|
@@ -487,12 +487,20 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
|
|
|
StorageBill old = storageBillService.getById(storageBill.getId());
|
|
|
int originalAmountTotal = old.getAmountTotal();
|
|
|
if("1024".equals(old.getTypeConfigId()) && oConvertUtils.isNotEmpty(storageBill.getDestination())){
|
|
|
- // 合并更新字段
|
|
|
- BeanUtils.copyProperties(storageBill, old);
|
|
|
- old.setAmountTotal(originalAmountTotal);
|
|
|
- JSONObject jsonObject = storageBillService.billetAutoTmpDataSyn(old);
|
|
|
-
|
|
|
- log.info("钢坯装运单编辑,未知目的地数据同步结果:{}", jsonObject);
|
|
|
+ try {
|
|
|
+ // 合并更新字段
|
|
|
+ BeanUtils.copyProperties(storageBill, old);
|
|
|
+ old.setAmountTotal(originalAmountTotal);
|
|
|
+ JSONObject jsonObject = storageBillService.billetAutoTmpDataSyn(old);
|
|
|
+ log.info("钢坯装运单编辑,未知目的地数据同步结果:{}", jsonObject);
|
|
|
+ } catch (Exception e) {
|
|
|
+ // 更新 typeConfigId 和 destination
|
|
|
+ old.setTypeConfigId(storageBill.getTypeConfigId());
|
|
|
+ old.setDestination(storageBill.getDestination());
|
|
|
+ storageBillService.updateById(old);
|
|
|
+ log.error("装运单同步发生异常,已更新目的地:", e);
|
|
|
+ return Result.OK("装运单同步异常,编辑目的地成功!");
|
|
|
+ }
|
|
|
} else {
|
|
|
log.info("{}{}", "B端编辑钢坯装运单", old.getLicensePlate() + "===" + storageBill.getLicensePlate());
|
|
|
if (!old.getLicensePlate().equals(storageBill.getLicensePlate())){
|
|
@@ -1732,14 +1740,23 @@ public class StorageBillController extends JeecgController<StorageBill, IStorage
|
|
|
StorageBill bill = storageBillService.getById(storageBill.getId());
|
|
|
// 原始装运单目的地ID是1024,才走数据同步
|
|
|
if("1024".equals(bill.getTypeConfigId()) && !"1024".equals(storageBill.getTypeConfigId())){
|
|
|
- bill.setDestination(storageBill.getDestination());
|
|
|
- bill.setTypeConfigId(storageBill.getTypeConfigId());
|
|
|
- JSONObject jsonObject = storageBillService.billetAutoTmpDataSynConfirm(bill);
|
|
|
- log.info("{}{}", "看板确认目的地数据同步结果:", jsonObject);
|
|
|
- return Result.OK("确认目的地成功!");
|
|
|
+ try {
|
|
|
+ bill.setDestination(storageBill.getDestination());
|
|
|
+ bill.setTypeConfigId(storageBill.getTypeConfigId());
|
|
|
+ JSONObject jsonObject = storageBillService.billetAutoTmpDataSynConfirm(bill);
|
|
|
+ log.info("{}{}", "看板确认目的地数据同步结果:", jsonObject);
|
|
|
+ return Result.OK("看板确认目的地成功!");
|
|
|
+ } catch (Exception e) {
|
|
|
+ // 更新typeConfigId和destination
|
|
|
+ bill.setTypeConfigId(storageBill.getTypeConfigId());
|
|
|
+ bill.setDestination(storageBill.getDestination());
|
|
|
+ storageBillService.getBaseMapper().updateById(bill);
|
|
|
+ log.error("B端监控看板确认目的地,同步发生异常", e.getMessage());
|
|
|
+ return Result.OK("看板确认目的地失败,系统已更新目的地信息!");
|
|
|
+ }
|
|
|
}else {
|
|
|
log.info("{}{}", "看板确认目的地参数有误:", JSON.toJSON(storageBill));
|
|
|
- return Result.OK("确认目的地失败!");
|
|
|
+ return Result.OK("看板确认目的地失败!");
|
|
|
}
|
|
|
}
|
|
|
|