【物料变更】多选基础资料, 去掉字段值最前面的逗号

优化import
This commit is contained in:
tanfengling@x-ri.com 2025-12-22 11:05:17 +08:00
parent 3012744a04
commit afe126facc
10 changed files with 15 additions and 71 deletions

View File

@ -7,19 +7,14 @@ import kd.bos.dataentity.entity.LocaleString;
import kd.bos.dataentity.metadata.IDataEntityProperty;
import kd.bos.dataentity.metadata.dynamicobject.DynamicProperty;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.datamodel.ListSelectedRow;
import kd.bos.entity.datamodel.ListSelectedRowCollection;
import kd.bos.entity.datamodel.events.ChangeData;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.entity.operate.result.OperationResult;
import kd.bos.entity.property.MulBasedataProp;
import kd.bos.form.control.events.BeforeClickEvent;
import kd.bos.form.control.events.BeforeItemClickEvent;
import kd.bos.form.control.events.ItemClickEvent;
import kd.bos.form.events.AfterDoOperationEventArgs;
import kd.bos.form.events.BeforeDoOperationEventArgs;
import kd.bos.form.operate.FormOperate;
import kd.bos.list.BillList;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
@ -147,10 +142,15 @@ public class MaterialBillPlugin extends AbstractBillPlugIn {
oldValue = oldValue + "," + objName;
}
if (!oldValue.equals(newValue)) {
if(oldValue.startsWith(",")){
oldValue = oldValue.substring(1);
}
if(newValue.startsWith(",")){
newValue = newValue.substring(1);
}
changeFields.append(",").append(name);
// changeContent.append("字段:" + displayName + "(" + name + "),变更前:" + oldValue.substring(1) + ",变更后:" + newValue.substring(1) + "");
changeContent.append("字段:" + displayName + ",变更前:" + oldValue.substring(1) + ",变更后:" + newValue.substring(1) + "");
changeContent.append("字段:" + displayName + ",变更前:" + oldValue.substring(1)
+ ",变更后:" + newValue.substring(1) + "");
changeEntry.set("tqq9_fieldname", displayName);//字段名称
changeEntry.set("tqq9_fieldnumber", name);//字段标识
changeEntry.set("tqq9_oldvalue", oldValue);//修改前值
@ -158,9 +158,11 @@ public class MaterialBillPlugin extends AbstractBillPlugIn {
changeEntry.set("tqq9_updatedate", new Date());//修改事件
}
} else {
if(newValue.startsWith(",")){
newValue = newValue.substring(1);
}
changeFields.append(",").append(name);
changeContent.append("字段:" + displayName + ",变更前:空,变更后:" + newValue.substring(1) + "");
changeEntry.set("tqq9_fieldname", displayName);//字段名称
changeEntry.set("tqq9_fieldnumber", name);//字段标识
changeEntry.set("tqq9_oldvalue", null);//修改前值
@ -176,8 +178,10 @@ public class MaterialBillPlugin extends AbstractBillPlugIn {
String objName = obj.getString("name");
oldValue = oldValue + "," + objName;
}
if(oldValue.startsWith(",")){
oldValue = oldValue.substring(1);
}
changeContent.append("字段:" + displayName + ",变更前:" + oldValue.substring(1) + ",变更后:空;");
changeEntry.set("tqq9_fieldname", displayName);//字段名称
changeEntry.set("tqq9_fieldnumber", name);//字段标识
changeEntry.set("tqq9_oldvalue", oldValue);//修改前值

View File

@ -15,7 +15,7 @@ import java.util.List;
import java.util.Map;
/**
* 收货通知单 保存 & 删除插件
* 收货通知单 保存
* 操作后上查采购订单判断该采购订单是否全部下推收获通知
* 如果采购订单明细行的采购数量 != 关联数量则将采购订单下拉字段是否可做收获通知 tqq9_sfkzsh赋值为true否则赋值为false
*/

View File

@ -10,9 +10,6 @@ import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.sdk.plugin.Plugin;
import java.util.ArrayList;
import java.util.UUID;
/**
* 品牌审核时反写执行采购信息到对应品牌的物料信息学里
*/

View File

@ -1,21 +1,16 @@
package tqq9.lc123.cloud.app.plugin.operate.sys;
import kd.bos.algo.DataSet;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.db.DB;
import kd.bos.db.DBRoute;
import kd.bos.entity.ExtendedDataEntity;
import kd.bos.entity.operate.result.OperationResult;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.AddValidatorsEventArgs;
import kd.bos.entity.plugin.args.AfterOperationArgs;
import kd.bos.entity.validate.AbstractValidator;
import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.bos.orm.ORM;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.sdk.plugin.Plugin;
/**

View File

@ -4,7 +4,6 @@ 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.entity.plugin.args.BeforeOperationArgs;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.bos.servicehelper.user.UserServiceHelper;

View File

@ -1,6 +1,5 @@
package tqq9.lc123.cloud.app.plugin.operate.sys;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.operate.result.OperationResult;
@ -10,14 +9,7 @@ import kd.bos.servicehelper.BusinessDataServiceHelper;
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.utils.ConfigUtils;
import tqq9.lc123.cloud.app.plugin.utils.FWRestfulUtils;
import tqq9.lc123.cloud.app.plugin.utils.FWUtils;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**

View File

@ -1,33 +1,20 @@
package tqq9.lc123.cloud.app.plugin.operate.sys;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.asymmetric.KeyType;
import cn.hutool.crypto.asymmetric.RSA;
import com.alibaba.fastjson.JSONObject;
import kd.bos.context.RequestContext;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.AfterOperationArgs;
import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.QueryServiceHelper;
import kd.sdk.plugin.Plugin;
import oadd.com.google.gson.Gson;
import oadd.com.google.gson.JsonObject;
import oadd.org.apache.commons.lang3.StringUtils;
import tqq9.lc123.cloud.app.eip.iscb.LCLogService;
import tqq9.lc123.cloud.app.eip.iscb.impl.LCLogServiceImpl;
import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
import tqq9.lc123.cloud.app.plugin.utils.FWRestfulUtils;
import tqq9.lc123.cloud.app.plugin.utils.HttpRequestUtils;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
* 单据操作插件

View File

@ -1,25 +0,0 @@
package tqq9.lc123.cloud.app.plugin.operate.sys;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.AfterOperationArgs;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.sdk.plugin.Plugin;
/**
* 单据操作插件
* 物料 修改个性字段 操作 是否修改个性字段置为true
*/
public class MaterialXggxzdOp extends AbstractOperationServicePlugIn implements Plugin {
// @Override
// public void afterExecuteOperationTransaction(AfterOperationArgs e) {
// super.afterExecuteOperationTransaction(e);
// DynamicObject[] dataEntities = e.getDataEntities();
// for (DynamicObject material : dataEntities) {
// material = BusinessDataServiceHelper.loadSingle(material.getPkValue(), material.getDynamicObjectType().getName());
// material.set("tqq9_checkboxfield", true);
// SaveServiceHelper.save(new DynamicObject[]{material});
// }
// }
}

View File

@ -10,7 +10,6 @@ import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.sdk.plugin.Plugin;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

View File

@ -1,22 +1,18 @@
package tqq9.lc123.cloud.app.plugin.operate.sys;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.entity.datamodel.IDataModel;
import kd.bos.form.events.AfterDoOperationEventArgs;
import kd.bos.isc.util.script.feature.tool.string.Json2Xml;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.AttachmentServiceHelper;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.sdk.plugin.Plugin;
import org.json.XML;
import tqq9.lc123.cloud.app.plugin.utils.HttpRequestUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;