|
|
@@ -73,10 +73,10 @@ public class LogisticsConsignmentService {
|
|
|
@Autowired
|
|
|
RedisLockUtil redisLockUtil;
|
|
|
|
|
|
- @DubboReference(version = "1.0.0", group = "design", check = false)
|
|
|
+ @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
|
|
|
RemoteSystemService remoteSystemService;
|
|
|
|
|
|
- @DubboReference(version = "1.0.0", group = "design", check = false)
|
|
|
+ @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
|
|
|
GoodsInfoService goodsInfoService;
|
|
|
|
|
|
@DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
|
|
|
@@ -232,7 +232,7 @@ public class LogisticsConsignmentService {
|
|
|
logisticsOrder.setTOrderId(tradeOrder.getId());
|
|
|
logisticsOrder.setTOrderNo("D" + com.sckw.transport.utils.StringUtils.getWaybillNoUtil());
|
|
|
logisticsOrder.setSettlementCycle(bo.getSettlementCycle());
|
|
|
- logisticsOrder.setPrice(new BigDecimal(bo.getPrice()));
|
|
|
+ logisticsOrder.setPrice(bo.getPrice());
|
|
|
logisticsOrder.setPriceType(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE.getType(), bo.getPriceType()) == null ?
|
|
|
null : Long.parseLong(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE.getType(), bo.getPriceType()).getValue()));
|
|
|
|
|
|
@@ -449,7 +449,7 @@ public class LogisticsConsignmentService {
|
|
|
// order.setPids(orderId + StringConstant.COMMA);
|
|
|
order.setPids(String.valueOf(orderId));
|
|
|
order.setSettlementCycle(bo.getSettlementCycle());
|
|
|
- order.setPrice(new BigDecimal(bo.getPrice()));
|
|
|
+ order.setPrice(bo.getPrice());
|
|
|
order.setPriceType(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE.getType(), bo.getPriceType()) == null ?
|
|
|
null : Long.parseLong(remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.PRICE_TYPE.getType(), bo.getPriceType()).getValue()));
|
|
|
// order.setAmount(tradeOrder.getAmount());
|
|
|
@@ -936,16 +936,16 @@ public class LogisticsConsignmentService {
|
|
|
if (CollectionUtils.isEmpty(ids) || ids.size() < NumberConstant.ONE) {
|
|
|
throw new BusinessException("单据id不能为空");
|
|
|
}
|
|
|
- List<JSONObject> list = new ArrayList<>();
|
|
|
+ HttpResult result = new HttpResult();
|
|
|
//1采购 2销售
|
|
|
if (String.valueOf(NumberConstant.ONE).equals(type)) {
|
|
|
- cancelConsignByOrder(ids, remark, list);
|
|
|
+ result = cancelConsignByOrder(ids, remark);
|
|
|
} else if (String.valueOf(NumberConstant.TWO).equals(type)) {
|
|
|
- cancelConsignBySellOrder(ids, remark, list);
|
|
|
+ result = cancelConsignBySellOrder(ids, remark);
|
|
|
} else {
|
|
|
throw new BusinessException("类型错误!");
|
|
|
}
|
|
|
- return HttpResult.ok(list);
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -953,81 +953,80 @@ public class LogisticsConsignmentService {
|
|
|
*
|
|
|
* @param ids
|
|
|
*/
|
|
|
- public void cancelConsignBySellOrder(List<String> ids, String remark, List<JSONObject> list) {
|
|
|
- ids.forEach(s -> {
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("id", s);
|
|
|
- /**当前单据作废
|
|
|
- * 托运数量回归溯
|
|
|
- */
|
|
|
- KwtLogisticsOrder kwtLogisticsOrder = kwtLogisticsOrderMapper.selectOne(new LambdaUpdateWrapper<KwtLogisticsOrder>()
|
|
|
- .eq(KwtLogisticsOrder::getId, s));
|
|
|
- if (kwtLogisticsOrder == null || (!String.valueOf(LogisticsOrderEnum.PENDING_ORDER.getCode()).equals(kwtLogisticsOrder.getStatus()))) {
|
|
|
- log.info("物流订单单据id:{}", s);
|
|
|
- jsonObject.put("message", "单据状态异常或单据不存在");
|
|
|
- jsonObject.put("status", HttpStatus.GLOBAL_EXCEPTION_CODE);
|
|
|
- } else {
|
|
|
- /**撤退推送接口数据溯源修改贸易订单已委托量*/
|
|
|
- CreateOrCancelLogisticsOrderParam param = new CreateOrCancelLogisticsOrderParam();
|
|
|
- param.setTOrderId(Long.parseLong(s));
|
|
|
- param.setEntrustAmount(kwtLogisticsOrder.getLoadAmount().negate());
|
|
|
- param.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
- param.setUpdateByName(LoginUserHolder.getUserName());
|
|
|
- HttpResult httpResult = tradeOrderInfoService.createOrCancelLogisticsOrder(param);
|
|
|
- if (HttpStatus.SUCCESS_CODE == httpResult.getCode()) {
|
|
|
- kwtLogisticsOrder.setDelFlag(NumberConstant.ONE);
|
|
|
- kwtLogisticsOrder.setUpdateTime(new Date());
|
|
|
- kwtLogisticsOrder.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
- kwtLogisticsOrderMapper.update(null, new LambdaUpdateWrapper<KwtLogisticsOrder>()
|
|
|
- .eq(KwtLogisticsOrder::getId, kwtLogisticsOrder.getId())
|
|
|
- .set(KwtLogisticsOrder::getStatus, LogisticsOrderEnum.CANCEL_ORDER.getCode())
|
|
|
- .set(KwtLogisticsOrder::getUpdateBy, LoginUserHolder.getUserId())
|
|
|
- .set(KwtLogisticsOrder::getUpdateTime, new Date()));
|
|
|
- KwtLogisticsOrderTrack orderTrack = kwtLogisticsOrderTrackMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrderTrack>()
|
|
|
- .eq(KwtLogisticsOrderTrack::getLOrderId, s)
|
|
|
- .eq(KwtLogisticsOrderTrack::getStatus, LogisticsOrderEnum.CANCEL_ORDER.getCode())
|
|
|
- );
|
|
|
- if (orderTrack == null) {
|
|
|
- KwtLogisticsOrderTrack track = new KwtLogisticsOrderTrack();
|
|
|
- track.setId(new IdWorker(NumberConstant.ONE).nextId());
|
|
|
- track.setLOrderId(Long.valueOf(s));
|
|
|
- track.setRemark(remark);
|
|
|
- track.setStatus(LogisticsOrderEnum.CANCEL_ORDER.getCode());
|
|
|
- track.setCreateBy(LoginUserHolder.getUserId());
|
|
|
- track.setCreateTime(new Date());
|
|
|
- track.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
- track.setUpdateTime(new Date());
|
|
|
- } else {
|
|
|
- orderTrack.setRemark(remark);
|
|
|
- orderTrack.setStatus(LogisticsOrderEnum.CANCEL_ORDER.getCode());
|
|
|
- orderTrack.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
- orderTrack.setUpdateTime(new Date());
|
|
|
- kwtLogisticsOrderTrackMapper.updateById(orderTrack);
|
|
|
- }
|
|
|
- //mongoDb数据
|
|
|
- SckwLogisticsOrder logisticsOrder = new SckwLogisticsOrder();
|
|
|
- logisticsOrder.set_id(Long.valueOf(s));
|
|
|
- logisticsOrder.setLOrderId(Long.valueOf(s));
|
|
|
- logisticsOrder.setStatus(LogisticsOrderEnum.CANCEL_ORDER.getStatus());
|
|
|
- logisticsOrder.setUpdateByName(LoginUserHolder.getUserName());
|
|
|
- logisticsOrder.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
- logisticsOrder.setUpdateTime(new Date());
|
|
|
- SckwBusSum sckwBusSum = new SckwBusSum();
|
|
|
- sckwBusSum.setBusSumType(BusinessTypeEnum.LOGISTICS_ORDER_TYPE.getName());
|
|
|
- sckwBusSum.setMethod(NumberConstant.TWO);
|
|
|
- sckwBusSum.setObject(logisticsOrder);
|
|
|
- streamBridge.send("sckw-busSum", JSON.toJSONString(sckwBusSum));
|
|
|
-
|
|
|
- jsonObject.put("status", HttpStatus.SUCCESS_CODE);
|
|
|
- jsonObject.put("message", "操作成功");
|
|
|
+ public HttpResult cancelConsignBySellOrder(List<String> ids, String remark) {
|
|
|
+ HttpResult result = new HttpResult();
|
|
|
+ String s = ids.get(0);
|
|
|
+ /**当前单据作废
|
|
|
+ * 托运数量回归溯
|
|
|
+ */
|
|
|
+ KwtLogisticsOrder kwtLogisticsOrder = kwtLogisticsOrderMapper.selectOne(new LambdaUpdateWrapper<KwtLogisticsOrder>()
|
|
|
+ .eq(KwtLogisticsOrder::getId, s));
|
|
|
+ if (kwtLogisticsOrder == null || (!LogisticsOrderEnum.PENDING_ORDER.getStatus().equals(String.valueOf(kwtLogisticsOrder.getStatus())))) {
|
|
|
+ log.info("物流订单单据id:{}", s);
|
|
|
+ result.setMsg("单据状态异常或单据不存在");
|
|
|
+ result.setCode(HttpStatus.GLOBAL_EXCEPTION_CODE);
|
|
|
+ return result;
|
|
|
+ } else {
|
|
|
+ /**撤退推送接口数据溯源修改贸易订单已委托量*/
|
|
|
+ CreateOrCancelLogisticsOrderParam param = new CreateOrCancelLogisticsOrderParam();
|
|
|
+ param.setTOrderId(kwtLogisticsOrder.getTOrderId());
|
|
|
+ param.setEntrustAmount(kwtLogisticsOrder.getAmount().negate());
|
|
|
+ param.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ param.setUpdateByName(LoginUserHolder.getUserName());
|
|
|
+ HttpResult httpResult = tradeOrderInfoService.createOrCancelLogisticsOrder(param);
|
|
|
+ log.info("销售订单撤销托运-溯源贸易订单请求数据:{},返回数据:{}", JSONObject.toJSONString(param), JSONObject.toJSONString(httpResult));
|
|
|
+ if (HttpStatus.SUCCESS_CODE == httpResult.getCode()) {
|
|
|
+// kwtLogisticsOrder.setDelFlag(NumberConstant.ONE);
|
|
|
+ kwtLogisticsOrder.setUpdateTime(new Date());
|
|
|
+ kwtLogisticsOrder.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ kwtLogisticsOrderMapper.update(null, new LambdaUpdateWrapper<KwtLogisticsOrder>()
|
|
|
+ .eq(KwtLogisticsOrder::getId, kwtLogisticsOrder.getId())
|
|
|
+ .set(KwtLogisticsOrder::getStatus, LogisticsOrderEnum.CANCEL_ORDER.getCode())
|
|
|
+ .set(KwtLogisticsOrder::getUpdateBy, LoginUserHolder.getUserId())
|
|
|
+ .set(KwtLogisticsOrder::getUpdateTime, new Date()));
|
|
|
+ KwtLogisticsOrderTrack orderTrack = kwtLogisticsOrderTrackMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrderTrack>()
|
|
|
+ .eq(KwtLogisticsOrderTrack::getLOrderId, s)
|
|
|
+ .eq(KwtLogisticsOrderTrack::getStatus, LogisticsOrderEnum.CANCEL_ORDER.getCode())
|
|
|
+ );
|
|
|
+ if (orderTrack == null) {
|
|
|
+ KwtLogisticsOrderTrack track = new KwtLogisticsOrderTrack();
|
|
|
+ track.setId(new IdWorker(NumberConstant.ONE).nextId());
|
|
|
+ track.setLOrderId(Long.valueOf(s));
|
|
|
+ track.setRemark(remark);
|
|
|
+ track.setStatus(LogisticsOrderEnum.CANCEL_ORDER.getCode());
|
|
|
+ track.setCreateBy(LoginUserHolder.getUserId());
|
|
|
+ track.setCreateTime(new Date());
|
|
|
+ track.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ track.setUpdateTime(new Date());
|
|
|
+ kwtLogisticsOrderTrackMapper.insert(track);
|
|
|
} else {
|
|
|
- JSONObject.toJSONString(httpResult);
|
|
|
- jsonObject.put("status", HttpStatus.GLOBAL_EXCEPTION_CODE);
|
|
|
- jsonObject.put("message", "操作失败:" + httpResult.getMsg());
|
|
|
+ orderTrack.setRemark(remark);
|
|
|
+ orderTrack.setStatus(LogisticsOrderEnum.CANCEL_ORDER.getCode());
|
|
|
+ orderTrack.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ orderTrack.setUpdateTime(new Date());
|
|
|
+ kwtLogisticsOrderTrackMapper.updateById(orderTrack);
|
|
|
}
|
|
|
+ //mongoDb数据
|
|
|
+ SckwLogisticsOrder logisticsOrder = new SckwLogisticsOrder();
|
|
|
+ logisticsOrder.set_id(Long.valueOf(s));
|
|
|
+ logisticsOrder.setLOrderId(Long.valueOf(s));
|
|
|
+ logisticsOrder.setStatus(LogisticsOrderEnum.CANCEL_ORDER.getStatus());
|
|
|
+ logisticsOrder.setUpdateByName(LoginUserHolder.getUserName());
|
|
|
+ logisticsOrder.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ logisticsOrder.setUpdateTime(new Date());
|
|
|
+ SckwBusSum sckwBusSum = new SckwBusSum();
|
|
|
+ sckwBusSum.setBusSumType(BusinessTypeEnum.LOGISTICS_ORDER_TYPE.getName());
|
|
|
+ sckwBusSum.setMethod(NumberConstant.TWO);
|
|
|
+ sckwBusSum.setObject(logisticsOrder);
|
|
|
+ streamBridge.send("sckw-busSum", JSON.toJSONString(sckwBusSum));
|
|
|
+ result.setMsg("操作成功");
|
|
|
+ result.setCode(HttpStatus.SUCCESS_CODE);
|
|
|
+ } else {
|
|
|
+ result.setMsg("操作失败:" + httpResult.getMsg());
|
|
|
+ result.setCode(HttpStatus.GLOBAL_EXCEPTION_CODE);
|
|
|
}
|
|
|
- list.add(jsonObject);
|
|
|
- });
|
|
|
+ }
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1035,83 +1034,79 @@ public class LogisticsConsignmentService {
|
|
|
*
|
|
|
* @param ids
|
|
|
*/
|
|
|
- public void cancelConsignByOrder(List<String> ids, String remark, List<JSONObject> list) {
|
|
|
- ids.forEach(s -> {
|
|
|
- /**当前单据作废
|
|
|
- * 托运数量回归溯源
|
|
|
- */
|
|
|
- JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put("id", s);
|
|
|
- /**当前单据作废
|
|
|
- * 托运数量回归溯
|
|
|
- */
|
|
|
- KwtLogisticsOrder kwtLogisticsOrder = kwtLogisticsOrderMapper.selectOne(new LambdaUpdateWrapper<KwtLogisticsOrder>()
|
|
|
- .eq(KwtLogisticsOrder::getId, s));
|
|
|
- if (kwtLogisticsOrder == null || (!LogisticsOrderEnum.PENDING_ORDER.getStatus().equals(String.valueOf(kwtLogisticsOrder.getStatus())))) {
|
|
|
- log.info("物流订单单据id:{}", s);
|
|
|
- jsonObject.put("message", "单据状态异常或单据不存在");
|
|
|
- jsonObject.put("status", HttpStatus.GLOBAL_EXCEPTION_CODE);
|
|
|
- } else {
|
|
|
- /**撤退推送接口数据溯源修改贸易订单已委托量*/
|
|
|
- CreateOrCancelLogisticsOrderParam param = new CreateOrCancelLogisticsOrderParam();
|
|
|
- param.setTOrderId(Long.parseLong(s));
|
|
|
- param.setEntrustAmount(kwtLogisticsOrder.getLoadAmount().negate());
|
|
|
- param.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
- param.setUpdateByName(LoginUserHolder.getUserName());
|
|
|
- HttpResult httpResult = tradeOrderInfoService.createOrCancelLogisticsOrder(param);
|
|
|
- if (HttpStatus.SUCCESS_CODE == httpResult.getCode()) {
|
|
|
+ public HttpResult cancelConsignByOrder(List<String> ids, String remark) {
|
|
|
+ HttpResult result = new HttpResult();
|
|
|
+ String id = ids.get(0);
|
|
|
+ /**当前单据作废
|
|
|
+ * 托运数量回归溯
|
|
|
+ */
|
|
|
+ KwtLogisticsOrder kwtLogisticsOrder = kwtLogisticsOrderMapper.selectOne(new LambdaUpdateWrapper<KwtLogisticsOrder>()
|
|
|
+ .eq(KwtLogisticsOrder::getId, Long.parseLong(id)));
|
|
|
+ if (kwtLogisticsOrder == null || (!LogisticsOrderEnum.PENDING_ORDER.getStatus().equals(String.valueOf(kwtLogisticsOrder.getStatus())))) {
|
|
|
+ log.info("物流订单单据id:{}", id);
|
|
|
+ result.setCode(HttpStatus.GLOBAL_EXCEPTION_CODE);
|
|
|
+ result.setMsg("单据状态异常或单据不存在");
|
|
|
+ return result;
|
|
|
+ } else {
|
|
|
+ /**撤退推送接口数据溯源修改贸易订单已委托量*/
|
|
|
+ CreateOrCancelLogisticsOrderParam param = new CreateOrCancelLogisticsOrderParam();
|
|
|
+ param.setTOrderId(kwtLogisticsOrder.getTOrderId());
|
|
|
+ param.setEntrustAmount(kwtLogisticsOrder.getAmount().negate());
|
|
|
+ param.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ param.setUpdateByName(LoginUserHolder.getUserName());
|
|
|
+ HttpResult httpResult = tradeOrderInfoService.createOrCancelLogisticsOrder(param);
|
|
|
+ log.info("采购订单撤销托运-溯源贸易订单请求数据:{},返回数据:{}", JSONObject.toJSONString(param), JSONObject.toJSONString(httpResult));
|
|
|
+ if (HttpStatus.SUCCESS_CODE == httpResult.getCode()) {
|
|
|
// kwtLogisticsOrder.setDelFlag(NumberConstant.ONE);
|
|
|
// kwtLogisticsOrder.setUpdateTime(new Date());
|
|
|
// kwtLogisticsOrder.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
- kwtLogisticsOrderMapper.update(null, new LambdaUpdateWrapper<KwtLogisticsOrder>()
|
|
|
- .eq(KwtLogisticsOrder::getId, kwtLogisticsOrder.getId())
|
|
|
- .set(KwtLogisticsOrder::getStatus, LogisticsOrderEnum.CANCEL_ORDER.getCode())
|
|
|
- .set(KwtLogisticsOrder::getUpdateBy, LoginUserHolder.getUserId())
|
|
|
- .set(KwtLogisticsOrder::getUpdateTime, new Date()));
|
|
|
- KwtLogisticsOrderTrack orderTrack = kwtLogisticsOrderTrackMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrderTrack>()
|
|
|
- .eq(KwtLogisticsOrderTrack::getLOrderId, s)
|
|
|
- .eq(KwtLogisticsOrderTrack::getStatus, LogisticsOrderEnum.CANCEL_ORDER.getCode())
|
|
|
- );
|
|
|
- if (orderTrack == null) {
|
|
|
- KwtLogisticsOrderTrack track = new KwtLogisticsOrderTrack();
|
|
|
- track.setId(new IdWorker(NumberConstant.ONE).nextId());
|
|
|
- track.setLOrderId(Long.valueOf(s));
|
|
|
- track.setRemark(remark);
|
|
|
- track.setStatus(LogisticsOrderEnum.CANCEL_ORDER.getCode());
|
|
|
- track.setCreateBy(LoginUserHolder.getUserId());
|
|
|
- track.setCreateTime(new Date());
|
|
|
- track.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
- track.setUpdateTime(new Date());
|
|
|
- } else {
|
|
|
- orderTrack.setRemark(remark);
|
|
|
- orderTrack.setStatus(LogisticsOrderEnum.CANCEL_ORDER.getCode());
|
|
|
- orderTrack.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
- orderTrack.setUpdateTime(new Date());
|
|
|
- kwtLogisticsOrderTrackMapper.updateById(orderTrack);
|
|
|
- }
|
|
|
- //mongoDb数据
|
|
|
- SckwLogisticsOrder logisticsOrder = new SckwLogisticsOrder();
|
|
|
- logisticsOrder.set_id(Long.valueOf(s));
|
|
|
- logisticsOrder.setLOrderId(Long.valueOf(s));
|
|
|
- logisticsOrder.setStatus(LogisticsOrderEnum.CANCEL_ORDER.getStatus());
|
|
|
- logisticsOrder.setUpdateByName(LoginUserHolder.getUserName());
|
|
|
- logisticsOrder.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
- logisticsOrder.setUpdateTime(new Date());
|
|
|
- SckwBusSum sckwBusSum = new SckwBusSum();
|
|
|
- sckwBusSum.setBusSumType(BusinessTypeEnum.LOGISTICS_ORDER_TYPE.getName());
|
|
|
- sckwBusSum.setMethod(NumberConstant.TWO);
|
|
|
- sckwBusSum.setObject(logisticsOrder);
|
|
|
- streamBridge.send("sckw-busSum", JSON.toJSONString(sckwBusSum));
|
|
|
-
|
|
|
- jsonObject.put("status", HttpStatus.SUCCESS_CODE);
|
|
|
- jsonObject.put("message", "操作失败:" + httpResult.getMsg());
|
|
|
+ kwtLogisticsOrderMapper.update(null, new LambdaUpdateWrapper<KwtLogisticsOrder>()
|
|
|
+ .eq(KwtLogisticsOrder::getId, kwtLogisticsOrder.getId())
|
|
|
+ .set(KwtLogisticsOrder::getStatus, LogisticsOrderEnum.CANCEL_ORDER.getCode())
|
|
|
+ .set(KwtLogisticsOrder::getUpdateBy, LoginUserHolder.getUserId())
|
|
|
+ .set(KwtLogisticsOrder::getUpdateTime, new Date()));
|
|
|
+ KwtLogisticsOrderTrack orderTrack = kwtLogisticsOrderTrackMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrderTrack>()
|
|
|
+ .eq(KwtLogisticsOrderTrack::getLOrderId, id)
|
|
|
+ .eq(KwtLogisticsOrderTrack::getStatus, LogisticsOrderEnum.CANCEL_ORDER.getCode())
|
|
|
+ );
|
|
|
+ if (orderTrack == null) {
|
|
|
+ KwtLogisticsOrderTrack track = new KwtLogisticsOrderTrack();
|
|
|
+ track.setId(new IdWorker(NumberConstant.ONE).nextId());
|
|
|
+ track.setLOrderId(Long.valueOf(id));
|
|
|
+ track.setRemark(remark);
|
|
|
+ track.setStatus(LogisticsOrderEnum.CANCEL_ORDER.getCode());
|
|
|
+ track.setCreateBy(LoginUserHolder.getUserId());
|
|
|
+ track.setCreateTime(new Date());
|
|
|
+ track.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ track.setUpdateTime(new Date());
|
|
|
+ kwtLogisticsOrderTrackMapper.insert(track);
|
|
|
} else {
|
|
|
- jsonObject.put("status", HttpStatus.GLOBAL_EXCEPTION_CODE);
|
|
|
- jsonObject.put("message", "操作失败:" + httpResult.getMsg());
|
|
|
+ orderTrack.setRemark(remark);
|
|
|
+ orderTrack.setStatus(LogisticsOrderEnum.CANCEL_ORDER.getCode());
|
|
|
+ orderTrack.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ orderTrack.setUpdateTime(new Date());
|
|
|
+ kwtLogisticsOrderTrackMapper.updateById(orderTrack);
|
|
|
}
|
|
|
+ //mongoDb数据
|
|
|
+ SckwLogisticsOrder logisticsOrder = new SckwLogisticsOrder();
|
|
|
+ logisticsOrder.set_id(Long.valueOf(id));
|
|
|
+ logisticsOrder.setLOrderId(Long.valueOf(id));
|
|
|
+ logisticsOrder.setStatus(LogisticsOrderEnum.CANCEL_ORDER.getStatus());
|
|
|
+ logisticsOrder.setUpdateByName(LoginUserHolder.getUserName());
|
|
|
+ logisticsOrder.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
+ logisticsOrder.setUpdateTime(new Date());
|
|
|
+ SckwBusSum sckwBusSum = new SckwBusSum();
|
|
|
+ sckwBusSum.setBusSumType(BusinessTypeEnum.LOGISTICS_ORDER_TYPE.getName());
|
|
|
+ sckwBusSum.setMethod(NumberConstant.TWO);
|
|
|
+ sckwBusSum.setObject(logisticsOrder);
|
|
|
+ streamBridge.send("sckw-busSum", JSON.toJSONString(sckwBusSum));
|
|
|
+ result.setCode(HttpStatus.SUCCESS_CODE);
|
|
|
+ } else {
|
|
|
+ result.setCode(HttpStatus.GLOBAL_EXCEPTION_CODE);
|
|
|
+ result.setMsg("操作失败:" + httpResult.getMsg());
|
|
|
}
|
|
|
- list.add(jsonObject);
|
|
|
- });
|
|
|
+ }
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
/**
|