|
@@ -81,13 +81,13 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@Transactional
|
|
@Transactional
|
|
- public Integer saveCustomerInfo(CustomerInfo customerInfo,SalesOrder salesOrder) throws Exception{
|
|
+ public Integer saveCustomerInfo(CustomerInfo customerInfo,SalesOrder salesOrder){
|
|
|
|
|
|
|
|
|
|
Integer flag = 0;
|
|
Integer flag = 0;
|
|
flag = customerInfoMapper.insert(customerInfo);
|
|
flag = customerInfoMapper.insert(customerInfo);
|
|
if(flag < 1){
|
|
if(flag < 1){
|
|
- throw new Exception("添加客诉失败");
|
|
+ throw new RuntimeException("添加客诉失败");
|
|
}
|
|
}
|
|
|
|
|
|
QuestionDescribe questionDescribe = new QuestionDescribe();
|
|
QuestionDescribe questionDescribe = new QuestionDescribe();
|
|
@@ -97,7 +97,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
questionDescribe.setDescribeHandleDesc(customerInfo.getDescribeHandleDesc());
|
|
questionDescribe.setDescribeHandleDesc(customerInfo.getDescribeHandleDesc());
|
|
flag = questionDescribeMapper.insert(questionDescribe);
|
|
flag = questionDescribeMapper.insert(questionDescribe);
|
|
if(flag < 1){
|
|
if(flag < 1){
|
|
- throw new Exception("添加客诉失败");
|
|
+ throw new RuntimeException("添加客诉失败");
|
|
}
|
|
}
|
|
|
|
|
|
if ("2".equals(customerInfo.getCustomerIsVisit())) {
|
|
if ("2".equals(customerInfo.getCustomerIsVisit())) {
|
|
@@ -111,7 +111,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
visit.setVisitStatus(1);
|
|
visit.setVisitStatus(1);
|
|
flag = visitMapper.addVisitInfo(visit);
|
|
flag = visitMapper.addVisitInfo(visit);
|
|
if(flag < 1){
|
|
if(flag < 1){
|
|
- throw new Exception("添加客诉失败");
|
|
+ throw new RuntimeException("添加客诉失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -143,17 +143,14 @@ public class CustomerServiceImpl implements CustomerService {
|
|
switch (customerInfo.getCustomerIsSolve()) {
|
|
switch (customerInfo.getCustomerIsSolve()) {
|
|
case 3:
|
|
case 3:
|
|
|
|
|
|
- isReturn = customerService.chargebackEfastOrder(customerCommon,salesOrder,2);
|
|
+ customerService.chargebackEfastOrder(customerCommon,salesOrder,2);
|
|
- if(!isReturn){
|
|
|
|
- throw new Exception("生成退单失败");
|
|
|
|
- }
|
|
|
|
|
|
|
|
map = customerService.sendEfastOrder(customerCommon,salesOrder);
|
|
map = customerService.sendEfastOrder(customerCommon,salesOrder);
|
|
if(map.get("status") == 1){
|
|
if(map.get("status") == 1){
|
|
customerCommon.setRelationBackEfastOrderId(String.valueOf(map.get("EfastOrderId")));
|
|
customerCommon.setRelationBackEfastOrderId(String.valueOf(map.get("EfastOrderId")));
|
|
complaintSignclosedInfo.setNewEfastId(String.valueOf(map.get("EfastOrderId")));
|
|
complaintSignclosedInfo.setNewEfastId(String.valueOf(map.get("EfastOrderId")));
|
|
}else{
|
|
}else{
|
|
- throw new Exception("换新创建Efast订单失败");
|
|
+ throw new RuntimeException("换新创建Efast订单失败");
|
|
}
|
|
}
|
|
complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());
|
|
complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());
|
|
customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
@@ -162,17 +159,14 @@ public class CustomerServiceImpl implements CustomerService {
|
|
break;
|
|
break;
|
|
case 4:
|
|
case 4:
|
|
|
|
|
|
- isReturn = customerService.chargebackEfastOrder(customerCommon,salesOrder,2);
|
|
+ customerService.chargebackEfastOrder(customerCommon,salesOrder,2);
|
|
- if(!isReturn){
|
|
|
|
- throw new Exception("生成退单失败");
|
|
|
|
- }
|
|
|
|
|
|
|
|
map = customerService.sendEfastOrder(customerCommon,salesOrder);
|
|
map = customerService.sendEfastOrder(customerCommon,salesOrder);
|
|
if(map.get("status") == 1){
|
|
if(map.get("status") == 1){
|
|
customerCommon.setRelationBackEfastOrderId(String.valueOf(map.get("EfastOrderId")));
|
|
customerCommon.setRelationBackEfastOrderId(String.valueOf(map.get("EfastOrderId")));
|
|
complaintSignclosedInfo.setNewEfastId(String.valueOf(map.get("EfastOrderId")));
|
|
complaintSignclosedInfo.setNewEfastId(String.valueOf(map.get("EfastOrderId")));
|
|
}else{
|
|
}else{
|
|
- throw new Exception("维修创建Efast订单失败");
|
|
+ throw new RuntimeException("维修创建Efast订单失败");
|
|
}
|
|
}
|
|
complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());
|
|
complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());
|
|
customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
@@ -185,15 +179,12 @@ public class CustomerServiceImpl implements CustomerService {
|
|
customerCommon.setRelationBackEfastOrderId(String.valueOf(map.get("EfastOrderId")));
|
|
customerCommon.setRelationBackEfastOrderId(String.valueOf(map.get("EfastOrderId")));
|
|
complaintSignclosedInfo.setNewEfastId(String.valueOf(map.get("EfastOrderId")));
|
|
complaintSignclosedInfo.setNewEfastId(String.valueOf(map.get("EfastOrderId")));
|
|
}else{
|
|
}else{
|
|
- throw new Exception("补发创建Efast订单失败");
|
|
+ throw new RuntimeException("补发创建Efast订单失败");
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 6:
|
|
case 6:
|
|
|
|
|
|
- isReturn = customerService.chargebackEfastOrder(customerCommon,salesOrder,3);
|
|
+ customerService.chargebackEfastOrder(customerCommon,salesOrder,3);
|
|
- if(!isReturn){
|
|
|
|
- throw new Exception("生成退单失败");
|
|
|
|
- }
|
|
|
|
|
|
|
|
complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());
|
|
complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());
|
|
customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
@@ -202,10 +193,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
break;
|
|
break;
|
|
case 7:
|
|
case 7:
|
|
|
|
|
|
- isReturn = customerService.chargebackEfastOrder(customerCommon,salesOrder,3);
|
|
+ customerService.chargebackEfastOrder(customerCommon,salesOrder,3);
|
|
- if(!isReturn){
|
|
|
|
- throw new Exception("生成退单失败");
|
|
|
|
- }
|
|
|
|
|
|
|
|
complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());
|
|
complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());
|
|
customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
customerService.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);
|
|
@@ -245,7 +233,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
if (flag < 1) {
|
|
if (flag < 1) {
|
|
- throw new Exception("添加客诉处理结果失败");
|
|
+ throw new RuntimeException("添加客诉处理结果失败");
|
|
}
|
|
}
|
|
|
|
|
|
customerCommon.setRelationId(relationId);
|
|
customerCommon.setRelationId(relationId);
|
|
@@ -309,7 +297,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Transactional
|
|
@Transactional
|
|
- public void saveComplaintDetectInfo(ComplaintDetectInfo complaintDetectInfo,CustomerCommon customerCommon) throws Exception{
|
|
+ public void saveComplaintDetectInfo(ComplaintDetectInfo complaintDetectInfo,CustomerCommon customerCommon){
|
|
Integer flag = 0;
|
|
Integer flag = 0;
|
|
List<ComplaintDetectInfo> complaintDetectInfoList = new ArrayList<ComplaintDetectInfo>();
|
|
List<ComplaintDetectInfo> complaintDetectInfoList = new ArrayList<ComplaintDetectInfo>();
|
|
complaintDetectInfo.setCustomerId(customerCommon.getCustomerId());
|
|
complaintDetectInfo.setCustomerId(customerCommon.getCustomerId());
|
|
@@ -332,7 +320,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
flag = complaintDetectInfoMapper.insertList(complaintDetectInfoList);
|
|
flag = complaintDetectInfoMapper.insertList(complaintDetectInfoList);
|
|
}
|
|
}
|
|
if(flag < 1){
|
|
if(flag < 1){
|
|
- throw new Exception("添加品检失败");
|
|
+ throw new RuntimeException("添加品检失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -342,7 +330,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Transactional
|
|
@Transactional
|
|
- public void saveComplaintSignclosedInfo(ComplaintSignclosedInfo complaintSignclosedInfo,CustomerCommon customerCommon)throws Exception{
|
|
+ public void saveComplaintSignclosedInfo(ComplaintSignclosedInfo complaintSignclosedInfo,CustomerCommon customerCommon){
|
|
Integer flag;
|
|
Integer flag;
|
|
complaintSignclosedInfo.setSignclosedType(1);
|
|
complaintSignclosedInfo.setSignclosedType(1);
|
|
complaintSignclosedInfo.setSignclosedIsQuality(1);
|
|
complaintSignclosedInfo.setSignclosedIsQuality(1);
|
|
@@ -353,7 +341,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
complaintSignclosedInfo.setSignclosedIsFittings(2);
|
|
complaintSignclosedInfo.setSignclosedIsFittings(2);
|
|
flag = complaintSignclosedInfoMapper.insert(complaintSignclosedInfo);
|
|
flag = complaintSignclosedInfoMapper.insert(complaintSignclosedInfo);
|
|
if(flag < 1){
|
|
if(flag < 1){
|
|
- throw new Exception("添加签收失败");
|
|
+ throw new RuntimeException("添加签收失败");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -388,7 +376,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
|
|
|
flag = complaintSignclosedProductInfoMapper.insertList(awaitingSignclosedProductInfoArrayList);
|
|
flag = complaintSignclosedProductInfoMapper.insertList(awaitingSignclosedProductInfoArrayList);
|
|
if(flag < 1){
|
|
if(flag < 1){
|
|
- throw new Exception("添加签收产品失败");
|
|
+ throw new RuntimeException("添加签收产品失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -397,7 +385,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Transactional
|
|
@Transactional
|
|
- public Map<String,Object> sendEfastOrder(CustomerCommon customerCommon,SalesOrder salesOrder) throws Exception{
|
|
+ public Map<String,Object> sendEfastOrder(CustomerCommon customerCommon,SalesOrder salesOrder){
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
List<EfastOrder> orderList = new ArrayList<EfastOrder>();
|
|
List<EfastOrder> orderList = new ArrayList<EfastOrder>();
|
|
List<OrderItem> itemList = new ArrayList<OrderItem>();
|
|
List<OrderItem> itemList = new ArrayList<OrderItem>();
|
|
@@ -489,12 +477,12 @@ public class CustomerServiceImpl implements CustomerService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Transactional
|
|
@Transactional
|
|
- public Map<String,Object> sendEfastOrder(SalesOrder salesOrder) throws Exception{
|
|
+ public Map<String,Object> sendEfastOrder(SalesOrder salesOrder){
|
|
|
|
|
|
|
|
|
|
int orderNum = salesOrderMapper.addSalesOrder(salesOrder);
|
|
int orderNum = salesOrderMapper.addSalesOrder(salesOrder);
|
|
if (orderNum <= 0) {
|
|
if (orderNum <= 0) {
|
|
- throw new Exception("添加订单失败");
|
|
+ throw new RuntimeException("添加订单失败");
|
|
}
|
|
}
|
|
for (SalesOrderItem item : salesOrder.getSalesOrderItemList()) {
|
|
for (SalesOrderItem item : salesOrder.getSalesOrderItemList()) {
|
|
item.setItemOrderId(salesOrder.getSalesId());
|
|
item.setItemOrderId(salesOrder.getSalesId());
|
|
@@ -502,7 +490,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
|
|
|
|
int itemNum = salesOrderMapper.addOrderItemList(salesOrder.getSalesOrderItemList());
|
|
int itemNum = salesOrderMapper.addOrderItemList(salesOrder.getSalesOrderItemList());
|
|
if (itemNum <= 0) {
|
|
if (itemNum <= 0) {
|
|
- throw new Exception("添加订单项失败");
|
|
+ throw new RuntimeException("添加订单项失败");
|
|
}
|
|
}
|
|
|
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
@@ -592,7 +580,7 @@ public class CustomerServiceImpl implements CustomerService {
|
|
if(oList != null && oList.size() > 0){
|
|
if(oList != null && oList.size() > 0){
|
|
map.put("EfastOrderId",oList.get(0).getOrderId());
|
|
map.put("EfastOrderId",oList.get(0).getOrderId());
|
|
}else{
|
|
}else{
|
|
- throw new Exception("添加订单项失败");
|
|
+ throw new RuntimeException("添加订单项失败");
|
|
}
|
|
}
|
|
map.put("status",status);
|
|
map.put("status",status);
|
|
return map;
|
|
return map;
|
|
@@ -603,17 +591,17 @@ public class CustomerServiceImpl implements CustomerService {
|
|
* @param customerCommon
|
|
* @param customerCommon
|
|
* @param salesOrder
|
|
* @param salesOrder
|
|
* @return
|
|
* @return
|
|
- * @throws Exception
|
|
+ * @throws RuntimeException
|
|
*/
|
|
*/
|
|
@Transactional
|
|
@Transactional
|
|
- public boolean chargebackEfastOrder(CustomerCommon customerCommon, SalesOrder salesOrder,Integer status) throws Exception{
|
|
+ public void chargebackEfastOrder(CustomerCommon customerCommon, SalesOrder salesOrder,Integer status){
|
|
|
|
|
|
SalesOrder order = new SalesOrder();
|
|
SalesOrder order = new SalesOrder();
|
|
order.setSalesId(salesOrder.getSalesId());
|
|
order.setSalesId(salesOrder.getSalesId());
|
|
order.setSalesOrderStatus(status);
|
|
order.setSalesOrderStatus(status);
|
|
Integer flag = salesOrderMapper.updateSalesOrder(order);
|
|
Integer flag = salesOrderMapper.updateSalesOrder(order);
|
|
if(flag < 0){
|
|
if(flag < 0){
|
|
- return false;
|
|
+ throw new RuntimeException("生成退单失败");
|
|
}
|
|
}
|
|
EfastOrder efastOrder = new EfastOrder();
|
|
EfastOrder efastOrder = new EfastOrder();
|
|
List<EfastOrderItem> itemList = new ArrayList<>();
|
|
List<EfastOrderItem> itemList = new ArrayList<>();
|
|
@@ -649,10 +637,8 @@ public class CustomerServiceImpl implements CustomerService {
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
logger.info("------将原订单生成退货订单报错------");
|
|
logger.info("------将原订单生成退货订单报错------");
|
|
}
|
|
}
|
|
- if(fg){
|
|
+ if(!fg){
|
|
- return true;
|
|
+ throw new RuntimeException("生成退单失败");
|
|
- }else{
|
|
|
|
- return false;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|