From e5a30525f01b3d9591405eb03971616a0c8fe0ac Mon Sep 17 00:00:00 2001 From: dxfeng Date: Thu, 12 Sep 2024 13:24:33 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=8A=B1=E5=90=8D=E5=86=8C-Excel=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=88=97=E5=B1=95=E7=A4=BA=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ExportCommonServiceImpl.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java b/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java index 24298290..c182cba0 100644 --- a/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java +++ b/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java @@ -15,7 +15,6 @@ 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; @@ -45,7 +44,6 @@ import weaver.systeminfo.SystemEnv; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; -import java.math.RoundingMode; import java.util.*; import java.util.stream.Collectors; @@ -169,6 +167,7 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ List columnList = Arrays.asList(columns.split(",")); String propValue = new BaseBean().getPropValue("hrmOrganization", "orgId"); + Map columnMap = new HashMap<>(); BigDecimal decimal = new BigDecimal(100 / columnList.size()); @@ -196,16 +195,18 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ weaTableColumn.setOtherpara(columnName); //weaTableColumn.setWidth(decimal.setScale(2, RoundingMode.HALF_UP).doubleValue() + "%"); - if (weaTableColumn.getDisplay().getBoolVal()) { - weaTableColumnList.add(weaTableColumn); - headerList.add(weaTableColumn.getColumn()); - headerNameList.add(weaTableColumn.getText()); - } + columnMap.put(columnName, weaTableColumn); } } - //todo 修复导出excel与列定制顺序 - + for (String columnName : columnList) { + WeaTableColumn weaTableColumn = columnMap.get(columnName); + if (weaTableColumn != null && weaTableColumn.getDisplay().getBoolVal()) { + weaTableColumnList.add(weaTableColumn); + headerList.add(weaTableColumn.getColumn()); + headerNameList.add(weaTableColumn.getText()); + } + } // 增加id字段,跳转人员卡片 From 1698f8c8d5c5c259400bdc598187caada6f2f771 Mon Sep 17 00:00:00 2001 From: dxfeng Date: Thu, 12 Sep 2024 14:32:52 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=8A=B1=E5=90=8D=E5=86=8C-=E9=AB=98?= =?UTF-8?q?=E7=BA=A7=E6=90=9C=E7=B4=A2=E6=B7=BB=E5=8A=A0=E5=A4=9A=E5=88=86?= =?UTF-8?q?=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/HrmResourceServiceImpl.java | 83 +++++++++++++------ 1 file changed, 56 insertions(+), 27 deletions(-) diff --git a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java index e6784571..a41b107c 100644 --- a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java +++ b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java @@ -6,7 +6,6 @@ import com.api.browser.bean.SearchConditionOption; import com.api.browser.util.ConditionType; import com.api.hrm.bean.HrmFieldBean; import com.api.hrm.util.HrmFieldSearchConditionComInfo; -import com.api.hrm.util.HrmTransMethod; import com.cloudstore.eccom.constant.WeaBoolAttr; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.cloudstore.eccom.result.WeaResultMsg; @@ -792,6 +791,13 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic // sb.append(" and t.status = 1"); sb.append(" and t.status < 4"); } + if (params.containsKey("-1_hrm_subcompanyid1")) { + String value = Util.null2String(params.get("-1_hrm_subcompanyid1")); + if (StringUtils.isNotBlank(value)) { + sb.append(" and t.subcompanyid1 in(").append(value).append(")"); + } + params.remove("-1_hrm_subcompanyid1"); + } for (Map.Entry entry : params.entrySet()) { String key = entry.getKey(); String value = Util.null2String(entry.getValue()); @@ -1010,6 +1016,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic List hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId(HrmGroupEnum.HRM_BASIC.getGroupType().toString()); createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, basicConditionItems); if (CollectionUtils.isNotEmpty(basicConditionItems)) { + SearchConditionItem searchConditionItem = buildSubCompanyCondition(hrmFieldSearchConditionComInfo); + basicConditionItems.add(0,searchConditionItem); addGroups.add(new SearchConditionGroup(SystemEnv.getHtmlLabelName(547175, user.getLanguage()), true, basicConditionItems)); } @@ -1029,6 +1037,22 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic return addGroups; } + private SearchConditionItem buildSubCompanyCondition(HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo) { + HrmFieldBean hrmFieldBean = new HrmFieldBean(); + hrmFieldBean.setFieldid(""); + hrmFieldBean.setFieldname("-1_hrm_subcompanyid1"); + hrmFieldBean.setFieldlabel("-82515"); + hrmFieldBean.setFieldhtmltype("3"); + hrmFieldBean.setType("170"); + hrmFieldBean.setIsQuickSearch(false); + hrmFieldBean.setIsScope(false); + hrmFieldBean.setDmlurl(""); + hrmFieldBean.setIssystem("1"); + hrmFieldBean.setIsFormField(true); + SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user); + return searchConditionItem; + } + /** * 构建查询条件Item * @@ -1081,32 +1105,37 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic HrmFieldManager hfm = new HrmFieldManager("HrmCustomFieldByInfoType", scopeid); List conditionItems = new ArrayList<>(); for (String field : fieldNames) { - String fieldName = field.substring(field.lastIndexOf("_") + 1); - JSONObject hrmFieldConf = hfm.getHrmFieldConf(fieldName); - if (null == hrmFieldConf) { - continue; - } - boolean baseField = hfm.isBaseField(fieldName); - HrmFieldBean hrmFieldBean = new HrmFieldBean(); - hrmFieldBean.setFieldid(Util.null2String(hrmFieldConf.getString("id"))); - hrmFieldBean.setFieldname(scopeid + "_" + (baseField ? "hrm" : "cus") + "_" + fieldName); - hrmFieldBean.setFieldlabel(hrmFieldConf.getString("fieldlabel")); - hrmFieldBean.setFieldhtmltype(hrmFieldConf.getString("fieldhtmltype")); - hrmFieldBean.setType(hrmFieldConf.getString("type")); - hrmFieldBean.setDmlurl(hrmFieldConf.getString("dmlurl")); - hrmFieldBean.setIssystem(baseField ? "1" : "0"); - hrmFieldBean.setIsFormField(true); - hrmFieldBean.setIsQuickSearch(false); - hrmFieldBean.setIsScope(false); - if ("jobactivity".equals(fieldName)) { - // 职务:282 - hrmFieldBean.setType("282"); - } - SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user); - conditionItems.add(searchConditionItem); - // 如果为下拉框,添加一条空选项 - if (searchConditionItem.getConditionType().equals(ConditionType.SELECT)) { - addEmptyForSelect(searchConditionItem); + if ("-1_hrm_subcompanyid1".equals(field)) { + SearchConditionItem searchConditionItem = buildSubCompanyCondition(hrmFieldSearchConditionComInfo); + conditionItems.add(searchConditionItem); + } else { + String fieldName = field.substring(field.lastIndexOf("_") + 1); + JSONObject hrmFieldConf = hfm.getHrmFieldConf(fieldName); + if (null == hrmFieldConf) { + continue; + } + boolean baseField = hfm.isBaseField(fieldName); + HrmFieldBean hrmFieldBean = new HrmFieldBean(); + hrmFieldBean.setFieldid(Util.null2String(hrmFieldConf.getString("id"))); + hrmFieldBean.setFieldname(scopeid + "_" + (baseField ? "hrm" : "cus") + "_" + fieldName); + hrmFieldBean.setFieldlabel(hrmFieldConf.getString("fieldlabel")); + hrmFieldBean.setFieldhtmltype(hrmFieldConf.getString("fieldhtmltype")); + hrmFieldBean.setType(hrmFieldConf.getString("type")); + hrmFieldBean.setDmlurl(hrmFieldConf.getString("dmlurl")); + hrmFieldBean.setIssystem(baseField ? "1" : "0"); + hrmFieldBean.setIsFormField(true); + hrmFieldBean.setIsQuickSearch(false); + hrmFieldBean.setIsScope(false); + if ("jobactivity".equals(fieldName)) { + // 职务:282 + hrmFieldBean.setType("282"); + } + SearchConditionItem searchConditionItem = hrmFieldSearchConditionComInfo.getSearchConditionItem(hrmFieldBean, user); + conditionItems.add(searchConditionItem); + // 如果为下拉框,添加一条空选项 + if (searchConditionItem.getConditionType().equals(ConditionType.SELECT)) { + addEmptyForSelect(searchConditionItem); + } } } if (CollectionUtils.isNotEmpty(conditionItems)) { From 6c973d86cdfbcda47bd12bc6091f4e874b61c03c Mon Sep 17 00:00:00 2001 From: dxfeng Date: Fri, 13 Sep 2024 10:20:52 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=8A=B1=E5=90=8D=E5=86=8C-=E5=88=97?= =?UTF-8?q?=E5=AE=9A=E5=88=B6=E6=B7=BB=E5=8A=A0=E5=88=86=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/HrmResourceServiceImpl.java | 32 ++++++++++++++----- .../transmethod/HrmResourceTransMethod.java | 6 ++++ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java index a41b107c..d4a8d129 100644 --- a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java +++ b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java @@ -306,7 +306,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic List selectKeys; if ("custom".equals(type)) { if ("-1".equals(templateId)) { - selectKeys = Arrays.asList("-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid".split(",")); + //selectKeys = Arrays.asList("-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid".split(",")); + selectKeys = Arrays.asList("-1_hrm_lastname,-1_hrm_departmentid,-1_hrm_subcompanyid1,-1_hrm_jobtitle,-1_hrm_mobile,-1_hrm_telephone,-1_hrm_managerid,-1_hrm_sporder".split(",")); } else { searchTemplateById = getHrmResourceMapper().getCustomTemplateById(templateId); selectKeys = getSelectKeys(searchTemplateById); @@ -602,7 +603,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic } Map apiDatas = new HashMap<>(); List addGroups = new ArrayList<>(); - List allConditions = getAllConditions(); + List allConditions = getAllConditions(true); // 穿梭框ID,展示所选字段信息 HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo(); if ("-1".equals(templateId)) { @@ -1000,12 +1001,15 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic } + public List getAllConditions() { + return getAllConditions(false); + } /** * 获取所有搜索字段信息构建的高级搜索表单 * * @return */ - public List getAllConditions() { + public List getAllConditions(boolean isSearch) { HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo(); List addGroups = new ArrayList<>(); List basicConditionItems = new ArrayList<>(); @@ -1016,7 +1020,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic List hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId(HrmGroupEnum.HRM_BASIC.getGroupType().toString()); createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, basicConditionItems); if (CollectionUtils.isNotEmpty(basicConditionItems)) { - SearchConditionItem searchConditionItem = buildSubCompanyCondition(hrmFieldSearchConditionComInfo); + SearchConditionItem searchConditionItem = buildSubCompanyCondition(hrmFieldSearchConditionComInfo,isSearch); basicConditionItems.add(0,searchConditionItem); addGroups.add(new SearchConditionGroup(SystemEnv.getHtmlLabelName(547175, user.getLanguage()), true, basicConditionItems)); } @@ -1037,13 +1041,25 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic return addGroups; } - private SearchConditionItem buildSubCompanyCondition(HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo) { + + /** + * 花名册构建 + * + * @param hrmFieldSearchConditionComInfo + * @param isSearch + * @return + */ + private SearchConditionItem buildSubCompanyCondition(HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo, boolean isSearch) { HrmFieldBean hrmFieldBean = new HrmFieldBean(); hrmFieldBean.setFieldid(""); hrmFieldBean.setFieldname("-1_hrm_subcompanyid1"); - hrmFieldBean.setFieldlabel("-82515"); + hrmFieldBean.setFieldlabel("-2458"); hrmFieldBean.setFieldhtmltype("3"); - hrmFieldBean.setType("170"); + if (isSearch) { + hrmFieldBean.setType("170"); + } else { + hrmFieldBean.setType("164"); + } hrmFieldBean.setIsQuickSearch(false); hrmFieldBean.setIsScope(false); hrmFieldBean.setDmlurl(""); @@ -1106,7 +1122,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic List conditionItems = new ArrayList<>(); for (String field : fieldNames) { if ("-1_hrm_subcompanyid1".equals(field)) { - SearchConditionItem searchConditionItem = buildSubCompanyCondition(hrmFieldSearchConditionComInfo); + SearchConditionItem searchConditionItem = buildSubCompanyCondition(hrmFieldSearchConditionComInfo,true); conditionItems.add(searchConditionItem); } else { String fieldName = field.substring(field.lastIndexOf("_") + 1); diff --git a/src/com/engine/organization/transmethod/HrmResourceTransMethod.java b/src/com/engine/organization/transmethod/HrmResourceTransMethod.java index 318dbb23..2a4fb9cd 100644 --- a/src/com/engine/organization/transmethod/HrmResourceTransMethod.java +++ b/src/com/engine/organization/transmethod/HrmResourceTransMethod.java @@ -27,6 +27,9 @@ public class HrmResourceTransMethod { */ public static String getFieldTrueValue(String id, String para) { HrmFieldManager hfm = new HrmFieldManager("HrmCustomFieldByInfoType", Integer.parseInt(para.split("_")[0])); + if("-1_hrm_subcompanyid1".equals(para)){ + hfm = new HrmFieldManager("HrmCustomFieldByInfoType", 5); + } String fieldName = para.substring(para.lastIndexOf("_") + 1); JSONObject hrmFieldConf = hfm.getHrmFieldConf(fieldName); User user = new User(); @@ -78,6 +81,9 @@ public class HrmResourceTransMethod { */ public static String getFieldTrueValueExp(String id, String para) { HrmFieldManager hfm = new HrmFieldManager("HrmCustomFieldByInfoType", Integer.parseInt(para.split("_")[0])); + if("-1_hrm_subcompanyid1".equals(para)){ + hfm = new HrmFieldManager("HrmCustomFieldByInfoType", 5); + } String fieldName = para.substring(para.lastIndexOf("_") + 1); JSONObject hrmFieldConf = hfm.getHrmFieldConf(fieldName); User user = new User(); From bb021a6f4549f950b96f891c4bda35faa30de381 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 26 Sep 2024 15:29:45 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=BC=96=E5=88=B6=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E6=B5=81=E7=A8=8B=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E5=A4=84=E7=90=86=20=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/department/DepartmentMapper.xml | 2 +- .../service/impl/JobServiceImpl.java | 13 +- .../action/WorkflowStaffOperateAction.java | 169 ++++++++++++++++++ 3 files changed, 179 insertions(+), 5 deletions(-) create mode 100644 src/weaver/interfaces/organization/action/WorkflowStaffOperateAction.java diff --git a/src/com/engine/organization/mapper/department/DepartmentMapper.xml b/src/com/engine/organization/mapper/department/DepartmentMapper.xml index 7d288abe..091f595a 100644 --- a/src/com/engine/organization/mapper/department/DepartmentMapper.xml +++ b/src/com/engine/organization/mapper/department/DepartmentMapper.xml @@ -96,7 +96,7 @@