自动化立体仓库 - WMS系统
dubin
2026-01-20 67826a2c51bbc013db409dd1a5e29dd4ba52fd72
初始化
10个文件已删除
2个文件已添加
39个文件已修改
3401 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/LocDetlController.java 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/LocMastController.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MobileController.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/WaitPakinController.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/AdjDetl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/result/MobileAdjustResult.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/LocMastMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/LocMastService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/MobileService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/WrkDetlService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 145 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WrkDetlServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/CodeBuilder.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/model/LocTypeDto.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/service/CommonService.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/web/WcsController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/AdjDetlMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocDetlMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocMastMapper.xml 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WrkMastMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/adjDetl/adjDetl.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/common.js 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locDetl/locDetl.js 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/matInOut/matInOut_old.js 567 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/pakStore/emptyOut.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/stoMan/stoQue.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/waitPakin/waitPakin.js 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/adjDetl/adjDetl.html 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/barcodeMatnr/barcodeMatnr.html 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/barcodeMatnr/barcodeMatnr_clamp.html 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/barcodeMatnr/barcodeMatnr_comb.html 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/barcodeMatnr/barcodeMatnr_detail.html 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/halfBarcode/halfBarcode_old.html 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/mat/mat.html 191 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/matInOut/matInOut_old.html 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pakStore/clampDetlQuery.html 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pakStore/clampDetlQuery_old.html 266 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pakStore/emptyOut.html 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pakStore/locDetlQuery.html 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pda/clamp.html 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pda/comb.html 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pda/index.html 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pda/inventory.html 411 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pda/matQuery.html 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/stoMan/stoQue.html 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/waitPakin/waitPakin.html 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/waitPakin/waitPakin_clamp.html 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/waitPakin/waitPakin_comb.html 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/LocDetlController.java
@@ -13,9 +13,12 @@
import com.core.common.DateUtils;
import com.core.common.R;
import com.zy.asrs.entity.LocDetl;
import com.zy.asrs.entity.ManLocDetl;
import com.zy.asrs.entity.Mat;
import com.zy.asrs.entity.StockStatisDTO;
import com.zy.asrs.mapper.LocDetlMapper;
import com.zy.asrs.service.LocDetlService;
import com.zy.asrs.service.ManLocDetlService;
import com.zy.asrs.service.MatService;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
@@ -57,27 +60,9 @@
        if (!locNos.isEmpty()) {
            List<LocDetl> res = new ArrayList<>();
            for (String locNo : new HashSet<>(locNos)) {
                    List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", locNo));
                    if (!locDetls.isEmpty()) {
                        res.addAll(locDetls);
                    }
                }
            return R.ok().add(res);
        }
        return R.parse(BaseRes.EMPTY);
    }
    @RequestMapping(value = "/locDetlOut/auth")
    @ManagerAuth
    public R stockOutListAll(@RequestParam(value = "locNos[]") List<String> locNos,@RequestParam(value = "matnrs[]",required = false) List<String> matnrs){
        if (!locNos.isEmpty()&&!matnrs.isEmpty()) {
            List<LocDetl> res = new ArrayList<>();
            for (String locNo : new HashSet<>(locNos)) {
                for (String matnr : new HashSet<>(matnrs)) {
                    List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("matnr",matnr).eq("loc_no",locNo));
                    if (!locDetls.isEmpty()) {
                        res.addAll(locDetls);
                    }
                List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", locNo));
                if (!locDetls.isEmpty()) {
                    res.addAll(locDetls);
                }
            }
            return R.ok().add(res);
@@ -88,27 +73,6 @@
    @RequestMapping(value = "/stock/out/list/auth")
    @ManagerAuth
    public R stockOutList(@RequestParam(defaultValue = "1")Integer curr,
                          @RequestParam(defaultValue = "10")Integer limit,
                          @RequestParam Map<String, Object> param){
        if (!Cools.isEmpty(param.get("modi_time"))){
            String val = String.valueOf(param.get("modi_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("modi_time");
            }
        }
        Page<LocDetl> stockOut = locDetlService.getStockOut(toPage(curr, limit, param, LocDetl.class));
        if (stockOut.getRecords().size()==0){
            stockOut = locDetlService.getStockOut(toPage(1, limit, param, LocDetl.class));
        }
        return R.ok(stockOut);
    }
    @RequestMapping(value = "/clamp/out/list/auth")
    @ManagerAuth
    public R clampOutList(@RequestParam(defaultValue = "1")Integer curr,
                          @RequestParam(defaultValue = "10")Integer limit,
                          @RequestParam Map<String, Object> param){
        if (!Cools.isEmpty(param.get("modi_time"))){
src/main/java/com/zy/asrs/controller/LocMastController.java
@@ -23,6 +23,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.Size;
import java.util.*;
@RestController
@@ -222,4 +223,62 @@
        locMastService.insertBatch(list);
        return R.ok("初始化成功");
    }
    @RequestMapping(value = "/locMast/list/auth/lev")
    @ManagerAuth
    public R listLev(@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){
        excludeTrash(param);
        EntityWrapper<LocMast> wrapper = new EntityWrapper<>();
        convertLev(param, wrapper);
        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
        return R.ok(locMastService.selectPage(new Page<>(curr, limit), wrapper));
    }
    private <T> void convertLev(Map<String, Object> map, EntityWrapper<T> wrapper){
        String sizeValue = null;
        // 第一步:先处理size参数
        if (map.containsKey("size")) {
            sizeValue = String.valueOf(map.get("size"));
            map.remove("size");  // 从map中移除,避免后面重复处理
            if (sizeValue.equals("2000*1500*170")){
                wrapper.in("lev1", Arrays.asList(4, 5)).andNew().eq("crn_no", 1);
            }else if (sizeValue.equals("1500*1500*170")){
                wrapper.in("lev1", Arrays.asList(1, 2, 3)).andNew().eq("crn_no", 1);
            }else if (sizeValue.equals("2600*1500*160")){
                wrapper.in("lev1", Arrays.asList(1, 2)).andNew().eq("crn_no", 2);
            }else if (sizeValue.equals("1300*1500*160")){
                wrapper.in("lev1", Arrays.asList(3, 4, 5, 6)).andNew().eq("crn_no", 2);
            }
        }
        // 第二步:处理其他参数
        for (Map.Entry<String, Object> entry : map.entrySet()){
            String key = entry.getKey();
            String val = String.valueOf(entry.getValue());
            if (val.contains(RANGE_TIME_LINK)){
                String[] dates = val.split(RANGE_TIME_LINK);
                wrapper.ge(key, DateUtils.convert(dates[0]));
                wrapper.le(key, DateUtils.convert(dates[1]));
            } else if (key.equals("loc_no")){
                wrapper.like(key, val);
            } else {
                wrapper.eq(key, val);
            }
        }
        // 第三步:如果没有size参数,则添加默认条件
        if (sizeValue == null) {
            wrapper.eq("loc_sts", "D");
        } else {
            // 如果有size参数,添加loc_sts != 'Y'的条件
            wrapper.and().ne("loc_sts", "Y");
        }
    }
}
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -492,11 +492,38 @@
    @RequestMapping("/combMeger/auth")
    @ManagerAuth(memo = "并板")
    public synchronized R adjustNewV2(@RequestBody MobileAdjustParam combParam) {
    public synchronized R adjustNewV2(@RequestBody CombParam combParam) {
        mobileService.adjustNew(combParam, Boolean.TRUE, getUserId());
        return R.ok("并板成功");
    }
    @RequestMapping("/checkDetl/auth/v2")
    @ManagerAuth
    public R getCheckDetlV2(@RequestParam(required = false) String barcode) {
        if (Cools.isEmpty(barcode)) {
            return R.ok();
        }
        WrkMast wrkMast = wrkMastService.selectByBarcode(barcode);
        if (wrkMast != null && (wrkMast.getIoType() == 107 || wrkMast.getIoType() == 57)) {
            List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
            if (!Cools.isEmpty(wrkDetls)) {
                MobileAdjustResult result = new MobileAdjustResult();
                result.setBarcode(barcode);
                result.setWrkNo(wrkMast.getWrkNo());
                result.setWrkDetls(wrkDetls);
                return R.ok().add(result);
            }
        }
        return R.ok();
    }
    @RequestMapping("/inventory/auth")
    @ManagerAuth(memo = "盘点")
    public synchronized R inventory(@RequestBody CombParam combParam) {
        mobileService.inventory(combParam, Boolean.TRUE, getUserId());
        return R.ok("盘点成功");
    }
    @RequestMapping("/empty/plate/out/start")
    @ManagerAuth(memo = "空板出库")
    public R emptyPlateOutStart(EmptyPlateOutParam param) {
src/main/java/com/zy/asrs/controller/WaitPakinController.java
@@ -152,49 +152,4 @@
        }
        return R.ok();
    }
    /*入库通知档界面组托 镇江恒立*/
    @RequestMapping(value = "waitPakin/comb/auth")
    @ManagerAuth
    public R comb(WaitPakin waitPakin) {
        if (Cools.isEmpty(waitPakin.getBarcode())||Cools.isEmpty(waitPakin.getModiUser())||Cools.isEmpty(waitPakin.getAnfme())){
            return R.error(BaseRes.PARAM);
        }
        if (waitPakin.getBarcode().length() != 8) {
            throw new CoolException("条码长度不是8位===>>" + waitPakin.getBarcode());
        }
        if (Integer.parseInt(waitPakin.getBarcode().substring(0,1)) < 4 || Integer.parseInt(waitPakin.getBarcode().substring(0,1)) > 8 ){
            throw new CoolException("不存在的托盘码类型:"+waitPakin.getBarcode().substring(0,1));
        }
        mobileService.combToWms(waitPakin);
        return R.ok("组托成功");
    }
    /*入库通知档界面并板 镇江恒立*/
    @RequestMapping(value = "/waitPakin/clamp/auth")
    @ManagerAuth
    public R clamp(WaitPakin waitPakin) {
        if (Cools.isEmpty(waitPakin.getBarcode())||Cools.isEmpty(waitPakin.getModiUser())||Cools.isEmpty(waitPakin.getAnfme())){
            return R.error(BaseRes.PARAM);
        }
        if (waitPakin.getBarcode().length() != 8) {
            throw new CoolException("条码长度不是8位===>>" + waitPakin.getBarcode());
        }
        if (Integer.parseInt(waitPakin.getBarcode().substring(0,1)) < 4 || Integer.parseInt(waitPakin.getBarcode().substring(0,1)) > 8 ){
            throw new CoolException("不存在的托盘码类型:"+waitPakin.getBarcode().substring(0,1));
        }
        Mat mat = matService.selectById(waitPakin.getModiUser());
        MobileAdjustParam combParam=new MobileAdjustParam();
        ArrayList<CombParam.CombMat> combMats=new ArrayList<>();
        CombParam.CombMat combMat=new CombParam.CombMat();
        combMat.setSpecs(mat.getSpecs());
        combMat.setMatnr(mat.getMatnr());
        combMat.setMaktx(mat.getMaktx());
        combMat.setAnfme(waitPakin.getAnfme());
        combMats.add(combMat);
        combParam.setBarcode(waitPakin.getBarcode());
        combParam.setCombMats(combMats);
        mobileService.adjustNew(combParam, Boolean.TRUE, getUserId());
        return R.ok("并板成功");
    }
}
src/main/java/com/zy/asrs/entity/AdjDetl.java
@@ -38,6 +38,20 @@
    private String locNo;
    /**
     * 托盘条码
     */
    @ApiModelProperty(value= "托盘条码")
    @TableField("barcode")
    private String barcode;
    /**
     * 并板的工作号
     */
    @ApiModelProperty(value= "并板的工作号")
    @TableField("work_no")
    private String workNo;
    /**
     * 商品编号
     */
    @ApiModelProperty(value= "变更商品编号")
@@ -134,8 +148,10 @@
    public AdjDetl() {}
    public AdjDetl(String locNo, String matnr, String batch, Double oriCtns, Double oriQty, Double oriWt, Double adjCtns, Double adjQty, Double adjWt, String memo, Long modiUser, Date modiTime, Long appeUser, Date appeTime) {
    public AdjDetl(String locNo, String barcode, String workNo, String matnr, String batch, Double oriCtns, Double oriQty, Double oriWt, Double adjCtns, Double adjQty, Double adjWt, String memo, Long modiUser, Date modiTime, Long appeUser, Date appeTime) {
        this.locNo = locNo;
        this.barcode = barcode;
        this.workNo = workNo;
        this.matnr = matnr;
        this.batch = batch;
        this.oriCtns = oriCtns;
src/main/java/com/zy/asrs/entity/result/MobileAdjustResult.java
@@ -11,6 +11,8 @@
@Data
public class MobileAdjustResult {
    private String barcode;
    private Integer staNo;
    private Integer wrkNo;
src/main/java/com/zy/asrs/mapper/LocMastMapper.java
@@ -50,4 +50,8 @@
    LocMast queryLocToOne(@Param("locType2") Short locType2);
    LocMast queryLocToTwo(@Param("locType2") Short locType2);
    LocMast queryLocToSpecal(@Param("locType1") Short locType1);
    LocMast queryLocToOneEmpty(@Param("locType2") Short locType2);
}
src/main/java/com/zy/asrs/service/LocMastService.java
@@ -56,4 +56,8 @@
    LocMast queryLocToOne(Short locType2);
    LocMast queryLocToTwo(Short locType2);
    LocMast queryLocToSpecal(Short locType1);
    LocMast queryLocToOneEmpty(Short locType2);
}
src/main/java/com/zy/asrs/service/MobileService.java
@@ -41,7 +41,7 @@
                  Double curOutQty, Integer ioType, Long userId, Date now);
    void adjustNew(MobileAdjustParam param, Boolean re, Long userId);
    void adjustNew(CombParam param, Boolean re, Long userId);
    void combToWms(WaitPakin waitPakin);
    void inventory(CombParam combParam, Boolean aTrue, Long userId);
}
src/main/java/com/zy/asrs/service/WrkDetlService.java
@@ -29,4 +29,6 @@
    boolean updateIoTimeWms(Integer wrkNo, Date now);
    List<PickInParam> selectDetByBarcode(String barcode);
    boolean updateInventoryAnfme(Double anfme, Integer wrkNo, String matnr, String batch);
}
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
@@ -81,6 +81,16 @@
    }
    @Override
    public LocMast queryLocToSpecal(Short locType1) {
        return this.baseMapper.queryLocToSpecal(locType1);
    }
    @Override
    public LocMast queryLocToOneEmpty(Short locType2) {
        return this.baseMapper.queryLocToOneEmpty(locType2);
    }
    @Override
    public Boolean checkWhole(List<LocDetl> locDetls) {
        return null;
    }
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -82,9 +82,6 @@
        if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) {
            throw new CoolException(BaseRes.PARAM);
        }
