From c6bc9682699d3e10dc06a3d6641a70179e64f9a1 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期二, 14 九月 2021 08:32:11 +0800
Subject: [PATCH] Merge branch 'xgmasrs' of https://gitee.com/luxiaotao1123/zy-asrs into xgmasrs

---
 src/main/java/com/zy/ints/service/impl/StockSyncServiceImpl.java     |   27 
 src/main/java/com/zy/asrs/entity/param/CombParam.java                |   18 
 src/main/java/com/zy/asrs/controller/LocMastController.java          |    2 
 src/main/java/com/zy/asrs/mapper/WrkDetlMapper.java                  |   12 
 src/main/java/com/zy/asrs/service/impl/MatStoreServiceImpl.java      |    5 
 src/main/resources/mapper/WaitMatchkMapper.xml                       |    6 
 src/main/resources/mapper/WaitMatinLogMapper.xml                     |    1 
 src/main/webapp/static/js/stoMan/stoQue.js                           |    1 
 src/main/webapp/views/report/viewStayTime.html                       |    2 
 src/main/java/com/zy/common/model/StartupDto.java                    |   10 
 src/main/java/com/zy/ints/task/handler/WaitMatoutLogHandler.java     |   40 
 src/main/webapp/static/js/pltBarcode/pltBarcode.js                   |  271 ++
 src/main/java/com/zy/asrs/utils/Utils.java                           |  175 +
 src/main/webapp/views/waitMatout/waitMatout.html                     |  310 +-
 src/main/java/com/zy/ints/mapper/StockSyncMapper.java                |   18 
 src/main/java/stockSync.sql                                          |   20 
 src/main/java/com/zy/ints/mapper/WaitMatinMapper.java                |    1 
 src/main/webapp/views/staDesc/staDesc.html                           |    5 
 src/main/java/com/zy/common/service/CommonService.java               |  328 ++
 src/main/webapp/views/waitMatchk/waitMatchk.html                     |   53 
 src/main/webapp/static/js/waitMatin/waitMatin.js                     |   76 
 src/main/java/com/zy/asrs/service/impl/PltBarcodeServiceImpl.java    |   19 
 src/main/java/com/zy/asrs/entity/CombBillQueryVo.java                |   41 
 src/main/java/com/zy/asrs/service/LocDetlService.java                |    9 
 src/main/java/com/zy/ints/service/WaitMatchkLogService.java          |    2 
 src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java          |  190 +
 src/main/webapp/static/js/pakStore/stockAdjust.js                    |    2 
 src/main/java/com/zy/asrs/service/impl/WrkDetlServiceImpl.java       |   13 
 src/main/java/com/zy/ints/service/impl/WaitMatinServiceImpl.java     |    7 
 src/main/java/com/zy/common/model/LocTypeDto.java                    |   65 
 src/main/java/com/zy/asrs/task/handler/PltBarcodeLogHandle.java      |   39 
 src/main/java/com/zy/ints/task/handler/IoCompleteLogHandler.java     |   39 
 src/main/java/com/zy/ints/mapper/IoCompleteMapper.java               |    3 
 src/main/java/com/zy/asrs/controller/BasWrkIotypeController.java     |   21 
 src/main/java/com/zy/ints/entity/WaitMatchk.java                     |   38 
 src/main/java/com/zy/asrs/entity/LocDetl.java                        |    2 
 src/main/java/com/zy/common/properties/SlaveProperties.java          |   24 
 src/main/webapp/static/js/waitMatout/waitMatout.js                   |  573 +++-
 src/main/resources/mapper/IoCompleteMapper.xml                       |    5 
 src/main/java/com/zy/ints/service/impl/WaitMatchkLogServiceImpl.java |    5 
 src/main/webapp/views/pda/stockQuery.html                            |   10 
 src/main/java/com/zy/asrs/task/PltBarcodeLogScheduler.java           |   30 
 src/main/java/com/zy/ints/service/IoCompleteService.java             |    3 
 src/main/java/com/zy/asrs/service/MatOutService.java                 |    2 
 src/main/java/com/zy/ints/service/WaitMatchkService.java             |    6 
 src/main/java/com/zy/ints/task/handler/WaitMatchkLogHandler.java     |   39 
 src/main/java/com/zy/ints/mapper/IoCompleteLogMapper.java            |   10 
 src/main/webapp/static/js/adjDetl/adjDetl.js                         |    2 
 src/main/webapp/views/pda/stockCheck.html                            |  483 ++++
 src/main/java/com/zy/ints/task/WaitMatchkLogScheduler.java           |   46 
 src/main/webapp/views/locMast/locMast.html                           |   75 
 src/main/webapp/views/pda/index.html                                 |   10 
 src/main/webapp/static/js/waitMatchkLog/waitMatchkLog.js             |    2 
 src/main/java/com/zy/ints/task/WaitMatinLogScheduler.java            |   48 
 src/main/resources/mapper/StockSyncMapper.xml                        |   38 
 src/main/java/com/zy/ints/mapper/WaitMatoutLogMapper.java            |    3 
 src/main/java/com/zy/asrs/service/PltBarcodeService.java             |   12 
 src/main/java/com/zy/common/web/param/SearchLocParam.java            |   30 
 src/main/webapp/views/waitMatinLog/waitMatinLog.html                 |   12 
 src/main/webapp/views/pltBarcode/pltBarcode.html                     |  218 +
 src/main/java/com/zy/ints/controller/IoCompleteController.java       |   16 
 src/main/java/com/zy/ints/service/WaitMatoutService.java             |   11 
 src/main/webapp/static/js/locMast/locMast.js                         |   16 
 src/main/java/com/zy/asrs/controller/MatStoreController.java         |    1 
 src/main/resources/application.yml                                   |   15 
 src/main/java/com/zy/asrs/mapper/LocDetlMapper.java                  |   12 
 src/main/java/com/zy/ints/controller/StockSyncController.java        |  123 +
 src/main/java/com/zy/ints/service/impl/IoCompleteServiceImpl.java    |    7 
 src/main/java/com/zy/asrs/mapper/PltBarcodeMapper.java               |   18 
 src/main/resources/mapper/LocDetlMapper.xml                          |    6 
 src/main/resources/mapper/LocMastMapper.xml                          |   15 
 src/main/java/com/zy/ints/service/impl/WaitMatchkServiceImpl.java    |    7 
 src/main/webapp/static/js/matStore/matStore.js                       |    2 
 src/main/webapp/static/js/wrkMast/wrkMast.js                         |    1 
 src/main/resources/mapper/WaitMatoutMapper.xml                       |   54 
 src/main/webapp/static/js/waitMatoutLog/waitMatoutLog.js             |    2 
 src/main/java/com/zy/asrs/controller/PltBarcodeController.java       |  157 +
 src/main/java/com/zy/ints/service/IoCompleteLogService.java          |    1 
 src/main/java/com/zy/ints/service/impl/WaitMatoutLogServiceImpl.java |    5 
 src/main/java/com/zy/ints/mapper/WaitMatinLogMapper.java             |    4 
 src/main/java/com/zy/ints/controller/WaitMatinLogController.java     |   16 
 src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java          |   78 
 src/main/java/com/zy/ints/service/impl/WaitMatinLogServiceImpl.java  |    8 
 src/main/java/com/zy/asrs/mapper/LocMastMapper.java                  |    7 
 src/main/java/com/zy/asrs/entity/WrkDetl.java                        |    6 
 src/main/java/com/zy/ints/service/WaitMatinLogService.java           |    2 
 src/main/java/com/zy/ints/controller/IoCompleteLogController.java    |   16 
 src/main/webapp/static/js/common.js                                  |    2 
 src/main/webapp/views/waitMatoutLog/waitMatoutLog.html               |   12 
 src/main/webapp/static/js/wrkDetl/wrkDetl.js                         |    3 
 src/main/java/com/zy/asrs/entity/PltBarcode.java                     |  472 ++++
 src/main/java/com/zy/ints/service/WaitMatoutLogService.java          |    1 
 src/main/webapp/views/locStatis/locStatis.html                       |    3 
 src/main/java/com/zy/ints/entity/StockSync.java                      |  233 ++
 src/main/resources/mapper/WaitMatinMapper.xml                        |    5 
 src/main/java/com/zy/ints/task/IoCompleteLogScheduler.java           |   47 
 src/main/java/com/zy/common/CodeBuilder.java                         |    7 
 src/main/webapp/views/pda/matQuery.html                              |    8 
 src/main/java/com/zy/ints/mapper/WaitMatchkMapper.java               |    6 
 src/main/java/com/zy/asrs/utils/VersionUtils.java                    |   43 
 src/main/java/com/zy/ints/mapper/WaitMatoutMapper.java               |    9 
 src/main/java/com/zy/ints/service/impl/IoCompleteLogServiceImpl.java |    5 
 src/main/java/com/zy/ints/mapper/WaitMatchkLogMapper.java            |    5 
 src/main/webapp/views/pda/comb.html                                  |    2 
 src/main/webapp/static/js/locStatis/locStatis.js                     |   70 
 src/main/java/com/zy/common/web/WcsController.java                   |  219 +
 src/main/webapp/static/js/ioCompleteLog/ioCompleteLog.js             |    2 
 src/main/java/com/zy/ints/service/impl/WaitMatoutServiceImpl.java    |   16 
 src/main/java/com/zy/asrs/task/handler/PlcLogHandler.java            |    9 
 src/main/webapp/views/adjDetl/adjDetl.html                           |   10 
 src/main/java/pltBarcode.sql                                         |   20 
 src/main/java/com/zy/asrs/task/AbstractHandler.java                  |    2 
 src/main/java/com/zy/asrs/service/impl/MatOutServiceImpl.java        |   10 
 src/main/webapp/views/stoMan/stoQue.html                             |   34 
 src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java        |  124 
 src/main/java/com/zy/ints/service/WaitMatinService.java              |    7 
 src/main/webapp/views/waitMatchkLog/waitMatchkLog.html               |   12 
 src/main/java/com/zy/asrs/service/WrkDetlService.java                |    7 
 src/main/webapp/static/js/report/stayTime.js                         |   11 
 src/main/webapp/views/pda/combPro.html                               |  415 +++
 src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java       |   13 
 src/main/webapp/static/js/waitMatchk/waitMatchk.js                   |  137 
 src/main/java/com/zy/asrs/controller/LocDetlController.java          |   33 
 src/main/webapp/static/js/waitMatinLog/waitMatinLog.js               |    2 
 src/main/webapp/views/ioCompleteLog/ioCompleteLog.html               |   12 
 src/main/java/com/zy/ints/task/WaitMatoutLogScheduler.java           |   47 
 src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java       |   13 
 src/main/java/com/zy/asrs/controller/MobileController.java           |  127 +
 src/main/java/com/zy/ints/controller/WaitMatoutController.java       |  119 
 src/main/webapp/static/js/cool.js                                    |   34 
 src/main/java/com/zy/ints/controller/WaitMatoutLogController.java    |   16 
 src/main/java/com/zy/ints/task/handler/WaitMatinLogHandler.java      |   44 
 src/main/java/com/zy/asrs/controller/StatisController.java           |   81 
 src/main/java/com/zy/ints/service/StockSyncService.java              |   14 
 src/main/resources/mapper/PltBarcodeMapper.xml                       |   31 
 src/main/java/com/zy/ints/controller/WaitMatchkLogController.java    |   16 
 src/main/java/com/zy/ints/controller/WaitMatchkController.java       |  116 
 src/main/java/com/zy/asrs/service/LocMastService.java                |    9 
 src/main/java/com/zy/asrs/controller/ReportQueryController.java      |    3 
 139 files changed, 6,051 insertions(+), 810 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/BasWrkIotypeController.java b/src/main/java/com/zy/asrs/controller/BasWrkIotypeController.java
index 18edf8c..20b2776 100644
--- a/src/main/java/com/zy/asrs/controller/BasWrkIotypeController.java
+++ b/src/main/java/com/zy/asrs/controller/BasWrkIotypeController.java
@@ -5,7 +5,9 @@
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.baomidou.mybatisplus.plugins.Page;
+import com.zy.asrs.entity.BasLocSts;
 import com.zy.asrs.entity.BasWrkIotype;
+import com.zy.asrs.service.BasLocStsService;
 import com.zy.asrs.service.BasWrkIotypeService;
 import com.zy.common.web.BaseController;
 import com.core.annotations.ManagerAuth;
@@ -23,6 +25,9 @@
 
     @Autowired
     private BasWrkIotypeService basWrkIotypeService;
+
+    @Autowired
+    private BasLocStsService basLocStsService;
 
     @RequestMapping(value = "/basWrkIotype/{id}/auth")
     @ManagerAuth
@@ -134,6 +139,22 @@
         return R.ok(result);
     }
 
+    @RequestMapping(value = "/locStacQuery/auth")
+    @ManagerAuth
+    public R queryloc(String condition) {
+        EntityWrapper<BasLocSts> wrapper = new EntityWrapper<>();
+        wrapper.like("lo_sts", condition);
+        Page<BasLocSts> page = basLocStsService.selectPage(new Page<>(0, 10), wrapper);
+        List<Map<String, Object>> result = new ArrayList<>();
+        for (BasLocSts basLocSts : page.getRecords()){
+            Map<String, Object> map = new HashMap<>();
+            map.put("id", basLocSts.getLocSts());
+            map.put("value", basLocSts.getLocDesc());
+            result.add(map);
+        }
+        return R.ok(result);
+    }
+
     @RequestMapping(value = "/basWrkIotype/check/column/auth")
     @ManagerAuth
     public R query(@RequestBody JSONObject param) {
diff --git a/src/main/java/com/zy/asrs/controller/LocDetlController.java b/src/main/java/com/zy/asrs/controller/LocDetlController.java
index fa4279c..da624a0 100644
--- a/src/main/java/com/zy/asrs/controller/LocDetlController.java
+++ b/src/main/java/com/zy/asrs/controller/LocDetlController.java
@@ -11,7 +11,9 @@
 import com.core.common.DateUtils;
 import com.core.common.R;
 import com.zy.asrs.entity.LocDetl;
+import com.zy.asrs.entity.LocMast;
 import com.zy.asrs.service.LocDetlService;
+import com.zy.asrs.service.LocMastService;
 import com.zy.common.web.BaseController;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -23,6 +25,9 @@
 
     @Autowired
     private LocDetlService locDetlService;
+
+    @Autowired
+    private LocMastService locMastService;
 
     @RequestMapping(value = "/locDetl/update")
     public R update1() {
@@ -104,6 +109,34 @@
         }
     }
 
+
+    @RequestMapping(value = "/locDetl/list/sts")
+    @ManagerAuth
+    public R stsList(@RequestParam(defaultValue = "1")Integer curr,
+                  @RequestParam(defaultValue = "10")Integer limit,
+                  @RequestParam(required = false)String orderByField,
+                  @RequestParam(required = false)String orderByType,
+                  @RequestParam(required = false)String condition,
+                  @RequestParam Map<String, Object> param){
+        excludeTrash(param);
+        String value= null;
+        for (String s : param.keySet()) {
+            value= (String) param.get(s);
+        }
+        LocMast loc_no = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", value));
+        if (loc_no.getLocSts().equals("O")||loc_no.getLocSts().equals("F")){
+            EntityWrapper<LocDetl> wrapper = new EntityWrapper<>();
+            convert(param, wrapper);
+            allLike(LocDetl.class, param.keySet(), wrapper, condition);
+            if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
+            return R.ok(locDetlService.selectPage(new Page<>(curr, limit), wrapper));
+        }else {
+            return R.error("璇ュ簱浣嶅綋鍓嶇姸鎬佷笉鑳借皟鏁�");
+        }
+    }
+
+
+
     @RequestMapping(value = "/locDetl/add/auth")
     @ManagerAuth(memo = "搴撲綅鏄庣粏娣诲姞")
     public R add(LocDetl locDetl) {
diff --git a/src/main/java/com/zy/asrs/controller/LocMastController.java b/src/main/java/com/zy/asrs/controller/LocMastController.java
index f923059..94a4820 100644
--- a/src/main/java/com/zy/asrs/controller/LocMastController.java
+++ b/src/main/java/com/zy/asrs/controller/LocMastController.java
@@ -164,7 +164,7 @@
     @RequestMapping(value = "/locMast/init/auth")
     @ManagerAuth(memo = "鍒濆鍖栧簱浣�")
 //    @Transactional
-    public R init(LocMastInitParam param) {
+    public synchronized R init(LocMastInitParam param) {
         List<LocMast> list = new ArrayList<>();
         for (int r=param.getStartRow(); r<=param.getEndRow(); r++){
             for (int b=param.getStartBay(); b<=param.getEndBay(); b++) {
diff --git a/src/main/java/com/zy/asrs/controller/MatStoreController.java b/src/main/java/com/zy/asrs/controller/MatStoreController.java
index bbfe7ff..d7ce416 100644
--- a/src/main/java/com/zy/asrs/controller/MatStoreController.java
+++ b/src/main/java/com/zy/asrs/controller/MatStoreController.java
@@ -28,7 +28,6 @@
     @RequestMapping("/mat/store/start")
     @ManagerAuth(memo = "鍏ュ簱鍚姩(閫氱煡妗�)")
     public R matStoreStart(@RequestBody FullStoreParam fullStoreParam) {
-//        return R.ok("鍏ュ簱鍚姩鎴愬姛").add(workService.startupFullPutStore(fullStoreParam,getUserId()));
         return R.ok("鍏ュ簱鍚姩鎴愬姛").add(matStoreService.startupFullStore(fullStoreParam,getUserId()));
     }
 }
diff --git a/src/main/java/com/zy/asrs/controller/MobileController.java b/src/main/java/com/zy/asrs/controller/MobileController.java
index cefa784..3851b5f 100644
--- a/src/main/java/com/zy/asrs/controller/MobileController.java
+++ b/src/main/java/com/zy/asrs/controller/MobileController.java
@@ -1,27 +1,32 @@
 package com.zy.asrs.controller;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.core.annotations.ManagerAuth;
 import com.core.common.BaseRes;
 import com.core.common.Cools;
 import com.core.common.R;
-import com.zy.asrs.entity.LocDetl;
-import com.zy.asrs.entity.LocMast;
-import com.zy.asrs.entity.WrkDetl;
+import com.core.exception.CoolException;
+import com.zy.asrs.entity.*;
 import com.zy.asrs.entity.param.CombParam;
-import com.zy.asrs.service.LocDetlService;
-import com.zy.asrs.service.LocMastService;
-import com.zy.asrs.service.MobileService;
-import com.zy.asrs.service.WrkDetlService;
+import com.zy.asrs.service.*;
 import com.zy.common.model.MobileLocDetlVo;
 import com.zy.common.web.BaseController;
+import com.zy.ints.entity.WaitMatchk;
+import com.zy.ints.entity.WaitMatin;
+import com.zy.ints.service.WaitMatchkService;
+import com.zy.ints.service.WaitMatinService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -40,6 +45,12 @@
     private LocDetlService locDetlService;
     @Autowired
     private WrkDetlService wrkDetlService;
+    @Autowired
+    private WaitMatinService waitMatinService;
+    @Autowired
+    private WaitMatchkService waitMatchkService;
+    @Autowired
+    private MatCodeService matCodeService;
 
     /**
      * 缁勬墭
@@ -50,7 +61,6 @@
         mobileService.comb(combParam, getUserId());
         return R.ok();
     }
-
 
     /**
      * 缁勬墭
@@ -160,4 +170,105 @@
         }
         return R.parse(BaseRes.PARAM);
     }
+
+    /**
+     * 鏍规嵁閫氱煡鍗曟煡璇㈡槑缁�
+     */
+    @RequestMapping("/bill/query/auth")
+    @ManagerAuth(memo = "鏍规嵁閫氱煡鍗曟煡璇㈡槑缁�")
+    public R billQuery(@RequestParam String billNo){
+        List<WaitMatin> waitMatins = waitMatinService.selectList(new EntityWrapper<WaitMatin>().eq("bill_no", billNo).last("and qty > in_qty"));
+        List<CombBillQueryVo> vos = new ArrayList<>();
+        if (!Cools.isEmpty(waitMatins)) {
+            for (WaitMatin waitMatin : waitMatins) {
+                CombBillQueryVo vo = new CombBillQueryVo();
+                vo.setMatNo(waitMatin.getMatNo());
+                vo.setMatName(waitMatin.getMatName());
+                vo.setCount(waitMatin.getQty()-waitMatin.getInQty());
+                vo.setBillNo(waitMatin.getBillNo());
+                vo.setSeqNo(waitMatin.getSeqNo());
+                vo.setUnit(waitMatin.getUnit());
+                vo.setSpecs(waitMatin.getSpecs());
+                vo.setSize(waitMatin.getSize());
+                vo.setColor(waitMatin.getColor());
+                vos.add(vo);
+            }
+        }
+        return R.ok().add(vos);
+    }
+
+    /**
+     * PDA鐩樼偣鏍规嵁鍑哄簱鍙f煡璇㈠搴旂墿鏂欎俊鎭�
+     */
+    @RequestMapping("/check/queryMatFromDevNo")
+    public R queryMatFromDevNo(Integer devNo) {
+        List<WrkDetl> list = wrkDetlService.queryMatFromDevNo(devNo);
+        return R.ok().add(list);
+    }
+
+    /**
+     * 鏍规嵁PDA鐩樼偣鏁伴噺锛屾洿鏂扮洏鐐归�氱煡妗�
+     * @param param
+     * @return
+     */
+    @RequestMapping("/stock/check")
+    @Transactional
+    public R erpStockCheck(@RequestBody String param) {
+        Boolean flag = false;
+        JSONObject jsonObject = JSONObject.parseObject(param);
+        String checkListStr = jsonObject.getString("checkList");
+        List<WaitMatchk> checkList = JSONArray.parseArray(checkListStr, WaitMatchk.class);
+        Long userId = 9527L; //getUserId();//9527L;
+        int seq = 0;
+        Date now = new Date();
+        for (Integer i = 0; i < checkList.size(); i++) {
+            String locNo = checkList.get(i).getLocNo();
+            String matNo = checkList.get(i).getMatNo();
+            Double checkQty = checkList.get(i).getCheckQty();
+
+            Wrapper<WaitMatchk> wrapper = new EntityWrapper<WaitMatchk>().eq("loc_no",locNo).eq("mat_no",matNo);
+            WaitMatchk waitMatchk0 = waitMatchkService.selectOne(wrapper);
+            if(null != waitMatchk0){
+                waitMatchk0.setCheckQty(checkQty);
+                flag = waitMatchkService.update(waitMatchk0,wrapper);
+                if(!flag){
+                    throw new CoolException("鏇存柊鐩樼偣閫氱煡妗eけ璐�");
+                }
+            } else {
+                MatCode matCode = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no",matNo));
+                WaitMatchk waitMatchk1 = waitMatchkService.selectOne(new EntityWrapper<WaitMatchk>().eq("loc_no",locNo).orderBy("seq_no",false));
+                if(null != matCode) {
+                    WaitMatchk waitMatchk = new WaitMatchk();
+                    waitMatchk.setLocNo(locNo);
+                    waitMatchk.setMatNo(matNo);
+                    if(null != waitMatchk1){
+                        waitMatchk.setBillNo(waitMatchk1.getBillNo());
+                        waitMatchk.setSeqNo(waitMatchk1.getSeqNo()+1);
+                        waitMatchk.setZpallet(waitMatchk1.getZpallet());
+                        waitMatchk.setLinkErp(waitMatchk1.getLinkErp());
+                        waitMatchk.setIoStatus(waitMatchk1.getIoStatus());
+                    } else {
+                        waitMatchk.setBillNo("0");
+                        waitMatchk.setSeqNo(seq++);
+                        waitMatchk.setLinkErp(0);
+                        waitMatchk.setIoStatus(1);
+                    }
+                    waitMatchk.setBillType(1);//鎶界洏
+                    waitMatchk.setMatName(matCode.getMatName());
+                    waitMatchk.setStockQty(0D);
+                    waitMatchk.setCheckQty(checkQty);
+                    waitMatchk.setModiTime(now);
+                    waitMatchk.setModiUser(getUserId());
+                    waitMatchk.setAppeTime(now);
+                    waitMatchk.setAppeUser(getUserId());
+                    flag = waitMatchkService.insert(waitMatchk);
+                    if(!flag){
+                        throw new CoolException("鏂板鐩樼偣閫氱煡妗f暟鎹け璐�");
+                    }
+                }
+
+            }
+        }
+        return R.ok().add(flag);
+    }
 }
diff --git a/src/main/java/com/zy/asrs/controller/PltBarcodeController.java b/src/main/java/com/zy/asrs/controller/PltBarcodeController.java
new file mode 100644
index 0000000..826ace7
--- /dev/null
+++ b/src/main/java/com/zy/asrs/controller/PltBarcodeController.java
@@ -0,0 +1,157 @@
+package com.zy.asrs.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.core.annotations.ManagerAuth;
+import com.core.common.BaseRes;
+import com.core.common.Cools;
+import com.core.common.DateUtils;
+import com.core.common.R;
+import com.zy.asrs.entity.LocDetl;
+import com.zy.asrs.entity.PltBarcode;
+import com.zy.asrs.entity.WrkDetl;
+import com.zy.asrs.service.LocDetlService;
+import com.zy.asrs.service.PltBarcodeService;
+import com.zy.asrs.service.WrkDetlService;
+import com.zy.common.web.BaseController;
+import com.zy.ints.entity.WaitMatin;
+import com.zy.ints.service.WaitMatinService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+public class PltBarcodeController extends BaseController {
+
+    @Autowired
+    private PltBarcodeService pltBarcodeService;
+    @Autowired
+    private LocDetlService locDetlService;
+    @Autowired
+    private WrkDetlService wrkDetlService;
+    @Autowired
+    private WaitMatinService waitMatinService;
+
+    @RequestMapping(value = "/pltBarcode/{id}/auth")
+    @ManagerAuth
+    public R get(@PathVariable("id") String id) {
+        return R.ok(pltBarcodeService.selectById(String.valueOf(id)));
+    }
+
+    @RequestMapping(value = "/pltBarcode/list/auth")
+    @ManagerAuth
+    public R list(@RequestParam(defaultValue = "1")Integer curr,
+                  @RequestParam(defaultValue = "10")Integer limit,
+                  @RequestParam(required = false)String orderByField,
+                  @RequestParam(required = false)String orderByType,
+                  @RequestParam(required = false)String condition,
+                  @RequestParam Map<String, Object> param){
+        EntityWrapper<PltBarcode> wrapper = new EntityWrapper<>();
+        excludeTrash(param);
+        convert(param, wrapper);
+        allLike(PltBarcode.class, param.keySet(), wrapper, condition);
+        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
+        return R.ok(pltBarcodeService.selectPage(new Page<>(curr, limit), wrapper));
+    }
+
+    private void convert(Map<String, Object> map, EntityWrapper wrapper){
+        for (Map.Entry<String, Object> entry : map.entrySet()){
+            String val = String.valueOf(entry.getValue());
+            if (val.contains(RANGE_TIME_LINK)){
+                String[] dates = val.split(RANGE_TIME_LINK);
+                wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
+                wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
+            } else {
+                wrapper.like(entry.getKey(), val);
+            }
+        }
+    }
+
+    @RequestMapping(value = "/pltBarcode/add/auth")
+    @ManagerAuth
+    public R add(PltBarcode pltBarcode) {
+        pltBarcodeService.insert(pltBarcode);
+        return R.ok();
+    }
+
+	@RequestMapping(value = "/pltBarcode/update/auth")
+	@ManagerAuth
+    public R update(PltBarcode pltBarcode){
+        if (Cools.isEmpty(pltBarcode) || null==pltBarcode.getSeqNo()){
+            return R.error();
+        }
+        pltBarcodeService.updateById(pltBarcode);
+        return R.ok();
+    }
+
+    @RequestMapping(value = "/pltBarcode/delete/auth")
+    @ManagerAuth
+    public R delete(@RequestParam(value="ids[]") String[] ids){
+         for (String id : ids){
+             int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",id));
+             int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",id));
+             if (countLoc > 0 || countWrk > 0) {
+                 return R.error("宸ヤ綔妗f垨搴撳瓨鏉$爜鏁版嵁宸插瓨鍦�");
+             }else {
+//                 List<WaitMatin> waitMatins = waitMatinService.selectList();
+                 List<PltBarcode> pltBarcodes = pltBarcodeService.selectList(new EntityWrapper<PltBarcode>().eq("barcode", id));
+                 for(PltBarcode pltBarcode : pltBarcodes){
+                     WaitMatin waitMatin = waitMatinService.selectOne(new EntityWrapper<WaitMatin>().eq("bill_no",pltBarcode.getBillNo())
+                                    .eq("seq_no",pltBarcode.getSeqNo()).eq("mat_no",pltBarcode.getMatNo()));
+                     if(null != waitMatin){
+                         waitMatin.setInQty(waitMatin.getInQty()-pltBarcode.getQty());
+                         waitMatinService.update(waitMatin,new EntityWrapper<WaitMatin>().eq("bill_no",pltBarcode.getBillNo())
+                                 .eq("seq_no",pltBarcode.getSeqNo()).eq("mat_no",pltBarcode.getMatNo()));
+                     }
+                 }
+                 pltBarcodeService.delete(new EntityWrapper<PltBarcode>().eq("barcode", id));
+             }
+//            pltBarcodeService.deleteById(id);
+        }
+        return R.ok();
+    }
+
+    @RequestMapping(value = "/pltBarcode/export/auth")
+    @ManagerAuth
+    public R export(@RequestBody JSONObject param){
+        EntityWrapper<PltBarcode> wrapper = new EntityWrapper<>();
+        List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
+        Map<String, Object> map = excludeTrash(param.getJSONObject("pltBarcode"));
+        convert(map, wrapper);
+        List<PltBarcode> list = pltBarcodeService.selectList(wrapper);
+        return R.ok(exportSupport(list, fields));
+    }
+
+    @RequestMapping(value = "/pltBarcodeQuery/auth")
+    @ManagerAuth
+    public R query(String condition) {
+        EntityWrapper<PltBarcode> wrapper = new EntityWrapper<>();
+        wrapper.like("mat_no", condition);
+        Page<PltBarcode> page = pltBarcodeService.selectPage(new Page<>(0, 10), wrapper);
+        List<Map<String, Object>> result = new ArrayList<>();
+        for (PltBarcode pltBarcode : page.getRecords()){
+            Map<String, Object> map = new HashMap<>();
+            map.put("id", pltBarcode.getSeqNo());
+            map.put("value", pltBarcode.getMatNo());
+            result.add(map);
+        }
+        return R.ok(result);
+    }
+
+    @RequestMapping(value = "/pltBarcode/check/column/auth")
+    @ManagerAuth
+    public R query(@RequestBody JSONObject param) {
+        Wrapper<PltBarcode> wrapper = new EntityWrapper<PltBarcode>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
+        if (null != pltBarcodeService.selectOne(wrapper)){
+            return R.parse(BaseRes.REPEAT).add(getComment(PltBarcode.class, String.valueOf(param.get("key"))));
+        }
+        return R.ok();
+    }
+
+}
diff --git a/src/main/java/com/zy/asrs/controller/ReportQueryController.java b/src/main/java/com/zy/asrs/controller/ReportQueryController.java
index ef24c44..f4d2d07 100644
--- a/src/main/java/com/zy/asrs/controller/ReportQueryController.java
+++ b/src/main/java/com/zy/asrs/controller/ReportQueryController.java
@@ -58,10 +58,13 @@
 	public Map<String,Object> queryViewStayTimeListByPages(@RequestParam(defaultValue = "1")Integer curr,
 														   @RequestParam(defaultValue = "10")Integer limit,
 														   @RequestParam Map<String, Object> param){
+		excludeTrash(param);
 		ViewStayTimeBean bean = new ViewStayTimeBean();
 		bean.setPageSize(limit);
 		bean.setPageNumber(curr);
+		bean.setLoc_no((String) param.get("loc_no"));
 		List<ViewStayTimeBean> list = reportQueryMapper.queryViewStayTimeList(bean);
+
 		int count = reportQueryMapper.getViewStayTimeCount(bean);
 		Page<ViewStayTimeBean> page = new Page<>();
 		page.setRecords(list);
diff --git a/src/main/java/com/zy/asrs/controller/StatisController.java b/src/main/java/com/zy/asrs/controller/StatisController.java
index da91ee3..b7241c3 100644
--- a/src/main/java/com/zy/asrs/controller/StatisController.java
+++ b/src/main/java/com/zy/asrs/controller/StatisController.java
@@ -6,13 +6,17 @@
 import com.baomidou.mybatisplus.plugins.Page;
 import com.core.annotations.ManagerAuth;
 import com.core.common.R;
+import com.core.exception.CoolException;
 import com.zy.asrs.entity.LocDetl;
 import com.zy.asrs.entity.MatCode;
 import com.zy.asrs.service.LocDetlService;
 import com.zy.asrs.service.MatCodeService;
 import com.zy.asrs.utils.VersionUtils;
 import com.zy.common.web.BaseController;
+import com.zy.ints.entity.StockSync;
+import com.zy.ints.service.StockSyncService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
@@ -20,6 +24,7 @@
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.net.URLEncoder;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -33,6 +38,8 @@
     private MatCodeService matCodeService;
     @Autowired
     private LocDetlService locDetlService;
+    @Autowired
+    StockSyncService stockSyncService;
 
     // 搴撳瓨缁熻 ------------------------------------------------------------------------------------------
 
@@ -44,7 +51,7 @@
                          @RequestParam Map<String, Object> param) {
         Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, LocDetl.class));
         for (LocDetl locDetl : stockStatis.getRecords()) {
-            MatCode mat = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no",locDetl.getMatNo()).eq("str8",locDetl.getColor()));
+            MatCode mat = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no",locDetl.getMatNo()));
 //            MatCode mat = matCodeService.selectById(locDetl.getMatnr());
             if (mat != null) {
                 VersionUtils.setLocDetl(locDetl, mat);
@@ -73,11 +80,71 @@
                 .doWrite(excel);
     }
 
-//    @RequestMapping(value = "/stock/statis/queryLocByMatNoAndMatName")
-//    public R queryLocByMatNoAndMatName(@RequestParam LocDetl locDetl){
-//            List<LocDetl> locDetls=locDetlService.getlocDetlByMatNoAndMatName(locDetl);
-////        locDetl.
-//        return R.ok().add(locDetls);
-//    }
+    /**
+     * 鑾峰彇搴撳瓨鍚屾琛ㄦ暟鎹�
+     * @return
+     */
+    @RequestMapping(value = "/stock/stockSyncCount")
+    @ManagerAuth(memo = "鑾峰彇搴撳瓨鍚屾涓婁紶娓呭崟鏁伴噺")
+    public R getStockSyncCount() {
+        return R.ok(stockSyncService.getStockSyncCount());
+    }
 
+    /**
+     * 鎻掑叆鏁版嵁鍒板簱瀛樺悓姝ヨ〃
+     * @return
+     */
+    @RequestMapping(value = "/stock/insertStockSync")
+    @ManagerAuth(memo = "鍚屾涓婁紶娓呭崟鏁版嵁鎻掑叆")
+    @Transactional
+    public R insertStockSync() {
+        Date now = new Date();
+        Long userId = getUserId();
+        List<LocDetl> locDetls = locDetlService.getStockSum();
+        for(LocDetl locdetl : locDetls){
+            StockSync stockSync = new StockSync();
+            stockSync.setMatNo(locdetl.getMatNo());
+            stockSync.setMatName(locdetl.getMatName());
+            stockSync.setQty(locdetl.getQty());
+            stockSync.setModiUser(userId);
+            stockSync.setModiTime(now);
+            stockSync.setAppeUser(userId);
+            stockSync.setAppeTime(now);
+            if(!stockSyncService.insert(stockSync)){
+                throw new CoolException("鎻掑叆鍚屾搴撳瓨鏁版嵁澶辫触");
+            }
+        }
+        return R.ok(locDetls.size());
+    }
+
+    /**
+     * 鏇存柊鏁版嵁鍒板簱瀛樺悓姝ヨ〃锛屽厛娓呯┖鍐嶆彃鍏�
+     * @return
+     */
+    @RequestMapping(value = "/stock/updateStockSync")
+    @ManagerAuth(memo = "娓呯┖鍚屾涓婁紶鏁版嵁骞舵彃鍏�")
+    @Transactional
+    public R updateStockSync() {
+        if(!stockSyncService.clearStockSync()){
+            throw new CoolException("鍚屾涓婁紶鏁版嵁娓呯┖澶辫触锛岃鑱旂郴绠$悊鍛�");
+        }
+
+        Date now = new Date();
+        Long userId = getUserId();
+        List<LocDetl> locDetls = locDetlService.getStockSum();
+        for(LocDetl locdetl : locDetls){
+            StockSync stockSync = new StockSync();
+            stockSync.setMatNo(locdetl.getMatNo());
+            stockSync.setMatName(locdetl.getMatName());
+            stockSync.setQty(locdetl.getQty());
+            stockSync.setModiUser(userId);
+            stockSync.setModiTime(now);
+            stockSync.setAppeUser(userId);
+            stockSync.setAppeTime(now);
+            if(!stockSyncService.insert(stockSync)){
+                throw new CoolException("鏇存柊鍚屾搴撳瓨鏁版嵁澶辫触");
+            }
+        }
+        return R.ok(locDetls.size());
+    }
 }
diff --git a/src/main/java/com/zy/asrs/entity/CombBillQueryVo.java b/src/main/java/com/zy/asrs/entity/CombBillQueryVo.java
new file mode 100644
index 0000000..1b4bbeb
--- /dev/null
+++ b/src/main/java/com/zy/asrs/entity/CombBillQueryVo.java
@@ -0,0 +1,41 @@
+package com.zy.asrs.entity;
+
+import lombok.Data;
+
+/**
+ * Created by vincent on 2021/2/2
+ */
+@Data
+public class CombBillQueryVo {
+
+    private String billNo;
+
+    private Integer seqNo;
+
+    private String matNo;
+
+    private String matName;
+
+    private String specs;
+
+    private String size;
+
+    private String color;
+
+    private Double count;
+
+    private String unit;
+
+//    private String warehouse;
+
+//    private String mnemonic;
+
+//    private String supplier;
+
+//    private String lgnum;
+
+    private String type;
+
+//    private String altme;
+
+}
diff --git a/src/main/java/com/zy/asrs/entity/LocDetl.java b/src/main/java/com/zy/asrs/entity/LocDetl.java
index 36db1be..f322a38 100644
--- a/src/main/java/com/zy/asrs/entity/LocDetl.java
+++ b/src/main/java/com/zy/asrs/entity/LocDetl.java
@@ -29,10 +29,12 @@
 
     @ApiModelProperty(value= "浜у搧缂栫爜")
     @TableId(value = "mat_no", type = IdType.INPUT)
+    @TableField("mat_no")
     private String matNo;
 
     @ApiModelProperty(value= "浜у搧鍚嶇О")
     @TableId(value = "mat_name")
+    @TableField("mat_name")
     private String matName;
 
     @ApiModelProperty(value= "瑙勬牸")
diff --git a/src/main/java/com/zy/asrs/entity/PltBarcode.java b/src/main/java/com/zy/asrs/entity/PltBarcode.java
new file mode 100644
index 0000000..8d72c87
--- /dev/null
+++ b/src/main/java/com/zy/asrs/entity/PltBarcode.java
@@ -0,0 +1,472 @@
+package com.zy.asrs.entity;
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.enums.IdType;
+import com.core.common.Cools;
+import com.core.common.SpringUtils;
+import com.zy.system.entity.User;
+import com.zy.system.service.UserService;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+@TableName("asr_plt_barcode")
+public class PltBarcode implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 鏉$爜
+     */
+    @ApiModelProperty(value= "鏉$爜")
+    @TableId(value = "barcode", type = IdType.INPUT)
+    private String barcode;
+
+    /**
+     * 鍗曟嵁缂栧彿
+     */
+    @ApiModelProperty(value= "鍗曟嵁缂栧彿")
+    @TableId(value = "bill_no", type = IdType.INPUT)
+    @TableField("bill_no")
+    private String billNo;
+
+    /**
+     * 搴忓彿
+     */
+    @ApiModelProperty(value= "搴忓彿")
+    @TableId(value = "seq_no", type = IdType.INPUT)
+    @TableField("seq_no")
+    private Integer seqNo;
+
+    /**
+     * 鍗曟嵁绫诲瀷 1: 閲囪喘鍏ュ簱  2: 鐢熶骇鍏ュ簱  3: 璋冩嫧鍏ュ簱  4: 閿�鍞��鍥炲叆搴�  5: 鍏朵粬鍏ュ簱  
+     */
+    @ApiModelProperty(value= "鍗曟嵁绫诲瀷 1: 閲囪喘鍏ュ簱  2: 鐢熶骇鍏ュ簱  3: 璋冩嫧鍏ュ簱  4: 閿�鍞��鍥炲叆搴�  5: 鍏朵粬鍏ュ簱  ")
+    @TableField("bill_type")
+    private Integer billType;
+
+    /**
+     * 鐗╂枡缂栫爜
+     */
+    @ApiModelProperty(value= "鐗╂枡缂栫爜")
+    @TableField("mat_no")
+    private String matNo;
+
+    /**
+     * 鐗╂枡鍚嶇О
+     */
+    @ApiModelProperty(value= "鐗╂枡鍚嶇О")
+    @TableField("mat_name")
+    private String matName;
+
+    /**
+     * 鏁伴噺
+     */
+    @ApiModelProperty(value= "鏁伴噺")
+    private Double qty;
+
+    /**
+     * 搴撲綅鍙�
+     */
+    @ApiModelProperty(value= "搴撲綅鍙�")
+    @TableField("loc_no")
+    private String locNo;
+
+    /**
+     * 瑙勬牸
+     */
+    @ApiModelProperty(value= "瑙勬牸")
+    private String specs;
+
+    /**
+     * 鍗曚綅
+     */
+    @ApiModelProperty(value= "鍗曚綅")
+    private String unit;
+
+    /**
+     * 灏哄
+     */
+    @ApiModelProperty(value= "灏哄")
+    private String size;
+
+    /**
+     * 棰滆壊
+     */
+    @ApiModelProperty(value= "棰滆壊")
+    private String color;
+
+    /**
+     * 鍗曢噸
+     */
+    @ApiModelProperty(value= "鍗曢噸")
+    private Double weight;
+
+    /**
+     * 澶囨敞
+     */
+    @ApiModelProperty(value= "澶囨敞")
+    private String memo;
+
+    /**
+     * ERP杩炵嚎 0: 闈炶繛绾�  1: ERP杩炵嚎  
+     */
+    @ApiModelProperty(value= "ERP杩炵嚎 0: 闈炶繛绾�  1: ERP杩炵嚎  ")
+    @TableField("link_erp")
+    private Integer linkErp;
+
+    /**
+     * 瀹屾垚鐘舵�� 0: 寰呭鐞�  1: 鍏ュ簱涓�  2: 鍏ュ簱瀹屾垚  3: 鍙栨秷鍏ュ簱  
+     */
+    @ApiModelProperty(value= "瀹屾垚鐘舵�� 0: 寰呭鐞�  1: 鍏ュ簱涓�  2: 鍏ュ簱瀹屾垚  3: 鍙栨秷鍏ュ簱  ")
+    @TableField("io_status")
+    private Integer ioStatus;
+
+    /**
+     * 瀹屾垚鏃堕棿
+     */
+    @ApiModelProperty(value= "瀹屾垚鏃堕棿")
+    @TableField("io_time")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private Date ioTime;
+
+    /**
+     * 淇敼浜哄憳
+     */
+    @ApiModelProperty(value= "淇敼浜哄憳")
+    @TableField("modi_user")
+    private Long modiUser;
+
+    /**
+     * 淇敼鏃堕棿
+     */
+    @ApiModelProperty(value= "淇敼鏃堕棿")
+    @TableField("modi_time")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private Date modiTime;
+
+    /**
+     * 寤烘。浜哄憳
+     */
+    @ApiModelProperty(value= "寤烘。浜哄憳")
+    @TableField("appe_user")
+    private Long appeUser;
+
+    /**
+     * 寤烘。鏃堕棿
+     */
+    @ApiModelProperty(value= "寤烘。鏃堕棿")
+    @TableField("appe_time")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private Date appeTime;
+
+    public PltBarcode() {}
+
+    public PltBarcode(String barcode,String billNo,Integer seqNo,Integer billType,String matNo,String matName,Double qty,String locNo,String specs,String unit,String size,String color,Double weight,String memo,Integer linkErp,Integer ioStatus,Date ioTime,Long modiUser,Date modiTime,Long appeUser,Date appeTime) {
+        this.barcode = barcode;
+        this.billNo = billNo;
+        this.seqNo = seqNo;
+        this.billType = billType;
+        this.matNo = matNo;
+        this.matName = matName;
+        this.qty = qty;
+        this.locNo = locNo;
+        this.specs = specs;
+        this.unit = unit;
+        this.size = size;
+        this.color = color;
+        this.weight = weight;
+        this.memo = memo;
+        this.linkErp = linkErp;
+        this.ioStatus = ioStatus;
+        this.ioTime = ioTime;
+        this.modiUser = modiUser;
+        this.modiTime = modiTime;
+        this.appeUser = appeUser;
+        this.appeTime = appeTime;
+    }
+
+//    PltBarcode pltBarcode = new PltBarcode(
+//            null,    // 鏉$爜[闈炵┖]
+//            null,    // 鍗曟嵁缂栧彿[闈炵┖]
+//            null,    // 搴忓彿[闈炵┖]
+//            null,    // 鍗曟嵁绫诲瀷
+//            null,    // 鐗╂枡缂栫爜[闈炵┖]
+//            null,    // 鐗╂枡鍚嶇О[闈炵┖]
+//            null,    // 鏁伴噺
+//            null,    // 搴撲綅鍙�
+//            null,    // 瑙勬牸
+//            null,    // 鍗曚綅
+//            null,    // 灏哄
+//            null,    // 棰滆壊
+//            null,    // 鍗曢噸
+//            null,    // 澶囨敞
+//            null,    // ERP杩炵嚎
+//            null,    // 瀹屾垚鐘舵��
+//            null,    // 瀹屾垚鏃堕棿
+//            null,    // 淇敼浜哄憳
+//            null,    // 淇敼鏃堕棿
+//            null,    // 寤烘。浜哄憳
+//            null    // 寤烘。鏃堕棿
+//    );
+
+    public String getBarcode() {
+        return barcode;
+    }
+
+    public void setBarcode(String barcode) {
+        this.barcode = barcode;
+    }
+
+    public String getBillNo() {
+        return billNo;
+    }
+
+    public void setBillNo(String billNo) {
+        this.billNo = billNo;
+    }
+
+    public Integer getSeqNo() {
+        return seqNo;
+    }
+
+    public void setSeqNo(Integer seqNo) {
+        this.seqNo = seqNo;
+    }
+
+    public Integer getBillType() {
+        return billType;
+    }
+
+    public String getBillType$(){
+        if (null == this.billType){ return null; }
+        switch (this.billType){
+            case 1:
+                return "閲囪喘鍏ュ簱";
+            case 2:
+                return "鐢熶骇鍏ュ簱";
+            case 3:
+                return "璋冩嫧鍏ュ簱";
+            case 4:
+                return "閿�鍞��鍥炲叆搴�";
+            case 5:
+                return "鍏朵粬鍏ュ簱";
+            default:
+                return String.valueOf(this.billType);
+        }
+    }
+
+    public void setBillType(Integer billType) {
+        this.billType = billType;
+    }
+
+    public String getMatNo() {
+        return matNo;
+    }
+
+    public void setMatNo(String matNo) {
+        this.matNo = matNo;
+    }
+
+    public String getMatName() {
+        return matName;
+    }
+
+    public void setMatName(String matName) {
+        this.matName = matName;
+    }
+
+    public Double getQty() {
+        return qty;
+    }
+
+    public void setQty(Double qty) {
+        this.qty = qty;
+    }
+
+    public String getLocNo() {
+        return locNo;
+    }
+
+    public void setLocNo(String locNo) {
+        this.locNo = locNo;
+    }
+
+    public String getSpecs() {
+        return specs;
+    }
+
+    public void setSpecs(String specs) {
+        this.specs = specs;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getSize() {
+        return size;
+    }
+
+    public void setSize(String size) {
+        this.size = size;
+    }
+
+    public String getColor() {
+        return color;
+    }
+
+    public void setColor(String color) {
+        this.color = color;
+    }
+
+    public Double getWeight() {
+        return weight;
+    }
+
+    public void setWeight(Double weight) {
+        this.weight = weight;
+    }
+
+    public String getMemo() {
+        return memo;
+    }
+
+    public void setMemo(String memo) {
+        this.memo = memo;
+    }
+
+    public Integer getLinkErp() {
+        return linkErp;
+    }
+
+    public String getLinkErp$(){
+        if (null == this.linkErp){ return null; }
+        switch (this.linkErp){
+            case 0:
+                return "闈炶繛绾�";
+            case 1:
+                return "ERP杩炵嚎";
+            default:
+                return String.valueOf(this.linkErp);
+        }
+    }
+
+    public void setLinkErp(Integer linkErp) {
+        this.linkErp = linkErp;
+    }
+
+    public Integer getIoStatus() {
+        return ioStatus;
+    }
+
+    public String getIoStatus$(){
+        if (null == this.ioStatus){ return null; }
+        switch (this.ioStatus){
+            case 0:
+                return "寰呭鐞�";
+            case 1:
+                return "鍏ュ簱涓�";
+            case 2:
+                return "鍏ュ簱瀹屾垚";
+            case 3:
+                return "鍙栨秷鍏ュ簱";
+            default:
+                return String.valueOf(this.ioStatus);
+        }
+    }
+
+    public void setIoStatus(Integer ioStatus) {
+        this.ioStatus = ioStatus;
+    }
+
+    public Date getIoTime() {
+        return ioTime;
+    }
+
+    public String getIoTime$(){
+        if (Cools.isEmpty(this.ioTime)){
+            return "";
+        }
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ioTime);
+    }
+
+    public void setIoTime(Date ioTime) {
+        this.ioTime = ioTime;
+    }
+
+    public Long getModiUser() {
+        return modiUser;
+    }
+
+    public String getModiUser$(){
+        UserService service = SpringUtils.getBean(UserService.class);
+        User user = service.selectById(this.modiUser);
+        if (!Cools.isEmpty(user)){
+            return String.valueOf(user.getUsername());
+        }
+        return null;
+    }
+
+    public void setModiUser(Long modiUser) {
+        this.modiUser = modiUser;
+    }
+
+    public Date getModiTime() {
+        return modiTime;
+    }
+
+    public String getModiTime$(){
+        if (Cools.isEmpty(this.modiTime)){
+            return "";
+        }
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime);
+    }
+
+    public void setModiTime(Date modiTime) {
+        this.modiTime = modiTime;
+    }
+
+    public Long getAppeUser() {
+        return appeUser;
+    }
+
+    public String getAppeUser$(){
+        UserService service = SpringUtils.getBean(UserService.class);
+        User user = service.selectById(this.appeUser);
+        if (!Cools.isEmpty(user)){
+            return String.valueOf(user.getUsername());
+        }
+        return null;
+    }
+
+    public void setAppeUser(Long appeUser) {
+        this.appeUser = appeUser;
+    }
+
+    public Date getAppeTime() {
+        return appeTime;
+    }
+
+    public String getAppeTime$(){
+        if (Cools.isEmpty(this.appeTime)){
+            return "";
+        }
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime);
+    }
+
+    public void setAppeTime(Date appeTime) {
+        this.appeTime = appeTime;
+    }
+
+
+}
diff --git a/src/main/java/com/zy/asrs/entity/WrkDetl.java b/src/main/java/com/zy/asrs/entity/WrkDetl.java
index 584ce60..f318964 100644
--- a/src/main/java/com/zy/asrs/entity/WrkDetl.java
+++ b/src/main/java/com/zy/asrs/entity/WrkDetl.java
@@ -36,10 +36,12 @@
 
     @ApiModelProperty(value= "浜у搧缂栫爜")
     @TableId(value = "mat_no")
+    @TableField("mat_no")
     private String matNo;
 
     @ApiModelProperty(value= "浜у搧鍚嶇О")
     @TableId(value = "mat_name")
+    @TableField("mat_name")
     private String matName;
 
     @ApiModelProperty(value= "瑙勬牸")
@@ -132,6 +134,10 @@
     @TableField("appe_time")
     private Date appeTime;
 
+    @ApiModelProperty(value= "搴撲綅鍙�")
+    @TableField(exist = false)
+    private String locNo;
+
     public String getIoTime$(){
         if (Cools.isEmpty(this.ioTime)){
             return "";
diff --git a/src/main/java/com/zy/asrs/entity/param/CombParam.java b/src/main/java/com/zy/asrs/entity/param/CombParam.java
index 38107d1..48d8d66 100644
--- a/src/main/java/com/zy/asrs/entity/param/CombParam.java
+++ b/src/main/java/com/zy/asrs/entity/param/CombParam.java
@@ -12,13 +12,25 @@
 
     private List<CombMat> combMats;
 
+    private String billNo;
+
     public static class CombMat {
+
+        private String seqNo;
 
         // 浜у搧缂栧彿
         private String matNo;
 
         // 浜у搧鏁伴噺
         private Double count;
+
+        public String getSeqNo() {
+            return seqNo;
+        }
+
+        public void setSeqNo(String seqNo) {
+            this.seqNo = seqNo;
+        }
 
         public String getMatNo() {
             return matNo;
@@ -38,6 +50,12 @@
 
     }
 
+    public String getBillNo() { return billNo; }
+
+    public void setBillNo(String billNo) {
+        this.billNo = billNo;
+    }
+
     public String getBarcode() {
         return barcode;
     }
diff --git a/src/main/java/com/zy/asrs/mapper/LocDetlMapper.java b/src/main/java/com/zy/asrs/mapper/LocDetlMapper.java
index 46dc8de..b5146b2 100644
--- a/src/main/java/com/zy/asrs/mapper/LocDetlMapper.java
+++ b/src/main/java/com/zy/asrs/mapper/LocDetlMapper.java
@@ -25,8 +25,8 @@
     @Update("update asr_loc_detl set loc_no = #{newLocNo}, modi_time=getDate() where loc_no = #{oldLocNo}")
     int updateLocNo(String newLocNo, String oldLocNo);
 
-    @Select("SELECT ld.loc_no FROM asr_loc_detl ld LEFT JOIN asr_loc_mast lm ON ld.loc_no = lm.loc_no WHERE (1 = 1 AND ld.mat_no = #{matNo} AND lm.loc_sts = 'F' AND DateDiff(dd, lm.modi_time, getdate()) = 0) ORDER BY lm.modi_time ASC")
-    List<String> selectSameDetlToday(String matNo);
+    @Select("SELECT ld.loc_no FROM asr_loc_detl ld LEFT JOIN asr_loc_mast lm ON ld.loc_no = lm.loc_no WHERE (1 = 1 AND ld.mat_no = #{matNo} AND (lm.row1 >= #{start} AND lm.row1 <= #{end})  AND lm.loc_sts = 'F' AND DateDiff(dd, lm.modi_time, getdate()) = 0) ORDER BY lm.modi_time ASC")
+    List<String> selectSameDetlToday(@Param("matNo") String matNo, @Param("start") Integer start, @Param("end") Integer end);
 
     List<LocDetl> selectLocDetlList(@Param("mat_no") String matNo);
 
@@ -38,4 +38,12 @@
     Integer getStockStatisCount(Map<String, Object> condition);
 
     List<LocDetl> getStockStatisExcel();
+
+    /**
+     * 搴撳瓨涓婃姤ERP鏃讹紝鏍规嵁鐗╂枡姹囨�绘煡璇㈠簱瀛樻�婚噺
+     * @return
+     */
+    @Select("select mat_no,mat_name,sum(qty) qty from asr_loc_detl group by mat_no,mat_name")
+    List<LocDetl> getStockSum();
+
 }
diff --git a/src/main/java/com/zy/asrs/mapper/LocMastMapper.java b/src/main/java/com/zy/asrs/mapper/LocMastMapper.java
index 57c635b..ed685a1 100644
--- a/src/main/java/com/zy/asrs/mapper/LocMastMapper.java
+++ b/src/main/java/com/zy/asrs/mapper/LocMastMapper.java
@@ -13,9 +13,14 @@
 @Repository
 public interface LocMastMapper extends BaseMapper<LocMast> {
 
-    LocMast queryFreeLocMast(@Param("row") Integer row);
+    LocMast queryFreeLocMast(@Param("row") Integer row, @Param("locType1") Short locType1, @Param("locType2") Short locType2, @Param("locType3") Short locType3);
 
     @Select("select loc_no from asr_loc_mast where 1=1 and loc_sts = 'O' and crn_no = #{crnNo}")
     List<String> queryGroupEmptyStock(Integer crnNo);
 
+//    @Select("select count(*) as count from asr_loc_mast where 1=1 and loc_sts = 'O' and loc_type1 = #{locType1} and loc_type2 = #{locType2} and loc_type3 = #{locType3} and crn_no = #{crnNo}")
+@Select("select count(*) as count from asr_loc_mast where 1=1 and loc_sts = 'O' and crn_no = #{crnNo} and (loc_type1 is null or loc_type1 = #{locType1}) " +
+        "and (loc_type2 is null or loc_type2 = #{locType2}) and (loc_type3 is null or loc_type3 = #{locType3}) ")
+    Integer selectEmptyLocCount(@Param("locType1") Short locType1, @Param("locType2") Short locType2, @Param("locType3") Short locType3, @Param("crnNo") Integer crnNo);
+
 }
diff --git a/src/main/java/com/zy/asrs/mapper/PltBarcodeMapper.java b/src/main/java/com/zy/asrs/mapper/PltBarcodeMapper.java
new file mode 100644
index 0000000..1833bd7
--- /dev/null
+++ b/src/main/java/com/zy/asrs/mapper/PltBarcodeMapper.java
@@ -0,0 +1,18 @@
+package com.zy.asrs.mapper;
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.zy.asrs.entity.PltBarcode;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Mapper
+@Repository
+public interface PltBarcodeMapper extends BaseMapper<PltBarcode> {
+
+    @Select("select * from asr_plt_barcode where io_status>=2")
+    List<PltBarcode> selectToBeHistoryData();
+
+}
diff --git a/src/main/java/com/zy/asrs/mapper/WrkDetlMapper.java b/src/main/java/com/zy/asrs/mapper/WrkDetlMapper.java
index 4bd53df..aced022 100644
--- a/src/main/java/com/zy/asrs/mapper/WrkDetlMapper.java
+++ b/src/main/java/com/zy/asrs/mapper/WrkDetlMapper.java
@@ -2,8 +2,9 @@
 
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 import com.zy.asrs.entity.WrkDetl;
-import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 import org.springframework.stereotype.Repository;
 
 import java.util.List;
@@ -12,4 +13,13 @@
 @Repository
 public interface WrkDetlMapper extends BaseMapper<WrkDetl> {
     List<WrkDetl> queryWrkDetl(@Param("matNo") String matNo,@Param("locNo") String locNo);
+
+    /**
+     * PDA鐩樼偣鏍规嵁鍑哄簱鍙f煡璇㈠搴旂墿鏂欎俊鎭�
+     * @param devNo
+     * @return
+     */
+    @Select("select b.source_loc_no as locNo, a.mat_no as matNo,a.mat_name as matName,a.qty as qty" +
+            " from asr_wrk_detl a left join asr_wrk_mast b on a.wrk_no = b.wrk_no where a.wrk_no = (select wrk_no from asr_bas_devp where dev_no = #{devNo})")
+    List<WrkDetl> queryMatFromDevNo(Integer devNo);
 }
diff --git a/src/main/java/com/zy/asrs/service/LocDetlService.java b/src/main/java/com/zy/asrs/service/LocDetlService.java
index 7e2ba91..381823c 100644
--- a/src/main/java/com/zy/asrs/service/LocDetlService.java
+++ b/src/main/java/com/zy/asrs/service/LocDetlService.java
@@ -24,7 +24,7 @@
      * @param matNo 浜у搧鍙�
      * @return locNo 搴撲綅鍙�
      */
-    List<String> getSameDetlToday(String matNo);
+    List<String> getSameDetlToday(String matNo, Integer start, Integer end);
 
     /**
      *
@@ -59,4 +59,11 @@
      * @return
      */
 //    List<LocDetl> getlocDetlByMatNoAndMatName(LocDetl locDetl);
+
+    /**
+     * 搴撳瓨涓婃姤ERP鏃讹紝鏍规嵁鐗╂枡姹囨�绘煡璇㈠簱瀛樻�婚噺
+     * @return
+     */
+    public List<LocDetl> getStockSum();
+
 }
diff --git a/src/main/java/com/zy/asrs/service/LocMastService.java b/src/main/java/com/zy/asrs/service/LocMastService.java
index 95932ad..4dea9b5 100644
--- a/src/main/java/com/zy/asrs/service/LocMastService.java
+++ b/src/main/java/com/zy/asrs/service/LocMastService.java
@@ -10,7 +10,7 @@
     /**
      * 妫�绱㈠彲鐢ㄥ簱浣�
      */
-    LocMast queryFreeLocMast(Integer row);
+    LocMast queryFreeLocMast(Integer row, Short locType1, Short locType2, Short locType3);
 
     /**
      * 鑾峰彇鍚岀粍璐ф灦鐨勭┖搴撲綅
@@ -18,4 +18,11 @@
      * @return 鍚岀粍绌哄簱浣嶉泦鍚�
      */
     List<String> queryGroupEmptyStock(String sourceLocNo);
+
+    /**
+     * 妫�鏌ュ綋鍓嶅簱浣嶆墍灞炲贩閬撶殑绌哄簱浣嶆暟閲�
+     * @param locMast
+     * @return
+     */
+    Boolean checkEmptyCount(LocMast locMast);
 }
diff --git a/src/main/java/com/zy/asrs/service/MatOutService.java b/src/main/java/com/zy/asrs/service/MatOutService.java
index 55de81d..dac8115 100644
--- a/src/main/java/com/zy/asrs/service/MatOutService.java
+++ b/src/main/java/com/zy/asrs/service/MatOutService.java
@@ -20,5 +20,5 @@
      * @param locDetls 寰呭嚭搴撲骇鍝�
      * @param ioType 鍏ュ嚭搴撶被鍨�
      */
-    void stockOut(BasDevp staNo, LocDetlDto locDetls, Integer ioType, Long userId);
+    void stockOut(String billNO,BasDevp staNo, LocDetlDto locDetls, Integer ioType, Long userId);
 }
diff --git a/src/main/java/com/zy/asrs/service/PltBarcodeService.java b/src/main/java/com/zy/asrs/service/PltBarcodeService.java
new file mode 100644
index 0000000..4ae3619
--- /dev/null
+++ b/src/main/java/com/zy/asrs/service/PltBarcodeService.java
@@ -0,0 +1,12 @@
+package com.zy.asrs.service;
+
+import com.zy.asrs.entity.PltBarcode;
+import com.baomidou.mybatisplus.service.IService;
+
+import java.util.List;
+
+public interface PltBarcodeService extends IService<PltBarcode> {
+
+    public List<PltBarcode> selectToBeHistoryData();
+
+}
diff --git a/src/main/java/com/zy/asrs/service/WrkDetlService.java b/src/main/java/com/zy/asrs/service/WrkDetlService.java
index ca87add..fe0f06e 100644
--- a/src/main/java/com/zy/asrs/service/WrkDetlService.java
+++ b/src/main/java/com/zy/asrs/service/WrkDetlService.java
@@ -1,8 +1,8 @@
 package com.zy.asrs.service;
 
 import com.baomidou.mybatisplus.service.IService;
-import com.zy.asrs.entity.WrkDetl;
 import com.zy.asrs.entity.MatCodeCountDto;
+import com.zy.asrs.entity.WrkDetl;
 
 import java.util.List;
 
@@ -11,4 +11,9 @@
     void createWorkDetail(Integer workNo, List<MatCodeCountDto> matCodeCountDtos, String barcode, Long userId);
 
     List<WrkDetl> queryWrkDetl(String matNo, String locNo);
+
+    /**
+     * PDA鐩樼偣鏍规嵁鍑哄簱鍙f煡璇㈠搴旂墿鏂欎俊鎭�
+     */
+    List<WrkDetl> queryMatFromDevNo(Integer devNo);
 }
diff --git a/src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java
index d3aa9e4..bb4ef0f 100644
--- a/src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java
@@ -41,8 +41,8 @@
     }
 
     @Override
-    public List<String> getSameDetlToday(String matNo) {
-        return this.baseMapper.selectSameDetlToday(matNo);
+    public List<String> getSameDetlToday(String matNo, Integer start, Integer end) {
+        return this.baseMapper.selectSameDetlToday(matNo, start, end);
     }
 
     @Override
@@ -68,4 +68,13 @@
        return this.baseMapper.getStockStatisExcel();
     }
 
+    /**
+     * 搴撳瓨涓婃姤ERP鏃讹紝鏍规嵁鐗╂枡姹囨�绘煡璇㈠簱瀛樻�婚噺
+     * @return
+     */
+    @Override
+    public List<LocDetl> getStockSum() {
+        return locDetlMapper.getStockSum();
+    }
+
 }
diff --git a/src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
index c90868c..12cd14e 100644
--- a/src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
@@ -18,8 +18,8 @@
     private RowLastnoService rowLastnoService;
 
     @Override
-    public LocMast queryFreeLocMast(Integer row) {
-        return this.baseMapper.queryFreeLocMast(row);
+    public LocMast queryFreeLocMast(Integer row, Short locType1, Short locType2, Short locType3) {
+        return this.baseMapper.queryFreeLocMast(row, locType1, locType2, locType3);
     }
 
     @Override
@@ -33,4 +33,13 @@
         }
         return this.baseMapper.queryGroupEmptyStock(sourceStock.getCrnNo());
     }
+
+    @Override
+    public Boolean checkEmptyCount(LocMast locMast) {
+        if (locMast == null) {
+            return false;
+        }
+        return this.baseMapper.selectEmptyLocCount(locMast.getLocType1(), locMast.getLocType2(), locMast.getLocType3(), locMast.getCrnNo()) > 1;
+    }
+
 }
diff --git a/src/main/java/com/zy/asrs/service/impl/MatOutServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MatOutServiceImpl.java
index 3747006..e8ee621 100644
--- a/src/main/java/com/zy/asrs/service/impl/MatOutServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MatOutServiceImpl.java
@@ -58,6 +58,9 @@
             if (!Cools.isEmpty(paramLocDetl.getMatNo())) {
                 //鏌ヨ鎵�鏈夊簱浣嶇姸鎬佷负F鐨勫簱浣嶄俊鎭�
                 List<LocDetl> locDetls=locDetlService.getlocDetlList(paramLocDetl.getMatNo());
+                if (locDetls.size()==0){
+                    throw new CoolException("搴撲綅鐘舵�佸嚭閿�");
+                }
                 for (LocDetl locDetl : locDetls) {
                     WaitMatout waitMatout = waitMatoutService.selectOne(new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo()).eq("seq_no",paramLocDetl.getSeqNo()));
                     Double outQty = paramLocDetl.getCount() - waitMatout.getOutQty();
@@ -71,14 +74,14 @@
 
                     if (outQty >= locDetl.getQty()){
                         //鐢熸垚鏂囨。璁板綍
-                        stockOut(staNo,new LocDetlDto(locDetl,locDetl.getQty()),ioType,userId);
+                        stockOut(waitMatout.getBillNo(),staNo,new LocDetlDto(locDetl,locDetl.getQty()),ioType,userId);
                         waitMatout.setOutQty(waitMatout.getOutQty() + locDetl.getQty());
                         //淇敼璁板綍
                         Integer update = waitMatoutMapper.update(waitMatout, new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo())
                                                                 .eq("seq_no",paramLocDetl.getSeqNo()));
                     }else {
                         //鐢熸垚鏂囨。璁板綍
-                        stockOut(staNo,new LocDetlDto(locDetl,outQty),ioType,userId);
+                        stockOut(waitMatout.getBillNo(),staNo,new LocDetlDto(locDetl,outQty),ioType,userId);
                         waitMatout.setOutQty(waitMatout.getOutQty() + outQty);
                         //淇敼璁板綍
                         Integer update = waitMatoutMapper.update(waitMatout, new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo())
@@ -91,7 +94,7 @@
 
     @Override
     @Transactional
-    public void stockOut(BasDevp staNo, LocDetlDto locDetlDtos, Integer ioType, Long userId) {
+    public void stockOut(String billNo,BasDevp staNo, LocDetlDto locDetlDtos, Integer ioType, Long userId) {
         // 鐢熸垚宸ヤ綔妗�
             LocDetl locDetl=locDetlDtos.getLocDetl();
             // 鑾峰彇搴撲綅
@@ -140,6 +143,7 @@
                 wrkDetl.setAppeTime(new Date());
                 wrkDetl.setAppeUser(userId);
                 wrkDetl.setModiTime(new Date());
+                wrkDetl.setBillNo(billNo);
                 wrkDetl.setModiUser(userId);
                 if (!wrkDetlService.insert(wrkDetl)) {
                     throw new CoolException("淇濆瓨宸ヤ綔妗f槑缁嗗け璐�");
diff --git a/src/main/java/com/zy/asrs/service/impl/MatStoreServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MatStoreServiceImpl.java
index 05bd433..fcc708d 100644
--- a/src/main/java/com/zy/asrs/service/impl/MatStoreServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MatStoreServiceImpl.java
@@ -8,6 +8,7 @@
 import com.zy.asrs.entity.param.FullStoreParam;
 import com.zy.asrs.service.*;
 import com.zy.asrs.utils.VersionUtils;
+import com.zy.common.model.LocTypeDto;
 import com.zy.common.model.StartupDto;
 import com.zy.common.service.CommonService;
 import com.zy.ints.entity.WaitMatin;
@@ -57,7 +58,9 @@
         int workNo = commonService.getWorkNo(DEFAULT_WORK_NO_TYPE);
         // 妫�绱㈠簱浣�
         List<String> matNos = param.getList().stream().map(FullStoreParam.MatCodeStore::getMatNo).distinct().collect(Collectors.toList());
-        StartupDto startupDtodto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 1, param.getDevpNo(), matNos, 0);
+        LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo);
+        locTypeDto.setLocType1((short) 1);
+        StartupDto startupDtodto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 1, param.getDevpNo(),false, matNos,locTypeDto, 0);
         // 鐢熸垚宸ヤ綔妗�
         WrkMast wrkMast = new WrkMast();
         wrkMast.setWrkNo(workNo);
diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
index d4ab78d..b3b7741 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -4,18 +4,21 @@
 import com.core.common.BaseRes;
 import com.core.common.Cools;
 import com.core.exception.CoolException;
+import com.zy.asrs.entity.LocDetl;
 import com.zy.asrs.entity.MatCode;
-import com.zy.asrs.entity.WaitPakin;
+import com.zy.asrs.entity.PltBarcode;
+import com.zy.asrs.entity.WrkDetl;
 import com.zy.asrs.entity.param.CombParam;
-import com.zy.asrs.service.MatCodeService;
-import com.zy.asrs.service.MobileService;
-import com.zy.asrs.service.WaitPakinService;
-import com.zy.asrs.utils.VersionUtils;
+import com.zy.asrs.service.*;
+import com.zy.ints.entity.WaitMatin;
+import com.zy.ints.service.WaitMatinService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Random;
 
 /**
  * 绉诲姩绔湇鍔℃牳蹇冪被
@@ -27,7 +30,13 @@
     @Autowired
     private MatCodeService matCodeService;
     @Autowired
-    private WaitPakinService waitPakinService;
+    private WaitMatinService waitMatinService;
+    @Autowired
+    private LocDetlService locDetlService;
+    @Autowired
+    private WrkDetlService wrkDetlService;
+    @Autowired
+    private PltBarcodeService pltBarcodeService;
 
     @Override
     @Transactional
@@ -35,29 +44,92 @@
         if (Cools.isEmpty(param.getBarcode()) || param.getCombMats().isEmpty()) {
             throw new CoolException(BaseRes.PARAM);
         }
-        int count = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
-                eq("zpallet", param.getBarcode()).eq("io_status", "N"));
-        if (count > 0) {
+//        int countPak = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()));
+//                eq("zpallet", param.getBarcode()).eq("io_status", "N"));
+        int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode()));
+        int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode()));
+        int countPlt = pltBarcodeService.selectCount(new EntityWrapper<PltBarcode>().eq("barcode",param.getBarcode()));
+        if (countPlt > 0 || countLoc > 0 || countWrk > 0) {
             throw new CoolException("鏉$爜鏁版嵁宸插瓨鍦�");
         }
-        for (CombParam.CombMat combMat : param.getCombMats()) {
-            MatCode matCode = matCodeService.selectById(combMat.getMatNo());
-            if (Cools.isEmpty(matCode)) {
-                throw new CoolException("浜у搧鏁版嵁閿欒");
-            }
-            WaitPakin waitPakin = new WaitPakin();
-            waitPakin.setZpallet(param.getBarcode());   // 鎵樼洏鐮�
-            waitPakin.setStatus("Y");    // 鐘舵��
-            waitPakin.setQty(combMat.getCount());  // 鏁伴噺
-            waitPakin.setIoStatus("N");     // 鍏ュ嚭鐘舵��
-            waitPakin.setAppeUser(userId);
-            waitPakin.setAppeTime(new Date());
-            waitPakin.setModiUser(userId);
-            waitPakin.setModiTime(new Date());
-            VersionUtils.setWaitPakIn(waitPakin, matCode);
 
-            if (!waitPakinService.insert(waitPakin)) {
-                throw new CoolException("淇濆瓨鏁版嵁澶辫触");
+        Date now = new Date();
+        if (Cools.isEmpty(param.getBillNo())) {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+            Random rand = new Random();
+            Integer r = rand.nextInt(900)+ 100;
+            String billNo = sdf.format(new Date()) + r;
+            Integer seqNo=0;
+            for (CombParam.CombMat combMat : param.getCombMats()) {
+                MatCode matCode = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no", combMat.getMatNo()));
+                if (Cools.isEmpty(matCode)) {
+                    throw new CoolException("鐗╂枡鏁版嵁閿欒");
+                }
+                seqNo++;
+                PltBarcode pltBarcode = new PltBarcode();
+                pltBarcode.setBarcode(param.getBarcode());
+                pltBarcode.setBillNo(billNo);
+                pltBarcode.setSeqNo(seqNo);
+                pltBarcode.setBillType(5);
+                pltBarcode.setMatNo(matCode.getMatNo());
+                pltBarcode.setMatName(matCode.getMatName());
+                pltBarcode.setQty(combMat.getCount());
+                pltBarcode.setUnit(matCode.getUnit());
+                pltBarcode.setSpecs(matCode.getSpecs());
+                pltBarcode.setSize(matCode.getSize());
+                pltBarcode.setColor(matCode.getColor());
+                pltBarcode.setLinkErp(0);
+                pltBarcode.setModiUser(userId);
+                pltBarcode.setModiTime(now);
+                pltBarcode.setAppeUser(userId);
+                pltBarcode.setAppeTime(now);
+
+                if (!pltBarcodeService.insert(pltBarcode)) {
+                    throw new CoolException("淇濆瓨鏁版嵁澶辫触");
+                }
+            }
+        } else {
+            // 鍏宠仈閫氱煡鍗曠粍鎵�
+            for (CombParam.CombMat combMat : param.getCombMats()) {
+                WaitMatin waitMatin = waitMatinService.selectOne(new EntityWrapper<WaitMatin>()
+                        .eq("bill_no",param.getBillNo()).eq("seq_no",combMat.getSeqNo()));
+
+                if (waitMatin == null) {
+                    throw new CoolException("閫氱煡鍗曚笉瀛樺湪" + combMat.getMatNo() + "鏁版嵁锛�");
+                }
+
+                if (combMat.getCount() > (waitMatin.getQty()-waitMatin.getInQty())) {
+                    throw new CoolException(combMat.getMatNo() + "缁勬墭鐗╂枡鏁伴噺涓嶈冻锛�");
+                }
+
+                PltBarcode pltBarcode = new PltBarcode();
+                pltBarcode.setBarcode(param.getBarcode());
+                pltBarcode.setBillNo(waitMatin.getBillNo());
+                pltBarcode.setSeqNo(waitMatin.getSeqNo());
+                pltBarcode.setBillType(waitMatin.getBillType());
+                pltBarcode.setMatNo(waitMatin.getMatNo());
+                pltBarcode.setMatName(waitMatin.getMatName());
+                pltBarcode.setQty(combMat.getCount());
+                pltBarcode.setUnit(waitMatin.getUnit());
+                pltBarcode.setSpecs(waitMatin.getSpecs());
+                pltBarcode.setSize(waitMatin.getSize());
+                pltBarcode.setColor(waitMatin.getColor());
+                pltBarcode.setLinkErp(waitMatin.getLinkErp());
+                pltBarcode.setModiUser(userId);
+                pltBarcode.setModiTime(now);
+                pltBarcode.setAppeUser(userId);
+                pltBarcode.setAppeTime(now);
+
+                if (!pltBarcodeService.insert(pltBarcode)) {
+                    throw new CoolException("淇濆瓨鏁版嵁澶辫触");
+                }
+
+                waitMatin.setInQty(combMat.getCount() + waitMatin.getInQty());
+                if (!waitMatinService.update(waitMatin,new EntityWrapper<WaitMatin>()
+                        .eq("bill_no",param.getBillNo()).eq("seq_no",combMat.getSeqNo()))){
+                    throw new CoolException("鏇存柊鏁版嵁澶辫触");
+                }
+
             }
         }
     }
diff --git a/src/main/java/com/zy/asrs/service/impl/PltBarcodeServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/PltBarcodeServiceImpl.java
new file mode 100644
index 0000000..d35d875
--- /dev/null
+++ b/src/main/java/com/zy/asrs/service/impl/PltBarcodeServiceImpl.java
@@ -0,0 +1,19 @@
+package com.zy.asrs.service.impl;
+
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.zy.asrs.entity.PltBarcode;
+import com.zy.asrs.mapper.PltBarcodeMapper;
+import com.zy.asrs.service.PltBarcodeService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service("pltBarcodeService")
+public class PltBarcodeServiceImpl extends ServiceImpl<PltBarcodeMapper, PltBarcode> implements PltBarcodeService {
+
+    @Override
+    public List<PltBarcode> selectToBeHistoryData() {
+        return this.baseMapper.selectToBeHistoryData();
+    }
+
+}
diff --git a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
index 4f3c4fe..a0cef33 100644
--- a/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -14,11 +14,12 @@
 import com.zy.asrs.service.*;
 import com.zy.asrs.utils.VersionUtils;
 import com.zy.common.model.LocDetlDto;
+import com.zy.common.model.LocTypeDto;
 import com.zy.common.model.OutLocDto;
 import com.zy.common.model.StartupDto;
 import com.zy.common.service.CommonService;
 import com.zy.ints.entity.WaitMatchk;
-import com.zy.ints.entity.WaitMatout;
+import com.zy.ints.service.IoCompleteService;
 import com.zy.ints.service.WaitMatchkService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -63,9 +64,10 @@
     private WrkMastLogService wrkMastLogService;
     @Autowired
     private WrkDetlLogService wrkDetlLogService;
-
     @Autowired
     private WaitMatchkService waitMatchkService;
+    @Autowired
+    private IoCompleteService ioCompleteService;
 
     @Override
     @Transactional
@@ -80,7 +82,9 @@
         int workNo = commonService.getWorkNo(DEFAULT_WORK_NO_TYPE);
         // 妫�绱㈠簱浣�
         List<String> matNos = param.getList().stream().map(FullStoreParam.MatCodeStore::getMatNo).distinct().collect(Collectors.toList());
-        StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 1, param.getDevpNo(), matNos, 0);
+        LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo);
+        locTypeDto.setLocType1((short) 1);
+        StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 1, param.getDevpNo(),false, matNos,locTypeDto, 0);
         // 鐢熸垚宸ヤ綔妗�
         WrkMast wrkMast = new WrkMast();
         wrkMast.setWrkNo(workNo);
@@ -153,7 +157,7 @@
             }
         }
         if (!locDetlDtos.isEmpty()) {
-            // 鍚姩鍑哄簱寮�濮� 101.鍑哄簱
+            // 鍚姩鍑哄簱寮�濮� 101.103鍑哄簱
             stockOut(staNo, locDetlDtos, null, userId);
         } else {
             throw new CoolException("搴撲綅浜у搧涓嶅瓨鍦�");
@@ -180,37 +184,38 @@
             }
             dtos.add(new OutLocDto(locNo, list));
         }
-        //鐢熸垚鐩樼偣鏂囨。
-        for (LocDetlDto locDetlDto : locDetlDtos) {
 
-            String id="";
+        if(ioType == 107) {
             //鑾峰彇褰撳墠鏃堕棿鎴�
             SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss");
             String temp = sf.format(new Date());
-            //鑾峰彇6浣嶉殢鏈烘暟
-            int random=(int) ((Math.random()+1)*1000);
-            id=temp+random;
-
+            //鑾峰彇3浣嶉殢鏈烘暟
+            Random rand = new Random();
+            Integer r = rand.nextInt(900) + 100;
+            String billNo = temp + r;
+            //鐢熸垚鐩樼偣閫氱煡妗�
+            for (LocDetlDto locDetlDto : locDetlDtos) {
 //            String replace = UUID.randomUUID().toString().replace("-", "");
-            LocDetl locDetl = locDetlDto.getLocDetl();
-            //鐢熸垚鐩樼偣妗�
-            WaitMatchk waitMatchk = new WaitMatchk();
-            waitMatchk.setBillNo(id);//璁㈠崟缂栧彿
-            waitMatchk.setLocNo(locDetl.getLocNo());//搴撲綅鍙�
-            waitMatchk.setStockQty(locDetl.getQty());
-            waitMatchk.setMatNo(locDetl.getMatNo());//浜у搧缂栧彿
-            waitMatchk.setMatName(locDetl.getMatName());//閾插钩鍚嶇О
-            waitMatchk.setSeqNo(i);
-            waitMatchk.setIoTime(new Date());
-            waitMatchk.setZpallet(locDetl.getZpallet());
-            waitMatchk.setAppeUser(userId); // 鎿嶄綔浜哄憳鏁版嵁
-            waitMatchk.setAppeTime(new Date());
-            waitMatchk.setModiUser(userId);
-            waitMatchk.setModiTime(new Date());
-            if (!waitMatchkService.insert(waitMatchk)){
-                throw new CoolException("淇濆瓨鐩樼偣妗eけ璐�");
+                LocDetl locDetl = locDetlDto.getLocDetl();
+                //鐢熸垚鐩樼偣妗�
+                WaitMatchk waitMatchk = new WaitMatchk();
+                waitMatchk.setBillNo(billNo);//璁㈠崟缂栧彿
+                waitMatchk.setLocNo(locDetl.getLocNo());//搴撲綅鍙�
+                waitMatchk.setStockQty(locDetl.getQty());
+                waitMatchk.setMatNo(locDetl.getMatNo());//浜у搧缂栧彿
+                waitMatchk.setMatName(locDetl.getMatName());//閾插钩鍚嶇О
+                waitMatchk.setSeqNo(i);
+//                waitMatchk.setIoTime(new Date());
+                waitMatchk.setZpallet(locDetl.getZpallet());
+                waitMatchk.setAppeUser(userId); // 鎿嶄綔浜哄憳鏁版嵁
+                waitMatchk.setAppeTime(new Date());
+                waitMatchk.setModiUser(userId);
+                waitMatchk.setModiTime(new Date());
+                if (!waitMatchkService.insert(waitMatchk)) {
+                    throw new CoolException("淇濆瓨鐩樼偣妗eけ璐�");
+                }
+                i++;
             }
-            i++;
         }
 
         // 鐢熸垚宸ヤ綔妗�
@@ -233,7 +238,6 @@
             }
             // 鐢熸垚宸ヤ綔鍙�
             int workNo = commonService.getWorkNo(DEFAULT_WORK_NO_TYPE);
-
 
             // 鐢熸垚宸ヤ綔妗�
             WrkMast wrkMast = new WrkMast();
@@ -299,7 +303,9 @@
         // 鐢熸垚宸ヤ綔鍙�
         int workNo = commonService.getWorkNo(DEFAULT_WORK_NO_TYPE);
         // 妫�绱㈠簱浣�
-        StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 10, devpNo, null, 0);
+        LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo);
+        locTypeDto.setLocType1((short) 1);
+        StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 10, devpNo, true,null,locTypeDto, 0);
         // 鐢熸垚宸ヤ綔妗�
         WrkMast wrkMast = new WrkMast();
         wrkMast.setWrkNo(workNo);
@@ -530,6 +536,7 @@
         } else if (wrkMast.getWrkSts() > 10) {
             wrkMast.setWrkSts(14L);
         }
+
         // 瀹屾垚鎿嶄綔浜哄憳璁板綍
         wrkMast.setManuType("鎵嬪姩瀹屾垚");
         Date now = new Date();
@@ -551,6 +558,15 @@
         if (Cools.isEmpty(locMast)) {
             throw new CoolException("搴撲綅涓嶅瓨鍦�");
         }
+        //鏌ヨ搴撲綅鐘舵��
+        if (locMast.getLocSts().equals("O")){
+            //鏇存柊搴撲綅鐘舵��
+            locMast.setLocSts("F");
+//            boolean b = locMastService.updateById(locMast);
+            if (!locMastService.updateById(locMast)){
+                throw new CoolException("鏇存柊搴撲綅鐘舵�佸け璐�");
+            }
+        }
 
         for (LocDetlAdjustParam.LocDetlAdjust adjust : param.getList()) {
             if (Cools.isEmpty(adjust.getMatNo())) {
diff --git a/src/main/java/com/zy/asrs/service/impl/WrkDetlServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/WrkDetlServiceImpl.java
index a4c1ff4..8c41d80 100644
--- a/src/main/java/com/zy/asrs/service/impl/WrkDetlServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/WrkDetlServiceImpl.java
@@ -3,6 +3,7 @@
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.core.common.Cools;
 import com.core.exception.CoolException;
+import com.zy.asrs.entity.LocDetl;
 import com.zy.asrs.entity.MatCode;
 import com.zy.asrs.entity.WrkDetl;
 import com.zy.asrs.entity.MatCodeCountDto;
@@ -40,8 +41,8 @@
             wrkDetl.setIoTime(new Date());
             wrkDetl.setQty(dto.getCount()); // 鏁伴噺
             VersionUtils.setWrkDetl(wrkDetl, matCode); // 鐗堟湰鎺у埗
-            wrkDetl.setBillNo("0");
-            wrkDetl.setSeqNo(0);
+            wrkDetl.setBillNo((null != dto.getBillNo()) ? dto.getBillNo() : "0");
+            wrkDetl.setSeqNo((null != dto.getSeqNo()) ? dto.getSeqNo() : 0);
             wrkDetl.setZpallet(barcode); // 鎵樼洏鏉$爜
             wrkDetl.setAppeUser(userId);
             wrkDetl.setAppeTime(new Date());
@@ -58,4 +59,12 @@
     public List<WrkDetl> queryWrkDetl(String matNo, String locNo) {
         return baseMapper.queryWrkDetl(matNo, locNo);
     }
+
+    /**
+     * PDA鐩樼偣鏍规嵁鍑哄簱鍙f煡璇㈠搴旂墿鏂欎俊鎭�
+     */
+    @Override
+    public List<WrkDetl> queryMatFromDevNo(Integer devNo) {
+        return baseMapper.queryMatFromDevNo(devNo);
+    }
 }
diff --git a/src/main/java/com/zy/asrs/task/AbstractHandler.java b/src/main/java/com/zy/asrs/task/AbstractHandler.java
index 9e630fb..64841ec 100644
--- a/src/main/java/com/zy/asrs/task/AbstractHandler.java
+++ b/src/main/java/com/zy/asrs/task/AbstractHandler.java
@@ -2,8 +2,10 @@
 
 import com.zy.asrs.task.core.AsrsException;
 import com.zy.asrs.task.core.ReturnT;
+import com.zy.ints.entity.WaitMatin;
 
 import java.text.MessageFormat;
+import java.util.List;
 
 /**
  * Created by vincent on 2020/7/4
diff --git a/src/main/java/com/zy/asrs/task/PltBarcodeLogScheduler.java b/src/main/java/com/zy/asrs/task/PltBarcodeLogScheduler.java
new file mode 100644
index 0000000..28c206a
--- /dev/null
+++ b/src/main/java/com/zy/asrs/task/PltBarcodeLogScheduler.java
@@ -0,0 +1,30 @@
+package com.zy.asrs.task;
+
+import com.zy.asrs.task.core.ReturnT;
+import com.zy.asrs.task.handler.PltBarcodeLogHandle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+/**
+ * Created by vincent on 2021/9/10
+ */
+@Component
+public class PltBarcodeLogScheduler {
+
+    private static final Logger log = LoggerFactory.getLogger(PltBarcodeLogScheduler.class);
+
+    @Autowired
+    private PltBarcodeLogHandle pltBarcodeLogHandle;
+
+    @Scheduled(cron = "0/30 * * * * ? ")
+    private void execute(){
+        ReturnT<String> returnT = pltBarcodeLogHandle.start();
+        if (!returnT.isSuccess()) {
+            log.error(returnT.getMsg());
+        }
+    }
+
+}
\ No newline at end of file
diff --git a/src/main/java/com/zy/asrs/task/handler/PlcLogHandler.java b/src/main/java/com/zy/asrs/task/handler/PlcLogHandler.java
index d2cecf1..bd76722 100644
--- a/src/main/java/com/zy/asrs/task/handler/PlcLogHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/PlcLogHandler.java
@@ -28,6 +28,15 @@
                     exceptionHandle("鍫嗗灈鏈�&PLC鍛戒护杞巻鍙叉。閿欒 ! ");
                 }
             }
+
+//            //鏉$爜缁勬墭鏁版嵁杞巻鍙叉。 2021-09-10 TQS ADD
+//            int updateBarcodeCount = jdbcTemplate.update("insert into asr_plt_barcode_log select * from asr_plt_barcode where io_status>=2;");
+//            if (updateBarcodeCount > 0) {
+//                int deleteBarcodeCount = jdbcTemplate.update("delete from asr_plt_barcode where io_status>=2;");
+//                if (deleteBarcodeCount <= 0) {
+//                    exceptionHandle("鏉$爜缁勬墭鏁版嵁杞巻鍙叉。閿欒 ! ");
+//                }
+//            }
         } catch (Exception e) {
             e.printStackTrace();
             TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
diff --git a/src/main/java/com/zy/asrs/task/handler/PltBarcodeLogHandle.java b/src/main/java/com/zy/asrs/task/handler/PltBarcodeLogHandle.java
new file mode 100644
index 0000000..718cce6
--- /dev/null
+++ b/src/main/java/com/zy/asrs/task/handler/PltBarcodeLogHandle.java
@@ -0,0 +1,39 @@
+package com.zy.asrs.task.handler;
+
+import com.zy.asrs.task.AbstractHandler;
+import com.zy.asrs.task.core.ReturnT;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+
+/**
+ * Created by TQS on 2021/9/10
+ */
+@Service
+public class PltBarcodeLogHandle extends AbstractHandler<String> {
+
+    @Autowired
+    private JdbcTemplate jdbcTemplate;
+
+    @Transactional
+    public ReturnT<String> start() {
+        try {
+            //鏉$爜缁勬墭鏁版嵁杞巻鍙叉。 2021-09-10 TQS ADD
+            int updateCount = jdbcTemplate.update("insert into asr_plt_barcode_log select * from asr_plt_barcode where io_status>=2;");
+            if (updateCount > 0) {
+                int deleteCount = jdbcTemplate.update("delete from asr_plt_barcode where io_status>=2;");
+                if (deleteCount <= 0) {
+                    exceptionHandle("鏉$爜缁勬墭鏁版嵁杞巻鍙叉。閿欒 ! ");
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return FAIL.setMsg(e.getMessage());
+        }
+        return SUCCESS;
+    }
+
+}
diff --git a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
index 7953d20..ab64af7 100644
--- a/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -1,14 +1,20 @@
 package com.zy.asrs.task.handler;
 
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.zy.asrs.entity.*;
 import com.zy.asrs.service.*;
 import com.zy.asrs.task.AbstractHandler;
 import com.zy.asrs.task.core.ReturnT;
 import com.zy.asrs.utils.VersionUtils;
+import com.zy.ints.entity.IoComplete;
 import com.zy.ints.entity.WaitMatin;
+import com.zy.ints.entity.WaitMatout;
+import com.zy.ints.service.IoCompleteService;
 import com.zy.ints.service.WaitMatinService;
+import com.zy.ints.service.WaitMatoutService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
@@ -30,9 +36,19 @@
     @Autowired
     private LocDetlService locDetlService;
     @Autowired
-    private WaitPakinService waitPakinService;
-    @Autowired
     private WaitMatinService waitMatinService;
+    @Autowired
+    private WaitMatoutService waitMatoutService;
+    @Autowired
+    private IoCompleteService ioCompleteService;
+    @Autowired
+    private PltBarcodeService pltBarcodeService;
+
+    /**
+     * ERP鎺ュ彛鏄惁鍚敤
+     */
+    @Value("${erp.enabled}")
+    private Boolean erpEnabled;
 
     public ReturnT<String> start(WrkMast wrkMast) {
         // 4.鍏ュ簱瀹屾垚
@@ -57,6 +73,7 @@
                 case 10:
                     // 淇敼搴撲綅鐘舵��=D
                     if (locMast.getLocSts().equals("S") || locMast.getLocSts().equals("Q")) {
+                        locMast.setFullPlt(wrkMast.getFullPlt());
                         locMast.setLocSts("D");
                         locMast.setIoTime(now);
                         locMast.setModiTime(now);
@@ -95,38 +112,54 @@
                                 exceptionHandle("鍏ㄦ澘鍏ュ簱 ===>> 娣诲姞搴撳瓨鏄庣粏澶辫触锛沎workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
                             }
                         }
-                        // 鏇存柊鍏ュ簱閫氱煡妗� ioStatus ===>> 2
-                        if(!"0".equals(wrkDetl.getBillNo()) || !wrkDetl.getSeqNo().equals(0)){
-                            WaitMatin waitMatin = waitMatinService.selectOne(new EntityWrapper<WaitMatin>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo()));
-                            if(null != waitMatin && waitMatin.getInQty() >= waitMatin.getQty()){
-                                waitMatin.setIoStatus(2);
-                                waitMatin.setModiTime(new Date());
-                                boolean res = waitMatinService.update(waitMatin, new EntityWrapper<WaitMatin>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo()));
-                                if(!res){
-                                    exceptionHandle("鍏ㄦ澘鍏ュ簱 ===>> 鏇存柊鍏ュ簱閫氱煡妗eけ璐ワ紱[workNo={0}],[billNo={1}]", wrkMast.getWrkNo(),wrkDetl.getBillNo());
-                                }
+
+                        //鏇存柊缁勬墭鏁版嵁鐘舵�佷负鍏ュ簱瀹屾垚 IoStatus ====>> 2
+                        Wrapper<PltBarcode> wrapper = new EntityWrapper<PltBarcode>().eq("barcode", wrkDetl.getZpallet())
+                                .eq("bill_no", wrkDetl.getBillNo()).eq("seq_no", wrkDetl.getSeqNo()).eq("mat_no", wrkDetl.getMatNo());
+                        PltBarcode pltBarcode = pltBarcodeService.selectOne(wrapper);
+                        if(null != pltBarcode) {
+                            pltBarcode.setIoStatus(2);//鍏ュ簱瀹屾垚
+                            boolean res = pltBarcodeService.update(pltBarcode, wrapper);
+                            if(!res){
+//                                exceptionHandle("鍏ㄦ澘鍏ュ簱 ===>> 鏇存柊缁勬墭鏁版嵁澶辫触锛沎workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo());
                             }
                         }
 
-                        //todo:鎻掑叆鍥炴姤妗�
-                        if("Y".equals(wrkMast.getLinkMis())){
-
+                        // 鏇存柊鍏ュ簱閫氱煡妗� ioStatus ====>> 2
+                        WaitMatin waitMatin = waitMatinService.selectOne(new EntityWrapper<WaitMatin>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo()));
+                        if(null != waitMatin && waitMatin.getInQty() >= waitMatin.getQty()){
+                            waitMatin.setIoStatus(2);
+                            waitMatin.setModiTime(now);
+                            boolean res = waitMatinService.update(waitMatin, new EntityWrapper<WaitMatin>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo()));
+                            if(!res){
+                                exceptionHandle("鍏ㄦ澘鍏ュ簱 ===>> 鏇存柊鍏ュ簱閫氱煡妗eけ璐ワ紱[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo());
+                            }
                         }
-//                        try {
-//                            WaitPakin setParam = new WaitPakin();
-//                            setParam.setIoStatus("Y");
-//                            boolean updateRes = waitPakinService.update(setParam
-//                                    , new EntityWrapper<WaitPakin>().eq("zpallet", wrkDetl.getZpallet())
-//                                            .eq("mat_no", wrkDetl.getMatNo())
-//                                            .eq("qty", wrkDetl.getQty()));
-//                            if (!updateRes && updateRes) {
-//                                exceptionHandle("鍏ㄦ澘鍏ュ簱 ===>> 鏇存柊鍏ュ簱閫氱煡妗eけ璐ワ紱[workNo={0}]", wrkMast.getWrkNo());
-//                            }
-//                        } catch (Exception ignore){}
+
+                        //鎻掑叆鍥炴姤妗� insert ====>> io_complete
+                        if(erpEnabled && "Y".equals(wrkMast.getLinkMis())){
+                            IoComplete ioComplete = new IoComplete();
+                            ioComplete.setBillNo(wrkDetl.getBillNo());
+                            ioComplete.setSeqNo(wrkDetl.getSeqNo());
+                            ioComplete.setTaskType(1);//鍏ュ簱
+                            ioComplete.setLocNo(wrkMast.getLocNo());
+                            ioComplete.setZpallet(wrkMast.getBarcode());
+                            ioComplete.setMatNo(wrkDetl.getMatNo());
+                            ioComplete.setMatName(wrkDetl.getMatName());
+                            ioComplete.setQty(wrkDetl.getQty());
+                            ioComplete.setUpdStatus(0);//涓婃姤鐘舵�侊紝寰呭鐞�
+                            ioComplete.setModiTime(now);
+                            ioComplete.setAppeTime(now);
+                            boolean res = ioCompleteService.insert(ioComplete);
+                            if(!res){
+                                exceptionHandle("鍏ㄦ澘鍏ュ簱 ===>> 鎻掑叆鍥炴姤閫氱煡妗eけ璐ワ紱[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo());
+                            }
+                        }
 
                     }
                     // 淇敼搴撲綅鐘舵�� S ====>> F
                     if (locMast.getLocSts().equals("S")) {
+                        locMast.setFullPlt(wrkMast.getFullPlt());
                         locMast.setLocSts("F");
                         locMast.setBarcode(wrkMast.getBarcode());
                         locMast.setIoTime(now);
@@ -150,11 +183,42 @@
                             if (!locDetlService.updateAnfme(locDetl.getQty() - wrkDetl.getQty(), locMast.getLocNo(), wrkDetl.getMatNo())) {
                                 exceptionHandle("鎷f枡鍏ュ簱 ===>> 淇敼搴撳瓨鏄庣粏鏁伴噺澶辫触锛沎workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
                             }
-                            // todo:luxiaotao 3)淇敼鍑哄簱閫氱煡妗� iostatus ==> Y
+
+                            // 鏇存柊鍑哄簱閫氱煡妗� ioStatus ====>> 2
+                            WaitMatout waitMatout = waitMatoutService.selectOne(new EntityWrapper<WaitMatout>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo()));
+                            if(null != waitMatout && waitMatout.getOutQty() >= waitMatout.getQty()){
+                                waitMatout.setIoStatus(2);
+                                waitMatout.setModiTime(now);
+                                boolean res = waitMatoutService.update(waitMatout, new EntityWrapper<WaitMatout>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo()));
+                                if(!res){
+                                    exceptionHandle("鎷f枡鍑哄簱 ===>> 鏇存柊鍑哄簱閫氱煡妗eけ璐ワ紱[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo());
+                                }
+                            }
+
+                            //鎻掑叆鍥炴姤妗� insert ====>> io_complete
+                            if(erpEnabled && "Y".equals(wrkMast.getLinkMis())){
+                                IoComplete ioComplete = new IoComplete();
+                                ioComplete.setBillNo(wrkDetl.getBillNo());
+                                ioComplete.setSeqNo(wrkDetl.getSeqNo());
+                                ioComplete.setTaskType(2);//鍑哄簱
+                                ioComplete.setLocNo(wrkMast.getLocNo());
+                                ioComplete.setZpallet(wrkMast.getBarcode());
+                                ioComplete.setMatNo(wrkDetl.getMatNo());
+                                ioComplete.setMatName(wrkDetl.getMatName());
+                                ioComplete.setQty(wrkDetl.getQty());
+                                ioComplete.setUpdStatus(0);//涓婃姤鐘舵�侊紝寰呭鐞�
+                                ioComplete.setModiTime(now);
+                                ioComplete.setAppeTime(now);
+                                boolean res = ioCompleteService.insert(ioComplete);
+                                if(!res){
+                                    exceptionHandle("鎷f枡鍑哄簱 ===>> 鎻掑叆鍥炴姤閫氱煡妗eけ璐ワ紱[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo());
+                                }
+                            }
                         }
                     }
                     // 淇敼搴撲綅鐘舵�� Q ====>> F
                     if (locMast.getLocSts().equals("Q")) {
+                        locMast.setFullPlt(wrkMast.getFullPlt());
                         locMast.setLocSts("F");
                         locMast.setBarcode(wrkMast.getBarcode());
                         locMast.setIoTime(now);
@@ -188,10 +252,42 @@
                                 exceptionHandle("骞舵澘鍏ュ簱 ===>> 鏂板搴撳瓨鏄庣粏澶辫触锛沎workNo={0}],[matNo={1}]", wrkMast.getWrkNo(), wrkDetl.getMatNo());
                             }
                         }
-                        // todo:luxiaotao 3)淇敼鍑哄簱閫氱煡妗� status ==> Y
+
+                        // 鏇存柊鍏ュ簱閫氱煡妗� ioStatus ====>> 2
+                        WaitMatin waitMatin = waitMatinService.selectOne(new EntityWrapper<WaitMatin>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo()));
+                        if(null != waitMatin && waitMatin.getInQty() >= waitMatin.getQty()){
+                            waitMatin.setIoStatus(2);
+                            waitMatin.setModiTime(now);
+                            boolean res = waitMatinService.update(waitMatin, new EntityWrapper<WaitMatin>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo()));
+                            if(!res){
+                                exceptionHandle("骞舵澘鍏ュ簱 ===>> 鏇存柊鍏ュ簱閫氱煡妗eけ璐ワ紱[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo());
+                            }
+                        }
+
+                        //鎻掑叆鍥炴姤妗� insert ====>> io_complete
+                        if(erpEnabled && "Y".equals(wrkMast.getLinkMis())){
+                            IoComplete ioComplete = new IoComplete();
+                            ioComplete.setBillNo(wrkDetl.getBillNo());
+                            ioComplete.setSeqNo(wrkDetl.getSeqNo());
+                            ioComplete.setTaskType(1);//鍏ュ簱
+                            ioComplete.setLocNo(wrkMast.getLocNo());
+                            ioComplete.setZpallet(wrkMast.getBarcode());
+                            ioComplete.setMatNo(wrkDetl.getMatNo());
+                            ioComplete.setMatName(wrkDetl.getMatName());
+                            ioComplete.setQty(wrkDetl.getQty());
+                            ioComplete.setUpdStatus(0);//涓婃姤鐘舵�侊紝寰呭鐞�
+                            ioComplete.setModiTime(now);
+                            ioComplete.setAppeTime(now);
+                            boolean res = ioCompleteService.insert(ioComplete);
+                            if(!res){
+                                exceptionHandle("骞舵澘鍏ュ簱 ===>> 鎻掑叆鍥炴姤閫氱煡妗eけ璐ワ紱[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo());
+                            }
+                        }
+
                     }
                     // 淇敼搴撲綅鐘舵�� Q ====>> F
                     if (locMast.getLocSts().equals("Q")) {
+                        locMast.setFullPlt(wrkMast.getFullPlt());
                         locMast.setLocSts("F");
                         locMast.setBarcode(wrkMast.getBarcode());
                         locMast.setIoTime(now);
@@ -208,9 +304,9 @@
                     if (wrkDetls57.isEmpty()) {
                         exceptionHandle("鐩樼偣鍏ュ簱 ===>> 宸ヤ綔鏄庣粏妗d负绌猴紱[workNo={0}]", wrkMast.getWrkNo());
                     }
-                    // todo:luxiaotao 3)淇敼鐩樼偣閫氱煡妗� status ==> Y
                     // 淇敼搴撲綅鐘舵�� Q ====>> F
                     if (locMast.getLocSts().equals("Q")) {
+                        locMast.setFullPlt(wrkMast.getFullPlt());
                         locMast.setLocSts("F");
                         locMast.setBarcode(wrkMast.getBarcode());
                         locMast.setIoTime(now);
@@ -232,10 +328,11 @@
                             exceptionHandle("搴撲綅绉昏浆 ===>> 杞Щ搴撳瓨鏄庣粏鏁版嵁澶辫触锛沎婧愬簱浣�={0}],[鐩爣搴撲綅={1}]", wrkMast.getSourceLocNo(), wrkMast.getLocNo());
                         }
                     }
-                    // todo:luxiaotao 3)淇敼鐩樼偣閫氱煡妗� status ==> Y
                     // 淇敼婧愬簱浣嶇姸鎬� ==> O
                     LocMast sourceLoc = locMastService.selectById(wrkMast.getSourceLocNo());
+                    String fullPlt = sourceLoc.getFullPlt();
                     if (null != sourceLoc) {
+                        sourceLoc.setFullPlt("N");
                         sourceLoc.setBarcode("");
                         sourceLoc.setLocSts("O");
                         sourceLoc.setModiTime(now);
@@ -245,6 +342,7 @@
                         }
                     }
                     // 淇敼鐩爣搴撲綅鐘舵�� ==> .locSts
+                    locMast.setFullPlt(fullPlt);
                     locMast.setLocSts(locSts);
                     locMast.setBarcode(wrkMast.getBarcode());
                     locMast.setIoTime(now);
@@ -286,7 +384,35 @@
                         exceptionHandle("鍏ㄦ澘鍑哄簱 ===>> 宸ヤ綔鏄庣粏妗d负绌猴紱[workNo={0}]", wrkMast.getWrkNo());
                     }
                     for (WrkDetl wrkDetl : wrkDetls101) {
-                        // todo:luxiaotao 3)淇敼鍑哄簱閫氱煡妗� status ==> Y
+                        WaitMatout waitMatout = waitMatoutService.selectOne(new EntityWrapper<WaitMatout>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo()));
+                        if(null != waitMatout && waitMatout.getOutQty() >= waitMatout.getQty()){
+                            waitMatout.setIoStatus(2);
+                            waitMatout.setModiTime(now);
+                            boolean res = waitMatoutService.update(waitMatout, new EntityWrapper<WaitMatout>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo()));
+                            if(!res){
+                                exceptionHandle("鍏ㄦ澘鍑哄簱 ===>> 鏇存柊鍑哄簱閫氱煡妗eけ璐ワ紱[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo());
+                            }
+                        }
+
+                        //鎻掑叆鍥炴姤妗� insert ====>> io_complete
+                        if(erpEnabled && "Y".equals(wrkMast.getLinkMis())){
+                            IoComplete ioComplete = new IoComplete();
+                            ioComplete.setBillNo(wrkDetl.getBillNo());
+                            ioComplete.setSeqNo(wrkDetl.getSeqNo());
+                            ioComplete.setTaskType(2);//鍑哄簱
+                            ioComplete.setLocNo(wrkMast.getLocNo());
+                            ioComplete.setZpallet(wrkMast.getBarcode());
+                            ioComplete.setMatNo(wrkDetl.getMatNo());
+                            ioComplete.setMatName(wrkDetl.getMatName());
+                            ioComplete.setQty(wrkDetl.getQty());
+                            ioComplete.setUpdStatus(0);//涓婃姤鐘舵�侊紝寰呭鐞�
+                            ioComplete.setModiTime(now);
+                            ioComplete.setAppeTime(now);
+                            boolean res = ioCompleteService.insert(ioComplete);
+                            if(!res){
+                                exceptionHandle("鍏ㄦ澘鍑哄簱 ===>> 鎻掑叆鍥炴姤閫氱煡妗eけ璐ワ紱[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo());
+                            }
+                        }
                     }
                     // 鍒犻櫎宸ヤ綔妗f簮搴撲綅鐨勫簱瀛樻槑缁�
                     if (!locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", wrkMast.getSourceLocNo()))) {
@@ -294,6 +420,7 @@
                     }
                     // 淇敼婧愬簱浣嶇姸鎬� R ===>> O
                     if (locMast.getLocSts().equals("R")) {
+                        locMast.setFullPlt("N");
                         locMast.setLocSts("O");
                         locMast.setBarcode("");
                         locMast.setModiTime(now);
@@ -307,6 +434,7 @@
                 case 110:
                     // 淇敼搴撲綅鐘舵�� R ===>> O
                     if (locMast.getLocSts().equals("R")) {
+                        locMast.setFullPlt("N");
                         locMast.setLocSts("O");
                         locMast.setBarcode("");
                         locMast.setModiTime(now);
diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java
new file mode 100644
index 0000000..e80f7e5
--- /dev/null
+++ b/src/main/java/com/zy/asrs/utils/Utils.java
@@ -0,0 +1,175 @@
+package com.zy.asrs.utils;
+
+import com.core.common.Arith;
+import com.core.common.Cools;
+import com.zy.common.properties.SlaveProperties;
+
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by vincent on 2020/8/27
+ */
+public class Utils {
+
+    private static final DecimalFormat fmt = new DecimalFormat("##0.00");
+
+    public static float scale(Float f){
+        if (f == null || f == 0f || Float.isNaN(f)) {
+            return 0f;
+        }
+        return (float) Arith.multiplys(2, f, 1);
+    }
+
+    public static String zerofill(String msg, Integer count){
+        if (msg.length() == count){
+            return msg;
+        } else if (msg.length() > count){
+            return msg.substring(0, 16);
+        } else {
+            StringBuilder msgBuilder = new StringBuilder(msg);
+            for (int i = 0; i<count-msg.length(); i++){
+                msgBuilder.insert(0,"0");
+            }
+            return msgBuilder.toString();
+        }
+    }
+
+    /**
+     * 鍒ゆ柇鏄惁涓烘繁搴撲綅
+     */
+    public static boolean isDeepLoc(SlaveProperties slaveProperties, String locNo){
+        if (slaveProperties.isDoubleDeep()) {
+            int row = getRow(locNo);
+            return slaveProperties.getDoubleLocs().contains(row);
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * 鍒ゆ柇鏄惁涓烘繁搴撲綅
+     */
+    public static boolean isDeepLoc(SlaveProperties slaveProperties, Integer row){
+        if (slaveProperties.isDoubleDeep()) {
+            return slaveProperties.getDoubleLocs().contains(row);
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * 鍒ゆ柇鏄惁涓烘祬搴撲綅
+     */
+    public static boolean isShallowLoc(SlaveProperties slaveProperties, String locNo){
+        if (slaveProperties.isDoubleDeep()) {
+            int row = getRow(locNo);
+            return !slaveProperties.getDoubleLocs().contains(row);
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * 鍒ゆ柇鏄惁涓烘祬搴撲綅
+     */
+    public static boolean isShallowLoc(SlaveProperties slaveProperties, Integer row){
+        if (slaveProperties.isDoubleDeep()) {
+            return !slaveProperties.getDoubleLocs().contains(row);
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * 鑾峰彇 娣卞簱浣嶅搴旂殑娴呭簱浣嶅彿
+     */
+    public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) {
+        int row = getRow(deepLoc);
+        int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
+        int shallowRow = remainder == 1 ? (row + 1) : (row - 1);
+        return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2);
+    }
+
+    /**
+     * 鑾峰彇 娣卞簱浣嶆帓瀵瑰簲鐨勬祬搴撲綅鎺�
+     */
+    public static Integer getShallowRow(SlaveProperties slaveProperties, Integer deepRow) {
+        int remainder = (int) Arith.remainder(deepRow, slaveProperties.getGroupCount());
+        return remainder == 1 ? (deepRow + 1) : (deepRow - 1);
+    }
+
+    /**
+     * 鑾峰彇 娴呭簱浣嶅搴旂殑娣卞簱浣嶅彿
+     */
+    public static String getDeepLoc(SlaveProperties slaveProperties, String shallowLoc) {
+        int row = getRow(shallowLoc);
+        int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount());
+        int targetRow;
+        if (remainder == 2) {
+            targetRow = row - 1;
+        } else if (remainder == 3) {
+            targetRow = row + 1;
+        } else {
+            throw new RuntimeException(shallowLoc + "涓嶆槸娴呭簱浣嶏紝绯荤粺绻佸繖");
+        }
+        return zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2);
+    }
+
+    /**
+     * 鑾峰彇 娴呭簱浣嶆帓瀵瑰簲鐨勬繁搴撲綅鎺�
+     */
+    public static Integer getDeepRow(SlaveProperties slaveProperties, Integer shallowRow) {
+        int remainder = (int) Arith.remainder(shallowRow, slaveProperties.getGroupCount());
+        int targetRow;
+        if (remainder == 2) {
+            targetRow = shallowRow - 1;
+        } else if (remainder == 3) {
+            targetRow = shallowRow + 1;
+        } else {
+            throw new RuntimeException(shallowRow + "涓嶆槸娴呭簱浣嶆帓锛岀郴缁熺箒蹇�");
+        }
+        return targetRow;
+    }
+
+    /**
+     * 閫氳繃搴撲綅鍙疯幏鍙� 鎺�
+     */
+    public static int getRow(String locNo) {
+        if (!Cools.isEmpty(locNo)) {
+            return Integer.parseInt(locNo.substring(0, 2));
+        }
+        throw new RuntimeException("搴撲綅瑙f瀽寮傚父");
+    }
+
+    /**
+     * 褰撴绱㈠埌鍙屾繁搴撲綅鐨勬祬搴撲綅鏃讹紝濡傛灉娣卞簱浣嶆棤璐э紝鍒欐斁鍏ュ搴旂殑娣卞簱浣�
+     */
+    public static void toDeepIfEmptyByShallow(String shallowLoc) {
+        int row = getRow(shallowLoc);
+        int remainder = (int) Arith.remainder(row, 4);
+        int targetRow = 0;
+        if (remainder == 2) {
+            targetRow = row - 1;
+        } else if (remainder == 3) {
+            targetRow = row + 1;
+        } else {
+            throw new RuntimeException(shallowLoc + "涓嶆槸娴呭簱浣嶏紝绯荤粺绻佸繖");
+        }
+        String targetLoc = zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2);
+
+    }
+
+    public static void main(String[] args) {
+        SlaveProperties slaveProperties = new SlaveProperties();
+        slaveProperties.setDoubleDeep(true);
+        List<Integer> list = new ArrayList<>();
+        list.add(1);list.add(4);list.add(5);list.add(8);list.add(9);list.add(12);
+        slaveProperties.setDoubleLocs(list);
+        slaveProperties.setGroupCount(4);
+        Integer deepRow = getDeepRow(slaveProperties, 6);
+        System.out.println(deepRow);
+
+    }
+}
diff --git a/src/main/java/com/zy/asrs/utils/VersionUtils.java b/src/main/java/com/zy/asrs/utils/VersionUtils.java
index 590e82b..dc9cad3 100644
--- a/src/main/java/com/zy/asrs/utils/VersionUtils.java
+++ b/src/main/java/com/zy/asrs/utils/VersionUtils.java
@@ -1,9 +1,8 @@
 package com.zy.asrs.utils;
 
-import com.zy.asrs.entity.LocDetl;
-import com.zy.asrs.entity.MatCode;
-import com.zy.asrs.entity.WaitPakin;
-import com.zy.asrs.entity.WrkDetl;
+import com.core.exception.CoolException;
+import com.zy.asrs.entity.*;
+import com.zy.common.model.LocTypeDto;
 import com.zy.common.utils.excel.matcode.MatCodeExcel;
 
 /**
@@ -121,5 +120,41 @@
         matCode.setNum5(excel.getNum5());
     }
 
+    /**
+     *  搴撲綅绉昏浆鏃剁被鍨嬫娴�
+     **/
+    public static void locMoveCheckLocType(LocMast sourceLoc, LocMast loc){
+        // 濡傛灉婧愬簱浣嶆槸楂樺簱浣嶏紝鐩爣搴撲綅鏄綆搴撲綅
+        if (sourceLoc.getLocType1() == 2 && loc.getLocType1() == 1) {
+            throw new CoolException("楂樺簱浣嶄笉鑳界Щ杞嚦浣庡簱浣�");
+        }
+//        // 濡傛灉婧愬簱浣嶆槸瀹藉簱浣嶏紝鐩爣搴撲綅鏄獎搴撲綅
+//        if (sourceLoc.getLocType2() == 2 && loc.getLocType2() == 1) {
+//            throw new CoolException("瀹藉簱浣嶄笉鑳界Щ杞嚦绐勫簱浣�");
+//        }
+//        // 濡傛灉婧愬簱浣嶆槸閲嶅簱浣嶏紝鐩爣搴撲綅鏄交搴撲綅
+//        if (sourceLoc.getLocType3() == 2 && loc.getLocType3() == 1) {
+//            throw new CoolException("閲嶅簱浣嶄笉鑳界Щ杞嚦杞诲簱浣�");
+//        }
+    }
+
+    /**
+     *  搴撲綅绉昏浆鏃剁被鍨嬫娴�
+     **/
+    public static boolean locMoveCheckLocType(LocMast loc, LocTypeDto dto){
+        // 濡傛灉婧愬簱浣嶆槸楂樺簱浣嶏紝鐩爣搴撲綅鏄綆搴撲綅
+        if (dto.getLocType1() == 2 && loc.getLocType1() == 1) {
+            return false;
+        }
+//        // 濡傛灉婧愬簱浣嶆槸瀹藉簱浣嶏紝鐩爣搴撲綅鏄獎搴撲綅
+//        if (dto.getLocType2() == 2 && loc.getLocType2() == 1) {
+//            return false;
+//        }
+//        // 濡傛灉婧愬簱浣嶆槸閲嶅簱浣嶏紝鐩爣搴撲綅鏄交搴撲綅
+//        if (dto.getLocType3() == 2 && loc.getLocType3() == 1) {
+//            return false;
+//        }
+        return true;
+    }
 
 }
diff --git a/src/main/java/com/zy/common/CodeBuilder.java b/src/main/java/com/zy/common/CodeBuilder.java
index f5dd70b..7fe1f35 100644
--- a/src/main/java/com/zy/common/CodeBuilder.java
+++ b/src/main/java/com/zy/common/CodeBuilder.java
@@ -18,8 +18,11 @@
         generator.url="192.168.4.208:1433;databasename=xgmasrs";
         generator.username="sa";
         generator.password="sa@123";
-        generator.table="ints_io_complete_log";
-        generator.packagePath="com.zy.ints";
+        generator.table="asr_plt_barcode";
+        generator.packagePath="com.zy.asrs";
+//        generator.html=false;
+//        generator.js=false;
+//        generator.htmlDetail=false;
         generator.build();
     }
 
diff --git a/src/main/java/com/zy/common/model/LocTypeDto.java b/src/main/java/com/zy/common/model/LocTypeDto.java
new file mode 100644
index 0000000..276d7b7
--- /dev/null
+++ b/src/main/java/com/zy/common/model/LocTypeDto.java
@@ -0,0 +1,65 @@
+package com.zy.common.model;
+
+import com.core.exception.CoolException;
+import com.zy.asrs.entity.BasDevp;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * Created by vincent on 2020/10/19
+ */
+@Data
+public class LocTypeDto implements Cloneable, Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    // 楂樹綆绫诲瀷{0:鏈煡,1:浣庡簱浣�,2:楂樺簱浣峿
+    private Short locType1;
+
+    // 瀹界獎绫诲瀷{0:鏈煡,1:绐勫簱浣�,2:瀹藉簱浣峿
+    private Short locType2;
+
+    // 杞婚噸绫诲瀷{0:鏈煡,1:杞诲簱浣�,2:閲嶅簱浣峿
+    private Short locType3;
+
+
+
+    public LocTypeDto(BasDevp basDevp) {
+        if (basDevp.getLocType1() == null || basDevp.getLocType1() == 0) {
+            throw new CoolException("plc楂樹綆妫�娴嬪紓甯�");
+        }
+        if (basDevp.getLocType1() == 1) {
+            this.locType1 = 1; // 浣庡簱浣�
+        } else {
+            this.locType1 = 2; // 楂樺簱浣�
+        }
+//        if (basDevp.getLocType2() == null || basDevp.getLocType2() == 0) {
+//            throw new CoolException("plc瀹界獎妫�娴嬪紓甯�");
+//        }
+//        if (basDevp.getLocType2() == 1) {
+//            this.locType2 = 1; // 绐勫簱浣�
+//        } else {
+//            this.locType2 = 2; // 瀹藉簱浣�
+//        }
+//        if (basDevp.getLocType3() == null || basDevp.getLocType3() == 0) {
+//            throw new CoolException("plc杞婚噸妫�娴嬪紓甯�");
+//        }
+//        if (basDevp.getLocType3() == 1) {
+//            this.locType3 = 1; // 杞诲簱浣�
+//        } else {
+//            this.locType3 = 2; // 閲嶅簱浣�
+//        }
+    }
+
+    @Override
+    public LocTypeDto clone() {
+        try {
+            return (LocTypeDto) super.clone();
+        } catch (CloneNotSupportedException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+}
diff --git a/src/main/java/com/zy/common/model/StartupDto.java b/src/main/java/com/zy/common/model/StartupDto.java
index dacec79..304aca3 100644
--- a/src/main/java/com/zy/common/model/StartupDto.java
+++ b/src/main/java/com/zy/common/model/StartupDto.java
@@ -13,6 +13,8 @@
 
     private String locNo;
 
+    private Integer workNo;
+
     public Integer getSourceStaNo() {
         return sourceStaNo;
     }
@@ -44,4 +46,12 @@
     public void setLocNo(String locNo) {
         this.locNo = locNo;
     }
+
+    public Integer getWorkNo() {
+        return workNo;
+    }
+
+    public void setWorkNo(Integer workNo) {
+        this.workNo = workNo;
+    }
 }
diff --git a/src/main/java/com/zy/common/properties/SlaveProperties.java b/src/main/java/com/zy/common/properties/SlaveProperties.java
new file mode 100644
index 0000000..c5184c4
--- /dev/null
+++ b/src/main/java/com/zy/common/properties/SlaveProperties.java
@@ -0,0 +1,24 @@
+package com.zy.common.properties;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by vincent on 2020/8/4
+ */
+@Data
+@Configuration
+@ConfigurationProperties(prefix = "wcs-slave")
+public class SlaveProperties {
+
+    private boolean doubleDeep;
+
+    private List<Integer> doubleLocs = new ArrayList<>();
+
+    private int groupCount;
+
+}
diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index b647bae..6df78ab 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -1,5 +1,6 @@
 package com.zy.common.service;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.core.common.Arith;
@@ -7,8 +8,12 @@
 import com.core.exception.CoolException;
 import com.zy.asrs.entity.*;
 import com.zy.asrs.service.*;
+import com.zy.asrs.utils.Utils;
+import com.zy.asrs.utils.VersionUtils;
+import com.zy.common.model.LocTypeDto;
 import com.zy.common.model.Shelves;
 import com.zy.common.model.StartupDto;
+import com.zy.common.properties.SlaveProperties;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -39,6 +44,8 @@
     private LocMastService locMastService;
     @Autowired
     private LocDetlService locDetlService;
+    @Autowired
+    private SlaveProperties slaveProperties;
 
     /**
      * 鐢熸垚宸ヤ綔鍙�
@@ -82,71 +89,132 @@
         return workNo;
     }
 
+    public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, boolean emptyMk, List<String> matNos, LocTypeDto locTypeDto, int times) {
+        LocTypeDto oldLocType = locTypeDto.clone();
+        return getLocNo(whsType, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times);
+    }
+
     /**
      * 妫�绱㈠簱浣嶅彿
      * @param whsType 绫诲瀷 1:鍙屾繁寮忚揣鏋�
      * @param staDescId 璺緞ID
      * @param sourceStaNo 婧愮珯
-     * @param matNos 浜у搧鍙烽泦鍚�
+     * @param matNos 鐗╂枡鍙烽泦鍚�
      * @return locNo 妫�绱㈠埌鐨勫簱浣嶅彿
      */
-    public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, int times) {
-//        if (sourceStaNo == 3) {
-//            whsType = 1;
-//        } else if (sourceStaNo == 7) {
-//            whsType = 2;
-//        } else if (sourceStaNo == 19) {
-//            whsType = 3;
-//        } else {
-//            throw new CoolException("鏃犳晥鍏ュ簱绔�");
-//        }
+    public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, boolean emptyMk, List<String> matNos, LocTypeDto locTypeDto, LocTypeDto oldLocType, int times) {
         StartupDto startupDto = new StartupDto();
+        // 鐢熸垚宸ヤ綔鍙�
+        int workNo = getWorkNo(0);
+//        if (locTypeDto.getLocType3() == 1) { // 杞昏揣淇″彿
+//            whsType = 2;    // 5 - 12 杞讳粨
+//        } else if (locTypeDto.getLocType3() == 2) { // 閲嶈揣淇″彿
+//            whsType = 1;    // 1 - 4 閲嶄粨
+//        }
         RowLastno rowLastno = rowLastnoService.selectById(whsType);
         if (Cools.isEmpty(rowLastno)) {
             throw new CoolException("鏁版嵁寮傚父锛岃鑱旂郴绠$悊鍛�");
         }
-        int curRow = rowLastno.getCurrentRow();
-        int sRow = rowLastno.getsRow();
-        int eRow = rowLastno.geteRow();
-        int crn_qty = rowLastno.getCrnQty();
-        int rowCount = eRow - sRow + 1;
+        int curRow = rowLastno.getCurrentRow();  // 褰撳墠鍒�
+        int sRow = rowLastno.getsRow();          // 璧峰鍒�
+        int eRow = rowLastno.geteRow();          // 缁堟鍒�
+        int crn_qty = rowLastno.getCrnQty();     // 鍫嗗灈鏈烘暟閲忥紙宸烽亾鏁伴噺锛�
+        int rowCount = eRow - sRow + 1;          // 搴撴帓鎬绘暟
         // 鐩爣鍫嗗灈鏈哄彿
         int crnNo = 0;
         // 鐩爣搴撲綅
         LocMast locMast = null;
 
-
-        // 鎸夎鍒欒疆璇㈣揣鏋�
-        if (whsType == 1 || whsType == 2) {
-            if (curRow == sRow) {
-                curRow = eRow;
-            } else {
-                curRow = sRow;
+        // 闈犺繎鎽嗘斁瑙勫垯 --- 鍚屽ぉ鍚岃鏍肩墿鏂�
+        if (!Cools.isEmpty(matNos)) {
+            List<String> locNos = locDetlService.getSameDetlToday(matNos.get(0), sRow, eRow);
+            for (String locNo : locNos) {
+                if (Utils.isShallowLoc(slaveProperties, locNo)) {
+                    continue;
+                }
+                String shallowLocNo = Utils.getShallowLoc(slaveProperties, locNo);
+                LocMast shallowLoc = locMastService.selectById(shallowLocNo);
+                // 妫�娴嬬洰鏍囧簱浣嶆槸鍚︿负绌哄簱浣�
+                if (shallowLoc != null && shallowLoc.getLocSts().equals("O")) {
+                    // 娴呭簱浣嶇鍚堝昂瀵告娴�
+                    if (VersionUtils.locMoveCheckLocType(shallowLoc, locTypeDto)) {
+                        // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
+                        if (locMastService.checkEmptyCount(shallowLoc)) {
+                            // 娴呭簱浣嶅搴斿爢鍨涙満蹇呴』鍙敤涓旀棤寮傚父
+                            if (basCrnpService.checkSiteError(shallowLoc.getCrnNo(), true)) {
+                                locMast = shallowLoc;
+                                crnNo = locMast.getCrnNo();
+                                break;
+                            }
+                        }
+                    }
+                }
             }
-            crnNo = whsType;
-            basCrnpService.checkSiteStatus(crnNo, true);
-        } else {
+        }
+        // 闈犺繎鎽嗘斁瑙勫垯 --- 绌烘墭
+        if (emptyMk) {
+            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").ge("row1", sRow).le("row1", eRow));
+            if (locMasts.size() > 0) {
+                for (LocMast loc : locMasts) {
+                    if (Utils.isShallowLoc(slaveProperties, loc.getLocNo())) {
+                        continue;
+                    }
+                    String shallowLocNo = Utils.getShallowLoc(slaveProperties,  loc.getLocNo());
+                    // 妫�娴嬬洰鏍囧簱浣嶆槸鍚︿负绌哄簱浣�
+                    LocMast shallowLoc = locMastService.selectById(shallowLocNo);
+                    if (shallowLoc != null && shallowLoc.getLocSts().equals("O")) {
+                        // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
+                        if (locMastService.checkEmptyCount(shallowLoc)) {
+                            // 娴呭簱浣嶅搴斿爢鍨涙満蹇呴』鍙敤涓旀棤寮傚父
+                            if (basCrnpService.checkSiteError(shallowLoc.getCrnNo(), true)) {
+                                locMast = shallowLoc;
+                                crnNo = locMast.getCrnNo();
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        // 濡傛灉娌℃湁鐩歌繎鐗╂枡锛屽垯鎸夎鍒欒疆璇㈣揣鏋�
+        if (null == locMast) {
             Shelves shelves = new Shelves(rowCount, crn_qty);
-            curRow = curRow - 4;
-            for (int i = 0; i < shelves.group; i ++) {
-                curRow = shelves.start(curRow);
-                if (curRow < 0) {
-                    throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
+            // 閲嶅簱浣� 1 - 4鎺�
+            if (whsType == 1) {
+                for (int i = 0; i < shelves.group; i ++) {
+                    curRow = shelves.start(curRow);
+                    if (curRow < 0) {
+                        throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
+                    }
+                    Integer crnNo1 = shelves.getCrnNo(curRow);
+                    if (basCrnpService.checkSiteError(crnNo1, true)) {
+                        crnNo = crnNo1;
+                        break;
+                    }
                 }
-                Integer crnNo1 = shelves.getCrnNo(curRow);
-                if (basCrnpService.checkSiteError(crnNo1 + 2, true)) {
-                    // 鍋忕Щ閲忚ˉ鍋�
-                    curRow = curRow + 4;
-                    crnNo = crnNo1 + 2;
-                    break;
-                }
+//                // 杞诲簱浣� 5 - 12鎺�
+//            } else {
+//                curRow = curRow - 4;
+//                for (int i = 0; i < shelves.group; i ++) {
+//                    curRow = shelves.start(curRow);
+//                    if (curRow < 0) {
+//                        throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
+//                    }
+//                    Integer crnNo1 = shelves.getCrnNo(curRow);
+//                    if (basCrnpService.checkSiteError(crnNo1 + 1, true)) {
+//                        // 鍋忕Щ閲忚ˉ鍋�
+//                        curRow = curRow + 4;
+//                        crnNo = crnNo1 + 1;
+//                        break;
+//                    }
+//                }
             }
         }
 
         if (crnNo == 0) {
             throw new CoolException("娌℃湁鍙敤鐨勫爢鍨涙満");
         }
-
         // 鑾峰彇鐩爣绔�
         Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
                 .eq("type_no", staDescId)
@@ -157,6 +225,7 @@
             log.error("鍏ュ簱璺緞涓嶅瓨鍦�, staDescId={}, sourceStaNo={}, crnNo={}", staDescId, sourceStaNo, crnNo);
             throw new CoolException("鍏ュ簱璺緞涓嶅瓨鍦�");
         }
+
         // 妫�娴嬬洰鏍囩珯
         BasDevp staNo = basDevpService.selectById(staDesc.getCrnStn());
         if (!staNo.getAutoing().equals("Y")) {
@@ -169,21 +238,79 @@
 
         // 寮�濮嬫煡鎵惧簱浣� ==============================>>
 
-        // 鏌ユ壘搴撲綅
-        locMast = locMastService.queryFreeLocMast(curRow);
+        // 1.褰撴绱㈠簱鎺掍负娴呭簱浣嶆帓鏃讹紝浼樺厛瀵绘壘褰撳墠搴撴帓鐨勬繁搴撲綅鎺�
+        if (locMast == null) {
+            if (Utils.isShallowLoc(slaveProperties, curRow)) {
+                Integer deepRow = Utils.getDeepRow(slaveProperties, curRow);
+                locMast = locMastService.queryFreeLocMast(deepRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3());
+                // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
+                if (!locMastService.checkEmptyCount(locMast)) {
+                    locMast = null;
+                }
+            }
+            if (Cools.isEmpty(locMast)) {
+                locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3());
+                // 鍥犲簱浣嶇Щ杞�侀渶棰勭暀绌哄簱浣�
+                if (!locMastService.checkEmptyCount(locMast)) {
+                    locMast = null;
+                }
+                // 鐩爣搴撲綅 ===>> 娴呭簱浣嶏紝 鍒欐牎楠屽叾娣卞簱浣嶆槸鍚︿负 F D X
+                if (null != locMast && Utils.isShallowLoc(slaveProperties, locMast.getLocNo())) {
+                    LocMast deepLoc = locMastService.selectById(Utils.getDeepLoc(slaveProperties, locMast.getLocNo()));
+                    if (!deepLoc.getLocSts().equals("F") && !deepLoc.getLocSts().equals("D") && !deepLoc.getLocSts().equals("X")) {
+                        locMast = null;
+                    }
+                }
+                // 鐩爣搴撲綅 ===>> 娣卞簱浣嶏紝 鍒欐牎楠屽叾娴呭簱浣嶆槸鍚︿负 O
+                if (null != locMast && Utils.isDeepLoc(slaveProperties, locMast.getLocNo())) {
+                    LocMast shallowLoc = locMastService.selectById(Utils.getShallowLoc(slaveProperties, locMast.getLocNo()));
+                    if (!shallowLoc.getLocSts().equals("O")) {
+                        locMast = null;
+                    }
+                }
+            }
+        }
 
+        // 2.搴撲綅褰撳墠鎵�灞炲昂瀵告棤绌哄簱浣嶆椂锛岃皟鏁村昂瀵稿弬鏁帮紝鍚戜笂鍏煎妫�绱㈠簱浣�
         if (Cools.isEmpty(locMast)) {
             // 褰撳墠宸烽亾鏃犵┖搴撲綅鏃讹紝閫掑綊璋冩暣鑷充笅涓�宸烽亾锛屾绱㈠叏閮ㄥ贩閬撴棤鏋滃悗锛岃烦鍑洪�掑綊
-            if (times >= rowCount) {
-                log.error("绯荤粺娌℃湁绌哄簱浣嶏紒锛侊紒");
-                throw new CoolException("娌℃湁绌哄簱浣�");
+            if (times < rowCount) {
+                times = times + 1;
+                return getLocNo(1, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times);
+            } else {
+                times = 0;
             }
-            times = times + 1;
-            return getLocNo(1, staDescId, sourceStaNo, matNos, times);
+            // 璐х墿妫�绱綆搴撲綅浠撳け璐ワ紝鍏煎楂樺簱浣嶄粨鍚庣户缁墽琛�
+            if (locTypeDto.getLocType1() == 1) {
+                locTypeDto.setLocType1((short) 2);
+                return getLocNo(1, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times);
+            }
+//            // 璐х墿妫�绱㈢獎搴撲綅浠撳け璐ワ紝鍏煎瀹藉簱浣嶄粨鍚庣户缁墽琛�
+//            if (locTypeDto.getLocType2() == 1) {
+//                locTypeDto.setLocType2((short) 2);
+//                if (oldLocType.getLocType1() == 1) {
+//                    locTypeDto.setLocType1((short) 1);
+//                }
+//                return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times);
+//            }
+//            // 璐х墿妫�绱㈣交搴撲綅浠撳け璐ワ紝鍏煎閲嶅簱浣嶄粨鍚庣户缁墽琛�
+//            if (locTypeDto.getLocType3() == 1) {
+//                locTypeDto.setLocType3((short) 2);
+//                if (oldLocType.getLocType1() == 1) {
+//                    locTypeDto.setLocType1((short) 1);
+//                }
+//                if (oldLocType.getLocType2() == 1) {
+//                    locTypeDto.setLocType2((short) 1);
+//                }
+//                return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times);
+//            }
+            log.error("绯荤粺娌℃湁绌哄簱浣嶏紒锛侊紒 灏哄瑙勬牸锛� {}锛� 杞娆℃暟锛歿}", JSON.toJSONString(locTypeDto), times);
+            throw new CoolException("娌℃湁绌哄簱浣�");
         }
         String locNo = locMast.getLocNo();
 
         // 杩斿洖dto
+        startupDto.setWorkNo(workNo);
         startupDto.setCrnNo(crnNo);
         startupDto.setSourceStaNo(sourceStaNo);
         startupDto.setStaNo(staNo.getDevNo());
@@ -191,6 +318,115 @@
         return startupDto;
     }
 
+//    /**
+//     * 妫�绱㈠簱浣嶅彿
+//     * @param whsType 绫诲瀷 1:鍙屾繁寮忚揣鏋�
+//     * @param staDescId 璺緞ID
+//     * @param sourceStaNo 婧愮珯
+//     * @param matNos 浜у搧鍙烽泦鍚�
+//     * @return locNo 妫�绱㈠埌鐨勫簱浣嶅彿
+//     */
+//    public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, int times) {
+////        if (sourceStaNo == 3) {
+////            whsType = 1;
+////        } else if (sourceStaNo == 7) {
+////            whsType = 2;
+////        } else if (sourceStaNo == 19) {
+////            whsType = 3;
+////        } else {
+////            throw new CoolException("鏃犳晥鍏ュ簱绔�");
+////        }
+//        StartupDto startupDto = new StartupDto();
+//        RowLastno rowLastno = rowLastnoService.selectById(whsType);
+//        if (Cools.isEmpty(rowLastno)) {
+//            throw new CoolException("鏁版嵁寮傚父锛岃鑱旂郴绠$悊鍛�");
+//        }
+//        int curRow = rowLastno.getCurrentRow();
+//        int sRow = rowLastno.getsRow();
+//        int eRow = rowLastno.geteRow();
+//        int crn_qty = rowLastno.getCrnQty();
+//        int rowCount = eRow - sRow + 1;
+//        // 鐩爣鍫嗗灈鏈哄彿
+//        int crnNo = 0;
+//        // 鐩爣搴撲綅
+//        LocMast locMast = null;
+//
+//
+//        // 鎸夎鍒欒疆璇㈣揣鏋�
+//        if (whsType == 1 || whsType == 2) {
+//            if (curRow == sRow) {
+//                curRow = eRow;
+//            } else {
+//                curRow = sRow;
+//            }
+//            crnNo = whsType;
+//            basCrnpService.checkSiteStatus(crnNo, true);
+//        } else {
+//            Shelves shelves = new Shelves(rowCount, crn_qty);
+//            curRow = curRow - 4;
+//            for (int i = 0; i < shelves.group; i ++) {
+//                curRow = shelves.start(curRow);
+//                if (curRow < 0) {
+//                    throw new CoolException("妫�绱㈠簱浣嶅け璐ワ紝璇疯仈绯荤鐞嗗憳");
+//                }
+//                Integer crnNo1 = shelves.getCrnNo(curRow);
+//                if (basCrnpService.checkSiteError(crnNo1 + 2, true)) {
+//                    // 鍋忕Щ閲忚ˉ鍋�
+//                    curRow = curRow + 4;
+//                    crnNo = crnNo1 + 2;
+//                    break;
+//                }
+//            }
+//        }
+//
+//        if (crnNo == 0) {
+//            throw new CoolException("娌℃湁鍙敤鐨勫爢鍨涙満");
+//        }
+//
+//        // 鑾峰彇鐩爣绔�
+//        Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
+//                .eq("type_no", staDescId)
+//                .eq("stn_no", sourceStaNo)
+//                .eq("crn_no", crnNo);
+//        StaDesc staDesc = staDescService.selectOne(wrapper);
+//        if (Cools.isEmpty(staDesc)) {
+//            log.error("鍏ュ簱璺緞涓嶅瓨鍦�, staDescId={}, sourceStaNo={}, crnNo={}", staDescId, sourceStaNo, crnNo);
+//            throw new CoolException("鍏ュ簱璺緞涓嶅瓨鍦�");
+//        }
+//        // 妫�娴嬬洰鏍囩珯
+//        BasDevp staNo = basDevpService.selectById(staDesc.getCrnStn());
+//        if (!staNo.getAutoing().equals("Y")) {
+//            throw new CoolException("鐩爣绔�"+staDesc.getCrnStn()+"涓嶅彲鐢�");
+//        }
+//
+//        // 鏇存柊搴撲綅鎺掑彿
+//        rowLastno.setCurrentRow(curRow);
+//        rowLastnoService.updateById(rowLastno);
+//
+//        // 寮�濮嬫煡鎵惧簱浣� ==============================>>
+//
+//        // 鏌ユ壘搴撲綅
+//        locMast = locMastService.queryFreeLocMast(curRow);
+//
+//        if (Cools.isEmpty(locMast)) {
+//            // 褰撳墠宸烽亾鏃犵┖搴撲綅鏃讹紝閫掑綊璋冩暣鑷充笅涓�宸烽亾锛屾绱㈠叏閮ㄥ贩閬撴棤鏋滃悗锛岃烦鍑洪�掑綊
+//            if (times >= rowCount) {
+//                log.error("绯荤粺娌℃湁绌哄簱浣嶏紒锛侊紒");
+//                throw new CoolException("娌℃湁绌哄簱浣�");
+//            }
+//            times = times + 1;
+//            return getLocNo(1, staDescId, sourceStaNo, matNos, times);
+//        }
+//        String locNo = locMast.getLocNo();
+//
+//        // 杩斿洖dto
+//        startupDto.setCrnNo(crnNo);
+//        startupDto.setSourceStaNo(sourceStaNo);
+//        startupDto.setStaNo(staNo.getDevNo());
+//        startupDto.setLocNo(locNo);
+//        return startupDto;
+//    }
+
     public static void main(String[] args) {
         System.out.println(Arith.remainder(1, 4));
         System.out.println("0200201".substring(0, 2));
diff --git a/src/main/java/com/zy/common/web/WcsController.java b/src/main/java/com/zy/common/web/WcsController.java
new file mode 100644
index 0000000..d3c84c0
--- /dev/null
+++ b/src/main/java/com/zy/common/web/WcsController.java
@@ -0,0 +1,219 @@
+package com.zy.common.web;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.core.common.Cools;
+import com.core.common.R;
+import com.core.exception.CoolException;
+import com.zy.asrs.entity.*;
+import com.zy.asrs.service.*;
+import com.zy.common.model.LocTypeDto;
+import com.zy.common.model.StartupDto;
+import com.zy.common.service.CommonService;
+import com.zy.common.web.param.SearchLocParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Created by vincent on 2020/10/30
+ */
+@Slf4j
+@RestController
+@RequestMapping("/rpc")
+public class WcsController {
+
+    @Autowired
+    private WrkMastService wrkMastService;
+    @Autowired
+    private BasDevpService basDevpService;
+    @Autowired
+    private CommonService commonService;
+    @Autowired
+    private WrkDetlService wrkDetlService;
+    @Autowired
+    private LocMastService locMastService;
+    @Autowired
+    private WaitPakinService waitPakinService;
+    @Autowired
+    private  LocDetlService locDetlService;
+    @Autowired
+    private PltBarcodeService pltBarcodeService;
+
+    @PostMapping("/pakin/loc/v1")
+    @ResponseBody
+    public R getLocNo(@RequestBody SearchLocParam param) {
+        if (Cools.isEmpty(param.getIoType())) {
+            return R.error("鍏ュ嚭搴撶被鍨嬩笉鑳戒负绌�");
+        }
+        if (Cools.isEmpty(param.getSourceStaNo())) {
+            return R.error("婧愮珯缂栧彿涓嶈兘涓虹┖");
+        }
+        List<PltBarcode> pltBarcodes = null;
+        if (param.getIoType() == 1) {
+            if (Cools.isEmpty(param.getBarcode())) {
+                return R.error("鏉$爜涓嶈兘涓虹┖");
+            }
+            pltBarcodes = pltBarcodeService.selectList(new EntityWrapper<PltBarcode>().eq("barcode", param.getBarcode()));
+            if (Cools.isEmpty(pltBarcodes)) {
+                return R.error("鏉$爜鏁版嵁閿欒");
+            }
+            int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode()));
+            int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode()));
+            if (countLoc > 0 || countWrk > 0) {
+                return R.error("宸ヤ綔妗�/搴撳瓨鏉$爜鏁版嵁宸插瓨鍦�");
+            }
+        }
+        if (Cools.isEmpty(param.getLocType1())){
+            return R.error("楂樹綆妫�娴嬩俊鍙蜂笉鑳戒负绌�");
+        }
+
+        // 婧愮珯鐐圭姸鎬佹娴�
+        BasDevp sourceStaNo = basDevpService.checkSiteStatus(param.getSourceStaNo(), true);
+        LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo);
+        locTypeDto.setLocType1(param.getLocType1());
+
+        StartupDto dto = null;
+        switch (param.getIoType()) {
+            case 1:
+                dto = startupFullPutStore(param.getSourceStaNo(), param.getBarcode(), locTypeDto, pltBarcodes);
+                break;
+            case 10:
+                dto = emptyPlateIn(param.getSourceStaNo(), locTypeDto);
+                break;
+            default:
+                break;
+        }
+
+        return R.ok().add(dto);
+    }
+
+    /**
+     * 鍏ㄦ澘鍏ュ簱 todo:luxiaotao 1.鐣欏嚭涓浆搴撲綅
+     */
+    @Transactional
+    public StartupDto startupFullPutStore(Integer devpNo, String barcode, LocTypeDto locTypeDto, List<PltBarcode> pltBarcodes) {
+        // 婧愮珯鐐圭姸鎬佹娴�
+        BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true);
+        // 妫�绱㈠簱浣�
+        List<String> matNos = pltBarcodes.stream().map(PltBarcode::getMatNo).distinct().collect(Collectors.toList());
+        StartupDto dto = commonService.getLocNo(1, 1, devpNo, false, matNos, locTypeDto,0);
+        int workNo = dto.getWorkNo();
+
+        // 鐢熸垚宸ヤ綔妗�
+        WrkMast wrkMast = new WrkMast();
+        wrkMast.setWrkNo(workNo);
+        wrkMast.setIoTime(new Date());
+        wrkMast.setWrkSts(2L); // 宸ヤ綔鐘舵�侊細鐢熸垚鍏ュ簱ID
+        wrkMast.setIoType(1); // 鍏ュ嚭搴撶姸鎬侊細1.鍏ュ簱
+        wrkMast.setIoPri(13D); // 浼樺厛绾�
+        wrkMast.setCrnNo(dto.getCrnNo());
+        wrkMast.setSourceStaNo(dto.getSourceStaNo());
+        wrkMast.setStaNo(dto.getStaNo());
+        wrkMast.setLocNo(dto.getLocNo());
+        wrkMast.setBarcode(barcode); // 鎵樼洏鐮�
+        wrkMast.setFullPlt("Y"); // 婊℃澘锛歒
+        wrkMast.setPicking("N"); // 鎷f枡
+        wrkMast.setExitMk("N"); // 閫�鍑�
+        wrkMast.setEmptyMk("N"); // 绌烘澘
+        wrkMast.setLinkMis("Y");
+        wrkMast.setCtnType(sourceStaNo.getCtnType()); // 瀹瑰櫒绫诲瀷
+        // 鎿嶄綔浜哄憳鏁版嵁
+        wrkMast.setAppeTime(new Date());
+        wrkMast.setModiTime(new Date());
+        boolean res = wrkMastService.insert(wrkMast);
+        if (!res) {
+            throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐�");
+        }
+        // 鐢熸垚宸ヤ綔妗f槑缁�
+        List<MatCodeCountDto> matDtos = new ArrayList<>();
+        pltBarcodes.forEach(elem -> {
+            matDtos.add(new MatCodeCountDto(elem.getBillNo(), elem.getSeqNo(), elem.getMatNo(), elem.getQty()));
+
+            //鏇存柊缁勬墭鏁版嵁鐘舵�佷负鍏ュ簱涓�
+            Wrapper<PltBarcode> wrapper = new EntityWrapper<PltBarcode>().eq("barcode", elem.getBarcode())
+                    .eq("bill_no", elem.getBillNo()).eq("seq_no", elem.getSeqNo()).eq("mat_no", elem.getMatNo());
+            PltBarcode pltBarcode = pltBarcodeService.selectOne(wrapper);
+            pltBarcode.setLocNo(dto.getLocNo());
+            pltBarcode.setIoStatus(1);//鍏ュ簱涓�
+            pltBarcodeService.update(pltBarcode,wrapper);
+        });
+        wrkDetlService.createWorkDetail(workNo, matDtos, barcode, null);
+        // 鏇存柊婧愮珯鐐逛俊鎭�
+        sourceStaNo.setWrkNo(workNo);
+        sourceStaNo.setModiTime(new Date());
+        if (!basDevpService.updateById(sourceStaNo)){
+            throw new CoolException("鏇存柊婧愮珯澶辫触");
+        }
+        // 鏇存柊鐩爣搴撲綅鐘舵��
+        LocMast locMast = locMastService.selectById(dto.getLocNo());
+        if (locMast.getLocSts().equals("O")){
+            locMast.setLocSts("S"); // S.鍏ュ簱棰勭害
+            locMast.setModiTime(new Date());
+            if (!locMastService.updateById(locMast)){
+                throw new CoolException("鏀瑰彉搴撲綅鐘舵�佸け璐�");
+            }
+        } else {
+            throw new CoolException(dto.getLocNo()+"鐩爣搴撲綅宸茶鍗犵敤");
+        }
+        return dto;
+    }
+
+    @Transactional
+    public StartupDto emptyPlateIn(Integer devpNo, LocTypeDto locTypeDto) {
+        // 婧愮珯鐐圭姸鎬佹娴�
+        BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true);
+        // 妫�绱㈠簱浣�
+        StartupDto dto = commonService.getLocNo(1, 10, devpNo, true, null, locTypeDto,0);
+        int workNo = dto.getWorkNo();
+        // 鐢熸垚宸ヤ綔妗�
+        WrkMast wrkMast = new WrkMast();
+        wrkMast.setWrkNo(workNo);
+        wrkMast.setIoTime(new Date());
+        wrkMast.setWrkSts(2L); // 宸ヤ綔鐘舵�侊細鐢熸垚鍏ュ簱ID
+        wrkMast.setIoType(10); // 鍏ュ嚭搴撶姸鎬侊細10.绌烘澘鍏ュ簱
+        wrkMast.setIoPri(13D); // 浼樺厛绾�
+        wrkMast.setCrnNo(dto.getCrnNo());
+        wrkMast.setSourceStaNo(dto.getSourceStaNo());
+        wrkMast.setStaNo(dto.getStaNo());
+        wrkMast.setLocNo(dto.getLocNo());
+        wrkMast.setFullPlt("N"); // 婊℃澘
+        wrkMast.setPicking("N"); // 鎷f枡
+        wrkMast.setExitMk("N"); // 閫�鍑�
+        wrkMast.setEmptyMk("Y"); // 绌烘澘
+        wrkMast.setLinkMis("Y");
+        wrkMast.setCtnType(sourceStaNo.getCtnType()); // 瀹瑰櫒绫诲瀷
+        // 鎿嶄綔浜哄憳鏁版嵁
+        wrkMast.setAppeTime(new Date());
+        wrkMast.setModiTime(new Date());
+        boolean res = wrkMastService.insert(wrkMast);
+        if (!res) {
+            throw new CoolException("淇濆瓨宸ヤ綔妗eけ璐�");
+        }
+        // 鏇存柊婧愮珯鐐逛俊鎭�
+        sourceStaNo.setWrkNo(workNo);
+        sourceStaNo.setModiTime(new Date());
+        if (!basDevpService.updateById(sourceStaNo)){
+            throw new CoolException("鏇存柊婧愮珯澶辫触");
+        }
+        // 鏇存柊鐩爣搴撲綅鐘舵��
+        LocMast locMast = locMastService.selectById(dto.getLocNo());
+        if (locMast.getLocSts().equals("O")){
+            locMast.setLocSts("S"); // S.鍏ュ簱棰勭害
+            locMast.setModiTime(new Date());
+            if (!locMastService.updateById(locMast)){
+                throw new CoolException("鏀瑰彉搴撲綅鐘舵�佸け璐�");
+            }
+        } else {
+            throw new CoolException(dto.getLocNo()+"鐩爣搴撲綅宸茶鍗犵敤");
+        }
+        return dto;
+    }
+
+}
diff --git a/src/main/java/com/zy/common/web/param/SearchLocParam.java b/src/main/java/com/zy/common/web/param/SearchLocParam.java
new file mode 100644
index 0000000..94b500c
--- /dev/null
+++ b/src/main/java/com/zy/common/web/param/SearchLocParam.java
@@ -0,0 +1,30 @@
+package com.zy.common.web.param;
+
+import com.alibaba.fastjson.JSON;
+import lombok.Data;
+
+/**
+ * Created by vincent on 2020/10/30
+ */
+@Data
+public class SearchLocParam {
+
+    private Integer ioType;
+
+    private Integer sourceStaNo;
+
+    private String barcode;
+
+    // 搴撲綅瑙勬牸锛� 0:鏈煡, 1:浣庡簱浣�, 2:涓簱浣�, 3:楂樺簱浣� 锛�
+    private Short locType1;
+
+    public static void main(String[] args) {
+        SearchLocParam searchLocParam = new SearchLocParam();
+        searchLocParam.setIoType(1);
+        searchLocParam.setSourceStaNo(101);
+        searchLocParam.setBarcode("10001111");
+        searchLocParam.setLocType1((short) 1);
+        System.out.println(JSON.toJSONString(searchLocParam));
+    }
+
+}
diff --git a/src/main/java/com/zy/ints/controller/IoCompleteController.java b/src/main/java/com/zy/ints/controller/IoCompleteController.java
index 1e0372c..d27b867 100644
--- a/src/main/java/com/zy/ints/controller/IoCompleteController.java
+++ b/src/main/java/com/zy/ints/controller/IoCompleteController.java
@@ -5,19 +5,21 @@
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.baomidou.mybatisplus.plugins.Page;
-import com.core.common.DateUtils;
-import com.zy.common.web.BaseController;
-import com.zy.ints.entity.IoComplete;
-import com.zy.ints.service.IoCompleteService;
 import com.core.annotations.ManagerAuth;
 import com.core.common.BaseRes;
 import com.core.common.Cools;
+import com.core.common.DateUtils;
 import com.core.common.R;
-import com.core.controller.AbstractBaseController;
+import com.zy.common.web.BaseController;
+import com.zy.ints.entity.IoComplete;
+import com.zy.ints.service.IoCompleteService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @RestController
 public class IoCompleteController extends BaseController {
@@ -37,10 +39,12 @@
                   @RequestParam(defaultValue = "10")Integer limit,
                   @RequestParam(required = false)String orderByField,
                   @RequestParam(required = false)String orderByType,
+                  @RequestParam(required = false)String condition,
                   @RequestParam Map<String, Object> param){
         EntityWrapper<IoComplete> wrapper = new EntityWrapper<>();
         excludeTrash(param);
         convert(param, wrapper);
+        allLike(IoComplete.class, param.keySet(), wrapper, condition);
         if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
         return R.ok(ioCompleteService.selectPage(new Page<>(curr, limit), wrapper));
     }
diff --git a/src/main/java/com/zy/ints/controller/IoCompleteLogController.java b/src/main/java/com/zy/ints/controller/IoCompleteLogController.java
index eed1cef..2891fa4 100644
--- a/src/main/java/com/zy/ints/controller/IoCompleteLogController.java
+++ b/src/main/java/com/zy/ints/controller/IoCompleteLogController.java
@@ -5,19 +5,21 @@
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.baomidou.mybatisplus.plugins.Page;
-import com.core.common.DateUtils;
-import com.zy.common.web.BaseController;
-import com.zy.ints.entity.IoCompleteLog;
-import com.zy.ints.service.IoCompleteLogService;
 import com.core.annotations.ManagerAuth;
 import com.core.common.BaseRes;
 import com.core.common.Cools;
+import com.core.common.DateUtils;
 import com.core.common.R;
-import com.core.controller.AbstractBaseController;
+import com.zy.common.web.BaseController;
+import com.zy.ints.entity.IoCompleteLog;
+import com.zy.ints.service.IoCompleteLogService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @RestController
 public class IoCompleteLogController extends BaseController {
@@ -37,10 +39,12 @@
                   @RequestParam(defaultValue = "10")Integer limit,
                   @RequestParam(required = false)String orderByField,
                   @RequestParam(required = false)String orderByType,
+                  @RequestParam(required = false)String condition,
                   @RequestParam Map<String, Object> param){
         EntityWrapper<IoCompleteLog> wrapper = new EntityWrapper<>();
         excludeTrash(param);
         convert(param, wrapper);
+        allLike(IoCompleteLog.class, param.keySet(), wrapper, condition);
         if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
         return R.ok(ioCompleteLogService.selectPage(new Page<>(curr, limit), wrapper));
     }
diff --git a/src/main/java/com/zy/ints/controller/StockSyncController.java b/src/main/java/com/zy/ints/controller/StockSyncController.java
new file mode 100644
index 0000000..445ac54
--- /dev/null
+++ b/src/main/java/com/zy/ints/controller/StockSyncController.java
@@ -0,0 +1,123 @@
+package com.zy.ints.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.core.common.DateUtils;
+import com.zy.ints.entity.StockSync;
+import com.zy.ints.service.StockSyncService;
+import com.core.annotations.ManagerAuth;
+import com.core.common.BaseRes;
+import com.core.common.Cools;
+import com.core.common.R;
+import com.zy.common.web.BaseController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+
+@RestController
+public class StockSyncController extends BaseController {
+
+    @Autowired
+    private StockSyncService stockSyncService;
+
+    @RequestMapping(value = "/stockSync/{id}/auth")
+    @ManagerAuth
+    public R get(@PathVariable("id") String id) {
+        return R.ok(stockSyncService.selectById(String.valueOf(id)));
+    }
+
+    @RequestMapping(value = "/stockSync/list/auth")
+    @ManagerAuth
+    public R list(@RequestParam(defaultValue = "1")Integer curr,
+                  @RequestParam(defaultValue = "10")Integer limit,
+                  @RequestParam(required = false)String orderByField,
+                  @RequestParam(required = false)String orderByType,
+                  @RequestParam Map<String, Object> param){
+        EntityWrapper<StockSync> wrapper = new EntityWrapper<>();
+        excludeTrash(param);
+        convert(param, wrapper);
+        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
+        return R.ok(stockSyncService.selectPage(new Page<>(curr, limit), wrapper));
+    }
+
+    private void convert(Map<String, Object> map, EntityWrapper wrapper){
+        for (Map.Entry<String, Object> entry : map.entrySet()){
+            String val = String.valueOf(entry.getValue());
+            if (val.contains(RANGE_TIME_LINK)){
+                String[] dates = val.split(RANGE_TIME_LINK);
+                wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
+                wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
+            } else {
+                wrapper.like(entry.getKey(), val);
+            }
+        }
+    }
+
+    @RequestMapping(value = "/stockSync/add/auth")
+    @ManagerAuth
+    public R add(StockSync stockSync) {
+        stockSyncService.insert(stockSync);
+        return R.ok();
+    }
+
+	@RequestMapping(value = "/stockSync/update/auth")
+	@ManagerAuth
+    public R update(StockSync stockSync){
+        if (Cools.isEmpty(stockSync) || null==stockSync.getMatNo()){
+            return R.error();
+        }
+        stockSyncService.updateById(stockSync);
+        return R.ok();
+    }
+
+    @RequestMapping(value = "/stockSync/delete/auth")
+    @ManagerAuth
+    public R delete(@RequestParam(value="ids[]") Long[] ids){
+         for (Long id : ids){
+            stockSyncService.deleteById(id);
+        }
+        return R.ok();
+    }
+
+    @RequestMapping(value = "/stockSync/export/auth")
+    @ManagerAuth
+    public R export(@RequestBody JSONObject param){
+        EntityWrapper<StockSync> wrapper = new EntityWrapper<>();
+        List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
+        Map<String, Object> map = excludeTrash(param.getJSONObject("stockSync"));
+        convert(map, wrapper);
+        List<StockSync> list = stockSyncService.selectList(wrapper);
+        return R.ok(exportSupport(list, fields));
+    }
+
+    @RequestMapping(value = "/stockSyncQuery/auth")
+    @ManagerAuth
+    public R query(String condition) {
+        EntityWrapper<StockSync> wrapper = new EntityWrapper<>();
+        wrapper.like("mat_no", condition);
+        Page<StockSync> page = stockSyncService.selectPage(new Page<>(0, 10), wrapper);
+        List<Map<String, Object>> result = new ArrayList<>();
+        for (StockSync stockSync : page.getRecords()){
+            Map<String, Object> map = new HashMap<>();
+            map.put("id", stockSync.getMatNo());
+            map.put("value", stockSync.getMatNo());
+            result.add(map);
+        }
+        return R.ok(result);
+    }
+
+    @RequestMapping(value = "/stockSync/check/column/auth")
+    @ManagerAuth
+    public R query(@RequestBody JSONObject param) {
+        Wrapper<StockSync> wrapper = new EntityWrapper<StockSync>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
+        if (null != stockSyncService.selectOne(wrapper)){
+            return R.parse(BaseRes.REPEAT).add(getComment(StockSync.class, String.valueOf(param.get("key"))));
+        }
+        return R.ok();
+    }
+
+}
diff --git a/src/main/java/com/zy/ints/controller/WaitMatchkController.java b/src/main/java/com/zy/ints/controller/WaitMatchkController.java
index e6cb4a9..81e14b2 100644
--- a/src/main/java/com/zy/ints/controller/WaitMatchkController.java
+++ b/src/main/java/com/zy/ints/controller/WaitMatchkController.java
@@ -5,16 +5,24 @@
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.baomidou.mybatisplus.plugins.Page;
-import com.core.common.DateUtils;
-import com.zy.common.web.BaseController;
-import com.zy.ints.entity.WaitMatchk;
-import com.zy.ints.service.WaitMatchkService;
 import com.core.annotations.ManagerAuth;
 import com.core.common.BaseRes;
 import com.core.common.Cools;
+import com.core.common.DateUtils;
 import com.core.common.R;
-import com.core.controller.AbstractBaseController;
+import com.core.exception.CoolException;
+import com.zy.asrs.entity.LocDetl;
+import com.zy.asrs.entity.LocMast;
+import com.zy.asrs.entity.MatCode;
+import com.zy.asrs.service.LocDetlService;
+import com.zy.asrs.service.LocMastService;
+import com.zy.asrs.service.MatCodeService;
+import com.zy.common.web.BaseController;
+import com.zy.ints.entity.WaitMatchk;
+import com.zy.ints.service.WaitMatchkLogService;
+import com.zy.ints.service.WaitMatchkService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.*;
@@ -24,6 +32,14 @@
 
     @Autowired
     private WaitMatchkService waitMatchkService;
+    @Autowired
+    private WaitMatchkLogService waitMatchkLogService;
+    @Autowired
+    private LocMastService locMastService;
+    @Autowired
+    private LocDetlService locDetlService;
+    @Autowired
+    private MatCodeService matCodeService;
 
     //鐩樼偣閫氱煡妗�
 
@@ -39,10 +55,12 @@
                   @RequestParam(defaultValue = "10")Integer limit,
                   @RequestParam(required = false)String orderByField,
                   @RequestParam(required = false)String orderByType,
+                  @RequestParam(required = false)String condition,
                   @RequestParam Map<String, Object> param){
         EntityWrapper<WaitMatchk> wrapper = new EntityWrapper<>();
         excludeTrash(param);
         convert(param, wrapper);
+        allLike(WaitMatchk.class, param.keySet(), wrapper, condition);
         if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
         return R.ok(waitMatchkService.selectPage(new Page<>(curr, limit), wrapper));
     }
@@ -77,15 +95,101 @@
         return R.ok();
     }
 
+    /**
+     * 鍒犻櫎鐩樼偣閫氱煡妗o紝鍒犻櫎鍓嶈浆鍘嗗彶妗�
+     * @param param
+     * @return
+     */
     @RequestMapping(value = "/waitMatchk/delete/auth")
     @ManagerAuth
+    @Transactional
     public R delete(@RequestParam String param){
         List<WaitMatchk> list = JSONArray.parseArray(param, WaitMatchk.class);
         if (Cools.isEmpty(list)){
             return R.error();
         }
         for (WaitMatchk entity : list){
-            waitMatchkService.delete(new EntityWrapper<>(entity));
+            boolean res =  waitMatchkLogService.save(entity.getBillNo(),entity.getLocNo(),entity.getMatNo());
+            if(!res){
+                throw new CoolException("杞巻鍙叉。鍑洪敊[locNo:"+entity.getLocNo()+"],[matNo:"+entity.getMatNo()+"]");
+            }else {
+                waitMatchkService.delete(new EntityWrapper<>(entity));
+            }
+        }
+        return R.ok();
+    }
+
+    /**
+     * 瀹℃牳鐩樼偣鍗曟嵁
+     * @param param
+     * @return
+     */
+    @RequestMapping(value = "/waitMatchk/verify/auth")
+    @ManagerAuth
+    @Transactional
+    public R verify(@RequestParam String param){
+        List<WaitMatchk> list = JSONArray.parseArray(param, WaitMatchk.class);
+        if (Cools.isEmpty(list)){
+            return R.error();
+        }
+        Date now = new Date();
+        for (WaitMatchk entity : list){
+            LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no",entity.getLocNo()));
+            if(null != locMast && locMast.getLocSts().equals("F")){
+                Wrapper<LocDetl> wrapperDetl = new EntityWrapper<LocDetl>().eq("loc_no",entity.getLocNo()).eq("mat_no",entity.getMatNo());
+                LocDetl locDetl = locDetlService.selectOne(wrapperDetl);
+                if(null != locDetl) {//鏇存柊鏁伴噺锛屽垹闄ゆ槑缁�
+                    if(entity.getCheckQty().equals(0)){
+                        if(!locDetlService.delete(wrapperDetl)){
+                            throw new CoolException("鍒犻櫎鏁伴噺涓�0鏄庣粏鍑洪敊[locNo:"+locDetl.getLocNo()+"],[matNo:"+locDetl.getMatNo()+"]");
+                        }
+                    }else{
+                        if(!entity.getCheckQty().equals(locDetl.getQty())){ //搴撳瓨鏁伴噺涓庣洏鐐规暟閲忕浉鍚屼笉鐢ㄦ洿鏂�
+                            locDetl.setQty(entity.getCheckQty());
+                            if(!locDetlService.update(locDetl,wrapperDetl)){
+                                throw new CoolException("鏇存柊搴撳瓨鏄庣粏鍑洪敊[locNo:"+locDetl.getLocNo()+"],[matNo:"+locDetl.getMatNo()+"]");
+                            }
+                        }
+
+                    }
+                } else {//鎻掑叆鏄庣粏
+                    LocDetl one = new LocDetl();
+                    one.setLocNo(entity.getLocNo());
+                    one.setMatNo(entity.getMatNo());
+                    one.setQty(entity.getCheckQty());
+                    one.setModiUser(getUserId());
+                    one.setModiTime(now);
+                    one.setAppeUser(getUserId());
+                    one.setAppeTime(now);
+
+                    WaitMatchk waitMatchk = waitMatchkService.selectOne(new EntityWrapper<WaitMatchk>().eq("loc_no",entity.getLocNo()));
+                    if(null != waitMatchk){
+                        one.setZpallet(waitMatchk.getZpallet());
+                    }
+                    MatCode matCode = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no",entity.getMatNo()));
+                    if(null != matCode) {
+                        one.setMatName(matCode.getMatName());
+                        one.setUnit(matCode.getUnit());
+                        one.setSpecs(matCode.getSpecs());
+                        one.setSize(matCode.getSize());
+                        one.setColor(matCode.getColor());
+                    } else {
+                        throw new CoolException("鏂板鏄庣粏鐗╂枡缂栫爜涓嶅瓨鍦ㄥ嚭閿橻matNo:"+entity.getMatNo()+"]");
+                    }
+
+                    if(!locDetlService.insert(one)){
+                        throw new CoolException("鎻掑叆搴撳瓨鏄庣粏鍑洪敊[locNo:"+entity.getLocNo()+"],[matNo:"+entity.getMatNo()+"]");
+                    }
+                }
+
+                entity.setVerifyStatus(1);
+                entity.setVerifyUser(getUserId());
+                entity.setModiTime(now);
+                Wrapper<WaitMatchk> wrapper = new EntityWrapper<WaitMatchk>().eq("loc_no",entity.getLocNo()).eq("mat_no",entity.getMatNo());
+                waitMatchkService.update(entity,wrapper);
+            } else {
+                throw new CoolException("搴撲綅闈炲湪搴撶姸鎬�:" + locMast.getLocNo());
+            }
         }
         return R.ok();
     }
diff --git a/src/main/java/com/zy/ints/controller/WaitMatchkLogController.java b/src/main/java/com/zy/ints/controller/WaitMatchkLogController.java
index 076c3d8..7365237 100644
--- a/src/main/java/com/zy/ints/controller/WaitMatchkLogController.java
+++ b/src/main/java/com/zy/ints/controller/WaitMatchkLogController.java
@@ -5,19 +5,21 @@
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.baomidou.mybatisplus.plugins.Page;
-import com.core.common.DateUtils;
-import com.zy.common.web.BaseController;
-import com.zy.ints.entity.WaitMatchkLog;
-import com.zy.ints.service.WaitMatchkLogService;
 import com.core.annotations.ManagerAuth;
 import com.core.common.BaseRes;
 import com.core.common.Cools;
+import com.core.common.DateUtils;
 import com.core.common.R;
-import com.core.controller.AbstractBaseController;
+import com.zy.common.web.BaseController;
+import com.zy.ints.entity.WaitMatchkLog;
+import com.zy.ints.service.WaitMatchkLogService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @RestController
 public class WaitMatchkLogController extends BaseController {
@@ -37,10 +39,12 @@
                   @RequestParam(defaultValue = "10")Integer limit,
                   @RequestParam(required = false)String orderByField,
                   @RequestParam(required = false)String orderByType,
+                  @RequestParam(required = false)String condition,
                   @RequestParam Map<String, Object> param){
         EntityWrapper<WaitMatchkLog> wrapper = new EntityWrapper<>();
         excludeTrash(param);
         convert(param, wrapper);
+        allLike(WaitMatchkLog.class, param.keySet(), wrapper, condition);
         if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
         return R.ok(waitMatchkLogService.selectPage(new Page<>(curr, limit), wrapper));
     }
diff --git a/src/main/java/com/zy/ints/controller/WaitMatinLogController.java b/src/main/java/com/zy/ints/controller/WaitMatinLogController.java
index 812214e..6032d2a 100644
--- a/src/main/java/com/zy/ints/controller/WaitMatinLogController.java
+++ b/src/main/java/com/zy/ints/controller/WaitMatinLogController.java
@@ -5,19 +5,21 @@
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.baomidou.mybatisplus.plugins.Page;
-import com.core.common.DateUtils;
-import com.zy.common.web.BaseController;
-import com.zy.ints.entity.WaitMatinLog;
-import com.zy.ints.service.WaitMatinLogService;
 import com.core.annotations.ManagerAuth;
 import com.core.common.BaseRes;
 import com.core.common.Cools;
+import com.core.common.DateUtils;
 import com.core.common.R;
-import com.core.controller.AbstractBaseController;
+import com.zy.common.web.BaseController;
+import com.zy.ints.entity.WaitMatinLog;
+import com.zy.ints.service.WaitMatinLogService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @RestController
 public class WaitMatinLogController extends BaseController {
@@ -37,10 +39,12 @@
                   @RequestParam(defaultValue = "10")Integer limit,
                   @RequestParam(required = false)String orderByField,
                   @RequestParam(required = false)String orderByType,
+                  @RequestParam(required = false)String condition,
                   @RequestParam Map<String, Object> param){
         EntityWrapper<WaitMatinLog> wrapper = new EntityWrapper<>();
         excludeTrash(param);
         convert(param, wrapper);
+        allLike(WaitMatinLog.class, param.keySet(), wrapper, condition);
         if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
         return R.ok(waitMatinLogService.selectPage(new Page<>(curr, limit), wrapper));
     }
diff --git a/src/main/java/com/zy/ints/controller/WaitMatoutController.java b/src/main/java/com/zy/ints/controller/WaitMatoutController.java
index b9f5ab7..3b149a3 100644
--- a/src/main/java/com/zy/ints/controller/WaitMatoutController.java
+++ b/src/main/java/com/zy/ints/controller/WaitMatoutController.java
@@ -9,16 +9,16 @@
 import com.core.common.Cools;
 import com.core.common.DateUtils;
 import com.core.common.R;
+import com.core.exception.CoolException;
 import com.zy.common.web.BaseController;
+import com.zy.ints.entity.WaitMatin;
 import com.zy.ints.entity.WaitMatout;
 import com.zy.ints.service.WaitMatoutService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @RestController
 public class WaitMatoutController extends BaseController {
@@ -30,6 +30,24 @@
     @ManagerAuth
     public R get(@PathVariable("id") String id) {
         return R.ok(waitMatoutService.selectById(String.valueOf(id)));
+    }
+
+
+    @RequestMapping(value = "/waitMatout/head/page/auth")
+    @ManagerAuth
+    public R headPage(@RequestParam(defaultValue = "1")Integer curr,
+                      @RequestParam(defaultValue = "10")Integer limit,
+                      @RequestParam Map<String, Object> param){
+        if (!Cools.isEmpty(param.get("appe_time"))){
+            String val = String.valueOf(param.get("appe_time"));
+            if (val.contains(RANGE_TIME_LINK)) {
+                String[] dates = val.split(RANGE_TIME_LINK);
+                param.put("startTime", DateUtils.convert(dates[0]));
+                param.put("endTime", DateUtils.convert(dates[1]));
+                param.remove("appe_time");
+            }
+        }
+        return R.ok(waitMatoutService.getHeadPage(toPage(curr, limit, param, WaitMatout.class)));
     }
 
     @RequestMapping(value = "/waitMatout/list/auth")
@@ -44,6 +62,20 @@
         excludeTrash(param);
         convert(param, wrapper);
         allLike(WaitMatout.class, param.keySet(), wrapper, condition);
+        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
+        return R.ok(waitMatoutService.selectPage(new Page<>(curr, limit), wrapper));
+    }
+
+    @RequestMapping(value = "/waitMatout/list/auth2")
+    @ManagerAuth
+    public R list(@RequestParam(defaultValue = "1")Integer curr,
+                  @RequestParam(defaultValue = "10")Integer limit,
+                  @RequestParam(required = false)String orderByField,
+                  @RequestParam(required = false)String orderByType,
+                  @RequestParam(required = false)String condition,
+                  @RequestParam(name = "billNo") String bill_no){
+        EntityWrapper<WaitMatout> wrapper = new EntityWrapper<>();
+        wrapper.eq("bill_no", bill_no);
         if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
         return R.ok(waitMatoutService.selectPage(new Page<>(curr, limit), wrapper));
     }
@@ -63,28 +95,81 @@
 
     @RequestMapping(value = "/waitMatout/add/auth")
     @ManagerAuth
-    public R add(WaitMatout waitMatout) {
-        waitMatoutService.insert(waitMatout);
-        return R.ok();
+    @Transactional
+    public R add(@RequestBody List<WaitMatout> waitMatouts) {
+        if (Cools.isEmpty(waitMatouts)) {
+            return R.parse(BaseRes.PARAM);
+        }
+        if (waitMatoutService.selectCount(new EntityWrapper<WaitMatout>().eq("bill_no", waitMatouts.get(0).getBillNo())) > 0) {
+            return R.error("鍗曟嵁缂栧彿宸插瓨鍦�");
+        }
+        int i = 1;
+        Date now = new Date();
+        for (WaitMatout waitMatout : waitMatouts) {
+            waitMatout.setSeqNo(i);
+            waitMatout.setAppeTime(now);
+            waitMatout.setAppeUser(getUserId());
+            waitMatout.setModiTime(now);
+            waitMatout.setModiUser(getUserId());
+            if (!waitMatoutService.insert(waitMatout)) {
+                throw new CoolException("娣诲姞鍗曟嵁鏄庣粏澶辫触");
+            }
+            i++;
+        }
+        return R.ok("娣诲姞鎴愬姛");
     }
 
-	@RequestMapping(value = "/waitMatout/update/auth")
-	@ManagerAuth
-    public R update(WaitMatout waitMatout){
-        if (Cools.isEmpty(waitMatout) || null==waitMatout.getSeqNo()){
+    @RequestMapping(value = "/waitMatout/modify/auth")
+    @ManagerAuth
+    @Transactional
+    public R update(@RequestBody List<WaitMatout> waitMatouts){
+        if (Cools.isEmpty(waitMatouts)) {
+            return R.parse(BaseRes.PARAM);
+        }
+        Date now = new Date();
+        List<WaitMatout> oldWaitMatouts = waitMatoutService.selectList(new EntityWrapper<WaitMatout>().eq("bill_no", waitMatouts.get(0).getBillNo()));
+        Date appeTime = oldWaitMatouts!=null?oldWaitMatouts.get(0).getAppeTime():now;
+        Long appeUser = oldWaitMatouts!=null?oldWaitMatouts.get(0).getAppeUser():getUserId();
+        if (!waitMatoutService.delete(new EntityWrapper<WaitMatout>().eq("bill_no", waitMatouts.get(0).getBillNo()))) {
             return R.error();
         }
-        waitMatoutService.updateById(waitMatout);
-        return R.ok();
+        int i = 1;
+        for (WaitMatout waitMatout : waitMatouts) {
+            waitMatout.setSeqNo(i);
+            waitMatout.setAppeTime(appeTime);
+            waitMatout.setAppeUser(appeUser);
+            waitMatout.setModiTime(now);
+            waitMatout.setModiUser(getUserId());
+            if (!waitMatoutService.insert(waitMatout)) {
+                throw new CoolException("淇敼鍗曟嵁鏄庣粏澶辫触");
+            }
+            i++;
+        }
+        return R.ok("淇敼鎴愬姛");
     }
+
+    @RequestMapping(value = "/waitMatout/detl/list/auth")
+    @ManagerAuth
+    public R detlPage(@RequestParam String billNo){
+        if (Cools.isEmpty(billNo)){
+            return R.parse(BaseRes.PARAM);
+        }
+        List<WaitMatout> waitMatins = waitMatoutService.selectList(new EntityWrapper<WaitMatout>().eq("bill_no", billNo));
+        if (Cools.isEmpty(waitMatins)) {
+            return R.parse(BaseRes.EMPTY);
+        }
+        return R.ok().add(waitMatins);
+    }
+
+
 
     @RequestMapping(value = "/waitMatout/delete/auth")
     @ManagerAuth
-    public R delete(@RequestParam(value="ids[]") Long[] ids){
-         for (Long id : ids){
-            waitMatoutService.deleteById(id);
+    public R delete(@RequestParam String billNo){
+        if (!waitMatoutService.delete(new EntityWrapper<WaitMatout>().eq("bill_no", billNo))) {
+            throw new CoolException("鍒犻櫎鍗曟嵁鏄庣粏澶辫触");
         }
-        return R.ok();
+        return R.ok("鍒犻櫎鎴愬姛");
     }
 
     @RequestMapping(value = "/waitMatout/export/auth")
diff --git a/src/main/java/com/zy/ints/controller/WaitMatoutLogController.java b/src/main/java/com/zy/ints/controller/WaitMatoutLogController.java
index 7817a6e..68189a7 100644
--- a/src/main/java/com/zy/ints/controller/WaitMatoutLogController.java
+++ b/src/main/java/com/zy/ints/controller/WaitMatoutLogController.java
@@ -5,19 +5,21 @@
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.baomidou.mybatisplus.plugins.Page;
-import com.core.common.DateUtils;
-import com.zy.common.web.BaseController;
-import com.zy.ints.entity.WaitMatoutLog;
-import com.zy.ints.service.WaitMatoutLogService;
 import com.core.annotations.ManagerAuth;
 import com.core.common.BaseRes;
 import com.core.common.Cools;
+import com.core.common.DateUtils;
 import com.core.common.R;
-import com.core.controller.AbstractBaseController;
+import com.zy.common.web.BaseController;
+import com.zy.ints.entity.WaitMatoutLog;
+import com.zy.ints.service.WaitMatoutLogService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @RestController
 public class WaitMatoutLogController extends BaseController {
@@ -37,10 +39,12 @@
                   @RequestParam(defaultValue = "10")Integer limit,
                   @RequestParam(required = false)String orderByField,
                   @RequestParam(required = false)String orderByType,
+                  @RequestParam(required = false)String condition,
                   @RequestParam Map<String, Object> param){
         EntityWrapper<WaitMatoutLog> wrapper = new EntityWrapper<>();
         excludeTrash(param);
         convert(param, wrapper);
+        allLike(WaitMatoutLog.class, param.keySet(), wrapper, condition);
         if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
         return R.ok(waitMatoutLogService.selectPage(new Page<>(curr, limit), wrapper));
     }
diff --git a/src/main/java/com/zy/ints/entity/StockSync.java b/src/main/java/com/zy/ints/entity/StockSync.java
new file mode 100644
index 0000000..b66c4f5
--- /dev/null
+++ b/src/main/java/com/zy/ints/entity/StockSync.java
@@ -0,0 +1,233 @@
+package com.zy.ints.entity;
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.enums.IdType;
+import com.core.common.Cools;
+import com.core.common.SpringUtils;
+import com.zy.system.entity.User;
+import com.zy.system.service.UserService;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+@TableName("ints_stock_sync")
+public class StockSync implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 鐗╂枡缂栫爜
+     */
+    @ApiModelProperty(value= "鐗╂枡缂栫爜")
+    @TableId(value = "mat_no", type = IdType.INPUT)
+    @TableField("mat_no")
+    private String matNo;
+
+    /**
+     * 鐗╂枡鍚嶇О
+     */
+    @ApiModelProperty(value= "鐗╂枡鍚嶇О")
+    @TableField("mat_name")
+    private String matName;
+
+    /**
+     * 鏁伴噺
+     */
+    @ApiModelProperty(value= "鏁伴噺")
+    private Double qty;
+
+    /**
+     * 瀹屾垚鐘舵�� 0: 寰呭鐞�  1: 涓婃姤鎴愬姛  2: 涓婃姤澶辫触  
+     */
+    @ApiModelProperty(value= "瀹屾垚鐘舵�� 0: 寰呭鐞�  1: 涓婃姤鎴愬姛  2: 涓婃姤澶辫触  ")
+    @TableField("upd_status")
+    private Integer updStatus;
+
+    /**
+     * 寮傚父淇℃伅
+     */
+    @ApiModelProperty(value= "寮傚父淇℃伅")
+    @TableField("error_memo")
+    private String errorMemo;
+
+    /**
+     * 淇敼浜哄憳
+     */
+    @ApiModelProperty(value= "淇敼浜哄憳")
+    @TableField("modi_user")
+    private Long modiUser;
+
+    /**
+     * 淇敼鏃堕棿
+     */
+    @ApiModelProperty(value= "淇敼鏃堕棿")
+    @TableField("modi_time")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private Date modiTime;
+
+    /**
+     * 寤烘。浜哄憳
+     */
+    @ApiModelProperty(value= "寤烘。浜哄憳")
+    @TableField("appe_user")
+    private Long appeUser;
+
+    /**
+     * 寤烘。鏃堕棿
+     */
+    @ApiModelProperty(value= "寤烘。鏃堕棿")
+    @TableField("appe_time")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private Date appeTime;
+
+    public StockSync() {}
+
+    public StockSync(String matNo,String matName,Double qty,Integer updStatus,String errorMemo,Long modiUser,Date modiTime,Long appeUser,Date appeTime) {
+        this.matNo = matNo;
+        this.matName = matName;
+        this.qty = qty;
+        this.updStatus = updStatus;
+        this.errorMemo = errorMemo;
+        this.modiUser = modiUser;
+        this.modiTime = modiTime;
+        this.appeUser = appeUser;
+        this.appeTime = appeTime;
+    }
+
+//    StockSync stockSync = new StockSync(
+//            null,    // 鐗╂枡缂栫爜[闈炵┖]
+//            null,    // 鐗╂枡鍚嶇О[闈炵┖]
+//            null,    // 鏁伴噺
+//            null,    // 瀹屾垚鐘舵��
+//            null,    // 寮傚父淇℃伅
+//            null,    // 淇敼浜哄憳
+//            null,    // 淇敼鏃堕棿
+//            null,    // 寤烘。浜哄憳
+//            null    // 寤烘。鏃堕棿
+//    );
+
+    public String getMatNo() {
+        return matNo;
+    }
+
+    public void setMatNo(String matNo) {
+        this.matNo = matNo;
+    }
+
+    public String getMatName() {
+        return matName;
+    }
+
+    public void setMatName(String matName) {
+        this.matName = matName;
+    }
+
+    public Double getQty() {
+        return qty;
+    }
+
+    public void setQty(Double qty) {
+        this.qty = qty;
+    }
+
+    public Integer getUpdStatus() {
+        return updStatus;
+    }
+
+    public String getUpdStatus$(){
+        if (null == this.updStatus){ return null; }
+        switch (this.updStatus){
+            case 0:
+                return "寰呭鐞�";
+            case 1:
+                return "涓婃姤鎴愬姛";
+            case 2:
+                return "涓婃姤澶辫触";
+            default:
+                return String.valueOf(this.updStatus);
+        }
+    }
+
+    public void setUpdStatus(Integer updStatus) {
+        this.updStatus = updStatus;
+    }
+
+    public String getErrorMemo() {
+        return errorMemo;
+    }
+
+    public void setErrorMemo(String errorMemo) {
+        this.errorMemo = errorMemo;
+    }
+
+    public Long getModiUser() {
+        return modiUser;
+    }
+
+    public String getModiUser$(){
+        UserService service = SpringUtils.getBean(UserService.class);
+        User user = service.selectById(this.modiUser);
+        if (!Cools.isEmpty(user)){
+            return String.valueOf(user.getUsername());
+        }
+        return null;
+    }
+
+    public void setModiUser(Long modiUser) {
+        this.modiUser = modiUser;
+    }
+
+    public Date getModiTime() {
+        return modiTime;
+    }
+
+    public String getModiTime$(){
+        if (Cools.isEmpty(this.modiTime)){
+            return "";
+        }
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime);
+    }
+
+    public void setModiTime(Date modiTime) {
+        this.modiTime = modiTime;
+    }
+
+    public Long getAppeUser() {
+        return appeUser;
+    }
+
+    public String getAppeUser$(){
+        UserService service = SpringUtils.getBean(UserService.class);
+        User user = service.selectById(this.appeUser);
+        if (!Cools.isEmpty(user)){
+            return String.valueOf(user.getUsername());
+        }
+        return null;
+    }
+
+    public void setAppeUser(Long appeUser) {
+        this.appeUser = appeUser;
+    }
+
+    public Date getAppeTime() {
+        return appeTime;
+    }
+
+    public String getAppeTime$(){
+        if (Cools.isEmpty(this.appeTime)){
+            return "";
+        }
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime);
+    }
+
+    public void setAppeTime(Date appeTime) {
+        this.appeTime = appeTime;
+    }
+
+
+}
diff --git a/src/main/java/com/zy/ints/entity/WaitMatchk.java b/src/main/java/com/zy/ints/entity/WaitMatchk.java
index 6322468..01686ad 100644
--- a/src/main/java/com/zy/ints/entity/WaitMatchk.java
+++ b/src/main/java/com/zy/ints/entity/WaitMatchk.java
@@ -1,44 +1,20 @@
 package com.zy.ints.entity;
 
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.enums.IdType;
 import com.core.common.Cools;
+import com.core.common.SpringUtils;
 import com.zy.asrs.entity.LocMast;
 import com.zy.asrs.service.LocMastService;
 import com.zy.system.entity.User;
 import com.zy.system.service.UserService;
 import io.swagger.annotations.ApiModelProperty;
-import com.baomidou.mybatisplus.annotations.TableId;
-import com.baomidou.mybatisplus.enums.IdType;
-import com.baomidou.mybatisplus.annotations.TableField;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiModelProperty;
-import com.core.common.SpringUtils;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiModelProperty;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiModelProperty;
-import com.core.common.SpringUtils;
-import io.swagger.annotations.ApiModelProperty;
-import com.core.common.SpringUtils;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiModelProperty;
-import com.core.common.SpringUtils;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import io.swagger.annotations.ApiModelProperty;
 
-import com.baomidou.mybatisplus.annotations.TableName;
 import java.io.Serializable;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 
 @TableName("ints_wait_matchk")
 public class WaitMatchk implements Serializable {
diff --git a/src/main/java/com/zy/ints/mapper/IoCompleteLogMapper.java b/src/main/java/com/zy/ints/mapper/IoCompleteLogMapper.java
index 1a4e9ab..bfe8128 100644
--- a/src/main/java/com/zy/ints/mapper/IoCompleteLogMapper.java
+++ b/src/main/java/com/zy/ints/mapper/IoCompleteLogMapper.java
@@ -1,12 +1,20 @@
 package com.zy.ints.mapper;
 
-import com.zy.ints.entity.IoCompleteLog;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.zy.ints.entity.IoCompleteLog;
+import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 @Mapper
 @Repository
 public interface IoCompleteLogMapper extends BaseMapper<IoCompleteLog> {
 
+//    @Insert("insert into ints_io_complete_log select * from ints_io_complete where bill_no=#{billNo} and seq_no=#{seqNo}")
+//    int save(@Param("billNo") String billNo,@Param("seqNo") Integer seqNo);
+
+    @Insert("insert into ints_io_complete_log select * from ints_io_complete where id=#{id}")
+    int save(@Param("id") Long id);
+
 }
diff --git a/src/main/java/com/zy/ints/mapper/IoCompleteMapper.java b/src/main/java/com/zy/ints/mapper/IoCompleteMapper.java
index 64fb031..19f2998 100644
--- a/src/main/java/com/zy/ints/mapper/IoCompleteMapper.java
+++ b/src/main/java/com/zy/ints/mapper/IoCompleteMapper.java
@@ -5,8 +5,11 @@
 import org.apache.ibatis.annotations.Mapper;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 @Mapper
 @Repository
 public interface IoCompleteMapper extends BaseMapper<IoComplete> {
 
+    List<IoComplete> selectIoCompleteBySts();
 }
diff --git a/src/main/java/com/zy/ints/mapper/StockSyncMapper.java b/src/main/java/com/zy/ints/mapper/StockSyncMapper.java
new file mode 100644
index 0000000..76ffa49
--- /dev/null
+++ b/src/main/java/com/zy/ints/mapper/StockSyncMapper.java
@@ -0,0 +1,18 @@
+package com.zy.ints.mapper;
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.zy.ints.entity.StockSync;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface StockSyncMapper extends BaseMapper<StockSync> {
+
+    Integer getStockSyncCount();
+
+//    Integer insertStockSync(List<StockSync> list);
+
+    Boolean clearStockSync();
+
+}
diff --git a/src/main/java/com/zy/ints/mapper/WaitMatchkLogMapper.java b/src/main/java/com/zy/ints/mapper/WaitMatchkLogMapper.java
index ef13ba3..36d49dc 100644
--- a/src/main/java/com/zy/ints/mapper/WaitMatchkLogMapper.java
+++ b/src/main/java/com/zy/ints/mapper/WaitMatchkLogMapper.java
@@ -2,11 +2,14 @@
 
 import com.zy.ints.entity.WaitMatchkLog;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 @Mapper
 @Repository
 public interface WaitMatchkLogMapper extends BaseMapper<WaitMatchkLog> {
-
+    @Insert("insert into ints_wait_matchk_log select * from ints_wait_matchk where bill_no=#{billNo} and loc_no=#{locNo} and mat_no=#{matNo}")
+    int save(@Param("billNo") String billNo, @Param("locNo") String locNo, @Param("matNo") String matNo);
 }
diff --git a/src/main/java/com/zy/ints/mapper/WaitMatchkMapper.java b/src/main/java/com/zy/ints/mapper/WaitMatchkMapper.java
index 61ef707..552b0ff 100644
--- a/src/main/java/com/zy/ints/mapper/WaitMatchkMapper.java
+++ b/src/main/java/com/zy/ints/mapper/WaitMatchkMapper.java
@@ -1,12 +1,14 @@
 package com.zy.ints.mapper;
 
-import com.zy.ints.entity.WaitMatchk;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.zy.ints.entity.WaitMatchk;
 import org.apache.ibatis.annotations.Mapper;
 import org.springframework.stereotype.Repository;
+
+import java.util.List;
 
 @Mapper
 @Repository
 public interface WaitMatchkMapper extends BaseMapper<WaitMatchk> {
-
+    List<WaitMatchk> selectWaitMatchkBySts();
 }
diff --git a/src/main/java/com/zy/ints/mapper/WaitMatinLogMapper.java b/src/main/java/com/zy/ints/mapper/WaitMatinLogMapper.java
index 9cad26e..8380270 100644
--- a/src/main/java/com/zy/ints/mapper/WaitMatinLogMapper.java
+++ b/src/main/java/com/zy/ints/mapper/WaitMatinLogMapper.java
@@ -2,11 +2,15 @@
 
 import com.zy.ints.entity.WaitMatinLog;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 @Mapper
 @Repository
 public interface WaitMatinLogMapper extends BaseMapper<WaitMatinLog> {
 
+    @Insert("insert into ints_wait_matin_log select * from ints_wait_matin where bill_no=#{billNo} and seq_no=#{seqNo}")
+    int save(@Param("billNo") String billNo,@Param("seqNo") Integer seqNo);
 }
diff --git a/src/main/java/com/zy/ints/mapper/WaitMatinMapper.java b/src/main/java/com/zy/ints/mapper/WaitMatinMapper.java
index 9343063..16b9dae 100644
--- a/src/main/java/com/zy/ints/mapper/WaitMatinMapper.java
+++ b/src/main/java/com/zy/ints/mapper/WaitMatinMapper.java
@@ -17,4 +17,5 @@
 
     Integer getHeadPageCount(Map<String, Object> map);
 
+    List<WaitMatin> selectWaitMatinBySts();
 }
diff --git a/src/main/java/com/zy/ints/mapper/WaitMatoutLogMapper.java b/src/main/java/com/zy/ints/mapper/WaitMatoutLogMapper.java
index 20d5f68..714734b 100644
--- a/src/main/java/com/zy/ints/mapper/WaitMatoutLogMapper.java
+++ b/src/main/java/com/zy/ints/mapper/WaitMatoutLogMapper.java
@@ -2,6 +2,7 @@
 
 import com.zy.ints.entity.WaitMatoutLog;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Mapper;
 import org.springframework.stereotype.Repository;
 
@@ -9,4 +10,6 @@
 @Repository
 public interface WaitMatoutLogMapper extends BaseMapper<WaitMatoutLog> {
 
+    @Insert("insert into ints_wait_matout_log select * from ints_wait_matout where bill_no=#{billNo} and seq_no=#{seqNo}")
+    int save(String billNo, Integer seqNo);
 }
diff --git a/src/main/java/com/zy/ints/mapper/WaitMatoutMapper.java b/src/main/java/com/zy/ints/mapper/WaitMatoutMapper.java
index b29b64a..ca07b7e 100644
--- a/src/main/java/com/zy/ints/mapper/WaitMatoutMapper.java
+++ b/src/main/java/com/zy/ints/mapper/WaitMatoutMapper.java
@@ -1,12 +1,21 @@
 package com.zy.ints.mapper;
 
+import com.zy.ints.entity.WaitMatin;
 import com.zy.ints.entity.WaitMatout;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+import java.util.Map;
+
 @Mapper
 @Repository
 public interface WaitMatoutMapper extends BaseMapper<WaitMatout> {
 
+    List<WaitMatout> getHeadPage(Map<String, Object> condition);
+
+    Integer getHeadPageCount(Map<String, Object> condition);
+
+    List<WaitMatout> selectWaitMatOutBySts();
 }
diff --git a/src/main/java/com/zy/ints/service/IoCompleteLogService.java b/src/main/java/com/zy/ints/service/IoCompleteLogService.java
index b2365d4..8b8126b 100644
--- a/src/main/java/com/zy/ints/service/IoCompleteLogService.java
+++ b/src/main/java/com/zy/ints/service/IoCompleteLogService.java
@@ -5,4 +5,5 @@
 
 public interface IoCompleteLogService extends IService<IoCompleteLog> {
 
+    Boolean save(Long id);
 }
diff --git a/src/main/java/com/zy/ints/service/IoCompleteService.java b/src/main/java/com/zy/ints/service/IoCompleteService.java
index 0088e43..be13341 100644
--- a/src/main/java/com/zy/ints/service/IoCompleteService.java
+++ b/src/main/java/com/zy/ints/service/IoCompleteService.java
@@ -3,6 +3,9 @@
 import com.zy.ints.entity.IoComplete;
 import com.baomidou.mybatisplus.service.IService;
 
+import java.util.List;
+
 public interface IoCompleteService extends IService<IoComplete> {
 
+    List<IoComplete> selectIoCompleteBySts();
 }
diff --git a/src/main/java/com/zy/ints/service/StockSyncService.java b/src/main/java/com/zy/ints/service/StockSyncService.java
new file mode 100644
index 0000000..affdda6
--- /dev/null
+++ b/src/main/java/com/zy/ints/service/StockSyncService.java
@@ -0,0 +1,14 @@
+package com.zy.ints.service;
+
+import com.baomidou.mybatisplus.service.IService;
+import com.zy.ints.entity.StockSync;
+
+public interface StockSyncService extends IService<StockSync> {
+
+    Integer getStockSyncCount();
+
+//    Integer insertStockSync(List<StockSync> list);
+
+    Boolean clearStockSync();
+
+}
diff --git a/src/main/java/com/zy/ints/service/WaitMatchkLogService.java b/src/main/java/com/zy/ints/service/WaitMatchkLogService.java
index 9fb3c1f..9e91eba 100644
--- a/src/main/java/com/zy/ints/service/WaitMatchkLogService.java
+++ b/src/main/java/com/zy/ints/service/WaitMatchkLogService.java
@@ -4,5 +4,5 @@
 import com.baomidou.mybatisplus.service.IService;
 
 public interface WaitMatchkLogService extends IService<WaitMatchkLog> {
-
+    boolean save(String billNo, String locNo, String matNo);
 }
diff --git a/src/main/java/com/zy/ints/service/WaitMatchkService.java b/src/main/java/com/zy/ints/service/WaitMatchkService.java
index 96fa040..0f247e8 100644
--- a/src/main/java/com/zy/ints/service/WaitMatchkService.java
+++ b/src/main/java/com/zy/ints/service/WaitMatchkService.java
@@ -1,8 +1,12 @@
 package com.zy.ints.service;
 
-import com.zy.ints.entity.WaitMatchk;
 import com.baomidou.mybatisplus.service.IService;
+import com.zy.ints.entity.WaitMatchk;
+
+import java.util.List;
 
 public interface WaitMatchkService extends IService<WaitMatchk> {
 
+    List<WaitMatchk> selectWaitMatchkBySts();
+
 }
diff --git a/src/main/java/com/zy/ints/service/WaitMatinLogService.java b/src/main/java/com/zy/ints/service/WaitMatinLogService.java
index c9468fd..2dbfe2e 100644
--- a/src/main/java/com/zy/ints/service/WaitMatinLogService.java
+++ b/src/main/java/com/zy/ints/service/WaitMatinLogService.java
@@ -5,4 +5,6 @@
 
 public interface WaitMatinLogService extends IService<WaitMatinLog> {
 
+
+    boolean save(String billNo, Integer seqNo);
 }
diff --git a/src/main/java/com/zy/ints/service/WaitMatinService.java b/src/main/java/com/zy/ints/service/WaitMatinService.java
index f414a97..79adc48 100644
--- a/src/main/java/com/zy/ints/service/WaitMatinService.java
+++ b/src/main/java/com/zy/ints/service/WaitMatinService.java
@@ -5,8 +5,15 @@
 import com.zy.ints.entity.WaitMatin;
 import com.baomidou.mybatisplus.service.IService;
 
+import java.util.List;
+
 public interface WaitMatinService extends IService<WaitMatin> {
 
     Page<WaitMatin> getHeadPage(Page<WaitMatin> page);
 
+    /**
+     * 鏌ヨ宸插畬鎴愬叆搴撶殑鍏ュ簱閫氱煡妗�
+     * @return
+     */
+    List<WaitMatin> selectWaitMatinBySts();
 }
diff --git a/src/main/java/com/zy/ints/service/WaitMatoutLogService.java b/src/main/java/com/zy/ints/service/WaitMatoutLogService.java
index 49d891d..386e079 100644
--- a/src/main/java/com/zy/ints/service/WaitMatoutLogService.java
+++ b/src/main/java/com/zy/ints/service/WaitMatoutLogService.java
@@ -5,4 +5,5 @@
 
 public interface WaitMatoutLogService extends IService<WaitMatoutLog> {
 
+    Boolean save(String billNo, Integer seqNo);
 }
diff --git a/src/main/java/com/zy/ints/service/WaitMatoutService.java b/src/main/java/com/zy/ints/service/WaitMatoutService.java
index be40265..6339231 100644
--- a/src/main/java/com/zy/ints/service/WaitMatoutService.java
+++ b/src/main/java/com/zy/ints/service/WaitMatoutService.java
@@ -1,8 +1,19 @@
 package com.zy.ints.service;
 
+import com.baomidou.mybatisplus.plugins.Page;
+import com.zy.ints.entity.WaitMatin;
 import com.zy.ints.entity.WaitMatout;
 import com.baomidou.mybatisplus.service.IService;
 
+import java.util.List;
+
 public interface WaitMatoutService extends IService<WaitMatout> {
 
+    Page<WaitMatout> getHeadPage(Page<WaitMatout> toPage);
+
+    /**
+     * 鏌ヨ鐘舵�佷负鍑哄簱瀹屾垚鐨勬墍鏈夊嚭搴撻�氱煡妗�
+     * @return
+     */
+    List<WaitMatout> selectWaitMatOutBySts();
 }
diff --git a/src/main/java/com/zy/ints/service/impl/IoCompleteLogServiceImpl.java b/src/main/java/com/zy/ints/service/impl/IoCompleteLogServiceImpl.java
index 7841c8e..5d7dd77 100644
--- a/src/main/java/com/zy/ints/service/impl/IoCompleteLogServiceImpl.java
+++ b/src/main/java/com/zy/ints/service/impl/IoCompleteLogServiceImpl.java
@@ -9,4 +9,9 @@
 @Service("ioCompleteLogService")
 public class IoCompleteLogServiceImpl extends ServiceImpl<IoCompleteLogMapper, IoCompleteLog> implements IoCompleteLogService {
 
+    @Override
+    public Boolean save(Long id) {
+
+        return this.baseMapper.save(id)>0;
+    }
 }
diff --git a/src/main/java/com/zy/ints/service/impl/IoCompleteServiceImpl.java b/src/main/java/com/zy/ints/service/impl/IoCompleteServiceImpl.java
index 920335b..f20b993 100644
--- a/src/main/java/com/zy/ints/service/impl/IoCompleteServiceImpl.java
+++ b/src/main/java/com/zy/ints/service/impl/IoCompleteServiceImpl.java
@@ -6,7 +6,14 @@
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service("ioCompleteService")
 public class IoCompleteServiceImpl extends ServiceImpl<IoCompleteMapper, IoComplete> implements IoCompleteService {
 
+    @Override
+    public List<IoComplete> selectIoCompleteBySts() {
+
+        return baseMapper.selectIoCompleteBySts();
+    }
 }
diff --git a/src/main/java/com/zy/ints/service/impl/StockSyncServiceImpl.java b/src/main/java/com/zy/ints/service/impl/StockSyncServiceImpl.java
new file mode 100644
index 0000000..827ce50
--- /dev/null
+++ b/src/main/java/com/zy/ints/service/impl/StockSyncServiceImpl.java
@@ -0,0 +1,27 @@
+package com.zy.ints.service.impl;
+
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.zy.ints.entity.StockSync;
+import com.zy.ints.mapper.StockSyncMapper;
+import com.zy.ints.service.StockSyncService;
+import org.springframework.stereotype.Service;
+
+@Service("stockSyncService")
+public class StockSyncServiceImpl extends ServiceImpl<StockSyncMapper, StockSync> implements StockSyncService {
+
+    @Override
+    public Integer getStockSyncCount() {
+        return this.baseMapper.getStockSyncCount();
+    }
+
+//    @Override
+//    public Integer insertStockSync(List<StockSync> list) {
+//        return this.baseMapper.insertStockSync(list);
+//    }
+
+    @Override
+    public Boolean clearStockSync() {
+        return this.baseMapper.clearStockSync();
+    }
+
+}
diff --git a/src/main/java/com/zy/ints/service/impl/WaitMatchkLogServiceImpl.java b/src/main/java/com/zy/ints/service/impl/WaitMatchkLogServiceImpl.java
index 2606719..005b198 100644
--- a/src/main/java/com/zy/ints/service/impl/WaitMatchkLogServiceImpl.java
+++ b/src/main/java/com/zy/ints/service/impl/WaitMatchkLogServiceImpl.java
@@ -9,4 +9,9 @@
 @Service("waitMatchkLogService")
 public class WaitMatchkLogServiceImpl extends ServiceImpl<WaitMatchkLogMapper, WaitMatchkLog> implements WaitMatchkLogService {
 
+    @Override
+    public boolean save(String billNo, String locNo, String matNo) {
+
+        return this.baseMapper.save(billNo,locNo,matNo)>0;
+    }
 }
diff --git a/src/main/java/com/zy/ints/service/impl/WaitMatchkServiceImpl.java b/src/main/java/com/zy/ints/service/impl/WaitMatchkServiceImpl.java
index d34c3d2..014f46e 100644
--- a/src/main/java/com/zy/ints/service/impl/WaitMatchkServiceImpl.java
+++ b/src/main/java/com/zy/ints/service/impl/WaitMatchkServiceImpl.java
@@ -6,7 +6,14 @@
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service("waitMatchkService")
 public class WaitMatchkServiceImpl extends ServiceImpl<WaitMatchkMapper, WaitMatchk> implements WaitMatchkService {
 
+    @Override
+    public List<WaitMatchk> selectWaitMatchkBySts() {
+        return baseMapper.selectWaitMatchkBySts();
+    }
+
 }
diff --git a/src/main/java/com/zy/ints/service/impl/WaitMatinLogServiceImpl.java b/src/main/java/com/zy/ints/service/impl/WaitMatinLogServiceImpl.java
index 92b7976..31260be 100644
--- a/src/main/java/com/zy/ints/service/impl/WaitMatinLogServiceImpl.java
+++ b/src/main/java/com/zy/ints/service/impl/WaitMatinLogServiceImpl.java
@@ -1,12 +1,20 @@
 package com.zy.ints.service.impl;
 
+import com.zy.ints.mapper.WaitMatchkMapper;
 import com.zy.ints.mapper.WaitMatinLogMapper;
 import com.zy.ints.entity.WaitMatinLog;
 import com.zy.ints.service.WaitMatinLogService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 @Service("waitMatinLogService")
 public class WaitMatinLogServiceImpl extends ServiceImpl<WaitMatinLogMapper, WaitMatinLog> implements WaitMatinLogService {
 
+
+    @Override
+    public boolean save(String billNo, Integer seqNo) {
+
+        return this.baseMapper.save(billNo,seqNo)>0;
+    }
 }
diff --git a/src/main/java/com/zy/ints/service/impl/WaitMatinServiceImpl.java b/src/main/java/com/zy/ints/service/impl/WaitMatinServiceImpl.java
index d6d9a41..0358b41 100644
--- a/src/main/java/com/zy/ints/service/impl/WaitMatinServiceImpl.java
+++ b/src/main/java/com/zy/ints/service/impl/WaitMatinServiceImpl.java
@@ -7,6 +7,8 @@
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service("waitMatinService")
 public class WaitMatinServiceImpl extends ServiceImpl<WaitMatinMapper, WaitMatin> implements WaitMatinService {
 
@@ -17,4 +19,9 @@
         return page;
     }
 
+    @Override
+    public List<WaitMatin> selectWaitMatinBySts() {
+        return baseMapper.selectWaitMatinBySts();
+    }
+
 }
diff --git a/src/main/java/com/zy/ints/service/impl/WaitMatoutLogServiceImpl.java b/src/main/java/com/zy/ints/service/impl/WaitMatoutLogServiceImpl.java
index da79cdb..b56a09d 100644
--- a/src/main/java/com/zy/ints/service/impl/WaitMatoutLogServiceImpl.java
+++ b/src/main/java/com/zy/ints/service/impl/WaitMatoutLogServiceImpl.java
@@ -9,4 +9,9 @@
 @Service("waitMatoutLogService")
 public class WaitMatoutLogServiceImpl extends ServiceImpl<WaitMatoutLogMapper, WaitMatoutLog> implements WaitMatoutLogService {
 
+    @Override
+    public Boolean save(String billNo, Integer seqNo) {
+
+        return this.baseMapper.save(billNo,seqNo)>0;
+    }
 }
diff --git a/src/main/java/com/zy/ints/service/impl/WaitMatoutServiceImpl.java b/src/main/java/com/zy/ints/service/impl/WaitMatoutServiceImpl.java
index 31dac72..68c1029 100644
--- a/src/main/java/com/zy/ints/service/impl/WaitMatoutServiceImpl.java
+++ b/src/main/java/com/zy/ints/service/impl/WaitMatoutServiceImpl.java
@@ -1,12 +1,28 @@
 package com.zy.ints.service.impl;
 
+import com.baomidou.mybatisplus.plugins.Page;
+import com.zy.ints.entity.WaitMatin;
 import com.zy.ints.mapper.WaitMatoutMapper;
 import com.zy.ints.entity.WaitMatout;
 import com.zy.ints.service.WaitMatoutService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service("waitMatoutService")
 public class WaitMatoutServiceImpl extends ServiceImpl<WaitMatoutMapper, WaitMatout> implements WaitMatoutService {
 
+    @Override
+    public Page<WaitMatout> getHeadPage(Page<WaitMatout> page) {
+
+        page.setRecords(baseMapper.getHeadPage(page.getCondition()));
+        page.setTotal(baseMapper.getHeadPageCount(page.getCondition()));
+        return page;
+    }
+
+    @Override
+    public List<WaitMatout> selectWaitMatOutBySts() {
+        return this.baseMapper.selectWaitMatOutBySts();
+    }
 }
diff --git a/src/main/java/com/zy/ints/task/IoCompleteLogScheduler.java b/src/main/java/com/zy/ints/task/IoCompleteLogScheduler.java
new file mode 100644
index 0000000..edfbbe8
--- /dev/null
+++ b/src/main/java/com/zy/ints/task/IoCompleteLogScheduler.java
@@ -0,0 +1,47 @@
+package com.zy.ints.task;
+
+import com.zy.asrs.task.core.ReturnT;
+import com.zy.ints.entity.IoComplete;
+import com.zy.ints.service.IoCompleteService;
+import com.zy.ints.task.handler.IoCompleteLogHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * 鍥炴姤妗h浆鍘嗗彶妗�
+ * Created by TQS on 2021/8/31
+ */
+@Component
+public class IoCompleteLogScheduler {
+
+    private static final Logger log = LoggerFactory.getLogger(IoCompleteLogScheduler.class);
+
+    @Autowired
+    private IoCompleteLogHandler ioCompleteLogHandler;
+    @Autowired
+    private IoCompleteService ioCompleteService;
+
+    /**
+     * ERP鎺ュ彛鏄惁鍚敤
+     */
+    @Value("${erp.enabled}")
+    private Boolean erpEnabled;
+
+    @Scheduled(cron = "0/10 * * * * ? ")
+    private void execute(){
+        if(!erpEnabled) return;
+        List<IoComplete> ioCompletes = ioCompleteService.selectIoCompleteBySts();
+        for (IoComplete ioComplete : ioCompletes) {
+            ReturnT<String> result = ioCompleteLogHandler.start(ioComplete);
+            if (!result.isSuccess()) {
+                log.error("鍥炴姤妗id={}]鍘嗗彶妗e鐞嗗け璐�", ioComplete.getId());
+            }
+        }
+    }
+}
diff --git a/src/main/java/com/zy/ints/task/WaitMatchkLogScheduler.java b/src/main/java/com/zy/ints/task/WaitMatchkLogScheduler.java
new file mode 100644
index 0000000..af36bb9
--- /dev/null
+++ b/src/main/java/com/zy/ints/task/WaitMatchkLogScheduler.java
@@ -0,0 +1,46 @@
+package com.zy.ints.task;
+
+import com.zy.asrs.task.core.ReturnT;
+import com.zy.ints.entity.WaitMatchk;
+import com.zy.ints.service.WaitMatchkService;
+import com.zy.ints.task.handler.WaitMatchkLogHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * 鐩樼偣閫氱煡妗h浆鍘嗗彶妗�
+ * Created by TQS on 2021/9/2
+ */
+@Component
+public class WaitMatchkLogScheduler {
+    private static final Logger log = LoggerFactory.getLogger(WaitMatchkLogScheduler.class);
+
+    @Autowired
+    private WaitMatchkLogHandler waitMatchkLogHandler;
+    @Autowired
+    private WaitMatchkService waitMatchkService;
+
+    /**
+     * ERP鎺ュ彛鏄惁鍚敤
+     */
+    @Value("${erp.enabled}")
+    private Boolean erpEnabled;
+
+    @Scheduled(cron = "0/5 * * * * ? ")
+    private void execute(){
+        if(!erpEnabled) return;
+        List<WaitMatchk> waitMatchks = waitMatchkService.selectWaitMatchkBySts();
+        for (WaitMatchk waitMatchk : waitMatchks) {
+            ReturnT<String> result = waitMatchkLogHandler.start(waitMatchk);
+            if (!result.isSuccess()) {
+                log.error("鐩樼偣閫氱煡妗billNo={},locNo={},matNo={}]鍘嗗彶妗e鐞嗗け璐�", waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo());
+            }
+        }
+    }
+}
diff --git a/src/main/java/com/zy/ints/task/WaitMatinLogScheduler.java b/src/main/java/com/zy/ints/task/WaitMatinLogScheduler.java
new file mode 100644
index 0000000..ff26406
--- /dev/null
+++ b/src/main/java/com/zy/ints/task/WaitMatinLogScheduler.java
@@ -0,0 +1,48 @@
+package com.zy.ints.task;
+
+import com.zy.asrs.task.core.ReturnT;
+import com.zy.ints.entity.WaitMatin;
+import com.zy.ints.service.WaitMatinService;
+import com.zy.ints.task.handler.WaitMatinLogHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * 鍏ュ簱閫氱煡妗h浆鍘嗗彶妗�
+ * Created by TQS on 2021/8/31
+ */
+@Component
+public class WaitMatinLogScheduler {
+
+    private static final Logger log = LoggerFactory.getLogger(WaitMatinLogScheduler.class);
+
+    @Autowired
+    private WaitMatinLogHandler waitMatinLogHandler;
+
+    @Autowired
+    private WaitMatinService waitMatinService;
+
+    /**
+     * ERP鎺ュ彛鏄惁鍚敤
+     */
+    @Value("${erp.enabled}")
+    private Boolean erpEnabled;
+
+    @Scheduled(cron = "0/4 * * * * ? ")
+    private void execute(){
+        if(!erpEnabled) return;
+        List<WaitMatin> WaitMatins = waitMatinService.selectWaitMatinBySts();
+        for (WaitMatin waitMatin : WaitMatins) {
+            ReturnT<String> result = waitMatinLogHandler.start(waitMatin);
+            if (!result.isSuccess()) {
+                log.error("鍏ュ簱閫氱煡妗billNo={}],[seqNo={}]鍘嗗彶妗e鐞嗗け璐�", waitMatin.getBillNo(),waitMatin.getSeqNo());
+            }
+        }
+    }
+}
diff --git a/src/main/java/com/zy/ints/task/WaitMatoutLogScheduler.java b/src/main/java/com/zy/ints/task/WaitMatoutLogScheduler.java
new file mode 100644
index 0000000..ff778c9
--- /dev/null
+++ b/src/main/java/com/zy/ints/task/WaitMatoutLogScheduler.java
@@ -0,0 +1,47 @@
+package com.zy.ints.task;
+
+import com.zy.asrs.task.core.ReturnT;
+import com.zy.ints.entity.WaitMatout;
+import com.zy.ints.service.WaitMatoutService;
+import com.zy.ints.task.handler.WaitMatoutLogHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * 鍑哄簱閫氱煡妗h浆鍘嗗彶妗�
+ * Created by TQS on 2021/8/31
+ */
+@Component
+public class WaitMatoutLogScheduler {
+    private static final Logger log = LoggerFactory.getLogger(WaitMatoutLogScheduler.class);
+
+    @Autowired
+    private WaitMatoutService waitMatoutService;
+    @Autowired
+    private WaitMatoutLogHandler waitMatOutLogHandler;
+
+    /**
+     * ERP鎺ュ彛鏄惁鍚敤
+     */
+    @Value("${erp.enabled}")
+    private Boolean erpEnabled;
+
+    @Scheduled(cron = "0/4 * * * * ? ")
+    private void execute(){
+        if(!erpEnabled) return;
+        List<WaitMatout> waitMatouts = waitMatoutService.selectWaitMatOutBySts();
+        for (WaitMatout waitMatout : waitMatouts) {
+            ReturnT<String> result = waitMatOutLogHandler.start(waitMatout);
+            if (!result.isSuccess()) {
+                log.error("鍑哄簱閫氱煡妗billNo={},seqNo={}]鍘嗗彶妗e鐞嗗け璐�", waitMatout.getBillNo(),waitMatout.getSeqNo());
+            }
+        }
+    }
+
+}
diff --git a/src/main/java/com/zy/ints/task/handler/IoCompleteLogHandler.java b/src/main/java/com/zy/ints/task/handler/IoCompleteLogHandler.java
new file mode 100644
index 0000000..95403ad
--- /dev/null
+++ b/src/main/java/com/zy/ints/task/handler/IoCompleteLogHandler.java
@@ -0,0 +1,39 @@
+package com.zy.ints.task.handler;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.zy.asrs.task.AbstractHandler;
+import com.zy.asrs.task.core.ReturnT;
+import com.zy.ints.entity.IoComplete;
+import com.zy.ints.service.IoCompleteLogService;
+import com.zy.ints.service.IoCompleteService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+
+@Service
+public class IoCompleteLogHandler extends AbstractHandler<String> {
+
+    @Autowired
+    private IoCompleteService ioCompleteService;
+
+    @Autowired
+    private IoCompleteLogService ioCompleteLogService;
+
+    public ReturnT<String> start(IoComplete ioComplete) {
+        try {
+            // 淇濆瓨宸ヤ綔涓绘。鍘嗗彶妗�
+            if (!ioCompleteLogService.save(ioComplete.getId())) {
+                exceptionHandle("淇濆瓨鍥炴姤鍘嗗彶妗id={0}]澶辫触", ioComplete.getId());
+            }
+            // 鍒犻櫎宸ヤ綔涓绘。
+            if (!ioCompleteService.delete(new EntityWrapper<IoComplete>().eq("id", ioComplete.getId()))) {
+                exceptionHandle("鍒犻櫎鍥炴姤妗id={0}]澶辫触", ioComplete.getId());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return FAIL.setMsg(e.getMessage());
+        }
+        return SUCCESS;
+    }
+}
diff --git a/src/main/java/com/zy/ints/task/handler/WaitMatchkLogHandler.java b/src/main/java/com/zy/ints/task/handler/WaitMatchkLogHandler.java
new file mode 100644
index 0000000..79d09c2
--- /dev/null
+++ b/src/main/java/com/zy/ints/task/handler/WaitMatchkLogHandler.java
@@ -0,0 +1,39 @@
+package com.zy.ints.task.handler;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.zy.asrs.task.AbstractHandler;
+import com.zy.asrs.task.core.ReturnT;
+import com.zy.ints.entity.WaitMatchk;
+import com.zy.ints.service.WaitMatchkLogService;
+import com.zy.ints.service.WaitMatchkService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+
+@Service
+public class WaitMatchkLogHandler extends AbstractHandler<String> {
+
+    @Autowired
+    private WaitMatchkService waitMatchkService;
+    @Autowired
+    private WaitMatchkLogService waitMatchkLogService;
+
+    public ReturnT<String> start(WaitMatchk waitMatchk){
+        try {
+            // 淇濆瓨鐩樼偣閫氱煡鍘嗗彶妗�
+            if (!waitMatchkLogService.save(waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo())) {
+                exceptionHandle("淇濆瓨鐩樼偣閫氱煡鍘嗗彶妗billNo={0},locNo={1},matNo={2}]澶辫触", waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo());
+            }
+            // 鍒犻櫎鐩樼偣閫氱煡妗�
+            if (!waitMatchkService.delete(new EntityWrapper<WaitMatchk>().eq("bill_no", waitMatchk.getBillNo()).eq("loc_no", waitMatchk.getLocNo())
+                        .eq("mat_no", waitMatchk.getMatNo()))) {
+                exceptionHandle("鍒犻櫎鐩樼偣閫氱煡妗billNo={0},locNo={1},matNo={2}]澶辫触", waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return FAIL.setMsg(e.getMessage());
+        }
+        return SUCCESS;
+    }
+}
diff --git a/src/main/java/com/zy/ints/task/handler/WaitMatinLogHandler.java b/src/main/java/com/zy/ints/task/handler/WaitMatinLogHandler.java
new file mode 100644
index 0000000..abe3aaa
--- /dev/null
+++ b/src/main/java/com/zy/ints/task/handler/WaitMatinLogHandler.java
@@ -0,0 +1,44 @@
+package com.zy.ints.task.handler;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.zy.asrs.task.AbstractHandler;
+import com.zy.asrs.task.core.ReturnT;
+import com.zy.ints.entity.WaitMatin;
+import com.zy.ints.service.WaitMatinLogService;
+import com.zy.ints.service.WaitMatinService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+
+/**
+ * 鍏ュ簱閫氱煡妗h浆鍘嗗彶妗�
+ * Created by TQS on 2021/8/31
+ */
+@Service
+public class WaitMatinLogHandler extends AbstractHandler<String>  {
+
+    @Autowired
+    WaitMatinService waitMatinService;
+    @Autowired
+    WaitMatinLogService waitMatinLogService;
+
+    @Transactional
+    public ReturnT<String> start(WaitMatin waitMatin){
+        try {
+            // 淇濆瓨鍏ュ簱閫氱煡鍘嗗彶妗�
+            if (!waitMatinLogService.save(waitMatin.getBillNo(),waitMatin.getSeqNo())) {
+                exceptionHandle("淇濆瓨鍏ュ簱閫氱煡鍘嗗彶妗billNo={0},seqNo={1}]澶辫触", waitMatin.getBillNo(),waitMatin.getSeqNo());
+            }
+            // 鍒犻櫎鍏ュ簱閫氱煡妗�
+            if (!waitMatinService.delete(new EntityWrapper<WaitMatin>().eq("bill_no", waitMatin.getBillNo()).eq("seq_no", waitMatin.getSeqNo()))) {
+                exceptionHandle("鍒犻櫎鍏ュ簱閫氱煡妗billNo={0},seqNo={1}]澶辫触", waitMatin.getBillNo(),waitMatin.getSeqNo());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return FAIL.setMsg(e.getMessage());
+        }
+        return SUCCESS;
+    }
+}
diff --git a/src/main/java/com/zy/ints/task/handler/WaitMatoutLogHandler.java b/src/main/java/com/zy/ints/task/handler/WaitMatoutLogHandler.java
new file mode 100644
index 0000000..9153800
--- /dev/null
+++ b/src/main/java/com/zy/ints/task/handler/WaitMatoutLogHandler.java
@@ -0,0 +1,40 @@
+package com.zy.ints.task.handler;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.zy.asrs.task.AbstractHandler;
+import com.zy.asrs.task.core.ReturnT;
+import com.zy.ints.entity.WaitMatout;
+import com.zy.ints.service.WaitMatoutLogService;
+import com.zy.ints.service.WaitMatoutService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
+
+@Service
+public class WaitMatoutLogHandler extends AbstractHandler<String> {
+
+    @Autowired
+    private WaitMatoutLogService waitMatoutLogService;
+
+    @Autowired
+    private WaitMatoutService waitMatoutService;
+
+    public ReturnT<String> start(WaitMatout waitMatout) {
+
+        try {
+            // 淇濆瓨鍑哄簱閫氱煡鍘嗗彶妗�
+            if (!waitMatoutLogService.save(waitMatout.getBillNo(),waitMatout.getSeqNo())) {
+                exceptionHandle("淇濆瓨鍑哄簱閫氱煡鍘嗗彶妗billNo={0},seqNo={1}]澶辫触", waitMatout.getBillNo());
+            }
+            // 鍒犻櫎鍑哄簱閫氱煡妗�
+            if (!waitMatoutService.delete(new EntityWrapper<WaitMatout>().eq("bill_no", waitMatout.getBillNo()).eq("seq_no", waitMatout.getSeqNo()))) {
+                exceptionHandle("鍒犻櫎鍑哄簱閫氱煡妗billNo={0},seqNo={1}]澶辫触", waitMatout.getBillNo());
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+            return FAIL.setMsg(e.getMessage());
+        }
+        return SUCCESS;
+    }
+}
diff --git a/src/main/java/pltBarcode.sql b/src/main/java/pltBarcode.sql
new file mode 100644
index 0000000..edb804a
--- /dev/null
+++ b/src/main/java/pltBarcode.sql
@@ -0,0 +1,20 @@
+-- save pltBarcode record
+-- mysql
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'pltBarcode/pltBarcode.html', 'pltBarcode绠$悊', null , '2', null , '1');
+
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'pltBarcode#view', '鏌ヨ', '', '3', '0', '1');
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'pltBarcode#btn-add', '鏂板', '', '3', '1', '1');
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'pltBarcode#btn-edit', '缂栬緫', '', '3', '2', '1');
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'pltBarcode#btn-delete', '鍒犻櫎', '', '3', '3', '1');
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'pltBarcode#btn-export', '瀵煎嚭', '', '3', '4', '1');
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'pltBarcode#btn-into', '瀵煎叆', '', '3', '5', '1');
+
+-- sqlserver
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'pltBarcode/pltBarcode.html', N'缁勬墭鏁版嵁绠$悊', 鈥�222鈥�, '2', null, '1');
+
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'pltBarcode#view', N'鏌ヨ', '20469', '3', '0', '1');
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'pltBarcode#btn-add', N'鏂板', '20469', '3', '1', '1');
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'pltBarcode#btn-edit', N'缂栬緫', '20469', '3', '2', '1');
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'pltBarcode#btn-delete', N'鍒犻櫎', '20469', '3', '3', '1');
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'pltBarcode#btn-export', N'瀵煎嚭', '20469', '3', '4', '1');
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'pltBarcode#btn-into', N'瀵煎叆', '20469', '3', '5', '1');
diff --git a/src/main/java/stockSync.sql b/src/main/java/stockSync.sql
new file mode 100644
index 0000000..5b59739
--- /dev/null
+++ b/src/main/java/stockSync.sql
@@ -0,0 +1,20 @@
+-- save stockSync record
+-- mysql
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'stockSync/stockSync.html', 'stockSync绠$悊', null , '2', null , '1');
+
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'stockSync#view', '鏌ヨ', '', '3', '0', '1');
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'stockSync#btn-add', '鏂板', '', '3', '1', '1');
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'stockSync#btn-edit', '缂栬緫', '', '3', '2', '1');
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'stockSync#btn-delete', '鍒犻櫎', '', '3', '3', '1');
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'stockSync#btn-export', '瀵煎嚭', '', '3', '4', '1');
+insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'stockSync#btn-into', '瀵煎叆', '', '3', '5', '1');
+
+-- sqlserver
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'stockSync/stockSync.html', N'stockSync绠$悊', null, '2', null, '1');
+
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'stockSync#view', N'鏌ヨ', '', '3', '0', '1');
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'stockSync#btn-add', N'鏂板', '', '3', '1', '1');
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'stockSync#btn-edit', N'缂栬緫', '', '3', '2', '1');
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'stockSync#btn-delete', N'鍒犻櫎', '', '3', '3', '1');
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'stockSync#btn-export', N'瀵煎嚭', '', '3', '4', '1');
+insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'stockSync#btn-into', N'瀵煎叆', '', '3', '5', '1');
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index ea1a31d..05e7da8 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -48,4 +48,17 @@
   pwd: xltys1995
 
 swagger:
-  enable: false
\ No newline at end of file
+  enable: false
+
+# 涓嬩綅鏈洪厤缃�
+wcs-slave:
+  # 鍙屾繁
+  doubleDeep: true
+  # 鍙屾繁搴撲綅鎺掑彿
+  doubleLocs: 1,4,5,8,9,12
+  # 涓�涓爢鍨涙満璐熻矗鐨勮揣鏋舵帓鏁�
+  groupCount: 4
+
+#ERP鎺ュ彛
+erp:
+  enabled: true
\ No newline at end of file
diff --git a/src/main/resources/mapper/IoCompleteMapper.xml b/src/main/resources/mapper/IoCompleteMapper.xml
index e98c846..6bf3458 100644
--- a/src/main/resources/mapper/IoCompleteMapper.xml
+++ b/src/main/resources/mapper/IoCompleteMapper.xml
@@ -21,5 +21,10 @@
         <result column="appe_time" property="appeTime" />
 
     </resultMap>
+    <select id="selectIoCompleteBySts" resultMap="BaseResultMap">
+         select * from ints_io_complete
+        where upd_status=1
+        order by modi_time,seq_no asc
+    </select>
 
 </mapper>
diff --git a/src/main/resources/mapper/LocDetlMapper.xml b/src/main/resources/mapper/LocDetlMapper.xml
index 14d0369..0764c7a 100644
--- a/src/main/resources/mapper/LocDetlMapper.xml
+++ b/src/main/resources/mapper/LocDetlMapper.xml
@@ -108,4 +108,10 @@
         where 1=1
         group by a.mat_no,a.mat_name
     </select>
+
+<!--    <select id="getStockSum" resultMap="BaseResultMap">-->
+<!--        select mat_no,mat_name,sum(qty) qty  from asr_loc_detl-->
+<!--        group by mat_no,mat_name-->
+<!--    </select>-->
+
 </mapper>
diff --git a/src/main/resources/mapper/LocMastMapper.xml b/src/main/resources/mapper/LocMastMapper.xml
index 61d8a3a..da76ae0 100644
--- a/src/main/resources/mapper/LocMastMapper.xml
+++ b/src/main/resources/mapper/LocMastMapper.xml
@@ -39,6 +39,19 @@
     </resultMap>
 
     <select id="queryFreeLocMast" resultMap="BaseResultMap">
-        select top 1 * from asr_loc_mast where row1=#{row} and loc_sts='O' order by loc_sts desc ,lev1 asc,bay1 asc
+        select top 1 *
+        from asr_loc_mast
+        where row1=#{row}
+        and loc_sts='O'
+        <if test="locType1 != null">
+            and loc_type1 = #{locType1}
+        </if>
+        <if test="locType2 != null">
+            and loc_type2 = #{locType2}
+        </if>
+        <if test="locType3 != null">
+            and loc_type3 = #{locType3}
+        </if>
+        order by loc_sts desc ,lev1 asc,bay1 asc
     </select>
 </mapper>
diff --git a/src/main/resources/mapper/PltBarcodeMapper.xml b/src/main/resources/mapper/PltBarcodeMapper.xml
new file mode 100644
index 0000000..67a68b8
--- /dev/null
+++ b/src/main/resources/mapper/PltBarcodeMapper.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zy.asrs.mapper.PltBarcodeMapper">
+
+    <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
+    <resultMap id="BaseResultMap" type="com.zy.asrs.entity.PltBarcode">
+        <result column="barcode" property="barcode" />
+        <result column="bill_no" property="billNo" />
+        <result column="seq_no" property="seqNo" />
+        <result column="bill_type" property="billType" />
+        <result column="mat_no" property="matNo" />
+        <result column="mat_name" property="matName" />
+        <result column="qty" property="qty" />
+        <result column="loc_no" property="locNo" />
+        <result column="specs" property="specs" />
+        <result column="unit" property="unit" />
+        <result column="size" property="size" />
+        <result column="color" property="color" />
+        <result column="weight" property="weight" />
+        <result column="memo" property="memo" />
+        <result column="link_erp" property="linkErp" />
+        <result column="io_status" property="ioStatus" />
+        <result column="io_time" property="ioTime" />
+        <result column="modi_user" property="modiUser" />
+        <result column="modi_time" property="modiTime" />
+        <result column="appe_user" property="appeUser" />
+        <result column="appe_time" property="appeTime" />
+
+    </resultMap>
+
+</mapper>
diff --git a/src/main/resources/mapper/StockSyncMapper.xml b/src/main/resources/mapper/StockSyncMapper.xml
new file mode 100644
index 0000000..c885a1f
--- /dev/null
+++ b/src/main/resources/mapper/StockSyncMapper.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zy.ints.mapper.StockSyncMapper">
+
+    <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
+    <resultMap id="BaseResultMap" type="com.zy.ints.entity.StockSync">
+        <result column="mat_no" property="matNo" />
+        <result column="mat_name" property="matName" />
+        <result column="qty" property="qty" />
+        <result column="upd_status" property="updStatus" />
+        <result column="error_memo" property="errorMemo" />
+        <result column="modi_user" property="modiUser" />
+        <result column="modi_time" property="modiTime" />
+        <result column="appe_user" property="appeUser" />
+        <result column="appe_time" property="appeTime" />
+
+    </resultMap>
+
+    <select id="getStockSyncCount" resultType="integer">
+        select count(*) from ints_stock_sync;
+    </select>
+
+<!--    <insert id="insertStockSync">-->
+<!--        BEGIN-->
+<!--        <foreach collection="list" item="item" index="index">-->
+<!--            INSERT INTO ints_stock_sync (mat_no, mat_name, qty, upd_status, appe_time, appe_user, modi_time, modi_user)-->
+<!--            VALUES (#{item.matNo,jdbcType=VARCHAR}, #{item.matName,jdbcType=VARCHAR}, #{item.qty,jdbcType=DECIMAL}, 0,-->
+<!--            #{item.appeTime,jdbcType=TIMESTAMP}, #{item.appeUser,jdbcType=DECIMAL},-->
+<!--            #{item.modiTime,jdbcType=TIMESTAMP}, #{item.modiUser,jdbcType=DECIMAL})-->
+<!--        </foreach>-->
+<!--        END;-->
+<!--    </insert>-->
+
+    <delete id="clearStockSync">
+        DELETE FROM ints_stock_sync
+    </delete>
+
+</mapper>
diff --git a/src/main/resources/mapper/WaitMatchkMapper.xml b/src/main/resources/mapper/WaitMatchkMapper.xml
index 241c3e0..885606e 100644
--- a/src/main/resources/mapper/WaitMatchkMapper.xml
+++ b/src/main/resources/mapper/WaitMatchkMapper.xml
@@ -25,4 +25,10 @@
 
     </resultMap>
 
+    <select id="selectWaitMatchkBySts" resultMap="BaseResultMap">
+       select * from ints_wait_matchk
+        where io_status=2 and verify_status=1
+        order by modi_time,mat_no asc
+    </select>
+
 </mapper>
diff --git a/src/main/resources/mapper/WaitMatinLogMapper.xml b/src/main/resources/mapper/WaitMatinLogMapper.xml
index 2760dc9..89a57ee 100644
--- a/src/main/resources/mapper/WaitMatinLogMapper.xml
+++ b/src/main/resources/mapper/WaitMatinLogMapper.xml
@@ -27,4 +27,5 @@
 
     </resultMap>
 
+
 </mapper>
diff --git a/src/main/resources/mapper/WaitMatinMapper.xml b/src/main/resources/mapper/WaitMatinMapper.xml
index 622c43b..8abd794 100644
--- a/src/main/resources/mapper/WaitMatinMapper.xml
+++ b/src/main/resources/mapper/WaitMatinMapper.xml
@@ -75,5 +75,10 @@
             ) r
         ) t
     </select>
+    <select id="selectWaitMatinBySts" resultMap="BaseResultMap">
+       select * from ints_wait_matin
+        where io_status=2
+        order by modi_time,mat_no asc
+    </select>
 
 </mapper>
diff --git a/src/main/resources/mapper/WaitMatoutMapper.xml b/src/main/resources/mapper/WaitMatoutMapper.xml
index cfcda26..3dfbdf5 100644
--- a/src/main/resources/mapper/WaitMatoutMapper.xml
+++ b/src/main/resources/mapper/WaitMatoutMapper.xml
@@ -27,4 +27,58 @@
 
     </resultMap>
 
+    <sql id="condition">
+        <if test="bill_no!=null and bill_no!='' ">
+            and bill_no like '%' + #{bill_no} + '%'
+        </if>
+        <if test="bill_type!=null and bill_type!='' ">
+            and bill_type like '%' + #{bill_type} + '%'
+        </if>
+        <if test="mat_name!=null and mat_name!='' ">
+            and a.mat_name like '%' + #{mat_name} + '%'
+        </if>
+        <if test="qty!=null and qty!='' ">
+            and a.qty = #{qty}
+        </if>
+        <if test="altme!=null and altme!='' ">
+            and a.unit like '%' + #{unit} + '%'
+        </if>
+        <if test="startTime!=null and endTime!=null">
+            and appe_time between #{startTime} and #{endTime}
+        </if>
+    </sql>
+
+
+    <select id="getHeadPage" resultMap="BaseResultMap">
+        select * from
+        (
+        select *,
+        ROW_NUMBER() over (order by appe_time desc) as row
+        from (
+        select distinct bill_no, bill_type, appe_time
+        from ints_wait_matout
+        where 1=1
+        <include refid="condition"></include>
+        ) r
+        ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
+    </select>
+    <select id="getHeadPageCount"  parameterType="java.util.Map" resultType="integer">
+        select count(1) from
+        (
+        select *,
+        ROW_NUMBER() over (order by appe_time desc) as row
+        from (
+        select distinct bill_no, bill_type, appe_time
+        from ints_wait_matout
+        where 1=1
+        <include refid="condition"></include>
+        ) r
+        ) t
+    </select>
+    <select id="selectWaitMatOutBySts" resultMap="BaseResultMap">
+        select * from ints_wait_matout
+        where io_status=2
+        order by modi_time,mat_no asc
+    </select>
+
 </mapper>
diff --git a/src/main/webapp/static/js/adjDetl/adjDetl.js b/src/main/webapp/static/js/adjDetl/adjDetl.js
index a90bf96..9290245 100644
--- a/src/main/webapp/static/js/adjDetl/adjDetl.js
+++ b/src/main/webapp/static/js/adjDetl/adjDetl.js
@@ -21,7 +21,7 @@
             // {type: 'checkbox'}
 //            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
 //             {field: 'adjId', align: 'center',title: '搴忓彿'}
-            {field: 'locNo$', align: 'center',title: '搴撲綅鍙�'}
+            {field: 'locNo$', align: 'center',title: '搴撲綅鍙�',sort:true}
             ,{field: 'matNo$', align: 'center',title: '浜у搧缂栧彿'}
             // ,{field: 'oriCtns', align: 'center',title: '鍘熺鏁�'}
             ,{field: 'oriQty', align: 'center',title: '鍘熸暟閲�'}
diff --git a/src/main/webapp/static/js/common.js b/src/main/webapp/static/js/common.js
index b51fb07..27028d4 100644
--- a/src/main/webapp/static/js/common.js
+++ b/src/main/webapp/static/js/common.js
@@ -181,7 +181,7 @@
     ,{field: 'matName', align: 'center',title: '浜у搧鍚嶇О'}
     ,{field: 'specs', align: 'center',title: '瑙勬牸'}
     ,{field: 'qty', align: 'center',title: '鏁伴噺'}
-    ,{field: 'unit', align: 'center',title: '鍗曚綅', width:80}
+    ,{field: 'unit', align: 'center',title: '鍗曚綅', width:80, hide: true}
     ,{field: 'size', align: 'center',title: '灏哄'}
     ,{field: 'color', align: 'center',title: '棰滆壊'}
     ,{field: 'zpallet', align: 'center',title: '鎵樼洏鏉$爜'}
diff --git a/src/main/webapp/static/js/cool.js b/src/main/webapp/static/js/cool.js
index d817c09..24e8709 100644
--- a/src/main/webapp/static/js/cool.js
+++ b/src/main/webapp/static/js/cool.js
@@ -61,6 +61,40 @@
     });
 }
 
+
+function autoLoad2(val) {
+    var inputDomVal = document.querySelector("input[data-key="+val+"]").value;
+    var selectDom = document.querySelector("select[data-key="+val+"Select]");
+    selectDom.length = 0;
+    var defaultOption = new Option("鍙栨秷閫夋嫨", "");
+    defaultOption.title = "";
+    selectDom.appendChild(defaultOption);
+    selectDom.style.display='none';
+    $.ajax({
+        url: baseUrl+"/"+getForeignKeyQuery(val)+"/auth",
+        headers: {'token': localStorage.getItem('token')},
+        data: {condition: inputDomVal},
+        method: 'POST',
+        traditional:true,
+        success: function (res) {
+            if (res.code === 200){
+                var list = res.data;
+                for (var i=0;i<list.length;i++){
+                    var option = new Option(list[i].value, i);
+                    option.title = list[i].id;
+                    selectDom.options[i+1] = option;
+                }
+                selectDom.style.display='block';
+            } else if (res.code === 403){
+                top.location.href = baseUrl+"/";
+            } else {
+                layer.msg(res.msg)
+            }
+        }
+    });
+}
+
+
 /**
  * 鎼滅储鑷姩琛ュ叏 -- select
  */
diff --git a/src/main/webapp/static/js/ioCompleteLog/ioCompleteLog.js b/src/main/webapp/static/js/ioCompleteLog/ioCompleteLog.js
index 4d67906..e801807 100644
--- a/src/main/webapp/static/js/ioCompleteLog/ioCompleteLog.js
+++ b/src/main/webapp/static/js/ioCompleteLog/ioCompleteLog.js
@@ -36,7 +36,7 @@
             ,{field: 'appeUser$', align: 'center',title: '寤烘。浜哄憳',event:'appeUser', style: 'cursor:pointer',hide:true}
             ,{field: 'appeTime$', align: 'center',title: '寤烘。鏃堕棿',hide:true}
 
-            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
+            // ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
         ]],
         request: {
             pageName: 'curr',
diff --git a/src/main/webapp/static/js/locMast/locMast.js b/src/main/webapp/static/js/locMast/locMast.js
index 2c8959e..ea9e9d3 100644
--- a/src/main/webapp/static/js/locMast/locMast.js
+++ b/src/main/webapp/static/js/locMast/locMast.js
@@ -5,6 +5,7 @@
     var layer = layui.layer;
     var layDate = layui.laydate;
     var form = layui.form;
+    var dropdown = layui.dropdown
 
     // 鏁版嵁娓叉煋
     tableIns = table.render({
@@ -20,7 +21,7 @@
         cols: [[
             {type: 'checkbox', fixed: 'left'}
 //            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
-            ,{field: 'locNo', align: 'center',title: '搴撲綅鍙�',sort:true}
+            ,{field: 'locNo', align: 'center',title: '搴撲綅鍙�', sort:true}
             ,{field: 'locSts$', align: 'center',title: '搴撲綅鐘舵��',width:200}
             // ,{field: 'whsType$', align: 'center',title: '搴撲綅绫诲瀷'}
             // ,{field: 'pltType', align: 'center',title: ''}
@@ -50,12 +51,12 @@
             // ,{field: 'scWeight', align: 'center',title: ''}
             // ,{field: 'invWh', align: 'center',title: ''}
             // ,{field: 'mk', align: 'center',title: ''}
-            // ,{field: 'barcode', align: 'center',title: ''}
+            ,{field: 'barcode', align: 'center',title: '鏉$爜'}
             // ,{field: 'PdcType', align: 'center',title: ''}
             // ,{field: 'ctnNo', align: 'center',title: ''}
             ,{field: 'locType1$', align: 'center',title: '楂樹綆绫诲瀷'}
-            ,{field: 'locType2$', align: 'center',title: '瀹界獎绫诲瀷'}
-            ,{field: 'locType3$', align: 'center',title: '杞婚噸绫诲瀷'}
+            // ,{field: 'locType2$', align: 'center',title: '瀹界獎绫诲瀷'}
+            // ,{field: 'locType3$', align: 'center',title: '杞婚噸绫诲瀷'}
 
             ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:100}
         ]],
@@ -90,6 +91,7 @@
             });
         }
     });
+
 
     // 鐩戝惉鎺掑簭浜嬩欢
     table.on('sort(locMast)', function (obj) {
@@ -207,6 +209,7 @@
                 });
                 break;
             case "init":
+                $('#initDo').removeClass("layui-btn-disabled")
                 layer.prompt({title: '璇疯緭鍏ュ彛浠わ紝骞堕噸缃簱浣�', formType: 1,   shadeClose: true}, function(pass, idx){
                     http.get(baseUrl+"/locMast/init/pwd", {pwd: pass}, function (res) {
                         if (res.data) {
@@ -390,13 +393,16 @@
 
     // 鍒濆鍖栦繚瀛�
     form.on('submit(initDo)', function (data) {
+        // layer.load(1, {shade: [0.5,'#000']});
+        $('#initDo').addClass("layui-btn-disabled").attr("disabled", "disabled");
         $.ajax({
             url: baseUrl+"/locMast/init/auth",
             headers: {'token': localStorage.getItem('token')},
             data: data.field,
             method: 'POST',
-            async: false,
+            // async: false,
             success: function (res) {
+                // layer.closeAll('loading');
                 if (res.code === 200){
                     layer.msg(res.msg);
                     layer.closeAll();
diff --git a/src/main/webapp/static/js/locStatis/locStatis.js b/src/main/webapp/static/js/locStatis/locStatis.js
index 2f49b1a..b667ef4 100644
--- a/src/main/webapp/static/js/locStatis/locStatis.js
+++ b/src/main/webapp/static/js/locStatis/locStatis.js
@@ -60,7 +60,7 @@
         even: true,
         toolbar: '#toolbar',
         cellMinWidth: 50,
-        cols: [[{field: 'qty', align: 'center', title: '鏁伴噺', width: 80}
+        cols: [[{field: 'qty', align: 'center', title: '鏁伴噺', width: 120}
             , {field: 'matNo', align: 'center', title: '浜у搧缂栫爜'}
             , {field: 'matName', align: 'center', title: '浜у搧鍚嶇О'}
             ]],
@@ -115,6 +115,74 @@
     table.on('toolbar(locStatis)', function (obj) {
         var checkStatus = table.checkStatus(obj.config.id);
         switch(obj.event) {
+            case 'syncStok':
+                alert('鎻掑叆鏁版嵁鍒癊RP鎺ュ彛搴撳瓨鍚屾琛�');
+                $.ajax({
+                    url: baseUrl + "/stock/stockSyncCount",
+                    headers: {'token': localStorage.getItem('token')},
+                    data: {},
+                    method: 'POST',
+                    traditional: true,
+                    success: function (res) {
+                        if (res.code === 200) {
+                            var msg = '';
+                            if (res.data == 0) {
+                                msg = '纭畾瑕佸悓姝ュ簱瀛樻暟鎹悧?'
+                            } else {
+                                msg = '鍚屾浠诲姟姝e湪杩涜锛岀‘瀹氳涓骞堕噸鏂板悓姝ュ悧?'
+                            }
+                            layer.confirm(msg, {
+                                    shadeClose: true
+                                    , btn: ['纭畾']
+                                }, function () {
+                                    if (res.data > 0) {
+                                        // 娓呯┖鍚屾涓婁紶娓呭崟鏁版嵁,鍐嶈繘琛屾彃鍏ユ暟鎹�
+                                        $.ajax({
+                                            url: baseUrl + "/stock/updateStockSync",
+                                            headers: {'token': localStorage.getItem('token')},
+                                            data: {},
+                                            contentType: 'application/json;charset=UTF-8',
+                                            method: 'POST',
+                                            success: function (res) {
+                                                if (res.code === 200) {
+                                                    layer.msg("鏇存柊涓婃姤搴撳瓨鏁版嵁鎴愬姛锛�");
+                                                } else if (res.code === 403) {
+                                                    top.location.href = baseUrl + "/";
+                                                } else {
+                                                    layer.msg(res.msg)
+                                                }
+                                            }
+                                        });
+                                    } else {
+                                        // 璋冪敤鍚屾涓婁紶娓呭崟鏁版嵁鎻掑叆鎺ュ彛
+                                        $.ajax({
+                                            url: baseUrl + "/stock/insertStockSync",
+                                            headers: {'token': localStorage.getItem('token')},
+                                            data: {},
+                                            contentType: 'application/json;charset=UTF-8',
+                                            method: 'POST',
+                                            success: function (res) {
+                                                if (res.code === 200) {
+                                                    layer.msg("鎻掑叆涓婃姤搴撳瓨鏁版嵁鎴愬姛锛�");
+                                                } else if (res.code === 403) {
+                                                    top.location.href = baseUrl + "/";
+                                                } else {
+                                                    layer.msg(res.msg)
+                                                }
+                                            }
+                                        });
+                                    }
+                                    layer.closeAll();
+                                }
+                            );
+                        } else if (res.code === 403) {
+                            top.location.href = baseUrl + "/";
+                        } else {
+                            layer.msg(res.msg)
+                        }
+                    }
+                });
+                break;
             case 'exportAll':
                 layer.closeAll();
                 layer.load(1, {shade: [0.1,'#fff']});
diff --git a/src/main/webapp/static/js/matStore/matStore.js b/src/main/webapp/static/js/matStore/matStore.js
index 657151f..0f5d761 100644
--- a/src/main/webapp/static/js/matStore/matStore.js
+++ b/src/main/webapp/static/js/matStore/matStore.js
@@ -71,7 +71,6 @@
                         return;
                     }
                 }
-                console.log(matCodeData)
                 $.ajax({
                     url: baseUrl+"/mat/store/start",
                     headers: {'token': localStorage.getItem('token')},
@@ -160,7 +159,6 @@
             layer.msg("璇疯緭鍏ユ暟瀛�");
         } else {
             if(count > (qty-inQty) ){
-                count.html(59)
                 layer.msg("鍏ュ簱鏁伴噺涓嶈兘瓒呰繃鍙叆搴撻噺");
             }
             if (count > 0) {
diff --git a/src/main/webapp/static/js/pakStore/stockAdjust.js b/src/main/webapp/static/js/pakStore/stockAdjust.js
index 3e73eb3..6cc64ca 100644
--- a/src/main/webapp/static/js/pakStore/stockAdjust.js
+++ b/src/main/webapp/static/js/pakStore/stockAdjust.js
@@ -123,7 +123,7 @@
     });
 
     function init(locNo) {
-        http.post(baseUrl + "/locDetl/list/auth", {locNo: locNo,limit: 1000}, function (res) {
+        http.post(baseUrl + "/locDetl/list/sts", {locNo: locNo,limit: 1000}, function (res) {
             matCodeData = [];
             let data = res.data.records;
             for (var i = 0; i<data.length; i++) {
diff --git a/src/main/webapp/static/js/pltBarcode/pltBarcode.js b/src/main/webapp/static/js/pltBarcode/pltBarcode.js
new file mode 100644
index 0000000..ed152f9
--- /dev/null
+++ b/src/main/webapp/static/js/pltBarcode/pltBarcode.js
@@ -0,0 +1,271 @@
+var pageCurr;
+layui.config({
+    base: baseUrl + "/static/layui/lay/modules/"
+}).use(['table','laydate', 'form', 'admin'], function(){
+    var table = layui.table;
+    var $ = layui.jquery;
+    var layer = layui.layer;
+    var layDate = layui.laydate;
+    var form = layui.form;
+    var admin = layui.admin;
+
+    // 鏁版嵁娓叉煋
+    tableIns = table.render({
+        elem: '#pltBarcode',
+        headers: {token: localStorage.getItem('token')},
+        url: baseUrl+'/pltBarcode/list/auth',
+        page: true,
+        limit: 16,
+        limits: [16, 30, 50, 100, 200, 500],
+        toolbar: '#toolbar',
+        cellMinWidth: 50,
+        cols: [[
+            {type: 'checkbox'}
+            ,{field: 'barcode', align: 'center',title: '鏉$爜'}
+            ,{field: 'billNo', align: 'center',title: '鍗曟嵁缂栧彿'}
+            ,{field: 'seqNo', align: 'center',title: '搴忓彿'}
+            ,{field: 'billType$', align: 'center',title: '鍗曟嵁绫诲瀷', hide: true}
+            ,{field: 'matNo', align: 'center',title: '鐗╂枡缂栫爜'}
+            ,{field: 'matName', align: 'center',title: '鐗╂枡鍚嶇О'}
+            ,{field: 'qty', align: 'center',title: '鏁伴噺'}
+            ,{field: 'locNo', align: 'center',title: '搴撲綅鍙�'}
+            ,{field: 'specs', align: 'center',title: '瑙勬牸'}
+            ,{field: 'unit', align: 'center',title: '鍗曚綅'}
+            ,{field: 'size', align: 'center',title: '灏哄', hide: true}
+            ,{field: 'color', align: 'center',title: '棰滆壊', hide: true}
+            ,{field: 'weight', align: 'center',title: '鍗曢噸', hide: true}
+            ,{field: 'memo', align: 'center',title: '澶囨敞', hide: true}
+            ,{field: 'linkErp$', align: 'center',title: 'ERP杩炵嚎', hide: true}
+            ,{field: 'ioStatus$', align: 'center',title: '瀹屾垚鐘舵��'}
+            ,{field: 'ioTime$', align: 'center',title: '瀹屾垚鏃堕棿', hide: true}
+            ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳',event: 'modiUser', style: 'cursor:pointer', hide: true}
+            ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿', hide: true}
+            ,{field: 'appeUser$', align: 'center',title: '寤烘。浜哄憳',event: 'appeUser', style: 'cursor:pointer', hide: true}
+            ,{field: 'appeTime$', align: 'center',title: '寤烘。鏃堕棿', hide: true}
+
+            // ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
+        ]],
+        request: {
+            pageName: 'curr',
+            pageSize: 'limit'
+        },
+        parseData: function (res) {
+            return {
+                'code': res.code,
+                'msg': res.msg,
+                'count': res.data.total,
+                'data': res.data.records
+            }
+        },
+        response: {
+            statusCode: 200
+        },
+        done: function(res, curr, count) {
+            if (res.code === 403) {
+                top.location.href = baseUrl+"/";
+            }
+            pageCurr=curr;
+            limit();
+        }
+    });
+
+    // 鐩戝惉鎺掑簭浜嬩欢
+    table.on('sort(pltBarcode)', function (obj) {
+        var searchData = {};
+        $.each($('#search-box [name]').serializeArray(), function() {
+            searchData[this.name] = this.value;
+        });
+        searchData['orderByField'] = obj.field;
+        searchData['orderByType'] = obj.type;
+        tableIns.reload({
+            where: searchData,
+            page: {curr: 1}
+        });
+    });
+
+    // 鐩戝惉澶村伐鍏锋爮浜嬩欢
+    table.on('toolbar(pltBarcode)', function (obj) {
+        var checkStatus = table.checkStatus(obj.config.id).data;
+        switch(obj.event) {
+            case 'addData':
+                showEditModel();
+                break;
+            case 'deleteData':
+               if (checkStatus.length === 0) {
+                   layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
+                   return;
+               }
+               var ids = checkStatus.map(function (d) {
+                   return d.barcode;
+               });
+               del(ids);
+               break;
+            case 'exportData':
+                layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
+                    var titles=[];
+                    var fields=[];
+                    obj.config.cols[0].map(function (col) {
+                        if (col.type === 'normal' && col.hide === false && col.toolbar == null) {
+                            titles.push(col.title);
+                            fields.push(col.field);
+                        }
+                    });
+                    var exportData = {};
+                    $.each($('#search-box [name]').serializeArray(), function() {
+                        exportData[this.name] = this.value;
+                    });
+                    var param = {
+                        'pltBarcode': exportData,
+                        'fields': fields
+                    };
+                    $.ajax({
+                        url: baseUrl+"/pltBarcode/export/auth",
+                        headers: {'token': localStorage.getItem('token')},
+                        data: JSON.stringify(param),
+                        dataType:'json',
+                        contentType:'application/json;charset=UTF-8',
+                        method: 'POST',
+                        success: function (res) {
+                            layer.closeAll();
+                            if (res.code === 200) {
+                                table.exportFile(titles,res.data,'xls');
+                            } else if (res.code === 403) {
+                                top.location.href = baseUrl+"/";
+                            } else {
+                                layer.msg(res.msg, {icon: 2})
+                            }
+                        }
+                    });
+                });
+                break;
+        }
+    });
+
+    // 鐩戝惉琛屽伐鍏蜂簨浠�
+    table.on('tool(pltBarcode)', function(obj){
+        var data = obj.data;
+        switch (obj.event) {
+            case 'edit':
+                showEditModel(data);
+                break;
+            case "del":
+                var ids = [data.barcode];
+                del(ids);
+                break;
+        }
+    });
+
+    /* 寮圭獥 - 鏂板銆佷慨鏀� */
+    function showEditModel(mData) {
+        admin.open({
+            type: 1,
+            area: '600px',
+            title: (mData ? '淇敼' : '娣诲姞') + '璁㈠崟鐘舵��',
+            content: $('#editDialog').html(),
+            success: function (layero, dIndex) {
+                layDateRender();
+                form.val('detail', mData);
+                form.on('submit(editSubmit)', function (data) {
+                    var loadIndex = layer.load(2);
+                    $.ajax({
+                        url: baseUrl+"/pltBarcode/"+(mData?'update':'add')+"/auth",
+                        headers: {'token': localStorage.getItem('token')},
+                        data: data.field,
+                        method: 'POST',
+                        success: function (res) {
+                            layer.close(loadIndex);
+                            if (res.code === 200){
+                                layer.close(dIndex);
+                                layer.msg(res.msg, {icon: 1});
+                                tableReload();
+                            } else if (res.code === 403){
+                                top.location.href = baseUrl+"/";
+                            }else {
+                                layer.msg(res.msg, {icon: 2});
+                            }
+                        }
+                    })
+                    return false;
+                });
+                $(layero).children('.layui-layer-content').css('overflow', 'visible');
+                layui.form.render('select');
+            }
+        });
+    }
+
+    /* 鍒犻櫎 */
+    function del(ids) {
+        layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵灏嗗垹闄よ鏉$爜缁勬墭鎵�鏈夋暟鎹�', {
+            skin: 'layui-layer-admin',
+            shade: .1
+        }, function (i) {
+            layer.close(i);
+            var loadIndex = layer.load(2);
+            $.ajax({
+                url: baseUrl+"/pltBarcode/delete/auth",
+                headers: {'token': localStorage.getItem('token')},
+                data: {ids: ids},
+                method: 'POST',
+                success: function (res) {
+                    layer.close(loadIndex);
+                    if (res.code === 200){
+                        layer.msg(res.msg, {icon: 1});
+                        tableReload();
+                    } else if (res.code === 403){
+                        top.location.href = baseUrl+"/";
+                    } else {
+                        layer.msg(res.msg, {icon: 2});
+                    }
+                }
+            })
+        });
+    }
+
+    // 鎼滅储
+    form.on('submit(search)', function (data) {
+        pageCurr = 1;
+        tableReload(false);
+    });
+
+    // 閲嶇疆
+    form.on('submit(reset)', function (data) {
+        pageCurr = 1;
+        clearFormVal($('#search-box'));
+        tableReload(false);
+    });
+
+    // 鏃堕棿閫夋嫨鍣�
+    function layDateRender() {
+            layDate.render({
+        elem: '#ioTime\\$',
+        type: 'datetime'
+    });
+        layDate.render({
+        elem: '#modiTime\\$',
+        type: 'datetime'
+    });
+        layDate.render({
+        elem: '#appeTime\\$',
+        type: 'datetime'
+    });
+
+    }
+    layDateRender();
+
+});
+
+// 鍏抽棴鍔ㄤ綔
+$(document).on('click','#data-detail-close', function () {
+    parent.layer.closeAll();
+});
+
+function tableReload(child) {
+    var searchData = {};
+    $.each($('#search-box [name]').serializeArray(), function() {
+        searchData[this.name] = this.value;
+    });
+    tableIns.reload({
+        where: searchData,
+        page: {curr: pageCurr}
+     });
+}
diff --git a/src/main/webapp/static/js/report/stayTime.js b/src/main/webapp/static/js/report/stayTime.js
index 318ba8e..81ee2f2 100644
--- a/src/main/webapp/static/js/report/stayTime.js
+++ b/src/main/webapp/static/js/report/stayTime.js
@@ -120,6 +120,14 @@
         pageCurr = 1;
         tableReload(false);
     });
+
+    // 鎼滅储鏍忛噸缃簨浠�
+    form.on('submit(reset)', function (data) {
+        pageCurr = 1;
+        clearFormVal($('#search-box'));
+        tableReload(false);
+    });
+
 });
 
 // 鍏抽棴鍔ㄤ綔
@@ -132,8 +140,9 @@
     $.each($('#search-box [name]').serializeArray(), function() {
         searchData[this.name] = this.value;
     });
+
     (child ? parent.tableIns : tableIns).reload({
-        where: searchData,
+        where:searchData,
         page: {
             curr: pageCurr
         },
diff --git a/src/main/webapp/static/js/stoMan/stoQue.js b/src/main/webapp/static/js/stoMan/stoQue.js
index 8c946b5..1556e3e 100644
--- a/src/main/webapp/static/js/stoMan/stoQue.js
+++ b/src/main/webapp/static/js/stoMan/stoQue.js
@@ -33,6 +33,7 @@
             ,{field: 'row1', align: 'center',title: '鎺�'}
             ,{field: 'bay1', align: 'center',title: '鍒�'}
             ,{field: 'lev1', align: 'center',title: '灞�'}
+            ,{field: 'barcode', align: 'center',title: '鏉$爜'}
             ,{field: 'fullPlt', align: 'center',title: '婊℃澘', templet:function(row){
                     var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
                     if(row.fullPlt === 'Y'){html += " checked ";}
diff --git a/src/main/webapp/static/js/waitMatchk/waitMatchk.js b/src/main/webapp/static/js/waitMatchk/waitMatchk.js
index 36085d0..23d72f3 100644
--- a/src/main/webapp/static/js/waitMatchk/waitMatchk.js
+++ b/src/main/webapp/static/js/waitMatchk/waitMatchk.js
@@ -1,13 +1,10 @@
 var pageCurr;
-layui.config({
-    base: baseUrl + "/static/layui/lay/modules/"
-}).use(['table','laydate', 'form', 'tableMerge'], function(){
+layui.use(['table','laydate', 'form'], function(){
     var table = layui.table;
     var $ = layui.jquery;
     var layer = layui.layer;
     var layDate = layui.laydate;
     var form = layui.form;
-    var tableMerge = layui.tableMerge;
 
     // 鏁版嵁娓叉煋
     tableIns = table.render({
@@ -21,13 +18,12 @@
         toolbar: '#toolbar',
         cellMinWidth: 50,
         cols: [[
-            {type: 'checkbox', merge: ['locNo$']}
+            {type: 'checkbox'}
+            ,{field: 'locNo$', align: 'center',title: '搴撲綅鍙�', merge:true}//,event: 'locNo', style: 'cursor:pointer'
 //            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
-            ,{field: 'locNo$', merge: true, align: 'center',title: '搴撲綅鍙�'}
             ,{field: 'billNo', align: 'center',title: '鍗曟嵁缂栧彿'}
             ,{field: 'seqNo', align: 'center',title: '搴忓彿'}
             ,{field: 'billType$', align: 'center',title: '鍗曟嵁绫诲瀷', hide: true}
-
             ,{field: 'zpallet', align: 'center',title: '鎵樼洏鍙�'}
             ,{field: 'matNo', align: 'center',title: '鐗╂枡缂栫爜'}
             ,{field: 'matName', align: 'center',title: '鐗╂枡鍚嶇О'}
@@ -37,10 +33,10 @@
             ,{field: 'ioStatus$', align: 'center',title: '瀹屾垚鐘舵��'}
             ,{field: 'ioTime$', align: 'center',title: '瀹屾垚鏃堕棿'}
             ,{field: 'verifyStatus$', align: 'center',title: '瀹℃牳鐘舵��'}
-            ,{field: 'verifyUser$', align: 'center',title: '瀹℃牳浜哄憳', hide: true}
-            ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳', hide: true}
+            ,{field: 'verifyUser$', align: 'center',title: '瀹℃牳浜哄憳',event: 'verifyUser', style: 'cursor:pointer', hide: true}
+            ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳',event: 'modiUser', style: 'cursor:pointer', hide: true}
             ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿', hide: true}
-            ,{field: 'appeUser$', align: 'center',title: '寤烘。浜哄憳', hide: true}
+            ,{field: 'appeUser$', align: 'center',title: '寤烘。浜哄憳',event: 'appeUser', style: 'cursor:pointer', hide: true}
             ,{field: 'appeTime$', align: 'center',title: '寤烘。鏃堕棿', hide: true}
             ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
         ]],
@@ -60,20 +56,22 @@
             statusCode: 200
         },
         done: function(res, curr, count) {
-            tableMerge.render(this);
             if (res.code === 403) {
                 top.location.href = baseUrl+"/";
             }
             pageCurr=curr;
             limit();
-            form.on('checkbox(tableCheckbox)', function (data) {
-                var _index = $(data.elem).attr('table-index')||0;
-                if(data.elem.checked){
-                    res.data[_index][data.value] = 'Y';
-                }else{
-                    res.data[_index][data.value] = 'N';
-                }
-            });
+            // form.on('checkbox(tableCheckbox)', function (data) {
+            //     var _index = $(data.elem).attr('table-index')||0;
+            //     if(data.elem.checked){
+            //         res.data[_index][data.value] = 'Y';
+            //     }else{
+            //         res.data[_index][data.value] = 'N';
+            //     }
+            // });
+            // $('.layui-form-checkbox').css("pointer-events", "none");
+            // $('td[data-field="0').css("cursor", "pointer")
+            merge(res);//璋冪敤
         }
     });
 
@@ -105,18 +103,50 @@
         var checkStatus = table.checkStatus(obj.config.id);
         switch(obj.event) {
             case 'addData':
-                layer.open({
-                    type: 2,
-                    title: '鏂板',
-                    maxmin: true,
-                    area: [top.detailWidth, top.detailHeight],
-                    content: 'waitMatchk_detail.html',
-                    success: function(layero, index){
-                        layer.getChildFrame('#data-detail-submit-edit', index).hide();
-                    	clearFormVal(layer.getChildFrame('#detail', index));
-                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
+                var data = checkStatus.data;
+
+                for(var i=0;i<data.length;i++){
+                    if (data[i].verifyStatus === 1) {
+                        layer.msg('鏁版嵁鐘舵�佸凡瀹�');
+                        return;
                     }
-                });
+                }
+
+                if (data.length === 0){
+                    layer.msg('璇烽�夋嫨鏁版嵁');
+                } else {
+                    layer.confirm('纭畾瀹℃牳'+(data.length===1?'姝�':data.length)+'鏉℃暟鎹悧', function(){
+                        $.ajax({
+                            url: baseUrl+"/waitMatchk/verify/auth",
+                            headers: {'token': localStorage.getItem('token')},
+                            data: {param: JSON.stringify(data)},
+                            method: 'POST',
+                            traditional:true,
+                            success: function (res) {
+                                if (res.code === 200){
+                                    layer.closeAll();
+                                    tableReload(false);
+                                } else if (res.code === 403){
+                                    top.location.href = baseUrl+"/";
+                                } else {
+                                    layer.msg(res.msg)
+                                }
+                            }
+                        })
+                    });
+                }
+                // layer.open({
+                //     type: 2,
+                //     title: '鏂板',
+                //     maxmin: true,
+                //     area: [top.detailWidth, top.detailHeight],
+                //     content: 'waitMatchk_detail.html',
+                //     success: function(layero, index){
+                //         layer.getChildFrame('#data-detail-submit-edit', index).hide();
+                //     	clearFormVal(layer.getChildFrame('#detail', index));
+                //         layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
+                //     }
+                // });
                 break;
             case 'deleteData':
                 var data = checkStatus.data;
@@ -184,6 +214,37 @@
                 break;
         }
     });
+
+    function merge(res) {
+        var data = res.data;
+        var mergeIndex = 0;//瀹氫綅闇�瑕佹坊鍔犲悎骞跺睘鎬х殑琛屾暟
+        var mark = 1; //杩欓噷娑夊強鍒扮畝鍗曠殑杩愮畻锛宮ark鏄绠楁瘡娆¢渶瑕佸悎骞剁殑鏍煎瓙鏁�
+        var columsName = ['', 'locNo\\$'];//闇�瑕佸悎骞剁殑鍒楀悕绉�
+        var columsIndex = [0, 1];//闇�瑕佸悎骞剁殑鍒楃储寮曞��
+
+        for (var k = 0; k < columsName.length; k++) { //杩欓噷寰幆鎵�鏈夎鍚堝苟鐨勫垪
+            var trArr = $(".layui-table-body>.layui-table").find("tr");//鎵�鏈夎
+            for (var i = 1; i < res.data.length; i++) { //杩欓噷寰幆琛ㄦ牸褰撳墠鐨勬暟鎹�
+                var tdCurArr = trArr.eq(i).find("td").eq(columsIndex[k]);//鑾峰彇褰撳墠琛岀殑褰撳墠鍒�
+                var tdPreArr = trArr.eq(mergeIndex).find("td").eq(columsIndex[k]);//鑾峰彇鐩稿悓鍒楃殑绗竴鍒�
+
+                if (data[i][columsName[k]] === data[i - 1][columsName[k]]) { //鍚庝竴琛岀殑鍊间笌鍓嶄竴琛岀殑鍊煎仛姣旇緝锛岀浉鍚屽氨闇�瑕佸悎骞�
+                    mark += 1;
+                    tdPreArr.each(function () {//鐩稿悓鍒楃殑绗竴鍒楀鍔爎owspan灞炴��
+                        $(this).attr("rowspan", mark);
+                    });
+                    tdCurArr.each(function () {//褰撳墠琛岄殣钘�
+                        $(this).css("display", "none");
+                    });
+                } else {
+                    mergeIndex = i;
+                    mark = 1;//涓�鏃﹀墠鍚庝袱琛岀殑鍊间笉涓�鏍蜂簡锛岄偅涔堥渶瑕佸悎骞剁殑鏍煎瓙鏁癿ark灏遍渶瑕侀噸鏂拌绠�
+                }
+            }
+            mergeIndex = 0;
+            mark = 1;
+        }
+    }
 
     /* 寮圭獥 - 鏂板銆佷慨鏀� */
     function showEditModel(mData) {
@@ -398,6 +459,20 @@
 
 });
 
+// var b = true;
+// $(function(){
+//     $(document.body).on('click','td[data-field="0"]',function(){
+//         var locNo = $(this).next().children("div").html();
+//         if (b) {
+//             b = false;
+//             $("tr td[data-field=locNo\\$] div:contains("+ locNo +")").parent().prev().children().children("div").click();
+//             setTimeout(function () {
+//                 b = true;
+//             }, 200)
+//         }
+//     });
+// })
+
 // 鍏抽棴鍔ㄤ綔
 $(document).on('click','#data-detail-close', function () {
     parent.layer.closeAll();
@@ -428,6 +503,8 @@
                 pageCurr -= 1;
             }
             limit(child);
+            // $('.layui-form-checkbox').css("pointer-events", "none");
+            // $('td[data-field="0').css("cursor", "pointer")
         }
     });
 }
diff --git a/src/main/webapp/static/js/waitMatchkLog/waitMatchkLog.js b/src/main/webapp/static/js/waitMatchkLog/waitMatchkLog.js
index 57b5a2c..0defef6 100644
--- a/src/main/webapp/static/js/waitMatchkLog/waitMatchkLog.js
+++ b/src/main/webapp/static/js/waitMatchkLog/waitMatchkLog.js
@@ -39,7 +39,7 @@
             ,{field: 'appeUser$', align: 'center',title: '寤烘。浜哄憳',event: 'appeUser', style: 'cursor:pointer',hide:true}
             ,{field: 'appeTime$', align: 'center',title: '寤烘。鏃堕棿',hide:true}
 
-            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
+            // ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
         ]],
         request: {
             pageName: 'curr',
diff --git a/src/main/webapp/static/js/waitMatin/waitMatin.js b/src/main/webapp/static/js/waitMatin/waitMatin.js
index 0c9fd90..2bfd66a 100644
--- a/src/main/webapp/static/js/waitMatin/waitMatin.js
+++ b/src/main/webapp/static/js/waitMatin/waitMatin.js
@@ -73,7 +73,7 @@
             layer.open({
                 type: 1,
                 title: false,
-                area: '630px',
+                area: '800px',
                 offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'],
                 shade: .01,
                 shadeClose: true,
@@ -98,7 +98,10 @@
                                 field: 'createTime$', title: '鍒涘缓鏃堕棿', sort: true, templet: function (d) {
                                     return util.toDateString(d.createTime);
                                 },  width: 180
-                            }
+                            },
+                            {field: 'inQty', title: '宸插叆搴撻噺'},
+                            {field: 'color', title: '棰滆壊'},
+                            {field: 'specs', title: '瑙勬牸'}
                         ]],
                         request: {
                             pageName: 'curr',
@@ -127,11 +130,13 @@
 
     // 鏄剧ず琛ㄥ崟寮圭獥
     function showEditModel(expTpe) {
+        var mlist=null
+        var inQtys=[]
         admin.open({
             type: 1,
             title: (expTpe ? '淇敼' : '娣诲姞') + '鍗曟嵁',
             content: $('#editDialog').html(),
-            area: '700px',
+            area: '1300px',
             success: function (layero, dIndex) {
                 $(layero).children('.layui-layer-content').css('overflow', 'visible');
                 var isExpAdd = !expTpe;
@@ -150,14 +155,29 @@
                     var param = [];
                     var nList = admin.util.deepClone(xxDataList);
                     for (var xi = 0; xi < nList.length; xi++) {
-                        if (nList[xi].qty > 0) {
+                        // console.log('宸插叆搴擄細'+nList[xi].inQty)
+                        // console.log('鏃ф暟閲忥細'+inQtys[xi])
+                        // console.log('鏁伴噺锛�'+nList[xi].qty)
+                        if (nList[xi].inQty > 0 && inQtys[xi]!=nList[xi].qty) {
+                            layer.msg("宸插叆搴撴棤娉曚慨鏀�", {icon: 2})
+                            return false;
+                        } else  if (nList[xi].qty > 0) {
                             param.push({
                                 billNo: data.field.billNo,
                                 billType: data.field.billType,
                                 matNo: nList[xi].matNo,
                                 matName: nList[xi].matName,
+                                color: nList[xi].color,
+                                size: nList[xi].size,
+                                specs: nList[xi].specs,
+                                memo: nList[xi].memo,
+                                unit: nList[xi].unit,
                                 qty: nList[xi].qty,
+                                inQty: nList[xi].inQty,
                             })
+                        }else if (nList[xi].qty == 0){
+                            layer.msg('鏄庣粏淇敼鏁伴噺涓嶅悎娉�', {icon: 2});
+                            return false;
                         }
                     }
                     if (param.length === 0) {
@@ -199,10 +219,21 @@
                         {type: 'numbers'},
                         {field: 'matNo', title: '鐗╂枡缂栫爜'},
                         {field: 'matName', title: '鐗╂枡鍚嶇О', width: 160},
+                        {field: 'specs', title: '瑙勬牸', width: 160},
+                        {field: 'color', title: '棰滆壊', width: 160},
+                        {field: 'size', title: '灏哄', width: 160},
                         {field: 'qty', title: '淇敼鏁伴噺', style: 'color: blue;font-weight: bold', edit: true, minWidth: 100, width: 100},
+                        {field: 'inQty', title: '宸插叆搴撻噺',  minWidth: 100, width: 100},
+                        {field: 'unit', title: '鍗曚綅', width: 160},
+                        {field: 'memo', title: '澶囨敞' , edit: true, width: 160},
                         {align: 'center', title: '鎿嶄綔', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80}
                     ]],
                     done: function (res) {
+                        mlist= res.data
+                        for (let i = 0; i < mlist.length; i++) {
+                            var waitIn=mlist[i]
+                            inQtys.push(waitIn.qty)
+                        }
                         $(layero).find('.layui-table-view').css('margin', '0');
                     },
                     size: ''
@@ -250,19 +281,29 @@
                 });
                 // 鏁伴噺淇敼
                 table.on('edit(formSSXMTable)', function (obj) {
-                    let count = Number(obj.value);
-                    if (isNaN(count)) {
-                        layer.msg("璇疯緭鍏ユ暟瀛�");
-                    } else {
-                        if (count > 0) {
-                            for (var i=0;i<xxDataList.length;i++){
-                                if (xxDataList[i]["matNo"] === obj.data.matNo){
-                                    xxDataList[i]["qty"] = count;
-                                    break;
-                                }
+                    if (obj.field=='memo'){
+                    let vle = obj.value;
+                        for (var i=0;i<xxDataList.length;i++) {
+                            if (xxDataList[i]["matNo"] === obj.data.matNo) {
+                                xxDataList[i]["memo"] = vle;
+                                break;
                             }
+                        }
+                    }else if (obj.field=='qty'){
+                        let vle = Number(obj.value);
+                        if (isNaN(vle)) {
+                            layer.msg("璇疯緭鍏ユ暟瀛�");
                         } else {
-                            layer.msg("鏁伴噺蹇呴』澶т簬闆�");
+                            if (vle > 0) {
+                                for (var i=0;i<xxDataList.length;i++) {
+                                    if (xxDataList[i]["matNo"] === obj.data.matNo) {
+                                        xxDataList[i]["qty"] = vle;
+                                        break;
+                                    }
+                                }
+                            } else {
+                                layer.msg("鏁伴噺蹇呴』澶т簬闆�");
+                            }
                         }
                     }
                     insTbSSXM.reload({data: xxDataList});
@@ -306,6 +347,11 @@
                                                     xxDataList.push({
                                                         matNo: mat.matNo,
                                                         matName: mat.matName,
+                                                        color:mat.color,
+                                                        size:mat.size,
+                                                        specs:mat.specs,
+                                                        memo: mat.memo,
+                                                        unit: mat.unit,
                                                         qty: 0.0
                                                     });
                                                     insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
diff --git a/src/main/webapp/static/js/waitMatinLog/waitMatinLog.js b/src/main/webapp/static/js/waitMatinLog/waitMatinLog.js
index 5e0817d..71dfd1f 100644
--- a/src/main/webapp/static/js/waitMatinLog/waitMatinLog.js
+++ b/src/main/webapp/static/js/waitMatinLog/waitMatinLog.js
@@ -41,7 +41,7 @@
             ,{field: 'appeUser$', align: 'center',title: '寤烘。浜哄憳',event: 'appeUser', style: 'cursor:pointer',hide:true}
             ,{field: 'appeTime$', align: 'center',title: '寤烘。鏃堕棿',hide:true}
 
-            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
+            // ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
         ]],
         request: {
             pageName: 'curr',
diff --git a/src/main/webapp/static/js/waitMatout/waitMatout.js b/src/main/webapp/static/js/waitMatout/waitMatout.js
index 2cfa8d7..8025c27 100644
--- a/src/main/webapp/static/js/waitMatout/waitMatout.js
+++ b/src/main/webapp/static/js/waitMatout/waitMatout.js
@@ -1,47 +1,29 @@
-var pageCurr;
 layui.config({
     base: baseUrl + "/static/layui/lay/modules/"
-}).use(['table','laydate', 'form', 'admin'], function(){
-    var table = layui.table;
+}).use(['layer', 'form', 'table', 'util', 'admin', 'xmSelect', 'laydate'], function () {
     var $ = layui.jquery;
     var layer = layui.layer;
-    var layDate = layui.laydate;
     var form = layui.form;
+    var table = layui.table;
+    var util = layui.util;
     var admin = layui.admin;
+    var xmSelect = layui.xmSelect;
+    var layDate = layui.laydate;
 
-    // 鏁版嵁娓叉煋
-    tableIns = table.render({
+    // 娓叉煋琛ㄦ牸
+    var insTb = table.render({
         elem: '#waitMatout',
+        url: baseUrl+'/waitMatout/head/page/auth',
         headers: {token: localStorage.getItem('token')},
-        url: baseUrl+'/waitMatout/list/auth',
         page: true,
-        limit: 16,
-        limits: [16, 30, 50, 100, 200, 500],
-        toolbar: '#toolbar',
-        cellMinWidth: 50,
+        cellMinWidth: 100,
         cols: [[
-            {type: 'checkbox'}
-            ,{field: 'billNo', align: 'center',title: '鍗曟嵁缂栧彿'}
-            ,{field: 'seqNo', align: 'center',title: '搴忓彿'}
-            ,{field: 'billType$', align: 'center',title: '鍗曟嵁绫诲瀷'}
-            ,{field: 'matNo', align: 'center',title: '鐗╂枡缂栫爜'}
-            ,{field: 'matName', align: 'center',title: '鐗╂枡鍚嶇О'}
-            ,{field: 'qty', align: 'center',title: '鏁伴噺'}
-            ,{field: 'specs', align: 'center',title: '瑙勬牸'}
-            ,{field: 'unit', align: 'center',title: '鍗曚綅'}
-            ,{field: 'size', align: 'center',title: '灏哄', hide: true}
-            ,{field: 'color', align: 'center',title: '棰滆壊', hide: true}
-            ,{field: 'weight', align: 'center',title: '鍗曢噸', hide: true}
-            ,{field: 'memo', align: 'center',title: '澶囨敞', hide: true}
-            ,{field: 'outQty', align: 'center',title: '宸插嚭搴撻噺'}
-            ,{field: 'linkErp$', align: 'center',title: 'ERP杩炵嚎'}
-            ,{field: 'ioStatus$', align: 'center',title: '瀹屾垚鐘舵��'}
-            ,{field: 'ioTime$', align: 'center',title: '瀹屾垚鏃堕棿', hide: true}
-            ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳',event: 'modiUser', style: 'cursor:pointer', hide: true}
-            ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿', hide: true}
-            ,{field: 'appeUser$', align: 'center',title: '寤烘。浜哄憳',event: 'appeUser', style: 'cursor:pointer', hide: true}
-            ,{field: 'appeTime$', align: 'center',title: '寤烘。鏃堕棿', hide: true}
-            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
+            {type: 'numbers'},
+            {field: 'billNo', title: '鍗曟嵁缂栧彿', sort: true},
+            {field: 'billType$', align: 'center', title: '绫诲瀷',  minWidth: 160, width: 160},
+            {align: 'center', title: '鏄庣粏', toolbar: '#tbLook', minWidth: 160, width: 160},
+            {field: 'appeTime$', title: '鍒涘缓鏃堕棿', minWidth: 200, width: 200},
+            {align: 'center', title: '鎿嶄綔', toolbar: '#operate', minWidth: 130, width: 130}
         ]],
         request: {
             pageName: 'curr',
@@ -58,124 +40,167 @@
         response: {
             statusCode: 200
         },
-        done: function(res, curr, count) {
+        done: function (res, curr, count) {
             if (res.code === 403) {
                 top.location.href = baseUrl+"/";
             }
-            pageCurr=curr;
-            limit();
         }
     });
 
-    // 鐩戝惉鎺掑簭浜嬩欢
-    table.on('sort(waitMatout)', function (obj) {
-        var searchData = {};
-        $.each($('#search-box [name]').serializeArray(), function() {
-            searchData[this.name] = this.value;
-        });
-        searchData['orderByField'] = obj.field;
-        searchData['orderByType'] = obj.type;
-        tableIns.reload({
-            where: searchData,
-            page: {curr: 1}
-        });
+    // 鎼滅储
+    form.on('submit(waitMatoutSearch)', function (data) {
+        insTb.reload({where: data.field, page: {curr: 1}});
     });
 
-    // 鐩戝惉澶村伐鍏锋爮浜嬩欢
-    table.on('toolbar(waitMatout)', function (obj) {
-        var checkStatus = table.checkStatus(obj.config.id).data;
-        switch(obj.event) {
-            case 'addData':
-                showEditModel();
-                break;
-            case 'deleteData':
-               if (checkStatus.length === 0) {
-                   layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
-                   return;
-               }
-               var ids = checkStatus.map(function (d) {
-                   return d.seqNo;
-               });
-               del(ids);
-               break;
-            case 'exportData':
-                layer.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
-                    var titles=[];
-                    var fields=[];
-                    obj.config.cols[0].map(function (col) {
-                        if (col.type === 'normal' && col.hide === false && col.toolbar == null) {
-                            titles.push(col.title);
-                            fields.push(col.field);
+    // 娣诲姞
+    $("#waitMatoutAddBtn").click(function () {
+        showEditModel();
+    });
+
+    // 宸ュ叿鏉$偣鍑讳簨浠�
+    table.on('tool(waitMatout)', function (obj) {
+        var data = obj.data;
+        var layEvent = obj.event;
+        var checkStatus = table.checkStatus(obj.config);
+        if (layEvent === 'edit') {
+            showEditModel(data);
+        } else if (layEvent === 'del') {
+            doDel(data.billNo);
+        } else if (layEvent === 'look') {
+            var $a = $(obj.tr).find('a[lay-event="look"]');
+            var offset = $a.offset();
+            var top = offset.top;
+            var left = offset.left;
+            layer.open({
+                type: 1,
+                title: false,
+                area: '800px',
+                offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'],
+                shade: .01,
+                shadeClose: true,
+                fixed: false,
+                content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>',
+                success: function (layero) {
+                    table.render({
+                        elem: '#lookSSXMTable',
+                        headers: {token: localStorage.getItem('token')},
+                        url: baseUrl+'/waitMatout/list/auth',
+                        where: {
+                            bill_no: data.billNo
+                        },
+                        page: true,
+                        cellMinWidth: 100,
+                        cols: [[
+                            {type: 'numbers'},
+                            {field: 'matNo', title: '鐗╂枡缂栫爜'},
+                            {field: 'matName', title: '鐗╂枡鍚嶇О', width: 160},
+                            {field: 'qty', title: '鏁伴噺', width: 90},
+                            {
+                                field: 'createTime$', title: '鍒涘缓鏃堕棿', sort: true, templet: function (d) {
+                                    return util.toDateString(d.createTime);
+                                },  width: 180
+                            },
+                            {field: 'outqty', title: '宸插嚭搴撻噺'},
+                            {field: 'color', title: '棰滆壊'},
+                            {field: 'specs', title: '瑙勬牸'},
+                        ]],
+                        request: {
+                            pageName: 'curr',
+                            pageSize: 'limit'
+                        },
+                        parseData: function (res) {
+                            return {
+                                'code': res.code,
+                                'msg': res.msg,
+                                'count': res.data.total,
+                                'data': res.data.records
+
+                            }
+                        },
+                        response: {
+                            statusCode: 200
+                        },
+                        done: function () {
+                            $(layero).find('.layui-table-view').css('margin', '0');
+                        },
+                        size: ''
+                    });
+                }
+            });
+        }
+    });
+
+    // 鏄剧ず琛ㄥ崟寮圭獥
+    function showEditModel(expTpe) {
+
+
+        var mlist=null
+        var oldQtys=[]
+        admin.open({
+            type: 1,
+            title: (expTpe ? '淇敼' : '娣诲姞') + '鍗曟嵁',
+            content: $('#editDialog').html(),
+            area: '1300px',
+            success: function (layero, dIndex) {
+                $(layero).children('.layui-layer-content').css('overflow', 'visible');
+                var isExpAdd = !expTpe;
+                // 鍥炴樉鏁版嵁
+                form.val('editForm', expTpe);
+                if (expTpe) {
+                    $('#billNo').attr("disabled", "disabled");
+                }
+                // 琛ㄥ崟鎻愪氦浜嬩欢
+                form.on('submit(waitMatoutEditSubmit)', function (data) {
+                    // 缁勮鏁版嵁
+                    if (xxDataList.length <= 0) {
+                        layer.tips('璇锋坊鍔犲崟鎹槑缁�', '#matAddBtnComment', {tips: [1, '#ff4c4c']});
+                        return false;
+                    }
+                    var param = [];
+                    var nList = admin.util.deepClone(xxDataList);
+                    for (var xi = 0; xi < nList.length; xi++) {
+                        // console.log('宸插嚭搴擄細'+nList[xi].outQty)
+                        // console.log('鏃ф暟閲忥細'+oldQtys[xi])
+                        // console.log('鏁伴噺锛�'+nList[xi].qty)
+                        if (nList[xi].outQty > 0 && oldQtys[xi]!=nList[xi].qty) {
+                            layer.msg("宸插嚭搴撴棤娉曚慨鏀�", {icon: 2})
+                            return false;
+                        } else if (nList[xi].qty > 0) {
+                            param.push({
+                                billNo: data.field.billNo,
+                                billType: data.field.billType,
+                                matNo: nList[xi].matNo,
+                                matName: nList[xi].matName,
+                                color: nList[xi].color,
+                                size: nList[xi].size,
+                                specs: nList[xi].specs,
+                                memo: nList[xi].memo,
+                                unit: nList[xi].unit,
+                                outQty: nList[xi].outQty,
+                                qty: nList[xi].qty,
+                            })
+                        }else if (nList[xi].qty == 0){
+                            layer.msg('鏄庣粏淇敼鏁伴噺涓嶅悎娉�', {icon: 2});
+                            return false;
                         }
-                    });
-                    var exportData = {};
-                    $.each($('#search-box [name]').serializeArray(), function() {
-                        exportData[this.name] = this.value;
-                    });
-                    var param = {
-                        'waitMatout': exportData,
-                        'fields': fields
-                    };
+                    }
+                    if (param.length === 0) {
+                        layer.msg('鍗曟嵁鏄庣粏鏁伴噺涓嶅悎娉�', {icon: 2});
+                        return false;
+                    }
+                    layer.load(2);
                     $.ajax({
-                        url: baseUrl+"/waitMatout/export/auth",
+                        url: baseUrl+"/waitMatout/" + (isExpAdd?"add":"modify") + "/auth",
                         headers: {'token': localStorage.getItem('token')},
                         data: JSON.stringify(param),
-                        dataType:'json',
                         contentType:'application/json;charset=UTF-8',
                         method: 'POST',
                         success: function (res) {
-                            layer.closeAll();
-                            if (res.code === 200) {
-                                table.exportFile(titles,res.data,'xls');
-                            } else if (res.code === 403) {
-                                top.location.href = baseUrl+"/";
-                            } else {
-                                layer.msg(res.msg, {icon: 2})
-                            }
-                        }
-                    });
-                });
-                break;
-        }
-    });
-
-    // 鐩戝惉琛屽伐鍏蜂簨浠�
-    table.on('tool(waitMatout)', function(obj){
-        var data = obj.data;
-        switch (obj.event) {
-            case 'edit':
-                showEditModel(data);
-                break;
-            case "del":
-                var ids = [data.seqNo];
-                del(ids);
-                break;
-        }
-    });
-
-    /* 寮圭獥 - 鏂板銆佷慨鏀� */
-    function showEditModel(mData) {
-        admin.open({
-            type: 1,
-            area: '600px',
-            title: (mData ? '淇敼' : '娣诲姞') + '璁㈠崟鐘舵��',
-            content: $('#editDialog').html(),
-            success: function (layero, dIndex) {
-                layDateRender();
-                form.val('detail', mData);
-                form.on('submit(editSubmit)', function (data) {
-                    var loadIndex = layer.load(2);
-                    $.ajax({
-                        url: baseUrl+"/waitMatout/"+(mData?'update':'add')+"/auth",
-                        headers: {'token': localStorage.getItem('token')},
-                        data: data.field,
-                        method: 'POST',
-                        success: function (res) {
-                            layer.close(loadIndex);
+                            layer.closeAll('loading');
                             if (res.code === 200){
                                 layer.close(dIndex);
+                                insTb.reload({page: {curr: 1}});
                                 layer.msg(res.msg, {icon: 1});
-                                tableReload();
                             } else if (res.code === 403){
                                 top.location.href = baseUrl+"/";
                             }else {
@@ -185,33 +210,235 @@
                     })
                     return false;
                 });
-                $(layero).children('.layui-layer-content').css('overflow', 'visible');
-                layui.form.render('select');
+                // 鏄庣粏琛ㄦ牸
+                var xxDataList = [];
+                var tbOptions = {
+                    elem: '#formSSXMTable',
+                    headers: {token: localStorage.getItem('token')},
+                    data: xxDataList,
+                    page: true,
+                    height: '350px;',
+                    cellMinWidth: 100,
+                    cols: [[
+                        {type: 'numbers'},
+                        {field: 'matNo', title: '鐗╂枡缂栫爜'},
+                        {field: 'matName', title: '鐗╂枡鍚嶇О', width: 160},
+                        {field: 'specs', title: '瑙勬牸', width: 160},
+                        {field: 'color', title: '棰滆壊', width: 160},
+                        {field: 'size', title: '灏哄', width: 160},
+                        {field: 'qty', title: '淇敼鏁伴噺', style: 'color: blue;font-weight: bold', edit: true, minWidth: 100, width: 100},
+                        {field: 'unit', title: '鍗曚綅', width: 160},
+                        {field: 'memo', title: '澶囨敞' , edit: true, width: 160},
+                        {field: 'outQty', title: '宸插嚭搴撻噺' , width: 160},
+                        {align: 'center', title: '鎿嶄綔', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80}
+                    ]],
+                    done: function (res) {
+                        mlist= res.data
+                        for (let i = 0; i < mlist.length; i++) {
+                            var waitOut=mlist[i]
+                            oldQtys.push(waitOut.qty)
+                        }
+                        $(layero).find('.layui-table-view').css('margin', '0');
+                    },
+                    size: ''
+                };
+                if (!isExpAdd) {
+                    $.ajax({
+                        url: baseUrl+"/waitMatout/detl/list/auth?billNo=" + expTpe.billNo,
+                        headers: {'token': localStorage.getItem('token')},
+                        method: 'GET',
+                        async: false,
+                        success: function (res) {
+                            if (res.code === 200){
+                                xxDataList = res.data;
+                                tbOptions.data = xxDataList;
+                            } else if (res.code === 403){
+                                top.location.href = baseUrl+"/";
+                            }else {
+                                layer.msg(res.msg, {icon: 2})
+                            }
+                        }
+                    })
+                }
+                var insTbSSXM = table.render(tbOptions);
+                // 宸ュ叿鏉$偣鍑讳簨浠�
+                table.on('tool(formSSXMTable)', function (obj) {
+                    var data = obj.data;
+                    var layEvent = obj.event;
+                    if (layEvent === 'edit') {
+                        showEditModel2(data);
+                    } else if (layEvent === 'del') {
+                        layer.confirm('纭畾瑕佸垹闄ゅ悧锛�', {
+                            shade: .1,
+                            skin: 'layui-layer-admin'
+                        }, function (i) {
+                            layer.close(i);
+                            for (var j = 0; j < xxDataList.length; j++) {
+                                if (xxDataList[j].matNo === data.matNo) {
+                                    xxDataList.splice(j, 1);
+                                    break;
+                                }
+                            }
+                            insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
+                        });
+                    }
+                });
+                // 鏁伴噺淇敼
+                table.on('edit(formSSXMTable)', function (obj) {
+                    if (obj.field=='memo'){
+                        let vle = obj.value;
+                        for (var i=0;i<xxDataList.length;i++) {
+                            if (xxDataList[i]["matNo"] === obj.data.matNo) {
+                                xxDataList[i]["memo"] = vle;
+                                break;
+                            }
+                        }
+                    }else if (obj.field=='qty'){
+                        let vle = Number(obj.value);
+                        if (isNaN(vle)) {
+                            layer.msg("璇疯緭鍏ユ暟瀛�");
+                        } else {
+                            if (vle > 0) {
+                                for (var i=0;i<xxDataList.length;i++) {
+                                    if (xxDataList[i]["matNo"] === obj.data.matNo) {
+                                        xxDataList[i]["qty"] = vle;
+                                        break;
+                                    }
+                                }
+                            } else {
+                                layer.msg("鏁伴噺蹇呴』澶т簬闆�");
+                            }
+                        }
+                    }
+
+                    insTbSSXM.reload({data: xxDataList});
+                });
+                //
+                $('#matAddBtnComment').click(function () {
+                    showEditModel2();
+                });
+
+                // 鏄剧ず娣诲姞鏄庣粏琛ㄥ崟寮圭獥
+                function showEditModel2(exp) {
+                    admin.open({
+                        type: 1,
+                        offset: '150px',
+                        area: '480px',
+                        title: (exp ? '淇敼' : '娣诲姞') + '鏄庣粏',
+                        content: $('#matEditDialog').html(),
+                        success: function (layero, dIndex) {
+                            $(layero).children('.layui-layer-content').css('overflow', 'visible');
+                            // 鍥炴樉鏁版嵁
+                            form.val('matEditForm', exp);
+                            // 琛ㄥ崟鎻愪氦浜嬩欢
+                            form.on('submit(matEditSubmit)', function (data) {
+                                var existMats = [];
+                                xxDataList.forEach(function(elem) {
+                                    existMats.push(elem.matNo);
+                                });
+                                var selectList = matXmSelect.getValue();
+                                for (var i = 0; i<selectList.length; i++) {
+                                    var item = selectList[i];
+                                    if (existMats.indexOf(item.value) === -1) {
+                                        // 鏌ヨ鐗╂枡璇︽儏
+                                        $.ajax({
+                                            url: baseUrl+"/matCode/"+item.value+"/auth",
+                                            headers: {'token': localStorage.getItem('token')},
+                                            method: 'GET',
+                                            async: false,
+                                            success: function (res) {
+                                                if (res.code === 200){
+                                                    var mat = res.data;
+                                                    xxDataList.push({
+                                                        matNo: mat.matNo,
+                                                        matName: mat.matName,
+                                                        color:mat.color,
+                                                        size:mat.size,
+                                                        specs:mat.specs,
+                                                        memo: mat.memo,
+                                                        unit: mat.unit,
+                                                        outQty: mat.outQty,
+                                                        qty: 0.0
+                                                    });
+                                                    insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
+                                                } else if (res.code === 403){
+                                                    top.location.href = baseUrl+"/";
+                                                }else {
+                                                    layer.msg(res.msg, {icon: 2})
+                                                }
+                                            }
+                                        })
+                                    }
+                                }
+                                layer.close(dIndex);
+                                return false;
+                            });
+                            // 娓叉煋鐗╂枡閫夋嫨
+                            var matXmSelect = xmSelect.render({
+                                el: '#mat',
+                                style: {
+                                    width: '340px',
+                                },
+                                autoRow: true,
+                                toolbar: { show: true },
+                                filterable: true,
+                                remoteSearch: true,
+                                remoteMethod: function(val, cb, show){
+                                    $.ajax({
+                                        url: baseUrl+"/mat/all/get/kv",
+                                        headers: {'token': localStorage.getItem('token')},
+                                        data: {
+                                            condition: val
+                                        },
+                                        method: 'POST',
+                                        success: function (res) {
+                                            if (res.code === 200){
+                                                cb(res.data)
+                                            } else {
+                                                cb([]);
+                                                layer.msg(res.msg, {icon: 2});
+                                            }
+                                        }
+                                    });
+                                }
+                            })
+                            // 寮圭獥涓嶅嚭鐜版粴鍔ㄦ潯
+                            $(layero).children('.layui-layer-content').css('overflow', 'visible');
+                            layui.form.render('select');
+                        }
+                    });
+                }
+
             }
         });
     }
 
-    /* 鍒犻櫎 */
-    function del(ids) {
-        layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', {
-            skin: 'layui-layer-admin',
-            shade: .1
+
+    // 鍒犻櫎鍗曟嵁
+    function doDel(billNo) {
+        layer.confirm('纭畾瑕佸垹闄ゅ悧锛�', {
+            shade: .1,
+            skin: 'layui-layer-admin'
         }, function (i) {
             layer.close(i);
-            var loadIndex = layer.load(2);
+            layer.load(2);
+
             $.ajax({
                 url: baseUrl+"/waitMatout/delete/auth",
                 headers: {'token': localStorage.getItem('token')},
-                data: {ids: ids},
+                data: {
+                    billNo: billNo
+                },
+                // contentType:'application/json;charset=UTF-8',
                 method: 'POST',
                 success: function (res) {
-                    layer.close(loadIndex);
+                    layer.closeAll('loading');
                     if (res.code === 200){
+                        insTb.reload({page: {curr: 1}});
                         layer.msg(res.msg, {icon: 1});
-                        tableReload();
                     } else if (res.code === 403){
                         top.location.href = baseUrl+"/";
-                    } else {
+                    }else {
                         layer.msg(res.msg, {icon: 2});
                     }
                 }
@@ -219,55 +446,9 @@
         });
     }
 
-    // 鎼滅储
-    form.on('submit(search)', function (data) {
-        pageCurr = 1;
-        tableReload(false);
+    layDate.render({
+        elem: '.layui-laydate-range'
+        ,type: 'datetime'
+        ,range: true
     });
-
-    // 閲嶇疆
-    form.on('submit(reset)', function (data) {
-        pageCurr = 1;
-        clearFormVal($('#search-box'));
-        tableReload(false);
-    });
-
-    // 鏃堕棿閫夋嫨鍣�
-    function layDateRender() {
-        layDate.render({
-        elem: '#ioTime\\$',
-        type: 'datetime'
-        });
-        layDate.render({
-        elem: '#modiTime\\$',
-        type: 'datetime'
-        });
-        layDate.render({
-        elem: '#appeTime\\$',
-        type: 'datetime'
-        });
-        layDate.render({
-            elem: '.layui-laydate-range'
-            ,type: 'datetime'
-            ,range: true
-        });
-    }
-    layDateRender();
-
-});
-
-// 鍏抽棴鍔ㄤ綔
-$(document).on('click','#data-detail-close', function () {
-    parent.layer.closeAll();
-});
-
-function tableReload(child) {
-    var searchData = {};
-    $.each($('#search-box [name]').serializeArray(), function() {
-        searchData[this.name] = this.value;
-    });
-    tableIns.reload({
-        where: searchData,
-        page: {curr: pageCurr}
-     });
-}
+});
\ No newline at end of file
diff --git a/src/main/webapp/static/js/waitMatoutLog/waitMatoutLog.js b/src/main/webapp/static/js/waitMatoutLog/waitMatoutLog.js
index 1322500..a75c6f1 100644
--- a/src/main/webapp/static/js/waitMatoutLog/waitMatoutLog.js
+++ b/src/main/webapp/static/js/waitMatoutLog/waitMatoutLog.js
@@ -41,7 +41,7 @@
             ,{field: 'appeUser$', align: 'center',title: '寤烘。浜哄憳',event: 'appeUser', style: 'cursor:pointer',hide:true}
             ,{field: 'appeTime$', align: 'center',title: '寤烘。鏃堕棿',hide:true}
 
-            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
+            // ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
         ]],
         request: {
             pageName: 'curr',
diff --git a/src/main/webapp/static/js/wrkDetl/wrkDetl.js b/src/main/webapp/static/js/wrkDetl/wrkDetl.js
index 9aad5bf..dc0ee9a 100644
--- a/src/main/webapp/static/js/wrkDetl/wrkDetl.js
+++ b/src/main/webapp/static/js/wrkDetl/wrkDetl.js
@@ -37,6 +37,7 @@
             pageSize: 'limit'
         },
         parseData: function (res) {
+            console.log(res)
             return {
                 'code': res.code,
                 'msg': res.msg,
@@ -322,7 +323,7 @@
 //            id: $('#id').val(),
             wrkNo: $('#wrkNo').val(),
             ioTime: top.strToDate($('#ioTime\\$').val()),
-            matnr: $('#matnr').val(),
+            matNo: $('#matNo').val(),
             lgnum: $('#lgnum').val(),
             tbnum: $('#tbnum').val(),
             tbpos: $('#tbpos').val(),
diff --git a/src/main/webapp/static/js/wrkMast/wrkMast.js b/src/main/webapp/static/js/wrkMast/wrkMast.js
index 28dfac5..02566f7 100644
--- a/src/main/webapp/static/js/wrkMast/wrkMast.js
+++ b/src/main/webapp/static/js/wrkMast/wrkMast.js
@@ -575,7 +575,6 @@
                 ,{field: 'zpallet', align: 'center',title: '鎵樼洏鏉$爜'}
                 ,{field: 'bname', align: 'center',title: '鐢ㄦ埛ID'}
                 ,{field: 'memo', align: 'center',title: '澶囨敞'}
-
                 ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:50}
             ]],
             request: {
diff --git a/src/main/webapp/views/adjDetl/adjDetl.html b/src/main/webapp/views/adjDetl/adjDetl.html
index db35ef2..7d119ce 100644
--- a/src/main/webapp/views/adjDetl/adjDetl.html
+++ b/src/main/webapp/views/adjDetl/adjDetl.html
@@ -30,11 +30,11 @@
             <input class="layui-input layui-laydate-range" name="modi_time" type="text" placeholder="璧峰鏃堕棿 - 缁堟鏃堕棿" autocomplete="off" style="width: 300px">
         </div>
     </div>
-    <div class="layui-inline">
-        <div class="layui-input-inline">
-            <input class="layui-input" type="text" name="condition" placeholder="璇疯緭鍏�" autocomplete="off">
-        </div>
-    </div>
+<!--    <div class="layui-inline">-->
+<!--        <div class="layui-input-inline">-->
+<!--            <input class="layui-input" type="text" name="condition" placeholder="璇疯緭鍏�" autocomplete="off">-->
+<!--        </div>-->
+<!--    </div>-->
     <!-- 寰呮坊鍔� -->
     <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block">
         <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">鎼滅储</button>
diff --git a/src/main/webapp/views/ioCompleteLog/ioCompleteLog.html b/src/main/webapp/views/ioCompleteLog/ioCompleteLog.html
index c887ae7..05cb885 100644
--- a/src/main/webapp/views/ioCompleteLog/ioCompleteLog.html
+++ b/src/main/webapp/views/ioCompleteLog/ioCompleteLog.html
@@ -16,7 +16,7 @@
 <div id="search-box" class="layui-form layui-card-header">
     <div class="layui-inline">
         <div class="layui-input-inline">
-            <input class="layui-input" type="text" name="id" placeholder="缂栧彿" autocomplete="off">
+            <input class="layui-input" type="text" name="condition" placeholder="璇疯緭鍏�" autocomplete="off">
         </div>
     </div>
     <div class="layui-inline">
@@ -66,15 +66,15 @@
 </div>
 <script type="text/html" id="toolbar">
     <div class="layui-btn-container">
-        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>
-        <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>
-        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">瀵煎嚭</button>
+<!--        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>-->
+<!--        <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>-->
+        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="margin-top: 10px">瀵煎嚭</button>
     </div>
 </script>
 
 <script type="text/html" id="operate">
-    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">璇︽儏</a>
-    <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a>
+<!--    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">璇︽儏</a>-->
+<!--    <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a>-->
 </script>
 
 <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
diff --git a/src/main/webapp/views/locMast/locMast.html b/src/main/webapp/views/locMast/locMast.html
index b736512..f2f18c0 100644
--- a/src/main/webapp/views/locMast/locMast.html
+++ b/src/main/webapp/views/locMast/locMast.html
@@ -29,11 +29,31 @@
             <input class="layui-input" type="text" name="loc_no" placeholder="搴撲綅鍙�" autocomplete="off">
         </div>
     </div>
+
     <div class="layui-inline">
-        <div class="layui-input-inline">
-            <input class="layui-input" type="text" name="loc_sts" placeholder="搴撲綅鐘舵��" autocomplete="off">
+        <div class="layui-input-inline cool-auto-complete">
+            <input id="locSts" name="loc_sts" class="layui-input" type="text"  style="display: none">
+            <input id="locSts$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="搴撲綅鐘舵��" onfocus=this.blur()>
+            <div class="cool-auto-complete-window">
+                <input class="cool-auto-complete-window-input" data-key="locStacQueryBylocSts" onkeyup="autoLoad2(this.getAttribute('data-key'))">
+                <select class="cool-auto-complete-window-select" data-key="locStacQueryBylocStsSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">
+                </select>
+            </div>
         </div>
     </div>
+
+<!--    <div class="layui-inline">-->
+<!--        <div class="layui-input-inline">-->
+<!--            <input class="layui-input" type="text" name="loc_sts" placeholder="搴撲綅鐘舵��" autocomplete="off">-->
+<!--        </div>-->
+<!--    </div>-->
+
+    <div class="layui-inline">
+        <div class="layui-input-inline">
+            <input class="layui-input" type="text" name="crn_no" placeholder="鍫嗗灈鏈哄彿" autocomplete="off">
+        </div>
+    </div>
+
     <div class="layui-inline">
         <div class="layui-input-inline">
             <input class="layui-input" type="text" name="row1" placeholder="鎺�" autocomplete="off">
@@ -53,6 +73,13 @@
     <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block">
         <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">鎼滅储</button>
         <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">閲嶇疆</button>
+    </div>
+</div>
+
+<!-- 瑙e喅娴忚鍣ㄨ嚜鍔ㄥ~鍏呭瘑鐮侀棶棰橈紝鏂板涓�涓殣钘忚緭鍏ユ -->
+<div class="layui-inline">
+    <div class="layui-input-inline">
+        <input class="layui-input" type="text" style="width:10px;opacity: 0;position: absolute">
     </div>
 </div>
 
@@ -141,28 +168,28 @@
                 </select>
             </div>
         </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label">瀹界獎绫诲瀷</label>
-            <div class="layui-input-inline">
-                <select name="locType2">
-                    <option style="display: none"></option>
-                    <option value="0">鏈煡</option>
-                    <option value="1">绐勫簱浣�</option>
-                    <option value="2">瀹藉簱浣�</option>
-                </select>
-            </div>
-        </div>
-        <div class="layui-form-item">
-            <label class="layui-form-label">杞婚噸绫诲瀷</label>
-            <div class="layui-input-inline">
-                <select name="locType3">
-                    <option style="display: none"></option>
-                    <option value="0">鏈煡</option>
-                    <option value="1">杞诲簱浣�</option>
-                    <option value="2">閲嶅簱浣�</option>
-                </select>
-            </div>
-        </div>
+<!--        <div class="layui-form-item">-->
+<!--            <label class="layui-form-label">瀹界獎绫诲瀷</label>-->
+<!--            <div class="layui-input-inline">-->
+<!--                <select name="locType2">-->
+<!--                    <option style="display: none"></option>-->
+<!--                    <option value="0">鏈煡</option>-->
+<!--                    <option value="1">绐勫簱浣�</option>-->
+<!--                    <option value="2">瀹藉簱浣�</option>-->
+<!--                </select>-->
+<!--            </div>-->
+<!--        </div>-->
+<!--        <div class="layui-form-item">-->
+<!--            <label class="layui-form-label">杞婚噸绫诲瀷</label>-->
+<!--            <div class="layui-input-inline">-->
+<!--                <select name="locType3">-->
+<!--                    <option style="display: none"></option>-->
+<!--                    <option value="0">鏈煡</option>-->
+<!--                    <option value="1">杞诲簱浣�</option>-->
+<!--                    <option value="2">閲嶅簱浣�</option>-->
+<!--                </select>-->
+<!--            </div>-->
+<!--        </div>-->
         <div id="prompt" style="text-indent: 10px;">
             <span class="not-null">鍒濆鍖栧簱浣嶅悗灏嗗垹闄ゅ簱瀛樻槑缁嗭紝璇疯皑鎱庢搷浣滐紒</span>
         </div>
diff --git a/src/main/webapp/views/locStatis/locStatis.html b/src/main/webapp/views/locStatis/locStatis.html
index fee6ea8..a979181 100644
--- a/src/main/webapp/views/locStatis/locStatis.html
+++ b/src/main/webapp/views/locStatis/locStatis.html
@@ -43,7 +43,8 @@
 </div>
 <script type="text/html" id="toolbar">
     <div class="layui-btn-container">
-        <button class="layui-btn" lay-event="exportAll" style="margin-top: -0px">瀵煎嚭鍏ㄩ儴</button>
+        <button class="layui-btn layui-btn-normal layui-btn-sm" id="refresh-sto" lay-event="syncStok" style="margin-left: 10px">涓婃姤搴撳瓨鍒癊RP</button>
+        <button class="layui-btn layui-btn-primary layui-btn-sm" lay-event="exportAll" style="float: right">瀵煎嚭</button>
     </div>
 </script>
 <script type="text/html" id="operate">
diff --git a/src/main/webapp/views/pda/comb.html b/src/main/webapp/views/pda/comb.html
index 5d0dddb..817e5e8 100644
--- a/src/main/webapp/views/pda/comb.html
+++ b/src/main/webapp/views/pda/comb.html
@@ -19,7 +19,7 @@
 <!-- 澶撮儴 -->
 <header>
     <div class="layui-input-inline">
-        <label class="layui-form-label">鏉$爜</label>
+        <label class="layui-form-label">鎵樼洏鐮�</label>
         <input class="layui-input" type="number" id="code" onkeyup="findCode(this)" oninput="if(value.length>8)value=value.slice(0,8)" placeholder="鎵爜 / 杈撳叆" autocomplete="off">
     </div>
     <div style="margin: 5px 5px">
diff --git a/src/main/webapp/views/pda/combPro.html b/src/main/webapp/views/pda/combPro.html
new file mode 100644
index 0000000..113a633
--- /dev/null
+++ b/src/main/webapp/views/pda/combPro.html
@@ -0,0 +1,415 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
+    <title>缁勬墭</title>
+    <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../static/css/pda.css" media="all">
+    <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
+    <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script>
+    <style>
+        .number-tool {
+            margin-left: 10px;
+            padding: 1px 0 1px 5px;
+            display: inline-block;
+            width: 120px;
+        }
+
+        .number-tool:after {
+            clear: both;
+            content: "";
+            display: table;
+        }
+
+        .number-tool button {
+            background-color: #fff;
+            margin-top: 3px;
+            font-size: 16px;
+            height: 25px;
+            float: left;
+            width: 25px;
+            border: 1px solid #777777;
+        }
+
+        .number-tool input {
+            text-align: center;
+            height: 30px;
+            float: left;
+            margin: 0 5px;
+            width: 50px;
+            padding: 0;
+        }
+
+        #confirm {
+            margin: 10px 10px;
+            padding: 5px 20px;
+            font-weight: 600;
+        }
+
+        #remove {
+            margin: 10px 10px;
+            padding: 5px 20px;
+            color: darkred;
+        }
+
+        .form-box span {
+            font-size: 16px;
+            display: inline-block;
+            text-align: right;
+        }
+
+        .form-box input {
+            width: 165px;
+            padding-left: 5px;
+            height: 30px;
+            border: 1px solid #777777;
+            overflow: hidden;
+            white-space: nowrap;
+            text-overflow: ellipsis;
+        }
+    </style>
+</head>
+<body>
+<!-- 澶撮儴 -->
+<header>
+    <div class="layui-input-inline" style="margin-top: 5px">
+        <label class="layui-form-label" style="margin-left: 16px">鍗曞彿</label>
+        <input class="layui-input" id="billNo" oninput="find(this)" placeholder="鎵爜 / 杈撳叆" autocomplete="off"
+               style="width: 175px; height: 40px; margin-right: 0;">
+    </div>
+    <div class="layui-input-inline">
+        <label class="layui-form-label">鎵樼洏鐮�</label>
+        <input class="layui-input" style="width: 175px;" type="number" id="code" onkeyup="findCode(this)"
+               oninput="if(value.length>8)value=value.slice(0,8)" placeholder="鎵爜 / 杈撳叆" autocomplete="off">
+    </div>
+</header>
+
+<!-- 涓讳綋 -->
+<main>
+    <table class="layui-table" id="chooseData" lay-filter="chooseData"></table>
+</main>
+<!-- 灏鹃儴 -->
+<footer>
+    <div class="layui-btn-container">
+        <!--<button type="button" id="test-btn" class="layui-btn layui-btn-primary" onclick="test()">娴嬭瘯鍏ュ簱</button>-->
+        <!--<button type="button" id="test-btn2" class="layui-btn layui-btn-primary" onclick="test2()">娴嬭瘯鍑哄簱</button>-->
+        <button type="button" id="reset-btn" class="layui-btn layui-btn-primary" onclick="reset()">閲嶇疆</button>
+        <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="comb()"
+                style="margin-left: 20px">缁勬墭
+        </button>
+        <span id="tips"></span>
+    </div>
+</footer>
+
+<!-- 淇敼鏁伴噺寮圭獥 -->
+<div id="modify" style="display: none; text-align: center;padding-top: 10px">
+    <div class="form-box">
+        <div class="form-item">
+            <table style="display: inline">
+                <tr>
+                    <td>
+                        <span style="width: 35px; margin-right: 5px">鐗╂枡</span>
+                    </td>
+                    <td style="text-align: left">
+                        <input id="matNo" type="text" disabled="disabled">
+                    </td>
+                </tr>
+            </table>
+        </div>
+        <div class="form-item">
+            <table style="display: inline">
+                <tr>
+                    <td style="vertical-align: top">
+                        <span style="width: 35px; margin-right: 5px">鍚嶇О</span>
+                    </td>
+                    <td style="text-align: left">
+                    <textarea rows="3" style="resize: none; width: 165px" id="matName" type="text" disabled="disabled"
+                              readonly="readonly"></textarea>
+                    </td>
+                </tr>
+            </table>
+        </div>
+<!--        <div class="form-item">-->
+<!--            <table style="display: inline">-->
+<!--                <tr>-->
+<!--                    <td>-->
+<!--                        <span style="width: 35px; margin-right: 5px">鍗曞彿</span>-->
+<!--                    </td>-->
+<!--                    <td style="text-align: left">-->
+<!--                        <input id="supplier" type="text" disabled="disabled">-->
+<!--                    </td>-->
+<!--                </tr>-->
+<!--            </table>-->
+<!--        </div>-->
+    </div>
+    <div class="form-item" style="margin-top: 5px">
+        <span style="vertical-align: middle">鏁伴噺</span>
+        <div class="number-tool" style="vertical-align: middle">
+            <button onclick="reduce()">-</button>
+            <input id="count" type="number">
+            <button onclick="add()">+</button>
+        </div>
+    </div>
+    <button id="remove" onclick="remove()">绉婚櫎</button>
+    <button id="confirm" onclick="confirm()">淇濆瓨</button>
+</div>
+
+</body>
+<script>
+    window.onload = function () {
+        document.getElementById("billNo").focus();
+    }
+    var tableIns;
+    var countLayer;
+    layui.use(['table', 'laydate', 'form'], function () {
+        var table = layui.table;
+        var $ = layui.jquery;
+        var layer = layui.layer;
+        var form = layui.form;
+
+        tableIns = table.render({
+            elem: '#chooseData',
+            data: [],
+            width: 320,
+            limit: 500,
+            cellMinWidth: 50,
+            cols: [[
+                {
+                    align: 'center',
+                    field: 'count',
+                    title: '鏁伴噺',
+                    event: 'modify',
+                    style: 'cursor: pointer;color: blue',
+                    width: 70
+                },
+                {field: 'matNo', align: 'center', title: '浜у搧缂栫爜', event: 'modify'},
+                {field: 'matName', align: 'center', title: '浜у搧鍚嶇О', event: 'modify'},
+                {field: 'seqNo', align: 'center', title: '搴忓彿', event: 'modify'}
+                // {field: 'color', align: 'center', title: '棰滆壊', event: 'modify',}
+            ]],
+            done: function (res, curr, count) {
+            }
+        });
+
+        // 鐩戝惉琛屽伐鍏蜂簨浠�
+        table.on('tool(chooseData)', function (obj) {
+            var data = obj.data;
+            switch (obj.event) {
+                case 'modify':
+                    countLayer = layer.open({
+                        type: 1,
+                        offset: '20px',
+                        title: '淇敼鏁伴噺',
+                        shadeClose: true,
+                        area: ['80%', '300px'],
+                        content: $("#modify"),
+                        success: function (layero, index) {
+                            $('#matNo').val(data.matNo);
+                            $('#matName').val(data.matName);
+                            // $('#supplier').val(data.billNo);
+                            $('#count').val(data.count);
+                            maxCount = data.count;
+                        }
+                    });
+                    break;
+            }
+        });
+
+    });
+
+    function findCode(el) {
+//        if (el.value.length === 7) {
+//            $('#code').focus();
+//        }
+    }
+
+    // 娣诲姞琛ㄦ牸鏁版嵁
+    var matData = [];
+
+    function addTableData(data) {
+        for (var i = 0; i < data.length; i++) {
+            var toPush = true;
+            for (var j = 0; j < matData.length; j++) {
+                if (data[i].matNo === matData[j].matNo) {
+                    matData[j].count = Number(matData[j].count) + Number(data[i].count);
+                    toPush = false;
+                }
+            }
+            if (toPush) {
+                matData.push(data[i]);
+            }
+        }
+        tableIns.reload({data: matData});
+//        $("#comb-btn").focus();
+    }
+
+
+    /**
+     * 鏍规嵁閫氱煡鍗曞彿鏌ヨ鐗╂枡璇︽儏
+     */
+    function find(el) {
+        if (isEmpty(el.value)) {
+            return;
+        }
+        var billNo = el.value;
+        if (billNo.indexOf('=') > -1) {
+            billNo = billNo.split(",")[0].split("=")[1];
+        }
+        if (isEmpty(billNo)) {
+            return;
+        }
+        // 璧嬪�煎墠娓呯┖琛ㄦ牸
+        matData = [];
+        tableIns.reload({data: matData});
+
+        $.ajax({
+            url: baseUrl + "/mobile/bill/query/auth",
+            headers: {'token': localStorage.getItem('token')},
+            data: {
+                billNo: billNo
+            },
+            method: 'POST',
+            success: function (res) {
+                if (res.code === 200) {
+                    if (res.data != null) {
+                        addTableData(res.data);
+                    }
+                } else if (res.code === 403) {
+                    top.location.href = baseUrl + "/pda";
+                } else {
+                    tips(res.msg, true)
+                }
+            }
+        });
+    }
+
+    /*************************************  鏁伴噺  ****************************************/
+    var countDom = $('#count');
+    var minCount = 1;
+    var maxCount = 1;
+
+    function add() {
+        if (countDom.val() >= maxCount) {
+            return;
+        }
+        countDom.val(Number(countDom.val()) + 1);
+    }
+
+    function reduce() {
+        if (countDom.val() <= minCount) {
+            return;
+        }
+        countDom.val(countDom.val() - 1);
+    }
+
+    // 淇敼鏁伴噺
+    function confirm() {
+        var matNo = $('#matNo').val();
+        var count = $('#count').val();
+        // var supplier = $("#supplier").val() === '' ? null : $("#supplier").val();
+        for (var j = 0; j < matData.length; j++) {
+            if (matNo === matData[j].matNo) {
+                if (count > maxCount || count < minCount) {
+                    tips("鏁伴噺涓嶈兘瓒呰繃鑼冨洿", true);
+                    return;
+                }
+                matData[j].count = Number(count);
+            }
+        }
+        tableIns.reload({data: matData});
+        layer.close(countLayer);
+        tips("淇敼鎴愬姛");
+    }
+
+    // 绉婚櫎鐗╂枡
+    function remove() {
+        var matNo = $('#matNo').val();
+        // var supplier = $("#supplier").val() === '' ? null : $("#supplier").val();
+        for (var j = 0; j < matData.length; j++) {
+            if (matNo === matData[j].matNo) {
+                matData.splice(j, 1);
+            }
+        }
+        tableIns.reload({data: matData});
+        layer.close(countLayer);
+        tips("绉婚櫎鎴愬姛");
+    }
+
+
+    // 閲嶇疆
+    function reset() {
+        $('#code').val("");
+        $('#billNo').val("");
+        matData = [];
+        tableIns.reload({data: matData});
+    }
+
+    // 缁勬墭
+    function comb() {
+        var barcode = $('#code').val();
+        if (isEmpty(barcode)) {
+            tips("鎵樼洏鏉$爜涓虹┖", true);
+            // document.getElementById("code").focus();
+            return;
+        }
+        if (barcode.length !== 8) {
+            tips("鏉$爜蹇呴』涓�8浣�", true);
+            return;
+        }
+        if (matData.length === 0) {
+            tips("璇锋彁鍙栫墿鏂�", true);
+            return;
+        }
+        var billNo = $('#billNo').val();
+        debugger
+        $.ajax({
+            url: baseUrl + "/mobile/comb/auth",
+            headers: {'token': localStorage.getItem('token')},
+            data: JSON.stringify({
+                barcode: barcode,
+                combMats: matData,
+                billNo: billNo,
+            }),
+            contentType: 'application/json;charset=UTF-8',
+            method: 'POST',
+            async: false,
+            success: function (res) {
+                if (res.code === 200) {
+                    reset();
+                    tips("缁勬墭鎴愬姛")
+                } else if (res.code === 403) {
+                    top.location.href = baseUrl + "/pda";
+                } else {
+                    tips(res.msg, true)
+                }
+            }
+        });
+    }
+
+    /**
+     * 鎻愮ず淇℃伅
+     * @param msg 鎻愮ず鍐呭
+     * @param warn true锛氱孩鑹插瓧浣�
+     */
+    function tips(msg, warn) {
+        layer.msg(msg, {icon: warn ? 2 : 1})
+    }
+
+    document.onkeyup = function (e) {
+        if (window.event)//濡傛灉window.event瀵硅薄瀛樺湪锛屽氨浠ユ浜嬩欢瀵硅薄涓哄噯
+            e = window.event;
+        var key = e.charCode || e.keyCode;
+        if (key === 115) {
+            $("#comb-btn").focus();
+            comb();
+        } else if (key === 113) {
+            $("#code").val("");
+            $("#code").focus();
+        }
+    }
+</script>
+</html>
\ No newline at end of file
diff --git a/src/main/webapp/views/pda/index.html b/src/main/webapp/views/pda/index.html
index e3bfa61..f7f6575 100644
--- a/src/main/webapp/views/pda/index.html
+++ b/src/main/webapp/views/pda/index.html
@@ -73,14 +73,16 @@
 
 <!-- 瀵艰埅鏍� -->
 <ul class="nav">
-    <li><a id="comb" onclick="nav(this.id)" class="nav-select" href="#">缁勬墭</a></li>
-    <li><a id="stockIn" onclick="nav(this.id)" class="nav-unselect" href="#">鍏ュ簱</a></li>
-    <li><a id="stockOut" onclick="nav(this.id)" class="nav-unselect" href="#">鍑哄簱</a></li>
+    <li><a id="combPro" onclick="nav(this.id)" class="nav-select" href="#">鍏ュ簱鍗曠粍鎵�</a></li> <!-- 鏍规嵁鍏ュ簱鍗曠粍鎵� -->
+    <li><a id="comb" onclick="nav(this.id)" class="nav-unselect" href="#">缁勬墭</a></li>    <!-- 鏍规嵁鐗╂枡浜у搧缁勬墭 -->
+<!--    <li><a id="stockIn" onclick="nav(this.id)" class="nav-unselect" href="#">鍏ュ簱</a></li>-->
+<!--    <li><a id="stockOut" onclick="nav(this.id)" class="nav-unselect" href="#">鍑哄簱</a></li>-->
+    <li><a id="stockCheck" onclick="nav(this.id)" class="nav-unselect" href="#">搴撳瓨鐩樼偣</a></li>
     <li><a id="stockQuery" onclick="nav(this.id)" class="nav-unselect" href="#">搴撳瓨鏌ヨ</a></li>
 </ul>
 
 <!-- 涓讳綋鍐呭 -->
-<iframe id="content" src="comb.html"></iframe>
+<iframe id="content" src="combPro.html"></iframe>
 
 </body>
 <script>
diff --git a/src/main/webapp/views/pda/matQuery.html b/src/main/webapp/views/pda/matQuery.html
index 677bf14..2ab8c70 100644
--- a/src/main/webapp/views/pda/matQuery.html
+++ b/src/main/webapp/views/pda/matQuery.html
@@ -86,11 +86,11 @@
     </div>
     <div class="form-item">
         <span>瑙勬牸鍨嬪彿</span>
-        <input id="str2" type="text" disabled="disabled">
+        <input id="specs" type="text" disabled="disabled">
     </div>
     <div class="form-item">
         <span>鍗曚綅</span>
-        <input id="str1" type="text" disabled="disabled">
+        <input id="unit" type="text" disabled="disabled">
     </div>
     <div class="form-item">
         <span style="vertical-align: middle">鏁伴噺</span>
@@ -125,8 +125,8 @@
                 if (res.code === 200) {
                     if (res.data != null) {
                         $('#matName').val(res.data.matName);
-                        $('#str1').val(res.data.str1);
-                        $('#str2').val(res.data.str2);
+                        $('#specs').val(res.data.specs);
+                        $('#unit').val(res.data.unit);
                         countDom.val(initMatCount);
                         $('#count').focus().select();
                     }
diff --git a/src/main/webapp/views/pda/stockCheck.html b/src/main/webapp/views/pda/stockCheck.html
new file mode 100644
index 0000000..a0f7a2b
--- /dev/null
+++ b/src/main/webapp/views/pda/stockCheck.html
@@ -0,0 +1,483 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
+    <title>鐩樼偣</title>
+    <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../static/css/pda.css" media="all">
+    <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
+    <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
+    <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script>
+    <style>
+        .number-tool {
+            margin-left: 10px;
+            padding: 1px 0 1px 5px;
+            display: inline-block;
+            width: 120px;
+        }
+
+        .number-tool:after {
+            clear: both;
+            content: "";
+            display: table;
+        }
+
+        .number-tool button {
+            background-color: #fff;
+            margin-top: 3px;
+            font-size: 16px;
+            height: 25px;
+            float: left;
+            width: 25px;
+            border: 1px solid #777777;
+        }
+
+        .number-tool input {
+            text-align: center;
+            height: 30px;
+            float: left;
+            margin: 0 5px;
+            width: 50px;
+            padding: 0;
+        }
+
+        #confirm {
+            margin: 10px 10px;
+            padding: 5px 20px;
+            font-weight: 600;
+        }
+
+        #remove {
+            margin: 10px 10px;
+            padding: 5px 20px;
+            color: darkred;
+        }
+    </style>
+</head>
+<body>
+<!-- 澶撮儴 -->
+<header class="layui-form">
+    <div class="layui-input-inline" style="margin-top: 0px">
+        <label class="layui-form-label">鍑哄簱鍙�</label>
+        <div class="layui-input-inline" style="margin-left: 5px;width: 120px">
+            <select id="staNoSelect" lay-filter="changeDevNo">
+                <option value="">璇烽�夋嫨</option>
+            </select>
+        </div>
+    </div>
+<!--    <div class="layui-input-inline">-->
+<!--        <label class="layui-form-label">鎵樼洏鐮�</label>-->
+<!--        <input class="layui-input" style="width: 175px;" type="number" id="code" oninput="find(this)"-->
+<!--               oninput="if(value.length>8)value=value.slice(0,8)" placeholder="鎵爜 / 杈撳叆" autocomplete="off">-->
+<!--    </div>-->
+    <div style="margin: 5px 5px">
+        <button id="replenish-btn" type="button" class="layui-btn layui-btn-normal" onclick="replenish()"><i
+                class="layui-icon">+</i>琛ュ厖
+        </button>
+    </div>
+</header>
+
+<!-- 涓讳綋 -->
+<main>
+    <table class="layui-table" id="chooseData" lay-filter="chooseData"></table>
+</main>
+<!-- 灏鹃儴 -->
+<footer>
+    <div class="layui-btn-container">
+        <button type="button" id="reset-btn" class="layui-btn layui-btn-primary" onclick="reset()">閲嶇疆</button>
+        <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="check()"
+                style="margin-left: 20px">纭
+        </button>
+        <span id="tips"></span>
+    </div>
+</footer>
+
+<!-- 淇敼鏁伴噺寮圭獥 -->
+<div id="modify" style="display: none; text-align: center;padding-top: 10px">
+    <div class="form-item">
+        <span>搴撲綅</span>
+        <input id="locNo" type="text" disabled="disabled" style="width: 70%">
+    </div>
+    <div class="form-item">
+        <span>鐗╂枡</span>
+        <input id="matNo" type="text" disabled="disabled" style="width: 70%">
+    </div>
+    <div class="form-item">
+        <span>鍚嶇О</span>
+        <input id="matName" type="text" disabled="disabled" style="width: 70%">
+    </div>
+    <div class="form-item" style="margin-top: 5px">
+        <span style="vertical-align: middle">鏁伴噺</span>
+        <div class="number-tool" style="vertical-align: middle">
+            <button onclick="reduce()">-</button>
+            <input id="count" type="number">
+            <button onclick="add()">+</button>
+        </div>
+    </div>
+    <button id="remove" onclick="remove()" style="display:none">绉婚櫎</button>
+    <button id="confirm" onclick="confirm()">淇濆瓨</button>
+</div>
+</body>
+
+<script type="text/template" id="takeSiteSelectTemplate">
+    {{#each data}}
+    <option value="{{this}}">{{this}}</option>
+    {{/each}}
+</script>
+
+<script>
+    var tableIns;
+    var anfmeLayer;
+    var souceData = [];
+    layui.use(['table', 'laydate', 'form'], function () {
+        var table = layui.table;
+        var $ = layui.jquery;
+        var layer = layui.layer;
+        var form = layui.form;
+
+        tableIns = table.render({
+            elem: '#chooseData',
+            data: [],
+            limit: 500,
+            cellMinWidth: 50,
+            cols: [[
+                {
+                    fixed: 'left',
+                    align: 'center',
+                    field: 'count',
+                    title: '鏁伴噺',
+                    event: 'modify',
+                    style: 'font-weight: bold;',
+                    width: 50
+                }
+                ,{field: 'matNo', align: 'center', title: '浜у搧缂栫爜', event: 'modify'}
+                ,{field: 'matName', align: 'center', title: '浜у搧鍚嶇О', event: 'modify'}
+                ,{field: 'locNo', align: 'center', title: '搴撲綅', event: 'modify'}//, hide: true
+            ]],
+            done: function (res, curr, count) {
+            }
+        });
+
+        // 鐩戝惉琛屽伐鍏蜂簨浠�
+        table.on('tool(chooseData)', function (obj) {
+            var data = obj.data;
+            switch (obj.event) {
+                case 'modify':
+                    anfmeLayer = layer.open({
+                        type: 1,
+                        offset: '20px',
+                        title: '淇敼鏁伴噺',
+                        shadeClose: true,
+                        area: ['80%', '250px'],
+                        content: $("#modify"),
+                        success: function (layero, index) {
+                            $('#matNo').val(data.matNo);
+                            $('#matName').val(data.matName);
+                            $('#count').val(data.count);
+                            $('#locNo').val(data.locNo);
+                        }
+                    });
+                    break;
+            }
+        });
+
+        // 鑾峰彇鍑哄簱鍙�
+        getOutBound();
+
+        function getOutBound() {
+            $.ajax({
+                url: baseUrl + "/available/take/check/site",
+                headers: {'token': localStorage.getItem('token')},
+                method: 'POST',
+                async: false,
+                success: function (res) {
+                    if (res.code === 200) {
+                        var tpl = $("#takeSiteSelectTemplate").html();
+                        var template = Handlebars.compile(tpl);
+                        var html = template(res);
+                        $('#staNoSelect').append(html);
+                        form.render('select');
+                    } else if (res.code === 403) {
+                        top.location.href = baseUrl + "/pda";
+                    } else {
+                        layer.msg(res.msg)
+                    }
+                }
+            })
+        }
+
+
+        form.on('select(changeDevNo)', function (data) {
+            souceData = []; // 鍒濆鍖栬〃鏍兼暟鎹褰�
+            $.ajax({
+                url: baseUrl + "/mobile/check/queryMatFromDevNo?devNo=" + data.value,
+                headers: {'token': localStorage.getItem('token')},
+                contentType: 'application/json;charset=UTF-8',
+                method: 'GET',
+                async: false,
+                success: function (res) {
+                    if (res.code === 200) {
+                        // console.log('鏁版嵁', res);
+                        locDetlData = res.data;
+                        if (res.data && res.data.length > 0) {
+                            res.data.map(function (item) {
+                                souceData.push(item);
+                            });
+                        }
+                        tableIns.reload({data: locDetlData});
+                    } else if (res.code === 403) {
+                        top.location.href = baseUrl + "/pda";
+                    } else {
+                        tips(res.msg, true)
+                    }
+                }
+            });
+        });
+    });
+
+    /**
+     * 鏍规嵁閫氱煡鍗曞彿鏌ヨ鐗╂枡璇︽儏
+     */
+    function find(el) {
+        if (isEmpty(el.value)) {
+            return;
+        }
+        var barcode = el.value;
+
+        locDetlData = [];
+        tableIns.reload({data: locDetlData});
+
+        $.ajax({
+            url: baseUrl + "/locDetl/queryDetl/auth",
+            headers: {'token': localStorage.getItem('token')},
+            data: {
+                // uuid: el.value
+                barcode : barcode
+            },
+            method: 'GET',
+            success: function (res) {
+                if (res.code === 200) {
+                    if (res.data != null) {
+                        locDetlData = [];
+                        initTableData(res.data);
+                    }
+                } else if (res.code === 403) {
+                    top.location.href = baseUrl + "/pda";
+                } else {
+                    tips(res.msg, true)
+                }
+            }
+        })
+    }
+
+    // 娣诲姞琛ㄦ牸鏁版嵁
+    var locDetlData = [];
+
+    function initTableData(data) {
+        for (var i = 0; i < data.length; i++) {
+            var toPush = true;
+            for (var j = 0; j < locDetlData.length; j++) {
+                if (data[i].matNo === locDetlData[j].matNo && data[i].locNo === locDetlData[j].locNo) {
+                    toPush = false;
+                }
+            }
+            if (toPush) {
+                locDetlData.push(data[i]);
+            }
+        }
+        tableIns.reload({data: locDetlData});
+    }
+
+    function addTableData(data) {
+        if (isEmpty(data.matNo)) {
+            tips("鎻愬彇澶辫触", true);
+            return;
+        }
+        var toPush = true;
+        for (var j = 0; j < locDetlData.length; j++) {
+            if (data.matNo === locDetlData[j].matNo && data.locNo === locDetlData[j].locNo) {
+                toPush = false;
+            }
+        }
+        if (toPush) {
+            var pushData = {
+                locNo: locDetlData[0] ? locDetlData[0].locNo : null,
+                matNo: data.matNo,
+                count: data.count,
+                matName: data.matName
+            }
+            locDetlData.push(pushData);
+        }
+        tableIns.reload({data: locDetlData});
+    }
+
+    /*************************************  鏁伴噺  ****************************************/
+    var countDom = $('#count');
+    var minCount = 0;
+
+    function add() {
+        countDom.val(Number(countDom.val()) + 1);
+    }
+
+    function reduce() {
+        if (countDom.val() <= minCount) {
+            return;
+        }
+        countDom.val(countDom.val() - 1);
+    }
+
+    // 淇敼鏁伴噺
+    function confirm() {
+        var matNo = $('#matNo').val();
+        var count = $('#count').val();
+        var locNo = $('#locNo').val();
+        for (var j = 0; j < locDetlData.length; j++) {
+            if (matNo === locDetlData[j].matNo && locNo === locDetlData[j].locNo) {
+                if (count < minCount) {
+                    tips("鏁伴噺蹇呴』澶т簬0", true);
+                    return;
+                }
+                locDetlData[j].count = Number(count);
+            }
+        }
+        // debugger
+        tableIns.reload({data: locDetlData});
+        layer.close(anfmeLayer);
+        tips("淇敼鎴愬姛");
+    }
+
+    // 绉婚櫎鐗╂枡
+    function remove() {
+        var matNo = $('#matNo').val();
+        var locNo = $('#locNo').val();
+        for (var j = 0; j < locDetlData.length; j++) {
+            if (matNo === locDetlData[j].matNo && locNo === locDetlData[j].locNo) {
+                locDetlData.splice(j, 1);
+            }
+        }
+        tableIns.reload({data: locDetlData});
+        layer.close(anfmeLayer);
+        tips("绉婚櫎鎴愬姛");
+    }
+
+
+    /*************************************  琛ュ厖  ****************************************/
+    var matCodeLayerIdx;
+
+    function replenish() {
+        matCodeLayerIdx = layer.open({
+            type: 2,
+            title: '琛ュ厖鍟嗗搧',
+            shade: [0.3, '#000'],
+            area: ['90%', '80%'],
+            content: 'matQuery.html',
+            success: function (layero, index) {
+                $('.layui-layer-title').css('font-size', '16px');
+                $('.layui-layer.layui-layer-iframe').css('border-radius', '8px');
+            },
+            end: function () {
+                // $('#mat-btn').focus();
+            }
+        });
+    }
+
+
+    // 閲嶇疆
+    function reset() {
+//        $('#locNo').val("");
+        $('#staNoSelect').val("");
+        layui.form.render('select');
+        locDetlData = [];
+        tableIns.reload({data: locDetlData});
+    }
+
+    // 纭
+    function check() {
+        var staNoSelect = $("#staNoSelect").val();
+        if (staNoSelect === "") {
+            layer.msg("璇烽�夋嫨鍑哄簱鍙�");
+            return;
+        }
+        if (souceData.length === 0) {
+            layer.msg("绔欑偣鏃犺揣锛屾棤娉曠洏鐐�");
+            return;
+        }
+        if (locDetlData.length > 0) {
+            for (var i = 0; i < locDetlData.length; i++) {
+                if (locDetlData[i].count === null || locDetlData[i].count === 0 || locDetlData[i].count === undefined) {
+                    tips(locDetlData[i].matNo + "鍟嗗搧鏁伴噺閿欒", true);
+                    return;
+                }
+            }
+        }
+        var checkList = [];
+        if (locDetlData.length > 0) {
+            locDetlData.map(function (item) {
+                checkList.push({
+                    locNo: item.locNo,
+                    matNo: item.matNo,
+                    checkQty: item.count
+                });
+            });
+        }
+        var sourceList = [];
+        if (souceData.length > 0) {
+            souceData.map(function (item) {
+                sourceList.push({
+                    locNo: item.locNo,
+                    matNo: item.matNo,
+                    count: item.count
+                });
+            });
+        }
+
+        // 鐩樼偣鎺ュ彛 /work/stock/check
+        $.ajax({
+            url: baseUrl+"/mobile/stock/check",
+            headers: {'token': localStorage.getItem('token')},
+            data: JSON.stringify({
+                checkList: checkList,
+                // sourceList: sourceList,
+            }),
+            contentType:'application/json;charset=UTF-8',
+            method: 'POST',
+            async: false,
+            success: function (res) {
+                if (res.code === 200) {
+                    reset();
+                    layer.msg("鐩樼偣鎴愬姛");
+                } else if (res.code === 403) {
+                    top.location.href = baseUrl + "/pda";
+                } else {
+                    tips(res.msg, true)
+                }
+            }
+        });
+    }
+
+    /**
+     * 鎻愮ず淇℃伅
+     * @param msg 鎻愮ず鍐呭
+     * @param warn true锛氱孩鑹插瓧浣�
+     */
+    function tips(msg, warn) {
+        layer.msg(msg, {icon: warn ? 2 : 1})
+    }
+
+    document.onkeyup = function (e) {
+        if (window.event)//濡傛灉window.event瀵硅薄瀛樺湪锛屽氨浠ユ浜嬩欢瀵硅薄涓哄噯
+            e = window.event;
+        var key = e.charCode || e.keyCode;
+        if (key === 115) {
+//            $("#comb-btn").focus();
+            comb();
+        } else if (key === 113) {
+//            $("#locNo").val("");
+//            $("#locNo").focus();
+        }
+    }
+</script>
+</html>
\ No newline at end of file
diff --git a/src/main/webapp/views/pda/stockQuery.html b/src/main/webapp/views/pda/stockQuery.html
index e1dadb2..34c9a2e 100644
--- a/src/main/webapp/views/pda/stockQuery.html
+++ b/src/main/webapp/views/pda/stockQuery.html
@@ -108,11 +108,11 @@
             limit: 500,
             cellMinWidth: 50,
             cols: [[
-                {field: 'matnr', align: 'center', title: '缂栫爜', event: 'detail'},
-                {field: 'maktx', align: 'center', title: '鍚嶇О', event: 'detail'},
-                {field: 'locNo', align: 'center', title: '搴撲綅', event: 'detail'},
-                {field: 'count', align: 'center', title: '鏁伴噺', event: 'detail', style:'color: blue', width:50},
-                {field: 'pickNum', align: 'center', title: '鎷f枡', event: 'detail', width:50},
+                {field: 'matNo', align: 'center', title: '缂栫爜', event: 'detail'}
+                ,{field: 'matName', align: 'center', title: '鍚嶇О', event: 'detail'}
+                ,{field: 'locNo', align: 'center', title: '搴撲綅', event: 'detail'}
+                ,{field: 'count', align: 'center', title: '鏁伴噺', event: 'detail', style:'color: blue', width:50}
+                // ,{field: 'pickNum', align: 'center', title: '鎷f枡', event: 'detail', width:50}
             ]],
             done: function (res, curr, count) {
             }
diff --git a/src/main/webapp/views/pltBarcode/pltBarcode.html b/src/main/webapp/views/pltBarcode/pltBarcode.html
new file mode 100644
index 0000000..0d02f03
--- /dev/null
+++ b/src/main/webapp/views/pltBarcode/pltBarcode.html
@@ -0,0 +1,218 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title></title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+    <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all">
+    <link rel="stylesheet" href="../../static/css/cool.css" media="all">
+    <link rel="stylesheet" href="../../static/css/common.css" media="all">
+</head>
+<body>
+
+<!-- 鎼滅储鏍� -->
+<div id="search-box" class="layui-form layui-card-header">
+    <div class="layui-inline">
+        <div class="layui-input-inline">
+            <input class="layui-input" type="text" name="barcode" placeholder="鏉$爜鍙�" autocomplete="off">
+        </div>
+    </div>
+    <div class="layui-inline">
+        <div class="layui-input-inline">
+            <input class="layui-input" type="text" name="condition" placeholder="璇疯緭鍏�" autocomplete="off">
+        </div>
+    </div>
+    <!-- 寰呮坊鍔� -->
+    <div id="data-search-btn" class="layui-btn-container layui-form-item">
+        <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">鎼滅储</button>
+        <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">閲嶇疆</button>
+    </div>
+</div>
+
+<!-- 琛ㄦ牸 -->
+<div class="layui-form">
+    <table class="layui-hide" id="pltBarcode" lay-filter="pltBarcode"></table>
+</div>
+<script type="text/html" id="toolbar">
+    <div class="layui-btn-container">
+<!--        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>-->
+        <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>
+        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">瀵煎嚭</button>
+    </div>
+</script>
+
+<script type="text/html" id="operate">
+<!--    <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">淇敼</a>-->
+<!--    <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a>-->
+</script>
+
+<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
+<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/pltBarcode/pltBarcode.js" charset="utf-8"></script>
+</body>
+<!-- 琛ㄥ崟寮圭獥 -->
+<script type="text/html" id="editDialog">
+    <form id="detail" lay-filter="detail" class="layui-form admin-form">
+        <input name="id" type="hidden">
+        <div class="layui-row">
+            <div class="layui-col-md12">
+                <div class="layui-form-item">
+                    <label class="layui-form-label layui-form-required">鏉$爜: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="barcode" placeholder="璇疯緭鍏ユ潯鐮�" lay-vertype="tips" lay-verify="required">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label layui-form-required">鍗曟嵁缂栧彿: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="billNo" placeholder="璇疯緭鍏ュ崟鎹紪鍙�" lay-vertype="tips" lay-verify="required">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label layui-form-required">搴忓彿: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="seqNo" placeholder="璇疯緭鍏ュ簭鍙�" lay-vertype="tips" lay-verify="required">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">鍗曟嵁绫诲瀷: </label>
+                    <div class="layui-input-block">
+                        <select name="billType">
+                            <option value="">璇烽�夋嫨鍗曟嵁绫诲瀷</option>
+                            <option value="1">閲囪喘鍏ュ簱</option>
+                            <option value="2">鐢熶骇鍏ュ簱</option>
+                            <option value="3">璋冩嫧鍏ュ簱</option>
+                            <option value="4">閿�鍞��鍥炲叆搴�</option>
+                            <option value="5">鍏朵粬鍏ュ簱</option>
+                        </select>
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label layui-form-required">鐗╂枡缂栫爜: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="matNo" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�" lay-vertype="tips" lay-verify="required">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label layui-form-required">鐗╂枡鍚嶇О: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="matName" placeholder="璇疯緭鍏ョ墿鏂欏悕绉�" lay-vertype="tips" lay-verify="required">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">鏁伴噺: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="qty" placeholder="璇疯緭鍏ユ暟閲�">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">搴撲綅鍙�: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="locNo" placeholder="璇疯緭鍏ュ簱浣嶅彿">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">瑙勬牸: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="specs" placeholder="璇疯緭鍏ヨ鏍�">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">鍗曚綅: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="unit" placeholder="璇疯緭鍏ュ崟浣�">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">灏哄: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="size" placeholder="璇疯緭鍏ュ昂瀵�">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">棰滆壊: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="color" placeholder="璇疯緭鍏ラ鑹�">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">鍗曢噸: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="weight" placeholder="璇疯緭鍏ュ崟閲�">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">澶囨敞: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="memo" placeholder="璇疯緭鍏ュ娉�">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">ERP杩炵嚎: </label>
+                    <div class="layui-input-block">
+                        <select name="linkErp">
+                            <option value="">璇烽�夋嫨ERP杩炵嚎</option>
+                            <option value="0">闈炶繛绾�</option>
+                            <option value="1">ERP杩炵嚎</option>
+                        </select>
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">瀹屾垚鐘舵��: </label>
+                    <div class="layui-input-block">
+                        <select name="ioStatus">
+                            <option value="">璇烽�夋嫨瀹屾垚鐘舵��</option>
+                            <option value="0">寰呭鐞�</option>
+                            <option value="1">鍏ュ簱涓�</option>
+                            <option value="2">鍏ュ簱瀹屾垚</option>
+                            <option value="3">鍙栨秷鍏ュ簱</option>
+                        </select>
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">瀹屾垚鏃堕棿: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="ioTime" id="ioTime$" placeholder="璇疯緭鍏ュ畬鎴愭椂闂�">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">淇敼浜哄憳: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="modiUser" placeholder="璇疯緭鍏ヤ慨鏀逛汉鍛�">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">淇敼鏃堕棿: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="modiTime" id="modiTime$" placeholder="璇疯緭鍏ヤ慨鏀规椂闂�">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">寤烘。浜哄憳: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="appeUser" placeholder="璇疯緭鍏ュ缓妗d汉鍛�">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">寤烘。鏃堕棿: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="appeTime" id="appeTime$" placeholder="璇疯緭鍏ュ缓妗f椂闂�">
+                    </div>
+                </div>
+
+             </div>
+        </div>
+        <hr class="layui-bg-gray">
+        <div class="layui-form-item text-right">
+            <button class="layui-btn" lay-filter="editSubmit" lay-submit="">淇濆瓨</button>
+            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">鍙栨秷</button>
+        </div>
+    </form>
+</script>
+</html>
+
diff --git a/src/main/webapp/views/report/viewStayTime.html b/src/main/webapp/views/report/viewStayTime.html
index 5be39ac..c7aca53 100644
--- a/src/main/webapp/views/report/viewStayTime.html
+++ b/src/main/webapp/views/report/viewStayTime.html
@@ -21,7 +21,7 @@
 <div id="search-box" class="layui-form layui-card-header">
     <div class="layui-inline">
         <div class="layui-input-inline">
-            <input class="layui-input" type="text" name="id" placeholder="搴撲綅鍙�" autocomplete="off">
+            <input class="layui-input" type="text" name="loc_no" placeholder="搴撲綅鍙�" autocomplete="off">
         </div>
     </div>
 
diff --git a/src/main/webapp/views/staDesc/staDesc.html b/src/main/webapp/views/staDesc/staDesc.html
index 0bd2251..8103745 100644
--- a/src/main/webapp/views/staDesc/staDesc.html
+++ b/src/main/webapp/views/staDesc/staDesc.html
@@ -25,6 +25,11 @@
             </div>
         </div>
     </div>
+    <div class="layui-inline">
+        <div class="layui-input-inline cool-auto-complete">
+             <input id="stnDesc" name="stn_desc" class="layui-input cool-auto-complete-div"  type="text" placeholder="绔欑偣鍚嶇О" >
+        </div>
+    </div>
     <!--<div class="layui-inline">-->
         <!--<label class="layui-form-label">缂栥��銆�鍙凤細</label>-->
         <!--<div class="layui-input-inline">-->
diff --git a/src/main/webapp/views/stoMan/stoQue.html b/src/main/webapp/views/stoMan/stoQue.html
index adc66c0..8411cc6 100644
--- a/src/main/webapp/views/stoMan/stoQue.html
+++ b/src/main/webapp/views/stoMan/stoQue.html
@@ -32,6 +32,40 @@
             <input class="layui-input" type="text" name="loc_no" placeholder="搴撲綅鍙�" autocomplete="off">
         </div>
     </div>
+
+    <div class="layui-inline">
+        <div class="layui-input-inline cool-auto-complete">
+            <input id="locSts" name="loc_sts" class="layui-input" type="text"  style="display: none">
+            <input id="locSts$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="搴撲綅鐘舵��" onfocus=this.blur()>
+            <div class="cool-auto-complete-window">
+                <input class="cool-auto-complete-window-input" data-key="locStacQueryBylocSts" onkeyup="autoLoad2(this.getAttribute('data-key'))">
+                <select class="cool-auto-complete-window-select" data-key="locStacQueryBylocStsSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">
+                </select>
+            </div>
+        </div>
+    </div>
+
+    <div class="layui-inline">
+        <div class="layui-input-inline">
+            <input class="layui-input" type="text" name="crn_no" placeholder="鍫嗗灈鏈哄彿" autocomplete="off">
+        </div>
+    </div>
+
+    <div class="layui-inline">
+        <div class="layui-input-inline">
+            <input class="layui-input" type="text" name="row1" placeholder="鎺�" autocomplete="off">
+        </div>
+    </div>
+    <div class="layui-inline">
+        <div class="layui-input-inline">
+            <input class="layui-input" type="text" name="bay1" placeholder="鍒�" autocomplete="off">
+        </div>
+    </div>
+    <div class="layui-inline">
+        <div class="layui-input-inline">
+            <input class="layui-input" type="text" name="lev1" placeholder="灞�" autocomplete="off">
+        </div>
+    </div>
     <!-- 鏃ユ湡鑼冨洿 -->
     <div class="layui-inline" style="width: 300px">
         <div class="layui-input-inline">
diff --git a/src/main/webapp/views/waitMatchk/waitMatchk.html b/src/main/webapp/views/waitMatchk/waitMatchk.html
index 3963446..39adbe6 100644
--- a/src/main/webapp/views/waitMatchk/waitMatchk.html
+++ b/src/main/webapp/views/waitMatchk/waitMatchk.html
@@ -16,7 +16,7 @@
 <div id="search-box" class="layui-form layui-card-header">
     <div class="layui-inline">
         <div class="layui-input-inline">
-            <input class="layui-input" type="text" name="bill_no" placeholder="缂栧彿" autocomplete="off">
+            <input class="layui-input" type="text" name="condition" placeholder="璇疯緭鍏�" autocomplete="off">
         </div>
     </div>
     <div class="layui-inline">
@@ -30,28 +30,28 @@
             </div>
         </div>
     </div>
-    <div class="layui-inline">
-        <div class="layui-input-inline cool-auto-complete">
-            <input id="modiUser" class="layui-input" name="modi_user" type="text" placeholder="璇疯緭鍏�" autocomplete="off" style="display: none">
-            <input id="modiUser$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="淇敼浜哄憳" onfocus=this.blur()>
-            <div class="cool-auto-complete-window">
-                <input class="cool-auto-complete-window-input" data-key="userQueryBymodiUser" onkeyup="autoLoad(this.getAttribute('data-key'))">
-                <select class="cool-auto-complete-window-select" data-key="userQueryBymodiUserSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">
-                </select>
-            </div>
-        </div>
-    </div>
-    <div class="layui-inline">
-        <div class="layui-input-inline cool-auto-complete">
-            <input id="appeUser" class="layui-input" name="appe_user" type="text" placeholder="璇疯緭鍏�" autocomplete="off" style="display: none">
-            <input id="appeUser$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="寤烘。浜哄憳" onfocus=this.blur()>
-            <div class="cool-auto-complete-window">
-                <input class="cool-auto-complete-window-input" data-key="userQueryByappeUser" onkeyup="autoLoad(this.getAttribute('data-key'))">
-                <select class="cool-auto-complete-window-select" data-key="userQueryByappeUserSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">
-                </select>
-            </div>
-        </div>
-    </div>
+<!--    <div class="layui-inline">-->
+<!--        <div class="layui-input-inline cool-auto-complete">-->
+<!--            <input id="modiUser" class="layui-input" name="modi_user" type="text" placeholder="璇疯緭鍏�" autocomplete="off" style="display: none">-->
+<!--            <input id="modiUser$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="淇敼浜哄憳" onfocus=this.blur()>-->
+<!--            <div class="cool-auto-complete-window">-->
+<!--                <input class="cool-auto-complete-window-input" data-key="userQueryBymodiUser" onkeyup="autoLoad(this.getAttribute('data-key'))">-->
+<!--                <select class="cool-auto-complete-window-select" data-key="userQueryBymodiUserSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">-->
+<!--                </select>-->
+<!--            </div>-->
+<!--        </div>-->
+<!--    </div>-->
+<!--    <div class="layui-inline">-->
+<!--        <div class="layui-input-inline cool-auto-complete">-->
+<!--            <input id="appeUser" class="layui-input" name="appe_user" type="text" placeholder="璇疯緭鍏�" autocomplete="off" style="display: none">-->
+<!--            <input id="appeUser$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="寤烘。浜哄憳" onfocus=this.blur()>-->
+<!--            <div class="cool-auto-complete-window">-->
+<!--                <input class="cool-auto-complete-window-input" data-key="userQueryByappeUser" onkeyup="autoLoad(this.getAttribute('data-key'))">-->
+<!--                <select class="cool-auto-complete-window-select" data-key="userQueryByappeUserSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">-->
+<!--                </select>-->
+<!--            </div>-->
+<!--        </div>-->
+<!--    </div>-->
 
     <!-- 寰呮坊鍔� -->
     <div id="data-search-btn" class="layui-btn-container layui-form-item">
@@ -66,15 +66,16 @@
 </div>
 <script type="text/html" id="toolbar">
     <div class="layui-btn-container">
-        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>
+        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">瀹℃牳</button>
         <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>
-        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">瀵煎嚭</button>
+        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" >瀵煎嚭</button>
+<!--        style="margin-top: 10px"-->
     </div>
 </script>
 
 <script type="text/html" id="operate">
     <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">璇︽儏</a>
-    <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a>
+<!--    <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a>-->
 </script>
 
 <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
diff --git a/src/main/webapp/views/waitMatchkLog/waitMatchkLog.html b/src/main/webapp/views/waitMatchkLog/waitMatchkLog.html
index f8875e1..573d531 100644
--- a/src/main/webapp/views/waitMatchkLog/waitMatchkLog.html
+++ b/src/main/webapp/views/waitMatchkLog/waitMatchkLog.html
@@ -16,7 +16,7 @@
 <div id="search-box" class="layui-form layui-card-header">
     <div class="layui-inline">
         <div class="layui-input-inline">
-            <input class="layui-input" type="text" name="bill_no" placeholder="缂栧彿" autocomplete="off">
+            <input class="layui-input" type="text" name="condition" placeholder="璇疯緭鍏�" autocomplete="off">
         </div>
     </div>
     <div class="layui-inline">
@@ -77,15 +77,15 @@
 </div>
 <script type="text/html" id="toolbar">
     <div class="layui-btn-container">
-        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>
-        <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>
-        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">瀵煎嚭</button>
+<!--        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>-->
+<!--        <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>-->
+        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="margin-top: 10px">瀵煎嚭</button>
     </div>
 </script>
 
 <script type="text/html" id="operate">
-    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">璇︽儏</a>
-    <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a>
+<!--    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">璇︽儏</a>-->
+<!--    <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a>-->
 </script>
 
 <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
diff --git a/src/main/webapp/views/waitMatinLog/waitMatinLog.html b/src/main/webapp/views/waitMatinLog/waitMatinLog.html
index d4fe5be..e2fb611 100644
--- a/src/main/webapp/views/waitMatinLog/waitMatinLog.html
+++ b/src/main/webapp/views/waitMatinLog/waitMatinLog.html
@@ -16,7 +16,7 @@
 <div id="search-box" class="layui-form layui-card-header">
     <div class="layui-inline">
         <div class="layui-input-inline">
-            <input class="layui-input" type="text" name="bill_no" placeholder="缂栧彿" autocomplete="off">
+            <input class="layui-input" type="text" name="condition" placeholder="璇疯緭鍏�" autocomplete="off">
         </div>
     </div>
     <div class="layui-inline">
@@ -55,15 +55,15 @@
 </div>
 <script type="text/html" id="toolbar">
     <div class="layui-btn-container">
-        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>
-        <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>
-        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">瀵煎嚭</button>
+<!--        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>-->
+<!--        <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>-->
+        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="margin-top: 10px">瀵煎嚭</button>
     </div>
 </script>
 
 <script type="text/html" id="operate">
-    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">璇︽儏</a>
-    <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a>
+<!--    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">璇︽儏</a>-->
+<!--    <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a>-->
 </script>
 
 <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
diff --git a/src/main/webapp/views/waitMatout/waitMatout.html b/src/main/webapp/views/waitMatout/waitMatout.html
index 6310e90..9949418 100644
--- a/src/main/webapp/views/waitMatout/waitMatout.html
+++ b/src/main/webapp/views/waitMatout/waitMatout.html
@@ -8,51 +8,136 @@
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
     <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
     <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all">
-    <link rel="stylesheet" href="../../static/css/cool.css" media="all">
-    <link rel="stylesheet" href="../../static/css/common.css" media="all">
+<!--    <link rel="stylesheet" href="../../static/css/cool.css" media="all">-->
+<!--    <link rel="stylesheet" href="../../static/css/common.css" media="all">-->
+
+    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
+    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
 </head>
 <body>
 
-<!-- 鎼滅储鏍� -->
-<div id="search-box" class="layui-form layui-card-header">
-    <div class="layui-inline">
-        <div class="layui-input-inline">
-            <input class="layui-input" type="text" name="bill_no" placeholder="鍗曟嵁缂栧彿" autocomplete="off">
+<!-- 姝f枃寮�濮� -->
+<div class="layui-fluid">
+    <div class="layui-card">
+        <div class="layui-card-body">
+            <!-- 琛ㄦ牸椤堕儴宸ュ叿鏍� -->
+            <div class="layui-form toolbar">
+                <div class="layui-form-item">
+                    <div class="layui-inline">
+                        <div class="layui-input-inline mr0">
+                            <input name="bill_no" class="layui-input" type="text" placeholder="杈撳叆鍗曟嵁缂栧彿"/>
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <div class="layui-input-inline mr0">
+                            <select name="bill_type" placeholder="璇烽�夋嫨鍗曟嵁绫诲瀷">
+<!--                                1:閿�鍞嚭搴�,2:棰嗘枡鍑哄簱,3:璋冩嫧鍑哄簱,4:閲囪喘閫�鍥炲嚭搴�,5:鍏朵粬鍑哄簱-->
+                                <option value="" style="display: none"></option>
+                                <option value="1">閿�鍞嚭搴�</option>
+                                <option value="2">棰嗘枡鍑哄簱</option>
+                                <option value="3">璋冩嫧鍑哄簱</option>
+                                <option value="4">閲囪喘閫�鍥炲嚭搴�</option>
+                                <option value="5">鍏朵粬鍑哄簱</option>
+                            </select>
+                        </div>
+                    </div>
+                    <div class="layui-inline" style="width: 300px">
+                        <div class="layui-input-inline">
+                            <input class="layui-input layui-laydate-range" name="appe_time" type="text" placeholder="璧峰鏃堕棿 - 缁堟鏃堕棿" autocomplete="off" style="width: 300px">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <button class="layui-btn icon-btn" lay-filter="waitMatoutSearch" lay-submit>
+                            <i class="layui-icon">&#xe615;</i>鎼滅储
+                        </button>
+                        <button id="waitMatoutAddBtn" class="layui-btn icon-btn"><i class="layui-icon">&#xe654;</i>娣诲姞
+                        </button>
+                    </div>
+                </div>
+            </div>
+            <table id="waitMatout" lay-filter="waitMatout"></table>
         </div>
     </div>
-    <!-- 鏃ユ湡鑼冨洿 -->
-    <div class="layui-inline" style="width: 300px">
-        <div class="layui-input-inline">
-            <input class="layui-input layui-laydate-range" id="modi_time" name="modi_time" type="text" placeholder="璧峰鏃堕棿 - 缁堟鏃堕棿" autocomplete="off" style="width: 300px">
+    <div class="layui-card">
+        <div class="layui-card-body">
+            鍑哄簱閫氱煡鍗曪細鐢盓RP鎻愪緵鍗曟嵁缂栧彿銆佺被鍨嬨�佸崟鎹椂闂村強鐗╂枡鏄庣粏锛岀敓鎴愬叆搴撲綔涓氬崟锛屼负缁存姢绯荤粺楂樺彲鐢紝鐢ㄦ埛鍙嚜琛屾坊鍔犲叆搴撻�氱煡鍗曟暟鎹紝瀹屾垚鐙珛鐨勫叆搴撲綔涓氥��
+            <span class="text-danger">鎵嬪姩娣诲姞鏃讹紝璇锋鏌ュ崟鎹紪鍙锋槸鍚﹀湪ERP绯荤粺涓凡瀛樺湪锛岄伩鍏嶅彂鐢熸暟鎹敊璇棶棰樸��</span>
         </div>
-    </div>
-    <div class="layui-inline">
-        <div class="layui-input-inline">
-            <input class="layui-input" type="text" name="condition" placeholder="璇疯緭鍏�" autocomplete="off">
-        </div>
-    </div>
-    <!-- 寰呮坊鍔� -->
-    <div id="data-search-btn" class="layui-btn-container layui-form-item">
-        <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">鎼滅储</button>
-        <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">閲嶇疆</button>
     </div>
 </div>
-
-<!-- 琛ㄦ牸 -->
-<div class="layui-form">
-    <table class="layui-hide" id="waitMatout" lay-filter="waitMatout"></table>
-</div>
-<script type="text/html" id="toolbar">
-    <div class="layui-btn-container">
-        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>
-        <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>
-        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">瀵煎嚭</button>
-    </div>
-</script>
-
+<!-- 琛ㄦ牸鎿嶄綔鍒� -->
 <script type="text/html" id="operate">
-    <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">淇敼</a>
-    <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a>
+    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">淇敼</a>
+    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
+</script>
+<!-- 琛ㄦ牸鎿嶄綔鍒� -->
+<script type="text/html" id="tbLook">
+    <span class="layui-text">
+        <a href="javascript:;" lay-event="look">
+            <i class="layui-icon" style="font-size: 12px;">&#xe61a;</i> 鏌ョ湅鍗曟嵁鏄庣粏
+        </a>
+    </span>
+</script>
+<!-- 琛ㄥ崟寮圭獥 -->
+<script type="text/html" id="editDialog">
+    <form id="editForm" lay-filter="editForm" class="layui-form model-form"  >
+        <input name="experimentTypeId" type="hidden"/>
+        <div class="layui-form-item">
+            <label class="layui-form-label">鍗曟嵁绫诲瀷锛�</label>
+            <div class="layui-input-block">
+                <select name="billType" maxlength="20" lay-verType="tips" lay-verify="required">
+                    <option value="" style="display: none"></option>
+                    <option value="1">閿�鍞嚭搴�</option>
+                    <option value="2">棰嗘枡鍑哄簱</option>
+                    <option value="3">璋冩嫧鍑哄簱</option>
+                    <option value="4">閲囪喘閫�鍥炲嚭搴�</option>
+                    <option value="5">鍏朵粬鍑哄簱</option>
+                </select>
+            </div>
+        </div>
+        <div class="layui-form-item">
+            <label class="layui-form-label">鍗曟嵁缂栧彿锛�</label>
+            <div class="layui-input-block">
+                <input id="billNo" name="billNo" placeholder="杈撳叆鍗曟嵁缂栧彿" type="text" class="layui-input" maxlength="20" lay-verType="tips" lay-verify="required"/>
+            </div>
+        </div>
+        <div class="layui-form-item" style="position: relative;">
+            <label class="layui-form-label">鍗曟嵁鏄庣粏锛�</label>
+            <div class="layui-input-block">
+                <table id="formSSXMTable" lay-filter="formSSXMTable"></table>
+            </div>
+            <button class="layui-btn layui-btn-sm icon-btn" id="matAddBtnComment"
+                    style="position: absolute; left: 20px;top: 60px;padding: 0 5px;" type="button">
+                <i class="layui-icon">&#xe654;</i>娣诲姞鏄庣粏
+            </button>
+        </div>
+        <div class="layui-form-item text-right">
+            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">鍙栨秷</button>
+            <button class="layui-btn" lay-filter="waitMatoutEditSubmit" lay-submit>淇濆瓨</button>
+        </div>
+    </form>
+</script>
+<!-- 琛ㄦ牸鎿嶄綔鍒� -->
+<script type="text/html" id="formSSXMTableBar">
+    <!--    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">淇敼</a>-->
+    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
+</script>
+<!-- 琛ㄥ崟寮圭獥 -->
+<script type="text/html" id="matEditDialog">
+    <form id="matEditForm" lay-filter="matEditForm" class="layui-form model-form">
+        <input name="experimentId" type="hidden"/>
+        <div class="layui-form-item">
+            <label class="layui-form-label">鐗╂枡 - 澶氶��</label>
+            <div class="layui-input-block">
+                <div id="mat" name="mat">
+                </div>
+            </div>
+        </div>
+        <div class="layui-form-item text-right">
+            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">鍙栨秷</button>
+            <button class="layui-btn" lay-filter="matEditSubmit" lay-submit>淇濆瓨</button>
+        </div>
+    </form>
 </script>
 
 <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
@@ -61,158 +146,5 @@
 <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
 <script type="text/javascript" src="../../static/js/waitMatout/waitMatout.js" charset="utf-8"></script>
 </body>
-<!-- 琛ㄥ崟寮圭獥 -->
-<script type="text/html" id="editDialog">
-    <form id="detail" lay-filter="detail" class="layui-form admin-form">
-        <input name="id" type="hidden">
-        <div class="layui-row">
-            <div class="layui-col-md12">
-                <div class="layui-form-item">
-                    <label class="layui-form-label layui-form-required">鍗曟嵁缂栧彿: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="billNo" placeholder="璇疯緭鍏ュ崟鎹紪鍙�" lay-vertype="tips" lay-verify="required">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label layui-form-required">搴忓彿: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="seqNo" placeholder="璇疯緭鍏ュ簭鍙�" lay-vertype="tips" lay-verify="required">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">鍗曟嵁绫诲瀷: </label>
-                    <div class="layui-input-block">
-                        <select name="billType">
-                            <option value="">璇烽�夋嫨鍗曟嵁绫诲瀷</option>
-                            <option value="1">閿�鍞嚭搴�</option>
-                            <option value="2">棰嗘枡鍑哄簱</option>
-                            <option value="3">璋冩嫧鍑哄簱</option>
-                            <option value="4">閲囪喘閫�鍥炲嚭搴�</option>
-                            <option value="5">鍏朵粬鍑哄簱</option>
-                        </select>
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label layui-form-required">鐗╂枡缂栫爜: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="matNo" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�" lay-vertype="tips" lay-verify="required">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label layui-form-required">鐗╂枡鍚嶇О: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="matName" placeholder="璇疯緭鍏ョ墿鏂欏悕绉�" lay-vertype="tips" lay-verify="required">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">鏁伴噺: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="qty" placeholder="璇疯緭鍏ユ暟閲�">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">瑙勬牸: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="specs" placeholder="璇疯緭鍏ヨ鏍�">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">鍗曚綅: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="unit" placeholder="璇疯緭鍏ュ崟浣�">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">灏哄: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="size" placeholder="璇疯緭鍏ュ昂瀵�">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">棰滆壊: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="color" placeholder="璇疯緭鍏ラ鑹�">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">鍗曢噸: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="weight" placeholder="璇疯緭鍏ュ崟閲�">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">澶囨敞: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="memo" placeholder="璇疯緭鍏ュ娉�">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">宸插嚭搴撻噺: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="outQty" placeholder="璇疯緭鍏ュ凡鍑哄簱閲�">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">ERP杩炵嚎: </label>
-                    <div class="layui-input-block">
-                        <select name="linkErp">
-                            <option value="">璇烽�夋嫨ERP杩炵嚎</option>
-                            <option value="0">闈炶繛绾�</option>
-                            <option value="1">ERP杩炵嚎</option>
-                        </select>
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">瀹屾垚鐘舵��: </label>
-                    <div class="layui-input-block">
-                        <select name="ioStatus">
-                            <option value="">璇烽�夋嫨瀹屾垚鐘舵��</option>
-                            <option value="0">寰呭鐞�</option>
-                            <option value="1">鍑哄簱涓�</option>
-                            <option value="2">鍑哄簱瀹屾垚</option>
-                            <option value="3">鍙栨秷鍑哄簱</option>
-                        </select>
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">瀹屾垚鏃堕棿: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="ioTime" id="ioTime$" placeholder="璇疯緭鍏ュ畬鎴愭椂闂�">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">淇敼浜哄憳: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="modiUser" placeholder="璇疯緭鍏ヤ慨鏀逛汉鍛�">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">淇敼鏃堕棿: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="modiTime" id="modiTime$" placeholder="璇疯緭鍏ヤ慨鏀规椂闂�">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">寤烘。浜哄憳: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="appeUser" placeholder="璇疯緭鍏ュ缓妗d汉鍛�">
-                    </div>
-                </div>
-                <div class="layui-form-item">
-                    <label class="layui-form-label">寤烘。鏃堕棿: </label>
-                    <div class="layui-input-block">
-                        <input class="layui-input" name="appeTime" id="appeTime$" placeholder="璇疯緭鍏ュ缓妗f椂闂�">
-                    </div>
-                </div>
-
-             </div>
-        </div>
-        <hr class="layui-bg-gray">
-        <div class="layui-form-item text-right">
-            <button class="layui-btn" lay-filter="editSubmit" lay-submit="">淇濆瓨</button>
-            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">鍙栨秷</button>
-        </div>
-    </form>
-</script>
 </html>
 
diff --git a/src/main/webapp/views/waitMatoutLog/waitMatoutLog.html b/src/main/webapp/views/waitMatoutLog/waitMatoutLog.html
index 61b0f75..d91dde9 100644
--- a/src/main/webapp/views/waitMatoutLog/waitMatoutLog.html
+++ b/src/main/webapp/views/waitMatoutLog/waitMatoutLog.html
@@ -16,7 +16,7 @@
 <div id="search-box" class="layui-form layui-card-header">
     <div class="layui-inline">
         <div class="layui-input-inline">
-            <input class="layui-input" type="text" name="bill_no" placeholder="缂栧彿" autocomplete="off">
+            <input class="layui-input" type="text" name="condition" placeholder="璇疯緭鍏�" autocomplete="off">
         </div>
     </div>
     <div class="layui-inline">
@@ -55,15 +55,15 @@
 </div>
 <script type="text/html" id="toolbar">
     <div class="layui-btn-container">
-        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>
-        <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>
-        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">瀵煎嚭</button>
+<!--        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>-->
+<!--        <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>-->
+        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="margin-top: 10px">瀵煎嚭</button>
     </div>
 </script>
 
 <script type="text/html" id="operate">
-    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">璇︽儏</a>
-    <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a>
+<!--    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">璇︽儏</a>-->
+<!--    <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a>-->
 </script>
 
 <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>

--
Gitblit v1.9.1