|
@@ -74,8 +74,6 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
@Autowired
|
|
|
private EfastOrderService efastOrderService;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public CustomerInfo getCustomerInfo(Integer customerId) {
|
|
|
return customerInfoMapper.getCustomerInfo(customerId);
|
|
@@ -136,7 +134,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
customerCommon.setRelationBackPostage(0);
|
|
|
|
|
|
|
|
|
- this.setName(customerCommon);
|
|
|
+ customerService.setName(customerCommon);
|
|
|
|
|
|
ComplaintDetectInfo complaintDetectInfo = new ComplaintDetectInfo();
|
|
|
ComplaintSignclosedInfo complaintSignclosedInfo = new ComplaintSignclosedInfo();
|
|
@@ -145,9 +143,12 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
switch (customerInfo.getCustomerIsSolve()) {
|
|
|
case 3:
|
|
|
|
|
|
- isReturn = this.chargebackEfastOrder(customerCommon,salesOrder,2);
|
|
|
+ isReturn = customerService.chargebackEfastOrder(customerCommon,salesOrder,2);
|
|
|
+ if(!isReturn){
|
|
|
+ throw new Exception("生成退单失败");
|
|
|
+ }
|
|
|
|
|
|
- map = this.sendEfastOrder(customerCommon,salesOrder);
|
|
|
+ map = customerService.sendEfastOrder(customerCommon,salesOrder);
|
|
|
if(map.get("status") == 1){
|
|
|
customerCommon.setRelationBackEfastOrderId(String.valueOf(map.get("EfastOrderId")));
|
|
|
complaintSignclosedInfo.setNewEfastId(String.valueOf(map.get("EfastOrderId")));
|
|
@@ -155,15 +156,18 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
throw new Exception("换新创建Efast订单失败");
|
|
|
}
|
|
|
complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());
|
|
|
- this.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
|
+ customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
|
complaintDetectInfo.setSignclosedId(complaintSignclosedInfo.getSignclosedId());
|
|
|
- this.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);
|
|
|
+ customerService.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);
|
|
|
break;
|
|
|
case 4:
|
|
|
|
|
|
- isReturn = this.chargebackEfastOrder(customerCommon,salesOrder,2);
|
|
|
+ isReturn = customerService.chargebackEfastOrder(customerCommon,salesOrder,2);
|
|
|
+ if(!isReturn){
|
|
|
+ throw new Exception("生成退单失败");
|
|
|
+ }
|
|
|
|
|
|
- map = this.sendEfastOrder(customerCommon,salesOrder);
|
|
|
+ map = customerService.sendEfastOrder(customerCommon,salesOrder);
|
|
|
if(map.get("status") == 1){
|
|
|
customerCommon.setRelationBackEfastOrderId(String.valueOf(map.get("EfastOrderId")));
|
|
|
complaintSignclosedInfo.setNewEfastId(String.valueOf(map.get("EfastOrderId")));
|
|
@@ -171,12 +175,12 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
throw new Exception("维修创建Efast订单失败");
|
|
|
}
|
|
|
complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());
|
|
|
- this.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
|
+ customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
|
complaintDetectInfo.setSignclosedId(complaintSignclosedInfo.getSignclosedId());
|
|
|
- this.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);
|
|
|
+ customerService.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);
|
|
|
break;
|
|
|
case 5:
|
|
|
- map = this.sendEfastOrder(customerCommon,salesOrder);
|
|
|
+ map = customerService.sendEfastOrder(customerCommon,salesOrder);
|
|
|
if(map.get("status") == 1){
|
|
|
customerCommon.setRelationBackEfastOrderId(String.valueOf(map.get("EfastOrderId")));
|
|
|
complaintSignclosedInfo.setNewEfastId(String.valueOf(map.get("EfastOrderId")));
|
|
@@ -186,21 +190,27 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
break;
|
|
|
case 6:
|
|
|
|
|
|
- isReturn = this.chargebackEfastOrder(customerCommon,salesOrder,3);
|
|
|
+ isReturn = customerService.chargebackEfastOrder(customerCommon,salesOrder,3);
|
|
|
+ if(!isReturn){
|
|
|
+ throw new Exception("生成退单失败");
|
|
|
+ }
|
|
|
|
|
|
complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());
|
|
|
- this.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
|
+ customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
|
complaintDetectInfo.setSignclosedId(complaintSignclosedInfo.getSignclosedId());
|
|
|
- this.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);
|
|
|
+ customerService.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);
|
|
|
break;
|
|
|
case 7:
|
|
|
|
|
|
- isReturn = this.chargebackEfastOrder(customerCommon,salesOrder,3);
|
|
|
+ isReturn = customerService.chargebackEfastOrder(customerCommon,salesOrder,3);
|
|
|
+ if(!isReturn){
|
|
|
+ throw new Exception("生成退单失败");
|
|
|
+ }
|
|
|
|
|
|
complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());
|
|
|
- this.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
|
+ customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
|
complaintDetectInfo.setSignclosedId(complaintSignclosedInfo.getSignclosedId());
|
|
|
- this.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);
|
|
|
+ customerService.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);
|
|
|
break;
|
|
|
}
|
|
|
customerCommon.setSignclosedId(complaintSignclosedInfo.getSignclosedId());
|
|
@@ -263,7 +273,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
* 产品配件初始化
|
|
|
* @param cc
|
|
|
*/
|
|
|
- private void setName(CustomerCommon cc){
|
|
|
+ public void setName(CustomerCommon cc){
|
|
|
for (int i=0;i<cc.getSendProdcues().size();i++) {
|
|
|
Product product = productMapper.getProduce(cc.getSendProdcues().get(i).getProductId());
|
|
|
cc.getSendProdcues().get(i).setSendProduceName(product.getProductName());
|
|
@@ -596,16 +606,15 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
@Transactional
|
|
|
- boolean chargebackEfastOrder(CustomerCommon customerCommon, SalesOrder salesOrder,Integer status) throws Exception{
|
|
|
+ public boolean chargebackEfastOrder(CustomerCommon customerCommon, SalesOrder salesOrder,Integer status) throws Exception{
|
|
|
|
|
|
SalesOrder order = new SalesOrder();
|
|
|
order.setSalesId(salesOrder.getSalesId());
|
|
|
order.setSalesOrderStatus(status);
|
|
|
Integer flag = salesOrderMapper.updateSalesOrder(order);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ if(flag < 0){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
EfastOrder efastOrder = new EfastOrder();
|
|
|
List<EfastOrderItem> itemList = new ArrayList<>();
|
|
|
|