Ver código fonte

批次列表通知配货

wangxiaoming 6 anos atrás
pai
commit
7b1136459c

+ 10 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/order/OrderBatch.java

@@ -35,6 +35,8 @@ public class OrderBatch  implements  Serializable{
     private Integer pendingReviewNum;
     //待发货数量
     private Integer pendingDeliveredNum;
+    //已配货数量
+    private Integer noticeDistNum;
     //已发货数量
     private Integer shippedNum;
 
@@ -158,4 +160,12 @@ public class OrderBatch  implements  Serializable{
     public void setEndDate(Date endDate) {
         this.endDate = endDate;
     }
+
+    public Integer getNoticeDistNum() {
+        return noticeDistNum;
+    }
+
+    public void setNoticeDistNum(Integer noticeDistNum) {
+        this.noticeDistNum = noticeDistNum;
+    }
 }

+ 1 - 2
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/SalesOrderService.java

@@ -264,13 +264,12 @@ public interface SalesOrderService {
     Integer listConfirmSalesOrderByBatch(String salesBatchId);
 
     /**
-     * 批量确认订单
+     * 批量通知配货
      * @param salesOrder
      * @return
      */
     Integer noticeDistribution(SalesOrder salesOrder);
 
-
     /**
      * 确认订单,需要传入完整的order
      * @param salesId

+ 2 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/SalesOrderMapper.java

@@ -220,11 +220,12 @@ public interface SalesOrderMapper {
     Integer delOrderById(Integer ids);
 
     /**
-     * 批量确认订单
+     * 通知配货
      * @param salesOrder
      * @return
      */
     Integer noticeDistribution(SalesOrder salesOrder);
+
     /**
      * 分配物流方式
      * @param salesOrder

+ 2 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml

@@ -1259,7 +1259,7 @@
             sales_batch_id = #{salesBatchId}
     </update>
 
-    <!-- 批量配货 -->
+    <!-- 批量配货 - 按照订单id -->
     <update id="noticeDistribution" parameterType="SalesOrder">
         update tb_rst_sales_order_info
         SET
@@ -1274,6 +1274,7 @@
         AND
           sales_id = #{salesId}
     </update>
+
     <!-- 分配发货方式 -->
     <update id="distributionExpress" parameterType="SalesOrder">
         update tb_rst_sales_order_info

+ 4 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/order/OrderBatchServiceImpl.java

@@ -46,7 +46,7 @@ public class OrderBatchServiceImpl  implements OrderBatchService {
             //是否有需要确认的订单   0:有   1:没有
             Integer flag = 1;
             //待审核数量  , 代发货 , 已发货
-            Integer pendingReviewNum = 0,pendingDeliveredNum=0,shippedNum=0;
+            Integer pendingReviewNum = 0,pendingDeliveredNum=0,shippedNum=0,noticeDistNum=0;
             HashSet store = new HashSet();
             for (SalesOrder so: salesOrderList) {
                 store.add(so.getStoreName());
@@ -56,6 +56,8 @@ public class OrderBatchServiceImpl  implements OrderBatchService {
                 }
                 if(so.getSalesShippingStatus() == null || so.getSalesShippingStatus() == 0 ){
                     pendingDeliveredNum ++;
+                }else if(so.getSalesShippingStatus() == 11){
+                    noticeDistNum++;
                 }else if(so.getSalesShippingStatus() == 1){
                     shippedNum++;
                 }
@@ -70,6 +72,7 @@ public class OrderBatchServiceImpl  implements OrderBatchService {
             ob.setPendingReviewNum(pendingReviewNum);
             ob.setPendingDeliveredNum(pendingDeliveredNum);
             ob.setShippedNum(shippedNum);
+            ob.setNoticeDistNum(noticeDistNum);
         }
         return PageUtil.getPage(list);
     }

+ 44 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/order/AdminOrderBatchController.java

@@ -94,6 +94,50 @@ public class AdminOrderBatchController {
 
 
     /**
+     * 通知配货
+     * @param request
+     * @return
+     */
+    @ResponseBody
+    @RequiresPermissions("salesOrder:distribution:salesOrder")
+    @RequestMapping("/noticeOfDist_order")
+    public ResponseJson noticeOfDist_order(HttpServletRequest request, String batchId,Integer warehouseId) {
+        ResponseJson rj = ResponseJson.getFAILURE();
+        if(batchId == null || warehouseId == null || warehouseId == 0){
+            return rj;
+        }
+
+        SalesOrder salesOrder = new SalesOrder();
+        salesOrder.setSalesBatchId(batchId);
+        List<SalesOrder> salesOrderList = salesOrderService.listSalesOrder(salesOrder);
+        String ids = "";
+        Integer flag = 0;
+        for (SalesOrder so:salesOrderList) {
+            if(so.getSalesStatus() == 1 && so.getSalesShippingStatus() == 0){  //salesStatus
+                SalesOrder newOrder = new SalesOrder();
+                newOrder.setSalesId(so.getSalesId());
+                newOrder.setSalesOrderId(salesOrder.getSalesDealCode());
+                newOrder.setSalesShippingStatus(11);
+                newOrder.setSalesWarehouseId(warehouseId);
+                salesOrderService.noticeDistribution(newOrder);
+            }else{
+                ids += so.getSalesDealCode()+",";
+                flag++;
+            }
+        }
+        if("".equals(ids)){
+            rj = ResponseJson.getSUCCESS();
+            return rj;
+        }
+        rj = ResponseJson.getSUCCESS();
+        rj.setReturnCode(500);
+        rj.addResponseKeyValue("number",flag);
+        rj.addResponseKeyValue("ids",ids);
+        return rj;
+    }
+
+
+    /**
      * 按照批次分配快递方式
      * @param request
      * @return

+ 80 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/order/bacth/order_batch_list.ftl

@@ -76,6 +76,7 @@
                             <td><a href="javascript:void(0)" style="color: #00E;" title="点击转到订单页面,查询该批次的所有订单" onclick="to_order_list('${batch.batchId!''}',1)">${batch.batchOrderNum!'0'}</a></td>
                             <td><a href="javascript:void(0)" style="color: #00E;" title="点击转到订单页面,查询该批次的所有订单" onclick="to_order_list('${batch.batchId!''}',2)">${batch.pendingReviewNum!'0'}</a></td>
                             <td><a href="javascript:void(0)" style="color: #00E;" title="点击转到订单页面,查询该批次的所有订单" onclick="to_order_list('${batch.batchId!''}',3)">${batch.pendingDeliveredNum!'0'}</a></td>
+                            <#--<td><a href="javascript:void(0)" style="color: #00E;" title="点击转到订单页面,查询该批次的所有订单" onclick="to_order_list('${batch.batchId!''}',11)">${batch.noticeDistNum!'0'}</a></td>-->
                             <td><a href="javascript:void(0)" style="color: #00E;" title="点击转到订单页面,查询该批次的所有订单" onclick="to_order_list('${batch.batchId!''}',4)">${batch.shippedNum!'0'}</a></td>
 
                             <td>${(batch.batchCreateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
@@ -89,6 +90,13 @@
                                         确认订单
                                     </a>
                                 </#if>
+
+                                <#if ((batch.shippedNum+batch.noticeDistNum) < batch.batchOrderNum)>
+                                    <a style="text-decoration:none;color: #50a2ea;" href="javascript:void(0);" title="确认订单" onclick="chooseWarehouse('${batch.batchId!''}')">
+                                        通知配货
+                                    </a>
+                                </#if>
+
                                 <a style="text-decoration:none;color: #50a2ea;" href="javascript:void(0);" title="分配物流"onclick="distribution_postFirm('分配物流','${path}/admin/order_batch/to_distribution_postFirm?batchId=${batch.batchId!''}','570','450');">
                                     分配物流
                                 </a>
@@ -102,6 +110,27 @@
     </table>
     </div>
 </div>
+
+<div style="display: none">
+    <div id="warehouse">
+        <div class="row cl"  style="width: 500px;height: 200px;margin-left: 35px;">
+            <div style="background-color: #7f9db9;margin-left: 10px;width: 200px;height: 150px;float:left;margin-left: 60px;">
+                <div class="radio-box" style="margin: 10px">
+                    <input  type="radio" id="warehouseId-1" name="warehouseId" value="1" checked>
+                    <label for="warehouseId-1"><strong>正常销售仓库</strong></label><br>
+                    <span>正常的销售订单,以及含有非优尼雅生产的产品订单</span>
+                </div>
+            </div>
+            <div class="radioDiv" style="background-color: #7f9db9;margin-left: 10px;width: 200px;height: 150px;float:left;">
+                <div class="radio-box" style="margin: 10px">
+                    <input type="radio" id="warehouseId-2" name="warehouseId" value="2" >
+                    <label for="warehouseId-2"><strong>售后订单仓库</strong></label><br>
+                    <span>WaterO净水机产品维修,选择售后仓库</span>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
 <tfoot>
 <#include "/base/page_util.ftl">
 </tfoot>
@@ -158,6 +187,57 @@
         });
     }
 
+    /**
+     * 选择仓库
+     */
+    function chooseWarehouse(id) {
+        layer.open({
+            type: 1
+            , title: "选择仓库" //不显示标题栏
+            , closeBtn: false
+            , area: ['600px', '300px']
+            , shade: 0.8
+            , id: 'LAY_layuipro' //设定一个id,防止重复弹出
+            , btn: ['确认', '取消']
+            , btnAlign: 'c'
+            , moveType: 1 //拖拽模式,0或者1
+            , content: $('#warehouse').html()
+            ,yes: function(index){
+                var warehouseId = $('input:radio[name="warehouseId"]:checked').val();
+                noticeOfDist_order(id,warehouseId)
+            }
+        })
+    }
+
+    /**
+     * 通知配货
+     */
+    function noticeOfDist_order(batchId,warehouseId){
+        $.ajax('${path}/admin/order_batch/noticeOfDist_order?dates=' + new Date().getTime(), {
+            data: {
+                "batchId":batchId,
+                "warehouseId":warehouseId
+            },
+            dataType: 'json',
+            type: 'post',
+            timeout: 15000,
+            success: function(res) {
+                if(res.resultCode == 200 && res.returnCode == 200){
+                    location.reload();
+                }else{
+                    layer.alert("通知配货异常!请检查订单状态与物流公司,异常订单ID:"+res.returnMsg.ids, function(indexy){
+                        layer.close(indexy);
+                        location.reload();
+                    });
+                }
+                return false;
+            },
+            error: function(xhr, type, errorThrown) {
+                layer.msg("通知配货失败,请重试!", {icon: 5, time: 3000});
+            }
+        });
+    }
+
     /*分配快递方式*/
     function distribution_postFirm(title,url,w,h){
         layer_show(title,url,w,h);

+ 133 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/notice_distribution.ftl

@@ -0,0 +1,133 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
+    <meta http-equiv="Cache-Control" content="no-siteapp"/>
+    <#include "/base/add_base.ftl">
+
+    <style>
+        .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
+        .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
+        .tit-2{position: relative;text-align: left;font-size: 16px;padding-left: 10px;color: #50a2ea;}
+        .tit-2:after{content: '';position: absolute;left: 0;top: 45%;height: 6px;width: 6px;border-radius: 6px;background-color: #32a3d8;}
+        #province select{margin-right:10px; width:100px;height: 31px;-webkit-appearance:none !important;appearance:none;background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;padding-left:3px;padding-right: 25px;}
+        .ac_results li a {white-space: nowrap;text-decoration:none;display:block;color:#05a;padding:1px 3px}
+        .ac_results li {border:1px solid #fff}
+        .ac_results li a span {float:right}
+        .select-box{background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;}
+        .select-box select{-webkit-appearance:none !important;background-color: transparent; appearance:none;padding-right: 15px;}
+        .dalog-ask{position: absolute;left:60%;top:0;-webkit-transform: translateY(-30%);transform: translateY(-30%);display: none;background-color: #fff;z-index: 10;}
+        .tag{ width:300px; min-height:300px; border:1px solid #32a3d8; position:relative;background-color: #fff;line-height: 1.5;padding: 10px 12px;}
+        .tag em{display:block; border-width:15px; position:absolute; top:30%; left:-30px;border-style:solid dashed dashed; border-color:transparent  #32a3d8 transparent transparent;font-size:0; line-height:0;}
+        .time-line-list{list-style: none;width: 100%;margin-left: -20px;}
+        .time-line-list>li{position: relative;float: left; text-align: center;width: 100px;overflow: hidden;white-space: nowrap;word-break: break-all;padding: 2px 0;}
+        .time-line-list .number{display: inline-block; padding: 2px; background: #32a3d8;border: 2px solid #fff;box-shadow:0 0 0 1px #32a3d8;width: 20px;height: 20px;color: #fff;line-height: 20px;border-radius: 50%;}
+        .time-line-list>li:before{content:'';position: absolute;height: 1px;width: 30%;right:0;top: 15px; background-color: #32a3d8;}
+        .time-line-list>li:after{content: '';position: absolute;height: 1px;width: 30%;left: 0;top: 15px;background:#32a3d8;}
+        .time-line-list>li:first-child:after,.time-line-list>li:last-child:before{display: none;}
+        .time-line-list .arrow{border-width:7px; position:absolute; left:25%; top:9px;border-style:solid dashed dashed; border-color:transparent  transparent  transparent #32a3d8;font-size:0; line-height:0;}
+        .time-line-list>li:first-child .arrow{display: none;}
+        .table-bg th{background-color: #e2f6ff;}
+        .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
+        .msg-phone{height: 35px;line-height: 35px;}
+        .col-sm-1{width: 150px;}
+
+        .all_down{text-decoration: underline;color: #f00;}
+    </style>
+    <title>通知配货 - 订单管理 - RST</title>
+</head>
+<body>
+
+<article class="page-container" style="padding: 10px;">
+    <div class="pd-20 cl">
+        <form action="${path}/admin/salesOrder/add_salesOrder" method="post" class="form form-horizontal" id="form-order-add"  onkeydown="if(event.keyCode==13)return false;">
+
+            <div class="row cl"  style="width: 500px;height: 200px;margin-left: 35px;">
+                <div style="background-color: #7f9db9;margin-left: 10px;width: 200px;height: 150px;float:left;margin-left: 60px;">
+                    <div class="radio-box" style="margin: 10px">
+                        <input  type="radio" id="warehouseId-1" name="warehouseId" value="1" checked>
+                        <label for="warehouseId-1"><strong>正常销售仓库</strong></label><br>
+                        <span>正常的销售订单,以及含有非优尼雅生产的产品订单</span>
+                    </div>
+                </div>
+                <div class="radioDiv" style="background-color: #7f9db9;margin-left: 10px;width: 200px;height: 150px;float:left;">
+                    <div class="radio-box" style="margin: 10px">
+                        <input type="radio" id="warehouseId-2" name="warehouseId" value="2" >
+                        <label for="warehouseId-2"><strong>售后订单仓库</strong></label><br>
+                        <span>WaterO净水机产品维修,选择售后仓库</span>
+                    </div>
+                </div>
+            </div>
+
+            <div class="row cl">
+                <div class="col-2 col-sm-2 col-offset-3">
+                    <button class="btn btn-block btn-primary size-XL" type="submit">确认录入</button>
+                </div>
+            </div>
+        </form>
+    </div>
+</article>
+
+<script type="text/javascript">
+    var url_path = "${path}";
+</script>
+<#--时间控件-->
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+
+
+
+<script type="text/javascript">
+    var date = new Date();
+    var newyear = date.getFullYear();
+    var newmonth = date.getMonth() + 1;
+    var day = date.getDate();
+    var hours = date.getHours(); //获取当前小时数(0-23)
+    var minutes = date.getMinutes(); //获取当前分钟数(0-59)
+    var seconds = date.getSeconds(); //获取当前秒数(0-59)
+    newmonth = (newmonth<10 ? "0"+newmonth:newmonth);
+    var newdate = newyear+ "-"+newmonth + "-" + day +" "+hours+":"+minutes+":"+seconds;
+    $("#salesPayTime").val(newdate);
+    var salesCustomerId = "${salesOrder.salesCustomerId!''}";
+
+    $('.skin-minimal input').iCheck({
+        checkboxClass: 'icheckbox-blue',
+        radioClass: 'iradio-blue',
+        increaseArea: '20%'
+    });
+    var ulc = initAddress($(".address_info"));
+    var sc = $(".sales_channel").initSalesChannel();
+    
+    $(function () {
+       if(isEmpty(salesCustomerId)){
+           setSelectCustomer(salesCustomerId);
+       }
+    })
+
+    $("#store_1").on("input",function(){
+        var $options=$("#datalist_1").children();
+
+        for(var i=0;i<$options.length;i++){
+            if($options.eq(i).val().trim()==$("#store_1").val().trim()){
+                $("#salesStoreId").val($options.eq(i).attr("data-id"));
+                break;
+            }else{
+                $("#salesStoreId").val("");
+            }
+        }
+    });
+
+    /*如果修改信息时匹配地址出现失败,由此标识提醒一次,添加订单不需要次标识*/
+    var isNameCorrect = true;
+
+</script>
+
+
+<script type="text/javascript" charset="utf-8" src="${path}/common/js/salesOrder/salesOrder.js"></script>
+
+
+</body>
+</html>

+ 2 - 2
watero-rst-web/src/main/webapp/common/js/common/UnlimitedLevelContact.js

@@ -203,7 +203,7 @@
             var openList = new Array();
             if(arguments[1].constructor == Array){
                 openList.push(level);
-                for(var k=0;k<arguments[1].length;k++){
+                for(var k=0;k<arguments[1].length;k++){ //超出level则不进行push,浪费开销
                     openList.push(arguments[1][k]);
                 }
             }else{
@@ -251,7 +251,7 @@
             var openList = new Array();
             if(arguments[1].constructor == Array){
                 openList.push(level);
-                for(var k=0;k<arguments[1].length;k++){
+                for(var k=0;k<arguments[1].length;k++){ ////超出level则不进行push,浪费开销
                     openList.push(arguments[1][k]);
                 }
             }else{