Преглед на файлове

Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent

liujiankang преди 7 години
родител
ревизия
ffd4280308

+ 5 - 8
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java

@@ -280,15 +280,13 @@ public class CustomerServiceImpl implements CustomerService {
         logger.info("-----------修改客诉-修改客诉基本信息---------------");
 
         QuestionDescribe questionDescribe = new QuestionDescribe();
-        questionDescribe.setCustomerId(customerInfo.getCustomerId());
+//        questionDescribe.setCustomerId(customerInfo.getCustomerId());
         questionDescribe.setDescribeId(customerInfo.getDescribeId());//客诉问题主键
         questionDescribe.setDescribeTitle(customerInfo.getDescribeTitle());  //客诉问题标题
         questionDescribe.setDescribeContent(customerInfo.getDescribeContent());  //客诉问题描述
         questionDescribe.setDescribeHandleDesc(customerInfo.getDescribeHandleDesc());   //处理描述
         questionDescribeMapper.updateByPrimaryKeySelective(questionDescribe);
-
         logger.info("-----------修改客诉-修改客诉问题---------------");
-
         if ("2".equals(customerInfo.getCustomerIsVisit())) {
             Visit visit = new Visit();
             visit.setCustomerId(customerInfo.getCustomerId());
@@ -305,7 +303,6 @@ public class CustomerServiceImpl implements CustomerService {
             }
             logger.info("-----------修改客诉-修改客诉回访信息---------------");
         }
-
         if (2 == customerInfo.getCustomerCounselType() &&
                 (customerInfo.getCustomerIsSolve() == 3 || customerInfo.getCustomerIsSolve() == 4 || customerInfo.getCustomerIsSolve() == 5 ||
                         customerInfo.getCustomerIsSolve() == 6 || customerInfo.getCustomerIsSolve() == 7)
@@ -313,7 +310,6 @@ public class CustomerServiceImpl implements CustomerService {
 
             salesOrder = salesOrderMapper.getSalesOrderById(salesOrder.getSalesId());
             logger.info("-----------修改客诉-查询订单--------------");
-
             CustomerCommon customerCommon = customerInfo.getCustomerCommon();
             customerCommon.setCustomerId(customerInfo.getCustomerId()); //设置客诉id
             customerCommon.setRelationBackStatus(1); //寄回状态 1:未寄回
@@ -462,6 +458,7 @@ public class CustomerServiceImpl implements CustomerService {
         if ("2".equals(customerInfo.getCustomerIsVisit())){
             visitMapper.deleteByPrimaryKey(customer.getCustomerId());
         }
+
         //查询旧客诉类型,判断是否修改了客诉类型
         Integer oldIsSolve = customerInfo.getCustomerIsSolve();// //处理结果: 1:已解决  2:未解决 3:换新  4:维修 5:补发 6:退货 7:无理由退货
         ClosedProdcue closedrecord = new ClosedProdcue();
@@ -498,7 +495,7 @@ public class CustomerServiceImpl implements CustomerService {
                     record.setRelationId(renewed.getRenewedId());
                     customerCommon.setSendProdcues(sendProdcueMapper.listSendProdcue(record));
                     customerService.setName(customerCommon);
-                    customerService.chargebackEfastOrder(customerCommon,salesOrder,8,2);
+                    //customerService.chargebackEfastOrder(customerCommon,salesOrder,8,2);
                 }
                 //删除寄出寄回产品
                 closedRecord.setRelationId(renewed.getRenewedId());
@@ -524,7 +521,7 @@ public class CustomerServiceImpl implements CustomerService {
                     record.setRelationId(repair.getRepairId());
                     customerCommon.setSendProdcues(sendProdcueMapper.listSendProdcue(record));
                     customerService.setName(customerCommon);
-                    customerService.chargebackEfastOrder(customerCommon, salesOrder, 8,2);    //从维修换货补发修改为已解决或未解决时,原订单生成退单
+                    //customerService.chargebackEfastOrder(customerCommon, salesOrder, 8,2);    //从维修换货补发修改为已解决或未解决时,原订单生成退单
                 }
                 //删除寄出寄回产品
                 closedRecord.setRelationId(repair.getRepairId());
@@ -550,7 +547,7 @@ public class CustomerServiceImpl implements CustomerService {
                     record.setRelationId(reissue.getReissueId());
                     customerCommon.setSendProdcues(sendProdcueMapper.listSendProdcue(record));
                     customerService.setName(customerCommon);
-                    customerService.chargebackEfastOrder(customerCommon, salesOrder, 8,2);    //从维修换货补发修改为已解决或未解决时,原订单生成退单
+                    //customerService.chargebackEfastOrder(customerCommon, salesOrder, 8,2);    //从维修换货补发修改为已解决或未解决时,原订单生成退单
                 }
                 //删除寄出产品
                 sendProdcue.setRelationId(reissue.getReissueId());

+ 3 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/questionDescribeMapper.xml

@@ -80,6 +80,9 @@
       <if test="describeHandleDesc != null" >
         describe_handle_desc = #{describeHandleDesc,jdbcType=INTEGER},
       </if>
+      <if test="describeTitle != null" >
+        describe_title = #{describeTitle},
+      </if>
     </set>
     where describe_id = #{describeId,jdbcType=INTEGER}
   </update>

+ 7 - 4
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -334,8 +334,8 @@ public class AdminCustomerController {
         for (int i = 0; i < list.size(); i++) {
             SalesOrderItem salesOrderItem = list.get(i);
             if (salesOrderItem.getItemIsSource() == 1) { //产品来源 1:产品颜色表,2:配件表
-                Product product = productService.getProductById(salesOrderItem.getItemProductId());
-                ProductColor productColor = productService.getProduceColor(salesOrderItem.getItemProductId());
+                Product product = productService.getProductById(salesOrderItem.getItemColorId());
+                ProductColor productColor = productService.getProduceColor(salesOrderItem.getItemColorId());
                 salesOrderItem.setItemProductType(product.getProductType());
                 salesOrderItem.setItemProductName(product.getProductName());
                 salesOrderItem.setItemProductPic(productColor.getColorPicture());
@@ -346,7 +346,7 @@ public class AdminCustomerController {
                 salesOrderItem.setItemIsSource(1);
                 salesAmount += productColor.getColorDiscount();
             } else if (salesOrderItem.getItemIsSource() == 2) {
-                Product product = productService.getProductById(salesOrderItem.getItemProductId());
+                Product product = productService.getProductByFittingsId(salesOrderItem.getItemProductId());
                 FittingsInfo fittingsInfo = fittingsInfoService.getFittingsById(salesOrderItem.getItemColorId());
                 salesOrderItem.setItemProductType(product.getProductType());
                 salesOrderItem.setItemProductName(product.getProductName());
@@ -480,14 +480,16 @@ public class AdminCustomerController {
     @RequiresPermissions("customer:select:customer")
     @RequestMapping("/select_customer_list")
     public ModelAndView selectCustomerList(HttpServletRequest request, CustomerInfo customerInfo,
+                                           @RequestParam(value = "isFirst", defaultValue = "1", required = false) Integer isFirst,
                                            @RequestParam(value = "pageSize", defaultValue = "10", required = false) Integer pageSize,
                                            @RequestParam(value = "pageNO", defaultValue = "1", required = false) Integer pageNO,
                                            @RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum) throws Exception {
         ModelAndView mv = new ModelAndView("cm/customer/custome_list");
-        if(customerInfo.getAdminId() == null){
+        if(customerInfo.getAdminId() == null && isFirst == 1){
             //获取登录员工id
             Integer adminId = AdminUtils.getLoginAdminId();
             customerInfo.setAdminId(adminId);
+            isFirst = 2;
         }
         PagedResult<CustomerInfo> pagedResult = customerService.listCustomer(pageNO, pageSize, customerInfo, totalNum == 0);
         if (totalNum != 0) {
@@ -509,6 +511,7 @@ public class AdminCustomerController {
         mv.addObject("typeList", typeList);
         mv.addObject("complaintTypeList", complaintTypeList);
         mv.addObject("adminList", adminList);
+        mv.addObject("isFirst", isFirst);
         customerInfo.setVisit(null);
         customerInfo.setCustomerCommon(null);
         customerInfo.setComplaintDetectList(null);

+ 1 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSalesOrderController.java

@@ -325,5 +325,6 @@ public class AdminSalesOrderController {
                 return new ResponseJson(500, "没有查到该订单信息!", 500);
             }
         }
+
     }
 }

+ 21 - 14
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/add_customer.ftl

@@ -132,12 +132,12 @@
                 </div>
             </div>
             <div class="row cl">
-                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>客户信息:</label>
+                <label class="form-label col-1 col-sm-1">客户信息:</label>
                 <div class="formControls col-2 col-sm-2 skin-minimal">
-                    <input type="text" class="input-text" placeholder="用户姓名" id="customerName" name="customerName" value="">
+                    <input type="text" class="input-text trim_input" placeholder="用户姓名" id="customerName" name="customerName" value="">
                 </div>
                 <div class="formControls col-2 col-sm-2 skin-minimal">
-                    <input type="text" class="input-text" placeholder="用户电话" id="customerTel" name="customerTel" value="">
+                    <input type="text" class="input-text associated-phone" placeholder="用户电话" id="customerTel" name="customerTel" value="">
                 </div>
             </div>
 
@@ -161,7 +161,7 @@
                 </div>
                 <div class="formControls col-2 col-sm-2">
                     <div class="clearfix">
-                        <input type="text" placeholder="搜索关键词" class="input-text  ac_input" name="questionIdMsg" value="" id="search_text" autocomplete="off" style="width:60%"><button type="button" class="btn btn-primary" id="search_button">搜索</button>
+                        <input type="text" placeholder="搜索关键词" class="input-text  ac_input trim_input" name="questionIdMsg" value="" id="search_text" autocomplete="off" style="width:60%"><button type="button" class="btn btn-primary" id="search_button">搜索</button>
                     </div>
                 </div>
 
@@ -182,7 +182,7 @@
             <div class="row cl">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>问题标题:</label>
                 <div class="formControls col-5 col-sm-5">
-                    <input type="text" class="input-text" style="width: 625px;" name="describeTitle" id="describeTitle" datatype="*1-50" errormsg="问题标题不正确!" >
+                    <input type="text" class="input-text trim_input" style="width: 625px;" name="describeTitle" id="describeTitle" datatype="*1-50" errormsg="问题标题不正确!" >
                 </div>
             </div>
 
@@ -530,10 +530,10 @@
                 <div class="row cl">
                     <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>被回访人:</label>
                     <div class="formControls col-2 col-sm-2">
-                        <input type="text" class="input-text" value="" placeholder="填写回访人姓名" id="" name="visitName"  datatype="*1-16" errormsg="回访人姓名格式不正确!" >
+                        <input type="text" class="input-text trim_input" value="" placeholder="填写回访人姓名" id="" name="visitName"  datatype="*1-16" errormsg="回访人姓名格式不正确!" >
                     </div>
                     <div class="formControls col-2 col-sm-2">
-                        <input type="text" class="input-text associated-phone" value="" placeholder="填写回访人手机号" id="" name="visitTel" datatype="n11-12" ignore="ignore" errormsg="回访人手机号码格式不正确!">
+                        <input type="text" class="input-text associated-phone" value="" placeholder="填写回访人手机号" id="" name="visitTel"  ignore="ignore" errormsg="回访人手机号码格式不正确!">
                     </div>
                 </div>
                 <div class="row cl">
@@ -610,6 +610,10 @@
 
 <script>
 
+    $(function(){
+
+    })
+
     /*是否是修改页面*/
     var isUpdate = false;
     /*是否需要回访  只有修改页面才会使用*/
@@ -740,13 +744,16 @@
 
         /* 监听手机号 失去焦点时  将其他手机号码未填的 补充上去 */
         $(".associated-phone").blur(function (){
-            var phone = $(this).val();
-            $(".associated-phone").each(function(){
-                var ph = $(this).val();
-                if(ph == null || ph == "" || typeof(ph) == undefined ){
-                    $(this).val(phone);
-                }
-            })
+            var phone = $.trim($(this).val());
+            $(this).val(phone);
+            if(phone.length == 11 && phoneReg.test(phone)){
+                $(".associated-phone").each(function(){
+                    var ph = $(this).val();
+                    if(ph == null || ph == "" || typeof(ph) == "undefined" || ph.length != 11){
+                        $(this).val(phone);
+                    }
+                })
+            }
         })
 
     })

+ 1 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/custome_list.ftl

@@ -38,6 +38,7 @@
     <div class="text-c">
         <form action="${path}/admin/customer/select_customer_list" method="post">
             <button type="button" style="cursor:pointer; float: left;height: 35px;margin-right: 30px;" class="my-btn-search" onclick="toAddCustomer();">新建客诉</button>
+            <input type="hidden" value="${isFirst!'1'}" placeholder="判断是否是第一次进去客诉列表" id="isFirst" name="isFirst">
             <input type="text" class="my-input"  style="width:90px;margin-right: 0px; margin-left: -65px;" value="${customerInfo.customerId!}" placeholder="客诉编号" id="customerId" name="customerId">
             <input type="text" class="my-input"  style="width:90px;margin-right: 0px;" value="${customerInfo.sendLogisticsNo!}" placeholder="物流编号" id="sendLogisticsNo" name="sendLogisticsNo">
             <input type="text" class="my-input"  style="width:90px;margin-right: 0px;" value="${customerInfo.customerName!}" placeholder="请输入姓名" id="customerName" name="customerName">

+ 2 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_customer.ftl

@@ -135,7 +135,7 @@
                 </div>
             </div>
             <div class="row cl">
-                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>客户信息:</label>
+                <label class="form-label col-1 col-sm-1">客户信息:</label>
                 <div class="formControls col-2 col-sm-2 skin-minimal">
                     <input type="text" class="input-text" placeholder="用户姓名" id="customerName" name="customerName" value="${customerInfo.customerName!''}">
                 </div>
@@ -204,7 +204,7 @@
             <div class="row cl">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>问题回复:</label>
                 <div class="formControls col-5 col-sm-5">
-                    <input type="hidden" name="questionId" id="questionId" value="">
+                    <input type="hidden" name="questionId" id="questionId" value="${customerInfo.questionId!''}">
                     <script id="describeContentText" type="text/plain" style="width:983px;height:250px;"></script>
                     </script>
                     <input type="hidden" name="describeContent" id="describeContent" value="">

+ 5 - 5
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_reissue.ftl

@@ -375,11 +375,11 @@
     function checkReissue() {
         var reissue_flag = true;
         var reissueSendName = $('#reissueSendName').val();
-        if (!uname.test(reissueSendName)) {
-            layer.msg("寄回人信息格式不正确,请重新输入!",{icon: 5,time:1000});
-            reissue_flag = false;
-            return reissue_flag;
-        }
+//        if (!uname.test(reissueSendName)) {
+//            layer.msg("寄回人信息格式不正确,请重新输入!",{icon: 5,time:1000});
+//            reissue_flag = false;
+//            return reissue_flag;
+//        }
         var reissueSendTel = $('#reissueSendTel').val();
         if (!mobile.test(reissueSendTel)) {
             layer.msg("寄回人电话号码格式不正确,请重新输入!",{icon: 5,time:1000});

+ 5 - 5
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_renewed.ftl

@@ -834,11 +834,11 @@
                     renewed_flag = false;
                     return renewed_flag;
                 }
-                if (!uname.test(renewedBackName)) {
-                    layer.msg("寄回人信息格式不正确,请重新输入!",{icon: 5,time:1000});
-                    renewed_flag = false;
-                    return renewed_flag;
-                }
+//                if (!uname.test(renewedBackName)) {
+//                    layer.msg("寄回人信息格式不正确,请重新输入!",{icon: 5,time:1000});
+//                    renewed_flag = false;
+//                    return renewed_flag;
+//                }
                 if (!mobile.test(renewedBackTel)) {
                     layer.msg("寄回人电话号码格式不正确,请重新输入!",{icon: 5,time:1000});
                     renewed_flag = false;

+ 5 - 5
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_repair.ftl

@@ -834,11 +834,11 @@
                     repair_flag = false;
                     return repair_flag;
                 }
-                if (!uname.test(repairBackName)) {
-                    layer.msg("寄回人信息格式不正确,请重新输入!",{icon: 5,time:1000});
-                    repair_flag = false;
-                    return repair_flag;
-                }
+//                if (!uname.test(repairBackName)) {
+//                    layer.msg("寄回人信息格式不正确,请重新输入!",{icon: 5,time:1000});
+//                    repair_flag = false;
+//                    return repair_flag;
+//                }
                 if (!mobile.test(repairBackTel)) {
                     layer.msg("寄回人电话号码格式不正确,请重新输入!",{icon: 5,time:1000});
                     repair_flag = false;

+ 3 - 3
watero-rst-web/src/main/webapp/WEB-INF/views/cm/salesOrder/sales_order_list.ftl

@@ -39,7 +39,7 @@
             <div style="float: left;box-sizing: border-box;min-height: 1px;">
                 <input type="text" id="efastOrderId" style="width: 200px;" class="input-text" value="" placeholder="请输入百胜交易号" nullmsg="订单编号不能为空">
             </div>
-            <div class="col-4"> </div>
+            <div class="col-4"></div>
         </div>
         <div class="row cl">
             <div class="formControls col-8">&nbsp;&nbsp;&nbsp;<span class="c-red" id="msge"></span></div>
@@ -57,7 +57,7 @@
 <div class="page-container">
     <div class="text-c">
         <form action="${path}/admin/salesOrder/list_order_page" method="post">
-            <input type="text" class="my-input"  style="width:90px;margin-right: 0px;" value="${salesOrder.salesOrderId!}" placeholder="订单号" name="salesOrderId" id="salesOrderId">
+            <input type="text" class="my-input"  style="width:90px;margin-right: 0px;" value="${salesOrder.salesOrderId!}" placeholder="百胜订单号" name="salesOrderId" id="salesOrderId">
             <input type="text" class="my-input"  style="width:90px;margin-right: 0px;" value="${salesOrder.salesAddressName!}" placeholder="收货人姓名" name="salesAddressName" id="salesAddressName">
             <input type="text" class="my-input"  style="width:90px;margin-right: 0px;" value="${salesOrder.salesAddressTel!}" placeholder="收货人电话" name="salesAddressTel" id="salesAddressTel">
             <input type="text" style="width:150px;height:36px;margin-right: 0px;" name="startDate" id="startDate" class="input-text" placeholder="开始时间" onClick="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',skin:'whyGreen' })" value="${(salesOrder.startDate?string("yyyy-MM-dd HH:mm:ss"))!''}" readonly="readonly"/>-
@@ -251,7 +251,7 @@
     }
 
     function submitSynOrder() {
-        var efastOrderId = $('#efastOrderId').val();
+        var efastOrderId = $.trim($('#efastOrderId').val());
         if(efastOrderId == null || efastOrderId == ""){
             $("#msge").html("请输入百胜交易号!");
             return false;

+ 20 - 2
watero-rst-web/src/main/webapp/common/js/common/common.js

@@ -190,8 +190,11 @@ function keyFun(node,maxNumber,minNumber){
 /**
  * 用于展示错误信息,并让该节点得到焦点
  */
-function vailErrorMsg(node,msg){
-    layer.msg(msg, {icon: 5, time: 2000});
+function vailErrorMsg(node,msg,number){
+    if(typeof (number) == "undefined"){
+        number = 2000;
+    }
+    layer.msg(msg, {icon: 5, time: number});
     node.select();
     window.setTimeout(function(){
         node.focus();
@@ -199,6 +202,21 @@ function vailErrorMsg(node,msg){
     $("html,body").animate({scrollTop:node.offset().top},300);//1000是ms,也可以用slow代替
 }
 
+/**
+ * 1000表的提示信息
+ * 用于展示错误信息,并让该节点得到焦点
+ */
+function vailErrorMsg_1(node,msg){
+    vailErrorMsg(node,msg,1000);
+}
+/**
+ * 5000表的提示信息
+ * 用于展示错误信息,并让该节点得到焦点
+ */
+function vailErrorMsg_5(node,msg){
+    vailErrorMsg(node,msg,5000);
+}
+
 
 /**物流名称替换**/
 function replace(code) {

+ 32 - 0
watero-rst-web/src/main/webapp/common/js/customer/customer.js

@@ -201,6 +201,19 @@ var isSolveTitleMsg = {
 /*===============================定义全局变量以及监听事件和初始化  -- end -- =============================== */
 
 
+/*===============================正则表达式  -- start -- =============================== */
+var phoneReg = /^[1][3,4,5,7,8][0-9]{9}$/;
+/*===============================正则表达式  -- end -- =============================== */
+
+/*=============================== 页面加载完成启动事件  -- start -- =============================== */
+$(function (){
+    $(".trim_input").change(function(){
+        var value = $.trim($(this).val());
+        $(this).val(value);
+    })
+})
+/*===============================页面加载完成启动事件  -- end -- =============================== */
+
 /*用于初始化监听回访信息的展示*/
 function initVisitEvent(){
     $("input[name='customerIsVisit']").change(function (){
@@ -1410,6 +1423,25 @@ function addCustomerReady(){
         $("#customerTel").val($("#sendTel").val());
     }*/
 
+    var phoneFlag = true;
+    $(".associated-phone").each(function () {
+        var phone = $(this).val();
+        if(phone != null && phone != "" && typeof (phone) != "undefined"){
+            if(phone.length != 11){
+                vailErrorMsg($(this),"手机号码格式不正确");
+                phoneFlag = false;
+            }
+            if (!phoneReg.test(phone)) {
+                vailErrorMsg($(this),"手机号码格式不正确");
+                phoneFlag = false;
+            }
+        }
+    })
+
+    if(!phoneFlag){
+        return false;
+    }
+
     /*验证来源入口*/
     var customerSourceType = $("input:radio[name='customerSourceType']:checked").val();
     if(customerSourceType == 3){