|
|
|
@ -67,9 +67,11 @@ public class UserInfoCmd {
|
|
|
|
|
*/
|
|
|
|
|
public Map<String, Object> getUserInfo(SimpleEmployee simpleEmployee) {
|
|
|
|
|
Map<String, Object> map = new HashMap<>(100);
|
|
|
|
|
String userid = String.valueOf(simpleEmployee.getEmployeeId());
|
|
|
|
|
// String userid = String.valueOf(simpleEmployee.getEmployeeId());
|
|
|
|
|
Long employeeId = simpleEmployee.getEmployeeId();
|
|
|
|
|
|
|
|
|
|
String username = String.valueOf(simpleEmployee.getName());
|
|
|
|
|
String userimageurl = "/profile/" + userid + "/personal";
|
|
|
|
|
String userimageurl = "/profile/" + employeeId + "/personal";
|
|
|
|
|
String department = "";
|
|
|
|
|
String position = "";
|
|
|
|
|
String days = "";
|
|
|
|
@ -79,74 +81,82 @@ 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 {
|
|
|
|
|
Map<String, Object> recordMap = new HashMap<String, Object>();
|
|
|
|
|
String groupId = "weaver-ebuilder-form-service";
|
|
|
|
|
String sourceType = "LOGIC";
|
|
|
|
|
String tenant_key = "t7akvdnf84";
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(userid)) {
|
|
|
|
|
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"));
|
|
|
|
|
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>();
|
|
|
|
|
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"));
|
|
|
|
|
|
|
|
|
|
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(userid);
|
|
|
|
|
doccreate = getDocCreateNum(employeeId);
|
|
|
|
|
log.error("doccreate:"+doccreate);
|
|
|
|
|
//流程创建
|
|
|
|
|
wfcreate = getWfCreateNum();
|
|
|
|
|
wfcreate = getWfCreateNum(simpleEmployee);
|
|
|
|
|
log.error("wfcreate:"+wfcreate);
|
|
|
|
|
//流程处理
|
|
|
|
|
wfdeal = getWfDealNum();
|
|
|
|
|
wfdeal = getWfDealNum(simpleEmployee);
|
|
|
|
|
log.error("wfdeal:"+wfdeal);
|
|
|
|
|
|
|
|
|
|
//参与群聊数量
|
|
|
|
|
cyqlsl = getCyqlNumNew(userid);
|
|
|
|
|
cyqlsl = getCyqlNumNew(employeeId+"");
|
|
|
|
|
log.error("cyqlsl:"+cyqlsl);
|
|
|
|
|
|
|
|
|
|
mtgtrs = getPjMtgtcsNew(userid);
|
|
|
|
|
mtgtrs = getPjMtgtcsNew(employeeId+"");
|
|
|
|
|
log.error("mtgtrs:"+mtgtrs);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("getUserInfo--Exception:" + e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
map.put("userid", userid);
|
|
|
|
|
|
|
|
|
|
map.put("userid", employeeId+"");
|
|
|
|
|
map.put("userimageurl", userimageurl);
|
|
|
|
|
map.put("username", username);
|
|
|
|
|
map.put("department", department);
|
|
|
|
@ -157,20 +167,18 @@ public class UserInfoCmd {
|
|
|
|
|
map.put("wfdeal", wfdeal);
|
|
|
|
|
map.put("cyqlsl", cyqlsl);
|
|
|
|
|
map.put("mtgtrs", mtgtrs);
|
|
|
|
|
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取文档创建数量
|
|
|
|
|
*
|
|
|
|
|
* @param userid
|
|
|
|
|
* @param employeeId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public String getDocCreateNum(String userid) {
|
|
|
|
|
public String getDocCreateNum(long employeeId) {
|
|
|
|
|
String num = "0";
|
|
|
|
|
try {
|
|
|
|
|
long employeeId = Long.parseLong(userid);
|
|
|
|
|
int doccreatecount = docClientService.countByCreator(employeeId);
|
|
|
|
|
num = doccreatecount + "";
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
@ -185,12 +193,10 @@ public class UserInfoCmd {
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public String getWfCreateNum() {
|
|
|
|
|
public String getWfCreateNum(SimpleEmployee employee) {
|
|
|
|
|
String num = "0";
|
|
|
|
|
try {
|
|
|
|
|
SimpleEmployee employee = UserContext.getCurrentUser();
|
|
|
|
|
RequestListConditionApiEntity conditionEntity = new RequestListConditionApiEntity();
|
|
|
|
|
|
|
|
|
|
WeaResult<RequestCountInfoPAEntity> RequestCountInfoPAEntity = wflRequestListRest.getRequestCountByTabId(employee, RequestListInitDimensionTabEnum.MINE_FLOWALL.getTabid(), conditionEntity);
|
|
|
|
|
Long count = RequestCountInfoPAEntity.getData().getCount();
|
|
|
|
|
num = count + "";
|
|
|
|
@ -206,18 +212,16 @@ public class UserInfoCmd {
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public String getWfDealNum() {
|
|
|
|
|
public String getWfDealNum(SimpleEmployee employee) {
|
|
|
|
|
String num = "0";
|
|
|
|
|
try {
|
|
|
|
|
Long count = 0L;
|
|
|
|
|
SimpleEmployee employee = UserContext.getCurrentUser();
|
|
|
|
|
RequestListConditionApiEntity conditionEntity = new RequestListConditionApiEntity();
|
|
|
|
|
WeaResult<RequestCountInfoPAEntity> RequestCountInfoPAEntity = wflRequestListRest.getRequestCountByTabId(employee, RequestListInitDimensionTabEnum.DONE_FLOWALL.getTabid(), conditionEntity);
|
|
|
|
|
int code = RequestCountInfoPAEntity.getCode();
|
|
|
|
|
if (code == 200) {
|
|
|
|
|
count = RequestCountInfoPAEntity.getData().getCount();
|
|
|
|
|
Long count = RequestCountInfoPAEntity.getData().getCount();
|
|
|
|
|
num = count + "";
|
|
|
|
|
}
|
|
|
|
|
num = count + "";
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("getWfDealNum:" + e);
|
|
|
|
@ -250,7 +254,7 @@ public class UserInfoCmd {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static String calculateMinute2(String sdate) throws ParseException {
|
|
|
|
|
public static String calculateMinute2(String sdate) {
|
|
|
|
|
String rzsj = "";
|
|
|
|
|
try {
|
|
|
|
|
if (sdate.length() >= 10) {
|
|
|
|
@ -357,88 +361,92 @@ public class UserInfoCmd {
|
|
|
|
|
*/
|
|
|
|
|
private String getCyqlNumNew(String 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(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) {
|
|
|
|
|
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 = "20";
|
|
|
|
|
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 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 = "20";
|
|
|
|
|
// 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+"";
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 平均每天沟通人数
|
|
|
|
@ -468,67 +476,68 @@ public class UserInfoCmd {
|
|
|
|
|
return amount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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 = "20";
|
|
|
|
|
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+"";
|
|
|
|
|
}
|
|
|
|
|
// 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 = "20";
|
|
|
|
|
// 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+"";
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|