修改--支付回调成功时,发送系统作品提交消息
This commit is contained in:
parent
9fb535d5b6
commit
c487fc2922
@ -44,6 +44,9 @@ public class PayBackController {
|
||||
@Autowired
|
||||
private IDailyUserService dailyUserService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserNotificationService sysUserNotificationService;
|
||||
|
||||
@Transactional
|
||||
@GetMapping("/wxRechargeCallback/{mchOrderNo}")
|
||||
public AjaxResult wxRechargeCallback(HttpServletRequest req, @PathVariable String mchOrderNo){
|
||||
@ -123,6 +126,10 @@ public class PayBackController {
|
||||
System.out.println("新订单id"+sysOrder1.getOrderId());
|
||||
|
||||
|
||||
// 系统消息提醒, 作品名, 资源位列表
|
||||
Map<String,List<String>> mapSource = new HashMap<>();
|
||||
// 系统消息提醒, 作品名, 作品Id
|
||||
Map<String,Long> mapId = new HashMap<>();
|
||||
|
||||
for(OrderCacheVo orderCacheVo : list){
|
||||
// System.out.println(orderCacheVo);
|
||||
@ -197,6 +204,17 @@ public class PayBackController {
|
||||
userWorkService.updateUserWork(userWork);
|
||||
|
||||
//--------------------------------------更新作品状态 旧版end----------------------------------------------------------
|
||||
|
||||
//--------------------------------------作品提交消息Map----------------------------------------------------------
|
||||
// 如果 key 不存在,自动创建空 List 并添加到 Map
|
||||
List<String> valueList = mapSource.computeIfAbsent(userWork.getWorkName(), k -> new ArrayList<>());
|
||||
// 添加资源位坐标
|
||||
String value = sysSource.getPart()+String.format("%2d", sysSource.getcX())+String.format("%2d", sysSource.getcY());
|
||||
valueList.add(value); // 直接添加到 List
|
||||
// 直接添加Id即可, 每个作品只对应一个Id
|
||||
mapId.put(userWork.getWorkName(),userWork.getWorkId());
|
||||
|
||||
//--------------------------------------作品提交消息Map end----------------------------------------------------------
|
||||
//------------------------------------------更新作品表 user_work 中的 work_status end-------------------------------
|
||||
|
||||
//---------------------------------------daily_source 中 资源位 b_bought+1-----------------------------------------
|
||||
@ -224,6 +242,28 @@ public class PayBackController {
|
||||
// 删除订单缓存数据
|
||||
redisCache.deleteObject(mchOrderNo);
|
||||
|
||||
// 添加作品提交消息, key为作品名称, value为资源位坐标
|
||||
for(String key : mapSource.keySet()){
|
||||
SysUserNotification sysUserNotification = new SysUserNotification();
|
||||
|
||||
// 接收消息的用户Id
|
||||
sysUserNotification.setUserId(list.get(0).getUserId());
|
||||
// 发送消息的用户Id, 这里就先默认是0.
|
||||
sysUserNotification.setSenderId(0L);
|
||||
// 目标Id--作品Id
|
||||
sysUserNotification.setTargetId(mapId.get(key));
|
||||
// 目标类型,8 作品提交消息.
|
||||
sysUserNotification.setTargetType("1");
|
||||
// 未读
|
||||
sysUserNotification.setStatus("0");
|
||||
// 消息详情
|
||||
String detail = String.format("尊敬的创作者,您提交的作品《%s》已成功进入审核流程。待审核通过后,作品将于 %s在 %s 区域同步展示。", key, list.get(0).getStartTime(), String.join("、 ", mapSource.get(key)));
|
||||
sysUserNotification.setDetail(detail);
|
||||
sysUserNotification.setType("8");
|
||||
|
||||
// 插入通知信息
|
||||
sysUserNotificationService.insertSysUserNotification(sysUserNotification);
|
||||
}
|
||||
|
||||
// 返回订单 order_id 和 订单详情的id,两者通过order_info_id关联.
|
||||
|
||||
|
||||
@ -7,15 +7,15 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
# url: jdbc:mysql://localhost:3306/wenlvapp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://localhost:3306/wenlvapp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
|
||||
# url: jdbc:mysql://172.17.0.7:3306/wenlvapp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # 腾讯云
|
||||
url: jdbc:mysql://172.17.0.3:3306/wenlvapp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # 火山云
|
||||
# url: jdbc:mysql://172.17.0.3:3306/wenlvapp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # 火山云
|
||||
# url: jdbc:mysql://localhost:3306/xingming?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://172.17.0.7:3306/wenlvapp?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
username: root
|
||||
# password: root
|
||||
password: dnxxkj
|
||||
password: root
|
||||
# password: dnxxkj
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
||||
@ -9,20 +9,20 @@ ruoyi:
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
# profile: D:/ruoyi/uploadPath
|
||||
##
|
||||
## # 保存身份证文件地址
|
||||
# idCardPath: D:/ruoyi/IdCard
|
||||
# domain: http://10.0.0.17:8081
|
||||
profile: D:/ruoyi/uploadPath
|
||||
#
|
||||
# # 保存身份证文件地址
|
||||
idCardPath: D:/ruoyi/IdCard
|
||||
domain: http://10.0.0.17:8081
|
||||
|
||||
# 腾讯云
|
||||
# domain: http://82.156.153.112:8081
|
||||
|
||||
# 火山云
|
||||
domain: http://14.103.162.172:8081
|
||||
|
||||
idCardPath: /home/IdCard
|
||||
profile: /home/uploadPath
|
||||
# domain: http://14.103.162.172:8081
|
||||
#
|
||||
# idCardPath: /home/IdCard
|
||||
# profile: /home/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
# 验证码类型 math 数组计算 char 字符验证
|
||||
@ -86,9 +86,9 @@ spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
# host: localhost
|
||||
host: localhost
|
||||
# host: 172.17.0.3 # 腾讯云
|
||||
host: 172.17.0.2 #火山云
|
||||
# host: 172.17.0.2 #火山云
|
||||
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
|
||||
Loading…
Reference in New Issue
Block a user