| | |
| | | @Repository |
| | | public interface LocMastMapper extends BaseMapper<LocMast> { |
| | | |
| | | @Select("select distinct row1 from asr_loc_mast where crn_no = #{crnNo}") |
| | | List<Integer> queryDistinctRow(@Param("crnNo")Integer crnNo); |
| | | |
| | | LocMast queryFreeLocMast(@Param("row") Integer row, @Param("locType1") Short locType1, @Param("locType2") Short locType2, @Param("locType3") Short locType3); |
| | | |
| | | @Select("select loc_no from asr_loc_mast where 1=1 and loc_sts = 'O' and crn_no = #{crnNo}") |
| | |
| | | |
| | | public interface LocMastService extends IService<LocMast> { |
| | | |
| | | List<Integer> queryDistinctRow(Integer crnNo); |
| | | |
| | | /** |
| | | * 检索可用库位 |
| | | */ |
| | |
| | | |
| | | public interface WrkMastService extends IService<WrkMast> { |
| | | |
| | | WrkMast selectByLocNo(String sourceLocNo); |
| | | |
| | | int getWorkingMast(Integer devpNo); |
| | | |
| | | List<WrkMast> selectToBeCompleteData(); |
| | |
| | | private RowLastnoService rowLastnoService; |
| | | |
| | | @Override |
| | | public List<Integer> queryDistinctRow(Integer crnNo) { |
| | | return this.baseMapper.queryDistinctRow(crnNo); |
| | | } |
| | | |
| | | @Override |
| | | public LocMast queryFreeLocMast(Integer row, Short locType1, Short locType2, Short locType3) { |
| | | return this.baseMapper.queryFreeLocMast(row, locType1, locType2, locType3); |
| | | } |
| | |
| | | import com.zy.ints.service.IoCompleteService; |
| | | import com.zy.ints.service.WaitMatchkLogService; |
| | | import com.zy.ints.service.WaitMatchkService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | /** |
| | | * Created by vincent on 2020/6/11 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class WorkServiceImpl implements WorkService { |
| | | static int i =1; |
| | |
| | | LocMast loc = null; |
| | | for (Integer row : rows) { |
| | | if (Utils.isDeepLoc(slaveProperties, row)) { |
| | | loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType1()); |
| | | loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType1(),shallowLoc.getLocType2(),shallowLoc.getLocType3()); |
| | | if (null != loc) { break; } |
| | | } |
| | | } |
| | | if (null == loc) { |
| | | for (Integer row : rows) { |
| | | if (Utils.isShallowLoc(slaveProperties, row)) { |
| | | loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType1()); |
| | | loc = locMastService.queryFreeLocMast(row, shallowLoc.getLocType1(),shallowLoc.getLocType2(),shallowLoc.getLocType3()); |
| | | if (null != loc) { break; } |
| | | } |
| | | } |
| | |
| | | public class WrkMastServiceImpl extends ServiceImpl<WrkMastMapper, WrkMast> implements WrkMastService { |
| | | |
| | | @Override |
| | | public WrkMast selectByLocNo(String sourceLocNo) { |
| | | return this.baseMapper.selectByLocNo(sourceLocNo); |
| | | } |
| | | |
| | | @Override |
| | | public int getWorkingMast(Integer devpNo) { |
| | | return selectCount(new EntityWrapper<WrkMast>().eq("source_sta_no", devpNo).in("wrk_sts", 1, 6)); |
| | | } |
| | |
| | | <if test="locType1 != null"> |
| | | and loc_type1 = #{locType1} |
| | | </if> |
| | | <if test="locType2 != null"> |
| | | and loc_type2 = #{locType2} |
| | | </if> |
| | | <if test="locType3 != null"> |
| | | and loc_type3 = #{locType3} |
| | | </if> |
| | | <!-- <if test="locType2 != null">--> |
| | | <!-- and loc_type2 = #{locType2}--> |
| | | <!-- </if>--> |
| | | <!-- <if test="locType3 != null">--> |
| | | <!-- and loc_type3 = #{locType3}--> |
| | | <!-- </if>--> |
| | | order by loc_sts desc ,lev1 asc,bay1 asc |
| | | </select> |
| | | </mapper> |