|
|
@ -2,14 +2,18 @@ package com.weaver.seconddev.cockpit.cmd;
|
|
|
|
|
|
|
|
|
|
|
|
import com.weaver.ebuilder.datasource.api.entity.SqlParamEntity;
|
|
|
|
import com.weaver.ebuilder.datasource.api.entity.SqlParamEntity;
|
|
|
|
import com.weaver.ebuilder.datasource.api.enums.SqlParamType;
|
|
|
|
import com.weaver.ebuilder.datasource.api.enums.SqlParamType;
|
|
|
|
|
|
|
|
import com.weaver.seconddev.cockpit.util.CommonUtils;
|
|
|
|
import com.weaver.seconddev.cockpit.util.DatabaseUtils;
|
|
|
|
import com.weaver.seconddev.cockpit.util.DatabaseUtils;
|
|
|
|
import com.weaver.seconddev.cockpit.util.JucailinCockpitUtils;
|
|
|
|
import com.weaver.seconddev.cockpit.util.JucailinCockpitUtils;
|
|
|
|
import com.weaver.teams.domain.user.SimpleEmployee;
|
|
|
|
import com.weaver.teams.domain.user.SimpleEmployee;
|
|
|
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -31,7 +35,7 @@ public class CockpitUserDataCmd {
|
|
|
|
private DatabaseUtils databaseUtils;
|
|
|
|
private DatabaseUtils databaseUtils;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Map<String, Object> getDataInfo(SimpleEmployee employee, Map<String, Object> paramMap,String tenantKey) {
|
|
|
|
public Map<String, Object> getDataInfo(SimpleEmployee employee, Map<String, Object> paramMap, String tenantKey) {
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> recordMap = new HashMap<String, Object>();
|
|
|
|
Map<String, Object> recordMap = new HashMap<String, Object>();
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
String sourceType = "LOGIC";
|
|
|
@ -39,70 +43,70 @@ public class CockpitUserDataCmd {
|
|
|
|
String subcompanynme = "";
|
|
|
|
String subcompanynme = "";
|
|
|
|
|
|
|
|
|
|
|
|
String employeeId = String.valueOf(employee.getEmployeeId());
|
|
|
|
String employeeId = String.valueOf(employee.getEmployeeId());
|
|
|
|
log.error("employeeId:"+employeeId);
|
|
|
|
log.error("employeeId:" + employeeId);
|
|
|
|
String username = employee.getName();
|
|
|
|
String username = employee.getName();
|
|
|
|
log.error("username:"+username);
|
|
|
|
log.error("username:" + username);
|
|
|
|
|
|
|
|
|
|
|
|
String deptname = employee.getDepartment().getName();
|
|
|
|
String deptname = employee.getDepartment().getName();
|
|
|
|
log.error("deptname:"+deptname);
|
|
|
|
log.error("deptname:" + deptname);
|
|
|
|
Long deptid = employee.getDepartment().getId();
|
|
|
|
Long deptid = employee.getDepartment().getId();
|
|
|
|
log.error("deptid:"+deptid);
|
|
|
|
log.error("deptid:" + deptid);
|
|
|
|
// long subCompanyid = employee.getDepartment().getSubCompanyId();
|
|
|
|
// long subCompanyid = employee.getDepartment().getSubCompanyId();
|
|
|
|
|
|
|
|
|
|
|
|
String positionname = employee.getPosition().getName();
|
|
|
|
String positionname = employee.getPosition().getName();
|
|
|
|
log.error("positionname:"+positionname);
|
|
|
|
log.error("positionname:" + positionname);
|
|
|
|
String gradename = employee.getGrade().getName();
|
|
|
|
String gradename = employee.getGrade().getName();
|
|
|
|
log.error("gradename:"+gradename);
|
|
|
|
log.error("gradename:" + gradename);
|
|
|
|
|
|
|
|
|
|
|
|
String personnelstatusname = "" ;
|
|
|
|
String personnelstatusname = "";
|
|
|
|
String personnelstatus = employee.getPersonnelStatus();
|
|
|
|
String personnelstatus = employee.getPersonnelStatus();
|
|
|
|
log.error("personnelstatus:"+personnelstatus);
|
|
|
|
log.error("personnelstatus:" + personnelstatus);
|
|
|
|
|
|
|
|
|
|
|
|
if("1".equals(personnelstatus)){
|
|
|
|
if ("1".equals(personnelstatus)) {
|
|
|
|
personnelstatusname = "试用员工";
|
|
|
|
personnelstatusname = "试用员工";
|
|
|
|
}else if("2".equals(personnelstatus)){
|
|
|
|
} else if ("2".equals(personnelstatus)) {
|
|
|
|
personnelstatusname = "试用延期员工";
|
|
|
|
personnelstatusname = "试用延期员工";
|
|
|
|
}else if("3".equals(personnelstatus)){
|
|
|
|
} else if ("3".equals(personnelstatus)) {
|
|
|
|
personnelstatusname = "正式员工";
|
|
|
|
personnelstatusname = "正式员工";
|
|
|
|
}else if("4".equals(personnelstatus)){
|
|
|
|
} else if ("4".equals(personnelstatus)) {
|
|
|
|
personnelstatusname = "临时员工";
|
|
|
|
personnelstatusname = "临时员工";
|
|
|
|
}else if("5".equals(personnelstatus)){
|
|
|
|
} else if ("5".equals(personnelstatus)) {
|
|
|
|
personnelstatusname = "实习员工";
|
|
|
|
personnelstatusname = "实习员工";
|
|
|
|
}else if("6".equals(personnelstatus)){
|
|
|
|
} else if ("6".equals(personnelstatus)) {
|
|
|
|
personnelstatusname = "离职员工";
|
|
|
|
personnelstatusname = "离职员工";
|
|
|
|
}else if("7".equals(personnelstatus)){
|
|
|
|
} else if ("7".equals(personnelstatus)) {
|
|
|
|
personnelstatusname = "退休员工";
|
|
|
|
personnelstatusname = "退休员工";
|
|
|
|
}else if("9".equals(personnelstatus)){
|
|
|
|
} else if ("9".equals(personnelstatus)) {
|
|
|
|
personnelstatusname = "解聘员工";
|
|
|
|
personnelstatusname = "解聘员工";
|
|
|
|
}else if("10".equals(personnelstatus)){
|
|
|
|
} else if ("10".equals(personnelstatus)) {
|
|
|
|
personnelstatusname = "无效员工";
|
|
|
|
personnelstatusname = "无效员工";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
log.error("personnelstatusname:"+personnelstatusname);
|
|
|
|
log.error("personnelstatusname:" + personnelstatusname);
|
|
|
|
|
|
|
|
|
|
|
|
String userimageurl = "/profile/" + employeeId + "/personal";
|
|
|
|
String userimageurl = "/profile/" + employeeId + "/personal";
|
|
|
|
|
|
|
|
|
|
|
|
long formdata = employee.getFormdata();
|
|
|
|
long formdata = employee.getFormdata();
|
|
|
|
log.error("formdata:"+formdata);
|
|
|
|
log.error("formdata:" + formdata);
|
|
|
|
|
|
|
|
|
|
|
|
String pkey = "field69.groupId";
|
|
|
|
String pkey = "field69.groupId";
|
|
|
|
String groupId = jucailinCockpitUtils.getUfPropData(pkey,tenantKey);
|
|
|
|
String groupId = jucailinCockpitUtils.getUfPropData(pkey, tenantKey);
|
|
|
|
log.error("groupId:"+groupId);
|
|
|
|
log.error("groupId:" + groupId);
|
|
|
|
|
|
|
|
|
|
|
|
String jobcallname = "";
|
|
|
|
String jobcallname = "";
|
|
|
|
long jobcallid = employee.getJobCall();
|
|
|
|
long jobcallid = employee.getJobCall();
|
|
|
|
log.error("jobcallid:"+jobcallid);
|
|
|
|
log.error("jobcallid:" + jobcallid);
|
|
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(deptid+"")){
|
|
|
|
if (StringUtils.isNotBlank(deptid + "")) {
|
|
|
|
String sql =" select name from eteams.department where id in( " +
|
|
|
|
String sql = " select name from eteams.department where id in( " +
|
|
|
|
" select subcompanyid from eteams.department where id = ? and delete_type=0 and tenant_key = ?" +
|
|
|
|
" select subcompanyid from eteams.department where id = ? and delete_type=0 and tenant_key = ?" +
|
|
|
|
" ) and delete_type=0 and tenant_key = ?";
|
|
|
|
" ) and delete_type=0 and tenant_key = ?";
|
|
|
|
|
|
|
|
|
|
|
|
log.error("sql:"+sql);
|
|
|
|
log.error("sql:" + sql);
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
sqlParamEntity.setValue(deptid+"");
|
|
|
|
sqlParamEntity.setValue(deptid + "");
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
@ -115,24 +119,24 @@ public class CockpitUserDataCmd {
|
|
|
|
sqlParamEntity.setValue(tenantKey);
|
|
|
|
sqlParamEntity.setValue(tenantKey);
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql, sqlparam);
|
|
|
|
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
if(!recordList.isEmpty() && recordList.size()>0){
|
|
|
|
if (!recordList.isEmpty() && recordList.size() > 0) {
|
|
|
|
subcompanynme = String.valueOf(recordList.get(0).get("name"));
|
|
|
|
subcompanynme = String.valueOf(recordList.get(0).get("name"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.error("subcompanynme:"+subcompanynme);
|
|
|
|
log.error("subcompanynme:" + subcompanynme);
|
|
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(jobcallid+"")){
|
|
|
|
if (StringUtils.isNotBlank(jobcallid + "")) {
|
|
|
|
String sql =" select data_name from eteams.hrm_jobcall " +
|
|
|
|
String sql = " select data_name from eteams.hrm_jobcall " +
|
|
|
|
" where id = ? "+
|
|
|
|
" where id = ? " +
|
|
|
|
" and delete_type = 0\n" +
|
|
|
|
" and delete_type = 0\n" +
|
|
|
|
" and tenant_key = ? \n" ;
|
|
|
|
" and tenant_key = ? \n";
|
|
|
|
log.error("sql:"+sql);
|
|
|
|
log.error("sql:" + sql);
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
sqlParamEntity.setValue(jobcallid+"");
|
|
|
|
sqlParamEntity.setValue(jobcallid + "");
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
@ -140,58 +144,58 @@ public class CockpitUserDataCmd {
|
|
|
|
sqlParamEntity.setValue(tenantKey);
|
|
|
|
sqlParamEntity.setValue(tenantKey);
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql, sqlparam);
|
|
|
|
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
if(!recordList.isEmpty() && recordList.size()>0){
|
|
|
|
if (!recordList.isEmpty() && recordList.size() > 0) {
|
|
|
|
jobcallname = String.valueOf(recordList.get(0).get("data_name"));
|
|
|
|
jobcallname = String.valueOf(recordList.get(0).get("data_name"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String field69 = "";
|
|
|
|
String field69 = "";
|
|
|
|
if(StringUtils.isNotBlank(formdata+"")){
|
|
|
|
if (StringUtils.isNotBlank(formdata + "")) {
|
|
|
|
String sql =" select field69 from eteams.Hrmemployeedefined where form_data_id = ?" ;
|
|
|
|
String sql = " select field69 from eteams.Hrmemployeedefined where form_data_id = ?";
|
|
|
|
log.error("getSelfServiceData--sql:"+sql);
|
|
|
|
log.error("getSelfServiceData--sql:" + sql);
|
|
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
sqlParamEntity.setValue(formdata+"");
|
|
|
|
sqlParamEntity.setValue(formdata + "");
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql, sqlparam);
|
|
|
|
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
if(recordList.size()>0){
|
|
|
|
if (recordList.size() > 0) {
|
|
|
|
field69 = String.valueOf(recordList.get(0).get("field69"));
|
|
|
|
field69 = String.valueOf(recordList.get(0).get("field69"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if("1".equals(field69)){
|
|
|
|
if ("1".equals(field69)) {
|
|
|
|
field69 = "销售";
|
|
|
|
field69 = "销售";
|
|
|
|
}else if("2".equals(field69)){
|
|
|
|
} else if ("2".equals(field69)) {
|
|
|
|
field69 = "项目";
|
|
|
|
field69 = "项目";
|
|
|
|
}else if("3".equals(field69)){
|
|
|
|
} else if ("3".equals(field69)) {
|
|
|
|
field69 = "技术";
|
|
|
|
field69 = "技术";
|
|
|
|
}else if("4".equals(field69)){
|
|
|
|
} else if ("4".equals(field69)) {
|
|
|
|
field69 = "客服";
|
|
|
|
field69 = "客服";
|
|
|
|
}else if("5".equals(field69)){
|
|
|
|
} else if ("5".equals(field69)) {
|
|
|
|
field69 = "运营";
|
|
|
|
field69 = "运营";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
log.error("field69:"+field69);
|
|
|
|
log.error("field69:" + field69);
|
|
|
|
recordMap.put("employeeId",employeeId);
|
|
|
|
recordMap.put("employeeId", employeeId);
|
|
|
|
recordMap.put("username",username);
|
|
|
|
recordMap.put("username", username);
|
|
|
|
recordMap.put("deptmentnnme",subcompanynme+"-"+deptname);
|
|
|
|
recordMap.put("deptmentnnme", subcompanynme + "-" + deptname);
|
|
|
|
recordMap.put("positionname",positionname);
|
|
|
|
recordMap.put("positionname", positionname);
|
|
|
|
recordMap.put("userimageurl",userimageurl);
|
|
|
|
recordMap.put("userimageurl", userimageurl);
|
|
|
|
recordMap.put("jobcallname",jobcallname);
|
|
|
|
recordMap.put("jobcallname", jobcallname);
|
|
|
|
recordMap.put("personnelstatusname",personnelstatusname);
|
|
|
|
recordMap.put("personnelstatusname", personnelstatusname);
|
|
|
|
recordMap.put("personnelstatus",personnelstatus);
|
|
|
|
recordMap.put("personnelstatus", personnelstatus);
|
|
|
|
recordMap.put("gradename",gradename);
|
|
|
|
recordMap.put("gradename", gradename);
|
|
|
|
recordMap.put("field69",field69);
|
|
|
|
recordMap.put("field69", field69);
|
|
|
|
String avatarUrl = "";
|
|
|
|
String avatarUrl = "";
|
|
|
|
if(StringUtils.isBlank(avatarUrl)){
|
|
|
|
if (StringUtils.isBlank(avatarUrl)) {
|
|
|
|
avatarUrl = "/build/hrm/static/media/male.png";
|
|
|
|
avatarUrl = "/build/hrm/static/media/male.png";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
recordMap.put("avatarUrl",avatarUrl);
|
|
|
|
recordMap.put("avatarUrl", avatarUrl);
|
|
|
|
|
|
|
|
|
|
|
|
// List<Map<String,String>> customList = new ArrayList<Map<String,String>>();
|
|
|
|
// List<Map<String,String>> customList = new ArrayList<Map<String,String>>();
|
|
|
|
// Map<String,String> customMap = new HashMap<String,String>();
|
|
|
|
// Map<String,String> customMap = new HashMap<String,String>();
|
|
|
@ -214,31 +218,42 @@ public class CockpitUserDataCmd {
|
|
|
|
// customMap.put("value","人力资源管理师");
|
|
|
|
// customMap.put("value","人力资源管理师");
|
|
|
|
// customList.add(customMap);
|
|
|
|
// customList.add(customMap);
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> customList = getCustomType(employee,tenantKey);
|
|
|
|
List<Map<String, Object>> customList = getCustomType(employee, tenantKey);
|
|
|
|
recordMap.put("customType",customList);
|
|
|
|
recordMap.put("customType", customList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String employeeId2 = String.valueOf(paramMap.get("userid"));
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(employeeId2)) {
|
|
|
|
|
|
|
|
employeeId = employeeId2;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Map<String, Object>> changeList = getEmpChangeData(employeeId, tenantKey);
|
|
|
|
|
|
|
|
recordMap.put("changeList", changeList);
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
log.error("PortalPerformanceInfoCmd :" + e);
|
|
|
|
log.error("PortalPerformanceInfoCmd :" + e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try{
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
|
log.error("CockpitUserDataCmd-333333");
|
|
|
|
log.error("CockpitUserDataCmd-333333");
|
|
|
|
Long avatarid = employee.getAvatarId();
|
|
|
|
Long avatarid = employee.getAvatarId();
|
|
|
|
log.error("CockpitUserDataCmd-avatarid:"+avatarid);
|
|
|
|
log.error("CockpitUserDataCmd-avatarid:" + avatarid);
|
|
|
|
|
|
|
|
|
|
|
|
String url = employee.getAvatar().getUrl();
|
|
|
|
String url = employee.getAvatar().getUrl();
|
|
|
|
|
|
|
|
|
|
|
|
log.error("CockpitUserDataCmd-url:"+url);
|
|
|
|
log.error("CockpitUserDataCmd-url:" + url);
|
|
|
|
|
|
|
|
|
|
|
|
String avatarUrl = employee.getAvatar().getPreviewUrl();
|
|
|
|
String avatarUrl = employee.getAvatar().getPreviewUrl();
|
|
|
|
log.error("CockpitUserDataCmd-test-avatarUrl:"+avatarUrl);
|
|
|
|
log.error("CockpitUserDataCmd-test-avatarUrl:" + avatarUrl);
|
|
|
|
|
|
|
|
|
|
|
|
Long SubCompanyId = employee.getDepartment().getSubCompanyId();
|
|
|
|
Long SubCompanyId = employee.getDepartment().getSubCompanyId();
|
|
|
|
log.error("CockpitUserDataCmd-test-SubCompanyId:"+SubCompanyId);
|
|
|
|
log.error("CockpitUserDataCmd-test-SubCompanyId:" + SubCompanyId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
Date hireDate = employee.getHiredate();
|
|
|
|
|
|
|
|
log.error("hireDate:" + sdf.format(hireDate));
|
|
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return recordMap;
|
|
|
|
return recordMap;
|
|
|
@ -248,27 +263,27 @@ public class CockpitUserDataCmd {
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public List<Map<String,Object>> getCustomType(SimpleEmployee employee,String tenantKey){
|
|
|
|
public List<Map<String, Object>> getCustomType(SimpleEmployee employee, String tenantKey) {
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> recordList = new ArrayList<Map<String,Object>>();
|
|
|
|
List<Map<String, Object>> recordList = new ArrayList<Map<String, Object>>();
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
Long employeeId = employee.getEmployeeId();
|
|
|
|
Long employeeId = employee.getEmployeeId();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
String sql =" select p.bqmc,p.bqnr \n" +
|
|
|
|
String sql = " select p.bqmc,p.bqnr \n" +
|
|
|
|
" from(\n" +
|
|
|
|
" from(\n" +
|
|
|
|
" select bqmc,bqnr " +
|
|
|
|
" select bqmc,bqnr " +
|
|
|
|
" from uf_rcbq " +
|
|
|
|
" from uf_rcbq " +
|
|
|
|
" where ry = ? \n" +
|
|
|
|
" where ry = ? \n" +
|
|
|
|
" and delete_type = 0\n" +
|
|
|
|
" and delete_type = 0\n" +
|
|
|
|
" and tenant_key = ? \n" +
|
|
|
|
" and tenant_key = ? \n" +
|
|
|
|
" order by xssx desc\n" +
|
|
|
|
" order by xssx desc\n" +
|
|
|
|
" ) p limit 4" ;
|
|
|
|
" ) p limit 4";
|
|
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
sqlParamEntity.setValue(employeeId+"");
|
|
|
|
sqlParamEntity.setValue(employeeId + "");
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
@ -276,11 +291,11 @@ public class CockpitUserDataCmd {
|
|
|
|
sqlParamEntity.setValue(tenantKey);
|
|
|
|
sqlParamEntity.setValue(tenantKey);
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql, sqlparam);
|
|
|
|
recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
if(recordList.size() < 4){
|
|
|
|
if (recordList.size() < 4) {
|
|
|
|
for(int i=0;i<(4-recordList.size());i++){
|
|
|
|
for (int i = 0; i < (4 - recordList.size()); i++) {
|
|
|
|
Map<String,Object> nullMap = new HashMap<String,Object>();
|
|
|
|
Map<String, Object> nullMap = new HashMap<String, Object>();
|
|
|
|
recordList.add(nullMap);
|
|
|
|
recordList.add(nullMap);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -291,4 +306,202 @@ public class CockpitUserDataCmd {
|
|
|
|
return recordList;
|
|
|
|
return recordList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<Map<String, Object>> getEmpChangeData(String employeeId, String tenantKey) {
|
|
|
|
|
|
|
|
List<Map<String, Object>> changeList = new ArrayList<Map<String, Object>>();
|
|
|
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
//入职
|
|
|
|
|
|
|
|
Map<String, Object> hireMap = getEmployeeHireData(employeeId, tenantKey, groupId, sourceType);
|
|
|
|
|
|
|
|
if (hireMap != null && hireMap.size() > 0) {
|
|
|
|
|
|
|
|
changeList.add(hireMap);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//变更
|
|
|
|
|
|
|
|
List<Map<String, Object>> changeDataList = getEmployeeChangeData(employeeId, tenantKey, groupId, sourceType);
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(changeDataList)) {
|
|
|
|
|
|
|
|
changeList.addAll(changeDataList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// //离职
|
|
|
|
|
|
|
|
// Map<String,Object> departMap = getEmployeeDepartData(employeeId,tenantKey,groupId,sourceType);
|
|
|
|
|
|
|
|
// if(departMap !=null && departMap.size()>0){
|
|
|
|
|
|
|
|
// changeList.add(departMap);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
log.error("getEmpChangeData:" + e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return changeList;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param employeeId
|
|
|
|
|
|
|
|
* @param tenantKey
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public Map<String, Object> getEmployeeHireData(String employeeId, String tenantKey, String groupId, String sourceType) {
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
String hiredate = "";
|
|
|
|
|
|
|
|
String dataSql = " select date_format(a.hiredate,'%Y-%m-%d') hiredate " +
|
|
|
|
|
|
|
|
" from eteams.employee a " +
|
|
|
|
|
|
|
|
" where a.id = ? " +
|
|
|
|
|
|
|
|
" and a.tenant_key = ? " +
|
|
|
|
|
|
|
|
" and a.status = 'normal' " +
|
|
|
|
|
|
|
|
" and a.type = 'inside'" +
|
|
|
|
|
|
|
|
" and delete_type = 0";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.error("getuserIfo--dataSql:" + dataSql);
|
|
|
|
|
|
|
|
List<String> strlist = new ArrayList<>(100);
|
|
|
|
|
|
|
|
strlist.add(employeeId + "");
|
|
|
|
|
|
|
|
strlist.add(tenantKey);
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = databaseUtils.getSqlParamEntity(strlist);
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, dataSql, sqlparam);
|
|
|
|
|
|
|
|
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(recordList)) {
|
|
|
|
|
|
|
|
Map<String, Object> recordMap = recordList.get(0);
|
|
|
|
|
|
|
|
hiredate = CommonUtils.null2String(recordMap.get("hiredate"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(hiredate)) {
|
|
|
|
|
|
|
|
map.put("changedate", hiredate);
|
|
|
|
|
|
|
|
map.put("operator_type", "entry");
|
|
|
|
|
|
|
|
map.put("operator_type_name", "入职");
|
|
|
|
|
|
|
|
map.put("data_type", "");
|
|
|
|
|
|
|
|
map.put("data_value", "");
|
|
|
|
|
|
|
|
map.put("change_id", "");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
log.error("getEmployeeHireData:" + e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return map;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public Map<String,Object> getEmployeeDepartData(Long employeeId,String tenantKey,String groupId,String sourceType){
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Map<String,Object> map = new HashMap<String,Object>();
|
|
|
|
|
|
|
|
// try {
|
|
|
|
|
|
|
|
// String hiredate = "";
|
|
|
|
|
|
|
|
// String dataSql =" select t.change_id,k.change_date,k.operator_type \n" +
|
|
|
|
|
|
|
|
// " from hrm_empchange_user t \n" +
|
|
|
|
|
|
|
|
// " inner join hrm_empchange k on k.id = t.change_id \n" +
|
|
|
|
|
|
|
|
// " where t.employeeid = ? \n" +
|
|
|
|
|
|
|
|
// " and t.delete_type = 0 \n" +
|
|
|
|
|
|
|
|
// " and t.tenant_key = ? " +
|
|
|
|
|
|
|
|
// " and k.delete_type = 0 \n" +
|
|
|
|
|
|
|
|
// " and k.tenant_key = ? " +
|
|
|
|
|
|
|
|
// " and k.batch_status = 2 \n" +
|
|
|
|
|
|
|
|
// " and k.operator_type = 'dismiss' ";
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// log.error("getuserIfo--dataSql:" + dataSql);
|
|
|
|
|
|
|
|
// List<String> strlist = new ArrayList<>(100);
|
|
|
|
|
|
|
|
// strlist.add(employeeId + "");
|
|
|
|
|
|
|
|
// strlist.add(tenantKey);
|
|
|
|
|
|
|
|
// List<SqlParamEntity> sqlparam = databaseUtils.getSqlParamEntity(strlist);
|
|
|
|
|
|
|
|
// Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, dataSql, sqlparam);
|
|
|
|
|
|
|
|
// List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
|
|
|
// if (CollectionUtils.isNotEmpty(recordList)) {
|
|
|
|
|
|
|
|
// Map<String, Object> recordMap = recordList.get(0);
|
|
|
|
|
|
|
|
// change_date = CommonUtils.null2String(recordMap.get("change_date"));
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// if (StringUtils.isNotBlank(hiredate)) {
|
|
|
|
|
|
|
|
// map.put("changedate", hiredate);
|
|
|
|
|
|
|
|
// map.put("operator_type", "entry");
|
|
|
|
|
|
|
|
// map.put("operator_type_name", "入职");
|
|
|
|
|
|
|
|
// map.put("data_type", "");
|
|
|
|
|
|
|
|
// map.put("data_value", "");
|
|
|
|
|
|
|
|
// map.put("change_id", "");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }catch (Exception e){
|
|
|
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
|
|
|
// log.error("getEmployeeHireData:"+e);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// return map;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<Map<String, Object>> getEmployeeChangeData(String employeeId, String tenantKey, String groupId, String sourceType) {
|
|
|
|
|
|
|
|
List<Map<String, Object>> changeList = new ArrayList<Map<String, Object>>();
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
String dataSql = " select t.change_id,date_format(k.change_date,'%Y-%m-%d') change_date,k.operator_type,p.data_type,p.data_value \n" +
|
|
|
|
|
|
|
|
" from eteams.hrm_empchange_user t\n" +
|
|
|
|
|
|
|
|
" inner join eteams.hrm_empchange k on k.id = t.change_id\n" +
|
|
|
|
|
|
|
|
" inner join eteams.hrm_empchange_userdetail p on p.change_id = t.CHANGE_ID\n" +
|
|
|
|
|
|
|
|
" where t.employeeid = ?\n" +
|
|
|
|
|
|
|
|
" and length(p.data_value)>0\n" +
|
|
|
|
|
|
|
|
" and k.batch_status = 2' \n" +
|
|
|
|
|
|
|
|
" and t.delete_type = 0 \n" +
|
|
|
|
|
|
|
|
" and t.tenant_key = ? \n" +
|
|
|
|
|
|
|
|
" and p.delete_type = 0 \n" +
|
|
|
|
|
|
|
|
" and p.tenant_key = ? \n" +
|
|
|
|
|
|
|
|
" and k.delete_type = 0 \n" +
|
|
|
|
|
|
|
|
" and k.tenant_key = ? " +
|
|
|
|
|
|
|
|
" and p.data_type in('newDepartment','newPosition','newSuperior','changeStatus')\n " +
|
|
|
|
|
|
|
|
" order by k.change_date \n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.error("getuserIfo--dataSql:" + dataSql);
|
|
|
|
|
|
|
|
List<String> strlist = new ArrayList<>(100);
|
|
|
|
|
|
|
|
strlist.add(employeeId + "");
|
|
|
|
|
|
|
|
strlist.add(tenantKey);
|
|
|
|
|
|
|
|
strlist.add(tenantKey);
|
|
|
|
|
|
|
|
strlist.add(tenantKey);
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = databaseUtils.getSqlParamEntity(strlist);
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, dataSql, sqlparam);
|
|
|
|
|
|
|
|
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(recordList)) {
|
|
|
|
|
|
|
|
for (int i = 0; i < recordList.size(); i++) {
|
|
|
|
|
|
|
|
Map<String, Object> recordMap = recordList.get(i);
|
|
|
|
|
|
|
|
String operator_type = String.valueOf(recordMap.get("operator_type"));
|
|
|
|
|
|
|
|
String operator_type_name = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ("trial".equals(operator_type)) {
|
|
|
|
|
|
|
|
operator_type_name = "试用";
|
|
|
|
|
|
|
|
} else if ("hire".equals(operator_type)) {
|
|
|
|
|
|
|
|
operator_type_name = "转正";
|
|
|
|
|
|
|
|
} else if ("extend".equals(operator_type)) {
|
|
|
|
|
|
|
|
operator_type_name = "续签";
|
|
|
|
|
|
|
|
} else if ("redeploy".equals(operator_type)) {
|
|
|
|
|
|
|
|
operator_type_name = "调动";
|
|
|
|
|
|
|
|
} else if ("dismiss".equals(operator_type)) {
|
|
|
|
|
|
|
|
operator_type_name = "离职";
|
|
|
|
|
|
|
|
} else if ("retire".equals(operator_type)) {
|
|
|
|
|
|
|
|
operator_type_name = "退休";
|
|
|
|
|
|
|
|
} else if ("quit".equals(operator_type)) {
|
|
|
|
|
|
|
|
operator_type_name = "解聘";
|
|
|
|
|
|
|
|
} else if ("rehire".equals(operator_type)) {
|
|
|
|
|
|
|
|
operator_type_name = "返聘";
|
|
|
|
|
|
|
|
} else if ("custom".equals(operator_type)) {
|
|
|
|
|
|
|
|
operator_type_name = "变更";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
recordMap.put("operator_type_name", operator_type_name);
|
|
|
|
|
|
|
|
String data_type = String.valueOf(recordMap.get("data_type"));
|
|
|
|
|
|
|
|
String data_type_name = "";
|
|
|
|
|
|
|
|
String data_value = String.valueOf(recordMap.get("data_value"));
|
|
|
|
|
|
|
|
String data_value_name = "";
|
|
|
|
|
|
|
|
if ("newDepartment".equals(data_type)) {
|
|
|
|
|
|
|
|
data_type_name = "部门";
|
|
|
|
|
|
|
|
} else if ("newPosition".equals(data_type)) {
|
|
|
|
|
|
|
|
data_type_name = "岗位";
|
|
|
|
|
|
|
|
} else if ("newSuperior".equals(data_type)) {
|
|
|
|
|
|
|
|
data_type_name = "上级";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
recordMap.put("data_type_name", data_type_name);
|
|
|
|
|
|
|
|
recordMap.put("data_value_name", data_value_name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
log.error("getEmpChangeData:" + e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return changeList;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|