Ver código fonte

客诉修改

wangxiaoming 6 anos atrás
pai
commit
f4e6936c89
16 arquivos alterados com 430 adições e 645 exclusões
  1. 1 6
      iamberry-app-interface/src/main/java/com/iamberry/app/face/UserService.java
  2. 0 153
      iamberry-app-interface/src/main/java/com/iamberry/app/face/UserService.java.mine
  3. 0 154
      iamberry-app-interface/src/main/java/com/iamberry/app/face/UserService.java.r5272
  4. 0 154
      iamberry-app-interface/src/main/java/com/iamberry/app/face/UserService.java.r5562
  5. 7 5
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/CustomerService.java
  6. 8 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/RelationOrderService.java
  7. 12 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerCommonServiceImpl.java
  8. 156 5
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java
  9. 5 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/RelationOrderServiceImpl.java
  10. 7 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/RelationOrderMapper.java
  11. 3 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/closedProdcueMapper.xml
  12. 6 2
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/cmRelationMapper.xml
  13. 171 161
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/customerCommonMapper.xml
  14. 8 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/relationOrderMapper.xml
  15. 3 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/sendProdcueMapper.xml
  16. 43 4
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AppComplaintQuestionInfoController.java

+ 1 - 6
iamberry-app-interface/src/main/java/com/iamberry/app/face/UserService.java

@@ -149,13 +149,8 @@ public interface UserService {
 	 * @return User Information
 	 */
 	public User selectUserByUsername(String username);
-<<<<<<< .mine
 
-||||||| .r5272
-	
 	public List<User> getAll(int start, int end);
-=======
-	
+
 	/*public List<User> getAll(int start, int end);*/
->>>>>>> .r5562
 }

+ 0 - 153
iamberry-app-interface/src/main/java/com/iamberry/app/face/UserService.java.mine

@@ -1,153 +0,0 @@
-package com.iamberry.app.face;
-
-import java.util.List;
-
-import com.iamberry.app.core.dto.RemoteIpInfoDTO;
-import com.iamberry.app.core.dto.UserDTO;
-import com.iamberry.app.core.entity.User;
-
-/**
- * UserService
- *
- * @author Moon Cheng
- * @date 2016年3月23日 上午11:33:29
- */
-
-public interface UserService {
-	
-	
-	public User validateUserToken(String token);
-
-	/**
-	 * register
-	 *
-	 * @author Moon Cheng
-	 * @param phone
-	 * @param password
-	 * @return User Information
-	 */
-	public User register(String phone, String password, String ip) ;
-
-	/**
-	 * thirdPartBindingPhone
-	 *
-	 * @param phone
-	 * @param openId
-	 * @return
-	 */
-	public User thirdPartBindingPhone(String phone, String openId) ;
-	/**
-	 * findById
-	 *
-	 * @param id
-	 * @return User
-	 */
-	public User findById(Long id);
-
-	/**
-	 * login
-	 *
-	 * @param phone
-	 * @param password
-	 * @param userAgent
-	 * @return
-	 */
-	public Object login(String phone, String password) ;
-
-	/**
-	 * thirdPartLogin
-	 *
-	 * @param openId
-	 * @param extType
-	 * @param extName
-	 * @param extPicture
-	 * @return
-	 */
-	public User thirdPartLogin(String openId, String extType, String extName, String extPicture, String ip) ;
-
-	/**
-	 * updateUserInfo
-	 *
-	 * @param user
-	 * @param token
-	 * @return
-	 */
-	public User updateUserInfo(User user, String token) ;
-
-	/**
-	 * updateDisplayPicture
-	 *
-	 * @author Moon Cheng
-	 * @param base64
-	 * @param token
-	 * @return
-	 */
-	public String updateDisplayPicture(String base64, String token) ;
-	/**
-	 * changePhone
-	 *
-	 * @author Moon Cheng
-	 * @param phone
-	 * @param token
-	 * @return
-	 */
-	public User changePhone(String phone, String token) ;
-	/**
-	 * resetPassWord
-	 *
-	 * @param oldPassword
-	 * @param newPassword
-	 * @param token
-	 * @return
-	 */
-	public int changePassword(String oldPassword, String newPassword, String token) ;
-	/**
-	 * changePassWord
-	 *
-	 * @param username,
-	 *            newPassword
-	 * @param session
-	 * @return int
-	 */
-	public int resetPassWord(String username, String newPassword) ;
-
-	public UserDTO tuyaConnect(User user) ;
-
-	/**
-	 * getStartPage
-	 *
-	 * @return String
-	 */
-	public String getStartPage() ;
-	/**
-	 * getLocation
-	 *
-	 * @param ip
-	 * @return String
-	 */
-	public RemoteIpInfoDTO getLocation(String ip) ;
-
-	/**
-	 * getApkVersion
-	 *
-	 * @return
-	 */
-	public String getApkVersion();
-	
-	/**
-	 * selectUserAvator
-	 *
-	 * @param id
-	 * @return String
-	 */
-	public String selectUserAvator(Long id);
-	
-	/**
-	 * selectUserByUsername
-	 *
-	 * @param username
-	 * @return User Information
-	 */
-	public User selectUserByUsername(String username);
-
-}

+ 0 - 154
iamberry-app-interface/src/main/java/com/iamberry/app/face/UserService.java.r5272

