| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.BaseRes; |
| | |
| | | } |
| | | } |
| | | |
| | | ArrayList<String> outerLocs = new ArrayList<>(); |
| | | //检测是否为浅库位 |
| | | boolean sign=false; |
| | | String th = ""; |
| | |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", outerLoc)); |
| | | if (locMast != null) { |
| | | if (!locMast.getLocSts().equals("O") && !locMast.getLocSts().equals("R")) { |
| | | sign = true; |
| | | th = "库位号:" + locNo + " 浅库位有非空库位!"; |
| | | break; |
| | | // sign = true; |
| | | // th = "库位号:" + locNo + " 浅库位有非空库位!"; |
| | | // break; |
| | | |
| | | OutLocDto outLocDto = new OutLocDto(); |
| | | outLocDto.setLocNo(locMast.getLocNo()); |
| | | List<LocDetlDto> locDetlDtos1 = new ArrayList<>(); |
| | | for (LocDetl locDetl : locDetlService.selectByLocNo(locMast.getLocNo())) { |
| | | LocDetlDto locDetlDto = new LocDetlDto(); |
| | | locDetlDto.setLocDetl(locDetl); |
| | | locDetlDto.setCount(locDetl.getAnfme()); |
| | | locDetlDtos1.add(locDetlDto); |
| | | } |
| | | outLocDto.setLocDetlDtos(locDetlDtos1); |
| | | if (!outerLocs.contains(locMast.getLocNo())) { |
| | | dtos.add(outLocDto); |
| | | outerLocs.add(locMast.getLocNo()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (sign){ |
| | | throw new CoolException("出库失败;"+th); |
| | | } |
| | | // if (sign){ |
| | | // throw new CoolException("出库失败;"+th); |
| | | // } |
| | | |
| | | //**************325、331、333、339站点额外逻辑代码************** |
| | | HashMap<String, Object> tmpMap = new HashMap<>(); |
| | |
| | | } |
| | | |
| | | private void generateAgvWaitpakin(WrkDetl wrkDetl){ |
| | | Order order = orderService.selectByNo(wrkDetl.getOrderNo()); |
| | | DocType docType = docTypeService.selectById(order.getDocType()); |
| | | if("人工补货单".equals(docType.getDocName())){ |
| | | AgvWaitPakin agvWaitPakin = new AgvWaitPakin(); |
| | | BeanUtils.copyProperties(wrkDetl,agvWaitPakin); |
| | | agvWaitPakinService.insert(agvWaitPakin); |
| | | String orderNo = wrkDetl.getOrderNo(); |
| | | if(orderNo.contains("{")){ |
| | | JSONArray orderArray = JSON.parseArray(orderNo); |
| | | for (Object o : orderArray){ |
| | | JSONObject jsonobject = (JSONObject) o; |
| | | Order order = orderService.selectByNo(jsonobject.get("orderNo").toString()); |
| | | DocType docType = docTypeService.selectById(order.getDocType()); |
| | | if("人工补货单".equals(docType.getDocName())){ |
| | | throw new CoolException("合并单据中包含人工补货单,单据为: " + jsonobject.get("orderNo")); |
| | | } |
| | | } |
| | | |
| | | }else { |
| | | Order order = orderService.selectByNo(orderNo); |
| | | DocType docType = docTypeService.selectById(order.getDocType()); |
| | | if("人工补货单".equals(docType.getDocName())){ |
| | | AgvWaitPakin agvWaitPakin = new AgvWaitPakin(); |
| | | BeanUtils.copyProperties(wrkDetl,agvWaitPakin); |
| | | agvWaitPakinService.insert(agvWaitPakin); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |