自动化立体仓库 - WMS系统
dubin
2026-02-07 8bc35cc4f75cfb435577e34763002f69def6a1a2
调试
1 文件已重命名
2个文件已添加
18个文件已修改
1231 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/LocMastController.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/WorkController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/LocDetlService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/WorkService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java 170 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/service/CommonService.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/web/WcsController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocDetlMapper.xml 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocMastMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/adjDetl/adjDetl.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locDetl/locDetl.js 231 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locDetlStatis/locDetlStatis.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/pakStore/clampOut.js 251 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/pakStore/clampOut_old.js 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/locDetl/locDetl.html 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pakStore/clampDetlQuery_old.html 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pakStore/clampOut.html 154 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pakStore/clampOut_old.html 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pda/index.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/LocMastController.java
@@ -24,7 +24,9 @@
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@RestController
public class LocMastController extends BaseController {
@@ -117,6 +119,7 @@
                locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()));
            }
        }
        locMast.setBarcode("");
        locMast.setModiUser(getUserId());
        locMast.setModiTime(new Date());
        locMastService.updateById(locMast);
@@ -238,6 +241,40 @@
        return R.ok(locMastService.selectPage(new Page<>(curr, limit), wrapper));
    }
    @RequestMapping(value = "/locMast/list/auth/lev/clamp")
    @ManagerAuth
    public R listLevClamp(@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));}
        Page<LocMast> pageResult = locMastService.selectPage(new Page<>(curr, limit), wrapper);
        if (pageResult != null && pageResult.getRecords() != null && !pageResult.getRecords().isEmpty()) {
            // 获取所有loc_no
            List<String> locNos = pageResult.getRecords().stream()
                    .map(LocMast::getLocNo) // 假设有getLocNo方法
                    .filter(Objects::nonNull)
                    .distinct()
                    .collect(Collectors.toList());
            if (!Cools.isEmpty(locNos)) {
                Map<String, Double> anfmeMap = locDetlService.getAnfmeByLocNos(locNos);
                // 更新sc_weight字段
                for (LocMast locMast : pageResult.getRecords()) {
                    if (locMast.getLocNo() != null && anfmeMap.containsKey(locMast.getLocNo())) {
                        locMast.setScWeight(anfmeMap.get(locMast.getLocNo())); // 假设有setScWeight方法
                    } else {
                        locMast.setScWeight(0.0); // 如果没有对应数据,设为0或null
                    }
                }
            }
        }
        return R.ok(pageResult);
    }
    private <T> void convertLev(Map<String, Object> map, EntityWrapper<T> wrapper){
        String sizeValue = null;
@@ -275,7 +312,7 @@
        // 第三步:如果没有size参数,则添加默认条件
        if (sizeValue == null) {
            wrapper.eq("loc_sts", "D");
            wrapper.eq("loc_sts", map.get("loc_sts"));
        } else {
            // 如果有size参数,添加loc_sts != 'Y'的条件
            wrapper.and().ne("loc_sts", "Y");
src/main/java/com/zy/asrs/controller/WorkController.java
@@ -307,7 +307,7 @@
    //并板出库
    @RequestMapping("/locClamp/out/start")
    @ManagerAuth(memo = "并板出库")
    public R locClampOutStart(@RequestBody StockOutParam param) {
    public R locClampOutStart(EmptyPlateOutParam param) {
        workService.locClampOut(param, getUserId());
        return R.ok("出库启动成功");
    }
src/main/java/com/zy/asrs/service/LocDetlService.java
@@ -89,4 +89,6 @@
    List<Map<String, Object>> selectLocDetlUnilateralMoveShuttleMap(Integer crnNo);
    List<LocDetl> selectLocDetlUnilateralMoveShuttle(String matnr, String batch, String grade, Integer crnNo);
    Map<String, Double> getAnfmeByLocNos(List<String> locNos);
}
src/main/java/com/zy/asrs/service/WorkService.java
@@ -111,5 +111,5 @@
    void turnMatLocDetl(EmptyPlateOutParam param, Long userId);
    void locClampOut(StockOutParam param, Long userId);
    void locClampOut(EmptyPlateOutParam param, Long userId);
}
src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java
@@ -1,5 +1,6 @@
package com.zy.asrs.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zy.asrs.entity.LocDetl;
@@ -14,9 +15,8 @@
import com.zy.asrs.utils.MatCompareUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@Service("locDetlService")
public class LocDetlServiceImpl extends ServiceImpl<LocDetlMapper, LocDetl> implements LocDetlService {
@@ -211,6 +211,40 @@
    }
    @Override
    public Map<String, Double> getAnfmeByLocNos(List<String> locNos) {
        if (locNos == null || locNos.isEmpty()) {
            return new HashMap<>();
        }
        // 构建查询条件
        EntityWrapper<LocDetl> wrapper = new EntityWrapper<>();
        wrapper.in("loc_no", locNos);
        // 执行查询
        List<LocDetl> list = this.selectList(wrapper);
        // 按loc_no分组并累加anfme值
        Map<String, Double> resultMap = new HashMap<>();
        for (LocDetl item : list) {
            if (item.getLocNo() != null && item.getAnfme() != null) {
                String locNo = item.getLocNo();
                Double anfmeValue = item.getAnfme();
                if (resultMap.containsKey(locNo)) {
                    // 累加已存在的值
                    Double sum = resultMap.get(locNo) + anfmeValue;
                    resultMap.put(locNo, sum);
                } else {
                    // 第一次添加
                    resultMap.put(locNo, anfmeValue);
                }
            }
        }
        return resultMap;
    }
    @Override
    public LocDetl selectItem(String locNo, WrkDetl wrkDetl) {
        List<LocDetl> locDetls = this.baseMapper.selectItem3(locNo, wrkDetl.getMatnr());
        if (locDetls != null) {
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -94,10 +94,17 @@
        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()));
        WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", param.getBarcode()));
        int countLocMast = locMastService.selectCount(new EntityWrapper<LocMast>().eq("barcode", param.getBarcode()));
        if (countLoc > 0 || countWrk > 0 || countwait > 0) {
            throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + param.getBarcode());
        }
        if (wrkMast != null && wrkMast.getWrkSts() != 15){
            throw new CoolException("工作档还未完成,托盘还未出库" + param.getBarcode());
        }
        if (countLocMast > 0){
            throw new CoolException("托盘未出库");
        }
        Date now = new Date();
        // 无单组托
