diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillContractPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillContractPlugin.java new file mode 100644 index 0000000..a60b37b --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillContractPlugin.java @@ -0,0 +1,71 @@ +package zcgj.zcdev.zcdev.fs.plugin.form; + +import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.operate.Submit; +import kd.bos.form.events.BeforeDoOperationEventArgs; +import kd.bos.logging.Log; +import kd.bos.logging.LogFactory; +import kd.sdk.plugin.Plugin; + +import java.time.LocalDate; +import java.time.ZoneId; +import java.util.Date; + +/** + * 对公报销单去年合同提醒插件 + */ +public class PublicreimbursebillContractPlugin extends AbstractBillPlugIn implements Plugin{ + + private static final Log log = LogFactory.getLog(PublicreimbursebillContractPlugin.class); + //开发商标识 + private static final String prefix ="zcgj"; + + //预付单的关联合同标识 + private final static String CONTRACT_ENTRY_ENTITY = "contractentry"; + + @Override + public void beforeDoOperation(BeforeDoOperationEventArgs args) { + + if((args.getSource() instanceof Submit) ) { + Submit source = (Submit) args.getSource(); + if (source.getOperateKey().equals("submit")) { + //获取当前页面的数据包 + DynamicObject dataEntity = this.getModel().getDataEntity(true); + //获取单据体数据的集合 + DynamicObjectCollection goodsEntities=dataEntity.getDynamicObjectCollection(CONTRACT_ENTRY_ENTITY); + boolean isMsg = false; + for (DynamicObject entryObj : goodsEntities) { + //获取合同签订日期 + Date signdate = entryObj.getDate("signdate"); + LocalDate localDate = dateToLocalDate(signdate); + int signdateYear = localDate.getYear(); + int currentYear = LocalDate.now().getYear(); + if(signdateYear 0){ this.getView().showTipNotification("报销住宿超出标准!(上浮20%)"); @@ -73,4 +76,44 @@ public class TripreimbursebillPlugin extends AbstractBillPlugIn implements Plug } } } + + @Override + public void propertyChanged(PropertyChangedArgs e) { + super.propertyChanged(e); + String name = e.getProperty().getName(); + if(name.equals("zcgj_isfloating20")){ + IDataModel model = this.getModel(); + ChangeData[] changeSet = e.getChangeSet(); + Boolean isfloating20 = (Boolean)changeSet[0].getNewValue(); + String zsKey = String.valueOf(model.getValue("zcgj_zs_key")); + + //获取当前费用为住宿的 + DynamicObjectCollection tripentryCollection = model.getEntryEntity("tripentry"); + //tripentry.get(0).getDynamicObjectCollection("entryentity").get(2).getDynamicObject("expenseitem").getString("number"); + for (DynamicObject tripentry : tripentryCollection) { + DynamicObjectCollection entryentityCollection = tripentry.getDynamicObjectCollection("entryentity"); + for (DynamicObject entryentity : entryentityCollection) { + DynamicObject expenseitem = entryentity.getDynamicObject("expenseitem"); + String zsNumber = expenseitem.getString("number"); + if(zsKey.equals(zsNumber)){ + BigDecimal orientryamount = entryentity.getBigDecimal("orientryamount");//报销金额 + BigDecimal tripstandardamount = entryentity.getBigDecimal("tripstandardamount");//差旅标准金额 + BigDecimal tripstandardamountOld = tripstandardamount;//差旅标准金额 + + Integer caldaycount = entryentity.getInt("caldaycount");//标准天数 + //如果选择了上浮20%,则按照上浮20%进行判断 + if(isfloating20){ + BigDecimal multiply = tripstandardamount.multiply(new BigDecimal("1.2")); + entryentity.set("tripstandardamount",multiply); + }else{ + entryentity.set("tripstandardamount",tripstandardamountOld); + } + this.getView().updateView("entryentity"); + this.getView().showTipNotification(tripstandardamount+" "+tripstandardamountOld); + } + } + } + + } + } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/report/BudgetActuRptListPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/report/BudgetActuRptListPlugin.java index 8f487e2..314f123 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/report/BudgetActuRptListPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/report/BudgetActuRptListPlugin.java @@ -1,6 +1,8 @@ package zcgj.zcdev.zcdev.fs.plugin.report; +import kd.bos.context.RequestContext; import kd.bos.dataentity.resource.ResManager; +import kd.bos.entity.datamodel.IDataModel; import kd.bos.entity.datamodel.events.PackageDataEvent; import kd.bos.entity.report.FilterInfo; import kd.bos.entity.report.ReportQueryParam; @@ -35,6 +37,15 @@ public class BudgetActuRptListPlugin extends AbstractReportFormPlugin implements super.packageData(packageDataEvent); } + @Override + public void initDefaultQueryParam(ReportQueryParam queryParam) { + super.initDefaultQueryParam(queryParam); + IDataModel model = this.getModel(); + //获取当前登陆人所在组织 + long orgId = RequestContext.get().getOrgId(); + model.setValue("zcgj_query_org",orgId); + } + @Override public boolean verifyQuery(ReportQueryParam queryParam) { FilterInfo filter = queryParam.getFilter(); @@ -46,6 +57,8 @@ public class BudgetActuRptListPlugin extends AbstractReportFormPlugin implements return true; } + + @Override public void setCellStyleRules(List cellStyleRules) { for (String field : FIELDS) { diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/report/FeeDeductionRptListPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/report/FeeDeductionRptListPlugin.java index 6d369d0..b37f8a7 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/report/FeeDeductionRptListPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/report/FeeDeductionRptListPlugin.java @@ -1,5 +1,7 @@ package zcgj.zcdev.zcdev.fs.plugin.report; +import kd.bos.context.RequestContext; +import kd.bos.entity.datamodel.IDataModel; import kd.bos.entity.datamodel.events.PackageDataEvent; import kd.bos.entity.report.FilterInfo; import kd.bos.entity.report.ReportQueryParam; @@ -35,6 +37,15 @@ public class FeeDeductionRptListPlugin extends AbstractReportFormPlugin implemen super.packageData(packageDataEvent); } + @Override + public void initDefaultQueryParam(ReportQueryParam queryParam) { + super.initDefaultQueryParam(queryParam); + IDataModel model = this.getModel(); + //获取当前登陆人所在组织 + long orgId = RequestContext.get().getOrgId(); + model.setValue("zcgj_query_org",orgId); + } + @Override public boolean verifyQuery(ReportQueryParam queryParam) { FilterInfo filter = queryParam.getFilter(); diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/report/PositionFeesRptListPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/report/PositionFeesRptListPlugin.java index 6c43d26..c83c9cb 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/report/PositionFeesRptListPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/report/PositionFeesRptListPlugin.java @@ -1,5 +1,7 @@ package zcgj.zcdev.zcdev.fs.plugin.report; +import kd.bos.context.RequestContext; +import kd.bos.entity.datamodel.IDataModel; import kd.bos.entity.datamodel.events.PackageDataEvent; import kd.bos.entity.report.FilterInfo; import kd.bos.entity.report.ReportQueryParam; @@ -7,10 +9,11 @@ import kd.bos.report.events.CellStyleRule; import kd.bos.report.plugin.AbstractReportFormPlugin; import kd.sdk.plugin.Plugin; +import java.util.Date; import java.util.List; /** - * 领导预算汇总与实际台账 + * 职务消费台账 * 报表格式化插件 */ public class PositionFeesRptListPlugin extends AbstractReportFormPlugin implements Plugin { @@ -33,6 +36,16 @@ public class PositionFeesRptListPlugin extends AbstractReportFormPlugin implemen super.setMergeColums(columns); } + @Override + public void initDefaultQueryParam(ReportQueryParam queryParam) { + super.initDefaultQueryParam(queryParam); + IDataModel model = this.getModel(); + //获取当前登陆人所在组织 + long orgId = RequestContext.get().getOrgId(); + model.setValue("zcgj_query_org",orgId); + model.setValue("zcgj_query_year",new Date()); + } + @Override public boolean verifyQuery(ReportQueryParam queryParam) { FilterInfo filter = queryParam.getFilter();