//        if(param.getCombMats().size()>1){
//            throw new CoolException("请提取一个商品,或者刷新重新组托!");
//        }
        // 判断是否有相同条码的数据
        if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>().
                eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) {
@@ -94,10 +91,6 @@
        if (param.getBarcode().length() != 8) {
            throw new CoolException("条码长度不是8位===>>" + param.getBarcode());
        }
//        if (param.getCombMats().size()>1){
//            throw new CoolException("不允许混料===>>" + param.getBarcode());
//        }
        int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode()));
        int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode()));
        int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode()));
@@ -128,7 +121,7 @@
            for (DetlDto detlDto : detlDtos) {
                Mat mat = matService.selectByMatnr(detlDto.getMatnr());
                if (Cools.isEmpty(mat)) {
                    throw new CoolException(detlDto.getMatnr() + "商品档案不存在");
                    throw new CoolException(detlDto.getMatnr() + "商品档案不存在---->" +  detlDto.getMatnr());
                }
                WaitPakin waitPakin = new WaitPakin();
                waitPakin.sync(mat);
@@ -642,21 +635,27 @@
    @Override
    @Transactional
    public void adjustNew(MobileAdjustParam param, Boolean re, Long userId) {
    public void adjustNew(CombParam param, Boolean re, Long userId) {
        WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", param.getBarcode()));
        if (Cools.isEmpty(wrkMast)) {
            throw new CoolException("托盘码:" + param.getBarcode() + " 无有效工作档");
        }
        if (wrkMast.getWrkSts() != 14){
             throw new CoolException("并板无效,工作档" + wrkMast.getWrkNo() + "未完成或已入库");
        }
        if (wrkMast.getIoType() != 104) {
            throw new CoolException("工作档:" + wrkMast.getWrkNo() + " 不是并板类型");
        }
        List<CombParam.CombMat> combMats = param.getCombMats();
        String recordRecordLog = "托盘码" + param.getBarcode() + "盘点记录:";
        String recordRecordLog = "托盘码" + param.getBarcode() + "并板记录:";
        AdjDetl adjDetl = new AdjDetl();
        adjDetl.setAppeTime(new Date());
        adjDetl.setAppeUser(userId);
        adjDetl.setModiTime(new Date());
        adjDetl.setModiUser(userId);
        adjDetl.setLocNo(wrkMast.getSourceLocNo());
        adjDetl.setLocNo(wrkMast.getSourceLocNo()); // 库位
        adjDetl.setBarcode( param.getBarcode()); //  托盘码
        adjDetl.setWorkNo(wrkMast.getWrkNo().toString()); //并板对应的工作号
        for (CombParam.CombMat wrkDetl : combMats) {
            WrkDetl wrkDetlOld = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>()
@@ -667,84 +666,94 @@
            adjDetl.setMatnr(wrkDetl.getMatnr());
//            adjDetl.setBatch(wrkDetl.getBatch());
            adjDetl.setAdjQty(wrkDetl.getAnfme());
            adjDetl.setBatch(wrkDetl.getBatch());
            adjDetl.setAdjQty(wrkDetl.getAnfme()); //变更数量
            if (Cools.isEmpty(wrkDetlOld)) {
                WrkDetl detl = new WrkDetl();
                detl.sync(wrkDetl);
                detl.setWrkNo(wrkMast.getWrkNo());
                detl.setZpallet(wrkMast.getBarcode());
                detl.setIoTime(new Date());
                wrkDetlService.insert(detl);
                detl.setIoTime(wrkMast.getIoTime()); //并板新增的物料保持原有物料的时间
                detl.setWeight(0.0); // 重量 后面如果需要 再修改
                detl.setModiUser(userId); // 修改人员
                detl.setAppeUser(userId); // 添加人员
                wrkDetlService.insert(detl); // 插入工作明细
                recordRecordLog = recordRecordLog + "\n" + "新增一条明细:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t数量:" + wrkDetl.getAnfme();
                adjDetl.setOriQty(0.0);
                adjDetl.setOriQty(0.0); // 原数量
                adjDetlService.insert(adjDetl);
            } else if (wrkDetlOld.getAnfme() != wrkDetl.getAnfme()) {
            }
//            else if (wrkDetlOld.getAnfme() != wrkDetl.getAnfme()) {
//                wrkDetlService.updateAnfme(wrkDetl.getAnfme() + wrkDetlOld.getAnfme(), wrkMast.getWrkNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
//                recordRecordLog = recordRecordLog + "\n" + "更新一条明细:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t原数量:" + wrkDetlOld.getAnfme() + "\t新增数量:" + wrkDetl.getAnfme();
//                adjDetl.setOriQty(wrkDetlOld.getAnfme()); // 原数量
//                adjDetlService.insert(adjDetl);
//
//            }
//            else if (wrkDetlOld.getAnfme() == wrkDetl.getAnfme()) {
//                recordRecordLog = recordRecordLog + "\n" + "一条明细保持不变:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t数量:" + wrkDetlOld.getAnfme();
//                continue;
//            }
            else {
//                throw new CoolException("托盘码:" + param.getBarcode() + " 未知异常,请联系管理员");
                wrkDetlService.updateAnfme(wrkDetl.getAnfme() + wrkDetlOld.getAnfme(), wrkMast.getWrkNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
                recordRecordLog = recordRecordLog + "\n" + "更新一条明细:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t原数量:" + wrkDetlOld.getAnfme() + "\t新数量:" + wrkDetl.getAnfme();
                adjDetl.setOriQty(wrkDetlOld.getAnfme());
                recordRecordLog = recordRecordLog + "\n" + "更新一条明细:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t原数量:" + wrkDetlOld.getAnfme() + "\t新增数量:" + wrkDetl.getAnfme();
                adjDetl.setOriQty(wrkDetlOld.getAnfme()); // 原数量
                adjDetlService.insert(adjDetl);
            } else if (wrkDetlOld.getAnfme() == wrkDetl.getAnfme()) {
                recordRecordLog = recordRecordLog + "\n" + "一条明细保持不变:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t数量:" + wrkDetlOld.getAnfme();
                continue;
            } else {
                throw new CoolException("托盘码:" + param.getBarcode() + " 未知异常,请联系管理员");
            }
        }
        log.info(recordRecordLog);
    }
    @Override
    public void combToWms(WaitPakin waitPakin) {
        int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", waitPakin.getBarcode()));
        int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", waitPakin.getBarcode()));
        WrkMast wrkMast = wrkMastService.selectByBarcode(waitPakin.getBarcode());
        int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", waitPakin.getBarcode()));
        if (countLoc > 0 || (countWrk > 0 && wrkMast.getWrkSts() != 15)) {
            throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + waitPakin.getBarcode());
    public void inventory(CombParam combParam, Boolean aTrue, Long userId) {
        WrkMast wrkMast = wrkMastService.selectByBarcode(combParam.getBarcode());
        if (Cools.isEmpty(wrkMast)) {
            throw new CoolException("托盘码:" + combParam.getBarcode() + " 无有效工作档");
        }
        if (wrkMast.getWrkSts() != 14) {
            throw new CoolException("盘点无效,工作档" + wrkMast.getWrkNo() + "未完成或已入库");
        }
        if (wrkMast.getIoType() != 107) {
            throw new CoolException("工作档:" + wrkMast.getWrkNo() + " 不是盘点类型");
        }
        Date now = new Date();
        // 生成入库通知档
        List<DetlDto> detlDtos = new ArrayList<>();
        Mat byId = matService.selectById(waitPakin.getModiUser());
        DetlDto detlDto = new DetlDto(byId.getMatnr(), waitPakin.getBatch(), waitPakin.getAnfme(), waitPakin.getProType(), waitPakin.getTemp2(), waitPakin.getOutOrderNo());
            detlDto.setMemo(detlDto.getMemo());
            if (DetlDto.has(detlDtos, detlDto)) {
                DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch());
                assert one != null;
                one.setAnfme(one.getAnfme() + detlDto.getAnfme());
            } else {
                detlDtos.add(detlDto);
        List<CombParam.CombMat> combMats = combParam.getCombMats();
        String recordRecordLog = "托盘码" + combParam.getBarcode() + "盘点记录:";
        for (CombParam.CombMat wrkDetl : combMats) {
            WrkDetl wrkDetlOld = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>()
                            .eq("wrk_no", wrkMast.getWrkNo())
                            .eq("matnr", wrkDetl.getMatnr())
//                    .eq("batch",Cools.isEmpty(wrkDetl.getBatch())?"":wrkDetl.getBatch())
            );
            if (Cools.isEmpty(wrkDetlOld)) {
                WrkDetl detl = new WrkDetl();
                detl.sync(wrkDetl);
                detl.setWrkNo(wrkMast.getWrkNo());
                detl.setZpallet(wrkMast.getBarcode());
                detl.setIoTime(wrkMast.getIoTime()); //盘点新增的物料保持原有物料的时间
                detl.setWeight(0.0); // 重量 后面如果需要 再修改
                detl.setModiUser(userId); // 修改人员
                detl.setAppeUser(userId); // 添加人员
                wrkDetlService.insert(detl); // 插入工作明细
                recordRecordLog = recordRecordLog + "\n" + "新增一条明细:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t数量:" + wrkDetl.getAnfme();
            }
        for (DetlDto dto : detlDtos) {
            Mat mat = matService.selectByMatnr(dto.getMatnr());
            if (Cools.isEmpty(mat)) {
                throw new CoolException(dto.getMatnr() + "商品档案不存在");
            // 更新数量
            else if (!wrkDetlOld.getAnfme().equals(wrkDetl.getAnfme())) {
                wrkDetlService.updateInventoryAnfme(wrkDetl.getAnfme(), wrkMast.getWrkNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
                recordRecordLog = recordRecordLog + "\n" + "更新一条明细:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t原数量:" + wrkDetlOld.getAnfme() + "\t更新数量:" + wrkDetl.getAnfme();
            }
            WaitPakin waitPakin1 = new WaitPakin();
            waitPakin1.sync(mat);
            waitPakin1.setProType(dto.getProType());
            waitPakin1.setTemp2(dto.getTemp2());
            waitPakin1.setOutOrderNo(dto.getOutOrderNo());
            waitPakin1.setBatch(dto.getBatch());
            waitPakin1.setZpallet(waitPakin.getBarcode());   // 托盘码
            waitPakin1.setIoStatus("N");     // 入出状态
            waitPakin1.setAnfme(dto.getAnfme());  // 数量
            waitPakin1.setStatus("Y");    // 状态
            waitPakin1.setAppeUser(waitPakin.getAppeUser());
            waitPakin1.setAppeTime(now);
            waitPakin1.setModiUser(waitPakin.getAppeUser());
            waitPakin1.setModiTime(now);
            waitPakin1.setMemo(detlDto.getMemo());
            if (!waitPakinService.insert(waitPakin1)) {
                throw new CoolException("保存入库通知档失败");
            // 数量保持不变
            else if (wrkDetlOld.getAnfme().equals(wrkDetl.getAnfme())) {
                recordRecordLog = recordRecordLog + "\n" + "一条明细保持不变:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t数量:" + wrkDetlOld.getAnfme();
                continue;
            }
        }
        log.info(recordRecordLog);
    }
}
src/main/java/com/zy/asrs/service/impl/WrkDetlServiceImpl.java
@@ -101,4 +101,13 @@
    public List<PickInParam> selectDetByBarcode(String barcode){
        return this.baseMapper.selectDetByBarcode(barcode);
    }
    @Override
    public boolean updateInventoryAnfme(Double anfme, Integer wrkNo, String matnr, String batch) {
        if (anfme < 0) {
            return this.baseMapper.deleteItem(wrkNo, matnr, batch) > 0;
        } else {
            return baseMapper.updateAnfme(anfme, wrkNo, matnr, batch) > 0;
        }
    }
}
src/main/java/com/zy/asrs/task/handler/WorkMastHandler.java
@@ -109,9 +109,6 @@
                            locDetl.setZpallet(wrkDetl.getZpallet()); // 托盘条码
                            locDetl.setModiTime(now);
                            locDetl.setAppeTime(now);
                            locDetl.setModel(wrkDetl.getModel());
                            locDetl.setTemp1(locMast.getLocType2().toString());//并板出库根据货物类型去选择
                            if (!locDetlService.insert(locDetl)) {
//                                exceptionHandle("全板入库 ===>> 添加库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
@@ -138,6 +135,9 @@
                    }
                    // 修改库位状态 S ====>> F
                    if (locMast.getLocSts().equals("S")) {
                        if (Cools.isEmpty(wrkMast.getBarcode())) {
                            throw new CoolException("入库条码不能为空");
                        }
                        locMast.setLocSts("F");
                        locMast.setBarcode(wrkMast.getBarcode());
                        locMast.setIoTime(now);
@@ -228,8 +228,6 @@
                            locDetl.setModiTime(now);
                            locDetl.setAppeTime(now);
                            locDetl.setTemp1(locMast.getLocType2().toString());//并板出库根据货物类型去选择
                            if (!locDetlService.insert(locDetl)) {
//                                exceptionHandle("并板入库 ===>> 新增库存明细失败;[workNo={0}],[matnr={1}]", wrkMast.getWrkNo(), wrkDetl.getMatnr());
                                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -258,6 +256,30 @@
//                        exceptionHandle("盘点入库 ===>> 工作明细档为空;[workNo={0}]", wrkMast.getWrkNo());
                        TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                        return FAIL.setMsg("盘点入库 ===>> 工作明细档为空; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]");
                    }
                    for (WrkDetl wrkDetl : wrkDetls57) {
                        LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl);
                        if (null != locDetl) {
                            if (!locDetlService.updateAnfme(wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl)) {
//                                exceptionHandle("盘点入库 ===>> 更新库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
                                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                                return FAIL.setMsg("盘点入库 ===>> 更新库存明细失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]");
                            }
                        } else {
                            locDetl = new LocDetl();
                            locDetl.sync(wrkDetl);
                            locDetl.setLocNo(wrkMast.getLocNo()); // 库位号
                            locDetl.setAnfme(wrkDetl.getAnfme()); // 数量
                            locDetl.setZpallet(wrkDetl.getZpallet()); // 托盘条码
                            locDetl.setModiTime(now);
                            locDetl.setAppeTime(now);
                            if (!locDetlService.insert(locDetl)) {
//                                exceptionHandle("盘点入库 ===>> 添加库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo());
                                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                                return FAIL.setMsg("盘点入库 ===>> 添加库存明细失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]");
                            }
                        }
                    }
                    // 修改库位状态 Q ====>> F
                    if (locMast.getLocSts().equals("Q")) {
@@ -381,6 +403,7 @@
                        locMast.setLocSts("O");
                        locMast.setModiTime(now);
                        locMast.setIoTime(now);
                        locMast.setBarcode("");
                        if (!locMastService.updateById(locMast)) {
//                            exceptionHandle("全板出库 ===>> 修改源库位状态失败;[workNo={0}],[sourceLocNo={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo());
                            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
@@ -394,6 +417,7 @@
                    if (locMast.getLocSts().equals("R")) {
                        locMast.setLocSts("O");
                        locMast.setModiTime(now);
                        locMast.setBarcode("");
                        locMast.setIoTime(now);
                        if (!locMastService.updateById(locMast)) {
//                            exceptionHandle("空板出库 ===>> 修改源库位状态失败;[workNo={0}],[sourceLocNo={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo());
src/main/java/com/zy/common/CodeBuilder.java
@@ -17,10 +17,10 @@
//        generator.table="sys_host";
        // sqlserver
        generator.sqlOsType = SqlOsType.SQL_SERVER;
        generator.url="192.168.4.15:1433;databasename=gdykasrs";
        generator.url="127.0.0.1:1433;databasename=rqdzasrs";
        generator.username="sa";
        generator.password="sa@123";
        generator.table="man_auto_move";
        generator.table="asr_adj_detl";
        generator.packagePath="com.zy.asrs";
        generator.build();
    }
src/main/java/com/zy/common/model/LocTypeDto.java
@@ -13,10 +13,10 @@
@Data
public class LocTypeDto {
    // 高低类型{0:未知,1:低库位,5:高库位,2:中库位,6:超高库位}
    // 高低类型{0:未知,1:低库位,2:高库位}
    private Short locType1;
    // 宽窄类型{0:未知,1:窄库位,2:宽库位}
    // 宽窄类型{0:未知,1:窄库位,2:宽库位 托盘码的首位是多少 这个字段就是多少 根据此字段分配库位到不同的堆垛机 不同的层}
    private Short locType2;
    // 轻重类型{0:未知,1:轻库位,2:重库位}
@@ -32,11 +32,7 @@
        if (basDevp.getLocType1() == 1) {
            this.locType1 = 1; // 低库位
        } else if (basDevp.getLocType1() ==2){
            this.locType1 = 2; // 中库位
        } else if (basDevp.getLocType1() == 5){
            this.locType1 = 5; // 高库位
        }else if (basDevp.getLocType1() == 6){
            this.locType1 = 6;//超高库位
            this.locType1 = 2; // 高库位
        }
        log.info(JSON.toJSONString(this));
    }
src/main/java/com/zy/common/service/CommonService.java
@@ -119,7 +119,15 @@
    @Transactional
    public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, LocTypeDto locTypeDto) {
        whsType = Utils.GetWhsType(sourceStaNo);
        return getLocNoToOne(whsType, staDescId, sourceStaNo, matnr, batch, grade, 0, locTypeDto, 0);
        StartupDto startupDto = new StartupDto();
        if (staDescId == 1){
            // 满托盘入库
            startupDto =  getLocNoToOne(whsType, staDescId, sourceStaNo, matnr, batch, grade, 0, locTypeDto, 0);
        }else if (staDescId == 10){
            // 空托盘入库
            startupDto =  getLocNoToTwo(whsType, staDescId, sourceStaNo, matnr, batch, grade, 0, locTypeDto, 0);
        }
        return startupDto;
    }
    /**
@@ -378,18 +386,76 @@
        return startupDto;
    }
    /*镇江恒立单伸立库逻辑*/
    /*镇江恒立单伸立库逻辑 满托盘入库*/
    @Transactional
    public StartupDto getLocNoToOne(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, Integer moveCrnNo, LocTypeDto locTypeDto, int times) {
        //目标库位
        LocMast locMast = null;
        if (locTypeDto.getLocType2()==5||locTypeDto.getLocType2()==6||locTypeDto.getLocType2()==4){
            //1号巷道 3种货物类型
        if (locTypeDto.getLocType2()==5){
            //1号巷道 单独的托盘
            locMast=locMastService.queryLocToOne(locTypeDto.getLocType2());
        }else if (locTypeDto.getLocType2() == 6){
            //1号巷道 混用托盘
            locMast=locMastService.queryLocToSpecal(locTypeDto.getLocType1());
        }else if (locTypeDto.getLocType2()==7||locTypeDto.getLocType2()==8){
            //2号巷道 2种货物类型
            locMast=locMastService.queryLocToTwo(locTypeDto.getLocType2());
        }else {
            throw new CoolException("不存在该库位类型:"+locTypeDto.getLocType2());
        }
        if (locMast == null){
            throw new CoolException("入库没有空库位");
        }
        //堆垛机号
        Integer crnNo = locMast.getCrnNo();
        //获取目标站
        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("入库路径不存在,staDesc={},sourceStaNo={},crnNo={}",1,staDescId,crnNo);
            throw new CoolException("入库路径不存在");
        }
        //检测目标站
        BasDevp staNo = basDevpService.selectById(staDesc.getCrnStn());
        if (!staNo.getAutoing().equals("Y")){
            throw new CoolException("目标站"+staDesc.getCrnStn()+"不可用");
        }
        //生成工作号
        int workNo = getWorkNo(0);
        //返回dto
        StartupDto startupDto =new StartupDto();
        startupDto.setWorkNo(workNo);
        startupDto.setLocNo(locMast.getLocNo());
        startupDto.setStaNo(staNo.getDevNo());
        startupDto.setCrnNo(crnNo);
        startupDto.setSourceStaNo(sourceStaNo);
        return startupDto;
    }
    /*镇江恒立单伸立库逻辑 空托盘入库*/
    @Transactional
    public StartupDto getLocNoToTwo(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, Integer moveCrnNo, LocTypeDto locTypeDto, int times) {
        //目标库位
        LocMast locMast = null;
        if (locTypeDto.getLocType2()==5 || locTypeDto.getLocType2() == 6){
            //1号巷道
            locMast=locMastService.queryLocToOneEmpty(locTypeDto.getLocType2());
        }else if (locTypeDto.getLocType2()==7||locTypeDto.getLocType2()==8){
            //2号巷道 2种货物类型
            locMast=locMastService.queryLocToTwo(locTypeDto.getLocType2());
        }else {
            throw new CoolException("不存在该库位类型:"+locTypeDto.getLocType2());
        }
src/main/java/com/zy/common/web/WcsController.java
@@ -108,15 +108,13 @@
        LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo);
        if (param.getBarcode().startsWith("5")){
            locTypeDto.setLocType2((short) 5);
            locTypeDto.setLocType2((short) 5); // 2000*1500*170 1巷道 4、5层
        }else if (param.getBarcode().startsWith("6")){
            locTypeDto.setLocType2((short) 6);
            locTypeDto.setLocType2((short) 6); // 1500*1500*170(有两种 托盘一样 载重不一样 需要单独根据 托盘码 + 高低 来写分库位的逻辑) 1巷道 1、2、3层
        }else if (param.getBarcode().startsWith("7")){
            locTypeDto.setLocType2((short) 7);
            locTypeDto.setLocType2((short) 7); // 2600*1500*160 2巷道 1、2层
        }else if (param.getBarcode().startsWith("8")){
            locTypeDto.setLocType2((short) 8);
        }else if (param.getBarcode().startsWith("4")){
            locTypeDto.setLocType2((short) 4);
            locTypeDto.setLocType2((short) 8); // 1300*1500*160 2巷道 3、4、5、6层
        }else {
            return R.error("条码规则不存在:"+param.getBarcode());
        }
@@ -125,7 +123,7 @@
        switch (param.getIoType()) {
            case 1://满托盘入库
                assert waitPakins != null;
                dto = startupFullPutStore(param.getSourceStaNo(), param.getBarcode(),param.getWeight(), locTypeDto, waitPakins);
                dto = startupFullPutStore(param.getSourceStaNo(), param.getBarcode(), param.getWeight(), locTypeDto, waitPakins);
                break;
            case 10://空托盘入库
                dto = emptyPlateIn(param.getSourceStaNo(), locTypeDto, param.getBarcode());
src/main/resources/application.yml
@@ -33,7 +33,7 @@
logging:
  path: /stock/out/@pom.build.finalName@/logs
  path: ./stock/out/@pom.build.finalName@/logs
super:
  pwd: xltys1995
src/main/resources/mapper/AdjDetlMapper.xml
@@ -6,6 +6,8 @@
    <resultMap id="BaseResultMap" type="com.zy.asrs.entity.AdjDetl">
        <id column="adj_id" property="adjId" />
        <result column="loc_no" property="locNo" />
        <result column="barcode" property="barcode" />
        <result column="work_no" property="workNo" />
        <result column="matnr" property="matnr" />
        <result column="matnr_old" property="matnrOld" />
        <result column="batch" property="batch" />
src/main/resources/mapper/LocDetlMapper.xml
@@ -152,6 +152,7 @@
        update asr_loc_detl
        set anfme = #{anfme}
        , modi_time = getdate()
        , appe_time = getdate()
        where 1=1
        and loc_no = #{locNo}
        and matnr = #{locDetl.matnr}
@@ -244,7 +245,7 @@
        select * from
        (
        select
        ROW_NUMBER() over (order by a.appe_time,a.matnr,a.loc_no) as row,
        ROW_NUMBER() over (order by a.modi_time, a.loc_no) as row,
        a.*
        from asr_loc_detl a
        left join asr_loc_mast b on a.loc_no = b.loc_no
src/main/resources/mapper/LocMastMapper.xml
@@ -123,13 +123,7 @@
    <select id="queryLocToOne" resultMap="BaseResultMap">
        select top 1 * from asr_loc_mast
        where loc_sts = 'O' and row1 in (1,2)
        <if test="locType2 == 4">
            and lev1 in(1)
        </if>
        <if test="locType2 == 5">
            and lev1 in(2,3)
        </if>
        <if test="locType2 == 6">
            and lev1 in(4,5)
        </if>
        order by lev1 asc,bay1 asc
@@ -146,4 +140,28 @@
        </if>
        order by lev1 asc,bay1 asc
    </select>
    <select id="queryLocToSpecal" resultMap="BaseResultMap">
        select top 1 * from asr_loc_mast
        where loc_sts = 'O' and row1 in (1,2)
        <if test="locType1 == 1">
            and lev1 in(1)
        </if>
        <if test="locType1 == 2">
            and lev1 in(2,3)
        </if>
        order by lev1 asc,bay1 asc
    </select>
    <select id="queryLocToOneEmpty" resultMap="BaseResultMap">
        select top 1 * from asr_loc_mast
        where loc_sts = 'O' and row1 in (1,2)
        <if test="locType2 == 5">
            and lev1 in(4,5)
        </if>
        <if test="locType2 == 6">
            and lev1 in(1,2,3)
        </if>
        order by lev1 asc,bay1 asc
    </select>
</mapper>
src/main/resources/mapper/WrkMastMapper.xml
@@ -70,7 +70,7 @@
        select * from asr_wrk_mast
        where wrk_sts=5
        or (wrk_sts=15 and ove_mk='Y' and wrk_no not in (select wrk_no from asr_bas_devp))
        or (wrk_sts=15 and dateadd(mi,5,crn_end_time) &lt;= getdate() and wrk_no not in (select wrk_no from asr_bas_devp))
        or (wrk_sts=15 and dateadd(mi,1,crn_end_time) &lt;= getdate() and wrk_no not in (select wrk_no from asr_bas_devp))
        or (wrk_sts=15 and crn_end_time is null and wrk_no not in (select wrk_no from asr_bas_devp))
        order by io_time,wrk_no asc
    </select>
src/main/webapp/static/js/adjDetl/adjDetl.js
@@ -22,6 +22,8 @@
//            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
//             {field: 'adjId', align: 'center',title: '序号'}
            {field: 'locNo', align: 'center',title: '库位号'}
            ,{field: 'barcode', align: 'center',title: '托盘条码'}
            ,{field: 'workNo', align: 'center',title: '工作号'}
            ,{field: 'matnrOld', align: 'center',title: '原品号'}
            ,{field: 'matnr', align: 'center',title: '当前品号'}
            ,{field: 'batch', align: 'center',title: '批号'}
src/main/webapp/static/js/common.js
@@ -186,14 +186,13 @@
    // ,{field: 'uuid', align: 'center',title: '编号'}
    // ,{field: 'tagId$', align: 'center',title: '所属归类'}
    ,{field: 'maktx', align: 'center',title: '商品名称', width: 200}
    // ,{field: 'name', align: 'center',title: '别名'}
    ,{field: 'name', align: 'center',title: '别名'}
    ,{field: 'specs', align: 'center',title: '规格'}
    ,{field: 'name', align: 'center',title: '型号'}
    ,{field: 'color', align: 'center',title: '颜色', hide: true}
    ,{field: 'brand', align: 'center',title: '品牌', hide: true}
    ,{field: 'unit', align: 'center',title: '单位', hide: true}
    ,{field: 'price', align: 'center',title: '单价', hide: true}
    ,{field: 'sku', align: 'center',title: '材质', hide: true}
    ,{field: 'sku', align: 'center',title: 'sku', hide: true}
    ,{field: 'units', align: 'center',title: '单位量', hide: true}
    ,{field: 'barcode', align: 'center',title: '条码', hide: true}
    ,{field: 'origin', align: 'center',title: '产地', hide: true}
@@ -201,10 +200,10 @@
    ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true}
    ,{field: 'itemNum', align: 'center',title: '品项数', hide: true}
    ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true}
    ,{field: 'weight', align: 'center',title: '总重量', hide: true}
    ,{field: 'length', align: 'center',title: '模孔数', hide: true}
    ,{field: 'volume', align: 'center',title: '开模壁厚', hide: true}
    ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true}
    ,{field: 'weight', align: 'center',title: '重量', hide: true}
    ,{field: 'length', align: 'center',title: '长度', hide: true}
    ,{field: 'volume', align: 'center',title: '体积', hide: true}
    ,{field: 'threeCode', align: 'center',title: '三方编码', hide: true}
    ,{field: 'supp', align: 'center',title: '供应商', hide: true}
    ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true}
    ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true}
@@ -219,10 +218,10 @@
    ,{field: 'updateBy$', align: 'center',title: '修改人员', hide: true}
    ,{field: 'updateTime$', align: 'center',title: '修改时间', hide: true}
    ,{field: 'memo', align: 'center',title: '备注', hide: true}
    ,{field: 'proType', align: 'center',title: '属性', hide: false}
    ,{field: 'temp1', align: 'center',title: '名称总称', hide: true}
    ,{field: 'outOrderNo', align: 'center',title: '合同号', hide: true}
    ,{field: 'temp2', align: 'center',title: '客户图号', hide: true}
//    ,{field: 'proType', align: 'center',title: '属性', hide: true}
//    ,{field: 'temp1', align: 'center',title: 'temp1', hide: true}
//    ,{field: 'outOrderNo', align: 'center',title: '合同号', hide: true}
//    ,{field: 'temp2', align: 'center',title: 'temp2', hide: true}
]
@@ -231,7 +230,7 @@
    {field: 'matnr', align: 'center',title: '商品编码', sort:true}
    ,{field: 'model', align: 'center',title: '型号', hide: false}
    ,{field: 'maktx', align: 'center',title: '商品名称', sort:true}
    ,{field: 'orderNo', align: 'center',title: '单据编号', hide: true}
    ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false}
    ,{field: 'spgNO', align: 'center',title: '派工单号', hide:true,sort:true}
    ,{field: 'batch', align: 'center',title: '批次', hide:true,sort:true}
    ,{field: 'outOrderNo', align: 'center',title: '合同号', sort:true, hide: true}
@@ -242,7 +241,7 @@
    ,{field: 'color', align: 'center',title: '颜色', hide: true}
    ,{field: 'brand', align: 'center',title: '品牌', hide: true}
    ,{field: 'price', align: 'center',title: '单价', hide: true}
    ,{field: 'sku', align: 'center',title: '材质', hide: true}
    ,{field: 'sku', align: 'center',title: 'sku', hide: true}
    ,{field: 'units', align: 'center',title: '单位量', hide: true}
    ,{field: 'barcode', align: 'center',title: '条码', hide: true}
    ,{field: 'origin', align: 'center',title: '产地', hide: true}
@@ -250,11 +249,11 @@
    ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true}
    ,{field: 'itemNum', align: 'center',title: '品项数', hide: true}
    ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true}
    ,{field: 'weight', align: 'center',title: '总重量', hide: true}
    ,{field: 'length', align: 'center',title: '单箱毛重', hide: true}
    ,{field: 'volume', align: 'center',title: '单箱体积', hide: true}
    ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true}
    ,{field: 'supp', align: 'center',title: '客户名称', hide:false }
    ,{field: 'weight', align: 'center',title: '重量', hide: true}
    ,{field: 'length', align: 'center',title: '长度', hide: true}
    ,{field: 'volume', align: 'center',title: '体积', hide: true}
    ,{field: 'threeCode', align: 'center',title: '三方编码', hide: true}
    ,{field: 'supp', align: 'center',title: '供应商', hide:false }
    ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true}
    ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true}
    ,{field: 'deadTime', align: 'center',title: '保质期', hide: true}
