|
|
|
@ -39,279 +39,313 @@ public class CockpitUserDataCmd {
|
|
|
|
|
|
|
|
|
|
Map<String, Object> userMap = new HashMap<String, Object>();
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
try {
|
|
|
|
|
String subcompanynme = "";
|
|
|
|
|
String groupId ="weaver-ebuilder-form-service";
|
|
|
|
|
|
|
|
|
|
try{
|
|
|
|
|
|
|
|
|
|
String employeeId = String.valueOf(employee.getEmployeeId());
|
|
|
|
|
Long deptid = 0L ;
|
|
|
|
|
String subcompanynme = "";
|
|
|
|
|
String employeeId = "";
|
|
|
|
|
|
|
|
|
|
String deptname = "" ;
|
|
|
|
|
String positionname = "";
|
|
|
|
|
String username = "";
|
|
|
|
|
try {
|
|
|
|
|
employeeId = String.valueOf(employee.getEmployeeId());
|
|
|
|
|
username = employee.getName();
|
|
|
|
|
}catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getDataInfo1:"+e);
|
|
|
|
|
}
|
|
|
|
|
log.error("employeeId:" + employeeId);
|
|
|
|
|
String username = employee.getName();
|
|
|
|
|
log.error("username:" + username);
|
|
|
|
|
|
|
|
|
|
String deptname = employee.getDepartment().getName();
|
|
|
|
|
try {
|
|
|
|
|
deptname = employee.getDepartment().getName();
|
|
|
|
|
deptid = employee.getDepartment().getId();
|
|
|
|
|
}catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getDataInfo2:"+e);
|
|
|
|
|
}
|
|
|
|
|
log.error("deptname:" + deptname);
|
|
|
|
|
Long deptid = employee.getDepartment().getId();
|
|
|
|
|
log.error("deptid:" + deptid);
|
|
|
|
|
// long subCompanyid = employee.getDepartment().getSubCompanyId();
|
|
|
|
|
|
|
|
|
|
String positionname = employee.getPosition().getName();
|
|
|
|
|
log.error("positionname:" + positionname);
|
|
|
|
|
String gradename = employee.getGrade().getName();
|
|
|
|
|
log.error("gradename:" + gradename);
|
|
|
|
|
|
|
|
|
|
String personnelstatusname = "";
|
|
|
|
|
String personnelstatus = employee.getPersonnelStatus();
|
|
|
|
|
log.error("personnelstatus:" + personnelstatus);
|
|
|
|
|
|
|
|
|
|
if ("1".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "试用员工";
|
|
|
|
|
} else if ("2".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "试用延期员工";
|
|
|
|
|
} else if ("3".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "正式员工";
|
|
|
|
|
} else if ("4".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "临时员工";
|
|
|
|
|
} else if ("5".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "实习员工";
|
|
|
|
|
} else if ("6".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "离职员工";
|
|
|
|
|
} else if ("7".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "退休员工";
|
|
|
|
|
} else if ("9".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "解聘员工";
|
|
|
|
|
} else if ("10".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "无效员工";
|
|
|
|
|
try {
|
|
|
|
|
positionname = employee.getPosition().getName();
|
|
|
|
|
}catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getDataInfo3:"+e);
|
|
|
|
|
}
|
|
|
|
|
log.error("positionname:" + positionname);
|
|
|
|
|
|
|
|
|
|
String personnelstatusname = "正式员工";
|
|
|
|
|
String personnelstatus = "";
|
|
|
|
|
try {
|
|
|
|
|
personnelstatus = employee.getPersonnelStatus();
|
|
|
|
|
log.error("personnelstatus:" + personnelstatus);
|
|
|
|
|
if ("1".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "试用员工";
|
|
|
|
|
} else if ("2".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "试用延期员工";
|
|
|
|
|
} else if ("3".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "正式员工";
|
|
|
|
|
} else if ("4".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "临时员工";
|
|
|
|
|
} else if ("5".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "实习员工";
|
|
|
|
|
} else if ("6".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "离职员工";
|
|
|
|
|
} else if ("7".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "退休员工";
|
|
|
|
|
} else if ("9".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "解聘员工";
|
|
|
|
|
} else if ("10".equals(personnelstatus)) {
|
|
|
|
|
personnelstatusname = "无效员工";
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getDataInfo4:"+e);
|
|
|
|
|
}
|
|
|
|
|
log.error("personnelstatusname:" + personnelstatusname);
|
|
|
|
|
|
|
|
|
|
String userimageurl = "/profile/" + employeeId + "/personal";
|
|
|
|
|
|
|
|
|
|
long formdata = employee.getFormdata();
|
|
|
|
|
log.error("formdata:" + formdata);
|
|
|
|
|
|
|
|
|
|
String pkey = "field69.groupId";
|
|
|
|
|
String groupId = jucailinCockpitUtils.getUfPropData(pkey, tenantKey);
|
|
|
|
|
log.error("groupId:" + groupId);
|
|
|
|
|
|
|
|
|
|
String jobcallname = "";
|
|
|
|
|
long jobcallid = employee.getJobCall();
|
|
|
|
|
log.error("jobcallid:" + jobcallid);
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(deptid + "")) {
|
|
|
|
|
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 = ?";
|
|
|
|
|
|
|
|
|
|
log.error("sql:" + sql);
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setValue(deptid + "");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenantKey);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenantKey);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql, sqlparam);
|
|
|
|
|
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
if (!recordList.isEmpty() && recordList.size() > 0) {
|
|
|
|
|
subcompanynme = String.valueOf(recordList.get(0).get("name"));
|
|
|
|
|
try {
|
|
|
|
|
if (StringUtils.isNotBlank(deptid + "")) {
|
|
|
|
|
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 = ?";
|
|
|
|
|
|
|
|
|
|
log.error("sql:" + sql);
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setValue(deptid + "");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenantKey);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenantKey);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql, sqlparam);
|
|
|
|
|
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
if (!recordList.isEmpty() && recordList.size() > 0) {
|
|
|
|
|
subcompanynme = String.valueOf(recordList.get(0).get("name"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getDataInfo5:"+e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log.error("subcompanynme:" + subcompanynme);
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(jobcallid + "")) {
|
|
|
|
|
String sql =" select data_name from eteams.hrm_jobcall " +
|
|
|
|
|
" where id = ? " +
|
|
|
|
|
" and delete_type = 0\n" +
|
|
|
|
|
" and tenant_key = ? \n";
|
|
|
|
|
log.error("sql:" + sql);
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setValue(jobcallid + "");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenantKey);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql, sqlparam);
|
|
|
|
|
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
if (!recordList.isEmpty() && recordList.size() > 0) {
|
|
|
|
|
jobcallname = String.valueOf(recordList.get(0).get("data_name"));
|
|
|
|
|
String jobcallname = "";
|
|
|
|
|
try{
|
|
|
|
|
long jobcallid = employee.getJobCall();
|
|
|
|
|
log.error("jobcallid:" + jobcallid);
|
|
|
|
|
if (StringUtils.isNotBlank(jobcallid + "")) {
|
|
|
|
|
String sql =" select data_name from eteams.hrm_jobcall " +
|
|
|
|
|
" where id = ? " +
|
|
|
|
|
" and delete_type = 0\n" +
|
|
|
|
|
" and tenant_key = ? \n";
|
|
|
|
|
log.error("sql:" + sql);
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setValue(jobcallid + "");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.VARCHAR);
|
|
|
|
|
sqlParamEntity.setValue(tenantKey);
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql, sqlparam);
|
|
|
|
|
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
if (!recordList.isEmpty() && recordList.size() > 0) {
|
|
|
|
|
jobcallname = String.valueOf(recordList.get(0).get("data_name"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getDataInfo6:"+e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String field69 = "";
|
|
|
|
|
if (StringUtils.isNotBlank(formdata + "")) {
|
|
|
|
|
String sql = " select field69 from eteams.Hrmemployeedefined where form_data_id = ?";
|
|
|
|
|
log.error("getSelfServiceData--sql:" + sql);
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setValue(formdata + "");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql, sqlparam);
|
|
|
|
|
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
if (recordList.size() > 0) {
|
|
|
|
|
field69 = String.valueOf(recordList.get(0).get("field69"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ("1".equals(field69)) {
|
|
|
|
|
field69 = "销售";
|
|
|
|
|
} else if ("2".equals(field69)) {
|
|
|
|
|
field69 = "项目";
|
|
|
|
|
} else if ("3".equals(field69)) {
|
|
|
|
|
field69 = "技术";
|
|
|
|
|
} else if ("4".equals(field69)) {
|
|
|
|
|
field69 = "客服";
|
|
|
|
|
} else if ("5".equals(field69)) {
|
|
|
|
|
field69 = "运营";
|
|
|
|
|
try{
|
|
|
|
|
long formdata = employee.getFormdata();
|
|
|
|
|
log.error("formdata:" + formdata);
|
|
|
|
|
if (StringUtils.isNotBlank(formdata + "")) {
|
|
|
|
|
String sql = " select field69 from eteams.Hrmemployeedefined where form_data_id = ?";
|
|
|
|
|
log.error("getSelfServiceData--sql:" + sql);
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = new ArrayList<SqlParamEntity>();
|
|
|
|
|
SqlParamEntity sqlParamEntity = new SqlParamEntity();
|
|
|
|
|
sqlParamEntity.setParamType(SqlParamType.LONG);
|
|
|
|
|
sqlParamEntity.setValue(formdata + "");
|
|
|
|
|
sqlparam.add(sqlParamEntity);
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql, sqlparam);
|
|
|
|
|
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
if (recordList.size() > 0) {
|
|
|
|
|
field69 = String.valueOf(recordList.get(0).get("field69"));
|
|
|
|
|
}
|
|
|
|
|
if ("1".equals(field69)) {
|
|
|
|
|
field69 = "销售";
|
|
|
|
|
} else if ("2".equals(field69)) {
|
|
|
|
|
field69 = "项目";
|
|
|
|
|
} else if ("3".equals(field69)) {
|
|
|
|
|
field69 = "技术";
|
|
|
|
|
} else if ("4".equals(field69)) {
|
|
|
|
|
field69 = "客服";
|
|
|
|
|
} else if ("5".equals(field69)) {
|
|
|
|
|
field69 = "运营";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getDataInfo6:"+e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log.error("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 = "";
|
|
|
|
|
|
|
|
|
|
String avatarUrl = "";
|
|
|
|
|
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"));
|
|
|
|
|
try {
|
|
|
|
|
String sex = "";
|
|
|
|
|
String resourceimageid = "";
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
log.error("hiredate:"+hiredate);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getDataInfo7:"+e);
|
|
|
|
|
}
|
|
|
|
|
userMap.put("avatarUrl", avatarUrl);
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> customList = getCustomType(employee, tenantKey);
|
|
|
|
|
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>> customList = new ArrayList<Map<String, Object>>();
|
|
|
|
|
try {
|
|
|
|
|
customList = getCustomType(employee, tenantKey);
|
|
|
|
|
userMap.put("customType", customList);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getDataInfo8:"+e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> changeList = new ArrayList<Map<String, Object>>();
|
|
|
|
|
if (StringUtils.isNotBlank(hiredate)) {
|
|
|
|
|
Map<String, Object> hireMap = new HashMap<String, Object>();
|
|
|
|
|
hireMap.put("change_date", 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);
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
if (StringUtils.isNotBlank(hiredate)) {
|
|
|
|
|
Map<String, Object> hireMap = new HashMap<String, Object>();
|
|
|
|
|
hireMap.put("change_date", 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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> empList = getEmpChangeData(employeeId, tenantKey);
|
|
|
|
|
if(!empList.isEmpty() && empList.size()>0){
|
|
|
|
|
changeList.addAll(empList);
|
|
|
|
|
}
|
|
|
|
|
List<Map<String, Object>> empList = getEmpChangeData(employeeId, tenantKey);
|
|
|
|
|
if(!empList.isEmpty() && empList.size()>0){
|
|
|
|
|
changeList.addAll(empList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < changeList.size()-1; i++) {
|
|
|
|
|
Map<String,Object> currentMap = changeList.get(i);
|
|
|
|
|
Map<String,Object> nextMap = changeList.get(i+1);
|
|
|
|
|
String current_changedate = String.valueOf(currentMap.get("change_date"));
|
|
|
|
|
String next_changedate = String.valueOf(nextMap.get("change_date"));
|
|
|
|
|
log.error("current_changedate:"+current_changedate);
|
|
|
|
|
log.error("next_changedate:"+next_changedate);
|
|
|
|
|
|
|
|
|
|
String diffdate = "";
|
|
|
|
|
if(StringUtils.isNotBlank(current_changedate) && StringUtils.isNotBlank(next_changedate)
|
|
|
|
|
&& !"null".equals(current_changedate) && !"null".equals(next_changedate)
|
|
|
|
|
){
|
|
|
|
|
try{
|
|
|
|
|
LocalDate current_date = LocalDate.parse(current_changedate);
|
|
|
|
|
LocalDate next_date = LocalDate.parse(next_changedate);
|
|
|
|
|
// 计算两个日期之间的期间
|
|
|
|
|
Period period = Period.between(current_date, next_date);
|
|
|
|
|
int year = period.getYears();
|
|
|
|
|
int month = period.getMonths();
|
|
|
|
|
if(year > 0){
|
|
|
|
|
diffdate = year+"年";
|
|
|
|
|
for (int i = 0; i < changeList.size()-1; i++) {
|
|
|
|
|
Map<String,Object> currentMap = changeList.get(i);
|
|
|
|
|
Map<String,Object> nextMap = changeList.get(i+1);
|
|
|
|
|
String current_changedate = String.valueOf(currentMap.get("change_date"));
|
|
|
|
|
String next_changedate = String.valueOf(nextMap.get("change_date"));
|
|
|
|
|
log.error("current_changedate:"+current_changedate);
|
|
|
|
|
log.error("next_changedate:"+next_changedate);
|
|
|
|
|
|
|
|
|
|
String diffdate = "";
|
|
|
|
|
if(StringUtils.isNotBlank(current_changedate) && StringUtils.isNotBlank(next_changedate)
|
|
|
|
|
&& !"null".equals(current_changedate) && !"null".equals(next_changedate)
|
|
|
|
|
){
|
|
|
|
|
try{
|
|
|
|
|
LocalDate current_date = LocalDate.parse(current_changedate);
|
|
|
|
|
LocalDate next_date = LocalDate.parse(next_changedate);
|
|
|
|
|
// 计算两个日期之间的期间
|
|
|
|
|
Period period = Period.between(current_date, next_date);
|
|
|
|
|
int year = period.getYears();
|
|
|
|
|
int month = period.getMonths();
|
|
|
|
|
if(year > 0){
|
|
|
|
|
diffdate = year+"年";
|
|
|
|
|
}
|
|
|
|
|
if(month > 0){
|
|
|
|
|
diffdate = diffdate +month+"月";
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getDataInfo:"+e);
|
|
|
|
|
}
|
|
|
|
|
if(month > 0){
|
|
|
|
|
diffdate = diffdate +month+"月";
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getDataInfo:"+e);
|
|
|
|
|
}
|
|
|
|
|
currentMap.put("diffdate",diffdate);
|
|
|
|
|
}
|
|
|
|
|
currentMap.put("diffdate",diffdate);
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getDataInfo9:"+e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String userimageurl = "/profile/" + employeeId + "/personal";
|
|
|
|
|
|
|
|
|
|
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("field69", field69);
|
|
|
|
|
userMap.put("avatarUrl", avatarUrl);
|
|
|
|
|
userMap.put("changeList", changeList);
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("PortalPerformanceInfoCmd :" + e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return userMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|