Browse Source

客诉列表寄回状态修改

liujiankang 6 years ago
parent
commit
2bc197f60d

+ 12 - 9
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java

@@ -1679,9 +1679,11 @@ public class CustomerServiceImpl implements CustomerService {
                 sendbackItemLists.add(info);
             }
         }
-        Integer msgs = customerService.addSendbackItemList(sendbackItemLists);
-        if(msgs < 1){
-            throw new RuntimeException("添加寄回产品项信息失败");
+        if(sendbackItemLists.size() > 0){
+            Integer msgs = customerService.addSendbackItemList(sendbackItemLists);
+            if(msgs < 1){
+                throw new RuntimeException("添加寄回产品项信息失败");
+            }
         }
         return sendbackInfo;
     }
@@ -1717,9 +1719,7 @@ public class CustomerServiceImpl implements CustomerService {
             return null;
         }
         //删除原寄回产品项
-        if(customerInfoMapper.deleteSendbackItemBySendbackId(sendbackInfo.getSendbackId()) < 1){
-            throw new RuntimeException("删除寄回产品项信息失败");
-        }
+        customerInfoMapper.deleteSendbackItemBySendbackId(sendbackInfo.getSendbackId());
         List<SendbackItem> sendbackItemLists = new ArrayList<>();
         for (SendbackItem info : sendbackItemList){
             info.setSendbackId(sendbackInfo.getSendbackId());
@@ -1727,10 +1727,13 @@ public class CustomerServiceImpl implements CustomerService {
                 sendbackItemLists.add(info);
             }
         }
-        Integer msgs = customerService.addSendbackItemList(sendbackItemLists);
-        if(msgs < 1){
-            throw new RuntimeException("修改寄回产品项信息失败");
+        if(sendbackItemLists.size() > 0){
+            Integer msgs = customerService.addSendbackItemList(sendbackItemLists);
+            if(msgs < 1){
+                throw new RuntimeException("修改寄回产品项信息失败");
+            }
         }
+
         return sendbackInfo;
     }
 

+ 20 - 8
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/customerInfoMapper.xml

@@ -342,6 +342,15 @@
     ss.relation_id
     ) sxx
     ) sx ON sx.customer_id = c.customer_id
+    LEFT JOIN (SELECT ss.* from (
+    select tb_rst_cm_sendback_info.*,tb_rst_cm_relation.customer_id
+    FROM
+    tb_rst_cm_sendback_info
+    LEFT JOIN tb_rst_cm_relation on tb_rst_cm_relation.relation_id = tb_rst_cm_sendback_info.relation_id
+
+    ORDER BY
+    sendback_create_time desc
+    ) ss) sss ON sss.customer_id = c.customer_id
     LEFT JOIN tb_rst_cm_visit v ON v.customer_id = c.customer_id
     LEFT JOIN tb_rst_sales_order_info oi ON cc.orderId = oi.sales_id
     LEFT JOIN tb_rst_cm_question_describe qd ON c.customer_id = qd.customer_id
@@ -402,7 +411,10 @@
         and c.customer_create_time &lt; #{endTime}
       </if>
       <if test="sendLogisticsNo != null and sendLogisticsNo != ''">
