|
|
|
@ -1,7 +1,8 @@
|
|
|
|
|
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;
|
|
|
|
|
import com.weaver.framework.rpc.annotation.RpcReference;
|
|
|
|
|
import com.weaver.seconddev.jcldoor.util.CommonUtils;
|
|
|
|
@ -64,14 +65,15 @@ public class UserInfoCmd {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public Map<String, Object> getUserInfo(SimpleEmployee simpleEmployee) {
|
|
|
|
|
Map<String, Object> map = new HashMap<>(100);
|
|
|
|
|
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>(100);
|
|
|
|
|
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 userimageurl = "/profile/" + employeeId + "/personal";
|
|
|
|
|
String department = "";
|
|
|
|
|
String position = "";
|
|
|
|
|
String days = "";
|
|
|
|
@ -81,21 +83,11 @@ public class UserInfoCmd {
|
|
|
|
|
String cyqlsl = "0";
|
|
|
|
|
String mtgtrs = "0";
|
|
|
|
|
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
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 " +
|
|
|
|
|
String dataSql =" select " +
|
|
|
|
|
" a.id, " +
|
|
|
|
|
" a.username, " +
|
|
|
|
|
" a.hiredate, " +
|
|
|
|
@ -112,6 +104,7 @@ public class UserInfoCmd {
|
|
|
|
|
" and a.type = 'inside'";
|
|
|
|
|
|
|
|
|
|
log.error("getuserIfo--dataSql:" + dataSql);
|
|
|
|
|
|
|
|
|
|
List<String> strlist = new ArrayList<>(100);
|
|
|
|
|
strlist.add(employeeId+"");
|
|
|
|
|
strlist.add(tenant_key);
|
|
|
|
@ -121,48 +114,35 @@ public class UserInfoCmd {
|
|
|
|
|
if (CollectionUtils.isNotEmpty(recordList)) {
|
|
|
|
|
recordMap = recordList.get(0);
|
|
|
|
|
}
|
|
|
|
|
username = CommonUtils.null2String(recordMap.get("username"));
|
|
|
|
|
log.error("username:"+username);
|
|
|
|
|
|
|
|
|
|
username = CommonUtils.null2String(recordMap.get("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);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("calculateMinute2-e:" + e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(days)) {
|
|
|
|
|
days = String.valueOf(calculateMinute(hiredate));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
log.error("days:"+days);
|
|
|
|
|
//文档创建
|
|
|
|
|
doccreate = getDocCreateNum(employeeId);
|
|
|
|
|
log.error("doccreate:"+doccreate);
|
|
|
|
|
//流程创建
|
|
|
|
|
wfcreate = getWfCreateNum(simpleEmployee);
|
|
|
|
|
log.error("wfcreate:"+wfcreate);
|
|
|
|
|
//流程处理
|
|
|
|
|
wfdeal = getWfDealNum(simpleEmployee);
|
|
|
|
|
log.error("wfdeal:"+wfdeal);
|
|
|
|
|
|
|
|
|
|
//参与群聊数量
|
|
|
|
|
cyqlsl = getCyqlNumNew(employeeId+"");
|
|
|
|
|
log.error("cyqlsl:"+cyqlsl);
|
|
|
|
|
cyqlsl = getCyqlNumNew(employeeId);
|
|
|
|
|
|
|
|
|
|
mtgtrs = getPjMtgtcsNew(employeeId+"");
|
|
|
|
|
log.error("mtgtrs:"+mtgtrs);
|
|
|
|
|
mtgtrs = getPjMtgtcsNew(employeeId);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getUserInfo--Exception:" + e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -177,6 +157,7 @@ public class UserInfoCmd {
|
|
|
|
|
map.put("wfdeal", wfdeal);
|
|
|
|
|
map.put("cyqlsl", cyqlsl);
|
|
|
|
|
map.put("mtgtrs", mtgtrs);
|
|
|
|
|
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -186,7 +167,7 @@ public class UserInfoCmd {
|
|
|
|
|
* @param employeeId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public String getDocCreateNum(long employeeId) {
|
|
|
|
|
public String getDocCreateNum(Long employeeId) {
|
|
|
|
|
String num = "0";
|
|
|
|
|
try {
|
|
|
|
|
int doccreatecount = docClientService.countByCreator(employeeId);
|
|
|
|
@ -264,7 +245,7 @@ public class UserInfoCmd {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String calculateMinute2(String sdate) {
|
|
|
|
|
public String calculateMinute2(String sdate) throws ParseException {
|
|
|
|
|
String rzsj = "";
|
|
|
|
|
try {
|
|
|
|
|
if (sdate.length() >= 10) {
|
|
|
|
@ -369,34 +350,30 @@ public class UserInfoCmd {
|
|
|
|
|
* @param employeeId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public String getCyqlNumNew(String employeeId) {
|
|
|
|
|
public String getCyqlNumNew(Long employeeId) {
|
|
|
|
|
String amount = "0";
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
|
|
|
|
|
try{
|
|
|
|
|
String sql = "select amount from uf_nj_cyqltjb where ry = ? and delete_type=0 and tenant_key = ?";
|
|
|
|
|
List<String> strlist = new ArrayList<>(100);
|
|
|
|
|
strlist.add(employeeId);
|
|
|
|
|
strlist.add(employeeId+"");
|
|
|
|
|
strlist.add(tenant_key);
|
|
|
|
|
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
List<SqlParamEntity> sqlparam = databaseUtils.getSqlParamEntity(strlist);
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
|
|
|
|
|
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
if(recordList.size()>0){
|
|
|
|
|
amount = String.valueOf(recordList.get(0).get("amount"));
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isBlank(amount)){
|
|
|
|
|
amount = "0";
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getCyqlNumNew-e:" + e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return amount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// private String getCyqlNum(String hiredate) {
|
|
|
|
|
// public String getCyqlNum(String hiredate) {
|
|
|
|
|
// int count = 0;
|
|
|
|
|
// try {
|
|
|
|
|
//
|
|
|
|
@ -463,12 +440,12 @@ public class UserInfoCmd {
|
|
|
|
|
* @param employeeId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public String getPjMtgtcsNew(String employeeId) {
|
|
|
|
|
public String getPjMtgtcsNew(Long employeeId) {
|
|
|
|
|
String amount = "0.0";
|
|
|
|
|
try{
|
|
|
|
|
String sql = "select amount from uf_nj_pjmrdlhhsl where ry = ? and delete_type=0 and tenant_key = ?";
|
|
|
|
|
List<String> strlist = new ArrayList<>(100);
|
|
|
|
|
strlist.add(employeeId);
|
|
|
|
|
strlist.add(employeeId+"");
|
|
|
|
|
strlist.add(tenant_key);
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
@ -486,7 +463,6 @@ public class UserInfoCmd {
|
|
|
|
|
return amount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// private String getPjMtgtcs(String hiredate){
|
|
|
|
|
// int count = 0;
|
|
|
|
|
// try {
|
|
|
|
|