| | |
| | | import com.core.common.R; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.OrderDetlPakout; |
| | | import com.zy.asrs.entity.OrderPakout; |
| | | import com.zy.asrs.entity.param.OrderInspectionRollParam; |
| | | import com.zy.asrs.entity.param.OrderOutLocBoxCsUtilParam; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.LocMastServiceImpl; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.utils.CodeDetectionUtil; |
| | |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private LocMastServiceImpl locMastService; |
| | | |
| | | @Transactional |
| | | public ReturnT<String> abandoned(OrderPakout orderPakout) { |
| | |
| | | if (!CodeDetectionUtil.barcodeDetection(orderDetl.getManu(),7)){ |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("model", orderDetl.getModel())); |
| | | if (!Cools.isEmpty(locDetl)){ |
| | | LocMast locMast = locMastService.selectById(locDetl.getLocNo()); |
| | | if (Cools.isEmpty(locMast) || !locMast.getLocSts().equals("F")){ |
| | | if (Cools.isEmpty(memo)){ |
| | | memo = "卷号"+ orderDetl.getModel()+"所在库位"+locDetl.getLocNo()+"不是在库状态"; |
| | | }else { |
| | | memo = memo+";卷号"+ orderDetl.getModel()+"所在库位"+locDetl.getLocNo()+"不是在库状态"; |
| | | } |
| | | continue; |
| | | } |
| | | signD = false; |
| | | orderDetl.sync(locDetl); |
| | | orderDetl.setManu(locDetl.getLocNo()); |
| | |
| | | orderDetlPakoutService.updateById(orderDetl); |
| | | continue; |
| | | } |
| | | |
| | | } else { |
| | | if (Cools.isEmpty(memo)){ |
| | | memo = "无库存"; |
| | | memo = "卷号"+ orderDetl.getModel()+"无库存"; |
| | | }else { |
| | | memo = memo+";无库存"; |
| | | memo = memo+";卷号"+ orderDetl.getModel()+"无库存"; |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | if (signD){ |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("model", orderDetl.getModel())); |
| | | if (!Cools.isEmpty(locDetl)){ |
| | | LocMast locMast = locMastService.selectById(locDetl.getLocNo()); |
| | | if (Cools.isEmpty(locMast) || !locMast.getLocSts().equals("F")){ |
| | | if (Cools.isEmpty(memo)){ |
| | | memo = "卷号"+ orderDetl.getModel()+"所在库位"+locDetl.getLocNo()+"不是在库状态"; |
| | | }else { |
| | | memo = memo+";卷号"+ orderDetl.getModel()+"所在库位"+locDetl.getLocNo()+"不是在库状态"; |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(orderDetl.getDanger$()) && orderDetl.getDanger()==1){//合格不需要检验 |
| | | continue; |
| | | } else { |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("model", orderDetl.getModel())); |
| | | if (!Cools.isEmpty(locDetl.getDanger$()) && locDetl.getDanger()==1){ |
| | | orderDetl.setDanger(1); |
| | | orderDetlPakoutService.updateById(orderDetl); |
| | | continue; |
| | | } |
| | | |
| | | } |
| | | } |
| | | OrderInspectionRollParam orderInspectionRollParam = new OrderInspectionRollParam(orderDetl.getModel()); |
| | |
| | | orderDetlPakoutService.updateById(orderDetl); |
| | | } else if (!Cools.isEmpty(orderDetl.getDanger$()) && value.equals(orderDetl.getDanger$())){ |
| | | if (Cools.isEmpty(memo)){ |
| | | memo = "查询卷号结果:"+jsonObject.getString("message"); |
| | | memo = "卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | }else { |
| | | memo = memo+";查询卷号结果:"+jsonObject.getString("message"); |
| | | memo = memo+";卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | } |
| | | continue; |
| | | } else { |
| | | if (Cools.isEmpty(memo)){ |
| | | memo = "查询卷号结果:"+jsonObject.getString("message"); |
| | | memo = "卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | }else { |
| | | memo = memo+";查询卷号结果:"+jsonObject.getString("message"); |
| | | memo = memo+";卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | } |
| | | if (value.equals("不合格")){ |
| | | orderDetl.setDanger(2); |
| | |
| | | } |
| | | } else { |
| | | if (Cools.isEmpty(memo)){ |
| | | memo = "查询卷号结果:"+jsonObject.getString("message"); |
| | | memo = "卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | }else { |
| | | memo = memo+";查询卷号结果:"+jsonObject.getString("message"); |
| | | memo = memo+";卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | } |
| | | } |
| | | success = true; |
| | | } else { |
| | | if (Cools.isEmpty(memo)){ |
| | | memo = "查询卷号结果:"+jsonObject.getString("message"); |
| | | memo = "卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | }else { |
| | | memo = memo+";查询卷号结果:"+jsonObject.getString("message"); |
| | | memo = memo+";卷号"+ orderDetl.getModel()+"查询结果:"+jsonObject.getString("message"); |
| | | } |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PAKIN_URL, JSON.toJSONString(orderInspectionRollParam), response); |
| | | // throw new CoolException("查询卷号是否合格失败"); |
| | | } |
| | | } catch (Exception e) { |
| | | if (Cools.isEmpty(memo)){ |
| | | memo = "查询卷号结果:"+"异常"+e.getMessage(); |
| | | memo = "卷号"+ orderDetl.getModel()+"查询结果:"+"异常"+e.getMessage(); |
| | | }else { |
| | | memo = memo+";查询卷号结果:"+"异常"+e.getMessage(); |
| | | memo = memo+"卷号"+ orderDetl.getModel()+"查询结果:"+"异常"+e.getMessage(); |
| | | } |
| | | log.error("fail", e); |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |