Commit 202f32a0 authored by shangtx's avatar shangtx

feat: 订单多次支付

parent 7f9e18b8
......@@ -217,7 +217,6 @@ public class ServiceOrderBizService extends AbstractMapper<ServiceOrder> {
int result = this.insertSelective(serviceOrder);
recordComponent.recordServiceOrderImg(serviceOrder, dto.getUrls());
// 记录流程
if (result == 1) {
recordComponent.recordProcess(serviceOrder.getId(), ServiceOrderStatusEnum.RESERVE.getStatus(), ServiceOrderStatusEnum.RESERVE.getMsg(), sourceEnum, null, null, null);
......@@ -228,14 +227,15 @@ public class ServiceOrderBizService extends AbstractMapper<ServiceOrder> {
public void paySuccess(String orderNo, String info) {
log.info("支付成功 orderNo: {}, info: {}", orderNo, info);
var no = orderNo.split("-")[0];
var order = selectOneByProperty("orderNo", no);
var order = selectOneByProperty("orderNo", orderNo);
order.setOrderStatus(ServiceOrderStatusEnum.PAY.getStatus());
order.setOrderStatus(order.getSkipWork() ? ServiceOrderStatusEnum.DISPATCH.getStatus() : ServiceOrderStatusEnum.PAY.getStatus());
order.setTotalPrice(order.getTotalPrice().add(order.getPrice()));
order.setPayNum(order.getPayNum() + 1);
int result = serviceOrderMapper.updateByPrimaryKeySelective(order);
// 通知客服
var logCondition = new ServiceOrderLog();
logCondition.setOrderId(order.getId());
......@@ -265,7 +265,8 @@ public class ServiceOrderBizService extends AbstractMapper<ServiceOrder> {
}
}
if (result == 1) {
recordComponent.recordProcess(order.getId(), ServiceOrderStatusEnum.PAY.getStatus(), ServiceOrderStatusEnum.PAY.getMsg(), ServiceOrderOpSourceEnum.MINI_APP, null, null, null);
var payMsg = String.format(ServiceOrderStatusEnum.PAY.getMsg(), order.getPrice());
recordComponent.recordProcess(order.getId(), ServiceOrderStatusEnum.PAY.getStatus(), payMsg, ServiceOrderOpSourceEnum.MINI_APP, null, null, null);
}
}
......@@ -316,7 +317,8 @@ public class ServiceOrderBizService extends AbstractMapper<ServiceOrder> {
var user = userMapper.selectByPrimaryKey(userId);
try {
var params = wechatNativePay.getPayParam("服务预约", order.getOrderNo(), order.getPrice(), notifyUrl,
String orderNo = order.getOrderNo() + "-" + order.getPayNum();
var params = wechatNativePay.getPayParam("服务预约", orderNo, order.getPrice(), notifyUrl,
user.getOpenId(), request);
return new OrderPayVO(params);
} catch (Exception e) {
......@@ -425,12 +427,13 @@ public class ServiceOrderBizService extends AbstractMapper<ServiceOrder> {
/**
* 获取各个状态(前端状态)下的待办数量
*
* @param userId
* @return
*/
public Map<Integer, Integer> getTodoNum(Long userId) {
User user = userMapper.selectByPrimaryKey(userId);
if(!ServiceUserTypeEnum.ADMIN.getId().equals(user.getRoleType())) {
if (!ServiceUserTypeEnum.ADMIN.getId().equals(user.getRoleType())) {
return Map.of(1, 0, 3, 0, 4, 0, 5, 0, 6, 0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment