From 5f8a4a4c41e30bd71a8f9d3211a98cc67f81b96a Mon Sep 17 00:00:00 2001 From: zhangzhiguo Date: Fri, 27 Dec 2024 17:16:32 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8F=90=E5=8F=96=E7=9F=BF=E5=B1=B1=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91=E8=87=B3=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=B1=BB=202.=E5=90=88=E5=90=8C=E5=8F=B0=E8=B4=A6?= =?UTF-8?q?=E7=AD=BE=E7=BA=A6=E6=96=B9=E9=BB=98=E8=AE=A4=E4=B8=BA=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E4=BA=BA=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ontractbillContractpartyDefaultPlugin.java | 29 ++++++++++++++++ .../form/DailyloanbillExpAccPlugin.java | 21 +----------- .../form/DailyreimbursExpAccPlugin.java | 21 ++---------- .../form/DailyreimbursVisitCheckPlugin.java | 11 ++++-- .../zcdev/fs/plugin/form/OrgCheckUtils.java | 34 +++++++++++++++++++ .../plugin/form/OverseaStaysLimitPlugin.java | 21 ++---------- .../plugin/form/PrepaybillContractPlugin.java | 20 +---------- .../plugin/form/PrepaybillExpAccPlugin.java | 20 +---------- .../PublicreimbursebillContractPlugin.java | 21 ++---------- .../form/PublicreimbursebillExpAccPlugin.java | 20 +---------- .../TripreimbursebillAbroadAlertedPlugin.java | 22 ++---------- .../form/TripstandAccmodationAutoPlugin.java | 3 ++ .../plugin/operate/ApprovalCheckFlowOp.java | 19 +---------- .../operate/DailyreimbursVisitCheckOp.java | 21 ++---------- .../plugin/operate/TripreimbursebillUpOp.java | 21 ++---------- 15 files changed, 92 insertions(+), 212 deletions(-) create mode 100644 code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/ContractbillContractpartyDefaultPlugin.java create mode 100644 code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/OrgCheckUtils.java diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/ContractbillContractpartyDefaultPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/ContractbillContractpartyDefaultPlugin.java new file mode 100644 index 0000000..dd26891 --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/ContractbillContractpartyDefaultPlugin.java @@ -0,0 +1,29 @@ +package zcgj.zcdev.zcdev.fs.plugin.form; + +import kd.bos.bill.AbstractBillPlugIn; +import kd.bos.context.RequestContext; +import kd.bos.servicehelper.user.UserServiceHelper; +import kd.sdk.plugin.Plugin; + +import java.util.EventObject; + +/** + * 合同台账单,签约方默认值设置插件 + */ +public class ContractbillContractpartyDefaultPlugin extends AbstractBillPlugIn implements Plugin { + + + @Override + public void afterCreateNewData(EventObject e) { + super.afterCreateNewData(e); + Long currentUserId = UserServiceHelper.getCurrentUserId(); + // 当前用户的主职部门(组织) + Long mainOrgId = UserServiceHelper.getUserMainOrgId(currentUserId); + //当前切换选择的组织 + Long currentOrgId = RequestContext.get().getOrgId(); + //当前所在的组织是属于矿山下的 + if(OrgCheckUtils.isKS(currentOrgId)){ + this.getModel().setValue("contractparty",mainOrgId); + } + } +} diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyloanbillExpAccPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyloanbillExpAccPlugin.java index 875be37..b0614a4 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyloanbillExpAccPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyloanbillExpAccPlugin.java @@ -72,7 +72,7 @@ public class DailyloanbillExpAccPlugin extends AbstractBillPlugIn implements Plu //costcompany 费用承担公司 DynamicObject costcompany = (DynamicObject)this.getModel().getValue("costcompany"); long costcompanyId = costcompany.getLong("id"); - if(isKS(currentOrgId) && isKS(costcompanyId)){ + if(OrgCheckUtils.isKS(currentOrgId) && OrgCheckUtils.isKS(costcompanyId)){ BasedataEdit fieldEdit = this.getView().getControl(ACCOUNT_ITEM); fieldEdit.addBeforeF7SelectListener(this); fieldEdit.addAfterF7SelectListener(this); @@ -213,23 +213,4 @@ public class DailyloanbillExpAccPlugin extends AbstractBillPlugIn implements Plu } } - - /** - * 判断是否为矿山 - */ - public boolean isKS(Long currentOrgId){ - String rootOrgCode = "10006431";//矿山总部组织编码 - QFilter filterOrgId = new QFilter("number", QCP.equals,rootOrgCode);//中材矿山建设有限公司 - DynamicObject adminOrg = BusinessDataServiceHelper.loadSingle("bos_org", "number,name,fullname", new QFilter[]{filterOrgId}); - long orgId = adminOrg.getLong("id"); - List orgIds = new ArrayList<>(1); - //orgIds.add(1692204547985902592L); - orgIds.add(orgId); - List subOrgIds = OrgUnitServiceHelper.getAllSubordinateOrgs(1L, orgIds, true); - Set orgSer = subOrgIds.stream().collect(Collectors.toSet()); - if(orgSer.contains(currentOrgId)){ - return true; - } - return false; - } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyreimbursExpAccPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyreimbursExpAccPlugin.java index ccba7c4..736c3f4 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyreimbursExpAccPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyreimbursExpAccPlugin.java @@ -69,7 +69,7 @@ public class DailyreimbursExpAccPlugin extends AbstractBillPlugIn implements Plu //costcompany 费用承担公司 DynamicObject costcompany = (DynamicObject)this.getModel().getValue("costcompany"); long costcompanyId = costcompany.getLong("id"); - if(isKS(currentOrgId) && isKS(costcompanyId)){ + if(OrgCheckUtils.isKS(currentOrgId) && OrgCheckUtils.isKS(costcompanyId)){ BasedataEdit fieldEdit = this.getView().getControl(ACCOUNT_ITEM); fieldEdit.addBeforeF7SelectListener(this); fieldEdit.addAfterF7SelectListener(this); @@ -211,22 +211,5 @@ public class DailyreimbursExpAccPlugin extends AbstractBillPlugIn implements Plu } } } - /** - * 判断是否为矿山 - */ - public boolean isKS(Long currentOrgId){ - String rootOrgCode = "10006431";//矿山总部组织编码 - QFilter filterOrgId = new QFilter("number", QCP.equals,rootOrgCode);//中材矿山建设有限公司 - DynamicObject adminOrg = BusinessDataServiceHelper.loadSingle("bos_org", "number,name,fullname", new QFilter[]{filterOrgId}); - long orgId = adminOrg.getLong("id"); - List orgIds = new ArrayList<>(1); - //orgIds.add(1692204547985902592L); - orgIds.add(orgId); - List subOrgIds = OrgUnitServiceHelper.getAllSubordinateOrgs(1L, orgIds, true); - Set orgSer = subOrgIds.stream().collect(Collectors.toSet()); - if(orgSer.contains(currentOrgId)){ - return true; - } - return false; - } + } diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyreimbursVisitCheckPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyreimbursVisitCheckPlugin.java index 60ab7f1..ca83063 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyreimbursVisitCheckPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/DailyreimbursVisitCheckPlugin.java @@ -16,6 +16,7 @@ import kd.bos.orm.query.QCP; import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.QueryServiceHelper; +import kd.bos.servicehelper.user.UserServiceHelper; import kd.sdk.plugin.Plugin; import java.text.SimpleDateFormat; @@ -55,9 +56,13 @@ public class DailyreimbursVisitCheckPlugin extends AbstractBillPlugIn implemen @Override public void afterCreateNewData(EventObject e) { super.afterCreateNewData(e); - QFilter nameQFilterAccItem = new QFilter("number",QCP.equals,"FYXM004.999"); - DynamicObject dynamicObjectAccItem = BusinessDataServiceHelper.loadSingle("er_expenseitemedit", "number,name", new QFilter[]{nameQFilterAccItem}); - this.getModel().setValue("expenseitem",dynamicObjectAccItem,0); + Long currentUserId = UserServiceHelper.getCurrentUserId(); + // 当前用户所属组织 + Long mainOrgId = UserServiceHelper.getUserMainOrgId(currentUserId); + this.getModel().setValue("contractparty",mainOrgId); + //QFilter nameQFilterAccItem = new QFilter("number",QCP.equals,"FYXM004.999"); + //DynamicObject dynamicObjectAccItem = BusinessDataServiceHelper.loadSingle("er_expenseitemedit", "number,name", new QFilter[]{nameQFilterAccItem}); + //this.getModel().setValue("expenseitem",dynamicObjectAccItem,0); } /** diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/OrgCheckUtils.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/OrgCheckUtils.java new file mode 100644 index 0000000..c279b93 --- /dev/null +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/OrgCheckUtils.java @@ -0,0 +1,34 @@ +package zcgj.zcdev.zcdev.fs.plugin.form; + +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.BusinessDataServiceHelper; +import kd.bos.servicehelper.org.OrgUnitServiceHelper; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +public class OrgCheckUtils { + + /** + * 判断是否为矿山 + */ + public static boolean isKS(Long currentOrgId){ + String rootOrgCode = "10006431";//矿山总部组织编码 + QFilter filterOrgId = new QFilter("number", QCP.equals,rootOrgCode);//中材矿山建设有限公司 + DynamicObject adminOrg = BusinessDataServiceHelper.loadSingle("bos_org", "number,name,fullname", new QFilter[]{filterOrgId}); + long orgId = adminOrg.getLong("id"); + List orgIds = new ArrayList<>(1); + //orgIds.add(1692204547985902592L); + orgIds.add(orgId); + List subOrgIds = OrgUnitServiceHelper.getAllSubordinateOrgs(1L, orgIds, true); + Set orgSer = subOrgIds.stream().collect(Collectors.toSet()); + if(orgSer.contains(currentOrgId)){ + return true; + } + return false; + } +} diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/OverseaStaysLimitPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/OverseaStaysLimitPlugin.java index c10455d..98ca42f 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/OverseaStaysLimitPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/OverseaStaysLimitPlugin.java @@ -33,6 +33,7 @@ import java.util.stream.Collectors; /** * 国外住宿费标准 */ +@Deprecated public class OverseaStaysLimitPlugin extends AbstractBillPlugIn implements Plugin, BeforeF7SelectListener { private static final Log log = LogFactory.getLog(OverseaStaysLimitPlugin.class); @@ -48,7 +49,7 @@ public class OverseaStaysLimitPlugin extends AbstractBillPlugIn implements Plugi //当前切换选择的组织 Long currentOrgId = RequestContext.get().getOrgId(); //当前所在的组织是属于矿山下的 - if(isKS(currentOrgId)){ + if(OrgCheckUtils.isKS(currentOrgId)){ BasedataEdit fieldEdit = this.getView().getControl("zcgj_district_f7"); fieldEdit.addBeforeF7SelectListener(this); } @@ -65,24 +66,6 @@ public class OverseaStaysLimitPlugin extends AbstractBillPlugIn implements Plugi } } - /** - * 判断是否为矿山 - */ - public boolean isKS(Long currentOrgId){ - String rootOrgCode = "10006431";//矿山总部组织编码 - QFilter filterOrgId = new QFilter("number", QCP.equals,rootOrgCode);//中材矿山建设有限公司 - DynamicObject adminOrg = BusinessDataServiceHelper.loadSingle("bos_org", "number,name,fullname", new QFilter[]{filterOrgId}); - long orgId = adminOrg.getLong("id"); - List orgIds = new ArrayList<>(1); - //orgIds.add(1692204547985902592L); - orgIds.add(orgId); - List subOrgIds = OrgUnitServiceHelper.getAllSubordinateOrgs(1L, orgIds, true); - Set orgSer = subOrgIds.stream().collect(Collectors.toSet()); - if(orgSer.contains(currentOrgId)){ - return true; - } - return false; - } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PrepaybillContractPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PrepaybillContractPlugin.java index 1f2156d..63c6c13 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PrepaybillContractPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PrepaybillContractPlugin.java @@ -52,7 +52,7 @@ public class PrepaybillContractPlugin extends AbstractBillPlugIn implements Plug //当前切换选择的组织 Long currentOrgId = RequestContext.get().getOrgId(); //当前所在的组织是属于矿山下的 - if(isKS(currentOrgId) && (args.getSource() instanceof Submit) ) { + if(OrgCheckUtils.isKS(currentOrgId) && (args.getSource() instanceof Submit) ) { Submit source = (Submit) args.getSource(); if (source.getOperateKey().equals("submit")) { //获取当前页面的数据包 @@ -79,24 +79,6 @@ public class PrepaybillContractPlugin extends AbstractBillPlugIn implements Plug } } - /** - * 判断是否为矿山 - */ - public boolean isKS(Long currentOrgId){ - String rootOrgCode = "10006431";//矿山总部组织编码 - QFilter filterOrgId = new QFilter("number", QCP.equals,rootOrgCode);//中材矿山建设有限公司 - DynamicObject adminOrg = BusinessDataServiceHelper.loadSingle("bos_org", "number,name,fullname", new QFilter[]{filterOrgId}); - long orgId = adminOrg.getLong("id"); - List orgIds = new ArrayList<>(1); - //orgIds.add(1692204547985902592L); - orgIds.add(orgId); - List subOrgIds = OrgUnitServiceHelper.getAllSubordinateOrgs(1L, orgIds, true); - Set orgSer = subOrgIds.stream().collect(Collectors.toSet()); - if(orgSer.contains(currentOrgId)){ - return true; - } - return false; - } /** * 将 java.util.Date 转换为 java.time.LocalDate * @param date java.util.Date diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PrepaybillExpAccPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PrepaybillExpAccPlugin.java index 6ab12be..edd0a19 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PrepaybillExpAccPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PrepaybillExpAccPlugin.java @@ -72,7 +72,7 @@ public class PrepaybillExpAccPlugin extends AbstractBillPlugIn implements Plugin //costcompany 费用承担公司 DynamicObject costcompany = (DynamicObject)this.getModel().getValue("costcompany"); long costcompanyId = costcompany.getLong("id"); - if(isKS(currentOrgId) && isKS(costcompanyId)){ + if(OrgCheckUtils.isKS(currentOrgId) && OrgCheckUtils.isKS(costcompanyId)){ BasedataEdit fieldEdit = this.getView().getControl(ACCOUNT_ITEM); fieldEdit.addBeforeF7SelectListener(this); fieldEdit.addAfterF7SelectListener(this); @@ -214,22 +214,4 @@ public class PrepaybillExpAccPlugin extends AbstractBillPlugIn implements Plugin } } - /** - * 判断是否为矿山 - */ - public boolean isKS(Long currentOrgId){ - String rootOrgCode = "10006431";//矿山总部组织编码 - QFilter filterOrgId = new QFilter("number", QCP.equals,rootOrgCode);//中材矿山建设有限公司 - DynamicObject adminOrg = BusinessDataServiceHelper.loadSingle("bos_org", "number,name,fullname", new QFilter[]{filterOrgId}); - long orgId = adminOrg.getLong("id"); - List orgIds = new ArrayList<>(1); - //orgIds.add(1692204547985902592L); - orgIds.add(orgId); - List subOrgIds = OrgUnitServiceHelper.getAllSubordinateOrgs(1L, orgIds, true); - Set orgSer = subOrgIds.stream().collect(Collectors.toSet()); - if(orgSer.contains(currentOrgId)){ - return true; - } - return false; - } } 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 index 8f37c90..223f34f 100644 --- 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 @@ -43,7 +43,7 @@ public class PublicreimbursebillContractPlugin extends AbstractBillPlugIn implem //当前切换选择的组织 Long currentOrgId = RequestContext.get().getOrgId(); //当前所在的组织是属于矿山下的 - if(isKS(currentOrgId)&&(args.getSource() instanceof Submit) ) { + if(OrgCheckUtils.isKS(currentOrgId)&&(args.getSource() instanceof Submit) ) { Submit source = (Submit) args.getSource(); if (source.getOperateKey().equals("submit")) { //获取当前页面的数据包 @@ -67,24 +67,7 @@ public class PublicreimbursebillContractPlugin extends AbstractBillPlugIn implem } } } - /** - * 判断是否为矿山 - */ - public boolean isKS(Long currentOrgId){ - String rootOrgCode = "10006431";//矿山总部组织编码 - QFilter filterOrgId = new QFilter("number", QCP.equals,rootOrgCode);//中材矿山建设有限公司 - DynamicObject adminOrg = BusinessDataServiceHelper.loadSingle("bos_org", "number,name,fullname", new QFilter[]{filterOrgId}); - long orgId = adminOrg.getLong("id"); - List orgIds = new ArrayList<>(1); - //orgIds.add(1692204547985902592L); - orgIds.add(orgId); - List subOrgIds = OrgUnitServiceHelper.getAllSubordinateOrgs(1L, orgIds, true); - Set orgSer = subOrgIds.stream().collect(Collectors.toSet()); - if(orgSer.contains(currentOrgId)){ - return true; - } - return false; - } + /** * 将 java.util.Date 转换为 java.time.LocalDate diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillExpAccPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillExpAccPlugin.java index bee6343..a43a815 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillExpAccPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/PublicreimbursebillExpAccPlugin.java @@ -72,7 +72,7 @@ public class PublicreimbursebillExpAccPlugin extends AbstractBillPlugIn implemen //costcompany 费用承担公司 DynamicObject costcompany = (DynamicObject)this.getModel().getValue("costcompany"); long costcompanyId = costcompany.getLong("id"); - if(isKS(currentOrgId) && isKS(costcompanyId)){ + if(OrgCheckUtils.isKS(currentOrgId) && OrgCheckUtils.isKS(costcompanyId)){ BasedataEdit fieldEdit = this.getView().getControl(ACCOUNT_ITEM); fieldEdit.addBeforeF7SelectListener(this); fieldEdit.addAfterF7SelectListener(this); @@ -213,23 +213,5 @@ public class PublicreimbursebillExpAccPlugin extends AbstractBillPlugIn implemen } } - /** - * 判断是否为矿山 - */ - public boolean isKS(Long currentOrgId){ - String rootOrgCode = "10006431";//矿山总部组织编码 - QFilter filterOrgId = new QFilter("number", QCP.equals,rootOrgCode);//中材矿山建设有限公司 - DynamicObject adminOrg = BusinessDataServiceHelper.loadSingle("bos_org", "number,name,fullname", new QFilter[]{filterOrgId}); - long orgId = adminOrg.getLong("id"); - List orgIds = new ArrayList<>(1); - //orgIds.add(1692204547985902592L); - orgIds.add(orgId); - List subOrgIds = OrgUnitServiceHelper.getAllSubordinateOrgs(1L, orgIds, true); - Set orgSer = subOrgIds.stream().collect(Collectors.toSet()); - if(orgSer.contains(currentOrgId)){ - return true; - } - return false; - } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TripreimbursebillAbroadAlertedPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TripreimbursebillAbroadAlertedPlugin.java index 5527ef1..7395b0f 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TripreimbursebillAbroadAlertedPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TripreimbursebillAbroadAlertedPlugin.java @@ -21,7 +21,9 @@ import java.util.stream.Collectors; /** * 差旅报销单国外住宿标准提醒插件 + * 废弃,使用产品自带逻辑 */ +@Deprecated public class TripreimbursebillAbroadAlertedPlugin extends AbstractBillPlugIn implements Plugin { //private static final Log log = LogFactory.getLog(TripreimbursebillPlugin.class); @@ -37,7 +39,7 @@ public class TripreimbursebillAbroadAlertedPlugin extends AbstractBillPlugIn imp //当前切换选择的组织 Long currentOrgId = RequestContext.get().getOrgId(); //当前所在的组织是属于矿山下的 - if(isKS(currentOrgId)){ + if(OrgCheckUtils.isKS(currentOrgId)){ String name = e.getProperty().getName(); //目的地变更 if("to".equals(name)){ @@ -104,22 +106,4 @@ public class TripreimbursebillAbroadAlertedPlugin extends AbstractBillPlugIn imp } } - /** - * 判断是否为矿山 - */ - public boolean isKS(Long currentOrgId){ - String rootOrgCode = "10006431";//矿山总部组织编码 - QFilter filterOrgId = new QFilter("number", QCP.equals,rootOrgCode);//中材矿山建设有限公司 - DynamicObject adminOrg = BusinessDataServiceHelper.loadSingle("bos_org", "number,name,fullname", new QFilter[]{filterOrgId}); - long orgId = adminOrg.getLong("id"); - List orgIds = new ArrayList<>(1); - //orgIds.add(1692204547985902592L); - orgIds.add(orgId); - List subOrgIds = OrgUnitServiceHelper.getAllSubordinateOrgs(1L, orgIds, true); - Set orgSer = subOrgIds.stream().collect(Collectors.toSet()); - if(orgSer.contains(currentOrgId)){ - return true; - } - return false; - } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TripstandAccmodationAutoPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TripstandAccmodationAutoPlugin.java index bdd0401..a57ea8a 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TripstandAccmodationAutoPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/form/TripstandAccmodationAutoPlugin.java @@ -17,6 +17,9 @@ import kd.sdk.plugin.Plugin; import java.util.EventObject; +/** + * 住宿标准自动取数 + */ public class TripstandAccmodationAutoPlugin extends AbstractBillPlugIn implements Plugin { diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/ApprovalCheckFlowOp.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/ApprovalCheckFlowOp.java index 87a89e7..8d038d0 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/ApprovalCheckFlowOp.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/ApprovalCheckFlowOp.java @@ -79,22 +79,5 @@ public class ApprovalCheckFlowOp extends AbstractOperationServicePlugIn { } } - /** - * 判断是否为矿山 - */ - public boolean isKS(Long currentOrgId){ - String rootOrgCode = "10006431";//矿山总部组织编码 - QFilter filterOrgId = new QFilter("number", QCP.equals,rootOrgCode);//中材矿山建设有限公司 - DynamicObject adminOrg = BusinessDataServiceHelper.loadSingle("bos_org", "number,name,fullname", new QFilter[]{filterOrgId}); - long orgId = adminOrg.getLong("id"); - List orgIds = new ArrayList<>(1); - //orgIds.add(1692204547985902592L); - orgIds.add(orgId); - List subOrgIds = OrgUnitServiceHelper.getAllSubordinateOrgs(1L, orgIds, true); - Set orgSer = subOrgIds.stream().collect(Collectors.toSet()); - if(orgSer.contains(currentOrgId)){ - return true; - } - return false; - } + } diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyreimbursVisitCheckOp.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyreimbursVisitCheckOp.java index 8334e74..12d8219 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyreimbursVisitCheckOp.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/DailyreimbursVisitCheckOp.java @@ -15,6 +15,7 @@ import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.QueryServiceHelper; import kd.bos.servicehelper.org.OrgUnitServiceHelper; import kd.bos.servicehelper.user.UserServiceHelper; +import zcgj.zcdev.zcdev.fs.plugin.form.OrgCheckUtils; import java.text.SimpleDateFormat; import java.time.LocalDate; @@ -53,7 +54,7 @@ public class DailyreimbursVisitCheckOp extends AbstractOperationServicePlugIn { //当前切换选择的组织 Long currentOrgId = RequestContext.get().getOrgId(); //当前所在的组织是属于矿山下的 - if(isKS(currentOrgId)){ + if(OrgCheckUtils.isKS(currentOrgId)){ e.getValidators().add(new ValidatorExt()); } } @@ -385,23 +386,5 @@ public class DailyreimbursVisitCheckOp extends AbstractOperationServicePlugIn { return LocalDate.of(date.getYear() - (years - 1), Month.JANUARY, 1); } - /** - * 判断是否为矿山 - */ - public boolean isKS(Long currentOrgId){ - String rootOrgCode = "10006431";//矿山总部组织编码 - QFilter filterOrgId = new QFilter("number", QCP.equals,rootOrgCode);//中材矿山建设有限公司 - DynamicObject adminOrg = BusinessDataServiceHelper.loadSingle("bos_org", "number,name,fullname", new QFilter[]{filterOrgId}); - long orgId = adminOrg.getLong("id"); - List orgIds = new ArrayList<>(1); - //orgIds.add(1692204547985902592L); - orgIds.add(orgId); - List subOrgIds = OrgUnitServiceHelper.getAllSubordinateOrgs(1L, orgIds, true); - Set orgSer = subOrgIds.stream().collect(Collectors.toSet()); - if(orgSer.contains(currentOrgId)){ - return true; - } - return false; - } } diff --git a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/TripreimbursebillUpOp.java b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/TripreimbursebillUpOp.java index c272d30..c7df556 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/TripreimbursebillUpOp.java +++ b/code/zcdev/zcgj-zcdev-zcdev-fs/src/main/java/zcgj/zcdev/zcdev/fs/plugin/operate/TripreimbursebillUpOp.java @@ -15,6 +15,7 @@ import kd.bos.orm.query.QFilter; import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.org.OrgUnitServiceHelper; import kd.bos.servicehelper.user.UserServiceHelper; +import zcgj.zcdev.zcdev.fs.plugin.form.OrgCheckUtils; import java.math.BigDecimal; import java.text.SimpleDateFormat; @@ -50,7 +51,7 @@ public class TripreimbursebillUpOp extends AbstractOperationServicePlugIn { //当前切换选择的组织 Long currentOrgId = RequestContext.get().getOrgId(); //当前所在的组织是属于矿山下的 - if(isKS(currentOrgId)){ + if(OrgCheckUtils.isKS(currentOrgId)){ e.getValidators().add(new ValidatorExt()); } } @@ -97,22 +98,4 @@ public class TripreimbursebillUpOp extends AbstractOperationServicePlugIn { } } - /** - * 判断是否为矿山 - */ - public boolean isKS(Long currentOrgId){ - String rootOrgCode = "10006431";//矿山总部组织编码 - QFilter filterOrgId = new QFilter("number", QCP.equals,rootOrgCode);//中材矿山建设有限公司 - DynamicObject adminOrg = BusinessDataServiceHelper.loadSingle("bos_org", "number,name,fullname", new QFilter[]{filterOrgId}); - long orgId = adminOrg.getLong("id"); - List orgIds = new ArrayList<>(1); - //orgIds.add(1692204547985902592L); - orgIds.add(orgId); - List subOrgIds = OrgUnitServiceHelper.getAllSubordinateOrgs(1L, orgIds, true); - Set orgSer = subOrgIds.stream().collect(Collectors.toSet()); - if(orgSer.contains(currentOrgId)){ - return true; - } - return false; - } }