@@ -1,154 +0,0 @@
-package com.iamberry.app.face;
-
-import java.util.List;
-
-import com.iamberry.app.core.dto.RemoteIpInfoDTO;
-import com.iamberry.app.core.dto.UserDTO;
-import com.iamberry.app.core.entity.User;
-
-/**
- * UserService
- *
- * @author Moon Cheng
- * @date 2016年3月23日 上午11:33:29
- */
-
-public interface UserService {
-	
-	
-	public User validateUserToken(String token);
-
-	/**
-	 * register
-	 *
-	 * @author Moon Cheng
-	 * @param phone
-	 * @param password
-	 * @return User Information
-	 */
-	public User register(String phone, String password, String ip) ;
-
-	/**
-	 * thirdPartBindingPhone
-	 *
-	 * @param phone
-	 * @param openId
-	 * @return
-	 */
-	public User thirdPartBindingPhone(String phone, String openId) ;
-	/**
-	 * findById
-	 *
-	 * @param id
-	 * @return User
-	 */
-	public User findById(Long id);
-
-	/**
-	 * login
-	 *
-	 * @param phone
-	 * @param password
-	 * @param userAgent
-	 * @return
-	 */
-	public Object login(String phone, String password) ;
-
-	/**
-	 * thirdPartLogin
-	 *
-	 * @param openId
-	 * @param extType
-	 * @param extName
-	 * @param extPicture
-	 * @return
-	 */
-	public User thirdPartLogin(String openId, String extType, String extName, String extPicture, String ip) ;
-
-	/**
-	 * updateUserInfo
-	 *
-	 * @param user
-	 * @param token
-	 * @return
-	 */
-	public User updateUserInfo(User user, String token) ;
-
-	/**
-	 * updateDisplayPicture
-	 *
-	 * @author Moon Cheng
-	 * @param base64
-	 * @param token
-	 * @return
-	 */
-	public String updateDisplayPicture(String base64, String token) ;
-	/**
-	 * changePhone
-	 *
-	 * @author Moon Cheng
-	 * @param phone
-	 * @param token
-	 * @return
-	 */
-	public User changePhone(String phone, String token) ;
-	/**
-	 * resetPassWord
-	 *
-	 * @param oldPassword
-	 * @param newPassword
-	 * @param token
-	 * @return
-	 */
-	public int changePassword(String oldPassword, String newPassword, String token) ;
-	/**
-	 * changePassWord
-	 *
-	 * @param username,
-	 *            newPassword
-	 * @param session
-	 * @return int
-	 */
-	public int resetPassWord(String username, String newPassword) ;
-
-	public UserDTO tuyaConnect(User user) ;
-
-	/**
-	 * getStartPage
-	 *
-	 * @return String
-	 */
-	public String getStartPage() ;
-	/**
-	 * getLocation
-	 *
-	 * @param ip
-	 * @return String
-	 */
-	public RemoteIpInfoDTO getLocation(String ip) ;
-
-	/**
-	 * getApkVersion
-	 *
-	 * @return
-	 */
-	public String getApkVersion();
-	
-	/**
-	 * selectUserAvator
-	 *
-	 * @param id
-	 * @return String
-	 */
-	public String selectUserAvator(Long id);
-	
-	/**
-	 * selectUserByUsername
-	 *
-	 * @param username
-	 * @return User Information
-	 */
-	public User selectUserByUsername(String username);
-	
-	public List<User> getAll(int start, int end);
-}

+ 0 - 154
iamberry-app-interface/src/main/java/com/iamberry/app/face/UserService.java.r5562

@@ -1,154 +0,0 @@
-package com.iamberry.app.face;
-
-import java.util.List;
-
-import com.iamberry.app.core.dto.RemoteIpInfoDTO;
-import com.iamberry.app.core.dto.UserDTO;
-import com.iamberry.app.core.entity.User;
-
-/**
- * UserService
- *
- * @author Moon Cheng
- * @date 2016年3月23日 上午11:33:29
- */
-
-public interface UserService {
-	
-	
-	public User validateUserToken(String token);
-
-	/**
-	 * register
-	 *
-	 * @author Moon Cheng
-	 * @param phone
-	 * @param password
-	 * @return User Information
-	 */
-	public User register(String phone, String password, String ip) ;
-
-	/**
-	 * thirdPartBindingPhone
-	 *
-	 * @param phone
-	 * @param openId
-	 * @return
-	 */
-	public User thirdPartBindingPhone(String phone, String openId) ;
-	/**
-	 * findById
-	 *
-	 * @param id
-	 * @return User
-	 */
-	public User findById(Long id);
-
-	/**
-	 * login
-	 *
-	 * @param phone
-	 * @param password
-	 * @param userAgent
-	 * @return
-	 */
-	public Object login(String phone, String password) ;
-
-	/**
-	 * thirdPartLogin
-	 *
-	 * @param openId
-	 * @param extType
-	 * @param extName
-	 * @param extPicture
-	 * @return
-	 */
-	public User thirdPartLogin(String openId, String extType, String extName, String extPicture, String ip) ;
-
-	/**
-	 * updateUserInfo
-	 *
-	 * @param user
-	 * @param token
-	 * @return
-	 */
-	public User updateUserInfo(User user, String token) ;
-
-	/**
-	 * updateDisplayPicture
-	 *
-	 * @author Moon Cheng
-	 * @param base64
-	 * @param token
-	 * @return
-	 */
-	public String updateDisplayPicture(String base64, String token) ;
-	/**
-	 * changePhone
-	 *
-	 * @author Moon Cheng
-	 * @param phone
-	 * @param token
-	 * @return
-	 */
-	public User changePhone(String phone, String token) ;
-	/**
-	 * resetPassWord
-	 *
-	 * @param oldPassword
-	 * @param newPassword
-	 * @param token
-	 * @return
-	 */
-	public int changePassword(String oldPassword, String newPassword, String token) ;
-	/**
-	 * changePassWord
-	 *
-	 * @param username,
-	 *            newPassword
-	 * @param session
-	 * @return int
-	 */
-	public int resetPassWord(String username, String newPassword) ;
-
-	public UserDTO tuyaConnect(User user) ;
-
-	/**
-	 * getStartPage
-	 *
-	 * @return String
-	 */
-	public String getStartPage() ;
-	/**
-	 * getLocation
-	 *
-	 * @param ip
-	 * @return String
-	 */
-	public RemoteIpInfoDTO getLocation(String ip) ;
-
-	/**
-	 * getApkVersion
-	 *
-	 * @return
-	 */
-	public String getApkVersion();
-	
-	/**
-	 * selectUserAvator
-	 *
-	 * @param id
-	 * @return String
-	 */
-	public String selectUserAvator(Long id);
-	
-	/**
-	 * selectUserByUsername
-	 *
-	 * @param username
-	 * @return User Information
-	 */
-	public User selectUserByUsername(String username);
-	
-	/*public List<User> getAll(int start, int end);*/
-}

