From 01824c5104590b96a3040faa317969bcd812bcca Mon Sep 17 00:00:00 2001 From: ZY <zc857179121@qq.com> Date: 星期六, 21 九月 2024 08:17:04 +0800 Subject: [PATCH] Merge branch 'xgmFlasrs' into xgmFlasrs2 hebing --- src/main/java/com/zy/asrs/controller/MobileController.java | 290 ++++++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 202 insertions(+), 88 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/MobileController.java b/src/main/java/com/zy/asrs/controller/MobileController.java index af7f3fb..e739ef9 100644 --- a/src/main/java/com/zy/asrs/controller/MobileController.java +++ b/src/main/java/com/zy/asrs/controller/MobileController.java @@ -2,6 +2,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; +import com.baomidou.mybatisplus.mapper.Wrapper; import com.core.annotations.ManagerAuth; import com.core.common.BaseRes; import com.core.common.Cools; @@ -9,11 +10,12 @@ import com.core.exception.CoolException; import com.zy.asrs.entity.*; import com.zy.asrs.entity.param.CombParam; +import com.zy.asrs.entity.param.GDYKConfirmGoodsParam; import com.zy.asrs.entity.param.MobileAdjustParam; +import com.zy.asrs.entity.param.OffSaleParam; import com.zy.asrs.entity.result.MobileAdjustResult; +import com.zy.asrs.mapper.ManLocDetlMapper; import com.zy.asrs.service.*; -import com.zy.common.model.LocDto; -import com.zy.common.model.TaskDto; import com.zy.common.model.WrkDto; import com.zy.common.web.BaseController; import org.springframework.beans.factory.annotation.Autowired; @@ -21,6 +23,7 @@ import org.springframework.web.bind.annotation.*; import java.util.*; +import java.util.List; /** * 绉诲姩绔帴鍙f帶鍒跺櫒 @@ -28,7 +31,7 @@ */ @RestController @RequestMapping("mobile") -public class MobileController extends BaseController { +public class MobileController extends BaseController { @Autowired private MobileService mobileService; @@ -51,7 +54,27 @@ @Autowired private PackService packService; @Autowired - private WorkService workService; + private ManLocDetlMapper manLocDetlMapper; + @Autowired + private WrkDetlLogService wrkDetlLogService; + + + // 鍟嗗搧涓婃灦 + @RequestMapping("/mat/onSale/auth") + @ManagerAuth + public R matOnSale(@RequestBody CombParam combParam) { + mobileService.onSale(combParam); + return R.ok("涓婃灦鎴愬姛"); + } + + // 鍟嗗搧涓嬫灦 + @RequestMapping("/mat/offSale/auth") + //@ManagerAuth + public R matOffSale(@RequestBody OffSaleParam offSaleParam) { + mobileService.offSale(offSaleParam); + return R.ok("涓嬫灦鎴愬姛"); + } + // 缁勬墭 ---------------------------------------------------------------------------------------------------- @@ -59,37 +82,90 @@ * 鏍规嵁鍗曞彿妫�绱㈠崟鎹暟鎹� * http://localhost:8081/jkwms/mobile/order/serach/orderNo/auth?orderNo=123123 */ +// @RequestMapping("/order/search/orderNo/auth") +// @ManagerAuth +// public R orderSearchByBarcode(@RequestParam String orderNo){ +// Order order = orderService.selectByNo(orderNo); +// if (order == null) { +// return R.ok(); +// } +// DocType docType = docTypeService.selectById(order.getDocType()); +// if (docType.getPakin() == null || docType.getPakin() != 1) { +// return R.ok(); +// } +// if (order.getSettle() > 2) { +// return R.ok(); +// } +// List<OrderDetl> orderDetls = orderService.selectWorkingDetls(order.getId()); +// if (Cools.isEmpty(orderDetls)) { +// return R.ok(); +// } +// return R.ok().add(orderDetls); +// } @RequestMapping("/order/search/orderNo/auth") @ManagerAuth - public R orderSearchByBarcode(@RequestParam String orderNo){ - Order order = orderService.selectByNo(orderNo); - if (order == null) { + public R orderSearchByBarcode(@RequestParam String orderNo) { + if (Cools.isEmpty(orderNo)) { + orderNo = null; + } + List<Order> orders = orderService.selectorderNoL(orderNo); + if (Cools.isEmpty(orders)) { return R.ok(); } - DocType docType = docTypeService.selectById(order.getDocType()); - if (docType.getPakin() == null || docType.getPakin() != 1) { - return R.ok(); + LinkedList<CombParam> combParams = new LinkedList<>(); + if (!Cools.isEmpty(orders)) { + for (Order order : orders) { + CombParam combParam = new CombParam(); + if (order == null) { + continue; + } + DocType docType = docTypeService.selectById(order.getDocType()); + if (docType.getPakin() == null || docType.getPakin() != 1) { + continue; + } + if (order.getSettle() > 2) { + continue; + } + List<OrderDetl> orderDetls = orderService.selectWorkingDetls(order.getId()); + if (!Cools.isEmpty(orderDetls)) { + LinkedList<CombParam.CombMat> combMats = new LinkedList<>(); + for (OrderDetl orderDetl : orderDetls) { + CombParam.CombMat combMat = new CombParam.CombMat(); + combMat.setMatnr(orderDetl.getMatnr()); + combMat.setBatch(orderDetl.getBatch()); + combMat.setAnfme(orderDetl.getAnfme() - orderDetl.getWorkQty()); + combMat.setMaktx(orderDetl.getMaktx()); + combMat.setSpecs(orderDetl.getSpecs()); + combMats.add(combMat); + } + combParam.setCombMats(combMats); + } + combParam.setOrderNo(order.getOrderNo()); + combParams.add(combParam); + } } - if (order.getSettle() > 2) { - return R.ok(); - } - List<OrderDetl> orderDetls = orderService.selectWorkingDetls(order.getId()); - if (Cools.isEmpty(orderDetls)) { - return R.ok(); - } - return R.ok().add(orderDetls); + return R.ok().add(combParams); } @RequestMapping("/comb/auth") @ManagerAuth(memo = "缁勬墭") - public R comb(@RequestBody CombParam combParam){ + public R comb(@RequestBody CombParam combParam) { + if (Cools.isEmpty(combParam.getOrderNo())) { + combParam.setOrderNo(combParam.getBillNo()); + } + List<CombParam.CombMat> combMats = combParam.getCombMats(); + combMats.forEach(elem -> { + if (Cools.isEmpty(elem.getBatch())) { + elem.setBatch(elem.getItemBatch()); + } + }); mobileService.comb(combParam, getUserId()); return R.ok("缁勬墭鎴愬姛"); } @RequestMapping("/pack/get/auth") @ManagerAuth - public R packGet(@RequestParam String barcode){ + public R packGet(@RequestParam String barcode) { Pack pack = packService.selectByBarcode(barcode); if (pack == null) { return R.ok(); @@ -100,12 +176,12 @@ return R.ok("缁勬墭鎴愬姛"); } - @RequestMapping("/pack/comb/auth") - @ManagerAuth(memo = "涓嬬嚎缁勬墭") - public R packComb(@RequestBody CombParam combParam){ - mobileService.packComb(combParam, getUserId()); - return R.ok("缁勬墭鎴愬姛"); - } +// @RequestMapping("/pack/comb/auth") +// @ManagerAuth(memo = "涓嬬嚎缁勬墭") +// public R packComb(@RequestBody CombParam combParam) { +// mobileService.packComb(combParam, getUserId()); +// return R.ok("缁勬墭鎴愬姛"); +// } // 鍑哄簱 --------------------------------------------------------------------------------------------------- @@ -113,22 +189,20 @@ @RequestMapping("/pakout/query/auth") @ManagerAuth @Deprecated - public R pakoutQuery(@RequestParam(required = false) String barcode, - @RequestParam(required = false) Integer staNo, - @RequestParam(required = false) String matnr){ - if (Cools.isEmpty(barcode) && Cools.isEmpty(matnr)) { + public R pakoutQuery(@RequestParam String barcode) { + if (Cools.isEmpty(barcode)) { return R.ok(); } if (!Cools.isEmpty(barcode)) { List<WrkDetl> wrkDetls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("zpallet", barcode)); return R.ok().add(wrkDetls); } - if (!Cools.isEmpty(matnr)) { - if (!Cools.isEmpty(staNo)) { - List<WrkDetl> wrkDetls = wrkDetlService.selectPakoutQuery(staNo, matnr); - return R.ok().add(wrkDetls); - } - } +// if (!Cools.isEmpty(matnr)) { +// if (!Cools.isEmpty(staNo)) { +// List<WrkDetl> wrkDetls = wrkDetlService.selectPakoutQuery(staNo, matnr); +// return R.ok().add(wrkDetls); +// } +// } return R.ok(); } @@ -139,7 +213,7 @@ */ @RequestMapping("/pakout/confirm/barcode/auth") @ManagerAuth - public R pakoutQueryByBarcode(@RequestParam(required = false) String barcode){ + public R pakoutQueryByBarcode(@RequestParam(required = false) String barcode) { if (Cools.isEmpty(barcode)) { return R.ok(); } @@ -154,12 +228,47 @@ } /** + * 鍑哄簱纭 - 鎵揣鐗� 骞垮痉瀹滅鐗� + * 1.鍏ㄦ澘 杩斿洖 101 + * 2.鎷f枡 杩斿洖 103 + */ + @RequestMapping("/pakout/confirm/goods/auth") //寰呭畬鍠� 鍘熷洜锛堝鎴锋湭缁欏嚭璇︾粏淇℃伅锛� + @ManagerAuth + public R pakoutQueryByGoods(@RequestBody GDYKConfirmGoodsParam combParam) { + if (Cools.isEmpty(combParam)) { + return R.ok(); + } +// List<Order> orders = orderService.selectorderNoL(batch); + OrderDetl orderDetl = orderDetlService.selectOne(new EntityWrapper<OrderDetl>().eq("matnr", combParam.getMatnr()).eq("batch", combParam.getBatch()).eq("order_no", combParam.getOrderNo())); + if (Cools.isEmpty(orderDetl)) { + return R.error("鏈煡鍒版暟鎹�"); + } + if (!orderDetl.getQty$().equals("宸插畬鎴�")) { + return R.error("浠诲姟鏈畬鎴�"); + } + //澶嶆牳鏁� + orderDetl.setSource(1); + orderDetlService.updateById(orderDetl); + return R.ok(); + } + + // 鏍规嵁搴撲綅鐮佸拰鍟嗗搧鐮佹悳绱㈠晢鍝� + @RequestMapping("/mat/find/auth") + public R find(@RequestParam(required = false) String locNo + , @RequestParam(required = false) String matnr) { + //List<ManLocDetl> manLocDetls = manLocDetlMapper.selectItem0(locNo, matnr); + ManLocDetl manLocDetl = manLocDetlMapper.selectLocNo0(locNo, matnr); + return R.ok(manLocDetl); + //return R.ok(manLocDetlMapper.selectItem0(locNo, matnr)); + } + + /** * 鍑哄簱纭 - 鎷f枡鍑哄簱 - 閫夋嫨鍏蜂綋鏉$爜鍟嗗搧 */ @RequestMapping("/pakout/confirm/pick/auth") @ManagerAuth public R pakoutQueryByBarcode(@RequestParam(required = false) Integer wrkNo - , @RequestParam(required = false) String matnr){ + , @RequestParam(required = false) String matnr) { if (Cools.isEmpty(wrkNo)) { return R.ok(); } @@ -294,63 +403,68 @@ @RequestMapping("/adjust/auth") @ManagerAuth(memo = "鐩樼偣") - public R adjust(@RequestBody MobileAdjustParam combParam){ + public R adjust(@RequestBody MobileAdjustParam combParam) { mobileService.adjust(combParam, getUserId()); return R.ok("鐩樼偣鎴愬姛"); } - @PostMapping("/out/pakout/auth") -// @ManagerAuth(memo = "鏍规嵁璁㈠崟鍑哄簱") + @PostMapping("/order/out/pakout/auth") + @ManagerAuth(memo = "璁㈠崟鍑哄簱") public synchronized R pakoutByOrder(@RequestBody JSONObject param) { - if(!param.containsKey("staNo") || !param.containsKey("orderNo")){ + if (!param.containsKey("staNo") || !param.containsKey("orderNo")) { return R.parse(BaseRes.PARAM); } - Integer staNo = param.containsKey("staNo") ? Integer.parseInt(param.get("staNo").toString()) : 0; - String orderNo = param.containsKey("orderNo") ? param.get("orderNo").toString() : ""; - - BasDevp sta = basDevpService.checkSiteStatus(staNo); - //鏍规嵁璁㈠崟鍙风敓鎴愬嚭搴撲换鍔″伐浣滄。,寰呭疄鐜� - List<OrderDetl> orderDetls = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("order_no", orderNo)); - for(OrderDetl orderDetl : orderDetls){ - - } - - -// if (Cools.isEmpty(locDtos)) { -// return R.parse(BaseRes.PARAM); -// } -// boolean lack = true; -// for (LocDto locDto : locDtos) { -// if (!locDto.isLack()) { -// lack = false; -// break; -// } -// } -// if (lack) { -// return R.error("搴撳瓨涓嶈冻"); -// } -// -// Thread.sleep(1000L); -// -// List<TaskDto> taskDtos = new ArrayList<>(); -// // 鏍规嵁 锛堝簱浣� & 鍑哄簱绔欙級 鍒嗙粍锛� 鐞嗘兂鐘舵�侊細涓�缁勪负涓�娆″嚭搴撲换鍔� -// for (LocDto locDto : locDtos) { -// if (locDto.isLack()) { continue; } -// TaskDto taskDto = new TaskDto(locDto.getLocNo(), locDto.getStaNo(), locDto); -// if (TaskDto.has(taskDtos, taskDto)) { -// TaskDto dto = TaskDto.find(taskDtos, taskDto); -// assert dto != null; -// dto.getLocDtos().addAll(taskDto.getLocDtos()); -// } else { -// taskDtos.add(taskDto); -// } -// } -// // ----------------------------------------------------------------------------------------------- -// for (TaskDto taskDto : taskDtos) { -// BasDevp staNo = basDevpService.checkSiteStatus(taskDto.getStaNo()); -// workService.stockOut(staNo, taskDto, getUserId()); -// } - return R.ok(); + mobileService.pakoutByOrder(param, getUserId()); + return R.ok("鍑哄簱鎴愬姛"); } + + /** + * 鏍规嵁閫氱煡鍗曟煡璇㈡槑缁� + */ + @RequestMapping("/bill/query1/auth") + @ManagerAuth(memo = "鏍规嵁閫氱煡鍗曟煡璇㈡槑缁�") + public R billQuery1(@RequestParam String billNo, @RequestParam String size) { + Order temp1 = orderService.selectOne(new EntityWrapper<Order>().eq("temp1", billNo)); + if (temp1 == null) { + throw new CoolException("璇ヨ鍗曚笉瀛樺湪"); + } + List<OrderDetl> waitMatins = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("order_no", temp1.getOrderNo()).like("model", size).last("and anfme > work_qty")); + if (waitMatins == null || waitMatins.isEmpty()) { + throw new CoolException("璇ヨ鍗曢」涓嶅瓨鍦�"); + } + //濡傛灉閫氱煡鍗曞崟鍙蜂负绌猴紝鍒欐煡璇㈣皟鎷ㄥ崟鍙� +// if (Cools.isEmpty(waitMatins) || waitMatins.size() <= 0) { +// waitMatins = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("temp1", billNo).like("size", size).last("and anfme > work_qty")); +// } + + List<CombBillQueryVo> vos = new ArrayList<>(); + if (!Cools.isEmpty(waitMatins)) { + for (OrderDetl waitMatin : waitMatins) { + CombBillQueryVo vo = new CombBillQueryVo(); + vo.setDetlId(waitMatin.getId()); + vo.setMatnr(waitMatin.getMatnr()); + vo.setMatName(waitMatin.getMaktx()); + vo.setQty(waitMatin.getAnfme() - waitMatin.getWorkQty()); + vo.setCount(waitMatin.getAnfme() - waitMatin.getWorkQty()); + vo.setBillNo(waitMatin.getOrderNo()); + vo.setSeqNo(waitMatin.getINo()); + vo.setUnit(waitMatin.getUnit()); + vo.setSpecs(waitMatin.getSpecs()); + vo.setSize(waitMatin.getModel()); + vo.setColor(waitMatin.getColor()); + vo.setItemBatch(waitMatin.getBatch()); + vo.setLuHao(waitMatin.getLuHao()); + vo.setOutOrderNo(waitMatin.getOutOrderNo()); + vo.setSPgNO(waitMatin.getSPgNO()); + vo.setProType(waitMatin.getProType()); + vo.setPacking(waitMatin.getPacking()); + //vo.setOveFlag(waitMatin.getOveFlag()); + vos.add(vo); + } + } + return R.ok().add(vos); + } + + } -- Gitblit v1.9.1