fix(生产报工平台):物料消耗同步和完工同步修改为一条一条抛送

This commit is contained in:
liaohechuan 2025-02-19 09:43:29 +08:00
parent 947f899bf1
commit 040939b594

View File

@ -1,6 +1,5 @@
package com.foreverwin.iep.integration.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.foreverwin.iep.common.faas.common.util.StringUtils;
@ -275,12 +274,15 @@ public class ShopOrderStatisticTransController {
@SysLog("生产管理报工平台-物料消耗报工")
@PostMapping("/callErpMaterial")
public R callErpMaterial(@RequestBody List<ZLotMaterialConsumptionTransaction> zLotMaterialConsumptionTransactions) {
InvokeResponse invokeResponse = lotMaterialDealSendSapService.callLotMaterialConsumption(zLotMaterialConsumptionTransactions, false,"");
if ("E".equals(invokeResponse.getResult())) {
return R.failed("SAP错误:" + invokeResponse.getMessageContent());
} else {
return R.ok();
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());
}
}
return R.ok();
}
// --------------------------------- 批次完工入库报工开始 -----------------------------------------------
@ -297,12 +299,15 @@ public class ShopOrderStatisticTransController {
@SysLog("生产管理报工平台-批次完工入库报工")
@PostMapping("/callErpLot")
public R callErpLot(@RequestBody List<ZLotMaterialCompleteTransaction> zLotMaterialCompleteTransactions) {
InvokeResponse invokeResponse = lotMaterialDealSendSapService.callLotMaterialComplete(zLotMaterialCompleteTransactions, false,"");
if ("E".equals(invokeResponse.getResult())) {
return R.failed("SAP错误:" + invokeResponse.getMessageContent());
} else {
return R.ok();
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());
}
}
return R.ok();
}
@ApiOperation(value = "生产管理报工平台-物料消耗冲销", notes = "生产管理报工平台-物料消耗冲销")