From 7bc3a97bbb433025b4c8fe69d607c63d83a6d4f8 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Mon, 22 Jul 2024 16:59:30 +0800 Subject: [PATCH 01/23] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=8E=9F=E6=96=B9=E6=B3=95=E4=BF=9D=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/util/response/ReturnResult.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/com/engine/organization/util/response/ReturnResult.java b/src/com/engine/organization/util/response/ReturnResult.java index 2f5562c0..0c7204fa 100644 --- a/src/com/engine/organization/util/response/ReturnResult.java +++ b/src/com/engine/organization/util/response/ReturnResult.java @@ -113,11 +113,11 @@ public class ReturnResult implements Serializable { * @param data * @return */ - //@Deprecated - //public static ReturnResult successed(T data) { - // - // return new ReturnResult<>(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMessage(), data); - //} + @Deprecated + public static ReturnResult successed(T data) { + + return new ReturnResult<>(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMessage(), data); + } /** * 多语言响应 From 5a230ea962167cdb572d22c22e85a56e6fd627ca Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 23 Jul 2024 10:02:43 +0800 Subject: [PATCH 02/23] =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=80=E9=94=AE?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=89=80=E6=9C=89=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/organization/service/impl/HrmResourceServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java index fbe393a8..994d70c3 100644 --- a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java +++ b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java @@ -589,6 +589,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic btnDatas.put("topMenu", topMenuList); btnDatas.put("rightMenu", rightMenuList); btnDatas.put("hasRight", true); + btnDatas.put("loginId", user.getUID()); return btnDatas; } From ec84cd6ccf2fabb9e9b86eacfeb630d44ad78d85 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 24 Jul 2024 15:41:32 +0800 Subject: [PATCH 03/23] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmresource/po/SearchTemplatePO.java | 1 + .../mapper/resource/HrmResourceMapper.java | 4 ++ .../mapper/resource/HrmResourceMapper.xml | 17 ++++++ .../resource/JclOrgCustomTemplateMapper.java | 4 +- .../resource/JclOrgCustomTemplateMapper.xml | 13 +++- .../service/HrmResourceService.java | 8 +++ .../service/impl/HrmResourceServiceImpl.java | 61 ++++++++++++++++--- .../web/HrmResourceController.java | 14 +++++ .../wrapper/HrmResourceWrapper.java | 4 ++ 9 files changed, 115 insertions(+), 11 deletions(-) diff --git a/src/com/engine/organization/entity/hrmresource/po/SearchTemplatePO.java b/src/com/engine/organization/entity/hrmresource/po/SearchTemplatePO.java index 4393a206..6fd748ca 100644 --- a/src/com/engine/organization/entity/hrmresource/po/SearchTemplatePO.java +++ b/src/com/engine/organization/entity/hrmresource/po/SearchTemplatePO.java @@ -26,4 +26,5 @@ public class SearchTemplatePO { private Integer creator; private Date createTime; private Date updateTime; + private Integer overall; } diff --git a/src/com/engine/organization/mapper/resource/HrmResourceMapper.java b/src/com/engine/organization/mapper/resource/HrmResourceMapper.java index 5e6039bc..816b1be1 100644 --- a/src/com/engine/organization/mapper/resource/HrmResourceMapper.java +++ b/src/com/engine/organization/mapper/resource/HrmResourceMapper.java @@ -55,6 +55,8 @@ public interface HrmResourceMapper { */ List getCustomTemplatesByUser(@Param("userId") Integer userId); + List getCustomOverAll(); + SearchTemplatePO getSearchTemplateById(@Param("id") String id); SearchTemplatePO getSearchTemplateByName(@Param("userId") Integer userId, @Param("name") String name); @@ -65,6 +67,8 @@ public interface HrmResourceMapper { SearchTemplatePO getUsedCustomTemplateByUser(@Param("userId") Integer userId); + SearchTemplatePO getOverallCustomTemplate(); + Integer insertSearchTemplate(SearchTemplatePO templatePO); Integer deleteSearchTemplate(@Param("id") Integer Id, @Param("userId") Integer userId); diff --git a/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml b/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml index 8097bea6..fd4847dc 100644 --- a/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml +++ b/src/com/engine/organization/mapper/resource/HrmResourceMapper.xml @@ -150,6 +150,13 @@ where creator = #{userId} + + @@ -445,9 +452,19 @@ select * from jcl_org_custom_template where ISUSED = 1 + and overall = 0 and creator = #{userId} + + + + + + + + diff --git a/src/com/engine/organization/mapper/resource/JclOrgCustomTemplateMapper.xml b/src/com/engine/organization/mapper/resource/JclOrgCustomTemplateMapper.xml index 0e37db0f..432e2ba2 100644 --- a/src/com/engine/organization/mapper/resource/JclOrgCustomTemplateMapper.xml +++ b/src/com/engine/organization/mapper/resource/JclOrgCustomTemplateMapper.xml @@ -14,12 +14,13 @@ + id,name,basic_fields, personal_fields,work_fields,isused, - creator,create_time,update_time + creator,create_time,update_time,overall select - from JCL_ORG_CUSTOM_TEMPLATE t where t.isused = #{isused} and t.creator = #{creator} + from JCL_ORG_CUSTOM_TEMPLATE t where t.isused = #{isused} and t.creator = #{creator} and overall is null @@ -183,6 +186,9 @@ work_fields, + + isused, + @@ -206,6 +212,9 @@ #{workFields}, + + #{isused}, + @@ -479,5 +488,12 @@ order by id + \ No newline at end of file diff --git a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java index c450894c..532e2ba2 100644 --- a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java +++ b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java @@ -273,6 +273,9 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic templatePO.setCreator(user.getUID()); templatePO.setCreateTime(new Date()); templatePO.setUpdateTime(new Date()); + templatePO.setIsused("1"); + // 将之前的模板,isused置为null + getHrmResourceMapper().updateCustomTemplateUsed(user.getUID()); getHrmResourceMapper().insertSearchTemplate(templatePO); return templatePO.getId(); } @@ -630,6 +633,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic btnDatas.put("loginId", user.getUID()); //获取当前用户使用的列定制模板Id btnDatas.put("customTemplateId", getCustomTemplateId()); + btnDatas.put("searchTemplateId", getSearchTemplateId()); return btnDatas; } @@ -656,6 +660,22 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic return customTemplateId; } + /** + * 获取当前用户使用的查询模板Id + * + * @return + */ + private String getSearchTemplateId() { + + String searchTemplateId = "-1"; + SearchTemplatePO usedCustomTemplate = getHrmResourceMapper().getUsedSerarchTemplateByUser(user.getUID()); + if (null != usedCustomTemplate) { + searchTemplateId = usedCustomTemplate.getId().toString(); + } + + return searchTemplateId; + } + @Override public Map getTabForm(Map params) { Map apiDatas = new HashMap<>(); From 710d6f50007276dcf7a3fb55137781e6f261aa76 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 25 Jul 2024 10:55:39 +0800 Subject: [PATCH 07/23] =?UTF-8?q?=E8=8A=B1=E5=90=8D=E5=86=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/service/HrmResourceService.java | 2 +- .../service/impl/HrmResourceServiceImpl.java | 15 ++++++++++----- .../organization/web/HrmResourceController.java | 3 +-- .../organization/wrapper/HrmResourceWrapper.java | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/com/engine/organization/service/HrmResourceService.java b/src/com/engine/organization/service/HrmResourceService.java index 6cc1178f..17aff125 100644 --- a/src/com/engine/organization/service/HrmResourceService.java +++ b/src/com/engine/organization/service/HrmResourceService.java @@ -133,7 +133,7 @@ public interface HrmResourceService { * @param params * @return */ - Integer saveCustomTemplate(SearchTemplateParam params); + Map saveCustomTemplate(SearchTemplateParam params); /** * 批量修改保存定制列模板 diff --git a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java index c450894c..66cf0d67 100644 --- a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java +++ b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java @@ -351,14 +351,14 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic } @Override - public Integer saveCustomTemplate(SearchTemplateParam params) { + public Map saveCustomTemplate(SearchTemplateParam params) { // 重复名称校验 + Map data = new HashMap<>(); SearchTemplatePO searchTemplateByName = getHrmResourceMapper().getCustomTemplateByName(user.getUID(), params.getShowname()); OrganizationAssert.isFalse("默认模板".equals(params.getShowname()) || null != searchTemplateByName, SystemEnv.getHtmlLabelName(547439, user.getLanguage())); SearchTemplatePO templatePO = buildSearchTemplateByFields(params.getFields()); - if (null == templatePO) { - return -1; - } + OrganizationAssert.notNull(templatePO,"模板存储失败"); + templatePO.setName(params.getShowname()); templatePO.setCreator(user.getUID()); templatePO.setIsused("0"); @@ -366,7 +366,12 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic templatePO.setUpdateTime(new Date()); templatePO.setOverall(0); getHrmResourceMapper().insertCustomTemplate(templatePO); - return templatePO.getId(); + + Map param = new HashMap<>(); + param.put("type","custom"); + param.put("id",templatePO.getId()); + data.put("result",getSearchTemplate(param)); + return data; } @Override diff --git a/src/com/engine/organization/web/HrmResourceController.java b/src/com/engine/organization/web/HrmResourceController.java index c5a45b49..474778f0 100644 --- a/src/com/engine/organization/web/HrmResourceController.java +++ b/src/com/engine/organization/web/HrmResourceController.java @@ -286,8 +286,7 @@ public class HrmResourceController { public ReturnResult saveCustomTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SearchTemplateParam params) { try { User user = HrmUserVarify.getUser(request, response); - Integer templateId = getHrmResourceWrapper(user).saveCustomTemplate(params); - return ReturnResult.successed(user,Util.null2String(templateId)); + return ReturnResult.successed(user,getHrmResourceWrapper(user).saveCustomTemplate(params)); } catch (Exception e) { return ReturnResult.exceptionHandle(e); } diff --git a/src/com/engine/organization/wrapper/HrmResourceWrapper.java b/src/com/engine/organization/wrapper/HrmResourceWrapper.java index 21145a46..2496a83a 100644 --- a/src/com/engine/organization/wrapper/HrmResourceWrapper.java +++ b/src/com/engine/organization/wrapper/HrmResourceWrapper.java @@ -91,7 +91,7 @@ public class HrmResourceWrapper extends OrganizationWrapper { return getHrmResourceService(user).getSearchTemplate(params); } - public Integer saveCustomTemplate(SearchTemplateParam params) { + public Map saveCustomTemplate(SearchTemplateParam params) { return getHrmResourceService(user).saveCustomTemplate(params); } From 6af0092549a9ed337e4a47cb3ae8670dfe78d712 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Thu, 25 Jul 2024 16:56:03 +0800 Subject: [PATCH 08/23] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=88=97=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E6=A8=A1=E6=9D=BF=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ExportCommonServiceImpl.java | 34 ++++++++++++++----- .../transmethod/HrmResourceTransMethod.java | 33 ++++++++++++++++++ 2 files changed, 58 insertions(+), 9 deletions(-) diff --git a/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java b/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java index 5c2b1369..d755dfbf 100644 --- a/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java +++ b/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java @@ -14,12 +14,14 @@ import com.engine.organization.component.OrganizationWeaTable; import com.engine.organization.entity.department.bo.DepartmentBO; import com.engine.organization.entity.department.dto.DepartmentListDTO; import com.engine.organization.entity.department.po.DepartmentPO; +import com.engine.organization.entity.hrmresource.po.JclOrgCustomTemplatePO; import com.engine.organization.entity.hrmresource.po.SearchTemplatePO; import com.engine.organization.entity.hrmresource.vo.HrmResourceVO; import com.engine.organization.entity.staff.po.StaffPO; import com.engine.organization.entity.staff.vo.StaffTableVO; import com.engine.organization.mapper.department.DepartmentMapper; import com.engine.organization.mapper.resource.HrmResourceMapper; +import com.engine.organization.mapper.resource.JclOrgCustomTemplateMapper; import com.engine.organization.mapper.resource.ResourceMapper; import com.engine.organization.mapper.staff.StaffMapper; import com.engine.organization.mapper.staff.StaffPlanMapper; @@ -141,18 +143,31 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ HrmResourceServiceImpl hrmResourceService = ServiceUtil.getService(HrmResourceServiceImpl.class,user); List allConditions = hrmResourceService.getAllConditions(); - List columnList; + JclOrgCustomTemplatePO jclOrgCustomTemplatePO = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).queryIsusedTemp("1", String.valueOf(user.getUID())); - // 查询当前台账定制列 - SearchTemplatePO usedCustomTemplate = MapperProxyFactory.getProxy(HrmResourceMapper.class).getUsedCustomTemplateByUser(user.getUID()); - if (null == usedCustomTemplate) { - // 默认列定制 - String selectKeys = "-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid"; - columnList = Arrays.asList(selectKeys.split(",")); + //2.是否存在通用模板 + if (null == jclOrgCustomTemplatePO) { + jclOrgCustomTemplatePO = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).queryOverAll(); + } + + String columns = ""; + if (jclOrgCustomTemplatePO != null) { + if (org.apache.commons.lang3.StringUtils.isNotBlank(jclOrgCustomTemplatePO.getBasicFields())) { + columns = jclOrgCustomTemplatePO.getBasicFields(); + } + if (org.apache.commons.lang3.StringUtils.isNotBlank(jclOrgCustomTemplatePO.getPersonalFields())) { + columns = columns + "," + jclOrgCustomTemplatePO.getPersonalFields(); + } + if (org.apache.commons.lang3.StringUtils.isNotBlank(jclOrgCustomTemplatePO.getWorkFields())) { + columns = columns + "," + jclOrgCustomTemplatePO.getWorkFields(); + } } else { - columnList = hrmResourceService.getSelectKeys(usedCustomTemplate); + //初次使用,无模板初始值 + columns = "-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_subcompanyid1,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid,-1_hrm_sporder"; } + List columnList = Arrays.asList(columns.split(",")); + BigDecimal decimal = new BigDecimal(100 / columnList.size()); @@ -168,7 +183,8 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ weaTableColumn.setText(MapperProxyFactory.getProxy(HrmResourceMapper.class).queryLabelName(fieldName, scopeId, user.getLanguage())); weaTableColumn.setColumn(hrmResourceService.buildTableSql(columnName).replace(".", "_")); weaTableColumn.setDisplay(columnList.contains(columnName) ? WeaBoolAttr.TRUE : WeaBoolAttr.FALSE); - weaTableColumn.setTransmethod("com.engine.organization.transmethod.HrmResourceTransMethod.getFieldTrueValue"); + // 导出专用转换,去除html标签 + weaTableColumn.setTransmethod("com.engine.organization.transmethod.HrmResourceTransMethod.getFieldTrueValueExp"); weaTableColumn.setOtherpara(columnName); weaTableColumn.setWidth(decimal.setScale(2, RoundingMode.HALF_UP).doubleValue() + "%"); if (weaTableColumn.getDisplay().getBoolVal()) { diff --git a/src/com/engine/organization/transmethod/HrmResourceTransMethod.java b/src/com/engine/organization/transmethod/HrmResourceTransMethod.java index 35ae848f..c3313fd0 100644 --- a/src/com/engine/organization/transmethod/HrmResourceTransMethod.java +++ b/src/com/engine/organization/transmethod/HrmResourceTransMethod.java @@ -16,6 +16,13 @@ import weaver.hrm.definedfield.HrmFieldManager; */ public class HrmResourceTransMethod { + /** + * 字段展示内容转换,列表用 + * + * @param id + * @param para + * @return + */ public static String getFieldTrueValue(String id, String para) { HrmFieldManager hfm = new HrmFieldManager("HrmCustomFieldByInfoType", Integer.parseInt(para.split("_")[0])); String fieldName = para.substring(para.lastIndexOf("_") + 1); @@ -32,6 +39,32 @@ public class HrmResourceTransMethod { } } + /** + * 字段展示内容转换,导出用 + * + * @param id + * @param para + * @return + */ + public static String getFieldTrueValueExp(String id, String para) { + HrmFieldManager hfm = new HrmFieldManager("HrmCustomFieldByInfoType", Integer.parseInt(para.split("_")[0])); + String fieldName = para.substring(para.lastIndexOf("_") + 1); + JSONObject hrmFieldConf = hfm.getHrmFieldConf(fieldName); + User user = new User(); + user.setUid(1); + try { + if (hfm.isBaseField(fieldName) && "jobactivity".equals(fieldName)) { + hrmFieldConf.put("type", 282); + } + String fieldvalue = hfm.getFieldvalue(null, user, null, hrmFieldConf.getString("dmlurl"), hrmFieldConf.getInt("id"), hrmFieldConf.getInt("fieldhtmltype"), hrmFieldConf.getInt("type"), id, 0, fieldName); + // fieldvalue去除Html内容 + fieldvalue = fieldvalue.replaceAll("<[^>]*>", "").replaceAll(" ", ""); + return fieldvalue; + } catch (Exception e) { + return ""; + } + } + public static String getDepartmentName(String departmentId) { return MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptNameById(Integer.parseInt(departmentId)); } From a7ee4e47a36161c213e4ea67b913b306ee6c0d6c Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 25 Jul 2024 18:51:29 +0800 Subject: [PATCH 09/23] =?UTF-8?q?=E8=8A=B1=E5=90=8D=E5=86=8C=E6=95=B4?= =?UTF-8?q?=E4=BD=93=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/resource/JclOrgCustomTemplateMapper.xml | 2 +- .../service/impl/HrmResourceServiceImpl.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/com/engine/organization/mapper/resource/JclOrgCustomTemplateMapper.xml b/src/com/engine/organization/mapper/resource/JclOrgCustomTemplateMapper.xml index 432e2ba2..bfd7213d 100644 --- a/src/com/engine/organization/mapper/resource/JclOrgCustomTemplateMapper.xml +++ b/src/com/engine/organization/mapper/resource/JclOrgCustomTemplateMapper.xml @@ -32,7 +32,7 @@ diff --git a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java index 10b2acbc..128e0f1d 100644 --- a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java +++ b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java @@ -344,10 +344,6 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic templates.add(0, SearchTemplateParam.builder().key("-1").showname("默认模板").build()); } - //1.增加全局模板 - if (userUID != 1) { - templates.addAll(getHrmResourceMapper().getCustomOverAll()); - } LinkedHashSet objects = new LinkedHashSet<>(templates); returnMap.put("templates", objects); return returnMap; @@ -725,11 +721,19 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic Map tabInfoMap = new HashMap<>(); tabInfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(user, infoPOList, false, true)); List jclOrgCustomTemplatePOS = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).listAllByCreator(user.getUID()); + //获取当前使用的模板过滤掉 + String customTemplateId = getCustomTemplateId(); + jclOrgCustomTemplatePOS = jclOrgCustomTemplatePOS.stream() + .filter(item -> !customTemplateId.equals(String.valueOf(item.getId()))) + .collect(Collectors.toList()); + List isUsed = new ArrayList<>(); AtomicInteger index = new AtomicInteger(0); List> collect = jclOrgCustomTemplatePOS.stream().map(item -> { Map resultMap = new HashMap<>(); resultMap.put("id", item.getId()); + resultMap.put("viewAttr", 1); + resultMap.put("editTable", false); resultMap.put("name", item.getName()); resultMap.put("createTime", DateUtil.getDate(item.getCreateTime(), "yyyy-MM-dd")); From a6b10dcd8e64e5b5b18a9bd8861fd1daadb75d82 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Fri, 2 Aug 2024 14:15:58 +0800 Subject: [PATCH 10/23] =?UTF-8?q?=E6=A0=B9=E7=BB=93=E7=82=B9=E6=A0=91?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=83=A8=E9=97=A8=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ChartServiceImpl.java | 24 ++++++-- .../service/impl/OrgChartServiceImpl.java | 58 +++++-------------- 2 files changed, 33 insertions(+), 49 deletions(-) diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index b3c3b360..2f9e8acf 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -89,6 +89,7 @@ public class ChartServiceImpl extends Service implements ChartService { // 根结点 String root = Util.null2String(params.get("root")); root = StringUtils.isBlank(root) ? "0" : root; + boolean isDepartment = root.startsWith("d"); // 维度 String dimension = Util.null2String(params.get("fclass")); @@ -524,6 +525,19 @@ public class ChartServiceImpl extends Service implements ChartService { public Map getDepartmentTree(Map params) { Map result = new HashMap<>(2); + List departmentTree = getDepartmentTreeList(params); + result.put("departmentTree", departmentTree); + result.put("api_status", true); + return result; + } + + /** + * 获取部门树集合 + * + * @param params + * @return + */ + public static List getDepartmentTreeList(Map params) { RecordSet rs = new RecordSet(); List departmentTree = new ArrayList<>(); String subCompany = Util.null2String(params.get("subcompany")); @@ -535,11 +549,9 @@ public class ChartServiceImpl extends Service implements ChartService { String sql = getDepartmentTreeSql(versionId, dimension, subCompany); rs.executeQuery(sql); while (rs.next()) { - departmentTree.add(CompanyTreePO.builder().id(rs.getString("id")).pId(rs.getString("pId")).disabled(!rs.getString("id").startsWith("d")).value(rs.getString("value")).title(rs.getString("title")).isLeaf(judgeTreeLeaf(versionId, dimension, rs.getString("id"))).build()); + departmentTree.add(CompanyTreePO.builder().id(rs.getString("id")).pId(rs.getString("pId")).disabled(false).value(rs.getString("value")).title(rs.getString("title")).isLeaf(judgeTreeLeaf(versionId, dimension, rs.getString("id"))).build()); } - result.put("departmentTree", departmentTree); - result.put("api_status", true); - return result; + return departmentTree; } @Override @@ -1654,7 +1666,7 @@ public class ChartServiceImpl extends Service implements ChartService { * @param subCompany 上级Id * @return SQL */ - private String getDepartmentTreeSql(String versionId, String dimension, String subCompany) { + private static String getDepartmentTreeSql(String versionId, String dimension, String subCompany) { // 是否展示当前数据 boolean isSearchCurrent = StringUtils.isBlank(versionId) || "0".equals(versionId); boolean isCurrentDimension = StringUtils.isNotBlank(dimension) && !"0".equals(dimension); @@ -1716,7 +1728,7 @@ public class ChartServiceImpl extends Service implements ChartService { * @param subCompany 上级元素ID * @return */ - private boolean judgeTreeLeaf(String versionId, String dimension, String subCompany) { + private static boolean judgeTreeLeaf(String versionId, String dimension, String subCompany) { RecordSet recordSet = new RecordSet(); String sql = getDepartmentTreeSql(versionId, dimension, subCompany); recordSet.executeQuery(sql); diff --git a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java index 53ca2237..0c116879 100644 --- a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java @@ -58,54 +58,29 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { item.put("companyname", rs.getString("companyname")); fclasslist.add(item); } - - List companyTree = new ArrayList<>(); - String sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompany where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = '0'"; - // 一级分部数据分权处理 - String dimension = Util.null2String(request2Map.get("fclass")); - //版本id - String id = Util.null2String(request2Map.get("id")); - boolean isRealDimension = StringUtils.isBlank(dimension) || "0".equals(dimension); - boolean isRealTime = StringUtils.isBlank(id) || "0".equals(id); - if (isRealTime && user.getUID() != 1 && isRealDimension) { - DetachUtil detachUtil = new DetachUtil(user); - if(detachUtil.isDETACH()) { - String ids = detachUtil.getJclRoleLevels(); - sql = sql + " and id in (" + ids + ")"; - } - } - - rs.executeQuery(sql); - while (rs.next()) { - companyTree.add(CompanyTreePO.builder().id(rs.getString("id")).pId(rs.getString("pId")).value(rs.getString("value")).title(rs.getString("title")).isLeaf(judgeTreeLeaf("select id from hrmsubcompany where (canceled is null or canceled != '1') and supsubcomid = ?", rs.getString("id"))).build()); - } result.put("api_status", true); result.put("fclasslist", fclasslist); - result.put("companyTree", companyTree); + Map subCompanyTree = getSubCompanyTree(request2Map); + result.putAll(subCompanyTree); return result; } @Override public Map getSubCompanyTree(Map params) { Map result = new HashMap<>(2); + List departmentTree = ChartServiceImpl.getDepartmentTreeList(params); + result.put("companyTree", departmentTree); + return result; + } - RecordSet rs = new RecordSet(); - List companyTree = new ArrayList<>(); - String subcompany = Util.null2String(params.get("subcompany")); - if (StringUtils.isBlank(subcompany)) { - subcompany = "0"; - } - String fclass = Util.null2String(params.get("fclass")); - String id = Util.null2String(params.get("id")); + private String getSubCompanyTreeSql(String id, String fclass, String subcompany) { // 是否展示当前数据 boolean isSearchCurrent = StringUtils.isBlank(id) || "0".equals(id); String sql; - String judgeTreeLeafSql; if (isSearchCurrent) { sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompany where (canceled is null or canceled != '1') and " + DBType.get(new RecordSet().getDBType()).ifNull("supsubcomid", "0") + " = ? "; boolean isRealDimension = StringUtils.isBlank(fclass) || "0".equals(fclass); boolean isRealTime = StringUtils.isBlank(id) || "0".equals(id); - judgeTreeLeafSql = sql; if (isRealTime && user.getUID() != 1 && isRealDimension) { DetachUtil detachUtil = new DetachUtil(user); if (detachUtil.isDETACH()) { @@ -125,14 +100,8 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { } // 添加时间轴条件 sql += " and versionid = " + id; - judgeTreeLeafSql = sql; } - rs.executeQuery(sql, subcompany); - while (rs.next()) { - companyTree.add(CompanyTreePO.builder().id(rs.getString("id")).pId(rs.getString("pId")).value(rs.getString("value")).title(rs.getString("title")).isLeaf(judgeTreeLeaf(judgeTreeLeafSql, rs.getString("id"))).build()); - } - result.put("companyTree", companyTree); - return result; + return sql; } private String companyDateWhereSql(Map request2Map) { @@ -705,16 +674,19 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { return fieldname; } + /** * 判断树是否为叶子节点 * - * @param sql 查询下级元素SQL - * @param treeId 当前元素ID + * @param versionId + * @param dimension + * @param subCompany * @return */ - private boolean judgeTreeLeaf(String sql, String treeId) { + private boolean judgeTreeLeaf(String versionId, String dimension, String subCompany) { RecordSet recordSet = new RecordSet(); - recordSet.executeQuery(sql, treeId); + String sql = getSubCompanyTreeSql(versionId, dimension, subCompany); + recordSet.executeQuery(sql, subCompany); return !recordSet.next(); } From d3f87a3a077bacc14fc8f30f70fae077180949b5 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Fri, 2 Aug 2024 14:53:20 +0800 Subject: [PATCH 11/23] =?UTF-8?q?=E6=A0=B9=E7=BB=93=E7=82=B9=E6=A0=91?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=83=A8=E9=97=A8=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ChartServiceImpl.java | 67 ++++++++++++++----- 1 file changed, 49 insertions(+), 18 deletions(-) diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index 2f9e8acf..4398c23a 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -462,14 +462,31 @@ public class ChartServiceImpl extends Service implements ChartService { " versionid = " + versionId + " and companyvirtualid = " + dimension; } } else { - if (hasVirtualFields) { - if (showVirtual) { - return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,isvirtual as isvitual,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and subcompanyid = " + root; + String numSql = ",a.job_num,a.staff_num"; + if (!isRealDimension) { + numSql = ""; + } + if (root.startsWith("d")) { + root = root.replace("d", ""); + if (hasVirtualFields) { + if (showVirtual) { + return "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual" + numSql + " from " + DEPARTMENT_TABLE + " a where (a.canceled is null or a.canceled != '1') and " + DEPARTMENT_ID + " = '" + root + "' and versionid = " + versionId; + } else { + return "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type ,isvirtual as isvitual" + numSql + " from " + DEPARTMENT_TABLE + " a where (canceled is null or canceled != '1') and (isvirtual is null or isvirtual != '1') and " + DEPARTMENT_ID + " = '" + root + "' and versionid = " + versionId; + } } else { - return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,isvirtual as isvitual,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and subcompanyid = " + root + " and (isvirtual is null or isvirtual != '1')"; + return "select " + DEPARTMENT_ID + " as id,a.departmentname as name,'2' as type" + numSql + " from " + DEPARTMENT_TABLE + " a where (canceled is null or canceled != '1') and " + DEPARTMENT_ID + " = '" + root + "' and versionid = " + versionId; } } else { - return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,a.job_num,a.staff_num from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and subcompanyid = " + root; + if (hasVirtualFields) { + if (showVirtual) { + return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,isvirtual as isvitual" + numSql + " from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and " + SUB_COMPANY_ID + " = " + root; + } else { + return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type,isvirtual as isvitual" + numSql + " from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and " + SUB_COMPANY_ID + " = " + root + " and (isvirtual is null or isvirtual != '1')"; + } + } else { + return "select " + SUB_COMPANY_ID + " as id,subcompanyname as name,'1' as type" + numSql + " from " + SUB_COMPANY_TABLE + " a where versionid = " + versionId + " and " + SUB_COMPANY_ID + " = " + root; + } } } } @@ -1351,15 +1368,28 @@ public class ChartServiceImpl extends Service implements ChartService { return "select id,companyname as name,'0' as type from " + COMPANY_TABLE + " where id = '" + dimension + "'"; } } else { - if (hasVirtualFields) { - if (showVirtual) { - return "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,c.on_job_num,c.staff_num from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid left join jcl_org_onjob c on a.id=c.data_id and c.type=1 where a.id = '" + root + "' order by showorder,id"; + if(root.startsWith("d")) { + root = root.replace("d", ""); + if (hasVirtualFields) { + if (showVirtual) { + return "select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual,c.on_job_num,c.staff_num from " + DEPARTMENT_TABLE + " a left join " + DEPARTMENT_DEFINED_TABLE + " b on a.id = b.deptid left join jcl_org_onjob c on a.id=c.data_id and c.type=2 where (a.canceled is null or a.canceled != '1') and a.id = '" + root + "'"; + } else { + return "select a.id,a.departmentname as name,'2' as type ,b.bmlx as isvitual,c.on_job_num,c.staff_num from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid left join jcl_org_onjob c on a.id=c.data_id and c.type=2 where (canceled is null or canceled != '1') and (b.bmlx is null or b.bmlx != '1') and a.id = '" + root + "'"; + } } else { - return "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,c.on_job_num,c.staff_num from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid left join jcl_org_onjob c on a.id=c.data_id and c.type=1 where a.id = '" + root + "' and (b.fblx is null or b.fblx!='1') order by showorder,id"; + return "select a.id,a.departmentname as name,'2' as type,b.on_job_num,b.staff_num from " + DEPARTMENT_TABLE + " a left join jcl_org_onjob b on a.id=b.data_id and b.type=2 where (canceled is null or canceled != '1') and a.id = '" + root + "'"; + } + }else { + if (hasVirtualFields) { + if (showVirtual) { + return "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,c.on_job_num,c.staff_num from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid left join jcl_org_onjob c on a.id=c.data_id and c.type=1 where a.id = '" + root + "' order by showorder,id"; + } else { + return "select a.id,a.subcompanyname as name,'1' as type ,b.fblx as isvitual,c.on_job_num,c.staff_num from " + SUB_COMPANY_TABLE + " a left join " + SUB_COMPANY_DEFINED_TABLE + " b on a.id = b.subcomid left join jcl_org_onjob c on a.id=c.data_id and c.type=1 where a.id = '" + root + "' and (b.fblx is null or b.fblx!='1') order by showorder,id"; + } + } else { + return "select a.id,a.subcompanyname as name,'1' as type,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a.id=b.data_id and b.type=1 where a.id = '" + root + "' order by a.showorder,a.id"; } - } else { - return "select a.id,a.subcompanyname as name,'1' as type,b.on_job_num,b.staff_num from " + SUB_COMPANY_TABLE + " a left join jcl_org_onjob b on a.id=b.data_id and b.type=1 where a.id = '" + root + "' order by a.showorder,a.id"; } } } @@ -1669,7 +1699,7 @@ public class ChartServiceImpl extends Service implements ChartService { private static String getDepartmentTreeSql(String versionId, String dimension, String subCompany) { // 是否展示当前数据 boolean isSearchCurrent = StringUtils.isBlank(versionId) || "0".equals(versionId); - boolean isCurrentDimension = StringUtils.isNotBlank(dimension) && !"0".equals(dimension); + boolean isNotCurrentDimension = StringUtils.isNotBlank(dimension) && !"0".equals(dimension); boolean isDepartment = subCompany.startsWith("d"); String sql; DBType dbType = DBType.get(new RecordSet().getDBType()); @@ -1677,31 +1707,32 @@ public class ChartServiceImpl extends Service implements ChartService { subCompany = subCompany.replace("d", ""); if (isSearchCurrent) { sql = "select " + dbType.concat("d", "id") + "as id, id as value, departmentname as title, " + dbType.concat("d", "supdepid") + " as pId from hrmdepartment where (canceled is null or canceled != '1') and " + dbType.ifNull("supdepid", "0") + " = " + subCompany; - if (isCurrentDimension) { + sql += " order by showorder,id "; + if (isNotCurrentDimension) { sql = "select " + dbType.concat("d", "id") + "as id, id as value, departmentname as title, " + dbType.concat("d", "supdepid") + " as pId from hrmdepartmentvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supdepid", "0") + " = " + subCompany; } - sql += " order by showorder,id "; } else { sql = "select " + dbType.concat("d", "departmentid") + "as id, departmentid as value, departmentname as title, " + dbType.concat("d", "supdepartmentid") + " as pId from jcl_chart_department where (canceled is null or canceled != '1') and " + dbType.ifNull("supdepartmentid", "0") + " = " + subCompany; - if (isCurrentDimension) { + if (isNotCurrentDimension) { sql = "select " + dbType.concat("d", "departmentvirtualid") + "as id, departmentvirtualid as value, departmentname as title, " + dbType.concat("d", "supdepid") + " as pId from jcl_chart_departmentvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supdepid", "0") + " = " + subCompany; } // 添加时间轴条件 sql += " and versionid = " + versionId; } } else { + // TODO 分权 if (isSearchCurrent) { sql = "select " + dbType.concat("", "id") + " as id, id as value, subcompanyname as title, supsubcomid as pId, showorder from hrmsubcompany where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcomid", "0") + " = " + subCompany + " union select " + dbType.concat("d", "id") + "as id, id as value, departmentname as title, subcompanyid1 as pId, showorder from hrmdepartment where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and " + dbType.ifNull("subcompanyid1", "0") + " = " + subCompany; - if (isCurrentDimension) { + sql += " order by showorder,id "; + if (isNotCurrentDimension) { sql = "select id as id, id as value, subcompanyname as title, supsubcomid as pId from hrmsubcompanyvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcomid", "0") + " = " + subCompany + " and companyid = '" + dimension + "' " + " union select " + dbType.concat("d", "id") + "as id, id as value, departmentname as title, subcompanyid1 as pId from hrmdepartmentvirtual where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and" + dbType.ifNull("subcompanyid1", "0") + " = " + subCompany; } - sql += " order by showorder,id "; } else { sql = "select " + dbType.concat("", "subcompanyid") + " as id, subcompanyid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompany where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcompanyid", "0") + " = " + subCompany + " union select " + dbType.concat("d", "subcompanyid") + "as id, subcompanyid as value, departmentname as title, subcompanyid as pId from jcl_chart_department where (canceled is null or canceled != '1') and (supdepartmentid is null or supdepartmentid =0) and " + dbType.ifNull("subcompanyid", "0") + " = " + subCompany; - if (isCurrentDimension) { + if (isNotCurrentDimension) { sql = "select " + dbType.concat("", "subcompanyvirtualid") + " as id, subcompanyvirtualid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompanyvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcompanyid", "0") + " = " + subCompany + " and companyid = '" + dimension + "' " + " union select " + dbType.concat("d", "departmentvirtualid") + "as id, departmentvirtualid as value, departmentname as title, subcompanyid as pId from jcl_chart_departmentvirtual where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and" + dbType.ifNull("subcompanyid", "0") + " = " + subCompany; } From 06a3d5b2259294d0a03393b8d567342ac98fe3a8 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Fri, 2 Aug 2024 16:45:57 +0800 Subject: [PATCH 12/23] =?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 --- .../entity/personnelcard/vo/CardAccessVO.java | 2 +- .../organization/service/ChartService.java | 9 +++ .../service/impl/ChartServiceImpl.java | 26 +++++++++ .../util/OrganizationDateUtil.java | 57 +++++++++++++++++++ .../organization/web/OrgChartController.java | 23 ++++++-- .../organization/wrapper/OrgChartWrapper.java | 4 ++ 6 files changed, 116 insertions(+), 5 deletions(-) diff --git a/src/com/engine/organization/entity/personnelcard/vo/CardAccessVO.java b/src/com/engine/organization/entity/personnelcard/vo/CardAccessVO.java index 3546758a..4e4e7939 100644 --- a/src/com/engine/organization/entity/personnelcard/vo/CardAccessVO.java +++ b/src/com/engine/organization/entity/personnelcard/vo/CardAccessVO.java @@ -49,7 +49,7 @@ public class CardAccessVO { @OrganizationTableColumn(labelId = 547390, text = "所有人可见", width = "15%", column = "all_people") private Integer allPeople; - @OrganizationTableColumn(labelId = 547392, text = "上级可见", width = "15%", column = "superior") + @OrganizationTableColumn(labelId = 547391, text = "上级可见", width = "15%", column = "superior") private Integer superior; @OrganizationTableColumn(labelId = 547392, text = "所有上级可见", width = "15%", column = "all_superior") diff --git a/src/com/engine/organization/service/ChartService.java b/src/com/engine/organization/service/ChartService.java index be26495e..99b0f721 100644 --- a/src/com/engine/organization/service/ChartService.java +++ b/src/com/engine/organization/service/ChartService.java @@ -101,4 +101,13 @@ public interface ChartService { * @return: java.util.Map */ Map selectLabel(); + + /** + * @Description: 历史版本删除 + * @Author: liang.cheng + * @Date: 2024/8/1 4:30 PM + * @param: [] + * @return: java.util.Map + */ + Map versionDelete(Integer versionId); } diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index b3c3b360..5a361d0c 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -701,6 +701,32 @@ public class ChartServiceImpl extends Service implements ChartService { return labelData; } + @Override + public Map versionDelete(Integer versionId) { + + Map data = new HashMap<>(); + + + RecordSet rs = new RecordSet(); + //1.删除版本表 + rs.executeUpdate("delete from jcl_org_chartversion where id = ?",versionId); + + //2.删除历史分部表 + rs.executeUpdate("delete from jcl_chart_subcompany where versionid = ?",versionId); + + //3.删除历史部门表 + rs.executeUpdate("delete from jcl_chart_department where versionid = ?",versionId); + + //4.删除历史聚才林岗位表 + rs.executeUpdate("delete from jcl_chart_job where versionid = ?",versionId); + + //5.删除历史人员表 + rs.executeUpdate("delete from jcl_chart_resource where versionid = ?",versionId); + + data.put("versionId",versionId); + return data; + } + /** * 生成人数 * @param stp diff --git a/src/com/engine/organization/util/OrganizationDateUtil.java b/src/com/engine/organization/util/OrganizationDateUtil.java index da57c62d..30a4c961 100644 --- a/src/com/engine/organization/util/OrganizationDateUtil.java +++ b/src/com/engine/organization/util/OrganizationDateUtil.java @@ -11,6 +11,7 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.*; import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; import java.util.Calendar; import java.util.Date; import java.util.Objects; @@ -470,6 +471,62 @@ public class OrganizationDateUtil { return localDate; } + + /** + * 获取一个月后的日期 + * @param firstDate + * @return + */ + public static String getLastMonthDate(String firstDate) { + // 定义日期格式 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String nextMonthDateString = ""; + + try { + LocalDate date = LocalDate.parse(firstDate, formatter); + LocalDate nextMonthDate = date.plusMonths(1); + nextMonthDateString = nextMonthDate.format(formatter); + + } catch (DateTimeParseException e) { + e.printStackTrace(); + } + return nextMonthDateString; + } + + /** + * 获取一年后的日期 + * @param firstDate + * @return + */ + public static String getLastYearDate(String firstDate) { + // 定义日期格式 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + String nextYearDateString = ""; + + try { + LocalDate date = LocalDate.parse(firstDate, formatter); + LocalDate nextYearDate = date.plusYears(1); + nextYearDateString = nextYearDate.format(formatter); + + } catch (DateTimeParseException e) { + e.printStackTrace(); + } + return nextYearDateString; + } + + + /** + * 格式化日期 + * @return + */ + public static String dateExample(LocalDate date) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); + return date.format(formatter); + } + + + + } diff --git a/src/com/engine/organization/web/OrgChartController.java b/src/com/engine/organization/web/OrgChartController.java index 42a17209..281bb548 100644 --- a/src/com/engine/organization/web/OrgChartController.java +++ b/src/com/engine/organization/web/OrgChartController.java @@ -12,10 +12,7 @@ import weaver.hrm.User; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import java.util.HashMap; @@ -100,6 +97,24 @@ public class OrgChartController { return JSONObject.toJSONString(apidatas); } + @GET + @Path("/versionDelete") + @Produces(MediaType.APPLICATION_JSON) + public String versionDelete(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("versionId") Integer versionId) { + Map apidatas = new HashMap<>(4); + try { + User user = HrmUserVarify.getUser(request, response); + apidatas = getOrgChartWrapper(user).versionDelete(versionId); + apidatas.put("api_status", true); + } catch (Exception e) { + //异常处理 + e.printStackTrace(); + apidatas.put("api_status", false); + apidatas.put("api_errormsg", "catch exception : " + e.getMessage()); + } + return JSONObject.toJSONString(apidatas); + } + @GET @Path("/getSubCompanyTree") diff --git a/src/com/engine/organization/wrapper/OrgChartWrapper.java b/src/com/engine/organization/wrapper/OrgChartWrapper.java index d7d46c32..5346546a 100644 --- a/src/com/engine/organization/wrapper/OrgChartWrapper.java +++ b/src/com/engine/organization/wrapper/OrgChartWrapper.java @@ -94,4 +94,8 @@ public class OrgChartWrapper extends Service { public Map selectLabel() { return getChartService(user).selectLabel(); } + + public Map versionDelete(Integer versionId) { + return getChartService(user).versionDelete(versionId); + } } 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 13/23] =?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 ad9e80e1e87304967f3e944805093b1363de7044 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Mon, 5 Aug 2024 14:56:25 +0800 Subject: [PATCH 14/23] =?UTF-8?q?=E6=A0=B9=E7=BB=93=E7=82=B9=E6=A0=91?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=83=A8=E9=97=A8=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/organization/entity/chart/CompanyTreePO.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/com/engine/organization/entity/chart/CompanyTreePO.java b/src/com/engine/organization/entity/chart/CompanyTreePO.java index c5c3dd1e..e002c8d0 100644 --- a/src/com/engine/organization/entity/chart/CompanyTreePO.java +++ b/src/com/engine/organization/entity/chart/CompanyTreePO.java @@ -22,6 +22,7 @@ public class CompanyTreePO { private boolean isLeaf; private String key; private boolean disabled; + private String type; public boolean getIsLeaf() { return isLeaf; @@ -38,4 +39,11 @@ public class CompanyTreePO { public String getValue() { return id; } + + public String getType() { + if(id.startsWith("d")){ + return "2"; + } + return "1"; + } } From be807d032bb645ae11f45adaf51ac7e69ccdf99f Mon Sep 17 00:00:00 2001 From: dxfeng Date: Mon, 5 Aug 2024 15:11:54 +0800 Subject: [PATCH 15/23] =?UTF-8?q?=E7=BC=96=E5=88=B6=E6=96=B9=E6=A1=88?= =?UTF-8?q?=E3=80=81=E7=BC=96=E5=88=B6=E4=BF=A1=E6=81=AF=E5=88=86=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/service/impl/StaffPlanServiceImpl.java | 7 +++++++ .../engine/organization/service/impl/StaffServiceImpl.java | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/com/engine/organization/service/impl/StaffPlanServiceImpl.java b/src/com/engine/organization/service/impl/StaffPlanServiceImpl.java index e1206971..70fda66e 100644 --- a/src/com/engine/organization/service/impl/StaffPlanServiceImpl.java +++ b/src/com/engine/organization/service/impl/StaffPlanServiceImpl.java @@ -17,6 +17,7 @@ import com.engine.organization.util.*; import com.engine.organization.util.browser.OrganizationBrowserUtil; import com.engine.organization.util.db.DBType; import com.engine.organization.util.db.MapperProxyFactory; +import com.engine.organization.util.detach.DetachUtil; import org.apache.commons.lang3.StringUtils; import weaver.common.DateUtil; import weaver.conn.RecordSet; @@ -284,6 +285,12 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService { if (null != forbiddenTag) { sqlWhere += " AND t.forbidden_tag = '" + forbiddenTag + "'"; } + // 分权 + DetachUtil detachUtil = new DetachUtil(user); + if (detachUtil.isDETACH()) { + String ids = detachUtil.getJclRoleLevels(); + sqlWhere += " AND t.ec_company in (" + ids + ")"; + } return sqlWhere; } } diff --git a/src/com/engine/organization/service/impl/StaffServiceImpl.java b/src/com/engine/organization/service/impl/StaffServiceImpl.java index 164a1820..81fa3b23 100644 --- a/src/com/engine/organization/service/impl/StaffServiceImpl.java +++ b/src/com/engine/organization/service/impl/StaffServiceImpl.java @@ -30,6 +30,7 @@ import com.engine.organization.util.*; import com.engine.organization.util.browser.OrganizationBrowserUtil; import com.engine.organization.util.db.DBType; import com.engine.organization.util.db.MapperProxyFactory; +import com.engine.organization.util.detach.DetachUtil; import com.engine.organization.util.excel.ExcelUtil; import org.apache.commons.lang3.StringUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -437,6 +438,12 @@ public class StaffServiceImpl extends Service implements StaffService { sqlWhere += " AND t.plan_id in ( select id from jcl_org_staffplan where plan_name " + dbType.like(staffName) + ") "; } + // 分权 + DetachUtil detachUtil = new DetachUtil(user); + if (detachUtil.isDETACH()) { + String ids = detachUtil.getJclRoleLevels(); + sqlWhere += " AND t.ec_company in (" + ids + ")"; + } return sqlWhere; } From 5c05759ad4bcfbaf6879f1950bf65fcc4ca4cbf4 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Tue, 6 Aug 2024 09:59:18 +0800 Subject: [PATCH 16/23] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E5=9B=BE=EF=BC=8C=E6=A0=B9=E7=BB=93=E7=82=B9=E4=B8=BA=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=97=B6=EF=BC=8C=E5=B1=82=E7=BA=A7=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/organization/service/impl/ChartServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index 4398c23a..05553f5c 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -141,6 +141,10 @@ public class ChartServiceImpl extends Service implements ChartService { // 向下查询数据 if (null != topChartPO) { + // 如果根结点是部门,顶层层级设置为1 + if(topChartPO.getFtype().equals("2")){ + topChartPO.setDepartmentDepth(1); + } findChildData(topChartPO, dataList, Integer.parseInt(depth), id, hideDepartment); } From fe60767829550b95c1ada4b297eabd96da554f44 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Tue, 6 Aug 2024 11:00:51 +0800 Subject: [PATCH 17/23] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E5=9B=BE=EF=BC=8C=E6=A0=B9=E7=BB=93=E7=82=B9=E4=B8=BA=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=97=B6=EF=BC=8C=E5=B1=82=E7=BA=A7=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/organization/service/impl/ChartServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index 05553f5c..a2936ad1 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -1735,7 +1735,7 @@ public class ChartServiceImpl extends Service implements ChartService { } } else { sql = "select " + dbType.concat("", "subcompanyid") + " as id, subcompanyid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompany where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcompanyid", "0") + " = " + subCompany + - " union select " + dbType.concat("d", "subcompanyid") + "as id, subcompanyid as value, departmentname as title, subcompanyid as pId from jcl_chart_department where (canceled is null or canceled != '1') and (supdepartmentid is null or supdepartmentid =0) and " + dbType.ifNull("subcompanyid", "0") + " = " + subCompany; + " union select " + dbType.concat("d", "departmentid") + "as id, departmentid as value, departmentname as title, subcompanyid as pId from jcl_chart_department where (canceled is null or canceled != '1') and (supdepartmentid is null or supdepartmentid =0) and " + dbType.ifNull("subcompanyid", "0") + " = " + subCompany; if (isNotCurrentDimension) { sql = "select " + dbType.concat("", "subcompanyvirtualid") + " as id, subcompanyvirtualid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompanyvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcompanyid", "0") + " = " + subCompany + " and companyid = '" + dimension + "' " + " union select " + dbType.concat("d", "departmentvirtualid") + "as id, departmentvirtualid as value, departmentname as title, subcompanyid as pId from jcl_chart_departmentvirtual where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and" + dbType.ifNull("subcompanyid", "0") + " = " + subCompany; From d865bb976b5dbab5dc09b9a2d3bdc94723b8e544 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Tue, 6 Aug 2024 15:51:04 +0800 Subject: [PATCH 18/23] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E5=9B=BE=EF=BC=8C=E6=A0=B9=E7=BB=93=E7=82=B9=E4=B8=BA=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=97=B6=EF=BC=8C=E5=B1=82=E7=BA=A7=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/service/impl/ChartServiceImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index cbb82587..957a0852 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -1760,14 +1760,14 @@ public class ChartServiceImpl extends Service implements ChartService { " union select " + dbType.concat("d", "id") + "as id, id as value, departmentname as title, subcompanyid1 as pId from hrmdepartmentvirtual where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and" + dbType.ifNull("subcompanyid1", "0") + " = " + subCompany; } } else { - sql = "select " + dbType.concat("", "subcompanyid") + " as id, subcompanyid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompany where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcompanyid", "0") + " = " + subCompany + - " union select " + dbType.concat("d", "departmentid") + "as id, departmentid as value, departmentname as title, subcompanyid as pId from jcl_chart_department where (canceled is null or canceled != '1') and (supdepartmentid is null or supdepartmentid =0) and " + dbType.ifNull("subcompanyid", "0") + " = " + subCompany; + sql = "select " + dbType.concat("", "subcompanyid") + " as id, subcompanyid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompany where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcompanyid", "0") + " = " + subCompany + " and versionid = " + versionId + + " union select " + dbType.concat("d", "departmentid") + "as id, departmentid as value, departmentname as title, subcompanyid as pId from jcl_chart_department where (canceled is null or canceled != '1') and (supdepartmentid is null or supdepartmentid =0) and " + dbType.ifNull("subcompanyid", "0") + " = " + subCompany + " and versionid = " + versionId ; if (isNotCurrentDimension) { - sql = "select " + dbType.concat("", "subcompanyvirtualid") + " as id, subcompanyvirtualid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompanyvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcompanyid", "0") + " = " + subCompany + " and companyid = '" + dimension + "' " + - " union select " + dbType.concat("d", "departmentvirtualid") + "as id, departmentvirtualid as value, departmentname as title, subcompanyid as pId from jcl_chart_departmentvirtual where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and" + dbType.ifNull("subcompanyid", "0") + " = " + subCompany; + sql = "select " + dbType.concat("", "subcompanyvirtualid") + " as id, subcompanyvirtualid as value, subcompanyname as title, supsubcompanyid as pId from jcl_chart_subcompanyvirtual where (canceled is null or canceled != '1') and " + dbType.ifNull("supsubcompanyid", "0") + " = " + subCompany + " and companyid = '" + dimension + "' " + " and versionid = " + versionId + + " union select " + dbType.concat("d", "departmentvirtualid") + "as id, departmentvirtualid as value, departmentname as title, subcompanyid as pId from jcl_chart_departmentvirtual where (canceled is null or canceled != '1') and (supdepid is null or supdepid =0) and" + dbType.ifNull("subcompanyid", "0") + " = " + subCompany + " and versionid = " + versionId ; } - // 添加时间轴条件 - sql += " and versionid = " + versionId; + //// 添加时间轴条件 + //sql += " and versionid = " + versionId; } } return sql; 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 19/23] =?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(); From 2114368acc049250ed15732ac77fd73d4a7f1ed2 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Tue, 13 Aug 2024 10:31:20 +0800 Subject: [PATCH 20/23] =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=BC=96=E5=88=B6?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=AF=BC=E5=85=A5bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/organization/service/impl/JobServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/organization/service/impl/JobServiceImpl.java b/src/com/engine/organization/service/impl/JobServiceImpl.java index 728249d2..26bf9692 100644 --- a/src/com/engine/organization/service/impl/JobServiceImpl.java +++ b/src/com/engine/organization/service/impl/JobServiceImpl.java @@ -741,7 +741,7 @@ public class JobServiceImpl extends Service implements JobService { OrganizationAssert.isEmpty(list, SystemEnv.getHtmlLabelName(547137, user.getLanguage())); } else { - OrganizationAssert.isTrue(null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable()), SystemEnv.getHtmlLabelName(547430,user.getLanguage())); + //OrganizationAssert.isTrue(null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable()), SystemEnv.getHtmlLabelName(547430,user.getLanguage())); jobNo = autoCreateCompanyNo(); } return jobNo; From 53afce795aa3b90d1ce32925124bbfdb02c78072 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 14 Aug 2024 17:04:38 +0800 Subject: [PATCH 21/23] =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=BC=96=E5=88=B6?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=AF=BC=E5=85=A5bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/department/DepartmentMapper.xml | 2 +- .../organization/mapper/job/JobMapper.java | 3 ++- .../organization/mapper/job/JobMapper.xml | 12 ++++----- .../service/impl/StaffServiceImpl.java | 2 +- .../util/saveimport/StaffInfoImportUtil.java | 26 ++++++++++++++++++- 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/com/engine/organization/mapper/department/DepartmentMapper.xml b/src/com/engine/organization/mapper/department/DepartmentMapper.xml index 272449ad..752ac012 100644 --- a/src/com/engine/organization/mapper/department/DepartmentMapper.xml +++ b/src/com/engine/organization/mapper/department/DepartmentMapper.xml @@ -122,7 +122,7 @@ diff --git a/src/com/engine/organization/mapper/job/JobMapper.java b/src/com/engine/organization/mapper/job/JobMapper.java index 6656dbee..275db287 100644 --- a/src/com/engine/organization/mapper/job/JobMapper.java +++ b/src/com/engine/organization/mapper/job/JobMapper.java @@ -141,7 +141,8 @@ public interface JobMapper { * @param parentJob * @return */ - Long getIdByNameAndPid(@Param("jobName") String jobName, @Param("parentCompany") Integer parentCompany, @Param("parentDepartment") Integer parentDepartment, @Param("parentJob") Long parentJob); + Long getIdByNameAndPid(@Param("jobName") String jobName, @Param("parentCompany") Integer parentCompany, @Param("parentDepartment") Integer parentDepartment, @Param("parentJob") Long parentJob, + @Param("jobactivitymark") String jobactivitymark,@Param("jobgroupremark") String jobgroupremark); int updateJobCompany(@Param("ids") Collection ids, @Param("parentCompany") Integer parentCompany, @Param("ecCompany") Integer ecCompany); diff --git a/src/com/engine/organization/mapper/job/JobMapper.xml b/src/com/engine/organization/mapper/job/JobMapper.xml index 30bc8be7..2580bdb5 100644 --- a/src/com/engine/organization/mapper/job/JobMapper.xml +++ b/src/com/engine/organization/mapper/job/JobMapper.xml @@ -483,13 +483,13 @@ + +