优化
This commit is contained in:
@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.framework.pay.core.client.PayClient;
|
||||
import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderRespDTO;
|
||||
@ -13,10 +14,12 @@ import cn.iocoder.yudao.framework.pay.core.enums.divide.PayDivideRefundStatusRes
|
||||
import cn.iocoder.yudao.framework.pay.core.enums.refund.PayRefundStatusRespEnum;
|
||||
import cn.iocoder.yudao.module.member.api.activitypay.ActivityApi;
|
||||
import cn.iocoder.yudao.module.member.api.activitypay.dto.ActivityPayDTO;
|
||||
import cn.iocoder.yudao.module.member.api.activitypay.dto.MenuDTO;
|
||||
import cn.iocoder.yudao.module.member.api.card.CardApi;
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.notify.vo.PayNotifyTaskDetailRespVO;
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.notify.vo.PayNotifyTaskPageReqVO;
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.notify.vo.PayNotifyTaskRespVO;
|
||||
import cn.iocoder.yudao.module.pay.controller.admin.order.vo.MenuVO;
|
||||
import cn.iocoder.yudao.module.pay.convert.notify.PayNotifyTaskConvert;
|
||||
import cn.iocoder.yudao.module.pay.dal.dataobject.app.PayAppDO;
|
||||
import cn.iocoder.yudao.module.pay.dal.dataobject.notify.PayNotifyLogDO;
|
||||
@ -32,6 +35,7 @@ import cn.iocoder.yudao.module.pay.service.notify.PayNotifyService;
|
||||
import cn.iocoder.yudao.module.pay.service.order.PayOrderService;
|
||||
import cn.iocoder.yudao.module.pay.service.refund.PayRefundService;
|
||||
import cn.iocoder.yudao.module.pay.service.wxprofitsharing.WxProfitsharingService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@ -143,7 +147,7 @@ public class PayNotifyController {
|
||||
|
||||
ActivityPayDTO activityPayDTO = new ActivityPayDTO();
|
||||
activityPayDTO.setActivityId(Long.valueOf(deserializedMap.get("activityId")));
|
||||
activityPayDTO.setSerialNumbers(deserializedMap.get("serialNumbers"));
|
||||
// activityPayDTO.setSerialNumbers(deserializedMap.get("serialNumbers"));
|
||||
activityPayDTO.setPrice(new BigDecimal(deserializedMap.get("price")).divide(new BigDecimal("100"), 2, RoundingMode.HALF_UP));
|
||||
activityPayDTO.setUserId(Long.valueOf(deserializedMap.get("userId")));
|
||||
activityPayDTO.setStatus(deserializedMap.get("status"));
|
||||
@ -154,6 +158,13 @@ public class PayNotifyController {
|
||||
activityPayDTO.setTransactionId( notify.getChannelOrderNo());
|
||||
activityPayDTO.setOpenid(deserializedMap.get("openid"));
|
||||
|
||||
String s = deserializedMap.get("menuList");
|
||||
if(StringUtils.isNotBlank(s)){
|
||||
List<MenuVO> menuVOS = JSON.parseArray(s, MenuVO.class);
|
||||
List<MenuDTO> bean = BeanUtils.toBean(menuVOS, MenuDTO.class);
|
||||
activityPayDTO.setMenu(bean);
|
||||
}
|
||||
|
||||
activityApi.createActivityPay(activityPayDTO);
|
||||
notifyRedisTemplate.delete("RESERVED" + notify.getOutTradeNo());
|
||||
}
|
||||
|
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.pay.controller.admin.order.vo;
|
||||
|
||||
|
||||
public class MenuVO {
|
||||
|
||||
private String serialNumbers;
|
||||
|
||||
private Long menuId;
|
||||
|
||||
private String menuName;
|
||||
|
||||
public String getSerialNumbers() {
|
||||
return serialNumbers;
|
||||
}
|
||||
|
||||
public void setSerialNumbers(String serialNumbers) {
|
||||
this.serialNumbers = serialNumbers;
|
||||
}
|
||||
|
||||
public Long getMenuId() {
|
||||
return menuId;
|
||||
}
|
||||
|
||||
public void setMenuId(Long menuId) {
|
||||
this.menuId = menuId;
|
||||
}
|
||||
|
||||
public String getMenuName() {
|
||||
return menuName;
|
||||
}
|
||||
|
||||
public void setMenuName(String menuName) {
|
||||
this.menuName = menuName;
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ import org.hibernate.validator.constraints.URL;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 支付订单提交 Request VO")
|
||||
@ -45,4 +46,6 @@ public class PayOrderSubmitReqVO {
|
||||
private String diningPeriod;
|
||||
|
||||
private Long voucherId;
|
||||
|
||||
private List<MenuVO> menuList;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.pay.service.order;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
@ -178,7 +179,6 @@ public class PayOrderServiceImpl implements PayOrderService {
|
||||
HashMap<String, String> stringStringHashMap = new HashMap<>();
|
||||
stringStringHashMap.put("activityId",reqVO.getActivityId().toString());
|
||||
stringStringHashMap.put("userId",getLoginUserId().toString());
|
||||
stringStringHashMap.put("serialNumbers",reqVO.getSerialNumbers());
|
||||
stringStringHashMap.put("price",unifiedOrderReqDTO.getPrice().toString());
|
||||
stringStringHashMap.put("status",reqVO.getStatus());
|
||||
stringStringHashMap.put("reserveTime",reqVO.getReserveTime());
|
||||
@ -188,6 +188,13 @@ public class PayOrderServiceImpl implements PayOrderService {
|
||||
if(reqVO.getVoucherId()!=null){
|
||||
stringStringHashMap.put("voucherId",reqVO.getVoucherId().toString());
|
||||
}
|
||||
if(reqVO.getSerialNumbers()!=null){
|
||||
stringStringHashMap.put("serialNumbers",reqVO.getSerialNumbers());
|
||||
}
|
||||
if(CollectionUtil.isNotEmpty(reqVO.getMenuList())){
|
||||
stringStringHashMap.put("menuList", JSONUtil.toJsonStr(reqVO.getMenuList()));
|
||||
}
|
||||
|
||||
|
||||
payRedis.opsForValue().set("RESERVED"+unifiedOrderReqDTO.getOutTradeNo()
|
||||
, JSONUtil.toJsonStr(stringStringHashMap));
|
||||
|
Reference in New Issue
Block a user