自动化立体仓库 - WMS系统
zwl
2 天以前 fb57e7836338304b16c09fec4fb5c68fb688c39e
1.新增分区查询
2.任务档新增分区字段
4个文件已添加
33个文件已修改
1089 ■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/LocDetlController.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/LocMastController.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/WrkMastController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/InventoryFlowDto.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/LocDetl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/LocMast.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/ManLocDetl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WrkMast.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WrkMastLog.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/LocMastMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/WrkMastLogMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/LocMastService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java 159 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WrkMastLogServiceImpl.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WrkMastServiceImpl.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/LocAliasUtils.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocDetlMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocMastMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ManLocDetlMapper.xml 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WrkMastLogMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WrkMastMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/sql/20260428_loc_mast_area_alias.sql 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/sql/20260428_wrk_mast_area.sql 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locDetl/locDetl.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/locMast/locMast.js 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/stoMan/stoQue.js 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/wrkMast/wrkMast.js 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/ioWorks/locDetlQuery.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/locDetl/locDetl.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/locMast/locMast.html 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/locMast/locMast_detail.html 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pakStore/locDetlCheckQuery.html 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pakStore/locDetlQuery.html 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/stoMan/stoQue.html 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/wrkMast/wrkMast.html 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/wrkMast/wrkMast_detail.html 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/java/com/zy/asrs/utils/LocAliasUtilsTest.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/LocDetlController.java
@@ -22,6 +22,7 @@
import com.zy.asrs.entity.result.LocDetlDTO;
import com.zy.asrs.mapper.LocDetlMapper;
import com.zy.asrs.service.LocDetlService;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.LocOwnerService;
import com.zy.asrs.service.MatService;
import com.zy.common.web.BaseController;
@@ -43,6 +44,9 @@
    private LocDetlMapper locDetlMapper;
    @Autowired
    private MatService matService;
    @Autowired
    private LocMastService locMastService;
    @Autowired
    private LocOwnerService locOwnerService;
@@ -209,8 +213,13 @@
                wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
                wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
            } else {
                if (entry.getKey().equals("locNo")) {
                    wrapper.like("loc_no", String.valueOf(entry.getValue()));
                if (entry.getKey().equals("locNo") || entry.getKey().equals("loc_no")) {
                    List<String> locNos = locMastService.selectLocNosByNoOrAlias(String.valueOf(entry.getValue()));
                    if (locNos.isEmpty()) {
                        wrapper.eq("loc_no", "__NO_MATCH__");
                    } else {
                        wrapper.in("loc_no", locNos);
                    }
                } else {
                    wrapper.like(entry.getKey(), String.valueOf(entry.getValue()));
                }
src/main/java/com/zy/asrs/controller/LocMastController.java
@@ -15,6 +15,7 @@
import com.zy.asrs.entity.param.LocMastInitParam;
import com.zy.asrs.mapper.LocDetlMapper;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.LocAliasUtils;
import com.zy.common.entity.Parameter;
import com.zy.common.model.Shelves;
import com.zy.common.service.CommonService;
@@ -99,7 +100,13 @@
                if (entry.getKey().equals("loc_type1")){
                    sign=true;
                }
                wrapper.like(entry.getKey(), val);
                if (entry.getKey().equals("loc_no")){
                    wrapper.andNew().like("loc_no", val).or().like("loc_alias", val);
                } else if (entry.getKey().equals("area_id")) {
                    wrapper.eq(entry.getKey(), val);
                } else {
                    wrapper.like(entry.getKey(), val);
                }
            }
        }
        if (sign){
@@ -114,6 +121,7 @@
        locMast.setModiTime(new Date());
        locMast.setAppeUser(getUserId());
        locMast.setAppeTime(new Date());
        locMastService.prepareAreaAlias(locMast);
        locMastService.insert(locMast);
        return R.ok();
    }
@@ -134,6 +142,15 @@
        }
        LocMast oldLocMast = locMastService.selectById(locMast.getLocNo());
        if (locMast.getAreaId() == null && oldLocMast != null) {
            locMast.setAreaId(oldLocMast.getAreaId());
        }
        if (locMast.getFrozen() == null && oldLocMast != null) {
            locMast.setFrozen(oldLocMast.getFrozen());
        }
        if (locMast.getFrozenMemo() == null && oldLocMast != null) {
            locMast.setFrozenMemo(oldLocMast.getFrozenMemo());
        }
        if (locMast.getLocSts().equals("F") && (oldLocMast.getLocSts().equals("D") || oldLocMast.getLocSts().equals("O"))) {
            return R.error("当前操作已被阻止,请联系管理员");
        }
@@ -205,6 +222,7 @@
        }
        locMast.setModiUser(getUserId());
        locMast.setModiTime(now);
        locMastService.prepareAreaAlias(locMast);
        AdjDetl adjDetl = new AdjDetl();
        adjDetl.setLocNo(locMast.getLocNo());
        adjDetl.setMatnr("原库位状态:" + oldLocMast.getLocSts());
@@ -215,12 +233,27 @@
            throw new CoolException("库位调整记录失败");
        }
        // 库位冻结->冻结所有库存
        if (locMast.getFrozen() == 1 && oldLocMast.getFrozen() == 0 && locMast.getLocSts().equals("F") && oldLocMast.getLocSts().equals("F")) {
        if (Integer.valueOf(1).equals(locMast.getFrozen())
                && Integer.valueOf(0).equals(oldLocMast.getFrozen())
                && locMast.getLocSts().equals("F")
                && oldLocMast.getLocSts().equals("F")) {
            locDetlMapper.updateDetlFrozenByLocNo(oldLocMast.getLocNo());
        }
        if(!locMastService.updateById(locMast)) {
            throw new CoolException("服务器错误,请联系管理员");
        }
        return R.ok();
    }
    @PostMapping(value = "/locMast/batch/area/auth")
    @ManagerAuth(memo = "批量修改库区")
    public R batchArea(@RequestBody JSONObject param) {
        if (Cools.isEmpty(param) || Cools.isEmpty(param.getJSONArray("locNos"))) {
            return R.error("请选择库位");
        }
        List<String> locNos = JSONObject.parseArray(param.getJSONArray("locNos").toJSONString(), String.class);
        Integer areaId = param.getInteger("areaId");
        locMastService.batchUpdateArea(locNos, areaId, getUserId());
        return R.ok();
    }
@@ -252,13 +285,13 @@
    @ManagerAuth
    public R query(String condition) {
        EntityWrapper<LocMast> wrapper = new EntityWrapper<>();
        wrapper.like("loc_no", condition);
        wrapper.andNew().like("loc_no", condition).or().like("loc_alias", condition);
        Page<LocMast> page = locMastService.selectPage(new Page<>(0, 10), wrapper);
        List<Map<String, Object>> result = new ArrayList<>();
        for (LocMast locMast : page.getRecords()){
            Map<String, Object> map = new HashMap<>();
            map.put("id", locMast.getLocNo());
            map.put("value", locMast.getLocNo());
            map.put("value", LocAliasUtils.displayLocNo(locMast));
            result.add(map);
        }
        return R.ok(result);
@@ -330,6 +363,7 @@
                    }
                }
            }
            locMastService.fillAreaAlias(list);
            if (!Cools.isEmpty(param.getEnable()) && param.getEnable() == 1){
                locMastService.delete(new EntityWrapper<>());
            }
src/main/java/com/zy/asrs/controller/WrkMastController.java
@@ -11,6 +11,7 @@
import com.core.common.DateUtils;
import com.core.common.R;
import com.zy.asrs.entity.WrkMast;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.WrkMastService;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
@@ -23,6 +24,9 @@
    @Autowired
    private WrkMastService wrkMastService;
    @Autowired
    private LocMastService locMastService;
    @RequestMapping(value = "/wrkMast/{id}/auth")
    @ManagerAuth
@@ -61,7 +65,18 @@
                wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
                wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
            } else {
                wrapper.like(entry.getKey(), val);
                if (entry.getKey().equals("loc_no") || entry.getKey().equals("source_loc_no")) {
                    List<String> locNos = locMastService.selectLocNosByNoOrAlias(val);
                    if (locNos.isEmpty()) {
                        wrapper.eq(entry.getKey(), "__NO_MATCH__");
                    } else {
                        wrapper.in(entry.getKey(), locNos);
                    }
                } else if (entry.getKey().equals("area_id")) {
                    wrapper.eq(entry.getKey(), val);
                } else {
                    wrapper.like(entry.getKey(), val);
                }
            }
        }
    }
