| | |
| | | |
| | | try{ |
| | | String locNo = null; |
| | | String locSts = null; |
| | | long whsType = 0L; |
| | | Integer crnNo = 0; |
| | | Integer row1 = 0; |
| | |
| | | } |
| | | if (entry.getKey().equals("whsType")) { |
| | | whsType = Long.getLong(val); |
| | | }else if (entry.getKey().equals("locNo")) { |
| | | }else if (entry.getKey().equals("loc_no")) { |
| | | locNo = val; |
| | | }else if (entry.getKey().equals("crnNo")) { |
| | | crnNo = Integer.getInteger(val); |
| | | }else if (entry.getKey().equals("crn_no")) { |
| | | crnNo = Integer.parseInt(val); |
| | | }else if (entry.getKey().equals("row1")) { |
| | | row1 = Integer.getInteger(val); |
| | | row1 = Integer.parseInt(val); |
| | | }else if (entry.getKey().equals("bay1")) { |
| | | bay1 = Integer.getInteger(val); |
| | | bay1 = Integer.parseInt(val); |
| | | }else if (entry.getKey().equals("lev1")) { |
| | | lev1 = Integer.getInteger(val); |
| | | lev1 = Integer.parseInt(val); |
| | | }else if (entry.getKey().equals("loc_sts")) { |
| | | locSts = val; |
| | | } |
| | | } |
| | | List<LocMast> locMastList = locMastService.selectLocMastListSix(locNo,whsType,crnNo,row1,bay1,lev1,0,10); |
| | | Page<LocMast> page = new Page<LocMast>(0,10).setRecords(locMastList); |
| | | page.setTotal(locMastService.selectLocMastListTotalSix(locNo,whsType,crnNo,row1,bay1,lev1)); |
| | | List<LocMast> locMastList = locMastService.selectLocMastListSix(locSts,locNo,whsType,crnNo,row1,bay1,lev1,curr,limit); |
| | | Page<LocMast> page = new Page<LocMast>(curr,limit).setRecords(locMastList); |
| | | page.setTotal(locMastService.selectLocMastListTotalSix(locSts,locNo,whsType,crnNo,row1,bay1,lev1)); |
| | | return R.ok(page); |
| | | }catch (Exception e){ |
| | | return R.error("异常" + e); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locMast/init/auth2") |
| | | @ManagerAuth(memo = "初始化库位") |
| | | // @Transactional |
| | | public R init2(LocMastInitParam param) { |
| | | try{ |
| | | List<LocMast> list = new ArrayList<>(); |
| | | for (int r=param.getStartRow(); r<=param.getEndRow(); r++){ |
| | | for (int b=param.getStartBay(); b<=param.getEndBay(); b++) { |
| | | for (int l=param.getStartLev(); l<=param.getEndLev(); l++) { |
| | | // 获取库位号 |
| | | String locNo = String.format("%02d", r) + String.format("%03d", b) + String.format("%02d", l); |
| | | // 获取堆垛机号 |
| | | int crnNo = 0; |
| | | try{ |
| | | Shelves shelves = new Shelves(param.getEndRow() - param.getStartRow() + 1, param.getCrnAmount(),param.getStartRow()); |
| | | for (List<Integer> node : shelves.nodes){ |
| | | |
| | | if (node.contains(r)) { |
| | | if (!Cools.isEmpty(param.getStaCrn()) && param.getStaCrn() > 0){ |
| | | crnNo = shelves.nodes.indexOf(node) + param.getStaCrn(); |
| | | }else { |
| | | crnNo = shelves.nodes.indexOf(node) + 1; |
| | | } |
| | | |
| | | break; |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | throw new Exception("解析堆垛机号失败,请填写正确的数据!!!"); |
| | | } |
| | | |
| | | Date now = new Date(); |
| | | LocMast locMast = new LocMast(); |
| | | locMast.setLocNo(locNo); |
| | | locMast.setLocSts("O"); |
| | | locMast.setRow1(r); // 排 |
| | | locMast.setBay1(b); // 列 |
| | | locMast.setLev1(l); // 层 |
| | | // locMast.setGro1(r); // 组 |
| | | locMast.setCrnNo(crnNo); // 堆垛机 |
| | | locMast.setLocType1(!Cools.isEmpty(param.getLocType1()) ? param.getLocType1() : 1); |
| | | locMast.setLocType2(param.getLocType2()); |
| | | locMast.setLocType3(param.getLocType3()); |
| | | locMast.setAppeUser(getUserId()); |
| | | locMast.setAppeTime(now); |
| | | locMast.setModiUser(getUserId()); |
| | | locMast.setModiTime(now); |
| | | // locMast.setWhsType(basWhs.getId()); |
| | | list.add(locMast); |
| | | } |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(param.getEnable()) && param.getEnable() == 1){ |
| | | locMastService.delete(new EntityWrapper<>()); |
| | | } |
| | | locMastService.insertBatch(list); |
| | | return R.ok("初始化成功"); |
| | | }catch (Exception e){ |
| | | return R.error("初始化失败===>"+e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/locMast/init/auth") |
| | | @ManagerAuth(memo = "初始化库位") |
| | | // @Transactional |