@@ -262,50 +261,8 @@
    ,{field: 'source$', align: 'center',title: '制购', hide: true}
    ,{field: 'check$', align: 'center',title: '要求检验', hide: true}
    ,{field: 'danger$', align: 'center',title: '危险品', hide: true}
    ,{field: 'proType', align: 'center',title: '属性', hide: false}
    ,{field: 'temp1', align: 'center',title: '名称总称', hide: true}
    ,{field: 'temp2', align: 'center',title: '客户图号', hide: true}
]
var halfBarcodeCols = [
    {field: 'matnr', align: 'center',title: '商品编码', sort:true, hide: true}
    ,{field: 'model', align: 'center',title: '型号', hide: true}
    ,{field: 'maktx', align: 'center',title: '商品名称', sort:true, hide: true}
    ,{field: 'orderNo', align: 'center',title: '单据编号', hide: true}
    ,{field: 'spgNO', align: 'center',title: '派工单号', hide:true,sort:true}
    ,{field: 'batch', align: 'center',title: '批次', hide:true,sort:true}
    ,{field: 'outOrderNo', align: 'center',title: '合同号', sort:true, hide: true}
    ,{field: 'unit', align: 'center',title: '单位', hide: true}
    ,{field: 'zpallet', align: 'center',title: '托盘条码', hide: false}
    ,{field: 'anfme', align: 'center',title: '绑定数量', hide: false}
    ,{field: 'specs', align: 'center',title: '规格', hide: true}
    ,{field: 'color', align: 'center',title: '颜色', hide: true}
    ,{field: 'brand', align: 'center',title: '品牌', hide: true}
    ,{field: 'price', align: 'center',title: '单价', hide: true}
    ,{field: 'sku', align: 'center',title: '材质', hide: true}
    ,{field: 'units', align: 'center',title: '单位量', hide: true}
    ,{field: 'barcode', align: 'center',title: '条码', hide: true}
    ,{field: 'origin', align: 'center',title: '产地', hide: true}
    ,{field: 'manu', align: 'center',title: '厂家', hide: true}
    ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true}
    ,{field: 'itemNum', align: 'center',title: '品项数', hide: true}
    ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true}
    ,{field: 'weight', align: 'center',title: '总重量', hide: true}
    ,{field: 'length', align: 'center',title: '单箱毛重', hide: true}
    ,{field: 'volume', align: 'center',title: '单箱体积', hide: true}
    ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true}
    ,{field: 'price', align: 'center',title: '可放数量', hide:false }
    ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true}
    ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true}
    ,{field: 'deadTime', align: 'center',title: '保质期', hide: true}
    ,{field: 'deadWarn', align: 'center',title: '预警天数', hide: true}
    ,{field: 'source$', align: 'center',title: '制购', hide: true}
    ,{field: 'check$', align: 'center',title: '要求检验', hide: true}
    ,{field: 'danger$', align: 'center',title: '危险品', hide: true}
    ,{field: 'proType', align: 'center',title: '属性', hide: true}
    ,{field: 'temp1', align: 'center',title: '名称总称', hide: true}
    ,{field: 'temp2', align: 'center',title: '客户图号', hide: true}
