| | |
| | | public ReturnT<String> start(int staNo) { |
| | | try { |
| | | BasDevp basDevp = basDevpService.selectById(staNo); |
| | | if (!Cools.isEmpty(basDevp) && !Cools.isEmpty(basDevp.getBarcode()) && basDevp.getWrkNo()==9992){ //上传前工作号跟电控约定为9992(你可以自定义) |
| | | WaitPakin waitPakin = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("zpallet", basDevp.getBarcode())); |
| | | if (Cools.isEmpty(waitPakin)){ |
| | | if (Cools.isEmpty(basDevp) || Cools.isEmpty(basDevp.getBarcode()) || basDevp.getReportSign()!=1 |
| | | || basDevp.getBarcode().equals("")){ |
| | | return FAIL; |
| | | } |
| | | if (basDevp.getWrkNo()>9899 && basDevp.getWrkNo()<10000 && basDevp.getAutoing().equals("Y") |
| | | && basDevp.getLoading().equals("Y") && basDevp.getInEnable().equals("Y")){ //上传前工作号跟电控约定为9992(你可以自定义) |
| | | int zpalletCount = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", basDevp.getBarcode())); |
| | | if (zpalletCount==0){ |
| | | ReturnT<String> result = null; |
| | | result = postMesData(barcodeUploadpath,basDevp); |
| | | System.out.println(result); |
| | | if (result.getCode()==200){ |
| | | basDevp.setReportSign(2); |
| | | basDevpService.updateById(basDevp); |
| | | return SUCCESS; |
| | | }else { |
| | | log.error("条码上传中控失败"); |
| | |
| | | success = true; |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}"+erpUrl+erpPath, JSON.toJSONString(combParam), response); |
| | | throw new CoolException("上报erp系统失败"); |
| | | throw new CoolException("条码上传中控失败"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "上报erp系统", |
| | | "条码上传中控", |
| | | erpUrl + erpPath, |
| | | null, |
| | | erpUrl, |