wangxiaoming 7 vuotta sitten
vanhempi
commit
d4ed57cbcf

+ 10 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/Postage.java

@@ -12,6 +12,8 @@ public class Postage implements Serializable {
     private Integer postageId;
     //客服人员id
     private Integer adminId;
+    //客诉id
+    private Integer customerId;
     //状态(客服操作)1:待申请    2:申请中
     private Integer postageCustomerStatus;
     //状态(客服经理审核)1:审核中 2:通过  3:驳回
@@ -208,4 +210,12 @@ public class Postage implements Serializable {
     public void setPostageClientAddress(String postageClientAddress) {
         this.postageClientAddress = postageClientAddress;
     }
+
+    public Integer getCustomerId() {
+        return customerId;
+    }
+
+    public void setCustomerId(Integer customerId) {
+        this.customerId = customerId;
+    }
 }

+ 9 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/PostageService.java

@@ -4,6 +4,7 @@ import com.iamberry.rst.core.cm.*;
 import com.iamberry.rst.core.order.ProductType;
 import com.iamberry.rst.core.page.PagedResult;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -48,4 +49,12 @@ public interface PostageService {
     Integer delPostage(Integer postageId);
 
 
+    /**
+     * 邮费集合
+     * @param postage
+     * @return
+     */
+    List<Postage> listPostage(Postage postage);
+
+
 }

+ 27 - 27
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerCommonServiceImpl.java

@@ -147,34 +147,34 @@ public class CustomerCommonServiceImpl implements CustomerCommonService {
         if(flag < 1){
             throw new RuntimeException("修改状态失败");
         }
-        CustomerInfo customerInfo = customerInfoMapper.getCustomerInfo(customerCommon.getCustomerId());
-        if(customerInfo == null){
-            throw new RuntimeException("查询客诉失败");
-        }
+//        CustomerInfo customerInfo = customerInfoMapper.getCustomerInfo(customerCommon.getCustomerId());
+//        if(customerInfo == null){
+//            throw new RuntimeException("查询客诉失败");
+//        }
         //1:已解决  2:未解决 3:换新  4:维修 5:补发 6:退货 7:无理由退货
-        if(customerCommon.getCustomerIsSolve() == 3 || customerCommon.getCustomerIsSolve() == 4
-                || customerCommon.getCustomerIsSolve() == 6|| customerCommon.getCustomerIsSolve() == 7){
-            if(customerCommon.getRelationIsTransfer() != 0){        //需要转邮费
-                Postage postage = new Postage();
-                postage.setAdminId(customerInfo.getAdminId());      //客服
-                postage.setPostageCustomerStatus(1);            //待申请
-                postage.setPostageOrderSource(customerInfo.getStoreId());   //店铺id
-                postage.setPostageTreatmentMethod(customerCommon.getCustomerIsSolve()); //处理方式
-                postage.setSalesOrderId(customerCommon.getSalesOrderId());       //efast订单号
-                postage.setPostageClientName(customerCommon.getRelationBackName());
-                postage.setPostageClientTel(customerCommon.getRelationBackTel());
-                postage.setPostageClientAddress(customerCommon.getRelationSendAddress());
-                postage.setPostageLogisticsCompany(customerCommon.getRelationBackLogisticsCompany());
-                postage.setPostageLogisticsNo(customerCommon.getRelationBackLogisticsNo());
-                postage.setPostageAmount(customerCommon.getRelationBackPostage());  //寄回邮费
-                postage.setPostageAlipay(customerCommon.getRelationAlipay());   //支付宝账户
-                postage.setPostageAlipayName(customerCommon.getRelationAlipayName());   //支付宝账号名称
-                flag = postageMapper.savePostage(postage);
-                if(flag < 1){
-                    throw new RuntimeException("添加邮费转账失败");
-                }
-            }
-        }
+//        if(customerCommon.getCustomerIsSolve() == 3 || customerCommon.getCustomerIsSolve() == 4
+//                || customerCommon.getCustomerIsSolve() == 6|| customerCommon.getCustomerIsSolve() == 7){
+//            if(customerCommon.getRelationIsTransfer() != 0){        //需要转邮费
+//                Postage postage = new Postage();
+//                postage.setAdminId(customerInfo.getAdminId());      //客服
+//                postage.setPostageCustomerStatus(1);            //待申请
+//                postage.setPostageOrderSource(customerInfo.getStoreId());   //店铺id
+//                postage.setPostageTreatmentMethod(customerCommon.getCustomerIsSolve()); //处理方式
+//                postage.setSalesOrderId(customerCommon.getSalesOrderId());       //efast订单号
+//                postage.setPostageClientName(customerCommon.getRelationBackName());
+//                postage.setPostageClientTel(customerCommon.getRelationBackTel());
+//                postage.setPostageClientAddress(customerCommon.getRelationSendAddress());
+//                postage.setPostageLogisticsCompany(customerCommon.getRelationBackLogisticsCompany());
+//                postage.setPostageLogisticsNo(customerCommon.getRelationBackLogisticsNo());
+//                postage.setPostageAmount(customerCommon.getRelationBackPostage());  //寄回邮费
+//                postage.setPostageAlipay(customerCommon.getRelationAlipay());   //支付宝账户
+//                postage.setPostageAlipayName(customerCommon.getRelationAlipayName());   //支付宝账号名称
+//                flag = postageMapper.savePostage(postage);
+//                if(flag < 1){
+//                    throw new RuntimeException("添加邮费转账失败");
+//                }
+//            }
+//        }
         return flag;
     }
 

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

@@ -525,8 +525,8 @@ public class CustomerServiceImpl implements CustomerService {
                 //查询换新数据id
                 renewed = renewedMapper.getRenewedInfo(renewed);
                 if(customer.getCustomerIsSolve() < 3){ //从维修换货补发修改为已解决或未解决时,原订单生成退单
-                    salesOrder = salesOrderMapper.getSalesOrderById(renewed.getOrderId());
-                    customerCommon.setOrderId(salesOrder.getSalesId()); //订单id
+                    //salesOrder = salesOrderMapper.getSalesOrderById(renewed.getOrderId());    //salesOrder.getSalesId()  全场最佳,就你戏多
+                    customerCommon.setOrderId(renewed.getOrderId()); //订单id
                     SendProdcue record = new SendProdcue();
                     record.setRelationId(renewed.getRenewedId());
                     customerCommon.setSendProdcues(sendProdcueMapper.listSendProdcue(record));
@@ -551,8 +551,8 @@ public class CustomerServiceImpl implements CustomerService {
                 //查询维修数据id
                 repair = repairMapper.getRepairInfo(repair);
                 if(customer.getCustomerIsSolve() < 3) { //从维修换货补发修改为已解决或未解决时,原订单生成退单
-                    salesOrder = salesOrderMapper.getSalesOrderById(repair.getOrderId());
-                    customerCommon.setOrderId(salesOrder.getSalesId()); //订单id
+                    //salesOrder = salesOrderMapper.getSalesOrderById(repair.getOrderId());
+                    customerCommon.setOrderId(repair.getOrderId()); //订单id
                     SendProdcue record = new SendProdcue();
                     record.setRelationId(repair.getRepairId());
                     customerCommon.setSendProdcues(sendProdcueMapper.listSendProdcue(record));
@@ -577,8 +577,8 @@ public class CustomerServiceImpl implements CustomerService {
                 //查询补发数据id
                 reissue = reissueMapper.getReissue(reissue);
                 if(customer.getCustomerIsSolve() < 3) { //从维修换货补发修改为已解决或未解决时,原订单生成退单
-                    salesOrder = salesOrderMapper.getSalesOrderById(reissue.getOrderId());
-                    customerCommon.setOrderId(salesOrder.getSalesId()); //订单id
+                    //salesOrder = salesOrderMapper.getSalesOrderById(reissue.getOrderId());
+                    customerCommon.setOrderId(reissue.getOrderId()); //订单id
                     SendProdcue record = new SendProdcue();
                     record.setRelationId(reissue.getReissueId());
                     customerCommon.setSendProdcues(sendProdcueMapper.listSendProdcue(record));

+ 5 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/PostageServiceImpl.java

@@ -35,6 +35,11 @@ public class PostageServiceImpl implements PostageService {
     }
 
     @Override
+    public List<Postage> listPostage(Postage postage) {
+        return postageMapper.listPostage(postage);
+    }
+
+    @Override
     public Postage getPostage(Integer postageId) {
         return postageMapper.getPostage(postageId);
     }

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

@@ -4,6 +4,7 @@
   <resultMap id="BaseResultMap" type="Postage" >
     <id column="postage_id" property="postageId" jdbcType="INTEGER" />
     <result column="admin_id" property="adminId" jdbcType="INTEGER" />
+    <result column="customer_id" property="customerId" jdbcType="INTEGER" />
     <result column="postage_customer_status" property="postageCustomerStatus" jdbcType="INTEGER" />
     <result column="postage_manager_status" property="postageManagerStatus" jdbcType="INTEGER" />
     <result column="postage_finance_status" property="postageFinanceStatus" jdbcType="INTEGER" />
@@ -22,7 +23,7 @@
   </resultMap>
 
   <sql id="Base_Column_List" >
-    p.postage_id, p.admin_id, p.postage_customer_status, p.postage_manager_status, p.postage_finance_status,
+    p.postage_id, p.admin_id, p.customer_id,  p.postage_customer_status, p.postage_manager_status, p.postage_finance_status,
     p.postage_order_source, p.postage_treatment_method, p.sales_orderId, p.postage_client_name,
     p.postage_client_tel,p.postage_client_address, p.postage_logistics_company, p.postage_logistics_no, p.postage_amount,
     p.postage_alipay, p.postage_alipay_name, p.postage_create_time, p.postage_update_time
@@ -40,6 +41,9 @@
       <if test="adminId != null and adminId != ''">
         p.admin_id = #{adminId}
       </if>
+      <if test="customerId != null and customerId != ''">
+        p.customer_id = #{customerId}
+      </if>
       <if test="postageId != null and postageId != ''">
         AND p.postage_id = #{postageId}
       </if>
@@ -95,7 +99,7 @@
   </select>
 
     <insert id="savePostage" parameterType="Postage" >
-    insert into tb_rst_postage (postage_id, admin_id, postage_customer_status,
+    insert into tb_rst_postage (postage_id, admin_id, customer_id, postage_customer_status,
     postage_manager_status, postage_finance_status,
     postage_order_source, postage_treatment_method,
     sales_orderId, postage_client_name, postage_client_tel,
@@ -103,7 +107,7 @@
     postage_logistics_company, postage_logistics_no,
     postage_amount, postage_alipay, postage_alipay_name
     )
-    values (#{postageId,jdbcType=INTEGER}, #{adminId,jdbcType=INTEGER}, #{postageCustomerStatus,jdbcType=INTEGER},
+    values (#{postageId,jdbcType=INTEGER}, #{adminId,jdbcType=INTEGER}, #{customerId,jdbcType=INTEGER}, #{postageCustomerStatus,jdbcType=INTEGER},
     #{postageManagerStatus,jdbcType=INTEGER}, #{postageFinanceStatus,jdbcType=INTEGER},
     #{postageOrderSource,jdbcType=INTEGER}, #{postageTreatmentMethod,jdbcType=INTEGER},
     #{salesOrderId,jdbcType=VARCHAR}, #{postageClientName,jdbcType=VARCHAR}, #{postageClientTel,jdbcType=VARCHAR},
@@ -119,6 +123,9 @@
       <if test="adminId != null" >
         admin_id = #{adminId,jdbcType=INTEGER},
       </if>
+      <if test="customerId != null" >
+        customer_id = #{customerId,jdbcType=INTEGER},
+      </if>
       <if test="postageCustomerStatus != null" >
         postage_customer_status = #{postageCustomerStatus,jdbcType=INTEGER},
       </if>

+ 73 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -89,6 +89,8 @@ public class AdminCustomerController {
     private CustomerCommonService customerCommonService;
     @Autowired
     private AddressService addressService;
+    @Autowired
+    private PostageService postageService;
 
 
 
@@ -1724,5 +1726,76 @@ public class AdminCustomerController {
             return rj;
         }
     }
+
+
+    /**
+     * 申请邮费
+     * @return
+     */
+    @ResponseBody
+    @RequiresPermissions("customer:applyPostage:customer")
+    @RequestMapping(value = "/apply_postage")
+    public ResponseJson applyPostage(HttpServletRequest request, Integer customerId) throws Exception {
+        CustomerInfo customerInfo = customerService.getCustomerInfo(customerId);
+        if(customerInfo == null){
+            return new ResponseJson(500, "未获取到客诉", 500);
+        }
+
+        CustomerCommon customerCommon = new CustomerCommon();
+        customerCommon.setCustomerId(customerId);
+        List<CustomerCommon> customerCommonList = customerCommonService.listCustomerCommon(customerCommon);
+        customerCommon = customerCommonList.get(0);
+
+        if(customerCommon.getRelationBackStatus() == 1){    //1:未寄回  2:已寄回  3:已收货  4:已签收待确认
+            return new ResponseJson(500, "请修改寄回状态,并填写寄回信息", 500);
+        }
+
+        if(customerCommon.getRelationBackStatus() == 2){    //1:未寄回  2:已寄回  3:已收货  4:已签收待确认
+            return new ResponseJson(500, "产品正在寄回中!", 500);
+        }
+
+        if(customerCommon.getRelationIsTransfer() == 0){    //relationIsTransfer 是否需要转账邮费  0:不需要 10:需要转账
+            return new ResponseJson(500, "请修改邮费转账状态,并填写邮费信息", 500);
+        }
+
+        if(customerCommon.getRelationBackPostage() == null || customerCommon.getRelationBackPostage() == 0  //relationBackPostage
+                || customerCommon.getRelationAlipay() == null || customerCommon.getRelationAlipayName() == null ){
+            return new ResponseJson(500, "请填写邮费信息", 500);
+        }
+
+        Postage age = new Postage();
+        age.setCustomerId(customerInfo.getCustomerId());    //客诉id
+        List<Postage> postageList = postageService.listPostage(age);
+        if(postageList != null && postageList.size() > 0){
+            return new ResponseJson(500, "该条客诉已在申请邮费中了", 500);
+        }
+
+        Integer flag = 0;
+        Postage postage = new Postage();
+        postage.setAdminId(customerInfo.getAdminId());      //客服
+        postage.setCustomerId(customerInfo.getCustomerId());        //客诉id
+        postage.setPostageCustomerStatus(2);            //------考虑手动点, 直接变为申请中
+        postage.setPostageManagerStatus(1);     //------考虑手动点, 直接变为申请中
+        postage.setPostageOrderSource(customerInfo.getStoreId());   //店铺id
+        postage.setPostageTreatmentMethod(customerCommon.getCustomerIsSolve()); //处理方式
+        postage.setSalesOrderId(customerCommon.getSalesOrderId());       //efast订单号
+        postage.setPostageClientName(customerCommon.getRelationBackName());
+        postage.setPostageClientTel(customerCommon.getRelationBackTel());
+        postage.setPostageClientAddress(customerCommon.getRelationSendAddress());
+        postage.setPostageLogisticsCompany(customerCommon.getRelationBackLogisticsCompany());
+        postage.setPostageLogisticsNo(customerCommon.getRelationBackLogisticsNo());
+        postage.setPostageAmount(customerCommon.getRelationBackPostage());  //寄回邮费
+        postage.setPostageAlipay(customerCommon.getRelationAlipay());   //支付宝账户
+        postage.setPostageAlipayName(customerCommon.getRelationAlipayName());   //支付宝账号名称
+        flag = postageService.savePostage(postage);
+
+        if(flag < 1){
+            return new ResponseJson(500, "申请失败", 500);
+        }
+
+        ResponseJson rj = new ResponseJson(200, "申请成功,请前往邮费转账列表查看", 200);
+        return rj;
+    }
+
 }
 

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

@@ -321,6 +321,12 @@
                                 ${(customer.customerCreateTime?string("HH:mm:ss"))!''}
                             </td>
                             <td>
+                                <#if customer.customerIsSolve == 3 || customer.customerIsSolve == 4 || customer.customerIsSolve == 6>
+                                    <a style="text-decoration:none" href="javascript:void(0);" title="申请邮费" onclick="ApplyForPostage(${customer.customerId!''})">
+                                        <font color=#06c>申请邮费</font>
+                                    </a><br/>
+                                </#if>
+
                                 <#if customer.customerIsSolve == 2>
                                     <a style="text-decoration:none" href="javascript:void(0);" title="已解决" onclick="updateCustomerIsSolve(${customer.customerId!''})">
                                         <font color=#06c>已解决</font>
@@ -489,6 +495,32 @@
 
         });
     }
+
+    /**
+     * 申请邮费
+     */
+    function ApplyForPostage(customerId) {
+        layer.confirm('确认要申请吗?',function(index){
+            $.ajax({
+                cache: true,
+                type: "POST",
+                data: {"customerId":customerId},
+                url: "${path}/admin/customer/apply_postage",
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        layer.msg(data.resultMsg,{icon: 1,time:1000});
+                    } else {
+                        layer.msg(data.resultMsg,{icon: 5,time:1000});
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                }
+            })
+        }, function() {
+        });
+    }
+
     /*查看物流*/
     function openLogistics(title, url, w, h) {
         layer_show(title,url,w,h);

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

@@ -832,29 +832,25 @@
             initProcessResult(allCustomerType);
         })
 
-
-        /*默认选择是否需要选择订单*/
-        $("input[name='typeId']").each(function(){
-            var typeId = parseInt($(this).val());
-            var isOrder = 1;
-            switch (typeId){    //1:Soodo电动牙刷   6:WaterO净水机    7:Aiberle净水机    9 :YULIA净水机
-                case 1:
-                    isOrder = 2;
-                    break;
-                case 6:
-                    isOrder = 1;
-                    break;
-                case 7:
-                    isOrder = 1;
-                    break;
-                case 9:
-                    isOrder = 1;
-                    break;
-                default:
-                    break;
-            }
-            opentionSelectOrder(isOrder);
-        })
+        var ty = parseInt($("input[name='typeId']:checked").val());
+        var isOrder = 1;
+        switch (ty){    //1:Soodo电动牙刷   6:WaterO净水机    7:Aiberle净水机    9 :YULIA净水机
+            case 1:
+                isOrder = 2;
+                break;
+            case 6:
+                isOrder = 1;
+                break;
+            case 7:
+                isOrder = 1;
+                break;
+            case 9:
+                isOrder = 1;
+                break;
+            default:
+                break;
+        }
+        opentionSelectOrder(isOrder);
 
         /*绑定产品类型选择事件*/
         $("input[name='typeId']").change(function (){

+ 5 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/cm/postage/postage_list.ftl

@@ -37,6 +37,7 @@
 <div class="page-container">
     <div class="text-c">
         <form action="${path}/admin/postage/postage_list" method="post">
+            <input type="text" class="my-input"  style="width:90px;margin-right: 0px;" value="${postage.customerId!}" placeholder="客诉编号" id="customerId" name="customerId">
             <input type="text" class="my-input"  style="width:90px;margin-right: 0px;" value="${postage.salesOrderId!}" placeholder="百胜订单号" id="salesOrderId" name="salesOrderId">
             <input type="text" class="my-input"  style="width:90px;margin-right: 0px;" value="${postage.postageClientName!}" placeholder="请输入客户姓名" id="postageClientName" name="postageClientName">
             <input type="text" class="my-input"  style="width:90px;margin-right: 0px;" value="${postage.postageClientTel!}" placeholder="请输入电话号码" id="postageClientTel" name="postageClientTel">
@@ -47,7 +48,7 @@
                 <option value="2" <#if postage.postageCustomerStatus??><#if postage.postageCustomerStatus == 2 >selected="selected"</#if></#if>>申请中</option>
             </select>
             <select class="my-select" name="postageManagerStatus" id="postageManagerStatus" style="height: 36px;width: 100px;margin: 0px;padding: 6px 10px 6px 15px;">
-                <option value="">客服审核</option>
+                <option value="">客服经理审核</option>
                 <option value="1" <#if postage.postageManagerStatus??><#if postage.postageManagerStatus == 1 >selected="selected"</#if></#if>>待审核</option>
                 <option value="2" <#if postage.postageManagerStatus??><#if postage.postageManagerStatus == 2 >selected="selected"</#if></#if>>通过</option>
                 <option value="3" <#if postage.postageManagerStatus??><#if postage.postageManagerStatus == 3 >selected="selected"</#if></#if>>驳回</option>
@@ -69,9 +70,10 @@
         <table class="table table-border table-bg table-bordered">
             <thead>
             <tr class="text-c">
+                <th width="50">客诉编号</th>
                 <th width="50">客服人员</th>
                 <th width="50">申请状态</th>
-                <th width="50">客服审核状态</th>
+                <th width="50">客服经理审核状态</th>
                 <th width="50">财务审核状态</th>
                 <th width="60">订单来源</th>
                 <th width="70">售后处理方式</th>
@@ -91,6 +93,7 @@
             <#if page.dataList?? &&  (page.dataList?size > 0) >
                 <#list page.dataList as postage>
                 <tr class="text-c">
+                    <td>${postage.customerId!''}</td>
                     <td>${postage.adminName!''}</td>
                     <td>
                         <#if postage.postageCustomerStatus == 1>

+ 1 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/order/excel_to_order.ftl

@@ -115,6 +115,7 @@
 							<option value="34">老虎工作室</option>
 							<option value="35">有赞</option>
 							<option value="37">深圳鑫之鹏</option>
+							<option value="38">东西儿童教育</option>
                         </select>
                     </label>
                 </td>