Forráskód Böngészése

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

wangxiaoming 6 éve
szülő
commit
4434bfc350

+ 18 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerInfo.java

@@ -163,6 +163,8 @@ public class CustomerInfo  implements Serializable {
     private String customerProvinceId;    //省
     private String customerCityId;    //市
     private String customerDistrictId;    //区
+    private List<PostageInfo> postageInfoList;    //邮费集合
+    private List<SendbackInfo> sendbackInfoList;    //寄回信息集合
 
     public void setComplaintDetectList(List<ComplaintDetectInfo> complaintDetectList) {
         this.complaintDetectList = complaintDetectList;
@@ -817,4 +819,20 @@ public class CustomerInfo  implements Serializable {
     public void setCustomerDistrictId(String customerDistrictId) {
         this.customerDistrictId = customerDistrictId;
     }
+
+    public List<PostageInfo> getPostageInfoList() {
+        return postageInfoList;
+    }
+
+    public void setPostageInfoList(List<PostageInfo> postageInfoList) {
+        this.postageInfoList = postageInfoList;
+    }
+
+    public List<SendbackInfo> getSendbackInfoList() {
+        return sendbackInfoList;
+    }
+
+    public void setSendbackInfoList(List<SendbackInfo> sendbackInfoList) {
+        this.sendbackInfoList = sendbackInfoList;
+    }
 }

+ 9 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerStatisticalInfo.java

@@ -44,6 +44,7 @@ public class CustomerStatisticalInfo implements Serializable {
     private Integer relationCustomerCosts;//客户报价
     private Integer relationId;//处理主键
     private String procMethodName;//处理详细方式
+    private String postageString;//邮费信息
 
     public Integer getCustomerId() {
         return customerId;
@@ -292,4 +293,12 @@ public class CustomerStatisticalInfo implements Serializable {
     public void setProcMethodName(String procMethodName) {
         this.procMethodName = procMethodName;
     }
+
+    public String getPostageString() {
+        return postageString;
+    }
+
+    public void setPostageString(String postageString) {
+        this.postageString = postageString;
+    }
 }

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

@@ -461,6 +461,8 @@
     <result column="describe_handle_desc" property="describeHandleDesc"/>
     <result column="describe_content" property="describeContent"/>
     <collection property="complaintDetectList" column="customer_id" ofType="ComplaintDetectInfo" select="listComplaintDetect"/>
+   <!-- <collection property="postageInfoList" column="customer_id" ofType="PostageInfo" select="listPostageInfoByCustomerId"/>-->
+    <collection property="sendbackInfoList" column="customer_id" ofType="SendbackInfo" select="listSendbackInfoByCustomerId"/>
   </resultMap>
 
   <select id="listComplaintDetect" parameterType="Integer" resultType="ComplaintDetectInfo">
@@ -757,7 +759,9 @@ LEFT JOIN tb_rst_sys_admin sa ON c.admin_id = sa.admin_id
 LEFT JOIN tb_rst_cm_relation cr ON cr.customer_id = c.customer_id
 LEFT JOIN tb_rst_cm_proc_method cpm ON cpm.proc_method_id = cr.proc_method_id
 LEFT JOIN tb_rst_cm_proc_type cpt ON cpt.proc_type_id = cpm.proc_type_id
-  </select>
+/*where cr.relation_id in (select relation_id from tb_rst_postage_info where postage_status = 1 and postage_create_time > '2019-02-12 00:00:00')
+and cr.relation_is_transfer = 10*/
+</select>
   <!-- 退换货统计sql start -->
   <!-- 总销量 -->
   <select id="salesTotalSales" parameterType="SalesOrder" resultType="ReturnStatisticsInfo">
@@ -1044,15 +1048,34 @@ LEFT JOIN tb_rst_cm_proc_type cpt ON cpt.proc_type_id = cpm.proc_type_id
 
   <select id="getCmRelationInfo" parameterType="CmRelation" resultType="CmRelation">
     SELECT
-      *
-     FROM
-     tb_rst_cm_relation
+    cr.*,
+    sx.sendback_status AS relationBackStatus
+    FROM
+    tb_rst_cm_relation cr
+    LEFT JOIN (
+    SELECT
+    sxx.*
+    FROM
+    (
+    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
+    GROUP BY
+    ss.relation_id
+    ) sxx
+    ) sx ON sx.customer_id = cr.customer_id
     <where>
       <if test="relationId != null and relationId != ''">
-        relation_id = #{relationId},
+        cr.relation_id = #{relationId},
       </if>
       <if test="customerId != null and customerId != ''">
-        customer_id = #{customerId}
+        cr.customer_id = #{customerId}
       </if>
     </where>
   </select>
@@ -1064,6 +1087,12 @@ LEFT JOIN tb_rst_cm_proc_type cpt ON cpt.proc_type_id = cpm.proc_type_id
   <select id="listPostageInfo" parameterType="Integer" resultType="PostageInfo">
       SELECT * from tb_rst_postage_info where relation_id = #{relationId}
   </select>
+
+  <select id="listPostageInfoByCustomerId" parameterType="Integer" resultType="PostageInfo">
+      SELECT * from tb_rst_postage_info
+      LEFT JOIN tb_rst_cm_relation on tb_rst_cm_relation.relation_id = tb_rst_postage_info.relation_id
+      where tb_rst_cm_relation.customer_id = #{customerId}
+  </select>
   <insert id="addPostageInfo" parameterType="PostageInfo" keyProperty="postageId" useGeneratedKeys="true">
     insert into tb_rst_postage_info
     (
@@ -1203,6 +1232,23 @@ LEFT JOIN tb_rst_cm_proc_type cpt ON cpt.proc_type_id = cpm.proc_type_id
      WHERE relation_id = #{relationId}
   </select>
 
+  <select id="listSendbackInfoByCustomerId" parameterType="Integer" resultType="SendbackInfo">
+    SELECT
+      sendback_id,
+      tb_rst_cm_sendback_info.relation_id,
+      sendback_logistics_company,
+      sendback_logistics_no,
+      sendback_name,
+      sendback_tel,
+      sendback_status,
+      sendback_sign_time,
+      sendback_create_time,
+      sendback_update_time
+     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
+      where tb_rst_cm_relation.customer_id = #{customerId}
+  </select>
+
   <select id="sendbackItemList" parameterType="Integer" resultType="SendbackItem">
       select
       *,

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

@@ -1602,7 +1602,7 @@ public class AdminCustomerController {
                 "问题类别", "小类名称", "客诉问题", "处理过程", "购买日期",
                 "处理方式","处理结果", "销售公司", "销售渠道", "产品型号", "产品颜色",
                 "产品数量", "寄回快递", "寄回单号", "签收日期",
-                "状态", "寄出快递", "寄出快递", "开箱损", "二次客诉", "跟进客服", "工厂报价", "客户报价"
+                "状态", "寄出快递", "寄出快递", "开箱损", "二次客诉", "跟进客服", "工厂报价", "客户报价", "邮费信息"
         };
         List<CustomerStatisticalInfo> customerStatisticalInfoList = new ArrayList<>();
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
@@ -1640,6 +1640,25 @@ public class AdminCustomerController {
                                     customers.setItemNum(String.valueOf(salesOrderItem.getItemNum()));
                                     customers.setRelationFactoryCosts(customerInfo.getRelationFactoryCosts());
                                     customers.setRelationCustomerCosts(customerInfo.getRelationCustomerCosts());
+                                    String postageString = "";
+                                    //查询邮费信息
+                                    List<PostageInfo> listPostageInfo = customerService.listPostageInfo(customers.getRelationId());
+                                    if(listPostageInfo.size() > 0){
+                                        for(PostageInfo postageInfo : listPostageInfo){
+                                            String state = "";
+                                            if(postageInfo.getPostageStatus() == 1){
+                                                state = "未申请";
+                                            }
+                                            if(postageInfo.getPostageStatus() == 2){
+                                                state = "已申请(待转账)";
+                                            }
+                                            if(postageInfo.getPostageStatus() == 3){
+                                                state = "已转账";
+                                            }
+                                            postageString = postageString+"状态:"+state+" ,金额:"+postageInfo.getPostageAmount()/100+" ,支付宝账号:"+postageInfo.getPostageAlipay()+";";
+                                        }
+                                    }
+                                    customers.setPostageString(postageString);
                                     customerStatisticalInfoList.add(customers);
                                 }
                             } else {
@@ -1766,6 +1785,7 @@ public class AdminCustomerController {
             }else{
                 row.createCell(26).setCellValue(customerStatisticalInfo.getRelationCustomerCosts());
             }
+            row.createCell(27).setCellValue(customerStatisticalInfo.getPostageString());
 
         }
         //下载导出订单Excel

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

@@ -145,7 +145,7 @@
             <th width="80">购买日期</th>
             <th width="60">区域</th>
             <th width="60">TDS</th>
-            <#--<th width="80">物流单号</th>-->
+            <th width="80">物流单号</th>
             <th width="80">处理结果</th>
             <#--<th width="80">需要回访</th>-->
             <th width="80">客诉时间</th>
@@ -210,27 +210,27 @@
                             <td>${(customer.salesTime?string("yyyy-MM-dd"))!''}</td>
                             <td>${customer.customerArea!''}</td>
                             <td>进${customer.customerInTDS!'0'}PPM<br/>出${customer.customerOutTDS!'0'}PPM</td>
-                            <#--<td>
-                                <#if (customer.sendLogisticsNo??) || (customer.backLogisticsNo??)>
-
-                                        <#if (customer.backLogisticsNo??)>
-                                            寄回:
-                                            <a onclick="openLogistics('物流信息','${path}/admin/detect/to_view_logistics?billCode=${customer.backLogisticsNo!''}&billName=${customer.backLogisticsCompany!''}',300,400);">${customer.backLogisticsNo!''}</a><br>
-                                        </#if>
-                                        <#if customer.sendLogisticsNo??>
-                                            寄出:
-                                            <a onclick="openLogistics('物流信息','${path}/admin/detect/to_view_logistics?billCode=${customer.sendLogisticsNo!''}&billName=${customer.sendLogisticsCompany!''}',300,400);">${customer.sendLogisticsNo!''}</a><br>
-                                        </#if>
-                                <#else>
-                                    无
+                            <td>
+                        <#if customer.sendbackInfoList?? &&  (customer.sendbackInfoList?size > 0) >
+                            寄回:
+                            <#list customer.sendbackInfoList as sendbackInfo>
+                                    <a onclick="openLogistics('物流信息','${path}/admin/detect/to_view_logistics?billCode=${sendbackInfo.sendbackLogisticsNo!''}&billName=${sendbackInfo.sendbackLogisticsCompany!''}',300,400);">${sendbackInfo.sendbackLogisticsNo!''};</a><br>
+                            </#list>
+                        <#else>
+                        无
+                        </#if>
+                                <#if customer.sendLogisticsNo??>
+                                    寄出:
+                                    <a onclick="openLogistics('物流信息','${path}/admin/detect/to_view_logistics?billCode=${customer.sendLogisticsNo!''}&billName=${customer.sendLogisticsCompany!''}',300,400);">${customer.sendLogisticsNo!''}</a><br>
                                 </#if>
-                            </td>-->
+                            </td>
                             <td id="txt_customerIsSolve">
                                 <#if customer.procMethodIsBack?? && customer.procMethodIsSend??>
                                     <#if customer.procMethodIsBack == 1 || customer.procMethodIsSend == 1>
                                         ${customer.procMethodName!''}(
                                             <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.backStatus == 1>
                                                             未寄回

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

@@ -1596,7 +1596,8 @@
     }
     /*修改换新信息*/
     function update_relation_info(type) {
-        var relation_flag = checkRenewed(type);
+        /*var relation_flag = checkRenewed(type);*/
+        var relation_flag = true;
         //省市县
         var provinceNumber = $("#provinceNumber").find("option:selected").text();
         var cityNumber = $("#cityNumber").find("option:selected").text();