diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/SubjectbalancePlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/SubjectbalancePlugin.java index 020667e..78de684 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/SubjectbalancePlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/SubjectbalancePlugin.java @@ -1,17 +1,22 @@ package zcgj.zcdev.zcdev.fs.plugin.form; +import kd.bos.dataentity.entity.DynamicObject; import kd.bos.entity.filter.ControlFilters; import kd.bos.form.control.events.ItemClickEvent; import kd.bos.list.IListView; 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.DeleteServiceHelper; import kd.sdk.plugin.Plugin; import zcgj.zcdev.zcdev.fs.plugin.common.AssetsLiabilitiesbalanceAutoData; import zcgj.zcdev.zcdev.fs.plugin.common.SubjectbalanceAutoData; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; import java.util.List; /** @@ -27,7 +32,19 @@ public class SubjectbalancePlugin extends AbstractListPlugin implements Plugin String itemKey = evt.getItemKey(); if("zcgj_gatdata".equals(itemKey)) { //科目余额表自动取数 - SubjectbalanceAutoData.getData(null,true);//其他 + LocalDate currentDate = LocalDate.now(); + // 定义格式器 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM"); + // 格式化为字符串 + String currentMonth = currentDate.format(formatter); + + QFilter idFilter = new QFilter("number", QCP.equals, currentMonth); + DynamicObject curperiod = BusinessDataServiceHelper.loadSingle("bd_period", "id,number", new QFilter[]{idFilter}); + if(curperiod!=null){ + SubjectbalanceAutoData.getData(curperiod.getLong("id"),true);//其他 + }else{ + this.getView().showMessage("获取当前期间有误!"); + } }else if("zcgj_gatdataperiod".equals(itemKey)) { //获取列表查询参数 ControlFilters filters = ((IListView)this.getView()).getControlFilters(); diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/AimcostcbsbillEditUIExt.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/AimcostcbsbillEditUIExt.java index 3198649..30734e7 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/AimcostcbsbillEditUIExt.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/AimcostcbsbillEditUIExt.java @@ -38,6 +38,7 @@ import kd.bos.form.field.events.BeforeF7SelectListener; import kd.bos.form.operate.FormOperate; import kd.bos.list.ListShowParameter; import kd.bos.orm.ORM; +import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.QueryServiceHelper; @@ -57,7 +58,7 @@ import kd.ec.cost.utils.CostTypeUtils; import kd.ec.cost.utils.CurrencyFormatUtil; //二开系统插件 -//工序成本预算表单插件:项目基础资料过滤和保存校验逻辑修改 +//工序成本预算表单插件:项目基础资料过滤和保存校验逻辑修改(项目年度预算) public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements BeforeF7SelectListener, RowClickEventListener { private static final String IS_CANCEL = "isCancel"; private static final String EDITONUNIT = "editonunit"; @@ -95,6 +96,12 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B boqEdit.addBeforeF7SelectListener(this); TreeEntryGrid grid = (TreeEntryGrid) this.getControl("treeentryentity"); grid.addRowClickListener(this); + + //工序过滤 + BasedataEdit cbs = this.getControl("cbs"); + if (cbs != null) { + cbs.addBeforeF7SelectListener(this); + } } public void entryRowClick(RowClickEvent rowclickevent) { @@ -140,6 +147,20 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B }/* else if ("project".equals(name)) { this.beforeProjectSelected(beforef7selectevent);//二开注释掉的 }*/ + else if ("cbs".equals(name)) { + //工序过滤 + Object projectObj = this.getModel().getValue("project");//工程项目 + if (projectObj == null) { + this.getView().showMessage(ResManager.loadKDString("请选择项目。", "EntCostSplitEditPlugin_0", "ec-ecco-formplugin", new Object[0])); + }else { + DynamicObject projectInfo = (DynamicObject)projectObj; + QFilter qFilter = new QFilter("project.id", QCP.equals, projectInfo.getLong("id")); + QFilter treeFilter = new QFilter("project.number", QCP.equals, projectInfo.getString("number")); + ListShowParameter showParameter = (ListShowParameter) beforef7selectevent.getFormShowParameter(); + showParameter.getListFilterParameter().getQFilters().add(qFilter); + showParameter.getTreeFilterParameter().getQFilters().add(treeFilter); + } + } } @@ -353,8 +374,18 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B entryColl.add(newValue); } } + //本年计划利润 zcgj_profitamount + this.getModel().setValue("zcgj_profitamount", project.getBigDecimal("zcgj_profitamount")); + //上年实际利润 zcgj_lastprofitamount + this.getModel().setValue("zcgj_lastprofitamount", project.getBigDecimal("zcgj_lastprofitamount")); + //上年实际产量 zcgj_alllastyearcount + this.getModel().setValue("zcgj_alllastyearcount", project.getBigDecimal("zcgj_alllastyearcount")); + //上年实际产值 zcgj_alllastyearamount + this.getModel().setValue("zcgj_alllastyearamount", project.getBigDecimal("zcgj_alllastyearamount")); + + DynamicObjectCollection newInfundprojectEntry = this.getModel().getDataEntity().getDynamicObjectCollection("zcgj_infundproject_entry"); - //上期项目收入预算 + //产出物收入预算 DynamicObjectCollection infundprojectEntry = project.getDynamicObjectCollection("zcgj_infundproject_entry"); if(!infundprojectEntry.isEmpty()) { for (DynamicObject dynamicObject : infundprojectEntry) { @@ -366,6 +397,13 @@ public class AimcostcbsbillEditUIExt extends AbstractEccoBillPlugin implements B dynamicObject1.set("zcgj_yearrecamount",dynamicObject.getBigDecimal("zcgj_yearrecamount")); dynamicObject1.set("zcgj_in_remarks",dynamicObject.getString("zcgj_in_remarks")); dynamicObject1.set("zcgj_in_seq",dynamicObject.getBigDecimal("zcgj_in_seq")); + //zcgj_producttype 产出物 + dynamicObject1.set("zcgj_producttype",dynamicObject.getDynamicObject("zcgj_producttype")); + //zcgj_lastyearcount 上年实际产量 + dynamicObject1.set("zcgj_lastyearcount",dynamicObject.getBigDecimal("zcgj_lastyearcount")); + //zcgj_lastyearamount 上年实际产值 + dynamicObject1.set("zcgj_lastyearamount",dynamicObject.getBigDecimal("zcgj_lastyearamount")); + } this.getView().updateView("zcgj_infundproject_entry"); diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EquipmentCardListPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EquipmentCardListPlugin.java index c04356b..4ec2c18 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EquipmentCardListPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/EquipmentCardListPlugin.java @@ -283,6 +283,16 @@ public class EquipmentCardListPlugin extends AbstractListPlugin implements Plugi System.out.println("总报错信息为:"+operationResultErrorInfos); } this.getView().showMessage("同步成功!"); + }else if(itemKey.equals("zcgj_cleanasset")){//清除设备折旧数据 + DynamicObject[] eceq_equipment = BusinessDataServiceHelper.load("eceq_equipinfo", "zcgj_entryentity", new QFilter[]{}); + if(eceq_equipment!=null){ + for (DynamicObject dynamicObject : eceq_equipment) { + DynamicObjectCollection entrys = dynamicObject.getDynamicObjectCollection("zcgj_entryentity"); + entrys.clear(); + } + SaveServiceHelper.save(eceq_equipment); + this.getView().showMessage("执行完成。清除条数为"+eceq_equipment.length); + } } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InContractFinaceConfirmeInvoicePlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InContractFinaceConfirmeInvoicePlugin.java index d2f8bc1..607da1c 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InContractFinaceConfirmeInvoicePlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/InContractFinaceConfirmeInvoicePlugin.java @@ -84,14 +84,14 @@ public class InContractFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn im filter.and(new QFilter("billstatus", "=", "C")); filter.and(new QFilter("currency", "=", currencyId)); filter.and(new QFilter("invoicestatus", "!=", "2")); - filter.and(new QFilter("unapplyamount", ">", BigDecimal.ZERO)); + filter.and(new QFilter("unapplyamount", "!=", BigDecimal.ZERO)); QFilter filter1 = new QFilter("isclaimed", "=", true); filter1.and(new QFilter("billstatus", "=", "C")); DynamicObject contract = (DynamicObject)this.getModel().getValue("zcgj_contract"); if (contract != null) { long contractId = contract.getLong("id"); filter1.and(new QFilter("contract", "=", contractId)); - filter1.and(new QFilter("unapplyamount", ">", BigDecimal.ZERO)); + filter1.and(new QFilter("unapplyamount", "!=", BigDecimal.ZERO)); DynamicObjectCollection contInvEntryCol = this.getModel().getEntryEntity("zcgj_entryentity"); if (!contInvEntryCol.isEmpty()) { List selectedInvIds = new ArrayList(8); @@ -232,9 +232,9 @@ public class InContractFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn im this.getView().showTipNotification(String.format(ResManager.loadKDString("发票号码%s,已存在分录行", "PaymentApplyEditUI_22", "ec-contract-formplugin", new Object[0]), invoice.getString("invoiceno"))); } else { BigDecimal unApplyAmount = invoice.getBigDecimal("unapplyamount"); - if (unApplyAmount != null && unApplyAmount.doubleValue() <= (double)0.0F) { + /*if (unApplyAmount != null && unApplyAmount.doubleValue() <= (double)0.0F) { this.getView().showTipNotification(String.format(ResManager.loadKDString("发票号码%s,金额已经被关联完毕,不可重复使用", "PaymentApplyEditUI_23", "ec-contract-formplugin", new Object[0]), invoice.getString("invoiceno"))); - } else { + } else {*/ DynamicObject upContract = (DynamicObject)this.getModel().getValue("zcgj_contract"); int rowIndex = this.getModel().createNewEntryRow("zcgj_entryentity"); this.getModel().setValue("zcgj_invoice", invoice.getPkValue(), rowIndex); @@ -250,7 +250,7 @@ public class InContractFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn im invoice.set("project", (DynamicObject)this.getModel().getValue("zcgj_project")); invoice.set("connecttype", "contract"); invArr.add(invoice); - } + // } } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaintenanceAckBillPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaintenanceAckBillPlugin.java index 57229a7..9976836 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaintenanceAckBillPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaintenanceAckBillPlugin.java @@ -203,7 +203,8 @@ public class MaintenanceAckBillPlugin extends AbstractBillPlugIn implements Plug for (DynamicObject newInvoice : newInvoices) { DynamicObject buyerOrg = newInvoice.getDynamicObject("buyer"); if (buyerOrg != null && buyerOrg.getLong("id") != orgId) { - this.getView().showErrorNotification(ResManager.loadKDString("导入失败:当前发票购买方不为当前财务记账组织,请确认信息。", "PaymentApplyEditUI_20", "ec-contract-formplugin", new Object[0])); + this.getView().showTipNotification(ResManager.loadKDString("导入失败:当前发票购买方不为当前财务记账组织,请确认信息。", "PaymentApplyEditUI_20", "ec-contract-formplugin", new Object[0])); + //this.getView().showErrorNotification(ResManager.loadKDString("导入失败:当前发票购买方不为当前财务记账组织,请确认信息。", "PaymentApplyEditUI_20", "ec-contract-formplugin", new Object[0])); return; } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInbFinaceConfirmeInvoicePlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInbFinaceConfirmeInvoicePlugin.java index 3e21bd3..76ed43c 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInbFinaceConfirmeInvoicePlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInbFinaceConfirmeInvoicePlugin.java @@ -264,7 +264,8 @@ public class MaterialInbFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i for (DynamicObject newInvoice : newInvoices) { DynamicObject buyerOrg = newInvoice.getDynamicObject("buyer"); if (buyerOrg != null && buyerOrg.getLong("id") != orgId) { - this.getView().showErrorNotification(ResManager.loadKDString("导入失败:当前发票购买方不为当前财务记账组织,请确认信息。", "PaymentApplyEditUI_20", "ec-contract-formplugin", new Object[0])); + this.getView().showTipNotification(ResManager.loadKDString("导入失败:当前发票购买方不为当前财务记账组织,请确认信息。", "PaymentApplyEditUI_20", "ec-contract-formplugin", new Object[0])); + //this.getView().showErrorNotification(ResManager.loadKDString("导入失败:当前发票购买方不为当前财务记账组织,请确认信息。", "PaymentApplyEditUI_20", "ec-contract-formplugin", new Object[0])); return; } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFinaceConfirmeInvoicePlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFinaceConfirmeInvoicePlugin.java index fdc4cdd..5956bea 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFinaceConfirmeInvoicePlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/OutContractFinaceConfirmeInvoicePlugin.java @@ -100,7 +100,7 @@ public class OutContractFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i filter.and(new QFilter("billstatus", "=", "C")); filter.and(new QFilter("currency", "=", currencyId)); filter.and(new QFilter("invoicestatus", "!=", "2")); - filter.and(new QFilter("unapplyamount", ">", BigDecimal.ZERO)); + filter.and(new QFilter("unapplyamount", "!=", BigDecimal.ZERO)); filter.and(new QFilter("zcgj_isbind", "=", false)); //发票被 rim_expense_relation 关系绑定 QFilter filter1 = new QFilter("isclaimed", "=", true); filter1.and(new QFilter("billstatus", "=", "C")); @@ -108,7 +108,7 @@ public class OutContractFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i if (contract != null) { long contractId = contract.getLong("id"); filter1.and(new QFilter("contract", "=", contractId)); - filter1.and(new QFilter("unapplyamount", ">", BigDecimal.ZERO)); + filter1.and(new QFilter("unapplyamount", "!=", BigDecimal.ZERO)); DynamicObjectCollection contInvEntryCol = this.getModel().getEntryEntity("zcgj_entryentity"); if (contInvEntryCol.size() > 0) { List selectedInvIds = new ArrayList(8); @@ -251,9 +251,9 @@ public class OutContractFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i this.getView().showTipNotification(String.format(ResManager.loadKDString("发票号码%s,已存在分录行", "PaymentApplyEditUI_22", "ec-contract-formplugin", new Object[0]), invoice.getString("invoiceno"))); } else { BigDecimal unApplyAmount = invoice.getBigDecimal("unapplyamount"); - if (unApplyAmount != null && unApplyAmount.doubleValue() <= (double)0.0F) { + /*if (unApplyAmount != null && unApplyAmount.doubleValue() <= (double)0.0F) { this.getView().showTipNotification(String.format(ResManager.loadKDString("发票号码%s,金额已经被关联完毕,不可重复使用", "PaymentApplyEditUI_23", "ec-contract-formplugin", new Object[0]), invoice.getString("invoiceno"))); - } else { + } else {*/ DynamicObject upContract = (DynamicObject)this.getModel().getValue("zcgj_contract"); int rowIndex = this.getModel().createNewEntryRow("zcgj_entryentity"); this.getModel().setValue("zcgj_invoice", invoice.getPkValue(), rowIndex); @@ -270,7 +270,7 @@ public class OutContractFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i invoice.set("connecttype", "contract"); invoice.set("zcgj_isbind", true); invArr.add(invoice); - } + // } } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractSettleUnauditCheckOp.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractSettleUnauditCheckOp.java index efaffbb..d381d88 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractSettleUnauditCheckOp.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/operate/OutContractSettleUnauditCheckOp.java @@ -1,5 +1,7 @@ package zcgj.zcdev.zcdev.pr.plugin.operate; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.entity.ExtendedDataEntity; @@ -7,12 +9,16 @@ 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.openapi.common.result.OpenApiResult; +import kd.bos.openapi.common.util.OpenApiSdkUtil; import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.operation.DeleteServiceHelper; import java.math.BigDecimal; +import java.util.List; +import java.util.Map; /** * 支出合同结算冲销单反审核校验是否生成收入合同冲销单 @@ -65,6 +71,8 @@ public class OutContractSettleUnauditCheckOp extends AbstractOperationServicePlu } return; }else{ + //删除发票绑定关系 + bindInvoice("1", dynamicObject.getLong("id")); QFilter idFilter = new QFilter("id", "=", dynamicObject.getLong("id")); QFilter statusFilter = new QFilter("billstatus", "=", "A"); DeleteServiceHelper.delete("zcgj_ec_out_finaceconfirm", new QFilter[]{idFilter.and(statusFilter)}); @@ -75,4 +83,27 @@ public class OutContractSettleUnauditCheckOp extends AbstractOperationServicePlu } } } + + + public void bindInvoice(String status,Long billId){ + // 拼接完整 JSON + String par =""; + if("1".equals(status)){ //删除发票绑定关系 + par = "{" + + " \"messageType\": \"billDel\"," + + " \"messageId\": \""+System.currentTimeMillis()+"\"," + + " \"data\": {" + + " \"billId\": \"" + billId + "\"," + + " \"resource\": \"4\"" + + " }" + + "}"; + } + Gson gson = new Gson(); + //String json = gson.toJson(balanceQueryParamApi); + Map params = gson.fromJson(par, + new TypeToken>() { + }.getType()); + OpenApiResult balanceData = OpenApiSdkUtil.invoke("/v2/rim/message/service", params); + + } }