| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public synchronized R generateTasks(PdaGeneralParam param, Long loginUserId) { |
| | | |
| | | // DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>().eq(DeviceSite::getSite,param.getTransferStationNo()).orderByDesc(DeviceSite::getId),false); |
| | | // DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>().eq(DeviceSite::getSite,param.getTransferStationNo()).orderByDesc(DeviceSite::getId) |
| | | // .last("LIMIT 1")); |
| | | // if (Objects.isNull(deviceSite)) { |
| | | // throw new CoolException("站点不存在!!"); |
| | | // } |
| | |
| | | if (StringUtils.isBlank(ruleCode)) { |
| | | throw new CoolException("编码错误:请确认编码「SYS_TASK_CODE」是否已生成!!"); |
| | | } |
| | | BasStation stationCode = basStationService.getById(deviceSite.getDeviceCode()); |
| | | String stationName = stationCode.getStationName(); |
| | | if (Cools.isEmpty(stationCode)) { |
| | | stationName = station.getStationName(); |
| | | } |
| | | Task task = new Task(); |
| | | task.setTaskCode(ruleCode) |
| | | .setTaskStatus(TaskStsType.GENERATE_IN.id) |
| | |
| | | .setTargLoc(targetLoc) |
| | | .setOrgSite(station.getStationName()) |
| | | .setBarcode(param.getContainerNo()) |
| | | .setTargSite(deviceSite.getDeviceCode()) |
| | | .setTargSite(stationName) |
| | | .setCreateBy(loginUserId) |
| | | .setUpdateBy(loginUserId); |
| | | if (!taskService.save(task)) { |