消息中心
This commit is contained in:
@@ -0,0 +1,51 @@
|
|||||||
|
package com.czg.controller.user;
|
||||||
|
|
||||||
|
import com.czg.account.dto.AcUserMsgDTO;
|
||||||
|
import com.czg.account.service.AcUserMsgService;
|
||||||
|
import com.czg.resp.CzgResult;
|
||||||
|
import com.mybatisflex.core.paginate.Page;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户端/用户消息
|
||||||
|
*
|
||||||
|
* @author yjjie
|
||||||
|
* @date 2025/12/9 19:17
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/user/msg")
|
||||||
|
public class UserMsgController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AcUserMsgService acUserMsgService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取未读消息数量
|
||||||
|
*/
|
||||||
|
@GetMapping("/unReadCount")
|
||||||
|
public CzgResult<Long> getUnReadCount() {
|
||||||
|
return CzgResult.success(acUserMsgService.getUnReadCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户消息列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/page")
|
||||||
|
public CzgResult<Page<AcUserMsgDTO>> getUserMsgPage() {
|
||||||
|
return CzgResult.success(acUserMsgService.getUserMsgPage());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单 Id 获取消息列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/order/{orderId}")
|
||||||
|
public CzgResult<List<AcUserMsgDTO>> getMsgListByOrderId(@PathVariable Long orderId) {
|
||||||
|
return CzgResult.success(acUserMsgService.getMsgListByOrderId(orderId));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
|
||||||
|
package com.czg.account.dto;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.fastjson2.annotation.JSONField;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import java.io.Serial;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实体类。
|
||||||
|
*
|
||||||
|
* @author gyj
|
||||||
|
* @since 2025-12-09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AcUserMsgDTO implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户 Id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺 Id
|
||||||
|
*/
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源 Id;如订单 Id
|
||||||
|
*/
|
||||||
|
private Long sourceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源类型:order 订单
|
||||||
|
*/
|
||||||
|
private String sourceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息类型:cash 现金,points 积分
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息读取状态:0 未读,1 已读
|
||||||
|
*/
|
||||||
|
private Integer readStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息标题
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息内容
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
package com.czg.account.entity;
|
||||||
|
|
||||||
|
import com.mybatisflex.annotation.Column;
|
||||||
|
import com.mybatisflex.annotation.Id;
|
||||||
|
import com.mybatisflex.annotation.KeyType;
|
||||||
|
import com.mybatisflex.annotation.Table;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实体类。
|
||||||
|
*
|
||||||
|
* @author gyj
|
||||||
|
* @since 2025-12-09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Table("ac_user_msg")
|
||||||
|
public class AcUserMsg implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@Id(keyType = KeyType.Auto)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户 Id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 店铺 Id
|
||||||
|
*/
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源 Id;如订单 Id
|
||||||
|
*/
|
||||||
|
private Long sourceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源类型:order 订单
|
||||||
|
*/
|
||||||
|
private String sourceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息类型:cash 现金,points 积分
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息读取状态:0 未读,1 已读
|
||||||
|
*/
|
||||||
|
private Integer readStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息标题
|
||||||
|
*/
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息内容
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(onInsertValue = "now()")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.czg.account.service;
|
||||||
|
|
||||||
|
import com.czg.account.dto.AcUserMsgDTO;
|
||||||
|
import com.czg.account.entity.AcUserMsg;
|
||||||
|
import com.mybatisflex.core.paginate.Page;
|
||||||
|
import com.mybatisflex.core.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务层。
|
||||||
|
*
|
||||||
|
* @author gyj
|
||||||
|
* @since 2025-12-09
|
||||||
|
*/
|
||||||
|
public interface AcUserMsgService extends IService<AcUserMsg> {
|
||||||
|
|
||||||
|
void addUserMsg(AcUserMsg msg);
|
||||||
|
|
||||||
|
Long getUnReadCount();
|
||||||
|
|
||||||
|
Page<AcUserMsgDTO> getUserMsgPage();
|
||||||
|
|
||||||
|
List<AcUserMsgDTO> getMsgListByOrderId(Long orderId);
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.czg.market.service;
|
package com.czg.market.service;
|
||||||
|
|
||||||
import com.mybatisflex.core.service.IService;
|
|
||||||
import com.czg.market.entity.MkConsumeCashbackRecord;
|
import com.czg.market.entity.MkConsumeCashbackRecord;
|
||||||
|
import com.mybatisflex.core.service.IService;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|||||||
@@ -47,5 +47,5 @@ public interface MkPointsUserService extends IService<MkPointsUser> {
|
|||||||
* 积分抵扣账单
|
* 积分抵扣账单
|
||||||
*/
|
*/
|
||||||
Long alterPoints(Long userId, Long shopUserId, @NotNull Long shopId, @NotNull PointsConstant floatType,
|
Long alterPoints(Long userId, Long shopUserId, @NotNull Long shopId, @NotNull PointsConstant floatType,
|
||||||
@NotNull Integer points, String sourceId, @NotBlank String reason);
|
@NotNull Integer points, Long sourceId, @NotBlank String reason);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.czg.service.account.mapper;
|
||||||
|
|
||||||
|
import com.mybatisflex.core.BaseMapper;
|
||||||
|
import com.czg.account.entity.AcUserMsg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 映射层。
|
||||||
|
*
|
||||||
|
* @author gyj
|
||||||
|
* @since 2025-12-09
|
||||||
|
*/
|
||||||
|
public interface AcUserMsgMapper extends BaseMapper<AcUserMsg> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.czg.service.account.service.impl;
|
||||||
|
|
||||||
|
import com.czg.account.dto.AcUserMsgDTO;
|
||||||
|
import com.czg.account.entity.AcUserMsg;
|
||||||
|
import com.czg.account.service.AcUserMsgService;
|
||||||
|
import com.czg.sa.StpKit;
|
||||||
|
import com.czg.service.account.mapper.AcUserMsgMapper;
|
||||||
|
import com.czg.utils.PageUtil;
|
||||||
|
import com.mybatisflex.core.paginate.Page;
|
||||||
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
|
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务层实现。
|
||||||
|
*
|
||||||
|
* @author gyj
|
||||||
|
* @since 2025-12-09
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AcUserMsgServiceImpl extends ServiceImpl<AcUserMsgMapper, AcUserMsg> implements AcUserMsgService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addUserMsg(AcUserMsg msg) {
|
||||||
|
save(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getUnReadCount() {
|
||||||
|
return count(QueryWrapper.create().eq(AcUserMsg::getReadStatus, 0).eq(AcUserMsg::getUserId, StpKit.USER.getLoginIdAsLong()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<AcUserMsgDTO> getUserMsgPage() {
|
||||||
|
return pageAs(PageUtil.buildPage(), QueryWrapper.create().eq(AcUserMsg::getUserId,
|
||||||
|
StpKit.USER.getLoginIdAsLong()).orderBy(AcUserMsg::getCreateTime, false), AcUserMsgDTO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AcUserMsgDTO> getMsgListByOrderId(Long orderId) {
|
||||||
|
return listAs(QueryWrapper.create().eq(AcUserMsg::getSourceId, orderId).eq(AcUserMsg::getSourceType, "order"),
|
||||||
|
AcUserMsgDTO.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.czg.service.account.mapper.AcUserMsgMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -30,12 +30,12 @@ public class Main {
|
|||||||
|
|
||||||
|
|
||||||
// String packageName = "system";
|
// String packageName = "system";
|
||||||
// String packageName = "account";
|
String packageName = "account";
|
||||||
// String packageName = "product";
|
// String packageName = "product";
|
||||||
String packageName = "market";
|
// String packageName = "market";
|
||||||
// tableName 指定需要生成的表
|
// tableName 指定需要生成的表
|
||||||
String tableName = "mk_ocr";
|
String tableName = "ac_user_msg";
|
||||||
String author = "zs";
|
String author = "gyj";
|
||||||
//是否生成DTO实体 默认生成
|
//是否生成DTO实体 默认生成
|
||||||
boolean isGenerateDto = true;
|
boolean isGenerateDto = true;
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.czg.account.dto.shopuser.ShopUserMoneyEditDTO;
|
import com.czg.account.dto.shopuser.ShopUserMoneyEditDTO;
|
||||||
|
import com.czg.account.entity.AcUserMsg;
|
||||||
import com.czg.account.entity.ShopInfo;
|
import com.czg.account.entity.ShopInfo;
|
||||||
import com.czg.account.entity.ShopUser;
|
import com.czg.account.entity.ShopUser;
|
||||||
|
import com.czg.account.service.AcUserMsgService;
|
||||||
import com.czg.account.service.ShopConfigService;
|
import com.czg.account.service.ShopConfigService;
|
||||||
import com.czg.account.service.ShopInfoService;
|
import com.czg.account.service.ShopInfoService;
|
||||||
import com.czg.account.service.ShopUserService;
|
import com.czg.account.service.ShopUserService;
|
||||||
@@ -63,6 +65,9 @@ public class MkConsumeCashbackServiceImpl extends ServiceImpl<MkConsumeCashbackM
|
|||||||
@Resource
|
@Resource
|
||||||
private MkConsumeCashbackRecordService consumeCashbackRecordService;
|
private MkConsumeCashbackRecordService consumeCashbackRecordService;
|
||||||
|
|
||||||
|
@DubboReference
|
||||||
|
private AcUserMsgService acUserMsgService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(key = "#shopId")
|
@Cacheable(key = "#shopId")
|
||||||
public MkConsumeCashbackVO detail(Long shopId) {
|
public MkConsumeCashbackVO detail(Long shopId) {
|
||||||
@@ -156,6 +161,10 @@ public class MkConsumeCashbackServiceImpl extends ServiceImpl<MkConsumeCashbackM
|
|||||||
.setRelationId(mkConsumeCashbackRecord.getId()).setMoney(cashbackAmount).setBizEnum(ShopUserFlowBizEnum.CASHBACK)
|
.setRelationId(mkConsumeCashbackRecord.getId()).setMoney(cashbackAmount).setBizEnum(ShopUserFlowBizEnum.CASHBACK)
|
||||||
.setRemark(StrUtil.format("订单消费: {}, 返现: {}", amount, cashbackAmount)));
|
.setRemark(StrUtil.format("订单消费: {}, 返现: {}", amount, cashbackAmount)));
|
||||||
log.info("订单返现 订单ID:{}, 店铺用户id: {}, 订单消费: {}, 返现: {}",orderId, shopUser.getId(), amount, cashbackAmount);
|
log.info("订单返现 订单ID:{}, 店铺用户id: {}, 订单消费: {}, 返现: {}",orderId, shopUser.getId(), amount, cashbackAmount);
|
||||||
|
|
||||||
|
AcUserMsg msg = new AcUserMsg().setUserId(userId).setShopId(shopId).setSourceId(orderId).setSourceType("order")
|
||||||
|
.setType("cash").setTitle("返现通知").setContent(StrUtil.format("订单: {}, 返现: {}", orderNo, cashbackAmount));
|
||||||
|
acUserMsgService.addUserMsg(msg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,6 @@ public class MkPointsConfigServiceImpl extends ServiceImpl<MkPointsConfigMapper,
|
|||||||
}
|
}
|
||||||
BigDecimal awardPoints = NumberUtil.roundDown(NumberUtil.div(payAmount, consumeAmount), 0);
|
BigDecimal awardPoints = NumberUtil.roundDown(NumberUtil.div(payAmount, consumeAmount), 0);
|
||||||
mkPointsUserService.alterPoints(null, shopUserId, orderInfo.getShopId(), PointsConstant.ADD,
|
mkPointsUserService.alterPoints(null, shopUserId, orderInfo.getShopId(), PointsConstant.ADD,
|
||||||
awardPoints.intValue(), orderInfo.getId().toString(), StrUtil.format("消费¥{}送{}积分", payAmount, awardPoints.intValue()));
|
awardPoints.intValue(), orderInfo.getId(), StrUtil.format("消费¥{}送{}积分", payAmount, awardPoints.intValue()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package com.czg.service.market.service.impl;
|
package com.czg.service.market.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.czg.account.entity.AcUserMsg;
|
||||||
import com.czg.account.entity.ShopInfo;
|
import com.czg.account.entity.ShopInfo;
|
||||||
import com.czg.account.entity.ShopUser;
|
import com.czg.account.entity.ShopUser;
|
||||||
|
import com.czg.account.service.AcUserMsgService;
|
||||||
import com.czg.account.service.ShopInfoService;
|
import com.czg.account.service.ShopInfoService;
|
||||||
import com.czg.account.service.ShopUserService;
|
import com.czg.account.service.ShopUserService;
|
||||||
import com.czg.account.vo.PointsShopListVO;
|
import com.czg.account.vo.PointsShopListVO;
|
||||||
@@ -40,6 +42,9 @@ public class MkPointsUserServiceImpl extends ServiceImpl<MkPointsUserMapper, MkP
|
|||||||
@Resource
|
@Resource
|
||||||
private MkPointsUserRecordService pointsUserRecordService;
|
private MkPointsUserRecordService pointsUserRecordService;
|
||||||
|
|
||||||
|
@DubboReference
|
||||||
|
private AcUserMsgService acUserMsgService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<MkPointsUserDTO> getPointsUserPage(String phone, Integer page, Integer size) {
|
public Page<MkPointsUserDTO> getPointsUserPage(String phone, Integer page, Integer size) {
|
||||||
Long shopUserId = null;
|
Long shopUserId = null;
|
||||||
@@ -110,7 +115,7 @@ public class MkPointsUserServiceImpl extends ServiceImpl<MkPointsUserMapper, MkP
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long alterPoints(Long userId, Long shopUserId, Long shopId, PointsConstant floatType, Integer points, String sourceId, String reason) {
|
public Long alterPoints(Long userId, Long shopUserId, Long shopId, PointsConstant floatType, Integer points, Long sourceId, String reason) {
|
||||||
MkPointsUser pointsUser = getPointsUser(shopId, shopUserId, userId);
|
MkPointsUser pointsUser = getPointsUser(shopId, shopUserId, userId);
|
||||||
if (floatType == null) {
|
if (floatType == null) {
|
||||||
throw new CzgException("积分变动类型不能为空");
|
throw new CzgException("积分变动类型不能为空");
|
||||||
@@ -134,13 +139,25 @@ public class MkPointsUserServiceImpl extends ServiceImpl<MkPointsUserMapper, MkP
|
|||||||
.mkPointsUserId(pointsUser.getId())
|
.mkPointsUserId(pointsUser.getId())
|
||||||
.floatType(floatType.getValue())
|
.floatType(floatType.getValue())
|
||||||
.floatPoints(points)
|
.floatPoints(points)
|
||||||
.sourceId(sourceId)
|
.sourceId(sourceId.toString())
|
||||||
.content(reason)
|
.content(reason)
|
||||||
.build();
|
.build();
|
||||||
boolean save = pointsUserRecordService.save(record);
|
boolean save = pointsUserRecordService.save(record);
|
||||||
if (!save) {
|
if (!save) {
|
||||||
throw new CzgException("积分操作失败,积分记录保存失败");
|
throw new CzgException("积分操作失败,积分记录保存失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AcUserMsg msg = new AcUserMsg()
|
||||||
|
.setUserId(userId)
|
||||||
|
.setShopId(shopId)
|
||||||
|
.setSourceId(sourceId)
|
||||||
|
.setSourceType("order")
|
||||||
|
.setType("points")
|
||||||
|
.setReadStatus(0)
|
||||||
|
.setTitle("积分变动")
|
||||||
|
.setContent(StrUtil.format("支付订单,{} 积分已入账", points));
|
||||||
|
acUserMsgService.addUserMsg(msg);
|
||||||
|
|
||||||
return record.getId();
|
return record.getId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ public class MkShopRechargeServiceImpl extends ServiceImpl<MkShopRechargeMapper,
|
|||||||
|
|
||||||
// 发放积分
|
// 发放积分
|
||||||
if (rechargeDetail.getRewardPoints() != null) {
|
if (rechargeDetail.getRewardPoints() != null) {
|
||||||
pointsUserService.alterPoints(null, shopUserId, shopUser.getMainShopId(), PointsConstant.ADD, rechargeDetail.getRewardPoints(), editId.toString(), "会员充值送积分");
|
pointsUserService.alterPoints(null, shopUserId, shopUser.getMainShopId(), PointsConstant.ADD, rechargeDetail.getRewardPoints(), editId, "会员充值送积分");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 发放优惠券
|
// 发放优惠券
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ public class TbMemberConfigServiceImpl extends ServiceImpl<TbMemberConfigMapper,
|
|||||||
int points = (int) (money.floatValue() / levelVO.getCostRewardPoints());
|
int points = (int) (money.floatValue() / levelVO.getCostRewardPoints());
|
||||||
log.info("消费送积分: {}", points);
|
log.info("消费送积分: {}", points);
|
||||||
if (points > 0) {
|
if (points > 0) {
|
||||||
pointsUserService.alterPoints(null, shopUser.getId(), shopUser.getMainShopId(), PointsConstant.ADD, points, sourceId.toString(), "会员消费送积分");
|
pointsUserService.alterPoints(null, shopUser.getId(), shopUser.getMainShopId(), PointsConstant.ADD, points, sourceId, "会员消费送积分");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -333,7 +333,7 @@ public class TbMemberConfigServiceImpl extends ServiceImpl<TbMemberConfigMapper,
|
|||||||
if (levelVO.getIsCycleReward() == 1) {
|
if (levelVO.getIsCycleReward() == 1) {
|
||||||
if (levelVO.getCycleRewardPoints() != null) {
|
if (levelVO.getCycleRewardPoints() != null) {
|
||||||
int points = levelVO.getCycleRewardPoints();
|
int points = levelVO.getCycleRewardPoints();
|
||||||
pointsUserService.alterPoints(null, shopUser.getId(), shopUser.getMainShopId(), PointsConstant.ADD, points, sourceId.toString(), "会员周奖励");
|
pointsUserService.alterPoints(null, shopUser.getId(), shopUser.getMainShopId(), PointsConstant.ADD, points, sourceId, "会员周奖励");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (levelVO.getCycleRewardCouponList() != null && !levelVO.getCycleRewardCouponList().isEmpty()) {
|
if (levelVO.getCycleRewardCouponList() != null && !levelVO.getCycleRewardCouponList().isEmpty()) {
|
||||||
|
|||||||
@@ -1265,7 +1265,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
//积分使用
|
//积分使用
|
||||||
if (orderInfo.getPointsNum() != null && orderInfo.getPointsNum() > 0) {
|
if (orderInfo.getPointsNum() != null && orderInfo.getPointsNum() > 0) {
|
||||||
pointsUserService.alterPoints(null, shopUser.getId(), orderInfo.getShopId(), PointsConstant.SUB,
|
pointsUserService.alterPoints(null, shopUser.getId(), orderInfo.getShopId(), PointsConstant.SUB,
|
||||||
orderInfo.getPointsNum(), orderInfo.getId().toString(), "积分抵扣账单");
|
orderInfo.getPointsNum(), orderInfo.getId(), "积分抵扣账单");
|
||||||
|
|
||||||
}
|
}
|
||||||
//更新优惠券信息
|
//更新优惠券信息
|
||||||
@@ -1289,8 +1289,6 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
|| (payType != null && !ArrayUtil.contains(payTypes, payType))) {
|
|| (payType != null && !ArrayUtil.contains(payTypes, payType))) {
|
||||||
//下单赠送积分
|
//下单赠送积分
|
||||||
pointsConfigService.consumeAwardPoints(shopUser.getId(), orderInfo);
|
pointsConfigService.consumeAwardPoints(shopUser.getId(), orderInfo);
|
||||||
// pointsUserService.alterPoints(null, shopUser.getId(), orderInfo.getShopId(), PointsConstant.ADD,
|
|
||||||
// rechargeDetail.getRewardPoints(), orderInfo.getId(), "下单赠送积分");
|
|
||||||
|
|
||||||
//消费返现
|
//消费返现
|
||||||
if (!orderInfo.getPayType().equals(PayEnums.CASH_PAY.getValue())) {
|
if (!orderInfo.getPayType().equals(PayEnums.CASH_PAY.getValue())) {
|
||||||
@@ -1505,7 +1503,7 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
|
|||||||
//积分使用
|
//积分使用
|
||||||
if (orderInfo.getPointsNum() != null && orderInfo.getPointsNum() > 0) {
|
if (orderInfo.getPointsNum() != null && orderInfo.getPointsNum() > 0) {
|
||||||
pointsUserService.alterPoints(null, shopUser.getId(), orderInfo.getShopId(), PointsConstant.ADD,
|
pointsUserService.alterPoints(null, shopUser.getId(), orderInfo.getShopId(), PointsConstant.ADD,
|
||||||
orderInfo.getPointsNum(), orderInfo.getId().toString(), "积分抵扣账单");
|
orderInfo.getPointsNum(), orderInfo.getId(), "积分抵扣账单");
|
||||||
}
|
}
|
||||||
//更新优惠券信息
|
//更新优惠券信息
|
||||||
if (StrUtil.isNotBlank(orderInfo.getCouponInfoList()) && !"null".equals(orderInfo.getCouponInfoList())) {
|
if (StrUtil.isNotBlank(orderInfo.getCouponInfoList()) && !"null".equals(orderInfo.getCouponInfoList())) {
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ public class PointsGoodPayServiceImpl implements PointsGoodPayService {
|
|||||||
if (record.getSpendPoints() != null && record.getSpendPoints() > 0) {
|
if (record.getSpendPoints() != null && record.getSpendPoints() > 0) {
|
||||||
//回增积分
|
//回增积分
|
||||||
pointsUserService.alterPoints(record.getUserId(), record.getShopUserId(), record.getShopId(), PointsConstant.ADD,
|
pointsUserService.alterPoints(record.getUserId(), record.getShopUserId(), record.getShopId(), PointsConstant.ADD,
|
||||||
record.getSpendPoints(), record.getId().toString(), "积分商品兑换退款");
|
record.getSpendPoints(), record.getId(), "积分商品兑换退款");
|
||||||
}
|
}
|
||||||
//退钱
|
//退钱
|
||||||
if (record.getExtraPaymentAmount() != null && record.getExtraPaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
|
if (record.getExtraPaymentAmount() != null && record.getExtraPaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
|
||||||
@@ -147,7 +147,7 @@ public class PointsGoodPayServiceImpl implements PointsGoodPayService {
|
|||||||
}
|
}
|
||||||
//扣除积分
|
//扣除积分
|
||||||
pointsUserService.alterPoints(record.getUserId(), null, record.getShopId(), PointsConstant.SUB,
|
pointsUserService.alterPoints(record.getUserId(), null, record.getShopId(), PointsConstant.SUB,
|
||||||
record.getSpendPoints(), record.getId().toString(), "积分商品兑换");
|
record.getSpendPoints(), record.getId(), "积分商品兑换");
|
||||||
record.setIsDel(0);
|
record.setIsDel(0);
|
||||||
if (goods.getGoodsCategory().equals("优惠券")) {
|
if (goods.getGoodsCategory().equals("优惠券")) {
|
||||||
record.setStatus("已完成");
|
record.setStatus("已完成");
|
||||||
|
|||||||
Reference in New Issue
Block a user