//    ,{field: 'proType', align: 'center',title: '属性', hide: false}
//    ,{field: 'temp1', align: 'center',title: 'temp1', hide: true}
//    ,{field: 'temp2', align: 'center',title: 'temp2', hide: true}
]
src/main/webapp/static/js/locDetl/locDetl.js
@@ -17,15 +17,6 @@
        ,{field: 'brand', align: 'center',title: '品牌', hide: true}
        ,{field: 'unit', align: 'center',title: '单位', hide: true}
        ,{field: 'price', align: 'center',title: '单价', hide: true}
        //,{fixed: 'right', title:'简图', align: 'center', toolbar: '#operate1', width: 300}
        // ,{fixed: 'right', align: 'center',title: '简图', templet:function(row){
        //         var html = "<img  src='http://127.0.0.1:8080/czkhasrs/previewImage?maktx=" +row.maktx+"'/>";
        //         return html;
        // }}
        /*,{fixed: 'right', align: 'center', title: '简图', templet: function(row){
                var html = "<a href='http://127.0.0.1:8080/czkhasrs/previewImage?maktx=" + row.maktx + "' target='_blank' rel='noopener noreferrer'>查看简图</a>";
                return html;
        }}*/
        ,{field: 'units', align: 'center',title: '单位量', hide: true}
        ,{field: 'barcode', align: 'center',title: '条码', hide: true}
        ,{field: 'origin', align: 'center',title: '产地', hide: true}