src/main/java/com/zy/asrs/entity/InventoryFlowDto.java
@@ -5,6 +5,7 @@
import com.zy.asrs.service.BasWrkIotypeService;
import com.zy.asrs.service.BasWrkStatusService;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.utils.LocAliasUtils;
import com.zy.system.entity.User;
import com.zy.system.service.UserService;
import lombok.Data;
@@ -57,18 +58,18 @@
        LocMastService service = SpringUtils.getBean(LocMastService.class);
        LocMast locMast = service.selectById(this.locNo);
        if (!Cools.isEmpty(locMast)) {
            return String.valueOf(locMast.getLocNo());
            return LocAliasUtils.displayLocNo(locMast);
        }
        return null;
        return this.locNo;
    }
    public String getSourceLocNo$() {
        LocMastService service = SpringUtils.getBean(LocMastService.class);
        LocMast locMast = service.selectById(this.sourceLocNo);
        if (!Cools.isEmpty(locMast)) {
            return String.valueOf(locMast.getLocNo());
            return LocAliasUtils.displayLocNo(locMast);
        }
        return null;
        return this.sourceLocNo;
    }
    public String getIoTime$() {
src/main/java/com/zy/asrs/entity/LocDetl.java
@@ -11,6 +11,7 @@
import com.zy.asrs.service.BasQualityTestingService;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.LocOwnerService;
import com.zy.asrs.utils.LocAliasUtils;
import com.zy.common.utils.Synchro;
import com.zy.system.entity.User;
import com.zy.system.service.UserService;
@@ -272,12 +273,16 @@
    private Integer frozen;
    public String getLocNo$(){
        return getLocAlias();
    }
    public String getLocAlias(){
        LocMastService service = SpringUtils.getBean(LocMastService.class);
        LocMast locMast = service.selectById(this.locNo);
        if (!Cools.isEmpty(locMast)){
            return String.valueOf(locMast.getLocNo());
            return LocAliasUtils.displayLocNo(locMast);
        }
        return null;
        return this.locNo;
    }
    public String getOwner$(){
        LocOwnerService service = SpringUtils.getBean(LocOwnerService.class);
src/main/java/com/zy/asrs/entity/LocMast.java
@@ -6,6 +6,7 @@
import com.baomidou.mybatisplus.enums.IdType;
import com.zy.asrs.service.BasLocStsService;
import com.zy.asrs.service.BasWhsService;
import com.zy.asrs.utils.LocAliasUtils;
import com.zy.system.entity.User;
import com.zy.system.service.UserService;
import com.core.common.Cools;
@@ -61,6 +62,20 @@
    @ApiModelProperty(value= "堆垛机号")
    @TableField("crn_no")
    private Integer crnNo;
    /**
     * 库区:1=A区,2=B区,3=C区
     */
    @ApiModelProperty(value= "库区")
    @TableField("area_id")
    private Integer areaId;
    /**
     * 库位别名
     */
    @ApiModelProperty(value= "库位别名")
    @TableField("loc_alias")
    private String locAlias;
    /**
     * 排
@@ -215,6 +230,10 @@
        return null;
    }
    public String getAreaId$() {
        return LocAliasUtils.areaName(this.areaId);
    }
    public String getIoTime$(){
        if (Cools.isEmpty(this.ioTime)){
            return "";
src/main/java/com/zy/asrs/entity/ManLocDetl.java
@@ -7,8 +7,10 @@
import com.baomidou.mybatisplus.enums.IdType;
import com.core.common.Cools;
import com.core.common.SpringUtils;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.LocOwnerService;
import com.zy.asrs.service.NodeService;
import com.zy.asrs.utils.LocAliasUtils;
import com.zy.system.entity.Host;
import com.zy.system.entity.User;
import com.zy.system.service.HostService;
@@ -273,6 +275,15 @@
        return null;
    }
    public String getLocNo$(){
        LocMastService service = SpringUtils.getBean(LocMastService.class);
        LocMast locMast = service.selectById(this.locNo);
        if (!Cools.isEmpty(locMast)){
            return LocAliasUtils.displayLocNo(locMast);
        }
        return this.locNo;
    }
    public String getOwner$(){
        LocOwnerService service = SpringUtils.getBean(LocOwnerService.class);
        LocOwner locOwner = service.selectById(this.owner);
src/main/java/com/zy/asrs/entity/WrkMast.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.LocAliasUtils;
import com.zy.system.entity.User;
import com.zy.system.service.UserService;
import com.core.common.Cools;
@@ -65,6 +66,13 @@
    @ApiModelProperty(value= "堆垛机")
    @TableField("crn_no")
    private Integer crnNo;
    /**
     * 库区:1=A区,2=B区,3=C区
     */
    @ApiModelProperty(value= "库区")
    @TableField("area_id")
    private Integer areaId;
    @ApiModelProperty(value= "")
    @TableField("sheet_no")
@@ -391,6 +399,10 @@
        return null;
    }
    public String getAreaId$(){
        return LocAliasUtils.areaName(this.areaId);
    }
    public String getWrkDate$(){
        if (Cools.isEmpty(this.wrkDate)){
            return "";
@@ -402,9 +414,9 @@
        LocMastService service = SpringUtils.getBean(LocMastService.class);
        LocMast locMast = service.selectById(this.locNo);
        if (!Cools.isEmpty(locMast)){
            return String.valueOf(locMast.getLocNo());
            return LocAliasUtils.displayLocNo(locMast);
        }
        return null;
        return this.locNo;
    }
    public String getStaNo$(){
@@ -429,9 +441,9 @@
        LocMastService service = SpringUtils.getBean(LocMastService.class);
        LocMast locMast = service.selectById(this.sourceLocNo);
        if (!Cools.isEmpty(locMast)){
            return String.valueOf(locMast.getLocNo());
            return LocAliasUtils.displayLocNo(locMast);
        }
        return null;
        return this.sourceLocNo;
    }
    public String getIoTime$(){
src/main/java/com/zy/asrs/entity/WrkMastLog.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.LocAliasUtils;
import com.zy.system.entity.User;
import com.zy.system.service.UserService;
import com.core.common.Cools;
@@ -70,6 +71,13 @@
    @ApiModelProperty(value= "堆垛机号")
    @TableField("crn_no")
    private Integer crnNo;
    /**
     * 库区:1=A区,2=B区,3=C区
     */
    @ApiModelProperty(value= "库区")
    @TableField("area_id")
    private Integer areaId;
    @ApiModelProperty(value= "")
    @TableField("sheet_no")
@@ -405,6 +413,10 @@
        return null;
    }
    public String getAreaId$(){
        return LocAliasUtils.areaName(this.areaId);
    }
    public String getWrkDate$(){
        if (Cools.isEmpty(this.wrkDate)){
            return "";
@@ -416,9 +428,9 @@
        LocMastService service = SpringUtils.getBean(LocMastService.class);
        LocMast locMast = service.selectById(this.locNo);
        if (!Cools.isEmpty(locMast)){
            return String.valueOf(locMast.getLocNo());
            return LocAliasUtils.displayLocNo(locMast);
        }
        return null;
        return this.locNo;
    }
    public String getStaNo$(){
@@ -443,9 +455,9 @@
        LocMastService service = SpringUtils.getBean(LocMastService.class);
        LocMast locMast = service.selectById(this.sourceLocNo);
        if (!Cools.isEmpty(locMast)){
            return String.valueOf(locMast.getLocNo());
            return LocAliasUtils.displayLocNo(locMast);
        }
        return null;
        return this.sourceLocNo;
    }
    public String getIoTime$(){
src/main/java/com/zy/asrs/mapper/LocMastMapper.java
@@ -27,6 +27,9 @@
    @Select("select count(*) as count from asr_loc_mast where 1=1 and loc_sts = 'O' and loc_type1 = #{locType1} and crn_no = #{crnNo}")
    Integer selectEmptyLocCount(@Param("locType1") Short locType1, @Param("crnNo") Integer crnNo,@Param("whsType") Long whsType);
    @Select("select min(row1) from asr_loc_mast where area_id = #{areaId}")
    Integer selectMinRowByArea(@Param("areaId") Integer areaId);
    List<LocMast> queryShallowLocFMast(@Param("crnNo") Integer crnNo,@Param("whsType") Long whsType);
    List<LocMast> selectLocShuttleMoveUnilateralY(@Param("bay")Integer bay,@Param("lev")Integer lev,@Param("whsType") Long whsType);
src/main/java/com/zy/asrs/mapper/WrkMastLogMapper.java
@@ -18,12 +18,12 @@
public interface WrkMastLogMapper extends BaseMapper<WrkMastLog> {
        @Insert("INSERT INTO asr_wrk_mast_log (" +
            "wrk_no, inv_wh, ymd, mk, whs_type, wrk_sts, io_type, crn_no, sheet_no, io_pri, wrk_date, loc_no, sta_no, source_sta_no, source_loc_no, loc_sts, " +
            "wrk_no, inv_wh, ymd, mk, whs_type, wrk_sts, io_type, crn_no, area_id, sheet_no, io_pri, wrk_date, loc_no, sta_no, source_sta_no, source_loc_no, loc_sts, " +
            "picking, link_mis, online_yn, upd_mk, exit_mk, plt_type, batch_seq, empty_mk, io_time, ctn_type, packed, ove_mk, mtn_type, user_no, crn_str_time, " +
            "crn_end_time, plc_str_time, crn_pos_time, load_time, exp_time, cost_time, ref_wrkno, ref_iotime, modi_user, modi_time, appe_user, appe_time, pause_mk, " +
            "error_time, error_memo, ctn_kind, manu_type, memo_m, sc_weight, log_mk, log_err_time, log_err_memo, barcode, Pdc_type, container_no, teu, plate_no, train_no, freq_type, cube_number, ctn_no, full_plt, pre_have, take_none) " +
            "SELECT " +
            "wrk_no, inv_wh, ymd, mk, whs_type, wrk_sts, io_type, crn_no, sheet_no, io_pri, wrk_date, loc_no, sta_no, source_sta_no, source_loc_no, loc_sts, " +
            "wrk_no, inv_wh, ymd, mk, whs_type, wrk_sts, io_type, crn_no, area_id, sheet_no, io_pri, wrk_date, loc_no, sta_no, source_sta_no, source_loc_no, loc_sts, " +
            "picking, link_mis, online_yn, upd_mk, exit_mk, plt_type, batch_seq, empty_mk, io_time, ctn_type, packed, ove_mk, mtn_type, user_no, crn_str_time, " +
            "crn_end_time, plc_str_time, crn_pos_time, load_time, exp_time, DATEDIFF(MINUTE, appe_time, GETDATE()), ref_wrkno, ref_iotime, modi_user, modi_time, appe_user, appe_time, pause_mk, " +
            "error_time, error_memo, ctn_kind, manu_type, memo, sc_weight, log_mk, log_err_time, log_err_memo, barcode, Pdc_type, container_no, teu, plate_no, train_no, freq_type, cube_number, ctn_no, full_plt, pre_have, take_none " +
src/main/java/com/zy/asrs/service/LocMastService.java
@@ -12,6 +12,27 @@
    List<LocMast>  asrLocMastNotInDetl2();
    List<LocMast>  asrLocMastNotInDetl3();
    List<ErrorDeviceParam>  adjacentLocMast();
    /**
     * 按库区和库位坐标补齐单个库位别名。
     */
    void prepareAreaAlias(LocMast locMast);
    /**
     * 按列表内的库区最小排批量补齐库位别名,主要用于初始化。
     */
    void fillAreaAlias(List<LocMast> locMasts);
    /**
     * 批量修改库区并重算相关库区别名。
     */
    void batchUpdateArea(List<String> locNos, Integer areaId, Long userId);
    /**
     * 按原库位号或别名查找原始 loc_no。
     */
    List<String> selectLocNosByNoOrAlias(String condition);
    /**
     * 检索可用库位
     */
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
@@ -1,17 +1,26 @@
package com.zy.asrs.service.impl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.entity.LocDetl;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.entity.param.ErrorDeviceParam;
import com.zy.asrs.mapper.LocMastMapper;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.RowLastnoService;
import com.zy.asrs.utils.LocAliasUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Service("locMastService")
public class LocMastServiceImpl extends ServiceImpl<LocMastMapper, LocMast> implements LocMastService {
@@ -35,6 +44,156 @@
        return this.baseMapper.adjacentLocMast();
    }
    @Override
    public void prepareAreaAlias(LocMast locMast) {
        if (locMast == null) {
            return;
        }
        Integer areaId = locMast.getAreaId();
        if (areaId == null) {
            areaId = LocAliasUtils.areaIdByCrnNo(locMast.getCrnNo());
            locMast.setAreaId(areaId);
        }
        Integer minRow = minRowByArea(areaId, locMast.getRow1());
        locMast.setLocAlias(LocAliasUtils.buildAlias(
                areaId,
                locMast.getRow1(),
                locMast.getBay1(),
                locMast.getLev1(),
                minRow));
    }
    @Override
    public void fillAreaAlias(List<LocMast> locMasts) {
        if (Cools.isEmpty(locMasts)) {
            return;
        }
        Map<Integer, Integer> minRowByArea = new HashMap<>();
        for (LocMast locMast : locMasts) {
            if (locMast.getAreaId() == null) {
                locMast.setAreaId(LocAliasUtils.areaIdByCrnNo(locMast.getCrnNo()));
            }
            Integer areaId = locMast.getAreaId();
            Integer row = locMast.getRow1();
            if (areaId == null || row == null) {
                continue;
            }
            Integer minRow = minRowByArea.get(areaId);
            if (minRow == null || row < minRow) {
                minRowByArea.put(areaId, row);
            }
        }
        for (LocMast locMast : locMasts) {
            locMast.setLocAlias(LocAliasUtils.buildAlias(
                    locMast.getAreaId(),
                    locMast.getRow1(),
                    locMast.getBay1(),
                    locMast.getLev1(),
                    minRowByArea.get(locMast.getAreaId())));
        }
    }
    @Override
    public void batchUpdateArea(List<String> locNos, Integer areaId, Long userId) {
        if (Cools.isEmpty(locNos)) {
            throw new CoolException("请选择库位");
        }
        if (LocAliasUtils.areaCode(areaId) == null) {
            throw new CoolException("库区参数错误");
        }
        List<LocMast> oldLocMasts = this.selectBatchIds(locNos);
        if (Cools.isEmpty(oldLocMasts)) {
            throw new CoolException("未找到要修改的库位");
        }
        Set<Integer> affectedAreaIds = new HashSet<>();
        affectedAreaIds.add(areaId);
        List<LocMast> updates = new ArrayList<>();
        Date now = new Date();
        for (LocMast oldLocMast : oldLocMasts) {
            if (oldLocMast.getAreaId() != null) {
                affectedAreaIds.add(oldLocMast.getAreaId());
            }
            LocMast update = new LocMast();
            update.setLocNo(oldLocMast.getLocNo());
            update.setAreaId(areaId);
            update.setModiUser(userId);
            update.setModiTime(now);
            updates.add(update);
        }
        if (!this.updateBatchById(updates)) {
            throw new CoolException("批量修改库区失败");
        }
        rebuildAliasByAreas(affectedAreaIds, userId);
    }
    @Override
    public List<String> selectLocNosByNoOrAlias(String condition) {
        List<String> locNos = new ArrayList<>();
        if (Cools.isEmpty(condition)) {
            return locNos;
        }
        List<LocMast> locMasts = this.selectList(new EntityWrapper<LocMast>()
                .andNew()
                .like("loc_no", condition)
                .or()
                .like("loc_alias", condition));
        for (LocMast locMast : locMasts) {
            locNos.add(locMast.getLocNo());
        }
        return locNos;
    }
    private Integer minRowByArea(Integer areaId, Integer currentRow) {
        if (areaId == null) {
            return null;
        }
        Integer minRow = this.baseMapper.selectMinRowByArea(areaId);
        if (currentRow != null && (minRow == null || currentRow < minRow)) {
            return currentRow;
        }
        return minRow;
    }
    private void rebuildAliasByAreas(Set<Integer> areaIds, Long userId) {
        if (Cools.isEmpty(areaIds)) {
            return;
        }
        List<LocMast> locMasts = this.selectList(new EntityWrapper<LocMast>().in("area_id", areaIds));
        if (Cools.isEmpty(locMasts)) {
            return;
        }
        Map<Integer, Integer> minRowByArea = new HashMap<>();
        for (LocMast locMast : locMasts) {
            Integer areaId = locMast.getAreaId();
            Integer row = locMast.getRow1();
            if (areaId == null || row == null) {
                continue;
            }
            Integer minRow = minRowByArea.get(areaId);
            if (minRow == null || row < minRow) {
                minRowByArea.put(areaId, row);
            }
        }
        List<LocMast> updates = new ArrayList<>();
        Date now = new Date();
        for (LocMast locMast : locMasts) {
            LocMast update = new LocMast();
            update.setLocNo(locMast.getLocNo());
            update.setLocAlias(LocAliasUtils.buildAlias(
                    locMast.getAreaId(),
                    locMast.getRow1(),
                    locMast.getBay1(),
                    locMast.getLev1(),
                    minRowByArea.get(locMast.getAreaId())));
            update.setModiUser(userId);
            update.setModiTime(now);
            updates.add(update);
        }
        if (!updates.isEmpty() && !this.updateBatchById(updates)) {
            throw new CoolException("重算库位别名失败");
        }
    }
    @Autowired
    private RowLastnoService rowLastnoService;
src/main/java/com/zy/asrs/service/impl/WrkMastLogServiceImpl.java
@@ -2,11 +2,15 @@
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.core.common.Cools;
import com.core.common.R;
import com.zy.asrs.entity.InventoryFlowDto;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.entity.WrkMastLog;
import com.zy.asrs.mapper.WrkMastLogMapper;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.WrkMastLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
@@ -14,6 +18,15 @@
@Service("wrkMastLogService")
public class WrkMastLogServiceImpl extends ServiceImpl<WrkMastLogMapper, WrkMastLog> implements WrkMastLogService {
    @Autowired
    private LocMastService locMastService;
    @Override
    public boolean insert(WrkMastLog entity) {
        fillAreaId(entity);
        return super.insert(entity);
    }
    @Override
    public boolean save(Integer workNo) {
@@ -45,4 +58,33 @@
        return R.ok(page);
    }
    private void fillAreaId(WrkMastLog wrkMastLog) {
        if (wrkMastLog == null) {
            return;
        }
        LocMast locMast = resolveAreaLocMast(wrkMastLog);
        if (locMast != null) {
            wrkMastLog.setAreaId(locMast.getAreaId());
        }
    }
    private LocMast resolveAreaLocMast(WrkMastLog wrkMastLog) {
        boolean outbound = wrkMastLog.getIoType() != null && wrkMastLog.getIoType() >= 100;
        LocMast primary = outbound
                ? selectLocMast(wrkMastLog.getSourceLocNo())
                : selectLocMast(wrkMastLog.getLocNo());
        if (primary != null) {
            return primary;
        }
        return outbound
                ? selectLocMast(wrkMastLog.getLocNo())
                : selectLocMast(wrkMastLog.getSourceLocNo());
    }
    private LocMast selectLocMast(String locNo) {
        if (Cools.isEmpty(locNo)) {
            return null;
        }
        return locMastService.selectById(locNo);
    }
}
src/main/java/com/zy/asrs/service/impl/WrkMastServiceImpl.java
@@ -3,11 +3,13 @@
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.core.common.Cools;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.entity.WrkMast;
import com.zy.asrs.entity.result.FindLocNoAttributeVo;
import com.zy.asrs.mapper.WrkMastLogMapper;
import com.zy.asrs.mapper.WrkMastMapper;
import com.zy.asrs.service.InboundCameraCaptureService;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.WrkMastService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -24,6 +26,21 @@
    @Autowired
    private WrkMastLogMapper wrkMastLogMapper;
    @Autowired
    private LocMastService locMastService;
    @Override
    public boolean insert(WrkMast entity) {
        fillAreaId(entity);
        return super.insert(entity);
    }
    @Override
    public boolean updateById(WrkMast entity) {
        fillAreaId(entity);
        return super.updateById(entity);
    }
    @Override
    public int getWorkingMast(Integer devpNo) {
@@ -147,4 +164,34 @@
            }
        }
    }
    private void fillAreaId(WrkMast wrkMast) {
        if (wrkMast == null) {
            return;
        }
        LocMast locMast = resolveAreaLocMast(wrkMast);
        if (locMast != null) {
            wrkMast.setAreaId(locMast.getAreaId());
        }
    }
    private LocMast resolveAreaLocMast(WrkMast wrkMast) {
        boolean outbound = wrkMast.getIoType() != null && wrkMast.getIoType() >= 100;
        LocMast primary = outbound
                ? selectLocMast(wrkMast.getSourceLocNo())
                : selectLocMast(wrkMast.getLocNo());
        if (primary != null) {
            return primary;
        }
        return outbound
                ? selectLocMast(wrkMast.getLocNo())
                : selectLocMast(wrkMast.getSourceLocNo());
    }
    private LocMast selectLocMast(String locNo) {
        if (Cools.isEmpty(locNo)) {
            return null;
        }
        return locMastService.selectById(locNo);
    }
}
src/main/java/com/zy/asrs/utils/LocAliasUtils.java
New file
@@ -0,0 +1,74 @@
package com.zy.asrs.utils;
import com.zy.asrs.entity.LocMast;
/**
 * 库位别名规则:不改变原始 loc_no,只按库区和重排排号生成展示别名。
 */
public final class LocAliasUtils {
    private LocAliasUtils() {
    }
    public static Integer areaIdByCrnNo(Integer crnNo) {
        if (crnNo == null) {
            return null;
        }
        if (crnNo >= 1 && crnNo <= 6) {
            return 1;
        }
        if (crnNo >= 7 && crnNo <= 18) {
            return 2;
        }
        if (crnNo >= 19 && crnNo <= 28) {
            return 3;
        }
        return null;
    }
    public static String areaCode(Integer areaId) {
        if (areaId == null) {
            return null;
        }
        switch (areaId) {
            case 1:
                return "A";
            case 2:
                return "B";
            case 3:
                return "C";
            default:
                return null;
        }
    }
    public static String areaName(Integer areaId) {
        String areaCode = areaCode(areaId);
        if (areaCode == null) {
            return areaId == null ? "" : String.valueOf(areaId);
        }
        return areaCode + "区";
    }
    public static String buildAlias(Integer areaId, Integer row, Integer bay, Integer lev, Integer minAreaRow) {
        String areaCode = areaCode(areaId);
        if (areaCode == null || row == null || bay == null || lev == null || minAreaRow == null) {
            return null;
        }
        int aliasRow = row - minAreaRow + 1;
        if (aliasRow <= 0) {
            return null;
        }
        return areaCode + "-" + String.format("%02d%03d%02d", aliasRow, bay, lev);
    }
    public static String displayLocNo(LocMast locMast) {
        if (locMast == null) {
            return null;
        }
        if (locMast.getLocAlias() != null && locMast.getLocAlias().trim().length() > 0) {
            return locMast.getLocAlias();
        }
        return locMast.getLocNo();
    }
}
src/main/resources/mapper/LocDetlMapper.xml
@@ -391,7 +391,7 @@
    <sql id="stockOutCondition">
        <if test="loc_no!=null and loc_no!='' ">
            and a.loc_no like '%' + #{loc_no} + '%'
            and (a.loc_no like '%' + #{loc_no} + '%' or b.loc_alias like '%' + #{loc_no} + '%')
        </if>
        <if test="matnr!=null and matnr!='' ">
            and a.matnr like '%' + #{matnr} + '%'
src/main/resources/mapper/LocMastMapper.xml
@@ -11,9 +11,12 @@
        <result column="loc_sts" property="locSts" />
        <result column="sheet_no" property="sheetNo" />
        <result column="crn_no" property="crnNo" />
        <result column="area_id" property="areaId" />
        <result column="loc_alias" property="locAlias" />
        <result column="row1" property="row1" />
        <result column="bay1" property="bay1" />
        <result column="lev1" property="lev1" />
        <result column="gro1" property="gro1" />
        <result column="full_plt" property="fullPlt" />
        <result column="loc_type" property="locType" />
        <result column="loc_type1" property="locType1" />
src/main/resources/mapper/ManLocDetlMapper.xml
@@ -38,10 +38,24 @@
            and mld.host_id = #{host_id}
        </if>
        <if test="loc_no != null and loc_no != ''">
            and mld.loc_no like concat('%',#{loc_no},'%')
            and (
                mld.loc_no like concat('%',#{loc_no},'%')
                or exists (
                    select 1 from asr_loc_mast alm
                    where alm.loc_no = mld.loc_no
                    and alm.loc_alias like concat('%',#{loc_no},'%')
                )
            )
        </if>
        <if test="locNo != null and locNo != ''">
            and mld.loc_no like concat('%',#{loc_no},'%')
            and (
                mld.loc_no like concat('%',#{locNo},'%')
                or exists (
                    select 1 from asr_loc_mast alm
                    where alm.loc_no = mld.loc_no
                    and alm.loc_alias like concat('%',#{locNo},'%')
                )
            )
        </if>
        <if test="matnr != null and matnr != ''">
            and mld.matnr like concat('%',#{matnr},'%')
@@ -58,10 +72,24 @@
            and v.host_id = #{host_id}
        </if>
        <if test="loc_no != null and loc_no != ''">
            and v.loc_no like concat('%',#{loc_no},'%')
            and (
                v.loc_no like concat('%',#{loc_no},'%')
                or exists (
                    select 1 from asr_loc_mast alm
                    where alm.loc_no = v.loc_no
                    and alm.loc_alias like concat('%',#{loc_no},'%')
                )
            )
        </if>
        <if test="locNo != null and locNo != ''">
            and v.loc_no like concat('%',#{loc_no},'%')
            and (
                v.loc_no like concat('%',#{locNo},'%')
                or exists (
                    select 1 from asr_loc_mast alm
                    where alm.loc_no = v.loc_no
                    and alm.loc_alias like concat('%',#{locNo},'%')
                )
            )
        </if>
        <if test="matnr != null and matnr != ''">
            and v.matnr like concat('%',#{matnr},'%')
@@ -220,7 +248,14 @@
            and a.node_id like '%' + #{node_id} + '%'
        </if>
        <if test="loc_no!=null and loc_no!='' ">
            and a.loc_no like '%' + #{loc_no} + '%'
            and (
                a.loc_no like '%' + #{loc_no} + '%'
                or exists (
                    select 1 from asr_loc_mast alm
                    where alm.loc_no = a.loc_no
                    and alm.loc_alias like '%' + #{loc_no} + '%'
                )
            )
        </if>
        <if test="matnr!=null and matnr!='' ">
            and a.matnr like '%' + #{matnr} + '%'
src/main/resources/mapper/WrkMastLogMapper.xml
@@ -13,6 +13,7 @@
        <result column="wrk_sts" property="wrkSts" />
        <result column="io_type" property="ioType" />
        <result column="crn_no" property="crnNo" />
        <result column="area_id" property="areaId" />
        <result column="sheet_no" property="sheetNo" />
        <result column="io_pri" property="ioPri" />
        <result column="wrk_date" property="wrkDate" />
src/main/resources/mapper/WrkMastMapper.xml
@@ -12,6 +12,7 @@
        <result column="wrk_sts" property="wrkSts" />
        <result column="io_type" property="ioType" />
        <result column="crn_no" property="crnNo" />
        <result column="area_id" property="areaId" />
        <result column="sheet_no" property="sheetNo" />
        <result column="io_pri" property="ioPri" />
        <result column="wrk_date" property="wrkDate" />
src/main/resources/sql/20260428_loc_mast_area_alias.sql
New file
@@ -0,0 +1,50 @@
IF COL_LENGTH('dbo.asr_loc_mast', 'area_id') IS NULL
BEGIN
    ALTER TABLE [dbo].[asr_loc_mast]
        ADD [area_id] INT NULL;
END;
IF COL_LENGTH('dbo.asr_loc_mast', 'loc_alias') IS NULL
BEGIN
    ALTER TABLE [dbo].[asr_loc_mast]
        ADD [loc_alias] NVARCHAR(32) NULL;
END;
EXEC sys.sp_executesql N'
UPDATE [dbo].[asr_loc_mast]
SET [area_id] =
    CASE
        WHEN [crn_no] BETWEEN 1 AND 6 THEN 1
        WHEN [crn_no] BETWEEN 7 AND 18 THEN 2
        WHEN [crn_no] BETWEEN 19 AND 28 THEN 3
        ELSE [area_id]
    END
WHERE [area_id] IS NULL
  AND [crn_no] BETWEEN 1 AND 28;
';
EXEC sys.sp_executesql N'
;WITH area_min AS (
    SELECT [area_id], MIN([row1]) AS [min_row]
    FROM [dbo].[asr_loc_mast]
    WHERE [area_id] IN (1, 2, 3)
      AND [row1] IS NOT NULL
    GROUP BY [area_id]
)
UPDATE lm
SET [loc_alias] =
    CASE lm.[area_id]
        WHEN 1 THEN N''A-''
        WHEN 2 THEN N''B-''
        WHEN 3 THEN N''C-''
    END
    + RIGHT(''00'' + CAST(lm.[row1] - area_min.[min_row] + 1 AS VARCHAR(10)), 2)
    + RIGHT(''000'' + CAST(lm.[bay1] AS VARCHAR(10)), 3)
    + RIGHT(''00'' + CAST(lm.[lev1] AS VARCHAR(10)), 2)
FROM [dbo].[asr_loc_mast] lm
INNER JOIN area_min ON lm.[area_id] = area_min.[area_id]
WHERE lm.[area_id] IN (1, 2, 3)
  AND lm.[row1] IS NOT NULL
  AND lm.[bay1] IS NOT NULL
  AND lm.[lev1] IS NOT NULL;
';
src/main/resources/sql/20260428_wrk_mast_area.sql
New file
@@ -0,0 +1,65 @@
IF COL_LENGTH('dbo.asr_loc_mast', 'area_id') IS NULL
BEGIN
    ALTER TABLE [dbo].[asr_loc_mast]
        ADD [area_id] INT NULL;
END;
EXEC sys.sp_executesql N'
UPDATE [dbo].[asr_loc_mast]
SET [area_id] =
    CASE
        WHEN [crn_no] BETWEEN 1 AND 6 THEN 1
        WHEN [crn_no] BETWEEN 7 AND 18 THEN 2
        WHEN [crn_no] BETWEEN 19 AND 28 THEN 3
        ELSE [area_id]
    END
WHERE [area_id] IS NULL
  AND [crn_no] BETWEEN 1 AND 28;
';
IF COL_LENGTH('dbo.asr_wrk_mast', 'area_id') IS NULL
BEGIN
    ALTER TABLE [dbo].[asr_wrk_mast]
        ADD [area_id] INT NULL;
END;
EXEC sys.sp_executesql N'
UPDATE m
SET area_id = CASE
        WHEN m.io_type >= 100 THEN COALESCE(source_loc.area_id, target_loc.area_id)
        ELSE COALESCE(target_loc.area_id, source_loc.area_id)
    END
FROM dbo.asr_wrk_mast m
LEFT JOIN dbo.asr_loc_mast target_loc ON target_loc.loc_no = m.loc_no
LEFT JOIN dbo.asr_loc_mast source_loc ON source_loc.loc_no = m.source_loc_no
WHERE m.area_id IS NULL
  AND CASE
        WHEN m.io_type >= 100 THEN COALESCE(source_loc.area_id, target_loc.area_id)
        ELSE COALESCE(target_loc.area_id, source_loc.area_id)
      END IS NOT NULL;
';
IF OBJECT_ID('dbo.asr_wrk_mast_log', 'U') IS NOT NULL
BEGIN
    IF COL_LENGTH('dbo.asr_wrk_mast_log', 'area_id') IS NULL
    BEGIN
        ALTER TABLE [dbo].[asr_wrk_mast_log]
            ADD [area_id] INT NULL;
    END;
    EXEC sys.sp_executesql N'
    UPDATE m
    SET area_id = CASE
            WHEN m.io_type >= 100 THEN COALESCE(source_loc.area_id, target_loc.area_id)
            ELSE COALESCE(target_loc.area_id, source_loc.area_id)
        END
    FROM dbo.asr_wrk_mast_log m
    LEFT JOIN dbo.asr_loc_mast target_loc ON target_loc.loc_no = m.loc_no
    LEFT JOIN dbo.asr_loc_mast source_loc ON source_loc.loc_no = m.source_loc_no
    WHERE m.area_id IS NULL
      AND CASE
            WHEN m.io_type >= 100 THEN COALESCE(source_loc.area_id, target_loc.area_id)
            ELSE COALESCE(target_loc.area_id, source_loc.area_id)
          END IS NOT NULL;
    ';
END;
src/main/webapp/static/js/locDetl/locDetl.js
@@ -2,7 +2,8 @@
function getCol() {
    var cols = [
        {type: 'checkbox'},
        {field: 'locNo$', align: 'center',title: '库位号'}
        {field: 'locNo', align: 'center',title: '库位号'}
        ,{field: 'locNo$', align: 'center',title: '库位别名'}
        ,{field: 'storeDate', align: 'center',title: '库龄(天)', hide: true, sort:true}
        ,{field: 'matnr', align: 'center',title: '商品编号', hide: false, sort:true}
        ,{field: 'maktx', align: 'center',title: '商品名称', hide: false, sort:true}
src/main/webapp/static/js/locMast/locMast.js
@@ -1,4 +1,5 @@
var pageCurr;
var batchAreaLocNos = [];
layui.use(['table','laydate', 'form'], function(){
    var table = layui.table;
    var $ = layui.jquery;
@@ -22,18 +23,9 @@
            {type: 'checkbox', fixed: 'left'}
//            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
            ,{field: 'locNo', align: 'center',title: '库位号',sort:true, hide:false}
            ,{field: 'areaId$', align: 'center',title: '库区',sort:true, hide:false}
            ,{field: 'locAlias', align: 'center',title: '库位别名',sort:true, hide:false}
            ,{field: 'locSts$', align: 'center',title: '库位状态',width:200, hide:false}
            ,{field: 'whsType$', align: 'center',title: '库位类型',width:200, hide:false}
            ,{field: 'frozen$', align: 'center',title: '冻结状态',
                templet: function(d) {
                    // 根据条件判断字体颜色
                    if (d.frozen$ === '已冻结') {
                        return '<span style="color: #34a8de;">' +d.frozen$ + '</span>';
                    } else {
                        return '<span">' +d.frozen$ + '</span>';
                    }
                }}
            ,{field: 'frozenMemo', align: 'center',title: '冻结原因'}
            // ,{field: 'pltType', align: 'center',title: ''}
            // ,{field: 'ctnType', align: 'center',title: ''}
            // ,{field: 'locSts', align: 'center',title: ''}
@@ -43,12 +35,6 @@
            ,{field: 'bay1', align: 'center',title: '列', sort:true, hide:false}
            ,{field: 'lev1', align: 'center',title: '层', sort:true, hide:false}
            ,{field: 'gro1', align: 'center',title: '组', sort:true, hide:false}
            ,{field: 'fullPlt', align: 'center',title: '满板', templet:function(row){
                    var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' disabled table-index='"+row.LAY_TABLE_INDEX+"'";
                    if(row.fullPlt === 'Y'){html += " checked ";}
                    html += ">";
                    return html;
                },width:80, hide:false}
            // ,{field: 'outEnable', align: 'center',title: ''}
            ,{field: 'ioTime$', align: 'center',title: 'ioTime', hide:true}
            // ,{field: 'firstTime$', align: 'center',title: '', hide:true}
@@ -92,14 +78,6 @@
            }
            pageCurr=curr;
            limit();
            form.on('checkbox(tableCheckbox)', function (data) {
                var _index = $(data.elem).attr('table-index')||0;
                if(data.elem.checked){
                    res.data[_index][data.value] = 'Y';
                }else{
                    res.data[_index][data.value] = 'N';
                }
            });
        }
    });
@@ -178,6 +156,28 @@
                            }
                        })
                    });
                }
                break;
            case 'batchArea':
                var areaData = checkStatus.data;
                if (areaData.length === 0){
                    layer.msg('请选择数据');
                } else {
                    batchAreaLocNos = areaData.map(function (item) {
                        return item.locNo;
                    });
                    $('#batchAreaId').val('');
                    layer.open({
                        type: 1,
                        title: '批量修改库区',
                        area: ["360px"],
                        maxmin: true,
                        shadeClose: true,
                        content: $("#batchAreaDiv"),
                        success: function () {
                            form.render('select');
                        }
                    })
                }
                break;
            case 'exportData':
@@ -304,42 +304,6 @@
                    }
                });
                break;
            case 'whsType':
                var param = top.reObject(data).whsType;
                if (param === undefined) {
                    layer.msg("无数据");
                } else {
                   layer.open({
                       type: 2,
                       title: '库位详情',
                       maxmin: true,
                       area: [top.detailWidth, top.detailHeight],
                       shadeClose: false,
                       content: '../basWhs/basWhs_detail.html',
                       success: function(layero, index){
                           $.ajax({
                               url: baseUrl+"/basWhs/"+ 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':
                var param = top.reObject(data).modiUser;
                if (param === undefined) {
@@ -439,6 +403,36 @@
        })
    });
    // 批量修改库区
    form.on('submit(batchAreaDo)', function (data) {
        if (batchAreaLocNos.length === 0) {
            layer.msg('请选择数据');
            return false;
        }
        $.ajax({
            url: baseUrl+"/locMast/batch/area/auth",
            headers: {'token': localStorage.getItem('token')},
            data: JSON.stringify({
                locNos: batchAreaLocNos,
                areaId: data.field.areaId
            }),
            dataType:'json',
            contentType:'application/json;charset=UTF-8',
            method: 'POST',
            success: function (res) {
                if (res.code === 200){
                    layer.closeAll();
                    tableReload(false);
                } else if (res.code === 403){
                    parent.location.href = "/";
                }else {
                    layer.msg(res.msg)
                }
            }
        });
        return false;
    });
    // 数据保存动作
    form.on('submit(save)', function () {
        if (banMsg != null){
@@ -460,6 +454,8 @@
        var data = {
//            id: $('#id').val(),
            locNo: $('#locNo').val(),
            areaId: $('#areaId').val(),
            locAlias: $('#locAlias').val(),
            whsType: $('#whsType').val(),
            pltType: $('#pltType').val(),
            ctnType: $('#ctnType').val(),
@@ -512,16 +508,6 @@
            }
        })
    }
    // 复选框事件
    form.on('checkbox(detailCheckbox)', function (data) {
        var el = data.elem;
        if (el.checked) {
            $(el).val('Y');
        } else {
            $(el).val('N');
        }
    });
    // 搜索栏搜索事件
    form.on('submit(search)', function (data) {
src/main/webapp/static/js/stoMan/stoQue.js
@@ -27,36 +27,21 @@
        cols: [[
            {type: 'checkbox'}
            ,{field: 'locNo', align: 'center',title: '库位号', hide:false}
            ,{field: 'locAlias', align: 'center',title: '库位别名', hide:false}
            ,{field: 'areaId$', align: 'center',title: '库区', hide:false}
            ,{field: 'locSts$', align: 'center',title: '库位状态', width: 180, style: 'color: #8E2323', hide:false}
            ,{field: 'whsType$', align: 'center',title: '库位类型', width: 180, style: 'color: #8E2323', hide:false}
            ,{field: 'frozen$', align: 'center',title: '冻结状态',
                templet: function(d) {
                    // 根据条件判断字体颜色
                    if (d.frozen$ === '已冻结') {
                        return '<span style="color: #34a8de;">' +d.frozen$ + '</span>';
                    } else {
                        return '<span">' +d.frozen$ + '</span>';
                    }
                }}
            ,{field: 'frozenMemo', align: 'center',title: '冻结原因'}
            ,{field: 'crnNo', align: 'center',title: '堆垛机号', sort:true, hide:false}
            ,{field: 'row1', align: 'center',title: '排', sort:true, hide:true}
            ,{field: 'bay1', align: 'center',title: '列', sort:true, hide:true}
            ,{field: 'lev1', align: 'center',title: '层', sort:true, hide:true}
            ,{field: 'row1', align: 'center',title: '排', sort:true, hide:false}
            ,{field: 'bay1', align: 'center',title: '列', sort:true, hide:false}
            ,{field: 'lev1', align: 'center',title: '层', sort:true, hide:false}
            ,{field: 'gro1', align: 'center',title: '组', sort:true, hide:true}
            ,{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: '条码号', hide:false}
            ,{field: 'locType1$', align: 'center',title: '高低类型', hide:true}
            ,{field: 'locType2$', align: 'center',title: '宽窄类型', hide:true}
            ,{field: 'locType3$', align: 'center',title: '轻重类型', hide:true}
            ,{field: 'modiUser$', align: 'center',title: '修改人员', hide:true}
            ,{field: 'modiTime$', align: 'center',title: '修改时间', width: 180, hide:false}
            ,{ fixed: 'right', title:'操作', align: 'center', toolbar: '#operate'}
            ,{ fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width: 120}
        ]],
        request: {
            pageName: 'curr',
@@ -181,6 +166,23 @@
                }
                locDetlToLayer(data.locNo);
                break;
            case 'viewPhoto':
                $.ajax({
                    url: baseUrl + "/photo/loc/auth",
                    headers: {'token': localStorage.getItem('token')},
                    data: {locNo: data.locNo},
                    method: 'GET',
                    success: function (res) {
                        if (res.code === 200) {
                            showPhotoViewer(layer, res.data);
                        } else if (res.code === 403) {
                            top.location.href = baseUrl + "/";
                        } else {
                            layer.msg(res.msg);
                        }
                    }
                });
                break;
        }
    });
src/main/webapp/static/js/wrkMast/wrkMast.js
@@ -28,13 +28,14 @@
            ,{field: 'ioType$', align: 'center',title: '入出库类型'}
            ,{field: 'ioPri', align: 'center',title: '优先级'}
            ,{field: 'crnNo$', align: 'center',title: '堆垛机'}
            ,{field: 'areaId$', align: 'center',title: '库区'}
            ,{field: 'sourceStaNo$', align: 'center',title: '源站'}
            ,{field: 'staNo$', align: 'center',title: '目标站'}
            ,{field: 'sourceLocNo$', align: 'center',title: '源库位'}
            ,{field: 'locNo$', align: 'center',title: '目标库位'}
            ,{field: 'barcode', align: 'center',title: '条码'}
            ,{field: 'preHave', align: 'center',title: '先入品', hide: true}
            ,{field: 'takeNone$', align: 'center', title: 'AGV锁定',hide: false}
            ,{field: 'takeNone$', align: 'center', title: 'AGV锁定', hide: true}
            // ,{field: 'picking', align: 'center',title: '拣料', templet:function(row){
            //         var html = "<input value='picking' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
@@ -379,6 +380,7 @@
            wrkSts: $('#wrkSts').val(),
            ioType: $('#ioType').val(),
            crnNo: $('#crnNo').val(),
            areaId: $('#areaId').val(),
            sheetNo: $('#sheetNo').val(),
            ioPri: $('#ioPri').val(),
            wrkDate: top.strToDate($('#wrkDate\\$').val()),
src/main/webapp/views/ioWorks/locDetlQuery.html
@@ -47,7 +47,7 @@
    <div id="search-box" class="layui-form layui-card-header">
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="loc_no" placeholder="货位" autocomplete="off">
                <input class="layui-input" type="text" name="loc_no" placeholder="货位/别名" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
@@ -100,7 +100,8 @@
    function getCol() {
        var cols = [
            {type: 'checkbox'}
            ,{field: 'locNo', align: 'center',title: '货位'}
            ,{field: 'locNo', align: 'center',title: '货位', hide: true}
            ,{field: 'locNo$', align: 'center',title: '货位'}
        ];
        cols.push.apply(cols, detlCols);
        cols.push({field: 'updateBy$', align: 'center',title: '修改人员', hide: true}
src/main/webapp/views/locDetl/locDetl.html
@@ -24,7 +24,7 @@
<div id="search-box" class="layui-form layui-card-header">
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off">
            <input class="layui-input" type="text" name="loc_no" placeholder="库位号/别名" autocomplete="off">
        </div>
    </div>
    <div class="layui-inline">
src/main/webapp/views/locMast/locMast.html
@@ -26,7 +26,17 @@
<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">
            <input class="layui-input" type="text" name="loc_no" placeholder="库位号/别名" autocomplete="off">
        </div>
    </div>
    <div class="layui-inline">
        <div class="layui-input-inline">
            <select name="area_id" class="layui-input" type="text" autocomplete="off">
                <option value="">库区</option>
                <option value="1">A区</option>
                <option value="2">B区</option>
                <option value="3">C区</option>
            </select>
        </div>
    </div>
    <div class="layui-inline">
@@ -38,27 +48,6 @@
                <select class="cool-auto-complete-window-select" data-key="basLocStsQueryBylocStsSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">
                </select>
            </div>
        </div>
    </div>
    <div class="layui-inline">
        <div class="layui-input-inline cool-auto-complete">
            <input id="whsType" name="whs_type" class="layui-input" type="text"  style="display: none">
            <input id="whsType$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="库位类型" onfocus=this.blur()>
            <div class="cool-auto-complete-window">
                <input class="cool-auto-complete-window-input" data-key="basWhsQueryBywhsType" onkeyup="autoLoad2(this.getAttribute('data-key'))">
                <select class="cool-auto-complete-window-select" data-key="basWhsQueryBywhsTypeSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">
                </select>
            </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">
                <!--                    <option style="display: none"></option>-->
                <option value="">库位类型</option>
                <option value="1">低库位</option>
                <option value="2">高库位</option>
            </select>
        </div>
    </div>
    <div class="layui-inline">
@@ -81,14 +70,6 @@
<!--            <input class="layui-input" type="text" name="lev1" placeholder="层" autocomplete="off">-->
<!--        </div>-->
<!--    </div>-->
    <div class="layui-input-inline">
        <select name="frozen" class="layui-input" type="text" autocomplete="off">
            <!--                    <option style="display: none"></option>-->
            <option value="">冻结否</option>
            <option value="0">未冻结</option>
            <option value="1">已冻结</option>
        </select>
    </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>
@@ -104,6 +85,7 @@
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button>
        <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">删除</button>
        <button class="layui-btn layui-btn-sm" id="btn-batch-area" lay-event="batchArea">批量修改库区</button>
        <button class="layui-btn layui-btn-primary" id="btn-init" lay-event="init">初始化</button>
<!--        <button class="layui-btn layui-btn-sm" id="btn-convertSize" lay-event="convertSize">大小库位转换</button>-->
        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button>
@@ -261,6 +243,26 @@
        </div>
    </div>
</div>
<!-- 批量修改库区弹窗 -->
<div id="batchAreaDiv" style="margin: 20px 0 10px 30px; display: none">
    <div class="layui-form layui-form-pane">
        <div class="layui-form-item">
            <label class="layui-form-label">库区</label>
            <div class="layui-input-inline">
                <select id="batchAreaId" name="areaId" lay-verify="required">
                    <option value="">请选择</option>
                    <option value="1">A区</option>
                    <option value="2">B区</option>
                    <option value="3">C区</option>
                </select>
            </div>
        </div>
        <div style="text-align: center; margin-top: 20px">
            <button class="layui-btn layui-btn-radius layui-btn-normal" id="batchAreaDo" lay-submit lay-filter="batchAreaDo">确定</button>
        </div>
    </div>
</div>
</body>
</html>
src/main/webapp/views/locMast/locMast_detail.html
@@ -29,24 +29,30 @@
                <input id="locNo" class="layui-input" type="text" onkeyup="check(this.id, 'locMast')">
            </div>
        </div>
        <div class="layui-inline"  style="width:80%;">
            <label class="layui-form-label">库  区:</label>
            <div class="layui-input-inline">
                <select id="areaId" name="areaId" disabled="disabled">
                    <option style="display: none"></option>
                    <option value="1">A区</option>
                    <option value="2">B区</option>
                    <option value="3">C区</option>
                </select>
            </div>
        </div>
        <div class="layui-inline"  style="width:80%;">
            <label class="layui-form-label">库位别名:</label>
            <div class="layui-input-inline">
                <input id="locAlias" class="layui-input" type="text" autocomplete="off" disabled="disabled">
            </div>
        </div>
        <div class="layui-inline"  style="width:31%;display: none">
            <label class="layui-form-label"><span class="not-null">*</span>:</label>
            <div class="layui-input-inline">
                <input id="locType" class="layui-input" type="text" >
            </div>
        </div>
        <div class="layui-inline"  style="width:80%">
            <label class="layui-form-label"><span class="not-null">*</span>库位类型:</label>
            <div class="layui-input-inline cool-auto-complete">
                <input id="whsType" class="layui-input" type="text" style="display: none">
                <input id="whsType$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" onfocus=this.blur() disabled="disabled">
                <div class="cool-auto-complete-window">
                    <input class="cool-auto-complete-window-input" data-key="basWhsQueryBywhsType" onkeyup="autoLoad(this.getAttribute('data-key'))">
                    <select class="cool-auto-complete-window-select" data-key="basWhsQueryBywhsTypeSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">
                    </select>
                </div>
            </div>
        </div>
        <input id="whsType" type="hidden">
        <div class="layui-inline"  style="width:31%;display: none">
            <label class="layui-form-label">:</label>
            <div class="layui-input-inline">
@@ -77,23 +83,8 @@
                <input id="sheetNo" class="layui-input" type="text">
            </div>
        </div>
        <!-- 冻结 -->
        <div class="layui-inline"  style="width:80%;">
            <label class="layui-form-label">冻结</label>
            <div class="layui-input-inline">
                <select id="frozen" name="frozen">
                    <option style="display: none"></option>
                    <option value="0">未冻结</option>
                    <option value="1">已冻结</option>
                </select>
            </div>
        </div>
        <div class="layui-inline"  style="width:80%;">
            <label class="layui-form-label">冻结原因:</label>
            <div class="layui-input-inline">
                <input id="frozenMemo" class="layui-input" type="text" autocomplete="off">
            </div>
        </div>
        <input id="frozen" type="hidden">
        <input id="frozenMemo" type="hidden">
        <div class="layui-inline"  style="width:80%;">
            <label class="layui-form-label">堆垛机号:</label>
            <div class="layui-input-inline">
@@ -124,12 +115,7 @@
                <input id="gro1" class="layui-input" type="text" autocomplete="off" disabled="disabled">
            </div>
        </div>
        <div class="layui-inline"  style="width:80%;display: none">
            <label class="layui-form-label">满  板:</label>
            <div class="layui-input-inline" style="text-align: left">
                <input id="fullPlt" class="layui-input" type="checkBox" lay-skin="primary" lay-filter='detailCheckbox'>
            </div>
        </div>
        <input id="fullPlt" type="hidden">
        <div class="layui-inline"  style="width:31%;display: none">
            <label class="layui-form-label">:</label>
            <div class="layui-input-inline">
src/main/webapp/views/pakStore/locDetlCheckQuery.html
@@ -151,7 +151,8 @@
    function getCol() {
        let cols = [
            {type: 'checkbox', merge: ['locNo']}
            ,{field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'}
            ,{field: 'locNo', align: 'center',title: '库位号', hide: true}
            ,{field: 'locNo$', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'}
        ];
        cols.push.apply(cols, detlCols);
        cols.push({field: 'modiUser$', align: 'center',title: '修改人员', hide: true}
src/main/webapp/views/pakStore/locDetlQuery.html
@@ -59,7 +59,7 @@
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off">
                <input class="layui-input" type="text" name="loc_no" placeholder="库位号/别名" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
@@ -129,8 +129,8 @@
    function getCol() {
        var cols = [
            {type: 'checkbox', merge: ['locNo']}
            ,{field: 'locNo', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'}
            // ,{field: 'locNo$', align: 'center',title: '库位号'}
            ,{field: 'locNo', align: 'center',title: '库位号', hide: true}
            ,{field: 'locNo$', align: 'center',title: '库位号', merge: true, style: 'font-weight: bold'}
        ];
        cols.push.apply(cols, detlCols);
        cols.push({field: 'modiUser$', align: 'center',title: '修改人员', hide: true}
src/main/webapp/views/stoMan/stoQue.html
@@ -29,7 +29,7 @@
<div id="search-box" class="layui-form layui-card-header">
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off">
            <input class="layui-input" type="text" name="loc_no" placeholder="库位号/别名" autocomplete="off">
        </div>
    </div>
    <div class="layui-inline">
@@ -44,23 +44,12 @@
        </div>
    </div>
    <div class="layui-inline">
        <div class="layui-input-inline cool-auto-complete">
            <input id="whsType" name="whs_type" class="layui-input" type="text"  style="display: none">
            <input id="whsType$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="库位类型" onfocus=this.blur()>
            <div class="cool-auto-complete-window">
                <input class="cool-auto-complete-window-input" data-key="basWhsQueryBywhsType" onkeyup="autoLoad2(this.getAttribute('data-key'))">
                <select class="cool-auto-complete-window-select" data-key="basWhsQueryBywhsTypeSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">
                </select>
            </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">
                <!--                    <option style="display: none"></option>-->
                <option value=""></option>
                <option value="1">小库位</option>
                <option value="2">大库位</option>
            <select name="area_id" class="layui-input" type="text" autocomplete="off">
                <option value="">库区</option>
                <option value="1">A区</option>
                <option value="2">B区</option>
                <option value="3">C区</option>
            </select>
        </div>
    </div>
@@ -80,14 +69,6 @@
<!--            <input class="layui-input layui-laydate-range" name="modi_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px">-->
<!--        </div>-->
<!--    </div>-->
    <div class="layui-input-inline">
        <select name="frozen" class="layui-input" type="text" autocomplete="off">
            <!--                    <option style="display: none"></option>-->
            <option value="">冻结否</option>
            <option value="0">未冻结</option>
            <option value="1">已冻结</option>
        </select>
    </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>
@@ -104,6 +85,7 @@
<table class="layui-hide" id="stoQue" lay-filter="stoQue"></table>
<script type="text/html" id="operate">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="viewPhoto">查看照片</a>
    <a class="layui-btn layui-btn-xs loc-detl" lay-event="locDetl">查看明细</a>
</script>
src/main/webapp/views/wrkMast/wrkMast.html
@@ -73,6 +73,16 @@
            <input class="layui-input" type="text" name="crn_no" placeholder="堆垛机号" autocomplete="off">
        </div>
    </div>
    <div class="layui-inline">
        <div class="layui-input-inline">
            <select name="area_id" class="layui-input" type="text" autocomplete="off">
                <option value="">库区</option>
                <option value="1">A区</option>
                <option value="2">B区</option>
                <option value="3">C区</option>
            </select>
        </div>
    </div>
    <!-- 日期范围 -->
    <div class="layui-inline" style="width: 300px">
        <div class="layui-input-inline">
src/main/webapp/views/wrkMast/wrkMast_detail.html
@@ -58,6 +58,17 @@
            </div>
        </div>
        <div class="layui-inline"  style="width:31%;">
            <label class="layui-form-label">库  区:</label>
            <div class="layui-input-inline">
                <select id="areaId" name="areaId" disabled="disabled">
                    <option style="display: none"></option>
                    <option value="1">A区</option>
                    <option value="2">B区</option>
                    <option value="3">C区</option>
                </select>
            </div>
        </div>
        <div class="layui-inline"  style="width:31%;">
            <label class="layui-form-label">优 先 级:</label>
            <div class="layui-input-inline">
                <input id="ioPri" class="layui-input" type="text">
src/test/java/com/zy/asrs/utils/LocAliasUtilsTest.java
New file
@@ -0,0 +1,46 @@
package com.zy.asrs.utils;
import com.zy.asrs.entity.LocMast;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
class LocAliasUtilsTest {
    @Test
    void areaIdByCrnNo_shouldUseConfiguredBoundaries() {
        assertEquals(Integer.valueOf(1), LocAliasUtils.areaIdByCrnNo(1));
        assertEquals(Integer.valueOf(1), LocAliasUtils.areaIdByCrnNo(6));
        assertEquals(Integer.valueOf(2), LocAliasUtils.areaIdByCrnNo(7));
        assertEquals(Integer.valueOf(2), LocAliasUtils.areaIdByCrnNo(18));
        assertEquals(Integer.valueOf(3), LocAliasUtils.areaIdByCrnNo(19));
        assertEquals(Integer.valueOf(3), LocAliasUtils.areaIdByCrnNo(28));
        assertNull(LocAliasUtils.areaIdByCrnNo(29));
    }
    @Test
    void buildAlias_shouldReindexRowsByAreaMinimumRow() {
        assertEquals("A-0100201", LocAliasUtils.buildAlias(1, 1, 2, 1, 1));
        assertEquals("B-0100201", LocAliasUtils.buildAlias(2, 13, 2, 1, 13));
        assertEquals("C-0301204", LocAliasUtils.buildAlias(3, 21, 12, 4, 19));
    }
    @Test
    void buildAlias_shouldReturnNullWhenRuleCannotApply() {
        assertNull(LocAliasUtils.buildAlias(null, 1, 2, 1, 1));
        assertNull(LocAliasUtils.buildAlias(4, 1, 2, 1, 1));
        assertNull(LocAliasUtils.buildAlias(1, null, 2, 1, 1));
        assertNull(LocAliasUtils.buildAlias(1, 1, 2, 1, null));
    }
    @Test
    void displayLocNo_shouldPreferAliasAndFallbackToOriginalLocNo() {
        LocMast locMast = new LocMast();
        locMast.setLocNo("0100201");
        assertEquals("0100201", LocAliasUtils.displayLocNo(locMast));
        locMast.setLocAlias("A-0100201");
        assertEquals("A-0100201", LocAliasUtils.displayLocNo(locMast));
    }
}