Bläddra i källkod

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

liujiankang 7 år sedan
förälder
incheckning
e21a168ded

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

@@ -20,6 +20,8 @@ public class ClosedProdcue  implements Serializable {
 
     private String closedProductName; //产品名称
 
+    private String closedProdcueMachineNo;      //机器编码
+
     private Integer productType;        //商品类型
     private String productNumber;       //产品型号
     private ProductColor productColor;      //颜色
@@ -103,4 +105,12 @@ public class ClosedProdcue  implements Serializable {
     public void setProductColor(ProductColor productColor) {
         this.productColor = productColor;
     }
+
+    public String getClosedProdcueMachineNo() {
+        return closedProdcueMachineNo;
+    }
+
+    public void setClosedProdcueMachineNo(String closedProdcueMachineNo) {
+        this.closedProdcueMachineNo = closedProdcueMachineNo;
+    }
 }

+ 11 - 12
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/SalesOrderServiceImpl.java

@@ -93,7 +93,7 @@ public class SalesOrderServiceImpl implements SalesOrderService {
     @Transient
     public boolean addOrderAndItem(SalesOrder salesOrder, List<SalesOrderItem> list) throws Exception {
         if (list == null || list.size() == 0) {
-            return false;
+            throw  new RuntimeException("获取Efast订单信息出错!");
         }
         SalesOrder verifyOrder = new SalesOrder();
         verifyOrder.setSalesOrderId(salesOrder.getSalesOrderId());
@@ -106,7 +106,7 @@ public class SalesOrderServiceImpl implements SalesOrderService {
         try {
             int orderNum = salesOrderMapper.addSalesOrder(salesOrder);
             if (orderNum <= 0) {
-                return false;
+                throw  new RuntimeException("获取Efast订单信息出错!");
             }
         }catch (Exception e){
             return true;
@@ -118,7 +118,7 @@ public class SalesOrderServiceImpl implements SalesOrderService {
         //批量添加订单项数据
         int itemNum = salesOrderMapper.addOrderItemList(list);
         if (itemNum <= 0) {
-            return false;
+            throw  new RuntimeException("获取Efast订单信息出错!");
         }
         return true;
     }
@@ -368,15 +368,15 @@ public class SalesOrderServiceImpl implements SalesOrderService {
     @Transient
     public boolean syncEfastOrder(JSONObject orderInfo) throws Exception {
         if (orderInfo == null) {
-            return false;
+            throw  new RuntimeException("获取Efast订单信息出错!");
         }
         if (!orderInfo.has("orders")) {
-            return false;
+            throw  new RuntimeException("获取Efast订单信息出错!");
         }
         //获取订单项集合
         JSONArray itemArray = orderInfo.getJSONArray("orders");
         if (itemArray == null || itemArray.size() == 0) {
-            return false;
+            throw  new RuntimeException("获取Efast订单信息出错!");
         }
 
         SalesOrder salesOrder = new SalesOrder();
@@ -445,11 +445,11 @@ public class SalesOrderServiceImpl implements SalesOrderService {
             ProductColor color = new ProductColor();
             JSONObject itemJson = itemArray.getJSONObject(j);
             SalesOrderItem item = new SalesOrderItem();
-            color.setColorBar(itemJson.getString("goods_sn"));
+            color.setColorBar(itemJson.getString("goods_barcode"));
             List<ProductColor> colorList = productService.listproductAndColor(color);
             if (colorList != null && colorList.size() > 0) {
                 color = colorList.get(0);
-                item.setItemColorBar(itemJson.getString("goods_sn"));//商品69码
+                item.setItemColorBar(itemJson.getString("goods_barcode"));//商品69码
                 item.setItemNum(itemJson.getInt("sn"));//商品数量
                 item.setItemCreateTime(salesOrder.getSalesCreateTime());
                 item.setItemColorId(color.getColorId());
@@ -465,13 +465,13 @@ public class SalesOrderServiceImpl implements SalesOrderService {
             } else {
                 //获取配件信息
                 FittingsInfo fittingsInfo = new FittingsInfo();
-                fittingsInfo.setFittingsBar(itemJson.getString("goods_sn"));
+                fittingsInfo.setFittingsBar(itemJson.getString("goods_barcode"));
                 List<FittingsInfo> Fittings = fittingsInfoMapper.listFittings(fittingsInfo);
                 if (Fittings == null || Fittings.size() == 0) {
                     continue;
                 }
                 fittingsInfo = Fittings.get(0);
-                item.setItemColorBar(itemJson.getString("goods_sn"));//商品69码
+                item.setItemColorBar(itemJson.getString("goods_barcode"));//商品69码
                 item.setItemNum(itemJson.getInt("sn"));//商品数量
                 item.setItemCreateTime(salesOrder.getSalesCreateTime());
                 item.setItemColorId(fittingsInfo.getFittingsId());
@@ -486,12 +486,11 @@ public class SalesOrderServiceImpl implements SalesOrderService {
                 itemList.add(item);
             }
         }
-        //添加订单和订单项
         boolean flag = salesOrderService.addOrderAndItem(salesOrder,itemList);
         if (flag) {
             return true;
         } else {
-            return false;
+            throw  new RuntimeException("添加订单项出错!");
         }
     }
 

+ 9 - 3
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSalesOrderController.java

@@ -318,13 +318,19 @@ public class AdminSalesOrderController {
             //获取订单详情
             JSONObject orderInfo = efastOrderService.getOrderFormEfastByOrderId(salesDealCode);
             //添加订单和订单项
-            boolean flag = salesOrderService.syncEfastOrder(orderInfo);
+            boolean flag = true;
+            try {
+                flag = salesOrderService.syncEfastOrder(orderInfo);
+            }catch (Exception e){
+                return new ResponseJson(500, e.getMessage(), 500);
+            }
             if (flag) {
                 return new ResponseJson(200, "同步成功!", 200);
             } else {
-                return new ResponseJson(500, "没有查到该订单信息!", 500);
+                return new ResponseJson(500, "同步订单错误!", 500);
             }
         }
-
     }
+
+
 }

+ 1 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/OrderTask.java

@@ -33,7 +33,7 @@ public class OrderTask implements InitializingBean {
     }
 
    // @Scheduled(cron = "0 0/4 * * * ?")//每*分钟执行一次
-    @Scheduled(cron = "0 0 */2 * * ?")//每小时执行一次
+//    @Scheduled(cron = "0 0 */2 * * ?")//每小时执行一次
     public void completeOrder() {
         logger.info("------------执行消息提醒,修改已处理的订单至已完成状态 start-----------");
         List<Order> orderList = orderService.listNoCompleteOrder();

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

@@ -105,8 +105,8 @@
                     <div class="radio-box">
                         <input type="radio" id="tel-3" name="customerSourceType" value="3" <#if customerInfo.customerSourceType == 3 >checked</#if>>
                         <label for="tel-3">其他</label>
-                        <input type="text" style="width: 321px;margin-left: 10px; <#if customerInfo.customerSourceType != 3 >display: none;</#if>" class="input-text" value="" placeholder="" id="customerSourceOld" name="customerSourceOld" placeholder="">
-                        <input type="hidden" value="${customerInfo.customerSource!''}" placeholder="" id="customerSource" name="customerSource"  >
+                        <input type="text" style="width: 321px;margin-left: 10px; <#if customerInfo.customerSourceType != 3 >display: none;</#if>" class="input-text" value="${customerInfo.customerSource!''}" placeholder="" id="customerSourceOld" name="customerSourceOld" placeholder="">
+                        <input type="hidden" value="" placeholder="" id="customerSource" name="customerSource"  >
                     </div>
                 </div>
             </div>