@@ -656,6 +663,7 @@
        adjDetl.setLocNo(wrkMast.getSourceLocNo()); // 库位
        adjDetl.setBarcode( param.getBarcode()); //  托盘码
        adjDetl.setWorkNo(wrkMast.getWrkNo().toString()); //并板对应的工作号
        adjDetl.setMemo("并板");
        for (CombParam.CombMat wrkDetl : combMats) {
            WrkDetl wrkDetlOld = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>()
@@ -721,6 +729,15 @@
        List<CombParam.CombMat> combMats = combParam.getCombMats();
        String recordRecordLog = "托盘码" + combParam.getBarcode() + "盘点记录:";
        AdjDetl adjDetl = new AdjDetl();
        adjDetl.setAppeTime(new Date());
        adjDetl.setAppeUser(userId);
        adjDetl.setModiTime(new Date());
        adjDetl.setModiUser(userId);
        adjDetl.setLocNo(wrkMast.getSourceLocNo()); // 库位
        adjDetl.setBarcode(combParam.getBarcode()); //  托盘码
        adjDetl.setWorkNo(wrkMast.getWrkNo().toString()); //盘点对应的工作号
        adjDetl.setMemo("盘点");
        for (CombParam.CombMat wrkDetl : combMats) {
            WrkDetl wrkDetlOld = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>()
@@ -728,6 +745,10 @@
                            .eq("matnr", wrkDetl.getMatnr())
//                    .eq("batch",Cools.isEmpty(wrkDetl.getBatch())?"":wrkDetl.getBatch())
            );
            adjDetl.setMatnr(wrkDetl.getMatnr());
            adjDetl.setBatch(wrkDetl.getBatch());
            adjDetl.setAdjQty(wrkDetl.getAnfme()); //变更数量
            if (Cools.isEmpty(wrkDetlOld)) {
                WrkDetl detl = new WrkDetl();
@@ -739,17 +760,25 @@
                detl.setModiUser(userId); // 修改人员
                detl.setAppeUser(userId); // 添加人员
                wrkDetlService.insert(detl); // 插入工作明细
                adjDetl.setOriQty(0.0); // 原数量
                adjDetlService.insert(adjDetl);
                recordRecordLog = recordRecordLog + "\n" + "新增一条明细:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t数量:" + wrkDetl.getAnfme();
            }
            // 更新数量
            else if (!wrkDetlOld.getAnfme().equals(wrkDetl.getAnfme())) {
                wrkDetlService.updateInventoryAnfme(wrkDetl.getAnfme(), wrkMast.getWrkNo(), wrkDetl.getMatnr(), wrkDetl.getBatch());
                adjDetl.setOriQty(wrkDetlOld.getAnfme()); // 原数量
                adjDetlService.insert(adjDetl);
                recordRecordLog = recordRecordLog + "\n" + "更新一条明细:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t原数量:" + wrkDetlOld.getAnfme() + "\t更新数量:" + wrkDetl.getAnfme();
            }
            // 数量保持不变
            else if (wrkDetlOld.getAnfme().equals(wrkDetl.getAnfme())) {
                adjDetl.setOriQty(wrkDetlOld.getAnfme()); // 原数量
                adjDetlService.insert(adjDetl);
                recordRecordLog = recordRecordLog + "\n" + "一条明细保持不变:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t数量:" + wrkDetlOld.getAnfme();
                continue;
            }
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -931,7 +931,7 @@
        String locNo = ""; // 待修改目标库位
        String locSts = ""; // 待修改目标库位状态
        // 入库取消(修改目标库位)
        if (wrkMast.getWrkSts() < 4 || (wrkMast.getWrkSts()>= 103 && wrkMast.getWrkSts() <= 105)) {
        if (wrkMast.getWrkSts() < 4) {
            locNo = wrkMast.getLocNo();
            locSts = "O";
@@ -940,15 +940,15 @@
                // 库位转移:源库位
                LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo());
                if (Cools.isEmpty(locMast)) {
                    throw new CoolException("取消库位转移失败,源库位不存在:" + wrkMast.getSourceLocNo());
                    throw new CoolException("取消库位转移失败,源库位不存在:"+ wrkMast.getSourceLocNo());
                }
                locMast.setLocSts(wrkMast.getFullPlt().equalsIgnoreCase("N") ? "D" : "F");
                locMast.setLocSts(wrkMast.getFullPlt().equalsIgnoreCase("N")?"D":"F");
                locMast.setModiTime(now);
                locMast.setModiUser(userId);
                locMastService.updateById(locMast);
            }
            // 出库取消(修改源库位)
        } else if ((wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14)) {
        } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14) {
            locNo = wrkMast.getSourceLocNo();
            // 出库 ===>> F.在库
            if (wrkMast.getIoType() > 100 && wrkMast.getIoType() != 110) {
@@ -958,11 +958,11 @@
                locSts = "D";
                // 库位转移 ===>> D.空桶/空栈板
            } else if (wrkMast.getIoType() == 11) {
                locSts = wrkMast.getFullPlt().equalsIgnoreCase("N") ? "D" : "F";
                locSts = wrkMast.getFullPlt().equalsIgnoreCase("N")?"D":"F";
                // 库位转移:目标库位
                LocMast locMast = locMastService.selectById(wrkMast.getLocNo());
                if (Cools.isEmpty(locMast)) {
                    throw new CoolException("取消库位转移失败,目标库位不存在:" + wrkMast.getSourceLocNo());
                    throw new CoolException("取消库位转移失败,目标库位不存在:"+ wrkMast.getSourceLocNo());
                }
                locMast.setLocSts("O");
                locMast.setModiTime(now);
@@ -1063,6 +1063,7 @@
            throw new CoolException("取消工作档失败,库位不存在:" + locNo);
        }
        locMast.setLocSts(locSts);
//        locMast.setScWeight(0.0); // 入库取消 把栈板重量置为0
        locMast.setModiTime(now);
        locMast.setModiUser(userId);
        boolean locMastRes = locMastService.updateById(locMast);
@@ -1261,120 +1262,69 @@
    }
    @Override
    public void locClampOut(StockOutParam param, Long userId) {
    public void locClampOut(EmptyPlateOutParam param, Long userId) {
        // 目标站点状态检测
        BasDevp staNo = basDevpService.checkSiteStatus(param.getOutSite());
        // 获取库位明细
        List<LocDetlDto> locDetlDtos = new ArrayList<>();
        for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) {
            if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) {
                LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl);
                if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount()));
            }
        }
        if (!locDetlDtos.isEmpty()) {
            LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo()));
            if (locMast.getLocSts().equals("F")) {
                // 启动出库开始 107.盘点出库
                clampOut(staNo, locDetlDtos, IoWorkType.CHECK_OUT, userId);
            } else {
                throw new CoolException("所选库位存在状态不为F的库位,库位号:" + locMast.getLocNo() + " 、当前状态:" + locMast.getLocSts() + "-" + locMast.getLocSts$());
            }
        } else {
            throw new CoolException("库位物料不存在");
        for (String locNo : param.getLocNos()) {
            List<LocDetl> locDetlList = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", locNo));
            clampout(locDetlList,locNo,staNo,IoWorkType.CHECK_OUT,userId);
        }
    }
    @Transactional
    public void clampOut(BasDevp staNo, List<LocDetlDto> locDetlDtos, IoWorkType ioWorkType, Long userId) {
    public void clampout(List<LocDetl> locDetlList,String locNo,BasDevp staNo,IoWorkType ioWorkType,Long userId) {
        Date now = new Date();
        // 合并同类项
        Set<String> locNos = new HashSet<>();
        List<OutLocDto> dtos = new ArrayList<>();
        for (LocDetlDto locDetlDto : locDetlDtos) {
            String locNo = locDetlDto.getLocDetl().getLocNo();
            if (locNos.contains(locNo)) {
                for (OutLocDto dto : dtos) {
                    if (dto.getLocNo().equals(locNo)) {
                        dto.getLocDetlDtos().add(locDetlDto);
                        break;
                    }
                }
            } else {
                locNos.add(locNo);
                dtos.add(new OutLocDto(locNo, locDetlDto));
        // 获取路径
        Integer outSta = staNo.getDevNo();
        LocMast locMast = locMastService.selectById(locNo);
        StaDesc staDesc = staDescService.queryCrnStn(104, locMast.getCrnNo(), outSta);
        // 生成工作号
        int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(104));
        // 生成工作档
        WrkMast wrkMast = new WrkMast();
        wrkMast.setWrkNo(workNo);
        wrkMast.setIoTime(now);
        wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID
        wrkMast.setIoType(104); // 入出库状态
        wrkMast.setIoPri(13D); // 优先级:13
        wrkMast.setCrnNo(locMast.getCrnNo());
        wrkMast.setSourceStaNo(staDesc.getCrnStn()); // 源站
        wrkMast.setStaNo(staDesc.getStnNo()); // 目标站
        wrkMast.setSourceLocNo(locNo); // 源库位
        wrkMast.setFullPlt("Y"); // 满板:Y
        wrkMast.setPicking("N"); // 拣料
        wrkMast.setExitMk("N"); // 退出
        wrkMast.setEmptyMk("N"); // 空板
        wrkMast.setLinkMis("N");
        wrkMast.setBarcode(locMast.getBarcode());
        wrkMast.setAppeUser(userId); // 操作人员数据
        wrkMast.setAppeTime(now);
        wrkMast.setModiUser(userId);
        wrkMast.setModiTime(now);
        if (!wrkMastService.insert(wrkMast)) {
            throw new CoolException("保存工作档失败,出库库位号:" + locNo);
        }
        // 生成工作明细
        for (LocDetl locDetl : locDetlList) {
            WrkDetl  wrkDetl = new WrkDetl();
            wrkDetl.sync(locDetl);
            wrkDetl.setWrkNo(workNo);
            wrkDetl.setIoTime(now);
            wrkDetl.setAppeTime(now);
            wrkDetl.setAppeUser(userId);
            wrkDetl.setModiTime(now);
            wrkDetl.setModiUser(userId);
            if (!wrkDetlService.insert(wrkDetl)) {
                throw new CoolException("保存工作档明细失败");
            }
        }
        Integer ioType = null;
        // 生成工作档
        for (OutLocDto dto : dtos) {
                ioType = 104;
            assert ioType != null;
            // 获取库位
            LocMast locMast = locMastService.selectById(dto.getLocNo());
            Integer outSta = staNo.getDevNo();
            // 获取路径
            StaDesc staDesc = staDescService.queryCrnStn(ioType, locMast.getCrnNo(), outSta);
            // 生成工作号
            int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType));
            // 生成工作档
            WrkMast wrkMast = new WrkMast();
            wrkMast.setWrkNo(workNo);
            wrkMast.setIoTime(now);
            wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID
            wrkMast.setIoType(ioType); // 入出库状态
            wrkMast.setIoPri(13D); // 优先级:13
            wrkMast.setCrnNo(locMast.getCrnNo());
            wrkMast.setSourceStaNo(staDesc.getCrnStn()); // 源站
            wrkMast.setStaNo(staDesc.getStnNo()); // 目标站
            wrkMast.setSourceLocNo(dto.getLocNo()); // 源库位
            wrkMast.setFullPlt("Y"); // 满板:Y
            wrkMast.setPicking("N"); // 拣料
            wrkMast.setExitMk("N"); // 退出
            wrkMast.setEmptyMk("N"); // 空板
            wrkMast.setLinkMis("N");
            wrkMast.setBarcode(locMast.getBarcode());
            wrkMast.setAppeUser(userId); // 操作人员数据
            wrkMast.setAppeTime(now);
            wrkMast.setModiUser(userId);
            wrkMast.setModiTime(now);
            if (!wrkMastService.insert(wrkMast)) {
                throw new CoolException("保存工作档失败,出库库位号:" + dto.getLocNo());
            }
            // 生成工作档明细
            for (LocDetlDto detlDto : dto.getLocDetlDtos()) {
                if (detlDto.getCount() == null || detlDto.getCount() <= 0.0D) {
                    continue;
                }
                WrkDetl wrkDetl = new WrkDetl();
                wrkDetl.sync(detlDto.getLocDetl());
                wrkDetl.setOrderNo(""); // 手动出库不需要带出库存中的单据编号
                wrkDetl.setWrkNo(workNo);
                wrkDetl.setIoTime(now);
                Double anfme = ioType == 101 ? detlDto.getLocDetl().getAnfme() : detlDto.getCount();
                wrkDetl.setAnfme(anfme); // 数量
                wrkDetl.setAppeTime(now);
                wrkDetl.setAppeUser(userId);
                wrkDetl.setModiTime(now);
                wrkDetl.setModiUser(userId);
                if (!wrkDetlService.insert(wrkDetl)) {
                    throw new CoolException("保存工作档明细失败");
                }
            }
            // 修改库位状态:   F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中
            locMast = locMastService.selectById(dto.getLocNo());
            if (locMast.getLocSts().equals("F")) {
                locMast.setLocSts(ioType == 101 ? "R" : "P");
                locMast.setModiUser(userId);
                locMast.setModiTime(now);
                if (!locMastService.updateById(locMast)) {
                    throw new CoolException("预约库位状态失败,库位号:" + dto.getLocNo());
                }
            } else {
                throw new CoolException(dto.getLocNo() + "库位不是在库状态");
            }
        // 修改库位状态
        locMast.setLocSts("P");
        locMast.setModiTime(now);
        locMast.setModiUser(userId);
        if (!locMastService.updateById(locMast)){
            throw new CoolException("并板出库修改库位状态失败");
        }
    }
}
src/main/java/com/zy/common/service/CommonService.java
@@ -448,9 +448,13 @@
    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());
        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种货物类型
