rsf-admin/src/page/deviceBind/DeviceBindCreate.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
rsf-admin/src/page/deviceBind/DeviceBindEdit.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
rsf-admin/src/page/waitPakin/SelectSiteModel.jsx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
rsf-server/src/main/java/com/vincent/rsf/server/api/controller/params/TaskInParam.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
rsf-server/src/main/java/com/vincent/rsf/server/api/entity/enums/LocUseStatusType.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/WcsServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
rsf-admin/src/page/deviceBind/DeviceBindCreate.jsx
@@ -128,11 +128,10 @@ parse={v => v} /> </Grid> <Grid item xs={6} display="flex" gap={1}> <NumberInput label="table.field.deviceBind.typeId" source="typeId" /> <Grid item xs={6} display="flex" gap={1}> <ReferenceInput source="typeId" label="table.field.deviceBind.typeId" reference="warehouseAreas" filter={{}}> <AutocompleteInput optionValue="id" optionText="name" label="table.field.deviceBind.typeId" /> </ReferenceInput> </Grid> <Grid item xs={6} display="flex" gap={1}> <TextInput rsf-admin/src/page/deviceBind/DeviceBindEdit.jsx
@@ -108,10 +108,9 @@ /> </Stack> <Stack direction='row' gap={2}> <NumberInput label="table.field.deviceBind.typeId" source="typeId" /> <ReferenceInput source="typeId" label="table.field.deviceBind.typeId" reference="warehouseAreas" filter={{}}> <AutocompleteInput optionValue="id" optionText="name" label="table.field.deviceBind.typeId" /> </ReferenceInput> </Stack> <Stack direction='row' gap={2}> <TextInput rsf-admin/src/page/waitPakin/SelectSiteModel.jsx
@@ -19,6 +19,27 @@ }, })); const SelectSiteButton = (props) => { const { source, setOpen, refresh, notify } = props; const record = useRecordContext(); const handleClick = async () => { setOpen(false); const id = record.id; const res = await request.post(`/waitPakin/merge`, {waitPakins: source, siteId: id}); if (res?.data?.code === 200) { refresh(); notify(res.data.msg); } else { notify(res.data.msg); } }; return ( <Button label="toolbar.selectSite" onClick={handleClick} /> ); }; const SelectSiteModel = (props) => { const { open, setOpen, source } = props; const translate = useTranslate(); @@ -47,6 +68,7 @@ <DialogContent> <List resource='deviceSite' filter={{type : 1}} sx={{ flexGrow: 1, transition: (theme) => @@ -68,17 +90,7 @@ <StyledDatagrid preferenceKey='deviceSite' bulkActionButtons={false} rowClick='toggleSelection' onToggleItem={async (id)=>{ setOpen(false); const res = await request.post(`/waitPakin/merge`, {waitPakins: source, siteId: id}); if (res?.data?.code === 200) { refresh(); notify(res.data.msg); } else { notify(res.data.msg); } }} rowClick={false} omit={['id','name', 'createTime','label', 'createBy', 'memo', 'updateBy$', 'createBy$', 'createTime', 'updateTime']} > <NumberField source="id" /> @@ -97,9 +109,7 @@ <BooleanField source="statusBool" label="common.field.status" sortable={false} /> <TextField source="memo" label="common.field.memo" sortable={false} /> <WrapperField cellClassName="opt" label="common.field.opt"> <Button label="toolbar.selectSite" onClick={(event)=>{ setOpen(false) }}/> <SelectSiteButton source={source} setOpen={setOpen} refresh={refresh} notify={notify} /> </WrapperField> </StyledDatagrid> </List> rsf-server/src/main/java/com/vincent/rsf/server/api/controller/params/TaskInParam.java
@@ -9,7 +9,6 @@ private Integer sourceStaNo; //作业站点 or 来源站点 private String barcode; //容器条码 private Integer locType1; //库位类型 private Integer area; // private Integer locType2; //库位类型 // private Integer locType3; //库位类型 } rsf-server/src/main/java/com/vincent/rsf/server/api/entity/enums/LocUseStatusType.java
File was deleted rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/WcsServiceImpl.java
@@ -7,7 +7,6 @@ import com.vincent.rsf.server.api.entity.dto.InTaskMsgDto; import com.vincent.rsf.server.api.entity.dto.LocTypeDto; import com.vincent.rsf.server.api.controller.params.TaskInParam; import com.vincent.rsf.server.api.entity.enums.LocUseStatusType; import com.vincent.rsf.server.api.entity.enums.OrderType; import com.vincent.rsf.server.api.entity.enums.TaskStsType; import com.vincent.rsf.server.api.entity.enums.TaskType; @@ -316,7 +315,11 @@ if (Cools.isEmpty(deviceSites)) { throw new CoolException("未找到站点路径信息"); } WarehouseAreas warehouseArea = warehouseAreasService.getById(param.getArea()); DeviceBind deviceBind = deviceBindService.getById(LocUtils.getAreaType(param.getSourceStaNo())); if (Cools.isEmpty(deviceBind)) { throw new CoolException("数据异常,请联系管理员===>库位规则未知"); } WarehouseAreas warehouseArea = warehouseAreasService.getById(deviceBind.getTypeId()); if (Cools.isEmpty(warehouseArea)) { throw new CoolException("未找到所属库区信息"); } @@ -324,18 +327,18 @@ InTaskMsgDto dto = null; switch (warehouseArea.getType()) { case "CRN": //堆垛机 dto = getLocNoCrn(param.getArea(), param.getSourceStaNo(), matnr,batch, locTypeDto, 0, param.getIoType()); dto = getLocNoCrn(deviceBind,warehouseArea.getId(), param.getSourceStaNo(), matnr,batch, locTypeDto, 0, param.getIoType()); break; case "SXC": //四向库 break; case "CTU": //ctu dto = getLocNoCtu(param.getArea(), param.getSourceStaNo(), matnr,batch, locTypeDto, 0, param.getIoType()); dto = getLocNoCtu(deviceBind,warehouseArea.getId(), param.getSourceStaNo(), matnr,batch, locTypeDto, 0, param.getIoType()); break; } return dto; } private InTaskMsgDto getLocNoCrn(Integer area,Integer sourceStaNo, String matnr, String batch,LocTypeDto locTypeDto, int times,Integer ioType){ private InTaskMsgDto getLocNoCrn(DeviceBind deviceBind,Long area,Integer sourceStaNo, String matnr, String batch,LocTypeDto locTypeDto, int times,Integer ioType){ if (Cools.isEmpty(matnr)) { //物料号 matnr = ""; } @@ -350,10 +353,7 @@ Loc loc = null; // 目标库位 InTaskMsgDto inTaskMsgDto = new InTaskMsgDto(); DeviceBind deviceBind = deviceBindService.getById(LocUtils.getAreaType(sourceStaNo)); if (Cools.isEmpty(deviceBind)) { throw new CoolException("数据异常,请联系管理员===>库位规则未知"); } int sRow = deviceBind.getStartRow(); int eRow = deviceBind.getEndRow(); int deviceQty = deviceBind.getDeviceQty(); @@ -386,7 +386,7 @@ String shallowLocNo = LocUtils.getShallowLoc(slaveProperties, loc1.getCode()); // 检测目标库位是否为空库位 Loc shallowLoc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode,shallowLocNo)); if (shallowLoc != null && shallowLoc.getUseStatus().equals(LocUseStatusType.Empty_Slot.type)) { if (shallowLoc != null && shallowLoc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_O.type)) { if (LocUtils.locMoveCheckLocTypeComplete(shallowLoc, locTypeDto)) { loc = shallowLoc; deviceNo = shallowLoc.getDeviceNo(); @@ -445,7 +445,7 @@ List<Loc> locMasts = null; locMasts = locService.list(new LambdaQueryWrapper<Loc>() .eq(Loc::getRow, nearRow) .eq(Loc::getUseStatus, LocUseStatusType.Empty_Slot.type) .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) .eq(Loc::getType, locTypeDto.getLocType1()) .eq(Loc::getAreaId,area) .orderByAsc(Loc::getLev) @@ -460,7 +460,7 @@ //相似物料打开,判断深库位有没有货,没货就放深库位,有货就不操作 Loc locMast2 = locService.getOne(new LambdaQueryWrapper<Loc>() .eq(Loc::getRow, shallowLoc) .eq(Loc::getUseStatus, LocUseStatusType.Empty_Slot.type) .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) .eq(Loc::getAreaId,area) ); if (!Cools.isEmpty(locMast2)) { @@ -471,7 +471,7 @@ //相似物料关闭,判断深库位有没有货,有货就放浅库位,无货就不操作 Loc locMast2 = locService.getOne(new LambdaQueryWrapper<Loc>() .eq(Loc::getCode, shallowLoc) .in(Loc::getUseStatus, LocUseStatusType.Empty_Pallet.type,LocUseStatusType.In_Stock.type) .in(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_D.type,LocStsType.LOC_STS_TYPE_F.type) .eq(Loc::getAreaId,area) ); if (!Cools.isEmpty(locMast2)) { @@ -480,7 +480,7 @@ }else{ locMast2 = locService.getOne(new LambdaQueryWrapper<Loc>() .eq(Loc::getCode, shallowLoc) .eq(Loc::getUseStatus, LocUseStatusType.Empty_Slot.type) .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) .eq(Loc::getAreaId,area) ); if (!Cools.isEmpty(locMast2)) { @@ -499,7 +499,7 @@ String shallowLoc = LocUtils.getDeepLoc(slaveProperties, locMast1.getCode()); Loc locMast2 = locService.getOne(new LambdaQueryWrapper<Loc>() .eq(Loc::getCode, shallowLoc) .eq(Loc::getUseStatus, "O") .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) .eq(Loc::getAreaId,area) ); if (!Cools.isEmpty(locMast2)) { @@ -508,7 +508,7 @@ } else { locMast2 = locService.getOne(new LambdaQueryWrapper<Loc>() .eq(Loc::getCode, shallowLoc) .in(Loc::getUseStatus, LocUseStatusType.Empty_Pallet.type,LocUseStatusType.In_Stock.type) .in(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_D.type,LocStsType.LOC_STS_TYPE_D.type) .eq(Loc::getAreaId,area) ); if (!Cools.isEmpty(locMast2)) { @@ -527,7 +527,7 @@ } //查询当前库位类型空库位 小于5个则locmast = null List<Loc> locTypeLocMasts = locService.list(new LambdaQueryWrapper<Loc>() .eq(Loc::getUseStatus, LocUseStatusType.Empty_Slot.type) .eq(Loc::getUseStatus,LocStsType.LOC_STS_TYPE_O.type) .eq(Loc::getDeviceNo, deviceNo) .eq(Loc::getType, locTypeDto.getLocType1()) .eq(Loc::getAreaId,area) @@ -536,18 +536,18 @@ loc = null; } // 递归查询 if (Cools.isEmpty(loc) || !loc.getUseStatus().equals(LocUseStatusType.Empty_Slot.type)) { if (Cools.isEmpty(loc) || !loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_O.type)) { // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 if (times < rowCount * 2) { times = times + 1; return getLocNoCrn(area,sourceStaNo,matnr,batch,locTypeDto,times, ioType); return getLocNoCrn(deviceBind,area,sourceStaNo,matnr,batch,locTypeDto,times, ioType); } // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位 if (locTypeDto.getLocType1() < 3) { int i = locTypeDto.getLocType1() + 1; locTypeDto.setLocType1(i); return getLocNoCrn(area,sourceStaNo,matnr,batch,locTypeDto,0, ioType); return getLocNoCrn(deviceBind,area,sourceStaNo,matnr,batch,locTypeDto,0, ioType); } throw new CoolException("没有空库位"); } @@ -561,7 +561,7 @@ return inTaskMsgDto; } private InTaskMsgDto getLocNoCtu(Integer area,Integer sourceStaNo, String matnr, String batch,LocTypeDto locTypeDto, int times,Integer ioType){ private InTaskMsgDto getLocNoCtu(DeviceBind deviceBind,Long area,Integer sourceStaNo, String matnr, String batch,LocTypeDto locTypeDto, int times,Integer ioType){ if (Cools.isEmpty(matnr)) { //物料号 matnr = ""; } @@ -571,14 +571,9 @@ int deviceNo = 0; Loc loc = new Loc(); InTaskMsgDto inTaskMsgDto = new InTaskMsgDto(); DeviceBind deviceBind = deviceBindService.getById(LocUtils.getAreaType(sourceStaNo)); if (Cools.isEmpty(deviceBind)) { throw new CoolException("数据异常,请联系管理员===>库位规则未知"); } List<Loc> loc1 = locService.list(new LambdaQueryWrapper<Loc>() .eq(Loc::getAreaId, area) .eq(Loc::getUseStatus, LocUseStatusType.Empty_Slot.type) .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) .eq(Loc::getType, locTypeDto.getLocType1()) .orderByAsc(Loc::getRow) .orderByAsc(Loc::getCol) @@ -604,18 +599,18 @@ inTaskMsgDto.setStaNo(Integer.parseInt(deviceSite.getDeviceSite())); } // 递归查询 if (Cools.isEmpty(loc) || !loc.getUseStatus().equals(LocUseStatusType.Empty_Slot.type)) { if (Cools.isEmpty(loc) || !loc.getUseStatus().equals(LocStsType.LOC_STS_TYPE_O.type)) { // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 if (times < 5) { times = times + 1; return getLocNoCrn(area,sourceStaNo,matnr,batch,locTypeDto,times, ioType); return getLocNoCtu(deviceBind,area,sourceStaNo,matnr,batch,locTypeDto,times, ioType); } // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位 if (locTypeDto.getLocType1() < 3) { int i = locTypeDto.getLocType1() + 1; locTypeDto.setLocType1(i); return getLocNoCrn(area,sourceStaNo,matnr,batch,locTypeDto,0, ioType); return getLocNoCtu(deviceBind,area,sourceStaNo,matnr,batch,locTypeDto,0, ioType); } throw new CoolException("没有空库位"); } rsf-server/src/main/java/com/vincent/rsf/server/manager/service/impl/TaskServiceImpl.java
@@ -2,11 +2,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.vincent.rsf.framework.common.Cools; import com.vincent.rsf.server.api.entity.enums.OrderType; import com.vincent.rsf.server.api.entity.enums.TaskStsType; import com.vincent.rsf.framework.common.R; import com.vincent.rsf.framework.exception.CoolException; import com.vincent.rsf.server.api.entity.enums.TaskType; import com.vincent.rsf.server.api.utils.LocUtils; import com.vincent.rsf.server.manager.controller.params.GenerateTaskParams; import com.vincent.rsf.server.manager.entity.*; import com.vincent.rsf.server.manager.enums.PakinIOStatus; @@ -62,6 +64,11 @@ @Autowired private LocItemService locItemService; @Autowired private DeviceBindService deviceBindService; @Autowired private WarehouseAreasService warehouseAreasService; /** * @param @@ -82,6 +89,20 @@ if (Objects.isNull(deviceSite)) { throw new CoolException("站点不存在!!"); } DeviceBind deviceBind = deviceBindService.getById(LocUtils.getAreaType(Integer.valueOf(deviceSite.getSite()))); if (Cools.isEmpty(deviceBind)) { throw new CoolException("库位规则未知"); } WarehouseAreas warehouseArea = warehouseAreasService.getById(deviceBind.getTypeId()); if (Cools.isEmpty(warehouseArea)) { throw new CoolException("未找到所属库区信息"); } /**获取库位*/ String targetLoc = LocManageUtil.getTargetLoc(warehouseArea.getId()); if (Cools.isEmpty(targetLoc)) { throw new CoolException("该站点对应库区未找到库位"); } /**获取组拖*/ List<Long> ids = waitPakin.getWaitPakins().stream().map(WaitPakin::getId).collect(Collectors.toList()); List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>() @@ -100,28 +121,28 @@ task.setTaskCode(ruleCode) .setTaskStatus(TaskStsType.GENERATE_IN.id.shortValue()) .setTaskType(TaskType.TASK_TYPE_IN.type.shortValue()) .setTargLoc(LocManageUtil.getTargetLoc()) .setTargLoc(targetLoc) .setBarcode(pakin.getBarcode()) .setTargSite(deviceSite.getDeviceCode()) .setOrgSite(deviceSite.getSite()) .setTargSite(deviceSite.getDeviceSite()) .setCreateBy(loginUserId) .setUpdateBy(loginUserId); if (!Objects.isNull(waitPakin.getSiteId()) && waitPakin.getSiteId() > 0) { DeviceSite site = deviceSiteService.getById(waitPakin.getSiteId()); task.setTargSite(site.getSite() + ""); } else { task.setTargSite(LocManageUtil.getTargetSite()); } if (!Objects.isNull(waitPakin.getLocCode()) && StringUtils.isNotBlank(waitPakin.getLocCode())) { List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, waitPakin.getLocCode())); // if (!locs.isEmpty()) { // throw new CoolException("库位错误:相同库位应只一条") // } Loc loc = locs.stream().findFirst().get(); task.setTargSite(loc.getCode()); } else { task.setTargSite(LocManageUtil.getTargetSite()); } // if (!Objects.isNull(waitPakin.getSiteId()) && waitPakin.getSiteId() > 0) { // DeviceSite site = deviceSiteService.getById(waitPakin.getSiteId()); // task.setTargSite(site.getSite() + ""); // } else { // task.setTargSite(LocManageUtil.getTargetSite()); // } // if (!Objects.isNull(waitPakin.getLocCode()) && StringUtils.isNotBlank(waitPakin.getLocCode())) { // List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, waitPakin.getLocCode())); //// if (!locs.isEmpty()) { //// throw new CoolException("库位错误:相同库位应只一条") //// } // Loc loc = locs.stream().findFirst().get(); // task.setTargSite(loc.getCode()); // } else { // task.setTargSite(LocManageUtil.getTargetSite()); // } if (!this.save(task)) { throw new CoolException("任务保存失败!!"); @@ -231,7 +252,7 @@ * @time 2025/4/15 15:28 */ @Transactional(rollbackFor = Exception.class) void saveLocItem(List<TaskItem> items, Long taskId) throws Exception { public void saveLocItem(List<TaskItem> items, Long taskId) throws Exception { Task task = this.getById(taskId); if (Objects.isNull(task)) { throw new CoolException("任务不存在!!"); @@ -255,7 +276,7 @@ * @return */ @Transactional(rollbackFor = Exception.class) void saveStockItems(List<TaskItem> items, WaitPakinItem order) throws Exception { public void saveStockItems(List<TaskItem> items, WaitPakinItem order) throws Exception { Stock stock = new Stock(); // if (!Objects.isNull(order.getPoCode()) && StringUtils.isNotBlank(order.getPoCode())) { // Purchase purchase = purchaseService.getOne(new LambdaQueryWrapper<Purchase>().eq(Purchase::getCode, order.getPoCode())); rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/LocManageUtil.java
@@ -21,11 +21,14 @@ * @return * @time 2025/3/31 08:50 */ public static String getTargetLoc() { public static String getTargetLoc(Long areaId) { //TODO 库位策略后续排期 LocService locService = SpringUtils.getBean(LocService.class); Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type), false); Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>() .eq(Loc::getAreaId, areaId) .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type), false ); return !Objects.isNull(loc) ? loc.getCode() : null; }