|
@@ -1,6 +1,7 @@
|
|
|
package com.citu.module.menduner.system.service.redeem;
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.map.MapUtil;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
|
|
import com.citu.framework.common.pojo.PageResult;
|
|
|
import com.citu.framework.common.util.object.BeanUtils;
|
|
@@ -13,6 +14,8 @@ import com.citu.module.menduner.system.controller.base.redeem.RedeemSaveReqVO;
|
|
|
import com.citu.module.menduner.system.dal.dataobject.redeem.RedeemDO;
|
|
|
import com.citu.module.menduner.system.dal.mysql.redeem.RedeemMapper;
|
|
|
import com.citu.module.menduner.system.service.record.UserAccountRecordService;
|
|
|
+import com.citu.module.menduner.system.util.MessageUtils;
|
|
|
+import com.citu.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
@@ -21,6 +24,7 @@ import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
import static com.citu.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
+import static com.citu.module.menduner.common.enums.CommonConstants.NOTIFY_SYS_POINT_REDEEM;
|
|
|
import static com.citu.module.menduner.system.enums.ErrorCodeConstants.MDE_REQUEST_ILLEGAL;
|
|
|
import static com.citu.module.menduner.system.enums.ErrorCodeConstants.REDEEM_NOT_EXISTS;
|
|
|
|
|
@@ -41,6 +45,8 @@ public class RedeemServiceImpl implements RedeemService {
|
|
|
put("房券-高端酒店房券", 12000);
|
|
|
}};
|
|
|
@Resource
|
|
|
+ private MessageUtils messageUtils;
|
|
|
+ @Resource
|
|
|
private RedeemMapper redeemMapper;
|
|
|
@Resource
|
|
|
private UserAccountRecordService accountRecordService;
|
|
@@ -110,5 +116,21 @@ public class RedeemServiceImpl implements RedeemService {
|
|
|
PointBizTypeEnum.REDEEM,
|
|
|
redeem.getId().toString()
|
|
|
);
|
|
|
+
|
|
|
+ // 发送系统消息
|
|
|
+ messageUtils.sendSystemMessage(
|
|
|
+ new NotifySendSingleToUserReqDTO()
|
|
|
+ .setTemplateCode(NOTIFY_SYS_POINT_REDEEM)
|
|
|
+ .setTemplateParams(
|
|
|
+ // 假设MapUtil.builder()的API允许链式调用,并且返回的是Map.Builder类型
|
|
|
+ // 如果不是,你需要根据实际的API进行调整
|
|
|
+ MapUtil.<String, Object>builder() // 显式指定泛型类型可能更好
|
|
|
+ .put("1", redeem.getName())
|
|
|
+ .put("2", redeem.getPoint())
|
|
|
+ .put("3", redeem.getContactName())
|
|
|
+ .put("4", redeem.getContactPhone())
|
|
|
+ .build()
|
|
|
+ ));
|
|
|
+
|
|
|
}
|
|
|
}
|