From 64ab363237e45dbfc623f72899899de479bebec9 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 2 Aug 2024 17:22:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E5=9B=BE=E5=A2=9E=E5=8A=A0=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E5=92=8C=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cronjob/OrgVersionDeleteCron.java | 70 +++++++++++++++++++ .../cronjob/OrgVersionRecordCron.java | 39 +++++++++++ 2 files changed, 109 insertions(+) create mode 100644 src/weaver/interfaces/organization/cronjob/OrgVersionDeleteCron.java create mode 100644 src/weaver/interfaces/organization/cronjob/OrgVersionRecordCron.java diff --git a/src/weaver/interfaces/organization/cronjob/OrgVersionDeleteCron.java b/src/weaver/interfaces/organization/cronjob/OrgVersionDeleteCron.java new file mode 100644 index 00000000..ef9bacc9 --- /dev/null +++ b/src/weaver/interfaces/organization/cronjob/OrgVersionDeleteCron.java @@ -0,0 +1,70 @@ +package weaver.interfaces.organization.cronjob; + +import com.engine.organization.service.impl.ChartServiceImpl; +import com.engine.organization.util.OrganizationAssert; +import com.engine.organization.util.OrganizationDateUtil; +import weaver.conn.RecordSet; +import weaver.general.Util; +import weaver.interfaces.schedule.BaseCronJob; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author liang.cheng + * @Date 2024/8/1 3:12 PM + * @Description: 组织架构版本定时删除 + * @Version 1.0 + */ +public class OrgVersionDeleteCron extends BaseCronJob { + + + + private String type; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + @Override + public void execute() { + + RecordSet rs = new RecordSet(); + + List idList = new ArrayList<>(); + String createTime = ""; + rs.executeQuery("select id,createtime from jcl_org_chartversion order by createtime asc"); + if (rs.next()){ + idList.add(Util.getIntValue(rs.getString("id"))); + createTime = Util.null2String(rs.getString("createtime")); + } + + OrganizationAssert.notEmpty(idList,"未查询到组织架构图历史版本"); + + //1.type=1 删除最早版本记录日期 + //2.type=2 删除最早版本日期--往后一个月的数据 + if("2".equals(type)){ + String lastMonthDate = OrganizationDateUtil.getLastMonthDate(createTime); + rs.executeQuery("select id from jcl_org_chartversion where createtime >= ? and createtime <= ?",createTime,lastMonthDate); + while (rs.next()) { + idList.add(Util.getIntValue(rs.getString("id"))); + } + } + //3.type=3 删除最早版本日期--往后一年的数据 + if("3".equals(type)){ + String lastYearDate = OrganizationDateUtil.getLastYearDate(createTime); + rs.executeQuery("select id from jcl_org_chartversion where createtime >= ? and createtime <= ?",createTime,lastYearDate); + while (rs.next()) { + idList.add(Util.getIntValue(rs.getString("id"))); + } + } + + //删除数据 + ChartServiceImpl chartService = new ChartServiceImpl(); + idList.forEach(chartService::versionDelete); + } +} diff --git a/src/weaver/interfaces/organization/cronjob/OrgVersionRecordCron.java b/src/weaver/interfaces/organization/cronjob/OrgVersionRecordCron.java new file mode 100644 index 00000000..1350c2f3 --- /dev/null +++ b/src/weaver/interfaces/organization/cronjob/OrgVersionRecordCron.java @@ -0,0 +1,39 @@ +package weaver.interfaces.organization.cronjob; + +import com.engine.organization.service.impl.ChartServiceImpl; +import com.engine.organization.util.OrganizationDateUtil; +import weaver.hrm.User; +import weaver.interfaces.schedule.BaseCronJob; + +import java.time.LocalDate; +import java.util.HashMap; +import java.util.Map; + +/** + * @Author liang.cheng + * @Date 2024/8/2 9:39 AM + * @Description: 组织架构图定时版本保存 + * @Version 1.0 + */ +public class OrgVersionRecordCron extends BaseCronJob { + + @Override + public void execute() { + + ChartServiceImpl chartService = new ChartServiceImpl(); + User user = new User(); + user.setUid(1); + + // 获取当前日期 + LocalDate today = LocalDate.now(); + String example = OrganizationDateUtil.dateExample(today); + String description = "版本自动记录"+example; + + Map params = new HashMap(){ + { + put("description",description); + }}; + + chartService.versionRecord(params,user); + } +} From 2ea741211f79b6ee21cad0227bd1dc35a3cf7500 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 8 Aug 2024 16:15:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=BB=84=E7=BB=87=E9=9D=9E=E6=A0=87?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=B5=8F=E8=A7=88=E6=8C=89=E9=92=AE=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E8=99=9A=E6=8B=9F=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/entity/extend/bo/ExtendInfoBO.java | 4 ++++ .../organization/entity/staff/vo/StaffTableVO.java | 9 ++++++++- .../organization/util/OrganizationFormItemUtil.java | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java b/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java index 570b621c..a520d0fa 100644 --- a/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java +++ b/src/com/engine/organization/entity/extend/bo/ExtendInfoBO.java @@ -411,6 +411,10 @@ public class ExtendInfoBO { searchConditionItem = new SearchConditionItem(ConditionType.BROWSER, fieldlabel, new String[]{fieldname}, browserbean); } else { searchConditionItem = conditionFactory.createCondition(ConditionType.BROWSER, fieldlabel, fieldname, detailtype); + //隐藏虚拟组织 + if(searchConditionItem != null ) { + searchConditionItem.getBrowserConditionParam().setHideVirtualOrg(true); + } } // 岗位浏览按钮 if ("666".equals(detailtype)) { diff --git a/src/com/engine/organization/entity/staff/vo/StaffTableVO.java b/src/com/engine/organization/entity/staff/vo/StaffTableVO.java index 526a864a..363af91e 100644 --- a/src/com/engine/organization/entity/staff/vo/StaffTableVO.java +++ b/src/com/engine/organization/entity/staff/vo/StaffTableVO.java @@ -18,7 +18,7 @@ import lombok.NoArgsConstructor; @AllArgsConstructor @NoArgsConstructor @OrganizationTable(pageId = "0cdfd5bb-dc09-11ec-b69e-00ffcbed7508", - fields = "t.id,t.is_used,s.control_dimension,t.plan_id,t.comp_id,t.dept_id,t.job_id,t.staff_num,t.permanent_num,t.freeze_num,t.lack_status,t.staff_desc", + fields = "t.id,t.is_used,s.control_dimension,t.plan_id,t.comp_id,t.dept_id,t.job_id,t.staff_num,t.permanent_num,t.freeze_num,t.lack_status,t.staff_desc,t.description", fromSql = "FROM jcl_org_staff t inner join jcl_org_staffplan s on t.plan_id = s.id", orderby = "id desc", primarykey = "id", @@ -91,4 +91,11 @@ public class StaffTableVO { @OrganizationTableColumn(labelId = 547349, text = "编制描述", width = "10%", column = "staff_desc") private String staffDesc; + /** + * 描述说明 + */ + @OrganizationTableColumn(labelId = 547142, text = "描述说明", width = "10%", column = "description") + private String description; + + } diff --git a/src/com/engine/organization/util/OrganizationFormItemUtil.java b/src/com/engine/organization/util/OrganizationFormItemUtil.java index 481eb5ab..31a28eac 100644 --- a/src/com/engine/organization/util/OrganizationFormItemUtil.java +++ b/src/com/engine/organization/util/OrganizationFormItemUtil.java @@ -162,6 +162,8 @@ public class OrganizationFormItemUtil { browser.setViewAttr(viewAttr); browser.setIsQuickSearch(isQuickSearch); browser.setLabel(label); + //隐藏虚拟组织 + browser.getBrowserConditionParam().setHideVirtualOrg(true); if ("161".equals(type) || "162".equals(type)) { fieldDbType = "browser." + fieldDbType; BrowserBean browserBean = new BrowserBean();