zy-asrs-common/src/main/java/com/zy/asrs/common/wms/mapper/BasDevpMapper.java
@@ -12,8 +12,8 @@ @Repository public interface BasDevpMapper extends BaseMapper<BasDevp> { List<Integer> getAvailableInSite(@Param("typeNo") Integer typeNo); List<Integer> getAvailableInSite(@Param("typeNo") Integer typeNo, @Param("hostId") Long hostId); List<Integer> getAvailableOutSite(@Param("typeNo") Integer typeNo); List<Integer> getAvailableOutSite(@Param("typeNo") Integer typeNo, @Param("hostId") Long hostId); } zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/BasDevpService.java
@@ -11,18 +11,19 @@ * 入库站 * @return */ List<Integer> getAvailableInSite(); List<Integer> getAvailableInSite(Long hostId); /** * 空板入库站 * @return */ List<Integer> getAvailableEmptyInSite(); List<Integer> getAvailableEmptyInSite(Long hostId); /** * 出库站 * * @return */ List<Integer> getAvailableOutSite(Integer typeNo); List<Integer> getAvailableOutSite(Integer typeNo, Long hostId); } zy-asrs-common/src/main/java/com/zy/asrs/common/wms/service/impl/BasDevpServiceImpl.java
@@ -12,18 +12,18 @@ public class BasDevpServiceImpl extends ServiceImpl<BasDevpMapper, BasDevp> implements BasDevpService { @Override public List<Integer> getAvailableInSite() { return this.baseMapper.getAvailableInSite(1); public List<Integer> getAvailableInSite(Long hostId) { return this.baseMapper.getAvailableInSite(1, hostId); } @Override public List<Integer> getAvailableEmptyInSite() { return this.baseMapper.getAvailableInSite(10); public List<Integer> getAvailableEmptyInSite(Long hostId) { return this.baseMapper.getAvailableInSite(10, hostId); } @Override public List<Integer> getAvailableOutSite(Integer typeNo) { return this.baseMapper.getAvailableOutSite(typeNo); public List<Integer> getAvailableOutSite(Integer typeNo, Long hostId) { return this.baseMapper.getAvailableOutSite(typeNo, hostId); } } zy-asrs-common/src/main/resources/mapper/wms/BasDevpMapper.xml
@@ -4,24 +4,26 @@ <select id="getAvailableInSite" resultType="java.lang.Integer"> select abd.dev_no from asr_bas_devp abd left join asr_sta_desc asd on abd.dev_no = asd.stn_no wbd.dev_no from wms_bas_devp wbd left join asr_sta_desc asd on wbd.dev_no = asd.stn_no where 1=1 and asd.type_no = #{typeNo} -- and abd.in_enable = 'Y' group by abd.dev_no and wbd.host_id = #{hostId} -- and wbd.in_enable = 'Y' group by wbd.dev_no </select> <select id="getAvailableOutSite" resultType="java.lang.Integer"> select abd.dev_no from asr_bas_devp abd left join asr_sta_desc asd on abd.dev_no = asd.stn_no wbd.dev_no from wms_bas_devp wbd left join asr_sta_desc asd on wbd.dev_no = asd.stn_no where 1=1 and asd.type_no = #{typeNo} -- and abd.out_enable = 'Y' group by abd.dev_no and wbd.host_id = #{hostId} -- wbd abd.out_enable = 'Y' group by wbd.dev_no </select> </mapper> zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/WorkController.java
@@ -32,27 +32,28 @@ @RequestMapping("/available/put/site") @ManagerAuth() public R availablePutSite(){ return R.ok().add(basDevpService.getAvailableInSite()); return R.ok().add(basDevpService.getAvailableInSite(getHostId())); } @RequestMapping("/available/empty/put/site") @ManagerAuth() public R availableEmptyPutSite(){ return R.ok().add(basDevpService.getAvailableEmptyInSite()); return R.ok().add(basDevpService.getAvailableEmptyInSite(getHostId())); } @RequestMapping("/available/take/site") @ManagerAuth() public R availableTakeSite(){ Long hostId = getHostId(); List<Map<String, Object>> result = new ArrayList<>(); List<Integer> outSite = basDevpService.getAvailableOutSite(101); List<Integer> outSite = basDevpService.getAvailableOutSite(101, hostId); for (Integer siteId : outSite) { Map<String, Object> map = new HashMap<>(); map.put("siteId", siteId); map.put("desc", siteId + "(全板出库口)"); result.add(map); } List<Integer> pickOutSite = basDevpService.getAvailableOutSite(103); List<Integer> pickOutSite = basDevpService.getAvailableOutSite(103, hostId); for (Integer siteId : pickOutSite) { Map<String, Object> map = new HashMap<>(); map.put("siteId", siteId); @@ -65,7 +66,7 @@ @RequestMapping("/available/take/check/site") @ManagerAuth() public R availableTakeCheckSite(){ return R.ok().add(basDevpService.getAvailableOutSite(107)); return R.ok().add(basDevpService.getAvailableOutSite(107, getHostId())); } }