Merge remote-tracking branch 'origin/master'
This commit is contained in:
		
						commit
						c32f3dc2cc
					
				|  | @ -6,6 +6,8 @@ import java.io.Serializable; | |||
| 
 | ||||
| public class WMSXmlReturn implements Serializable { | ||||
| 
 | ||||
|     public static final long seid=1L; | ||||
| 
 | ||||
|     @ApiParam("返回结果") | ||||
|     private Response response; | ||||
| 
 | ||||
|  | @ -17,9 +19,14 @@ public class WMSXmlReturn implements Serializable { | |||
|         this.response = response; | ||||
|     } | ||||
| 
 | ||||
|     public WMSXmlReturn() { | ||||
|     } | ||||
| 
 | ||||
|     public WMSXmlReturn(Response response) { | ||||
|         this.response = response; | ||||
|     } | ||||
| 
 | ||||
|     public static class Response { | ||||
|     public static class Response implements Serializable { | ||||
| 
 | ||||
| 
 | ||||
|         @ApiParam("flag") | ||||
|  |  | |||
|  | @ -1,11 +1,18 @@ | |||
| package tqq9.lc123.cloud.app.api.plugin; | ||||
| 
 | ||||
| import kd.bos.logging.Log; | ||||
| import kd.bos.logging.LogFactory; | ||||
| import kd.bos.openapi.api.plugin.ApiSerializerPlugin; | ||||
| import kd.bos.openapi.api.plugin.SerializerResult; | ||||
| import kd.bos.openapi.common.result.OpenApiResult; | ||||
| import tqq9.lc123.cloud.app.api.model.WMSXmlReturn; | ||||
| 
 | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
| 
 | ||||
| public class WMSApiSerializerPlugin implements ApiSerializerPlugin { | ||||
|     private final static Log logger = LogFactory.getLog(WMSApiSerializerPlugin.class); | ||||
| 
 | ||||
|     @Override | ||||
|     public SerializerResult serialize(Object response, String accept, String contentTyp){ | ||||
|         if (contentTyp.contains("xml")) { | ||||
|  | @ -13,12 +20,37 @@ public class WMSApiSerializerPlugin implements ApiSerializerPlugin { | |||
|             Object data = openApiResult.getData(); | ||||
|             if(data!=null){ | ||||
|                 String errorCode = openApiResult.getErrorCode(); | ||||
|                 if(data instanceof Map){ | ||||
|                     HashMap data1 = (HashMap) data; | ||||
|                     logger.info("WMSApiSerializerPlugin map"+data1.toString()); | ||||
|                     HashMap<String, Object> response1 = (HashMap<String, Object>) data1.get("response"); | ||||
| 
 | ||||
|                     StringBuilder sb = new StringBuilder(); | ||||
| 
 | ||||
|                     // 构建 XML 格式的字符串 | ||||
|                     sb.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); | ||||
|                     sb.append("<response>\n"); | ||||
| 
 | ||||
|                     sb.append("<flag>").append(response1.get("flag").toString()).append("</flag>\n"); | ||||
|                     sb.append("<code>").append(response1.get("code").toString()).append("</code>\n"); | ||||
|                     sb.append("<message>").append(response1.get("message").toString()).append("</message>\n"); | ||||
| 
 | ||||
|                     sb.append("</response>"); | ||||
|                     logger.info("WMSApiSerializerPlugin map"+sb.toString()); | ||||
| 
 | ||||
|                     SerializerResult serializerResult = new SerializerResult(contentTyp,sb.toString()); | ||||
|                     return serializerResult; | ||||
|                 }else{ | ||||
|                     WMSXmlReturn wmsXmlReturn = (WMSXmlReturn) data; | ||||
|                     WMSXmlReturn.Response response1 = wmsXmlReturn.getResponse(); | ||||
|                     response1.setCode(errorCode); | ||||
|                     SerializerResult serializerResult = new SerializerResult(contentTyp,response1.toString()); | ||||
|                     logger.info("WMSApiSerializerPlugin map"+response1.toString()); | ||||
| 
 | ||||
|                     return serializerResult; | ||||
|                 } | ||||
| 
 | ||||
|             } | ||||
|         } | ||||
|         return null; | ||||
|     } | ||||
|  |  | |||
|  | @ -168,8 +168,8 @@ public class PayBillOperationPlugin extends AbstractOperationServicePlugIn imple | |||
|             //采购订单 | ||||
|             DynamicObject pm_purorderbill = BusinessDataServiceHelper.loadSingle("pm_purorderbill", new QFilter[]{new QFilter("billno", QCP.equals, corebillno)}); | ||||
|             Boolean tqq9_isrebatecalculate = pm_purorderbill.getBoolean("tqq9_isrebatecalculate");//是否已计算返利 | ||||
| 
 | ||||
|             if (pm_purorderbill != null && !tqq9_isrebatecalculate) { | ||||
|             String operationKey = e.getOperationKey(); | ||||
|             if (pm_purorderbill != null &&tqq9_isrebatecalculate&&StringUtils.equals("pay",operationKey)) { | ||||
|                 BigDecimal tqq9_hshfsyje = pm_purorderbill.getBigDecimal("tqq9_hshfsyje");//含税货返使用金额 | ||||
|                 BigDecimal tqq9_hsxfsyje = pm_purorderbill.getBigDecimal("tqq9_hsxfsyje");//含税现返使用金额 | ||||
|                 String tqq9_hfid = pm_purorderbill.getString("tqq9_hfid");//货返id | ||||
|  |  | |||
|  | @ -1,11 +1,14 @@ | |||
| package tqq9.lc123.cloud.app.plugin.operate.conm; | ||||
| 
 | ||||
| import com.alibaba.fastjson.JSONObject; | ||||
| import kd.bos.dataentity.entity.DynamicObject; | ||||
| import kd.bos.entity.operate.result.OperationResult; | ||||
| import kd.bos.entity.plugin.AbstractOperationServicePlugIn; | ||||
| import kd.bos.entity.plugin.args.AfterOperationArgs; | ||||
| import kd.bos.servicehelper.BusinessDataServiceHelper; | ||||
| import kd.bos.servicehelper.QueryServiceHelper; | ||||
| import kd.bos.servicehelper.operation.SaveServiceHelper; | ||||
| import org.apache.commons.lang3.StringUtils; | ||||
| import tqq9.lc123.cloud.app.plugin.trd.FWImpl; | ||||
| 
 | ||||
| import java.util.List; | ||||
|  | @ -32,21 +35,21 @@ public class PurconmSubmitToFwOp extends AbstractOperationServicePlugIn { | |||
|                 boolean existChange = QueryServiceHelper.exists("conm_xpurcontract", successPkId); | ||||
|                 if(existChange){ | ||||
|                     bill = BusinessDataServiceHelper.loadSingle(successPkId, "conm_xpurcontract"); | ||||
|                     resultStr = FWImpl.pushFwPurChange(bill); | ||||
|                     resultStr = FWImpl.pushFwPurconmChange(bill); | ||||
|                 } | ||||
|             } | ||||
|             if(StringUtils.isNotBlank(resultStr)){ | ||||
|                 JSONObject resultObj = JSONObject.parseObject(resultStr); | ||||
|                 String code = resultObj.getString("code"); | ||||
|                 if("SUCCESS".equals(code)){ | ||||
|                     JSONObject data = resultObj.getJSONObject("data"); | ||||
|                     if(data != null){ | ||||
|                         String requestid = data.getString("requestid"); | ||||
|                         bill.set("tqq9_fwrequestid", requestid); | ||||
|                         SaveServiceHelper.save(new DynamicObject[]{bill}); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
| //            if(StringUtils.isNotBlank(resultStr)){ | ||||
| //                JSONObject resultObj = JSONObject.parseObject(resultStr); | ||||
| //                String code = resultObj.getString("code"); | ||||
| //                if("SUCCESS".equals(code)){ | ||||
| //                    JSONObject data = resultObj.getJSONObject("data"); | ||||
| //                    if(data != null){ | ||||
| //                        String requestid = data.getString("requestid"); | ||||
| //                        bill.set("tqq9_fwrequestid", requestid); | ||||
| //                        SaveServiceHelper.save(new DynamicObject[]{bill}); | ||||
| //                    } | ||||
| //                } | ||||
| //            } | ||||
|              | ||||
|         } | ||||
|     } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue