|  | @@ -1338,6 +1338,7 @@ public class CustomerServiceImpl implements CustomerService {
 | 
	
		
			
				|  |  |          * 添加订单
 | 
	
		
			
				|  |  |          * 添加寄入寄出
 | 
	
		
			
				|  |  |          * */
 | 
	
		
			
				|  |  | +        Integer flag = 0;
 | 
	
		
			
				|  |  |          CmRelation cmRelation = new CmRelation();
 | 
	
		
			
				|  |  |          cmRelation.setCustomerId(customerInfo.getCustomerId());
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -1380,15 +1381,26 @@ public class CustomerServiceImpl implements CustomerService {
 | 
	
		
			
				|  |  |                  procMethodId = 1;
 | 
	
		
			
				|  |  |                  cmRelation.setRelationBackStatus(1);     //寄回状态 1:未寄回 2:已寄回 3:已收货 4: 已签收待确认
 | 
	
		
			
				|  |  |                  cmRelation.setRelationSendStatus(1);   //寄送状态 1:未寄送 2:已寄送 3:已收货
 | 
	
		
			
				|  |  | +                cmRelation.setRelationSendName(customerInfo.getCustomerName());
 | 
	
		
			
				|  |  | +                cmRelation.setRelationBackName(customerInfo.getCustomerName());
 | 
	
		
			
				|  |  | +                cmRelation.setRelationSendTel(customerInfo.getCustomerTel());
 | 
	
		
			
				|  |  | +                cmRelation.setRelationBackTel(customerInfo.getCustomerTel());
 | 
	
		
			
				|  |  | +                cmRelation.setRelationIsTransfer(0);
 | 
	
		
			
				|  |  | +                cmRelation.setRelationBackPostage(0);
 | 
	
		
			
				|  |  |                  break;
 | 
	
		
			
				|  |  |              case 2:
 | 
	
		
			
				|  |  |                  procMethodId = 2;
 | 
	
		
			
				|  |  |                  cmRelation.setRelationBackStatus(1);     //寄回状态 1:未寄回 2:已寄回 3:已收货 4: 已签收待确认
 | 
	
		
			
				|  |  |                  cmRelation.setRelationSendStatus(1);   //寄送状态 1:未寄送 2:已寄送 3:已收货
 | 
	
		
			
				|  |  | +                cmRelation.setRelationSendName(customerInfo.getCustomerName());
 | 
	
		
			
				|  |  | +                cmRelation.setRelationBackName(customerInfo.getCustomerName());
 | 
	
		
			
				|  |  | +                cmRelation.setRelationSendTel(customerInfo.getCustomerTel());
 | 
	
		
			
				|  |  | +                cmRelation.setRelationBackTel(customerInfo.getCustomerTel());
 | 
	
		
			
				|  |  | +                cmRelation.setRelationIsTransfer(0);
 | 
	
		
			
				|  |  | +                cmRelation.setRelationBackPostage(0);
 | 
	
		
			
				|  |  |                  break;
 | 
	
		
			
				|  |  |              case 3:
 | 
	
		
			
				|  |  |                  procMethodId = 3;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |                  break;
 | 
	
		
			
				|  |  |              case 4:
 | 
	
		
			
				|  |  |                  procMethodId = 6;
 | 
	
	
		
			
				|  | @@ -1412,62 +1424,67 @@ public class CustomerServiceImpl implements CustomerService {
 | 
	
		
			
				|  |  |                  break;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          cmRelation.setProcMethodId(procMethodId);
 | 
	
		
			
				|  |  | +        cmRelation.setRelationState(1);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        //删除寄出寄回产品 -----
 | 
	
		
			
				|  |  | -        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);
 | 
	
		
			
				|  |  | +        flag = cmRelationMapper.save(cmRelation);
 | 
	
		
			
				|  |  |          if (flag < 1) {
 | 
	
		
			
				|  |  |              throw new RuntimeException("添加处理方式失败");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        customerService.setName(cmRelation);
 | 
	
		
			
				|  |  | +        if(customerInfo.getCustomerIsSolve() == 3 || customerInfo.getCustomerIsSolve() == 4 || customerInfo.getCustomerIsSolve() == 5 ||
 | 
	
		
			
				|  |  | +                customerInfo.getCustomerIsSolve() == 6 ||customerInfo.getCustomerIsSolve() == 7 ){
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        /*添加客诉-添加处理与订单关联表 ---------- */
 | 
	
		
			
				|  |  | -        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);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +            //删除寄出寄回产品 -----
 | 
	
		
			
				|  |  | +            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);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        if(relationAndOrderList != null && relationAndOrderList.size() > 0){
 | 
	
		
			
				|  |  | -            relationOrderService.saveList(relationAndOrderList);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +               /*恢复订单状态 ------------ */
 | 
	
		
			
				|  |  | +            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);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        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());
 | 
	
		
			
				|  |  | +              /* 删除掉订单与处理的关联表  ----------- */
 | 
	
		
			
				|  |  | +            RelationOrder rol = new RelationOrder();
 | 
	
		
			
				|  |  | +            rol.setRelationType(customerCommon.getCustomerIsSolve());
 | 
	
		
			
				|  |  | +            rol.setRelationId(customerCommon.getRelationId());
 | 
	
		
			
				|  |  | +            relationOrderService.deleteByRelationOrder(rol);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            /*产品整理*/
 | 
	
		
			
				|  |  | +            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;
 | 
	
		
			
				|  |  |      }
 |