src/main/java/com/zy/common/web/WcsController.java
@@ -429,6 +429,7 @@
        LocMast locMast = locMastService.selectById(dto.getLocNo());
        if (locMast.getLocSts().equals("O")) {
            locMast.setLocSts("S"); // S.入库预约
//            locMast.setScWeight(weight); // 整托重量记入库位 为并板出库筛选托盘做准备
            locMast.setModiTime(now);
            if (!locMastService.updateById(locMast)) {
                throw new CoolException("改变库位状态失败");
src/main/resources/mapper/LocDetlMapper.xml
@@ -270,20 +270,19 @@
        SELECT
        ROW_NUMBER() OVER (ORDER BY SUM(a.anfme) DESC) AS row,
        -- 分组字段
        a.model,
        a.matnr,
        a.pro_type AS proType,
        a.out_order_no AS outOrderNo,
        a.temp2 AS temp2,
        -- 非分组字段用聚合函数获取一个代表值(例如MAX或MIN)
        MAX(a.matnr) AS matnr,
        MAX(a.specs) AS specs,
        MAX(a.temp1) AS temp1,
        MAX(a.maktx) AS maktx,
        -- 聚合数量
        SUM(a.anfme) AS anfme
        FROM asr_loc_detl a
        WHERE 1=1
        <include refid="stockOutConditionTwo"/>
        GROUP BY a.model, a.pro_type, a.out_order_no, a.temp2
        GROUP BY a.matnr, a.pro_type, a.out_order_no, a.temp2
        ) t
        WHERE t.row BETWEEN ((#{pageNumber}-1)*#{pageSize}+1) AND (#{pageNumber}*#{pageSize})
    </select>
@@ -295,11 +294,11 @@
        select count(1) as count from
        (
        select
        a.model
        a.matnr
        from asr_loc_detl a
        where 1=1
        <include refid="stockOutCondition"></include>
        group by a.model
        group by a.matnr
        ) b
    </select>
src/main/resources/mapper/LocMastMapper.xml
@@ -126,7 +126,7 @@
        <if test="locType2 == 5">
            and lev1 in(4,5)
        </if>
        order by lev1 asc,bay1 asc
        order by bay1 asc,lev1 asc,row1 asc
    </select>
    <select id="queryLocToTwo" resultMap="BaseResultMap">
@@ -138,7 +138,7 @@
        <if test="locType2 == 8">
            and lev1 in(3,4,5,6)
        </if>
        order by lev1 asc,bay1 asc
        order by bay1 asc,lev1 asc,row1 asc
    </select>
    <select id="queryLocToSpecal" resultMap="BaseResultMap">
@@ -150,7 +150,7 @@
        <if test="locType1 == 2">
            and lev1 in(2,3)
        </if>
        order by lev1 asc,bay1 asc
        order by bay1 asc,lev1 asc,row1 asc
    </select>
    <select id="queryLocToOneEmpty" resultMap="BaseResultMap">
@@ -162,6 +162,6 @@
        <if test="locType2 == 6">
            and lev1 in(1,2,3)
        </if>
        order by lev1 asc,bay1 asc
        order by bay1 asc,lev1 asc,row1 asc
    </select>
</mapper>
src/main/webapp/static/js/adjDetl/adjDetl.js
@@ -33,7 +33,7 @@
            // ,{field: 'adjCtns', align: 'center',title: '变更箱数'}
            ,{field: 'adjQty', align: 'center',title: '变更数量'}
            // ,{field: 'adjWt', align: 'center',title: '变更重量'}
            ,{field: 'memo', align: 'center',title: '备注',hide:true}
            ,{field: 'memo', align: 'center',title: '操作类型'}
            ,{field: 'modiUser$', align: 'center',title: '修改人员'}
            ,{field: 'modiTime$', align: 'center',title: '修改时间'}
            // ,{field: 'appeUser', align: 'center',title: '创建者'}
src/main/webapp/static/js/locDetl/locDetl.js
@@ -49,6 +49,35 @@
    return cols;
}
// 高亮显示库龄大于等于1天的行 - 深红色
function highlightStoreDateRows() {
    setTimeout(function() {
        var rows = $('.layui-table-body .layui-table tbody tr');
        rows.each(function() {
            var $row = $(this);
            var storeDateText = $row.find('td[data-field="storeDate"] .layui-table-cell').text().trim();
            // 尝试解析库龄数值
            var storeDays = parseInt(storeDateText);
            // 如果库龄大于等于1天,添加深红色背景
            if (!isNaN(storeDays) && storeDays >= 1) {
                $row.css({
                    'background-color': '#f5222d',  // 深红色背景
                    'color': '#ffffff',              // 白色文字
                    'font-weight': 'bold'
                });
                // 也可以给每个单元格添加边框
                $row.find('td').css({
                    'border-bottom': '1px solid #ff7875'
                });
            }
        });
    }, 50); // 稍微增加延迟确保DOM完全渲染
}
layui.use(['table','laydate', 'form'], function(){
    var table = layui.table;
    var $ = layui.jquery;
@@ -89,6 +118,10 @@
            }
            pageCurr=curr;
            limit();
            // 添加高亮效果 - 在每次表格渲染完成后执行
            highlightStoreDateRows();
            form.on('checkbox(tableCheckbox)', function (data) {
                var _index = $(data.elem).attr('table-index')||0;
                if(data.elem.checked){
@@ -119,6 +152,9 @@
                }
                pageCurr=curr;
                limit();
                // 排序后重新应用高亮
                highlightStoreDateRows();
            }
        });
    });
