|
|
@ -1,5 +1,7 @@
|
|
|
|
package com.weaver.seconddev.jcldoor.cmd;
|
|
|
|
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.base.entity.result.WeaResult;
|
|
|
|
import com.weaver.ebuilder.datasource.api.entity.SqlParamEntity;
|
|
|
|
import com.weaver.ebuilder.datasource.api.entity.SqlParamEntity;
|
|
|
|
import com.weaver.framework.rpc.annotation.RpcReference;
|
|
|
|
import com.weaver.framework.rpc.annotation.RpcReference;
|
|
|
@ -19,6 +21,7 @@ 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.ParseException;
|
|
|
|
import java.text.ParseException;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.time.LocalDate;
|
|
|
|
import java.time.LocalDate;
|
|
|
@ -47,6 +50,9 @@ public class UserInfoCmd {
|
|
|
|
@RpcReference(group = "workflow")
|
|
|
|
@RpcReference(group = "workflow")
|
|
|
|
WflRequestListRest wflRequestListRest;
|
|
|
|
WflRequestListRest wflRequestListRest;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RpcReference
|
|
|
|
|
|
|
|
private com.weaver.em.msg.api.rest.OaRest oaRest;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private JucailinPortalUtils jucailinPortalUtils;
|
|
|
|
private JucailinPortalUtils jucailinPortalUtils;
|
|
|
|
|
|
|
|
|
|
|
@ -131,9 +137,10 @@ public class UserInfoCmd {
|
|
|
|
//流程处理
|
|
|
|
//流程处理
|
|
|
|
wfdeal = getWfDealNum();
|
|
|
|
wfdeal = getWfDealNum();
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//参与群聊数量
|
|
|
|
cyqlsl = "0";
|
|
|
|
cyqlsl = getCyqlNum(hiredate);
|
|
|
|
mtgtrs = "0";
|
|
|
|
|
|
|
|
|
|
|
|
mtgtrs = getPjMtgtcs(hiredate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
log.error("getUserInfo--Exception:" + e.getMessage());
|
|
|
|
log.error("getUserInfo--Exception:" + e.getMessage());
|
|
|
@ -276,6 +283,7 @@ public class UserInfoCmd {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取人员类型
|
|
|
|
* 获取人员类型
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param simpleEmployee
|
|
|
|
* @param simpleEmployee
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -341,5 +349,128 @@ public class UserInfoCmd {
|
|
|
|
return type;
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String getCyqlNum(String hiredate) {
|
|
|
|
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean flag = isTimestampFormat(hiredate);
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // 定义日期格式
|
|
|
|
|
|
|
|
String sdate = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
|
|
|
|
calendar.add(Calendar.DAY_OF_YEAR, -1);
|
|
|
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
|
|
String edate = dateFormat.format(calendar.getTime());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (flag) {
|
|
|
|
|
|
|
|
sdate = hiredate.substring(0, 10);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
long timestamp = new Long(hiredate); // 时间戳,单位是毫秒
|
|
|
|
|
|
|
|
Date rzdate = new Date(timestamp); // 将时间戳转换为Date对象
|
|
|
|
|
|
|
|
sdate = sdf.format(rzdate);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleEmployee employee = UserContext.getCurrentUser();
|
|
|
|
|
|
|
|
Long cid = employee.getCid();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.error("cid:" + cid);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String pageSize = "100";
|
|
|
|
|
|
|
|
String pageNum = "1";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> json = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
json.put("cid", cid);
|
|
|
|
|
|
|
|
json.put("pageNum", pageNum);
|
|
|
|
|
|
|
|
json.put("pageSize", pageSize);
|
|
|
|
|
|
|
|
json.put("startDate", sdate);
|
|
|
|
|
|
|
|
json.put("endDate", edate);
|
|
|
|
|
|
|
|
log.error("getCyqlNum json:" + JSON.toJSONString(json));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
com.weaver.em.msg.api.entity.Request emrequest = new com.weaver.em.msg.api.entity.Request();
|
|
|
|
|
|
|
|
emrequest.setUrl("/user-profile/groupSession");
|
|
|
|
|
|
|
|
emrequest.setParamsMap(json);
|
|
|
|
|
|
|
|
emrequest.setAsync(false);
|
|
|
|
|
|
|
|
log.error("getCyqlNum:" + emrequest.toString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
com.weaver.em.msg.api.entity.Response response2 = oaRest.executeIm(emrequest);
|
|
|
|
|
|
|
|
log.error("getCyqlNum:" + response2.toString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String data = response2.getData();
|
|
|
|
|
|
|
|
log.error("getCyqlNum data:" + data);
|
|
|
|
|
|
|
|
JSONObject resObj = JSONObject.parseObject(data);
|
|
|
|
|
|
|
|
JSONObject actionMsg = (JSONObject) resObj.get("actionMsg");
|
|
|
|
|
|
|
|
int code = (int) actionMsg.get("code");
|
|
|
|
|
|
|
|
if(code == 0){
|
|
|
|
|
|
|
|
JSONObject dataObj = (JSONObject) resObj.get("data");
|
|
|
|
|
|
|
|
count = (int) dataObj.get("count");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
log.error("getCyqlNum Exception:" + e.getMessage());
|
|
|
|
|
|
|
|
count = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return count+"";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String getPjMtgtcs(String hiredate){
|
|
|
|
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean flag = isTimestampFormat(hiredate);
|
|
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // 定义日期格式
|
|
|
|
|
|
|
|
String sdate = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
|
|
|
|
calendar.add(Calendar.DAY_OF_YEAR, -1);
|
|
|
|
|
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
|
|
String edate = dateFormat.format(calendar.getTime());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (flag) {
|
|
|
|
|
|
|
|
sdate = hiredate.substring(0, 10);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
long timestamp = new Long(hiredate); // 时间戳,单位是毫秒
|
|
|
|
|
|
|
|
Date rzdate = new Date(timestamp); // 将时间戳转换为Date对象
|
|
|
|
|
|
|
|
sdate = sdf.format(rzdate);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleEmployee employee = UserContext.getCurrentUser();
|
|
|
|
|
|
|
|
Long cid = employee.getCid();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String pageSize = "100";
|
|
|
|
|
|
|
|
String pageNum = "1";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> json = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
json.put("cid", cid);
|
|
|
|
|
|
|
|
json.put("pageNum", pageNum);
|
|
|
|
|
|
|
|
json.put("pageSize", pageSize);
|
|
|
|
|
|
|
|
json.put("startDate", sdate);
|
|
|
|
|
|
|
|
json.put("endDate", edate);
|
|
|
|
|
|
|
|
log.error("getPjMtgtcs json:" + JSON.toJSONString(json));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
com.weaver.em.msg.api.entity.Request emrequest = new com.weaver.em.msg.api.entity.Request();
|
|
|
|
|
|
|
|
emrequest.setUrl("/user-profile/dailySingleSession");
|
|
|
|
|
|
|
|
emrequest.setParamsMap(json);
|
|
|
|
|
|
|
|
emrequest.setAsync(false);
|
|
|
|
|
|
|
|
log.error("getPjMtgtcs:" + emrequest.toString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
com.weaver.em.msg.api.entity.Response response2 = oaRest.executeIm(emrequest);
|
|
|
|
|
|
|
|
log.error("getPjMtgtcs:" + response2.toString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String data = response2.getData();
|
|
|
|
|
|
|
|
log.error("getPjMtgtcs data:" + data);
|
|
|
|
|
|
|
|
JSONObject resObj = JSONObject.parseObject(data);
|
|
|
|
|
|
|
|
JSONObject actionMsg = (JSONObject) resObj.get("actionMsg");
|
|
|
|
|
|
|
|
int code = (int) actionMsg.get("code");
|
|
|
|
|
|
|
|
if(code == 0){
|
|
|
|
|
|
|
|
JSONObject dataObj = (JSONObject) resObj.get("data");
|
|
|
|
|
|
|
|
count = (int) dataObj.get("count");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
log.error("getPjMtgtcs Exception:" + e.getMessage());
|
|
|
|
|
|
|
|
count = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return count+"";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|