| | |
| | | private MatnrCodeService matnrCodeService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | |
| | | // WrkMast wrkMast = wrkMastMapper.selectPakOutStep1(slave.getId(), crnStn.getStaNo()); |
| | | List<WrkMast> wrkMasts = wrkMastMapper.selectPakOutStep11(slave.getId(), crnStn.getStaNo()); |
| | | // 获取工作状态为14的工作档 |
| | | WrkMast wrkMast1 = wrkMastMapper.selectPakOutStep14(slave.getId(), crnStn.getStaNo()); |
| | | if ( wrkMast1 !=null) { |
| | | continue; |
| | | } |
| | | // WrkMast wrkMast1 = wrkMastMapper.selectPakOutStep14(slave.getId(), crnStn.getStaNo()); |
| | | // if ( wrkMast1 !=null) { |
| | | // continue; |
| | | // } |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | if (wrkMast == null) { |
| | | continue; |
| | |
| | | short sta1 = 0; |
| | | short souSta2 = 0; |
| | | short sta2 = 0; |
| | | Integer matnr = 0; |
| | | Integer matnr2 = 0; |
| | | String matnr = "0"; |
| | | String matnr2 = "0"; |
| | | String batch = ""; |
| | | String batch2 = ""; |
| | | short type = 0; |
| | |
| | | if (inStn.getSourcePlcId() == 4 || inStn.getSourcePlcId() ==5){ //灌装站需要获取输送线物料代码 |
| | | matnr = staProtocol.getMatnr(); |
| | | batch = staProtocol.getBatch(); |
| | | anfme = Cools.isEmpty(staProtocol.getAnfme()) ? anfme:staProtocol.getAnfme().shortValue(); |
| | | anfme = (Cools.isEmpty(staProtocol.getAnfme()) || staProtocol.getAnfme()==0) ? anfme:staProtocol.getAnfme().shortValue(); |
| | | weight11 = staProtocol.getWeight1(); |
| | | weight = weight11; |
| | | String memoBool = staProtocol.isBan()? "存在":"不存在"; |
| | |
| | | if (inStn.getSourcePlcId() == 4){ |
| | | matnr2 = staProtocol.getMatnr(); |
| | | batch2 = staProtocol.getBatch(); |
| | | anfme2 = Cools.isEmpty(staProtocol.getAnfme2()) ? anfme2:staProtocol.getAnfme2().shortValue(); |
| | | anfme2 = (Cools.isEmpty(staProtocol.getAnfme2()) || staProtocol.getAnfme2()==0) ? anfme2:staProtocol.getAnfme2().shortValue(); |
| | | |
| | | weight11 = staProtocol.getWeight1(); |
| | | weight2 = weight11; |
| | | String memoBool = staProtocol.isBan()? "存在":"不存在"; |
| | |
| | | WaitPakin waitPakin = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("zpallet", barcode).eq("io_status", "N")); |
| | | if (Cools.isEmpty(waitPakin)) { |
| | | try { |
| | | CreateComb(barcode, staProtocol.getMatnr(),staProtocol.getWorkNo().intValue(),staProtocol.getBatch(),inSta); |
| | | CreateComb(barcode, staProtocol.getMatnr().toString(),staProtocol.getWorkNo().intValue(),staProtocol.getBatch(),inSta); |
| | | }catch (IOException e) { |
| | | throw new CoolException(e); |
| | | } |
| | |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | log.error(""+e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | public void CreateComb(String barcode,Integer code,Integer wrkNo,String batch,DevpSlave.Sta inSta) throws IOException { |
| | | public void CreateComb(String barcode,String code,Integer wrkNo,String batch,DevpSlave.Sta inSta) throws IOException { |
| | | Double anfme = 0d; |
| | | Double weight = 0d; |
| | | String memo = ""; |
| | |
| | | if (Cools.isEmpty(wrkMastSta)){ |
| | | wrkMastSta = wrkMastStaService.selectOne(new EntityWrapper<WrkMastSta>().eq("wrk_no2", wrkNo)); |
| | | if (Cools.isEmpty(wrkMastSta)){ |
| | | if (code >0 && !Cools.isEmpty(batch)){ |
| | | if (!Cools.isEmpty(batch)){ |
| | | anfme = 1d; |
| | | }else { |
| | | throw new CoolException("未找到对应的任务信息"); |
| | |
| | | weight = wrkMastSta.getWeight(); |
| | | memo = wrkMastSta.getMemo(); |
| | | } |
| | | MatnrCode matnrCode = matnrCodeService.selectByCode(code); |
| | | if (Cools.isEmpty(matnrCode)){ |
| | | //// |
| | | // MatnrCode matnrCode = matnrCodeService.selectByCode(code); |
| | | Mat mat = matService.selectByCode(code); |
| | | if (Cools.isEmpty(mat)){ |
| | | throw new CoolException("未找到对应的物料信息"); |
| | | } |
| | | CombParam combParam = new CombParam(); |
| | | ArrayList<CombParam.CombMat> combMats = new ArrayList<>(); |
| | | CombParam.CombMat combMat = new CombParam.CombMat(); |
| | | combParam.setBarcode(barcode); |
| | | combMat.setMatnr(matnrCode.getMatnr()); |
| | | combMat.setMatnr(mat.getMatnr()); |
| | | combMat.setBatch(batch); |
| | | combMat.setAnfme(anfme); |
| | | combMat.setWeight(weight); |