|
|
|
@ -36,7 +36,7 @@ public class CockpitUserDataCmd {
|
|
|
|
|
|
|
|
|
|
public Map<String, Object> getDataInfo(SimpleEmployee employee, Map<String, Object> paramMap, String tenantKey) {
|
|
|
|
|
|
|
|
|
|
Map<String, Object> recordMap = new HashMap<String, Object>();
|
|
|
|
|
Map<String, Object> userMap = new HashMap<String, Object>();
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
try {
|
|
|
|
|
String subcompanynme = "";
|
|
|
|
@ -97,7 +97,7 @@ public class CockpitUserDataCmd {
|
|
|
|
|
log.error("jobcallid:" + jobcallid);
|
|
|
|
|
|
|
|
|
|
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 = ?" +
|
|
|
|
|
" ) and delete_type=0 and tenant_key = ?";
|
|
|
|
|
|
|
|
|
@ -124,10 +124,11 @@ public class CockpitUserDataCmd {
|
|
|
|
|
subcompanynme = String.valueOf(recordList.get(0).get("name"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log.error("subcompanynme:" + subcompanynme);
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(jobcallid + "")) {
|
|
|
|
|
String sql = " select data_name from eteams.hrm_jobcall " +
|
|
|
|
|
String sql =" select data_name from eteams.hrm_jobcall " +
|
|
|
|
|
" where id = ? " +
|
|
|
|
|
" and delete_type = 0\n" +
|
|
|
|
|
" and tenant_key = ? \n";
|
|
|
|
@ -180,52 +181,96 @@ public class CockpitUserDataCmd {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log.error("field69:" + field69);
|
|
|
|
|
recordMap.put("employeeId", employeeId);
|
|
|
|
|
recordMap.put("username", username);
|
|
|
|
|
recordMap.put("deptmentnnme", subcompanynme + "-" + deptname);
|
|
|
|
|
recordMap.put("positionname", positionname);
|
|
|
|
|
recordMap.put("userimageurl", userimageurl);
|
|
|
|
|
recordMap.put("jobcallname", jobcallname);
|
|
|
|
|
recordMap.put("personnelstatusname", personnelstatusname);
|
|
|
|
|
recordMap.put("personnelstatus", personnelstatus);
|
|
|
|
|
recordMap.put("gradename", gradename);
|
|
|
|
|
recordMap.put("field69", field69);
|
|
|
|
|
userMap.put("employeeId", employeeId);
|
|
|
|
|
userMap.put("username", username);
|
|
|
|
|
userMap.put("deptmentnnme", subcompanynme + "-" + deptname);
|
|
|
|
|
userMap.put("positionname", positionname);
|
|
|
|
|
userMap.put("userimageurl", userimageurl);
|
|
|
|
|
userMap.put("jobcallname", jobcallname);
|
|
|
|
|
userMap.put("personnelstatusname", personnelstatusname);
|
|
|
|
|
userMap.put("personnelstatus", personnelstatus);
|
|
|
|
|
userMap.put("gradename", gradename);
|
|
|
|
|
userMap.put("field69", field69);
|
|
|
|
|
String avatarUrl = "";
|
|
|
|
|
if (StringUtils.isBlank(avatarUrl)) {
|
|
|
|
|
avatarUrl = "/build/hrm/static/media/male.png";
|
|
|
|
|
|
|
|
|
|
String hiredate = "";
|
|
|
|
|
String resourceimageid = "";
|
|
|
|
|
String sex = "";
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(employeeId)){
|
|
|
|
|
String dataSql =" select date_format(a.hiredate,'%Y-%m-%d') hiredate,resourceimageid,sex " +
|
|
|
|
|
" 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("getEmployeeHireData--dataSql:" + dataSql);
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setValue(employeeId + "");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenantKey);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
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 = String.valueOf(recordMap.get("hiredate"));
|
|
|
|
|
resourceimageid = String.valueOf(recordMap.get("resourceimageid"));
|
|
|
|
|
sex = String.valueOf(recordMap.get("sex"));
|
|
|
|
|
}
|
|
|
|
|
log.error("hiredate:"+hiredate);
|
|
|
|
|
}
|
|
|
|
|
recordMap.put("avatarUrl", avatarUrl);
|
|
|
|
|
|
|
|
|
|
// List<Map<String,String>> customList = new ArrayList<Map<String,String>>();
|
|
|
|
|
// Map<String,String> customMap = new HashMap<String,String>();
|
|
|
|
|
// customMap.put("name","销售排名");
|
|
|
|
|
// customMap.put("value","TOP1");
|
|
|
|
|
// customList.add(customMap);
|
|
|
|
|
//
|
|
|
|
|
// customMap = new HashMap<String,String>();
|
|
|
|
|
// customMap.put("name","职称");
|
|
|
|
|
// customMap.put("value","高级工程师");
|
|
|
|
|
// customList.add(customMap);
|
|
|
|
|
//
|
|
|
|
|
// customMap = new HashMap<String,String>();
|
|
|
|
|
// customMap.put("name","熟悉领域");
|
|
|
|
|
// customMap.put("value","项目实施");
|
|
|
|
|
// customList.add(customMap);
|
|
|
|
|
//
|
|
|
|
|
// customMap = new HashMap<String,String>();
|
|
|
|
|
// customMap.put("name","技能证书");
|
|
|
|
|
// customMap.put("value","人力资源管理师");
|
|
|
|
|
// customList.add(customMap);
|
|
|
|
|
if(StringUtils.isNotBlank(resourceimageid)){
|
|
|
|
|
avatarUrl = "/api/file/preview?type=redirect&fileId="+resourceimageid;
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isBlank(avatarUrl)) {
|
|
|
|
|
if("male".equals(sex)){
|
|
|
|
|
avatarUrl = "/build/hrm/static/media/male.png"; //female
|
|
|
|
|
}else if("female".equals(sex)){
|
|
|
|
|
avatarUrl = "/build/hrm/static/media/female.png"; //female
|
|
|
|
|
}else{
|
|
|
|
|
avatarUrl = "/build/hrm/static/media/male.png"; //female
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
userMap.put("avatarUrl", avatarUrl);
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> customList = getCustomType(employee, tenantKey);
|
|
|
|
|
recordMap.put("customType", customList);
|
|
|
|
|
userMap.put("customType", customList);
|
|
|
|
|
|
|
|
|
|
if(paramMap.containsKey("userid")){
|
|
|
|
|
String userid = String.valueOf(paramMap.get("userid"));
|
|
|
|
|
log.error("userid2:"+userid);
|
|
|
|
|
if (StringUtils.isNotBlank(userid)) {
|
|
|
|
|
employeeId = userid;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> changeList = new ArrayList<Map<String, Object>>();
|
|
|
|
|
if (StringUtils.isNotBlank(hiredate)) {
|
|
|
|
|
Map<String, Object> hireMap = new HashMap<String, Object>();
|
|
|
|
|
hireMap.put("changedate", hiredate);
|
|
|
|
|
hireMap.put("operator_type", "entry");
|
|
|
|
|
hireMap.put("operator_type_name", "入职");
|
|
|
|
|
hireMap.put("data_type", "");
|
|
|
|
|
hireMap.put("data_value", "");
|
|
|
|
|
hireMap.put("change_id", "");
|
|
|
|
|
changeList.add(hireMap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String employeeId2 = String.valueOf(paramMap.get("userid"));
|
|
|
|
|
if (StringUtils.isNotBlank(employeeId2)) {
|
|
|
|
|
employeeId = employeeId2;
|
|
|
|
|
List<Map<String, Object>> empList = getEmpChangeData(employeeId, tenantKey);
|
|
|
|
|
if(!empList.isEmpty() && empList.size()>0){
|
|
|
|
|
changeList.addAll(empList);
|
|
|
|
|
}
|
|
|
|
|
List<Map<String, Object>> changeList = getEmpChangeData(employeeId, tenantKey);
|
|
|
|
|
recordMap.put("changeList", changeList);
|
|
|
|
|
userMap.put("changeList", changeList);
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
@ -255,7 +300,6 @@ public class CockpitUserDataCmd {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Long SubCompanyId = employee.getDepartment().getSubCompanyId();
|
|
|
|
|
log.error("CockpitUserDataCmd-test-SubCompanyId:" + SubCompanyId);
|
|
|
|
|
|
|
|
|
@ -264,6 +308,8 @@ public class CockpitUserDataCmd {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
log.error("getSex:" + employee.getSex().getName());
|
|
|
|
|
log.error("getSex2:" + employee.getSex().getDescription());
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
Date hireDate = employee.getHiredate();
|
|
|
|
@ -272,7 +318,8 @@ public class CockpitUserDataCmd {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return recordMap;
|
|
|
|
|
|
|
|
|
|
return userMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
@ -330,12 +377,12 @@ public class CockpitUserDataCmd {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
//入职
|
|
|
|
|
Map<String, Object> hireMap = getEmployeeHireData(employeeId, tenantKey, groupId, sourceType);
|
|
|
|
|
if (hireMap != null && hireMap.size() > 0) {
|
|
|
|
|
changeList.add(hireMap);
|
|
|
|
|
}
|
|
|
|
|
// Map<String, Object> hireMap = getEmployeeHireData(employeeId, tenantKey, groupId, sourceType);
|
|
|
|
|
// if (hireMap != null && hireMap.size() > 0) {
|
|
|
|
|
// changeList.add(hireMap);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
log.error("changeList:"+changeList.size());
|
|
|
|
|
// log.error("changeList:"+changeList.size());
|
|
|
|
|
//变更
|
|
|
|
|
List<Map<String, Object>> changeDataList = getEmployeeChangeData(employeeId, tenantKey, groupId, sourceType);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(changeDataList)) {
|
|
|
|
@ -365,7 +412,7 @@ public class CockpitUserDataCmd {
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
try {
|
|
|
|
|
String hiredate = "";
|
|
|
|
|
String dataSql = " select date_format(a.hiredate,'%Y-%m-%d') hiredate " +
|
|
|
|
|
String dataSql =" select date_format(a.hiredate,'%Y-%m-%d') hiredate " +
|
|
|
|
|
" from eteams.employee a " +
|
|
|
|
|
" where a.id = ? " +
|
|
|
|
|
" and a.tenant_key = ? " +
|
|
|
|
@ -464,27 +511,27 @@ public class CockpitUserDataCmd {
|
|
|
|
|
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";
|
|
|
|
|
" 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("getEmployeeChangeData--dataSql:" + dataSql);
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setValue(employeeId + "");
|
|
|
|
|
sqlParamEntity.setValue(employeeId);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
@ -588,7 +635,7 @@ public class CockpitUserDataCmd {
|
|
|
|
|
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
log.error("getDepartmentName--recordList:" + recordList.size());
|
|
|
|
|
if(!recordList.isEmpty() && recordList.size()>0){
|
|
|
|
|
deptname = String.valueOf(recordList.get(0).get("name"));
|
|
|
|
|
deptname = String.valueOf(recordList.get(0).get("name"));
|
|
|
|
|
}
|
|
|
|
|
log.error("getDepartmentName--deptname:" + deptname);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|