Browse Source

客诉修改

wangxiaoming 6 years ago
parent
commit
5d4ed82625

+ 2 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ClosedProdcue.java

@@ -38,10 +38,12 @@ public class ClosedProdcue  implements Serializable {
         this.closedProductName = closedProductName;
     }
 
+    @Deprecated
     public Integer getClosedProdcueType() {
         return closedProdcueType;
     }
 
+    @Deprecated
     public void setClosedProdcueType(Integer closedProdcueType) {
         this.closedProdcueType = closedProdcueType;
     }

+ 0 - 1
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CmRelation.java

@@ -93,7 +93,6 @@ public class CmRelation implements  Serializable{
 
     /*订单关联集合*/
     private List<RelationOrder> relationOrderList = new ArrayList<>();
-
     /*订单集合*/
     private List<SalesOrder> salesOrderList = new ArrayList<>();
 

+ 15 - 1
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerInfo.java

@@ -39,6 +39,7 @@ public class CustomerInfo  implements Serializable {
     // 微信昵称
     private String customerWechatName;
     //  处理结果: 1:已解决  2:未解决 3:换新  4:维修 5:补发 6:退货 7:无理由退货
+    @Deprecated
     private Integer customerIsSolve;
     //  是否需要回访  1:不需要回访  2:需要回复 
     private String customerIsVisit;
@@ -129,6 +130,7 @@ public class CustomerInfo  implements Serializable {
 
     private Visit visit = new Visit();  //回访类
 
+    @Deprecated
     private CustomerCommon customerCommon = new CustomerCommon(); //处理结果综合  公共类
 
     private CmRelation cmRelation = new CmRelation();
@@ -434,10 +436,22 @@ public class CustomerInfo  implements Serializable {
         this.customerTel = customerTel;
     }
 
+
+
+    /**
+     * 不维护此字段
+     * @param
+     */
+    @Deprecated
     public Integer getCustomerIsSolve() {
         return customerIsSolve;
     }
 
+    /**
+     * 请使用
+     * @param customerIsSolve
+     */
+    @Deprecated
     public void setCustomerIsSolve(Integer customerIsSolve) {
         this.customerIsSolve = customerIsSolve;
     }
@@ -508,7 +522,7 @@ public class CustomerInfo  implements Serializable {
 
     /**
      * 请使用 getCmRelation
-     * @param customerCommon
+     * @param
      */
     @Deprecated
     public CustomerCommon getCustomerCommon() {

+ 2 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/RelationOrder.java

@@ -27,10 +27,12 @@ public class RelationOrder  implements  Serializable{
         this.relationOrderId=relationOrderId;
     }
 
+    @Deprecated
     public Integer getRelationType(){
         return relationType;
     }
 
+    @Deprecated
     public void setRelationType(Integer  relationType){
         this.relationType=relationType;
     }

+ 1 - 1
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/SalesOrder.java

@@ -57,7 +57,7 @@ public class SalesOrder implements Serializable {
     private Integer salesCompanyId;         //销售公司id
     private Integer salesType;              //订单类型  1:购买2:租赁
     private String salesDealCode;           //交易号
-    private Integer salesOrderStatus;       //订单状态 订单状态:1:正常 2:换货 3:退货  4:维修  5:补发
+    private Integer salesOrderStatus;       //订单状态 订单状态:1:正常 2:换货 3:退货  4:维修  5:补发 -- TODO: 2019/1/4 改为 ProcTypeId
     private Integer salesShippingStatus;    //发货状态 0(未发货)1(已发货,即已扫描出库)3(备货中)4(收货) 11(已通知配货,后加)
     private Integer salesDeliver;            //出库状态  1:未出库   2:已出库
     private Date salesDeliverTime;            //出库时间

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

@@ -17,6 +17,7 @@ public class SendProdcue  implements Serializable {
 
     private Integer sendProdcueNumber;      //产品数量
 
+    @Deprecated
     private Integer sendProduceType;    //售后类型  3:换新;4:维修;5:补发;6:退货;7:无理由退货
 
     private String sendProduceName; //产品名称
@@ -37,10 +38,12 @@ public class SendProdcue  implements Serializable {
         this.sendProduceName = sendProduceName;
     }
 
+    @Deprecated
     public Integer getSendProduceType() {
         return sendProduceType;
     }
 
+    @Deprecated
     public void setSendProduceType(Integer sendProduceType) {
         this.sendProduceType = sendProduceType;
     }

+ 4 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/CustomerService.java

@@ -112,6 +112,10 @@ public interface CustomerService {
     ProductType getcompanyAffiliation(Integer customerId);
 
     /*设置产品,配件参数*/
+    void setName(CmRelation cr);
+
+    /*设置产品,配件参数*/
+    @Deprecated
     void setName(CustomerCommon cc);
     /**
      * 将原订单生成退货单

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

@@ -9,6 +9,7 @@ import com.iamberry.rst.core.order.*;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.faces.cm.CustomerCommonService;
 import com.iamberry.rst.faces.cm.CustomerService;
+import com.iamberry.rst.faces.cm.ProcMethodService;
 import com.iamberry.rst.faces.cm.RelationOrderService;
 import com.iamberry.rst.faces.order.EfastOrderService;
 import com.iamberry.rst.service.address.mapper.AddressMapper;
@@ -81,6 +82,10 @@ public class CustomerServiceImpl implements CustomerService {
     private CustomerCommonService customerCommonService;
     @Autowired
     private RelationOrderService relationOrderService;
+    @Autowired
+    private ProcMethodService procMethodService;
+    @Autowired
+    private CmRelationMapper cmRelationMapper;
 
     @Override
     public CustomerInfo getCustomerInfo(Integer customerId) {
@@ -130,156 +135,72 @@ public class CustomerServiceImpl implements CustomerService {
             logger.info("-----------添加客诉-添加客诉回访信息---------------");
         }
 
-        if (2 == customerInfo.getCustomerCounselType() &&
-                (customerInfo.getCustomerIsSolve() == 3 || customerInfo.getCustomerIsSolve() == 4 || customerInfo.getCustomerIsSolve() == 5 ||
-                customerInfo.getCustomerIsSolve() == 6 || customerInfo.getCustomerIsSolve() == 7)
-                ){
-
+        ProcMethod procMethod = procMethodService.getProcMethodById(customerInfo.getProcMethodId());
+        if (2 == customerInfo.getCustomerCounselType() && (procMethod.getProcMethodIsBack()==1||procMethod.getProcMethodIsSend()==1)){
             if(isNeedSelectOrder == 1){
                 SalesOrder so = new SalesOrder();
                 if(salesOrder.getIds()!= null && salesOrder.getIds().indexOf("_") > -1){
                     String[] salesIds = salesOrder.getIds().split("_");
                     so.setSalesIds(salesIds);
                     orderList = salesOrderMapper.listSalesOrder(so);
-                    logger.info("-----------添加客诉-查询订单--------------");
                     if(orderList == null || orderList.size() < 1){
-                        logger.info("-----------添加客诉-订单为空-请重新添加订单 --------------");
                         throw new RuntimeException("添加客诉-订单为空-请重新添加订单");
                     }
+                }else{
+                    throw new RuntimeException("添加客诉-订单为空-请重新添加订单");
                 }
             }
-
-            CustomerCommon customerCommon = customerInfo.getCustomerCommon();
-            customerCommon.setCustomerId(customerInfo.getCustomerId()); //设置客诉id
-            customerCommon.setRelationBackStatus(1); //寄回状态 1:未寄回
-            customerCommon.setRelationSendStatus(1); //寄送状态 1:未寄送
-            customerCommon.setRelationState(1); //状态  默认使用中
-            customerCommon.setTransactionNumber(customerInfo.getTransactionNumber());   //外部交易号
-
+            logger.info("-----------添加客诉-添加订单 --------------");
+
+            CmRelation cmRelation = customerInfo.getCmRelation();
+            cmRelation.setCustomerId(customerInfo.getCustomerId());
+            cmRelation.setRelationBackStatus(1); //寄回状态 1:未寄回
+            cmRelation.setRelationSendStatus(1); //寄送状态 1:未寄送
+            cmRelation.setRelationState(1); //状态  默认使用中
+            //cmRelation.setTransactionNumber(customerInfo.getTransactionNumber());   //外部交易号
             // TODO: 2018/3/27 是否转账邮费,默认为不需要转账 : 0
-            customerCommon.setRelationIsTransfer(0);    //是否已转账邮费
-            customerCommon.setRelationBackPostage(0);   //邮费默认为0
+            cmRelation.setRelationIsTransfer(0);    //是否已转账邮费
+            cmRelation.setRelationBackPostage(0);   //邮费默认为0
+            cmRelation.setRelationBackName(cmRelation.getRelationSendName()); //姓名
+            cmRelation.setRelationBackTel(cmRelation.getRelationSendTel()); //电话号码
 
-            customerCommon.setRelationBackName(customerCommon.getRelationSendName()); //姓名
-            customerCommon.setRelationBackTel(customerCommon.getRelationSendTel()); //电话号码
-
-            /*  初始化产品类型,名称,配件名称 */
-            customerService.setName(customerCommon);
+             /*  初始化产品类型,名称,配件名称 */
+            customerService.setName(cmRelation);
             logger.info("-----------添加客诉-初始化产品,配件信息--------------");
 
             ComplaintDetectInfo complaintDetectInfo = new ComplaintDetectInfo();  //品质检测
             ComplaintSignclosedInfo complaintSignclosedInfo = new ComplaintSignclosedInfo(); //客诉-签收表
-            Map<String,Object> map;
-            boolean isReturn = false;
-            switch (customerInfo.getCustomerIsSolve()) {  //处理结果: 1:已解决  2:未解决 3:换新  4:维修 5:补发 6:退货 7:无理由退货
-                case 3: //换新
-//                    customerService.chargebackEfastOrder(customerCommon,salesOrder,2);    //原订单生成退单
-//                    map = customerService.sendEfastOrder(customerCommon,salesOrder);  //换新需要向Efast推送一条换新发货的订单
-//                    if(map.get("status") == 1){
-//                        customerCommon.setRelationBackEfastOrderId(String.valueOf(map.get("EfastOrderId")));  //存放Efast订单编号
-//                        complaintSignclosedInfo.setNewEfastId(String.valueOf(map.get("EfastOrderId")));     //仓储签收表添加  发货的Efast订单id
-//                    }else{
-//                        throw new RuntimeException("换新创建Efast订单失败");
-//                    }
-                    //complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());    //原有订单的Efast的订单编号
-                    //customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);//创建仓储任务
-                    //complaintDetectInfo.setSignclosedId(complaintSignclosedInfo.getSignclosedId()); //设置仓储签收id
-                    //customerService.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);   //创建品检
-                    break;
-                case 4: //维修
-//                    customerService.chargebackEfastOrder(customerCommon,salesOrder,2);    //原订单生成退单
-//                    map = customerService.sendEfastOrder(customerCommon,salesOrder);  //维修需要向Efast推送一条维修发货的订单
-//                    if(map.get("status") == 1){
-//                        customerCommon.setRelationBackEfastOrderId(String.valueOf(map.get("EfastOrderId")));  //存放Efast订单编号
-//                        complaintSignclosedInfo.setNewEfastId(String.valueOf(map.get("EfastOrderId")));     //仓储签收表添加  发货的Efast订单id
-//                    }else{
-//                        throw new RuntimeException("维修创建Efast订单失败");
-//                    }
-                    //complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());    //原有订单的Efast的订单编号
-                    //customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);//创建仓储任务
-                    //complaintDetectInfo.setSignclosedId(complaintSignclosedInfo.getSignclosedId()); //设置仓储签收id
-                    //customerService.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);   //创建品检
-                    break;
-                case 5: //补发  不用创建仓储签收任务
-//                    map = customerService.sendEfastOrder(customerCommon,salesOrder);  //补发需要向Efast推送一条发货的订单
-//                    if(map.get("status") == 1){
-//                        customerCommon.setRelationBackEfastOrderId(String.valueOf(map.get("EfastOrderId")));  //存放Efast订单编号
-//                        complaintSignclosedInfo.setNewEfastId(String.valueOf(map.get("EfastOrderId")));     //仓储签收表添加  发货的Efast订单id
-//                    }else{
-//                        throw new RuntimeException("补发创建Efast订单失败");
-//                    }
-                    break;
-                case 6: //退货
-
-//                   customerService.chargebackEfastOrder(customerCommon,salesOrder,3);    //原订单生成退单
 
-                    //complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());    //原有订单的Efast的订单编号
-                    //customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);//创建仓储任务
-                    //complaintDetectInfo.setSignclosedId(complaintSignclosedInfo.getSignclosedId()); //设置仓储签收id
-                    //customerService.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);   //创建品检
-                    break;
-                case 7: //无理由退货
-
-//                   customerService.chargebackEfastOrder(customerCommon,salesOrder,3);    //原订单生成退单
-
-                    //complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());    //原有订单的Efast的订单编号
-                    //customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);//创建仓储任务
-                    //complaintDetectInfo.setSignclosedId(complaintSignclosedInfo.getSignclosedId()); //设置仓储签收id
-                    //customerService.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);   //创建品检
-                    break;
+      /*       Map<String,Object> map;
+           customerService.chargebackEfastOrder(customerCommon,salesOrder,2);    //原订单生成退单
+            map = customerService.sendEfastOrder(customerCommon,salesOrder);  //换新需要向Efast推送一条换新发货的订单
+            if(map.get("status") == 1){
+                customerCommon.setRelationBackEfastOrderId(String.valueOf(map.get("EfastOrderId")));  //存放Efast订单编号
+                complaintSignclosedInfo.setNewEfastId(String.valueOf(map.get("EfastOrderId")));     //仓储签收表添加  发货的Efast订单id
+            }else{
+                throw new RuntimeException("换新创建Efast订单失败");
             }
-            logger.info("-----------添加客诉-创建仓储/品检成功--------------");
-            customerCommon.setSignclosedId(complaintSignclosedInfo.getSignclosedId()); //设置仓储id
+            complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());    //原有订单的Efast的订单编号
+            customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);//创建仓储任务
+            complaintDetectInfo.setSignclosedId(complaintSignclosedInfo.getSignclosedId()); //设置仓储签收id
+            customerService.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);   //创建品检*/
 
+            logger.info("-----------添加客诉-创建仓储/品检成功--------------");
 
-            /*将公共的对象 转换换新/维修/退款等*/
-            Object object = CustomerCommonUtil.getRelation(customerInfo.getCustomerIsSolve(), customerCommon);
+            cmRelation.setSignclosedId(complaintSignclosedInfo.getSignclosedId()); //设置仓储id
 
-            Integer relationId = 0;
-            Integer orderStatus = 1;
-//            switch (customerInfo.getCustomerIsSolve()) {  //处理结果: 1:已解决  2:未解决 3:换新  4:维修 5:补发 6:退货 7:无理由退货
-//                case 3: //换新
-//                    Renewed renewed = (Renewed) object;
-//                    flag = renewedMapper.insert(renewed);
-//                    relationId = renewed.getRenewedId();
-//                    orderStatus = 2;
-//                    break;
-//                case 4: //维修
-//                    Repair repair = (Repair) object;
-//                    flag = repairMapper.insert(repair);
-//                    relationId = repair.getRepairId();
-//                    orderStatus = 4;
-//                    break;
-//                case 5: //补发
-//                    Reissue reissue = (Reissue) object;
-//                    flag = reissueMapper.insert(reissue);
-//                    relationId = reissue.getReissueId();
-//                    orderStatus = 5;
-//                    break;
-//                case 6: //退货
-//                    BackGoods backGoods = (BackGoods) object;
-//                    flag = backGoodsMapper.insert(backGoods);
-//                    relationId = backGoods.getBackGoodsId();
-//                    orderStatus = 3;
-//                    break;
-//                case 7: //无理由退货
-//                    NoreasonBack noreasonBack = (NoreasonBack) object;
-//                    flag = noreasonBackMapper.insert(noreasonBack);
-//                    relationId = noreasonBack.getNoreasonBackId();
-//                    orderStatus = 3;
-//                    break;
-//            }
+            /*添加处理方式*/
+            flag = cmRelationMapper.save(cmRelation);
             if (flag < 1) {
                 throw new RuntimeException("添加客诉处理结果失败");
             }
-            logger.info("-----------添加客诉-添加换新/维修/补发/退货/无理由退货信息成功--------------");
+            logger.info("-----------添加客诉-添加客诉处理成功--------------");
 
             /*添加客诉-添加处理与订单关联表*/
             List<RelationOrder> relationOrderList = new ArrayList<>();
             for (SalesOrder sor : orderList) {
                 RelationOrder ro = new RelationOrder();
-                ro.setRelationType(customerInfo.getCustomerIsSolve());
-                ro.setRelationId(relationId);
+                ro.setRelationId(cmRelation.getRelationId());
                 ro.setSalesId(sor.getSalesId());
                 ro.setRelationCustomerId(customerInfo.getCustomerId());
                 relationOrderList.add(ro);
@@ -290,26 +211,24 @@ public class CustomerServiceImpl implements CustomerService {
                     throw new RuntimeException("添加客诉,关联订单失败");
                 }
             }
+            logger.info("-----------添加客诉-添加处理与订单关联表--------------");
 
             for (SalesOrder sor : orderList) {
                 SalesOrder newOrder = new SalesOrder(); //salesOrderStatus
                 newOrder.setSalesId(sor.getSalesId());
-                newOrder.setSalesOrderStatus(orderStatus);
+                newOrder.setSalesOrderStatus(procMethod.getProcTypeId());
                 flag = salesOrderMapper.updateSalesOrder(newOrder);
                 if(flag < 1){
                     throw new RuntimeException("添加客诉,修改订单失败");
                 }
             }
-            logger.info("-----------添加客诉-添加处理与订单关联表--------------");
-
-            customerCommon.setRelationId(relationId);
-            CustomerCommonUtil.setProduceOrFitting(customerInfo.getCustomerIsSolve(),customerCommon);
-
-            if(customerCommon.getClosedProdcues() != null && customerCommon.getClosedProdcues().size()>0){
-                closedProdcueMapper.insert(customerCommon.getClosedProdcues());
+            logger.info("-----------添加客诉-修改订单--------------");
+            CustomerCommonUtil.setProduceOrFitting(cmRelation);
+            if(cmRelation.getClosedProdcues() != null && cmRelation.getClosedProdcues().size()>0){
+                closedProdcueMapper.insert(cmRelation.getClosedProdcues());
             }
-            if(customerCommon.getSendProdcues() != null && customerCommon.getSendProdcues().size() > 0){
-                sendProdcueMapper.insert(customerCommon.getSendProdcues());
+            if(cmRelation.getSendProdcues() != null && cmRelation.getSendProdcues().size() > 0){
+                sendProdcueMapper.insert(cmRelation.getSendProdcues());
             }
             logger.info("-----------添加客诉-寄回寄出产品配件成功--------------");
         }
@@ -821,53 +740,43 @@ public class CustomerServiceImpl implements CustomerService {
 
     /**
      * 产品配件初始化
-     * @param cc
+     * @param cr
      */
+    @Override
     @Transactional
-    public void setName(CustomerCommon cc){
-        for (int i=0;i<cc.getSendProdcues().size();i++) {
-            ProductColor productColor = productMapper.getProductBySku(cc.getSendProdcues().get(i).getColorBar());
-            cc.getSendProdcues().get(i).setProductColor(productColor);
-            cc.getSendProdcues().get(i).setColorId(productColor.getColorId());
-
+    public void setName(CmRelation cr) {
+        for (int i=0;i<cr.getSendProdcues().size();i++) {
+            ProductColor productColor = productMapper.getProductBySku(cr.getSendProdcues().get(i).getColorBar());
+            cr.getSendProdcues().get(i).setProductColor(productColor);
+            cr.getSendProdcues().get(i).setColorId(productColor.getColorId());
             Product product = productMapper.getProduce(productColor.getColorProductId());
-            cc.getSendProdcues().get(i).setProductId(product.getProductId());
-            cc.getSendProdcues().get(i).setSendProduceName(product.getProductName());
-            cc.getSendProdcues().get(i).setProductType(product.getProductType());
-            cc.getSendProdcues().get(i).setProductNumber(product.getProductNumber());
-        }
-        for (int i=0;i<cc.getSendFittings().size();i++) {
-            FittingsInfo fittingsInfo = productMapper.getFittingsBySku( cc.getSendFittings().get(i).getColorBar());
-            cc.getSendFittings().get(i).setFittingsId(fittingsInfo.getFittingsId());
-            cc.getSendFittings().get(i).setProductId(fittingsInfo.getFittingsId());
-            cc.getSendFittings().get(i).setSendFittingsName(fittingsInfo.getFittingsName());
-
-            Product product = productMapper.getProduce(fittingsInfo.getProductId());
-            cc.getSendFittings().get(i).setSendFittingsName(product.getProductName());
+            cr.getSendProdcues().get(i).setProductId(product.getProductId());
+            cr.getSendProdcues().get(i).setSendProduceName(product.getProductName());
+            cr.getSendProdcues().get(i).setProductType(product.getProductType());
+            cr.getSendProdcues().get(i).setProductNumber(product.getProductNumber());
         }
-        for (int i=0;i<cc.getClosedProdcues().size();i++) {
-            ProductColor productColor = productMapper.getProductBySku(cc.getClosedProdcues().get(i).getColorBar());
-            cc.getClosedProdcues().get(i).setProductColor(productColor);
-            cc.getClosedProdcues().get(i).setColorId(productColor.getColorId());
-
+        for (int i=0;i<cr.getClosedProdcues().size();i++) {
+            ProductColor productColor = productMapper.getProductBySku(cr.getClosedProdcues().get(i).getColorBar());
+            cr.getClosedProdcues().get(i).setProductColor(productColor);
+            cr.getClosedProdcues().get(i).setColorId(productColor.getColorId());
             Product product = productMapper.getProduce(productColor.getColorProductId());
-            cc.getClosedProdcues().get(i).setProductId(product.getProductId());
-            cc.getClosedProdcues().get(i).setClosedProductName(product.getProductName());
-            cc.getClosedProdcues().get(i).setProductType(product.getProductType());
-            cc.getClosedProdcues().get(i).setProductNumber(product.getProductNumber());
-        }
-        for (int i=0;i<cc.getClosedFittings().size();i++) {
-            FittingsInfo fittingsInfo = productMapper.getFittingsBySku(cc.getClosedFittings().get(i).getColorBar());
-            cc.getClosedFittings().get(i).setFittingsId(fittingsInfo.getFittingsId());
-            cc.getClosedFittings().get(i).setProductId(fittingsInfo.getProductId());
-            cc.getClosedFittings().get(i).setClosedFittingsName(fittingsInfo.getFittingsName());
-
-            Product product = productMapper.getProduce(fittingsInfo.getProductId());
-            cc.getClosedFittings().get(i).setClosedProductName(product.getProductName());
+            cr.getClosedProdcues().get(i).setProductId(product.getProductId());
+            cr.getClosedProdcues().get(i).setClosedProductName(product.getProductName());
+            cr.getClosedProdcues().get(i).setProductType(product.getProductType());
+            cr.getClosedProdcues().get(i).setProductNumber(product.getProductNumber());
         }
     }
 
     /**
+     * 产品配件初始化
+     * @param cc
+     */
+    @Override
+    @Transactional
+    public void setName(CustomerCommon cc){
+    }
+
+    /**
      * 添加品检
      * @param complaintDetectInfo
      * @param customerCommon

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

@@ -149,10 +149,11 @@
         from tb_rst_cm_relation t
         where t.relation_id= #{relationId}
     </select>
-    <insert id="save" parameterType="CmRelation" >
+    <insert id="save" parameterType="CmRelation"  useGeneratedKeys="true"  keyProperty="relationId" >
         insert into
         tb_rst_cm_relation
         (
+        relation_id,
         proc_method_id,
         customer_id,
         signclosed_id,
@@ -185,6 +186,7 @@
         )
         values
         (
+         #{relationId},
         #{procMethodId},
         #{customerId},
         #{signclosedId},

+ 16 - 0
watero-rst-service/src/main/java/com/iamberry/rst/util/CustomerCommonUtil.java

@@ -11,6 +11,7 @@ public class CustomerCommonUtil {
      * @param type 处理结果: 1:已解决  2:未解决 3:换新  4:维修 5:补发 6:退货 7:无理由退货
      * @return
      */
+    @Deprecated
     public static Object getRelation(Integer type,CustomerCommon c){
         switch (type){
             case 3: //换新
@@ -156,6 +157,7 @@ public class CustomerCommonUtil {
      * @param object
      * @return
      */
+    @Deprecated
     public static CustomerCommon getCustomerCommon(int solve, Object object) {
         if (object == null) {
             return null;
@@ -309,6 +311,7 @@ public class CustomerCommonUtil {
      * @param relationList
      * @return
      */
+    @Deprecated
     public static List<CustomerCommon> listToCustomerCommon(int solve,List<?> relationList){
         List<CustomerCommon> ccList = new ArrayList<>();
         for (Object relation : relationList){
@@ -324,6 +327,7 @@ public class CustomerCommonUtil {
      * 售后类型  3:换新;4:维修;5:补发;6:退货;7:无理由退货
      * @param type
      */
+    @Deprecated
     public static void setProduceOrFitting(Integer type,CustomerCommon cc){
         for (int i=0;i<cc.getSendProdcues().size();i++) {
             cc.getSendProdcues().get(i).setSendProduceType(type);
@@ -343,6 +347,18 @@ public class CustomerCommonUtil {
         }
     }
 
+    /**
+     * 将所有的寄回寄出中的类型改为  type
+     * @param cc
+     */
+    public static void setProduceOrFitting(CmRelation cc){
+        for (int i=0;i<cc.getSendProdcues().size();i++) {
+            cc.getSendProdcues().get(i).setRelationId(cc.getRelationId());
+        }
+        for (int i=0;i<cc.getClosedProdcues().size();i++) {
+            cc.getClosedProdcues().get(i).setRelationId(cc.getRelationId());
+        }
+    }
 
 
 

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

@@ -349,9 +349,9 @@
             </div>
 
             <input type="hidden" id="sendProdcues" name="sendProdcuesJson" value="">
-            <input type="hidden" id="sendFittings" name="sendFittingsJson" value="">
             <input type="hidden" id="closedProdcues" name="closedProdcuesJson" value="">
-            <input type="hidden" id="closedFittings" name="closedFittingsJson" value="">
+
+            <input type="hidden" id="customerIsSolve" name="customerIsSolve" value="">
 
             <div class="row cl init_proMethod" id="" code="returnCode" msg="resultMsg" data="returnMsg" >
                 <label class="form-label col-1 col-sm-1">处理结果:</label>

+ 30 - 20
watero-rst-web/src/main/webapp/common/js/common/UnlimitedLevelContact.js

@@ -8,6 +8,7 @@
                 /*配置删除的字符,用于设置name的时候,需要删除某些字符更好确认选项*/
                 judgeNameShield : [],
                 /*选中的数据,按照集合的形式存放 -- 用于回调出去*/
+                dataList : [],
                 data : [],
                 allCallback:function (array) {}
             },
@@ -50,6 +51,7 @@
                 /*初始化层次结构*/
                 $(this.ulcNode).attr("ulclevel",index);
             });
+            this.options.dataList = new Array(num);
             this.options.data = new Array(num);
         },
         initUlcHtml : function(level,id,thisId){
@@ -102,13 +104,14 @@
                     // $(node.ulcNode).unbind("change"); //移除change
 
                     /* 将每次选中的数据加入到data */
-                    var valId = $(node.ulcNode).val();
-                    $(res.data).each(function (){
-                        var data =  node.parseData(this);
-                        if(valId == data.id){
-                            ulc.options.data[level] = this;
-                        }
-                    });
+                    ulc.options.dataList[level] = res.data;
+                    // var valId = $(node.ulcNode).val();
+                    // $(res.data).each(function (){
+                    //     var data =  node.parseData(this);
+                    //     if(valId == data.id){
+                    //         ulc.options.dataList[level] = this;
+                    //     }
+                    // });
 
                     /* 绑定事件 */
                     if(ulc.options.ulcLevel.length-1 > level &&  node.isSelected == 1){
@@ -280,13 +283,20 @@
             /*绑定回调函数的值*/
             this.options.ulcLevel[level].callback(this.options.data[level]);
         },
-        allBackData:function (level) {
-            if(this.ulcIsEmpty(level)){
-                /*绑定回调函数的值*/
-                this.options.allCallback(this.options.data[level]);
-            }else{
-                this.options.allCallback(this.options.data);
+        allBackData:function () {
+            var ulc = this;
+            for (var i=0;i<ulc.options.ulcLevel.length;i++){
+                var node = ulc.options.ulcLevel[i];
+                var valId = $(node.ulcNode).val();
+                var dataList = ulc.options.dataList[i];
+                $(dataList).each(function (){
+                    var data =  node.parseData(this);
+                    if(valId == data.id){
+                        ulc.options.data[i] = this;
+                    }
+                });
             }
+            this.options.allCallback(ulc.options.data);
         },
         setUlcCallback:function (fun,level) {
             /*回调函数设置*/
@@ -367,13 +377,13 @@ function init_ulc(node){
     return ulc;
 };
 
-function ulcSecc(data) {
-    console.log(JSON.stringify(data));
-}
-
-function ulcSecc1(data) {
-    console.log("------"+JSON.stringify(data));
-}
+// function ulcSecc(data) {
+//     console.log(JSON.stringify(data));
+// }
+//
+// function ulcSecc1(data) {
+//     console.log("------"+JSON.stringify(data));
+// }
 //
 // var  ulcLevel = new Array();
 // $(node).find("select").each(function () {

+ 9 - 4
watero-rst-web/src/main/webapp/common/js/customer/customer.js

@@ -392,10 +392,12 @@ function initProduceType(){
                     default:
                         break;
                 }
-                opentionSelectOrder(isOrder);
+                isNeedSelectOrder = isOrder ;
+                opentionSelectOrder();
             })
             /*当前第一个默认选中上朵电动牙刷  isNeedSelectOrder = 2  默认不需要选择订单*/
-            opentionSelectOrder(2);
+            isNeedSelectOrder = 2 ;
+            opentionSelectOrder();
         },
         error: function(XmlHttpRequest, textStatus, errorThrown){
         }
@@ -406,6 +408,7 @@ function initProduceType(){
  *
  */
 function ulcProcessResult(data){
+    console.log(JSON.stringify(data));
     initProcessResult(data[1].procMethodIsBack,data[1].procMethodIsSend);
 }
 
@@ -1396,8 +1399,7 @@ function setStore(companyId,node){
  * 控制展示订单
  *  1:需要有订单    2:不需要有订单
  */
-function  opentionSelectOrder(type){
-    isNeedSelectOrder = type ;
+function  opentionSelectOrder(){
     opentionSelectOrderDiv();
 }
 
@@ -1464,6 +1466,9 @@ $(function(){
 
 /* 添加客诉的准备 */
 function addCustomerReady(){
+
+    $("#customerIsSolve").val($("#procMethodId").val());
+
     /* 是否需要添加订单,赋值 */
     $("#isNeedSelectOrder").val(isNeedSelectOrder);
     if(isNeedSelectOrder == 1){