| | |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.entity.param.MobileAdjustParam; |
| | | import com.zy.asrs.entity.param.OffSaleParam; |
| | | import com.zy.asrs.entity.param.OpenOrderPakinParam; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.mapper.BasDevpMapper; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.MatUtils; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.constant.AgvSiteConstant; |
| | | import com.zy.common.constant.ApiInterfaceConstant; |
| | | import com.zy.common.constant.MesConstant; |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.common.model.DetlDto; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 移动端服务核心类 |
| | |
| | | private ManLocDetlService manLocDetlService; |
| | | @Autowired |
| | | private ManLocDetlMapper manLocDetlMapper; |
| | | @Resource |
| | | private InventoryCheckOrderDetlService inventoryCheckOrderDetlService; |
| | | |
| | | @Resource |
| | | private BasDevpMapper basDevpMapper; |
| | | |
| | | @Override |
| | | public R inLocCallAgv(String sta, String inSta) { |
| | | |
| | | BasDevp basDevp = basDevpMapper.selectById(inSta); |
| | | // 0.出库模式,1.agv入库中,2.生成入库任务 |
| | | if (basDevp.getDevMk().equals("0")) { // 是出库 |
| | | // 判断是否有出库任务 |
| | | int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>() |
| | | .eq("sta_no", inSta).lt("wrk_sts",14).in("io_type",101,103,107,110)); |
| | | if (count == 0) { |
| | | // 没有出库任务,更改为入库模式 |
| | | basDevp.setDevMk("1"); |
| | | basDevpMapper.updateById(basDevp); |
| | | } else { |
| | | return R.parse(inSta + "站点存在出库任务"); |
| | | } |
| | | } |
| | | |
| | | // 先绑定 |
| | | // boolean flag = bindPodAndBerth(sta); |
| | | // if (!flag) { |
| | | // return R.parse(inSta + "绑定失败"); |
| | | // } |
| | | |
| | | ForwardAGVTaskParam forwardAGVTaskParam = new ForwardAGVTaskParam(); |
| | | forwardAGVTaskParam.setReqCode(UUID.randomUUID().toString().replace("-", "")); |
| | | forwardAGVTaskParam.setClientCode("IWMS"); |
| | | forwardAGVTaskParam.setTaskTyp("GT3"); |
| | | forwardAGVTaskParam.setCtnrTyp("2"); |
| | | forwardAGVTaskParam.setPriority("1"); |
| | | List<ForwardAGVTaskParam.PositionCodePaths> positionCodePathsList = new ArrayList<>(); |
| | | positionCodePathsList.add(new ForwardAGVTaskParam.PositionCodePaths(sta, "05")); |
| | | positionCodePathsList.add(new ForwardAGVTaskParam.PositionCodePaths(inSta, "05")); |
| | | forwardAGVTaskParam.setPositionCodePath(positionCodePathsList); |
| | | |
| | | String body = JSON.toJSONString(forwardAGVTaskParam); |
| | | String response = ""; |
| | | String message = ""; |
| | | boolean success = false; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(ApiInterfaceConstant.AGV_IP) |
| | | .setPath(ApiInterfaceConstant.AGV_CALL_IN_PATH) |
| | | .setJson(body) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | jsonObject.getString("message"); |
| | | if (jsonObject.getInteger("code").equals(0)) { |
| | | success = true; |
| | | } else { |
| | | log.error("入库呼叫agv失败!!!url:{};request:{};response:{}", ApiInterfaceConstant.AGV_IP + ApiInterfaceConstant.AGV_CALL_IN_PATH, body, response); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("入库呼叫agv异常", e); |
| | | } finally { |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "入库呼叫agv", |
| | | ApiInterfaceConstant.AGV_IP + ApiInterfaceConstant.AGV_CALL_IN_PATH, |
| | | null, |
| | | "127.0.0.1", |
| | | body, |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | } |
| | | } |
| | | |
| | | return success ? R.ok("呼叫agv成功") : R.parse(message); |
| | | } |
| | | |
| | | @Override |
| | | public R unbind(String site) { |
| | | String staMap = AgvSiteConstant.SiteMap.get(site); |
| | | if (staMap == null) { |
| | | return R.parse("没有找到该站点的入库映射:" + site); |
| | | } |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("reqCode",UUID.randomUUID().toString().replace("-", "")); // 请求唯一值 |
| | | jsonObject.put("ctnrTyp","2"); // 容器类型2 |
| | | jsonObject.put("stgBinCode",staMap); // 仓位编号,根据客仓编号转换 |
| | | jsonObject.put("indBind","0"); // 1绑定,0解绑 |
| | | |
| | | String body = jsonObject.toJSONString(); |
| | | String response = ""; |
| | | String message = ""; |
| | | boolean success = false; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(ApiInterfaceConstant.AGV_IP) |
| | | .setPath(ApiInterfaceConstant.AGV_BIND_PATH) |
| | | .setJson(body) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject res = JSON.parseObject(response); |
| | | message = jsonObject.getString("message"); |
| | | if (res.getInteger("code").equals(0)) { |
| | | success = true; |
| | | } else { |
| | | log.error("调用agv解绑暂存位失败!!!url:{};request:{};response:{}", ApiInterfaceConstant.AGV_IP + ApiInterfaceConstant.AGV_BIND_PATH, body, response); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("调用agv解绑暂存位异常", e); |
| | | } finally { |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "调用agv解绑暂存位", |
| | | ApiInterfaceConstant.AGV_IP + ApiInterfaceConstant.AGV_BIND_PATH, |
| | | null, |
| | | "127.0.0.1", |
| | | body, |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | } |
| | | } |
| | | return success ? R.ok("解绑成功") : R.parse(message); |
| | | } |
| | | |
| | | private boolean bindPodAndBerth(String sta) { |
| | | String staMap = AgvSiteConstant.SiteMap.get(sta); |
| | | if (staMap == null) { |
| | | log.error("没有找到该站点的入库映射:{}",sta); |
| | | return false; |
| | | } |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("reqCode",UUID.randomUUID().toString().replace("-", "")); // 请求唯一值 |
| | | jsonObject.put("ctnrTyp","2"); // 容器类型2 |
| | | jsonObject.put("stgBinCode",staMap); // 仓位编号,根据客仓编号转换 |
| | | jsonObject.put("indBind","1"); // 1绑定,0解绑 |
| | | |
| | | String body = jsonObject.toJSONString(); |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(ApiInterfaceConstant.AGV_IP) |
| | | .setPath(ApiInterfaceConstant.AGV_BIND_PATH) |
| | | .setJson(body) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject res = JSON.parseObject(response); |
| | | if (res.getInteger("code").equals(0)) { |
| | | success = true; |
| | | } else { |
| | | log.error("调用agv绑定仓位失败!!!url:{};request:{};response:{}", ApiInterfaceConstant.AGV_IP + ApiInterfaceConstant.AGV_BIND_PATH, body, response); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("调用agv绑定仓位异常", e); |
| | | } finally { |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "调用agv绑定仓位", |
| | | ApiInterfaceConstant.AGV_IP + ApiInterfaceConstant.AGV_BIND_PATH, |
| | | null, |
| | | "127.0.0.1", |
| | | body, |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | } |
| | | } |
| | | return success; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) { |
| | | throw new CoolException(BaseRes.PARAM); |
| | | } |
| | | // 判断是否有相同条码的数据 |
| | | if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). |
| | | eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) { |
| | | throw new CoolException(param.getBarcode() + "数据正在进行入库"); |
| | | if(param.getCombMats().size()>1){ |
| | | throw new CoolException("请提取一个商品,或者刷新重新组托!"); |
| | | } |
| | | param.getCombMats().forEach(elem -> { |
| | | // 判断是否有相同条码的数据 |
| | | if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). |
| | | eq("zpallet", param.getBarcode()) |
| | | .eq("io_status", "N") |
| | | .eq("matnr",elem.getMatnr()).eq("batch",elem.getBatch())) > 0) { |
| | | throw new CoolException(param.getBarcode() + "已有相同数据"); |
| | | } |
| | | }); |
| | | |
| | | if(param.getBarcode().length()!=9){ |
| | | throw new CoolException("条码长度不是9位===>>" + param.getBarcode()); |
| | | } |
| | | |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode())); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode())); |
| | | // int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",param.getBarcode())); |
| | | if (countLoc > 0 || countWrk > 0) { |
| | | throw new CoolException("工作档/库存条码数据已存在===>>" + param.getBarcode()); |
| | | } |
| | |
| | | // 生成入库通知档 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | param.getCombMats().forEach(elem -> { |
| | | |
| | | // 判断是否有相同条码的数据 |
| | | if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). |
| | | eq("zpallet", param.getBarcode()) |
| | | .eq("io_status", "N") |
| | | .eq("matnr",elem.getMatnr()).eq("batch",elem.getBatch())) > 0) { |
| | | throw new CoolException(param.getBarcode() + "已有相同数据"); |
| | | } |
| | | |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); |
| | |
| | | // 关联组托 |
| | | } else { |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | | if (order.getSettle() > 2) { |
| | | if (Cools.isEmpty(order) || order.getSettle() > 2) { |
| | | throw new CoolException("单据编号已过期"); |
| | | } |
| | | // 生成入库通知档 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | param.getCombMats().forEach(elem -> { |
| | | |
| | | for (CombParam.CombMat elem : param.getCombMats()) { |
| | | |
| | | |
| | | // param.getCombMats().forEach(elem -> { |
| | | |
| | | // 订单明细数量校验 |
| | | OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), elem.getMatnr(), elem.getBatch()); |
| | | if (Cools.isEmpty(orderDetl)) { |
| | | throw new CoolException("该单据中未找到对应物料明细"); |
| | | } |
| | | if (elem.getAnfme() > orderDetl.getEnableQty()) { |
| | | throw new CoolException(orderDetl.getMatnr() + "入库数量不合法"); |
| | | } |
| | |
| | | throw new CoolException("修改单据作业数量失败"); |
| | | } |
| | | |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme()); |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(),orderDetl.getManu()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); |
| | | assert one != null; |
| | |
| | | } else { |
| | | detlDtos.add(detlDto); |
| | | } |
| | | }); |
| | | // }); |
| | | } |
| | | for (DetlDto detlDto : detlDtos) { |
| | | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | |
| | | waitPakin.setAppeTime(now); |
| | | waitPakin.setModiUser(userId); |
| | | waitPakin.setModiTime(now); |
| | | waitPakin.setManu(detlDto.getMark()); //标记 |
| | | waitPakin.setOrigin(order.getItemName());//仓库 |
| | | if (!waitPakinService.insert(waitPakin)) { |
| | | throw new CoolException("保存入库通知档失败"); |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void mergeComb(CombParam param, Long userId) { |
| | | |
| | | if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) { |
| | | throw new CoolException(BaseRes.PARAM); |
| | | } |
| | | if(param.getCombMats().stream().anyMatch(obj -> obj.getAnfme() == null)){ |
| | | throw new CoolException("入库物料数量不能为空"); |
| | | } |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | | if (Cools.isEmpty(order) || order.getSettle() > 2) { |
| | | throw new CoolException("单据编号已过期"); |
| | | } |
| | | |
| | | // 判断是否有相同条码的数据 |
| | | if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). |
| | | eq("zpallet", param.getBarcode()).eq("io_status", "N")) > 0) { |
| | | throw new CoolException(param.getBarcode() + "数据正在进行入库"); |
| | | } |
| | | |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode())); |
| | | WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode()); |
| | | if (wrkMast.getWrkSts() != 14 && wrkMast.getIoType() != 104){ |
| | | throw new CoolException(param.getBarcode() + "该条码数据不为并板出库"); |
| | | } |
| | | |
| | | //设置非null批号, |
| | | for (CombParam.CombMat combMat : param.getCombMats()) { |
| | | if (combMat.getBatch() == null){ |
| | | combMat.setBatch(""); |
| | | } |
| | | } |
| | | |
| | | Date now = new Date(); |
| | | for (CombParam.CombMat combMat : param.getCombMats()) { |
| | | // 订单明细数量校验 |
| | | OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), combMat.getMatnr(), combMat.getBatch()); |
| | | if (Cools.isEmpty(orderDetl)) { |
| | | throw new CoolException("该单据中未找到对应物料明细"); |
| | | } |
| | | if (combMat.getAnfme() > orderDetl.getEnableQty()) { |
| | | throw new CoolException(orderDetl.getMatnr() + "入库数量不合法"); |
| | | } |
| | | // 修改订单作业数量 |
| | | if (!orderDetlService.increaseWorkQty(order.getId(), combMat.getMatnr(), combMat.getBatch(), combMat.getAnfme())) { |
| | | throw new CoolException("修改单据作业数量失败"); |
| | | } |
| | | |
| | | Mat mat = matService.selectByMatnr(combMat.getMatnr()); |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(mat); |
| | | wrkDetl.setBatch(combMat.getBatch()); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setOrderNo(param.getOrderNo()); |
| | | wrkDetl.setZpallet(param.getBarcode()); |
| | | wrkDetl.setAnfme(combMat.getAnfme()); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiTime(now); |
| | | wrkDetl.setModiUser(userId); |
| | | wrkDetl.setManu(orderDetl.getManu()); |
| | | wrkDetlService.insert(wrkDetl); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | // 商品上架 |
| | | @Override |
| | | public void onSale(CombParam param) { |
| | | Date now = new Date(); |
| | |
| | | throw new CoolException(combMat.getMatnr() + ":商品数量有误!"); |
| | | } |
| | | if (Cools.isEmpty(combMat.getBatch())){ |
| | | throw new CoolException(combMat.getMatnr() + ":商品批号有误!"); |
| | | // throw new CoolException(combMat.getMatnr() + ":商品批号有误!"); |
| | | } |
| | | ManLocDetl manLocDetl = new ManLocDetl(); |
| | | manLocDetl.setLocNo(locno); |
| | | manLocDetl.setNodeId(node.getId()); |
| | | manLocDetl.setMaktx(mat.getMaktx()); |
| | | manLocDetl.setMatnr(mat.getMatnr()); |
| | | manLocDetl.setBatch(combMat.getBatch()); |
| | | manLocDetl.setBatch(Cools.isEmpty(combMat.getBatch()) ? "" : combMat.getBatch()); |
| | | manLocDetl.setAnfme(combMat.getAnfme()); |
| | | manLocDetl.setModiTime(now); |
| | | if (!manLocDetlService.insert(manLocDetl)) { |
| | |
| | | } |
| | | } |
| | | |
| | | // 商品下架 |
| | | @Override |
| | | public void offSale(OffSaleParam offSaleParam) { |
| | | ManLocDetl manLocDetl = manLocDetlMapper.selectLocNo0(offSaleParam.getLocNo(), offSaleParam.getMatnr()); |
| | |
| | | } |
| | | manLocDetlMapper.updateAnfme0(anfme,manLocDetl.getNodeId()); |
| | | } |
| | | |
| | | // 查找商品 |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | String orderNo = "PACK" + snowflakeIdWorker.nextId(); |
| | | OpenOrderPakinParam openParam = new OpenOrderPakinParam(); |
| | | openParam.setOrderNo(orderNo); |
| | | openParam.setOrderTime(DateUtils.convert(now)); |
| | | openParam.setInboundDate(DateUtils.convert(now)); |
| | | openParam.setOrderType("打包入库单"); |
| | | openParam.setOrderDetails(detlDtos); |
| | | openService.pakinOrderCreate(openParam); |
| | |
| | | } |
| | | |
| | | @Override |
| | | // @Transactional |
| | | public void leftoversOut(Map<String, Object> map,Long userId) { |
| | | String barcode = map.get("barcode").toString(); |
| | | String barcode2 = map.get("barcode2").toString(); |
| | | |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",barcode2)); |
| | | int countWrk = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("barcode",barcode2).ne("io_type",200)); |
| | | int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet",barcode2)); |
| | | if (countLoc > 0 || countWrk > 0 || countwait > 0) { |
| | | throw new CoolException("该条码已被使用===>>" + barcode2); |
| | | } |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", barcode).eq("io_type", 103)); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException("未查询到拣料任务"); |
| | | } |
| | | int workNo = commonService.getWorkNo(1); |
| | | WrkMast wrkMast2 = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", barcode2).eq("io_type", 200)); |
| | | if (Cools.isEmpty(wrkMast2)) { |
| | | Date now = new Date(); |
| | | |
| | | WrkMast wrkMast1 = new WrkMast(); |
| | | wrkMast1.sync(wrkMast); |
| | | wrkMast1.setWrkNo(workNo); |
| | | wrkMast1.setWrkSts(2L); |
| | | wrkMast1.setIoType(200); |
| | | wrkMast1.setSourceStaNo(wrkMast.getStaNo() == 113 ? 111 : 117); |
| | | wrkMast1.setStaNo(wrkMast.getStaNo() == 113 ? 204 : 304); |
| | | wrkMast1.setIoTime(now); |
| | | wrkMast1.setIoPri(13D); // 优先级:13 |
| | | wrkMast1.setCrnNo(wrkMast.getCrnNo()); |
| | | wrkMast1.setSourceLocNo(wrkMast.getLocNo()); // 源库位 |
| | | wrkMast1.setFullPlt("Y"); // 满板:Y |
| | | wrkMast1.setPicking("N"); // 拣料 |
| | | wrkMast1.setExitMk("N"); // 退出 |
| | | wrkMast1.setEmptyMk("N"); // 空板 |
| | | wrkMast1.setLinkMis("N"); |
| | | wrkMast1.setAppeUser(userId); // 操作人员数据 |
| | | wrkMast1.setAppeTime(now); |
| | | wrkMast1.setModiUser(userId); |
| | | wrkMast1.setModiTime(now); |
| | | wrkMast1.setBarcode(barcode2); |
| | | if (!wrkMastService.insert(wrkMast1)) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("zpallet", map.get("barcode"))); |
| | | if (Cools.isEmpty(wrkDetls)) { |
| | | throw new CoolException("未查询到拣料任务明细"); |
| | | } |
| | | |
| | | for(WrkDetl wrkDetl : wrkDetls){ |
| | | WrkDetl wrkDetl1 = new WrkDetl(); |
| | | wrkDetl1.sync(wrkDetl); |
| | | wrkDetl1.setWrkNo(workNo); |
| | | wrkDetlService.insert(wrkDetl1); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void pdaAdjust(pdaAdjustParam param, Long userId) { |
| | | if (Cools.isEmpty(param)){ |
| | | throw new CoolException("盘点列表参数为空"); |
| | | } |
| | | for (InventoryCheckOrderDetl orderDetl: param.getParam()){ |
| | | InventoryCheckOrderDetl inventoryCheckOrderDetl = inventoryCheckOrderDetlService.selectOne(new EntityWrapper<InventoryCheckOrderDetl>() |
| | | .eq("order_no", orderDetl.getOrderNo()) |
| | | .eq("matnr", orderDetl.getMatnr()) |
| | | .eq("batch", orderDetl.getBatch())); |
| | | if (Cools.isEmpty(inventoryCheckOrderDetl)){ |
| | | throw new CoolException("未查询到盘点信息"); |
| | | } |
| | | if (!inventoryCheckOrderDetl.getStatus().equals("1")){ |
| | | throw new CoolException("该任务已盘点"); |
| | | } |
| | | inventoryCheckOrderDetl.setCheckAnfme(orderDetl.getCheckAnfme()); |
| | | inventoryCheckOrderDetl.setStatus("2"); |
| | | if (!inventoryCheckOrderDetlService.updateById(inventoryCheckOrderDetl)){ |
| | | throw new CoolException("保存盘点信息失败!"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void stockOut(OrderDetl orderDetl, BasDevp staNo, LocDetl locDetl, |
| | | Double curOutQty, Integer ioType, Long userId, Date now) { |