|
|
|
@ -1,7 +1,5 @@
|
|
|
|
|
package com.weaver.seconddev.jcldoor.cmd;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.weaver.common.base.entity.result.WeaResult;
|
|
|
|
|
import com.weaver.common.hrm.util.Util;
|
|
|
|
|
import com.weaver.ebuilder.datasource.api.entity.SqlParamEntity;
|
|
|
|
@ -67,11 +65,13 @@ public class UserInfoCmd {
|
|
|
|
|
*/
|
|
|
|
|
public Map<String, Object> getUserInfo(SimpleEmployee simpleEmployee) {
|
|
|
|
|
Map<String, Object> map = new HashMap<>(100);
|
|
|
|
|
// String userid = String.valueOf(simpleEmployee.getEmployeeId());
|
|
|
|
|
Long employeeId = simpleEmployee.getEmployeeId();
|
|
|
|
|
|
|
|
|
|
String username = String.valueOf(simpleEmployee.getName());
|
|
|
|
|
Long employeeId = simpleEmployee.getEmployeeId();
|
|
|
|
|
log.error("getUserInfo-employeeId:"+employeeId);
|
|
|
|
|
String userimageurl = "/profile/" + employeeId + "/personal";
|
|
|
|
|
String username = String.valueOf(simpleEmployee.getName());
|
|
|
|
|
log.error("username:"+username);
|
|
|
|
|
|
|
|
|
|
String department = "";
|
|
|
|
|
String position = "";
|
|
|
|
|
String days = "";
|
|
|
|
@ -81,49 +81,58 @@ public class UserInfoCmd {
|
|
|
|
|
String cyqlsl = "0";
|
|
|
|
|
String mtgtrs = "0";
|
|
|
|
|
|
|
|
|
|
// String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
// String sourceType = "LOGIC";
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
try {
|
|
|
|
|
username = simpleEmployee.getName();
|
|
|
|
|
department = simpleEmployee.getDepartment().getName();
|
|
|
|
|
position = simpleEmployee.getPosition().getName();
|
|
|
|
|
String hiredate = sdf.format(simpleEmployee.getHiredate());
|
|
|
|
|
// Map<String, Object> recordMap = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
|
|
String department2 = simpleEmployee.getDepartment().getName();
|
|
|
|
|
log.error("department2:"+department2);
|
|
|
|
|
String position2 = simpleEmployee.getPosition().getName();
|
|
|
|
|
log.error("position2:"+position2);
|
|
|
|
|
String hiredate2 = sdf.format(simpleEmployee.getHiredate());
|
|
|
|
|
log.error("hiredate2:"+hiredate2);
|
|
|
|
|
Map<String, Object> recordMap = new HashMap<String, Object>();
|
|
|
|
|
if (StringUtils.isNotBlank(employeeId+"")) {
|
|
|
|
|
// String dataSql = "select " +
|
|
|
|
|
// " a.id, " +
|
|
|
|
|
// " a.username, " +
|
|
|
|
|
// " a.hiredate, " +
|
|
|
|
|
// " b.name as department, " +
|
|
|
|
|
// " c.name as position " +
|
|
|
|
|
// "from " +
|
|
|
|
|
// " eteams.employee a " +
|
|
|
|
|
// " left join eteams.department b on a.department = b.id " +
|
|
|
|
|
// " left join eteams.position c on c.id = a.position " +
|
|
|
|
|
// "where " +
|
|
|
|
|
// " a.id = ? " +
|
|
|
|
|
// " and a.tenant_key = ? " +
|
|
|
|
|
// " and a.status = 'normal' " +
|
|
|
|
|
// " and a.type = 'inside'";
|
|
|
|
|
// log.error("getuserIfo--dataSql:" + dataSql);
|
|
|
|
|
// List<String> strlist = new ArrayList<>(100);
|
|
|
|
|
// strlist.add(userid);
|
|
|
|
|
// strlist.add(tenant_key);
|
|
|
|
|
// 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)) {
|
|
|
|
|
// recordMap = recordList.get(0);
|
|
|
|
|
// }
|
|
|
|
|
// username = CommonUtils.null2String(recordMap.get("username"));
|
|
|
|
|
// department = CommonUtils.null2String(recordMap.get("department"));
|
|
|
|
|
// position = CommonUtils.null2String(recordMap.get("position"));
|
|
|
|
|
|
|
|
|
|
// String hiredate = CommonUtils.null2String(recordMap.get("hiredate"));
|
|
|
|
|
String dataSql ="select " +
|
|
|
|
|
" a.id, " +
|
|
|
|
|
" a.username, " +
|
|
|
|
|
" a.hiredate, " +
|
|
|
|
|
" b.name as department, " +
|
|
|
|
|
" c.name as position " +
|
|
|
|
|
" from " +
|
|
|
|
|
" eteams.employee a " +
|
|
|
|
|
" left join eteams.department b on a.department = b.id " +
|
|
|
|
|
" left join eteams.position c on c.id = a.position " +
|
|
|
|
|
" where " +
|
|
|
|
|
" a.id = ? " +
|
|
|
|
|
" and a.tenant_key = ? " +
|
|
|
|
|
" and a.status = 'normal' " +
|
|
|
|
|
" and a.type = 'inside'";
|
|
|
|
|
|
|
|
|
|
log.error("getuserIfo--dataSql:" + dataSql);
|
|
|
|
|
List<String> strlist = new ArrayList<>(100);
|
|
|
|
|
strlist.add(employeeId+"");
|
|
|
|
|
strlist.add(tenant_key);
|
|
|
|
|
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)) {
|
|
|
|
|
recordMap = recordList.get(0);
|
|
|
|
|
}
|
|
|
|
|
username = CommonUtils.null2String(recordMap.get("username"));
|
|
|
|
|
log.error("username:"+username);
|
|
|
|
|
|
|
|
|
|
department = CommonUtils.null2String(recordMap.get("department"));
|
|
|
|
|
log.error("department:"+department);
|
|
|
|
|
|
|
|
|
|
position = CommonUtils.null2String(recordMap.get("position"));
|
|
|
|
|
log.error("position:"+position);
|
|
|
|
|
|
|
|
|
|
String hiredate = CommonUtils.null2String(recordMap.get("hiredate"));
|
|
|
|
|
log.error("hiredate:"+hiredate);
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(hiredate)) {
|
|
|
|
|
try {
|
|
|
|
|
days = calculateMinute2(hiredate);
|
|
|
|
@ -153,6 +162,7 @@ public class UserInfoCmd {
|
|
|
|
|
log.error("mtgtrs:"+mtgtrs);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getUserInfo--Exception:" + e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -236,7 +246,7 @@ public class UserInfoCmd {
|
|
|
|
|
* @return
|
|
|
|
|
* @throws ParseException
|
|
|
|
|
*/
|
|
|
|
|
public static int calculateMinute(String sdate) throws ParseException {
|
|
|
|
|
public int calculateMinute(String sdate) throws ParseException {
|
|
|
|
|
long l = 0;
|
|
|
|
|
boolean flag = isTimestampFormat(sdate);
|
|
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
@ -254,7 +264,7 @@ public class UserInfoCmd {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static String calculateMinute2(String sdate) {
|
|
|
|
|
public String calculateMinute2(String sdate) {
|
|
|
|
|
String rzsj = "";
|
|
|
|
|
try {
|
|
|
|
|
if (sdate.length() >= 10) {
|
|
|
|
@ -274,7 +284,7 @@ public class UserInfoCmd {
|
|
|
|
|
return rzsj;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static boolean isTimestampFormat(String inputDate) {
|
|
|
|
|
public boolean isTimestampFormat(String inputDate) {
|
|
|
|
|
// 使用 simpleDateFormat 尝试将输入日期解析为时间戳格式
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
try {
|
|
|
|
@ -359,7 +369,7 @@ public class UserInfoCmd {
|
|
|
|
|
* @param employeeId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private String getCyqlNumNew(String employeeId) {
|
|
|
|
|
public String getCyqlNumNew(String employeeId) {
|
|
|
|
|
String amount = "0";
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
@ -453,7 +463,7 @@ public class UserInfoCmd {
|
|
|
|
|
* @param employeeId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private String getPjMtgtcsNew(String employeeId) {
|
|
|
|
|
public String getPjMtgtcsNew(String employeeId) {
|
|
|
|
|
String amount = "0.0";
|
|
|
|
|
try{
|
|
|
|
|
String sql = "select amount from uf_nj_pjmrdlhhsl where ry = ? and delete_type=0 and tenant_key = ?";
|
|
|
|
|