要货计划做了优化
This commit is contained in:
parent
14a2c49c8c
commit
cf9cbb265d
@ -222,7 +222,7 @@ public class GoodsPlanController {
|
|||||||
ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
|
ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
|
||||||
executor.schedule(() -> {
|
executor.schedule(() -> {
|
||||||
System.out.println("延时任务执行");
|
System.out.println("延时任务执行");
|
||||||
}, 5, TimeUnit.SECONDS); // 5秒后执行
|
}, 10, TimeUnit.SECONDS); //10秒后执行
|
||||||
executor.shutdown(); // 关闭线程池
|
executor.shutdown(); // 关闭线程池
|
||||||
|
|
||||||
//明细列表
|
//明细列表
|
||||||
@ -271,33 +271,52 @@ public class GoodsPlanController {
|
|||||||
erpGoodsPlanDetailReq.put("entrycomment", goodsPlanDetailData.getString("remark__c") != null ? goodsPlanDetailData.getString("remark__c") : "");//备注
|
erpGoodsPlanDetailReq.put("entrycomment", goodsPlanDetailData.getString("remark__c") != null ? goodsPlanDetailData.getString("remark__c") : "");//备注
|
||||||
erpGoodsPlanDetailReq.put("f9w5_contractno", goodsPlanDetailData.getString("sales_contract_number__c__r") != null ? goodsPlanDetailData.getString("sales_contract_number__c__r") : "");//销售合同编号
|
erpGoodsPlanDetailReq.put("f9w5_contractno", goodsPlanDetailData.getString("sales_contract_number__c__r") != null ? goodsPlanDetailData.getString("sales_contract_number__c__r") : "");//销售合同编号
|
||||||
erpGoodsPlanDetailReq.put("f9w5_tracknumber_number", trackingNum);//跟踪号
|
erpGoodsPlanDetailReq.put("f9w5_tracknumber_number", trackingNum);//跟踪号
|
||||||
erpGoodsPlanDetailReq.put("f9w5_programversion_number", goodsPlanDetailData.getString("program_version_number__c"));//程序版本
|
|
||||||
erpGoodsPlanDetailReq.put("f9w5_smplatform_number", goodsPlanDetailData.getString("platform_name_code__c") != null ? goodsPlanDetailData.getString("platform_name_code__c") : "");
|
|
||||||
|
|
||||||
//开始查询项目号
|
//程序版本
|
||||||
String projectId = goodsPlanDetailData.getString("project_name__c") != null ? goodsPlanDetailData.getString("project_name__c") : "";
|
String programVersion = goodsPlanDetailData.getString("program_version_number__c") != null ? goodsPlanDetailData.getString("program_version_number__c") : "";
|
||||||
|
|
||||||
//开始查询项目号
|
if (programVersion.equals("")) {
|
||||||
JSONObject getProjectReq = crmRequestUtil.getCRMList(Arrays.asList(
|
log.info("程序版本不存在,将不再向下执行");
|
||||||
new Filter("EQ", "_id", Arrays.asList(projectId))
|
continue;
|
||||||
), "NewOpportunityObj");
|
|
||||||
|
|
||||||
JSONObject projectRes = new JSONObject();
|
|
||||||
|
|
||||||
try {
|
|
||||||
projectRes = restTemplate.postForObject(URLConstant.GET_CUSTOMIZE_LIST_URL, getProjectReq, JSONObject.class);
|
|
||||||
} catch (RestClientException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String projectCode = "";
|
erpGoodsPlanDetailReq.put("f9w5_programversion_number", programVersion);//程序版本
|
||||||
|
|
||||||
if ("success".equals(projectRes.getString("errorDescription")) && !projectRes.getJSONObject("data").getJSONArray("dataList").isEmpty()) {
|
//程序版本编码
|
||||||
JSONObject projectData = projectRes.getJSONObject("data").getJSONArray("dataList").getJSONObject(0);
|
String programVersionCode = goodsPlanDetailData.getString("platform_name_code__c") != null ? goodsPlanDetailData.getString("platform_name_code__c") : "";
|
||||||
projectCode = projectData.getString("opportunity_id__c") != null ? projectData.getString("opportunity_id__c") : "";
|
|
||||||
|
if (programVersionCode.equals("")) {
|
||||||
|
log.info("程序版本编码不存在,将不再向下执行");
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
erpGoodsPlanDetailReq.put("f9w5_project_number", projectCode);//项目号
|
erpGoodsPlanDetailReq.put("f9w5_smplatform_number", programVersionCode);
|
||||||
|
|
||||||
|
// //开始查询项目号
|
||||||
|
// String projectId = goodsPlanDetailData.getString("project_name__c") != null ? goodsPlanDetailData.getString("project_name__c") : "";
|
||||||
|
//
|
||||||
|
// //开始查询项目号
|
||||||
|
// JSONObject getProjectReq = crmRequestUtil.getCRMList(Arrays.asList(
|
||||||
|
// new Filter("EQ", "_id", Arrays.asList(projectId))
|
||||||
|
// ), "NewOpportunityObj");
|
||||||
|
//
|
||||||
|
// JSONObject projectRes = new JSONObject();
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// projectRes = restTemplate.postForObject(URLConstant.GET_CUSTOMIZE_LIST_URL, getProjectReq, JSONObject.class);
|
||||||
|
// } catch (RestClientException e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// String projectCode = "";
|
||||||
|
//
|
||||||
|
// if ("success".equals(projectRes.getString("errorDescription")) && !projectRes.getJSONObject("data").getJSONArray("dataList").isEmpty()) {
|
||||||
|
// JSONObject projectData = projectRes.getJSONObject("data").getJSONArray("dataList").getJSONObject(0);
|
||||||
|
// projectCode = projectData.getString("opportunity_id__c") != null ? projectData.getString("opportunity_id__c") : "";
|
||||||
|
// }
|
||||||
|
|
||||||
|
//项目号
|
||||||
|
erpGoodsPlanDetailReq.put("f9w5_project_number", goodsPlanDetailData.getString("project_no__c") != null ? goodsPlanDetailData.getString("project_no__c") : "");//项目号
|
||||||
|
|
||||||
goodsPlanDetailList.add(erpGoodsPlanDetailReq);
|
goodsPlanDetailList.add(erpGoodsPlanDetailReq);
|
||||||
|
|
||||||
@ -329,6 +348,11 @@ public class GoodsPlanController {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//判断明细是否存在
|
||||||
|
if (goodsPlanDetailList.isEmpty()) {
|
||||||
|
log.info("明细为空,将不再向下执行");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
erpGoodsPlanReq.put("billentry", goodsPlanDetailList);
|
erpGoodsPlanReq.put("billentry", goodsPlanDetailList);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user