#E10-47# 接口优化

main
shilei 11 months ago
parent ba8ac14f42
commit a5374b6fba

@ -22,7 +22,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
@ -64,9 +63,23 @@ public class CockpitWorkAchievementsCmd {
Map<String,String> threeMap = new HashMap<String,String>(100);
Map<String,String> fourMap = new HashMap<String,String>(100);
String startday = "";
if(paramMap.containsKey("startday")){
startday = String.valueOf(paramMap.get("startday"));
}
String endday = "";
if(paramMap.containsKey("startday")){
endday = String.valueOf(paramMap.get("endday"));
}
String startday = String.valueOf(paramMap.get("startday"));
String endday = String.valueOf(paramMap.get("endday"));
String employeeId = simpleEmployee.getEmployeeId()+"";
if(paramMap.containsKey("userid")){
String userid = String.valueOf(paramMap.get("userid"));
if(StringUtils.isNotBlank(userid)){
employeeId = userid;
}
}
String one = "0";
String oneword = "";
@ -85,10 +98,9 @@ public class CockpitWorkAchievementsCmd {
String foururl = "";
try {
String employeeId = String.valueOf(simpleEmployee.getEmployeeId());
//销售 0项目 1,技术 2其它 3
String znlx = getUserType(simpleEmployee,tenantKey);
log.error("znlx:"+znlx);
//销售 0项目 1,技术 2其它 3
if("2".equals(znlx)){
@ -224,35 +236,6 @@ public class CockpitWorkAchievementsCmd {
return recordMap;
}
public String getScore( List<Long> userList,String startDay, String endDay,String dateType,String tenantKey) {
String scoreData = "0.00" ;
try {
FlowDataListReq flowDataListReq = new FlowDataListReq();
flowDataListReq.setCurrent(1);
flowDataListReq.setPageSize(20);
flowDataListReq.setStartTime(startDay + "");
flowDataListReq.setEndTime(endDay + "");
flowDataListReq.setDateType(dateType);
flowDataListReq.setTenantKey(tenantKey);
flowDataListReq.setUserList(userList);
FlowData flowData = remotePerformanceService.queryFlowData(flowDataListReq);
log.error("getWholeYearKpi2-flowData:" + flowData);
List<FlowDataListRes> flowDataList = flowData.getDataList();
if (flowDataList.size() > 0) {
for (int index = 0; index < flowDataList.size(); index++) {
FlowDataListRes flowDataListRes = flowDataList.get(index);
float score = flowDataListRes.getScore();
scoreData = score+"";
}
}
} catch (Exception e) {
log.error("getWholeYearKpi2-getScore-Exception:" + e.getMessage());
}
return scoreData;
}
/***
*
* @param startday
@ -279,10 +262,6 @@ public class CockpitWorkAchievementsCmd {
endday = sdf.format(new Date());
}
if (StringUtils.isBlank(employeeId)) {
employeeId = String.valueOf(UserContext.getCurrentEmployeeId());
}
if (StringUtils.isNotBlank(employeeId)) {
String dataSql =" select ifnull(sum(d.integer2),0) as devcou \n" +
" from wfc_form_data l\n" +
@ -313,6 +292,7 @@ public class CockpitWorkAchievementsCmd {
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, dataSql,sqlparam);
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
log.error("recordList:"+recordList.size());
if(recordList.size()>0){
quecou = String.valueOf(recordList.get(0).get("devcou"));
}
@ -402,9 +382,6 @@ public class CockpitWorkAchievementsCmd {
if (StringUtils.isBlank(endday)) {
endday = sdf.format(new Date());
}
if (StringUtils.isBlank(employeeId)) {
employeeId = String.valueOf(UserContext.getCurrentEmployeeId());
}
if (StringUtils.isNotBlank(employeeId)) {
String dataSql =" select count(1) as devcou \n" +
@ -422,6 +399,8 @@ public class CockpitWorkAchievementsCmd {
" and p.delete_type=0\n" +
" order by d.id desc ";
log.error("getDaysInfo-dataSql:" + dataSql);
List<String> strlist = new ArrayList<>(100);
strlist.add(employeeId);
strlist.add(startday);
@ -430,9 +409,10 @@ public class CockpitWorkAchievementsCmd {
strlist.add(tenantKey);
strlist.add(tenantKey);
List<SqlParamEntity> sqlparam = databaseUtils.getSqlParamEntity(strlist);
log.info("DevDaysCountCmd sql:" + dataSql);
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, dataSql,sqlparam);
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
log.error("recordList:"+recordList.size());
if(recordList.size()>0){
devcou = String.valueOf(recordList.get(0).get("devcou"));
}
@ -474,7 +454,7 @@ public class CockpitWorkAchievementsCmd {
String sql =" select count(1) as count from cw_content " +
" where CREATOR=?\n" +
" and left(create_time,10)>=? " +
" and left(create_time,10) <= ?" +
" and left(create_time,10)<= ?" +
" and tenant_key = ?" +
" and delete_type = 0 ";
@ -489,12 +469,14 @@ public class CockpitWorkAchievementsCmd {
List<SqlParamEntity> sqlparam = databaseUtils.getSqlParamEntity(strlist);
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql, sqlparam);
List<Map<String, Object>> recordList = databaseUtils.getDataSourceList(result);
log.error("recordList:"+recordList.size());
if (recordList.size() > 0) {
count = String.valueOf(recordList.get(0).get("count"));
}
}catch (Exception e){
e.printStackTrace();
log.error("getCoWorkInfo-Exception:"+e.getMessage());
log.error("getCoWorkInfo-e:"+e.getMessage());
}
return count;
}
@ -520,7 +502,7 @@ public class CockpitWorkAchievementsCmd {
}
} catch (Exception e) {
e.printStackTrace();
log.error("getWfInfo-Exception:" + e);
log.error("getWfInfo-e:" + e);
}
return wfcount;
}
@ -552,77 +534,75 @@ public class CockpitWorkAchievementsCmd {
endday = sdf.format(new Date());
}
if(StringUtils.isBlank(employeeId)){
employeeId = String.valueOf(UserContext.getCurrentEmployeeId());
}
if(StringUtils.isNotBlank(employeeId)){
String sql =" SELECT \n" +
" CONVERT(ifnull(sum(cast(t1.skje as decimal(18,2))),0),CHAR) as skje,\n" + //收款金额
" CONVERT(ifnull(sum(cast(t1.xmskje as decimal(18,2))),0),CHAR) as xmskje,\n" + // 项目收款金额
" CONVERT(ifnull(sum(cast(t1.xsyxje as decimal(18,2))),0),CHAR) as xsyxje," + // 销售有效金额
" CONVERT(ifnull(sum(cast(t1.xsje as decimal(18,2))),0),CHAR) as xsje," + // 销售金额
" CONVERT(ifnull(sum(cast(t1.xmyxje as decimal(18,2))),0),CHAR) as xmyxje," + //项目有效金额
" CONVERT(ifnull(sum(cast(t1.xsjxhk as decimal(18,2))),0),CHAR) as xsjxhk," + //有效绩效回款
" CONVERT(ifnull(sum(cast(t1.sumsk as decimal(18,2))),0),CHAR) as sumsk," + //总收款金额
" CONVERT(ifnull(sum(cast(t1.sjjsk as decimal(18,2))),0),CHAR) as sjjsk," + //实际结算款
" CONVERT(ifnull(sum(cast(t1.skjs as decimal(18,2))),0),CHAR) as skjs " + //收款结算
" FROM uf_jxhs_skmx t1\n" +
" LEFT JOIN uf_jxhs_zxhtzb t2 ON t1.hth = t2.hth AND t2.hth != '' AND t2.hth IS NOT NULL \n" +
" LEFT JOIN ebdf_physical_data epd on t1.id = epd.form_data_id and epd.delete_type = 0 \n" +
" WHERE t1.skje != 0 \n" +
" and t1.skje IS NOT NULL " +
" and t1.xshsny >= ? and t1.xshsny <=? "+
" and (" +
" ? IN ( 2, 27, 166, 10285, 11661, 300, 876, 3593, 1416, 1647, 1844,3044480226941419013,794508876297846787 ) \n" +
" or cast(t1.xsjl AS decimal(25,0)) in( \n" +
" SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" +
" UNION " +
" SELECT id FROM eteams.employee WHERE id = ? " +
" )\n" +
" or cast(t1.kfry AS decimal(25,0)) in(\n" +
" SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" +
" UNION " +
" SELECT id FROM eteams.employee WHERE id = ? " +
" )\n" +
" or cast(t1.qdjl AS decimal(25,0)) in(\n" +
" SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" +
" UNION " +
" SELECT id FROM eteams.employee WHERE id = ? " +
" )\n" +
" or cast(t1.xmjl AS decimal(25,0)) in(\n" +
" SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" +
" UNION " +
" SELECT id FROM eteams.employee WHERE id = ? " +
" )\n" +
" )\n" +
" order by t1.id " ;
log.error("getSkInfo-sql:"+sql);
List<String> strlist = new ArrayList<>(100);
strlist.add(startday);
strlist.add(endday);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
List<SqlParamEntity> sqlparam = databaseUtils.getSqlParamEntity(strlist);
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
log.error("recordList:"+recordList.size());
String sql =" SELECT \n" +
" CONVERT(ifnull(sum(cast(t1.skje as decimal(18,2))),0),CHAR) as skje,\n" + //收款金额
" CONVERT(ifnull(sum(cast(t1.xmskje as decimal(18,2))),0),CHAR) as xmskje,\n" + // 项目收款金额
" CONVERT(ifnull(sum(cast(t1.xsyxje as decimal(18,2))),0),CHAR) as xsyxje," + // 销售有效金额
" CONVERT(ifnull(sum(cast(t1.xsje as decimal(18,2))),0),CHAR) as xsje," + // 销售金额
" CONVERT(ifnull(sum(cast(t1.xmyxje as decimal(18,2))),0),CHAR) as xmyxje," + //项目有效金额
" CONVERT(ifnull(sum(cast(t1.xsjxhk as decimal(18,2))),0),CHAR) as xsjxhk," + //有效绩效回款
" CONVERT(ifnull(sum(cast(t1.sumsk as decimal(18,2))),0),CHAR) as sumsk," + //总收款金额
" CONVERT(ifnull(sum(cast(t1.sjjsk as decimal(18,2))),0),CHAR) as sjjsk," + //实际结算款
" CONVERT(ifnull(sum(cast(t1.skjs as decimal(18,2))),0),CHAR) as skjs " + //收款结算
" FROM uf_jxhs_skmx t1\n" +
" LEFT JOIN uf_jxhs_zxhtzb t2 ON t1.hth = t2.hth AND t2.hth != '' AND t2.hth IS NOT NULL \n" +
" LEFT JOIN ebdf_physical_data epd on t1.id = epd.form_data_id and epd.delete_type = 0 \n" +
" WHERE t1.skje != 0 \n" +
" and t1.skje IS NOT NULL " +
" and t1.xshsny >= ? and t1.xshsny <=? "+
" and (" +
" ? IN ( 2, 27, 166, 10285, 11661, 300, 876, 3593, 1416, 1647, 1844,3044480226941419013,794508876297846787 ) \n" +
" or cast(t1.xsjl AS decimal(25,0)) in( \n" +
" SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" +
" UNION " +
" SELECT id FROM eteams.employee WHERE id = ? " +
" )\n" +
" or cast(t1.kfry AS decimal(25,0)) in(\n" +
" SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" +
" UNION " +
" SELECT id FROM eteams.employee WHERE id = ? " +
" )\n" +
" or cast(t1.qdjl AS decimal(25,0)) in(\n" +
" SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" +
" UNION " +
" SELECT id FROM eteams.employee WHERE id = ? " +
" )\n" +
" or cast(t1.xmjl AS decimal(25,0)) in(\n" +
" SELECT cid AS id FROM eteams.emp_link WHERE pid = ? and RELATION in ('othersenior','senior') \n" +
" UNION " +
" SELECT id FROM eteams.employee WHERE id = ? " +
" )\n" +
" )\n" +
" order by t1.id " ;
log.error("PorojectReceiptsInfoCmd sql:"+sql);
List<String> strlist = new ArrayList<>(100);
strlist.add(startday);
strlist.add(endday);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
List<SqlParamEntity> sqlparam = databaseUtils.getSqlParamEntity(strlist);
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
log.error("recordList:"+recordList.size());
if(!CollectionUtils.isEmpty(recordList)){
skje = String.valueOf(recordList.get(0).get("skje"));
if(recordList.size()>0){
skje = String.valueOf(recordList.get(0).get("skje"));
}
log.error("skje:"+skje);
}
log.error("skje:"+skje);
} catch (Exception e) {
e.printStackTrace();
log.error("PorojectReceiptsInfoCmd Exception:"+e);
log.error("getSkInfo-e:"+e);
}
return skje;
}
@ -646,60 +626,58 @@ public class CockpitWorkAchievementsCmd {
if(StringUtils.isBlank(endday)){
endday = sdf.format(new Date());
}
if(StringUtils.isBlank(employeeId)){
employeeId = String.valueOf(UserContext.getCurrentEmployeeId());
}
String sql =" select CONVERT(ifnull(sum(cast(t1.htzje as decimal(18,2))),0),CHAR) as htzje," +
" CONVERT(ifnull(sum(cast(t1.htyxje as decimal(18,2))),0),CHAR) as htyxje," +
" CONVERT(ifnull(sum(cast(t1.sumsk as decimal(18,2))),0),CHAR) as sumsk " +
" from uf_jxhs_xmys t1 \n" +
" where t1.ysrq>=? and t1.ysrq<=? " +
" and ( t1.qyjl = ? "+
" or t1.qyjl in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" +
" or t1.ysry = ?\n" +
" or t1.ysry in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" +
" or t1.dqfzr = ?\n" +
" or t1.dqfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" +
" or t1.tdjl = ?\n" +
" or t1.tdjl in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" +
" or t1.tdfzr = ?\n" +
" or t1.tdfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" +
" or t1.jgfzr = ?\n" +
" or t1.jgfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" +
" or t1.dqzj = ?\n" +
" or t1.dqzj in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?) " +
" ) " ;
List<String> strlist = new ArrayList<>(100);
strlist.add(startday);
strlist.add(endday);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
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(StringUtils.isNotBlank(employeeId)){
String sql =" select CONVERT(ifnull(sum(cast(t1.htzje as decimal(18,2))),0),CHAR) as htzje," +
" CONVERT(ifnull(sum(cast(t1.htyxje as decimal(18,2))),0),CHAR) as htyxje," +
" CONVERT(ifnull(sum(cast(t1.sumsk as decimal(18,2))),0),CHAR) as sumsk " +
" from uf_jxhs_xmys t1 \n" +
" where t1.ysrq>=? and t1.ysrq<=? " +
" and ( t1.qyjl = ? "+
" or t1.qyjl in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" +
" or t1.ysry = ?\n" +
" or t1.ysry in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" +
" or t1.dqfzr = ?\n" +
" or t1.dqfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" +
" or t1.tdjl = ?\n" +
" or t1.tdjl in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" +
" or t1.tdfzr = ?\n" +
" or t1.tdfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" +
" or t1.jgfzr = ?\n" +
" or t1.jgfzr in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?)\n" +
" or t1.dqzj = ?\n" +
" or t1.dqzj in (select cid from eteams.EMP_LINK where RELATION in ('othersenior','senior') and pid= ?) " +
" ) " ;
log.error("getYsInfo-sql:"+sql);
List<String> strlist = new ArrayList<>(100);
strlist.add(startday);
strlist.add(endday);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
strlist.add(employeeId);
if(!recordList.isEmpty() && recordList.size()>0){
htzje = String.valueOf(recordList.get(0).get("htzje"));
List<SqlParamEntity> sqlparam = databaseUtils.getSqlParamEntity(strlist);
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
log.error("recordList:"+recordList.size());
if(recordList.size()>0){
htzje = String.valueOf(recordList.get(0).get("htzje"));
}
}
} catch (Exception e) {
e.printStackTrace();
log.error("PorojectAcceptanceInfoCmd:"+e.getMessage());
log.error("getYsInfo-e:"+e.getMessage());
}
return htzje;
}
@ -728,28 +706,27 @@ public class CockpitWorkAchievementsCmd {
endday = sdf.format(new Date());
}
if(StringUtils.isBlank(employeeId)){
employeeId = String.valueOf(UserContext.getCurrentEmployeeId());
}
String sql = " select count(1) as count " +
" from document " +
" where CREATOR=?\n" +
" and left(create_time,10)>=? " +
" and left(create_time,10) <= ?" ;
if(StringUtils.isNotBlank(employeeId)){
String sql = " select count(1) as count " +
" from document " +
" where CREATOR=?\n" +
" and left(create_time,10)>=? " +
" and left(create_time,10) <= ?" ;
log.error("PortalDocCreateCountCmd sql:"+sql);
List<String> strlist = new ArrayList<>(100);
strlist.add(employeeId);
strlist.add(startday);
strlist.add(endday);
log.error("getDocInfo-sql:"+sql);
List<String> strlist = new ArrayList<>(100);
strlist.add(employeeId);
strlist.add(startday);
strlist.add(endday);
List<SqlParamEntity> sqlparam = databaseUtils.getSqlParamEntity(strlist);
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){
count = String.valueOf(recordList.get(0).get("count"));
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
log.error("recordList:"+recordList.size());
if(recordList.size()>0){
count = String.valueOf(recordList.get(0).get("count"));
}
}
}catch (Exception e){
e.printStackTrace();
@ -776,35 +753,35 @@ public class CockpitWorkAchievementsCmd {
endday = sdf.format(new Date());
}
if(StringUtils.isBlank(employeeId)){
employeeId = String.valueOf(UserContext.getCurrentEmployeeId());
}
String sql =" select count(1) as count\n" +
" from blog " +
" where creator=?\n" +
" and left(BLOG_TIME,10) >=?\n" +
" and left(BLOG_TIME,10) <=?\n" +
" and type='blog'\n" +
" and TENANT_KEY = ?\n" +
" and MODULE = 'blog'\n" +
" and DELETE_TYPE = 0\n" +
" and CONTENT is not null" ;
if(StringUtils.isNotBlank(employeeId)){
String sql =" select count(1) as count\n" +
" from blog " +
" where creator=?\n" +
" and left(BLOG_TIME,10) >=?\n" +
" and left(BLOG_TIME,10) <=?\n" +
" and type='blog'\n" +
" and TENANT_KEY = ?\n" +
" and MODULE = 'blog'\n" +
" and DELETE_TYPE = 0\n" +
" and CONTENT is not null" ;
List<String> strlist = new ArrayList<>(100);
strlist.add(employeeId);
strlist.add(startday);
strlist.add(endday);
strlist.add(tenantKey);
log.error("getDailyInfo-sql:"+sql);
List<String> strlist = new ArrayList<>(100);
strlist.add(employeeId);
strlist.add(startday);
strlist.add(endday);
strlist.add(tenantKey);
List<SqlParamEntity> sqlparam = databaseUtils.getSqlParamEntity(strlist);
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){
count = String.valueOf(recordList.get(0).get("count"));
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
if(recordList.size()>0){
count = String.valueOf(recordList.get(0).get("count"));
}
}
}catch (Exception e){
e.printStackTrace();
log.error("getDailyInfo-e:"+e);

@ -229,9 +229,10 @@ public class CockpitWorkDate4TypeCmd {
List<Map<String,String>> datalist = new ArrayList<>(100);
try {
long employeeId = employee.getEmployeeId();
Long userid = employee.getUserId();
Map<String,String> calendarMap = new HashMap<String,String>();
String calendar_count = getCalendarDateAmount(employeeId,"1",tenantKey);
String calendar_count = getCalendarDataAmount(userid,tenantKey);
String calendar_name = "日程";
String calendar_pkey = "calendar.create.amount";
String calendar_url = jucailinCockpitUtils.getUfPropData(calendar_pkey,tenantKey);
@ -241,7 +242,7 @@ public class CockpitWorkDate4TypeCmd {
datalist.add(calendarMap);
calendarMap = new HashMap<String,String>();
String calendar_count2 = getCalendarDateAmount(employeeId,"2",tenantKey);
String calendar_count2 = getTaskDataAmount(employeeId,"2",tenantKey);
String calendar_name2 = "我的任务";
String calendar_pkey2 = "task.mine.amount";
String calendar_url2 = jucailinCockpitUtils.getUfPropData(calendar_pkey2,tenantKey);
@ -251,7 +252,7 @@ public class CockpitWorkDate4TypeCmd {
datalist.add(calendarMap);
calendarMap = new HashMap<String,String>();
String calendar_count3 = getCalendarDateAmount(employeeId,"3",tenantKey);
String calendar_count3 = getTaskDataAmount(employeeId,"3",tenantKey);
String calendar_name3 = "关注任务";
String calendar_pkey3 = "task.watch.amount";
String calendar_url3 = jucailinCockpitUtils.getUfPropData(calendar_pkey3,tenantKey);
@ -453,24 +454,45 @@ public class CockpitWorkDate4TypeCmd {
}
/***
*
* @param employeeId
* @param tenantKey
* @return
*/
public String getCalendarDataAmount(Long employeeId,String tenantKey) {
String count = "0";
try {
int clendarcount = remoteAgendaService.countCalendar(employeeId,tenantKey);
count = clendarcount + "";
} catch (Exception e) {
e.printStackTrace();
log.error("getDocCreateNum:" + e);
}
return count;
}
public String getCalendarDateAmount(Long employeeId,String type,String tenantKey) {
/***
*
* @param employeeId
* @param type
* @param tenantKey
* @return
*/
public String getTaskDataAmount(Long employeeId,String type,String tenantKey) {
String count = "0";
String groupId = "weaver-doc-service";
String sourceType = "LOGIC";
try {
if("1".equals(type)){
int clendarcount = remoteAgendaService.countCalendar(employeeId,tenantKey);
count = clendarcount + "";
}else if("2".equals(type)){
if("2".equals(type)){
String sql =" select count(1) as cou " +
" from task " +
" where creator = ? \n" +
" and STATUS = 'todo'\n" +
" and status = 'todo'\n" +
" and delete_type = 0\n" +
" and tenant_key= ? " ;

@ -8,6 +8,8 @@ import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.weaver.esb.api.rpc.EsbRpcRemoteInterface;
@Service("esb_njjucailin_im_Action2")
public class EsbRpcRemoteJucailinUpdateImDataAction implements EsbRpcRemoteInterface, Serializable {

Loading…
Cancel
Save