领料推送高压mes优化
This commit is contained in:
parent
8fea59e694
commit
bd072e4524
|
|
@ -213,6 +213,11 @@ public class SyncGyMesPickmUtil {
|
|||
if (useVOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// // 创建子项数组
|
||||
JSONArray contentArray = new JSONArray();
|
||||
|
||||
JSONObject singleObj = new JSONObject();
|
||||
for (AggPickmVO vo : useVOs) {
|
||||
PickmHeadVO pickmHeadVO = vo.getParentVO();
|
||||
PickmItemVO[] itemVOS = (PickmItemVO[]) vo.getChildrenVO();
|
||||
|
|
@ -227,35 +232,36 @@ public class SyncGyMesPickmUtil {
|
|||
if (checkBillType(billType, configParams)) {
|
||||
continue;
|
||||
}
|
||||
JSONObject singleObj = new JSONObject();
|
||||
// 创建子项数组
|
||||
JSONArray contentArray = new JSONArray();
|
||||
// 20260104 改成新接口
|
||||
// "quantityPerSet": "单套数量(单位用量)",
|
||||
// "totalQuantity": "总数量(计划出库主数量)",
|
||||
// "reservedQuantity": "预留数量",
|
||||
// "cumulativePendingQuantity": "累计待发数量",
|
||||
// "cumulativeIssuedQuantity": "累计出库数量"
|
||||
|
||||
singleObj.put("materialPreparationPlanNumber", pickmHeadVO.getVbillcode());// 备料计划单号
|
||||
singleObj.put("bipId", pickmHeadVO.getCpickmid());// 主键ID
|
||||
singleObj.put("bipProcessProductionOrderId", pickmHeadVO.getVsourcemocode()); // 流程生产订单号
|
||||
singleObj.put("bipProcessProductionOrderRowNum", pickmHeadVO.getVsourcemorowcode()); // 来源单据号行号
|
||||
// 创建子项数组
|
||||
for (PickmItemVO item : itemVOS) {
|
||||
JSONObject itemObj = new JSONObject();
|
||||
itemObj.put("bipChildId", item.getCpickm_bid()); // 子项主键ID
|
||||
itemObj.put("bchkitemforwr", item.getBchkitemforwr().booleanValue() ? "Y" : "N"); // 完工齐套检查
|
||||
itemObj.put("quantityPerSet", item.getNunituseastnum() != null ? item.getNunituseastnum().doubleValue() : null); // 单套数量(单位用量)
|
||||
itemObj.put("totalQuantity", item.getNplanoutnum() != null ? item.getNplanoutnum().doubleValue() : null); // 总数量(计划出库主数量)
|
||||
|
||||
itemObj.put("reservedQuantity", item.getNatpastnum() != null ? item.getNatpastnum().doubleValue() : null); // 预留数量
|
||||
itemObj.put("cumulativePendingQuantity", item.getNshouldastnum() != null ? item.getNshouldastnum().doubleValue() : null); // 累计待发数量
|
||||
itemObj.put("cumulativeIssuedQuantity", item.getNaccoutastnum() != null ? item.getNaccoutastnum().doubleValue() : null); // 累计出库数量
|
||||
itemObj.put("totalQuantity", item.getNplanoutnum() != null ? item.getNplanoutnum().doubleValue() : null); // 总数量(计划出库主数量)
|
||||
contentArray.add(itemObj); // 将子项添加到数组
|
||||
}
|
||||
|
||||
}
|
||||
if(contentArray.size() > 0) {
|
||||
singleObj.put("itemList", contentArray); // 将子项数组添加到主对象
|
||||
jsonArray.add(singleObj);
|
||||
list.put("list", jsonArray);
|
||||
if (!list.isEmpty()) {
|
||||
logger.error("gyMes-Pickm-领料修改备料计划开始同步高压MES");
|
||||
pushDataAsync(list);
|
||||
}
|
||||
}
|
||||
if (!list.isEmpty()) {
|
||||
logger.error("gyMes-Pickm-领料修改备料计划开始同步高压MES");
|
||||
pushDataAsync(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -309,7 +315,7 @@ public class SyncGyMesPickmUtil {
|
|||
// 异步调用线程池
|
||||
final ExecutorService asyncExecutor = Executors.newFixedThreadPool(1);
|
||||
String baseUrl = configParams.get("mesBaseUrl");
|
||||
String requestUrl = baseUrl + configParams.get("materialRequirementsUpdate");
|
||||
String requestUrl = baseUrl + configParams.get("mRUpdateBatch");
|
||||
logger.error("gyMes-Pickm-url = " + requestUrl);
|
||||
// 提交异步任务,立即返回,不等待结果
|
||||
CompletableFuture.runAsync(() -> {
|
||||
|
|
|
|||
Loading…
Reference in New Issue