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 class WMSXmlReturn implements Serializable {
|
||||||
|
|
||||||
|
public static final long seid=1L;
|
||||||
|
|
||||||
@ApiParam("返回结果")
|
@ApiParam("返回结果")
|
||||||
private Response response;
|
private Response response;
|
||||||
|
|
||||||
|
|
@ -17,9 +19,14 @@ public class WMSXmlReturn implements Serializable {
|
||||||
this.response = response;
|
this.response = response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public WMSXmlReturn() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public WMSXmlReturn(Response response) {
|
||||||
|
this.response = response;
|
||||||
|
}
|
||||||
|
|
||||||
public static class Response {
|
public static class Response implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
@ApiParam("flag")
|
@ApiParam("flag")
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,18 @@
|
||||||
package tqq9.lc123.cloud.app.api.plugin;
|
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.ApiSerializerPlugin;
|
||||||
import kd.bos.openapi.api.plugin.SerializerResult;
|
import kd.bos.openapi.api.plugin.SerializerResult;
|
||||||
import kd.bos.openapi.common.result.OpenApiResult;
|
import kd.bos.openapi.common.result.OpenApiResult;
|
||||||
import tqq9.lc123.cloud.app.api.model.WMSXmlReturn;
|
import tqq9.lc123.cloud.app.api.model.WMSXmlReturn;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class WMSApiSerializerPlugin implements ApiSerializerPlugin {
|
public class WMSApiSerializerPlugin implements ApiSerializerPlugin {
|
||||||
|
private final static Log logger = LogFactory.getLog(WMSApiSerializerPlugin.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SerializerResult serialize(Object response, String accept, String contentTyp){
|
public SerializerResult serialize(Object response, String accept, String contentTyp){
|
||||||
if (contentTyp.contains("xml")) {
|
if (contentTyp.contains("xml")) {
|
||||||
|
|
@ -13,12 +20,37 @@ public class WMSApiSerializerPlugin implements ApiSerializerPlugin {
|
||||||
Object data = openApiResult.getData();
|
Object data = openApiResult.getData();
|
||||||
if(data!=null){
|
if(data!=null){
|
||||||
String errorCode = openApiResult.getErrorCode();
|
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 wmsXmlReturn = (WMSXmlReturn) data;
|
||||||
WMSXmlReturn.Response response1 = wmsXmlReturn.getResponse();
|
WMSXmlReturn.Response response1 = wmsXmlReturn.getResponse();
|
||||||
response1.setCode(errorCode);
|
response1.setCode(errorCode);
|
||||||
SerializerResult serializerResult = new SerializerResult(contentTyp,response1.toString());
|
SerializerResult serializerResult = new SerializerResult(contentTyp,response1.toString());
|
||||||
|
logger.info("WMSApiSerializerPlugin map"+response1.toString());
|
||||||
|
|
||||||
return serializerResult;
|
return serializerResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,14 +34,14 @@ public class BaseDataPlugin extends AbstractFormPlugin implements Plugin {
|
||||||
DynamicObject creator = dataEntity.getDynamicObject("creator");
|
DynamicObject creator = dataEntity.getDynamicObject("creator");
|
||||||
DynamicObject bos_user = BusinessDataServiceHelper.loadSingle("bos_user", new QFilter[]{new QFilter("id", QCP.equals, creator.getLong("id"))});
|
DynamicObject bos_user = BusinessDataServiceHelper.loadSingle("bos_user", new QFilter[]{new QFilter("id", QCP.equals, creator.getLong("id"))});
|
||||||
DynamicObjectCollection entryentity = bos_user.getDynamicObjectCollection("entryentity");
|
DynamicObjectCollection entryentity = bos_user.getDynamicObjectCollection("entryentity");
|
||||||
DynamicObject dept=null;
|
DynamicObject dept = null;
|
||||||
for (DynamicObject dynamicObject : entryentity) {
|
for (DynamicObject dynamicObject : entryentity) {
|
||||||
boolean ispartjob = dynamicObject.getBoolean("ispartjob");
|
boolean ispartjob = dynamicObject.getBoolean("ispartjob");
|
||||||
if (!ispartjob){
|
if (!ispartjob) {
|
||||||
dept=dynamicObject.getDynamicObject("dpt");
|
dept = dynamicObject.getDynamicObject("dpt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model.setValue("tqq9_dept",dept);
|
model.setValue("tqq9_dept", dept);
|
||||||
this.getView().updateView();
|
this.getView().updateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -50,40 +50,40 @@ public class BaseDataPlugin extends AbstractFormPlugin implements Plugin {
|
||||||
super.propertyChanged(e);
|
super.propertyChanged(e);
|
||||||
String key = e.getProperty().getName();
|
String key = e.getProperty().getName();
|
||||||
if (StringUtils.equals("tqq9_registration", key)) {
|
if (StringUtils.equals("tqq9_registration", key)) {
|
||||||
StringBuilder stringBuilder=new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
ChangeData[] changeSet = e.getChangeSet();
|
ChangeData[] changeSet = e.getChangeSet();
|
||||||
ChangeData changeData = changeSet[0];
|
ChangeData changeData = changeSet[0];
|
||||||
int rowIndex = changeData.getRowIndex();
|
int rowIndex = changeData.getRowIndex();
|
||||||
DynamicObject newValue = (DynamicObject)changeData.getNewValue();
|
DynamicObject newValue = (DynamicObject) changeData.getNewValue();
|
||||||
if(newValue!=null){
|
if (newValue != null) {
|
||||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("id", QCP.equals, newValue.getLong("id"))});
|
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");
|
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||||
for (DynamicObject entry : tqq9_entry) {
|
for (DynamicObject entry : tqq9_entry) {
|
||||||
String supno = entry.getString("tqq9_e_supno");
|
String supno = entry.getString("tqq9_e_supno");
|
||||||
stringBuilder.append("#").append(supno);
|
stringBuilder.append("#").append(supno);
|
||||||
}
|
}
|
||||||
if(StringUtils.isNotBlank(stringBuilder.toString())){
|
if (StringUtils.isNotBlank(stringBuilder.toString())) {
|
||||||
String substring = stringBuilder.substring(1);
|
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)) {
|
if (StringUtils.equals("tqq9_zczh", key)) {
|
||||||
StringBuilder stringBuilder=new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
ChangeData[] changeSet = e.getChangeSet();
|
ChangeData[] changeSet = e.getChangeSet();
|
||||||
ChangeData changeData = changeSet[0];
|
ChangeData changeData = changeSet[0];
|
||||||
int rowIndex = changeData.getRowIndex();
|
int rowIndex = changeData.getRowIndex();
|
||||||
DynamicObject newValue = (DynamicObject)changeData.getNewValue();
|
DynamicObject newValue = (DynamicObject) changeData.getNewValue();
|
||||||
if(newValue!=null){
|
if (newValue != null) {
|
||||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("id", QCP.equals, newValue.getLong("id"))});
|
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");
|
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||||
for (DynamicObject entry : tqq9_entry) {
|
for (DynamicObject entry : tqq9_entry) {
|
||||||
String supno = entry.getString("tqq9_e_supno");
|
String supno = entry.getString("tqq9_e_supno");
|
||||||
stringBuilder.append("#").append(supno);
|
stringBuilder.append("#").append(supno);
|
||||||
}
|
}
|
||||||
if(StringUtils.isNotBlank(stringBuilder.toString())){
|
if (StringUtils.isNotBlank(stringBuilder.toString())) {
|
||||||
String substring = stringBuilder.substring(1);
|
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)});
|
DynamicObject pm_purorderbill = BusinessDataServiceHelper.loadSingle("pm_purorderbill", new QFilter[]{new QFilter("billno", QCP.equals, corebillno)});
|
||||||
Boolean tqq9_isrebatecalculate = pm_purorderbill.getBoolean("tqq9_isrebatecalculate");//是否已计算返利
|
Boolean tqq9_isrebatecalculate = pm_purorderbill.getBoolean("tqq9_isrebatecalculate");//是否已计算返利
|
||||||
|
String operationKey = e.getOperationKey();
|
||||||
if (pm_purorderbill != null && !tqq9_isrebatecalculate) {
|
if (pm_purorderbill != null &&tqq9_isrebatecalculate&&StringUtils.equals("pay",operationKey)) {
|
||||||
BigDecimal tqq9_hshfsyje = pm_purorderbill.getBigDecimal("tqq9_hshfsyje");//含税货返使用金额
|
BigDecimal tqq9_hshfsyje = pm_purorderbill.getBigDecimal("tqq9_hshfsyje");//含税货返使用金额
|
||||||
BigDecimal tqq9_hsxfsyje = pm_purorderbill.getBigDecimal("tqq9_hsxfsyje");//含税现返使用金额
|
BigDecimal tqq9_hsxfsyje = pm_purorderbill.getBigDecimal("tqq9_hsxfsyje");//含税现返使用金额
|
||||||
String tqq9_hfid = pm_purorderbill.getString("tqq9_hfid");//货返id
|
String tqq9_hfid = pm_purorderbill.getString("tqq9_hfid");//货返id
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
package tqq9.lc123.cloud.app.plugin.operate.conm;
|
package tqq9.lc123.cloud.app.plugin.operate.conm;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import kd.bos.dataentity.entity.DynamicObject;
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
import kd.bos.entity.operate.result.OperationResult;
|
import kd.bos.entity.operate.result.OperationResult;
|
||||||
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||||
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
||||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
import kd.bos.servicehelper.QueryServiceHelper;
|
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 tqq9.lc123.cloud.app.plugin.trd.FWImpl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -32,21 +35,21 @@ public class PurconmSubmitToFwOp extends AbstractOperationServicePlugIn {
|
||||||
boolean existChange = QueryServiceHelper.exists("conm_xpurcontract", successPkId);
|
boolean existChange = QueryServiceHelper.exists("conm_xpurcontract", successPkId);
|
||||||
if(existChange){
|
if(existChange){
|
||||||
bill = BusinessDataServiceHelper.loadSingle(successPkId, "conm_xpurcontract");
|
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