|
@ -1235,15 +1235,30 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
}
|
|
|
}
|
|
|
//求总时长
|
|
|
int seconds = totalTaklTime(waihudList);
|
|
|
//求平均时长
|
|
|
map.put("waihuAvgTalkTime",getAvgTime(seconds,waihudList.size()));
|
|
|
if (waihudList.size()>0){
|
|
|
int seconds = totalTaklTime(waihudList);
|
|
|
//求平均时长
|
|
|
map.put("waihuAvgTalkTime",getAvgTime(seconds,waihudList.size()));
|
|
|
}else {
|
|
|
map.put("waihuAvgTalkTime",0);
|
|
|
}
|
|
|
|
|
|
map.put("waihuCount",waihudList.size());
|
|
|
map.put("waihuCustomerNoCount",customerNoCount);
|
|
|
|
|
|
//--------------今日在线时长-----------------//
|
|
|
|
|
|
List<ManageCustomerOnlineRecordDO> manageCustomerOnlineRecordDOList = manageCustomerOnlineRecordDao.findByCustomerCodeToday(userCode,startTime,endTime);
|
|
|
String lineSql="SELECT" +
|
|
|
" *" +
|
|
|
" FROM" +
|
|
|
" `manage_customer_online_record`" +
|
|
|
" WHERE" +
|
|
|
" customer_code ='"+userCode+"'" +
|
|
|
" AND create_time >='"+startTime+"'" +
|
|
|
" AND create_time <='"+endTime+"'" +
|
|
|
" ORDER BY" +
|
|
|
" create_time";
|
|
|
List<ManageCustomerOnlineRecordDO> manageCustomerOnlineRecordDOList = jdbcTemplate.query(lineSql,new BeanPropertyRowMapper<>(ManageCustomerOnlineRecordDO.class));
|
|
|
//如果最新一条是离线则直接获取总在线时长就是在线时间,
|
|
|
// 如果最新一条是在线,则用当前时间减去上一条登录时间加上之前的在线时长为总的在线时长
|
|
|
Map<String,Object> lineMap = getOnlineAndNotOnlineAndNowOnline(manageCustomerOnlineRecordDOList);
|
|
@ -1254,7 +1269,10 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
//求总时长
|
|
|
int jieruTotalSecond = totalTaklTime(jieruList);
|
|
|
//求平均时长
|
|
|
map.put("jieruAvgTalkTime",getAvgTime(jieruTotalSecond,jieruList.size()));
|
|
|
if (jieruList.size()>0){
|
|
|
map.put("jieruAvgTalkTime",getAvgTime(jieruTotalSecond,jieruList.size()));
|
|
|
}
|
|
|
map.put("jieruAvgTalkTime",0);
|
|
|
map.put("jieruCount",jieruList.size());
|
|
|
|
|
|
//--------------今日协同任务完成数-----------------//
|
|
@ -1277,7 +1295,7 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
" executor_code = '"+userCode+"'" +
|
|
|
" AND executor_type = 2" +
|
|
|
" AND `status`<3";
|
|
|
Map<String,Object> weiwanchenMap = jdbcTemplate.queryForMap(wanchenSql);
|
|
|
Map<String,Object> weiwanchenMap = jdbcTemplate.queryForMap(weiwanchenSql);
|
|
|
String fasongSql="SELECT" +
|
|
|
" COUNT(*) AS fasongCount" +
|
|
|
" FROM" +
|
|
@ -1298,46 +1316,54 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
|
|
|
public Map<String,Object> getOnlineAndNotOnlineAndNowOnline(List<ManageCustomerOnlineRecordDO> list){
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
//如果最新一条是离线则直接获取总在线时长就是在线时间,
|
|
|
// 如果最新一条是在线,则用当前时间减去上一条登录时间加上之前的在线时长为总的在线时长
|
|
|
int status = list.get(list.size()-1).getStatus();
|
|
|
String firstOnlineTime = DateUtil.dateToStr(list.get(0).getCreateTime(),DateUtil.YYYY_MM_DD_HH_MM_SS);
|
|
|
int totalOnlineMinute=0;
|
|
|
int totalNotOnlineMinute =0;
|
|
|
int toMinute = 0;
|
|
|
//离线status==2
|
|
|
if (status==2){
|
|
|
totalOnlineMinute =list.get(list.size()-1).getTotalOnlineTime();
|
|
|
long allTime = list.get(list.size()-1).getCreateTime().getTime()-list.get(0).getCreateTime().getTime();
|
|
|
totalNotOnlineMinute= Integer.valueOf(String.valueOf(allTime/1000/60))-totalOnlineMinute;
|
|
|
}
|
|
|
//在线status==1
|
|
|
if (status==1){
|
|
|
//只有一条在线的数据,用当前时间减去数据创建时间
|
|
|
long onlineDate = 0L;
|
|
|
long allDateTime = 0L;
|
|
|
int lastOnlineTime =0;
|
|
|
Date now = new Date();
|
|
|
onlineDate = now.getTime()-list.get(list.size()-1).getCreateTime().getTime();
|
|
|
allDateTime = now.getTime()-list.get(0).getCreateTime().getTime();
|
|
|
toMinute = Integer.valueOf(String.valueOf(onlineDate/1000/60));
|
|
|
//多条数据,要加上上一次记录的在线时长
|
|
|
if(list.size()>1){
|
|
|
int notOnlineCount=0;
|
|
|
for (ManageCustomerOnlineRecordDO m : list){
|
|
|
if (m.getStatus()==2 && notOnlineCount<1){
|
|
|
notOnlineCount++;
|
|
|
lastOnlineTime = m.getTotalOnlineTime();
|
|
|
if (list!=null && list.size()>0){
|
|
|
//如果最新一条是离线则直接获取总在线时长就是在线时间,
|
|
|
// 如果最新一条是在线,则用当前时间减去上一条登录时间加上之前的在线时长为总的在线时长
|
|
|
int status = list.get(list.size()-1).getStatus();
|
|
|
String firstOnlineTime = DateUtil.dateToStr(list.get(0).getCreateTime(),DateUtil.YYYY_MM_DD_HH_MM_SS);
|
|
|
int totalOnlineMinute=0;
|
|
|
int totalNotOnlineMinute =0;
|
|
|
int toMinute = 0;
|
|
|
//离线status==2
|
|
|
if (status==2){
|
|
|
totalOnlineMinute =list.get(list.size()-1).getTotalOnlineTime();
|
|
|
long allTime = list.get(list.size()-1).getCreateTime().getTime()-list.get(0).getCreateTime().getTime();
|
|
|
totalNotOnlineMinute= Integer.valueOf(String.valueOf(allTime/1000/60))-totalOnlineMinute;
|
|
|
}
|
|
|
//在线status==1
|
|
|
if (status==1){
|
|
|
//只有一条在线的数据,用当前时间减去数据创建时间
|
|
|
long onlineDate = 0L;
|
|
|
long allDateTime = 0L;
|
|
|
int lastOnlineTime =0;
|
|
|
Date now = new Date();
|
|
|
onlineDate = now.getTime()-list.get(list.size()-1).getCreateTime().getTime();
|
|
|
allDateTime = now.getTime()-list.get(0).getCreateTime().getTime();
|
|
|
toMinute = Integer.valueOf(String.valueOf(onlineDate/1000/60));
|
|
|
//多条数据,要加上上一次记录的在线时长
|
|
|
if(list.size()>1){
|
|
|
int notOnlineCount=0;
|
|
|
for (ManageCustomerOnlineRecordDO m : list){
|
|
|
if (m.getStatus()==2 && notOnlineCount<1){
|
|
|
notOnlineCount++;
|
|
|
lastOnlineTime = m.getTotalOnlineTime();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
totalOnlineMinute=toMinute+lastOnlineTime;
|
|
|
totalNotOnlineMinute = Integer.valueOf(String.valueOf(allDateTime/1000/60))-totalOnlineMinute;
|
|
|
}
|
|
|
totalOnlineMinute=toMinute+lastOnlineTime;
|
|
|
totalNotOnlineMinute = Integer.valueOf(String.valueOf(allDateTime/1000/60))-totalOnlineMinute;
|
|
|
map.put("notOnline",totalNotOnlineMinute);
|
|
|
map.put("online",totalOnlineMinute);
|
|
|
map.put("nowOnline",toMinute);
|
|
|
map.put("firstOnlineTime",firstOnlineTime);
|
|
|
}else {
|
|
|
map.put("notOnline",0);
|
|
|
map.put("online",0);
|
|
|
map.put("nowOnline",0);
|
|
|
map.put("firstOnlineTime","");
|
|
|
}
|
|
|
map.put("notOnline",totalNotOnlineMinute);
|
|
|
map.put("online",totalOnlineMinute);
|
|
|
map.put("nowOnline",toMinute);
|
|
|
map.put("firstOnlineTime",firstOnlineTime);
|
|
|
|
|
|
return map;
|
|
|
}
|
|
|
|
|
@ -1484,11 +1510,11 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
" COUNT(*) AS weiwanchengCount" +
|
|
|
" FROM" +
|
|
|
" `manage_synergy_workorder_servicer` s" +
|
|
|
"LEFT JOIN wlyy_user u ON s.executor_code = u.`code`" +
|
|
|
" LEFT JOIN wlyy_user u ON s.executor_code = u.`code`" +
|
|
|
" WHERE" +
|
|
|
" executor_type = 2" +
|
|
|
" AND `status`<3";
|
|
|
Map<String,Object> weiwanchenMap = jdbcTemplate.queryForMap(wanchenSql);
|
|
|
Map<String,Object> weiwanchenMap = jdbcTemplate.queryForMap(weiwanchenSql);
|
|
|
String fasongSql="SELECT" +
|
|
|
" COUNT(*) AS fasongCount" +
|
|
|
" FROM" +
|
|
@ -1497,7 +1523,7 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
" s.*, w.create_user," +
|
|
|
" w.create_user_name" +
|
|
|
" FROM" +
|
|
|
" manage_synergy_workorder_servicer s" +
|
|
|
" manage_synergy_workorder_servicer s" +
|
|
|
" LEFT JOIN manage_synergy_workorder w ON s.workorder_code = w.`code`" +
|
|
|
" WHERE" +
|
|
|
" w.create_user_type = 2" +
|
|
@ -1565,7 +1591,7 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
String sql="SELECT" +
|
|
|
" u.`code`,"+
|
|
|
" u.`name`," +
|
|
|
" u.`online`," +
|
|
|
" u.`online` as onlineType," +
|
|
|
" r.type," +
|
|
|
" COUNT(*) as num"+
|
|
|
" FROM" +
|
|
@ -1590,7 +1616,7 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
Map<String,Object> resultMap = new HashMap<>();
|
|
|
resultMap.put("userCode",userCode);
|
|
|
resultMap.put("userName",map.get("name"));
|
|
|
resultMap.put("online",map.get("online"));
|
|
|
resultMap.put("onlineType",map.get("online"));
|
|
|
if ("1".equals(type)){
|
|
|
resultMap.put("jieruCount",map.get("num"));
|
|
|
resultMap.put("waihuCount",0);
|
|
@ -1616,7 +1642,7 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
Map<String,Object> resultMap = new HashMap<>();
|
|
|
resultMap.put("userCode",userCode);
|
|
|
resultMap.put("userName",map.get("name"));
|
|
|
resultMap.put("online",map.get("online"));
|
|
|
resultMap.put("onlineType",map.get("onlineType"));
|
|
|
if ("1".equals(type)){
|
|
|
resultMap.put("jieruCount",map.get("num"));
|
|
|
resultMap.put("waihuCount",0);
|
|
@ -1632,8 +1658,18 @@ public class SynergyManageService extends BaseJpaService {
|
|
|
}
|
|
|
for (Map<String,Object> reMap : resultList){
|
|
|
String userCode = String.valueOf(reMap.get("userCode"));
|
|
|
List<ManageCustomerOnlineRecordDO> manageCustomerOnlineRecordDOList = manageCustomerOnlineRecordDao.findByCustomerCodeToday(userCode,startTime,endTime);
|
|
|
//如果最新一条是离线则直接获取总在线时长就是在线时间,
|
|
|
String lineSql="SELECT" +
|
|
|
" *" +
|
|
|
" FROM" +
|
|
|
" `manage_customer_online_record`" +
|
|
|
" WHERE" +
|
|
|
" customer_code ='"+userCode+"'" +
|
|
|
" AND create_time >='"+startTime+"'" +
|
|
|
" AND create_time <='"+endTime+"'" +
|
|
|
" ORDER BY" +
|
|
|
" create_time";
|
|
|
List<ManageCustomerOnlineRecordDO> manageCustomerOnlineRecordDOList = jdbcTemplate.query(lineSql,new BeanPropertyRowMapper<>(ManageCustomerOnlineRecordDO.class));
|
|
|
//如果最新一条是离线则直接获取总在线时长就是在线时间
|
|
|
// 如果最新一条是在线,则用当前时间减去上一条登录时间加上之前的在线时长为总的在线时长
|
|
|
Map<String,Object> lineMap = getOnlineAndNotOnlineAndNowOnline(manageCustomerOnlineRecordDOList);
|
|
|
reMap.putAll(lineMap);
|