自动化立体仓库 - WMS系统
#
lsh
2024-06-12 04b201c0e52a0971584f68504864b2ac527d03fd
#
4个文件已修改
119 ■■■■ 已修改文件
src/main/java/com/zy/asrs/entity/RowLastno.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/Utils.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/service/CommonService.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/RowLastnoMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/RowLastno.java
@@ -142,6 +142,34 @@
    @TableField("sta_no_list")
    private String staNoList;
    /**
     * 库类型ID
     */
    @ApiModelProperty(value= "库类型ID")
    @TableField("type_id")
    private Integer typeId;
    /**
     * 相似物料开关
     */
    @ApiModelProperty(value= "相似物料开关")
    @TableField("be_similar")
    private String beSimilar;
    /**
     * 是否存在点位
     */
    @ApiModelProperty(value= "是否存在点位")
    @TableField("point_switch")
    private String pointSwitch;
    /**
     * 空板靠近摆放
     */
    @ApiModelProperty(value= "空板靠近摆放")
    @TableField("empty_similar")
    private String emptySimilar;
    public RowLastno() {}
    public RowLastno(String wrkMk,Integer currentRow,Integer sRow,Integer eRow,Integer crnQty,String memo,Long modiUser,Date modiTime,Long appeUser,Date appeTime,Integer limintLoc) {
@@ -347,4 +375,36 @@
        this.staNoList = StaNoList;
    }
    public Integer getTypeId() {
        return typeId;
    }
    public void setTypeId(Integer typeId) {
        this.typeId = typeId;
    }
    public String getBeSimilar() {
        return beSimilar;
    }
    public void setBeSimilar(String beSimilar) {
        this.beSimilar = beSimilar;
    }
    public String getPointSwitch() {
        return pointSwitch;
    }
    public void setPointSwitch(String pointSwitch) {
        this.pointSwitch = pointSwitch;
    }
    public String getEmptySimilar() {
        return emptySimilar;
    }
    public void setEmptySimilar(String emptySimilar) {
        this.emptySimilar = emptySimilar;
    }
}
src/main/java/com/zy/asrs/utils/Utils.java
@@ -240,22 +240,15 @@
        return 0;
    }
    public static boolean BooleanWhsTypeStaIoType(Integer whsType) {  //查询相似物料开关
        if (whsType == 1 || whsType==3 || whsType==4) {
    public static boolean BooleanWhsTypeStaIoType(RowLastno rowLastno) {  //查询相似物料开关
        if (rowLastno.getBeSimilar().equals("Y")) {
            return true;
        }
        return false;
    }
    public static boolean BooleanWhsTypeSta(Integer whsType) {
        if (whsType == 1 || whsType == 2 || whsType == 5 || whsType==3 || whsType==4) {
            return true;
        }
        return false;
    }
    public static boolean BooleanWhsTypeSta(Integer whsType, Integer staDescId) {
        if ((whsType == 1 || whsType == 5 || whsType == 2 || whsType==3 || whsType==4) && staDescId != 11 && staDescId != 111) {
    public static boolean BooleanWhsTypeSta(RowLastno rowLastno, Integer staDescId) {//站点路径更新
        if (rowLastno.getPointSwitch().equals("Y") && staDescId != 11 && staDescId != 111) {
            return true;
        }
        return false;
@@ -281,7 +274,7 @@
    public static int[] LocNecessaryParameters(Integer whsType, Integer curRow, Integer crnNumber) {
        RowLastnoService rowLastnoService = SpringUtils.getBean(RowLastnoService.class);
        RowLastno rowLastno = rowLastnoService.selectById(whsType);
        switch (whsType){
        switch (rowLastno.getTypeId()) {
            case 1://经典双伸库位
                return LocNecessaryParametersDoubleExtension(rowLastno, curRow, crnNumber); //已完善
            case 2://经典单伸库位(2排货架)
@@ -303,7 +296,6 @@
        Integer sRow = rowLastno.getsRow();
        Integer sCrnNo = rowLastno.getsCrnNo();
        if (BooleanWhsTypeSta(rowLastno.getWhsType())) {
            necessaryParameters[0] = crnNumber; // 轮询次数
            //满板正常入库
            if (curRow.equals(crnNumber * 4 + sRow - 1)) {
@@ -331,7 +323,7 @@
                    throw new CoolException("库位排号异常:排号:" + curRow);
                }
            }
        }
        return necessaryParameters;
    }
@@ -356,7 +348,6 @@
        int[] necessaryParameters = new int[]{0, 0, 0, 0};
        Integer sRow = rowLastno.getsRow();
        Integer sCrnNo = rowLastno.getsCrnNo();
        if (BooleanWhsTypeSta(rowLastno.getWhsType())) {
            necessaryParameters[0] = crnNumber; // 轮询次数
            //满板正常入库
            if (curRow.equals(crnNumber * 2 + sRow - 1)) {
@@ -384,7 +375,6 @@
                    throw new CoolException("库位排号异常:排号:" + curRow);
                }
            }
        }
        return necessaryParameters;
    }
@@ -393,7 +383,6 @@
        int[] necessaryParameters = new int[]{0, 0, 0, 0};
        Integer sRow = rowLastno.getsRow();
        Integer sCrnNo = rowLastno.getsCrnNo();
        if (BooleanWhsTypeSta(rowLastno.getWhsType())) {
            necessaryParameters[0] = crnNumber; // 轮询次数
            //满板正常入库
            if (curRow.equals(crnNumber * 3 + sRow - 1)) {
@@ -421,7 +410,7 @@
                    throw new CoolException("库位排号异常:排号:" + curRow);
                }
            }
        }
        return necessaryParameters;
    }
@@ -430,7 +419,6 @@
        int[] necessaryParameters = new int[]{0, 0, 0, 0};
        Integer sRow = rowLastno.getsRow();
        Integer sCrnNo = rowLastno.getsCrnNo();
        if (BooleanWhsTypeSta(rowLastno.getWhsType())) {
            necessaryParameters[0] = crnNumber; // 轮询次数
            //满板正常入库
            if (curRow.equals(crnNumber * 3 + sRow - 1)) {
@@ -458,7 +446,7 @@
                    throw new CoolException("库位排号异常:排号:" + curRow);
                }
            }
        }
        return necessaryParameters;
    }