@@ -137,7 +173,7 @@
                    content: 'locDetl_detail.html',
                    success: function(layero, index){
                        layer.getChildFrame('#data-detail-submit-edit', index).hide();
                        clearFormVal(layer.getChildFrame('#detail', index));
                        clearFormVal(layer.getChildFrame('#detail', index));
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                    }
                });
@@ -146,6 +182,10 @@
                tableIns.reload({
                    page: {
                        curr: pageCurr
                    },
                    done: function(res, curr, count) {
                        // 刷新后重新应用高亮
                        highlightStoreDateRows();
                    }
                });
                limit();
@@ -267,35 +307,35 @@
                if (param === undefined) {
                    layer.msg("无数据");
                } else {
                   layer.open({
                       type: 2,
                       title: '库位号详情',
                       maxmin: true,
                       area: [top.detailWidth, top.detailHeight],
                       shadeClose: false,
                       content: '../locMast/locMast_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: baseUrl+"/locMast/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
                                   if (res.code === 200){
                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                       layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                       layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                   } else if (res.code === 403){
                                       parent.location.href = "/";
                                   }else {
                                       layer.msg(res.msg)
                                   }
                               }
                           })
                       }
                   });
                    layer.open({
                        type: 2,
                        title: '库位号详情',
                        maxmin: true,
                        area: [top.detailWidth, top.detailHeight],
                        shadeClose: false,
                        content: '../locMast/locMast_detail.html',
                        success: function(layero, index){
                            $.ajax({
                                url: baseUrl+"/locMast/"+ param +"/auth",
                                headers: {'token': localStorage.getItem('token')},
                                method: 'GET',
                                success: function (res) {
                                    if (res.code === 200){
                                        setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                    } else if (res.code === 403){
                                        parent.location.href = "/";
                                    }else {
                                        layer.msg(res.msg)
                                    }
                                }
                            })
                        }
                    });
                }
                break;
            case 'modiUser':