@@ -33,10 +24,10 @@
        ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true}
        ,{field: 'itemNum', align: 'center',title: '品项数', hide: true}
        ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true}
        ,{field: 'weight', align: 'center',title: '总重', hide: true}
        ,{field: 'length', align: 'center',title: '单箱毛重', hide: true}
        ,{field: 'volume', align: 'center',title: '单箱体积', hide: true}
        ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true}
        ,{field: 'weight', align: 'center',title: '重量', hide: true}
        ,{field: 'length', align: 'center',title: '长度', hide: true}
        ,{field: 'volume', align: 'center',title: '体积', hide: true}
        ,{field: 'threeCode', align: 'center',title: '三方编码', hide: true}
        ,{field: 'supp', align: 'center',title: '供应商', hide: true}
        ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true}
        ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true}
@@ -46,8 +37,8 @@
        ,{field: 'check$', align: 'center',title: '要求检验', hide: true}
        ,{field: 'danger$', align: 'center',title: '危险品', hide: true}
        ,{field: 'proType', align: 'center',title: '属性', hide: false}
        ,{field: 'temp1', align: 'center',title: '名称总称', hide: true}
        ,{field: 'temp2', align: 'center',title: '客户图号', hide: true}
//        ,{field: 'temp1', align: 'center',title: 'temp1', hide: true}
//        ,{field: 'temp2', align: 'center',title: 'temp2', hide: true}
    ];
