From deb6a6b0c367cafb786d037992ab1df43d3934a9 Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期一, 04 九月 2023 10:30:26 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/controller/NodeController.java | 81 ++++++++++++++++++++++++++++++++++------ 1 files changed, 68 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/NodeController.java b/src/main/java/com/zy/asrs/controller/NodeController.java index 87ee636..f045756 100644 --- a/src/main/java/com/zy/asrs/controller/NodeController.java +++ b/src/main/java/com/zy/asrs/controller/NodeController.java @@ -13,9 +13,7 @@ import com.core.common.DateUtils; import com.core.common.R; import com.core.exception.CoolException; -import com.zy.asrs.entity.LocMast; -import com.zy.asrs.entity.ManLocDetl; -import com.zy.asrs.entity.Node; +import com.zy.asrs.entity.*; import com.zy.asrs.entity.param.InitPakoutParam; import com.zy.asrs.entity.param.LocMastInitParam; import com.zy.asrs.entity.param.NodeInitPatam; @@ -67,9 +65,9 @@ @RequestParam(required = false)String orderByType, @RequestParam Map<String, Object> param){ EntityWrapper<Node> wrapper = new EntityWrapper<>(); + wrapper.eq("type",3); excludeTrash(param); convert(param, wrapper); - hostEq(wrapper); if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} return R.ok(nodeService.selectPage(new Page<>(curr, limit), wrapper)); } @@ -98,7 +96,6 @@ @RequestParam(required = false)String orderByType, @RequestParam Map<String, Object> param){ EntityWrapper<Node> wrapper = new EntityWrapper<>(); - wrapper.ne("type",3); excludeTrash(param); convert(param, wrapper); hostEq(wrapper); @@ -317,13 +314,13 @@ if (node.getType() != 3) { return R.error("浠呭彲閫夋嫨璐т綅"); } - return nodeService.stockPakin(number, getUserId(), getHostId()); + return nodeService.stockPakin(number, getUserId(), getHostId(),getUser()); } @RequestMapping("/work/stock/pakout") @ManagerAuth(memo = "鍑哄簱") public R initPakout(@RequestBody List<InitPakoutParam> params) { - return nodeService.initPakout(params, getUserId(), getHostId()); + return nodeService.initPakout(params, getUserId(), getHostId(),getUser()); } @PostMapping(value = "/work/empty/stock") @@ -336,7 +333,7 @@ @ManagerAuth(memo = "搴撲綅绉昏浆") public R locMoveStart(@RequestParam String sourceLocNo, @RequestParam String targetLocNo) { - nodeService.locMove(sourceLocNo, targetLocNo, getUserId()); + nodeService.locMove(sourceLocNo, targetLocNo, getUserId(),getUser()); return R.ok("绉诲簱鍚姩鎴愬姛"); } @RequestMapping(value = "/node/select/{id}/auth") @@ -348,19 +345,59 @@ } @RequestMapping(value = "/node/init/auth") - @ManagerAuth(memo = "鍒濆鍖栧簱浣�") -// @Transactional + @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())); Node node = nodeService.selectOne(nodeEntityWrapper); - for (int r=param.getStartRow(); r<=param.getEndRow(); r++){ - for (int b=param.getStartBay(); b<=param.getEndBay(); b++) { + String[] string = node.getNamePath().split(","); + 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 = param.getName()+"-" +String.format("%02d", r) + String.format("%02d", b) + String.format("%02d", 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(); @@ -386,6 +423,22 @@ } } + 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())); @@ -420,4 +473,6 @@ } + + } -- Gitblit v1.9.1