|
@@ -353,7 +353,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
|
@TradeOrderLog(operateType = TradeOrderOperateTypeEnum.ADMIN_DELIVERY)
|
|
@TradeOrderLog(operateType = TradeOrderOperateTypeEnum.ADMIN_DELIVERY)
|
|
public void deliveryOrder(TradeOrderDeliveryReqVO deliveryReqVO) {
|
|
public void deliveryOrder(TradeOrderDeliveryReqVO deliveryReqVO) {
|
|
//校验发货信息不能都为空
|
|
//校验发货信息不能都为空
|
|
- if(deliveryReqVO.getLogisticsNo() == null && deliveryReqVO.getDeliveryRemark() == null){
|
|
|
|
|
|
+ if (deliveryReqVO.getLogisticsNo() == null && deliveryReqVO.getDeliveryRemark() == null) {
|
|
throw exception(ORDER_DELIVERY_DETAILS_IS_NULL);
|
|
throw exception(ORDER_DELIVERY_DETAILS_IS_NULL);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -390,10 +390,10 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
|
}
|
|
}
|
|
|
|
|
|
// 执行更新
|
|
// 执行更新
|
|
- if(deliveryReqVO.getDeliveryRemark() != null){
|
|
|
|
|
|
+ if (deliveryReqVO.getDeliveryRemark() != null) {
|
|
//如果是虚拟商品直接完成发货和签收
|
|
//如果是虚拟商品直接完成发货和签收
|
|
updateOrderObj.setStatus(TradeOrderStatusEnum.COMPLETED.getStatus()).setDeliveryTime(LocalDateTime.now()).setReceivingTime(LocalDateTime.now());
|
|
updateOrderObj.setStatus(TradeOrderStatusEnum.COMPLETED.getStatus()).setDeliveryTime(LocalDateTime.now()).setReceivingTime(LocalDateTime.now());
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
updateOrderObj.setStatus(TradeOrderStatusEnum.DELIVERED.getStatus()).setDeliveryTime(LocalDateTime.now());
|
|
updateOrderObj.setStatus(TradeOrderStatusEnum.DELIVERED.getStatus()).setDeliveryTime(LocalDateTime.now());
|
|
}
|
|
}
|
|
int updateCount = tradeOrderMapper.updateByIdAndStatus(order.getId(), order.getStatus(), updateOrderObj);
|
|
int updateCount = tradeOrderMapper.updateByIdAndStatus(order.getId(), order.getStatus(), updateOrderObj);
|
|
@@ -412,13 +412,18 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
|
//5.发送微信模板消息
|
|
//5.发送微信模板消息
|
|
List<String> params = new ArrayList<>();
|
|
List<String> params = new ArrayList<>();
|
|
params.add(order.getNo());
|
|
params.add(order.getNo());
|
|
- params.add(deliveryExpressService.getDeliveryNameById(order.getLogisticsId()));
|
|
|
|
- params.add(order.getLogisticsNo());
|
|
|
|
|
|
+ if (deliveryReqVO.getDeliveryRemark() != null) {
|
|
|
|
+ params.add("无");
|
|
|
|
+ params.add("-");
|
|
|
|
+ }else{
|
|
|
|
+ params.add(deliveryExpressService.getDeliveryNameById(order.getLogisticsId()));
|
|
|
|
+ params.add(order.getLogisticsNo());
|
|
|
|
+ }
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
params.add(LocalDateTime.now().format(formatter));
|
|
params.add(LocalDateTime.now().format(formatter));
|
|
params.add(tradeOrderItemMapper.getSupNameByOrderId(order.getId()));
|
|
params.add(tradeOrderItemMapper.getSupNameByOrderId(order.getId()));
|
|
wcChatMessageUtils.sendWcChatMessage(order.getUserId(), WcChatMessageTemplateIdEnum.ORDER_DELIVERY2.getTemplateId(),
|
|
wcChatMessageUtils.sendWcChatMessage(order.getUserId(), WcChatMessageTemplateIdEnum.ORDER_DELIVERY2.getTemplateId(),
|
|
- params, null,order.getUserId(), order.getId());
|
|
|
|
|
|
+ params, null, order.getUserId(), order.getId());
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -433,7 +438,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
|
|
|
|
|
// 设置订阅参数,包括回调URL和手机号
|
|
// 设置订阅参数,包括回调URL和手机号
|
|
SubscribeParameters subscribeParameters = new SubscribeParameters();
|
|
SubscribeParameters subscribeParameters = new SubscribeParameters();
|
|
- subscribeParameters.setCallbackurl("http://47.107.28.221:8001/admin-api/trade/order/callBackUrl?orderId="+order.getId());
|
|
|
|
|
|
+ subscribeParameters.setCallbackurl("http://47.107.28.221:8001/admin-api/trade/order/callBackUrl?orderId=" + order.getId());
|
|
subscribeParameters.setPhone(order.getReceiverMobile());
|
|
subscribeParameters.setPhone(order.getReceiverMobile());
|
|
//添加盐
|
|
//添加盐
|
|
subscribeParameters.setSalt(order.getLogisticsNo());
|
|
subscribeParameters.setSalt(order.getLogisticsNo());
|
|
@@ -460,13 +465,13 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
|
String returnCode = jsonObject.get("returnCode").getAsString();
|
|
String returnCode = jsonObject.get("returnCode").getAsString();
|
|
|
|
|
|
if (result && returnCode.equals("200")) {
|
|
if (result && returnCode.equals("200")) {
|
|
- log.info("订单号:{}:订阅成功",order.getNo());
|
|
|
|
|
|
+ log.info("订单号:{}:订阅成功", order.getNo());
|
|
|
|
|
|
order.setSubscriptionLogisticsInfo(TradeOrderSubscribeStatusEnum.SUBSCRIBE.getStatus());
|
|
order.setSubscriptionLogisticsInfo(TradeOrderSubscribeStatusEnum.SUBSCRIBE.getStatus());
|
|
- } else if(returnCode.equals("600") || returnCode.equals("601")) {
|
|
|
|
|
|
+ } else if (returnCode.equals("600") || returnCode.equals("601")) {
|
|
throw exception(NOT_SUFFICIENT_FUNDS);
|
|
throw exception(NOT_SUFFICIENT_FUNDS);
|
|
} else {
|
|
} else {
|
|
- log.info("订单号:{}:订阅失败原因:{}",order.getNo(),jsonObject);
|
|
|
|
|
|
+ log.info("订单号:{}:订阅失败原因:{}", order.getNo(), jsonObject);
|
|
|
|
|
|
order.setSubscriptionLogisticsInfo(TradeOrderSubscribeStatusEnum.abnormal.getStatus());
|
|
order.setSubscriptionLogisticsInfo(TradeOrderSubscribeStatusEnum.abnormal.getStatus());
|
|
}
|
|
}
|