| | |
| | | const getLocs = async (ids) => { |
| | | const { data: { code, data, msg } } = await request.post('/check/locs/' + ids); |
| | | if (code === 200) { |
| | | console.log('----->'); |
| | | console.log(data); |
| | | setRows(data) |
| | | const matnrs = selectedMatnr.filter(item => data.some(bigData => bigData.matnrCode === item)); |
| | | // setSelectedMatnr(matnrs) |
| | | } else { |
| | | notify(msg); |
| | | } |
| | |
| | | </Box> |
| | | <Box sx={{ textAlign: 'center' }}> |
| | | <CloseButton setOpen={setOpen} /> |
| | | <SubmitButton selectedIds={selectedIds} setOpen={setOpen} setSelectedIds={setSelectedIds} rowSelectedIds={rowSelectedIds} gridRef={gridRef} record={record} /> |
| | | <SubmitButton selectedIds={selectedIds} setOpen={setOpen} setSelectedIds={setSelectedIds} selectedMatnr={selectedMatnr} rowSelectedIds={rowSelectedIds} gridRef={gridRef} record={record} /> |
| | | </Box> |
| | | </Card> |
| | | </Grid> |
| | |
| | | |
| | | |
| | | //提交按钮 |
| | | const SubmitButton = ({ selectedIds, setSelectedIds, rowSelectedIds, gridRef, record, setOpen }) => { |
| | | const SubmitButton = ({ selectedIds, setSelectedIds, rowSelectedIds, gridRef, record, setOpen, selectedMatnr }) => { |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | |
| | | } |
| | | }) |
| | | |
| | | const { data: { code, data, msg } } = await request.post('/check/generate/tasks', records); |
| | | let params = records.filter(record => record?.items.length > 0); |
| | | |
| | | const { data: { code, data, msg } } = await request.post('/check/generate/tasks', params); |
| | | if (code == 200) { |
| | | refresh(); |
| | | setOpen(false) |
| | |
| | | package com.vincent.rsf.server.api.service.impl; |
| | | |
| | | 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.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | |
| | | .setOrderType(OrderType.ORDER_CHECK.type) |
| | | .setSourceCode(diffItem.getOrderCode()) |
| | | .setWkType(Short.parseShort(OrderWorkType.ORDER_WORK_TYPE_STOCK_CHECK.type)) |
| | | .setAnfme(diffItem.getAnfme()) |
| | | .setAnfme(diffItem.getCheckQty()) |
| | | .setWorkQty(0.0) |
| | | .setBatch(diffItem.getBatch()) |
| | | .setMaktx(matnr.getName()) |
| | |
| | | throw new CoolException("新增盘点明细保存失败!!"); |
| | | } |
| | | |
| | | diffItem.setTaskItemId(taskItem.getId()); |
| | | diffItem.setTaskItemId(taskItem.getId()).setExceStatus(CheckDiffExceStatus.CHECK_DIFF_EXCE_STATUS_HOLD.val); |
| | | |
| | | if (!checkDiffItemService.updateById(diffItem)) { |
| | | throw new CoolException("明细修改失败!!"); |
| | |
| | | return R.error("数据错误,未找到差异单明细"); |
| | | } |
| | | diffItem.setCheckQty(ckDiffItem.getCheckQty()).setReason(ckDiffItem.getReason()).setMemo(ckDiffItem.getMemo()); |
| | | } |
| | | |
| | | diffItem.setExceStatus(CheckDiffExceStatus.CHECK_DIFF_EXCE_STATUS_HOLD.val); |
| | | if (!checkDiffItemService.updateById(diffItem)) { |
| | | throw new CoolException("更新差异单明细失败"); |
| | | } |
| | | // Double checkQty = Math.round((checkDiff.getCheckQty() + diffItem.getCheckQty()) * 10000) / 10000.0; |
| | | // checkDiff.setCheckQty(checkQty); |
| | | |
| | | if (!taskItemService.update(new LambdaUpdateWrapper<TaskItem>() |
| | | .set(TaskItem::getAnfme, diffItem.getCheckQty()) |
| | | .eq(TaskItem::getId, diffItem.getTaskItemId()))) { |
| | | throw new CoolException("任务数量修改失败!!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<CheckDiffItem> diffItems = checkDiffItemService.list(new LambdaQueryWrapper<CheckDiffItem>() |
| | |
| | | |
| | | /** |
| | | * 每五秒校验深库位是否为空,如果浅库位有货,将浅库位移至深库位 |
| | | */ |
| | | @Scheduled(cron = "0/35 * * * * ? ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void shallocToDeep() throws Exception { |
| | | List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>() |
| | | .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) |
| | | .in(Loc::getRow, rows)); |
| | | if (locs.isEmpty()) { |
| | | return; |
| | | } |
| | | for (Loc loc : locs) { |
| | | String shallowLoc = LocUtils.getShallowLoc(loc.getCode()); |
| | | Loc one = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, shallowLoc)); |
| | | if (Objects.isNull(one) || !one.getUseStatus().equals(LocStsType.LOC_STS_TYPE_F.type)) { |
| | | continue; |
| | | } |
| | | taskService.moveToDeep(SystemAuthUtils.getLoginUserId(), shallowLoc); |
| | | } |
| | | } |
| | | *///TODO 生成移库任务前,需要检查是否有任务前往当前托盘 |
| | | // @Scheduled(cron = "0/35 * * * * ? ") |
| | | // @Transactional(rollbackFor = Exception.class) |
| | | // public void shallocToDeep() throws Exception { |
| | | // List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>() |
| | | // .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_O.type) |
| | | // .in(Loc::getRow, rows)); |
| | | // if (locs.isEmpty()) { |
| | | // return; |
| | | // } |
| | | // for (Loc loc : locs) { |
| | | // String shallowLoc = LocUtils.getShallowLoc(loc.getCode()); |
| | | // Loc one = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, shallowLoc)); |
| | | // if (Objects.isNull(one) || !one.getUseStatus().equals(LocStsType.LOC_STS_TYPE_F.type)) { |
| | | // continue; |
| | | // } |
| | | // taskService.moveToDeep(SystemAuthUtils.getLoginUserId(), shallowLoc); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | /** |
| | |
| | | tempLocs.forEach(working -> { |
| | | taskItems.forEach(taskItem -> { |
| | | if (taskItem.getMatnrId().equals(working.getMatnrId())) { |
| | | Double minQty = Math.round((working.getAnfme() - taskItem.getAnfme()) * 10000) / 10000.0; |
| | | Double minQty = taskItem.getAnfme(); |
| | | if (!task.getTaskType().equals(TaskType.TASK_TYPE_CHECK_IN.type)) { |
| | | minQty = Math.round((working.getAnfme() - taskItem.getAnfme()) * 10000) / 10000.0; |
| | | } |
| | | if (minQty.compareTo(0.0) > 0) { |
| | | taskItem.setAnfme(minQty); |
| | | if (!taskItemService.updateById(taskItem)) { |
| | | throw new CoolException("任务明细修改失败!!"); |
| | | } |
| | | |
| | | } else { |
| | | if (!taskItemService.removeById(taskItem)) { |
| | | throw new CoolException("任务明细修改失败!!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | }); |
| | | }); |
| | | List<Long> matnrIds = taskItems.stream().map(TaskItem::getMatnrId).collect(Collectors.toList()); |
| | |
| | | }); |
| | | |
| | | locItemWorkingService.remove(new LambdaQueryWrapper<LocItemWorking>().eq(LocItemWorking::getTaskId, task.getId())); |
| | | Loc loc1 = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getOrgLoc())); |
| | | Loc loc1 = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, task.getTargLoc())); |
| | | if (Objects.isNull(loc1)) { |
| | | throw new CoolException("目标库位不存在!!"); |
| | | } |