From 71fc51363be5de581bae2b56ce7359bc090cc172 Mon Sep 17 00:00:00 2001 From: hello Date: Mon, 18 Aug 2025 13:54:52 +0800 Subject: [PATCH 1/9] youhua --- .../pr/plugin/operate/OutContractFinaceConfirmeCkOp.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractFinaceConfirmeCkOp.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractFinaceConfirmeCkOp.java index c2c44b1..3a393e7 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractFinaceConfirmeCkOp.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractFinaceConfirmeCkOp.java @@ -40,6 +40,10 @@ public class OutContractFinaceConfirmeCkOp extends AbstractOperationServicePlugI for (DynamicObject dynamicObject : expenseitementry) { i++; DynamicObject zcgjAccounttype = dynamicObject.getDynamicObject("zcgj_accounttype"); + if(zcgjAccounttype == null){ + this.addFatalErrorMessage(extendedDataEntity, String.format("费用项目分录,第%d行科目分类不能为空!",i)); + return; + } String number = zcgjAccounttype.getString("number"); DynamicObject cbs = dynamicObject.getDynamicObject("zcgj_cbs"); if(StringUtils.equals(number, "FL001") && cbs == null){ //生成成本时,工序必录 From 4c380dfdf000ce41fd27c415758e5ab7f78f27c2 Mon Sep 17 00:00:00 2001 From: zhangzhiguo <421587375@qq.com> Date: Mon, 18 Aug 2025 15:21:55 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=AF=B9=E5=85=AC=E6=8A=A5=E9=94=80?= =?UTF-8?q?=E5=8D=95=E5=A2=9E=E5=8A=A0=E6=97=A0=E5=90=88=E5=90=8C=E4=BB=98?= =?UTF-8?q?=E6=AC=BE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...blicreimbursebillNoContractListPlugin.java | 66 +++++++++++++++++++ .../PublicreimbursebillNoContractPlugin.java | 32 +++++++++ 2 files changed, 98 insertions(+) create mode 100644 code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractListPlugin.java create mode 100644 code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractPlugin.java diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractListPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractListPlugin.java new file mode 100644 index 0000000..01bce29 --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractListPlugin.java @@ -0,0 +1,66 @@ +package zcgj.zcdev.zcdev.fs.plugin.form; + +import kd.bos.entity.plugin.args.AfterOperationArgs; +import kd.bos.form.FormShowParameter; +import kd.bos.form.ShowType; +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.events.SetFilterEvent; +import kd.bos.form.operate.FormOperate; +import kd.bos.list.ListShowParameter; +import kd.bos.list.events.BeforeShowBillFormEvent; +import kd.bos.list.plugin.AbstractListPlugin; +import kd.bos.mvc.list.ListView; +import kd.bos.orm.query.QFilter; + +import java.util.HashMap; +import java.util.Map; + +/** + * 对公报销单无合同列表插件 + */ +public class PublicreimbursebillNoContractListPlugin extends AbstractListPlugin { + + private static String current_opkey = ""; + + @Override + public void setFilter(SetFilterEvent e) { + ListShowParameter param = (ListShowParameter) this.getView().getFormShowParameter(); + String isec = param.getCustomParam("isec"); + if (isec!=null) { + if(isec.equals("true")) { + this.getView().setVisible(false, "tblnew"); + } + e.addCustomQFilter(new QFilter("zcgj_isec", "=", Boolean.valueOf(isec))); + }else{ + e.addCustomQFilter(new QFilter("zcgj_isec", "=", false)); + this.getView().setVisible(false, "zcgj_newecbill"); + } + } + + @Override + public void beforeShowBill(BeforeShowBillFormEvent e) { + FormShowParameter formShowParameter = this.getView().getFormShowParameter(); + if(null!=formShowParameter && current_opkey.equals("zcgj_newecbill")){ + Map customParams =formShowParameter.getCustomParams(); + if(null!=customParams){ + customParams.put("isec",true); + e.getParameter().setCustomParams(customParams); + } + current_opkey =""; + } + super.beforeShowBill(e); + } + + @Override + public void beforeItemClick(BeforeItemClickEvent evt) { + String itemKey = evt.getItemKey(); + if("zcgj_newecbill".equals(itemKey)) { + System.out.println(); + current_opkey = "zcgj_newecbill"; + } + super.beforeItemClick(evt); + } +} diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractPlugin.java new file mode 100644 index 0000000..3503de0 --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractPlugin.java @@ -0,0 +1,32 @@ +package zcgj.zcdev.zcdev.fs.plugin.form; + +import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.entity.datamodel.IDataModel; +import kd.bos.form.FormShowParameter; +import kd.bos.form.events.AfterDoOperationEventArgs; +import kd.bos.form.events.SetFilterEvent; +import kd.bos.form.operate.FormOperate; +import kd.bos.list.ListShowParameter; +import kd.bos.list.plugin.AbstractListPlugin; +import kd.bos.orm.query.QFilter; + +import java.util.EventObject; + +/** + * 对公报销单无合同列表插件 + */ +public class PublicreimbursebillNoContractPlugin extends AbstractBillPlugIn { + + @Override + public void afterCreateNewData(EventObject e) { + + Object isecObj = this.getView().getFormShowParameter().getCustomParam("isec"); + if(null!=isecObj){ + boolean isec1 = (boolean)isecObj; + IDataModel model = this.getModel(); + model.setValue("zcgj_isec", isec1); + this.getView().updateView("zcgj_isec"); + } + + } +} From d24bcf8e0630054377e686eaece2e5646c139f5c Mon Sep 17 00:00:00 2001 From: xuhaihui <2098865055@qq.com> Date: Mon, 18 Aug 2025 18:35:42 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E5=80=9F=E6=AC=BE=E5=8D=95=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=92=A4=E9=94=80=E5=92=8C=E5=8F=8D=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=89=A3=E9=99=A4=E5=AF=B9=E5=BA=94=E7=9A=84?= =?UTF-8?q?=E5=AE=9A=E9=A2=9D=E5=A4=87=E7=94=A8=E9=87=91=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E5=92=8C=E6=A0=A1=E9=AA=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operate/DailyLoanBillSubValidatorOp.java | 94 +++++++++++++++++++ .../LoanSlipReserveFundReverserOp.java | 94 +++++++++++++++++++ 2 files changed, 188 insertions(+) create mode 100644 code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java create mode 100644 code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/LoanSlipReserveFundReverserOp.java diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java new file mode 100644 index 0000000..77febd5 --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java @@ -0,0 +1,94 @@ +package zcgj.zcdev.zcdev.fs.plugin.operate; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +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.PreparePropertysEventArgs; +import kd.bos.entity.plugin.args.AfterOperationArgs; +import kd.bos.entity.validate.AbstractValidator; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; +import zcgj.zcdev.zcdev.fs.utils.OrgCheckUtils; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 借款单提交操作插件 + * 说明:校验备用金类型中的借款金额是否满足对应备用金类型的条件 + */ +public class DailyLoanBillSubValidatorOp extends AbstractOperationServicePlugIn { + public void onPreparePropertys(PreparePropertysEventArgs e) { + super.onPreparePropertys(e); + e.getFieldKeys().add("costcompany");//核算组织(费用承担公司) + e.getFieldKeys().add("zcgj_impresttype");//备用金类型 + e.getFieldKeys().add("loanamount");//借款金额合计 + e.getFieldKeys().add("applier");//申请人 + e.getFieldKeys().add("bizdate");//申请日期 + } + + @Override + public void onAddValidators(AddValidatorsEventArgs e) { + super.onAddValidators(e); + e.getValidators().add(new ValidatorExt()); + } + + class ValidatorExt extends AbstractValidator { + @Override + public void validate() { + ExtendedDataEntity[] dataEntities = this.getDataEntities(); + for (ExtendedDataEntity dataEnt : dataEntities) { + DynamicObject er_dailyLoanBill = dataEnt.getDataEntity(); + DynamicObject companyObj = (DynamicObject) er_dailyLoanBill.get("costcompany");//核算组织(费用承担公司) + if (companyObj != null) { + Long companyId = companyObj.getLong("id"); + if (OrgCheckUtils.isKS(companyId)) { + String impRestType = er_dailyLoanBill.getString("zcgj_impresttype");//备用金类型 + DynamicObject applier = er_dailyLoanBill.getDynamicObject("applier");//申请人 + if (impRestType != null && !"".equals(impRestType)) { + if (impRestType.equals("0")) { + //定额备用金 + Date bizDate = er_dailyLoanBill.getDate("bizdate");//申请日期 + BigDecimal loanAmount = er_dailyLoanBill.getBigDecimal("loanamount");//借款金额合计 + LocalDate localDate = bizDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + String bizDateYear = String.valueOf(localDate.getYear());//申请日期年份 + + QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue()); + filter.and(new QFilter("zcgj_currentyear", QCP.equals, bizDateYear)); + DynamicObject quotaImprestLedger = BusinessDataServiceHelper.loadSingle("zcgj_quotaimprestledger", new QFilter[]{filter});//定额备用金初始台账 + DynamicObjectCollection entryEntityCollection = quotaImprestLedger.getDynamicObjectCollection("zcgj_entryentity");//分录 + for (DynamicObject entryEntity : entryEntityCollection) { + DynamicObject person = entryEntity.getDynamicObject("zcgj_person");//人员 + if (person.getPkValue().equals(applier.getPkValue())) { + BigDecimal zcgj_remainingquota = entryEntity.getBigDecimal("zcgj_remainingquota");//剩余额度 + if (zcgj_remainingquota.compareTo(loanAmount) < 0) { + this.addFatalErrorMessage(dataEnt, "借款金额超过剩余额度!!"); + return; + } + } + } + }/* else if (impRestType.equals("1")) { + //临时备用金 + } else if (impRestType.equals("2")) { + //项目筹备备用金 + QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());// 可借款人员 + filter.and(new QFilter("zcgj_entryentity.zcgj_isenabled", QCP.equals, true));// 启用 + filter.and(new QFilter("zcgj_entryentity.zcgj_company", QCP.equals, companyId));// 公司 + DynamicObject projectReserveFund = BusinessDataServiceHelper.loadSingle("zcgj_projectreservefund", new QFilter[]{filter});//项目筹备备用金公司 + }*/ + } + } + } + } + } + } +} diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/LoanSlipReserveFundReverserOp.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/LoanSlipReserveFundReverserOp.java new file mode 100644 index 0000000..00b464b --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/LoanSlipReserveFundReverserOp.java @@ -0,0 +1,94 @@ +package zcgj.zcdev.zcdev.fs.plugin.operate; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.operate.result.OperationResult; +import kd.bos.entity.plugin.AbstractOperationServicePlugIn; +import kd.bos.entity.plugin.args.AfterOperationArgs; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.operation.SaveServiceHelper; +import zcgj.zcdev.zcdev.fs.utils.OrgCheckUtils; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 借款单提交撤销和反审核操作插件 + * 说明:将对应备用金类型中的借款金额反写至对应基础资料中 + */ +public class LoanSlipReserveFundReverserOp extends AbstractOperationServicePlugIn { + @Override + public void afterExecuteOperationTransaction(AfterOperationArgs e) { + super.afterExecuteOperationTransaction(e); + + String operationKey = e.getOperationKey();//操作标识 + OperationResult operationResult = getOperationResult(); + List successPkIds = operationResult.getSuccessPkIds(); + List modifiedEntities = new ArrayList<>(); + + for (Object model : successPkIds) { + long id = (long) model; + QFilter f1 = new QFilter("id", "=", id); + DynamicObject er_dailyLoanBill = BusinessDataServiceHelper.loadSingle("er_dailyloanbill", new QFilter[]{f1});//借款单 + DynamicObject companyObj = (DynamicObject) er_dailyLoanBill.get("costcompany");//核算组织(费用承担公司) + if (companyObj != null) { + Long companyId = companyObj.getLong("id"); + if (OrgCheckUtils.isKS(companyId)) { + String impRestType = er_dailyLoanBill.getString("zcgj_impresttype");//备用金类型 + if (impRestType != null && !"".equals(impRestType)) { + if (impRestType.equals("0")) { + //定额备用金 + DynamicObject applier = er_dailyLoanBill.getDynamicObject("applier");//申请人 + Date bizDate = er_dailyLoanBill.getDate("bizdate");//申请日期 + BigDecimal loanAmount = er_dailyLoanBill.getBigDecimal("loanamount");//借款金额合计 + LocalDate localDate = bizDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + String bizDateYear = String.valueOf(localDate.getYear());//申请日期年份 + QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue()); + filter.and(new QFilter("zcgj_currentyear", QCP.equals, bizDateYear)); + DynamicObject quotaImprestLedger = BusinessDataServiceHelper.loadSingle("zcgj_quotaimprestledger", new QFilter[]{filter});//定额备用金初始台账 + DynamicObjectCollection entryEntityCollection = quotaImprestLedger.getDynamicObjectCollection("zcgj_entryentity");//分录 + for (DynamicObject entryEntity : entryEntityCollection) { + DynamicObject person = entryEntity.getDynamicObject("zcgj_person");//人员 + if (person.getPkValue().equals(applier.getPkValue())) { + if (operationKey.equals("submit")) { + //提交 + BigDecimal zcgj_usedquota = entryEntity.getBigDecimal("zcgj_usedquota").add(loanAmount);//已使用+借款金额 + entryEntity.set("zcgj_usedquota", zcgj_usedquota);//已使用 + BigDecimal zcgj_quota = entryEntity.getBigDecimal("zcgj_quota");//额度 + BigDecimal zcgj_remainingquota = zcgj_quota.subtract(entryEntity.getBigDecimal("zcgj_usedquota"));//额度-已使用 + entryEntity.set("zcgj_remainingquota", zcgj_remainingquota);//剩余额度 + } else if (operationKey.equals("unsubmit") || operationKey.equals("unaudit")) { + //撤销、反审核 + BigDecimal zcgj_usedquota = entryEntity.getBigDecimal("zcgj_usedquota").subtract(er_dailyLoanBill.getBigDecimal("loanamount"));//已使用+借款金额 + entryEntity.set("zcgj_usedquota", zcgj_usedquota);//已使用 + BigDecimal zcgj_remainingquota = entryEntity.getBigDecimal("zcgj_quota").add(entryEntity.getBigDecimal("zcgj_usedquota"));//额度-已使用 + entryEntity.set("zcgj_remainingquota", zcgj_remainingquota);//剩余额度 + } + break; + } + } + modifiedEntities.add(quotaImprestLedger); + }/* else if (impRestType.equals("1")) { + //临时备用金 + } else if (impRestType.equals("2")) { + //项目筹备备用金 + }*/ + } + } + if (!modifiedEntities.isEmpty()) { + try { + SaveServiceHelper.save(modifiedEntities.toArray(new DynamicObject[0])); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + } + } + } +} From f4023db40aeb60f78841741e0dc77dfd32c49d26 Mon Sep 17 00:00:00 2001 From: xuhaihui <2098865055@qq.com> Date: Tue, 19 Aug 2025 09:58:24 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E5=80=9F=E6=AC=BE=E5=8D=95=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=A0=A1=E9=AA=8C=E6=89=A3=E5=87=8F=E8=BF=94=E8=BF=98?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operate/DailyLoanBillSubValidatorOp.java | 29 ++++++++++++++----- .../LoanSlipReserveFundReverserOp.java | 14 ++++----- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java index 77febd5..ceb9f9f 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java @@ -54,17 +54,22 @@ public class DailyLoanBillSubValidatorOp extends AbstractOperationServicePlugIn if (OrgCheckUtils.isKS(companyId)) { String impRestType = er_dailyLoanBill.getString("zcgj_impresttype");//备用金类型 DynamicObject applier = er_dailyLoanBill.getDynamicObject("applier");//申请人 + Date bizDate = er_dailyLoanBill.getDate("bizdate");//申请日期 + LocalDate localDate = bizDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + String bizDateYear = String.valueOf(localDate.getYear());//申请日期年份 if (impRestType != null && !"".equals(impRestType)) { if (impRestType.equals("0")) { //定额备用金 - Date bizDate = er_dailyLoanBill.getDate("bizdate");//申请日期 BigDecimal loanAmount = er_dailyLoanBill.getBigDecimal("loanamount");//借款金额合计 - LocalDate localDate = bizDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); - String bizDateYear = String.valueOf(localDate.getYear());//申请日期年份 - QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue()); - filter.and(new QFilter("zcgj_currentyear", QCP.equals, bizDateYear)); - DynamicObject quotaImprestLedger = BusinessDataServiceHelper.loadSingle("zcgj_quotaimprestledger", new QFilter[]{filter});//定额备用金初始台账 + QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());//可借款人员 + filter.and(new QFilter("zcgj_currentyear", QCP.equals, bizDateYear));//申请日期年份 + DynamicObject quotaImprestLedger = BusinessDataServiceHelper.loadSingle("zcgj_quotaimprestledger", + new QFilter[]{filter});//定额备用金初始台账 + if (quotaImprestLedger == null) { + this.addFatalErrorMessage(dataEnt, "您未在定额备用金初始化台账里!!"); + return; + } DynamicObjectCollection entryEntityCollection = quotaImprestLedger.getDynamicObjectCollection("zcgj_entryentity");//分录 for (DynamicObject entryEntity : entryEntityCollection) { DynamicObject person = entryEntity.getDynamicObject("zcgj_person");//人员 @@ -76,9 +81,17 @@ public class DailyLoanBillSubValidatorOp extends AbstractOperationServicePlugIn } } } - }/* else if (impRestType.equals("1")) { + } else if (impRestType.equals("1")) { //临时备用金 - } else if (impRestType.equals("2")) { + QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());//可借款人员 + filter.and(new QFilter("zcgj_currentyear", QCP.equals, bizDateYear));//申请日期年份 + DynamicObject quotaImprestLedger = BusinessDataServiceHelper.loadSingle("zcgj_quotaimprestledger", + "id",new QFilter[]{filter});//定额备用金初始台账 + if (quotaImprestLedger != null) { + this.addFatalErrorMessage(dataEnt, "您在定额备用金初始化台账里,所以不能使用临时备用金!!"); + return; + } + }/* else if (impRestType.equals("2")) { //项目筹备备用金 QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());// 可借款人员 filter.and(new QFilter("zcgj_entryentity.zcgj_isenabled", QCP.equals, true));// 启用 diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/LoanSlipReserveFundReverserOp.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/LoanSlipReserveFundReverserOp.java index 00b464b..659c34f 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/LoanSlipReserveFundReverserOp.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/LoanSlipReserveFundReverserOp.java @@ -79,13 +79,13 @@ public class LoanSlipReserveFundReverserOp extends AbstractOperationServicePlugI } else if (impRestType.equals("2")) { //项目筹备备用金 }*/ - } - } - if (!modifiedEntities.isEmpty()) { - try { - SaveServiceHelper.save(modifiedEntities.toArray(new DynamicObject[0])); - } catch (Exception ex) { - throw new RuntimeException(ex); + if (!modifiedEntities.isEmpty()) { + try { + SaveServiceHelper.save(modifiedEntities.toArray(new DynamicObject[0])); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } } } } From a3dab0657ec8503e869cbd1aea22ac7014c65d46 Mon Sep 17 00:00:00 2001 From: xuhaihui <2098865055@qq.com> Date: Tue, 19 Aug 2025 13:39:58 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E5=80=9F=E6=AC=BE=E5=8D=95=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=A0=A1=E9=AA=8C=E6=89=A3=E5=87=8F=E8=BF=94=E8=BF=98?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/operate/DailyLoanBillSubValidatorOp.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java index ceb9f9f..9f62754 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java @@ -86,18 +86,23 @@ public class DailyLoanBillSubValidatorOp extends AbstractOperationServicePlugIn QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());//可借款人员 filter.and(new QFilter("zcgj_currentyear", QCP.equals, bizDateYear));//申请日期年份 DynamicObject quotaImprestLedger = BusinessDataServiceHelper.loadSingle("zcgj_quotaimprestledger", - "id",new QFilter[]{filter});//定额备用金初始台账 + "id", new QFilter[]{filter});//定额备用金初始台账 if (quotaImprestLedger != null) { this.addFatalErrorMessage(dataEnt, "您在定额备用金初始化台账里,所以不能使用临时备用金!!"); return; } - }/* else if (impRestType.equals("2")) { + } else if (impRestType.equals("2")) { //项目筹备备用金 QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());// 可借款人员 filter.and(new QFilter("zcgj_entryentity.zcgj_isenabled", QCP.equals, true));// 启用 filter.and(new QFilter("zcgj_entryentity.zcgj_company", QCP.equals, companyId));// 公司 - DynamicObject projectReserveFund = BusinessDataServiceHelper.loadSingle("zcgj_projectreservefund", new QFilter[]{filter});//项目筹备备用金公司 - }*/ + DynamicObject projectReserveFund = BusinessDataServiceHelper.loadSingle("zcgj_projectreservefund", + "id", new QFilter[]{filter});//项目筹备备用金公司 + if (projectReserveFund == null) { + this.addFatalErrorMessage(dataEnt, "您未在项目筹备备用金公司里,所以不能使用项目筹备备用金!!"); + return; + } + } } } } From fc72394ab4bdda7d2716e3f1ba9d391b9a8341d7 Mon Sep 17 00:00:00 2001 From: zhangzhiguo <421587375@qq.com> Date: Tue, 19 Aug 2025 14:45:39 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E6=97=A0=E5=90=88=E5=90=8C=E4=BB=98?= =?UTF-8?q?=E6=AC=BE=E7=94=B3=E8=AF=B7=E5=8D=95(=E5=AF=B9=E5=85=AC?= =?UTF-8?q?=E6=8A=A5=E9=94=80=E5=8D=95)=E5=90=88=E5=90=8C=E5=BF=85?= =?UTF-8?q?=E5=BD=95=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operate/PublicBillContractCkOp.java | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/PublicBillContractCkOp.java diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/PublicBillContractCkOp.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/PublicBillContractCkOp.java new file mode 100644 index 0000000..a638654 --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/PublicBillContractCkOp.java @@ -0,0 +1,71 @@ +package zcgj.zcdev.zcdev.fs.plugin.operate; + +import kd.bos.context.RequestContext; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.ExtendedDataEntity; +import kd.bos.entity.plugin.AbstractOperationServicePlugIn; +import kd.bos.entity.plugin.AddValidatorsEventArgs; +import kd.bos.entity.plugin.PreparePropertysEventArgs; +import kd.bos.entity.validate.AbstractValidator; +import kd.bos.servicehelper.user.UserServiceHelper; +import kd.bos.util.StringUtils; +import zcgj.zcdev.zcdev.fs.utils.OrgCheckUtils; + +import java.text.SimpleDateFormat; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 无合同付款申请单(对公报销单)合同必录校验 + */ +public class PublicBillContractCkOp extends AbstractOperationServicePlugIn { + + @Override + public void onPreparePropertys(PreparePropertysEventArgs e) { + super.onPreparePropertys(e); + e.getFieldKeys().add("costcompany"); + e.getFieldKeys().add("zcgj_isec"); + e.getFieldKeys().add("zcgj_invoiceremark");//特殊说明 + e.getFieldKeys().add("zcgj_nocontract");//合同付款类型 无合同付款 NOCONTRACT , 合同付款 CONTRACT + e.getFieldKeys().add("contractentry");//关联合同 + } + + @Override + public void onAddValidators(AddValidatorsEventArgs e) { + super.onAddValidators(e); + e.getValidators().add(new ValidatorExt()); + } + + class ValidatorExt extends AbstractValidator { + @Override + public void validate() { + ExtendedDataEntity[] extendedDataEntities = this.getDataEntities(); + + for (ExtendedDataEntity extendedDataEntity : extendedDataEntities) { + DynamicObject dataEntity = extendedDataEntity.getDataEntity(); + Object costcompanyObj = dataEntity.get("costcompany"); + Object costdeptObj = dataEntity.get("costdept"); + if(costcompanyObj!=null && costdeptObj != null){ + DynamicObject costcompany = (DynamicObject)costcompanyObj; + long costcompanyId = costcompany.getLong("id"); + if(OrgCheckUtils.isKS(costcompanyId)){ + boolean isec = dataEntity.getBoolean("zcgj_isec"); + if(isec){ + String nocontract = dataEntity.getString("zcgj_nocontract"); + if("CONTRACT".equals(nocontract)){ //如果是合同付款 + DynamicObjectCollection contractentry = dataEntity.getDynamicObjectCollection("contractentry"); + String invoiceremark = dataEntity.getString("zcgj_invoiceremark"); + if((contractentry == null || contractentry.isEmpty()) && StringUtils.isEmpty(invoiceremark)){ + this.addFatalErrorMessage(extendedDataEntity, String.format("合同付款类型为合同付款时,关联合同分录不能为空或填写特殊说明!")); + } + } + } + + } + } + } + } + } +} From 09dd32d717e41773dd90f53f5b690b603e8c8102 Mon Sep 17 00:00:00 2001 From: zhangzhiguo <421587375@qq.com> Date: Tue, 19 Aug 2025 14:46:12 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E6=97=A0=E5=90=88=E5=90=8C=E4=BB=98?= =?UTF-8?q?=E6=AC=BE=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PublicreimbursebillNoContractPlugin.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractPlugin.java index 3503de0..1093ccc 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillNoContractPlugin.java @@ -1,14 +1,22 @@ package zcgj.zcdev.zcdev.fs.plugin.form; import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.bill.BillShowParameter; +import kd.bos.bill.OperationStatus; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.LocaleString; +import kd.bos.dataentity.resource.ResManager; import kd.bos.entity.datamodel.IDataModel; import kd.bos.form.FormShowParameter; import kd.bos.form.events.AfterDoOperationEventArgs; +import kd.bos.form.events.PreOpenFormEventArgs; import kd.bos.form.events.SetFilterEvent; import kd.bos.form.operate.FormOperate; import kd.bos.list.ListShowParameter; import kd.bos.list.plugin.AbstractListPlugin; import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.QueryServiceHelper; +import org.apache.commons.lang.StringUtils; import java.util.EventObject; @@ -17,6 +25,8 @@ import java.util.EventObject; */ public class PublicreimbursebillNoContractPlugin extends AbstractBillPlugIn { + private static boolean editTitle = false; + @Override public void afterCreateNewData(EventObject e) { @@ -25,8 +35,46 @@ public class PublicreimbursebillNoContractPlugin extends AbstractBillPlugIn { boolean isec1 = (boolean)isecObj; IDataModel model = this.getModel(); model.setValue("zcgj_isec", isec1); + editTitle = isec1; this.getView().updateView("zcgj_isec"); + if(isec1){ + this.getView().setFormTitle(new LocaleString("无合同付款申请单")); + } } + } + @Override + public void afterBindData(EventObject e) { + super.afterBindData(e); + boolean isec=(boolean)this.getModel().getValue("zcgj_isec"); + if(isec){ + this.getView().setFormTitle(new LocaleString("无合同付款申请单")); + } + } + + @Override + public void preOpenForm(PreOpenFormEventArgs e) { + super.preOpenForm(e); + /* OperationStatus status = e.getFormShowParameter().getStatus(); + if (!status.equals(OperationStatus.ADDNEW)) { + Object pkId = ((BillShowParameter)e.getSource()).getPkId(); + if (pkId == null) { + return; + } + try { + String formId = e.getFormShowParameter().getFormId(); + DynamicObject upLookBill = QueryServiceHelper.queryOne(formId, "zcgj_isec", new QFilter[]{new QFilter("id", "=", pkId)}); + boolean isec = upLookBill.getBoolean("zcgj_isec"); + if (isec) { + BillShowParameter billShowParameter = (BillShowParameter)e.getFormShowParameter(); + billShowParameter.setCaption(ResManager.loadKDString("无合同付款申请单", "PublicReimAssetBillEdit_1", "fi-er-formplugin", new Object[0])); + } + } catch (Exception var8) { + //logger.error("没有找到相应的对公报销单,其pk为:" + pkId); + } + }if(editTitle){ + BillShowParameter billShowParameter = (BillShowParameter)e.getFormShowParameter(); + billShowParameter.setCaption(ResManager.loadKDString("无合同付款申请单", "PublicReimAssetBillEdit_1", "fi-er-formplugin", new Object[0])); + }*/ } } From da9f943fa581a089d3e030e874f70bb5813f03e0 Mon Sep 17 00:00:00 2001 From: zhangzhiguo <421587375@qq.com> Date: Tue, 19 Aug 2025 14:46:53 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E8=B5=84=E9=87=91=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=AD=97=E6=AE=B5=E7=BC=BA=E5=A4=B1=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zcgj/zcdev/zcdev/pr/plugin/form/FundingplanapplyPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/FundingplanapplyPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/FundingplanapplyPlugin.java index b2894b1..e68e6eb 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/FundingplanapplyPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/FundingplanapplyPlugin.java @@ -82,7 +82,7 @@ public class FundingplanapplyPlugin extends AbstractBillPlugIn implements Plugin DynamicObject[] load = BusinessDataServiceHelper.load("zcgj_ec_fundingplanapply", "zcgj_period," + "zcgj_infundproject_entry.zcgj_in_fundproject,zcgj_infundproject_entry.zcgj_in_custom,zcgj_infundproject_entry.zcgj_iinitialreceivable " + - ",zcgj_infundproject_entry.zcgj_expectedmonetarycap,zcgj_infundproject_entry.zcgj_expectedmonetaryfund,zcgj_infundproject_entry.zcgj_otheramount,zcgj_infundproject_entry.zcgj_expectedreceivableba "+ + ",zcgj_infundproject_entry.zcgj_expectedmonetarycap,zcgj_infundproject_entry.zcgj_expectedmonetaryfund,zcgj_infundproject_entry.zcgj_otheramount,zcgj_infundproject_entry.zcgj_expectedreceivableba,zcgj_infundproject_entry.zcgj_plannedoutputvalue "+ ",zcgj_outfundproject_entry.zcgj_out_fundproject,zcgj_outfundproject_entry.zcgj_out_supplier,zcgj_outfundproject_entry.zcgj_openingpayable" + ",createtime", searchFilterList.toArray(new QFilter[]{}), "createtime desc"); From b63dc4756fb46a8507d1ba84b761b32faf970c02 Mon Sep 17 00:00:00 2001 From: xuhaihui <2098865055@qq.com> Date: Tue, 19 Aug 2025 16:24:18 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E5=80=9F=E6=AC=BE=E5=8D=95=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=A0=A1=E9=AA=8C=E6=89=A3=E5=87=8F=E8=BF=94=E8=BF=98?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fs/plugin/operate/DailyLoanBillSubValidatorOp.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java index 9f62754..ab60cfd 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyLoanBillSubValidatorOp.java @@ -91,6 +91,13 @@ public class DailyLoanBillSubValidatorOp extends AbstractOperationServicePlugIn this.addFatalErrorMessage(dataEnt, "您在定额备用金初始化台账里,所以不能使用临时备用金!!"); return; } + QFilter filter1 = new QFilter("balanceamount", QCP.not_equals, 0); + DynamicObject er_dailyLoanBill1 = BusinessDataServiceHelper.loadSingle("er_dailyloanbill", + "id", new QFilter[]{filter1});//定额备用金初始台账 + if (er_dailyLoanBill1 != null){ + this.addFatalErrorMessage(dataEnt, "您存在未还完的借款!!"); + return; + } } else if (impRestType.equals("2")) { //项目筹备备用金 QFilter filter = new QFilter("zcgj_entryentity.zcgj_person", QCP.equals, applier.getPkValue());// 可借款人员