Kaynağa Gözat

Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent

# Conflicts:
#	watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java
wangxiaoming 7 yıl önce
ebeveyn
işleme
7f5e958b94

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

@@ -18,14 +18,14 @@ public interface CustomerService {
      * @param customerInfo
      * @return
      */
-    Integer saveCustomerInfo(CustomerInfo customerInfo,SalesOrder salesOrder) throws Exception;
+    Integer saveCustomerInfo(CustomerInfo customerInfo,SalesOrder salesOrder);
 
     /**
      * 添加订单到efast
      * @param salesOrder
      * @return
      */
-    Map<String,Object> sendEfastOrder(SalesOrder salesOrder)throws Exception;
+    Map<String,Object> sendEfastOrder(SalesOrder salesOrder);
 
     /**
      * 根据id获取客诉信息
@@ -113,24 +113,24 @@ public interface CustomerService {
      * @return
      * @throws Exception
      */
-    boolean chargebackEfastOrder(CustomerCommon customerCommon, SalesOrder salesOrder,Integer status) throws Exception;
+    void chargebackEfastOrder(CustomerCommon customerCommon, SalesOrder salesOrder,Integer status);
     /**
      * 添加仓储
      * @param customerCommon
      * @return
      */
-    void saveComplaintSignclosedInfo(ComplaintSignclosedInfo complaintSignclosedInfo,CustomerCommon customerCommon)throws  Exception;
+    void saveComplaintSignclosedInfo(ComplaintSignclosedInfo complaintSignclosedInfo,CustomerCommon customerCommon);
     /**
      * 添加品检
      * @param complaintDetectInfo
      * @param customerCommon
      * @return
      */
-    void saveComplaintDetectInfo(ComplaintDetectInfo complaintDetectInfo,CustomerCommon customerCommon) throws  Exception;
+    void saveComplaintDetectInfo(ComplaintDetectInfo complaintDetectInfo,CustomerCommon customerCommon);
     /**
      * 向Efast推送订单  仅换新,维修 ,补发
      * @return
      */
     @Transactional
-    Map<String,Object> sendEfastOrder(CustomerCommon customerCommon,SalesOrder salesOrder) throws Exception;
+    Map<String,Object> sendEfastOrder(CustomerCommon customerCommon,SalesOrder salesOrder);
 }

+ 27 - 41
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java

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

+ 5 - 2
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -609,8 +609,11 @@ public class AdminCustomerController {
         }
         customerInfo.setTransactionNumber(orderId);
 
-        flag = customerService.saveCustomerInfo(customerInfo, salesOrder);
-
+        try{
+            flag = customerService.saveCustomerInfo(customerInfo, salesOrder);
+        }catch (RuntimeException e){
+            return new ResponseJson(500, e.getMessage(), 500);
+        }
         if (flag < 1) {
             return new ResponseJson(500, "添加客诉失败!", 500);
         } else {

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

@@ -1861,10 +1861,16 @@
                             location.href = "${path}/admin/customer/select_customer_list";
                         } else {
                             layer.close(index);
+                            layer.msg(data.resultMsg, {icon: 5, time: 3000});
                         }
                         return ;
                     });
                 }
+            },
+            ajaxurl:function (data) {
+                if (data) {
+
+                }
             }
         });
     })

+ 6 - 6
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_particulars.ftl

@@ -147,22 +147,22 @@
 		<#if ptsMachine.machineProcessState == 2><span class="text-red">异常</#if></span></li>
 
         <li style="width: 100%;height: 25px;">
-            <div style="float: left;width: 200px;">软件版本:
+            <div style="float: left;width: 300px;">软件版本:
                 <span class="text-red">
                     <a class="rj-a" style="" href="javascript:void(0);" title="点击查看软件版本" onclick="selectVersion('${produce.produceId ! ''}','${produce.produceName ! ''}')">${ptsMachineVersion.machineVersionNo ! ''}</a>
                 </span>
             </div>
-            <div style="float: left;width: 200px;">硬件版本:<span class="text-red">${ptsBom.bomVersion ! ''}</span></div>
+            <div style="float: left;width: 300px;">硬件版本:<span class="text-red">${ptsBom.bomVersion ! ''}</span></div>
         </li>
 
         <li style="width: 100%;height: 25px;">
-            <div style="float: left;width: 200px;">所属批次:${ptsBatch.batchNo ! ''}</div>
-            <div style="float: left;width: 200px;">所属Bom:${ptsBom.bomName ! ''}</div>
+            <div style="float: left;width: 300px;">所属批次:${ptsBatch.batchNo ! ''}</div>
+            <div style="float: left;width: 300px;">所属Bom:${ptsBom.bomName ! ''}</div>
         </li>
 
         <li style="width: 100%;height: 25px;">
-            <div style="float: left;width: 200px;">Bom总质量:${ptsBom.allComponentsWeight ! ''}g</div>
-            <div style="float: left;width: 200px;">Bom总价格:${ptsBom.allComponentsCost/100 ! ''}元</div>
+            <div style="float: left;width: 300px;">Bom总质量:${ptsBom.allComponentsWeight ! ''}g</div>
+            <div style="float: left;width: 300px;">Bom总价格:${ptsBom.allComponentsCost/100 ! ''}元</div>
         </li>
 
         <li  style="width: 100%;height: 25px;">Bom零件清单</li>

+ 1 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_print_List.ftl

@@ -40,7 +40,7 @@
 			</form>
 		</div>
 		<div class="mt-2" style="margin: 20px; " >
-            <div style="width: 50%;margin: 0 auto; ">
+            <div style="width: 55%;margin: 0 auto; ">
                 <table class="table table-border table-bordered table-bg table-hover table-sort" >
                     <thead>
                     <tr class="text-c">