src/main/webapp/static/js/matInOut/matInOut_old.js
File was deleted
src/main/webapp/static/js/pakStore/emptyOut.js
@@ -37,7 +37,7 @@
    tableIns = table.render({
        elem: '#locMast',
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/locMast/list/auth',
        url: baseUrl+'/locMast/list/auth/lev',
        page: true,
        limit: 16,
        limits: [16, 30, 50, 100, 200, 500],
@@ -51,7 +51,7 @@
            ,{field: 'locNo', align: 'center',title: '库位号',sort:true}
            ,{field: 'locSts$', align: 'center',title: '库位状态',width:200}
            // ,{field: 'whsType$', align: 'center',title: '库位类型'}
            ,{field: 'locType2$', align: 'center',title: '托盘类型'}
            ,{field: 'barcode', align: 'center',title: '托盘条码'}
            ,{field: 'crnNo', align: 'center',title: '堆垛机号'}
            ,{field: 'row1', align: 'center',title: '排'}
            ,{field: 'bay1', align: 'center',title: '列'}
src/main/webapp/static/js/stoMan/stoQue.js
@@ -33,12 +33,12 @@
            ,{field: 'row1', align: 'center',title: '排'}
            ,{field: 'bay1', align: 'center',title: '列'}
            ,{field: 'lev1', 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 ";}
                    html += "disabled='disabled' >";
                    return html;
                },width:80}
            // ,{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 ";}
            //         html += "disabled='disabled' >";
            //         return html;
            //     },width:80}
            ,{field: 'barcode', align: 'center',title: '条码号'}
            ,{field: 'locType1$', align: 'center',title: '大小类型'}
            ,{field: 'modiUser$', align: 'center',title: '修改人员'}
src/main/webapp/static/js/waitPakin/waitPakin.js
@@ -169,34 +169,6 @@
                    });
                }
                break;
            case 'combData':
                layer.open({
                    type: 2,
                    title: '组托',
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    content: 'waitPakin_comb.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 'clampData':
                layer.open({
                    type: 2,
                    title: '并板',
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    content: 'waitPakin_clamp.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 'exportData':
                layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){
                    var titles=[];
@@ -363,24 +335,6 @@
            return;
        }
        method("add");
    });
    // 数据组托动作
    form.on('submit(comb)', function () {
        if (banMsg != null){
            layer.msg(banMsg);
            return;
        }
        method("comb");
    });
    // 数据并板动作
    form.on('submit(clamp)', function () {
        if (banMsg != null){
            layer.msg(banMsg);
            return;
        }
        method("clamp");
    });
    // 数据修改动作
src/main/webapp/views/adjDetl/adjDetl.html
@@ -21,6 +21,16 @@
    </div>
    <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="work_no" placeholder="工作号" autocomplete="off">
        </div>
    </div>
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input class="layui-input" type="text" name="matnr" placeholder="当前品号" autocomplete="off">
        </div>
    </div>
src/main/webapp/views/barcodeMatnr/barcodeMatnr.html
File was deleted
src/main/webapp/views/barcodeMatnr/barcodeMatnr_clamp.html
File was deleted
src/main/webapp/views/barcodeMatnr/barcodeMatnr_comb.html
File was deleted
src/main/webapp/views/barcodeMatnr/barcodeMatnr_detail.html
File was deleted
src/main/webapp/views/halfBarcode/halfBarcode_old.html
File was deleted
src/main/webapp/views/mat/mat.html
@@ -86,15 +86,15 @@
                    <!-- 表格工具栏2 -->
                    <div id="search-box" class="layui-form toolbar"  style="padding-top: 5px">
                        <div class="layui-inline">
                            <label class="layui-form-label" style="padding: 8px 15px 8px 15px">商品编码:</label>
                            <label class="layui-form-label" style="padding: 8px 15px 8px 15px">商品编号:</label>
                            <div class="layui-input-inline">
                                <input name="matnr" class="layui-input" placeholder="输入商品编码"/>
                                <input name="matnr" class="layui-input" placeholder="输入商品编号"/>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label" style="padding: 8px 15px 8px 15px">型号:</label>
                            <label class="layui-form-label" style="padding: 8px 15px 8px 15px">商品名称:</label>
                            <div class="layui-input-inline">
                                <input name="name" class="layui-input" placeholder="输入型号"/>
                                <input name="maktx" class="layui-input" placeholder="输入商品名称"/>
                            </div>
                        </div>
                        <div class="layui-inline">
@@ -128,8 +128,6 @@
        <button class="layui-btn layui-btn-sm" id="btn-print-batch" lay-event="btnPrintBatch">批量打印</button>
        <button class="layui-btn layui-btn-sm layui-btn-normal" id="btn-add" lay-event="addData">新增</button>
        <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button>
<!--        <button class="layui-btn layui-btn-sm layui-btn-danger"><a onclick="importImage()" style="font-size: 15px"><i class="layui-icon layui-icon-upload"></i>上传简图</a></button>-->
        <li style="display: none"><input id="importImage" type="file" onchange="uploadImage(this)" ></li>
        <!-- 商品/物料 数据中心 -->
        <div class="dropdown-menu" style="float: right">
            <button class="layui-btn layui-btn-primary layui-border-black icon-btn layui-btn-sm">&nbsp;数据同步 <i class="layui-icon layui-icon-drop"></i></button>
@@ -150,7 +148,6 @@
<script type="text/html" id="operate">
    <a class="layui-btn layui-btn-xs btn-edit layui-btn-primary" lay-event="edit">修改</a>
<!--    <a class="layui-btn layui-btn-xs btn-edit layui-btn-primary" lay-event="editBarcode">绑定</a>-->
    <button class="layui-btn layui-btn-xs btn-print" lay-event="btnPrint">打印</button>
</script>
@@ -202,184 +199,56 @@
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商品编码</label>
                    <div class="layui-input-block">
                        <input name="matnr" placeholder="请输入商品编码" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">型号</label>
                    <div class="layui-input-block">
                        <input name="name" placeholder="请输入型号" class="layui-input">
                    </div>
                </div>
<!--                <div class="layui-form-item">-->
<!--                    <label class="layui-form-label">开模壁厚</label>-->
<!--                    <div class="layui-input-block">-->
<!--                        <input name="volume" placeholder="请输入开模壁厚" class="layui-input">-->
<!--                    </div>-->
<!--                </div>-->
            </div>
            <div class="layui-col-md6">
<!--                <div class="layui-form-item">-->
<!--                    <label class="layui-form-label layui-form-required">模具名称</label>-->
<!--                    <div class="layui-input-block">-->
<!--                        <input id="matnr" name="matnr" placeholder="请输入模具名称" class="layui-input" lay-vertype="tips" lay-verify="required" required="">-->
<!--                    </div>-->
<!--                </div>-->
                <div class="layui-form-item">
                    <label class="layui-form-label">规格</label>
                    <div class="layui-input-block">
                        <input name="specs" placeholder="请输入代码" class="layui-input">
                    </div>
                </div>
<!--                <div class="layui-form-item">-->
<!--                    <label class="layui-form-label">备注</label>-->
<!--                    <div class="layui-input-block">-->
<!--                        <input name="memo" placeholder="请输入备注" class="layui-input">-->
<!--                    </div>-->
<!--                </div>-->
                <div class="layui-form-item">
                    <label class="layui-form-label">颜色</label>
                    <div class="layui-input-block">
                        <input name="color" placeholder="颜色" class="layui-input">
                    </div>
                </div>
<!--                <div class="layui-form-item">-->
<!--                    <label class="layui-form-label">颜色</label>-->
<!--                    <div class="layui-input-block">-->
<!--                        <select id="color" name="color" lay-filter="color" placeholder="请选择状态">-->
<!--                        <option value="">请选择状态</option>-->
<!--                        <option value="正常" name="color" class="layui-input">正常</option>-->
<!--                        <option value="报废" name="color" class="layui-input">报废</option>-->
<!--                        </select>-->
<!--                    </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>
<!-- 表单弹窗 -->
<script type="text/html" id="editDialogBarcode">
    <form id="detailBarcode" lay-filter="detail" class="layui-form admin-form">
        <input name="id" type="hidden">
        <input name="uuid" type="hidden">
        <input name="nodeId" type="hidden">
        <input name="tag_id" type="hidden">
        <input name="model" type="hidden">
        <input name="name" type="hidden">
        <input name="batch" type="hidden">
        <input name="docId" type="hidden">
        <input name="docNum" type="hidden">
        <input name="custName" type="hidden">
        <input name="itemNum" type="hidden">
        <input name="count" type="hidden">
        <input name="weight" type="hidden">
        <input name="status" type="hidden">
        <input name="createBy" type="hidden">
        <input name="updateTime$" type="hidden">
        <input name="updateBy" type="hidden">
        <div class="layui-row">
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">分类</label>
                    <div class="layui-input-block">
                        <div id="tagSelBarcode" class="ew-xmselect-tree"></div>
                        <input name="specs" placeholder="请输入规格" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">型材型号</label>
                    <label class="layui-form-label">重量</label>
                    <div class="layui-input-block">
                        <input name="maktx" placeholder="请输入型材型号" class="layui-input" lay-vertype="tips" lay-verify="required" required="">
                        <input name="weight" placeholder="重量" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">模具名称</label>
                    <label class="layui-form-label">体积</label>
                    <div class="layui-input-block">
                        <input name="matnr" placeholder="请输入模具名称" class="layui-input">
                        <input name="volume" placeholder="请输入体积" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">型号</label>
                    <div class="layui-input-block">
                        <input name="name" placeholder="请输入型号" class="layui-input">
                    </div>
                </div>
                <!--                <div class="layui-form-item">-->
                <!--                    <label class="layui-form-label">开模壁厚</label>-->
                <!--                    <div class="layui-input-block">-->
                <!--                        <input name="volume" placeholder="请输入开模壁厚" class="layui-input">-->
                <!--                    </div>-->
                <!--                </div>-->
            </div>
            <div class="layui-col-md6">
                <!--                <div class="layui-form-item">-->
                <!--                    <label class="layui-form-label layui-form-required">模具名称</label>-->
                <!--                    <div class="layui-input-block">-->
                <!--                        <input id="matnr" name="matnr" placeholder="请输入模具名称" class="layui-input" lay-vertype="tips" lay-verify="required" required="">-->
                <!--                    </div>-->
                <!--                </div>-->
                <div class="layui-form-item">
                    <label class="layui-form-label">规格</label>
                    <label class="layui-form-label layui-form-required">商品编号</label>
                    <div class="layui-input-block">
                        <input name="specs" placeholder="请输入代码" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">托盘码</label>
                    <div class="layui-input-block">
                        <input name="unit" placeholder="请输入托盘码" class="layui-input">
                        <input id="matnr" name="matnr" placeholder="请输入商品编号" class="layui-input" lay-vertype="tips" lay-verify="required" required="">
                    </div>
                </div>
                <!--                <div class="layui-form-item">-->
                <!--                    <label class="layui-form-label">备注</label>-->
                <!--                    <div class="layui-input-block">-->
                <!--                        <input name="memo" placeholder="请输入备注" class="layui-input">-->
                <!--                    </div>-->
                <!--                </div>-->
                <div class="layui-form-item">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <input name="memo" placeholder="请输入备注" class="layui-input">
                    </div>
                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">状态</label>
                                    <div class="layui-input-block">
                                        <input name="color" placeholder="" class="layui-input">
                                    </div>
                                </div>
<!--                <div class="layui-form-item">-->
<!--                    <label class="layui-form-label">状态</label>-->
<!--                    <div class="layui-input-block">-->
<!--                        <select id="colorBarcode" name="color" lay-filter="color" placeholder="请选择状态">-->
<!--                            <option value="">请选择状态</option>-->
<!--                            <option value="正常" name="color" class="layui-input">正常</option>-->
<!--                            <option value="报废" name="color" class="layui-input">报废</option>-->
<!--                        </select>-->
<!--                    </div>-->
<!--                </div>-->
                <div class="layui-form-item">
                    <label class="layui-form-label">长度</label>
                    <div class="layui-input-block">
                        <input name="length" placeholder="请输入长度" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">三方编码</label>
                    <div class="layui-input-block">
                        <input name="threeCode" placeholder="请输入三方编码" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
src/main/webapp/views/matInOut/matInOut_old.html
File was deleted
src/main/webapp/views/pakStore/clampDetlQuery.html
@@ -77,39 +77,17 @@
                <input class="layui-input" type="text" name="zpallet" placeholder="托盘码"  autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <select name="temp1">
                    <option value="">请选择托盘类型</option>
                    <option value="4">1500*1500*870</option>
                    <option value="5">1500*1500*1670</option>
                    <option value="6">2000*1500*2170</option>
                    <option value="7">2600*1500*660</option>
                    <option value="8">1300*1500*1460</option>
                </select>
            </div>
        </div>
        <!--<div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="temp1" placeholder="总称" autocomplete="off">
            </div>
        </div>-->
        <!--<div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="temp2" placeholder="客户图号" autocomplete="off">
            </div>
        </div>-->
        <!--<div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="outOrderNo" placeholder="合同号" autocomplete="off">
            </div>
        </div>-->
        <!-- 日期范围 -->
        <!--<div class="layui-inline" style="width: 300px">
            <div class="layui-input-inline">
                <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">-->
<!--                <select name="size">-->
<!--                    <option value="">请选择托盘类型</option>-->
<!--                    <option value="2000*1500*170">2000*1500*170</option>-->
<!--                    <option value="1500*1500*170">1500*1500*170</option>-->
<!--                    <option value="2600*1500*160">2600*1500*160</option>-->
<!--                    <option value="1300*1500*160">1300*1500*160</option>-->
<!--                </select>-->
<!--            </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>
@@ -162,7 +140,7 @@
        locDetlTableIns = table.render({
            elem: '#stockOut',
            headers: {token: localStorage.getItem('token')},
            url: baseUrl+'/clamp/out/list/auth',
            url: baseUrl+'/stock/out/list/auth',
            page: true,
            limits: [16, 30, 50, 100, 200, 500],
            limit: 16,
src/main/webapp/views/pakStore/clampDetlQuery_old.html
File was deleted
src/main/webapp/views/pakStore/emptyOut.html
@@ -81,6 +81,11 @@
    </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="排" lay-verify="number"  autocomplete="off">
        </div>
    </div>
@@ -96,13 +101,12 @@
    </div>
    <div class="layui-inline">
        <div class="layui-input-inline">
            <select name="loc_type1">
            <select name="size">
                <option value="">请选择托盘类型</option>
                <option value="4">1500*1500*870</option>
                <option value="5">1500*1500*1670</option>
                <option value="6">2000*1500*2170</option>
                <option value="7">2600*1500*660</option>
                <option value="8">1300*1500*1460</option>
                <option value="2000*1500*170">2000*1500*170</option>
                <option value="1500*1500*170">1500*1500*170</option>
                <option value="2600*1500*160">2600*1500*160</option>
                <option value="1300*1500*160">1300*1500*160</option>
            </select>
        </div>
    </div>
src/main/webapp/views/pakStore/locDetlQuery.html
@@ -64,7 +64,12 @@
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="matnr" placeholder="商品编码"  autocomplete="off">
                <input class="layui-input" type="text" name="matnr" placeholder="商品编号"  autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="maktx" placeholder="商品名称"  autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
@@ -74,7 +79,7 @@
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="zpallet" placeholder="托盘码"  autocomplete="off">
                <input class="layui-input" type="text" name="proType" placeholder="属性"  autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
@@ -126,10 +131,8 @@
    function getCol() {
        var cols = [
            //{type: 'checkbox', merge: ['locNo']},
            {type: 'checkbox'}
            ,{field: 'locNo', align: 'center',title: '库位号', style: 'font-weight: bold'}
            //,{field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'}
            {type: 'checkbox', merge: ['locNo']}
            ,{field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'}
            // ,{field: 'locNo$', align: 'center',title: '库位号'}
        ];
        cols.push.apply(cols, detlCols);
@@ -188,9 +191,6 @@
        table.on('toolbar(stockOut)', function (obj) {
            var checkStatus = table.checkStatus(obj.config.id);
            var data = checkStatus.data;
            // console.info(obj)
            // console.info(JSON.stringify(obj))
            // console.info(JSON.stringify(data))
            switch(obj.event) {
                case 'confirm':
                    if (data.length === 0){
@@ -198,15 +198,13 @@
                        return;
                    }
                    let locNos = [];
                    let matnrs = [];
                    data.forEach(function(elem) {
                        locNos.push(elem.locNo);
                        matnrs.push(elem.matnr);
                    });
                    $.ajax({
                        url: baseUrl+"/locDetlOut/auth",
                        url: baseUrl+"/locDetl/auth",
                        headers: {'token': localStorage.getItem('token')},
                        data: {locNos:locNos,matnrs:matnrs},
                        data: {locNos:locNos},
                        method: 'POST',
                        async: false,
                        success: function (res) {
src/main/webapp/views/pda/clamp.html
New file
@@ -0,0 +1,194 @@
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, target-densitydpi=high-dpi, 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>
    </style>
</head>
<body>
<!-- 头部 -->
<header>
    <div class="layui-input-inline">
        <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">
        <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><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="comb()" style="margin-left: 20px">并板</button>
        <span id="tips"></span>
    </div>
</footer>
</body>
<script>
    var tableIns;
    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: 'anfme', title: '数量', style:'color: blue', width:50},
                {field: 'matnr', align: 'center', title: '商品编号'},
                {field: 'maktx', align: 'center', title: '商品名称'},
                {field: 'specs', align: 'center', title: '规格'},
                {field: 'unit', align: 'center', title: '单位'},
                {field: 'barcode', align: 'center', title: '条码'}
            ]],
            done: function (res, curr, anfme) {
            }
        });
    });
    window.onload = function(){document.getElementById("code").focus();}
    function findCode(el) {
        if (el.value.length === 8) {
            $('#mat-btn').focus();
            getMat();
        }
    }
    var matCodeLayerIdx;
    function getMat() {
        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');
            },
            end: function () {
                $('#mat-btn').focus();
            }
        });
    }
    // 添加表格数据
    var matData = [];
    function addTableData(data) {
        if (isEmpty(data.maktx)){
            tips("提取失败", true);
            return;
        }
        let toPush = true;
        for (var j=0;j<matData.length;j++){
            if (data.matnr === matData[j].matnr) {
                matData[j].anfme = Number(matData[j].anfme) + Number(data.anfme);
                toPush  = false;
            }
        }
        if (toPush) {
            matData.push(data);
        }
        tips("提取成功");
        tableIns.reload({data: matData});
    }
    // 重置
    function reset() {
        $('#code').val("");
        matData = [];
        tableIns.reload({data: matData});
    }
    // 并板
    function comb() {
        let barcode = $('#code').val();
        if (isEmpty(barcode)) {
            tips("托盘条码为空", true);
            // document.getElementById("code").focus();
            return;
        }
        if (barcode.length !== 8) {
            tips("条码必须为8位", true);
            return;
        }
        if (!barcode.startsWith("5") &&
            !barcode.startsWith("6") &&
            !barcode.startsWith("7") &&
            !barcode.startsWith("8")){
            tips("托盘条码格式错误", true);
        }
        if (matData.length === 0) {
            tips("请提取物料", true);
            return;
        }
        $.ajax({
            url: baseUrl+"/mobile/combMeger/auth",
            headers: {'token': localStorage.getItem('token')},
            data: JSON.stringify({
                barcode: barcode,
                combMats: matData
            }),
            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) {
        // var tips = $('#tips');
        // tips.html(msg);
        // tips.css("color", warn?"red":'#666');
        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>
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">
@@ -56,7 +56,10 @@
            cols: [[
                {fixed: 'left', align: 'center', field: 'anfme', title: '数量', style:'color: blue', width:50},
                {field: 'matnr', align: 'center', title: '商品编号'},
                {field: 'maktx', align: 'center', title: '商品名称'}
                {field: 'maktx', align: 'center', title: '商品名称'},
                {field: 'specs', align: 'center', title: '规格'},
                {field: 'unit', align: 'center', title: '单位'},
                {field: 'barcode', align: 'center', title: '条码'}
            ]],
            done: function (res, curr, anfme) {
            }
@@ -130,6 +133,13 @@
            tips("条码必须为8位", true);
            return;
        }
        if (!barcode.startsWith("5") &&
            !barcode.startsWith("6") &&
            !barcode.startsWith("7") &&
            !barcode.startsWith("8")){
            tips("托盘条码格式错误", true);
            return;
        }
        if (matData.length === 0) {
            tips("请提取物料", true);
            return;
src/main/webapp/views/pda/index.html
@@ -74,6 +74,8 @@
<!-- 导航栏 -->
<ul class="nav">
    <li><a id="comb" onclick="nav(this.id)" class="nav-select" href="#">组托</a></li>
    <li><a id="clamp" onclick="nav(this.id)" class="nav-select" href="#">并板</a></li>
<!--    <li><a id="inventory" 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>-->
</ul>
src/main/webapp/views/pda/inventory.html
New file
@@ -0,0 +1,411 @@
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, target-densitydpi=high-dpi, 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>
        .quantity-input {
            width: 100%;
            height: 100%;
            border: none;
            text-align: center;
            background-color: transparent;
            color: blue;
        }
    </style>
</head>
<body>
<!-- 头部 -->
<header>
    <div class="layui-input-inline">
        <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">
        <button id="mat-btn" type="button" class="layui-btn layui-btn-normal" onclick="getMat()"><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="submit-btn" class="layui-btn layui-btn-normal " onclick="submitCheck()" style="margin-left: 20px">盘点</button>
        <span id="tips"></span>
    </div>
</footer>
</body>
<script>
    var tableIns;
    var matData = [];
    var currentBarcode = '';
    var currentWrkNo = null;
    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: matData,
            limit: 500,
            cellMinWidth: 50,
            cols: [[
                {fixed: 'left', align: 'center', field: 'anfme', title: '数量', style:'color: blue', width: 50, templet: function(d){
                        return '<input type="number" class="quantity-input" value="' + (d.anfme || 0) + '" ' +
                            'data-index="' + d.LAY_TABLE_INDEX + '" onblur="updateQuantity(this)" style="width: 100%">';
                    }},
                {field: 'matnr', align: 'center', title: '商品编号'},
                {field: 'maktx', align: 'center', title: '商品名称'},
                {field: 'specs', align: 'center', title: '规格'},
                {field: 'unit', align: 'center', title: '单位'},
                {field: 'barcode', align: 'center', title: '条码'},
                {field: 'stock', align: 'center', title: '托盘数量', style:'color: green', templet: function(d){
                        return d.stock || d.anfme || 0;
                    }}
            ]],
            done: function (res, curr, anfme) {
                // 绑定数量输入框事件
                bindQuantityEvents();
            }
        });
        function bindQuantityEvents() {
            // 绑定输入框点击事件
            $('.quantity-input').off('click').on('click', function(e){
                e.stopPropagation();
                $(this).select();
            });
            // 绑定回车键事件
            $('.quantity-input').off('keydown').on('keydown', function(e){
                if(e.keyCode === 13) {
                    e.preventDefault();
                    updateQuantity(this);
                    $(this).blur();
                }
            });
        }
    });
    window.onload = function(){
        document.getElementById("code").focus();
    }
    function findCode(el) {
        if (el.value.length === 8) {
            currentBarcode = el.value;
            getCheckDetails(currentBarcode);
        }
    }
    var matCodeLayerIdx;
    function getMat() {
        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');
            },
            end: function () {
                $('#mat-btn').focus();
            }
        });
    }
    // 添加表格数据 - 来自物料选择弹窗
    function addTableData(data) {
        if (isEmpty(data.maktx)){
            tips("提取失败", true);
            return;
        }
        let toPush = true;
        for (var j=0; j<matData.length; j++){
            if (data.matnr === matData[j].matnr) {
                // 如果是同一个物料,累加数量
                matData[j].anfme = Number(matData[j].anfme) + Number(data.anfme);
                toPush = false;
                break;
            }
        }
        if (toPush) {
            // 新增物料,添加库存字段
            var newItem = {
                LAY_TABLE_INDEX: matData.length,
                anfme: data.anfme || 0,
                matnr: data.matnr || '',
                maktx: data.maktx || '',
                specs: data.specs || '',
                unit: data.unit || '',
                barcode: data.barcode || '',
                stock: 0 // 手动添加的物料,库存为0
            };
            matData.push(newItem);
        }
        tips("提取成功");
        tableIns.reload({data: matData});
    }
    // 获取盘点明细
    function getCheckDetails(barcode) {
        if (!barcode || barcode.length !== 8) {
            tips("托盘条码必须为8位", true);
            return;
        }
        if (!barcode.startsWith("5") &&
            !barcode.startsWith("6") &&
            !barcode.startsWith("7") &&
            !barcode.startsWith("8")){
            tips("托盘条码格式错误", true);
            return;
        }
        tips("正在查询...", false);
        $.ajax({
            url: baseUrl + "/mobile/checkDetl/auth/v2?barcode=" + encodeURIComponent(barcode),
            headers: {'token': localStorage.getItem('token')},
            method: 'GET',
            success: function (res) {
                if (res.code === 200) {
                    if (res.data && res.data.wrkDetls && res.data.wrkDetls.length > 0) {
                        var result = res.data;
                        currentWrkNo = result.wrkNo;
                        matData = result.wrkDetls.map(function(item, index) {
                            return {
                                LAY_TABLE_INDEX: index,
                                anfme: item.anfme || 0,
                                matnr: item.matnr || '',
                                maktx: item.maktx || '',
                                specs: item.specs || '',
                                unit: item.unit || '',
                                barcode: item.barcode || '',
                                stock: item.anfme || 0,
                                detlNo: item.detlNo || '',
                                wrkNo: item.wrkNo || '',
                                detlId: item.detlId || null,
                                locno: item.locno || '',
                                batch: item.batch || '',
                                itemBatch: item.itemBatch || ''
                            };
                        });
                        tableIns.reload({data: matData});
                        tips("查询成功,共 " + matData.length + " 条记录");
                    } else {
                        matData = [];
                        tableIns.reload({data: matData});
                        tips("该托盘暂无盘点数据", false);
                    }
                } else if (res.code === 403) {
                    tips("登录已过期,请重新登录", true);
                    setTimeout(function() {
                        top.location.href = baseUrl + "/pda";
                    }, 1500);
                } else {
                    tips(res.msg || "查询失败,错误码:" + res.code, true);
                }
            },
            error: function(xhr, status, error) {
                if (xhr.responseJSON && xhr.responseJSON.code) {
                    var res = xhr.responseJSON;
                    if (res.code === 403) {
                        tips("登录已过期,请重新登录", true);
                        setTimeout(function() {
                            top.location.href = baseUrl + "/pda";
                        }, 1500);
                    } else {
                        tips(res.msg || "接口返回错误,错误码:" + res.code, true);
                    }
                } else {
                    if (xhr.status === 404) {
                        tips("接口不存在(404),请检查URL路径", true);
                    } else if (xhr.status === 500) {
                        tips("服务器内部错误(500)", true);
                    } else if (xhr.status === 0) {
                        tips("无法连接到服务器,请检查网络", true);
                    } else {
                        tips("请求失败,状态码:" + xhr.status, true);
                    }
                }
            }
        });
    }
    // 更新数量
    function updateQuantity(input) {
        var value = $(input).val();
        var index = $(input).data('index');
        if (value === '' || value === null) {
            value = 0;
            $(input).val(0);
        }
        value = parseFloat(value);
        if (isNaN(value) || value < 0) {
            value = 0;
            $(input).val(0);
        }
        if (matData[index]) {
            matData[index].anfme = value;
            // 更新输入框的值
            $(input).val(value);
            // 高亮显示差异
            var stock = matData[index].stock || 0;
            if (value !== stock) {
                $(input).css('color', '#ff5722'); // 橙色表示有差异
            } else {
                $(input).css('color', 'blue'); // 蓝色表示无差异
            }
        }
    }
    // 重置
    function reset() {
        $('#code').val("");
        currentBarcode = '';
        currentWrkNo = null;
        matData = [];
        tableIns.reload({data: matData});
        document.getElementById("code").focus();
    }
    // 盘点提交 - 调用 /inventory/auth 接口
    function submitCheck() {
        let barcode = $('#code').val();
        if (isEmpty(barcode)) {
            tips("托盘条码为空", true);
            return;
        }
        if (barcode.length !== 8) {
            tips("条码必须为8位", true);
            return;
        }
        if (!barcode.startsWith("5") &&
            !barcode.startsWith("6") &&
            !barcode.startsWith("7") &&
            !barcode.startsWith("8")){
            tips("托盘条码格式错误", true);
            return;
        }
        if (matData.length === 0) {
            tips("请盘点物料", true);
            return;
        }
        // 构建 CombParam 数据结构
        var combMats = matData.map(function(item) {
            var combMat = {
                detlId: item.detlId || null,
                detId: item.detlNo || null,
                matnr: item.matnr || '',
                anfme: item.anfme || 0,
                maktx: item.maktx || '',
                specs: item.specs || '',
                batch: item.batch || '',
                itemBatch: item.itemBatch || ''
            };
            // 如果有其他字段也一并提交
            if (item.proType) combMat.proType = item.proType;
            if (item.temp2) combMat.temp2 = item.temp2;
            if (item.outOrderNo) combMat.outOrderNo = item.outOrderNo;
            if (item.memo) combMat.memo = item.memo;
            return combMat;
        });
        // 构建完整的请求数据
        var requestData = {
            barcode: barcode,
            locno: matData[0]?.locno || '', // 如果有库位信息
            combMats: combMats
        };
        // 如果有单据编号,也一并提交
        if (currentWrkNo) {
            requestData.orderNo = currentWrkNo.toString();
            requestData.billNo = currentWrkNo.toString();
        }
        console.log("提交数据:", JSON.stringify(requestData, null, 2));
        tips("正在提交盘点数据...", false);
        $.ajax({
            url: baseUrl + "/mobile/inventory/auth",
            headers: {'token': localStorage.getItem('token')},
            data: JSON.stringify(requestData),
            contentType:'application/json;charset=UTF-8',
            method: 'POST',
            success: function (res) {
                if (res.code === 200) {
                    reset();
                    tips("盘点成功");
                } else if (res.code === 403) {
                    tips("登录已过期,请重新登录", true);
                    setTimeout(function() {
                        top.location.href = baseUrl + "/pda";
                    }, 1500);
                } else {
                    tips(res.msg || "盘点失败", true);
                }
            },
            error: function(xhr, status, error) {
                if (xhr.responseJSON && xhr.responseJSON.code) {
                    tips(xhr.responseJSON.msg || "提交失败", true);
                } else {
                    tips("提交失败,状态码:" + xhr.status, true);
                }
            }
        });
    }
    function tips(msg, warn) {
        layer.msg(msg, {icon: warn?2:1})
    }
    document.onkeyup = function (e) {
        if (window.event)
            e = window.event;
        var key = e.charCode || e.keyCode;
        if (key === 115) { // F4键
            $("#submit-btn").focus();
            submitCheck();
        } else if (key === 113) { // F2键
            $("#code").val("");
            $("#code").focus();
        } else if (key === 114) { // F3键
            getMat();
        } else if (key === 116) { // F5键
            if (currentBarcode) {
                getCheckDetails(currentBarcode);
            }
        }
    }
