rsf-admin/src/page/basicInfo/deviceSite/DeviceSiteList.jsx
@@ -150,14 +150,14 @@ omit={['id', 'createTime', 'createBy', 'memo', 'label','name','target','statusBool','updateBy']} > <NumberField source="id" /> <TextField source="site$" label="table.field.deviceSite.site" /> <TextField source="site" label="table.field.deviceSite.site" /> <TextField source="name" label="table.field.deviceSite.name" /> <NumberField source="type$" label="table.field.deviceSite.type" /> <TextField source="target" label="table.field.deviceSite.target" /> <TextField source="label" label="table.field.deviceSite.label" /> <TextField source="device$" label="table.field.deviceSite.device" /> <TextField source="channel" label="table.field.deviceSite.channel" /> <TextField source="deviceSite$" label="table.field.deviceSite.deviceSite" /> <TextField source="deviceSite" label="table.field.deviceSite.deviceSite" /> <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> <TextField source="nickname" /> </ReferenceField> rsf-open-api/src/main/java/com/vincent/rsf/openApi/controller/WmsRcsController.java
@@ -58,7 +58,7 @@ * @description: 任务回调,状态回写 * @version 1.0 */ @ApiOperation("异常任务回调") @ApiOperation("状态上报回调") @PostMapping("/callback/event") public R callBackEvent(@RequestBody ExMsgCallbackParams params) { return wmsRcsService.callBackEvent(params); rsf-open-api/src/main/java/com/vincent/rsf/openApi/service/impl/WmsRcsServiceImpl.java
@@ -115,7 +115,7 @@ ResponseEntity<String> exchange = restTemplate.exchange(callUrl, HttpMethod.POST, httpEntity, String.class); log.info("任务执行状态上报,响应结果: {}", exchange); if (Objects.isNull(exchange.getBody())) { throw new CoolException("任务执行状态上报失败!!"); return R.error(); } else { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.coercionConfigDefaults() @@ -125,7 +125,8 @@ if (result.getCode() == 200) { return R.ok(); } else { throw new CoolException("任务执行状态上报失败!!"); return R.error(result.getMsg()); // throw new CoolException("任务执行状态上报失败!!"); } } catch (JsonProcessingException e) { throw new CoolException(e.getMessage()); rsf-open-api/src/main/resources/application-dev.yml
@@ -58,11 +58,11 @@ #RCS链接 rcs: #链接 host: http://10.10.10.247 host: http://10.10.10.200 #端口 port: 8088 wms: #链接 host: http://127.0.0.1 host: http://10.10.10.157 #端口 port: 8080 rsf-server/src/main/java/com/vincent/rsf/server/api/entity/dto/InTaskMsgDto.java
@@ -6,7 +6,7 @@ public class InTaskMsgDto { private String sourceStaNo; private Integer staNo; private String staNo; private Integer deviceNo; rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/WcsServiceImpl.java
@@ -45,6 +45,7 @@ import java.util.List; import java.util.Objects; import java.util.Random; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -422,8 +423,13 @@ if (dtos.isEmpty()) { scheduled.shutdown(); } dtos.forEach(dto -> { for (SyncLocsDto dto : dtos) { Loc loc = new Loc(); String string = new Random().nextInt(10000000) + ""; Loc one = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, string)); if (!Objects.isNull(one)) { string = new Random().nextInt(10000000) + ""; } loc.setCode(dto.getLocNo()) .setBarcode(dto.getBarcode()) .setRow(dto.getRow()) @@ -431,6 +437,7 @@ .setId(null) .setAreaId(41L) .setWarehouseId(27L) .setBarcode(string) .setCol(dto.getBay()) .setType(dto.getLocType()) .setStatus(dto.getStatusBool()) @@ -439,7 +446,7 @@ scheduled.shutdown(); throw new CoolException("WCS库位同步失败!!"); } }); } current++; } }, 1, 1, TimeUnit.SECONDS); @@ -641,7 +648,7 @@ if (Cools.isEmpty(deviceSite)) { channel = 0; } else { inTaskMsgDto.setStaNo(Integer.parseInt(deviceSite.getDeviceSite())); inTaskMsgDto.setStaNo(deviceSite.getDeviceSite()); } //更新当前排 @@ -834,13 +841,13 @@ DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() .eq(DeviceSite::getType, ioType) .eq(DeviceSite::getSite, sourceStaNo) .eq(DeviceSite::getDeviceCode, loc.getDeviceNo()) .eq(!Objects.isNull(loc.getDeviceNo()), DeviceSite::getDeviceCode, loc.getDeviceNo()) ); if (Cools.isEmpty(deviceSite)) { deviceNo = 0; loc = null; } else { inTaskMsgDto.setStaNo(Integer.parseInt(deviceSite.getDeviceSite())); inTaskMsgDto.setStaNo(deviceSite.getDeviceSite()); } // 递归查询 if (Cools.isEmpty(loc) || !loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_O.type)) { rsf-server/src/main/java/com/vincent/rsf/server/api/utils/LocUtils.java
@@ -338,7 +338,7 @@ if (Cools.isEmpty(deviceSite)) { channel = 0; } else { inTaskMsgDto.setStaNo(Integer.parseInt(deviceSite.getDeviceSite())); inTaskMsgDto.setStaNo(deviceSite.getDeviceSite()); } //更新当前排 rsf-server/src/main/java/com/vincent/rsf/server/manager/constant/StaGroupConstant.java
@@ -5,50 +5,50 @@ public class StaGroupConstant { public static final ArrayList<String> FAR_LEFT_STA_ROW_LIST = new ArrayList<String>(){{ add("9-1"); add("9-2"); add("9-3"); add("10-1"); add("10-2"); add("10-3"); add("109-1"); add("109-2"); add("109-3"); add("110-1"); add("110-2"); add("110-3"); add("1001"); add("1007"); }}; public static final ArrayList<String> LEFT_STA_ROW_LIST = new ArrayList<String>(){{ add("7-1"); add("7-2"); add("7-3"); add("8-1"); add("8-2"); add("8-3"); add("107-1"); add("107-2"); add("107-3"); add("108-1"); add("108-2"); add("108-3"); }}; public static final ArrayList<String> MIDDLE_STA_ROW_LIST = new ArrayList<String>(){{ add("5-1"); add("5-2"); add("5-3"); add("6-1"); add("6-2"); add("6-3"); add("105-1"); add("105-2"); add("105-3"); add("106-1"); add("106-2"); add("106-3"); }}; public static final ArrayList<String> RIGHT_STA_ROW_LIST = new ArrayList<String>(){{ add("3-1"); add("3-2"); add("3-3"); add("4-1"); add("4-2"); add("4-3"); add("103-1"); add("103-2"); add("103-3"); add("104-1"); add("104-2"); add("104-3"); }}; public static final ArrayList<String> FAR_RIGHT_STA_ROW_LIST = new ArrayList<String>(){{ add("1-1"); add("1-2"); add("1-3"); add("2-1"); add("2-2"); add("2-3"); add("101-1"); add("101-2"); add("101-3"); add("101-1"); add("101-2"); add("101-3"); }}; } rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/DeviceSite.java
@@ -197,21 +197,21 @@ // ); public String getSite$() { if (this.site == null) {return null;} BasStationService service = SpringUtils.getBean(BasStationService.class); BasStation station = service.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, this.site)); if (Objects.isNull(station)) {return null;} return station.getStationName(); } public String getDeviceSite$() { if (this.deviceSite == null) {return null;} BasStationService service = SpringUtils.getBean(BasStationService.class); BasStation station = service.getById(this.deviceSite); if (Objects.isNull(station)) {return null;} return station.getStationName(); } // public String getSite$() { // if (this.site == null) {return null;} // BasStationService service = SpringUtils.getBean(BasStationService.class); // BasStation station = service.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, this.site)); // if (Objects.isNull(station)) {return null;} // return station.getStationName(); // } // // public String getDeviceSite$() { // if (this.deviceSite == null) {return null;} // BasStationService service = SpringUtils.getBean(BasStationService.class); // BasStation station = service.getById(this.deviceSite); // if (Objects.isNull(station)) {return null;} // return station.getStationName(); // } public String getType$(){ if (null == this.type){ return null; } rsf-server/src/main/java/com/vincent/rsf/server/manager/enums/LocStsType.java
@@ -43,7 +43,7 @@ */ public static String getLocSts(String val) { if (val.equals(RcsLocStsType.LOC_STS_TYPE_D.type)) { return LocStsType.LOC_STS_TYPE_D.type; return LocStsType.LOC_STS_TYPE_O.type; } else if (val.equals(RcsLocStsType.LOC_STS_TYPE_F.type)) { return LocStsType.LOC_STS_TYPE_F.type; } else if (val.equals(RcsLocStsType.LOC_STS_TYPE_S.type)) { rsf-server/src/main/java/com/vincent/rsf/server/manager/enums/RcsTaskType.java
@@ -6,7 +6,7 @@ //任务类型 RCS_TASK_TYPE_ENUM_TRANSFER("LOC_TO_LOC", "移库"), RCS_TASK_TYPE_ENUM_OUT("LOC_TO_STA", "出库"), RCS_TASK_TYPE_ENUM_IN("LOC_TO_LOC", "入库"), RCS_TASK_TYPE_ENUM_IN("STA_TO_LOC", "入库"), RCS_TASK_TYPE_ENUM_STA("STA_TO_STA", "站点间搬运"), ; rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/AutoRunSchedules.java
@@ -12,7 +12,7 @@ import com.vincent.rsf.server.manager.entity.*; import com.vincent.rsf.server.manager.enums.*; import com.vincent.rsf.server.manager.service.*; import com.vincent.rsf.server.manager.service.impl.DeviceSiteServiceImpl; import com.vincent.rsf.server.manager.service.impl.BasStationServiceImpl; import com.vincent.rsf.server.system.constant.SerialRuleCode; import com.vincent.rsf.server.system.service.ConfigService; import com.vincent.rsf.server.system.utils.SerialRuleUtils; @@ -52,43 +52,47 @@ @Autowired private DeviceSiteService deviceSiteService; /** * @author Ryan * @date 2025/9/1 * @description: 自动生成盘点跑库单 * @version 1.0 */ public void autoCheckOrders() { Boolean autoRunArea = configService.getVal("AUTO_RUN_CHECK_ORDERS", Boolean.class); if (!autoRunArea) { return; } //获取任务列表中,为盘点出库的任务 List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>() .in(Task::getTaskType, Arrays.asList(TaskType.TASK_TYPE_CHECK_OUT.type, TaskType.TASK_TYPE_CHECK_IN.type))); if (tasks.size() >= 10) { return; /** * 自动生成库位明细 */ @Transactional(rollbackFor = Exception.class) // @Scheduled(cron = "0/25 * * * * ?") public void insertRandomMats() { List<Loc> list = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type)); for (Loc loc : list) { List<LocItem> items = locItemService.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocId, loc.getId())); if (!items.isEmpty()) { continue; } List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type).last("limit 1")); locs.forEach(loc -> { List<LocItem> locItems = locItemService.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocId, loc.getId())); if (!locItems.isEmpty()) { DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>().eq(DeviceSite::getType, TaskType.TASK_TYPE_CHECK_OUT.type), false); //生成盘点任务参数 LocToTaskParams locToTaskParams = new LocToTaskParams(); locToTaskParams.setType(Constants.TASK_TYPE_OUT_CHECK) .setItems(locItems) .setSiteNo(deviceSite.getSite()) .setOrgLoc(loc.getCode()); try { locItemService.generateTask(TaskResouceType.TASK_RESOUCE_CHECK_TYPE.val, locToTaskParams, getLoginUserId()); } catch (Exception e) { throw new CoolException(e.getMessage()); List<Matnr> matnrs = matnrService.list(new LambdaQueryWrapper<Matnr>().orderByAsc(Matnr::getBarcode).last("limit 100")); Collections.shuffle(matnrs); Matnr matnr = matnrs.stream().findFirst().get(); LocItem locItem = new LocItem(); BeanUtils.copyProperties(matnr, locItem); locItem.setBarcode(loc.getBarcode()) .setLocId(loc.getId()) .setMatnrCode(matnr.getCode()) .setMaktx(matnr.getName()) .setMatnrId(matnr.getId()) .setId(null) .setAnfme(45.0) .setLocCode(loc.getCode()); locItemService.save(locItem); } } }); } // /** // * @author Ryan // * @date 2025/9/1 // * @description: 自动生成盘点跑库单 // * @version 1.0 // */ // @Scheduled(cron = "0/25 * * * * ?") // public void autoCheckOrders() { // // // } /** * @author Ryan @@ -96,6 +100,7 @@ * @description: 自动完成盘点功能 * @version 1.0 */ @Scheduled(cron = "0/35 * * * * ?") public void autoCheckComplete() { Boolean autoRunArea = configService.getVal("AUTO_RUN_CHECK_ORDERS", Boolean.class); if (!autoRunArea) { @@ -111,23 +116,37 @@ if (!tasks.isEmpty()) { tasks.forEach(task -> { if (task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) { if (task.getTaskStatus().equals(TaskStsType.GENERATE_IN.id)) { task.setTaskStatus(TaskStsType.COMPLETE_IN.id); if (!taskService.updateById(task)) { throw new CoolException("盘点再入库任务完成失败!!"); if (task.getTaskStatus().equals(TaskStsType.COMPLETE_IN.id)) { if (!stationService.update(new LambdaUpdateWrapper<BasStation>() .eq(BasStation::getStationName, task.getOrgSite()) .set(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_O.type))) { throw new CoolException("站点状态修改失败!!"); } } } else { //创建出库任务状态 if (task.getTaskStatus().equals(TaskStsType.GENERATE_OUT.id)) { task.setTaskStatus(TaskStsType.COMPLETE_OUT.id); if (!taskService.updateById(task)) { throw new CoolException("盘点出库任务完成失败!!"); // if (task.getTaskStatus().equals(TaskStsType.WCS_EXECUTE_OUT.id)) { // task.setTaskStatus(TaskStsType.COMPLETE_OUT.id); // if (!taskService.updateById(task)) { // throw new CoolException("盘点出库任务完成失败!!"); // } // //出库已完成,等待盘点中 // } else if (task.getTaskStatus().equals(TaskStsType.WAVE_SEED.id)) { if (!stationService.update(new LambdaUpdateWrapper<BasStation>() .eq(BasStation::getStationName, task.getOrgSite()) .set(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_F.type))) { throw new CoolException("站点状态修改失败!!"); } //出库已完成,等待盘点中 } else if (task.getTaskStatus().equals(TaskStsType.WAVE_SEED.id)) { try { taskService.pickOrCheckTask(task.getId(), Constants.TASK_TYPE_OUT_CHECK); if (!stationService.update(new LambdaUpdateWrapper<BasStation>() .eq(BasStation::getStationName, task.getOrgSite()) .set(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_R.type))) { throw new CoolException("站点状态修改失败!!"); } } catch (Exception e) { throw new CoolException(e.getMessage()); } @@ -138,7 +157,24 @@ } /** * @author Ryan * @date 2025/9/1 * @description: 自动完成盘点功能 * @version 1.0 */ @Scheduled(cron = "0/25 * * * * ?") public void genRun() { Boolean flagAuto = configService.getVal("AUTO_RUN_CHECK_ORDERS", Boolean.class); if (!flagAuto) { return; } //获取任务列表中,为盘点出库的任务 List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>() .in(Task::getTaskType, Arrays.asList(TaskType.TASK_TYPE_CHECK_OUT.type, TaskType.TASK_TYPE_CHECK_IN.type))); if (tasks.size() >= 6) { return; } String autoRunArea = configService.getVal("AUTO_RUN_AREA", String.class); if (Cools.isEmpty(autoRunArea)) { return; @@ -169,38 +205,79 @@ private void autoRun(List<Integer> locGroupList, List<String> staGroupList) { List<String> staPreNos = getStaPrefixes(staGroupList); String staTaskMemo = "DEMO_STA_" + String.join("-", staPreNos); log.error("=========>"); log.info(staTaskMemo); System.out.println(staTaskMemo); List<Task> list = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getMemo, staTaskMemo)); if (!Cools.isEmpty(list) && list.size() > 30) { if (!Cools.isEmpty(list) && list.size() >= 1) { return; } // 入库 应该根据工作档回去 this.runStaToLoc(locGroupList, staGroupList, staTaskMemo); // 出库,需要校验工作档是否存在,存在就说明站点处于忙碌状态 this.runLocToSta(locGroupList, staGroupList, staTaskMemo); // 移库 this.runLocToLoc(locGroupList, staTaskMemo); List<Loc> locs = getAreaLocs(locGroupList, staGroupList, staTaskMemo); for (Loc loc : locs) { List<LocItem> locItems = locItemService.list(new LambdaQueryWrapper<LocItem>().eq(LocItem::getLocId, loc.getId())); if (!locItems.isEmpty()) { locItems.forEach(locItem -> { locItem.setOutQty(locItem.getAnfme()); }); List<BasStation> stations = stationService.list(new LambdaQueryWrapper<BasStation>().eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_O.type)); if (Cools.isEmpty(stations)) { throw new CoolException("无可用站点!!"); } DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() .in(DeviceSite::getSite, stations) .eq(DeviceSite::getType, TaskType.TASK_TYPE_CHECK_OUT.type), false); if (Cools.isEmpty(deviceSite)) { throw new CoolException("无可用路径!!"); } //生成盘点任务参数 LocToTaskParams locToTaskParams = new LocToTaskParams(); locToTaskParams.setType(Constants.TASK_TYPE_OUT_CHECK) .setItems(locItems) .setSiteNo(deviceSite.getSite()) .setOrgLoc(loc.getCode()); List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getTargSite, deviceSite.getSite())); if (!tasks.isEmpty()) { continue; } try { //生成盘点出库任务,站点预约 if (!stationService.update(new LambdaUpdateWrapper<BasStation>() .eq(BasStation::getStationName, deviceSite.getSite()) .set(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_S.type))) { throw new CoolException("站点状态更新失败!!"); } locItemService.generateTask(TaskResouceType.TASK_RESOUCE_CHECK_TYPE.val, locToTaskParams, getLoginUserId()); } catch (Exception e) { throw new CoolException(e.getMessage()); } } } // 入库 private void runStaToLoc(List<Integer> locGroupList, List<String> staGroupList, String memo) { // 入库 应该根据工作档回去 // this.runStaToLoc(locGroupList, staGroupList, staTaskMemo); // // 出库,需要校验工作档是否存在,存在就说明站点处于忙碌状态 // this.runLocToSta(locGroupList, staGroupList, staTaskMemo); // // 移库 // this.runLocToLoc(locGroupList, staTaskMemo); } private List<Loc> getAreaLocs(List<Integer> locGroupList, List<String> staGroupList, String memo) { Integer startRow = Collections.min(locGroupList); Integer endRow = Collections.max(locGroupList); // STA IDLE LambdaQueryWrapper<BasStation> idleWrapper = new LambdaQueryWrapper<BasStation>().eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_F.type).in(BasStation::getStationName, staGroupList); List<BasStation> idleList = stationService.list(idleWrapper); if (Cools.isEmpty(idleList)) { return; } Collections.shuffle(idleList); // LambdaQueryWrapper<BasStation> idleWrapper = new LambdaQueryWrapper<BasStation>().eq(BasStation::getUseStatus, LocStsType.LOC_STS_TYPE_O.type).in(BasStation::getStationName, staGroupList); // List<BasStation> idleList = stationService.list(idleWrapper); // if (Cools.isEmpty(idleList)) { // return new ArrayList<>(); // } // Collections.shuffle(idleList); // LOC STOCK LambdaQueryWrapper<Loc> stockWrapper = new LambdaQueryWrapper<Loc>().eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type); LambdaQueryWrapper<Loc> stockWrapper = new LambdaQueryWrapper<Loc>().eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type); if (null != startRow) { stockWrapper.ge(Loc::getRow, startRow); } @@ -209,12 +286,13 @@ } List<Loc> stockList = locService.list(stockWrapper); if (Cools.isEmpty(stockList)) { return; return new ArrayList<>(); } Collections.shuffle(stockList); return stockList; //生成入库工作档 generateTask(idleList.get(0).getStationName(), stockList.get(0).getCode(), idleList.get(0).getBarcode()); // generateTask(idleList.get(0).getStationName(), stockList.get(0).getCode(), idleList.get(0).getBarcode()); } rsf-server/src/main/java/com/vincent/rsf/server/manager/schedules/TaskSchedules.java
@@ -252,31 +252,31 @@ .in(Task::getTaskStatus, integers) .orderByDesc(Task::getSort)); for (Task task : tasks) { Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getBarcode, task.getBarcode())); if (Objects.isNull(loc)) { continue; } //判断是否深库位 if (!LocUtils.isShallowLoc(loc.getCode())) { //获取深库位对应的浅库位 String shallowLoc = LocUtils.getShallowLoc(loc.getCode()); if (StringUtils.isBlank(shallowLoc)) { continue; } Loc shalloc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, shallowLoc)); if (Objects.isNull(shalloc) || !shalloc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_F.type)) { //如果浅库位不在库跳出循环 continue; } LocToTaskParams params = new LocToTaskParams(); params.setOrgLoc(shallowLoc).setType(TaskType.TASK_TYPE_LOC_MOVE.type + ""); //生成移库任务 Task moveTask = locItemService.genMoveTask(params, loginUserId); moveTask.setSort(!Objects.isNull(task.getSort()) ? task.getSort() + 1 : Constants.TASK_SORT_DEFAULT_VALUE + 1); if (!taskService.updateById(moveTask)) { throw new Exception("任务优先级更新失败!!"); } } // Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getBarcode, task.getBarcode())); // if (Objects.isNull(loc)) { // continue; // } // //判断是否深库位 // if (!LocUtils.isShallowLoc(loc.getCode())) { // //获取深库位对应的浅库位 // String shallowLoc = LocUtils.getShallowLoc(loc.getCode()); // if (StringUtils.isBlank(shallowLoc)) { // continue; // } // Loc shalloc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, shallowLoc)); // if (Objects.isNull(shalloc) || !shalloc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_F.type)) { // //如果浅库位不在库跳出循环 // continue; // } // LocToTaskParams params = new LocToTaskParams(); // params.setOrgLoc(shallowLoc).setType(TaskType.TASK_TYPE_LOC_MOVE.type + ""); // //生成移库任务 // Task moveTask = locItemService.genMoveTask(params, loginUserId); // moveTask.setSort(!Objects.isNull(task.getSort()) ? task.getSort() + 1 : Constants.TASK_SORT_DEFAULT_VALUE + 1); // if (!taskService.updateById(moveTask)) { // throw new Exception("任务优先级更新失败!!"); // } // } //TODO 调用下发任务接口 pubTaskToWcs(task); } @@ -321,20 +321,18 @@ taskParams.setBatch(task.getBarcode()); if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type ) || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_IN.type)) { itemParam.setDestLoc(task.getTargLoc()) .setOriSta(task.getOrgSite()); } else if (task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type) || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_IN.type)) { itemParam.setDestLoc(task.getTargLoc()) .setOriSta(task.getTargSite()); } else if (task.getTaskType().equals(TaskType.TASK_TYPE_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_AGAIN_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_OUT.type) ) { || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_OUT.type)) { itemParam.setOriLoc(task.getOrgLoc()) .setDestSta(task.getTargSite()); @@ -378,7 +376,12 @@ .set(Task::getTaskStatus, TaskStsType.WCS_EXECUTE_IN.id))) { throw new CoolException("任务状态修改失败!!"); } } else if (task.getTaskType().equals(TaskType.TASK_TYPE_OUT.type)) { } else if (task.getTaskType().equals(TaskType.TASK_TYPE_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_MERGE_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_EMPITY_OUT.type) || task.getTaskType().equals(TaskType.TASK_TYPE_PICK_AGAIN_OUT.type) ) { if (!taskService.update(new LambdaUpdateWrapper<Task>().eq(Task::getTaskCode, task.getTaskCode()) .set(Task::getTaskStatus, TaskStsType.WCS_EXECUTE_OUT.id))) { throw new CoolException("任务状态修改失败!!"); rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/DeviceSiteServiceImpl.java
@@ -70,9 +70,9 @@ for (String target : targets) { DeviceSite site1 = new DeviceSite(); site1.setType(id + "") .setSite(site) .setSite(basStation.getStationName()) .setDevice(param.getDeviceType()) .setDeviceSite(deviceSite) .setDeviceSite(basStation2.getStationName()) .setTarget(target) .setDeviceCode(param.getDeviceCode()) .setChannel(param.getChannel()) rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/LocItemServiceImpl.java
@@ -157,7 +157,7 @@ } else if (map.getType().equals(Constants.TASK_TYPE_OUT_CHECK)) { //盘点出库 DeviceSite deviceSite = deviceSiteService.getOne(new LambdaQueryWrapper<DeviceSite>() .eq(DeviceSite::getChannel, loc.getChannel()) .eq(!Objects.isNull(loc.getChannel()), DeviceSite::getChannel, loc.getChannel()) .eq(DeviceSite::getSite, siteNo) .eq(DeviceSite::getType, TaskType.TASK_TYPE_CHECK_OUT.type)); if (Objects.isNull(deviceSite)) { rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -979,7 +979,8 @@ if (Objects.isNull(locInfo)) { throw new CoolException("获取库位失败!!"); } task.setTargLoc(locInfo.getLocNo()); task.setTargLoc(locInfo.getLocNo()) .setOrgSite(task.getTargSite()); if (!this.updateById(task)) { throw new CoolException("任务状态更新失败!!"); rsf-server/src/main/resources/application-dev.yml
@@ -14,10 +14,10 @@ # url: jdbc:mysql://47.76.147.249:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai # username: rsf username: root # url: jdbc:mysql://10.10.10.200:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai # password: xltys1995 url: jdbc:mysql://127.0.0.1:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai password: 34821015 url: jdbc:mysql://10.10.10.200:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai password: xltys1995 # url: jdbc:mysql://127.0.0.1:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai # password: 34821015 type: com.alibaba.druid.pool.DruidDataSource druid: initial-size: 5 rsf-server/src/main/resources/application.yml
@@ -46,6 +46,7 @@ # 下位机配置 wcs-slave: agv: false # 双深 doubleDeep: true # 双深库位排号