diff --git a/src/com/engine/organization/entity/browser/bo/CusBowserTreeBO.java b/src/com/engine/organization/entity/browser/bo/CusBowserTreeBO.java index 3dfa427b..5afcfeb5 100644 --- a/src/com/engine/organization/entity/browser/bo/CusBowserTreeBO.java +++ b/src/com/engine/organization/entity/browser/bo/CusBowserTreeBO.java @@ -26,7 +26,7 @@ public class CusBowserTreeBO { .domid("sel_" + item.getId()) .hasChild(item.getIsParent()) .isLeaf(!item.getIsParent()) - .isopen(false) + .isopen(true) .key(getKey(item)) .name(item.getName()) .build()).collect(Collectors.toList()); diff --git a/src/com/engine/organization/entity/department/bo/DepartmentBO.java b/src/com/engine/organization/entity/department/bo/DepartmentBO.java index ac13e899..3abe5801 100644 --- a/src/com/engine/organization/entity/department/bo/DepartmentBO.java +++ b/src/com/engine/organization/entity/department/bo/DepartmentBO.java @@ -5,6 +5,7 @@ import com.engine.organization.entity.department.param.DeptSearchParam; import com.engine.organization.entity.department.po.DepartmentPO; import com.engine.organization.entity.department.vo.SingleDeptTreeVO; import com.engine.organization.entity.searchtree.SearchTree; +import com.engine.organization.exception.OrganizationRunTimeException; import com.engine.organization.mapper.department.DepartmentMapper; import com.engine.organization.util.db.MapperProxyFactory; import org.apache.commons.collections.CollectionUtils; @@ -32,17 +33,21 @@ public class DepartmentBO { * @return */ public static List buildDeptDTOShowNames(Collection list) { - SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo(); - DepartmentComInfo departmentComInfo = new DepartmentComInfo(); return list.stream().peek(e -> { - e.setSubCompanyName((null == e.getSubCompanyId1() || 0 == e.getSubCompanyId1()) ? "" : subCompanyComInfo.getSubCompanyname(Util.null2String(e.getSubCompanyId1()))); - e.setSupDepName((null == e.getSupDepId() || 0 == e.getSupDepId()) ? "" : departmentComInfo.getDepartmentname(Util.null2String(e.getSupDepId()))); + List children = e.getChildren(); + if (CollectionUtils.isNotEmpty(children)){ + List collect = children.stream().peek(item -> item.setBmfzr(getEmployeeNameById(item.getId()))).collect(Collectors.toList()); + e.setChildren(collect); + } e.setBmfzr(getEmployeeNameById(e.getId())); } ).collect(Collectors.toList()); } public static List buildDeptDTOList(Collection list, String orderType) { + SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo(); + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); + // 递归添加父级数据 List dtoList = list.stream().map(e -> DepartmentListDTO @@ -53,6 +58,8 @@ public class DepartmentBO { .departmentCode(e.getDepartmentCode()) .subCompanyId1(e.getSubCompanyId1()) .supDepId(e.getSupDepId()) + .subCompanyName((null == e.getSubCompanyId1() || 0 == e.getSubCompanyId1()) ? "" : subCompanyComInfo.getSubCompanyname(Util.null2String(e.getSubCompanyId1()))) + .supDepName((null == e.getSupDepId() || 0 == e.getSupDepId()) ? "" : departmentComInfo.getDepartmentname(Util.null2String(e.getSupDepId()))) .showOrder(null == e.getShowOrder() ? 0 : e.getShowOrder()) .canceled(null == e.getCanceled() ? 0 : e.getCanceled()) .orderType(orderType) @@ -189,7 +196,7 @@ public class DepartmentBO { } } } catch (Exception e) { - throw new RuntimeException(e); + throw new OrganizationRunTimeException(e); } return StringUtils.join(employeeNameById, ","); } diff --git a/src/com/engine/organization/mapper/comp/CompMapper.xml b/src/com/engine/organization/mapper/comp/CompMapper.xml index d6f7cec9..648b5856 100644 --- a/src/com/engine/organization/mapper/comp/CompMapper.xml +++ b/src/com/engine/organization/mapper/comp/CompMapper.xml @@ -106,7 +106,7 @@ select from hrmsubcompany t - WHERE id IN + WHERE (t.canceled is null or t.canceled != '1') and id IN NULL) OR id IN(#{id} @@ -117,25 +117,25 @@ FROM hrmsubcompany t - WHERE t.SUPSUBCOMID = 0 + WHERE t.SUPSUBCOMID = 0 and (t.canceled is null or t.canceled != '1') select distinct supDepId from hrmdepartment - where 1=1 + where (canceled is null or canceled != '1') - select - from jcl_org_custom_template order by id + from jcl_org_custom_template where creator = #{creator} order by id diff --git a/src/com/engine/organization/service/impl/ChartServiceImpl.java b/src/com/engine/organization/service/impl/ChartServiceImpl.java index 7a245698..42c30e1c 100644 --- a/src/com/engine/organization/service/impl/ChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/ChartServiceImpl.java @@ -426,7 +426,7 @@ public class ChartServiceImpl extends Service implements ChartService { chartPO.setFname(name); // 岗位处理后的ID chartPO.setParentId(parentId); - chartPO.setExpand("0"); + chartPO.setExpand("1"); chartPO.setHasChildren("0"); chartPO.setBelongto(Util.null2String(belongTo)); chartPO.setCompanyWorkYear(companyWorkYear); diff --git a/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java b/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java index 117da446..55899d43 100644 --- a/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java +++ b/src/com/engine/organization/service/impl/ExportCommonServiceImpl.java @@ -28,6 +28,8 @@ import com.engine.organization.util.excel.ExcelUtil; import org.apache.commons.lang.StringUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.general.Util; +import weaver.hrm.company.DepartmentComInfo; +import weaver.hrm.company.SubCompanyComInfo; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -104,7 +106,7 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ List headerList = new ArrayList<>(); List headerNameList = new ArrayList<>(); OrganizationWeaTable table = new OrganizationWeaTable<>(user, HrmResourceVO.class); - String sqlWhere = " where 1 = 1 and t.status < 4 and (t.accounttype is null or t.accounttype != 1)"; + String sqlWhere = " where 1 = 1 and (t.accounttype is null or t.accounttype != 1)"; // 分权查询 DetachUtil detachUtil = new DetachUtil(user); String parentCompanyIds = detachUtil.getJclRoleLevels(); @@ -215,10 +217,11 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ @Override public XSSFWorkbook departmentExport() { + SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo(); + DepartmentComInfo departmentComInfo = new DepartmentComInfo(); String orderSql = PageInfoSortUtil.getSortSql("", " showorder "); List allList = getDepartmentMapper().listAll(orderSql); new DetachUtil(user).filterDepartmentList(allList); - Map poMaps = allList.stream().collect(Collectors.toMap(DepartmentPO::getId, item -> item)); List dtoList = allList.stream().map(e -> DepartmentListDTO .builder() @@ -226,8 +229,10 @@ public class ExportCommonServiceImpl extends Service implements ExportCommonServ .departmentMark(e.getDepartmentMark()) .departmentName(e.getDepartmentName()) .departmentCode(e.getDepartmentCode()) - .subCompanyName(0 == e.getSubCompanyId1() ? "" : MapperProxyFactory.getProxy(CompMapper.class).listById(e.getSubCompanyId1()).getSubCompanyName()) - .supDepName(null == poMaps.get(e.getSupDepId()) ? "" : poMaps.get(e.getSupDepId()).getDepartmentName()) + .subCompanyId1(e.getSubCompanyId1()) + .supDepId(e.getSupDepId()) + .subCompanyName((null == e.getSubCompanyId1() || 0 == e.getSubCompanyId1()) ? "" : subCompanyComInfo.getSubCompanyname(Util.null2String(e.getSubCompanyId1()))) + .supDepName((null == e.getSupDepId() || 0 == e.getSupDepId()) ? "" : departmentComInfo.getDepartmentname(Util.null2String(e.getSupDepId()))) .bmfzr(DepartmentBO.getEmployeeNameById(e.getId())) .canceled(null == e.getCanceled() ? 0 : e.getCanceled()) .build()).collect(Collectors.toList()); diff --git a/src/com/engine/organization/service/impl/FunctionOutStaffServiceImpl.java b/src/com/engine/organization/service/impl/FunctionOutStaffServiceImpl.java index a5cd07c5..f1efbd2b 100644 --- a/src/com/engine/organization/service/impl/FunctionOutStaffServiceImpl.java +++ b/src/com/engine/organization/service/impl/FunctionOutStaffServiceImpl.java @@ -94,9 +94,12 @@ public class FunctionOutStaffServiceImpl { .sum(); staffPO.setPermanentNum(sum); Integer sums = staffPO.getPermanentNum() + staffPO.getFreezeNum(); + //强控策略下不容许超编 if (staffPO.getControlPolicy().equals(HARDCONTROLLER)) { - OrganizationAssert.isFalse(sums.compareTo(staffPO.getStaffNum()) > 0,"强控策略下不容许超编"); + //冻结数释放 + OrganizationAssert.isFalse((sums > staffPO.getStaffNum() && staffPO.getFreezeNum() > 0),"强控策略下请先释放当前冻结数后再完成入职操作"); + OrganizationAssert.isFalse( sums > staffPO.getStaffNum(),"强控策略下不容许超编"); } //向上部门 分部在编数调整 upwardReviewSums(param); diff --git a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java index ef7db662..1bae9507 100644 --- a/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java +++ b/src/com/engine/organization/service/impl/HrmResourceServiceImpl.java @@ -686,7 +686,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic infoPOList.add(ExtendInfoPO.builder().viewAttr(1).id(null).fieldName("createTime").fieldNameDesc("创建时间").fieldType("date").controlType(1).browserType("1").customValue("[\"input\",\"text\",\"50\"]").showOrder(2).isrequired(0).isSystemDefault(0).build()); Map tabInfoMap = new HashMap<>(); tabInfoMap.put("columns", ExtendInfoBO.convertInfoListToTable(user, infoPOList, false, true)); - List jclOrgCustomTemplatePOS = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).listAll(); + List jclOrgCustomTemplatePOS = MapperProxyFactory.getProxy(JclOrgCustomTemplateMapper.class).listAllByCreator(user.getUID()); List isUsed = new ArrayList<>(); AtomicInteger index = new AtomicInteger(0); List> collect = jclOrgCustomTemplatePOS.stream().map(item -> { diff --git a/src/com/engine/organization/util/OrganizationFormItemUtil.java b/src/com/engine/organization/util/OrganizationFormItemUtil.java index 91697ee1..21e1b1e4 100644 --- a/src/com/engine/organization/util/OrganizationFormItemUtil.java +++ b/src/com/engine/organization/util/OrganizationFormItemUtil.java @@ -190,6 +190,10 @@ public class OrganizationFormItemUtil { CustomBrowserBean customBrowserBean = JSONObject.parseObject(s, CustomBrowserBean.class); customBrowserBean.setHasLeftTree(true); customBrowserBean.setLeftToSearchKey("treeKey"); + + Map map = new HashMap<>(2); + map.put("width",988); + customBrowserBean.setModalStyle(map); browser.setBrowserConditionParam(customBrowserBean); } return browser;