@@ -303,35 +343,35 @@
                if (param === undefined) {
                    layer.msg("无数据");
                } else {
                   layer.open({
                       type: 2,
                       title: '修改人员详情',
                       maxmin: true,
                       area: [top.detailWidth, top.detailHeight],
                       shadeClose: false,
                       content: '../user/user_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: baseUrl+"/user/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
                                   if (res.code === 200){
                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                       layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                       layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                   } else if (res.code === 403){
                                       parent.location.href = "/";
                                   }else {
                                       layer.msg(res.msg)
                                   }
                               }
                           })
                       }
                   });
                    layer.open({
                        type: 2,
                        title: '修改人员详情',
                        maxmin: true,
                        area: [top.detailWidth, top.detailHeight],
                        shadeClose: false,
                        content: '../user/user_detail.html',
                        success: function(layero, index){
                            $.ajax({
                                url: baseUrl+"/user/"+ param +"/auth",
                                headers: {'token': localStorage.getItem('token')},
                                method: 'GET',
                                success: function (res) {
                                    if (res.code === 200){
                                        setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                    } else if (res.code === 403){
                                        parent.location.href = "/";
                                    }else {
                                        layer.msg(res.msg)
                                    }
                                }
                            })
                        }
                    });
                }
                break;
            case 'appeUser':
@@ -339,35 +379,35 @@
                if (param === undefined) {
                    layer.msg("无数据");
                } else {
                   layer.open({
                       type: 2,
                       title: '创建者详情',
                       maxmin: true,
                       area: [top.detailWidth, top.detailHeight],
                       shadeClose: false,
                       content: '../user/user_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: baseUrl+"/user/"+ param +"/auth",
                               headers: {'token': localStorage.getItem('token')},
                               method: 'GET',
                               success: function (res) {
                                   if (res.code === 200){
                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                       layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                       layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                   } else if (res.code === 403){
                                       parent.location.href = "/";
                                   }else {
                                       layer.msg(res.msg)
                                   }
                               }
                           })
                       }
                   });
                    layer.open({
                        type: 2,
                        title: '创建者详情',
                        maxmin: true,
                        area: [top.detailWidth, top.detailHeight],
                        shadeClose: false,
                        content: '../user/user_detail.html',
                        success: function(layero, index){
                            $.ajax({
                                url: baseUrl+"/user/"+ param +"/auth",
                                headers: {'token': localStorage.getItem('token')},
                                method: 'GET',
                                success: function (res) {
                                    if (res.code === 200){
                                        setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                    } else if (res.code === 403){
                                        parent.location.href = "/";
                                    }else {
                                        layer.msg(res.msg)
                                    }
                                }
                            })
                        }
                    });
                }
                break;
            // 查看简图
@@ -493,13 +533,13 @@
        tableReload(false);
    });
    // 搜索栏重置事件
    form.on('submit(reset)', function (data) {
        pageCurr = 1;
        clearFormVal($('#search-box'));
        tableReload(false);
    });
    layDate.render({
        elem: '.layui-laydate-range'
        ,type: 'datetime'
@@ -515,7 +555,6 @@
        type: 'datetime'
    });
});
// 关闭动作
@@ -524,8 +563,7 @@
});
function tableReload(child) {
    var searchData = {
    };
    var searchData = {};
    $.each($('#search-box [name]').serializeArray(), function() {
        searchData[this.name] = this.value;
    });
@@ -539,11 +577,18 @@
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            // 搜索/重置后重新应用高亮
            highlightStoreDateRows();
            if (res.data.length === 0 && count !== 0) {
                tableIns.reload({
                    where: searchData,
                    page: {
                        curr: pageCurr-1
                    },
                    done: function(res2, curr2, count2) {
                        highlightStoreDateRows();
                    }
                });
                pageCurr -= 1;
@@ -605,4 +650,4 @@
    if (event.keyCode === 13) {
        $("#search").click();
    }
});
});
src/main/webapp/static/js/locDetlStatis/locDetlStatis.js
@@ -34,7 +34,7 @@
            {field: 'matnr', title:'产品编码', align: 'center'},
            {field: 'model', title:'产品代码', align: 'center'},
            {field: 'specs', title:'产品规格', align: 'center'},
            {field: 'temp1', title:'产品总称', align: 'center'},
            {field: 'maktx', title:'产品总称', align: 'center'},
            {field: 'outOrderNo', title:'合同号', align: 'center'},
            {field: 'proType', title:'属性', align: 'center'},
            {field: 'temp2', title:'客户图号', align: 'center'},
