| | |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | |
| | | private String errorMsgOrderLoc = ""; |
| | | private String orderOneNo = null; |
| | | private String cstmrName = null; |
| | | private String danger = null; |
| | | private Long userId; |
| | | private String remoteAddr; |
| | | private boolean sign = true; |
| | |
| | | @Override |
| | | public void invoke(OutLocBoxExcel excel, AnalysisContext ctx) { |
| | | String batch = excel.getBatch(); |
| | | String orderNo = excel.getOrderNo(); |
| | | // String orderNo = excel.getOrderNo(); |
| | | // String cstmrName = excel.getCstmrName(); |
| | | String memo = excel.getMemo(); |
| | | if (Cools.isEmpty(orderOneNo)){ |
| | |
| | | throw new CoolException("客户名称参数为空"); |
| | | } |
| | | } |
| | | String[] s=new String[4]; |
| | | if (Cools.isEmpty(danger)){ |
| | | if (!Cools.isEmpty(excel.getDanger())){ |
| | | danger = excel.getDanger(); |
| | | } else { |
| | | // throw new CoolException("待判参数为空"); |
| | | } |
| | | } |
| | | if (Cools.isEmpty(danger)){ |
| | | danger = "合格"; |
| | | } |
| | | String[] s=new String[5]; |
| | | s[0] = batch; |
| | | s[1] = orderOneNo; |
| | | s[2] = cstmrName; |
| | | s[3] = memo; |
| | | s[4] = danger; |
| | | OutLocBoxCs.add(s); |
| | | total++; |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext ctx) { |
| | | if (!Cools.isEmpty(OutLocBoxCs) && OutLocBoxCs.size() != 0) { |
| | | if (!Cools.isEmpty(OutLocBoxCs) && !OutLocBoxCs.isEmpty()) { |
| | | LocDetlService locDetlService = SpringUtils.getBean(LocDetlService.class); |
| | | LocMastService locMastService = SpringUtils.getBean(LocMastService.class); |
| | | SlaveProperties slaveProperties = SpringUtils.getBean(SlaveProperties.class); |
| | |
| | | if (Cools.isEmpty(locDetlSou)){ |
| | | sign = false; |
| | | errorMsgOrderLoc = errorMsgOrderLoc + "[===》" +"箱号:"+outLocBoxC[0]+" 未查询到数据!!!《===]"; |
| | | continue; |
| | | // throw new CoolException("箱号:"+outLocBoxC[0]+" 未查询到数据!!!"); |
| | | } |
| | | if (!locDetlSou.getDanger$().equals(outLocBoxC[4])){ |
| | | sign = false; |
| | | errorMsgOrderLoc = errorMsgOrderLoc + "[===》" +"箱号:"+outLocBoxC[0]+" ==》出库输入待判状态:"+outLocBoxC[4]+"、库存状态:"+locDetlSou.getDanger$()+"。状态不匹配《===]"; |
| | | continue; |
| | | // throw new CoolException("箱号:"+outLocBoxC[0]+" 未查询到数据!!!"); |
| | | } |
| | |
| | | .eq("loc_no", locDetlSou.getLocNo()).eq("origin", locDetlSou.getOrigin())); |
| | | for (LocDetl locDetl:locDetls){ |
| | | total++; |
| | | String[] locDetlNow=new String[4]; |
| | | String[] locDetlNow=new String[5]; |
| | | locDetlNow[0] = locDetl.getBatch(); |
| | | locDetlNow[1] = outLocBoxC[1]; |
| | | locDetlNow[2] = outLocBoxC[2]; |
| | | locDetlNow[3] = outLocBoxC[3]; |
| | | locDetlNow[4] = outLocBoxC[4]; |
| | | outLocBoxCList.add(locDetlNow); |
| | | outLocBoxCNew.add(outLocBoxC[0]); |
| | | } |
| | |
| | | // locDetl.getBatch(),locDetl.getBrand(),locDetl.getBarcode(), outLocBoxC[1],locDetl.getAnfme()); |
| | | // locDto.setOrigin(locDetl.getOrigin()); |
| | | // locDto.setWeight(locDetl.getWeight()); |
| | | locDetl.setMemo(outLocBoxC[3]); |
| | | |
| | | if (!Cools.isEmpty(outLocBoxC[3])){ |
| | | String memo = Cools.isEmpty(locDetl.getMemo())? "" : locDetl.getMemo()+","; |
| | | locDetl.setMemo(memo + DateUtils.convert(new Date(), DateUtils.yyyyMMdd_C)+"手动输入备注:" + outLocBoxC[3]); |
| | | } else if (Cools.isEmpty(locDetl.getMemo())){ |
| | | locDetl.setMemo(outLocBoxC[3]); |
| | | } |
| | | LocDto locDto = new LocDto(locDetl); |
| | | locDtos.add(locDto); |
| | | } |
| | |
| | | locDetl.setOrigin(locDto.getOrigin()); |
| | | locDetl.setWeight(locDto.getWeight()); |
| | | locDetl.setMemo(locDto.getMemo()); |
| | | locDetl.setDanger(locDto.getDanger()); |
| | | |
| | | locDetls.add(locDetl); |
| | | } |