+ 7 - 5
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/CustomerService.java

@@ -19,14 +19,14 @@ public interface CustomerService {
      * @param customerInfo
      * @return
      */
-    Integer saveCustomerInfo(CustomerInfo customerInfo,SalesOrder salesOrder);
+    Integer saveCustomerInfo(CustomerInfo customerInfo, SalesOrder salesOrder);
 
     /**
      * 修改客诉
      * @param customerInfo
      * @return
      */
-    Integer updateCustomerInfo(CustomerInfo customerInfo,SalesOrder salesOrder);
+    Integer updateCustomerInfo(CustomerInfo customerInfo, SalesOrder salesOrder);
     /**
      * 添加订单到efast
      * @param salesOrder
@@ -124,7 +124,7 @@ public interface CustomerService {
      * @return
      * @throws Exception
      */
-    void chargebackEfastOrder(CustomerCommon customerCommon, SalesOrder salesOrder,Integer status,Integer returnType);
+    void chargebackEfastOrder(CustomerCommon customerCommon, SalesOrder salesOrder, Integer status, Integer returnType);
     /**
      * 添加仓储
      * @param customerCommon
@@ -142,13 +142,13 @@ public interface CustomerService {
      * 向Efast推送订单  仅换新,维修 ,补发
      * @return
      */
-    Map<String,Object> sendEfastOrder(CustomerCommon customerCommon,SalesOrder salesOrder);
+    Map<String,Object> sendEfastOrder(CustomerCommon customerCommon, SalesOrder salesOrder);
 
     /*查询问题个数*/
     Integer getQuestionNumber(CustomerInfo customerInfo);
 
     /*删除旧的售后信息*/
-    void deleteCustomerAfterSales(CustomerInfo customer,CmRelation cmRelation);
+    void deleteCustomerAfterSales(CustomerInfo customer, CmRelation cmRelation);
 
     Integer selectNotSolvedCustomer(CustomerInfo customer);
 
@@ -229,4 +229,6 @@ public interface CustomerService {
      * @return
      */
     CmRelation getCmRelationInfo(CmRelation cmRelation);
+
+    Integer updateRelation(CustomerInfo cm);
 }

+ 8 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/RelationOrderService.java

@@ -49,6 +49,14 @@ public interface RelationOrderService {
     Integer  deleteByRelationId(Integer  relationId);
 
     /**
+     * 删除数据 by relationId
+     * @param  relationOrder
+     * @return Integer
+     */
+    Integer  deleteByRelationOrder(RelationOrder  relationOrder);
+
+
+    /**
      * 增加数据 <集合>
      * @param  relationOrderList
      * @return Integer

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

@@ -46,7 +46,6 @@ public class CustomerCommonServiceImpl implements CustomerCommonService {
     @Autowired
     private SalesOrderMapper salesOrderMapper;
 
-
     @Override
     public CustomerCommon getListProduceAndFitting(CustomerCommon customerCommon) {
         ClosedProdcue closedProdcue = new ClosedProdcue();
@@ -81,6 +80,18 @@ public class CustomerCommonServiceImpl implements CustomerCommonService {
                 }
             }
             c.setSalesOrderList(orderList);
+
+            SendProdcue sendProdcue  = new SendProdcue();
+            sendProdcue.setRelationId(c.getRelationId());
+            sendProdcue.setSendProduceType(c.getCustomerIsSolve()); //sendProduceType
+            List<SendProdcue> sendProdcueList = sendProdcueMapper.listSendProdcue(sendProdcue);
+            c.setSendProdcues(sendProdcueList);
+
+            ClosedProdcue closedProdcue = new ClosedProdcue();
+            closedProdcue.setRelationId(c.getRelationId());
+            closedProdcue.setClosedProdcueType(c.getCustomerIsSolve());
+            List<ClosedProdcue> closedProdcueList = closedProdcueMapper.listclosedProdcue(closedProdcue);
+            c.setClosedProdcues(closedProdcueList);
         }
 
 //        List<CustomerCommon> customerCommonList = new ArrayList<>();

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

@@ -153,7 +153,7 @@ public class CustomerServiceImpl implements CustomerService {
         CmRelation cmRelation = customerInfo.getCmRelation();
         cmRelation.setCustomerId(customerInfo.getCustomerId());
         cmRelation.setRelationBackStatus(1); //寄回状态 1:未寄回
-        cmRelation.setRelationSendStatus(1); //寄送状态 1:未寄送
+        cmRelation.setRelationSendStatus(1); //寄送状态 1:未寄送x
         cmRelation.setRelationState(1); //状态  默认使用中
         //cmRelation.setTransactionNumber(customerInfo.getTransactionNumber());   //外部交易号
         // TODO: 2018/3/27 是否转账邮费,默认为不需要转账 : 0
@@ -302,10 +302,10 @@ public class CustomerServiceImpl implements CustomerService {
         customerService.setName(cr);
         logger.info("-----------修改客诉-初始化产品,配件信息--------------");
 
-        ComplaintDetectInfo complaintDetectInfo = new ComplaintDetectInfo();  //品质检测
-        ComplaintSignclosedInfo complaintSignclosedInfo = new ComplaintSignclosedInfo(); //客诉-签收表
-        Map<String,Object> map;
-        boolean isReturn = false;
+//        ComplaintDetectInfo complaintDetectInfo = new ComplaintDetectInfo();  //品质检测
+//        ComplaintSignclosedInfo complaintSignclosedInfo = new ComplaintSignclosedInfo(); //客诉-签收表
+//        Map<String,Object> map;
+//        boolean isReturn = false;
         logger.info("-----------修改客诉-创建仓储/品检成功--------------");
 
         flag = cmRelationMapper.update(cr);
@@ -1320,4 +1320,155 @@ public class CustomerServiceImpl implements CustomerService {
 //        return repair;
         return null;
     }
+
+
+    @Override
+    public Integer updateRelation(CustomerInfo customerInfo) {
+         /*
+        * 查询客诉
+        * 查询处理方式
+        * 查询订单
+        * 查询寄入寄出
+        *
+        * 删除订单
+        * 删除寄入寄出
+        *
+        * 添加处理方式
+        *
+        * 添加订单
+        * 添加寄入寄出
+        * */
+        CmRelation cmRelation = new CmRelation();
+        cmRelation.setCustomerId(customerInfo.getCustomerId());
+
+        CustomerCommon customerCommon = new CustomerCommon();
+        customerCommon.setCustomerId(customerInfo.getCustomerId());
+        List<CustomerCommon> customerCommonList = customerCommonService.listCustomerCommon(customerCommon);
+        if(customerCommonList != null && customerCommonList.size() > 0){
+            customerCommon = customerCommonList.get(0);
+            cmRelation.setRelationBackStatus(customerCommon.getRelationBackStatus());     //寄回状态 1:未寄回 2:已寄回 3:已收货 4: 已签收待确认
+            cmRelation.setRelationBackName(customerCommon.getRelationBackName());   //寄回人姓名
+            cmRelation.setRelationBackTel(customerCommon.getRelationBackTel());  //寄回人电话
+            cmRelation.setRelationBackLogisticsCompany(customerCommon.getRelationBackLogisticsCompany());   //寄回物流公司
+            cmRelation.setRelationBackLogisticsNo(customerCommon.getRelationBackLogisticsNo()); //寄回物流单号
+            cmRelation.setRelationBackPostage(customerCommon.getRelationBackPostage()); //寄回邮费 单位为分
+            cmRelation.setRelationSendStatus(customerCommon.getRelationSendStatus());   //寄送状态 1:未寄送 2:已寄送 3:已收货
+            cmRelation.setRelationSendName(customerCommon.getRelationSendName());//寄送人姓名
+            cmRelation.setRelationSendTel(customerCommon.getRelationSendTel());
+            cmRelation.setProvinceNumber(customerCommon.getProvinceNumber());   //寄送地址-省
+            cmRelation.setCityNumber(customerCommon.getCityNumber());   //寄送地址-市
+            cmRelation.setAreaNumber(customerCommon.getAreaNumber());   //寄送地址-区
+            cmRelation.setRelationSendMergeAddress(customerCommon.getRelationSendMergeAddress());    //寄送地址-省市区
+            cmRelation.setRelationSendAddress(customerCommon.getRelationSendAddress());  //寄送地址-详细地址
+            cmRelation.setRelationSendLogisticsCompany(customerCommon.getRelationSendLogisticsCompany());    //寄送物流公司
+            cmRelation.setRelationSendLogisticsNo(customerCommon.getRelationSendLogisticsNo());  //寄送物流单号
+            cmRelation.setRelationDesc(customerCommon.getRelationDesc());   //备注
+            cmRelation.setRelationState(1);//状态 1:使用中 2:停用中
+            cmRelation.setRelationAlipay(customerCommon.getRelationAlipay());   //转账账户
+            cmRelation.setRelationAlipayName(customerCommon.getRelationAlipayName()); //转账账户姓名
+            cmRelation.setRelationIsTransfer(customerCommon.getRelationIsTransfer());   //是否已转账邮费 0:不需要 1:已转 2:已申请待转 3:未申请
+            cmRelation.setRelationBackReceiptDate(customerCommon.getRelationBackReceiptDate()); //签收日期
+            cmRelation.setRelationFactoryCosts(customerCommon.getRelationFactoryCosts());//工厂维修报价
+            cmRelation.setRelationCustomerCosts(customerCommon.getRelationCustomerCosts());  //客户报价
+            cmRelation.setRelationCreateTime(customerCommon.getRelationCreateTime());
+            cmRelation.setRelationUpdateTime(customerCommon.getRelationUpdateTime());
+        }
+
+        Integer procMethodId;
+        switch (customerInfo.getCustomerIsSolve()){   //1:已解决  2:未解决 3:换新  4:维修 5:补发 6:退货 7:无理由退货     客诉修改
+            case 1:
+                procMethodId = 1;
+                cmRelation.setRelationBackStatus(1);     //寄回状态 1:未寄回 2:已寄回 3:已收货 4: 已签收待确认
+                cmRelation.setRelationSendStatus(1);   //寄送状态 1:未寄送 2:已寄送 3:已收货
+                break;
+            case 2:
+                procMethodId = 2;
+                cmRelation.setRelationBackStatus(1);     //寄回状态 1:未寄回 2:已寄回 3:已收货 4: 已签收待确认
+                cmRelation.setRelationSendStatus(1);   //寄送状态 1:未寄送 2:已寄送 3:已收货
+                break;
+            case 3:
+                procMethodId = 3;
+
+                break;
+            case 4:
+                procMethodId = 6;
+                break;
+            case 5:
+                procMethodId = 13;
+                cmRelation.setRelationBackStatus(1);     //寄回状态 1:未寄回 2:已寄回 3:已收货 4: 已签收待确认
+                break;
+            case 6:
+                procMethodId = 10;
+                cmRelation.setRelationSendStatus(1);   //寄送状态 1:未寄送 2:已寄送 3:已收货
+                break;
+            case 7:
+                procMethodId = 8;
+                cmRelation.setRelationSendStatus(1);   //寄送状态 1:未寄送 2:已寄送 3:已收货
+                break;
+            default:
+                procMethodId = 2;
+                cmRelation.setRelationBackStatus(1);     //寄回状态 1:未寄回 2:已寄回 3:已收货 4: 已签收待确认
+                cmRelation.setRelationSendStatus(1);   //寄送状态 1:未寄送 2:已寄送 3:已收货
+                break;
+        }
+        cmRelation.setProcMethodId(procMethodId);
+
+        //删除寄出寄回产品 -----
+        ClosedProdcue closedrecord = new ClosedProdcue();
+        SendProdcue sendProdcue = new SendProdcue();
+        closedrecord.setRelationId(customerCommon.getRelationId());
+        closedrecord.setClosedProdcueType(customerCommon.getCustomerIsSolve());
+        closedProdcueMapper.deleteProduce(closedrecord);
+        sendProdcue.setRelationId(customerCommon.getRelationId());
+        sendProdcue.setSendProduceType(customerCommon.getCustomerIsSolve());
+        sendProdcueMapper.deleteByPrimaryKey(sendProdcue);
+
+        /*恢复订单状态 ------------ */
+        RelationOrder relationOrder = new RelationOrder();
+        relationOrder.setRelationType(customerCommon.getCustomerIsSolve());
+        relationOrder.setRelationId(customerCommon.getRelationId());
+        List<RelationOrder> relationOrderList = relationOrderService.getRelationOrderList(relationOrder);
+        for (int k=0; k<relationOrderList.size();k++){
+            SalesOrder newOrder = new SalesOrder(); //salesOrderStatus
+            newOrder.setSalesId(relationOrderList.get(k).getSalesId());
+            newOrder.setSalesOrderStatus(procMethodId);
+            salesOrderMapper.updateSalesOrder(newOrder);
+        }
+
+        /* 删除掉订单与处理的关联表  ----------- */
+        RelationOrder rol = new RelationOrder();
+        rol.setRelationType(customerCommon.getCustomerIsSolve());
+        rol.setRelationId(customerCommon.getRelationId());
+        relationOrderService.deleteByRelationOrder(rol);
+
+        Integer flag = cmRelationMapper.save(cmRelation);
+        if (flag < 1) {
+            throw new RuntimeException("添加处理方式失败");
+        }
+
+        customerService.setName(cmRelation);
+
+        /*添加客诉-添加处理与订单关联表 ---------- */
+        List<RelationOrder> relationAndOrderList = new ArrayList<>();
+        for (RelationOrder sokk : relationOrderList) {
+            RelationOrder ro = new RelationOrder();
+            ro.setRelationId(cmRelation.getRelationId());
+            ro.setSalesId(sokk.getSalesId());
+            ro.setRelationCustomerId(customerInfo.getCustomerId());
+            relationAndOrderList.add(ro);
+        }
+
+        if(relationAndOrderList != null && relationAndOrderList.size() > 0){
+            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());
+        }
+        return flag;
+    }
 }

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

