wangxiaoming 6 lat temu
rodzic
commit
f17c352425

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

@@ -816,8 +816,16 @@
         update tb_rst_sales_order_info
         SET
         sales_post_firm = #{salesPostFirm}
-        WHERE
-        sales_batch_id = #{salesBatchId}
-        and sales_shipping_status != 1
+        <where>
+            <if test="salesBatchId !=null and salesBatchId !=''">
+                AND  sales_batch_id = #{salesBatchId}
+            </if>
+            <if test="salesIds != null and salesIds.length > 0 ">
+                AND sales_id IN
+                <foreach collection="salesIds" item="node" index="index" separator="," open="(" close=")">
+                    #{node}
+                </foreach >
+            </if>
+        </where>
     </update>
 </mapper>

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

@@ -5,7 +5,9 @@ import com.iamberry.rst.core.cm.SalesOrder;
 import com.iamberry.rst.core.order.OrderBatch;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.core.sys.Admin;
+import com.iamberry.rst.core.tools.LogisticsInfo;
 import com.iamberry.rst.faces.cm.SalesOrderService;
+import com.iamberry.rst.faces.order.LogisticsInfoService;
 import com.iamberry.rst.faces.order.OrderBatchService;
 import com.iamberry.rst.utils.AdminUtils;
 import com.iamberry.rst.utils.StitchAttrUtil;
@@ -19,6 +21,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.List;
 
 @Controller
 @RequestMapping("/admin/order_batch")
@@ -28,6 +31,8 @@ public class AdminOrderBatchController {
     private OrderBatchService orderBatchService;
     @Autowired
     private SalesOrderService salesOrderService;
+    @Autowired
+    private LogisticsInfoService logisticsInfoService;
 
     /**
      * 批次列表
@@ -126,9 +131,12 @@ public class AdminOrderBatchController {
      */
     @RequiresPermissions("salesOrder:confirm:salesOrder")
     @RequestMapping(value = "/to_distribution_postFirm")
-    public ModelAndView toDistributionPostFirm(HttpServletRequest request,String batchId) {
+    public ModelAndView toDistributionPostFirm(HttpServletRequest request,String batchId,String salesIds) {
         ModelAndView mv = new ModelAndView("order/bacth/distribution_postFirm");
+        List<LogisticsInfo>logisticsInfoList =  logisticsInfoService.getLogisticsInfoList(new LogisticsInfo());
+        mv.addObject("logisticsInfoList",logisticsInfoList);
         mv.addObject("batchId",batchId);
+        mv.addObject("salesIds",salesIds);
         return mv;
     }
 

+ 15 - 18
watero-rst-web/src/main/webapp/WEB-INF/views/order/bacth/distribution_postFirm.ftl

@@ -33,28 +33,20 @@
         <div class="input-box"  >
             <span class="input-dic spanhidth" style="margin-top: 12px;margin-left: 120px;">快递方式:</span>
             <select class="my-select" name="salesPostFirm" id="salesPostFirm" style="height: 36px;width: 200px">
-                <option value="sto">申通快递</option>
-                <option value="yto">圆通快递</option>
-                <option value="sf">顺丰快递</option>
-                <option value="ems">邮政EMS</option>
-                <option value="zto">中通快递</option>
-                <option value="zjs">宅急送</option>
-                <option value="yunda">韵达快递</option>
-                <option value="cces">cces快递</option>
-                <option value="pick">上门提货</option>
-                <option value="htky">汇通快递</option>
-                <option value="ttkdex">天天快递</option>
-                <option value="stars">星晨急便</option>
-                <option value="jd">京东快递</option>
-                <option value="01">其他</option>
-                <option value="02">上门送货</option>
+                <#list logisticsInfoList as logisticsInfo>
+                    <option  value="${logisticsInfo.logisticsRstCode}">${logisticsInfo.logisticsName}</option>
+                </#list>
             </select>
         </div>
 
-        <div style="text-align:center;" >
         <#if batchId??>
             <input type="hidden" value="${batchId!''}" id="batchId" name="batchId">
         </#if>
+        <#if salesIds??>
+            <input type="hidden" value="${salesIds!''}" id="salesIds" name="salesIds">
+        </#if>
+
+        <div style="text-align:center;" >
             <button type="button" class="my-btn-submit" onclick="listSalesPostFirm();">确认分配</button>
         </div>
 
@@ -67,10 +59,15 @@
      * 分配快递方式
      */
     function listSalesPostFirm(){
-        var batchId = $("#batchId").val();
+        var batchId = cufte($("#batchId").val());
+        var salesIds = cufte($("#salesIds").val());
         var salesPostFirm = $("#salesPostFirm").val();
         $.ajax('${path}/admin/order_batch/list_SalesPostFirm?dates=' + new Date().getTime(), {
-            data: {"salesBatchId":batchId,"salesPostFirm" : salesPostFirm},
+            data: {
+                "salesIds":salesIds,
+                "salesBatchId":batchId,
+                "salesPostFirm" : salesPostFirm
+            },
             dataType: 'json',
             type: 'post',
             timeout: 15000,

Plik diff jest za duży
+ 4 - 4
watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/list_wait_send_order.ftl


+ 22 - 33
watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/sales_order_list.ftl

@@ -245,15 +245,19 @@
                             </a><br/>
                         </#if>
                         <#if order.salesStatus == 0>
-                        <a style="text-decoration:none" href="javascript:void(0);" title="确认订单" onclick="confirm_one(${order.salesId!''})">
-                            <font color=#06c>确认订单</font>
-                        </a><br/>
+                            <a style="text-decoration:none" href="javascript:void(0);" title="确认订单" onclick="confirm_one(${order.salesId!''})">
+                                <font color=#06c>确认订单</font>
+                            </a><br/>
                         </#if>
+
+                        <a style="text-decoration:none" href="javascript:void(0);" title="分配发货方式" onclick="distribution_express(${order.salesId!''})">
+                            <font color=#06c>分配发货方式</font>
+                        </a><br/>
                     </td>
                 </tr>
                 </#list>
             <#else>
-            <tr><td colspan="15" class="td-manage text-c" >暂时没有订单信息,请添加!</td></tr>
+                <tr><td colspan="15" class="td-manage text-c" >暂时没有订单信息,请添加!</td></tr>
             </#if>
             </tbody>
         </table>
@@ -262,39 +266,13 @@
             <div style="float: left;margin-top: 20px;">
                 <button type="button" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);height: 35px;" id="" onclick="noticeDistribution()">通知配货</button>
                 <button type="button" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);height: 35px;" id="" onclick="confirmOrder()">确认订单</button>
-                <button type="button" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);height: 35px;" id="" onclick="distribution_express()">分配快递公司</button>
+                <button type="button" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);height: 35px;" id="" onclick="distribution_express(null)">分配快递公司</button>
             </div>
         </#if>
 
     </div>
 </div>
 
-<!-- 同步订单状态 -->
-<div class="layui-layer layui-anim layui-layer-iframe" id="layui-Express" times="4" showtime="0" contype="string" style="display:none;z-index: 10; width: 400px; height: 260px; position: absolute; top: 100px; left: 379px;">
-    <form action="" method="post" class="form form-horizontal" id="form-admin-Express">
-        <div class="layui-layer-title" style="cursor: move;" move="ok">同步订单</div>
-        <br>
-        <div class="row cl">
-            <label class="form-label col-4" style="float: left;"><span class="c-red">*</span>&nbsp;快递公司:</label>
-            <div style="float: left;box-sizing: border-box;min-height: 1px;">
-                <select class="select" id="orderExpress" name="orderExpress">
-                    <#list logisticsInfoList as logisticsInfo>
-                        <option value="${logisticsInfo.logisticsRstCode}">${logisticsInfo.logisticsName}</option>
-                    </#list>
-                </select>
-            </div>
-            <div class="col-4"></div>
-        </div>
-        <br>
-        <div class="col-9 col-offset-3">
-            <input class="btn btn-primary radius" onclick="distributionOrderExpress()" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
-        </div>
-    </form>
-    <span class="layui-layer-setwin">
-        <a class="layui-layer-ico layui-layer-close layui-layer-close1" onclick="exitWindowsDiv(this);" href="javascript:;"></a>
-    </span>
-</div>
-
 <tfoot>
 <#include "/base/page_util.ftl">
 <script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>
@@ -518,8 +496,19 @@
         }
 
 
-        function distribution_express(){
-            $("#layui-Express").show();
+        function distribution_express(salesId){
+            if(salesId == null){
+                salesId = "";
+                $(".sales_id:checked").each(function(){
+                    var val = $(this).val();
+                    if(isEmpty(salesId)){
+                        salesId += ","+val
+                    }else{
+                        salesId = val
+                    }
+                })
+            }
+            layer_show("分配快递方式","${path}/admin/order_batch/to_distribution_postFirm?salesIds="+salesId,'570','450');
         }
 
         function distributionOrderExpress(){