fix(101和531):增加车间数组在此维护内可不许自动报工

This commit is contained in:
liaohechuan 2025-03-07 13:16:42 +08:00
parent 3affe33ce8
commit 01b1a1b68f
4 changed files with 20 additions and 6 deletions

View File

@ -321,7 +321,7 @@ public class ShopOrderStatisticTransController {
for (int i = 0; i < zLotMaterialCompleteTransactions.size(); i++) {
List<ZLotMaterialCompleteTransaction> newList = new ArrayList<>();
newList.add(zLotMaterialCompleteTransactions.get(i));
InvokeResponse invokeResponse = lotMaterialDealSendSapService.callLotMaterialComplete(newList, false,"");
InvokeResponse invokeResponse = lotMaterialDealSendSapService.callLotMaterialComplete(newList, false,"", new ArrayList<>());
if ("E".equals(invokeResponse.getResult())) {
sb.append("批次【"+zLotMaterialCompleteTransactions.get(i).getLotNo()+"】SAP错误:" + invokeResponse.getMessageContent());
}

View File

@ -45,6 +45,8 @@ public class SapShopOrderCompleteJob {
String postingDate = null;
// 同步时间节点
String syncTimeNode = null;
// 车间列表不需要消耗报工
List<String> cjList = new ArrayList<>();
String jobParam = XxlJobHelper.getJobParam();
if (StrUtil.isNotBlank(jobParam)) {
Map<String, String> paramMap = JS.parseMap(jobParam, "=", ";");
@ -53,6 +55,14 @@ public class SapShopOrderCompleteJob {
endDate = paramMap.get("endDate");
postingDate = paramMap.get("postingDate");
syncTimeNode = paramMap.get("syncTimeNode");
String cj = paramMap.get("cjList");
if (StrUtil.isNotBlank(cj)) {
if (cj.contains(",")) {
cjList = Arrays.asList(cj.split(","));
} else {
cjList.add(cj);
}
}
}
if (StrUtil.isBlank(site)) {
XxlJobHelper.log("ERROR:未维护站点[site]参数");
@ -104,7 +114,7 @@ public class SapShopOrderCompleteJob {
for (int i = 0; i < oneZeroOneList.size(); i++) {
List<ZLotMaterialCompleteTransaction> newList = new ArrayList<>();
newList.add(oneZeroOneList.get(i));
InvokeResponse invokeResponse = lotMaterialDealSendSapService.callLotMaterialComplete(newList, true, postingDate);
InvokeResponse invokeResponse = lotMaterialDealSendSapService.callLotMaterialComplete(newList, true, postingDate, cjList);
if (!"S".equals(invokeResponse.getResult())) {
XxlJobHelper.log("WARN:同步101完工入库数据失败!!!" + invokeResponse.getMessageContent());
}
@ -119,7 +129,7 @@ public class SapShopOrderCompleteJob {
for (int i = 0; i < fiveThreeOneList.size(); i++) {
List<ZLotMaterialCompleteTransaction> newList = new ArrayList<>();
newList.add(fiveThreeOneList.get(i));
InvokeResponse invokeResponse = lotMaterialDealSendSapService.callLotMaterialComplete(newList, true, postingDate);
InvokeResponse invokeResponse = lotMaterialDealSendSapService.callLotMaterialComplete(newList, true, postingDate, cjList);
if (!"S".equals(invokeResponse.getResult())) {
XxlJobHelper.log("WARN:同步531完工入库数据失败!!!" + invokeResponse.getMessageContent());
}

View File

@ -8,7 +8,7 @@ import java.util.List;
public interface LotMaterialDealSendSapService {
InvokeResponse callLotMaterialComplete(List<ZLotMaterialCompleteTransaction> zLotMaterialCompleteTransactions, boolean isPass, String postingDate);
InvokeResponse callLotMaterialComplete(List<ZLotMaterialCompleteTransaction> zLotMaterialCompleteTransactions, boolean isPass, String postingDate, List<String> cjList);
InvokeResponse callLotMaterialConsumption(List<ZLotMaterialConsumptionTransaction> zLotMaterialConsumptionTransactions, boolean isPass, String postingDate, List<String> cjList);
}

View File

@ -39,7 +39,7 @@ public class LotMaterialDealSendSapServiceImpl implements LotMaterialDealSendSap
private final String messageId = "ZMM_MES_GOODSMVT_CREATE";
@Override
public InvokeResponse callLotMaterialComplete(List<ZLotMaterialCompleteTransaction> zLotMaterialCompleteTransactions, boolean isPass, String postingDate) {
public InvokeResponse callLotMaterialComplete(List<ZLotMaterialCompleteTransaction> zLotMaterialCompleteTransactions, boolean isPass, String postingDate, List<String> cjList) {
InvokeResponse invokeResponse = new InvokeResponse();
List<ZLotMaterialCompleteTransaction> newOneZeroOneList = new ArrayList<>();
List<ZLotMaterialCompleteTransaction> newFiveThreeOneList = new ArrayList<>();
@ -48,6 +48,10 @@ public class LotMaterialDealSendSapServiceImpl implements LotMaterialDealSendSap
JSONArray fiveThreeOneList = new JSONArray();
List<ZLotMaterialCompleteTransaction> srcList = new ArrayList<>();
for (ZLotMaterialCompleteTransaction completeTransaction : zLotMaterialCompleteTransactions) {
// 如果车间在维护的数据里,不自动报工
if (CollectionUtils.isNotEmpty(cjList) && StringUtils.isNotEmpty(completeTransaction.getFabNo()) && cjList.contains(completeTransaction.getFabNo())) {
continue;
}
// 重新校验一遍是否已经报过工,防止重复报工
ZLotMaterialCompleteTransaction targetObj = zLotMaterialCompleteTransactionMapper.selectById(completeTransaction.getSid());
if ("S".equals(targetObj.getSyncStatus()) && !isPass) {
@ -199,7 +203,7 @@ public class LotMaterialDealSendSapServiceImpl implements LotMaterialDealSendSap
List<ZLotMaterialConsumptionTransaction> srcList = new ArrayList<>();
for (ZLotMaterialConsumptionTransaction consumptionTransaction : zLotMaterialConsumptionTransactions) {
// 如果车间在维护的数据里,不自动报工
if (CollectionUtils.isNotEmpty(cjList) && cjList.contains(consumptionTransaction.getFabNo())) {
if (CollectionUtils.isNotEmpty(cjList) && StringUtils.isNotEmpty(consumptionTransaction.getFabNo()) && cjList.contains(consumptionTransaction.getFabNo())) {
continue;
}
// 重新校验一遍是否已经报过工,防止重复报工