Explorar o código

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

# Conflicts:
#	watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java
wangxiaoming %!s(int64=7) %!d(string=hai) anos
pai
achega
0fc0ac0ec2

+ 11 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ClosedProdcue.java

@@ -1,5 +1,7 @@
 package com.iamberry.rst.core.cm;
 
+import com.iamberry.rst.core.order.ProductColor;
+
 import java.io.Serializable;
 
 public class ClosedProdcue  implements Serializable {
@@ -20,6 +22,7 @@ public class ClosedProdcue  implements Serializable {
 
     private Integer productType;        //商品类型
     private String productNumber;       //产品型号
+    private ProductColor productColor;      //颜色
 
     public String getClosedProductName() {
         return closedProductName;
@@ -92,4 +95,12 @@ public class ClosedProdcue  implements Serializable {
     public void setProductNumber(String productNumber) {
         this.productNumber = productNumber;
     }
+
+    public ProductColor getProductColor() {
+        return productColor;
+    }
+
+    public void setProductColor(ProductColor productColor) {
+        this.productColor = productColor;
+    }
 }

+ 25 - 7
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java

@@ -89,6 +89,7 @@ public class CustomerServiceImpl implements CustomerService {
         if(flag < 1){
             throw new RuntimeException("添加客诉失败");
         }
+        logger.info("-----------添加客诉-添加客诉基本信息---------------");
 
         QuestionDescribe questionDescribe = new QuestionDescribe();
         questionDescribe.setCustomerId(customerInfo.getCustomerId());
@@ -99,6 +100,7 @@ public class CustomerServiceImpl implements CustomerService {
         if(flag < 1){
             throw new RuntimeException("添加客诉问题失败");
         }
+        logger.info("-----------添加客诉-添加客诉问题---------------");
 
         if ("2".equals(customerInfo.getCustomerIsVisit())) {
             Visit visit = new Visit();
@@ -114,6 +116,7 @@ public class CustomerServiceImpl implements CustomerService {
             if(flag < 1){
                 throw new RuntimeException("添加客诉回访失败");
             }
+            logger.info("-----------添加客诉-添加客诉回访信息---------------");
         }
 
         if (2 == customerInfo.getCustomerCounselType() &&
@@ -122,6 +125,7 @@ public class CustomerServiceImpl implements CustomerService {
                 ){
 
             salesOrder = salesOrderMapper.getSalesOrderById(salesOrder.getSalesId());
+            logger.info("-----------添加客诉-查询订单--------------");
 
             CustomerCommon customerCommon = customerInfo.getCustomerCommon();
             customerCommon.setCustomerId(customerInfo.getCustomerId()); //设置客诉id
@@ -134,8 +138,12 @@ public class CustomerServiceImpl implements CustomerService {
             customerCommon.setRelationIsTransfer(0);    //是否已转账邮费  0:不需要
             customerCommon.setRelationBackPostage(0);   //邮费默认为0
 
+            customerCommon.setRelationBackName(customerCommon.getRelationSendName()); //姓名
+            customerCommon.setRelationBackTel(customerCommon.getRelationSendTel()); //电话号码
+
             /*  初始化产品类型,名称,配件名称 */
             customerService.setName(customerCommon);
+            logger.info("-----------添加客诉-初始化产品,配件信息--------------");
 
             ComplaintDetectInfo complaintDetectInfo = new ComplaintDetectInfo();  //品质检测
             ComplaintSignclosedInfo complaintSignclosedInfo = new ComplaintSignclosedInfo(); //客诉-签收表
@@ -185,7 +193,7 @@ public class CustomerServiceImpl implements CustomerService {
                     break;
                 case 6: //退货
 
-                   customerService.chargebackEfastOrder(customerCommon,salesOrder,3);    //原订单生成退单
+                    customerService.chargebackEfastOrder(customerCommon,salesOrder,3);    //原订单生成退单
 
                     complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());    //原有订单的Efast的订单编号
                     customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);//创建仓储任务
@@ -202,6 +210,7 @@ public class CustomerServiceImpl implements CustomerService {
                     customerService.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);   //创建品检
                     break;
             }
+            logger.info("-----------添加客诉-创建仓储/品检成功--------------");
             customerCommon.setSignclosedId(complaintSignclosedInfo.getSignclosedId()); //设置仓储id
 
             Object object = CustomerCommon.getRelation(customerInfo.getCustomerIsSolve(), customerCommon);
@@ -236,7 +245,7 @@ public class CustomerServiceImpl implements CustomerService {
             if (flag < 1) {
                 throw new RuntimeException("添加客诉处理结果失败");
             }
-
+            logger.info("-----------添加客诉-添加换新/维修/补发/退货/无理由退货信息成功--------------");
             customerCommon.setRelationId(relationId);
 
             CustomerCommon.setProduceOrFitting(customerInfo.getCustomerIsSolve(),customerCommon);
@@ -253,6 +262,7 @@ public class CustomerServiceImpl implements CustomerService {
             if(customerCommon.getSendFittings() != null && customerCommon.getSendFittings().size() > 0){
                 sendFittingMapper.insert(customerCommon.getSendFittings());
             }
+            logger.info("-----------添加客诉-寄回寄出产品配件成功--------------");
         }
         return flag;
     }
@@ -262,6 +272,7 @@ public class CustomerServiceImpl implements CustomerService {
      * 产品配件初始化
      * @param cc
      */
+    @Transactional
     public void setName(CustomerCommon cc){
         for (int i=0;i<cc.getSendProdcues().size();i++) {
             Product product = productMapper.getProduce(cc.getSendProdcues().get(i).getProductId());
@@ -277,13 +288,12 @@ public class CustomerServiceImpl implements CustomerService {
             cc.getSendFittings().get(i).setFittingsId(fittingsInfo.getFittingsId());
         }
         for (int i=0;i<cc.getClosedProdcues().size();i++) {
-            Product product = productMapper.getProduce(cc.getSendProdcues().get(i).getProductId());
+            Product product = productMapper.getProduce(cc.getClosedProdcues().get(i).getProductId());
             cc.getClosedProdcues().get(i).setClosedProductName(product.getProductName());
             cc.getClosedProdcues().get(i).setProductType(product.getProductType());
             cc.getClosedProdcues().get(i).setProductNumber(product.getProductNumber());
-
-            ProductColor productColor = productMapper.getProduceColor(cc.getSendProdcues().get(i).getColorId());
-            cc.getSendProdcues().get(i).setProductColor(productColor);
+            ProductColor productColor = productMapper.getProduceColor(cc.getClosedProdcues().get(i).getColorId());
+            cc.getClosedProdcues().get(i).setProductColor(productColor);
         }
         for (int i=0;i<cc.getClosedFittings().size();i++) {
             FittingsInfo fittingsInfo = fittingsInfoMapper.getFittingsById(cc.getClosedFittings().get(i).getFittingsId());
@@ -583,8 +593,16 @@ public class CustomerServiceImpl implements CustomerService {
         }
         if(oList != null && oList.size() > 0){
             map.put("EfastOrderId",oList.get(0).getOrderId());
+
+            SalesOrder sa =  new SalesOrder();
+            sa.setSalesId(salesOrder.getSalesId());
+            sa.setSalesOrderId(oList.get(0).getOrderId());
+            orderNum = salesOrderMapper.updateSalesOrder(sa);
+            if (orderNum <= 0) {
+                throw new RuntimeException("系统修改订单失败,订单回滚,Efast交易号:"+salesOrder.getSalesDealCode());
+            }
         }else{
-            throw new RuntimeException("添加订单项失败");
+            throw new RuntimeException("添加Efast订单失败");
         }
         map.put("status",status);
         return map;

+ 2 - 2
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/visitMapper.xml

@@ -51,12 +51,12 @@
 
   <!-- 添加客诉回访信息 -->
   <insert id="addVisitInfo" parameterType="Visit" useGeneratedKeys="true"  keyProperty="visitId" >
-    insert into tb_rst_visit (visit_id, customer_id, admin_id, 
+    insert into tb_rst_visit (visit_id, customer_id, admin_id, designated_admin_id,
       visit_name, visit_tel, visit_date, 
       visit_time_select, visit_status, visit_complete_date, 
       visit_complete_name, visit_complete_tel, visit_complete_remark, 
       visit_complete_sex)
-    values (#{visitId,jdbcType=INTEGER}, #{customerId,jdbcType=INTEGER}, #{adminId,jdbcType=INTEGER}, 
+    values (#{visitId,jdbcType=INTEGER}, #{customerId,jdbcType=INTEGER}, #{adminId,jdbcType=INTEGER}, #{designatedAdminId,jdbcType=INTEGER},
       #{visitName,jdbcType=VARCHAR}, #{visitTel,jdbcType=CHAR}, #{visitDate,jdbcType=DATE}, 
       #{visitTimeSelect,jdbcType=BIT}, #{visitStatus,jdbcType=TINYINT}, #{visitCompleteDate,jdbcType=DATE}, 
       #{visitCompleteName,jdbcType=VARCHAR}, #{visitCompleteTel,jdbcType=CHAR}, #{visitCompleteRemark,jdbcType=VARCHAR}, 

+ 18 - 14
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -237,17 +237,14 @@ public class AdminCustomerController {
 
         try {
             Map<String, Object> map = customerService.sendEfastOrder(salesOrder);
-            if (map.get("status") == 1) {
-                salesOrder.setSalesOrderId((String) map.get("EfastOrderId"));
-            } else {
-                return new ResponseJson(500, "添加订单失败!", 500);
-            }
+//            if (map.get("status") == 1) {
+//                salesOrder.setSalesOrderId((String) map.get("EfastOrderId"));
+//            }
         } catch (RuntimeException e) {
-            return new ResponseJson(500, e.getMessage(), 500);
+            return new ResponseJson(500, "添加订单成功--"+ e.getMessage(), 500);
         }
-
         Integer orderId = salesOrder.getSalesId();
-        ResponseJson rj = new ResponseJson(200, "添加成功", 200);
+        ResponseJson rj = new ResponseJson(200, "添加订单成功", 200);
         rj.addResponseKeyValue("orderId", orderId);
         return rj;
     }
@@ -512,6 +509,7 @@ public class AdminCustomerController {
         ResponseJson rj = new ResponseJson(200, "修改成功!", 200);
 
         ProductType productType = new ProductType();
+        productType.setTypeStatus(1);
         List<ProductType> productTypeList = productService.listProductType(productType);
 
         if (productTypeList != null && productTypeList.size() > 0) {
@@ -584,6 +582,10 @@ public class AdminCustomerController {
     @RequestMapping("/save_customer")
     public ResponseJson addCustomer(HttpServletRequest request, CustomerInfo customerInfo, SalesOrder salesOrder, CustomerCommon customerCommon,
                                     String sendProdcuesJson, String sendFittingsJson, String closedProdcuesJson, String closedFittingsJson) throws Exception {
+        ResponseJson rjx = this.isValiData(customerInfo);
+        if(rjx.getResultCode() == 500){
+            return rjx;
+        }
         Integer flag = 0;
         JSONArray jsonArray;
         List<SendProdcue> sendProdcueList;
@@ -620,11 +622,13 @@ public class AdminCustomerController {
         }
         customerInfo.setTransactionNumber(orderId);
 
+        logger.info("-----------------添加客诉开始----------------------");
         try {
             flag = customerService.saveCustomerInfo(customerInfo, salesOrder);
         } catch (RuntimeException e) {
             return new ResponseJson(500, e.getMessage(), 500);
         }
+        logger.info("-----------------添加客诉结束----------------------");
         if (flag < 1) {
             return new ResponseJson(500, "添加客诉失败!", 500);
         }
@@ -685,12 +689,12 @@ public class AdminCustomerController {
      * @param customerInfo
      * @return
      */
-    public boolean isValiData(CustomerInfo customerInfo) {
-        boolean flag = true;
-//        if (customerInfo.getBomName() == null || "".equals(customerInfo.getBomName())) {
-//            return false;
-//        }
-        return flag;
+    public ResponseJson isValiData(CustomerInfo customerInfo) {
+        ResponseJson rj = new ResponseJson();
+        if(customerInfo.getAdminId() == null){
+            return new ResponseJson(500, "未填写客诉id", 500);
+        }
+        return rj;
     }
 
     /**

+ 3 - 3
watero-rst-web/src/main/java/com/iamberry/rst/utils/test.java

@@ -5,7 +5,7 @@ import com.auth0.jwt.internal.org.apache.commons.codec.binary.Base64;
 import com.auth0.jwt.internal.org.apache.commons.codec.binary.StringUtils;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
-import org.apache.kafka.clients.consumer.ConsumerRecord;
+//import org.apache.kafka.clients.consumer.ConsumerRecord;
 
 
 import java.io.File;
@@ -32,7 +32,7 @@ public class test {
     }
 
 
-    public static void main(String[] args) throws Exception {
+   /* public static void main(String[] args) throws Exception {
         ConsumerRecord<String, String> record = new ConsumerRecord<String, String>("4", 1, 1, "data", "{\"data\":\"7uiBfrOFcdy/EDWxcT6SlSH10bmyKW4BoILZ7f4LQygzN9scB2To4W3gRf0nzI+kHOKWzrv5DHEfJNt9/QrlfTk6VcHGwiPGycwiPvDkoTe4eJOW8Qqwm/1H4nNX+1Ed/CTueaJe3E/BNsFxe7rF+qYIHqZnL4b2n9Padc5ySenpG7G0a5xepWP0KZYDN4KeCTCNBf4XIxuHSB/BGVZpATEykU1vILnX89GzoJlV+10=\"}");
         String appKey = "5kkyurvvtt58bbuxueee";//填APP KEY
         String secretKey = "rhj6na6u3y6uhy6qrbb3944mg5uqqpbb";//APP SECRET
@@ -65,5 +65,5 @@ public class test {
                 flog = false;
             }
         }
-    }
+    }*/
 }

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

@@ -368,7 +368,7 @@
             </div>
 
             <div class="row cl" id="TDScollect" style="display: none;">
-                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>TDS收集:</label>
+                <label class="form-label col-1 col-sm-1">TDS收集:</label>
                 <div class="formControls col-2 col-sm-2" style="position: relative;">
                     <input type="hidden" name="arrcity_3word" id="arrcity_3word" value="" />
                     <input style="width: 190px;" placeholder="" class="input-text my-search-input" placeholder="请输入城市名称搜索" type="text" name="arrcity" id="arrcity" />
@@ -383,10 +383,10 @@
                 </div>
                 <input type="hidden" name="customerArea" id="customerArea">
                 <div class="formControls col-2 col-sm-2">
-                    <input type="text" class="input-text" value="" placeholder="进水TDS数值,最大999" id="customerInTDS" name="customerInTDS" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)">
+                    <input type="text" class="input-text" value="" placeholder="进水TDS数值,最大999" id="customerInTDS" name="customerInTDS" onkeyup="TDSLinkage($(this),999)" onpaste="TDSLinkage($(this),999)">
                 </div>
                 <div class="formControls col-2 col-sm-2">
-                    <input type="text" class="input-text" value="" placeholder="出水TDS数值,最大999" id="customerOutTDS" name="customerOutTDS" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)">
+                    <input type="text" class="input-text" value="" placeholder="出水TDS数值,最大999" id="customerOutTDS" name="customerOutTDS" onkeyup="TDSLinkage($(this),999)" onpaste="TDSLinkage($(this),999)">
                 </div>
             </div>
             <div class="row cl" id="TDScollectShow" style="display: none;">
@@ -762,6 +762,13 @@
         /*监听客诉类型选择事件*/
         $("input[name='customerCounselType']").change(function (){
             allCustomerInfoType = parseInt($(this).val());
+            if(allCustomerInfoType == 1){
+                $("#customer-process-1").iCheck('check');  //设置已解决
+                allCustomerType = 1;
+            }else{
+                $("#customer-process-3").iCheck('check');  //设置换新
+                allCustomerType =3;
+            }
             initProcessResult(allCustomerType);
         })
 
@@ -818,13 +825,13 @@
             setTDSCollect();
         });
         /*实时监听文本框-- TDS进水*/
-        document.getElementById("customerInTDS").addEventListener("input", function(){
-            setTDSCollect();
-        });
+//        document.getElementById("customerInTDS").addEventListener("input", function(){
+//            setTDSCollect();
+//        });
         /*实时监听文本框-- TDS出水*/
-        document.getElementById("customerOutTDS").addEventListener("input", function(){
-            setTDSCollect();
-        });
+//        document.getElementById("customerOutTDS").addEventListener("input", function(){
+//            setTDSCollect();
+//        });
 
         /* 监听手机号 失去焦点时  将其他手机号码未填的 */
         $(".associated-phone").blur(function (){
@@ -878,23 +885,15 @@
     * */
     function visitByType(type){
         if(1 == type){  //不需要回访
-            $("#customer-visit-2").prop("checked",true); //不需要回访
-            initCheckByNode($("#customer-visit-2"));
+            $("#customer-visit-2").iCheck('check');  //设置不需要回访
             $("#needToVisit").css("display","none");
         }else{
-            $("#customer-visit-1").prop("checked",true); //需要回访
-            initCheckByNode($("#customer-visit-1"));
+            $("#customer-visit-1").iCheck('check');  //设置需要回访
             $("#needToVisit").css("display","block");
         }
         initVisitEvent();
     }
 
-//    function keyFun(node){
-//        var c=$(node);
-//        var temp_amount=c.val().replace(/[^\d]/g,'');
-//        $(node).val(Number(temp_amount));
-//    }
-
     /*初始化客服*/
     var sysAminList;
     function initSysAdmin() {
@@ -1087,7 +1086,7 @@
                     $("#TDScollectShow").show();
                     $("#sendAddressInfo").show();
                     $("#sendAddressByPhone").show();
-                    $("#updateProduct").show();
+                    $("#updateProduct").hide(); //换新产品
                     $("#postageAccount").show();    //邮费转账账户
                     visitByType(2); //需要回访
                     break;
@@ -1107,7 +1106,7 @@
                     $("#TDScollectShow").show();
                     $("#sendAddressInfo").show();
                     $("#sendAddressByPhone").show();
-                    $("#updateProduct").show();
+                    $("#updateProduct").hide();//维修产品
                     $("#postageAccount").show();    //邮费转账账户
                     visitByType(2); //需要回访
                     break;
@@ -1181,15 +1180,16 @@
             resultHtml += html;
         }
 
-        /* 根据处理类型来切换 产品列表的列名称 */
-        for(var i=0;i<resultProductTableTitle[0].length;i++){
-            $("#table1").find("th").eq(i).html(resultProductTableTitle[0][i]);
-        }
-        for(var i=0;i<resultProductTableTitle[1].length;i++){
-            $("#table2").find("th").eq(i).html(resultProductTableTitle[1][i]);
+        if(resultProductTableTitle != null && resultProductTableTitle.length > 0){
+            /* 根据处理类型来切换 产品列表的列名称 */
+            for(var i=0;i<resultProductTableTitle[0].length;i++){
+                $("#table1").find("th").eq(i).html(resultProductTableTitle[0][i]);
+            }
+            for(var i=0;i<resultProductTableTitle[1].length;i++){
+                $("#table2").find("th").eq(i).html(resultProductTableTitle[1][i]);
+            }
         }
 
-
         $("#processResultStatus").html(resultHtml);
     }
 
@@ -1547,13 +1547,13 @@
                         }
                         var time = formatDate(new Date(salesOrder.salesCreateTime),"yyyy-MM-dd");
                         html += '' +
-                                ' <td>'+ convertUndefinedToEmpty(salesOrder.companyName) +'-'+ convertUndefinedToEmpty(salesOrder.storeName) +'</td>' +
-                                ' <td>'+ salesOrder.salesId +'</td>' +
-                                ' <td>'+ salesOrder.salesAddressName +'</td>' +
-                                ' <td>'+ salesOrder.salesAddressTel +'</td>' +
-                                ' <td>'+ salesOrder.salesAmount/100 +'</td>' +
-                                ' <td>'+ productsHtml +'</td>' +
-                                ' <td>'+ time +'</td>' +
+                                ' <td style="text-align: center;">'+ convertUndefinedToEmpty(salesOrder.companyName) +'-'+ convertUndefinedToEmpty(salesOrder.storeName) +'</td>' +
+                                ' <td style="text-align: center;">'+ salesOrder.salesId +'</td>' +
+                                ' <td style="text-align: center;">'+ salesOrder.salesAddressName +'</td>' +
+                                ' <td style="text-align: center;">'+ salesOrder.salesAddressTel +'</td>' +
+                                ' <td style="text-align: center;">'+ salesOrder.salesAmount/100 +'</td>' +
+                                ' <td style="text-align: center;">'+ productsHtml +'</td>' +
+                                ' <td style="text-align: center;">'+ time +'</td>' +
                                 '';
                        //address = '<td colspan="1">收货地址</td><td colspan="6" class="td-manage text-c" >'+ salesOrder.salesAddressInfo +'&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #0a6999;text-decoration: underline;" href="javascript:void(0);" title="编辑" onclick="updateAdress()">修改地址</a></td>' ;
                         address = salesOrder.salesAddressInfo;
@@ -1628,8 +1628,11 @@
                     abbreviation = addrss.replace(cityReg,"");
                     break;
                 case 2:
-                    var districtReg = new RegExp("","g");
+                    var districtReg = new RegExp("","g");
                     abbreviation = addrss.replace(districtReg,"");
+
+                    districtReg = new RegExp("市","g");
+                    abbreviation = abbreviation.replace(districtReg,"");
                     break;
                 default:
                     break;
@@ -1713,11 +1716,11 @@
             var disId = "";
             $("#district").html(districtHtml);
             if(selectDistrict != null && selectDistrict.length > 0 ){
-                disId = selectDistrict[0].cityId;
+                disId = selectDistrict[0].districtId;
             }else{
-                disId = district[0].cityId;
+                disId = district[0].districtId;
             }
-            $("#city option[value='" + disId + "']").attr("selected","true");
+            $("#district option[value='" + disId + "']").attr("selected","true");
         }
     }
 
@@ -1781,7 +1784,7 @@
                                 '         <td width="15" style="'+ fristInputStyle +' padding: 0px;width: 25px;">' +
                                 '             <input type="hidden" class="input-produce-id" value="' + color.colorProductId + '">' +
                                 '             <input type="hidden" class="input-color-id" value="' + color.colorId + '">' +
-                                '             <input type="text" class="input-text input-color-number number-input" style="width: 100%;border: none;text-align: center;" value="'+ number +'" placeholder="产品数量"  id="" name="" onkeyup="keyFun($(this))" onpaste="keyFun($(this))" >' +
+                                '             <input type="text" class="input-text input-color-number number-input" style="width: 100%;border: none;text-align: center;" value="'+ number +'" placeholder="产品数量"  id="color-' + color.colorProductId + '-' + color.colorId + '" name="" onkeyup="keyFun($(this))" onpaste="keyFun($(this))" >' +
                                 '         </td>' +
                                 '     </tr>';
                         fristInputStyle = "";
@@ -1805,7 +1808,7 @@
                                 '         <td width="15" style="'+ fristInputStyle +'padding: 0px;width: 25px;">' +
                                 '             <input type="hidden" class="input-produce-id" value="' + produceFit.productId + '">' +
                                 '             <input type="hidden" class="input-fittings-id" value="' + produceFit.fittingsId +'">' +
-                                '             <input type="text" class="input-text input-fittings-number" style="width: 100%;border: none;text-align: center;" value="'+ number +'" placeholder="配件数量" id="" name="" onkeyup="keyFun($(this))" onpaste="keyFun($(this))" >' +
+                                '             <input type="text" class="input-text input-fittings-number" style="width: 100%;border: none;text-align: center;" value="'+ number +'" placeholder="配件数量" id="fittings-' + produceFit.productId + '-' + produceFit.fittingsId +'" name="" onkeyup="keyFun($(this))" onpaste="keyFun($(this))" >' +
                                 '         </td>' +
                                 '     </tr>';
                         fristInputStyle = "";
@@ -1832,8 +1835,6 @@
 
         $("#addProduct").html(html);
 
-//        initCheck(); //因为需要展示产品,所以再次初始化多选框
-
         setBackProduct(html);  //设置寄回产品
 
         monitorProduct();   //监听产品变化
@@ -1897,42 +1898,20 @@
         if(html != null && html != "" && typeof(html) != "undefined"){
             $("#back-product").html(html);
         }else{
-            return false;
-//            $("#addProduct").find(".input-color-number").each(function(){
-//                var number = $(this).val();
-//                if(number != null && number != ""){
-//                    var product = new Object();
-//                    product.productId = $(this).parent().find(".input-produce-id").val();
-//                    product.colorId = $(this).parent().find(".input-color-id").val();
-//                    //换新、维修,退货,无理由退货,
-//                    if(allCustomerType == 3 || allCustomerType == 4 || allCustomerType == 6 || allCustomerType == 7){
-//                        product.closedProdcueNumber = number;
-//                        closedProdcues.push(product);
-//                    }else if(allCustomerType == 5){
-//                        product.sendProdcueNumber = number;
-//                        sendProdcues.push(product);
-//                    }
-//                }
-//            })
-//
-//            $("#addProduct").find(".input-fittings-number").each(function(){
-//                var number = $(this).val();
-//                if(number != null && number != ""){
-//                    var fittings = new Object();
-//                    fittings.productId = $(this).parent().find(".input-produce-id").val();
-//                    fittings.fittingsId = $(this).parent().find(".input-fittings-id").val();
-//                    //换新、维修,退货,无理由退货,
-//                    if(allCustomerType == 3 || allCustomerType == 4 || allCustomerType == 6 || allCustomerType == 7){
-//                        fittings.closedFittingNumber = number;
-//                        closedFittings.push(fittings);
-//                    }else if(allCustomerType == 5){
-//                        fittings.sendFittingNumber = number;
-//                        sendFittings.push(fittings);
-//                    }
-//                }
-//            })
-
-
+            $("#addProduct").find(".input-color-number").each(function(){
+                var number = $(this).val();
+                if(number != null && number != ""){
+                    var colorNodeId = $(this).attr("id");
+                    $("#back-product").find("#"+colorNodeId).val(number);
+                }
+            })
+            $("#addProduct").find(".input-fittings-number").each(function(){
+                var number = $(this).val();
+                if(number != null && number != ""){
+                    var fittingsNodeId = $(this).attr("id");
+                    $("#back-product").find("#"+fittingsNodeId).val(number);
+                }
+            })
         }
     }
 
@@ -1943,14 +1922,46 @@
 
         if(TDSAddress != null && TDSAddress != ""){
             $("#DTS-address").html("地址:" + TDSAddress);
-            var customerInTDS = $("#customerInTDS").val();
-            var customerOutTDS = $("#customerOutTDS").val()
-            if(customerInTDS != null && customerInTDS != "" && customerOutTDS != null && customerOutTDS != ""){
-                $("#DTS-in").html("进水:" + customerInTDS + " PPM");
-                $("#DTS-out").html("出水:" + customerOutTDS + " PPM");
+        }
+    }
+
+    /*TDS联动处理*/
+    function TDSLinkage(node,maxNumber,minNumber){
+        setTDSCollect();
+
+        var number = 0;
+        var c=$(node);
+        if(c.val() == ""){
+            $(node).val("");
+        }else{
+            var temp_amount=c.val().replace(/[^\d]/g,'');
+            number  = Number(temp_amount)
+            if(maxNumber!= null && maxNumber!= "" && number > maxNumber){
+                number = maxNumber;
+            }
+            if(minNumber!= null && minNumber!= "" && number < minNumber){
+                number = minNumber;
             }
+            $(node).val(number);
+        }
+
+        var nodeName = $(node).attr("id");
+        if(nodeName == "customerInTDS" ){
+            $("#DTS-in").html("进水:" + number + " PPM");
+        }else if(nodeName == "customerOutTDS" ){
+            $("#DTS-out").html("出水:" + number + " PPM");
         }
     }
+
+    /**
+     * 获取当前节点,将当前节点的val值除了数字其他的删掉
+     * @param node
+     * @param maxNumber  最大值
+     * @param minNumber  最小值
+     */
+    function keyFun(node,maxNumber,minNumber){
+
+    }
 </script>
 <script>
     $(function(){
@@ -1998,9 +2009,7 @@
         if(customerSourceType == 3){
             var customerSourceOld = $("#customerSourceOld").val();
             if(customerSourceOld == null || customerSourceOld == "" || typeof(customerSourceOld)=="undefined"){
-
                 vailErrorMsg($("#customerSourceOld"),"未填写来源入口");
-
                 return false;
             }else{
                 $("#customerSource").val(customerSourceOld);
@@ -2172,6 +2181,25 @@
         $("#closedProdcues").val(JSON.stringify(closedProdcues));
         $("#closedFittings").val(JSON.stringify(closedFittings));
 
+        var visitTimeSelect = $("input[name='visitTimeSelect']").val();
+        var visit_date = $('#datemin').val();
+        var myDate = new Date();
+        var date = myDate.getFullYear()+"-"+(myDate.getMonth()+1)+"-"+myDate.getDate();
+        var hours = myDate.getHours();
+        //如果两个时间相等,则判断可选的回访时间
+        if(Date.parse(visit_date) == Date.parse(date)){
+            if (hours > 12 && visitTimeSelect == 1) {
+                vailErrorMsg($("#datemin"),"该时间已超过当前时间,请重新选择回访时间!");
+                return false;
+            } else if (hours > 14 && visitTimeSelect == 2) {
+                vailErrorMsg($("#datemin"),"该时间已超过当前时间,请重新选择回访时间!");
+                return false;
+            } else if (hours > 16 && visitTimeSelect == 3) {
+                vailErrorMsg($("#datemin"),"该时间已超过当前时间,请重新选择回访时间!");
+                return false;
+            }
+        }
+
         return true;
     }
 

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

@@ -308,7 +308,7 @@
                     })
                     $('#salesItem').html(salesItem);
                     $('#salesPayTime').html(salesOrder.salesPayTime);
-                    $('#relationSendMergeAddress').html(customerCommon.relationSendMergeAddress+"-"+customerCommon.relationSendAddress);
+                    $('#relationSendMergeAddress').html( convertUndefinedToEmpty(customerCommon.relationSendMergeAddress)+"-"+convertUndefinedToEmpty(customerCommon.relationSendAddress));
                     $('#describeHandleDesc').html(customer.describeHandleDesc);
 
                     if (customerCommon.sendProdcues != null && customerCommon.sendProdcues.length > 0) {
@@ -343,7 +343,7 @@
                     } else {
                         $('#divCloseProdcue').hide();
                     }
-                    $('#customerTDS').html("<strong>TDS收集:</strong>"+customerCommon.relationSendMergeAddress+",进水"+
+                    $('#customerTDS').html("<strong>TDS收集:</strong>"+  convertUndefinedToEmpty(customerCommon.relationSendMergeAddress) +",进水"+
                             (customer.customerInTDS==undefined?0:customer.customerInTDS)+"ppm"+",出水"+(customer.customerOutTDS==undefined?0:customer.customerOutTDS)+"ppm");
 
                     if (customer.customerIsVisit == '2') {

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

@@ -49,14 +49,14 @@
                     </#list>
                 </#if>
             </select>
-            <select class="my-select" name="complaintId" style="height: 36px;width: 120px;margin: 0px;">
+           <#-- <select class="my-select" name="complaintId" style="height: 36px;width: 120px;margin: 0px;">
                 <option value ="">客诉类型</option>
                 <#if complaintTypeList?? &&  (complaintTypeList?size > 0) >
                     <#list complaintTypeList as complaint>
                         <option value ="${complaint.complaintId!}" <#if customerInfo.complaintId??><#if customerInfo.complaintId ==complaint.complaintId >selected="selected"</#if></#if>>${complaint.complaintClassName!}</option>
                     </#list>
                 </#if>
-            </select>
+            </select>-->
             <select class="my-select" name="customerIsVisit" style="height: 36px;width: 120px;margin: 0px;>
                 <option value ="">是否需要回访</option>
                 <option value="">是否回访</option>
@@ -85,7 +85,7 @@
             <th width="70">电话</th>
             <th width="80">来源入口</th>
             <th width="80">客诉产品</th>
-            <th width="80">客诉类型</th>
+            <#--<th width="80">客诉类型</th>-->
             <th width="80">问题类型</th>
             <th width="100">问题简述</th>
             <th width="80">销售</th>
@@ -119,7 +119,7 @@
                                 </#if>
                             </td>
                             <td>${customer.typeName!''}</td>
-                            <td>${customer.complaintClassName!''}</td>
+                            <#--<td>${customer.complaintClassName!''}</td>-->
                             <td>${customer.smallClassName!''}</td>
                             <td>
                                 ${customer.describeTitle!'暂无'}<br/>
@@ -396,10 +396,11 @@
                 success: function(data){
                     if (data.returnCode == 200) {
                         layer.msg(data.resultMsg,{icon: 1,time:1000});
-                        $('#txt_customerIsSolve').html('已解决');
+                       // $('#txt_customerIsSolve').html('已解决');
                     } else {
                         layer.msg(data.resultMsg,{icon: 5,time:1000});
                     }
+                    location.replace(location.href);
                 },
                 error: function(XmlHttpRequest, textStatus, errorThrown){
                 }

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

@@ -137,7 +137,8 @@
                 <tr class="text-c">
                     <th width="50">销售公司</th>
                     <th width="50">店铺名称</th>
-                    <th width="100">订单编号<span style="font-weight: normal;float: left;display: block;width: 100%;">(Efast交易号)</span></th>
+                    <th width="50">订单编号</th>
+                    <th width="100">交易号</th>
                     <th width="60">收货人姓名</th>
                     <th width="80">收货人电话</th>
                     <th width="80">订单金额</th>
@@ -150,7 +151,7 @@
                 <tbody id="orderAll">
 
                      <tr class="text-c">
-                         <td colspan="10">请输入搜索条件,搜索订单~
+                         <td colspan="11">请输入搜索条件,搜索订单~
                          </td>
                      </tr>
 
@@ -346,6 +347,7 @@
                         html += '<tr class="text-c">' +
                                 ' <td>'+ convertUndefinedToEmpty(salesOrder.companyName) +'</td>' +
                                 ' <td>'+ convertUndefinedToEmpty(salesOrder.storeName) +'</td>' +
+                                ' <td>'+ salesOrder.salesId +'</td>' +
                                 ' <td>'+ salesOrder.salesDealCode +'</td>' +
                                 ' <td>'+ salesOrder.salesAddressName +'</td>' +
                                 ' <td>'+ salesOrder.salesAddressTel +'</td>' +
@@ -357,7 +359,7 @@
                                 ' </tr>';
                     }
                 }else{
-                    html = '<tr class="text-c"><td colspan="10">没有搜索到订单,请点击“添加订单”按钮,添加订单。</td></tr>';
+                    html = '<tr class="text-c"><td colspan="11">没有搜索到订单,请点击“添加订单”按钮,添加订单。</td></tr>';
                 }
                 $("#orderAll").html(html);
                 layer.close(index);

+ 7 - 7
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/complete_signclosed.ftl

@@ -235,15 +235,15 @@
                         if(value.colorList != null) {
                             if (value.colorList.length > 0) {
                                 $.each(value.colorList, function (i, value) {
-                                    colorTable = colorTable + '<td id="tdColorId' + value.colorId + '"><input type="checkbox" value="' + value.colorId + '" name="alreadyColorName" datatype="*">' + value.colorName + ''
+                                    colorTable = colorTable + '<td id="tdColorId' + value.colorId + '" style="border-top: 1px solid #ddd; "><input type="checkbox" value="' + value.colorId + '" name="alreadyColorName" datatype="*">' + value.colorName + ''
                                             + '<input type="text" style="width: 50px;margin-left: 10px;" class="input-text" oninput="generateInput(' + value.colorId + ')" onpropertychange="generateInput(' + value.colorId + ')"  placeholder="数量" id="alreadyColorId' + value.colorId + '" name="alreadyColorId' + value.colorId + '"><br>' +
                                             '</td>'
                                 });
                             }else{
-                                colorTable = '暂无颜色,请先添加产品颜色';
+                                colorTable = '<span>暂无颜色,请先添加产品颜色</span>';
                             }
                         }else {
-                            colorTable = '暂无颜色,请先添加产品颜色';
+                            colorTable = '<span>暂无颜色,请先添加产品颜色</span>';
                         }
                         if(value.fittingsList != null) {
                             if (value.fittingsList.length > 0) {
@@ -252,15 +252,15 @@
                                             + '<input type="text" style="width: 50px;margin-left: 10px;" class="input-text" value="" placeholder="数量" id="alreadyFittingsId' + value.fittingsId + '" name="alreadyFittingsId' + value.fittingsId + '"><br>'
                                 });
                             }else{
-                                fittingsTable = '暂无配件,请先添加配件';
+                                fittingsTable = '<span>暂无配件,请先添加配件</span>';
                             }
                         }else{
-                            fittingsTable = '暂无配件,请先添加配件';
+                            fittingsTable = '<span>暂无配件,请先添加配件</span>';
                         }
                         var productTable = '<tr>'
                                 +'<td>'+value.productName+'</td>'
-                                +'<td><table border="0">'+colorTable+'</table></td>'
-                                +'<td>'+fittingsTable+'</td>'
+                                +'<td style="margin: 0px;padding: 0px;height: 20px;"><table border="0" style="height: 65px;">'+colorTable+'</table></td>'
+                                +'<td style="margin: 0px;padding: 0px;height: 20px;">'+fittingsTable+'</td>'
                                 +'</tr>';
                         $("#addProduct").append(productTable);
                     });

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

@@ -149,6 +149,10 @@ function listDistrict(cityId,districtName){
  */
 function keyFun(node,maxNumber,minNumber){
     var c=$(node);
+    if(c.val() == ""){
+        $(node).val("");
+        return false;
+    }
     var temp_amount=c.val().replace(/[^\d]/g,'');
     var number  = Number(temp_amount)
     if(maxNumber!= null && maxNumber!= "" && number > maxNumber){