From 19e76055b26c9513e5bfd4e62e34a88b192109dd Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期六, 23 十二月 2023 20:45:59 +0800 Subject: [PATCH] #增加日志 --- src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java | 26 +++++++++++++++++++++----- 1 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java index 7e48d42..ac9a84a 100644 --- a/src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/AgvWorkServiceImpl.java @@ -1,6 +1,8 @@ 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.core.common.Cools; import com.core.exception.CoolException; @@ -389,7 +391,7 @@ while (iterator1.hasNext()) { LocDetlAdjustParam.LocDetlAdjust adjust = iterator1.next(); if (adjust.getCount() == 0) { continue; } - if (locDetl.getMatnr().equals(adjust.getMatnr()) && Cools.eq(locDetl.getBatch(), adjust.getBatch())) { + if (locDetl.getMatnr().equals(adjust.getMatnr()) && Cools.eq(locDetl.getBatch(), adjust.getBatch()) && Cools.eq(locDetl.getSuppCode(),adjust.getSuppCode()) && Cools.eq(locDetl.getThreeCode(),adjust.getThreeCode()) && Cools.eq(locDetl.getDeadTime(),adjust.getDeadTime())) { if (!locDetl.getAnfme().equals(adjust.getCount())) { // todo 鐩樼偣璁板綍 // 淇敼搴撳瓨 @@ -506,7 +508,9 @@ if (Cools.isEmpty(wrkMast)){ throw new CoolException(workNo+"宸ヤ綔妗d笉瀛樺湪"); } - + if(!wrkMast.getLocNo().contains("@") || !wrkMast.getSourceLocNo().contains("@")){ + throw new CoolException("鐩爣搴撲綅鎴栬�呮簮搴撲綅鏆傛湭鍒嗛厤锛屾棤娉曞彇娑�"); + } //淇敼AGV宸ヤ綔妗g殑宸ヤ綔鐘舵�佷负205.宸ヤ綔瀹屾垚 agvWrkMastService.updateWrkStsByWrkNo(wrkMast.getWrkNo(),205); @@ -561,9 +565,21 @@ agvWrkDetlList1.forEach(agvWrkDetl -> { if(!Cools.isEmpty(agvWrkDetl.getOrderNo())){ - OrderDetl orderDetl = orderDetlService.selectByOrderNoAndMatnr(agvWrkDetl.getOrderNo(),agvWrkDetl.getMatnr(),agvWrkDetl.getThreeCode(),agvWrkDetl.getDeadTime()); - orderDetl.setQty(orderDetl.getQty() - agvWrkDetl.getAnfme()); - orderDetlService.updateById(orderDetl); + String orderNo = agvWrkDetl.getOrderNo(); + if(orderNo.contains("{")){ + JSONArray orderArray = JSON.parseArray(orderNo); + for (Object o : orderArray){ + JSONObject jsonobject = (JSONObject) o; + OrderDetl orderDetl = orderDetlService.selectByOrderNoAndMatnr(jsonobject.get("orderNo").toString(),agvWrkDetl.getMatnr(),agvWrkDetl.getThreeCode(),agvWrkDetl.getDeadTime()); + orderDetl.setQty(orderDetl.getQty() - agvWrkDetl.getAnfme()); + orderDetlService.updateById(orderDetl); + } + + }else { + OrderDetl orderDetl = orderDetlService.selectByOrderNoAndMatnr(agvWrkDetl.getOrderNo(),agvWrkDetl.getMatnr(),agvWrkDetl.getThreeCode(),agvWrkDetl.getDeadTime()); + orderDetl.setQty(orderDetl.getQty() - agvWrkDetl.getAnfme()); + orderDetlService.updateById(orderDetl); + } } }); -- Gitblit v1.9.1