@@ -68,6 +68,11 @@ public class RelationOrderServiceImpl  implements RelationOrderService {
         return  relationOrderMapper.deleteByRelationId(relationId);
     }
 
+    @Override
+    public Integer deleteByRelationOrder(RelationOrder relationOrder) {
+        return  relationOrderMapper.deleteByRelationOrder(relationOrder);
+    }
+
     /**
      * 增加数据 <集合>
      * @param  relationOrderList

+ 7 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/RelationOrderMapper.java

@@ -49,6 +49,13 @@ public interface RelationOrderMapper {
     Integer  deleteByRelationId(Integer  relationId);
 
     /**
+     * 删除数据 by relationId
+     * @param  relationOrder
+     * @return Integer
+     */
+    Integer  deleteByRelationOrder(RelationOrder  relationOrder);
+
+    /**
      * 增加数据 <集合>
      * @param  relationOrderList
      * @return Integer

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

@@ -48,6 +48,9 @@
       <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>

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

@@ -190,7 +190,9 @@
         relation_alipay_name,
         relation_back_receipt_date,
         relation_factory_costs,
-        relation_customer_costs
+        relation_customer_costs,
+        relation_create_time,
+        relation_update_time
         )
         values
         (
@@ -223,7 +225,9 @@
         #{relationAlipayName},
         #{relationBackReceiptDate},
         #{relationFactoryCosts},
-        #{relationCustomerCosts}
+        #{relationCustomerCosts},
+        #{relationCreateTime},
+        #{relationUpdateTime}
         )
     </insert>
     <update id="update" parameterType="CmRelation" >

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

@@ -4,167 +4,177 @@
 
     <select id="listCustomerCommon" parameterType="CustomerCommon" resultType="CustomerCommon">
         SELECT
-            cc.*
+        cc.*
         FROM (
-            SELECT
-                '3' AS customerIsSolve,
-                renewed_id AS relationId,
-                customer_id AS customerId,
-                order_id AS  orderId,
-                signclosed_id AS signclosedId,
-                renewed_back_efast_order_id AS  relationBackEfastOrderId,
-                renewed_back_name AS  relationBackName,
-                renewed_back_tel AS  relationBackTel,
-                renewed_back_status  AS relationBackStatus,
-                renewed_back_receipt_date  AS relationBackReceiptDate,
-                renewed_back_logistics_company AS relationBackLogisticsCompany,
-                renewed_back_logistics_no AS relationBackLogisticsNo,
-                renewed_back_postage AS relationBackPostage,
-                renewed_back_machine_no AS  relationBackMachineNo,
-                renewed_send_status AS relationSendStatus,
-                renewed_send_name AS  relationSendName,
-                renewed_send_tel AS relationSendTel,
-                province_number AS provinceNumber,
-                city_number AS cityNumber,
-                area_number AS areaNumber,
-                renewed_send_merge_address AS relationSendMergeAddress,
-                renewed_send_address AS relationSendAddress,
-                renewed_send_logistics_company AS relationSendLogisticsCompany,
-                renewed_send_logistics_no AS relationSendLogisticsNo,
-                renewed_desc AS relationDesc,
-                renewed_state AS relationState,
-                renewed_alipay AS relationAlipay,
-                renewed_is_transfer AS relationIsTransfer,
-                renewed_alipay_name AS relationAlipayName
-            FROM tb_rst_renewed
-            UNION ALL
-            SELECT
-                '4' AS customerIsSolve,
-                repair_id AS relationId,
-                customer_id AS customerId,
-                order_id AS  orderId,
-                signclosed_id AS signclosedId,
-                repair_back_efast_order_id AS  relationBackEfastOrderId,
-                repair_back_name AS  relationBackName,
-                repair_back_tel AS  relationBackTel,
-                repair_back_status  AS relationBackStatus,
-                repair_back_receipt_date  AS relationBackReceiptDate,
-                repair_back_logistics_company AS relationBackLogisticsCompany,
-                repair_back_logistics_no AS relationBackLogisticsNo,
-                repair_back_postage AS relationBackPostage,
-                repair_back_machine_no AS  relationBackMachineNo,
-                repair_send_status AS relationSendStatus,
-                repair_send_name AS  relationSendName,
-                repair_send_tel AS relationSendTel,
-                province_number AS provinceNumber,
-                city_number AS cityNumber,
-                area_number AS areaNumber,
-                repair_send_merge_address AS relationSendMergeAddress,
-                repair_send_address AS relationSendAddress,
-                repair_send_logistics_company AS relationSendLogisticsCompany,
-                repair_send_logistics_no AS relationSendLogisticsNo,
-                repair_desc AS relationDesc,
-                repair_state AS relationState,
-                repair_alipay AS relationAlipay,
-                repair_is_transfer AS relationIsTransfer,
-                repair_alipay_name AS relationAlipayName
-            FROM tb_rst_repair
-            UNION ALL
-            SELECT
-                '5' AS customerIsSolve,
-                reissue_id AS relationId,
-                customer_id AS customerId,
-                order_id AS  orderId,
-                NULL AS signclosedId,
-                reissue_back_efast_order_id AS  relationBackEfastOrderId,
-                NULL AS  relationBackName,
-                NULL AS  relationBackTel,
-                NULL  AS relationBackStatus,
-                NULL  AS relationBackReceiptDate,
-                NULL AS relationBackLogisticsCompany,
-                NULL AS relationBackLogisticsNo,
-                NULL AS relationBackPostage,
-                NULL AS  relationBackMachineNo,
-                reissue_send_status AS relationSendStatus,
-                reissue_send_name AS  relationSendName,
-                reissue_send_tel AS relationSendTel,
-                province_number AS provinceNumber,
-                city_number AS cityNumber,
-                area_number AS areaNumber,
-                reissue_send_merge_address AS relationSendMergeAddress,
-                reissue_send_address AS relationSendAddress,
-                reissue_send_logistics_company AS relationSendLogisticsCompany,
-                reissue_send_logistics_no AS relationSendLogisticsNo,
-                reissue_desc AS relationDesc,
-                reissue_state AS relationState,
-                NULL AS relationAlipay,
-                NULL AS relationIsTransfer,
-                NULL AS relationAlipayName
-            FROM tb_rst_reissue
-            UNION ALL
-            SELECT
-                '6' AS customerIsSolve,
-                back_goods_id AS relationId,
-                customer_id AS customerId,
-                order_id AS  orderId,
-                signclosed_id AS signclosedId,
-                NULL AS  relationBackEfastOrderId,
-                back_goods_back_name AS  relationBackName,
-                back_goods_back_tel AS  relationBackTel,
-                back_goods_back_status  AS relationBackStatus,
-                back_goods_back_receipt_date  AS relationBackReceiptDate,
-                back_goods_back_logistics_company AS relationBackLogisticsCompany,
-                back_goods_back_logistics_no AS relationBackLogisticsNo,
-                back_goods_back_postage AS relationBackPostage,
-                back_goods_back_machine_no AS  relationBackMachineNo,
-                NULL AS relationSendStatus,
-                NULL AS  relationSendName,
-                NULL AS relationSendTel,
-                NULL AS provinceNumber,
-                NULL AS cityNumber,
-                NULL AS areaNumber,
-                NULL AS relationSendMergeAddress,
-                NULL AS relationSendAddress,
-                NULL AS relationSendLogisticsCompany,
-                NULL AS relationSendLogisticsNo,
-                back_goods_desc AS relationDesc,
-                back_goods_state AS relationState,
-                back_goods_alipay AS relationAlipay,
-                back_goods_is_transfer AS relationIsTransfer,
-                back_goods_alipay_name AS relationAlipayName
-            FROM tb_rst_back_goods
-            UNION ALL
-            SELECT
-                '7' AS customerIsSolve,
-                noreason_back_id AS relationId,
-                customer_id AS customerId,
-                order_id AS  orderId,
-                signclosed_id AS signclosedId,
-                NULL AS  relationBackEfastOrderId,
-                noreason_back_back_name AS  relationBackName,
-                noreason_back_back_tel AS  relationBackTel,
-                noreason_back_back_status  AS relationBackStatus,
-                noreason_back_receipt_date  AS relationBackReceiptDate,
-                noreason_back_back_logistics_company AS relationBackLogisticsCompany,
-                noreason_back_back_logistics_no AS relationBackLogisticsNo,
-                noreason_back_back_postage AS relationBackPostage,
-                noreason_back_back_machine_no AS  relationBackMachineNo,
-                NULL AS relationSendStatus,
-                NULL AS  relationSendName,
-                NULL AS relationSendTel,
-                NULL AS provinceNumber,
-                NULL AS cityNumber,
-                NULL AS areaNumber,
-                NULL AS relationSendMergeAddress,
-                NULL AS relationSendAddress,
-                NULL AS relationSendLogisticsCompany,
-                NULL AS relationSendLogisticsNo,
-                noreason_back_desc AS relationDesc,
-                noreason_back_state AS relationState,
-                noreason_back_alipay AS relationAlipay,
-                noreason_back_is_transfer AS relationIsTransfer,
-                noreason_back_alipay_name AS relationAlipayName
-            FROM tb_rst_noreason_back
+        SELECT
+        '3' AS customerIsSolve,
+        renewed_id AS relationId,
+        customer_id AS customerId,
+        order_id AS  orderId,
+        signclosed_id AS signclosedId,
+        renewed_back_efast_order_id AS  relationBackEfastOrderId,
+        renewed_back_name AS  relationBackName,
+        renewed_back_tel AS  relationBackTel,
+        renewed_back_status  AS relationBackStatus,
+        renewed_back_receipt_date  AS relationBackReceiptDate,
+        renewed_back_logistics_company AS relationBackLogisticsCompany,
+        renewed_back_logistics_no AS relationBackLogisticsNo,
+        renewed_back_postage AS relationBackPostage,
+        renewed_back_machine_no AS  relationBackMachineNo,
+        renewed_send_status AS relationSendStatus,
+        renewed_send_name AS  relationSendName,
+        renewed_send_tel AS relationSendTel,
+        province_number AS provinceNumber,
+        city_number AS cityNumber,
+        area_number AS areaNumber,
+        renewed_send_merge_address AS relationSendMergeAddress,
+        renewed_send_address AS relationSendAddress,
+        renewed_send_logistics_company AS relationSendLogisticsCompany,
+        renewed_send_logistics_no AS relationSendLogisticsNo,
+        renewed_desc AS relationDesc,
+        renewed_state AS relationState,
+        renewed_alipay AS relationAlipay,
+        renewed_is_transfer AS relationIsTransfer,
+        renewed_alipay_name AS relationAlipayName,
+        renewed_create_time AS  relationCreateTime,
+        renewed_update_time AS  relationUpdateTime
+        FROM tb_rst_renewed
+        UNION ALL
+        SELECT
+        '4' AS customerIsSolve,
+        repair_id AS relationId,
+        customer_id AS customerId,
+        order_id AS  orderId,
+        signclosed_id AS signclosedId,
+        repair_back_efast_order_id AS  relationBackEfastOrderId,
+        repair_back_name AS  relationBackName,
+        repair_back_tel AS  relationBackTel,
+        repair_back_status  AS relationBackStatus,
+        repair_back_receipt_date  AS relationBackReceiptDate,
+        repair_back_logistics_company AS relationBackLogisticsCompany,
+        repair_back_logistics_no AS relationBackLogisticsNo,
+        repair_back_postage AS relationBackPostage,
+        repair_back_machine_no AS  relationBackMachineNo,
+        repair_send_status AS relationSendStatus,
+        repair_send_name AS  relationSendName,
+        repair_send_tel AS relationSendTel,
+        province_number AS provinceNumber,
+        city_number AS cityNumber,
+        area_number AS areaNumber,
+        repair_send_merge_address AS relationSendMergeAddress,
+        repair_send_address AS relationSendAddress,
+        repair_send_logistics_company AS relationSendLogisticsCompany,
+        repair_send_logistics_no AS relationSendLogisticsNo,
+        repair_desc AS relationDesc,
+        repair_state AS relationState,
+        repair_alipay AS relationAlipay,
+        repair_is_transfer AS relationIsTransfer,
+        repair_alipay_name AS relationAlipayName,
+        repair_create_time AS  relationCreateTime,
+        repair_update_time AS  relationUpdateTime
+        FROM tb_rst_repair
+        UNION ALL
+        SELECT
+        '5' AS customerIsSolve,
+        reissue_id AS relationId,
+        customer_id AS customerId,
+        order_id AS  orderId,
+        NULL AS signclosedId,
+        reissue_back_efast_order_id AS  relationBackEfastOrderId,
+        NULL AS  relationBackName,
+        NULL AS  relationBackTel,
+        NULL  AS relationBackStatus,
+        NULL  AS relationBackReceiptDate,
+        NULL AS relationBackLogisticsCompany,
+        NULL AS relationBackLogisticsNo,
+        NULL AS relationBackPostage,
+        NULL AS  relationBackMachineNo,
+        reissue_send_status AS relationSendStatus,
+        reissue_send_name AS  relationSendName,
+        reissue_send_tel AS relationSendTel,
+        province_number AS provinceNumber,
+        city_number AS cityNumber,
+        area_number AS areaNumber,
+        reissue_send_merge_address AS relationSendMergeAddress,
+        reissue_send_address AS relationSendAddress,
+        reissue_send_logistics_company AS relationSendLogisticsCompany,
+        reissue_send_logistics_no AS relationSendLogisticsNo,
+        reissue_desc AS relationDesc,
+        reissue_state AS relationState,
+        NULL AS relationAlipay,
+        NULL AS relationIsTransfer,
+        NULL AS relationAlipayName,
+        reissue_create_time AS  relationCreateTime,
+        reissue_update_time AS  relationUpdateTime
+        FROM tb_rst_reissue
+        UNION ALL
+        SELECT
+        '6' AS customerIsSolve,
+        back_goods_id AS relationId,
+        customer_id AS customerId,
+        order_id AS  orderId,
+        signclosed_id AS signclosedId,
+        NULL AS  relationBackEfastOrderId,
+        back_goods_back_name AS  relationBackName,
+        back_goods_back_tel AS  relationBackTel,
+        back_goods_back_status  AS relationBackStatus,
+        back_goods_back_receipt_date  AS relationBackReceiptDate,
+        back_goods_back_logistics_company AS relationBackLogisticsCompany,
+        back_goods_back_logistics_no AS relationBackLogisticsNo,
+        back_goods_back_postage AS relationBackPostage,
+        back_goods_back_machine_no AS  relationBackMachineNo,
+        NULL AS relationSendStatus,
+        NULL AS  relationSendName,
+        NULL AS relationSendTel,
+        NULL AS provinceNumber,
+        NULL AS cityNumber,
+        NULL AS areaNumber,
+        NULL AS relationSendMergeAddress,
+        NULL AS relationSendAddress,
+        NULL AS relationSendLogisticsCompany,
+        NULL AS relationSendLogisticsNo,
+        back_goods_desc AS relationDesc,
+        back_goods_state AS relationState,
+        back_goods_alipay AS relationAlipay,
+        back_goods_is_transfer AS relationIsTransfer,
+        back_goods_alipay_name AS relationAlipayName,
+        back_goods_create_time AS  relationCreateTime,
+        back_goods_update_time AS  relationUpdateTime
+        FROM tb_rst_back_goods
+        UNION ALL
+        SELECT
+        '7' AS customerIsSolve,
+        noreason_back_id AS relationId,
+        customer_id AS customerId,
+        order_id AS  orderId,
+        signclosed_id AS signclosedId,
+        NULL AS  relationBackEfastOrderId,
+        noreason_back_back_name AS  relationBackName,
+        noreason_back_back_tel AS  relationBackTel,
+        noreason_back_back_status  AS relationBackStatus,
+        noreason_back_receipt_date  AS relationBackReceiptDate,
+        noreason_back_back_logistics_company AS relationBackLogisticsCompany,
+        noreason_back_back_logistics_no AS relationBackLogisticsNo,
+        noreason_back_back_postage AS relationBackPostage,
+        noreason_back_back_machine_no AS  relationBackMachineNo,
+        NULL AS relationSendStatus,
+        NULL AS  relationSendName,
+        NULL AS relationSendTel,
+        NULL AS provinceNumber,
+        NULL AS cityNumber,
+        NULL AS areaNumber,
+        NULL AS relationSendMergeAddress,
+        NULL AS relationSendAddress,
+        NULL AS relationSendLogisticsCompany,
+        NULL AS relationSendLogisticsNo,
+        noreason_back_desc AS relationDesc,
+        noreason_back_state AS relationState,
+        noreason_back_alipay AS relationAlipay,
+        noreason_back_is_transfer AS relationIsTransfer,
+        noreason_back_alipay_name AS relationAlipayName,
+        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
         <where>
@@ -184,7 +194,7 @@
                 and cc.relationId = #{relationId}
             </if>
         </where>
-  </select>
+    </select>
 
 
     <select id="listCustomerCommonByStatus" parameterType="CustomerCommon" resultType="Integer">

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

@@ -92,6 +92,14 @@
         where relation_id=#{relationId}
     </delete>
 
+    <delete id="deleteByRelationOrder" parameterType="Integer" >
+        delete FROM
+        tb_rst_cm_relation_order
+        where
+              relation_id=#{relationId}
+        AND relation_type =#{relationType}
+    </delete>
+
     <insert id="saveList" parameterType="java.util.List" >
         insert into
         tb_rst_cm_relation_order

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

@@ -48,6 +48,9 @@
       <if test="relationId != null and relationId != ''">
         and relation_id = #{relationId}
       </if>
+      <if test="sendProduceType != null and sendProduceType != ''">
+        and send_produce_type = #{sendProduceType}
+      </if>
     </where>
   </delete>
 

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

@@ -3,10 +3,7 @@ package com.iamberry.rst.controllers.cm;
 import com.iamberry.rst.core.cm.*;
 import com.iamberry.rst.core.order.ProductColor;
 import com.iamberry.rst.core.page.PagedResult;
-import com.iamberry.rst.faces.cm.ComplaintQuestionInfoService;
-import com.iamberry.rst.faces.cm.CustomerCommonService;
-import com.iamberry.rst.faces.cm.RelationOrderService;
-import com.iamberry.rst.faces.cm.SalesOrderService;
+import com.iamberry.rst.faces.cm.*;
 import com.iamberry.rst.faces.kdn.KuaiDiNiaoService;
 import com.iamberry.rst.faces.order.EfastOrderService;
 import com.iamberry.rst.faces.product.ProductService;
@@ -63,6 +60,8 @@ public class AppComplaintQuestionInfoController {
     private SeleOrdeCompUtil seleOrdeCompUtil;
     @Autowired
     private KuaiDi100 kuaiDi100;
+    @Autowired
+    private CustomerService customerService;
 
     /**
      * 进入客诉问题描述
@@ -416,6 +415,46 @@ 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;
+    }
+
 
 
 }