Quellcode durchsuchen

添加了查询客诉详情的接口

liuzhiwei vor 7 Jahren
Ursprung
Commit
9eee247c4f

+ 3 - 3
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerCommon.java

@@ -410,7 +410,7 @@ public class CustomerCommon implements Serializable {
      * @param object
      * @return
      */
-    public CustomerCommon getCustomerCommon(int solve, Object object) {
+    public static CustomerCommon getCustomerCommon(int solve, Object object) {
         if (object == null) {
             return null;
         }
@@ -500,7 +500,7 @@ public class CustomerCommon implements Serializable {
                 customerCommon.setRelationUpdateTime(reissue.getReissueUpdateTime());
                 break;
             case 6://退货
-                BackGoods backGoods = new BackGoods();
+                BackGoods backGoods = (BackGoods)object;
                 customerCommon.setRelationId(backGoods.getBackGoodsId());
                 customerCommon.setCustomerId(backGoods.getCustomerId());
                 customerCommon.setOrderId(backGoods.getOrderId());
@@ -520,7 +520,7 @@ public class CustomerCommon implements Serializable {
                 customerCommon.setRelationUpdateTime(backGoods.getBackGoodsUpdateTime());
                 break;
             case 7://无理由退货
-                NoreasonBack noreasonBack = new NoreasonBack();
+                NoreasonBack noreasonBack = (NoreasonBack)object;
                 customerCommon.setRelationId(noreasonBack.getNoreasonBackId());
                 customerCommon.setCustomerId(noreasonBack.getCustomerId());
                 customerCommon.setOrderId(noreasonBack.getOrderId());

+ 2 - 1
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/CustomerService.java

@@ -1,6 +1,7 @@
 package com.iamberry.rst.faces.cm;
 
 import com.iamberry.rst.core.cm.BackGoods;
+import com.iamberry.rst.core.cm.CustomerCommon;
 import com.iamberry.rst.core.cm.CustomerInfo;
 import com.iamberry.rst.core.cm.Reissue;
 import com.iamberry.rst.core.page.PagedResult;
@@ -38,7 +39,7 @@ public interface CustomerService {
      * @param customerInfo
      * @return
      */
-    CustomerInfo getCustomerInfo(CustomerInfo customerInfo);
+    CustomerCommon getCustomerInfo(CustomerInfo customerInfo);
 
     /**
      * 获取售后退货信息

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

@@ -120,31 +120,77 @@ public class CustomerServiceImpl implements CustomerService {
     }
 
     @Override
-    public CustomerInfo getCustomerInfo(CustomerInfo customerInfo) {
+    public CustomerCommon getCustomerInfo(CustomerInfo customerInfo) {
+        CustomerCommon customerCommon = new CustomerCommon();
         //查询客诉列表
         List<CustomerInfo> customerList = customerInfoMapper.listCustomer(customerInfo);
         if (customerList == null || customerList.size() == 0) {
             return null;
         }
         CustomerInfo customer = customerList.get(0);
-
-        //查询售后维修集合
-        Repair repairInfo = new Repair();
-        repairInfo.setRepairState(1);
-        List<Repair> repairList = repairMapper.listRepair(repairInfo);
-        //查询售后退货集合
-        BackGoods backGoodsInfo = new BackGoods();
-        backGoodsInfo.setBackGoodsState(1);
-        List<BackGoods> backGoodsList = backGoodsMapper.listBackGoods(backGoodsInfo);
-        //查询售后无理由退货集合
-        NoreasonBack noreasonBackInfo = new NoreasonBack();
-        noreasonBackInfo.setNoreasonBackState(1);
-        List<NoreasonBack> noreasonBackList = noreasonBackMapper.listNoreasonBack(noreasonBackInfo);
-        //查询售后补发集合
-        Reissue reissueInfo = new Reissue();
-        reissueInfo.setReissueState(1);
-        List<Reissue> reissueList = reissueMapper.listReissue(reissueInfo);
-        return customer;
+        switch (customer.getCustomerIsSolve().intValue()) {
+            case 3://换新
+                //查询售后换新集合
+                Renewed renewedInfo = new Renewed();
+                renewedInfo.setRenewedState(1);
+                renewedInfo.setCustomerId(customerInfo.getCustomerId());
+                List<Renewed> renewedList = renewedMapper.listRenewed(renewedInfo);
+                if (renewedList == null || renewedList.size() == 0) {
+                    return null;
+                }
+                renewedInfo = renewedList.get(0);
+                customerCommon = CustomerCommon.getCustomerCommon(3,renewedInfo);
+                break;
+            case 4://维修
+                //查询售后维修集合
+                Repair repairInfo = new Repair();
+                repairInfo.setRepairState(1);
+                repairInfo.setCustomerId(customerInfo.getCustomerId());
+                List<Repair> repairList = repairMapper.listRepair(repairInfo);
+                if (repairList == null || repairList.size() == 0) {
+                    return null;
+                }
+                repairInfo = repairList.get(0);
+                customerCommon = CustomerCommon.getCustomerCommon(4,repairInfo);
+                break;
+            case 5://补发
+                //查询售后补发集合
+                Reissue reissueInfo = new Reissue();
+                reissueInfo.setReissueState(1);
+                reissueInfo.setCustomerId(customerInfo.getCustomerId());
+                List<Reissue> reissueList = reissueMapper.listReissue(reissueInfo);
+                if (reissueList == null || reissueList.size() == 0) {
+                    return null;
+                }
+                reissueInfo = reissueList.get(0);
+                customerCommon = CustomerCommon.getCustomerCommon(5,reissueInfo);
+                break;
+            case 6://退货
+                //查询售后退货集合
+                BackGoods backGoodsInfo = new BackGoods();
+                backGoodsInfo.setBackGoodsState(1);
+                backGoodsInfo.setCustomerId(customerInfo.getCustomerId());
+                List<BackGoods> backGoodsList = backGoodsMapper.listBackGoods(backGoodsInfo);
+                if (backGoodsList == null || backGoodsList.size() == 0) {
+                    return null;
+                }
+                backGoodsInfo = backGoodsList.get(0);
+                customerCommon = CustomerCommon.getCustomerCommon(6,backGoodsInfo);
+                break;
+            case 7://无理由退货
+                //查询售后无理由退货集合
+                NoreasonBack noreasonBackInfo = new NoreasonBack();
+                noreasonBackInfo.setNoreasonBackState(1);
+                noreasonBackInfo.setCustomerId(customerInfo.getCustomerId());
+                List<NoreasonBack> noreasonBackList = noreasonBackMapper.listNoreasonBack(noreasonBackInfo);
+                if (noreasonBackList == null || noreasonBackList.size() == 0) {
+                    return null;
+                }
+                noreasonBackInfo = noreasonBackList.get(0);
+                customerCommon = CustomerCommon.getCustomerCommon(7,noreasonBackInfo);
+                break;
+        }
+        return customerCommon;
     }
 
     @Override

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

@@ -40,6 +40,14 @@
       *
     from
       tb_rst_noreason_back
+    <where>
+      <if test="customerId != null and customerId != ''">
+        customer_id = #{customerId}
+      </if>
+      <if test="noreasonBackState != null and noreasonBackState != ''">
+        and noreason_back_state = #{noreasonBackState}
+      </if>
+    </where>
   </select>
 
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >

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

@@ -98,6 +98,14 @@
       *
     from
       tb_rst_renewed
+    <where>
+      <if test="customerId != null and customerId != ''">
+        customer_id = #{customerId}
+      </if>
+      <if test="renewedState != null and renewedState != ''">
+        and renewed_state = #{renewedState}
+      </if>
+    </where>
   </select>
 
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >

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

@@ -229,6 +229,10 @@ public class AdminCustomerController {
         if (!StringUtils.isNotEmpty(customerId)) {
             return mv;
         }
+        CustomerInfo customerInfo = new CustomerInfo();
+        customerInfo.setCustomerId(Integer.parseInt(customerId));
+        CustomerCommon customerCommon = customerService.getCustomerInfo(customerInfo);
+        mv.addObject("customerCommon",customerCommon);
         return mv;
     }