fix(生产报工平台):物料消耗同步和完工同步修改为一条一条抛送
This commit is contained in:
parent
040939b594
commit
1d3dcf66cd
@ -274,15 +274,27 @@ public class ShopOrderStatisticTransController {
|
||||
@SysLog("生产管理报工平台-物料消耗报工")
|
||||
@PostMapping("/callErpMaterial")
|
||||
public R callErpMaterial(@RequestBody List<ZLotMaterialConsumptionTransaction> zLotMaterialConsumptionTransactions) {
|
||||
for (ZLotMaterialConsumptionTransaction consumptionTransaction : zLotMaterialConsumptionTransactions) {
|
||||
// 重新校验一遍是否已经报过工,防止重复报工
|
||||
ZLotMaterialConsumptionTransaction targetObj = zLotMaterialConsumptionTransactionMapper.selectById(consumptionTransaction.getSid());
|
||||
if ("S".equals(targetObj.getSyncStatus())) {
|
||||
throw BusinessException.build("批次" + targetObj.getLotNo() + "消耗已经报工,不可重复报工");
|
||||
}
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < zLotMaterialConsumptionTransactions.size(); i++) {
|
||||
List<ZLotMaterialConsumptionTransaction> newList = new ArrayList<>();
|
||||
newList.add(zLotMaterialConsumptionTransactions.get(i));
|
||||
InvokeResponse invokeResponse = lotMaterialDealSendSapService.callLotMaterialConsumption(newList, false,"");
|
||||
if ("E".equals(invokeResponse.getResult())) {
|
||||
return R.failed("SAP错误:" + invokeResponse.getMessageContent());
|
||||
sb.append("批次【"+zLotMaterialConsumptionTransactions.get(i).getLotNo()+"】SAP错误:" + invokeResponse.getMessageContent());
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
if (sb.length() > 0) {
|
||||
return R.failed(sb.toString());
|
||||
} else {
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------- 批次完工入库报工开始 -----------------------------------------------
|
||||
@ -299,15 +311,27 @@ public class ShopOrderStatisticTransController {
|
||||
@SysLog("生产管理报工平台-批次完工入库报工")
|
||||
@PostMapping("/callErpLot")
|
||||
public R callErpLot(@RequestBody List<ZLotMaterialCompleteTransaction> zLotMaterialCompleteTransactions) {
|
||||
for (ZLotMaterialCompleteTransaction completeTransaction : zLotMaterialCompleteTransactions) {
|
||||
// 重新校验一遍是否已经报过工,防止重复报工
|
||||
ZLotMaterialCompleteTransaction targetObj = zLotMaterialCompleteTransactionMapper.selectById(completeTransaction.getSid());
|
||||
if ("S".equals(targetObj.getSyncStatus())) {
|
||||
throw BusinessException.build("批次" + targetObj.getLotNo() + "完工已经报工,不可重复报工");
|
||||
}
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < zLotMaterialCompleteTransactions.size(); i++) {
|
||||
List<ZLotMaterialCompleteTransaction> newList = new ArrayList<>();
|
||||
newList.add(zLotMaterialCompleteTransactions.get(i));
|
||||
InvokeResponse invokeResponse = lotMaterialDealSendSapService.callLotMaterialComplete(newList, false,"");
|
||||
if ("E".equals(invokeResponse.getResult())) {
|
||||
return R.failed("SAP错误:" + invokeResponse.getMessageContent());
|
||||
sb.append("批次【"+zLotMaterialCompleteTransactions.get(i).getLotNo()+"】SAP错误:" + invokeResponse.getMessageContent());
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
if (sb.length() > 0) {
|
||||
return R.failed(sb.toString());
|
||||
} else {
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "生产管理报工平台-物料消耗冲销", notes = "生产管理报工平台-物料消耗冲销")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user