自动化立体仓库 - WMS系统
#
LSH
2023-02-11 e6fc4345bb82c01a190c16093a175b87573525b7
#
6个文件已修改
67 ■■■■ 已修改文件
src/main/java/com/zy/asrs/mapper/LocMastMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/LocMastService.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/service/CommonService.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/LocMastMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/LocMastMapper.java
@@ -17,7 +17,9 @@
    LocMast queryFreeLocMast1(@Param("row") Integer row, @Param("locType1") Short locType1 ,@Param("channelMax") int channelMax);
    LocMast queryFreeLocMast2(@Param("row") Integer row, @Param("locType1") Short locType1);
    LocMast queryFreeLocMast2(@Param("row") Integer row, @Param("locType1") Short locType1, @Param("locType2") Short locType2);
    Integer queryFreeLocMastCount(@Param("row") Integer row, @Param("locType1") Short locType1, @Param("locType2") Short locType2);
    @Select("select loc_no from asr_loc_mast where 1=1 and loc_sts = 'O' and crn_no = #{crnNo}")
    List<String> queryGroupEmptyStock(Integer crnNo);
src/main/java/com/zy/asrs/service/LocMastService.java
@@ -21,7 +21,12 @@
    /**
     * 检索可用库位
     */
    LocMast queryFreeLocMast2(Integer row, Short locType1);
    LocMast queryFreeLocMast2(Integer row, Short locType1, Short locType2);
    /**
     * 检索可用库位
     */
    Integer queryFreeLocMastCount(Integer row, Short locType1, Short locType2);
    /**
     * 获取同组货架的空库位
src/main/java/com/zy/asrs/service/impl/LocMastServiceImpl.java
@@ -29,8 +29,13 @@
    }
    @Override
    public LocMast queryFreeLocMast2(Integer row, Short locType1) {
        return this.baseMapper.queryFreeLocMast2(row, locType1);
    public LocMast queryFreeLocMast2(Integer row, Short locType1, Short locType2) {
        return this.baseMapper.queryFreeLocMast2(row, locType1 ,locType2);
    }
    @Override
        public Integer queryFreeLocMastCount(Integer row, Short locType1, Short locType2) {
        return this.baseMapper.queryFreeLocMastCount(row, locType1 ,locType2);
    }
src/main/java/com/zy/common/service/CommonService.java
@@ -3,16 +3,12 @@
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.core.common.Arith;
import com.core.common.Cools;
import com.core.exception.CoolException;
import com.zy.asrs.entity.*;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.Utils;
import com.zy.asrs.utils.VersionUtils;
import com.zy.common.entity.Parameter;
import com.zy.common.model.LocTypeDto;
import com.zy.common.model.Shelves;
import com.zy.common.model.StartupDto;
import com.zy.common.properties.SlaveProperties;
import lombok.extern.slf4j.Slf4j;
@@ -51,6 +47,8 @@
    private SlaveProperties slaveProperties;
    @Value("${channel.channelMax}")
    private Integer channelMax;
    @Value("${channel.equipmentCount}")
    private Integer equipmentCount;
    /**
     * 生成工作号
@@ -162,10 +160,10 @@
            } else if (ruleId == 1){  //按测试设备排序,优先排满单台设备
                locMast = locMastService.queryFreeLocMast1(curRow, locTypeDto.getLocType1() ,channelMax+1);
            } else if (ruleId == 2){  //按通道排序,均匀分配每台设备
                locMast = locMastService.queryFreeLocMast2(curRow, locTypeDto.getLocType1() );
                Short locType2 = getLocType2Small(curRow, locTypeDto.getLocType1());
                locMast = locMastService.queryFreeLocMast2(curRow, locTypeDto.getLocType1() ,locType2);
            } else { //默认规则
                locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1());
                locMast = locMastService.queryFreeLocMast2(curRow, locTypeDto.getLocType1(),(short)0);
            }
        }
@@ -193,4 +191,18 @@
        return startupDto;
    }
    public Short getLocType2Small(Integer curRow,short locType1){
        Integer OCount = locMastService.queryFreeLocMastCount(curRow, locType1, (short)1);
        Short locType2=1;
        for (int i=2;i<equipmentCount+1;i++){
            Integer integer =locMastService.queryFreeLocMastCount(curRow, locType1, (short)i);
            if (OCount<integer){
                OCount=integer;
                locType2=(short)i;
            }
        }
        return locType2;
    }
}
src/main/resources/application.yml
@@ -56,6 +56,8 @@
channel:
  # 最大通道数
  channelMax: 48
  # 充放电测试柜数量
  equipmentCount: 6
# MES系统
mes:
src/main/resources/mapper/LocMastMapper.xml
@@ -70,13 +70,30 @@
        from asr_loc_mast
        where row1=#{row}
        and loc_sts='O'
        and bay1=#{bay}
        <if test="locType2 != null and locType != 0">
            and loc_type2 = #{locType2}
        </if>
        <if test="locType2 != null and locType == 0">
            and loc_type2 != null
            and loc_type2 != #{locType2}
        </if>
        <if test="locType1 != null">
            and loc_type1 = #{locType1}
        </if>
        order by lev1 asc,bay1 asc
    </select>
    <select id="queryFreeLocMastCount" resultMap="BaseResultMap">
        select count(1)
        from asr_loc_mast
        where row1=#{row}
        and loc_sts='O'
        and loc_type2 = #{locType2}
        <if test="locType1 != null">
            and loc_type1 = #{locType1}
        </if>
    </select>
    <select id="queryShallowLocFMast" resultMap="BaseResultMap">
        select * from asr_loc_mast
        where 1=1