parent
5861d261ef
commit
87ba54fa88
|
|
@ -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,11 +20,36 @@ public class WMSApiSerializerPlugin implements ApiSerializerPlugin {
|
|||
Object data = openApiResult.getData();
|
||||
if(data!=null){
|
||||
String errorCode = openApiResult.getErrorCode();
|
||||
WMSXmlReturn wmsXmlReturn = (WMSXmlReturn) data;
|
||||
WMSXmlReturn.Response response1 = wmsXmlReturn.getResponse();
|
||||
response1.setCode(errorCode);
|
||||
SerializerResult serializerResult = new SerializerResult(contentTyp,response1.toString());
|
||||
return serializerResult;
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -34,56 +34,56 @@ public class BaseDataPlugin extends AbstractFormPlugin implements Plugin {
|
|||
DynamicObject creator = dataEntity.getDynamicObject("creator");
|
||||
DynamicObject bos_user = BusinessDataServiceHelper.loadSingle("bos_user", new QFilter[]{new QFilter("id", QCP.equals, creator.getLong("id"))});
|
||||
DynamicObjectCollection entryentity = bos_user.getDynamicObjectCollection("entryentity");
|
||||
DynamicObject dept=null;
|
||||
DynamicObject dept = null;
|
||||
for (DynamicObject dynamicObject : entryentity) {
|
||||
boolean ispartjob = dynamicObject.getBoolean("ispartjob");
|
||||
if (!ispartjob){
|
||||
dept=dynamicObject.getDynamicObject("dpt");
|
||||
if (!ispartjob) {
|
||||
dept = dynamicObject.getDynamicObject("dpt");
|
||||
}
|
||||
}
|
||||
model.setValue("tqq9_dept",dept);
|
||||
model.setValue("tqq9_dept", dept);
|
||||
this.getView().updateView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChanged(PropertyChangedArgs e) {
|
||||
public void propertyChanged(PropertyChangedArgs e) {
|
||||
super.propertyChanged(e);
|
||||
String key = e.getProperty().getName();
|
||||
if (StringUtils.equals("tqq9_registration", key)) {
|
||||
StringBuilder stringBuilder=new StringBuilder();
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
ChangeData[] changeSet = e.getChangeSet();
|
||||
ChangeData changeData = changeSet[0];
|
||||
int rowIndex = changeData.getRowIndex();
|
||||
DynamicObject newValue = (DynamicObject)changeData.getNewValue();
|
||||
if(newValue!=null){
|
||||
DynamicObject newValue = (DynamicObject) changeData.getNewValue();
|
||||
if (newValue != null) {
|
||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("id", QCP.equals, newValue.getLong("id"))});
|
||||
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||
for (DynamicObject entry : tqq9_entry) {
|
||||
String supno = entry.getString("tqq9_e_supno");
|
||||
stringBuilder.append("#").append(supno);
|
||||
}
|
||||
if(StringUtils.isNotBlank(stringBuilder.toString())){
|
||||
if (StringUtils.isNotBlank(stringBuilder.toString())) {
|
||||
String substring = stringBuilder.substring(1);
|
||||
this.getModel().setValue("tqq9_licenseno",substring,rowIndex);
|
||||
this.getModel().setValue("tqq9_licenseno", substring, rowIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.equals("tqq9_zczh", key)) {
|
||||
StringBuilder stringBuilder=new StringBuilder();
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
ChangeData[] changeSet = e.getChangeSet();
|
||||
ChangeData changeData = changeSet[0];
|
||||
int rowIndex = changeData.getRowIndex();
|
||||
DynamicObject newValue = (DynamicObject)changeData.getNewValue();
|
||||
if(newValue!=null){
|
||||
DynamicObject newValue = (DynamicObject) changeData.getNewValue();
|
||||
if (newValue != null) {
|
||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("id", QCP.equals, newValue.getLong("id"))});
|
||||
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||
for (DynamicObject entry : tqq9_entry) {
|
||||
String supno = entry.getString("tqq9_e_supno");
|
||||
stringBuilder.append("#").append(supno);
|
||||
}
|
||||
if(StringUtils.isNotBlank(stringBuilder.toString())){
|
||||
if (StringUtils.isNotBlank(stringBuilder.toString())) {
|
||||
String substring = stringBuilder.substring(1);
|
||||
this.getModel().setValue("tqq9_licenseno",substring,rowIndex);
|
||||
this.getModel().setValue("tqq9_licenseno", substring, rowIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue