Compare commits
57 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
a77721403f | |
|
|
5da46ee91a | |
|
|
61840cf0cd | |
|
|
0b976934f2 | |
|
|
6d3ed2d9f8 | |
|
|
11419ab320 | |
|
|
dab7ce5729 | |
|
|
7cc38df2e9 | |
|
|
9cf8a7cdf0 | |
|
|
b0db84f231 | |
|
|
d2750025a5 | |
|
|
2fe6013af1 | |
|
|
722e1b8fe6 | |
|
|
4d4827a2c4 | |
|
|
b9c00d1e66 | |
|
|
6a5e6e5bec | |
|
|
80248b03d6 | |
|
|
289242d013 | |
|
|
47fb84d10d | |
|
|
d77e9d35d4 | |
|
|
5a2affb1a8 | |
|
|
d5a24e3bfb | |
|
|
421a70491a | |
|
|
1f532ebade | |
|
|
aff49d0bc9 | |
|
|
b9c9d1d65a | |
|
|
3a5c581241 | |
|
|
4beda57943 | |
|
|
280fe586db | |
|
|
76d9138191 | |
|
|
8de60788a7 | |
|
|
fdf4736e34 | |
|
|
cffa697c2f | |
|
|
77b2d12efd | |
|
|
58111e5be4 | |
|
|
918f2e2a6e | |
|
|
8a843480b6 | |
|
|
757b41f8c5 | |
|
|
a91bbf74ee | |
|
|
7595f6bc77 | |
|
|
aa0d573cc3 | |
|
|
14464744b8 | |
|
|
95d3dac14f | |
|
|
4fcbe238b4 | |
|
|
f254feb128 | |
|
|
5ed00c6a24 | |
|
|
d08192032c | |
|
|
4d2e8a8035 | |
|
|
ea5809ac15 | |
|
|
b572bc4d48 | |
|
|
e5f46a8083 | |
|
|
bb021a6f45 | |
|
|
6c973d86cd | |
|
|
1698f8c8d5 | |
|
|
e5a30525f0 | |
|
|
2d240460f1 | |
|
|
137273284e |
|
|
@ -25,6 +25,7 @@ import org.apache.commons.collections.CollectionUtils;
|
|||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.company.SubCompanyComInfo;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
@ -77,13 +78,14 @@ public class JobBrowserService extends BrowserService {
|
|||
Map<String, Object> apidatas = new HashMap<>();
|
||||
String q = Util.null2String(httpServletRequest.getParameter("q"));
|
||||
List<String> sqlParams = new ArrayList<>();
|
||||
SubCompanyComInfo subInfo = new SubCompanyComInfo();
|
||||
String keyword = "";
|
||||
if (q.length() > 0) {
|
||||
keyword = "%" + q + "%";
|
||||
}
|
||||
RecordSet rs = new RecordSet();
|
||||
String sqlwhere = " where t.delete_type = 0 ";
|
||||
String backfields = "t.id, t.job_no, h.jobtitlename as name ";
|
||||
String backfields = "t.id,t.ec_company, t.job_no, h.jobtitlename as name ";
|
||||
String fromSql = "FROM jcl_org_job t left join hrmjobtitles h on t.ec_jobTitle = h.id ";
|
||||
String orderby = " order by t.id ";
|
||||
sqlwhere += " ";
|
||||
|
|
@ -104,7 +106,8 @@ public class JobBrowserService extends BrowserService {
|
|||
Map<String, String> item = new HashMap<>(3);
|
||||
item.put("id", Util.null2String(rs.getString("id")));
|
||||
String name = Util.null2String(rs.getString("name"));
|
||||
item.put("name", name);
|
||||
String subCompanyname = subInfo.getSubCompanyname(Util.null2String(rs.getString("ec_company")));
|
||||
item.put("name", name+"("+subCompanyname+")");
|
||||
item.put("title", name);
|
||||
datas.add(item);
|
||||
}
|
||||
|
|
@ -234,7 +237,7 @@ public class JobBrowserService extends BrowserService {
|
|||
compList = MapperProxyFactory.getProxy(CompMapper.class).listParent();
|
||||
}
|
||||
// 获取顶层分部
|
||||
compList.stream().sorted(Comparator.comparing(item -> null == item.getShowOrder() ? 0 : item.getShowOrder())).forEach(item -> buildCompNodes(treeNodes, compHasSubs, item));
|
||||
compList.stream().sorted(Comparator.comparingDouble(item -> null == item.getShowOrder() ? 0 : item.getShowOrder())).forEach(item -> buildCompNodes(treeNodes, compHasSubs, item));
|
||||
} else if ("1".equals(params.getType())) {
|
||||
// 当前节点下的元素
|
||||
CompPO compBuild = CompPO.builder().supSubComId(Integer.parseInt(params.getId())).canceled(0).build();
|
||||
|
|
|
|||
|
|
@ -58,14 +58,6 @@ public class ChartPO {
|
|||
// 编制数
|
||||
private int staffNum;
|
||||
|
||||
//是否关键岗
|
||||
private Integer keyJob;
|
||||
|
||||
//bk人员
|
||||
private String bkPerson;
|
||||
|
||||
|
||||
|
||||
public String getId() {
|
||||
if (StringUtils.isNotBlank(ftype)) {
|
||||
switch (ftype) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.engine.organization.entity.chart;
|
||||
|
||||
import com.icbc.api.internal.apache.http.impl.cookie.S;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,10 @@ public class CompBO {
|
|||
}
|
||||
|
||||
public static List<SearchTree> buildSetToSearchTree(Set<CompPO> comps) {
|
||||
return comps.stream().sorted(Comparator.comparing(item -> null == item.getShowOrder() ? 0 : item.getShowOrder())).map(item -> {
|
||||
return comps.stream().sorted(Comparator
|
||||
.comparingDouble(CompPO::getShowOrder)
|
||||
.thenComparingDouble(CompPO::getShowOrderOfTree)
|
||||
).map(item -> {
|
||||
SearchTree tree = new SearchTree();
|
||||
tree.setCanClick(true);
|
||||
tree.setCanceled(item.getCanceled() != null && item.getCanceled() != 0);
|
||||
|
|
@ -37,6 +40,7 @@ public class CompBO {
|
|||
tree.setSelected(false);
|
||||
tree.setType("1");
|
||||
tree.setOrderNum(null == item.getShowOrder() ? 0 : item.getShowOrder());
|
||||
tree.setShowOrderOfTree(null == item.getShowOrderOfTree() ? 0 : item.getShowOrderOfTree());
|
||||
return tree;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class CompListDTO {
|
|||
|
||||
|
||||
@TableTitle(labelId = 547185, title = "显示顺序", dataIndex = "showOrder", key = "showOrder", sorter = true)
|
||||
private Integer showOrder;
|
||||
private Double showOrder;
|
||||
|
||||
/**
|
||||
* 禁用标记
|
||||
|
|
@ -78,8 +78,8 @@ public class CompListDTO {
|
|||
*/
|
||||
private List<CompListDTO> children;
|
||||
|
||||
public Integer getShowOrder() {
|
||||
return null == showOrder ? 0 : showOrder;
|
||||
public Double getShowOrder() {
|
||||
return null == showOrder ? 0.00 : showOrder;
|
||||
}
|
||||
|
||||
private String orderType;
|
||||
|
|
@ -89,9 +89,9 @@ public class CompListDTO {
|
|||
return children;
|
||||
}
|
||||
if ("asc".equalsIgnoreCase(orderType)) {
|
||||
return children.stream().sorted(Comparator.comparing(CompListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
return children.stream().sorted(Comparator.comparingDouble(CompListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
} else {
|
||||
return children.stream().sorted(Comparator.comparing(CompListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
return children.stream().sorted(Comparator.comparingDouble(CompListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ public class CompParam extends BaseQueryParam {
|
|||
private String outKey;
|
||||
private Integer limitUsers;
|
||||
private String uuid;
|
||||
private Integer showOrder;
|
||||
private Integer showOrderOfTree;
|
||||
private Double showOrder;
|
||||
private Double showOrderOfTree;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,20 @@ public class CompPO {
|
|||
private Date modified;
|
||||
private Integer modifier;
|
||||
private String uuid;
|
||||
private Integer showOrder;
|
||||
private Integer showOrderOfTree;
|
||||
private Double showOrder;
|
||||
private Double showOrderOfTree;
|
||||
|
||||
public Double getShowOrder() {
|
||||
if (null == showOrder) {
|
||||
return 0.00;
|
||||
}
|
||||
return showOrder;
|
||||
}
|
||||
|
||||
public Double getShowOrderOfTree() {
|
||||
if (null == showOrderOfTree) {
|
||||
return 0.00;
|
||||
}
|
||||
return showOrderOfTree;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,8 +171,9 @@ public class DepartmentBO {
|
|||
tree.setPid(null == item.getSupDepId() ? "0" : item.getSupDepId().toString());
|
||||
tree.setSelected(false);
|
||||
tree.setType("2");
|
||||
tree.setParentComp(null == item.getSupDepId() ? "0" : item.getSubCompanyId1().toString());
|
||||
tree.setOrderNum(null == item.getShowOrder() ? 0 : item.getShowOrder().intValue());
|
||||
tree.setParentComp(null == item.getSubCompanyId1() ? "0" : item.getSubCompanyId1().toString());
|
||||
tree.setOrderNum(null == item.getShowOrder() ? 0.00 : item.getShowOrder().intValue());
|
||||
tree.setShowOrderOfTree(null == item.getShowOrderOfTree() ? 0.00 : item.getShowOrderOfTree());
|
||||
return tree;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class DepartmentListDTO {
|
|||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableTitle(labelId = 547141, title = "名称", dataIndex = "departmentMark", key = "departmentMark", width = "200")
|
||||
@TableTitle(labelId = 547181, title = "简称", dataIndex = "departmentMark", key = "departmentMark", width = "200")
|
||||
private String departmentMark;
|
||||
|
||||
/**
|
||||
|
|
@ -48,7 +48,7 @@ public class DepartmentListDTO {
|
|||
/**
|
||||
* 简称
|
||||
*/
|
||||
@TableTitle(labelId = 547181, title = "简称", dataIndex = "departmentName", key = "departmentName")
|
||||
@TableTitle(labelId = 547141, title = "名称", dataIndex = "departmentName", key = "departmentName")
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
|
|
@ -105,9 +105,9 @@ public class DepartmentListDTO {
|
|||
return children;
|
||||
}
|
||||
if ("asc".equalsIgnoreCase(orderType)) {
|
||||
return children.stream().sorted(Comparator.comparing(DepartmentListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
return children.stream().sorted(Comparator.comparingDouble(DepartmentListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
} else {
|
||||
return children.stream().sorted(Comparator.comparing(DepartmentListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
return children.stream().sorted(Comparator.comparingDouble(DepartmentListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,5 +28,5 @@ public class DeptSearchParam extends BaseQueryParam {
|
|||
|
||||
private String uuid;
|
||||
private Double showOrder;
|
||||
private Integer showOrderOfTree;
|
||||
private Double showOrderOfTree;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,6 @@ public class DepartmentPO {
|
|||
private Integer modifier;
|
||||
private String uuid;
|
||||
private Double showOrder;
|
||||
private Integer showOrderOfTree;
|
||||
private Double showOrderOfTree;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class ResourcePO {
|
|||
private Integer jobtitle;
|
||||
|
||||
private String lastName;
|
||||
private Integer dspOrder;
|
||||
private Double dspOrder;
|
||||
|
||||
/**
|
||||
* 临时关联聚才林岗位ID
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import lombok.NoArgsConstructor;
|
|||
" left join HRMJOBTITLES t3 on t.JOBTITLE=t3.id" +
|
||||
" left join HRMJOBACTIVITIES t4 on t3.JOBACTIVITYID=t4.ID" +
|
||||
" left join HRMJOBGROUPS t5 on t4.JOBGROUPID=t5.ID ",
|
||||
orderby = " t.dsporder ",
|
||||
orderby = " t.dsporder",
|
||||
sortway = " asc",
|
||||
primarykey = "id",
|
||||
operates = {
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ public class JobBO {
|
|||
tree.setSelected(false);
|
||||
tree.setType("3");
|
||||
tree.setParentComp(null == item.getEcDepartment() ? "0" : item.getEcDepartment().toString());
|
||||
tree.setOrderNum(null == item.getShowOrder() ? 0 : item.getShowOrder());
|
||||
tree.setOrderNum(null == item.getShowOrder() ? 0.00 : item.getShowOrder());
|
||||
return tree;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
|
|
|
|||
|
|
@ -89,6 +89,8 @@ public class JobListDTO {
|
|||
//@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag")
|
||||
//private Integer forbiddenTag;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 操作列
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public class JobSearchParam extends BaseQueryParam {
|
|||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer showOrder;
|
||||
private Double showOrder;
|
||||
|
||||
private Integer subcompanyid1;
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public class JobPO {
|
|||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer showOrder;
|
||||
private Double showOrder;
|
||||
|
||||
private String gradeId;
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ public class SearchTree extends TreeNode {
|
|||
private boolean isCanceled;
|
||||
private String requestParams;
|
||||
private String parentComp;
|
||||
private Integer orderNum;
|
||||
private Double orderNum;
|
||||
private Double showOrderOfTree;
|
||||
|
||||
public String getCompanyid() {
|
||||
return companyid;
|
||||
|
|
@ -76,14 +77,28 @@ public class SearchTree extends TreeNode {
|
|||
this.parentComp = parentComp;
|
||||
}
|
||||
|
||||
public Integer getOrderNum() {
|
||||
public Double getOrderNum() {
|
||||
if(null==orderNum){
|
||||
return 0.00;
|
||||
}
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(Integer orderNum) {
|
||||
public void setOrderNum(Double orderNum) {
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
public Double getShowOrderOfTree() {
|
||||
if(null==showOrderOfTree){
|
||||
return 0.00;
|
||||
}
|
||||
return showOrderOfTree;
|
||||
}
|
||||
|
||||
public void setShowOrderOfTree(Double showOrderOfTree) {
|
||||
this.showOrderOfTree = showOrderOfTree;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.organization.enums;
|
||||
|
||||
import com.engine.organization.exception.OrganizationRunTimeException;
|
||||
import com.engine.organization.util.saveimport.JobInfoImportUtil;
|
||||
import com.engine.organization.util.saveimport.PostInfoImportUtil;
|
||||
import com.engine.organization.util.saveimport.SequenceImportUtil;
|
||||
import com.engine.organization.util.saveimport.StaffInfoImportUtil;
|
||||
|
|
@ -30,6 +31,22 @@ public enum OrgImportEnum implements OrgImportAdapter {
|
|||
return StaffInfoImportUtil.importForm(user);
|
||||
}
|
||||
},
|
||||
JOB("job") {
|
||||
@Override
|
||||
public Map<String, Object> orgImport(Map<String, Object> params, User user) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
String excelFile = (String) params.get("excelfile");
|
||||
resultMap.put("pId", JobInfoImportUtil.saveImport("add", excelFile, user));
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> orgForm(User user) {
|
||||
return JobInfoImportUtil.importForm(user);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
SEQUENCE("sequence"){
|
||||
@Override
|
||||
public Map<String, Object> orgImport(Map<String, Object> params, User user) {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
<result column="departmentCode" property="departmentCode"/>
|
||||
<result column="coadjutant" property="coadjutant"/>
|
||||
<result column="showOrder" property="showOrder"/>
|
||||
<result column="showOrderOfTree" property="showOrderOfTree"/>
|
||||
<result column="uuid" property="uuid"/>
|
||||
</resultMap>
|
||||
|
||||
|
|
@ -30,6 +31,7 @@
|
|||
t.departmentCode,
|
||||
t.coadjutant,
|
||||
t.showOrder,
|
||||
t.showOrderOfTree,
|
||||
t.uuid
|
||||
</sql>
|
||||
|
||||
|
|
@ -96,7 +98,7 @@
|
|||
<select id="listDeptsByIds" resultType="java.util.Map">
|
||||
select
|
||||
id as "id",
|
||||
departmentName as "name"
|
||||
departmentMark as "name"
|
||||
from hrmdepartment t
|
||||
WHERE id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@
|
|||
groupid,
|
||||
#{scopeId} as scopeId,
|
||||
'hrm' as tablename
|
||||
FROM hrm_formfield) hrmallfield
|
||||
FROM hrm_formfield where isuse = 1) hrmallfield
|
||||
WHERE FIELDHTMLTYPE != '6' and groupid IN (SELECT id FROM hrm_fieldgroup WHERE grouptype = #{scopeId})
|
||||
ORDER BY hrmallfield.groupid, hrmallfield.fieldorder
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ public interface JobMapper {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
Integer getMaxShowOrder();
|
||||
Double getMaxShowOrder();
|
||||
|
||||
/**
|
||||
* 根据名字和上级查询岗位信息
|
||||
|
|
@ -141,13 +141,15 @@ public interface JobMapper {
|
|||
* @param parentJob
|
||||
* @return
|
||||
*/
|
||||
Long getIdByNameAndPid(@Param("jobName") String jobName, @Param("parentCompany") Integer parentCompany, @Param("parentDepartment") Integer parentDepartment, @Param("parentJob") Long parentJob,
|
||||
List<JobPO> 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<Long> ids, @Param("parentCompany") Integer parentCompany, @Param("ecCompany") Integer ecCompany);
|
||||
|
||||
int selectByConditions(@Param("resourcePO") ResourcePO resourcePO);
|
||||
|
||||
int selectByE9(@Param("jobTitleName") String jobTitleName,@Param("jobactivitymark") String jobactivitymark,@Param("jobgroupremark") String jobgroupremark);
|
||||
|
||||
List<String> listUsedId();
|
||||
|
||||
List<String> isAllowDelete(@Param("jobId") Long jobId);
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@
|
|||
and t.forbidden_tag = #{jobPO.forbiddenTag}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getMaxShowOrder" resultType="java.lang.Integer">
|
||||
<select id="getMaxShowOrder" resultType="java.lang.Double">
|
||||
select max(show_order)
|
||||
from jcl_org_job
|
||||
</select>
|
||||
|
|
@ -482,8 +482,20 @@
|
|||
and delete_type = 0
|
||||
</select>
|
||||
|
||||
<select id="getIdByNameAndPid" resultType="java.lang.Long">
|
||||
select t.id from jcl_org_job t
|
||||
|
||||
<select id="selectByE9" resultType="java.lang.Integer">
|
||||
select h.id from hrmjobtitles h
|
||||
left join hrmjobactivities j on h.jobactivityid = j.id
|
||||
left join hrmjobgroups f on j.jobgroupid = f.id
|
||||
where j.jobactivitymark = #{jobactivitymark}
|
||||
and f.jobgroupremark = #{jobgroupremark}
|
||||
and h.JOBTITLENAME = #{jobTitleName}
|
||||
</select>
|
||||
|
||||
<select id="getIdByNameAndPid" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_job t
|
||||
left join hrmjobtitles h on t.ec_jobTitle = h.id
|
||||
left join hrmjobactivities j on h.jobactivityid = j.id
|
||||
left join hrmjobgroups f on j.jobgroupid = f.id
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<select id="selectFilterDatas" resultType="com.engine.organization.entity.hrmresource.po.ResourcePO">
|
||||
select distinct a.subcompanyid1, a.departmentid, a.jobtitle
|
||||
from hrmresource a
|
||||
where a.status < 4
|
||||
where a.status < 4 and a.seclevel >= 0
|
||||
and not exists
|
||||
(select 1
|
||||
from jcl_org_job b
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ public interface ChartService {
|
|||
* @param: []
|
||||
* @return: java.util.Map<java.lang.Integer,com.engine.organization.entity.chart.HrmLabelVO>
|
||||
*/
|
||||
Map<Integer, HrmLabelVO> selectLabel();
|
||||
Map<String, HrmLabelVO> selectLabel();
|
||||
|
||||
/**
|
||||
* @Description: 历史版本删除
|
||||
|
|
|
|||
|
|
@ -60,8 +60,9 @@ public class CardAccessServiceImpl extends Service implements CardAccessService
|
|||
@Override
|
||||
public Map<String, Object> hasRight() {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
boolean hasRight = HasRightUtil.hasRight(user, RIGHT_NAME, true);
|
||||
resultMap.put("hasRight", hasRight);
|
||||
//boolean hasRight = HasRightUtil.hasRight(user, RIGHT_NAME, true);
|
||||
//脚本未找到该菜单 放开所有
|
||||
resultMap.put("hasRight", true);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -218,7 +218,6 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
return result;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public Map<String, Object> getDepartmentDetail(Map<String, Object> params) {
|
||||
String rootId = Util.null2String(params.get("rootId"));
|
||||
|
|
@ -304,7 +303,7 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
// 查询部门下的岗位
|
||||
if (isRealTime) {
|
||||
String subcompanyid1 = new DepartmentComInfo().getSubcompanyid1(departmentId);
|
||||
sql = "select a.id,a.jobtitlename as name,b.bkhrm,b.is_key from hrmjobtitles a inner join jcl_org_job b on a.id = b.ec_jobtitle and (b.delete_type is null or b.delete_type = 0) where b.ec_department = '" + departmentId + "' and b.ec_company='" + subcompanyid1 + "'";
|
||||
sql = "select a.id,a.jobtitlename as name from hrmjobtitles a inner join jcl_org_job b on a.id = b.ec_jobtitle and (b.delete_type is null or b.delete_type = 0) where b.ec_department = '" + departmentId + "' and b.ec_company='" + subcompanyid1 + "'";
|
||||
} else {
|
||||
rs.executeQuery("select subcompanyid from jcl_chart_department where departmentid = '" + departmentId + "' and versionid = " + versionId);
|
||||
rs.next();
|
||||
|
|
@ -312,9 +311,6 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
sql = "select jobid as id ,jobname as name from jcl_chart_job where departmentid = '" + departmentId + "' and subcompanyid = '" + subcompanyid + "' and versionid = " + versionId;
|
||||
}
|
||||
rs.executeQuery(sql);
|
||||
|
||||
ResourceComInfo rc = new ResourceComInfo();
|
||||
|
||||
while (rs.next()) {
|
||||
ChartPO chartPO = new ChartPO();
|
||||
chartPO.setFtype("3");
|
||||
|
|
@ -325,11 +321,6 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
chartPO.setParentId(rootId);
|
||||
chartPO.setExpand("1");
|
||||
chartPO.setHasChildren("1");
|
||||
if (isRealTime) {
|
||||
chartPO.setKeyJob(Util.getIntValue(rs.getString("is_key")));
|
||||
chartPO.setBkPerson(rc.getLastname(Util.null2String(rs.getString("bkhrm"))));
|
||||
}
|
||||
|
||||
jobTitleList.add(chartPO);
|
||||
}
|
||||
|
||||
|
|
@ -724,9 +715,9 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<Integer, HrmLabelVO> selectLabel() {
|
||||
public Map<String, HrmLabelVO> selectLabel() {
|
||||
RecordSet rs = new RecordSet();
|
||||
Map<Integer, HrmLabelVO> labelData = new HashMap<>();
|
||||
Map<String, HrmLabelVO> labelData = new HashMap<>();
|
||||
//labelId集合
|
||||
List<Integer> labelIds = Arrays.asList(547190,547194,547196,547262,547282,547283,547284,547285,547286,547287,547292,547293,547294,547296,547298,547299,547300,547301,547302,547303,547304,547305,547307,547310,547313,547314,547315,547316,547317,
|
||||
547318,547319,547320,547321,547322,547323,547324,547326,547327,547328,547329,547330,547331,547332,547333,547334,547345,547346,547447,547448,547468,547473,547475,547476,547477,547478,547478,547264,547265,547463,547464,547465,
|
||||
|
|
@ -735,7 +726,7 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
labelIds.forEach(item -> {
|
||||
rs.executeQuery("select labelName from HtmlLabelInfo where indexid = ? and languageid = ?",item,user.getLanguage());
|
||||
if (rs.next()){
|
||||
labelData.put(item,HrmLabelVO.builder().labelName(Util.null2String(rs.getString("labelName"))).build());
|
||||
labelData.put(Util.null2String(item),HrmLabelVO.builder().labelName(Util.null2String(rs.getString("labelName"))).build());
|
||||
}
|
||||
|
||||
});
|
||||
|
|
@ -1016,7 +1007,7 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
" left join JCL_ORG_ONJOB d on a.id=d.data_id and d.type=1 ";
|
||||
deptQuerySql = "select a.id as departmentid, a.departmentmark, a.departmentname, a.subcompanyid1 as subcompanyid, " +
|
||||
"b.SUBCOMPANYNAME as subcompany,a.supdepid as supdepartmentid,c.departmentname as supdepartment," +
|
||||
"a.canceled,a.departmentcode,a.coadjutant,a.tlevel,d.bmlx as isvirtual,a.bmfzr as fleader,e.on_job_num,e.staff_num " +
|
||||
"a.canceled,a.departmentcode,a.coadjutant,a.tlevel,d.bmlx as isvirtual,d.bmfzr as fleader,e.on_job_num,e.staff_num " +
|
||||
"from hrmdepartment a left join hrmsubcompany b on a.subcompanyid1 = b.id " +
|
||||
"left join hrmdepartment c on a.supdepid = c.id " +
|
||||
"left join hrmdepartmentdefined d on a.id=d.deptid " +
|
||||
|
|
@ -1049,12 +1040,13 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
" a.departmentcode,\n" +
|
||||
" a.coadjutant,\n" +
|
||||
" a.tlevel,\n" +
|
||||
" a.bmfzr as fleader,\n" +
|
||||
" e.bmfzr as fleader,\n" +
|
||||
" d.on_job_num,\n" +
|
||||
" d.staff_num" +
|
||||
" from hrmdepartment a\n" +
|
||||
" left join hrmsubcompany b on a.subcompanyid1 = b.id\n" +
|
||||
" left join hrmdepartment c on a.supdepid = c.id\n" +
|
||||
" left join hrmdepartmentdefined e on a.id=e.deptid\n" +
|
||||
" left join JCL_ORG_ONJOB d on a.id=d.data_id and d.type=2 ";
|
||||
}
|
||||
|
||||
|
|
@ -1680,9 +1672,6 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
* @return 人员名称
|
||||
*/
|
||||
private String getDepartmentLeader(String ids) {
|
||||
if (!isRealTime) {
|
||||
return ids;
|
||||
}
|
||||
if (StringUtils.isBlank(ids)) {
|
||||
return "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,10 +85,10 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
// 添加父级元素
|
||||
List<CompListDTO> compListDTOS = CompBO.buildCompDTOList(allList, filterCompPOs, orderType.toString());
|
||||
if ("asc".equalsIgnoreCase(orderType.toString())) {
|
||||
compListDTOS = compListDTOS.stream().sorted(Comparator.comparing(CompListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
compListDTOS = compListDTOS.stream().sorted(Comparator.comparingDouble(CompListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
|
||||
} else {
|
||||
compListDTOS = compListDTOS.stream().sorted(Comparator.comparing(CompListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
compListDTOS = compListDTOS.stream().sorted(Comparator.comparingDouble(CompListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
}
|
||||
List<CompListDTO> subList = PageUtil.subList(params.getCurrent(), params.getPageSize(), compListDTOS);
|
||||
pageInfos = new PageInfo<>(user, subList, CompListDTO.class);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class ConfigServiceImpl extends Service implements ConfigService {
|
|||
public String ssoLogin(QTXConfigParam qtx) throws UnsupportedEncodingException {
|
||||
String hkUrl;
|
||||
BaseBean bb = new BaseBean();
|
||||
String enable = bb.getPropValue("qtx_sso_login", "enable");
|
||||
String enable = bb.getPropValue("hrmOrganization", "enable");
|
||||
String userAgent = qtx.getUserAgent();
|
||||
boolean termianal = MobileTerminalEnum.containsEnumValue(userAgent);
|
||||
if (VALUE_ONE.equals(enable)) {
|
||||
|
|
@ -83,7 +83,7 @@ public class ConfigServiceImpl extends Service implements ConfigService {
|
|||
if (Objects.nonNull(qtxConfigPO)) {
|
||||
BeanUtils.copyProperties(datas, qtxConfigPO);
|
||||
}
|
||||
map.put("isopenconfig",bb.getPropValue("qtx_sso_login","enable"));
|
||||
map.put("isopenconfig",bb.getPropValue("hrmOrganization","enable"));
|
||||
map.put("columns",columns);
|
||||
map.put("datas", Collections.singletonList(datas));
|
||||
return map;
|
||||
|
|
@ -93,7 +93,7 @@ public class ConfigServiceImpl extends Service implements ConfigService {
|
|||
@Override
|
||||
public int saveConfigInfo(QTXConfigPO qtxConfigPO, String isopenconfig) {
|
||||
ConfigOperator ConfigOperator = new ConfigOperator();
|
||||
ConfigOperator.setProp("qtx_sso_login.properties", "enable", isopenconfig);
|
||||
ConfigOperator.setProp("hrmOrganization.properties", "enable", isopenconfig);
|
||||
qtxConfigPO.setCreator(user.getUID());
|
||||
qtxConfigPO.setCreateDate(OrganizationDateUtil.getFormatLocalDate(LocalDate.now()));
|
||||
getConfigMapper().deleteAll();
|
||||
|
|
|
|||
|
|
@ -134,10 +134,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
// 添加父级元素
|
||||
List<DepartmentListDTO> compListDTOS = DepartmentBO.buildDeptDTOList(allList, filterDeptPOs, orderType.toString());
|
||||
if ("asc".equalsIgnoreCase(orderType.toString())) {
|
||||
compListDTOS = compListDTOS.stream().sorted(Comparator.comparing(DepartmentListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
compListDTOS = compListDTOS.stream().sorted(Comparator.comparingDouble(DepartmentListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
|
||||
} else {
|
||||
compListDTOS = compListDTOS.stream().sorted(Comparator.comparing(DepartmentListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
compListDTOS = compListDTOS.stream().sorted(Comparator.comparingDouble(DepartmentListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
}
|
||||
List<DepartmentListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), compListDTOS);
|
||||
pageInfos = new PageInfo<>(user, DepartmentBO.buildDeptDTOShowNames(subList), DepartmentListDTO.class);
|
||||
|
|
|
|||
|
|
@ -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<String> columnList = Arrays.asList(columns.split(","));
|
||||
String propValue = new BaseBean().getPropValue("hrmOrganization", "orgId");
|
||||
Map<String, WeaTableColumn> 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字段,跳转人员卡片
|
||||
|
|
|
|||
|
|
@ -81,13 +81,14 @@ public class FunctionOutStaffServiceImpl {
|
|||
OrganizationAssert.isFalse(staffPO.getFreezeNum() == 0, SystemEnv.getHtmlLabelName(547949,user.getLanguage()));
|
||||
}
|
||||
|
||||
List<Integer> numberF = Arrays.asList(staffPO.getFreezeNum(),param.getNum(),staffPO.getPermanentNum());
|
||||
List<Integer> numberF = Arrays.asList(staffPO.getFreezeNum(),param.getNum());
|
||||
//1.增加冻结数 (num为负数时为减少冻结数)
|
||||
Integer sum = numberF.stream()
|
||||
.mapToInt(Integer::intValue)
|
||||
.sum();
|
||||
Integer sums = sum + staffPO.getPermanentNum();
|
||||
if (staffPO.getControlPolicy().equals(HARDCONTROLLER)) {
|
||||
OrganizationAssert.isFalse(sum.compareTo(staffPO.getStaffNum()) > 0, SystemEnv.getHtmlLabelName(547469,user.getLanguage()));
|
||||
OrganizationAssert.isFalse(sums.compareTo(staffPO.getStaffNum()) > 0, SystemEnv.getHtmlLabelName(547469,user.getLanguage()));
|
||||
}
|
||||
staffPO.setFreezeNum(sum);
|
||||
buildStaffPO(staffPO);
|
||||
|
|
@ -233,7 +234,6 @@ public class FunctionOutStaffServiceImpl {
|
|||
bb.writeLog("编制参数"+ JSON.toJSONString(param));
|
||||
bb.writeLog("查询结果"+ JSON.toJSONString(staffPO));
|
||||
bb.writeLog("user对象"+JSON.toJSONString(user));
|
||||
bb.writeLog("msg"+SystemEnv.getHtmlLabelName(547474,user.getLanguage()));
|
||||
OrganizationAssert.notEmpty(staffPO,SystemEnv.getHtmlLabelName(547474,user.getLanguage()));
|
||||
return staffPO.get(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -64,7 +63,10 @@ import weaver.general.BaseBean;
|
|||
import weaver.general.StringUtil;
|
||||
import weaver.general.TimeUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.company.DepartmentComInfo;
|
||||
import weaver.hrm.company.SubCompanyComInfo;
|
||||
import weaver.hrm.definedfield.HrmFieldManager;
|
||||
import weaver.hrm.privacy.PrivacyComInfo;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -187,25 +189,40 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
|
||||
}
|
||||
List<SearchConditionItem> items = filterByDomkey(all, columnList);
|
||||
List<String> privacyList = Arrays.asList("-1_hrm_mobile","-1_hrm_telephone","-1_hrm_mobilecall","-1_hrm_fax","-1_hrm_email");
|
||||
for (SearchConditionItem item : items) {
|
||||
String columnName = item.getDomkey()[0];
|
||||
WeaTableColumn weaTableColumn = new WeaTableColumn();
|
||||
|
||||
if (columnName.equals("-1_cus_"+propValue)){
|
||||
weaTableColumn.setOtherpara(columnName);
|
||||
fields.add("t.id as " + buildTableSql(columnName).replace(".", "_"));
|
||||
weaTableColumn.setTransmethod("com.engine.organization.transmethod.HrmResourceTransMethod.getOrgValue");
|
||||
}else if(privacyList.contains(columnName)) {
|
||||
fields.add(buildTableSql(columnName) + " as " + buildTableSql(columnName).replace(".", "_"));
|
||||
PrivacyComInfo pc = new PrivacyComInfo();
|
||||
Map<String, String> mapShowSets = pc.getMapShowSets();
|
||||
String[] parts = columnName.split("_");
|
||||
String fieldName = parts[parts.length - 1];
|
||||
if (mapShowSets != null && mapShowSets.get("mobile") != null) {
|
||||
weaTableColumn.setOtherpara("column:id+" + user.getUID() + "+"+fieldName+"");
|
||||
weaTableColumn.setTransmethod("weaver.hrm.privacy.PrivacyComInfo.getSearchContent");
|
||||
}else {
|
||||
weaTableColumn.setOtherpara(fieldName+":"+user.getLanguage());
|
||||
weaTableColumn.setTransmethod("weaver.hrm.HrmTransMethod.getDefineContent");
|
||||
}
|
||||
|
||||
}else{
|
||||
} else{
|
||||
weaTableColumn.setOtherpara(columnName);
|
||||
fields.add(buildTableSql(columnName) + " as " + buildTableSql(columnName).replace(".", "_"));
|
||||
weaTableColumn.setTransmethod("com.engine.organization.transmethod.HrmResourceTransMethod.getFieldTrueValue");
|
||||
}
|
||||
|
||||
String scopeId = columnName.split("_")[0];
|
||||
String fieldName = columnName.substring(columnName.lastIndexOf("_") + 1);
|
||||
|
||||
weaTableColumn.setText(getHrmResourceMapper().queryLabelName(fieldName, scopeId, user.getLanguage()));
|
||||
weaTableColumn.setColumn(buildTableSql(columnName).replace(".", "_"));
|
||||
weaTableColumn.setOtherpara(columnName);
|
||||
|
||||
weaTableColumn.setDisplay(columnList.contains(columnName) ? WeaBoolAttr.TRUE : WeaBoolAttr.FALSE);
|
||||
weaTableColumn.setWidth(decimal.setScale(2, RoundingMode.HALF_UP).doubleValue() + "%");
|
||||
weaTableColumnList.add(weaTableColumn);
|
||||
|
|
@ -216,6 +233,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
weaTableColumn.setColumn("id");
|
||||
weaTableColumn.setDisplay(WeaBoolAttr.FALSE);
|
||||
|
||||
|
||||
weaTableColumnList.add(weaTableColumn);
|
||||
fields.add("t.id");
|
||||
table.setBackfields(StringUtils.join(fields, ","));
|
||||
|
|
@ -307,7 +325,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
List<String> 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);
|
||||
|
|
@ -603,7 +622,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
}
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionGroup> allConditions = getAllConditions();
|
||||
List<SearchConditionGroup> allConditions = getAllConditions(true);
|
||||
// 穿梭框ID,展示所选字段信息
|
||||
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
||||
if ("-1".equals(templateId)) {
|
||||
|
|
@ -643,6 +662,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
btnDatas.put("rightMenu", rightMenuList);
|
||||
btnDatas.put("hasRight", true);
|
||||
btnDatas.put("loginId", user.getUID());
|
||||
btnDatas.put("cardType", new BaseBean().getPropValue("hrmOrganization", "cardType"));
|
||||
//获取当前用户使用的列定制模板Id
|
||||
btnDatas.put("customTemplateId", getCustomTemplateId());
|
||||
btnDatas.put("searchTemplateId", getSearchTemplateId());
|
||||
|
|
@ -785,13 +805,25 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, conditionItems);
|
||||
Map<String, SearchConditionItem> allFieldsMap = conditionItems.stream().collect(Collectors.toMap(item -> item.getDomkey()[0], item -> item, (k1, k2) -> k1));
|
||||
boolean isQuickSearch = "true".equals(Util.null2String(params.get("isQuickSearch")));
|
||||
DepartmentComInfo deptInfo = new DepartmentComInfo();
|
||||
SubCompanyComInfo subInfo = new SubCompanyComInfo();
|
||||
|
||||
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||||
StringBuilder sb = new StringBuilder(" where 1=1 ");
|
||||
// 默认去除外部人员显示
|
||||
sb.append( " and t.seclevel >= 0 ");
|
||||
|
||||
if (params.containsKey("lastName") || !params.containsKey("-1_hrm_status")) {
|
||||
// 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<String, Object> entry : params.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
String value = Util.null2String(entry.getValue());
|
||||
|
|
@ -802,10 +834,18 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
sb.append(" and t.lastname ").append(dbType.like(value));
|
||||
}
|
||||
if ("companyId".equals(key)) {
|
||||
sb.append(" and t.subcompanyid1 ='").append(value).append("'");
|
||||
ArrayList<Integer> list = new ArrayList<>();
|
||||
list.add(Integer.parseInt(value));
|
||||
subInfo.getSubCompanyLists(value,list);
|
||||
String allSub = StringUtils.join(list,",");
|
||||
sb.append(" and t.subcompanyid1 in(").append(allSub).append(")");
|
||||
}
|
||||
if ("departmentId".equals(key)) {
|
||||
sb.append(" and t.departmentId ='").append(value).append("'");
|
||||
ArrayList<Integer> list = new ArrayList<>();
|
||||
list.add(Integer.parseInt(value));
|
||||
deptInfo.getAllChildDeptByDepId(list,value);
|
||||
String allDept = StringUtils.join(list,",");
|
||||
sb.append(" and t.departmentId in (").append(allDept).append(")");
|
||||
}
|
||||
if ("jobTitle".equals(key)) {
|
||||
JobPO jobById = getJobMapper().getJobById(Long.parseLong(value));
|
||||
|
|
@ -994,12 +1034,15 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
}
|
||||
|
||||
|
||||
public List<SearchConditionGroup> getAllConditions() {
|
||||
return getAllConditions(false);
|
||||
}
|
||||
/**
|
||||
* 获取所有搜索字段信息构建的高级搜索表单
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<SearchConditionGroup> getAllConditions() {
|
||||
public List<SearchConditionGroup> getAllConditions(boolean isSearch) {
|
||||
HrmFieldSearchConditionComInfo hrmFieldSearchConditionComInfo = new HrmFieldSearchConditionComInfo();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> basicConditionItems = new ArrayList<>();
|
||||
|
|
@ -1010,6 +1053,8 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
List<CusFormFieldPO> hrmFieldsByScopeId = getSystemDataMapper().getHrmFieldsByScopeId(HrmGroupEnum.HRM_BASIC.getGroupType().toString());
|
||||
createConditionItems(hrmFieldSearchConditionComInfo, hrmFieldsByScopeId, basicConditionItems);
|
||||
if (CollectionUtils.isNotEmpty(basicConditionItems)) {
|
||||
SearchConditionItem searchConditionItem = buildSubCompanyCondition(hrmFieldSearchConditionComInfo,isSearch);
|
||||
basicConditionItems.add(0,searchConditionItem);
|
||||
addGroups.add(new SearchConditionGroup(SystemEnv.getHtmlLabelName(547175, user.getLanguage()), true, basicConditionItems));
|
||||
}
|
||||
|
||||
|
|
@ -1029,6 +1074,34 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
return addGroups;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 花名册构建
|
||||
*
|
||||
* @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("-2458");
|
||||
hrmFieldBean.setFieldhtmltype("3");
|
||||
if (isSearch) {
|
||||
hrmFieldBean.setType("170");
|
||||
} else {
|
||||
hrmFieldBean.setType("164");
|
||||
}
|
||||
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 +1154,37 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
HrmFieldManager hfm = new HrmFieldManager("HrmCustomFieldByInfoType", scopeid);
|
||||
List<SearchConditionItem> 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,true);
|
||||
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)) {
|
||||
|
|
@ -1235,7 +1313,7 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
|
||||
case BROWSER://浏览按钮
|
||||
// 兼容多选浏览按钮
|
||||
sb.append(" and ").append(dbType.concat(tableSql)).append(dbType.like(value));
|
||||
sb.append(" and ").append(dbType.concat(tableSql)).append(dbType.like("," + value + ","));
|
||||
break;
|
||||
|
||||
case INPUTNUMBER:// 数字
|
||||
|
|
|
|||
|
|
@ -164,10 +164,10 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
// 添加父级元素
|
||||
List<JobListDTO> jobListDTOS = JobBO.buildJobDTOList(allList, filterJobPOs);
|
||||
if ("asc".equalsIgnoreCase(orderType.toString())) {
|
||||
jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparing(JobListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparingDouble(JobListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
|
||||
} else {
|
||||
jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparing(JobListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparingDouble(JobListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
}
|
||||
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS);
|
||||
pageInfos = new PageInfo<>(user, subList, JobListDTO.class);
|
||||
|
|
@ -207,6 +207,9 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
// 批量删除
|
||||
topMenuList.add(MenuBtn.topMenu_batchDelete(userLanguage));
|
||||
topMenuList.add(MenuBtn.builder().isBatch("0").isTop("1").menuFun("refresh").menuIcon("icon-coms-Refresh").menuName(SystemEnv.getHtmlLabelName(547432,userLanguage)).type("BTN_REFRESH").build());
|
||||
// 批量导入
|
||||
topMenuList.add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("batchImport").menuIcon("icon-coms-leading-in").menuName(SystemEnv.getHtmlLabelName(547242,user.getLanguage())).type("BTN_BatchImport").build());
|
||||
|
||||
topMenuList.add(MenuBtn.topMenu_addNew(userLanguage));
|
||||
btnDatas.put("topMenu", topMenuList);
|
||||
// 日志
|
||||
|
|
@ -367,9 +370,9 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
}
|
||||
|
||||
if (StringUtils.isBlank(params.get("show_order").toString())) {
|
||||
Integer maxShowOrder = getJobMapper().getMaxShowOrder();
|
||||
Double maxShowOrder = getJobMapper().getMaxShowOrder();
|
||||
if (null == maxShowOrder) {
|
||||
maxShowOrder = 0;
|
||||
maxShowOrder = 0.00;
|
||||
}
|
||||
params.put("show_order", maxShowOrder + 1);
|
||||
}
|
||||
|
|
@ -380,7 +383,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
|
||||
String jobNo = (String) params.get("job_no");
|
||||
// 判断是否开启自动编号
|
||||
jobNo = repeatDetermine(jobNo);
|
||||
jobNo = repeatDetermine(jobNo,searchParam.getEcJobTitle(),searchParam.getEcDepartment());
|
||||
params.put("job_no", jobNo);
|
||||
return getExtService(user).updateExtForm(user, EXTEND_TYPE, JCL_ORG_JOB, params, "", null);
|
||||
}
|
||||
|
|
@ -401,7 +404,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
String oldJobNo = oldJobPO.getJobNo();
|
||||
String jobNo = searchParam.getJobNo();
|
||||
if (!jobNo.equals(oldJobNo)) {
|
||||
jobNo = repeatDetermine(jobNo);
|
||||
jobNo = repeatDetermine(jobNo,searchParam.getEcJobTitle(),searchParam.getEcDepartment());
|
||||
params.put("job_no", jobNo);
|
||||
}
|
||||
|
||||
|
|
@ -433,8 +436,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
OrganizationAssert.notBlank(department, SystemEnv.getHtmlLabelName(547423,user.getLanguage()));
|
||||
int insertCount = 0;
|
||||
List<Long> idList = Arrays.stream(ids.split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
Integer orderNum = getJobMapper().getMaxShowOrder();
|
||||
orderNum = null == orderNum ? 0 : orderNum;
|
||||
Double orderNum = getJobMapper().getMaxShowOrder();
|
||||
orderNum = null == orderNum ? 0.00 : orderNum;
|
||||
for (Long id : idList) {
|
||||
orderNum++;
|
||||
JobPO jobById = getJobMapper().getJobById(id);
|
||||
|
|
@ -739,7 +742,8 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
public String repeatDetermine(String jobNo) {
|
||||
public String repeatDetermine(String jobNo,Integer jobTitle,Integer departmentId) {
|
||||
JobTitlesComInfo jb = new JobTitlesComInfo();
|
||||
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.JOBTITLES.getValue());
|
||||
if (StringUtils.isNotBlank(jobNo)) {
|
||||
jobNo = CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobNo);
|
||||
|
|
@ -748,7 +752,11 @@ 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()));
|
||||
jobNo = autoCreateCompanyNo();
|
||||
//jobNo = autoCreateCompanyNo();
|
||||
String jobTitlescode = jb.getJobTitlescode(String.valueOf(jobTitle));
|
||||
if (!"".equals(jobTitlescode)) {
|
||||
jobNo = jobTitlescode+"-"+departmentId;
|
||||
}
|
||||
}
|
||||
return jobNo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@ import org.apache.commons.collections.CollectionUtils;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.cachecenter.bean.RolemembersComInfo;
|
||||
import weaver.hrm.resource.ResourceComInfo;
|
||||
import weaver.hrm.roles.RolesComInfo;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
|
|
@ -233,7 +231,7 @@ public class ManagerDetachServiceImpl extends Service implements ManagerDetachSe
|
|||
}
|
||||
String ecRolelevel = (String) params.get("ecRolelevel");
|
||||
if (StringUtils.isNotBlank(ecRolelevel)) {
|
||||
sqlWhere += " AND " + dbType.concat("ec_rolelevel") + dbType.like(ecRolelevel);
|
||||
sqlWhere += " AND " + dbType.concat("ec_rolelevel") + dbType.like("," + ecRolelevel + ",");
|
||||
}
|
||||
return sqlWhere;
|
||||
}
|
||||
|
|
@ -247,9 +245,9 @@ public class ManagerDetachServiceImpl extends Service implements ManagerDetachSe
|
|||
*/
|
||||
public static List<Integer> getJclRoleLevels(Integer uId) {
|
||||
List<Integer> ecRoleLevels = new ArrayList<>();
|
||||
ManagerDetachMapper mangeDetachMapper = MapperProxyFactory.getProxy(ManagerDetachMapper.class);
|
||||
// ManagerDetachMapper mangeDetachMapper = MapperProxyFactory.getProxy(ManagerDetachMapper.class);
|
||||
//人员
|
||||
List<ManagerDetachPO> detachListById = new ArrayList<>(mangeDetachMapper.getDetachListById(uId,0));
|
||||
List<ManagerDetachPO> detachListById = new ArrayList<>(MapperProxyFactory.getProxy(ManagerDetachMapper.class).getDetachListById(uId,0));
|
||||
//角色
|
||||
HrmCommonService hrmCommonService = new HrmCommonServiceImpl();
|
||||
List<String> roleIds = new ArrayList<>(Arrays.asList(hrmCommonService.getRoleIds(uId).split(",")));
|
||||
|
|
|
|||
|
|
@ -611,9 +611,15 @@ public class OrgChartServiceImpl extends Service implements OrgChartService {
|
|||
Map<String, Object> datas = new HashMap<>();
|
||||
RecordSet rs = new RecordSet();
|
||||
String fclass = Util.null2String(params.get("fclass"));
|
||||
String timeName = Util.null2String(params.get("timeName"));
|
||||
List<TimeLinesBO> timeLinesBOList = new ArrayList<>();
|
||||
timeLinesBOList.add(TimeLinesBO.builder().key(0).id(0).title("当前版本").color("blue").time("").build());
|
||||
rs.executeQuery("SELECT id,recorddate,description from JCL_ORG_CHARTVERSION where fclass = ? and deletetype = ? order by id desc", fclass, 0);
|
||||
String sql = "SELECT id,recorddate,description from JCL_ORG_CHARTVERSION where fclass = ? and deletetype = ?";
|
||||
if (StringUtils.isNotEmpty(timeName)) {
|
||||
sql += " and description like '%"+timeName+"%'";
|
||||
}
|
||||
sql += " order by id desc";
|
||||
rs.executeQuery(sql, fclass, 0);
|
||||
while (rs.next()) {
|
||||
timeLinesBOList.add(TimeLinesBO.builder()
|
||||
.key(rs.getInt("id"))
|
||||
|
|
|
|||
|
|
@ -845,7 +845,7 @@ public class PersonnelResumeServiceImpl extends Service implements PersonnelResu
|
|||
jobPO.setDescription(description);
|
||||
jobPO.setWorkDuty(work_duty);
|
||||
jobPO.setWorkAuthority(work_authority);
|
||||
jobPO.setShowOrder(StringUtils.isBlank(show_order) ? null : Integer.parseInt(show_order));
|
||||
jobPO.setShowOrder(StringUtils.isBlank(show_order) ? null : Double.parseDouble(show_order));
|
||||
jobPO.setForbiddenTag(StringUtils.isBlank(forbidden_tag) ? null : Integer.parseInt(forbidden_tag));
|
||||
jobPO.setGradeId(grade_id);
|
||||
jobPO.setLevelId(level_id);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -25,7 +25,11 @@ public class DetachUtil {
|
|||
private final List<Integer> jclRoleLevels;
|
||||
|
||||
public DetachUtil(User user) {
|
||||
if (1 == user.getUID() || user.isAdmin()) {
|
||||
// if (1 == user.getUID() || user.isAdmin()) {
|
||||
// DETACH = false;
|
||||
// }
|
||||
//分权管理员支持分权
|
||||
if (1 == user.getUID()) {
|
||||
DETACH = false;
|
||||
}
|
||||
if (DETACH) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,268 @@
|
|||
package com.engine.organization.util.saveimport;
|
||||
|
||||
|
||||
import com.engine.organization.entity.extend.po.ExtendInfoPO;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourcePO;
|
||||
import com.engine.organization.entity.jclimport.po.JclImportHistoryDetailPO;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFCell;
|
||||
import org.apache.poi.xssf.usermodel.XSSFRow;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.job.JobTitlesComInfo;
|
||||
import weaver.systeminfo.SystemEnv;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/09/15
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class JobInfoImportUtil {
|
||||
static Map<String, ExtendInfoPO> importFieldsMap;
|
||||
|
||||
static {
|
||||
importFieldsMap = new HashMap<>();
|
||||
importFieldsMap.put("岗位名称", ExtendInfoPO.builder().tableName("jcl_org_job").fieldName("ec_jobTitle").fieldNameDesc("岗位名称").isrequired(1).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
importFieldsMap.put("所属分部", ExtendInfoPO.builder().tableName("jcl_org_job").fieldName("ec_company").fieldNameDesc("所属分部").isrequired(1).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
importFieldsMap.put("所属部门", ExtendInfoPO.builder().tableName("jcl_org_job").fieldName("ec_department").fieldNameDesc("所属部门").isrequired(1).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
importFieldsMap.put("职务类别", ExtendInfoPO.builder().tableName("hrmjobgroups").fieldName("jobgroupname").fieldNameDesc("职务类别").isrequired(1).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
importFieldsMap.put("所属职务", ExtendInfoPO.builder().tableName("hrmjobactivities").fieldName("jobactivityname").fieldNameDesc("所属职务").isrequired(1).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
importFieldsMap.put("是否关键岗", ExtendInfoPO.builder().tableName("jcl_org_job").fieldName("is_key").fieldNameDesc("是否关键岗").isrequired(1).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
|
||||
}
|
||||
|
||||
public static Long saveImport(String operateType, String excelFile, User user) {
|
||||
Long importHistoryId = OrgImportUtil.saveImportLog("job_info", operateType, user);
|
||||
JclImportHistoryDetailPO historyDetailPO;
|
||||
|
||||
ImageFileManager manager = new ImageFileManager();
|
||||
manager.getImageFileInfoById(Util.getIntValue(excelFile));
|
||||
XSSFWorkbook workbook;
|
||||
try {
|
||||
workbook = new XSSFWorkbook(manager.getInputStream());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
// 当前sheet
|
||||
XSSFSheet sheetAt = workbook.getSheetAt(0);
|
||||
int lastRow = sheetAt.getLastRowNum();
|
||||
OrganizationAssert.isTrue(lastRow > 0, "导入数据为空");
|
||||
short lastCellNum = sheetAt.getRow(0).getLastCellNum();
|
||||
List<ExtendInfoPO> extendInfoPOS = new ArrayList<>();
|
||||
JobTitlesComInfo jobTitlesComInfo = new JobTitlesComInfo();
|
||||
// 遍历每一行数据
|
||||
nextRow:
|
||||
for (int i = 0; i <= lastRow; i++) {
|
||||
historyDetailPO = new JclImportHistoryDetailPO();
|
||||
historyDetailPO.setPid(importHistoryId);
|
||||
XSSFRow row = sheetAt.getRow(i);
|
||||
if (null == row) {
|
||||
continue;
|
||||
}
|
||||
// 组装待处理数据
|
||||
Integer subCompanyId = null;
|
||||
Integer departmentId = null;
|
||||
String departmentname = "";
|
||||
Integer jobTitleId = null;
|
||||
Integer isKey = null;
|
||||
|
||||
|
||||
String jobactivitymark = "";
|
||||
String jobgroupremark = "";
|
||||
|
||||
historyDetailPO.setRowNums(String.valueOf(i + 1));
|
||||
for (int cellIndex = 0; cellIndex < lastCellNum; cellIndex++) {
|
||||
XSSFCell cell = row.getCell((short) cellIndex);
|
||||
String cellValue = OrgImportUtil.getCellValue(cell).trim();
|
||||
if (i == 0) {
|
||||
// 首行 初始化字段信息
|
||||
ExtendInfoPO extendInfoPO = importFieldsMap.get(cellValue);
|
||||
extendInfoPOS.add(extendInfoPO);
|
||||
} else {
|
||||
ExtendInfoPO infoPO = extendInfoPOS.get(cellIndex);
|
||||
// 数据校验
|
||||
if (infoPO.getIsrequired() == 1 && StringUtils.isBlank(cellValue)) {
|
||||
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "为必填项");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue nextRow;
|
||||
}
|
||||
|
||||
Object reallyValue;
|
||||
try {
|
||||
reallyValue = OrgImportUtil.getReallyValue(infoPO, cellValue);
|
||||
} catch (Exception e) {
|
||||
historyDetailPO.setOperateDetail(cellValue + "转换失败");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue nextRow;
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(cellValue) && StringUtils.isBlank(Util.null2String(reallyValue))) {
|
||||
historyDetailPO.setOperateDetail(infoPO.getFieldNameDesc() + "数据转换失败,未找到对应数据");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue nextRow;
|
||||
}
|
||||
|
||||
|
||||
// 分部
|
||||
if ("ec_company".equals(infoPO.getFieldName())) {
|
||||
String[] split = cellValue.split(">");
|
||||
if (split.length > 0 && StringUtils.isNotBlank(cellValue)) {
|
||||
if (split.length > 8) {
|
||||
historyDetailPO.setOperateDetail("分部层级不能大于10");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue nextRow;
|
||||
}
|
||||
for (String s : split) {
|
||||
subCompanyId = MapperProxyFactory.getProxy(CompMapper.class).getIdByNameAndPid(s, subCompanyId == null ? 0 : subCompanyId);
|
||||
if (null == subCompanyId) {
|
||||
historyDetailPO.setOperateDetail(cellValue + "分部未找到对应数据");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue nextRow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 部门
|
||||
if ("ec_department".equals(infoPO.getFieldName())) {
|
||||
String[] split = cellValue.split(">");
|
||||
if (split.length > 0 && StringUtils.isNotBlank(cellValue)) {
|
||||
if (split.length > 8) {
|
||||
historyDetailPO.setOperateDetail("部门层级不能大于10");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue nextRow;
|
||||
}
|
||||
for (String s : split) {
|
||||
departmentId = MapperProxyFactory.getProxy(DepartmentMapper.class).getIdByNameAndPid(s, subCompanyId, departmentId == null ? 0 : departmentId);
|
||||
departmentname = s;
|
||||
if (null == departmentId) {
|
||||
historyDetailPO.setOperateDetail(cellValue + "部门未找到对应数据");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue nextRow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//职务类别
|
||||
if ("jobgroupname".equals(infoPO.getFieldName()) && StringUtils.isNotBlank(cellValue)) {
|
||||
jobgroupremark = cellValue;
|
||||
}
|
||||
|
||||
//所属职务
|
||||
if ("jobactivityname".equals(infoPO.getFieldName()) && StringUtils.isNotBlank(cellValue)) {
|
||||
jobactivitymark = cellValue;
|
||||
}
|
||||
|
||||
//是否关键岗
|
||||
if ("is_key".equals(infoPO.getFieldName()) && StringUtils.isNotBlank(cellValue)) {
|
||||
isKey = "是".equals(cellValue) ? 1 : 0;
|
||||
}
|
||||
|
||||
// 岗位
|
||||
if ("ec_jobTitle".equals(infoPO.getFieldName()) && StringUtils.isNotBlank(cellValue)) {
|
||||
|
||||
String jobTitleName = cellValue;
|
||||
//1.岗位在所属职务下是否存在
|
||||
jobTitleId = MapperProxyFactory.getProxy(JobMapper.class).selectByE9(jobTitleName, jobactivitymark, jobgroupremark);
|
||||
if (null == jobTitleId) {
|
||||
historyDetailPO.setOperateDetail(cellValue + "在系统岗职位体系中未匹配到数据,请检查职务和类别是否正确");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue nextRow;
|
||||
}
|
||||
//2.岗位数据在聚才林岗位管理中是否重复
|
||||
ResourcePO build = ResourcePO.builder().subcompanyid1(subCompanyId).departmentid(departmentId).jobtitle(jobTitleId).build();
|
||||
int count = MapperProxyFactory.getProxy(JobMapper.class).selectByConditions(build);
|
||||
if (count > 0) {
|
||||
historyDetailPO.setOperateDetail(departmentname +"下 <"+ cellValue + ">岗位在聚才林岗位管理中已存在,请勿重复导入");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue nextRow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 校验、数据交互
|
||||
if (i == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String jobNo = jobTitlesComInfo.getJobTitlescode(String.valueOf(jobTitleId)) + "-" +departmentId;
|
||||
JobPO jobPO = JobPO.builder()
|
||||
.jobNo(jobNo)
|
||||
.isKey(isKey)
|
||||
.deleteType(0)
|
||||
.createTime(new Date())
|
||||
.ecCompany(subCompanyId)
|
||||
.ecDepartment(departmentId)
|
||||
.ecJobTitle(jobTitleId)
|
||||
.build();
|
||||
MapperProxyFactory.getProxy(JobMapper.class).insertIgnoreNull(jobPO);
|
||||
|
||||
|
||||
historyDetailPO.setOperateDetail("添加成功");
|
||||
historyDetailPO.setStatus("1");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
|
||||
}
|
||||
return importHistoryId;
|
||||
}
|
||||
|
||||
|
||||
public static List<Map<String, Object>> importForm(User user) {
|
||||
// 返回导入数据
|
||||
List<Map<String, Object>> lsGroup = new ArrayList<>();
|
||||
Map<String, Object> groupItem = new HashMap<>(3);
|
||||
List<Object> itemList = new ArrayList<>();
|
||||
groupItem.put("title", SystemEnv.getHtmlLabelName(33803, Util.getIntValue(user.getLanguage())));
|
||||
groupItem.put("defaultshow", true);
|
||||
List<Integer> lsPromptLabel = new ArrayList<>();
|
||||
lsPromptLabel.add(34275);
|
||||
lsPromptLabel.add(125452);
|
||||
|
||||
for (int i = 0; i < lsPromptLabel.size(); i++) {
|
||||
Map<String, Object> item = new HashMap<>();
|
||||
item.put("index", (i + 1));
|
||||
String value = Util.toScreen(SystemEnv.getHtmlLabelName(lsPromptLabel.get(i), user.getLanguage()), user.getLanguage());
|
||||
if (i == 0) {
|
||||
value += SystemEnv.getHtmlLabelName(28576, user.getLanguage());
|
||||
item.put("link", "/hrm/import/template/job.xls");
|
||||
}
|
||||
item.put("value", value);
|
||||
itemList.add(item);
|
||||
}
|
||||
Map<String, Object> other = new HashMap<>();
|
||||
other.put("index", (lsPromptLabel.size() + 1));
|
||||
other.put("value", "注意:分部和部门存在多层级时候用 > 分割");
|
||||
itemList.add(other);
|
||||
Map<String, Object> other1 = new HashMap<>();
|
||||
other1.put("index", (lsPromptLabel.size() + 2));
|
||||
other1.put("value", "注意:如果必填字段存在多语言不支持导入");
|
||||
itemList.add(other1);
|
||||
groupItem.put("items", itemList);
|
||||
lsGroup.add(groupItem);
|
||||
return lsGroup;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -222,14 +222,22 @@ public class StaffInfoImportUtil {
|
|||
continue nextRow;
|
||||
}
|
||||
for (String s : split) {
|
||||
parentJobId = MapperProxyFactory.getProxy(JobMapper.class).getIdByNameAndPid(s, parentCompanyId, parentDepartmentId == null ? 0 : parentDepartmentId, parentJobId == null ? 0 : parentJobId
|
||||
List<JobPO> jobPList = MapperProxyFactory.getProxy(JobMapper.class).getIdByNameAndPid(s, parentCompanyId, parentDepartmentId == null ? 0 : parentDepartmentId, parentJobId == null ? 0 : parentJobId
|
||||
,jobactivitymark,jobgroupremark);
|
||||
if (null == parentJobId) {
|
||||
if (jobPList.size() > 1) {
|
||||
historyDetailPO.setOperateDetail(s + "岗位在岗位管理中存在重复数据,请先处理");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue nextRow;
|
||||
}
|
||||
if (jobPList.size() == 0) {
|
||||
historyDetailPO.setOperateDetail(s + "岗位未找到对应数据");
|
||||
historyDetailPO.setStatus("0");
|
||||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue nextRow;
|
||||
}
|
||||
parentJobId = jobPList.get(0).getId();
|
||||
|
||||
}
|
||||
}
|
||||
map.put("job_id", parentJobId);
|
||||
|
|
@ -286,7 +294,7 @@ public class StaffInfoImportUtil {
|
|||
break;
|
||||
case "3": // 岗位
|
||||
if (null == parentJobId) {
|
||||
checkMsg = "编制维度选择岗位时,岗位必填!";
|
||||
checkMsg = "编制维度选择岗位时,未找到对应岗位!";
|
||||
} else {
|
||||
JobPO jobPO = MapperProxyFactory.getProxy(JobMapper.class).getJobById(parentJobId);
|
||||
if (null == jobPO) {
|
||||
|
|
|
|||
|
|
@ -91,7 +91,11 @@ public class SearchTreeUtil {
|
|||
Set<String> leafIds = new HashSet<>();
|
||||
List<SearchTree> collect = treeList.stream().peek(e -> {
|
||||
if (null != collects && CollectionUtils.isNotEmpty(collects.get(e.getId()))) {
|
||||
List<TreeNode> nodes = collects.get(e.getId()).stream().sorted(Comparator.comparing(item -> null == item.getOrderNum() ? 0 : item.getOrderNum())).collect(Collectors.toList());
|
||||
List<TreeNode> nodes = collects.get(e.getId()).stream().sorted(Comparator
|
||||
.comparingDouble(SearchTree::getOrderNum)
|
||||
.thenComparingDouble(SearchTree::getShowOrderOfTree)
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
e.setSubs(nodes);
|
||||
leafIds.add(e.getId());
|
||||
if (CollectionUtils.isNotEmpty(e.getSubs())) {
|
||||
|
|
@ -110,18 +114,25 @@ public class SearchTreeUtil {
|
|||
* @return
|
||||
*/
|
||||
public static List<SearchTree> builderTreeMode(List<SearchTree> treeList, List<SearchTree> deptTrees) {
|
||||
Map<String, List<TreeNode>> parentMap = treeList.stream().collect(Collectors.groupingBy(TreeNode::getPid));
|
||||
Map<String, List<SearchTree>> parentMap = treeList.stream().collect(Collectors.groupingBy(SearchTree::getPid));
|
||||
Map<String, List<SearchTree>> childMap = deptTrees.stream().collect(Collectors.groupingBy(SearchTree::getParentComp));
|
||||
boolean isAdd = !childMap.isEmpty();
|
||||
Set<String> leafIds = new HashSet<>();
|
||||
List<SearchTree> collect = treeList.stream().peek(e -> {
|
||||
Set<TreeNode> treeNodes = new LinkedHashSet<>();
|
||||
if (isAdd && CollectionUtils.isNotEmpty(childMap.get(e.getId()))) {
|
||||
List<SearchTree> searchTrees = childMap.get(e.getId()).stream().sorted(Comparator.comparing(SearchTree::getOrderNum)).collect(Collectors.toList());
|
||||
List<SearchTree> searchTrees = childMap.get(e.getId()).stream().sorted(
|
||||
Comparator.comparingDouble(SearchTree::getOrderNum)
|
||||
.thenComparingDouble(SearchTree::getShowOrderOfTree)
|
||||
).collect(Collectors.toList());
|
||||
treeNodes.addAll(searchTrees);
|
||||
}
|
||||
List<TreeNode> nodes = parentMap.get(e.getId());
|
||||
List<SearchTree> nodes = parentMap.get(e.getId());
|
||||
if (CollectionUtils.isNotEmpty(nodes)) {
|
||||
nodes = nodes.stream().sorted(
|
||||
Comparator.comparingDouble(SearchTree::getOrderNum)
|
||||
.thenComparingDouble(SearchTree::getShowOrderOfTree)
|
||||
).collect(Collectors.toList());
|
||||
treeNodes.addAll(nodes);
|
||||
}
|
||||
e.setSubs(new ArrayList<>(treeNodes));
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ public class StaffOutController {
|
|||
public ReturnResult changeStaff(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody StaffOutParam staffOutParam) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
//ESB接口user对象是null
|
||||
if (user == null) {
|
||||
user = new User();
|
||||
user.setUid(1);
|
||||
}
|
||||
return ReturnResult.successed(user,staffOutService(user).changeStaff(staffOutParam));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
|
|
@ -48,6 +53,11 @@ public class StaffOutController {
|
|||
public ReturnResult transactionOnJob(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody StaffOutParam staffOutParam) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
//ESB接口user对象是null
|
||||
if (user == null) {
|
||||
user = new User();
|
||||
user.setUid(1);
|
||||
}
|
||||
return ReturnResult.successed(user,staffOutService(user).transactionOnJob(staffOutParam));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class OrgChartWrapper extends Service {
|
|||
return getChartService(user).recordStatistics(param);
|
||||
}
|
||||
|
||||
public Map<Integer, HrmLabelVO> selectLabel() {
|
||||
public Map<String, HrmLabelVO> selectLabel() {
|
||||
return getChartService(user).selectLabel();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,169 @@
|
|||
package weaver.interfaces.organization.action;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.engine.organization.entity.hrmresource.po.ResourcePO;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.entity.staff.po.StaffPO;
|
||||
import com.engine.organization.enums.DeleteTypeEnum;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.mapper.staff.StaffMapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.job.JobTitlesComInfo;
|
||||
import weaver.interfaces.workflow.action.Action;
|
||||
import weaver.soa.workflow.request.RequestInfo;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/9/25 2:03 PM
|
||||
* @Description: 流程明细编制信息操作初始化
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class WorkflowStaffOperateAction implements Action {
|
||||
|
||||
@Override
|
||||
public String execute(RequestInfo requestInfo) {
|
||||
|
||||
String requestid = requestInfo.getRequestid();
|
||||
int formid = Math.abs(requestInfo.getRequestManager().getFormid());
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
|
||||
String mainTable = String.format("%s%s", "formtable_main_", formid);
|
||||
|
||||
String detaiTable = String.format("%s%s",mainTable,"_dt1");
|
||||
|
||||
//1.获取表单数据
|
||||
rs.executeQuery("select a.bzfa,b.fb,b.bm,b.gw,b.bzs,b.zzs from "+mainTable+" as a \n" +
|
||||
"right join "+detaiTable+" as b on a.id = b.mainid where a.requestid = ?",requestid);
|
||||
|
||||
List<StaffPO> staffList = new ArrayList<>();
|
||||
|
||||
while (rs.next()) {
|
||||
StaffPO build = StaffPO.builder()
|
||||
.planId(Util.getIntValue(rs.getString("bzfa")))
|
||||
.compId(Util.getIntValue(rs.getString("fb")))
|
||||
.deptId(Util.getIntValue(rs.getString("bm")))
|
||||
.jobId(Util.getIntValue(rs.getString("gw")))
|
||||
.staffNum(Util.getIntValue(rs.getString("bzs")))
|
||||
.permanentNum(Util.getIntValue(rs.getString("zzs")))
|
||||
.build();
|
||||
staffList.add(build);
|
||||
}
|
||||
|
||||
if (CollectionUtil.isEmpty(staffList)) {
|
||||
requestInfo.getRequestManager().setMessagecontent("未找到明细数据");
|
||||
return Action.FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
Integer planId = staffList.get(0).getPlanId();
|
||||
|
||||
//2.数据处理,Ec岗位id替换为聚才林岗位id 不存在情况下新增岗位数据
|
||||
buildJobTitle(staffList);
|
||||
|
||||
//3.根据方案id获取当前已有编制信息与流程明细比较;已存在的更新,未存在的新增
|
||||
List<StaffPO> hStaffList = new ArrayList<>();
|
||||
rs.executeQuery("select id,comp_id,dept_id,job_id,freeze_num from jcl_org_staff where plan_id = ? and delete_type = 0",planId);
|
||||
while (rs.next()) {
|
||||
StaffPO build = StaffPO.builder()
|
||||
.id((long) Util.getIntValue(rs.getString("id")))
|
||||
.compId(Util.getIntValue(rs.getString("comp_id")))
|
||||
.deptId(Util.getIntValue(rs.getString("dept_id")))
|
||||
.jobId(Util.getIntValue(rs.getString("job_id")))
|
||||
.freezeNum(Util.getIntValue(rs.getString("freeze_num")))
|
||||
.build();
|
||||
hStaffList.add(build);
|
||||
}
|
||||
|
||||
//新增的编制信息数据List
|
||||
List<StaffPO> iStaffList = new ArrayList<>();
|
||||
|
||||
Map<String, StaffPO> hStaffMap = new HashMap<>();
|
||||
|
||||
for (StaffPO staff : hStaffList) {
|
||||
String key = staff.getCompId() + "_" + staff.getDeptId() + "_" + staff.getJobId();
|
||||
hStaffMap.put(key, staff);
|
||||
}
|
||||
|
||||
for (StaffPO staff : staffList) {
|
||||
String key = staff.getCompId() + "_" + staff.getDeptId() + "_" + staff.getJobId();
|
||||
if (hStaffMap.containsKey(key)) {
|
||||
StaffPO matchedStaff = hStaffMap.get(key);
|
||||
matchedStaff.setPermanentNum(staff.getPermanentNum());
|
||||
matchedStaff.setStaffNum(staff.getStaffNum());
|
||||
}else {
|
||||
iStaffList.add(staff);
|
||||
}
|
||||
}
|
||||
|
||||
//更新
|
||||
hStaffList.forEach(item -> {
|
||||
//todo 冻结数还原为0根据需求而定
|
||||
buildStaffPO(item);
|
||||
rs.executeUpdate("update jcl_org_staff set staff_num = ?,permanent_num = ?,lack_status = ? where id = ?",
|
||||
item.getStaffNum(),item.getPermanentNum(),item.getLackStatus(),item.getId());
|
||||
});
|
||||
|
||||
//插入
|
||||
iStaffList.forEach(staffPO -> {
|
||||
staffPO.setFreezeNum(0);
|
||||
staffPO.setControlPolicy(1);
|
||||
staffPO.setDeleteType(0);
|
||||
staffPO.setCreateTime(new Date());
|
||||
staffPO.setUpdateTime(new Date());
|
||||
staffPO.setCreator(1L);
|
||||
buildStaffPO(staffPO);
|
||||
MapperProxyFactory.getProxy(StaffMapper.class).insertIgnoreNull(staffPO);
|
||||
});
|
||||
|
||||
return Action.SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ec岗位转换聚才林岗位
|
||||
* @param staffList
|
||||
*/
|
||||
private void buildJobTitle(List<StaffPO> staffList) {
|
||||
JobTitlesComInfo jb = new JobTitlesComInfo();
|
||||
staffList.forEach(item -> {
|
||||
ResourcePO resourcePo = ResourcePO.builder().subcompanyid1(item.getCompId()).departmentid(item.getDeptId()).jobtitle(item.getJobId()).build();
|
||||
JobPO jobByResource = MapperProxyFactory.getProxy(JobMapper.class).getJobByResource(resourcePo);
|
||||
if (jobByResource == null) {
|
||||
//岗位不存在新增
|
||||
JobPO jobPO = JobPO.builder()
|
||||
.ecCompany(resourcePo.getSubcompanyid1())
|
||||
.ecDepartment(resourcePo.getDepartmentid())
|
||||
.ecJobTitle(resourcePo.getJobtitle())
|
||||
.isKey(0)
|
||||
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.build();
|
||||
String jobTitlescode = jb.getJobTitlescode(String.valueOf(resourcePo.getJobtitle()));
|
||||
if (!"".equals(jobTitlescode)) {
|
||||
jobPO.setJobNo(jobTitlescode+"-"+resourcePo.getDepartmentid());
|
||||
}
|
||||
MapperProxyFactory.getProxy(JobMapper.class).insertIgnoreNull(jobPO);
|
||||
item.setJobId(Math.toIntExact(jobPO.getId()));
|
||||
}else {
|
||||
item.setJobId(Math.toIntExact(jobByResource.getId()));
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private static void buildStaffPO(StaffPO staffPO) {
|
||||
List<Integer> number = Arrays.asList(staffPO.getPermanentNum(),staffPO.getFreezeNum());
|
||||
Integer sums = number.stream()
|
||||
.mapToInt(Integer::intValue)
|
||||
.sum();
|
||||
Integer a = staffPO.getStaffNum();
|
||||
staffPO.setLackStatus((a.compareTo(sums) < 0) ? 3 : ((a.compareTo(sums) == 0) ? 2 : 1));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package weaver.interfaces.organization.cronjob;
|
||||
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
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/10/18 11:25 AM
|
||||
* @Description: 自动清除已失效的岗位 (执行前请注意编制的引用,会出现名称为空)
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class DeleteIsCancelJobCrob extends BaseCronJob {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
RecordSet rs = new RecordSet();
|
||||
|
||||
List<JobPO> jobList = new ArrayList<>();
|
||||
rs.executeQuery("select id,ec_jobtitle,ec_department from jcl_org_job where delete_type = 0");
|
||||
while (rs.next()) {
|
||||
jobList.add(JobPO.builder()
|
||||
.id((long)Util.getIntValue(rs.getString("id")))
|
||||
.ecJobTitle(Util.getIntValue(rs.getString("ec_jobtitle")))
|
||||
.ecDepartment(Util.getIntValue(rs.getString("ec_department")))
|
||||
.build());
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<Long> deleteIds = new ArrayList<>();
|
||||
|
||||
jobList.forEach(job -> {
|
||||
|
||||
//1.岗位是否封存或删除
|
||||
rs.executeQuery("select id from hrmjobtitles where id = ? and (canceled is null or canceled != 1)",job.getEcJobTitle());
|
||||
if (!rs.next()) {
|
||||
deleteIds.add(job.getId());
|
||||
return;
|
||||
}
|
||||
|
||||
//2.部门是否封存或删除
|
||||
rs.executeQuery("select id from hrmdepartment where id = ? and (canceled is null or canceled != 1)",job.getEcDepartment());
|
||||
if (!rs.next()) {
|
||||
deleteIds.add(job.getId());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (CollectionUtils.isNotEmpty(deleteIds)) {
|
||||
MapperProxyFactory.getProxy(JobMapper.class).deleteByIds(deleteIds);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package weaver.interfaces.organization.cronjob;
|
||||
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.interfaces.schedule.BaseCronJob;
|
||||
|
||||
/**
|
||||
* @Author liang.cheng
|
||||
* @Date 2024/10/10 1:56 PM
|
||||
* @Description: 定时清除组织管理Delete_type=1的数据
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class TableDeleteDataCron extends BaseCronJob {
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
RecordSet rs = new RecordSet();
|
||||
|
||||
rs.execute("delete from jcl_org_scheme where delete_type = 1");
|
||||
rs.execute("delete from jcl_org_level where delete_type = 1");
|
||||
rs.execute("delete from jcl_org_grade where delete_type = 1");
|
||||
rs.execute("delete from jcl_org_sequence where delete_type = 1");
|
||||
rs.execute("delete from jcl_org_staffplan where delete_type = 1");
|
||||
rs.execute("delete from jcl_org_staff where delete_type = 1");
|
||||
rs.execute("delete from jcl_org_job where delete_type = 1");
|
||||
rs.execute("delete from jcl_org_jobext where delete_type = 1");
|
||||
rs.execute("delete from jcl_org_jobext_dt1 where delete_type = 1");
|
||||
rs.execute("delete from jcl_org_detach where delete_type = 1");
|
||||
rs.execute("delete from jcl_org_cardaccess where delete_type = 1");
|
||||
rs.execute("delete from jcl_org_cardbutton where delete_type = 1");
|
||||
rs.execute("delete from jcl_field_extendgroup where delete_type = 1");
|
||||
rs.execute("delete from jcl_field_extendtitle where delete_type = 1");
|
||||
rs.execute("delete from jcl_field_extendinfo where delete_type = 1");
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue