1.范围调整

This commit is contained in:
龚豆豆 2025-11-13 16:52:10 +08:00
parent f0377639a7
commit ad080d56f7
15 changed files with 262 additions and 83 deletions

View File

@ -16,6 +16,7 @@ public class Constants {
public static final String TYPE_PUSH = "push"; //下推类型 public static final String TYPE_PUSH = "push"; //下推类型
public static final String TYPE_SUBMIT = "submit"; //提交类型 public static final String TYPE_SUBMIT = "submit"; //提交类型
public static final String TYPE_AUDIT = "audit"; //审核类型 public static final String TYPE_AUDIT = "audit"; //审核类型
public static final String TYPE_UNAUDIT = "unaudit"; //反审核类型
public static final String TYPE_ENABLE = "enable"; //启用类型 public static final String TYPE_ENABLE = "enable"; //启用类型
public static final String TYPE_DISABLE = "disable"; //禁用类型 public static final String TYPE_DISABLE = "disable"; //禁用类型
public static final String TYPE_CLOSE = "bizclose"; //关闭类型 public static final String TYPE_CLOSE = "bizclose"; //关闭类型

View File

@ -493,7 +493,7 @@ public class PurApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
String number = org.getString("number"); String number = org.getString("number");
DynamicObject tqq9_org = BusinessDataServiceHelper.loadSingle(org.getLong("id"), "bos_org");//组织 DynamicObject tqq9_org = BusinessDataServiceHelper.loadSingle(org.getLong("id"), "bos_org");//组织
JSONObject material = entry.getJSONObject("tqq9_material");//物料 JSONObject material = entry.getJSONObject("tqq9_material");//物料
DynamicObject tqq9_material = BusinessDataServiceHelper.loadSingle(material.getLong("id"), "bd_material");//物料 DynamicObject tqq9_material = BusinessDataServiceHelper.loadSingle(material.getLong("id"),"bd_material","id,taxrate,number,name,baseunit,tqq9_xsyj1,tqq9_amountfield1,tqq9_amountfield4,tqq9_maxprice_sh,tqq9_maxprice_bj,tqq9_maxprice_gz");//物料
DynamicObject taxrate1 = tqq9_material.getDynamicObject("taxrate"); DynamicObject taxrate1 = tqq9_material.getDynamicObject("taxrate");
BigDecimal taxrate2=null; BigDecimal taxrate2=null;
if(taxrate1!=null){ if(taxrate1!=null){

View File

@ -3,7 +3,6 @@ package tqq9.lc123.cloud.app.plugin.form.pm;
import kd.bos.algo.DataSet; import kd.bos.algo.DataSet;
import kd.bos.bill.BillShowParameter; import kd.bos.bill.BillShowParameter;
import kd.bos.coderule.api.CodeRuleInfo;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.utils.StringUtils; import kd.bos.dataentity.utils.StringUtils;
@ -21,12 +20,8 @@ import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter; import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.QueryServiceHelper; import kd.bos.servicehelper.QueryServiceHelper;
import kd.bos.servicehelper.coderule.CodeRuleServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.bos.servicehelper.user.UserServiceHelper;
import kd.sdk.plugin.Plugin; import kd.sdk.plugin.Plugin;
import java.math.BigDecimal;
import java.util.*; import java.util.*;
/** /**
@ -161,12 +156,6 @@ public class PurSuggestRptFromPlugin extends AbstractFormPlugin implements Plugi
"sum(case when forgid=" + cd + " then fqty else 0 end) tqq9_cdinventory\n" + "sum(case when forgid=" + cd + " then fqty else 0 end) tqq9_cdinventory\n" +
"from t_im_inv_realbalance group by fmaterialid,forgid"; "from t_im_inv_realbalance group by fmaterialid,forgid";
// //即时库存表
// String realbalancesql = "/*dialect*//*dialect*/select '1' tqq9_isauto,fmaterialid tqq9_material,forgid tqq9_org,sum(case when forgid='"+sh+"' then fqty else 0 end) tqq9_shinventory, \n" +
// "sum(case when forgid='"+bj+"' then fqty else 0 end) tqq9_bjinventory,sum(case when forgid='"+gz+"' then fqty else 0 end) tqq9_gzinventory,\n" +
// "sum(case when forgid='"+cd+"' then fqty else 0 end) tqq9_cdinventory\n" +
// "from t_im_inv_realbalance group by fmaterialid,forgid";
//销售出库 //销售出库
String saloutbillsql = "/*dialect*/ SELECT sum(case when t1.fbiztime>= CURRENT_DATE - INTERVAL '90 days' and forgid=" + sh + " then t2.fqty else 0 end)/3 tqq9_permonthsales_sh,\n" + String saloutbillsql = "/*dialect*/ SELECT sum(case when t1.fbiztime>= CURRENT_DATE - INTERVAL '90 days' and forgid=" + sh + " then t2.fqty else 0 end)/3 tqq9_permonthsales_sh,\n" +
"sum(case when t1.fbiztime>= CURRENT_DATE - INTERVAL '90 days' and forgid=" + bj + " then t2.fqty else 0 end)/3 tqq9_permonthsales_bj,\n" + "sum(case when t1.fbiztime>= CURRENT_DATE - INTERVAL '90 days' and forgid=" + bj + " then t2.fqty else 0 end)/3 tqq9_permonthsales_bj,\n" +
@ -202,26 +191,6 @@ public class PurSuggestRptFromPlugin extends AbstractFormPlugin implements Plugi
"left join SA_SalesOrderDetail_GZ de(nolock) on ma.somid =de.somid where Status in('新增','已审核') and cInvoiceTitle not like '%上海励齿%' \n" + "left join SA_SalesOrderDetail_GZ de(nolock) on ma.somid =de.somid where Status in('新增','已审核') and cInvoiceTitle not like '%上海励齿%' \n" +
"and cInvoiceTitle not like '%北京励齿%' and cInvoiceTitle not like '%广州励齿%' and cinvcode is not null GROUP BY cInvCode"; "and cInvoiceTitle not like '%北京励齿%' and cInvoiceTitle not like '%广州励齿%' and cinvcode is not null GROUP BY cInvCode";
// //排名-上海
// String range_sh="/*dialect*/SELECT cInvCode as tqq9_sku_lc, CASE WHEN SUM(RowNum) = 0 THEN '其他' WHEN SUM(RowNum) <= 100 THEN '前一百' WHEN SUM(RowNum) <= 500 THEN '前五百' \n" +
// "WHEN SUM(RowNum) <= 1000 THEN '前一千' WHEN SUM(RowNum) <= 2000 THEN '前两千' END as tqq9_ranking FROM ( SELECT cInvCode, ROW_NUMBER() OVER (ORDER BY SUM(isum) DESC) as RowNum \n" +
// "FROM SA_SalesOrderMaster_SH ma(nolock) INNER JOIN SA_SalesOrderDetail_SH de(nolock) ON ma.somid = de.somid WHERE DATEDIFF(month, dInputDate,\n" +
// "GETDATE()) BETWEEN 1 AND 3 AND cInvoiceTitle NOT LIKE '%上海励齿%' AND cInvoiceTitle NOT LIKE '%北京励齿%' AND cInvoiceTitle NOT LIKE '%广州励齿%' AND Status != '草稿' \n" +
// "AND cInvCode NOT LIKE 'ZF%' GROUP BY cInvCode ) AS a WHERE a.RowNum <= 2000 GROUP BY cInvCode";
//
// //排名-北京
// String range_bj="/*dialect*/SELECT cInvCode as tqq9_sku_lc, CASE WHEN SUM(RowNum) = 0 THEN '其他' WHEN SUM(RowNum) <= 100 THEN '前一百' WHEN SUM(RowNum) <= 500 THEN '前五百' \n" +
// "WHEN SUM(RowNum) <= 1000 THEN '前一千' WHEN SUM(RowNum) <= 2000 THEN '前两千' END as tqq9_ranking FROM ( SELECT cInvCode, ROW_NUMBER() OVER (ORDER BY SUM(isum) DESC) as RowNum \n" +
// "FROM SA_SalesOrderMaster_SH ma(nolock) INNER JOIN SA_SalesOrderDetail_SH de(nolock) ON ma.somid = de.somid WHERE DATEDIFF(month, dInputDate,\n" +
// "GETDATE()) BETWEEN 1 AND 3 AND cInvoiceTitle NOT LIKE '%上海励齿%' AND cInvoiceTitle NOT LIKE '%北京励齿%' AND cInvoiceTitle NOT LIKE '%广州励齿%' AND Status != '草稿' \n" +
// "AND cInvCode NOT LIKE 'ZF%' GROUP BY cInvCode ) AS a WHERE a.RowNum <= 2000 GROUP BY cInvCode";
//
// //排名-广州
// String range_gz="/*dialect*/SELECT cInvCode as tqq9_sku_lc, CASE WHEN SUM(RowNum) = 0 THEN '其他' WHEN SUM(RowNum) <= 100 THEN '前一百' WHEN SUM(RowNum) <= 500 THEN '前五百' \n" +
// "WHEN SUM(RowNum) <= 1000 THEN '前一千' WHEN SUM(RowNum) <= 2000 THEN '前两千' END as tqq9_ranking FROM ( SELECT cInvCode, ROW_NUMBER() OVER (ORDER BY SUM(isum) DESC) as RowNum \n" +
// "FROM SA_SalesOrderMaster_SH ma(nolock) INNER JOIN SA_SalesOrderDetail_SH de(nolock) ON ma.somid = de.somid WHERE DATEDIFF(month, dInputDate,\n" +
// "GETDATE()) BETWEEN 1 AND 3 AND cInvoiceTitle NOT LIKE '%上海励齿%' AND cInvoiceTitle NOT LIKE '%北京励齿%' AND cInvoiceTitle NOT LIKE '%广州励齿%' AND Status != '草稿' \n" +
// "AND cInvCode NOT LIKE 'ZF%' GROUP BY cInvCode ) AS a WHERE a.RowNum <= 2000 GROUP BY cInvCode";
//排名 //排名
String rangesql = "/*dialect*/SELECT cInvCode AS tqq9_sku_lc,CASE WHEN RowNum <= 100 THEN '前一百'WHEN RowNum <= 500 THEN '前五百'WHEN RowNum <= 1000 THEN '前一千'WHEN RowNum <= 2000 THEN '前两千'ELSE '其他'END AS tqq9_ranking\n" + String rangesql = "/*dialect*/SELECT cInvCode AS tqq9_sku_lc,CASE WHEN RowNum <= 100 THEN '前一百'WHEN RowNum <= 500 THEN '前五百'WHEN RowNum <= 1000 THEN '前一千'WHEN RowNum <= 2000 THEN '前两千'ELSE '其他'END AS tqq9_ranking\n" +
"FROM (SELECT cInvCode,ROW_NUMBER() OVER (ORDER BY SUM(isum) DESC) AS RowNum FROM (SELECT cInvCode, isum FROM SA_SalesOrderMaster_SH ma (nolock)INNER JOIN SA_SalesOrderDetail_SH de (nolock) ON ma.somid = de.somid\n" + "FROM (SELECT cInvCode,ROW_NUMBER() OVER (ORDER BY SUM(isum) DESC) AS RowNum FROM (SELECT cInvCode, isum FROM SA_SalesOrderMaster_SH ma (nolock)INNER JOIN SA_SalesOrderDetail_SH de (nolock) ON ma.somid = de.somid\n" +

View File

@ -338,6 +338,9 @@ public class PuroderBillShareRefundPlugin extends AbstractBillPlugIn {
String number = org.getString("number"); String number = org.getString("number");
DynamicObject org_fl = BusinessDataServiceHelper.loadSingle("tqq9_thirdconfig", "name", DynamicObject org_fl = BusinessDataServiceHelper.loadSingle("tqq9_thirdconfig", "name",
new QFilter[]{new QFilter("number", QCP.equals, number)}); new QFilter[]{new QFilter("number", QCP.equals, number)});
if(org_fl==null){
this.getView().showErrorNotification("组织选择错误");
}
String orgid_fl = org_fl != null ? org_fl.getString("name") : null; String orgid_fl = org_fl != null ? org_fl.getString("name") : null;
HashMap<String, Object> queryMap = new HashMap<>(); HashMap<String, Object> queryMap = new HashMap<>();
queryMap.put("supplierId", newValue.getString("tqq9_ztsupplierid")); queryMap.put("supplierId", newValue.getString("tqq9_ztsupplierid"));

View File

@ -269,7 +269,7 @@ public class PurorderEntryIntroPaybillPlugin extends AbstractBillPlugIn imple
} }
JSONObject material = entry.getJSONObject("tqq9_material");//物料 JSONObject material = entry.getJSONObject("tqq9_material");//物料
DynamicObject tqq9_material = BusinessDataServiceHelper.loadSingle(material.getLong("id"), "bd_material");//物料 DynamicObject tqq9_material = BusinessDataServiceHelper.loadSingle(material.getLong("id"),"bd_material","id,taxrate,number,name,baseunit,tqq9_xsyj1,tqq9_amountfield1,tqq9_amountfield4,tqq9_maxprice_sh,tqq9_maxprice_bj,tqq9_maxprice_gz");//物料
DynamicObject taxrate1 = tqq9_material.getDynamicObject("taxrate"); DynamicObject taxrate1 = tqq9_material.getDynamicObject("taxrate");
BigDecimal taxrate2=null; BigDecimal taxrate2=null;
if(taxrate1!=null){ if(taxrate1!=null){

View File

@ -1,13 +1,10 @@
package tqq9.lc123.cloud.app.plugin.form.sys; package tqq9.lc123.cloud.app.plugin.form.sys;
import kd.bos.bill.AbstractBillPlugIn; import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.bill.OperationStatus; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.property.ComboProp; import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.property.TextProp; import kd.bos.form.events.AfterDoOperationEventArgs;
import kd.bos.form.field.ComboEdit; import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.bos.form.field.TextEdit;
import java.util.EventObject;
/** /**
@ -16,39 +13,48 @@ import java.util.EventObject;
public class MaterialBillPlugin extends AbstractBillPlugIn { public class MaterialBillPlugin extends AbstractBillPlugIn {
/** // /**
* 修改时设置变更缘由必填 // * 修改时设置变更缘由必填
* @param e // * @param e
*/ // */
// @Override
// public void afterBindData(EventObject e) {
// super.afterBindData(e);
// OperationStatus status = this.getView().getFormShowParameter().getStatus();
// if(OperationStatus.EDIT.getValue() == status.getValue()){
// ComboEdit tqq9_bgyyCtrl = this.getView().getControl("tqq9_bgyy");
// ComboEdit tqq9_bgyy2Ctrl = this.getView().getControl("tqq9_bgyy2");
// ComboEdit tqq9_shbgyyCtrl = this.getView().getControl("tqq9_shbgyy");
// TextEdit tqq9_bgms1Ctrl = this.getView().getControl("tqq9_bgms1");
// TextEdit tqq9_bgms2Ctrl = this.getView().getControl("tqq9_bgms2");
// TextEdit tqq9_bgms3Ctrl = this.getView().getControl("tqq9_bgms3");
//
// ComboProp tqq9_bgyyProp = (ComboProp) tqq9_bgyyCtrl.getProperty();
// ComboProp tqq9_bgyy2Prop = (ComboProp) tqq9_bgyy2Ctrl.getProperty();
// ComboProp tqq9_shbgyyProp = (ComboProp) tqq9_shbgyyCtrl.getProperty();
// TextProp tqq9_bgms1Prop = (TextProp) tqq9_bgms1Ctrl.getProperty();
// TextProp tqq9_bgms2Prop = (TextProp) tqq9_bgms2Ctrl.getProperty();
// TextProp tqq9_bgms3Prop = (TextProp) tqq9_bgms3Ctrl.getProperty();
//
// tqq9_bgyyProp.setMustInput(true);
// tqq9_bgyy2Prop.setMustInput(true);
// tqq9_shbgyyProp.setMustInput(true);
// tqq9_bgms1Prop.setMustInput(true);
// tqq9_bgms2Prop.setMustInput(true);
// tqq9_bgms3Prop.setMustInput(true);
//
//// this.getView().setVisible(true, "tqq9_bgyy","tqq9_bgyy2","tqq9_shbgyy","tqq9_bgms1","tqq9_bgms2","tqq9_bgms3");
// }
// }
@Override @Override
public void afterBindData(EventObject e) { public void afterDoOperation(AfterDoOperationEventArgs afterDoOperationEventArgs) {
super.afterBindData(e); super.afterDoOperation(afterDoOperationEventArgs);
OperationStatus status = this.getView().getFormShowParameter().getStatus(); String operateKey = afterDoOperationEventArgs.getOperateKey();
if(OperationStatus.EDIT.getValue() == status.getValue()){ if (StringUtils.equals("submit",operateKey)) {
ComboEdit tqq9_bgyyCtrl = this.getView().getControl("tqq9_bgyy"); getModel().setValue("tqq9_isfirst",false);
ComboEdit tqq9_bgyy2Ctrl = this.getView().getControl("tqq9_bgyy2"); SaveServiceHelper.save(new DynamicObject[]{this.getModel().getDataEntity()});
ComboEdit tqq9_shbgyyCtrl = this.getView().getControl("tqq9_shbgyy");
TextEdit tqq9_bgms1Ctrl = this.getView().getControl("tqq9_bgms1");
TextEdit tqq9_bgms2Ctrl = this.getView().getControl("tqq9_bgms2");
TextEdit tqq9_bgms3Ctrl = this.getView().getControl("tqq9_bgms3");
ComboProp tqq9_bgyyProp = (ComboProp) tqq9_bgyyCtrl.getProperty();
ComboProp tqq9_bgyy2Prop = (ComboProp) tqq9_bgyy2Ctrl.getProperty();
ComboProp tqq9_shbgyyProp = (ComboProp) tqq9_shbgyyCtrl.getProperty();
TextProp tqq9_bgms1Prop = (TextProp) tqq9_bgms1Ctrl.getProperty();
TextProp tqq9_bgms2Prop = (TextProp) tqq9_bgms2Ctrl.getProperty();
TextProp tqq9_bgms3Prop = (TextProp) tqq9_bgms3Ctrl.getProperty();
tqq9_bgyyProp.setMustInput(true);
tqq9_bgyy2Prop.setMustInput(true);
tqq9_shbgyyProp.setMustInput(true);
tqq9_bgms1Prop.setMustInput(true);
tqq9_bgms2Prop.setMustInput(true);
tqq9_bgms3Prop.setMustInput(true);
// this.getView().setVisible(true, "tqq9_bgyy","tqq9_bgyy2","tqq9_shbgyy","tqq9_bgms1","tqq9_bgms2","tqq9_bgms3");
} }
} }
} }

View File

@ -0,0 +1,66 @@
package tqq9.lc123.cloud.app.plugin.form.sys;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.form.FormShowParameter;
import kd.bos.form.control.Control;
import kd.bos.form.control.events.BeforeItemClickEvent;
import kd.bos.form.control.events.ItemClickEvent;
import kd.bos.list.plugin.AbstractListPlugin;
import kd.sdk.plugin.Plugin;
import java.util.EventObject;
import java.util.HashMap;
import java.util.Map;
/**
* 供应商区域资质动态表单
*/
public class SupplierAreaFormPlugin extends AbstractListPlugin implements Plugin {
@Override
public void registerListener(EventObject e) {
super.registerListener(e);
this.addItemClickListeners("tqq9_toolbarap");
}
@Override
public void beforeItemClick(BeforeItemClickEvent evt) {
super.beforeItemClick(evt);
String itemKey = evt.getItemKey();
if ("btnok".equals(itemKey)) {
Object tqq9_qyzz = this.getModel().getValue("tqq9_qyzz");
if (tqq9_qyzz == null) {
this.getView().showMessage("请填写供应商区域资质");
evt.setCancel(true);
}
}
}
@Override
public void itemClick(ItemClickEvent evt) {
super.itemClick(evt);
String itemKey = evt.getItemKey();
if (StringUtils.equals("btnok", itemKey)) {
Map<String, Object> data = new HashMap<>();
data.put("tqq9_qyzz", this.getModel().getValue("tqq9_qyzz"));
data.put("tqq9_ids", this.getModel().getValue("tqq9_ids"));
data.put("isContinue", true);
this.getView().returnDataToParent(data);
this.getView().close();
Control tqq9_toolbarap = this.getView().getControl("tqq9_toolbarap");
}
}
@Override
public void afterCreateNewData(EventObject e) {
// 获取当前页面的FormShowParameter对象
FormShowParameter formShowParameter = this.getView().getFormShowParameter();
// 获取自定义参数
String ids = formShowParameter.getCustomParam("ids");
if (ids != null) {
this.getModel().setValue("tqq9_ids", ids);
}
}
}

View File

@ -0,0 +1,125 @@
package tqq9.lc123.cloud.app.plugin.form.sys;
import kd.bos.dataentity.OperateOption;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.datamodel.ListSelectedRowCollection;
import kd.bos.entity.operate.result.IOperateInfo;
import kd.bos.entity.operate.result.OperationResult;
import kd.bos.form.CloseCallBack;
import kd.bos.form.FormShowParameter;
import kd.bos.form.ShowType;
import kd.bos.form.control.events.BeforeItemClickEvent;
import kd.bos.form.events.ClosedCallBackEvent;
import kd.bos.list.BillList;
import kd.bos.list.plugin.AbstractListPlugin;
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.operation.OperationServiceHelper;
import kd.sdk.plugin.Plugin;
import tqq9.lc123.cloud.app.api.utils.Constants;
import java.util.*;
/**
* 供应商列表插件
*/
public class SupplierFormPlugin extends AbstractListPlugin implements Plugin {
private final static Log logger = LogFactory.getLog(SupplierFormPlugin.class);
@Override
public void beforeItemClick(BeforeItemClickEvent evt) {
super.beforeItemClick(evt);
String itemKey = evt.getItemKey();
if ("tqq9_qyzzbg".equals(itemKey)) {
BillList billList = this.getControl(AbstractListPlugin.BILLLISTID);
ListSelectedRowCollection selectedRows = billList.getSelectedRows();
if (selectedRows.size() > 0) {
HashSet<Object> ids = new HashSet<>();
StringBuilder errorMsg = new StringBuilder();
Object[] primaryKeyValues = selectedRows.getPrimaryKeyValues();
for (Object primaryKeyValue : primaryKeyValues) {
ids.add(primaryKeyValue);
}
DynamicObject[] bd_suppliers = BusinessDataServiceHelper.load("bd_supplier", "id,number,status,enable,tqq9_mulcombofield1,createorg", new QFilter[]{new QFilter("id", QCP.in, ids)});
for (DynamicObject bd_supplier : bd_suppliers) {
String number = bd_supplier.getString("number");
String status = bd_supplier.getString("status");
if (!StringUtils.equals("C", status)) {
errorMsg.append(",").append("供应商编码 " + number + "未审核");
}
String enable = bd_supplier.getString("enable");
if (!StringUtils.equals("1", enable)) {
errorMsg.append(",").append("供应商编码 " + number + "未启用");
}
}
if (errorMsg.length() > 0) {
this.getView().showErrorNotification(errorMsg.substring(1));
}
FormShowParameter param = new FormShowParameter();
param.setFormId("tqq9_gysqyzz");
param.setCloseCallBack(new CloseCallBack(this, "updateFilter"));
param.setCustomParam("ids", ids.toString());
param.getOpenStyle().setShowType(ShowType.Modal);
this.getView().showForm(param);
} else {
this.getView().showErrorNotification("请先选中供应商数据");
}
}
}
@Override
public void closedCallBack(ClosedCallBackEvent closedCallBackEvent) {
super.closedCallBack(closedCallBackEvent);
if (closedCallBackEvent.getActionId().equals("updateFilter")) {
Object returnData = closedCallBackEvent.getReturnData();
if (returnData != null) {
Map data = (Map) returnData;
Boolean isContinue = (Boolean) data.get("isContinue");
if (isContinue == null || !isContinue) {
return;
}
String tqq9_qyzz = data.get("tqq9_qyzz").toString();
String tqq9_ids = data.get("tqq9_ids").toString();
String[] stringArray = tqq9_ids.substring(1, tqq9_ids.length() - 1).split(", ");
List<Long> longList = new ArrayList<>();
for (String str : stringArray) {
longList.add(Long.parseLong(str));
}
HashMap<Object, String> supplierMap = new HashMap<>();
StringBuilder stringBuilder = new StringBuilder();
DynamicObject[] bd_suppliers = BusinessDataServiceHelper.load("bd_supplier", "id,number,status,enable,tqq9_mulcombofield1,createorg", new QFilter[]{new QFilter("id", QCP.in, longList)});
for (DynamicObject bd_supplier : bd_suppliers) {
supplierMap.put(bd_supplier.get("id"),bd_supplier.getString("number"));
}
OperateOption operateOption = OperateOption.create();
OperationResult unauditResult = OperationServiceHelper.executeOperate(Constants.TYPE_UNAUDIT, "bd_supplier", bd_suppliers, operateOption);
if(!unauditResult.isSuccess()){
List<IOperateInfo> allErrorOrValidateInfo = unauditResult.getAllErrorOrValidateInfo();
for (IOperateInfo iOperateInfo : allErrorOrValidateInfo) {
String supNumber = supplierMap.get(iOperateInfo.getPkValue());
stringBuilder.append(",").append("编码为 ").append(supNumber).append(" 的供应商反审核失败,请手动修改供应商区域资质变更");
}
}
List<Object> successPkIds = unauditResult.getSuccessPkIds();
DynamicObject[] bd_suppliers1 = BusinessDataServiceHelper.load("bd_supplier", "id,number,status,enable,tqq9_mulcombofield1", new QFilter[]{new QFilter("id", QCP.in, successPkIds)});
for (DynamicObject dynamicObject : bd_suppliers1) {
dynamicObject.set("tqq9_mulcombofield1",tqq9_qyzz);
}
OperationResult sumbitResult = OperationServiceHelper.executeOperate(Constants.TYPE_SUBMIT, "bd_supplier", bd_suppliers1, operateOption);
if (!sumbitResult.isSuccess()) {
List<IOperateInfo> allErrorOrValidateInfo = unauditResult.getAllErrorOrValidateInfo();
for (IOperateInfo iOperateInfo : allErrorOrValidateInfo) {
String supNumber = supplierMap.get(iOperateInfo.getPkValue());
stringBuilder.append(",").append("编码为 ").append(supNumber).append(" 的供应商提交失败,请手动提交");
}
}
}
}
}
}

View File

@ -2,6 +2,7 @@ package tqq9.lc123.cloud.app.plugin.operate.pm;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.botp.runtime.BFRow; import kd.bos.entity.botp.runtime.BFRow;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.BeforeOperationArgs; import kd.bos.entity.plugin.args.BeforeOperationArgs;
@ -34,8 +35,9 @@ public class OtherInWareSaveOpPlugin extends AbstractOperationServicePlugIn impl
if (dataEntities1.length > 0) { if (dataEntities1.length > 0) {
DynamicObject dynamicObject = dataEntities1[0]; DynamicObject dynamicObject = dataEntities1[0];
String operationKey = e.getOperationKey();
Map<Long, List<BFRow>> id = BFTrackerServiceHelper.findDirtSourceBills(TQQ9_OTHERINAPPLY, new Long[]{dynamicObject.getLong("id")}); Map<Long, List<BFRow>> id = BFTrackerServiceHelper.findDirtSourceBills(TQQ9_OTHERINAPPLY, new Long[]{dynamicObject.getLong("id")});
if (dynamicObject.getBoolean("tqq9_isrebulidlink")) { if (dynamicObject.getBoolean("tqq9_isrebulidlink")& StringUtils.equals("save",operationKey)) {
DynamicObjectCollection billentry1 = dynamicObject.getDynamicObjectCollection("billentry"); DynamicObjectCollection billentry1 = dynamicObject.getDynamicObjectCollection("billentry");
if (billentry1.size() > 0) { if (billentry1.size() > 0) {
DynamicObject dynamicObject1 = billentry1.get(0); DynamicObject dynamicObject1 = billentry1.get(0);

View File

@ -2,6 +2,7 @@ package tqq9.lc123.cloud.app.plugin.operate.pm;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.BeforeOperationArgs; import kd.bos.entity.plugin.args.BeforeOperationArgs;
import kd.bos.logging.Log; import kd.bos.logging.Log;
@ -30,7 +31,8 @@ public class OtherOutWareSaveOpPlugin extends AbstractOperationServicePlugIn imp
if (dataEntities1.length > 0) { if (dataEntities1.length > 0) {
DynamicObject dynamicObject = dataEntities1[0]; DynamicObject dynamicObject = dataEntities1[0];
if (dynamicObject.getBoolean("tqq9_isrebulidlink")) { String operationKey = e.getOperationKey();
if (dynamicObject.getBoolean("tqq9_isrebulidlink")& StringUtils.equals("save",operationKey)) {
DynamicObjectCollection billentry1 = dynamicObject.getDynamicObjectCollection("billentry"); DynamicObjectCollection billentry1 = dynamicObject.getDynamicObjectCollection("billentry");
if (billentry1.size() > 0) { if (billentry1.size() > 0) {
DynamicObject dynamicObject1 = billentry1.get(0); DynamicObject dynamicObject1 = billentry1.get(0);

View File

@ -2,6 +2,7 @@ package tqq9.lc123.cloud.app.plugin.operate.pm;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.BeforeOperationArgs; import kd.bos.entity.plugin.args.BeforeOperationArgs;
import kd.bos.logging.Log; import kd.bos.logging.Log;
@ -28,7 +29,8 @@ public class PurInWareSaveOpPlugin extends AbstractOperationServicePlugIn implem
DynamicObject[] dataEntities1 = e.getDataEntities(); DynamicObject[] dataEntities1 = e.getDataEntities();
if (dataEntities1.length > 0) { if (dataEntities1.length > 0) {
DynamicObject dynamicObject = dataEntities1[0]; DynamicObject dynamicObject = dataEntities1[0];
if (dynamicObject.getBoolean("tqq9_isrebulidlink")) { String operationKey = e.getOperationKey();
if (dynamicObject.getBoolean("tqq9_isrebulidlink")&&StringUtils.equals("save",operationKey)) {
DynamicObjectCollection billentry1 = dynamicObject.getDynamicObjectCollection("billentry"); DynamicObjectCollection billentry1 = dynamicObject.getDynamicObjectCollection("billentry");
if (billentry1.size() > 0) { if (billentry1.size() > 0) {
DynamicObject dynamicObject1 = billentry1.get(0); DynamicObject dynamicObject1 = billentry1.get(0);

View File

@ -2,6 +2,7 @@ package tqq9.lc123.cloud.app.plugin.operate.pm;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.BeforeOperationArgs; import kd.bos.entity.plugin.args.BeforeOperationArgs;
import kd.bos.logging.Log; import kd.bos.logging.Log;
@ -31,7 +32,8 @@ public class PurRefundApplySaveOpPlugin extends AbstractOperationServicePlugIn i
DynamicObject[] dataEntities1 = e.getDataEntities(); DynamicObject[] dataEntities1 = e.getDataEntities();
logger.info("PurRefundApplySaveOpPlugin-start"); logger.info("PurRefundApplySaveOpPlugin-start");
logger.info("PurRefundApplySaveOpPlugin:单据数量"+dataEntities1.length); logger.info("PurRefundApplySaveOpPlugin:单据数量"+dataEntities1.length);
if (dataEntities1.length > 0) { String operationKey = e.getOperationKey();
if (dataEntities1.length > 0 && StringUtils.equals("save",operationKey)) {
DynamicObject dynamicObject = dataEntities1[0]; DynamicObject dynamicObject = dataEntities1[0];
logger.info("PurRefundApplySaveOpPlugin:单据号"+dynamicObject.getString("billno")); logger.info("PurRefundApplySaveOpPlugin:单据号"+dynamicObject.getString("billno"));
DynamicObjectCollection billentry1 = dynamicObject.getDynamicObjectCollection("billentry"); DynamicObjectCollection billentry1 = dynamicObject.getDynamicObjectCollection("billentry");

View File

@ -2,6 +2,7 @@ package tqq9.lc123.cloud.app.plugin.operate.pm;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.botp.runtime.BFRow; import kd.bos.entity.botp.runtime.BFRow;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.BeforeOperationArgs; import kd.bos.entity.plugin.args.BeforeOperationArgs;
@ -34,8 +35,10 @@ public class ReceiptNoticeSavePlugin extends AbstractOperationServicePlugIn impl
if (dataEntities1.length > 0) { if (dataEntities1.length > 0) {
DynamicObject dynamicObject = dataEntities1[0]; DynamicObject dynamicObject = dataEntities1[0];
String operationKey = e.getOperationKey();
Map<Long, List<BFRow>> id = BFTrackerServiceHelper.findDirtSourceBills(PM_PURORDERBILL, new Long[]{dynamicObject.getLong("id")}); Map<Long, List<BFRow>> id = BFTrackerServiceHelper.findDirtSourceBills(PM_PURORDERBILL, new Long[]{dynamicObject.getLong("id")});
if (id.size()==0) { if (id.size()==0& StringUtils.equals("save",operationKey)) {
DynamicObjectCollection billentry1 = dynamicObject.getDynamicObjectCollection("billentry"); DynamicObjectCollection billentry1 = dynamicObject.getDynamicObjectCollection("billentry");
if (billentry1.size() > 0) { if (billentry1.size() > 0) {
DynamicObject dynamicObject1 = billentry1.get(0); DynamicObject dynamicObject1 = billentry1.get(0);

View File

@ -2,6 +2,7 @@ package tqq9.lc123.cloud.app.plugin.operate.pm;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn; import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.args.BeforeOperationArgs; import kd.bos.entity.plugin.args.BeforeOperationArgs;
import kd.bos.logging.Log; import kd.bos.logging.Log;
@ -30,7 +31,8 @@ public class SaleOutWareSaveOpPlugin extends AbstractOperationServicePlugIn impl
if (dataEntities1.length > 0) { if (dataEntities1.length > 0) {
DynamicObject dynamicObject = dataEntities1[0]; DynamicObject dynamicObject = dataEntities1[0];
if (dynamicObject.getBoolean("tqq9_isrebulidlink")) { String operationKey = e.getOperationKey();
if (dynamicObject.getBoolean("tqq9_isrebulidlink")&& StringUtils.equals("save",operationKey)) {
DynamicObjectCollection billentry1 = dynamicObject.getDynamicObjectCollection("billentry"); DynamicObjectCollection billentry1 = dynamicObject.getDynamicObjectCollection("billentry");
if (billentry1.size() > 0) { if (billentry1.size() > 0) {
DynamicObject dynamicObject1 = billentry1.get(0); DynamicObject dynamicObject1 = billentry1.get(0);

View File

@ -16,11 +16,7 @@ import tqq9.lc123.cloud.app.plugin.utils.ConfigUtils;
import tqq9.lc123.cloud.app.plugin.utils.FWRestfulUtils; import tqq9.lc123.cloud.app.plugin.utils.FWRestfulUtils;
import tqq9.lc123.cloud.app.plugin.utils.FWUtils; import tqq9.lc123.cloud.app.plugin.utils.FWUtils;
import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
@ -3359,7 +3355,7 @@ public class FWImpl {
DynamicObject providerlinkman = bill.getDynamicObject("providerlinkman"); DynamicObject providerlinkman = bill.getDynamicObject("providerlinkman");
if(providerlinkman != null){ if(providerlinkman != null){
providerlinkman = BusinessDataServiceHelper.loadSingle(providerlinkman.getPkValue(), providerlinkman.getDynamicObjectType().getName()); providerlinkman = BusinessDataServiceHelper.loadSingle(providerlinkman.getPkValue(), providerlinkman.getDynamicObjectType().getName());
dhlxr = providerlinkman.getString("name"); dhlxr = providerlinkman.getString("contactperson");
dhlxrdh = providerlinkman.getString("phone"); dhlxrdh = providerlinkman.getString("phone");
} }
String dhlxdz = bill.getString("provideraddress"); String dhlxdz = bill.getString("provideraddress");