自动化立体仓库 - WMS系统
#
luxiaotao1123
2022-10-19 8cac5d40279933c61ce2ab120aef9d6302ae08e2
#
2个文件已修改
89 ■■■■■ 已修改文件
src/main/java/com/zy/common/service/CommonService.java 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocDetlMapper.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/service/CommonService.java
@@ -111,21 +111,20 @@
     */
    public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, LocTypeDto locTypeDto, LocTypeDto oldLocType, int times) {
        StartupDto startupDto = new StartupDto();
        int start;
        int end;
        int start = 2;
        int end = 30;
        switch (sourceStaNo) {
            case 103:
                whsType = 1;
                start = 1;
                end = 14;
                break;
            case 203:
            case 107:
                whsType = 2;
                start = 8;
                end = 21;
                end = 17;
                break;
            case 118:
                whsType = 3;
                start = 18;
                break;
            default:
                throw new CoolException("检索库位失败,请联系管理员");
                whsType = 1;
                break;
        }
        // 生成工作号
        int workNo = getWorkNo(0);
@@ -187,55 +186,16 @@
        }
        // 如果没有相近物料,则按规则轮询货架
        int currentRow = 1;
        if (null == locMast) {
            Shelves shelves = new Shelves(rowCount, crn_qty);
            for (int i = 0; i < shelves.group; i ++) {
                if (i > 0) {
                    curRow = currentRow;
                }
                curRow = shelves.start(curRow);
                if (curRow < 0) {
                    throw new CoolException("检索库位失败,请联系管理员");
                }
                currentRow = curRow;
                int crnNo1 = shelves.get(curRow);
                if (whsType == 1) {
                    switch (curRow) {
                        case 1:
                            curRow = 1;
                            break;
                        case 2:
                            curRow = 7;
                            break;
                        case 3:
                            curRow = 8;
                            break;
                        case 4:
                            curRow = 14;
                            break;
                        default:
                            throw new CoolException("检索库位失败,请联系管理员");
                    }
                } else {
                    switch (curRow) {
                        case 1:
                            curRow = 8;
                            break;
                        case 2:
                            curRow = 14;
                            break;
                        case 3:
                            curRow = 15;
                            break;
                        case 4:
                            curRow = 21;
                            break;
                        default:
                            throw new CoolException("检索库位失败,请联系管理员");
                    }
                    crnNo1 = crnNo1 + 1;
                Integer crnNo1 = shelves.get(curRow) + 1;
                if (whsType != 1) {
                    crnNo1 = whsType;
                }
                if (basCrnpService.checkSiteError(crnNo1, true)) {
                    crnNo = crnNo1;
@@ -265,7 +225,7 @@
        }
        // 更新库位排号
        rowLastno.setCurrentRow(currentRow);
        rowLastno.setCurrentRow(curRow);
        rowLastnoService.updateById(rowLastno);
        // 开始查找库位 ==============================>>
src/main/resources/mapper/LocDetlMapper.xml
@@ -277,5 +277,26 @@
            batch LIKE '%[a-z]%'
    </select>
    <select id="selectSameDetl" resultType="java.lang.String">
        SELECT
        ld.loc_no
        FROM asr_loc_detl ld
        LEFT JOIN asr_loc_mast lm ON ld.loc_no = lm.loc_no
        LEFT JOIN (
            select
            loc_no,
            count(1) as count
            from asr_loc_detl
            where 1=1
            group by loc_no
        ) dual on dual.loc_no = lm.loc_no
        WHERE 1 = 1
        AND ld.matnr = #{matnr}
        AND (lm.row1 >= #{start} AND lm.row1 &lt;= #{end})
        AND (lm.loc_sts = 'F')
        AND dual.count = 1
        ORDER BY lm.modi_time ASC
    </select>
</mapper>