- <%@pagecontentType="text/html;charset=GBK"%>
- <%@tagliburi="http://java.sun.com/jstl/core"prefix="c"%>
- <%@tagliburi="/WEB-INF/tld/utiltags.tld"prefix="util"%>
- <scripttype="text/javascript"
- src="<%=request.getContextPath()%>/js/common.js"></script>
- <scriptlanguage="javascript"
- src="<%=request.getContextPath()%>/js/xmlcommon.js"></script>
- src="<%=request.getContextPath()%>/css/tabber.js"></script>
- src="<%=request.getContextPath()%>/js/calendar.js"></script>
- <linkrel="stylesheet"
- href="<%=request.getContextPath()%>/css/example.css"TYPE="text/css"
- MEDIA="screen"/>
- <linkrel="stylesheet"
- href="<%=request.getContextPath()%>/css/style.css"type="text/css"/>
- src="<%=request.getContextPath()%>/js/jquery-1.3.2.min.js"></script>
- <head>
- <util:message/>
- <Metahttp-equiv="Content-Type"content="text/html;charset=GBK">
- <title>电话销售系统</title>
- </head>
- <body>
- <formname="form1"method="post"action="">
- <tablewidth="99%"border="0"align="center"cellpadding="0"
- cellspacing="0">
- <tr>
- <tdwidth="22"height="32"
- background="<%=request.getContextPath()%>/images/main/frame_q.jpg">
- </td>
- <td
- background="<%=request.getContextPath()%>/images/main/frame_w.jpg"
- class="MainTitle">
- <!--呼入控制数据设置-->
- 呼入屏蔽设置
- <tdwidth="22"height="32"
- background="<%=request.getContextPath()%>/images/main/frame_e.jpg">
- </td>
- </tr>
- <td
- background="<%=request.getContextPath()%>/images/main/frame_a.jpg">
- <tdvalign="top"bgcolor="#EFEFEF">
- <tablewidth="100%"border="0"cellspacing="0"cellpadding="0">
- <td></td>
- </tr>
- </table>
- <tablewidth="100%"border="0"cellpadding="0"cellspacing="0"
- bgcolor="#EFEFEF">
- <tdclass="SecondTitle">.:设置查询:.</td>
- <tr>
- <tdbgcolor="#999999">
- <tablename="tableA"border="0"cellspacing="1"cellpadding="1"
- width="100%">
- <trwidth="100%">
- <tdwidth="14%"align="right"class="general-td">数据来源:</td>
- <tdalign="left"class="general-td"><select
- name="dataSource"class="selectCtrl"id="dataSource">
- <optionvalue="">全部</option>
- <optionvalue="1"<c:iftest='${result.blackListDTO.dataSource=="1"}'>selected</c:if>>电销系统</option>
- <optionvalue="2"<c:iftest='${result.blackListDTO.dataSource=="2"}'>selected</c:if>>承保系统</option>
- </select></td>
- <tdwidth="14%"align="right"class="general-td">类型:</td>
- <tdalign="left"class="general-td"><select
- name="type"class="selectCtrl"id="type">
- <optionvalue="">全部</option>
- <optionvalue="1-1"<c:iftest='${result.blackListDTO.type=="1-1"}'>selected</c:if>>黑名单(电销)</option>
- <optionvalue="1-2"<c:iftest='${result.blackListDTO.type=="1-2"}'>selected</c:if>>黑名单(承保)</option>
- <optionvalue="2"<c:iftest='${result.blackListDTO.type=="2"}'>selected</c:if>>号码屏蔽</option>
- <trwidth="100%">
- <tdwidth="14%"align="right"class="general-td">类型明细:</td>
- name="typeDetail"class="selectCtrl"id="typeDetail">
- <c:forEachvar="blackList"
- items="${result.blackListRemarkList}">
- <optionvalue='<c:outvalue="${blackList.paramId}"/>'<c:iftest="${result.blackListDTO.typeDetail==blackList.paramId}">selected</c:if>>
- <c:outvalue="${blackList.paramValue}"/>
- </option>
- </c:forEach>
- <optionvalue="hc"<c:iftest='${result.blackListDTO.typeDetail=="hc"}'>selected</c:if>>呼出</option>
- <optionvalue="dx"<c:iftest='${result.blackListDTO.typeDetail=="dx"}'>selected</c:if>>短信</option>
- </select></td>
- <tdwidth="14%"align="right"class="general-td">是否屏蔽:</td>
- name="isExcluded"class="selectCtrl"id="isExcluded">
- <optionvalue="1"<c:iftest='${result.blackListDTO.isExcluded=="1"}'>selected</c:if>>是</option>
- <optionvalue="0"<c:iftest='${result.blackListDTO.isExcluded=="0"}'>selected</c:if>>否</option>
- <tdcolspan="4"align="right"class="general-td"><input
- name="efdag3"type="button"class="btn"value="查询"
- onclick="searchCallInControlDataList();"></td>
- </table>
- <tablewidth="100%"border="0"cellspacing="0"cellpadding="0">
- <td></td>
- <tablewidth="100%"border="0"cellpadding="0"cellspacing="0"
- bgcolor="#EFEFEF">
- <tdclass="SecondTitle">.:查询结果:.</td>
- <tdbgcolor="#999999">
- <tablename="tableB"border="0"cellspacing="1"cellpadding="1"
- width="100%">
- <tdwidth="10%"align="center"bgcolor="#DFE0E4"class="title-td">
- 选择
- <inputtype="checkBox"name="checkAll"id="checkAll"onclick="gotocheckAll(this);">
- <tdwidth="10%"align="center"bgcolor="#DFE0E4"
- class="title-td">数据来源</td>
- class="title-td">类型</td>
- class="title-td">类型明细</td>
- class="title-td">是否屏蔽</td>
- class="title-td">最新操作时间</td>
- <c:forEachvar="black"items="${result.blackList}">
- <tdstyle="display:none;"><inputtype="hidden"name="id"value='<c:outvalue="${black.id}"/>'></td>
- <tdwidth="7%"align="center"class="general-td"><input
- type="checkBox"name="toBeEdited"></td>
- <tdwidth="7%"align="center"class="general-td"id="dataSource1"
- style="color:<c:iftest='${emptyblack.isExcluded}'>red;</c:if>">
- <c:iftest="${black.dataSource==1}">电销系统</c:if>
- <c:iftest="${black.dataSource==2}">承保系统</c:if>
- <tdwidth="6%"align="center"class="general-td"id="type1"
- style="color:<c:iftest='${emptyblack.isExcluded}'>red;</c:if>">
- <c:iftest='${black.type=="1-1"||black.type=="1-2"}'>黑名单</c:if>
- <c:iftest='${black.type=="2"}'>号码屏蔽</c:if>
- <tdwidth="9%"align="center"class="general-td"id="tyepDetail1"
- <c:forEachvar="blackList"items="${result.blackListRemarkList}">
- <c:iftest='${blackList.paramId==black.typeDetail}'>
- <c:outvalue="${blackList.paramValue}"/>
- </c:if>
- </c:forEach>
- <tdalign="center"class="general-td">
- <c:iftest="${black.isExcluded==1}">是</c:if>
- <c:iftest="${black.isExcluded==0}">否</c:if>
- <c:outvalue="${black.updatedDate}"/>
- <tdalign="right"class="general-td"colspan="9"><input
- name="efdag2"type="button"class="btn"value="修改"onclick="edit();"></td>
- <tdclass="general-td"colspan="9">
- <tableid="table1"align="center"width="500"border="0"
- cellpadding="0"cellspacing="0">
- <tdid="td1"align="center"valign="middle"><input
- type="hidden"name="pageTotal"id="pageTotal1"
- value='<c:outvalue="${result.totalPage}"/>'><span>共<c:out
- value="${result.totalPage}"/>页
- </span><inputtype=buttonname="prevPage1"value="上一页"id="prevPage1"
- onClick="gotoPrevPage1()"class="btn2"><inputid="nextPage1"
- type=buttonname="nextPage1"value="下一页"
- onclick="gotoNextPage1();"class="btn2"><inputid="jump1"
- type=buttonname="jump1"value="跳至"onclick="gotoJump1()"
- class="btn2"><span>第<inputid="pageNo1"
- name="pageNo"style="text-align:center"
- value='<c:outvalue="${result.pageNo}"/>'
- class="inputbg3">
- </span>页</td>
- <tdclass="SecondTitle">.:临时数据处理:.</td>
- <tdwidth="14%"align="center"class="general-td">电话号码:</td>
- <tdwidth="38%"align="left"class="general-td"><inputid="phoneNo"
- maxlength="15"name="phoneNo"type="text"class="inputbg">
- <tdcolspan="4"align="right"class="general-td"><inputid="query2"
- onclick="searchCallInControlDataListByPhoneNo(this);"></td>
- <tablename="tableA"border="0"cellspacing="1"cellpadding="1"
- <trwidth="100%"id="insert">
- class="title-td">电话号码</td>
- class="title-td">状态</td>
- class="title-td">创建时间</td>
- class="title-td">更新时间</td>
- class="title-td">操作</td>
- <tdclass="general-td"colspan="9">
- <tableid="table1"align="center"width="500"border="0"
- cellpadding="0"cellspacing="0">
- <tdstyle="display:none;"><inputtype="hidden"id="hiddenPageNo2"></td>
- <tdid="td1"align="center"valign="middle">
- 共<spanid="pageTotal2">0</span>页
- <inputtype=buttonname="prevPage2"value="上一页"id="prevPage2"
- onClick="searchCallInControlDataListByPhoneNo(this)"class="btn2"disabled="disabled"><input
- type=buttonname="nextPage2"value="下一页"id="nextPage2"
- onClick="searchCallInControlDataListByPhoneNo(this)"class="btn2"disabled="disabled"><inputid="jump2"
- type=buttonname="jump2"value="跳至"onclick="searchCallInControlDataListByPhoneNo(this)"
- class="btn2"disabled="disabled">
- 第
- <span>
- <inputname="pageNo2"style="text-align:center"value="0"class="inputbg3"id="pageNo2">
- </span>
- 页
- </form>
- </body>
- <scripttype="text/javascript">
- varpageNo=$("#pageNo1").val();
- vardataSource=$("#dataSource").val();
- vartype=$("#type").val();
- vartypeDetail=$("#typeDetail").val();
- varisExcluded=$("#isExcluded").val();
- if($("#pageTotal1").val()<="1")
- {
- $("#prevPage1").attr("disabled","disabled");
- $("#nextPage1").attr("disabled","disabled");
- $("#jump1").attr("disabled",85); line-height:18px"> }else{
- if(pageNo==$("#pageTotal1").val())
- $("#nextPage1").attr("disabled",85); line-height:18px"> }elseif(pageNo=="1"){
- }
- }
- functiongotoPrevPage1()
- pageNo=parseInt($("#pageNo1").val());
- if(pageNo>1)
- {
- pageNo=pageNo-1;
- window.location.href="<%=request.getContextPath()%>/callInControlData.goto.do?dataSource="
- +dataSource+"&type="+type+"&typeDetail="+typeDetail+"&isExcluded="+isExcluded+"&pageNo="+pageNo;
- functiongotoNextPage1()
- if(pageNo<$("#pageTotal1").val())
- pageNo=parseInt(pageNo)+1;
- functiongotoJump1()
- vartemp=pageNo;
- pageNo=$("#pageNo1").val();
- if(isNaN(pageNo)||parseInt(pageNo)>$("#pageTotal1").val()||parseInt(pageNo)<1)
- alert("您输入的页数不存在!");
- returnfalse;
- window.location.href="<%=request.getContextPath()%>/callInControlData.goto.do?dataSource="
- +dataSource+"&type="+type+"&typeDetail="+typeDetail+"&isExcluded="+isExcluded+"&pageNo="+pageNo;
- functionsearchCallInControlDataList()
- dataSource=$("#dataSource").val();
- type=$("#type").val();
- typeDetail=$("#typeDetail").val();
- isExcluded=$("#isExcluded").val();
- +dataSource+"&type="+type+"&typeDetail="+typeDetail+"&isExcluded="+isExcluded;
- functionedit(){
- vartoBeEdited=$('input[name="toBeEdited"]:checked');
- if(toBeEdited.length==0){
- alert("请至少选择一条记录!");
- return;
- varids=newArray();
- for(vari=0;i<toBeEdited.length;i++){
- var_ids=toBeEdited.parent().prev().children();
- ids.push(_ids[i].value);
- window.location.href="<%=request.getContextPath()%>/callInControlData.goto.do?flag=edit&ids="+ids;
- functiongotocheckAll(obj){
- if(obj.checked){
- $('input[name="toBeEdited"]').attr("checked","checked");
- }else{
- functionsearchCallInControlDataListByPhoneNo(obj){
- varpageNo;
- if(obj.id=="query2"){
- pageNo="1";
- }elseif(obj.id=="prevPage2"){
- pageNo=parseInt($("#hiddenPageNo2").val())-1;
- if(pageNo==1){
- $("#prevPage2").attr("disabled",226); color:inherit; line-height:18px"> }elseif(obj.id=="nextPage2"){
- pageNo=parseInt($("#hiddenPageNo2").val())+1;
- if(pageNo==parseInt($("#pageTotal2").html())){
- $("#nextPage2").attr("disabled",85); line-height:18px"> }elseif(obj.id=="jump2"){
- if(isNaN($("#pageNo2").val())||$("#pageNo2").val()<1||$("#pageNo2").val()>$("#pageTotal2").html()){
- alert("您输入的页数不存在!");
- return;
- else{
- pageNo=$("#pageNo2").val();
- $.ajax({
- url:"<%=request.getContextPath()%>/callInControlData.goto.do",
- data:{flag:"queryByPhone",phoneNo:$("#phoneNo").val(),pageNo:pageNo},
- dataType:"json",
- type:"post",85); line-height:18px"> success:function(data){
- $("#pageTotal2").html(Math.ceil(data[0].pageTotal/10));
- if($("#pageTotal2").html()!=0){
- $("#pageNo2").val(pageNo);
- $("#hiddenPageNo2").val(pageNo);
- if($("#pageTotal2").html()>1){
- if(pageNo!=1){
- if(pageNo!=$("#pageTotal2").html()){
- $("#nextPage2").attr("disabled","");
- $("#jump2").attr("disabled",226); color:inherit; line-height:18px"> vardataSource="";
- vartype="";
- vartypeDetail="";
- varvalidFlag="";
- $('tr[name="dataInserted"]').remove();
- for(vari=0;i<data[0].blackList.length;i++){
- if(data[0].blackList[i].dataSource=="1"){
- dataSource="电销系统";
- }elseif(data[0].blackList[i].dataSource=="2"){
- dataSource="承保系统";
- if(data[0].blackList[i].type=="1-1"||data[0].blackList[i].type=="1-2"){
- type="黑名单";
- }elseif(data[0].blackList[i].type=="2"){
- type="号码屏蔽";
- if(data[0].blackList[i].validFlag=="1"){
- validFlag="有效";
- }elseif(data[0].blackList[i].validFlag=="0"){
- validFlag="无效";
- for(varj=0;j<data[0].blackListRemarkList.length;j++){
- if(data[0].blackList[i].typeDetail==data[0].blackListRemarkList[j].paramId){
- typeDetail=data[0].blackListRemarkList[j].paramValue;
- break;
- $('<trwidth="100%"name="dataInserted">'+
- '<tdalign="center"class="general-td">'+data[0].blackList[i].phoneNo+'</td>'+
- '<tdalign="center"class="general-td">'+dataSource+'</td>'+
- '<tdalign="center"class="general-td">'+type+'</td>'+
- '<tdalign="center"class="general-td">'+typeDetail+'</td>'+
- '<tdalign="center"class="general-td">'+validFlag+'</td>'+
- '<tdalign="center"class="general-td">'+data[0].blackList[i].createdDate+'</td>'+
- '<tdalign="center"class="general-td">'+data[0].blackList[i].updatedDate+'</td>'+
- '<tdalign="center"class="general-td"><inputtype="button"value="解锁呼入"class="btn"></td>'+
- '</tr>').insertAfter($("#insert"));
- },85); line-height:18px"> error:function(data){
- alert("系统异常,请联系管理员!");
- });
- </script>
后台java:
- packagecom.tpaic.callCenter.web.controller.comeInControlData;
- importjava.util.ArrayList;
- importjava.util.HashMap;
- importjava.util.List;
- importjava.util.Map;
- importjavax.servlet.http.HttpServletRequest;
- importjavax.servlet.http.HttpServletResponse;
- importnet.sf.json.JSONArray;
- importorg.apache.java.lang.Bytes;
- importorg.springframework.web.servlet.ModelAndView;
- importcom.tpaic.callCenter.biz.util.sqlNamesUtil;
- importcom.tpaic.callCenter.dto.CodeTableDTO;
- importcom.tpaic.callCenter.dto.blackList.BlackListDTO;
- importcom.tpaic.callCenter.util.StringUtil;
- importcom.tpaic.callCenter.web.controller.common.AbstractCommonController;
- importcom.tpaic.callCenter.web.util.CommonUtils;
- importcom.tpaic.callCenter.web.util.ServiceRequestId;
- /**
- *@authorex_zhangkenan
- *呼入控制数据设置
- */
- publicclassCallInControlDataGotoControllerextendsAbstractCommonController{
- privateStringeditView;
- publicStringgetEditView(){
- returneditView;
- publicvoidsetEditView(StringeditView){
- this.editView=editView;
- protectedModelAndViewhandleRequestInternal(HttpServletRequestrequest,HttpServletResponseresponse)throwsException{
- Map<String,Object>resultMap=newHashMap<String,Object>();
- Stringflag=request.getParameter("flag");
- if(flag==null){
- //查询电销系统黑名单原因列表
- @SuppressWarnings("unchecked")
- List<Object>blackListRemarkList=(List<Object>)this.getDispatch().dispatchRequest(
- CommonUtils.getAggregatedSearchDTO(
- sqlNamesUtil.CODETABLE_SEARCH_CODETYPE,"blackListRemark"),226); color:inherit; line-height:18px"> ServiceRequestId.AGGREGATED_SEARCH_ACTION);
- resultMap.put("blackListRemarkList",blackListRemarkList);
- //查询电销系统blacklist表
- StringpageNo=request.getParameter("pageNo");
- StringdataSource=request.getParameter("dataSource");
- Stringtype=request.getParameter("type");
- StringtypeDetail=request.getParameter("typeDetail");
- StringisExcluded=request.getParameter("isExcluded");
- BlackListDTOblackListDTO=newBlackListDTO();
- if(StringUtil.isEmpty(pageNo)){
- blackListDTO.setPageNo(1);
- }else{
- blackListDTO.setPageNo(Integer.parseInt(pageNo));
- blackListDTO.setDataSource(dataSource);
- blackListDTO.setType(type);
- blackListDTO.setTypeDetail(typeDetail);
- blackListDTO.setIsExcluded(isExcluded);
- StringtotalPage=(String)this.getDispatch().dispatchRequest(CommonUtils.getAggregatedSearchDTO(
- sqlNamesUtil.Search_Blacklist_For_Total_Page,blackListDTO,false),
- ServiceRequestId.AGGREGATED_SEARCH_ACTION);
- List<BlackListDTO>blackList=(List<BlackListDTO>)this.getDispatch().dispatchRequest(CommonUtils.getAggregatedSearchDTO(
- sqlNamesUtil.Search_Blacklist_For_List,blackListDTO),85); line-height:18px"> resultMap.put("pageNo",blackListDTO.getPageNo());
- resultMap.put("totalPage",totalPage);
- resultMap.put("blackList",blackList);
- resultMap.put("blackListDTO",blackListDTO);
- returnnewModelAndView(this.getSuccessView(),"result",resultMap);
- }elseif(flag.equals("edit")){
- Stringids=request.getParameter("ids");
- @SuppressWarnings({"unchecked"})
- sqlNamesUtil.Search_Blacklist_For_List_By_Ids,ids),226); color:inherit; line-height:18px"> resultMap.put("blackList",blackList);
- @SuppressWarnings("unchecked")
- List<CodeTableDTO>blackListRemarkList=(List<CodeTableDTO>)this.getDispatch().dispatchRequest(
- CommonUtils.getAggregatedSearchDTO(
- sqlNamesUtil.CODETABLE_SEARCH_CODETYPE,226); color:inherit; line-height:18px"> resultMap.put("blackListRemarkList",blackListRemarkList);
- returnnewModelAndView(this.getEditView(),226); color:inherit; line-height:18px"> }elseif(flag.equals("save")){
- StringisOrNotExcluded=request.getParameter("isOrNotExcluded");
- List<BlackListDTO>blackListDTO=newArrayList<BlackListDTO>();
- for(inti=0;i<ids.split(",").length;i++){
- BlackListDTOdto=newBlackListDTO();
- dto.setId(ids.split(",")[i]);
- dto.setIsExcluded(isOrNotExcluded.split(",")[i]);
- blackListDTO.add(dto);
- Stringdata="1";
- Map<String,Object>map=newHashMap<String,Object>();
- map.put("blackListDTO",85); line-height:18px"> try{
- this.getDispatch().dispatchRequest(map,ServiceRequestId.UPDATE_BLACK_LIST_FOR_ISEXCLUDED_ACTION);
- }catch(Exceptione){
- data="0";
- response.getWriter().write(data);
- returnnull;
- }elseif(flag.equals("queryByPhone")){
- StringphoneNo=request.getParameter("phoneNo");
- dto.setPhoneNo(phoneNo);
- dto.setPageNo(Integer.parseInt(pageNo));
- sqlNamesUtil.Search_Blacklist_For_List_By_Phone,dto),226); color:inherit; line-height:18px"> StringpageTotal=(String)this.getDispatch().dispatchRequest(CommonUtils.getAggregatedSearchDTO(
- sqlNamesUtil.Search_Blacklist_By_Phone_For_Num,phoneNo,85); line-height:18px"> map.put("blackList",226); color:inherit; line-height:18px"> map.put("blackListRemarkList",85); line-height:18px"> map.put("pageTotal",pageTotal);
- JSONArrayjsonArray=JSONArray.fromObject(map);
- response.setCharacterEncoding("UTF-8");
- response.getWriter().write(jsonArray.toString());
- }