From 07bff1f9178267497db9c63d72ae247becf4b927 Mon Sep 17 00:00:00 2001 From: 14391 <1439194698@qq.com> Date: Mon, 20 Oct 2025 17:27:06 +0800 Subject: [PATCH] 1020 --- .../app/plugin/operate/sys/wmsZczPostApi.java | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lc123/cloud/app/plugin/operate/sys/wmsZczPostApi.java b/lc123/cloud/app/plugin/operate/sys/wmsZczPostApi.java index 0ee0c69..ff7190f 100644 --- a/lc123/cloud/app/plugin/operate/sys/wmsZczPostApi.java +++ b/lc123/cloud/app/plugin/operate/sys/wmsZczPostApi.java @@ -11,6 +11,7 @@ import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.AttachmentServiceHelper; import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.util.StringUtils; import kd.sdk.plugin.Plugin; import tqq9.lc123.cloud.app.plugin.utils.HttpRequestUtils; @@ -44,7 +45,7 @@ public class wmsZczPostApi extends AbstractBillPlugIn implements Plugin { DynamicObject dataEntity = model.getDataEntity(); String number = dataEntity.getString("number"); - if ("audit" .equals(operateKey)) { + if ("audit".equals(operateKey)) { DynamicObject file = BusinessDataServiceHelper.loadSingle("tqq9_registration", "id,tqq9_attachmentpanelbj,tqq9_supplier.number,tqq9_supplier.tqq9_prolicense,tqq9_entry,tqq9_entry.tqq9_e_supplier", new QFilter[]{new QFilter("number", QFilter.equals, number)}); DynamicObjectCollection tqq9_entry = file.getDynamicObjectCollection("tqq9_entry"); @@ -57,11 +58,17 @@ public class wmsZczPostApi extends AbstractBillPlugIn implements Plugin { if (tqq9_e_supplier != null) { HashMap map = new HashMap<>(); String number2 = tqq9_e_supplier.getString("number"); - DynamicObject file2 = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", "id,number,name,tqq9_prolicense", + DynamicObject file2 = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", "id,number,name,tqq9_prolicense,tqq9_type", new QFilter[]{new QFilter("number", QFilter.equals, number2)}); String MFCode = file2.getString("number"); String name = file2.getString("name"); String ProLicenceCode = file2.getString("tqq9_prolicense"); + String tqq9_type = file2.getString("tqq9_type");//厂商类型 + if (StringUtils.isNotEmpty(tqq9_type) && tqq9_type.contains("B")) { + map.put("isAgent", "Y");//代理商 + } else { + map.put("isAgent", "N"); + } map.put("manufactoryCode", MFCode); map.put("manufactoryName", name); map.put("proLicenceCode", ProLicenceCode); @@ -92,15 +99,14 @@ public class wmsZczPostApi extends AbstractBillPlugIn implements Plugin { // 是否有效, Y/N (默认为Y) String yxqs = ""; Date tqq9_startdate = dataEntity.getDate("tqq9_startdate"); - if (tqq9_startdate !=null){ - yxqs = sdf.format(dataEntity.getDate("tqq9_startdate"));//有效期至 + if (tqq9_startdate != null) { + yxqs = sdf.format(tqq9_startdate);//有效期至 } String yxqz = ""; - String tqq9_enddate = sdf.format(dataEntity.getDate("tqq9_enddate"));//有效期至 + Date tqq9_enddate = dataEntity.getDate("tqq9_enddate");//有效期至 if (tqq9_enddate != null) { - yxqs = sdf.format(dataEntity.getDate("tqq9_enddate"));//有效期至 + yxqz = sdf.format(tqq9_enddate);//有效期至 } - String cRemark = dataEntity.getString("tqq9_remark");//备注 String modifytime = sdf.format(dataEntity.getDate("modifytime"));//修改时间 String IsImportation = dataEntity.getString("tqq9_type").equals("A") ? "Y" : "N";//是否进口 Map request = new HashMap<>(); @@ -114,18 +120,19 @@ public class wmsZczPostApi extends AbstractBillPlugIn implements Plugin { request.put("updateTime", modifytime); request.put("urlPathList", urlPathList); request.put("manufactoryList", manufactoryList); + request.put("key1", dataEntity.getString("tqq9_remark"));//备注 // 最终的外层Map Map finalMap = new HashMap<>(); finalMap.put("request", request); StringBuilder xmlBuilder = new StringBuilder(); xmlBuilder.append("\n"); buildXml(xmlBuilder, finalMap, 0); - System.out.println("xmlBuilder:"+xmlBuilder); + System.out.println("xmlBuilder:" + xmlBuilder); HashMap headMap = new HashMap<>(); try { - String s = HttpRequestUtils.postXml(WMS_URL+ "?method=registrationcertificate.create&v=2.0&format=xml&customerId=123", xmlBuilder.toString(), headMap); - logger.info("wms注册证接口回传日志:"+s); + String s = HttpRequestUtils.postXml(WMS_URL + "?method=registrationcertificate.create&v=2.0&format=xml&customerId=123", xmlBuilder.toString(), headMap); + logger.info("wms注册证接口回传日志:" + s); System.out.println(s); } catch (IOException ex) { throw new RuntimeException(ex);