|
@ -1,6 +1,7 @@
|
|
package com.yihu.wlyy.service.synergy;
|
|
package com.yihu.wlyy.service.synergy;
|
|
|
|
|
|
import com.yihu.wlyy.entity.*;
|
|
import com.yihu.wlyy.entity.*;
|
|
|
|
import com.yihu.wlyy.entity.call.CallRecord;
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkordeReminderDO;
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkordeReminderDO;
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderDO;
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderDO;
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderExecutorDO;
|
|
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderExecutorDO;
|
|
@ -13,10 +14,12 @@ import com.yihu.wlyy.util.IdCardUtil;
|
|
import com.yihu.wlyy.util.query.BaseJpaService;
|
|
import com.yihu.wlyy.util.query.BaseJpaService;
|
|
import jxl.Workbook;
|
|
import jxl.Workbook;
|
|
import jxl.write.*;
|
|
import jxl.write.*;
|
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@ -1079,7 +1082,63 @@ public class SynergyManageService extends BaseJpaService {
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
public void customerHomePage(String userCode){
|
|
|
|
|
|
public int saveCallLabel(String callLabels,String callCode){
|
|
|
|
String sql ="UPDATE manage_call_record SET call_label='"+callLabels+"' WHERE `code`='"+callCode+"'";
|
|
|
|
return jdbcTemplate.update(sql);
|
|
|
|
}
|
|
|
|
|
|
|
|
public int saveCallInfo(String serviceType,String serviceContent,String callCode){
|
|
|
|
String sql ="UPDATE manage_call_record SET service_type='"+serviceType+"',service_content='"+serviceContent+"' WHERE `code`='"+callCode+"'";
|
|
|
|
return jdbcTemplate.update(sql);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void customerIndex(String userCode){
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
|
String today = DateUtil.dateToStrShort(new Date());
|
|
|
|
String callSql ="SELECT * FROM manage_call_record WHERE user_code='"+userCode+"' and create_time>='"+today+" 00:00:00' and create_time<='"+today+" 23:59:59'";
|
|
|
|
//今日外呼量
|
|
|
|
List<CallRecord> waihudList = jdbcTemplate.query(callSql+" and type=2",new BeanPropertyRowMapper<>(CallRecord.class));
|
|
|
|
int customerNoCount = 0;
|
|
|
|
int hours = 0;
|
|
|
|
int minutes = 0;
|
|
|
|
int seconds = 0;
|
|
|
|
for(CallRecord callRecord : waihudList){
|
|
|
|
//求总时长
|
|
|
|
if (callRecord.getAnswerStatus()==1){
|
|
|
|
String talkTime = callRecord.getTalkTime();
|
|
|
|
String[] talkTimeStr = talkTime.split(":");
|
|
|
|
for (int i=0;i<talkTimeStr.length;i++){
|
|
|
|
if (i==0){
|
|
|
|
hours += Integer.valueOf(talkTimeStr[i]);
|
|
|
|
}
|
|
|
|
if (i==1){
|
|
|
|
minutes += Integer.valueOf(talkTimeStr[i]);
|
|
|
|
}
|
|
|
|
if (i==2){
|
|
|
|
seconds += Integer.valueOf(talkTimeStr[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获取客户未接通数量
|
|
|
|
if(callRecord.getAnswerStatus()==3){
|
|
|
|
customerNoCount++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String avgTalkTime = "";
|
|
|
|
seconds = hours*3600+minutes*60+seconds;
|
|
|
|
avgTalkTime =seconds/3600+"时";
|
|
|
|
if (seconds%3600==0){
|
|
|
|
avgTalkTime +="0分0秒";
|
|
|
|
}else {
|
|
|
|
if (seconds%3600%60==0){
|
|
|
|
avgTalkTime +=seconds%3600/60+"分0秒";
|
|
|
|
}else {
|
|
|
|
avgTalkTime +=seconds%3600/60+"分"+seconds%3600%60+"秒";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
map.put("waihuCount",waihudList.size());
|
|
|
|
map.put("waihuCustomerNoCount",customerNoCount);
|
|
|
|
map.put("waihuAvgTalkTime",avgTalkTime);
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|