1020
This commit is contained in:
		
							parent
							
								
									61ffe0d181
								
							
						
					
					
						commit
						07bff1f917
					
				|  | @ -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<String, String> 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 { | |||
|             //	<status>是否有效, Y/N (默认为Y) </ status> | ||||
|             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<String, Object> 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<String, Object> finalMap = new HashMap<>(); | ||||
|             finalMap.put("request", request); | ||||
|             StringBuilder xmlBuilder = new StringBuilder(); | ||||
|             xmlBuilder.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); | ||||
|             buildXml(xmlBuilder, finalMap, 0); | ||||
|             System.out.println("xmlBuilder:"+xmlBuilder); | ||||
|             System.out.println("xmlBuilder:" + xmlBuilder); | ||||
| 
 | ||||
|             HashMap<String, String> 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); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue