| | |
| | | import com.zy.acs.conveyor.core.properties.SlaveProperties; |
| | | import com.zy.acs.conveyor.core.service.StationService; |
| | | import com.zy.acs.conveyor.entity.Job; |
| | | import com.zy.acs.conveyor.enums.WorkNoTypeType; |
| | | import com.zy.acs.conveyor.service.JobService; |
| | | import com.zy.acs.conveyor.service.WmsMainService; |
| | | import com.zy.acs.conveyor.service.WrkLastnoService; |
| | |
| | | News.error("{}:站点:{},无物", config.getMark(), staProtocol.getSiteId()); |
| | | continue; |
| | | } |
| | | if (staProtocol.isWeightErr()) { |
| | | News.error("{}:站点:{},重量异常:{}", config.getMark(), staProtocol.getSiteId(), staProtocol.getWeight()); |
| | | continue; |
| | | } |
| | | if (staProtocol.isBarcodeErr()) { |
| | | News.error("{}:站点:{},条码异常:{}", config.getMark(), staProtocol.getSiteId(), staProtocol.getBarcode()); |
| | | continue; |
| | | } |
| | | if (staProtocol.isLoadErr()) { |
| | | News.error("{}:站点:{},入库时检测托盘上有无货物", config.getMark(), staProtocol.getSiteId()); |
| | | continue; |
| | | } |
| | | String barcode = staProtocol.getBarcode(); |
| | | if (Cools.isEmpty(barcode)) { |
| | | News.error("站点:{},未扫到码值:{}", staProtocol.getSiteId(), barcode); |
| | |
| | | continue; |
| | | } |
| | | |
| | | ApplyInRepsonseDto locOfWms = wmsMainService.getLocOfWms(applyIn(barcode, inSta.getStaNo() + "", staProtocol)); |
| | | ApplyInRepsonseDto locOfWms = wmsMainService.getLocOfWms(applyIn(job, barcode, inSta.getStaNo() + "", staProtocol)); |
| | | if (locOfWms != null) { |
| | | staProtocol.setWorkNo(staProtocol.getWorkNo()); |
| | | staProtocol.setStaNo(inSta.getTargetSta()); |
| | | redis.push(RedisConveyorConstant.CONVEYOR_TASK_FLAG, staProtocol); |
| | | job.setLoc(locOfWms.getLocNo()); |
| | | job.setStaNo(String.valueOf(inSta.getTargetSta()+1)); |
| | | job.setStaNo(String.valueOf(inSta.getTargetSta() + 1)); |
| | | job.setTaskNo(locOfWms.getTaskNo()); |
| | | job.setBatchNo(locOfWms.getBatchNo()); |
| | | job.setBarcode(barcode); |
| | |
| | | return job; |
| | | } |
| | | |
| | | private Integer getWorkNo() { |
| | | return wrkLastnoService.nextWorkNo(WorkNoTypeType.WORK_NO_TYPE.type); |
| | | } |
| | | |
| | | private ApplyInDto applyIn(String barcode, String staNo, StaProtocol staProtocol) { |
| | | private ApplyInDto applyIn(Job job, String barcode, String staNo, StaProtocol staProtocol) { |
| | | ApplyInDto applyInDto = new ApplyInDto(); |
| | | applyInDto.setStaNo(staNo); |
| | | applyInDto.setBarcode(barcode); |
| | | applyInDto.setFull(staProtocol.isFullPlt()); |
| | | applyInDto.setFull(Boolean.valueOf(job.getFull())); |
| | | applyInDto.setWeight(staProtocol.getWeight()); |
| | | return applyInDto; |
| | | } |