| | |
| | | public interface LocMastMapper extends BaseMapper<LocMast> { |
| | | |
| | | List<LocMast> queryFreeLocMast(@Param("rows") List<Integer> rows, @Param("rowsLen") Integer rowsLen, @Param("locType1") Short locType1); |
| | | List<LocMast> queryFreeLocMast2(@Param("rows") List<Integer> rows, @Param("rowsLen") Integer rowsLen, @Param("locType1") Short locType1, @Param("inout_everyday") Boolean inoutEveryday); |
| | | |
| | | @Select("select loc_no from asr_loc_mast where 1=1 and loc_sts = 'O' and crn_no = #{crnNo}") |
| | | List<String> queryGroupEmptyStock(Integer crnNo); |
| | |
| | | * 检索可用库位 |
| | | */ |
| | | List<LocMast> queryFreeLocMast(List<Integer> rows, Integer rowsLen, Short locType1); |
| | | List<LocMast> queryFreeLocMast2(List<Integer> rows, Integer rowsLen, Short locType1,Boolean inoutEveryday); |
| | | |
| | | /** |
| | | * 获取同组货架的空库位 |
| | |
| | | public List<LocMast> queryFreeLocMast(List<Integer> rows, Integer rowsLen, Short locType1) { |
| | | return this.baseMapper.queryFreeLocMast(rows, rowsLen, locType1); |
| | | } |
| | | @Override |
| | | public List<LocMast> queryFreeLocMast2(List<Integer> rows, Integer rowsLen, Short locType1,Boolean inoutEveryday) { |
| | | return this.baseMapper.queryFreeLocMast2(rows, rowsLen, locType1,inoutEveryday); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> queryGroupEmptyStock(String sourceLocNo) { |
| | |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | /** |
| | | * 生成工作号 |
| | |
| | | if (locMast == null) { |
| | | List<Integer> rows = Utils.getGroupLoc(curRow); |
| | | |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMast(rows, rows.size(), locTypeDto.getLocType1()); |
| | | Mat mat = matService.selectByMatnr(matNos.get(0)); |
| | | List<LocMast> locMasts = locMastService.queryFreeLocMast2(rows, rows.size(), locTypeDto.getLocType1(),mat.getInoutEveryday()); |
| | | if (!Cools.isEmpty(locMasts)) { |
| | | Integer innermostRow = Utils.getInnermostRow(locMasts.get(0).getLocNo()); |
| | | for (LocMast one : locMasts) { |
| | |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | # url: jdbc:sqlserver://10.10.10.100:1433;databasename=bfasrs |
| | | url: jdbc:sqlserver://localhost:1433;databasename=bfasrs |
| | | # url: jdbc:sqlserver://192.168.4.15:1433;databasename=bfasrs |
| | | # url: jdbc:sqlserver://localhost:1433;databasename=bfasrs |
| | | url: jdbc:sqlserver://192.168.4.15:1433;databasename=bfasrs |
| | | username: sa |
| | | # password: Zoneyung@zy56$ |
| | | password: sa@123 |
| | |
| | | ) |
| | | </select> |
| | | |
| | | <select id="queryFreeLocMast2" resultMap="BaseResultMap"> |
| | | select |
| | | * |
| | | from asr_loc_mast |
| | | where 1=1 |
| | | <if test="inoutEveryday == 2.0"> |
| | | and bay1 >= 10 |
| | | </if> |
| | | <if test="inoutEveryday != 2.0"> |
| | | and bay1 < 10 |
| | | </if> |
| | | and row1 in |
| | | <foreach item="item" collection="rows" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | and ctn_no = |
| | | ( |
| | | select |
| | | top 1 |
| | | ctn_no |
| | | from ( |
| | | select |
| | | ctn_no, |
| | | count(1) as count |
| | | from asr_loc_mast |
| | | where 1=1 |
| | | and row1 in |
| | | <foreach item="item" collection="rows" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | and loc_sts = 'O' |
| | | <if test="locType1 != null"> |
| | | and loc_type1 = #{locType1} |
| | | </if> |
| | | and loc_no not in ('0100101', '0200101', '0300101', '1200701', '1300701', '1400701', '1900401', '2000401', '2100401') |
| | | group by ctn_no |
| | | ) a |
| | | where count = #{rowsLen} |
| | | order by right(ctn_no, 2) + 0 asc, left(ctn_no, 3) + 0 asc |
| | | ) |
| | | </select> |
| | | |
| | | </mapper> |