|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.service.impl; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSON; | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONObject; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.mapper.EntityWrapper; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.mapper.Wrapper; | 
|---|
|  |  |  | import com.core.common.*; | 
|---|
|  |  |  | import com.core.common.BaseRes; | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.core.common.SnowflakeIdWorker; | 
|---|
|  |  |  | 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.PickInParam; | 
|---|
|  |  |  | 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.MesConstant; | 
|---|
|  |  |  | import com.zy.common.entity.Parameter; | 
|---|
|  |  |  | import com.zy.common.model.DetlDto; | 
|---|
|  |  |  | import com.zy.common.model.MesCombParam; | 
|---|
|  |  |  | import com.zy.common.service.CommonService; | 
|---|
|  |  |  | import com.zy.common.utils.HttpHandler; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | 
|---|
|  |  |  | private ManLocDetlService manLocDetlService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ManLocDetlMapper manLocDetlMapper; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private MatBarcodeService matBarcodeService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private AdjDetlService adjDetlService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | 
|---|
|  |  |  | // 生成入库通知档 | 
|---|
|  |  |  | List<DetlDto> detlDtos = new ArrayList<>(); | 
|---|
|  |  |  | param.getCombMats().forEach(elem -> { | 
|---|
|  |  |  | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme()); | 
|---|
|  |  |  | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(), elem.getProType(), elem.getTemp2(), elem.getOutOrderNo()); | 
|---|
|  |  |  | detlDto.setMemo(detlDto.getMemo()); | 
|---|
|  |  |  | if (DetlDto.has(detlDtos, detlDto)) { | 
|---|
|  |  |  | DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); | 
|---|
|  |  |  | assert one != null; | 
|---|
|  |  |  | 
|---|
|  |  |  | if (Cools.isEmpty(mat)) { | 
|---|
|  |  |  | throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //校验当前物料与托盘绑定信息是否正确 | 
|---|
|  |  |  | MatBarcode matBarcode = new MatBarcode(); | 
|---|
|  |  |  | MatBarcode mb = matBarcodeService.selectbyMatnr(detlDto.getMatnr()); | 
|---|
|  |  |  | if (mb != null){ | 
|---|
|  |  |  | if (!mb.getZpallet().equals(param.getBarcode())){ | 
|---|
|  |  |  | throw new CoolException(detlDto.getMatnr() + "该物料与其他托盘绑定,请先解绑"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | matBarcode.setZpallet(param.getBarcode());//托盘码 | 
|---|
|  |  |  | matBarcode.setMatnr(mat.getMatnr());//物料号 | 
|---|
|  |  |  | matBarcode.setMaktx(mat.getMaktx());//物料名称 | 
|---|
|  |  |  | matBarcode.setSpecs(mat.getSpecs());//规格 | 
|---|
|  |  |  | matBarcode.setModel(mat.getModel());//型号 | 
|---|
|  |  |  | if (!matBarcodeService.insert(matBarcode)) { | 
|---|
|  |  |  | throw new CoolException("物料与托盘绑定失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | WaitPakin waitPakin = new WaitPakin(); | 
|---|
|  |  |  | waitPakin.sync(mat); | 
|---|
|  |  |  | waitPakin.setProType(detlDto.getProType()); | 
|---|
|  |  |  | waitPakin.setTemp2(detlDto.getTemp2()); | 
|---|
|  |  |  | waitPakin.setOutOrderNo(detlDto.getOutOrderNo()); | 
|---|
|  |  |  | waitPakin.setBatch(detlDto.getBatch()); | 
|---|
|  |  |  | waitPakin.setZpallet(param.getBarcode());   // 托盘码 | 
|---|
|  |  |  | waitPakin.setIoStatus("N");     // 入出状态 | 
|---|
|  |  |  | 
|---|
|  |  |  | waitPakin.setAppeTime(now); | 
|---|
|  |  |  | waitPakin.setModiUser(userId); | 
|---|
|  |  |  | waitPakin.setModiTime(now); | 
|---|
|  |  |  | waitPakin.setMemo(detlDto.getMemo()); | 
|---|
|  |  |  | if (!waitPakinService.insert(waitPakin)) { | 
|---|
|  |  |  | throw new CoolException("保存入库通知档失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | // 关联组托 | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Order order = orderService.selectOne(new EntityWrapper<Order>().eq("temp1", param.getOrderNo())); | 
|---|
|  |  |  | Order order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", param.getOrderNo())); | 
|---|
|  |  |  | if (Cools.isEmpty(order) || order.getSettle() > 2) { | 
|---|
|  |  |  | throw new CoolException("单据编号已过期"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | param.getCombMats().forEach(elem -> { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 订单明细数量校验 | 
|---|
|  |  |  | OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), elem.getMatnr(), elem.getBatch()); | 
|---|
|  |  |  | //OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), elem.getMatnr(), elem.getBatch(),elem.getAnfme() ); | 
|---|
|  |  |  | OrderDetl orderDetl = orderDetlService.selectById(elem.getDetlId()); | 
|---|
|  |  |  | if (elem.getAnfme() > orderDetl.getEnableQty()) { | 
|---|
|  |  |  | throw new CoolException(orderDetl.getMatnr() + "入库数量不合法"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 修改订单作业数量 | 
|---|
|  |  |  | if (!orderDetlService.increaseWorkQty(order.getId(), elem.getMatnr(), elem.getBatch(), elem.getAnfme())) { | 
|---|
|  |  |  | if (!orderDetlService.increaseWorkQty(orderDetl, elem.getAnfme())) { | 
|---|
|  |  |  | throw new CoolException("修改单据作业数量失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme()); | 
|---|
|  |  |  | if (DetlDto.has(detlDtos, detlDto)) { | 
|---|
|  |  |  | DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); | 
|---|
|  |  |  | assert one != null; | 
|---|
|  |  |  | one.setAnfme(one.getAnfme() + detlDto.getAnfme()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | detlDtos.add(detlDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | for (DetlDto detlDto : detlDtos) { | 
|---|
|  |  |  | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); | 
|---|
|  |  |  | Mat mat = matService.selectByMatnr(orderDetl.getMatnr()); | 
|---|
|  |  |  | if (Cools.isEmpty(mat)) { | 
|---|
|  |  |  | throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); | 
|---|
|  |  |  | throw new CoolException(orderDetl.getMatnr() + "商品档案不存在"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //校验当前物料与托盘绑定信息是否正确 | 
|---|
|  |  |  | MatBarcode matBarcode = new MatBarcode(); | 
|---|
|  |  |  | MatBarcode mb = matBarcodeService.selectbyMatnr(orderDetl.getMatnr()); | 
|---|
|  |  |  | if (mb != null){ | 
|---|
|  |  |  | if (!mb.getZpallet().equals(param.getBarcode())){ | 
|---|
|  |  |  | throw new CoolException(orderDetl.getMatnr() + "该物料与其他托盘绑定,请先解绑"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | matBarcode.setZpallet(param.getBarcode());//托盘码 | 
|---|
|  |  |  | matBarcode.setMatnr(mat.getMatnr());//物料号 | 
|---|
|  |  |  | matBarcode.setMaktx(mat.getMaktx());//物料名称 | 
|---|
|  |  |  | matBarcode.setSpecs(mat.getSpecs());//规格 | 
|---|
|  |  |  | matBarcode.setModel(mat.getModel());//型号 | 
|---|
|  |  |  | if (!matBarcodeService.insert(matBarcode)) { | 
|---|
|  |  |  | throw new CoolException("物料与托盘绑定失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | WaitPakin waitPakin = new WaitPakin(); | 
|---|
|  |  |  | waitPakin.sync(mat); | 
|---|
|  |  |  | waitPakin.setOrderNo(order.getOrderNo());   // 单据编号 | 
|---|
|  |  |  | waitPakin.setBatch(detlDto.getBatch());     // 序列码 | 
|---|
|  |  |  | waitPakin.setBatch(orderDetl.getBatch());     // 序列码 | 
|---|
|  |  |  | waitPakin.setZpallet(param.getBarcode());   // 托盘码 | 
|---|
|  |  |  | waitPakin.setIoStatus("N");     // 入出状态 | 
|---|
|  |  |  | waitPakin.setAnfme(detlDto.getAnfme());  // 数量 | 
|---|
|  |  |  | waitPakin.setAnfme(elem.getAnfme());  // 数量 | 
|---|
|  |  |  | waitPakin.setStatus("Y");    // 状态 | 
|---|
|  |  |  | waitPakin.setAppeUser(userId); | 
|---|
|  |  |  | waitPakin.setAppeTime(now); | 
|---|
|  |  |  | waitPakin.setModiUser(userId); | 
|---|
|  |  |  | waitPakin.setModiTime(now); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | waitPakin.setBatch(orderDetl.getBatch()); | 
|---|
|  |  |  | waitPakin.setSPgNO(orderDetl.getSPgNO()); | 
|---|
|  |  |  | waitPakin.setOutOrderNo(orderDetl.getOutOrderNo()); | 
|---|
|  |  |  | waitPakin.setProType(orderDetl.getProType()); | 
|---|
|  |  |  | waitPakin.setLuHao(orderDetl.getLuHao()); | 
|---|
|  |  |  | waitPakin.setPacking(orderDetl.getPacking()); | 
|---|
|  |  |  | if (!waitPakinService.insert(waitPakin)) { | 
|---|
|  |  |  | throw new CoolException("保存入库通知档失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | orderService.updateSettle(order.getId(), 2L, userId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public void packComb(CombParam param, Long userId) { | 
|---|
|  |  |  | 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() + "数据正在进行入库"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Date now = new Date(); | 
|---|
|  |  |  | //    @Override | 
|---|
|  |  |  | //    @Transactional | 
|---|
|  |  |  | //    public void packComb(CombParam param, Long userId) { | 
|---|
|  |  |  | //        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() + "数据正在进行入库"); | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | //        Date now = new Date(); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //        boolean packDown = Parameter.get().getPackDown().equals("true"); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //        // 无单组托 | 
|---|
|  |  |  | //        if (Cools.isEmpty(param.getOrderNo())) { | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //            // 生成入库通知档 | 
|---|
|  |  |  | //            List<DetlDto> detlDtos = new ArrayList<>(); | 
|---|
|  |  |  | //            param.getCombMats().forEach(elem -> { | 
|---|
|  |  |  | //                // 打包上线数据校验 | 
|---|
|  |  |  | //                if (packDown) { | 
|---|
|  |  |  | //                    Pack pack = packService.selectByBarcode(elem.getMatnr()); | 
|---|
|  |  |  | //                    if (pack == null) { | 
|---|
|  |  |  | //                        throw new CoolException(elem.getMatnr() + "条码冗余,请检查!"); | 
|---|
|  |  |  | //                    } | 
|---|
|  |  |  | //                    if (pack.getSettle() != 1) { | 
|---|
|  |  |  | //                        throw new CoolException(elem.getMatnr() + "条码已下线,请检查!"); | 
|---|
|  |  |  | //                    } | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //                Mat analyse = MatUtils.analyseMat(elem.getMatnr()); | 
|---|
|  |  |  | //                // 条码、物料代码、序列号、数量 | 
|---|
|  |  |  | //                DetlDto detlDto = new DetlDto(elem.getMatnr(), analyse.getMatnr(), analyse.getBarcode(), elem.getAnfme()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | boolean packDown = Parameter.get().getPackDown().equals("true"); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 无单组托 | 
|---|
|  |  |  | if (Cools.isEmpty(param.getOrderNo())) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 生成入库通知档 | 
|---|
|  |  |  | List<DetlDto> detlDtos = new ArrayList<>(); | 
|---|
|  |  |  | param.getCombMats().forEach(elem -> { | 
|---|
|  |  |  | // 打包上线数据校验 | 
|---|
|  |  |  | if (packDown) { | 
|---|
|  |  |  | Pack pack = packService.selectByBarcode(elem.getMatnr()); | 
|---|
|  |  |  | if (pack == null) { | 
|---|
|  |  |  | throw new CoolException(elem.getMatnr() + "条码冗余,请检查!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (pack.getSettle() != 1) { | 
|---|
|  |  |  | throw new CoolException(elem.getMatnr() + "条码已下线,请检查!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Mat analyse = MatUtils.analyseMat(elem.getMatnr()); | 
|---|
|  |  |  | // 条码、物料代码、序列号、数量 | 
|---|
|  |  |  | DetlDto detlDto = new DetlDto(elem.getMatnr(), analyse.getMatnr(), analyse.getBarcode(), elem.getAnfme()); | 
|---|
|  |  |  | //                DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme()); | 
|---|
|  |  |  | if (DetlDto.has(detlDtos, detlDto)) { | 
|---|
|  |  |  | DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); | 
|---|
|  |  |  | assert one != null; | 
|---|
|  |  |  | one.setAnfme(one.getAnfme() + detlDto.getAnfme()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | detlDtos.add(detlDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (packDown) { | 
|---|
|  |  |  | MesCombParam mesCombParam = new MesCombParam(); | 
|---|
|  |  |  | mesCombParam.setZpallet(param.getBarcode()); | 
|---|
|  |  |  | mesCombParam.setPakinTime(DateUtils.convert(now)); | 
|---|
|  |  |  | mesCombParam.setLgort("5008"); | 
|---|
|  |  |  | mesCombParam.setPlantCode("5000"); | 
|---|
|  |  |  | mesCombParam.setFromCode("5012-20"); | 
|---|
|  |  |  | mesCombParam.setStationCode("JJQ-PFZPDB-XX"); | 
|---|
|  |  |  | for (DetlDto detlDto : detlDtos) { | 
|---|
|  |  |  | mesCombParam.getList().add(new MesCombParam.Detl(detlDto.getOrderNo(), detlDto.getAnfme())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | String response = ""; | 
|---|
|  |  |  | boolean success = false; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | response = new HttpHandler.Builder() | 
|---|
|  |  |  | .setUri(MesConstant.URL) | 
|---|
|  |  |  | .setPath(MesConstant.PACK_DOWN_URL) | 
|---|
|  |  |  | .setJson(JSON.toJSONString(mesCombParam)) | 
|---|
|  |  |  | .build() | 
|---|
|  |  |  | .doPost(); | 
|---|
|  |  |  | JSONObject jsonObject = JSON.parseObject(response); | 
|---|
|  |  |  | if (jsonObject.getInteger("code").equals(200)) { | 
|---|
|  |  |  | success = true; | 
|---|
|  |  |  | } else if (jsonObject.getInteger("code").equals(500)) { | 
|---|
|  |  |  | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); | 
|---|
|  |  |  | throw new CoolException(jsonObject.getString("msg")); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); | 
|---|
|  |  |  | throw new CoolException("上报mes系统失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("fail", e); | 
|---|
|  |  |  | throw new CoolException(e.getMessage()); | 
|---|
|  |  |  | } finally { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | // 保存接口日志 | 
|---|
|  |  |  | apiLogService.save( | 
|---|
|  |  |  | "打包下线帮托上报", | 
|---|
|  |  |  | MesConstant.URL + MesConstant.PACK_DOWN_URL, | 
|---|
|  |  |  | null, | 
|---|
|  |  |  | "127.0.0.1", | 
|---|
|  |  |  | JSON.toJSONString(mesCombParam), | 
|---|
|  |  |  | response, | 
|---|
|  |  |  | success | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | log.error("", e); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 生成入库单据 | 
|---|
|  |  |  | String orderNo = "PACK" + snowflakeIdWorker.nextId(); | 
|---|
|  |  |  | OpenOrderPakinParam openParam = new OpenOrderPakinParam(); | 
|---|
|  |  |  | openParam.setOrderNo(orderNo); | 
|---|
|  |  |  | openParam.setOrderTime(DateUtils.convert(now)); | 
|---|
|  |  |  | openParam.setOrderType("打包入库单"); | 
|---|
|  |  |  | openParam.setOrderDetails(detlDtos); | 
|---|
|  |  |  | openService.pakinOrderCreate(openParam); | 
|---|
|  |  |  | Order order = orderService.selectByNo(orderNo); | 
|---|
|  |  |  | if (null == order) { | 
|---|
|  |  |  | throw new CoolException("生成单据失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!orderService.updateSettle(order.getId(), 2L, userId)) { | 
|---|
|  |  |  | throw new CoolException("修改单据状态失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 生成入库通知档 | 
|---|
|  |  |  | for (DetlDto detlDto : detlDtos) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 修改作业数量 ---------------------------------------- | 
|---|
|  |  |  | // 订单明细数量校验 | 
|---|
|  |  |  | OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), detlDto.getMatnr(), detlDto.getBatch()); | 
|---|
|  |  |  | if (detlDto.getAnfme() > orderDetl.getEnableQty()) { | 
|---|
|  |  |  | throw new CoolException(orderDetl.getMatnr() + "入库数量不合法"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 修改订单作业数量 | 
|---|
|  |  |  | if (!orderDetlService.increaseWorkQty(order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getAnfme())) { | 
|---|
|  |  |  | throw new CoolException("修改单据作业数量失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 保存入库通知档 | 
|---|
|  |  |  | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); | 
|---|
|  |  |  | if (Cools.isEmpty(mat)) { | 
|---|
|  |  |  | throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | WaitPakin waitPakin = new WaitPakin(); | 
|---|
|  |  |  | waitPakin.sync(mat); | 
|---|
|  |  |  | waitPakin.setOrderNo(orderNo); | 
|---|
|  |  |  | waitPakin.setBatch(detlDto.getBatch()); | 
|---|
|  |  |  | waitPakin.setZpallet(param.getBarcode());   // 托盘码 | 
|---|
|  |  |  | waitPakin.setIoStatus("N");     // 入出状态 | 
|---|
|  |  |  | waitPakin.setAnfme(detlDto.getAnfme());  // 数量 | 
|---|
|  |  |  | waitPakin.setStatus("Y");    // 状态 | 
|---|
|  |  |  | waitPakin.setAppeUser(userId); | 
|---|
|  |  |  | waitPakin.setAppeTime(now); | 
|---|
|  |  |  | waitPakin.setModiUser(userId); | 
|---|
|  |  |  | waitPakin.setModiTime(now); | 
|---|
|  |  |  | if (!waitPakinService.insert(waitPakin)) { | 
|---|
|  |  |  | throw new CoolException("保存入库通知档失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 修改打包数据状态 | 
|---|
|  |  |  | Pack pack = packService.selectByBarcode(detlDto.getOrderNo()); | 
|---|
|  |  |  | pack.setSettle(2L); | 
|---|
|  |  |  | pack.setUpdateTime(now); | 
|---|
|  |  |  | pack.setUpdateBy(userId); | 
|---|
|  |  |  | if (!packService.updateById(pack)) { | 
|---|
|  |  |  | throw new CoolException("修改打包数据异常"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /// /                DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme()); | 
|---|
|  |  |  | //                if (DetlDto.has(detlDtos, detlDto)) { | 
|---|
|  |  |  | //                    DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); | 
|---|
|  |  |  | //                    assert one != null; | 
|---|
|  |  |  | //                    one.setAnfme(one.getAnfme() + detlDto.getAnfme()); | 
|---|
|  |  |  | //                } else { | 
|---|
|  |  |  | //                    detlDtos.add(detlDto); | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //            }); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //            if (packDown) { | 
|---|
|  |  |  | //                MesCombParam mesCombParam = new MesCombParam(); | 
|---|
|  |  |  | //                mesCombParam.setZpallet(param.getBarcode()); | 
|---|
|  |  |  | //                mesCombParam.setPakinTime(DateUtils.convert(now)); | 
|---|
|  |  |  | //                mesCombParam.setLgort("5008"); | 
|---|
|  |  |  | //                mesCombParam.setPlantCode("5000"); | 
|---|
|  |  |  | //                mesCombParam.setFromCode("5012-20"); | 
|---|
|  |  |  | //                mesCombParam.setStationCode("JJQ-PFZPDB-XX"); | 
|---|
|  |  |  | //                for (DetlDto detlDto : detlDtos) { | 
|---|
|  |  |  | //                    mesCombParam.getList().add(new MesCombParam.Detl(detlDto.getOrderNo(), detlDto.getAnfme())); | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //                String response = ""; | 
|---|
|  |  |  | //                boolean success = false; | 
|---|
|  |  |  | //                try { | 
|---|
|  |  |  | //                    response = new HttpHandler.Builder() | 
|---|
|  |  |  | //                            .setUri(MesConstant.URL) | 
|---|
|  |  |  | //                            .setPath(MesConstant.PACK_DOWN_URL) | 
|---|
|  |  |  | //                            .setJson(JSON.toJSONString(mesCombParam)) | 
|---|
|  |  |  | //                            .build() | 
|---|
|  |  |  | //                            .doPost(); | 
|---|
|  |  |  | //                    JSONObject jsonObject = JSON.parseObject(response); | 
|---|
|  |  |  | //                    if (jsonObject.getInteger("code").equals(200)) { | 
|---|
|  |  |  | //                        success = true; | 
|---|
|  |  |  | //                    } else if (jsonObject.getInteger("code").equals(500)) { | 
|---|
|  |  |  | //                        log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); | 
|---|
|  |  |  | //                        throw new CoolException(jsonObject.getString("msg")); | 
|---|
|  |  |  | //                    } else { | 
|---|
|  |  |  | //                        log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL + MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); | 
|---|
|  |  |  | //                        throw new CoolException("上报mes系统失败"); | 
|---|
|  |  |  | //                    } | 
|---|
|  |  |  | //                } catch (Exception e) { | 
|---|
|  |  |  | //                    log.error("fail", e); | 
|---|
|  |  |  | //                    throw new CoolException(e.getMessage()); | 
|---|
|  |  |  | //                } finally { | 
|---|
|  |  |  | //                    try { | 
|---|
|  |  |  | //                        // 保存接口日志 | 
|---|
|  |  |  | //                        apiLogService.save( | 
|---|
|  |  |  | //                                "打包下线帮托上报", | 
|---|
|  |  |  | //                                MesConstant.URL + MesConstant.PACK_DOWN_URL, | 
|---|
|  |  |  | //                                null, | 
|---|
|  |  |  | //                                "127.0.0.1", | 
|---|
|  |  |  | //                                JSON.toJSONString(mesCombParam), | 
|---|
|  |  |  | //                                response, | 
|---|
|  |  |  | //                                success | 
|---|
|  |  |  | //                        ); | 
|---|
|  |  |  | //                    } catch (Exception e) { | 
|---|
|  |  |  | //                        log.error("", e); | 
|---|
|  |  |  | //                    } | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //            // 生成入库单据 | 
|---|
|  |  |  | //            String orderNo = "PACK" + snowflakeIdWorker.nextId(); | 
|---|
|  |  |  | //            OpenOrderPakinParam openParam = new OpenOrderPakinParam(); | 
|---|
|  |  |  | //            openParam.setOrderNo(orderNo); | 
|---|
|  |  |  | //            openParam.setOrderTime(DateUtils.convert(now)); | 
|---|
|  |  |  | //            openParam.setOrderType("打包入库单"); | 
|---|
|  |  |  | //            openParam.setOrderDetails(detlDtos); | 
|---|
|  |  |  | //            openService.pakinOrderCreate(openParam); | 
|---|
|  |  |  | //            Order order = orderService.selectByNo(orderNo); | 
|---|
|  |  |  | //            if (null == order) { | 
|---|
|  |  |  | //                throw new CoolException("生成单据失败"); | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | //            if (!orderService.updateSettle(order.getId(), 2L, userId)) { | 
|---|
|  |  |  | //                throw new CoolException("修改单据状态失败"); | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //            // 生成入库通知档 | 
|---|
|  |  |  | //            for (DetlDto detlDto : detlDtos) { | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //                // 修改作业数量 ---------------------------------------- | 
|---|
|  |  |  | //                // 订单明细数量校验 | 
|---|
|  |  |  | //                OrderDetl orderDetl = orderDetlService.selectItem(order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getAnfme()); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //                if (detlDto.getAnfme() > orderDetl.getEnableQty()) { | 
|---|
|  |  |  | //                    throw new CoolException(orderDetl.getMatnr() + "入库数量不合法"); | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //                // 修改订单作业数量 | 
|---|
|  |  |  | //                if (!orderDetlService.increaseWorkQty(orderDetl, detlDto.getAnfme())) { | 
|---|
|  |  |  | //                    throw new CoolException("修改单据作业数量失败"); | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //                // 保存入库通知档 | 
|---|
|  |  |  | //                Mat mat = matService.selectByMatnr(detlDto.getMatnr()); | 
|---|
|  |  |  | //                if (Cools.isEmpty(mat)) { | 
|---|
|  |  |  | //                    throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //                WaitPakin waitPakin = new WaitPakin(); | 
|---|
|  |  |  | //                waitPakin.sync(mat); | 
|---|
|  |  |  | //                waitPakin.setOrderNo(orderNo); | 
|---|
|  |  |  | //                waitPakin.setBatch(detlDto.getBatch()); | 
|---|
|  |  |  | //                waitPakin.setZpallet(param.getBarcode());   // 托盘码 | 
|---|
|  |  |  | //                waitPakin.setIoStatus("N");     // 入出状态 | 
|---|
|  |  |  | //                waitPakin.setAnfme(detlDto.getAnfme());  // 数量 | 
|---|
|  |  |  | //                waitPakin.setStatus("Y");    // 状态 | 
|---|
|  |  |  | //                waitPakin.setAppeUser(userId); | 
|---|
|  |  |  | //                waitPakin.setAppeTime(now); | 
|---|
|  |  |  | //                waitPakin.setModiUser(userId); | 
|---|
|  |  |  | //                waitPakin.setModiTime(now); | 
|---|
|  |  |  | //                if (!waitPakinService.insert(waitPakin)) { | 
|---|
|  |  |  | //                    throw new CoolException("保存入库通知档失败"); | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //                // 修改打包数据状态 | 
|---|
|  |  |  | //                Pack pack = packService.selectByBarcode(detlDto.getOrderNo()); | 
|---|
|  |  |  | //                pack.setSettle(2L); | 
|---|
|  |  |  | //                pack.setUpdateTime(now); | 
|---|
|  |  |  | //                pack.setUpdateBy(userId); | 
|---|
|  |  |  | //                if (!packService.updateById(pack)) { | 
|---|
|  |  |  | //                    throw new CoolException("修改打包数据异常"); | 
|---|
|  |  |  | //                } | 
|---|
|  |  |  | //            } | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  | //    } | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public void pakoutByOrder(JSONObject param, Long userId) { | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | BasDevp sta = basDevpService.checkSiteStatus(staNo); | 
|---|
|  |  |  | //根据订单号生成出库任务工作档 | 
|---|
|  |  |  | List<OrderDetl> pg_no = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("pg_no",orderNo)); | 
|---|
|  |  |  | List<OrderDetl> pg_no = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("pg_no", orderNo)); | 
|---|
|  |  |  | Order order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no", pg_no.get(0).getOrderNo())); | 
|---|
|  |  |  | if (order.getSettle() != 1 && order.getSettle() != 2) { | 
|---|
|  |  |  | throw new CoolException("该订单已处理"); | 
|---|
|  |  |  | 
|---|
|  |  |  | Date now = new Date(); | 
|---|
|  |  |  | for (OrderDetl orderDetl : orderDetls) { | 
|---|
|  |  |  | //查询所有库位状态为F的库位信息 | 
|---|
|  |  |  | List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), null, null); | 
|---|
|  |  |  | List<LocDetl> locDetls = locDetlService.queryStock(orderDetl); | 
|---|
|  |  |  | if (locDetls.size() == 0) { | 
|---|
|  |  |  | throw new CoolException("库存中没有该物料"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | throw new CoolException(locDetl.getLocNo() + "库位不是在库状态"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public void adjustNew(MobileAdjustParam param, Boolean re, Long userId) { | 
|---|
|  |  |  | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", param.getBarcode())); | 
|---|
|  |  |  | if (Cools.isEmpty(wrkMast)) { | 
|---|
|  |  |  | throw new CoolException("托盘码:" + param.getBarcode() + " 无有效工作档"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<CombParam.CombMat> combMats = param.getCombMats(); | 
|---|
|  |  |  | String recordRecordLog = "托盘码" + param.getBarcode() + "盘点记录:"; | 
|---|
|  |  |  | AdjDetl adjDetl = new AdjDetl(); | 
|---|
|  |  |  | adjDetl.setAppeTime(new Date()); | 
|---|
|  |  |  | adjDetl.setAppeUser(userId); | 
|---|
|  |  |  | adjDetl.setModiTime(new Date()); | 
|---|
|  |  |  | adjDetl.setModiUser(userId); | 
|---|
|  |  |  | adjDetl.setLocNo(wrkMast.getSourceLocNo()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (CombParam.CombMat wrkDetl : combMats) { | 
|---|
|  |  |  | WrkDetl wrkDetlOld = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>() | 
|---|
|  |  |  | .eq("wrk_no", wrkMast.getWrkNo()) | 
|---|
|  |  |  | .eq("matnr", wrkDetl.getMatnr()) | 
|---|
|  |  |  | //                    .eq("batch",Cools.isEmpty(wrkDetl.getBatch())?"":wrkDetl.getBatch()) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | adjDetl.setMatnr(wrkDetl.getMatnr()); | 
|---|
|  |  |  | //            adjDetl.setBatch(wrkDetl.getBatch()); | 
|---|
|  |  |  | adjDetl.setAdjQty(wrkDetl.getAnfme()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (Cools.isEmpty(wrkDetlOld)) { | 
|---|
|  |  |  | WrkDetl detl = new WrkDetl(); | 
|---|
|  |  |  | detl.sync(wrkDetl); | 
|---|
|  |  |  | detl.setWrkNo(wrkMast.getWrkNo()); | 
|---|
|  |  |  | detl.setZpallet(wrkMast.getBarcode()); | 
|---|
|  |  |  | wrkDetlService.insert(detl); | 
|---|
|  |  |  | recordRecordLog = recordRecordLog + "\n" + "新增一条明细:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t数量:" + wrkDetl.getAnfme(); | 
|---|
|  |  |  | adjDetl.setOriQty(0.0); | 
|---|
|  |  |  | adjDetlService.insert(adjDetl); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } else if (wrkDetlOld.getAnfme() != wrkDetl.getAnfme()) { | 
|---|
|  |  |  | wrkDetlService.updateAnfme(wrkDetl.getAnfme() + wrkDetlOld.getAnfme(), wrkMast.getWrkNo(), wrkDetl.getMatnr(), wrkDetl.getBatch()); | 
|---|
|  |  |  | recordRecordLog = recordRecordLog + "\n" + "更新一条明细:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t原数量:" + wrkDetlOld.getAnfme() + "\t新数量:" + wrkDetl.getAnfme(); | 
|---|
|  |  |  | adjDetl.setOriQty(wrkDetlOld.getAnfme()); | 
|---|
|  |  |  | adjDetlService.insert(adjDetl); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } else if (wrkDetlOld.getAnfme() == wrkDetl.getAnfme()) { | 
|---|
|  |  |  | recordRecordLog = recordRecordLog + "\n" + "一条明细保持不变:" + "\t商品编号:" + wrkDetl.getMatnr() + "\t批号:" + wrkDetl.getBatch() + "\t数量:" + wrkDetlOld.getAnfme(); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | throw new CoolException("托盘码:" + param.getBarcode() + " 未知异常,请联系管理员"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | log.info(recordRecordLog); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void combToWms(WaitPakin waitPakin) { | 
|---|
|  |  |  | // 判断是否有相同条码的数据 | 
|---|
|  |  |  | //        if (waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). | 
|---|
|  |  |  | //                eq("zpallet", waitPakin.getBarcode()).eq("io_status", "N")) > 0) { | 
|---|
|  |  |  | //            throw new CoolException(waitPakin.getBarcode() + "数据正在进行入库"); | 
|---|
|  |  |  | //        } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (waitPakin.getBarcode().length() != 8) { | 
|---|
|  |  |  | throw new CoolException("条码长度不是8位===>>" + waitPakin.getBarcode()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", waitPakin.getBarcode())); | 
|---|
|  |  |  | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", waitPakin.getBarcode())); | 
|---|
|  |  |  | WrkMast wrkMast = wrkMastService.selectByBarcode(waitPakin.getBarcode()); | 
|---|
|  |  |  | int countwait = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", waitPakin.getBarcode())); | 
|---|
|  |  |  | if (countLoc > 0 || (countWrk > 0 && wrkMast.getWrkSts() != 15)) { | 
|---|
|  |  |  | throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + waitPakin.getBarcode()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Date now = new Date(); | 
|---|
|  |  |  | // 生成入库通知档 | 
|---|
|  |  |  | List<DetlDto> detlDtos = new ArrayList<>(); | 
|---|
|  |  |  | Mat byId = matService.selectById(waitPakin.getModiUser()); | 
|---|
|  |  |  | DetlDto detlDto = new DetlDto(byId.getMatnr(), waitPakin.getBatch(), waitPakin.getAnfme(), waitPakin.getProType(), waitPakin.getTemp2(), waitPakin.getOutOrderNo()); | 
|---|
|  |  |  | detlDto.setMemo(detlDto.getMemo()); | 
|---|
|  |  |  | if (DetlDto.has(detlDtos, detlDto)) { | 
|---|
|  |  |  | DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); | 
|---|
|  |  |  | assert one != null; | 
|---|
|  |  |  | one.setAnfme(one.getAnfme() + detlDto.getAnfme()); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | detlDtos.add(detlDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (DetlDto dto : detlDtos) { | 
|---|
|  |  |  | Mat mat = matService.selectByMatnr(dto.getMatnr()); | 
|---|
|  |  |  | if (Cools.isEmpty(mat)) { | 
|---|
|  |  |  | throw new CoolException(dto.getMatnr() + "商品档案不存在"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //校验当前物料与托盘绑定信息是否正确 | 
|---|
|  |  |  | MatBarcode mb = matBarcodeService.selectbyMatnr(dto.getMatnr()); | 
|---|
|  |  |  | if (mb != null){ | 
|---|
|  |  |  | if (!mb.getZpallet().equals(waitPakin.getBarcode())){ | 
|---|
|  |  |  | throw new CoolException(detlDto.getMatnr() + "该物料与其他托盘绑定,请先解绑"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | WaitPakin waitPakin1 = new WaitPakin(); | 
|---|
|  |  |  | waitPakin1.sync(mat); | 
|---|
|  |  |  | waitPakin1.setProType(dto.getProType()); | 
|---|
|  |  |  | waitPakin1.setTemp2(dto.getTemp2()); | 
|---|
|  |  |  | waitPakin1.setOutOrderNo(dto.getOutOrderNo()); | 
|---|
|  |  |  | waitPakin1.setBatch(dto.getBatch()); | 
|---|
|  |  |  | waitPakin1.setZpallet(waitPakin.getBarcode());   // 托盘码 | 
|---|
|  |  |  | waitPakin1.setIoStatus("N");     // 入出状态 | 
|---|
|  |  |  | waitPakin1.setAnfme(dto.getAnfme());  // 数量 | 
|---|
|  |  |  | waitPakin1.setStatus("Y");    // 状态 | 
|---|
|  |  |  | waitPakin1.setAppeUser(waitPakin.getAppeUser()); | 
|---|
|  |  |  | waitPakin1.setAppeTime(now); | 
|---|
|  |  |  | waitPakin1.setModiUser(waitPakin.getAppeUser()); | 
|---|
|  |  |  | waitPakin1.setModiTime(now); | 
|---|
|  |  |  | waitPakin1.setMemo(detlDto.getMemo()); | 
|---|
|  |  |  | if (!waitPakinService.insert(waitPakin1)) { | 
|---|
|  |  |  | throw new CoolException("保存入库通知档失败"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|