北上广注册证,生产商根据标记推送,非采购供应商创建人根据泛微id查询

This commit is contained in:
sez 2025-12-10 11:41:04 +08:00
parent 5f571ca997
commit ba785762c9
5 changed files with 90 additions and 60 deletions

View File

@ -61,9 +61,9 @@ public class SupplierControl implements Serializable {
billStatus = false; billStatus = false;
} else { } else {
creator = BusinessDataServiceHelper.loadSingle("bos_user", creator = BusinessDataServiceHelper.loadSingle("bos_user",
new QFilter[]{new QFilter("number", QCP.equals, creator_number)}); new QFilter[]{new QFilter("entryentity.tqq9_fwuserid", QCP.equals, creator_number)});
if (null == creator) { if (null == creator) {
rowMsg.add("根据创建人工号" + creator_number + "】在金蝶系统中没有查询到对应的人员信息"); rowMsg.add("根据泛微人员id" + creator_number + "】在金蝶系统中没有查询到对应的人员信息");
billStatus = false; billStatus = false;
} }
} }

View File

@ -61,36 +61,44 @@ public class BGScsOpPlugin extends AbstractOperationServicePlugIn {
HashMap<String, String> headMap = new HashMap<>(); HashMap<String, String> headMap = new HashMap<>();
logger.info("北广生产商同步body" + jsonBody); logger.info("北广生产商同步body" + jsonBody);
try { try {
String result = HttpRequestUtils.postJson(BJ_URL + "/api/BA/Manufacturer", jsonBody, headMap); boolean tqq9_pushbj = dataEntity.getBoolean("tqq9_pushbj");
if (StringUtils.isNotEmpty(result)) { if (!tqq9_pushbj) {
ObjectMapper objectMapper = new ObjectMapper(); String result = HttpRequestUtils.postJson(BJ_URL + "/api/BA/Manufacturer", jsonBody, headMap);
JsonNode rootNode = objectMapper.readTree(result); if (StringUtils.isNotEmpty(result)) {
if (null != rootNode) { ObjectMapper objectMapper = new ObjectMapper();
String code = String.valueOf(rootNode.get("code")); JsonNode rootNode = objectMapper.readTree(result);
LCLogServiceImpl lcLogService = new LCLogServiceImpl(); if (null != rootNode) {
lcLogService.savelog("北京生产商同步", BJ_URL+ "/api/BA/Manufacturer", true, code.equals("0"), jsonBody, result); String code = String.valueOf(rootNode.get("code"));
lcLogService.isSuccess("tqq9_proxyandfactory", number, "number", "tqq9_pushw", code.equals("0")); LCLogServiceImpl lcLogService = new LCLogServiceImpl();
lcLogService.savelog("北京生产商同步", BJ_URL + "/api/BA/Manufacturer", true, code.equals("0"), jsonBody, result);
lcLogService.isSuccess("tqq9_proxyandfactory", number, "number", "tqq9_pushbj", code.equals("0"));
}
logger.info("北京生产商同步结果:" + result);
} }
logger.info("北京生产商同步结果:" + result);
} }
} catch (IOException ex) { } catch (IOException ex) {
throw new RuntimeException(ex); throw new RuntimeException(ex);
} }
//广州 //广州
try { try {
String result = HttpRequestUtils.postJson(GZ_URL + "/api/BA/Manufacturer", jsonBody, headMap); boolean tqq9_pushgz = dataEntity.getBoolean("tqq9_pushgz");
if (StringUtils.isNotEmpty(result)) { if (!tqq9_pushgz) {
ObjectMapper objectMapper = new ObjectMapper(); String result = HttpRequestUtils.postJson(GZ_URL + "/api/BA/Manufacturer", jsonBody, headMap);
JsonNode rootNode = objectMapper.readTree(result); if (StringUtils.isNotEmpty(result)) {
if (null != rootNode) { ObjectMapper objectMapper = new ObjectMapper();
String code = String.valueOf(rootNode.get("code")); JsonNode rootNode = objectMapper.readTree(result);
LCLogServiceImpl lcLogService = new LCLogServiceImpl(); if (null != rootNode) {
lcLogService.savelog("广州生产商同步", GZ_URL+ "/api/BA/Manufacturer", true, code.equals("0"), jsonBody, result); String code = String.valueOf(rootNode.get("code"));
lcLogService.isSuccess("tqq9_proxyandfactory", number, "number", "tqq9_pushw", code.equals("0")); LCLogServiceImpl lcLogService = new LCLogServiceImpl();
lcLogService.savelog("广州生产商同步", GZ_URL + "/api/BA/Manufacturer", true, code.equals("0"), jsonBody, result);
lcLogService.isSuccess("tqq9_proxyandfactory", number, "number", "tqq9_pushgz", code.equals("0"));
}
logger.info("广州生产商同步结果:" + result);
} }
logger.info("广州生产商同步结果:" + result);
} }
} catch (IOException ex) { } catch (IOException ex) {
throw new RuntimeException(ex); throw new RuntimeException(ex);
} }

View File

@ -140,35 +140,43 @@ public class BGZczOpPlugin extends AbstractOperationServicePlugIn {
logger.info("广州注册证body" + gzjsonBody); logger.info("广州注册证body" + gzjsonBody);
//北京 //北京
try { try {
String result = HttpRequestUtils.postJson(BJ_URL + "/api/BA/Registration", bjjsonBody, null); boolean tqq9_pushbj = dataEntity.getBoolean("tqq9_pushbj");
if (StringUtils.isNotEmpty(result)) { if (!tqq9_pushbj) {
ObjectMapper objectMapper = new ObjectMapper(); String result = HttpRequestUtils.postJson(BJ_URL + "/api/BA/Registration", bjjsonBody, null);
JsonNode rootNode = objectMapper.readTree(result); if (StringUtils.isNotEmpty(result)) {
if (null != rootNode) { ObjectMapper objectMapper = new ObjectMapper();
String code = String.valueOf(rootNode.get("code")); JsonNode rootNode = objectMapper.readTree(result);
LCLogServiceImpl lcLogService = new LCLogServiceImpl(); if (null != rootNode) {
lcLogService.savelog("北京注册证同步", BJ_URL+ "/api/BA/Registration", true, code.equals("0"), bjjsonBody, result); String code = String.valueOf(rootNode.get("code"));
lcLogService.isSuccess("tqq9_registration", number, "number", "tqq9_pushw", code.equals("0")); LCLogServiceImpl lcLogService = new LCLogServiceImpl();
lcLogService.savelog("北京注册证同步", BJ_URL + "/api/BA/Registration", true, code.equals("0"), bjjsonBody, result);
lcLogService.isSuccess("tqq9_registration", number, "number", "tqq9_pushbj", code.equals("0"));
}
logger.info("北京注册证同步结果:" + result);
} }
logger.info("北京注册证同步结果:" + result);
} }
} catch (IOException ex) { } catch (IOException ex) {
throw new RuntimeException(ex); throw new RuntimeException(ex);
} }
//广州 //广州
try { try {
String result = HttpRequestUtils.postJson(GZ_URL + "/api/BA/Registration", gzjsonBody, null); boolean tqq9_pushgz = dataEntity.getBoolean("tqq9_pushgz");
if (StringUtils.isNotEmpty(result)) { if (!tqq9_pushgz) {
ObjectMapper objectMapper = new ObjectMapper(); String result = HttpRequestUtils.postJson(GZ_URL + "/api/BA/Registration", gzjsonBody, null);
JsonNode rootNode = objectMapper.readTree(result); if (StringUtils.isNotEmpty(result)) {
if (null != rootNode) { ObjectMapper objectMapper = new ObjectMapper();
String code = String.valueOf(rootNode.get("code")); JsonNode rootNode = objectMapper.readTree(result);
LCLogServiceImpl lcLogService = new LCLogServiceImpl(); if (null != rootNode) {
lcLogService.savelog("广州注册证同步", GZ_URL+ "/api/BA/Registration", true, code.equals("0"), bjjsonBody, result); String code = String.valueOf(rootNode.get("code"));
lcLogService.isSuccess("tqq9_registration", number, "number", "tqq9_pushw", code.equals("0")); LCLogServiceImpl lcLogService = new LCLogServiceImpl();
lcLogService.savelog("广州注册证同步", GZ_URL + "/api/BA/Registration", true, code.equals("0"), bjjsonBody, result);
lcLogService.isSuccess("tqq9_registration", number, "number", "tqq9_pushgz", code.equals("0"));
}
logger.info("广州注册证同步结果:" + result);
} }
logger.info("广州注册证同步结果:" + result);
} }
} catch (IOException ex) { } catch (IOException ex) {
throw new RuntimeException(ex); throw new RuntimeException(ex);
} }

View File

@ -43,6 +43,9 @@ public class WmsScsSyncOpPlugin extends AbstractOperationServicePlugIn {
e.getFieldKeys().add("name"); e.getFieldKeys().add("name");
e.getFieldKeys().add("tqq9_address"); e.getFieldKeys().add("tqq9_address");
e.getFieldKeys().add("tqq9_proaddress"); e.getFieldKeys().add("tqq9_proaddress");
e.getFieldKeys().add("tqq9_pushw");
e.getFieldKeys().add("tqq9_pushgz");
e.getFieldKeys().add("tqq9_pushbj");
} }
@Override @Override
@ -117,18 +120,22 @@ public class WmsScsSyncOpPlugin extends AbstractOperationServicePlugIn {
String ttx_mainUrl = ConfigUtils.getThirdConfigByNumber("Ttx_MainURL"); String ttx_mainUrl = ConfigUtils.getThirdConfigByNumber("Ttx_MainURL");
ttx_mainUrl = ttx_mainUrl + "?method=manufacturer.create&v=2.0&format=xml&customerId=" + ttx_customerId; ttx_mainUrl = ttx_mainUrl + "?method=manufacturer.create&v=2.0&format=xml&customerId=" + ttx_customerId;
try { try {
String result = HttpRequestUtils.postXml(ttx_mainUrl, xmlBuilder.toString(), headMap); boolean tqq9_pushw = dataEntity.getBoolean("tqq9_pushw");
if (StringUtils.isNotEmpty(result)) { if (!tqq9_pushw) {
JSONObject jsonObject = HttpRequestUtils.xmlToJson(result); String result = HttpRequestUtils.postXml(ttx_mainUrl, xmlBuilder.toString(), headMap);
JSONObject response = jsonObject.getJSONObject("response"); if (StringUtils.isNotEmpty(result)) {
String code = response.getString("code"); JSONObject jsonObject = HttpRequestUtils.xmlToJson(result);
JSONObject response = jsonObject.getJSONObject("response");
String code = response.getString("code");
LCLogServiceImpl lcLogService = new LCLogServiceImpl(); LCLogServiceImpl lcLogService = new LCLogServiceImpl();
lcLogService.savelog("wms生产商同步", ttx_mainUrl, true, code.equals("200"), xmlBuilder.toString(), result); lcLogService.savelog("wms生产商同步", ttx_mainUrl, true, code.equals("200"), xmlBuilder.toString(), result);
lcLogService.isSuccess("tqq9_proxyandfactory", number1, "number", "tqq9_pushw", code.equals("200")); lcLogService.isSuccess("tqq9_proxyandfactory", number1, "number", "tqq9_pushw", code.equals("200"));
logger.info("wms生产商同步接口结果" + result); logger.info("wms生产商同步接口结果" + result);
}
} }
} catch (IOException ex) { } catch (IOException ex) {
throw new RuntimeException(ex); throw new RuntimeException(ex);
} }

View File

@ -50,6 +50,9 @@ public class WmsZczSyncOpPlugin extends AbstractOperationServicePlugIn {
e.getFieldKeys().add("tqq9_proxyno"); e.getFieldKeys().add("tqq9_proxyno");
e.getFieldKeys().add("tqq9_entry.tqq9_e_supno"); e.getFieldKeys().add("tqq9_entry.tqq9_e_supno");
e.getFieldKeys().add("enable"); e.getFieldKeys().add("enable");
e.getFieldKeys().add("tqq9_pushw");
e.getFieldKeys().add("tqq9_pushgz");
e.getFieldKeys().add("tqq9_pushbj");
} }
@Override @Override
@ -169,17 +172,21 @@ public class WmsZczSyncOpPlugin extends AbstractOperationServicePlugIn {
String ttx_mainUrl = ConfigUtils.getThirdConfigByNumber("Ttx_MainURL"); String ttx_mainUrl = ConfigUtils.getThirdConfigByNumber("Ttx_MainURL");
ttx_mainUrl = ttx_mainUrl + "?method=registrationcertificate.create&v=2.0&format=xml&customerId=" + ttx_customerId; ttx_mainUrl = ttx_mainUrl + "?method=registrationcertificate.create&v=2.0&format=xml&customerId=" + ttx_customerId;
try { try {
String result = HttpRequestUtils.postXml(ttx_mainUrl, xmlBuilder.toString(), headMap); boolean tqq9_pushw = dataEntity.getBoolean("tqq9_pushw");
if (StringUtils.isNotEmpty(result)) { if (!tqq9_pushw) {
JSONObject jsonObject = HttpRequestUtils.xmlToJson(result); String result = HttpRequestUtils.postXml(ttx_mainUrl, xmlBuilder.toString(), headMap);
JSONObject response = jsonObject.getJSONObject("response"); if (StringUtils.isNotEmpty(result)) {
String code = response.getString("code"); JSONObject jsonObject = HttpRequestUtils.xmlToJson(result);
LCLogServiceImpl lcLogService = new LCLogServiceImpl(); JSONObject response = jsonObject.getJSONObject("response");
lcLogService.savelog("wms注册证同步", ttx_mainUrl, true, code.equals("200"), xmlBuilder.toString(), result); String code = response.getString("code");
lcLogService.isSuccess("tqq9_registration", number, "number", "tqq9_pushw", code.equals("200")); LCLogServiceImpl lcLogService = new LCLogServiceImpl();
lcLogService.savelog("wms注册证同步", ttx_mainUrl, true, code.equals("200"), xmlBuilder.toString(), result);
lcLogService.isSuccess("tqq9_registration", number, "number", "tqq9_pushw", code.equals("200"));
logger.info("wms注册证接口结果" + result); logger.info("wms注册证接口结果" + result);
}
} }
} catch (IOException ex) { } catch (IOException ex) {
throw new RuntimeException(ex); throw new RuntimeException(ex);
} }