Merge branch 'bfasrs' of http://47.97.1.152:5880/r/zy-asrs into bfasrs
|  |  |  | 
|---|
|  |  |  | public R query(String condition) { | 
|---|
|  |  |  | EntityWrapper<DocType> wrapper = new EntityWrapper<>(); | 
|---|
|  |  |  | wrapper.like("doc_name", condition); | 
|---|
|  |  |  | Page<DocType> page = docTypeService.selectPage(new Page<>(0, 10), wrapper); | 
|---|
|  |  |  | Page<DocType> page = docTypeService.selectPage(new Page<>(0, 100), wrapper); | 
|---|
|  |  |  | List<Map<String, Object>> result = new ArrayList<>(); | 
|---|
|  |  |  | for (DocType docType : page.getRecords()){ | 
|---|
|  |  |  | Map<String, Object> map = new HashMap<>(); | 
|---|
|  |  |  | 
|---|
|  |  |  | List<LocMast> queryFreeLocMastEnd(@Param("row") Integer row, @Param("locType1") Short locType1); | 
|---|
|  |  |  | List<LocMast> queryFreeLocMastEnd0(@Param("bay") Integer bay,@Param("lev") Integer lev,@Param("row1") Integer row, @Param("locType1") Short locType1); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<LocMast> queryFreeLocMastEnd1(@Param("row") Integer row, @Param("locType1") Short locType1, @Param("inoutEveryday") 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); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | , Integer rowBeg, Integer rowEnd, Integer bayBeg, Integer bayEnd, Integer levBeg, Integer levEnd); | 
|---|
|  |  |  | List<LocMast> queryFreeLocMastEnd(Integer row, Short locType1); | 
|---|
|  |  |  | List<LocMast> queryFreeLocMastEnd0(Integer bay,Integer lev,Integer row, Short locType1); | 
|---|
|  |  |  | List<LocMast> queryFreeLocMastEnd1(Integer row, Short locType1,Boolean inoutEveryday); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<LocMast> queryFreeLocMast2(Short locType1, Integer rowBeg, Integer rowEnd, Integer bayBeg, Integer bayEnd, Integer levBeg, Integer levEnd); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<LocMast> queryFreeLocMastEnd1(Integer row, Short locType1,Boolean inoutEveryday){ | 
|---|
|  |  |  | return this.baseMapper.queryFreeLocMastEnd1(row, locType1,inoutEveryday); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<LocMast> queryFreeLocMast2(Short locType1, Integer rowBeg, Integer rowEnd, Integer bayBeg, Integer bayEnd, Integer levBeg, Integer levEnd) { | 
|---|
|  |  |  | return this.baseMapper.queryFreeLocMast2(locType1, rowBeg, rowEnd, bayBeg, bayEnd, levBeg, levEnd); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID | 
|---|
|  |  |  | wrkMast.setIoType(ioType); // 入出库状态 | 
|---|
|  |  |  | Double ioPri = wrkMastService.getIoPri(ioType, dto.getLocNo()); | 
|---|
|  |  |  | wrkMast.setIoPri(13D); // 优先级:13 | 
|---|
|  |  |  | wrkMast.setIoPri(15D); // 优先级:13 | 
|---|
|  |  |  | wrkMast.setOutMost(locMastService.isOutMost(dto.getLocNo(), false) ? 1 : 0); | 
|---|
|  |  |  | wrkMast.setCrnNo(locMast.getCrnNo()); | 
|---|
|  |  |  | wrkMast.setSourceStaNo(staDesc.getCrnStn()); // 源站 | 
|---|
|  |  |  | 
|---|
|  |  |  | // 开始查找库位 ==============================>> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 1.当检索库排为浅库位排时,优先寻找当前库排的深库位排 | 
|---|
|  |  |  | // 高低频管控、库位组全部为O | 
|---|
|  |  |  | if (locMast == null) { | 
|---|
|  |  |  | List<Integer> rows = Utils.getGroupLoc(curRow); | 
|---|
|  |  |  | List<LocMast> locMasts = locMastService.queryFreeLocMast0(rows, rows.size(), locTypeDto.getLocType1(), inoutEveryday); | 
|---|
|  |  |  | 
|---|
|  |  |  | if (!locMastService.checkEmptyCount(locMast, 10)) { locMast = null; } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 2.1 高低频管控、库位组无需全部为O,找到库位对应深库位不能为P R | 
|---|
|  |  |  | if (Cools.isEmpty(locMast)) { | 
|---|
|  |  |  | int sign = curRow; | 
|---|
|  |  |  | while (sign != 0 && Cools.isEmpty(locMast)) { | 
|---|
|  |  |  | List<LocMast> locMasts = locMastService.queryFreeLocMastEnd1(sign, locTypeDto.getLocType1(), inoutEveryday); | 
|---|
|  |  |  | for (LocMast loc : locMasts) { | 
|---|
|  |  |  | // 同库位组对应其钱库位是否为 O.空库位 | 
|---|
|  |  |  | boolean success = true; | 
|---|
|  |  |  | // 浅库位 | 
|---|
|  |  |  | List<String> outerLocList = Utils.getGroupOuterLoc(loc.getLocNo()); | 
|---|
|  |  |  | for (String outerLocNo : outerLocList) { | 
|---|
|  |  |  | LocMast outerLoc = locMastService.selectById(outerLocNo); | 
|---|
|  |  |  | if (Cools.isEmpty(outerLoc)) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!outerLoc.getLocSts().equals("O")) { | 
|---|
|  |  |  | success = false; break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 深库位 | 
|---|
|  |  |  | List<String> insideLocList = Utils.getGroupInsideLoc(loc.getLocNo()); | 
|---|
|  |  |  | for (String insideLocNo : insideLocList) { | 
|---|
|  |  |  | LocMast insideLoc = locMastService.selectById(insideLocNo); | 
|---|
|  |  |  | if (Cools.isEmpty(insideLoc)) { | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (insideLoc.getLocSts().equals("R") || insideLoc.getLocSts().equals("P")) { | 
|---|
|  |  |  | success = false; break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 因库位移转、需预留空库位 | 
|---|
|  |  |  | if (!locMastService.checkEmptyCount(loc, 10)) { | 
|---|
|  |  |  | success = false; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (success) { | 
|---|
|  |  |  | locMast = loc; | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | sign = getCurRow(sign); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 2.无库位时,无视区域锁定,重新查找库位 | 
|---|
|  |  |  | if (Cools.isEmpty(locMast)) { | 
|---|
|  |  |  | int sign = curRow; | 
|---|
|  |  |  | 
|---|
|  |  |  | server: | 
|---|
|  |  |  | port: 8081 | 
|---|
|  |  |  | port: 8080 | 
|---|
|  |  |  | servlet: | 
|---|
|  |  |  | context-path: /@pom.build.finalName@ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  | username: sa | 
|---|
|  |  |  | #    password: Zoneyung@zy56$ | 
|---|
|  |  |  | password: sa@123 | 
|---|
|  |  |  | 
|---|
|  |  |  | order by loc_sts desc ,lev1 asc,bay1 asc | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="queryFreeLocMastEnd1" resultMap="BaseResultMap"> | 
|---|
|  |  |  | select * | 
|---|
|  |  |  | from asr_loc_mast | 
|---|
|  |  |  | where row1=#{row} | 
|---|
|  |  |  | and loc_sts='O' | 
|---|
|  |  |  | <if test="locType1 != null"> | 
|---|
|  |  |  | and loc_type1 = #{locType1} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <choose> | 
|---|
|  |  |  | <when test="inoutEveryday != null and inoutEveryday"> | 
|---|
|  |  |  | AND bay1 < 11             </when> | 
|---|
|  |  |  | <otherwise> | 
|---|
|  |  |  | AND bay1 >= 11 | 
|---|
|  |  |  | </otherwise> | 
|---|
|  |  |  | </choose> | 
|---|
|  |  |  | and loc_no not in ('0100101', '0200101', '0300101', '1200701', '1300701', '1400701', '1900401', '2000401', '2100401') | 
|---|
|  |  |  | order by loc_sts desc ,lev1 asc,bay1 asc | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="queryFreeLocMastEnd0" resultMap="BaseResultMap"> | 
|---|
|  |  |  | select * | 
|---|
|  |  |  | from asr_loc_mast | 
|---|