|  |  | 
 |  |  | package com.zy.asrs.service.impl; | 
 |  |  |  | 
 |  |  | import com.baomidou.mybatisplus.mapper.EntityWrapper; | 
 |  |  | import com.baomidou.mybatisplus.mapper.Wrapper; | 
 |  |  | import com.core.common.Cools; | 
 |  |  | import com.core.common.DateUtils; | 
 |  |  | import com.core.common.R; | 
 |  |  | import com.core.common.SnowflakeIdWorker; | 
 |  |  | import com.core.exception.CoolException; | 
 |  |  | import com.zy.asrs.entity.*; | 
 |  |  | 
 |  |  | import com.zy.asrs.entity.result.StockVo; | 
 |  |  | import com.zy.asrs.mapper.TagMapper; | 
 |  |  | import com.zy.asrs.service.*; | 
 |  |  | import com.zy.asrs.task.core.ReturnT; | 
 |  |  | import com.zy.asrs.utils.MatUtils; | 
 |  |  | import com.zy.asrs.utils.PostMesDataUtils; | 
 |  |  | import com.zy.common.model.DetlDto; | 
 |  |  | import com.zy.common.model.LocTypeDto; | 
 |  |  | import com.zy.common.model.StartupDto; | 
 |  |  | import com.zy.common.model.enums.WorkNoType; | 
 |  |  | import com.zy.common.service.CommonService; | 
 |  |  | import com.zy.common.utils.NodeUtils; | 
 |  |  | import com.zy.common.web.WcsController; | 
 |  |  | import com.zy.common.web.param.SearchLocParam; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.stereotype.Service; | 
 |  |  | 
 |  |  |     private WaitPakinService waitPakinService; | 
 |  |  |     @Autowired | 
 |  |  |     private CommonService commonService; | 
 |  |  |     @Autowired | 
 |  |  |     private LocDetlRullUpDetailService locDetlRullUpDetailService; | 
 |  |  |     @Autowired | 
 |  |  |     private WrkDetlSingleService wrkDetlSingleService; | 
 |  |  |     @Autowired | 
 |  |  |     private WrkMastStaService wrkMastStaService; | 
 |  |  |     @Autowired | 
 |  |  |     private WrkMastStaLogService wrkMastStaLogService; | 
 |  |  |     @Autowired | 
 |  |  |     private StaDescService staDescService; | 
 |  |  |     @Autowired | 
 |  |  |     private LocMastService locMastService; | 
 |  |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional | 
 |  |  | 
 |  |  |         LabellerMatParam labellerMatParam = new LabellerMatParam(); | 
 |  |  |         labellerMatParam.setDevNo(param.getDevNo()); | 
 |  |  |         labellerMatParam.setLabNo(param.getLabNo()); | 
 |  |  |         labellerMatParam.setWrkNo(basDevp.getWrkNo().toString()); | 
 |  |  | //        ArrayList<LabellerMatParam.CombMat> combMats = new ArrayList<>(); | 
 |  |  |         ArrayList<LabellerMatParam.BoxNo> boxNos = new ArrayList<>(); | 
 |  |  | //        String orderNo = ""; | 
 |  |  | 
 |  |  |  | 
 |  |  | //        labellerMatParam.setCombMats(combMats); | 
 |  |  | //        labellerMatParam.setLabellingTime(DateUtils.convert(new Date())); | 
 |  |  |         labellerMatParam.setWrkNo(basDevp.getWrkNo().toString()); | 
 |  |  | //        labellerMatParam.setLabTemplate("1"); | 
 |  |  | //        labellerMatParam.setOrderNo(orderNo); | 
 |  |  |         wrkMast.setWrkSts(53L); | 
 |  |  | 
 |  |  |  | 
 |  |  |         if (param.getLabResult().equals("OK")){ | 
 |  |  |             wrkMast.setWrkSts(54L); | 
 |  |  |             wrkMast.setStaNo(144); | 
 |  |  |             if (!wrkMastService.updateById(wrkMast)){ | 
 |  |  |                 throw new CoolException("异常,请重新申请"); | 
 |  |  |             } | 
 |  |  |         }else if (param.getLabResult().equals("NG")){ | 
 |  |  |             wrkMast.setWrkSts(52L); | 
 |  |  |             wrkMast.setWrkSts(52L);//重新贴标 | 
 |  |  |             if (!wrkMastService.updateById(wrkMast)){ | 
 |  |  |                 throw new CoolException("异常,请重新申请"); | 
 |  |  |             } | 
 |  |  | 
 |  |  |      * */ | 
 |  |  |     @Override | 
 |  |  |     @Transactional | 
 |  |  |     public void palletizingComplete(PalletizingCompleteParam param) { | 
 |  |  |     public void PalletizingCompleteTwoFloorParam(PalletizingCompleteTwoFloorParam param) { | 
 |  |  |         Long userId = 7777L;//中控 | 
 |  |  |         //判断param参数 | 
 |  |  |         if (Cools.isEmpty(param.getBarcode())){ | 
 |  |  | 
 |  |  |             throw new CoolException("参数:码垛位编号 palletizingNo为空"); | 
 |  |  |         }else if (Cools.isEmpty(param.getBoxType())){ | 
 |  |  |             throw new CoolException("参数:木箱类型 boxType为空"); | 
 |  |  |         }else if (Cools.isEmpty(param.getMatLists()) || param.getMatLists().size()==0){ | 
 |  |  |         }else if (Cools.isEmpty(param.getMatList()) || param.getMatList().size()==0){ | 
 |  |  |             throw new CoolException("参数:物料明细 matLists为空"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         ArrayList<String> positions = new ArrayList<>();   //木箱位置查重      (orgin) | 
 |  |  |         String matnrOne = "";//木箱相同位置 规格 matnr校验  1、左 | 
 |  |  |         String matnrTwo = "";//木箱相同位置 规格 matnr校验  2、右 | 
 |  |  |         ArrayList<String> boxNos = new ArrayList<>();   //木箱唯一编码查重  (batch) | 
 |  |  |         //判断matLists参数 | 
 |  |  |         for (PalletizingCompleteParam.MatList matList:param.getMatLists()){ | 
 |  |  |         for (PalletizingCompleteTwoFloorParam.MatList matList:param.getMatList()){ | 
 |  |  |             if (Cools.isEmpty(matList.getMatnr())){ | 
 |  |  |                 throw new CoolException("参数:物料编码 matnr为空"); | 
 |  |  |                 throw new CoolException("参数:规格 matnr为空"); | 
 |  |  |             }else if (Cools.isEmpty(matList.getPosition())){ | 
 |  |  |                 throw new CoolException("物料编码:"+matList.getMatnr()+"、参数:码垛位置 position为空"); | 
 |  |  |             }else if (Cools.isEmpty(matList.getBoxNo())){ | 
 |  |  |                 throw new CoolException("物料编码:"+matList.getMatnr()+"、参数:木箱编号 boxNo为空"); | 
 |  |  |             }else if (Cools.isEmpty(matList.getAnfme()) || matList.getAnfme().equals(0)){ | 
 |  |  |                 throw new CoolException("物料编码:"+matList.getMatnr()+"、参数:木箱中铜箔数量 anfme为空"); | 
 |  |  |                 throw new CoolException("规格:"+matList.getMatnr()+"、参数:码垛位置 position为空"); | 
 |  |  |             }else if (Cools.isEmpty(matList.getBatch())){ | 
 |  |  |                 throw new CoolException("规格:"+matList.getMatnr()+"、参数:木箱编号 batch为空"); | 
 |  |  |             }else if (Cools.isEmpty(matList.getModel())){ | 
 |  |  |                 throw new CoolException("规格:"+matList.getMatnr()+"、参数:卷号 model为空"); | 
 |  |  |             }else if (Cools.isEmpty(matList.getBatch())){ | 
 |  |  |                 throw new CoolException("规格:"+matList.getMatnr()+"、参数:木箱编号 boxNo为空"); | 
 |  |  |             }else if (Cools.isEmpty(matList.getWeight()) || matList.getWeight().equals(0D)){ | 
 |  |  |                 throw new CoolException("物料编码:"+matList.getMatnr()+"、参数:重量 weight为空"); | 
 |  |  |                 throw new CoolException("规格:"+matList.getMatnr()+"、参数:净重 weight为空"); | 
 |  |  |             }else if (Cools.isEmpty(matList.getRoughWeight()) || matList.getRoughWeight().equals(0D)){ | 
 |  |  |                 throw new CoolException("规格:"+matList.getMatnr()+"、参数:毛重 roughWeight"); | 
 |  |  |             }else if (Cools.isEmpty(matList.getRollExtent()) || matList.getRollExtent().equals(0D)){ | 
 |  |  |                 throw new CoolException("规格:"+matList.getMatnr()+"、参数:卷长度 rollExtent"); | 
 |  |  |             } | 
 |  |  | //            else if (Cools.isEmpty(matList.getJoint()) || matList.getJoint()==0){ | 
 |  |  | //                throw new CoolException("规格:"+matList.getMatnr()+"、参数:接头数 joint"); | 
 |  |  | //            } | 
 |  |  |  | 
 |  |  |             if (matList.getPosition().equals("1")){//1、左  2、右 | 
 |  |  |                 if (!matnrOne.equals("")){ | 
 |  |  |                     if (!matnrOne.equals(matList.getMatnr())){ | 
 |  |  |                         throw new CoolException("木箱位置:"+matList.getPosition()+"存在不同规格卷信息"); | 
 |  |  |                     } | 
 |  |  |                 }else { | 
 |  |  |                     matnrOne=matList.getMatnr(); | 
 |  |  |                 } | 
 |  |  |             }else if (matList.getPosition().equals("2")){ | 
 |  |  |                 if (!matnrTwo.equals("")){ | 
 |  |  |                     if (!matnrTwo.equals(matList.getMatnr())){ | 
 |  |  |                         throw new CoolException("木箱位置:"+matList.getPosition()+"存在不同规格卷信息"); | 
 |  |  |                     } | 
 |  |  |                 }else { | 
 |  |  |                     matnrTwo=matList.getMatnr(); | 
 |  |  |                 } | 
 |  |  |             }else { | 
 |  |  |                 throw new CoolException("参数:木箱编号 boxNo:"+matList.getBatch()+",木箱位置错误:"+matList.getPosition()); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             if (!positions.contains(matList.getPosition())){ | 
 |  |  |                 positions.add(matList.getPosition()); | 
 |  |  |             if (!boxNos.contains(matList.getBatch())){ | 
 |  |  |                 boxNos.add(matList.getBatch()); | 
 |  |  |             }else { | 
 |  |  |                 throw new CoolException("参数:木箱编号 boxNo:"+matList.getBoxNo()+",木箱位置存在重复:"+matList.getPosition()); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             if (!boxNos.contains(matList.getBoxNo())){ | 
 |  |  |                 boxNos.add(matList.getBoxNo()); | 
 |  |  |             }else { | 
 |  |  |                 throw new CoolException("参数:木箱编号 boxNo:"+matList.getBoxNo()+",木箱编码存在重复"); | 
 |  |  |                 throw new CoolException("参数:木箱编号 boxNo:"+matList.getBatch()+",木箱编码存在重复"); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         Date now = new Date(); | 
 |  |  |         for (PalletizingCompleteParam.MatList matList:param.getMatLists()){ | 
 |  |  |         for (PalletizingCompleteTwoFloorParam.MatList matList:param.getMatList()){ | 
 |  |  |             Mat mat = matService.selectByMatnr(matList.getMatnr()); | 
 |  |  |             if (Cools.isEmpty(mat)) { | 
 |  |  |                 throw new CoolException(matList.getMatnr() + "商品档案不存在"); | 
 |  |  |                 mat = new Mat(); | 
 |  |  |                 mat.setMatnr(matList.getMatnr()); | 
 |  |  |                 mat.setMaktx(matList.getMatnr()); | 
 |  |  |                 mat.setTagId(tagService.getTop().getId()); | 
 |  |  |                 mat.setCreateBy(userId); | 
 |  |  |                 mat.setCreateTime(now); | 
 |  |  |                 mat.setUpdateBy(userId); | 
 |  |  |                 mat.setUpdateTime(now); | 
 |  |  |                 mat.setStatus(1); | 
 |  |  |                 if (!matService.insert(mat)) { | 
 |  |  |                     throw new CoolException("规格添加失败,请联系管理员"); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             WaitPakin waitPakin = new WaitPakin(); | 
 |  |  |             waitPakin.sync(mat); | 
 |  |  |             waitPakin.setModel(matList.getBatch());     //批次 | 
 |  |  |             waitPakin.setSpecs(matList.getSpecs());     //规格 | 
 |  |  |             waitPakin.setBatch(matList.getBoxNo());       //木箱编码 | 
 |  |  |             waitPakin.setBatch(matList.getBatch());       //木箱编码  //批次  唯一值  箱号 | 
 |  |  |             waitPakin.setModel(matList.getModel());       //卷号  唯一值 | 
 |  |  |             waitPakin.setBrand(param.getBoxType());     //木箱类型 | 
 |  |  |             waitPakin.setZpallet(param.getBarcode());   //托盘码 | 
 |  |  |             waitPakin.setOrigin(matList.getPosition()); //木箱在托盘上的位置 | 
 |  |  |             waitPakin.setWeight(matList.getWeight());  //净重 | 
 |  |  |             waitPakin.setVolume(matList.getRoughWeight());  //毛重 | 
 |  |  |             waitPakin.setPrice(matList.getRollExtent());   //长度 | 
 |  |  |             waitPakin.setSpecs(String.valueOf(matList.getJoint()));   //接头 | 
 |  |  |             waitPakin.setIoStatus("N");     // 入出状态 | 
 |  |  |             waitPakin.setAnfme(matList.getAnfme().doubleValue());  // 木箱中铜箔数量 | 
 |  |  |             waitPakin.setAnfme(matList.getAnfme());  // 数量 | 
 |  |  |             waitPakin.setStatus("Y");    // 状态 | 
 |  |  |             waitPakin.setAppeUser(userId); | 
 |  |  |             waitPakin.setAppeTime(now); | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /* | 
 |  |  |      * 松盛(1楼):码垛完成下发入库信息 | 
 |  |  |      * */ | 
 |  |  |     @Override | 
 |  |  |     @Transactional | 
 |  |  |     public void palletizingCompleteS(PalletizingCompleteParam param) { | 
 |  |  |         //判断param参数 | 
 |  |  |         if (Cools.isEmpty(param.getBarcode())){ | 
 |  |  |             throw new CoolException("参数:托盘码 barcode为空"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode()); | 
 |  |  |         if (Cools.isEmpty(wrkMast) || wrkMast.getWrkSts()!=2){ | 
 |  |  |             log.error("退库码垛完成,返回托盘码未查询到工作档案!"); | 
 |  |  |             throw new CoolException("参数:托盘码 barcode未查询到工作档案"); | 
 |  |  |         } | 
 |  |  |         wrkMast.setSheetNo("4"); | 
 |  |  |         wrkMastService.updateById(wrkMast); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /* | 
 |  |  |      *中控:出库完成月台相关 | 
 |  |  |      * */ | 
 |  |  |     @Override | 
 |  |  |     @Transactional | 
 |  |  |     public void balconyComplete(LabellerMatParam param) { | 
 |  |  |         if (Cools.isEmpty(param.getWrkNo())){ | 
 |  |  |             throw new CoolException("工作号为空!"); | 
 |  |  |         } | 
 |  |  |         WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", param.getWrkNo())); | 
 |  |  |         if (Cools.isEmpty(wrkMast)){ | 
 |  |  |             throw new CoolException("工作号为空!"); | 
 |  |  |         } | 
 |  |  |         wrkMast.setWrkSts(57L); | 
 |  |  |         wrkMastService.updateById(wrkMast); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /* | 
 |  |  |      * 桁架上位软件:单次拆垛完成通知 | 
 |  |  |      * */ | 
 |  |  |     @Override | 
 |  |  | 
 |  |  |     public void singleUnstackingComplete(SingleUnstackingCompleteParam param) { | 
 |  |  |         Long userId = 8888L;//桁架上位软件 | 
 |  |  |         //判断param参数 | 
 |  |  |         if (Cools.isEmpty(param.getBarcode())){ | 
 |  |  |             throw new CoolException("参数:托盘码 barcode为空"); | 
 |  |  |         }else if (Cools.isEmpty(param.getPalletizingNo())){ | 
 |  |  |         if (Cools.isEmpty(param.getPalletizingNo())){ | 
 |  |  |             throw new CoolException("参数:码垛位编号 palletizingNo为空"); | 
 |  |  |         }else if (Cools.isEmpty(param.getMatLists()) || param.getMatLists().size()==0){ | 
 |  |  |         }else if (Cools.isEmpty(param.getMatList()) || param.getMatList().size()==0){ | 
 |  |  |             throw new CoolException("参数:物料明细 matLists为空"); | 
 |  |  |         } | 
 |  |  |         WrkMast wrkMastMatrix = wrkMastService.selectByBarcode(param.getBarcode()); | 
 |  |  |         if (Cools.isEmpty(wrkMastMatrix)){ | 
 |  |  |             throw new CoolException("参数:托盘码查询工作档失败:"+param.getBarcode()); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNoUnstacking(wrkMastMatrix.getWrkNo()); | 
 |  |  |         ArrayList<WrkDetl> wrkDetlsNew = new ArrayList<>(); | 
 |  |  |         ArrayList<WrkDetlSingle> wrkDetlsOld = new ArrayList<>(); | 
 |  |  |         //判断matLists参数 | 
 |  |  |         for (SingleUnstackingCompleteParam.MatList matList:param.getMatLists()){ | 
 |  |  |         for (SingleUnstackingCompleteParam.MatList matList:param.getMatList()){ | 
 |  |  |             if (Cools.isEmpty(matList.getPosition())){ | 
 |  |  |                 throw new CoolException("参数:码垛位置 position为空"); | 
 |  |  |             }else if (Cools.isEmpty(matList.getBoxNo())){ | 
 |  |  |                 throw new CoolException("参数:木箱编号 boxNo为空"); | 
 |  |  |             } | 
 |  |  |             WrkDetlSingle wrkDetlSingleOne = wrkDetlSingleService.selectOne(new EntityWrapper<WrkDetlSingle>().eq("batch", matList.getBoxNo())); | 
 |  |  |             List<WrkDetlSingle> wrkDetlSingles = wrkDetlSingleService.selectList(new EntityWrapper<WrkDetlSingle>() | 
 |  |  |                     .eq("wrk_no", wrkDetlSingleOne.getWrkNo()).eq("io_time", wrkDetlSingleOne.getIoTime())); | 
 |  |  |             boolean sign=true; | 
 |  |  |             for (WrkDetl wrkDetl:wrkDetls){ | 
 |  |  |                 if (wrkDetl.getBatch().equals(matList.getBoxNo())){//木箱编码 | 
 |  |  |                     wrkDetl.setInspect(1); | 
 |  |  |                     wrkDetlService.update(wrkDetl,new EntityWrapper<WrkDetl>().eq("batch",wrkDetl.getBatch())); | 
 |  |  |                     wrkDetlsNew.add(wrkDetl); | 
 |  |  |                     sign=false; | 
 |  |  |                     break; | 
 |  |  |                 } | 
 |  |  |             for (WrkDetlSingle wrkDetlSingle:wrkDetlSingles){ | 
 |  |  |                 WrkDetl wrkDetl = new WrkDetl(); | 
 |  |  |                 wrkDetl.sync(wrkDetlSingle); | 
 |  |  |                 wrkDetlsNew.add(wrkDetl); | 
 |  |  |                 wrkDetlsOld.add(wrkDetlSingle); | 
 |  |  |                 sign=false; | 
 |  |  |                 break; | 
 |  |  |             } | 
 |  |  |             if (sign){ | 
 |  |  |                 throw new CoolException("参数:木箱编号 boxNo未查询到对应的工作明细!"); | 
 |  |  | 
 |  |  |         wrkMast.setIoTime(now); | 
 |  |  |         wrkMast.setWrkSts(51L); // 工作状态:生成入库ID | 
 |  |  |         wrkMast.setIoType(202); // 入出库状态:202.拆垛后出库 | 
 |  |  |         wrkMast.setIoPri(13D); // 优先级 | 
 |  |  |         wrkMast.setIoPri(99D); // 优先级 | 
 |  |  |         wrkMast.setSourceStaNo(param.getDevNo$()); | 
 |  |  |         wrkMast.setStaNo(140); //贴标站点 | 
 |  |  |         wrkMast.setStaNo(144); //贴标站点  直接到尾端 | 
 |  |  |         // 操作人员数据 | 
 |  |  |         wrkMast.setAppeUser(userId); | 
 |  |  |         wrkMast.setAppeTime(now); | 
 |  |  | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         for (WrkDetlSingle wrkDetlSingle : wrkDetlsOld) { | 
 |  |  |             wrkDetlSingleService.delete(new EntityWrapper<WrkDetlSingle>() | 
 |  |  |                     .eq("batch",wrkDetlSingle.getBatch()) | 
 |  |  |                     .eq("wrk_no",wrkDetlSingle.getWrkNo()) | 
 |  |  |                     .eq("io_time",wrkDetlSingle.getIoTime())); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /* | 
 |  |  | 
 |  |  |     @Override | 
 |  |  |     @Transactional | 
 |  |  |     public void singleMountUnstackingComplete(SingleMountUnstackingCompleteParam param) { | 
 |  |  |         Long userId = 8888L;//桁架上位软件 | 
 |  |  | //        Long userId = 8888L;//桁架上位软件 | 
 |  |  |         //判断param参数 | 
 |  |  |         if (Cools.isEmpty(param.getBarcode())){ | 
 |  |  |             throw new CoolException("参数:托盘码 barcode为空"); | 
 |  |  |         }else if (Cools.isEmpty(param.getPalletizingNo())){ | 
 |  |  |             throw new CoolException("参数:码垛位编号 palletizingNo为空"); | 
 |  |  |         } | 
 |  |  |         WrkMast wrkMastMatrix = wrkMastService.selectByBarcode(param.getBarcode()); | 
 |  |  |         if (Cools.isEmpty(wrkMastMatrix)){ | 
 |  |  |             throw new CoolException("参数:托盘码查询工作档失败:"+param.getBarcode()); | 
 |  |  |         }else { | 
 |  |  |             if (!wrkMastMatrix.getIoType().equals(101)){ | 
 |  |  |                 List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNoUnstacking(wrkMastMatrix.getWrkNo()); | 
 |  |  |                 if (Cools.isEmpty(param.getMatLists()) || param.getMatLists().size()==0 || param.getMatLists().size()!=wrkDetls.size()){ | 
 |  |  |                     throw new CoolException("返回物料明细数为"+param.getMatLists().size()+",托盘码:"+param.getBarcode()+"应剩余物料数:"+wrkDetls.size()); | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 ArrayList<String> orgin = new ArrayList<>(); | 
 |  |  |                 //判断matLists参数 | 
 |  |  |                 for (SingleMountUnstackingCompleteParam.MatList matList : param.getMatLists()){ | 
 |  |  |                     if (Cools.isEmpty(matList.getPosition())){ | 
 |  |  |                         throw new CoolException("参数:码垛位置 position为空"); | 
 |  |  |                     }else if (Cools.isEmpty(matList.getBoxNo())){ | 
 |  |  |                         throw new CoolException("参数:木箱编号 boxNo为空"); | 
 |  |  |                     } | 
 |  |  |                     if (!orgin.contains(matList.getPosition())){ | 
 |  |  |                         orgin.add(matList.getPosition()); | 
 |  |  |                     }else { | 
 |  |  |                         throw new CoolException("参数:木箱编号 boxNo:"+matList.getBoxNo()+",木箱位置存在重复"); | 
 |  |  |                     } | 
 |  |  |                     boolean sign=true; | 
 |  |  |                     for (WrkDetl wrkDetl:wrkDetls){ | 
 |  |  |                         if (wrkDetl.getBatch().equals(matList.getBoxNo())){//木箱编码 | 
 |  |  |                             wrkDetl.setOrigin(matList.getPosition()); | 
 |  |  |                             wrkDetlService.update(wrkDetl,new EntityWrapper<WrkDetl>().eq("batch",wrkDetl.getBatch())); | 
 |  |  |                             sign=false; | 
 |  |  |                             break; | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                     if (sign){ | 
 |  |  |                         throw new CoolException("参数:木箱编号 boxNo:"+matList.getBoxNo()+"未查询到对应的工作明细!"); | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         wrkMastMatrix.setSheetNo("1"); | 
 |  |  |         wrkMastMatrix.setSheetNo("2"); | 
 |  |  |         if (!wrkMastService.updateById(wrkMastMatrix)){ | 
 |  |  |             throw new CoolException("更新工作档失败==》桁架上位软件:单托拆垛完成通知"); | 
 |  |  |         } | 
 |  |  | 
 |  |  |      * */ | 
 |  |  |     @Override | 
 |  |  |     @Transactional | 
 |  |  |     public void cs1(String barcode) { | 
 |  |  |         BasDevp basDevp = basDevpService.selectById(216); | 
 |  |  |         basDevp.setWrkNo(9992); | 
 |  |  |         basDevp.setBarcode(barcode); | 
 |  |  |         basDevpService.updateById(basDevp); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /* | 
 |  |  |      * | 
 |  |  |      * */ | 
 |  |  |     @Override | 
 |  |  |     @Transactional | 
 |  |  |     public void cs2() { | 
 |  |  |         BasDevp basDevp = basDevpService.selectById(216); | 
 |  |  |         basDevp.setWrkNo(0); | 
 |  |  |         basDevp.setBarcode(""); | 
 |  |  |         basDevpService.updateById(basDevp); | 
 |  |  | //        int[] staNos =new int[]{122}; | 
 |  |  | //        for (Integer staNo:staNos){ | 
 |  |  | //            int[] crnNos =new int[]{6}; | 
 |  |  | //            for (Integer crnNo:crnNos){ | 
 |  |  | //                descSta(staNo,crnNo); | 
 |  |  | //            } | 
 |  |  | //        } | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /* | 
 |  |  |      * | 
 |  |  |      * */ | 
 |  |  |     @Override | 
 |  |  |     @Transactional | 
 |  |  |     public void cs3() { | 
 |  |  |     private void descSta(Integer staNo,Integer crnNo){ | 
 |  |  | //        int[] typeNos =new int[]{1,10,53,101,103,110}; | 
 |  |  |         int[] typeNos =new int[]{10,110}; | 
 |  |  |         for (Integer typeNo:typeNos){ | 
 |  |  |             descSta3(staNo,crnNo,typeNo); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     private void descSta3(Integer staNo,Integer crnNo,Integer typeNo){ | 
 |  |  |         StaDesc staDesc = new StaDesc(); | 
 |  |  |         staDesc.setTypeNo(typeNo); | 
 |  |  |         staDesc.setStnNo(staNo); | 
 |  |  |         staDesc.setCrnNo(crnNo); | 
 |  |  |         staDesc.setCrnStn(CrnNoRC(crnNo,staDesc.getTypeNo()>100)); | 
 |  |  |         descSta2(staDesc); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     private void descSta2(StaDesc staDesc){ | 
 |  |  |         Date now = new Date(); | 
 |  |  |         //入库 | 
 |  |  |         int sameRes = staDescService.selectCount(new EntityWrapper<StaDesc>() | 
 |  |  |                 .eq("type_no", staDesc.getTypeNo()) | 
 |  |  |                 .eq("stn_no", staDesc.getStnNo()) | 
 |  |  |                 .eq("crn_no", staDesc.getCrnNo()) | 
 |  |  |                 .eq("crn_stn", staDesc.getCrnStn())); | 
 |  |  |         if (sameRes == 0) { | 
 |  |  |             staDesc.setModiUser(9527L); | 
 |  |  |             staDesc.setModiTime(now); | 
 |  |  |             staDesc.setAppeUser(9527L); | 
 |  |  |             staDesc.setAppeTime(now); | 
 |  |  |             staDescService.insert(staDesc); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     private Integer CrnNoRC(Integer crnNo,boolean sign){ | 
 |  |  |         Integer crnStn = 0; | 
 |  |  |         switch (crnNo){ | 
 |  |  |             case 1: | 
 |  |  |                 crnStn = 102; | 
 |  |  |                 break; | 
 |  |  |             case 2: | 
 |  |  |                 crnStn = 105; | 
 |  |  |                 break; | 
 |  |  |             case 3: | 
 |  |  |                 crnStn = 108; | 
 |  |  |                 break; | 
 |  |  |             case 4: | 
 |  |  |                 crnStn = 111; | 
 |  |  |                 break; | 
 |  |  |             case 5: | 
 |  |  |                 crnStn = 114; | 
 |  |  |                 break; | 
 |  |  |             case 6: | 
 |  |  |                 crnStn = 117; | 
 |  |  |                 break; | 
 |  |  |         } | 
 |  |  |         if (sign){ | 
 |  |  |             return crnStn-2; | 
 |  |  |         } | 
 |  |  |         return crnStn; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     /*...........................上饶江铜..............以上.............徐工汉云...........................*/ |