| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/node/init/auth") |
| | | @ManagerAuth(memo = "初始化库位") |
| | | @ManagerAuth(memo = "平库库位初始化") |
| | | @Transactional |
| | | public R init(NodeInitPatam param) { |
| | | List<Node> list = new ArrayList<>(); |
| | | EntityWrapper<Node> nodeEntityWrapper = new EntityWrapper<>(); |
| | | nodeEntityWrapper.eq("id",param.getValue()); |
| | | nodeEntityWrapper.eq("name",param.getName()); |
| | | nodeService.delete(new EntityWrapper<Node>().eq("parent_id",param.getValue())); |
| | | // nodeService.delete(new EntityWrapper<Node>().eq("parent_id",param.getValue())); |
| | | Node node = nodeService.selectOne(nodeEntityWrapper); |
| | | String[] string = node.getNamePath().split(","); |
| | | for (int r=param.getStartRow(); r<=param.getEndRow(); r++){ |
| | | for (int b=param.getStartBay(); b<=param.getEndBay(); b++) { |
| | | int tno=1; int no=1; |
| | | for (int b=param.getStartBay(); b<=param.getEndBay(); b++) { |
| | | for (int r=param.getStartRow(); r<=param.getEndRow(); r++){ |
| | | for (int l=param.getStartLev(); l<=param.getEndLev(); l++) { |
| | | // 获取库位号 |
| | | String locNo; |
| | | |
| | | if (param.getName().equals("DT-B")){ |
| | | if (b == 2 || b ==4 || b == 7){ |
| | | if (l == 1){ |
| | | locNo = param.getName()+"T-" +String.format("%02d", tno) + String.format("%02d", r) + String.format("%02d", l); |
| | | }else { |
| | | locNo = null; |
| | | } |
| | | |
| | | |
| | | }else { |
| | | locNo = param.getName()+"-" +String.format("%02d", no) + String.format("%02d", r) + String.format("%02d", l); |
| | | |
| | | } |
| | | }else if (param.getName().equals("DT-C") || param.getName().equals("DT-D")){ |
| | | if (b == 3 || b ==6 || b == 9 || b == 12 || b == 15 || b == 17 || b == 20 || b == 23){ |
| | | if (l == 1){ |
| | | locNo = param.getName()+"T-" +String.format("%02d", tno) + String.format("%02d", r) + String.format("%02d", l); |
| | | }else { |
| | | locNo = null; |
| | | } |
| | | |
| | | }else { |
| | | locNo = param.getName()+"-" +String.format("%02d", no) + String.format("%02d", r) + String.format("%02d", l); |
| | | |
| | | } |
| | | |
| | | }else { |
| | | locNo = param.getName()+"-" +String.format("%02d", r) + String.format("%02d", b) + String.format("%02d", l); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | if (locNo == null){ |
| | | continue; |
| | | } |
| | | |
| | | Date now = new Date(); |
| | | Node node1 = new Node(); |
| | |
| | | |
| | | } |
| | | } |
| | | if (param.getName().equals("DT-B")){ |
| | | if (b == 2 || b ==4 || b == 7){ |
| | | tno++; |
| | | }else { |
| | | no++; |
| | | } |
| | | }else if (param.getName().equals("DT-C") || param.getName().equals("DT-D")){ |
| | | if (b == 3 || b ==6 || b == 9 || b == 12 || b == 15 || b == 17 || b == 20 || b == 23){ |
| | | tno++; |
| | | }else { |
| | | no++; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | // |
| | | // nodeService.delete(new EntityWrapper<Node>().eq("parent_id",param.getValue())); |