src/main/webapp/static/js/pakStore/clampOut.js
@@ -1,78 +1,14 @@
var locDetlLayerIdx;
var tableIns;
var locDetlData = [];
function getCol() {
    var cols = [
        {field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'}
    ];
    cols.push.apply(cols, detlCols);
    return cols;
}
var pageCurr;
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"
}).use(['table','laydate', 'form', 'admin', 'tableMerge'], function() {
}).use(['table','laydate', 'form', 'admin'], function() {
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    var layDate = layui.laydate;
    var form = layui.form;
    var admin = layui.admin;
    var tableMerge = layui.tableMerge;
    tableIns = table.render({
        elem: '#chooseData',
        headers: {token: localStorage.getItem('token')},
        data: [],
        even: true,
        toolbar: '#toolbar',
        cellMinWidth: 50,
        cols: [getCol()],
        done: function(res, curr, count) {
            tableMerge.render(this);
            limit();
            getOutBound();
        }
    });
    // 监听头工具栏事件
    table.on('toolbar(chooseData)', function (obj) {
        switch (obj.event) {
            case 'outbound':
                if (locDetlData.length === 0){
                    layer.msg('请先添加并板库存', {icon: 2});
                } else {
                    var staNo = $("#staNoSelect").val();
                    if (staNo === "" || staNo === null){
                        layer.msg("请选择出库站", {icon: 2});
                        return;
                    }
                    let param = {
                        outSite: staNo,
                        locDetls: locDetlData
                    }
                    $.ajax({
                        url: baseUrl+"/locClamp/out/start",
                        headers: {'token': localStorage.getItem('token')},
                        data: JSON.stringify(param),
                        contentType:'application/json;charset=UTF-8',
                        method: 'POST',
                        success: function (res) {
                            if (res.code === 200){
                                locDetlData = [];
                                tableIns.reload({data: locDetlData});
                                layer.msg(res.msg, {icon: 1});
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            } else {
                                layer.msg(res.msg, {icon: 2})
                            }
                        }
                    });
                }
                break;
        }
    });
    // 获取出库口
    function getOutBound(){
@@ -97,42 +33,159 @@
        })
    }
    $(document).on('click','#mat-query', function () {
        let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false});
        locDetlLayerIdx = layer.open({
            type: 2,
            title: false,
            closeBtn: false,
            maxmin: false,
            area: ['90%', '85%'],
            shadeClose: true,
            content: 'clampDetlQuery.html',
            success: function(layero, index){
                layer.close(loadIndex);
    // 数据渲染
    tableIns = table.render({
        elem: '#locMast',
        headers: {token: localStorage.getItem('token')},
        url: baseUrl+'/locMast/list/auth/lev/clamp',
        page: true,
        limit: 16,
        limits: [16, 30, 50, 100, 200, 500],
        where: {loc_sts: "F"},
        even: true,
        toolbar: '#toolbar',
        defaultToolbar: ['filter'],
        cellMinWidth: 50,
        cols: [[
            {type: 'checkbox', fixed: 'left'}
            ,{field: 'locNo', align: 'center',title: '库位号',sort:true}
            ,{field: 'locSts$', align: 'center',title: '库位状态',width:200}
            // ,{field: 'whsType$', align: 'center',title: '库位类型'}
            ,{field: 'barcode', align: 'center',title: '托盘条码'}
            ,{field: 'crnNo', align: 'center',title: '堆垛机号'}
            ,{field: 'scWeight', align: 'center',title: '托盘总重'}
            ,{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' disabled=‘disabled’ lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
                    if(row.fullPlt === 'Y'){html += " checked ";}
                    html += ">";
                    return html;
                },width:80}
            ,{field: 'modiUser$', align: 'center',title: '修改人员',event: 'modiUser'}
            ,{field: 'modiTime$', align: 'center',title: '修改时间'}
        ]],
        request: {
            pageName: 'curr',
            pageSize: 'limit'
        },
        parseData: function (res) {
            return {
                'code': res.code,
                'msg': res.msg,
                'count': res.data.total,
                'data': res.data.records
            }
        });
    })
        },
        response: {
            statusCode: 200
        },
        done: function(res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            getOutBound();
            limit();
            form.on('checkbox(tableCheckbox)', function (data) {
                var _index = $(data.elem).attr('table-index')||0;
                if(data.elem.checked){
                    res.data[_index][data.value] = 'Y';
                }else{
                    res.data[_index][data.value] = 'N';
                }
            });
        }
    });
    // 监听头工具栏事件
    table.on('toolbar(locMast)', function (obj) {
        var data = table.checkStatus(obj.config.id).data;
        switch (obj.event) {
            case 'outbound':
                var staNo = $("#staNoSelect").val();
                if (staNo === "" || staNo === null){
                    layer.msg("请选择出库口");
                    return;
                }
                var locNos = [];
                data.forEach(function(elem) {
                    locNos.push(elem.locNo);
                });
                if (data.length === 0){
                    layer.msg('请至少选中一行数据');
                } else {
                    $.ajax({
                        url: baseUrl+"/locClamp/out/start",
                        headers: {'token': localStorage.getItem('token')},
                        data: {
                            outSite: staNo,
                            locNos: locNos
                        },
                        method: 'POST',
                        traditional:true,
                        success: function (res) {
                            if (res.code === 200){
                                tableReload(); // 重载表格
                                getOutBound(); // 重载出库口
                                layer.msg(res.msg);
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            } else {
                                layer.msg(res.msg)
                            }
                        }
                    });
                }
                break;
        }
    });
    // 搜索栏搜索事件
    form.on('submit(search)', function (data) {
        pageCurr = 1;
        $('#detlTable').css("display", 'none');
        tableReload(false);
        getOutBound();
    });
    // 搜索栏重置事件
    form.on('submit(reset)', function (data) {
        pageCurr = 1;
        clearFormVal($('#search-box'));
        $('#detlTable').css("display", 'none');
        tableReload(false);
        getOutBound();
    });
})
// 添加表格数据
function addTableData(data) {
    for (let i=0;i<data.length;i++){
        let pass = false;
        for (let j=0;j<locDetlData.length;j++){
            if (data[i].matnr === locDetlData[j].matnr && data[i].batch === locDetlData[j].batch && data[i].locNo$ === locDetlData[j].locNo$) {
                pass = true;
                break;
function tableReload(child) {
    var searchData = {};
    $.each($('#search-box [name]').serializeArray(), function() {
        searchData[this.name] = this.value;
    });
    (child ? parent.tableIns : tableIns).reload({
        where: searchData,
        page: {
            curr: pageCurr
        },
        done: function (res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            if (res.data.length === 0 && count !== 0) {
                tableIns.reload({
                    where: searchData,
                    page: {
                        curr: pageCurr-1
                    }
                });
                pageCurr -= 1;
            }
            limit(child);
        }
        if (pass) {
            data.splice(i--, 1);
        } else {
            data[i]["count"] = data[i]["anfme"];
        }
    }
    locDetlData.push.apply(locDetlData, data);
    tableIns.reload({data: locDetlData});
    layer.close(locDetlLayerIdx);
}
    });
}
src/main/webapp/static/js/pakStore/clampOut_old.js
New file
@@ -0,0 +1,138 @@
var locDetlLayerIdx;
var tableIns;
var locDetlData = [];
function getCol() {
    var cols = [
        {field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'}
    ];
    cols.push.apply(cols, detlCols);
    return cols;
}
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"
}).use(['table','laydate', 'form', 'admin', 'tableMerge'], function() {
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    var layDate = layui.laydate;
    var form = layui.form;
    var admin = layui.admin;
    var tableMerge = layui.tableMerge;
    tableIns = table.render({
        elem: '#chooseData',
        headers: {token: localStorage.getItem('token')},
        data: [],
        even: true,
        toolbar: '#toolbar',
        cellMinWidth: 50,
        cols: [getCol()],
        done: function(res, curr, count) {
            tableMerge.render(this);
            limit();
            getOutBound();
        }
    });
    // 监听头工具栏事件
    table.on('toolbar(chooseData)', function (obj) {
        switch (obj.event) {
            case 'outbound':
                if (locDetlData.length === 0){
                    layer.msg('请先添加并板库存', {icon: 2});
                } else {
                    var staNo = $("#staNoSelect").val();
                    if (staNo === "" || staNo === null){
                        layer.msg("请选择出库站", {icon: 2});
                        return;
                    }
                    let param = {
                        outSite: staNo,
                        locDetls: locDetlData
                    }
                    $.ajax({
                        url: baseUrl+"/locClamp/out/start",
                        headers: {'token': localStorage.getItem('token')},
                        data: JSON.stringify(param),
                        contentType:'application/json;charset=UTF-8',
                        method: 'POST',
                        success: function (res) {
                            if (res.code === 200){
                                locDetlData = [];
                                tableIns.reload({data: locDetlData});
                                layer.msg(res.msg, {icon: 1});
                            } else if (res.code === 403){
                                top.location.href = baseUrl+"/";
                            } else {
                                layer.msg(res.msg, {icon: 2})
                            }
                        }
                    });
                }
                break;
        }
    });
    // 获取出库口
    function getOutBound(){
        $.ajax({
            url: baseUrl+"/available/take/check/site",
            headers: {'token': localStorage.getItem('token')},
            method: 'POST',
            async: false,
            success: function (res) {
                if (res.code === 200){
                    var tpl = $("#takeSiteSelectTemplate").html();
                    var template = Handlebars.compile(tpl);
                    var html = template(res);
                    $('#staNoSelect').append(html);
                    form.render('select');
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                }else {
                    layer.msg(res.msg)
                }
            }
        })
    }
    $(document).on('click','#mat-query', function () {
        let loadIndex = layer.msg('请求中...', {icon: 16, shade: 0.01, time: false});
        locDetlLayerIdx = layer.open({
            type: 2,
            title: false,
            closeBtn: false,
            maxmin: false,
            area: ['90%', '85%'],
            shadeClose: true,
            content: 'clampDetlQuery.html',
            success: function(layero, index){
                layer.close(loadIndex);
            }
        });
    })
})
// 添加表格数据
function addTableData(data) {
    for (let i=0;i<data.length;i++){
        let pass = false;
        for (let j=0;j<locDetlData.length;j++){
            if (data[i].matnr === locDetlData[j].matnr && data[i].batch === locDetlData[j].batch && data[i].locNo$ === locDetlData[j].locNo$) {
                pass = true;
                break;
            }
        }
        if (pass) {
            data.splice(i--, 1);
        } else {
            data[i]["count"] = data[i]["anfme"];
        }
    }
    locDetlData.push.apply(locDetlData, data);
    tableIns.reload({data: locDetlData});
    layer.close(locDetlLayerIdx);
}
src/main/webapp/views/locDetl/locDetl.html
@@ -88,9 +88,6 @@
<script type="text/html" id="operate">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a>
</script>
<!--<script type="text/html" id="operate1">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="showPic" >查看简图</a>
</script>-->
<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
src/main/webapp/views/pakStore/clampDetlQuery_old.html
src/main/webapp/views/pakStore/clampOut.html
@@ -21,7 +21,26 @@
            background-color: #fff;
            border-radius: 5px;
            box-shadow: 0 0 3px rgba(0,0,0,.3);
            padding-bottom: 20px;
        }
        #search-box {
            padding: 30px 0 20px 0;
        }
        #search-box .layui-inline:first-child {
            margin-left: 30px;
        }
        #search-box .layui-inline {
            margin-right: 5px;
        }
        #data-search-btn {
            margin-left: 10px;
            display: inline-block;
        }
        #data-search-btn.layui-btn-container .layui-btn {
            margin-right: 20px;
        }
        #staNoSpan {
            text-align: center;
            display: inline-block;
