zxf 2023-08-04 11:36:17 +08:00
parent acdbb406d5
commit f601846504
3 changed files with 175 additions and 53 deletions

View File

@ -1,3 +1,3 @@
#save ini #save ini
#Tue Jul 25 00:51:51 CST 2023 #Fri Aug 04 11:27:47 CST 2023
deploystamp=1612237236000 deploystamp=1612237236000

View File

@ -5,28 +5,35 @@
</head> </head>
<body> <body>
<div widget="toolbar" style="padding:5px;border:0;"> <div widget="toolbar" style="padding:5px;border:0;">
<input name="start_time" widget=datechooser showTime="true" timeFormat="HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" valueFormat="yyyy-MM-dd HH:mm:ss" allowinput="f" label="录音时长"> <input name="start_time" widget=datechooser showTime="true" timeFormat="HH:mm:ss" format="yyyy-MM-dd" valueFormat="yyyy-MM-dd" allowinput="f" label="录音时间">
<input name="end_time" widget=datechooser showTime="true" timeFormat="HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" valueFormat="yyyy-MM-dd HH:mm:ss" allowinput="f" style="margin-left: -70px;" label="至"> <input name="end_time" widget=datechooser showTime="true" timeFormat="HH:mm:ss" format="yyyy-MM-dd" valueFormat="yyyy-MM-dd" allowinput="f" style="margin-left: -70px;" label="至">
<input name="call_type" widget=combox allowinput="f" style="width: 200px;" showNullItem="true" <input widget="edit" name="phone" label="来电人号码"/>
data="[{id:'呼入',text:'呼入',{id:'呼出',text:'呼出'}]" emptyText="请选择" label="呼叫类型"/> <input widget="edit" name="empno" label="工号"/>
<input name="calltype" widget=combox allowinput="f" style="width: 200px;" showNullItem="true"
data="[{id:'0',text:'呼入'},{id:'1',text:'呼出'}]" emptyText="请选择" label="呼叫类型">
<a widget="button" iconCls="icon-search" onclick="search()">查询</a> <a widget="button" iconCls="icon-search" onclick="search()">查询</a>
<a widget="button" iconCls="icon-export" onclick="exportExl()">导出</a>&nbsp;&nbsp;&nbsp; <a widget="button" iconCls="icon-export" onclick="exportExl()">导出</a>
</div> </div>
<div widget="autosize"> <div widget="autosize">
<div widget="datagrid" name="grid" style="width: 100%; height: 100%;" url="rush/bureau/getlist" > <div widget="datagrid" name="grid" style="width: 100%; height: 100%;" url="rush/bureau/getlist" >
<div type="indexcolumn" width="35" header="序号"></div> <div type="indexcolumn" width="35" header="序号"></div>
<div field="id" visible="id"></div> <div field="id" visible="id"></div>
<div field="emp_no" width="30" header="工号"></div> <div field="emp_no" width="30" header="工号" align="center"></div>
<div field="create_time" width="70" header="日期"></div> <div field="name" width="30" header="姓名" align="center"></div>
<div field="phone_num" width="60" header="电话号码"></div> <div field="create_time" width="50" header="日期" align="center"></div>
<div field="start_time" width="70" header="开始时间" ></div> <div field="phone_num" width="50" header="电话号码" align="center"></div>
<div field="end_time" width="70" header="结束时间" ></div> <div field="start_time" width="70" header="开始时间" align="center"></div>
<div field="record_duration" width="50" header="录音时长(秒)" ></div> <div field="end_time" width="70" header="结束时间" align="center"></div>
<div field="call_type" width="50" header="呼叫类型" ></div> <div field="record_duration" width="40" header="录音时长(秒)" align="center"></div>
<div field="caller_phone" width="50" header="来电人电话" ></div> <div field="call_type" width="35" renderer="callType" align="center" header="呼叫类型" ></div>
<div field="down" width="65" header="下载" renderer="downRender" align="center"></div> <div field="down" width="40" header="下载" renderer="downRender" align="center"></div>
<div field="play" width="65" header="录音" renderer="playRender" align="center"></div> <div field="play" width="40" header="调听" renderer="playRender" align="center"></div>
<div field="area_name" width="50" header="所属地区" ></div> <div field="caller_phone" width="50" header="来电人联系电话" align="center" ></div>
<div field="customer_name" width="50" header="公司名称" align="center" ></div>
<div field="question_content" width="50" header="咨询内容" align="center" ></div>
<div field="question_answer" width="50" header="解决办法" align="center" ></div>
<div field="productname" width="50" header="问题类型" align="center" ></div>
<div field="area_name" width="50" header="所属地区" align="center" ></div>
</div> </div>
</div> </div>
</body> </body>
@ -34,9 +41,9 @@
<script type="text/javascript"> <script type="text/javascript">
var grid = aos.get('grid'); var grid = aos.get('grid');
var nowday=aos.formatDate(new Date(),"yyyy-MM-dd") var nowday=aos.formatDate(new Date(),"yyyy-MM-dd");
aos.get('start_time').setValue(nowday+" 00:00:00");
aos.get('end_time').setValue(nowday+" 23:59:59");
function search(){ function search(){
var grid = aos.get('grid'); var grid = aos.get('grid');
var begindate=aos.get('start_time').getFormValue(); var begindate=aos.get('start_time').getFormValue();
@ -55,7 +62,12 @@
var params={ var params={
searchbegindate:begindate, searchbegindate:begindate,
searchenddate:enddate}; searchenddate:enddate,
phone:aos.get('phone').getValue(),
empno:aos.get('empno').getValue(),
calltype:aos.get('calltype').getValue()
};
grid.load(params); grid.load(params);
} }
} }
@ -67,9 +79,11 @@
var params={ var params={
searchbegindate:begindate, searchbegindate:begindate,
searchenddate:enddate, searchenddate:enddate,
chargetype:aos.get('call_type').getValue()}; phone:aos.get('phone').getValue(),
empno:aos.get('empno').getValue(),
calltype:aos.get('calltype').getValue()};
grid.load(params); grid.load(params);
return ;
} }
} }
@ -85,6 +99,23 @@
} }
} }
function callType(e){
var row=e.row;
var value=row.call_type;
if(value=='0'){
return '<p style="color:red;">呼入</p>';
}
if(value=='1'){
return '<p style="color:green;">呼出</p>';
}
else{
return value;
}
}
function downRender(e){ function downRender(e){
var row=e.row; var row=e.row;
var value=row.down; var value=row.down;
@ -104,22 +135,27 @@
function exportExl(){ function exportExl123(){
var begindate=aos.get('start_time').getFormValue();
var enddate=aos.get('end_time').getFormValue();
alert(begindate)
var initparam={ var initparam={
searchoperator:aos.get('searchoperator').getValue(), searchbegindate:begindate,
searchbegindate:aos.get('searchbegindate').getFormValue(), searchenddate:enddate,
searchenddate:aos.get('searchenddate').getFormValue(), phone:aos.get('phone').getValue(),
custname:aos.get('custname').getValue(), empno:aos.get('empno').getValue(),
chargetype:aos.get('chargetype').getValue(), calltype:aos.get('calltype').getValue()};
searchresult:aos.get('searchresult').getValue()};
var base = document.getElementsByTagName("base")[0].href; var base = document.getElementsByTagName("base")[0].href;
var Eurl=base+"rush/kaohe/exportRecoding"; var Eurl=base+"rush/bureau/exportRecoding";
var Eurl = aos.addUrlParams(Eurl,initparam); var Eurl = aos.addUrlParams(Eurl,initparam);
window.location.href=encodeURI(Eurl); window.location.href=encodeURI(Eurl);
}
function exportExl(){
var base = document.getElementsByTagName("base")[0].href;
window.location.href=base+"rush/bureau/exportRecoding?empno="+aos.get('empno').getValue()+"&searchbegindate="+aos.get('start_time').getFormValue()+"&searchenddate="+aos.get('end_time').getFormValue()+"&phone="+aos.get('phone').getValue()+"&calltype="+ encodeURI(encodeURI(aos.get('calltype').getValue()));
} }
</script> </script>
</html> </html>

View File

@ -2,12 +2,17 @@ package rush;
import com.aisino.aosplus.core.dao.DbHelper; import com.aisino.aosplus.core.dao.DbHelper;
import com.aisino.aosplus.core.mvc.DataContext;
import com.aisino.aosplus.core.mvc.annotation.Action; import com.aisino.aosplus.core.mvc.annotation.Action;
import com.aisino.aosplus.core.mvc.annotation.Request; import com.aisino.aosplus.core.mvc.annotation.Request;
import com.aisino.aosplus.core.mvc.bean.Params; import com.aisino.aosplus.core.mvc.bean.Params;
import com.aisino.hangxin.common.POIExcelMapExportUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -20,38 +25,57 @@ public class BureauAction {
@Request.Post("getlist") @Request.Post("getlist")
public Map getCustomerById(Params params) { public Map getCustomerById(Params params) {
Object start_time=params.get("start_time"); String searchbegindate=params.getString("searchbegindate");
Object end_time=params.get("end_time"); String searchenddate=params.getString("searchenddate");
String sql=" select id,emp_no,create_time,phone_num,start_time,end_time,record_duration," + String phone=params.getString("phone");
"call_type,record_url path,caller_phone, area_name ,'播放' AS play ,'下载' as down from area_call_record where 1=1 "; String empno=params.getString("empno");
String calltype=params.getString("calltype");
// String sql=" select id,emp_no,create_time,phone_num,start_time,end_time,record_duration," +
// "call_type,record_url path,caller_phone, area_name ,'播放' AS play ,'下载' as down from area_call_record where 1=1 ";
String sql=" SELECT c.CALLID, c.CALLEENO,c.CALLERNO phone_num ,c.AGENTID emp_no,c.BEGINTIME start_time,c.ENDTIME end_time,to_char(c.BEGINTIME,'yyyy-mm-dd') create_time, " +
"c.SECONDS record_duration ,REGEXP_REPLACE( REGEXP_REPLACE(c.FILENAME,'Z:\\\\1',''),'\\\\','/') path ,c.CALLTYPE call_type,c.NAME,s.TEL_RECORD_ID,s.RECODER_ID," +
"s.ENTRY_DATE,s.ORGID,s.ORGNAME area_name,s.PRODUCTNAME,s.CUSTOMER_ID,s.QUESTION_ID," +
"s.QUESTION_ANSWER,s.CUSTOMER_NAME,s.CUSTOMER_TAX_ID,s.tel ,s.MOBILE caller_phone,s.PERSON_TEL, s.question_content," +
"s.CONTACT,s.TEL_DATE ,s.TEL_PERSON,s.ENTRY_PERSON ,'播放' AS play ,'下载' as down FROM " +
"CALLSYS_TRECORDFAILINFO c " +
"LEFT JOIN CRM_SM_TEL_RECORD s ON c.CALLID = s.CALLID where 1=1 ";
String timeSql=""; String timeSql="";
if(StringUtils.isNotBlank("start_time")){ String typeSql="";
timeSql=" and 1=1"; String phoneSql="";
String empnoSql="";
if(searchbegindate!=null&&searchenddate!=null){
timeSql=" and to_char(c.BEGINTIME,'yyyy-mm-dd')>='"+searchbegindate +"' and to_char(c.BEGINTIME,'yyyy-mm-dd')<='"+searchenddate+"'" ;
}
if(calltype!=null){
typeSql=" and c.CALLTYPE='"+calltype+"'";
}
if(phone!=null){
phoneSql=" and s.MOBILE like '%"+phone+"%'" ;
}
if(empno!=null){
empnoSql=" and c.AGENTID like '%"+empno+"%'" ;
} }
Map map = DbHelper.getDbService().queryPageMapList(sql, params); Map map = DbHelper.getDbService().queryPageMapList(sql+timeSql+typeSql+phoneSql+empnoSql, params);
List<Map> records = (List<Map>) map.get("records"); List<Map> records = (List<Map>) map.get("records");
for(Map m : records){ for(Map m : records){
m.put("path","http://10.1.1.54:8082"+m.get("path"));
if ((m.get("info")!=null && Integer.parseInt(m.get("info").toString())>0 && m.get("path")!=null)||m.get("zltime")!=null){
// String path = m.get("path").toString();
if(m.get("path")==null){ if(m.get("path")==null){
m.put("play","无录音"); m.put("play","无录音");
m.put("path",""); m.put("path","");
} }
if(m.get("path").toString().endsWith("v3")){
m.put("path",m.get("path"));
}else{
m.put("path",m.get("path"));
}
}
} }
return map; return map;
} }
@ -60,5 +84,67 @@ public class BureauAction {
@Request.Get("exportRecoding")
public void exportRecoding(Params params) throws UnsupportedEncodingException {
String searchbegindate=params.getString("searchbegindate");
String searchenddate=params.getString("searchenddate");
String phone=params.getString("phone");
String empno=params.getString("empno");
String calltype=params.getString("calltype");
// String sql=" select id,emp_no,create_time,phone_num,start_time,end_time,record_duration," +
// "call_type,record_url path,caller_phone, area_name ,'播放' AS play ,'下载' as down from area_call_record where 1=1 ";
String sql=" SELECT c.CALLID, c.CALLEENO,c.CALLERNO phone_num ,c.AGENTID emp_no,c.BEGINTIME start_time,c.ENDTIME end_time,to_char(c.BEGINTIME,'yyyy-mm-dd') create_time, " +
"c.SECONDS record_duration ,decode(c.CALLTYPE,'0','呼入','1','呼出') call_type,c.NAME,s.TEL_RECORD_ID,s.RECODER_ID," +
"s.ENTRY_DATE,s.ORGID,s.ORGNAME area_name,s.PRODUCTNAME,s.CUSTOMER_ID,s.QUESTION_ID," +
"s.QUESTION_ANSWER,s.CUSTOMER_NAME,s.CUSTOMER_TAX_ID,s.tel ,s.MOBILE caller_phone,s.PERSON_TEL, s.question_content," +
"s.CONTACT,s.TEL_DATE ,s.TEL_PERSON,s.ENTRY_PERSON FROM " +
"CALLSYS_TRECORDFAILINFO c " +
"LEFT JOIN CRM_SM_TEL_RECORD s ON c.CALLID = s.CALLID where 1=1 ";
String timeSql="";
String typeSql="";
String phoneSql="";
String empnoSql="";
if(searchbegindate!=null&&searchenddate!=null){
timeSql=" and to_char(c.BEGINTIME,'yyyy-mm-dd')>='"+searchbegindate +"' and to_char(c.BEGINTIME,'yyyy-mm-dd')<='"+searchenddate+"'" ;
}
if(calltype!=null){
typeSql=" and c.CALLTYPE='"+calltype+"'";
}
if(phone!=null){
phoneSql=" and s.MOBILE like '%"+phone+"%'" ;
}
if(empno!=null){
empnoSql=" and c.AGENTID like '%"+empno+"%'" ;
}
List<Map> resultMap = DbHelper.getDbService().queryMapList(sql+timeSql+typeSql+phoneSql+empnoSql, params);
HttpServletResponse response = DataContext.getResponse();
String fileName = "通话记录明细";//
String sheetName = "通话记录明细";
POIExcelMapExportUtil pee = new POIExcelMapExportUtil(response,
fileName, sheetName);
// Map Key属性
String titleColumn1[] = {"emp_no","name", "create_time", "phone_num", "start_time", "end_time", "record_duration","call_type","caller_phone","customer_name","question_content","question_answer","productname","area_name"};
// Excel列名
String titleName1[] = {"工号", "姓名","日期","电话号码", "开始时间", "结束时间", "录音时长(秒)", "呼叫类型","来电人电话号码", "公司名称", "咨询内容","解决办法","问题类型","所属地区"};
// Excel 列宽
int titleSize[] = {30, 30, 30, 30, 30, 30,30, 30,30, 30, 30,30, 30,30};
// 内容书写,返回输出流
pee.wirteListMapExcel(titleColumn1, titleName1, titleSize, resultMap);
}
} }