init
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
package com.ruoyi.cai.controller;
|
package com.ruoyi.cai.controller.admin;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
@@ -26,15 +26,15 @@ import java.util.Arrays;
|
|||||||
* 守护赠送流水
|
* 守护赠送流水
|
||||||
*
|
*
|
||||||
* @author 77
|
* @author 77
|
||||||
* @date 2023-12-30
|
* @date 2023-12-31
|
||||||
*/
|
*/
|
||||||
@Validated
|
@Validated
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/cai/guardLog")
|
@RequestMapping("/cai/guardLog")
|
||||||
public class CaiGuardLogController extends BaseController {
|
public class GuardLogController extends BaseController {
|
||||||
|
|
||||||
private final GuardLogService iGuardLogService;
|
private final GuardLogService guardLogService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询守护赠送流水列表
|
* 查询守护赠送流水列表
|
||||||
@@ -42,10 +42,11 @@ public class CaiGuardLogController extends BaseController {
|
|||||||
@SaCheckPermission("cai:guardLog:list")
|
@SaCheckPermission("cai:guardLog:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<GuardLog> list(GuardLog bo, PageQuery pageQuery) {
|
public TableDataInfo<GuardLog> list(GuardLog bo, PageQuery pageQuery) {
|
||||||
Page<GuardLog> page = iGuardLogService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
Page<GuardLog> page = guardLogService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||||
return TableDataInfo.build(page);
|
return TableDataInfo.build(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取守护赠送流水详细信息
|
* 获取守护赠送流水详细信息
|
||||||
*
|
*
|
||||||
@@ -55,7 +56,7 @@ public class CaiGuardLogController extends BaseController {
|
|||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public R<GuardLog> getInfo(@NotNull(message = "主键不能为空")
|
public R<GuardLog> getInfo(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable Long id) {
|
@PathVariable Long id) {
|
||||||
return R.ok(iGuardLogService.getById(id));
|
return R.ok(guardLogService.getById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -66,7 +67,7 @@ public class CaiGuardLogController extends BaseController {
|
|||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody GuardLog bo) {
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody GuardLog bo) {
|
||||||
return toAjax(iGuardLogService.save(bo));
|
return toAjax(guardLogService.save(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -77,7 +78,7 @@ public class CaiGuardLogController extends BaseController {
|
|||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody GuardLog bo) {
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody GuardLog bo) {
|
||||||
return toAjax(iGuardLogService.updateById(bo));
|
return toAjax(guardLogService.updateById(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -90,6 +91,6 @@ public class CaiGuardLogController extends BaseController {
|
|||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
return toAjax(iGuardLogService.removeBatchByIds(Arrays.asList(ids), true));
|
return toAjax(guardLogService.removeBatchByIds(Arrays.asList(ids)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
package com.ruoyi.cai.controller.admin;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ruoyi.cai.domain.GuardTotal;
|
||||||
|
import com.ruoyi.cai.service.GuardTotalService;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户守护累计
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-31
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cai/guardTotal")
|
||||||
|
public class GuardTotalController extends BaseController {
|
||||||
|
|
||||||
|
private final GuardTotalService guardTotalService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户守护累计列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:guardTotal:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<GuardTotal> list(GuardTotal bo, PageQuery pageQuery) {
|
||||||
|
Page<GuardTotal> page = guardTotalService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||||
|
return TableDataInfo.build(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户守护累计详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:guardTotal:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<GuardTotal> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(guardTotalService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户守护累计
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:guardTotal:add")
|
||||||
|
@Log(title = "用户守护累计", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody GuardTotal bo) {
|
||||||
|
return toAjax(guardTotalService.save(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户守护累计
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:guardTotal:edit")
|
||||||
|
@Log(title = "用户守护累计", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody GuardTotal bo) {
|
||||||
|
return toAjax(guardTotalService.updateById(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户守护累计
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:guardTotal:remove")
|
||||||
|
@Log(title = "用户守护累计", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(guardTotalService.removeBatchByIds(Arrays.asList(ids)));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
package com.ruoyi.cai.controller.admin;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.ruoyi.cai.domain.UserGift;
|
||||||
|
import com.ruoyi.cai.service.UserGiftService;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.PageQuery;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.validate.AddGroup;
|
||||||
|
import com.ruoyi.common.core.validate.EditGroup;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 礼物流水
|
||||||
|
*
|
||||||
|
* @author 77
|
||||||
|
* @date 2023-12-31
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cai/userGift")
|
||||||
|
public class UserGiftController extends BaseController {
|
||||||
|
|
||||||
|
private final UserGiftService userGiftService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询礼物流水列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:userGift:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<UserGift> list(UserGift bo, PageQuery pageQuery) {
|
||||||
|
Page<UserGift> page = userGiftService.page(pageQuery.build(), Wrappers.lambdaQuery(bo).orderByDesc(UserGift::getCreateTime));
|
||||||
|
return TableDataInfo.build(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取礼物流水详细信息
|
||||||
|
*
|
||||||
|
* @param id 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:userGift:query")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public R<UserGift> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(userGiftService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增礼物流水
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:userGift:add")
|
||||||
|
@Log(title = "礼物流水", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody UserGift bo) {
|
||||||
|
return toAjax(userGiftService.save(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改礼物流水
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:userGift:edit")
|
||||||
|
@Log(title = "礼物流水", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody UserGift bo) {
|
||||||
|
return toAjax(userGiftService.updateById(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除礼物流水
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cai:userGift:remove")
|
||||||
|
@Log(title = "礼物流水", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
return toAjax(userGiftService.removeBatchByIds(Arrays.asList(ids)));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -46,9 +46,9 @@ public class CaiConsumeLog implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Long oneAmount;
|
private Long oneAmount;
|
||||||
/**
|
/**
|
||||||
* 二级金额
|
* 工会金额
|
||||||
*/
|
*/
|
||||||
private Long twoAmount;
|
private Long unionAmount;
|
||||||
/**
|
/**
|
||||||
* 平台金额
|
* 平台金额
|
||||||
*/
|
*/
|
||||||
@@ -125,7 +125,7 @@ public class CaiConsumeLog implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 状态 0-待计算分销 1-已计算分销
|
* 状态 0-待计算分销 1-已计算分销
|
||||||
*/
|
*/
|
||||||
private String calculateStatus;
|
private Boolean calculateStatus;
|
||||||
/**
|
/**
|
||||||
* 状态 -1-无须分销 0-待分销 1-已分销
|
* 状态 -1-无须分销 0-待分销 1-已分销
|
||||||
*/
|
*/
|
||||||
@@ -133,7 +133,7 @@ public class CaiConsumeLog implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 状态 0-否 1-是
|
* 状态 0-否 1-是
|
||||||
*/
|
*/
|
||||||
private String admin;
|
private Boolean admin;
|
||||||
/**
|
/**
|
||||||
* 管理员ID
|
* 管理员ID
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -28,14 +28,20 @@ public class GuardLog implements Serializable {
|
|||||||
* 女神
|
* 女神
|
||||||
*/
|
*/
|
||||||
private Long fromUserId;
|
private Long fromUserId;
|
||||||
|
private String fromUsercode;
|
||||||
|
private String fromMobile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 赠送人
|
* 赠送人
|
||||||
*/
|
*/
|
||||||
private Long toUserId;
|
private Long toUserId;
|
||||||
|
private String toUsercode;
|
||||||
|
private String toMobile;
|
||||||
/**
|
/**
|
||||||
* 赠送个数
|
* 赠送个数
|
||||||
*/
|
*/
|
||||||
private Long guardNum;
|
private Long guardNum;
|
||||||
|
private Long guardPrice;
|
||||||
/**
|
/**
|
||||||
* 守护值
|
* 守护值
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -28,10 +28,14 @@ public class GuardTotal implements Serializable {
|
|||||||
* 被守护人的user_id(大咖)
|
* 被守护人的user_id(大咖)
|
||||||
*/
|
*/
|
||||||
private Long fromUserId;
|
private Long fromUserId;
|
||||||
|
private String fromUsercode;
|
||||||
|
private String fromMobile;
|
||||||
/**
|
/**
|
||||||
* 守护人的user_id
|
* 守护人的user_id
|
||||||
*/
|
*/
|
||||||
private Long toUserId;
|
private Long toUserId;
|
||||||
|
private String toUsercode;
|
||||||
|
private String toMobile;
|
||||||
/**
|
/**
|
||||||
* 累计守护符个数
|
* 累计守护符个数
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -32,14 +32,21 @@ public class UserGift implements Serializable {
|
|||||||
* 赠送者
|
* 赠送者
|
||||||
*/
|
*/
|
||||||
private Long fromUid;
|
private Long fromUid;
|
||||||
|
private String fromUsercode;
|
||||||
|
private String fromMobile;
|
||||||
/**
|
/**
|
||||||
* 接受者
|
* 接受者
|
||||||
*/
|
*/
|
||||||
private Long toUid;
|
private Long toUid;
|
||||||
|
private String toUsercode;
|
||||||
|
private String toMobile;
|
||||||
/**
|
/**
|
||||||
* 礼物ID
|
* 礼物ID
|
||||||
*/
|
*/
|
||||||
private Long giftId;
|
private Long giftId;
|
||||||
|
private String giftImg;
|
||||||
|
private String giftName;
|
||||||
|
private Long giftPrice;
|
||||||
/**
|
/**
|
||||||
* 礼物数量
|
* 礼物数量
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface GuardTotalMapper extends BaseMapper<GuardTotal> {
|
public interface GuardTotalMapper extends BaseMapper<GuardTotal> {
|
||||||
|
|
||||||
List<GuardTotalDTO> selectGuardTotal(@Param("fromUserId") Long fromUserId, @Param("limit") Integer limit);
|
List<GuardTotalDTO> selectGuardTotal(@Param("toUserId") Long toUserId, @Param("limit") Integer limit);
|
||||||
|
|
||||||
void incs(@Param("fromUserId") Long fromUserId, @Param("toUserId") Long toUserId, @Param("guardNum") Long guardNum, @Param("guardValue") Long guardValue);
|
void incs(@Param("fromUserId") Long fromUserId, @Param("toUserId") Long toUserId, @Param("guardNum") Long guardNum, @Param("guardValue") Long guardValue);
|
||||||
|
|
||||||
Long guardCount(@Param("fromUserId") Long fromUserId);
|
Long guardCount(@Param("toUserId") Long toUserId);
|
||||||
Long guardPersonCount(@Param("fromUserId") Long fromUserId);
|
Long guardPersonCount(@Param("toUserId") Long toUserId);
|
||||||
|
|
||||||
Page<GuardListPageVo> userGuardPage(@Param("build") Page<Object> build, @Param("userId") Long userId);
|
Page<GuardListPageVo> userGuardPage(@Param("build") Page<Object> build, @Param("toUserId") Long toUserId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,4 +18,5 @@ public interface UserGiftMapper extends BaseMapper<UserGift> {
|
|||||||
List<UserGiftIndexVo> selectGiftList(@Param("userId") Long userId);
|
List<UserGiftIndexVo> selectGiftList(@Param("userId") Long userId);
|
||||||
|
|
||||||
long countGiftNum(@Param("fromUid") Long fromUid, @Param("toUid") Long toUid);
|
long countGiftNum(@Param("fromUid") Long fromUid, @Param("toUid") Long toUid);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,5 +23,5 @@ public interface GuardTotalService extends IService<GuardTotal> {
|
|||||||
|
|
||||||
GuardNum getGuardNum(Long fromUserId, Long toUserId);
|
GuardNum getGuardNum(Long fromUserId, Long toUserId);
|
||||||
|
|
||||||
Page<GuardListPageVo> userGuardPage(PageQuery pageQuery, Long userId);
|
Page<GuardListPageVo> userGuardPage(PageQuery pageQuery, Long toUserId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,4 +18,5 @@ public interface UserGiftService extends IService<UserGift> {
|
|||||||
List<UserGiftIndexVo> selectGiftList(Long userId);
|
List<UserGiftIndexVo> selectGiftList(Long userId);
|
||||||
|
|
||||||
boolean giveGift(GiveGiftRes query);
|
boolean giveGift(GiveGiftRes query);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,9 +96,14 @@ public class GuardTotalServiceImpl extends ServiceImpl<GuardTotalMapper, GuardTo
|
|||||||
consumeLog = accountService.decr(consumeLog);
|
consumeLog = accountService.decr(consumeLog);
|
||||||
GuardLog guardLog = new GuardLog();
|
GuardLog guardLog = new GuardLog();
|
||||||
guardLog.setFromUserId(fromUserId);
|
guardLog.setFromUserId(fromUserId);
|
||||||
|
guardLog.setFromUsercode(fromUser.getUsercode());
|
||||||
|
guardLog.setFromMobile(fromUser.getMobile());
|
||||||
guardLog.setToUserId(query.getToUserId());
|
guardLog.setToUserId(query.getToUserId());
|
||||||
|
guardLog.setToMobile(toUser.getMobile());
|
||||||
|
guardLog.setToUsercode(toUser.getUsercode());
|
||||||
guardLog.setGuardNum(query.getGuardNum());
|
guardLog.setGuardNum(query.getGuardNum());
|
||||||
guardLog.setGuardValue(guardPrice);
|
guardLog.setGuardValue(guardValue);
|
||||||
|
guardLog.setGuardPrice(guardPrice);
|
||||||
guardLog.setConsumeLogId(consumeLog.getId());
|
guardLog.setConsumeLogId(consumeLog.getId());
|
||||||
guardLogService.save(guardLog);
|
guardLogService.save(guardLog);
|
||||||
GuardTotal one = this.getOne(Wrappers.lambdaQuery(GuardTotal.class)
|
GuardTotal one = this.getOne(Wrappers.lambdaQuery(GuardTotal.class)
|
||||||
@@ -107,7 +112,11 @@ public class GuardTotalServiceImpl extends ServiceImpl<GuardTotalMapper, GuardTo
|
|||||||
if(one == null){
|
if(one == null){
|
||||||
one = new GuardTotal();
|
one = new GuardTotal();
|
||||||
one.setFromUserId(fromUserId);
|
one.setFromUserId(fromUserId);
|
||||||
|
one.setFromUsercode(fromUser.getUsercode());
|
||||||
|
one.setFromMobile(fromUser.getMobile());
|
||||||
one.setToUserId(query.getToUserId());
|
one.setToUserId(query.getToUserId());
|
||||||
|
one.setToMobile(toUser.getMobile());
|
||||||
|
one.setToUsercode(toUser.getUsercode());
|
||||||
this.save(one);
|
this.save(one);
|
||||||
}
|
}
|
||||||
baseMapper.incs(fromUserId,query.getToUserId(),query.getGuardNum(),guardValue);
|
baseMapper.incs(fromUserId,query.getToUserId(),query.getGuardNum(),guardValue);
|
||||||
@@ -136,7 +145,7 @@ public class GuardTotalServiceImpl extends ServiceImpl<GuardTotalMapper, GuardTo
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<GuardListPageVo> userGuardPage(PageQuery pageQuery,Long userId) {
|
public Page<GuardListPageVo> userGuardPage(PageQuery pageQuery,Long toUserId) {
|
||||||
return baseMapper.userGuardPage(pageQuery.build(),userId);
|
return baseMapper.userGuardPage(pageQuery.build(),toUserId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,8 +61,15 @@ public class UserGiftServiceImpl extends ServiceImpl<UserGiftMapper, UserGift> i
|
|||||||
UserGift userGift = new UserGift();
|
UserGift userGift = new UserGift();
|
||||||
userGift.setType(query.getType());
|
userGift.setType(query.getType());
|
||||||
userGift.setFromUid(fromUserId);
|
userGift.setFromUid(fromUserId);
|
||||||
|
userGift.setFromMobile(fromUser.getMobile());
|
||||||
|
userGift.setFromUsercode(fromUser.getUsercode());
|
||||||
userGift.setToUid(query.getToUserId());
|
userGift.setToUid(query.getToUserId());
|
||||||
|
userGift.setToMobile(toUser.getMobile());
|
||||||
|
userGift.setToUsercode(toUser.getUsercode());
|
||||||
userGift.setGiftId(query.getGiftId());
|
userGift.setGiftId(query.getGiftId());
|
||||||
|
userGift.setGiftName(gift.getName());
|
||||||
|
userGift.setGiftImg(gift.getImg());
|
||||||
|
userGift.setGiftPrice(gift.getPrice());
|
||||||
userGift.setGiftCount(query.getGiftCount());
|
userGift.setGiftCount(query.getGiftCount());
|
||||||
userGift.setGiftAmount(giftAmount);
|
userGift.setGiftAmount(giftAmount);
|
||||||
userGift.setConsumerLogId(consumeLog.getId());
|
userGift.setConsumerLogId(consumeLog.getId());
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="selectGuardTotal" resultType="com.ruoyi.cai.dto.app.dto.GuardTotalDTO">
|
<select id="selectGuardTotal" resultType="com.ruoyi.cai.dto.app.dto.GuardTotalDTO">
|
||||||
select t1.from_user_id,t1.to_user_id,t2.avatar,t1.guard_num
|
select t1.from_user_id,t1.to_user_id,t2.avatar,t1.guard_num
|
||||||
from cai_guard_total t1
|
from cai_guard_total t1
|
||||||
join cai_user t2 on t1.to_user_id = t2.id
|
join cai_user t2 on t1.from_user_id = t2.id
|
||||||
where t1.from_user_id = #{fromUserId}
|
where t1.to_user_id = #{toUserId}
|
||||||
order by guard_num desc
|
order by guard_num desc
|
||||||
<if test="limit != null">
|
<if test="limit != null">
|
||||||
limit #{limit}
|
limit #{limit}
|
||||||
@@ -32,20 +32,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="guardCount" resultType="java.lang.Long">
|
<select id="guardCount" resultType="java.lang.Long">
|
||||||
select ifnull(sum(guard_num),0)
|
select ifnull(sum(guard_num),0)
|
||||||
from cai_guard_total t1
|
from cai_guard_total t1
|
||||||
join cai_user t2 on t1.to_user_id = t2.id
|
join cai_user t2 on t1.from_user_id = t2.id
|
||||||
where t1.from_user_id = #{fromUserId}
|
where t1.to_user_id = #{toUserId}
|
||||||
</select>
|
</select>
|
||||||
<select id="guardPersonCount" resultType="java.lang.Long">
|
<select id="guardPersonCount" resultType="java.lang.Long">
|
||||||
select ifnull(count(1),0)
|
select ifnull(count(1),0)
|
||||||
from cai_guard_total t1
|
from cai_guard_total t1
|
||||||
join cai_user t2 on t1.to_user_id = t2.id
|
join cai_user t2 on t1.from_user_id = t2.id
|
||||||
where t1.from_user_id = #{fromUserId}
|
where t1.to_user_id = #{toUserId}
|
||||||
</select>
|
</select>
|
||||||
<select id="userGuardPage" resultType="com.ruoyi.cai.dto.app.vo.index.GuardListPageVo">
|
<select id="userGuardPage" resultType="com.ruoyi.cai.dto.app.vo.index.GuardListPageVo">
|
||||||
select t1.to_user_id as user_id, t2.nickname,t2.avatar,t2.usercode,t1.guard_num,t1.guard_value
|
select t1.from_user_id as user_id, t2.nickname,t2.avatar,t2.usercode,t1.guard_num,t1.guard_value
|
||||||
from cai_guard_total t1
|
from cai_guard_total t1
|
||||||
join cai_user t2 on t1.to_user_id = t2.id
|
join cai_user t2 on t1.from_user_id = t2.id
|
||||||
where t1.from_user_id = #{userId}
|
where t1.to_user_id = #{toUserId}
|
||||||
order by guard_num desc
|
order by guard_num desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user