@@ -467,7 +455,6 @@
        int[] necessaryParameters = new int[]{0, 0, 0, 0};
        Integer sRow = rowLastno.getsRow();
        Integer sCrnNo = rowLastno.getsCrnNo();
        if (BooleanWhsTypeSta(rowLastno.getWhsType())) {
            necessaryParameters[0] = crnNumber; // 轮询次数
            //满板正常入库
            if (curRow.equals(crnNumber * 4 + sRow - 1)) {
@@ -495,7 +482,7 @@
                    throw new CoolException("库位排号异常:排号:" + curRow);
                }
            }
        }
        return necessaryParameters;
    }
src/main/java/com/zy/common/service/CommonService.java
@@ -119,7 +119,12 @@
     */
    @Transactional
    public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, String matnr, String batch, String grade, LocTypeDto locTypeDto) {
        try{
        whsType = Utils.GetWhsType(sourceStaNo);
        }catch (Exception e){
            log.error("站点={} 未查询到对应的规则",sourceStaNo);
            return null;
        }
        return getLocNoRun(whsType,staDescId,sourceStaNo,matnr,batch,grade,0,locTypeDto,0);
    }
@@ -199,7 +204,7 @@
        boolean signRule2 = false;
        if (Utils.BooleanWhsTypeStaIoType(whsType)){
        if (Utils.BooleanWhsTypeStaIoType(rowLastno)){
            // 靠近摆放规则 --- 同天同规格物料 //分离版
            if (!Cools.isEmpty(matnr) &&  staDescId == 1){
                signRule1 = true;
@@ -270,9 +275,9 @@
//        }
        // 靠近摆放规则 --- 空托 //互通版
        if (staDescId == 10  && Utils.BooleanWhsTypeStaIoType(whsType)) {
        if (staDescId == 10  && Utils.BooleanWhsTypeStaIoType(rowLastno)) {
            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").ge("row1", sRow).le("row1", eRow));
            if (locMasts.size() > 0) {
            if (!locMasts.isEmpty()) {
                for (LocMast loc : locMasts) {
                    if (Utils.isShallowLoc(slaveProperties, loc.getLocNo())) {
                        continue;
@@ -297,7 +302,7 @@
        StaDesc staDesc = null;
        BasDevp staNo = null;
        if (Utils.BooleanWhsTypeSta(whsType, staDescId)) {
        if (Utils.BooleanWhsTypeSta(rowLastno, staDescId)) {
            // 获取目标站
            wrapper = new EntityWrapper<StaDesc>()
                    .eq("type_no", staDescId)
@@ -317,12 +322,11 @@
                }
                startupDto.setStaNo(staNo.getDevNo());
            }
        }
        // 更新库位排号
        if (Utils.BooleanWhsTypeSta(whsType, staDescId) && Cools.isEmpty(locMast)) {
            if (Cools.isEmpty(locMast)){
            rowLastno.setCurrentRow(curRow);
            rowLastnoService.updateById(rowLastno);
            }
        }
        // 开始查找库位 ==============================>>
@@ -337,7 +341,7 @@
                if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) {
                    continue;
                }
                if (Utils.BooleanWhsTypeStaIoType(whsType)){
                if (Utils.BooleanWhsTypeStaIoType(rowLastno)){
                    String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo());
                    LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
                            .eq("loc_no", shallowLoc).eq("loc_sts", "O"));
@@ -353,12 +357,12 @@
                }
            }
            if (Cools.isEmpty(locMast) && Utils.BooleanWhsTypeStaIoType(whsType)){
            if (Cools.isEmpty(locMast) && Utils.BooleanWhsTypeStaIoType(rowLastno)){
                for (LocMast locMast1 : locMasts) {
                    if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) {
                        continue;
                    }
                    if (Utils.BooleanWhsTypeStaIoType(whsType)){
                    if (Utils.BooleanWhsTypeStaIoType(rowLastno)){
                        String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo());
                        LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
                                .eq("loc_no", shallowLoc).eq("loc_sts", "O"));
src/main/resources/mapper/RowLastnoMapper.xml
@@ -22,6 +22,10 @@
        <result column="sign_type_other" property="signTypeOther" />
        <result column="sign_type_other_boolean" property="signTypeOtherBoolean" />
        <result column="sta_no_list" property="staNoList" />
        <result column="type_id" property="typeId" />
        <result column="be_similar" property="beSimilar" />
        <result column="point_switch" property="pointSwitch" />
        <result column="empty_similar" property="emptySimilar" />
    </resultMap>