This commit is contained in:
2022-11-24 16:01:59 +08:00
parent dde7740d79
commit c1caf24ad7
9 changed files with 215 additions and 79 deletions

View File

@@ -1,11 +1,14 @@
package org.nl.wms.ext.crm.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.utils.SecurityUtils;
import org.nl.modules.wql.WQL;
import org.nl.wms.ext.crm.service.CrmToLmsService;
import org.nl.modules.wql.core.bean.WQLObject;
@@ -54,6 +57,30 @@ public class CrmToLmsServiceImpl implements CrmToLmsService {
WQLObject.getWQLObject("MD_CS_CustomerBaseProc").insert(jo);
log.info(jo.toString());
//插入客户表
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
JSONObject customer_jo = WQLObject.getWQLObject("").query("cust_code = '"+customer_name+"'").uniqueResult(0);
if (ObjectUtil.isEmpty(customer_jo)){
customer_jo = new JSONObject();
customer_jo.put("cust_id",IdUtil.getSnowflake(1,1).nextId());
customer_jo.put("cust_code",customer_name);
customer_jo.put("cust_name",description);
customer_jo.put("create_id",currentUserId);
customer_jo.put("create_name",nickName);
customer_jo.put("create_time",now);
customer_jo.put("update_optid",currentUserId);
customer_jo.put("update_optname",nickName);
customer_jo.put("update_time",now);
WQLObject.getWQLObject("md_cs_customerbase").insert(customer_jo);
}else {
customer_jo.put("cust_name",description);
WQLObject.getWQLObject("md_cs_customerbase").update(customer_jo);
}
JSONObject result = new JSONObject();
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");

View File

@@ -882,7 +882,31 @@ public class MesToLmsServiceImpl implements MesToLmsService {
String is_mesTolms = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("is_mesTolms").getValue();
if (StrUtil.equals(is_mesTolms, "1")) {
String ContainerName = param.getString("ContainerName");
String SaleOrderName = param.getString("SaleOrderName");
String isUnPlanProduction = param.getString("isUnPlanProduction");
if (isUnPlanProduction.equals("1")){
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("container_name = '"+ContainerName+"'").uniqueResult(0);
/*sub_jo.put("change_type_scode","02");
sub_jo.put("create_id",currentUserId);
sub_jo.put("create_name",nickName);
sub_jo.put("change_time",DateUtil.now());
sub_jo.put("workorder_id",IdUtil.getSnowflake(1, 1).nextId() + "");
WQLObject.getWQLObject("PDM_BI_SubPackageRelationChangeFlow").insert(sub_jo);*/
sub_jo.put("sale_order_name",SaleOrderName);
WQLObject.getWQLObject("pdm_bi_subpackagerelation").update(sub_jo);
/*JSONObject new_sub = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("container_name = '"+ContainerName+"' AND status = '2'").uniqueResult(0);
new_sub.put("change_type_scode","01");
new_sub.put("create_id",currentUserId);
new_sub.put("create_name",nickName);
new_sub.put("change_time",DateUtil.now());
new_sub.put("workorder_id",IdUtil.getSnowflake(1, 1).nextId() + "");
WQLObject.getWQLObject("PDM_BI_SubPackageRelationChangeFlow").insert(new_sub);*/
}
}
JSONObject result = new JSONObject();

View File

@@ -54,7 +54,8 @@ public class LmsToSapServiceImpl implements LmsToSapService {
String api = "";
url = url + "/sap/center/wms/004";
try {
String resultMsg = HttpRequest.post(url).header("TOKEN","FA163EE139D41EED9286BB7E1A2F8D4C")
String resultMsg = HttpRequest.post(url).header("TOKEN","877734686FA61EDD99E9D85A96D91E14")
.header("sap-client","800")
.body(String.valueOf(jo))
.execute().body();
result = JSONObject.parseObject(resultMsg);
@@ -115,10 +116,11 @@ public class LmsToSapServiceImpl implements LmsToSapService {
// String url = acsUrl + api;
String url = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("SAP_URL").getValue();
String api = "";
String api = "/sap/center/wms/005";
url = url + api;
try {
String resultMsg = HttpRequest.post(url)
String resultMsg = HttpRequest.post(url).header("TOKEN","877734686FA61EDD99E9D85A96D91E14")
.header("sap-client","800")
.body(String.valueOf(jo))
.execute().body();
result = JSONObject.parseObject(resultMsg);

View File

@@ -44,10 +44,12 @@ public class SubpackagerelationServiceImpl implements SubpackagerelationService
String sale_order_name = MapUtil.getStr(whereJson, "sale_order_name");
String customer_name = MapUtil.getStr(whereJson, "customer_name");
String customer_description = MapUtil.getStr(whereJson, "customer_description");
String package_box_sn = MapUtil.getStr(whereJson, "package_box_sn");
JSONObject map = new JSONObject();
map.put("flag", "1");
if (ObjectUtil.isNotEmpty(material_code)) map.put("material_code","%"+material_code+"%");
if (ObjectUtil.isNotEmpty(package_box_sn)) map.put("package_box_sn","%"+package_box_sn+"%");
if (ObjectUtil.isNotEmpty(material_name)) map.put("material_name","%"+material_name+"%");
if (ObjectUtil.isNotEmpty(sale_order_name)) map.put("sale_order_name","%"+sale_order_name+"%");
if (ObjectUtil.isNotEmpty(customer_name)) map.put("customer_name","%"+customer_name+"%");

View File

@@ -19,6 +19,7 @@
输入.sale_order_name TYPEAS s_string
输入.customer_name TYPEAS s_string
输入.customer_description TYPEAS s_string
输入.package_box_sn TYPEAS s_string
[临时表]
@@ -55,6 +56,10 @@
product_name LIKE 输入.material_code
ENDOPTION
OPTION 输入.package_box_sn <> ""
package_box_sn LIKE 输入.package_box_sn
ENDOPTION
OPTION 输入.material_name <> ""
product_description LIKE 输入.material_name
ENDOPTION