</script>
</html>
src/main/webapp/views/pda/matQuery.html
@@ -85,15 +85,15 @@
        <input id="maktx" type="text" disabled="disabled">
    </div>
    <div class="form-item">
        <span>图号</span>
        <input id="model" type="text" disabled="disabled">
        <span>规格</span>
        <input id="specs" type="text" disabled="disabled">
    </div>
    <div class="form-item">
        <span>单位</span>
        <input id="unit" type="text" disabled="disabled">
    </div>
    <div class="form-item">
        <span>批次号</span>
        <span>条码</span>
        <input id="barcode" type="text" disabled="disabled">
    </div>
    <div class="form-item">
@@ -129,7 +129,7 @@
                if (res.code === 200) {
                    if (res.data != null) {
                        $('#maktx').val(res.data.maktx);
                        $('#model').val(res.data.model);
                        $('#specs').val(res.data.specs);
                        $('#unit').val(res.data.unit);
                        $('#barcode').val(res.data.barcode);
                        countDom.val(initMatCount);
@@ -151,6 +151,9 @@
        var data = {
            matnr: $('#matnr').val(),
            maktx: $('#maktx').val(),
            specs: $('#specs').val(),
            unit: $('#unit').val(),
            barcode: $('#barcode').val(),
            anfme: countDom.val()
        };
        parent.addTableData(data);
src/main/webapp/views/stoMan/stoQue.html
@@ -43,16 +43,16 @@
            </div>
        </div>
    </div>
    <div class="layui-inline">
        <div class="layui-input-inline">
            <select name="loc_type1" id="loc_type1" class="layui-input" type="text" placeholder="库位类型" autocomplete="off">
<!--    <div class="layui-inline">-->
<!--        <div class="layui-input-inline">-->
<!--            <select name="loc_type1" id="loc_type1" class="layui-input" type="text" placeholder="库位类型" autocomplete="off">-->
                <!--                    <option style="display: none"></option>-->
                <option value=""></option>
                <option value="1">小库位</option>
                <option value="2">大库位</option>
            </select>
        </div>
    </div>
<!--                <option value=""></option>-->
<!--                <option value="1">小库位</option>-->
<!--                <option value="2">大库位</option>-->
<!--            </select>-->
<!--        </div>-->
<!--    </div>-->
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input class="layui-input" type="text" name="crn_no" placeholder="堆垛机号" autocomplete="off">
src/main/webapp/views/waitPakin/waitPakin.html
@@ -46,8 +46,6 @@
<!--        <button class="layui-btn layui-btn-sm" id="btn-wrk" lay-event="addWrk">生成任务</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-sm" id="btn-comb" lay-event="combData">组托</button>
        <button class="layui-btn layui-btn-sm" id="btn-clamp" lay-event="clampData">并板</button>
        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="">导出</button>
    </div>
</script>
src/main/webapp/views/waitPakin/waitPakin_clamp.html
File was deleted
src/main/webapp/views/waitPakin/waitPakin_comb.html
File was deleted