@@ -46,79 +65,75 @@
        #btn-outbound {
            margin-left: 60px;
        }
        /*----------------------------------*/
        .function-area {
            padding: 20px 50px;
        }
        .function-btn {
            font-size: 16px;
            padding: 1px 2px;
            width: 100px;
            height: 50px;
            border-color: #2b425b;
            border-radius: 4px;
            border-width: 2px;
            background: none;
            border-style: solid;
            transition: 0.4s;
            cursor: pointer;
            letter-spacing: 1.5px;
        }
        .function-btn:hover {
            background-color: #2b425b;
            color: #fff;
        }
        /*#mat-query {*/
        /*    display: none;*/
        /*}*/
        #btn-outbound {
            display: none;
        }
    </style>
</head>
<body style="padding-bottom: 30px">
<body>
<!-- 功能区 -->
<div class="function-area">
    <button id="mat-query" class="function-btn">提取库存</button>
</div>
<hr>
<!-- 表格 -->
<div style="padding-bottom: 5px; margin-bottom: 45px">
    <!-- 头部 -->
    <script type="text/html" id="toolbar">
        <div class="layui-form">
            <div class="layui-btn-container">
                <!-- 1.选择出库口 -->
                <span id="staNoSpan">出库口:</span>
                <select id="staNoSelect" lay-verify="required">
                    <option value="">请选择站点</option>
                </select>
                <!-- 2.启动出库 -->
                <button class="layui-btn layui-btn-lg" id="btn-outbound" lay-event="outbound">并板出库</button>
            </div>
