Compare commits
1 Commits
master
...
成都运达科技股份有限公司
| Author | SHA1 | Date |
|---|---|---|
|
|
34447af035 |
|
|
@ -25,7 +25,6 @@ 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;
|
||||
|
|
@ -78,14 +77,13 @@ 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.ec_company, t.job_no, h.jobtitlename as name ";
|
||||
String backfields = "t.id, 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 += " ";
|
||||
|
|
@ -106,8 +104,7 @@ 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"));
|
||||
String subCompanyname = subInfo.getSubCompanyname(Util.null2String(rs.getString("ec_company")));
|
||||
item.put("name", name+"("+subCompanyname+")");
|
||||
item.put("name", name);
|
||||
item.put("title", name);
|
||||
datas.add(item);
|
||||
}
|
||||
|
|
@ -237,7 +234,7 @@ public class JobBrowserService extends BrowserService {
|
|||
compList = MapperProxyFactory.getProxy(CompMapper.class).listParent();
|
||||
}
|
||||
// 获取顶层分部
|
||||
compList.stream().sorted(Comparator.comparingDouble(item -> null == item.getShowOrder() ? 0 : item.getShowOrder())).forEach(item -> buildCompNodes(treeNodes, compHasSubs, item));
|
||||
compList.stream().sorted(Comparator.comparing(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();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
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,10 +24,7 @@ public class CompBO {
|
|||
}
|
||||
|
||||
public static List<SearchTree> buildSetToSearchTree(Set<CompPO> comps) {
|
||||
return comps.stream().sorted(Comparator
|
||||
.comparingDouble(CompPO::getShowOrder)
|
||||
.thenComparingDouble(CompPO::getShowOrderOfTree)
|
||||
).map(item -> {
|
||||
return comps.stream().sorted(Comparator.comparing(item -> null == item.getShowOrder() ? 0 : item.getShowOrder())).map(item -> {
|
||||
SearchTree tree = new SearchTree();
|
||||
tree.setCanClick(true);
|
||||
tree.setCanceled(item.getCanceled() != null && item.getCanceled() != 0);
|
||||
|
|
@ -40,7 +37,6 @@ 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 Double showOrder;
|
||||
private Integer showOrder;
|
||||
|
||||
/**
|
||||
* 禁用标记
|
||||
|
|
@ -78,8 +78,8 @@ public class CompListDTO {
|
|||
*/
|
||||
private List<CompListDTO> children;
|
||||
|
||||
public Double getShowOrder() {
|
||||
return null == showOrder ? 0.00 : showOrder;
|
||||
public Integer getShowOrder() {
|
||||
return null == showOrder ? 0 : showOrder;
|
||||
}
|
||||
|
||||
private String orderType;
|
||||
|
|
@ -89,9 +89,9 @@ public class CompListDTO {
|
|||
return children;
|
||||
}
|
||||
if ("asc".equalsIgnoreCase(orderType)) {
|
||||
return children.stream().sorted(Comparator.comparingDouble(CompListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
return children.stream().sorted(Comparator.comparing(CompListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
} else {
|
||||
return children.stream().sorted(Comparator.comparingDouble(CompListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
return children.stream().sorted(Comparator.comparing(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 Double showOrder;
|
||||
private Double showOrderOfTree;
|
||||
private Integer showOrder;
|
||||
private Integer showOrderOfTree;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,20 +32,6 @@ public class CompPO {
|
|||
private Date modified;
|
||||
private Integer modifier;
|
||||
private String uuid;
|
||||
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;
|
||||
}
|
||||
private Integer showOrder;
|
||||
private Integer showOrderOfTree;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,9 +171,8 @@ public class DepartmentBO {
|
|||
tree.setPid(null == item.getSupDepId() ? "0" : item.getSupDepId().toString());
|
||||
tree.setSelected(false);
|
||||
tree.setType("2");
|
||||
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());
|
||||
tree.setParentComp(null == item.getSupDepId() ? "0" : item.getSubCompanyId1().toString());
|
||||
tree.setOrderNum(null == item.getShowOrder() ? 0 : item.getShowOrder().intValue());
|
||||
return tree;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class DepartmentListDTO {
|
|||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableTitle(labelId = 547181, title = "简称", dataIndex = "departmentMark", key = "departmentMark", width = "200")
|
||||
@TableTitle(labelId = 547141, title = "名称", dataIndex = "departmentMark", key = "departmentMark", width = "200")
|
||||
private String departmentMark;
|
||||
|
||||
/**
|
||||
|
|
@ -48,7 +48,7 @@ public class DepartmentListDTO {
|
|||
/**
|
||||
* 简称
|
||||
*/
|
||||
@TableTitle(labelId = 547141, title = "名称", dataIndex = "departmentName", key = "departmentName")
|
||||
@TableTitle(labelId = 547181, 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.comparingDouble(DepartmentListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
return children.stream().sorted(Comparator.comparing(DepartmentListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
} else {
|
||||
return children.stream().sorted(Comparator.comparingDouble(DepartmentListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
return children.stream().sorted(Comparator.comparing(DepartmentListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,5 +28,5 @@ public class DeptSearchParam extends BaseQueryParam {
|
|||
|
||||
private String uuid;
|
||||
private Double showOrder;
|
||||
private Double showOrderOfTree;
|
||||
private Integer showOrderOfTree;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,6 @@ public class DepartmentPO {
|
|||
private Integer modifier;
|
||||
private String uuid;
|
||||
private Double showOrder;
|
||||
private Double showOrderOfTree;
|
||||
private Integer showOrderOfTree;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class ResourcePO {
|
|||
private Integer jobtitle;
|
||||
|
||||
private String lastName;
|
||||
private Double dspOrder;
|
||||
private Integer dspOrder;
|
||||
|
||||
/**
|
||||
* 临时关联聚才林岗位ID
|
||||
|
|
|
|||
|
|
@ -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.00 : item.getShowOrder());
|
||||
tree.setOrderNum(null == item.getShowOrder() ? 0 : item.getShowOrder());
|
||||
return tree;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
|
|
|
|||
|
|
@ -89,8 +89,6 @@ public class JobListDTO {
|
|||
//@TableTitle(title = "是否启用", dataIndex = "forbiddenTag", key = "forbiddenTag")
|
||||
//private Integer forbiddenTag;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 操作列
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ public class JobSearchParam extends BaseQueryParam {
|
|||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Double showOrder;
|
||||
private Integer showOrder;
|
||||
|
||||
private Integer subcompanyid1;
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public class JobPO {
|
|||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Double showOrder;
|
||||
private Integer showOrder;
|
||||
|
||||
private String gradeId;
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,7 @@ public class SearchTree extends TreeNode {
|
|||
private boolean isCanceled;
|
||||
private String requestParams;
|
||||
private String parentComp;
|
||||
private Double orderNum;
|
||||
private Double showOrderOfTree;
|
||||
private Integer orderNum;
|
||||
|
||||
public String getCompanyid() {
|
||||
return companyid;
|
||||
|
|
@ -77,28 +76,14 @@ public class SearchTree extends TreeNode {
|
|||
this.parentComp = parentComp;
|
||||
}
|
||||
|
||||
public Double getOrderNum() {
|
||||
if(null==orderNum){
|
||||
return 0.00;
|
||||
}
|
||||
public Integer getOrderNum() {
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(Double orderNum) {
|
||||
public void setOrderNum(Integer 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,7 +1,6 @@
|
|||
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;
|
||||
|
|
@ -31,22 +30,6 @@ 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,7 +12,6 @@
|
|||
<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>
|
||||
|
||||
|
|
@ -31,7 +30,6 @@
|
|||
t.departmentCode,
|
||||
t.coadjutant,
|
||||
t.showOrder,
|
||||
t.showOrderOfTree,
|
||||
t.uuid
|
||||
</sql>
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@
|
|||
groupid,
|
||||
#{scopeId} as scopeId,
|
||||
'hrm' as tablename
|
||||
FROM hrm_formfield where isuse = 1) hrmallfield
|
||||
FROM hrm_formfield) 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
|
||||
*/
|
||||
Double getMaxShowOrder();
|
||||
Integer getMaxShowOrder();
|
||||
|
||||
/**
|
||||
* 根据名字和上级查询岗位信息
|
||||
|
|
@ -148,8 +148,6 @@ public interface JobMapper {
|
|||
|
||||
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.Double">
|
||||
<select id="getMaxShowOrder" resultType="java.lang.Integer">
|
||||
select max(show_order)
|
||||
from jcl_org_job
|
||||
</select>
|
||||
|
|
@ -482,16 +482,6 @@
|
|||
and delete_type = 0
|
||||
</select>
|
||||
|
||||
|
||||
<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"/>
|
||||
|
|
|
|||
|
|
@ -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 and a.seclevel >= 0
|
||||
where a.status < 4
|
||||
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<String, HrmLabelVO> selectLabel();
|
||||
Map<Integer, HrmLabelVO> selectLabel();
|
||||
|
||||
/**
|
||||
* @Description: 历史版本删除
|
||||
|
|
|
|||
|
|
@ -60,9 +60,8 @@ 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", true);
|
||||
boolean hasRight = HasRightUtil.hasRight(user, RIGHT_NAME, true);
|
||||
resultMap.put("hasRight", hasRight);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -271,13 +271,13 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
if (isRealTime) {
|
||||
// 查询部门本身
|
||||
if (hasVirtualFields) {
|
||||
sql = "select a.id,a.departmentname as name,b.bmfzr,b.bmlx as isvitual from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid where a.id = '" + departmentId + "'";
|
||||
sql = "select a.id,a.departmentname as name,b.bmfzr,b.bmlx as isvitual,b.bmjl from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid where a.id = '" + departmentId + "'";
|
||||
} else {
|
||||
sql = "select a.id,a.departmentname as name,b.bmfzr from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid where a.id = '" + departmentId + "'";
|
||||
sql = "select a.id,a.departmentname as name,b.bmfzr,b.bmjl from " + DEPARTMENT_TABLE + " a left join hrmdepartmentdefined b on a.id = b.deptid where a.id = '" + departmentId + "'";
|
||||
}
|
||||
} else {
|
||||
if (hasVirtualFields) {
|
||||
sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name,fleader as bmfzr,isvirtual as isvitual from " + DEPARTMENT_TABLE + " a where a." + DEPARTMENT_ID + " = '" + departmentId + "' and versionid = " + versionId;
|
||||
sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name,fleader as bmjl,isvirtual as isvitual from " + DEPARTMENT_TABLE + " a where a." + DEPARTMENT_ID + " = '" + departmentId + "' and versionid = " + versionId;
|
||||
} else {
|
||||
sql = "select " + DEPARTMENT_ID + " as id,a.departmentname as name from " + DEPARTMENT_TABLE + " a where a." + DEPARTMENT_ID + " = '" + departmentId + "' and versionid = " + versionId;
|
||||
}
|
||||
|
|
@ -285,7 +285,7 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
rs.executeQuery(sql);
|
||||
ChartPO departmentChartPO = new ChartPO();
|
||||
if (rs.next()) {
|
||||
String fLeader = Util.null2String(rs.getString("bmfzr"));
|
||||
String fLeader = Util.null2String(rs.getString("bmjl"));
|
||||
departmentChartPO.setFtype("2");
|
||||
departmentChartPO.setFobjid(departmentId);
|
||||
departmentChartPO.setId(rootId);
|
||||
|
|
@ -715,9 +715,9 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<String, HrmLabelVO> selectLabel() {
|
||||
public Map<Integer, HrmLabelVO> selectLabel() {
|
||||
RecordSet rs = new RecordSet();
|
||||
Map<String, HrmLabelVO> labelData = new HashMap<>();
|
||||
Map<Integer, 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,
|
||||
|
|
@ -726,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(Util.null2String(item),HrmLabelVO.builder().labelName(Util.null2String(rs.getString("labelName"))).build());
|
||||
labelData.put(item,HrmLabelVO.builder().labelName(Util.null2String(rs.getString("labelName"))).build());
|
||||
}
|
||||
|
||||
});
|
||||
|
|
@ -1007,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,d.bmfzr as fleader,e.on_job_num,e.staff_num " +
|
||||
"a.canceled,a.departmentcode,a.coadjutant,a.tlevel,d.bmlx as isvirtual,d.bmjl 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 " +
|
||||
|
|
@ -1040,14 +1040,15 @@ public class ChartServiceImpl extends Service implements ChartService {
|
|||
" a.departmentcode,\n" +
|
||||
" a.coadjutant,\n" +
|
||||
" a.tlevel,\n" +
|
||||
" e.bmfzr as fleader,\n" +
|
||||
" d.on_job_num,\n" +
|
||||
" d.staff_num" +
|
||||
" d.bmjl as fleader,\n" +
|
||||
" e.on_job_num,\n" +
|
||||
" e.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 ";
|
||||
" LEFT JOIN hrmsubcompany b ON a.subcompanyid1 = b.id\n" +
|
||||
" LEFT JOIN hrmdepartment c ON a.supdepid = c.id\n" +
|
||||
" LEFT JOIN hrmdepartmentdefined d ON a.id = d.deptid\n" +
|
||||
" LEFT JOIN JCL_ORG_ONJOB e ON a.id = e.data_id \n" +
|
||||
" AND e.type = 2";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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.comparingDouble(CompListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
compListDTOS = compListDTOS.stream().sorted(Comparator.comparing(CompListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
|
||||
} else {
|
||||
compListDTOS = compListDTOS.stream().sorted(Comparator.comparingDouble(CompListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
compListDTOS = compListDTOS.stream().sorted(Comparator.comparing(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("hrmOrganization", "enable");
|
||||
String enable = bb.getPropValue("qtx_sso_login", "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("hrmOrganization","enable"));
|
||||
map.put("isopenconfig",bb.getPropValue("qtx_sso_login","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("hrmOrganization.properties", "enable", isopenconfig);
|
||||
ConfigOperator.setProp("qtx_sso_login.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.comparingDouble(DepartmentListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
compListDTOS = compListDTOS.stream().sorted(Comparator.comparing(DepartmentListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
|
||||
} else {
|
||||
compListDTOS = compListDTOS.stream().sorted(Comparator.comparingDouble(DepartmentListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
compListDTOS = compListDTOS.stream().sorted(Comparator.comparing(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);
|
||||
|
|
|
|||
|
|
@ -86,9 +86,8 @@ public class FunctionOutStaffServiceImpl {
|
|||
Integer sum = numberF.stream()
|
||||
.mapToInt(Integer::intValue)
|
||||
.sum();
|
||||
Integer sums = sum + staffPO.getPermanentNum();
|
||||
if (staffPO.getControlPolicy().equals(HARDCONTROLLER)) {
|
||||
OrganizationAssert.isFalse(sums.compareTo(staffPO.getStaffNum()) > 0, SystemEnv.getHtmlLabelName(547469,user.getLanguage()));
|
||||
OrganizationAssert.isFalse(sum.compareTo(staffPO.getStaffNum()) > 0, SystemEnv.getHtmlLabelName(547469,user.getLanguage()));
|
||||
}
|
||||
staffPO.setFreezeNum(sum);
|
||||
buildStaffPO(staffPO);
|
||||
|
|
|
|||
|
|
@ -63,10 +63,7 @@ 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;
|
||||
|
|
@ -189,40 +186,25 @@ 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{
|
||||
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);
|
||||
|
|
@ -233,7 +215,6 @@ 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, ","));
|
||||
|
|
@ -662,7 +643,6 @@ 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());
|
||||
|
|
@ -805,14 +785,9 @@ 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");
|
||||
|
|
@ -834,18 +809,10 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
sb.append(" and t.lastname ").append(dbType.like(value));
|
||||
}
|
||||
if ("companyId".equals(key)) {
|
||||
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(")");
|
||||
sb.append(" and t.subcompanyid1 ='").append(value).append("'");
|
||||
}
|
||||
if ("departmentId".equals(key)) {
|
||||
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(")");
|
||||
sb.append(" and t.departmentId ='").append(value).append("'");
|
||||
}
|
||||
if ("jobTitle".equals(key)) {
|
||||
JobPO jobById = getJobMapper().getJobById(Long.parseLong(value));
|
||||
|
|
@ -1313,7 +1280,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.comparingDouble(JobListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparing(JobListDTO::getShowOrder)).collect(Collectors.toList());
|
||||
|
||||
} else {
|
||||
jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparingDouble(JobListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
jobListDTOS = jobListDTOS.stream().sorted(Comparator.comparing(JobListDTO::getShowOrder).reversed()).collect(Collectors.toList());
|
||||
}
|
||||
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS);
|
||||
pageInfos = new PageInfo<>(user, subList, JobListDTO.class);
|
||||
|
|
@ -207,9 +207,6 @@ 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);
|
||||
// 日志
|
||||
|
|
@ -370,9 +367,9 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
}
|
||||
|
||||
if (StringUtils.isBlank(params.get("show_order").toString())) {
|
||||
Double maxShowOrder = getJobMapper().getMaxShowOrder();
|
||||
Integer maxShowOrder = getJobMapper().getMaxShowOrder();
|
||||
if (null == maxShowOrder) {
|
||||
maxShowOrder = 0.00;
|
||||
maxShowOrder = 0;
|
||||
}
|
||||
params.put("show_order", maxShowOrder + 1);
|
||||
}
|
||||
|
|
@ -436,8 +433,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());
|
||||
Double orderNum = getJobMapper().getMaxShowOrder();
|
||||
orderNum = null == orderNum ? 0.00 : orderNum;
|
||||
Integer orderNum = getJobMapper().getMaxShowOrder();
|
||||
orderNum = null == orderNum ? 0 : orderNum;
|
||||
for (Long id : idList) {
|
||||
orderNum++;
|
||||
JobPO jobById = getJobMapper().getJobById(id);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ 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;
|
||||
|
||||
|
|
@ -231,7 +233,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;
|
||||
}
|
||||
|
|
@ -245,9 +247,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<>(MapperProxyFactory.getProxy(ManagerDetachMapper.class).getDetachListById(uId,0));
|
||||
List<ManagerDetachPO> detachListById = new ArrayList<>(mangeDetachMapper.getDetachListById(uId,0));
|
||||
//角色
|
||||
HrmCommonService hrmCommonService = new HrmCommonServiceImpl();
|
||||
List<String> roleIds = new ArrayList<>(Arrays.asList(hrmCommonService.getRoleIds(uId).split(",")));
|
||||
|
|
|
|||
|
|
@ -611,15 +611,9 @@ 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());
|
||||
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);
|
||||
rs.executeQuery("SELECT id,recorddate,description from JCL_ORG_CHARTVERSION where fclass = ? and deletetype = ? order by id desc", 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 : Double.parseDouble(show_order));
|
||||
jobPO.setShowOrder(StringUtils.isBlank(show_order) ? null : Integer.parseInt(show_order));
|
||||
jobPO.setForbiddenTag(StringUtils.isBlank(forbidden_tag) ? null : Integer.parseInt(forbidden_tag));
|
||||
jobPO.setGradeId(grade_id);
|
||||
jobPO.setLevelId(level_id);
|
||||
|
|
|
|||
|
|
@ -25,11 +25,7 @@ public class DetachUtil {
|
|||
private final List<Integer> jclRoleLevels;
|
||||
|
||||
public DetachUtil(User user) {
|
||||
// if (1 == user.getUID() || user.isAdmin()) {
|
||||
// DETACH = false;
|
||||
// }
|
||||
//分权管理员支持分权
|
||||
if (1 == user.getUID()) {
|
||||
if (1 == user.getUID() || user.isAdmin()) {
|
||||
DETACH = false;
|
||||
}
|
||||
if (DETACH) {
|
||||
|
|
|
|||
|
|
@ -1,268 +0,0 @@
|
|||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -236,8 +236,6 @@ public class StaffInfoImportUtil {
|
|||
OrgImportUtil.saveImportDetailLog(historyDetailPO);
|
||||
continue nextRow;
|
||||
}
|
||||
parentJobId = jobPList.get(0).getId();
|
||||
|
||||
}
|
||||
}
|
||||
map.put("job_id", parentJobId);
|
||||
|
|
@ -294,7 +292,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,11 +91,7 @@ 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
|
||||
.comparingDouble(SearchTree::getOrderNum)
|
||||
.thenComparingDouble(SearchTree::getShowOrderOfTree)
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
List<TreeNode> nodes = collects.get(e.getId()).stream().sorted(Comparator.comparing(item -> null == item.getOrderNum() ? 0 : item.getOrderNum())).collect(Collectors.toList());
|
||||
e.setSubs(nodes);
|
||||
leafIds.add(e.getId());
|
||||
if (CollectionUtils.isNotEmpty(e.getSubs())) {
|
||||
|
|
@ -114,25 +110,18 @@ public class SearchTreeUtil {
|
|||
* @return
|
||||
*/
|
||||
public static List<SearchTree> builderTreeMode(List<SearchTree> treeList, List<SearchTree> deptTrees) {
|
||||
Map<String, List<SearchTree>> parentMap = treeList.stream().collect(Collectors.groupingBy(SearchTree::getPid));
|
||||
Map<String, List<TreeNode>> parentMap = treeList.stream().collect(Collectors.groupingBy(TreeNode::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.comparingDouble(SearchTree::getOrderNum)
|
||||
.thenComparingDouble(SearchTree::getShowOrderOfTree)
|
||||
).collect(Collectors.toList());
|
||||
List<SearchTree> searchTrees = childMap.get(e.getId()).stream().sorted(Comparator.comparing(SearchTree::getOrderNum)).collect(Collectors.toList());
|
||||
treeNodes.addAll(searchTrees);
|
||||
}
|
||||
List<SearchTree> nodes = parentMap.get(e.getId());
|
||||
List<TreeNode> 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));
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class OrgChartWrapper extends Service {
|
|||
return getChartService(user).recordStatistics(param);
|
||||
}
|
||||
|
||||
public Map<String, HrmLabelVO> selectLabel() {
|
||||
public Map<Integer, HrmLabelVO> selectLabel() {
|
||||
return getChartService(user).selectLabel();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ public class WorkflowStaffOperateAction implements Action {
|
|||
MapperProxyFactory.getProxy(StaffMapper.class).insertIgnoreNull(staffPO);
|
||||
});
|
||||
|
||||
return Action.SUCCESS;
|
||||
return Action.FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue