Browse Source

优化库存列表

xian 4 years ago
parent
commit
862a7ef314

+ 35 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/InventoryInfo.java

@@ -36,6 +36,41 @@ public class InventoryInfo implements Serializable{
 
     private Integer logType;//类型1.采购 2.发货 3.次品
     private Integer productIsCombination;//是否组合产品 1.否。2是
+    /**
+     * 是否查询实物库存,如果确定,则不查询仓库的其他产品
+     */
+    private Integer isEntityInventory;
+
+    /**
+     * 接收前端传递的事务库存id
+     */
+    private Integer[] ids;
+
+    private String inventoryIDS;
+
+    public String getInventoryIDS() {
+        return inventoryIDS;
+    }
+
+    public void setInventoryIDS(String inventoryIDS) {
+        this.inventoryIDS = inventoryIDS;
+    }
+
+    public Integer getIsEntityInventory() {
+        return isEntityInventory;
+    }
+
+    public void setIsEntityInventory(Integer isEntityInventory) {
+        this.isEntityInventory = isEntityInventory;
+    }
+
+    public Integer[] getIds() {
+        return ids;
+    }
+
+    public void setIds(Integer[] ids) {
+        this.ids = ids;
+    }
 
     public Integer getInventoryId() {
         return inventoryId;

+ 8 - 2
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/inventoryMapper.xml

@@ -99,11 +99,17 @@
     LEFT jOIN tb_rst_order_warehouse ow on fi.warehouse_id  = ow.warehouse_id
 
     <where>
+
+      <if test="isEntityInventory != null and isEntityInventory == 2">
+        fi.inventory_id IN
+        <foreach collection="ids" index="index" item="item" open="(" separator="," close=")">#{item}</foreach>
+      </if>
+
       <if test="inventoryId != null and inventoryId != ''">
-        fi.inventory_id = #{inventoryId}
+        AND fi.inventory_id = #{inventoryId}
       </if>
       <if test="warehouseId != null">
-        fi.warehouse_id = #{warehouseId}
+        AND fi.warehouse_id = #{warehouseId}
       </if>
       <if test="inventoryProductName != null and inventoryProductName != ''">
         and fi.inventory_product_name like CONCAT('%',#{inventoryProductName},'%')

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

@@ -1,6 +1,7 @@
 package com.iamberry.rst.controllers.cm;
 
 import com.iamberry.redis.RedisUtils;
+import com.iamberry.rst.controllers.order.AdminSalesOrderController;
 import com.iamberry.rst.core.address.City;
 import com.iamberry.rst.core.address.District;
 import com.iamberry.rst.core.address.Province;
@@ -1820,7 +1821,7 @@ public class AdminCustomerController {
     @RequestMapping("/download_customer_excel")
     public ResponseJson downloadEfastOrderExcel(HttpServletRequest request, HttpServletResponse res, CustomerInfo customerInfo,Integer type) throws Exception {
         String path = request.getSession().getServletContext().getRealPath("/");
-        new Thread(new Mythread(path,customerInfo,type)).start();
+        AdminSalesOrderController.THREAD_POOL.submit(new Mythread(path,customerInfo,type));
         return new ResponseJson(200, "查询成功", 200);
     }
 
@@ -1857,7 +1858,8 @@ public class AdminCustomerController {
             List<CustomerStatisticalInfo> customerStatisticalInfoList = new ArrayList<>();
             SimpleDateFormat sdf4=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             for (CustomerStatisticalInfo customerInfo : customerList) {
-                long startTime=System.currentTimeMillis();   //获取开始时间
+                //获取开始时间
+                long startTime=System.currentTimeMillis();
                 s++;
                 //新建一个容器
                 CustomerStatisticalInfo customer = new CustomerStatisticalInfo();

+ 1 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminPtsBatchController.java

@@ -198,7 +198,7 @@ public class AdminPtsBatchController {
      */
     private boolean isValiData(PtsBatch ptsBatch) {
         boolean flag = true;
-        if(ptsBatch.getBatchNo() == null  || ptsBatch.getBatchNo().length() >= 20){
+        if(ptsBatch.getBatchNo() == null){
             return false;
         }
         if (ptsBatch.getBatchQuantity() == null || ptsBatch.getBatchQuantity() == 0){

+ 11 - 4
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/InventoryController.java

@@ -72,12 +72,19 @@ public class InventoryController {
         //查询当前登录人属于哪个仓库
         OrderWarehouse ow = salesOrderService.selectAdminWarehouse(admin.getAdminId());
         if(ow == null){
-            ModelAndView mv = new ModelAndView("order/salesOrder/error");
-            return mv;
+            return new ModelAndView("order/salesOrder/error");
+        }
+        // 判断是否请求实物数据
+        if (inventoryInfo.getIsEntityInventory() != null && inventoryInfo.getIsEntityInventory() == 2) {
+            String[] inventoryIDS = inventoryInfo.getInventoryIDS().split(",");
+            Integer[] ids = new Integer[inventoryIDS.length];
+            for (int i = inventoryIDS.length - 1; i >= 0; i--) {
+                ids[i] = Integer.parseInt(inventoryIDS[i]);
+            }
+            inventoryInfo.setIds(ids);
         }
 
         ModelAndView mv = new ModelAndView("cm/inventory/inventory_list");
-        StringBuilder url = new StringBuilder("/admin/inventory/select_inventory_list?pageSize=" + pageSize);
         // 封装请求数据
         PageRequest<InventoryInfo> pageRequest = new PageRequest<>(inventoryInfo, pageNO, pageSize, pageTotal == null);
         // 查询库存列表
@@ -100,7 +107,7 @@ public class InventoryController {
             total = pageTotal;
             result.setPages(total);
         }
-        StitchAttrUtil.getSa().setModelAndView(inventoryInfo, mv, "/admin/inventory/select_inventory_list", result);
+        StitchAttrUtil.getSa().addNoPro("ids").setModelAndView(inventoryInfo, mv, "/admin/inventory/select_inventory_list", result);
         return mv;
     }
 

+ 23 - 29
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inventory/inventory_list.ftl

@@ -3,7 +3,9 @@
 <head>
     <meta charset="UTF-8">
     <title></title>
-<#include "/base/list_base.ftl">
+    <#include "/base/list_base.ftl">
+    <!-- 新增需求引入js、css -->
+    <link href="${path}/common/lib/bootstrap/bootstrap.min.css" rel="stylesheet" />
     <style>
         *{padding: 0;margin: 0;}
         .my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 25px;margin-right: 5px;}
@@ -40,47 +42,39 @@
 <div class="page-container">
     <div class="text-c">
         <form name="form1" action="${path}/admin/inventory/select_inventory_list" method="post">
-            <#--<select id="inventoryProductBar" name="inventoryProductBar" class="select" style="width: 120px;">
-            <#if (productColorList?size > 0)>
-                <#list productColorList as product>
-                    <#if inventoryProductBar??>
-                        <option value="${product.colorBar!""}" <#if product.colorBar == inventoryProductBar>selected</#if>>${product.productName!""}</option>
-                    <#else >
-                        <option value="${product.colorBar!""}" >${product.productName!""}</option>
-                    </#if>
-                </#list>
-            </#if>
-            </select>
+            <input type="hidden" name="inventoryIDS" value="211,591,210,435,181,182,437,681,531,197,212,172,171,170,169,173,607,519,553,559,495,497,461,184,633,223,224,225,226,115,220,116,113,120,119,118,117,124,121,215,213,214,151,168,165"/>
 
-            <select id="productColorId" name="productColorId" class="select" style="width: 120px;">
-
-            </select>-->
-
-            <select class="my-select" name="warehouseId" style="height: 30px;width: 150px">
+            <select class="select" name="warehouseId" style="height: 35px;width: 150px">
                 <option value ="">选择仓库</option>
-            <#if (orderWarehouseList?size > 0)>
-                <#list orderWarehouseList as orderWarehouse>
-                    <option value ="${orderWarehouse.warehouseId!}" <#if warehouseId??><#if warehouseId == orderWarehouse.warehouseId>selected="selected"</#if></#if>>${orderWarehouse.warehouseName!}</option>
-                </#list>
-            </#if>
+                <#if (orderWarehouseList?size > 0)>
+                    <#list orderWarehouseList as orderWarehouse>
+                        <option value ="${orderWarehouse.warehouseId!}" <#if warehouseId??><#if warehouseId == orderWarehouse.warehouseId>selected="selected"</#if></#if>>${orderWarehouse.warehouseName!}</option>
+                    </#list>
+                </#if>
             </select>
 
-            <select class="my-select" name="productTypeId" style="height: 30px;width: 150px">
-                    <option value ="">选择产品类型</option>
+            <select class="select" name="isEntityInventory" style="height: 35px;width: 150px">
+                <option value ="1" <#if isEntityInventory?? && isEntityInventory == 1>selected</#if>>全部库存数据</option>
+                <option value ="2" <#if isEntityInventory?? && isEntityInventory == 2>selected</#if>>爱贝源实物库存</option>
+            </select>
+
+            <select class="select" name="productTypeId" style="height: 35px;width: 150px">
+                <option value ="">选择产品类型</option>
                 <#if (productTypeList?size > 0)>
                     <#list productTypeList as typeList>
                         <option value ="${typeList.typeId!}" <#if productTypeId??><#if productTypeId == typeList.typeId>selected="selected"</#if></#if>>${typeList.typeName!}</option>
                     </#list>
                 </#if>
              </select>
-                <input class="my-input" style="width: 100px;height: 29px;" type="text" name="inventoryProductName" value="${inventoryProductName!}" placeholder="产品名称"/>
-                <input class="my-input" style="width: 100px;height: 29px;" type="text" name="productColorName" value="${productColorName!}" placeholder="产品颜色"/>
-                <input class="my-input" style="width: 100px;height: 29px;" type="text" name="inventoryProductBar" value="${inventoryProductBar!}" placeholder="产品69码"/>
-            <button style="cursor:pointer;" type="submit" class="my-btn-search">搜索</button>
+
+            <input class="text-input" style="width: 100px;height: 25px;" type="text" name="inventoryProductName" value="${inventoryProductName!}" placeholder="产品名称"/>
+            <input class="text-input" style="width: 100px;height: 25px;" type="text" name="productColorName" value="${productColorName!}" placeholder="产品颜色"/>
+            <input class="text-input" style="width: 100px;height: 25px;" type="text" name="inventoryProductBar" value="${inventoryProductBar!}" placeholder="产品69码"/>
+            <button style="cursor:pointer;height: 35px;margin-bottom: 10px" type="submit" class="my-btn-search btn">搜索</button>
         </form>
     </div>
     <div class="mt-20">
-        <table class="table table-border table-bordered table-bg table-hover table-sort">
+        <table class="table table-bordered table-hover table-sort">
             <thead>
             <tr class="text-c">
                 <th width="50">仓库</th>