-        AND  cc.relationSendLogisticsNo =  #{sendLogisticsNo} OR cc.relationBackLogisticsNo  =  #{sendLogisticsNo}
+        AND  cc.relationSendLogisticsNo =  #{sendLogisticsNo} OR sss.sendback_logistics_no  =  #{sendLogisticsNo}
+      </if>
+      <if test="storeId != null and storeId != ''">
+        AND  c.store_id =  #{storeId}
       </if>
       <if test="backStatus != null and backStatus != ''">
         and c.customer_id in (
@@ -1263,25 +1275,25 @@ and cr.relation_is_transfer = 10*/
   <update id="updateSendbackInfo" parameterType="SendbackInfo">
     UPDATE tb_rst_cm_sendback_info
     <set>
-      <if test="sendbackLogisticsCompany != null and sendbackLogisticsCompany != ''">
+      <if test="sendbackLogisticsCompany != null">
         sendback_logistics_company = #{sendbackLogisticsCompany},
       </if>
-      <if test="sendbackLogisticsNo != null and sendbackLogisticsNo != ''">
+      <if test="sendbackLogisticsNo != null">
         sendback_logistics_no = #{sendbackLogisticsNo},
       </if>
-      <if test="sendbackName != null and sendbackName != ''">
+      <if test="sendbackName != null">
         sendback_name = #{sendbackName},
       </if>
-      <if test="sendbackSignTime != null and sendbackSignTime != ''">
+      <if test="sendbackSignTime != null">
         sendback_sign_time = #{sendbackSignTime},
       </if>
-      <if test="sendbackTel != null and sendbackTel != ''">
+      <if test="sendbackTel != null">
         sendback_tel = #{sendbackTel},
       </if>
-      <if test="sendbackStatus != null and sendbackStatus != ''">
+      <if test="sendbackStatus != null">
         sendback_status = #{sendbackStatus},
       </if>
-      <if test="sendbackSignTime != null and sendbackSignTime != ''">
+      <if test="sendbackSignTime != null">
         sendback_sign_time = #{sendbackSignTime}
       </if>
     </set>

+ 3 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -485,7 +485,8 @@ public class AdminCustomerController {
         List<ComplaintSmallClassInfo> complaintSmallClassInfoList = complaintSmallClassInfoService.listComplaintSmallClassInfo(new ComplaintSmallClassInfo());
         //查询处理类型
         List<ProcType> procTypeList = customerService.listProcType();
-
+        //店铺(销售渠道)
+        List<StoreInfo> listStoreInfo = storeInfoService.listStore(new StoreInfo());
         //查询问题集合   第 30 条bug
 //        List<QuestionDescribe> questionDescribeList = questionDescribeService.listQuestionDescribe(new QuestionDescribe());
 
@@ -503,6 +504,7 @@ public class AdminCustomerController {
         mv.addObject("complaintTypeList", complaintTypeList);
         mv.addObject("adminList", adminList);
         mv.addObject("procTypeList", procTypeList);
+        mv.addObject("listStoreInfo", listStoreInfo);
         customerInfo.setVisit(null);
         customerInfo.setCustomerCommon(null);
         customerInfo.setComplaintDetectList(null);

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

@@ -121,6 +121,14 @@
                     </#list>
                 </#if>
             </select>
+            <select class="my-select" name="storeId" id="storeId" style="height: 36px;width: 132px;padding: 12px 10px 6px 15px;">
+            <option value="">店铺</option>
+        <#if listStoreInfo?? &&  (listStoreInfo?size > 0) >
+            <#list listStoreInfo as info>
+                <option value="${info.storeId!''}" <#if customerInfo.storeId??><#if customerInfo.storeId == info.storeId >selected="selected"</#if></#if>>${info.storeName!''}</option>
+            </#list>
+        </#if>
+            </select>
             <button type="submit" class="btn" style="background: #32a3d8;color: #fff;height: 35px;margin-top: -8px;"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
         </form>
     </div>
@@ -231,7 +239,8 @@
                                             <a style="text-decoration:none" href="javascript:void(0);" onclick="toUpdateRelation(${customer.customerId!''})">
                                                 <font color=#06c>
                                                     <input type="hidden" value="${customer.backStatus!''}">
-                                                    <#if customer.backStatus?? && customer.procMethodIsBack == 1>
+                                                <#if customer.procMethodIsBack == 1>
+                                                    <#if customer.backStatus??>
                                                         <#if customer.backStatus == 1>
                                                             未寄回
                                                         <#elseif customer.backStatus == 2>
@@ -240,8 +249,13 @@
                                                             已收货
                                                         <#elseif customer.backStatus == 4>
                                                             已签收待确认
+                                                        <#else>
+                                                            未寄回
                                                         </#if>
+                                                    <#else>
+                                                        未寄回
                                                     </#if>
+                                                </#if>
                                                     <#if customer.procMethodIsBack == 1 && customer.procMethodIsSend == 1>,</#if>
                                                     <#if customer.sendStatus?? && customer.procMethodIsSend == 1>
                                                         <#if customer.sendStatus == 1>

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

@@ -766,14 +766,14 @@
                 layer.msg("请选择寄回状态!",{icon: 5,time:1000});
                 return;
             }
-            if(sendbackLogisticsCompany == null || sendbackLogisticsCompany == ""){
+            /*if(sendbackLogisticsCompany == null || sendbackLogisticsCompany == ""){
                 layer.msg("请输入物流公司!",{icon: 5,time:1000});
                 return;
             }
             if(sendbackLogisticsNo == null || sendbackLogisticsNo == ""){
                 layer.msg("请输入物流单号!",{icon: 5,time:1000});
                 return;
-            }
+            }*/
             if(sendbackName == null || sendbackName == ""){
                 layer.msg("请输入寄回人姓名!",{icon: 5,time:1000});
                 return;
@@ -865,14 +865,14 @@
             layer.msg("请选择寄回状态!",{icon: 5,time:1000});
             return;
         }
-        if(sendbackLogisticsCompany == null || sendbackLogisticsCompany == ""){
+        /*if(sendbackLogisticsCompany == null || sendbackLogisticsCompany == ""){
             layer.msg("请输入物流公司!",{icon: 5,time:1000});
             return;
         }
         if(sendbackLogisticsNo == null || sendbackLogisticsNo == ""){
             layer.msg("请输入物流单号!",{icon: 5,time:1000});
             return;
-        }
+        }*/
         if(sendbackName == null || sendbackName == ""){
             layer.msg("请输入寄回人姓名!",{icon: 5,time:1000});
             return;