From f601846504014d9542edcc7a3c7bfea3f4f56920 Mon Sep 17 00:00:00 2001 From: zxf Date: Fri, 4 Aug 2023 11:36:17 +0800 Subject: [PATCH] 1 --- .../artifacts/rushfee_Web_exploded/ptrun.ini | 2 +- resource/html/bureau/recording.html | 100 +++++++++----- src/rush/BureauAction.java | 126 +++++++++++++++--- 3 files changed, 175 insertions(+), 53 deletions(-) diff --git a/classes/artifacts/rushfee_Web_exploded/ptrun.ini b/classes/artifacts/rushfee_Web_exploded/ptrun.ini index 8937a2a..4381b3c 100644 --- a/classes/artifacts/rushfee_Web_exploded/ptrun.ini +++ b/classes/artifacts/rushfee_Web_exploded/ptrun.ini @@ -1,3 +1,3 @@ #save ini -#Tue Jul 25 00:51:51 CST 2023 +#Fri Aug 04 11:27:47 CST 2023 deploystamp=1612237236000 diff --git a/resource/html/bureau/recording.html b/resource/html/bureau/recording.html index 1286d69..448b2ea 100644 --- a/resource/html/bureau/recording.html +++ b/resource/html/bureau/recording.html @@ -5,28 +5,35 @@
- - - + + + + + 查询 - 导出    + 导出
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -34,9 +41,9 @@ \ No newline at end of file diff --git a/src/rush/BureauAction.java b/src/rush/BureauAction.java index 71673b2..2ef2411 100644 --- a/src/rush/BureauAction.java +++ b/src/rush/BureauAction.java @@ -2,12 +2,17 @@ package rush; 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.Request; import com.aisino.aosplus.core.mvc.bean.Params; +import com.aisino.hangxin.common.POIExcelMapExportUtil; import org.apache.commons.lang.StringUtils; 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.Map; @@ -20,38 +25,57 @@ public class BureauAction { @Request.Post("getlist") public Map getCustomerById(Params params) { - Object start_time=params.get("start_time"); - Object end_time=params.get("end_time"); - 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 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 ,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=""; - if(StringUtils.isNotBlank("start_time")){ - timeSql=" and 1=1"; + 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+"%'" ; } - Map map = DbHelper.getDbService().queryPageMapList(sql, params); + Map map = DbHelper.getDbService().queryPageMapList(sql+timeSql+typeSql+phoneSql+empnoSql, params); List records = (List) map.get("records"); for(Map m : records){ - - 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){ - m.put("play","无录音"); - m.put("path",""); - } - if(m.get("path").toString().endsWith("v3")){ - m.put("path",m.get("path")); - - }else{ - m.put("path",m.get("path")); - } + m.put("path","http://10.1.1.54:8082"+m.get("path")); + if(m.get("path")==null){ + m.put("play","无录音"); + m.put("path",""); } } + + 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 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); + } + }