<!-- 搜索栏 -->
<div id="search-box" class="layui-form layui-card-header">
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off">
        </div>
    </script>
    </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>
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input class="layui-input" type="text" name="bay1" placeholder="列" lay-verify="number" autocomplete="off">
        </div>
    </div>
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input class="layui-input" type="text" name="lev1" placeholder="层" lay-verify="number" autocomplete="off">
        </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>
    <!-- 行 -->
    <script type="text/html" id="operate">
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</a>
    </script>
    <table class="layui-table" id="chooseData" lay-filter="chooseData"></table>
    <!-- 待添加 -->
    <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block">
        <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button>
        <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置</button>
    </div>
</div>
<script type="text/template" id="takeSiteSelectTemplate">
    {{#each data}}
    <option value="{{this}}">{{this}}</option>
    {{/each}}
<script type="text/html" id="toolbar">
    <div class="layui-form">
        <div class="layui-btn-container">
            <!-- 1.选择出库口 -->
            <span id="staNoSpan">并板出库口:</span>
            <select id="staNoSelect" lay-verify="required">
                <option value="">请选择站点</option>
            </select>
            <!-- 2.启动出库 -->
            <button class="layui-btn layui-btn-lg" id="btn-outbound" lay-event="outbound">启动出库</button>
        </div>
    </div>
</script>
<!-- 空板库位表 -->
<table class="layui-hide" id="locMast" lay-filter="locMast"></table>
<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>
@@ -127,6 +142,15 @@
<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script>
<script type="text/javascript" src="../../static/js/pakStore/clampOut.js" charset="utf-8"></script>
</body>
</html>
<!--启动出库-->
<div id="outboundDiv">
</div>
<script type="text/template" id="takeSiteSelectTemplate">
    {{#each data}}
    <option value="{{this}}">{{this}}</option>
    {{/each}}
</script>
</body>
</html>
src/main/webapp/views/pakStore/clampOut_old.html
New file
@@ -0,0 +1,132 @@
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all">
    <link rel="stylesheet" href="../../static/css/cool.css" media="all">
    <link rel="stylesheet" href="../../static/css/common.css" media="all">
    <style>
        html {
            height: 100%;
            padding: 10px;
            background-color: #f1f1f1;
            box-sizing: border-box;
        }
        body {
            background-color: #fff;
            border-radius: 5px;
            box-shadow: 0 0 3px rgba(0,0,0,.3);
        }
        #staNoSpan {
            text-align: center;
            display: inline-block;
            width: 100px;
            font-size: 13px;
        }
        .layui-btn-container .layui-form-select {
            display: inline-block;
            width: 150px;
            height: 30px;
        }
        .layui-btn-container .layui-form-select.layui-form-selected {
            display: inline-block;
            width: 150px;
        }
        .layui-btn-container .layui-select-title input {
            font-size: 13px;
        }
        .layui-btn-container .layui-anim.layui-anim-upbit dd {
            font-size: 13px;
        }
        #btn-outbound {
            margin-left: 60px;
        }
        /*----------------------------------*/
        .function-area {
            padding: 20px 50px;
        }
        .function-btn {
            font-size: 16px;
            padding: 1px 2px;
            width: 100px;
            height: 50px;
            border-color: #2b425b;
            border-radius: 4px;
            border-width: 2px;
            background: none;
            border-style: solid;
            transition: 0.4s;
            cursor: pointer;
            letter-spacing: 1.5px;
        }
        .function-btn:hover {
            background-color: #2b425b;
            color: #fff;
        }
        /*#mat-query {*/
        /*    display: none;*/
        /*}*/
        #btn-outbound {
            display: none;
        }
    </style>
</head>
<body style="padding-bottom: 30px">
<!-- 功能区 -->
<div class="function-area">
    <button id="mat-query" class="function-btn">提取库存</button>
</div>
<hr>
<!-- 表格 -->
<div style="padding-bottom: 5px; margin-bottom: 45px">
    <!-- 头部 -->
    <script type="text/html" id="toolbar">
        <div class="layui-form">
            <div class="layui-btn-container">
                <!-- 1.选择出库口 -->
                <span id="staNoSpan">出库口:</span>
                <select id="staNoSelect" lay-verify="required">
                    <option value="">请选择站点</option>
                </select>
                <!-- 2.启动出库 -->
                <button class="layui-btn layui-btn-lg" id="btn-outbound" lay-event="outbound">并板出库</button>
            </div>
        </div>
    </script>
    <!-- 行 -->
    <script type="text/html" id="operate">
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</a>
    </script>
    <table class="layui-table" id="chooseData" lay-filter="chooseData"></table>
</div>
<script type="text/template" id="takeSiteSelectTemplate">
    {{#each data}}
    <option value="{{this}}">{{this}}</option>
    {{/each}}
</script>
<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script>
<script type="text/javascript" src="../../static/js/pakStore/clampOut_old.js" charset="utf-8"></script>
</body>
</html>
src/main/webapp/views/pda/index.html
@@ -75,7 +75,7 @@
<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="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>