|
|
@@ -266,6 +266,7 @@ public class KwoTradeOrderService {
|
|
|
throw new BusinessException(updateResult.getMsg());
|
|
|
}
|
|
|
addOtherOrderInfo(order, BeanUtils.copyProperties(param, ValetOrderParam.class), false);
|
|
|
+ //TODO:发送提醒消息
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -387,6 +388,7 @@ public class KwoTradeOrderService {
|
|
|
throw new BusinessException(updateResult.getMsg());
|
|
|
}
|
|
|
addOtherOrderInfo(order, BeanUtils.copyProperties(param, ValetOrderParam.class), false);
|
|
|
+ //TODO:发送提醒消息
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -610,6 +612,10 @@ public class KwoTradeOrderService {
|
|
|
ValetOrderParam valetOrderParam = BeanUtils.copyProperties(param, ValetOrderParam.class);
|
|
|
|
|
|
addOtherOrderInfo(order, valetOrderParam, true);
|
|
|
+ //TODO:发送提醒消息
|
|
|
+ if (Objects.equals(param.getOperateType(), 1)) {
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -830,6 +836,7 @@ public class KwoTradeOrderService {
|
|
|
updateParam.setTOrderId(order.getId()).setStatus(order.getStatus()).setUpdateBy(LoginUserHolder.getUserId())
|
|
|
.setUpdateByName(LoginUserHolder.getUserName()).setUpdateTime(new Date());
|
|
|
saveMongoDb(3, updateParam);
|
|
|
+ //TODO:发送提醒消息
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -860,7 +867,9 @@ public class KwoTradeOrderService {
|
|
|
* @return: void
|
|
|
*/
|
|
|
public void completeOrder(CompleteOrderParam param) {
|
|
|
- KwoTradeOrder order = getById(param.getId());
|
|
|
+ BigDecimal actualAmount = param.getActualAmount();
|
|
|
+ Long tOrderId = param.getId();
|
|
|
+ KwoTradeOrder order = getById(tOrderId);
|
|
|
if (Objects.isNull(order)) {
|
|
|
throw new BusinessException("Order not found");
|
|
|
}
|
|
|
@@ -870,22 +879,22 @@ public class KwoTradeOrderService {
|
|
|
if (kwoTradeOrderUnitService.entMatch(param.getId(), LoginUserHolder.getEntId(), DictEnum.TORDER_UNIT_TYPE_2.getValue())) {
|
|
|
throw new BusinessException("无订单操作权限!");
|
|
|
}
|
|
|
- if (transportDubboService.checkLogisticsOrderByTradeOrderId(param.getId())) {
|
|
|
+ if (transportDubboService.checkLogisticsOrderByTradeOrderId(tOrderId)) {
|
|
|
throw new CustomPromptException(HttpStatus.COMPLETE_TORDER_FAIL_CODE, "订单存在未完成的物流托运,不可完结!");
|
|
|
}
|
|
|
- String lockKey = String.format(RedisConstant.TORDER_UPDATE_AMOUNT_KEY, param.getId());
|
|
|
+ String lockKey = String.format(RedisConstant.TORDER_UPDATE_AMOUNT_KEY, tOrderId);
|
|
|
if (Boolean.FALSE.equals(RedissonUtils.tryLock(lockKey, 5L, 10L))) {
|
|
|
throw new BusinessException("业务繁忙,请稍后再试!");
|
|
|
}
|
|
|
try {
|
|
|
- order.setActualAmount(param.getActualAmount()).setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_5.getValue()));
|
|
|
+ order.setActualAmount(actualAmount).setStatus(Integer.valueOf(DictEnum.TORDER_STATUS_5.getValue()));
|
|
|
kwoTradeOrderMapper.updateById(order);
|
|
|
//订单状态记录
|
|
|
KwoTradeOrderTrack track = new KwoTradeOrderTrack();
|
|
|
- track.setTOrderId(order.getId()).setTOrderNo(order.getTOrderNo()).setRemark(param.getRemark()).setStatus(order.getStatus());
|
|
|
+ track.setTOrderId(tOrderId).setTOrderNo(order.getTOrderNo()).setRemark(param.getRemark()).setStatus(order.getStatus());
|
|
|
kwoTradeOrderTrackService.insert(track);
|
|
|
- if (param.getActualAmount().compareTo(order.getAmount()) != 0) {
|
|
|
- KwoTradeOrderGoods goods = kwoTradeOrderGoodsService.getByOrderId(param.getId());
|
|
|
+ if (actualAmount.compareTo(order.getAmount()) != 0) {
|
|
|
+ KwoTradeOrderGoods goods = kwoTradeOrderGoodsService.getByOrderId(tOrderId);
|
|
|
if (Objects.isNull(goods)) {
|
|
|
throw new BusinessException("商品信息异常!");
|
|
|
}
|
|
|
@@ -896,6 +905,12 @@ public class KwoTradeOrderService {
|
|
|
throw new BusinessException(updateResult.getMsg());
|
|
|
}
|
|
|
}
|
|
|
+ //更新合同履约量
|
|
|
+ KwoTradeOrderContract contract = kwoTradeOrderContractService.getByOrderId(tOrderId);
|
|
|
+ if (Objects.isNull(contract) || Objects.isNull(contract.getContractId())) {
|
|
|
+ throw new BusinessException("订单合同信息异常");
|
|
|
+ }
|
|
|
+ remoteContractService.updatePerformed(contract.getContractId(), actualAmount);
|
|
|
//mongodb更新订单状态
|
|
|
SckwTradeOrder updateParam = new SckwTradeOrder();
|
|
|
updateParam.setTOrderId(order.getId()).setActualAmount(order.getActualAmount()).setStatus(order.getStatus())
|