浏览代码

客诉修改

wangxiaoming 6 年之前
父节点
当前提交
f4df66aed3

+ 47 - 10
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java

@@ -502,6 +502,16 @@ public class CustomerServiceImpl implements CustomerService {
     @Transactional
     public void setName(CmRelation cr) {
         for (int i=0;i<cr.getSendProdcues().size();i++) {
+            if("123456".equals(cr.getSendProdcues().get(i).getColorBar())){
+                continue;
+            }
+            if("6970465730030".equals(cr.getSendProdcues().get(i).getColorBar())){
+                continue;
+            }
+            if("6970465730023".equals(cr.getSendProdcues().get(i).getColorBar())){
+                continue;
+            }
+
             ProductColor productColor = productMapper.getProductBySku(cr.getSendProdcues().get(i).getColorBar());
             cr.getSendProdcues().get(i).setProductColor(productColor);
             cr.getSendProdcues().get(i).setColorId(productColor.getColorId());
@@ -512,6 +522,15 @@ public class CustomerServiceImpl implements CustomerService {
             cr.getSendProdcues().get(i).setProductNumber(product.getProductNumber());
         }
         for (int i=0;i<cr.getClosedProdcues().size();i++) {
+            if(("123456").equals(cr.getClosedProdcues().get(i).getColorBar())){
+                continue;
+            }
+            if(("6970465730030").equals(cr.getClosedProdcues().get(i).getColorBar())){
+                continue;
+            }
+            if(("6970465730023").equals(cr.getClosedProdcues().get(i).getColorBar())){
+                continue;
+            }
             ProductColor productColor = productMapper.getProductBySku(cr.getClosedProdcues().get(i).getColorBar());
             cr.getClosedProdcues().get(i).setProductColor(productColor);
             cr.getClosedProdcues().get(i).setColorId(productColor.getColorId());
@@ -1323,6 +1342,7 @@ public class CustomerServiceImpl implements CustomerService {
 
 
     @Override
+    @Transactional
     public Integer updateRelation(CustomerInfo customerInfo) {
          /*
         * 查询客诉
@@ -1342,6 +1362,12 @@ public class CustomerServiceImpl implements CustomerService {
         CmRelation cmRelation = new CmRelation();
         cmRelation.setCustomerId(customerInfo.getCustomerId());
 
+        /*判断是否是新加的客诉*/
+        CmRelation crold = cmRelationMapper.getCmRelationByCustomerId(customerInfo.getCustomerId());
+        if(crold != null ){
+            return 1;
+        }
+
         CustomerCommon customerCommon = new CustomerCommon();
         customerCommon.setCustomerId(customerInfo.getCustomerId());
         List<CustomerCommon> customerCommonList = customerCommonService.listCustomerCommon(customerCommon);
@@ -1373,6 +1399,9 @@ public class CustomerServiceImpl implements CustomerService {
             cmRelation.setRelationCustomerCosts(customerCommon.getRelationCustomerCosts());  //客户报价
             cmRelation.setRelationCreateTime(customerCommon.getRelationCreateTime());
             cmRelation.setRelationUpdateTime(customerCommon.getRelationUpdateTime());
+
+            cmRelation.setSendProdcues(customerCommon.getSendProdcues());
+            cmRelation.setClosedProdcues(customerCommon.getClosedProdcues());
         }
 
         Integer procMethodId;
@@ -1462,9 +1491,6 @@ public class CustomerServiceImpl implements CustomerService {
             rol.setRelationId(customerCommon.getRelationId());
             relationOrderService.deleteByRelationOrder(rol);
 
-            /*产品整理*/
-            customerService.setName(cmRelation);
-
             /*添加客诉-添加处理与订单关联表 ---------- */
             List<RelationOrder> relationAndOrderList = new ArrayList<>();
             for (RelationOrder sokk : relationOrderList) {
@@ -1478,13 +1504,24 @@ public class CustomerServiceImpl implements CustomerService {
                 relationOrderService.saveList(relationAndOrderList);
             }
 
-            CustomerCommonUtil.setProduce(cmRelation);
-            if(cmRelation.getClosedProdcues() != null && cmRelation.getClosedProdcues().size()>0){
-                closedProdcueMapper.insert(cmRelation.getClosedProdcues());
-            }
-            if(cmRelation.getSendProdcues() != null && cmRelation.getSendProdcues().size() > 0){
-                sendProdcueMapper.insert(cmRelation.getSendProdcues());
-            }
+            Integer fl =  0;
+             /*产品整理*/
+             try{
+                 customerService.setName(cmRelation);
+                 fl = 1;
+             }catch (Exception e){
+                 e.printStackTrace();
+             }
+
+             if(fl == 1){
+                 CustomerCommonUtil.setProduce(cmRelation);
+                 if(cmRelation.getClosedProdcues() != null && cmRelation.getClosedProdcues().size()>0){
+                     closedProdcueMapper.insert(cmRelation.getClosedProdcues());
+                 }
+                 if(cmRelation.getSendProdcues() != null && cmRelation.getSendProdcues().size() > 0){
+                     sendProdcueMapper.insert(cmRelation.getSendProdcues());
+                 }
+             }
         }
         return flag;
     }

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

@@ -48,9 +48,6 @@
       <if test="relationId != null and relationId != ''">
         relation_id = #{relationId}
       </if>
-      <if test="relationId != null and relationId != ''">
-        relation_id = #{relationId}
-      </if>
       <if test="closedProdcueId != null and closedProdcueId != ''">
         and closed_prodcue_id = #{closedProdcueId}
       </if>

+ 15 - 5
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/customerCommonMapper.xml

@@ -37,7 +37,9 @@
         renewed_is_transfer AS relationIsTransfer,
         renewed_alipay_name AS relationAlipayName,
         NULL	AS relationFactoryCosts,
-        NULL AS relationCustomerCosts
+        NULL AS relationCustomerCosts,
+        renewed_create_time AS  relationCreateTime,
+        renewed_update_time AS  relationUpdateTime
         FROM tb_rst_renewed
         UNION ALL
         SELECT
@@ -71,7 +73,9 @@
         repair_is_transfer AS relationIsTransfer,
         repair_alipay_name AS relationAlipayName,
         repair_factory_costs AS relationFactoryCosts,
-        repair_customer_costs AS relationCustomerCosts
+        repair_customer_costs AS relationCustomerCosts,
+        repair_create_time AS  relationCreateTime,
+        repair_update_time AS  relationUpdateTime
         FROM tb_rst_repair
         UNION ALL
         SELECT
@@ -105,7 +109,9 @@
         NULL AS relationIsTransfer,
         NULL AS relationAlipayName,
         NUll	AS relationFactoryCosts,
-        NUll AS relationCustomerCosts
+        NUll AS relationCustomerCosts,
+        reissue_create_time AS  relationCreateTime,
+        reissue_update_time AS  relationUpdateTime
         FROM tb_rst_reissue
         UNION ALL
         SELECT
@@ -139,7 +145,9 @@
         back_goods_is_transfer AS relationIsTransfer,
         back_goods_alipay_name AS relationAlipayName,
         NULL	AS relationFactoryCosts,
-        NULL AS relationCustomerCosts
+        NULL AS relationCustomerCosts,
+        back_goods_create_time AS  relationCreateTime,
+        back_goods_update_time AS  relationUpdateTime
         FROM tb_rst_back_goods
         UNION ALL
         SELECT
@@ -173,7 +181,9 @@
         noreason_back_is_transfer AS relationIsTransfer,
         noreason_back_alipay_name AS relationAlipayName,
         NULL AS relationFactoryCosts,
-        NULL AS relationCustomerCosts
+        NULL AS relationCustomerCosts,
+        noreason_back_create_time AS  relationCreateTime,
+        noreason_back_update_time AS  relationUpdateTime
         FROM tb_rst_noreason_back
         )cc
         LEFT JOIN tb_rst_cm_customer_info c on cc.customerId = c.customer_id

+ 11 - 9
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -198,16 +198,18 @@ public class AdminCustomerController {
             for (int k = 0; k < relationOrderList.size(); k++) {
                 salesIds[k] = String.valueOf(relationOrderList.get(k).getSalesId());
             }
-            SalesOrder so = new SalesOrder();
-            so.setSalesIds(salesIds);
-            List<SalesOrder> orderList = salesOrderService.listSalesOrder(so);
-            for (SalesOrder sor : orderList) {
-                SalesOrderItem salesOrderItem = new SalesOrderItem();
-                salesOrderItem.setItemOrderId(sor.getSalesId());
-                List<SalesOrderItem> salesOrderItemList = salesOrderService.listSalesOrderItem(salesOrderItem);
-                sor.setSalesOrderItemList(salesOrderItemList);
+            if(salesIds!=null && salesIds.length > 0){
+                SalesOrder so = new SalesOrder();
+                so.setSalesIds(salesIds);
+                List<SalesOrder> orderList = salesOrderService.listSalesOrder(so);
+                for (SalesOrder sor : orderList) {
+                    SalesOrderItem salesOrderItem = new SalesOrderItem();
+                    salesOrderItem.setItemOrderId(sor.getSalesId());
+                    List<SalesOrderItem> salesOrderItemList = salesOrderService.listSalesOrderItem(salesOrderItem);
+                    sor.setSalesOrderItemList(salesOrderItemList);
+                }
+                mv.addObject("salesOrderList", orderList);
             }
-            mv.addObject("salesOrderList", orderList);
         } else {
             mv.addObject("salesOrderList", null);
         }

+ 34 - 34
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AppComplaintQuestionInfoController.java

@@ -406,40 +406,40 @@ public class AppComplaintQuestionInfoController {
      * @param request
      * @return
      */
-    @ResponseBody
-    @RequestMapping(value = "/updateRelation")
-    public ResponseJson updateRelation(HttpServletRequest request){
-
-        System.out.println("++++++ 处理方式数据迁移开始 ++++++++");
-        logger.info("++++++ 处理方式数据迁移开始 ++++++++");
-        ResponseJson msg = new ResponseJson();
-        SalesOrder salesOrder = new SalesOrder();
-        CustomerInfo customerInfo  = new CustomerInfo();
-        Integer pageNo = 1;
-        while (true) {
-            PagedResult<CustomerInfo> pagedResult = customerService.listCustomer(pageNo, 20, customerInfo, false);
-            System.out.println("pageNo:"+ pageNo);
-            logger.info("pageNo:"+ pageNo);
-
-            List<CustomerInfo> customerList = pagedResult.getDataList();
-            for (CustomerInfo cm:customerList) {
-                System.out.println("客诉Id:"+ cm.getCustomerId());
-                logger.info("客诉Id:"+ cm.getCustomerId());
-                Integer falg = customerService.updateRelation(cm);
-                if(falg < 1){
-                    System.out.println("转换失败"+ cm.getCustomerId());
-                    logger.info("转换失败"+ cm.getCustomerId());
-                }
-            }
-            if(customerList.size() < 20){
-                break;
-            }
-            pageNo++;
-        }
-        System.out.println("++++++ 处理方式数据迁移结束 ++++++++");
-        logger.info("++++++ 处理方式数据迁移结束 ++++++++");
-        return msg;
-    }
+//    @ResponseBody
+//    @RequestMapping(value = "/updateRelation")
+//    public ResponseJson updateRelation(HttpServletRequest request){
+//
+//        System.out.println("++++++ 处理方式数据迁移开始 ++++++++");
+//        logger.info("++++++ 处理方式数据迁移开始 ++++++++");
+//        ResponseJson msg = new ResponseJson();
+//        SalesOrder salesOrder = new SalesOrder();
+//        CustomerInfo customerInfo  = new CustomerInfo();
+//        Integer pageNo = 349;
+//        while (true) {
+//            PagedResult<CustomerInfo> pagedResult = customerService.listCustomer(pageNo, 20, customerInfo, false);
+//            System.out.println("pageNo:"+ pageNo);
+//            logger.info("pageNo:"+ pageNo);
+//
+//            List<CustomerInfo> customerList = pagedResult.getDataList();
+//            for (CustomerInfo cm:customerList) {
+//                System.out.println("客诉Id:"+ cm.getCustomerId());
+//                logger.info("客诉Id:"+ cm.getCustomerId());
+//                Integer falg = customerService.updateRelation(cm);
+//                if(falg < 1){
+//                    System.out.println("转换失败"+ cm.getCustomerId());
+//                    logger.info("转换失败"+ cm.getCustomerId());
+//                }
+//            }
+//            if(customerList.size() < 20){
+//                break;
+//            }
+//            pageNo++;
+//        }
+//        System.out.println("++++++ 处理方式数据迁移结束 ++++++++");
+//        logger.info("++++++ 处理方式数据迁移结束 ++++++++");
+//        return msg;
+//    }
 
 
 

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

@@ -993,7 +993,11 @@
      * 设置省市区
      */
     function setAddressInfo(){
-        ulcRelationAddress.setUlcById(0,${cmRelation.provinceNumber!''},${cmRelation.cityNumber!''},${cmRelation.areaNumber!''});
+        var provinceNumber = ${cmRelation.provinceNumber!'"xxxxx"'};
+        if(provinceNumber != "xxxxx"){
+            ulcRelationAddress.setUlcById(0,${cmRelation.provinceNumber!'1'},${cmRelation.cityNumber!'1'},${cmRelation.areaNumber!'1'});
+        }
+
 
         <#--var proId = setPro(null,1);  //创建省-->
         <#--<#if cmRelation.provinceNumber?? >-->

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

@@ -459,8 +459,9 @@ function initProcessResult(procMethodIsBack,procMethodIsSend){
         $("#salesChannelsSelect").show();  //展示销售公司
         $("#TDScollect").show();
 
-        if((procMethodIsBack == 2 && procMethodIsSend == 2) || isNeedSelectOrder == 2){ //不需要寄回,不需要寄出就是 已解决,未解决
+        if((procMethodIsBack == 2 && procMethodIsSend == 2)){ //不需要寄回,不需要寄出就是 已解决,未解决
             visitByType(1);
+            isNeedSelectOrder == 2
         }
 
         var promType = $("#procTypeId").val() //查看是否为维修

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

@@ -122,8 +122,8 @@ function setSelectCustomer(customerId){
                 $("#salesAddressTel").val(customer.customerTel);
                 /* 售后订单的支付时间、支付方式默认 */
                 $("#salesPayTime").val(customer.salesTime);
-                sc.setUlcById(0,1,11);
-                ulc.setUlcByName(0,"省","市","区");
+                // sc.setUlcById(0,1,11);
+                // ulc.setUlcByName(0,"省","市","区");
             }else{
             }
             $("#salesCustomer").show();