| | |
| | | basStation: 'BasStation', |
| | | basContainer: 'BasContainer', |
| | | waveRule: 'Wave Rules', |
| | | checkDiff: 'Check Diff', |
| | | |
| | | }, |
| | | table: { |
| | |
| | | ntyStatus: "ntyStatus", |
| | | platItemId: 'platItemId' |
| | | }, |
| | | |
| | | checkDiff: { |
| | | orderCode: "Check Code", |
| | | checkType: "Check Type", |
| | | areaId: "Warehouse Area ID", |
| | | areaName: "Warehouse Area Name", |
| | | anfme: "Stock Qty", |
| | | checkQty: "Check Qty", |
| | | exceStatus: "Exce Status", |
| | | }, |
| | | checkDiffItem: { |
| | | checkId: "checkId", |
| | | orderCode: "orderCode", |
| | | maktx: "maktx", |
| | | matnrCode: "matnrCode", |
| | | spec: "spec", |
| | | model: "model", |
| | | barcode: "barcode", |
| | | batch: "batch", |
| | | anfme: "anfme", |
| | | checkQty: "checkQty", |
| | | exceStatus: "exceStatus", |
| | | reason: "reason", |
| | | }, |
| | | outStockItem: { |
| | | asnId: "ID", |
| | | asnCode: "Out Code", |
| | |
| | | stockTransfer: '库位转移', |
| | | waveRule: '波次策略', |
| | | checkOrder: '盘点单', |
| | | checkDiff: '盘点差异单', |
| | | }, |
| | | table: { |
| | | field: { |
| | |
| | | ntyStatus: "上报状态", |
| | | exceStatus: '执行状态' |
| | | }, |
| | | |
| | | checkOrderItem: { |
| | | orderId: "主单标识", |
| | | orderCode: "单号", |
| | |
| | | qrcode: "二维码", |
| | | barcode: "序列码", |
| | | }, |
| | | |
| | | checkDiff: { |
| | | orderCode: "盘点单", |
| | | checkType: "盘点类型", |
| | | areaId: "库区ID", |
| | | areaName: "库区", |
| | | anfme: "库面数量", |
| | | checkQty: "盘点数量", |
| | | exceStatus: "执行状态", |
| | | }, |
| | | checkDiffItem: { |
| | | checkId: "盘点单ID", |
| | | orderCode: "盘点单号", |
| | | maktx: "物料名称", |
| | | matnrCode: "物料编码", |
| | | spec: "规格", |
| | | model: "型号", |
| | | barcode: "托盘码", |
| | | batch: "批次", |
| | | anfme: "库存数量", |
| | | checkQty: "实盘数量", |
| | | exceStatus: "执行状态", |
| | | reason: "差异原因", |
| | | }, |
| | | asnOrderItem: { |
| | | orderId: "主单标识", |
| | | orderCode: "单号", |
| | |
| | | import stockTransfer from "./work/stockTransfer"; |
| | | import waveRule from './waveRule'; |
| | | import check from './orders/check'; |
| | | import checkDiff from './orders/check/checkDiff'; |
| | | |
| | | const ResourceContent = (node) => { |
| | | switch (node.component) { |
| | |
| | | return waveRule; |
| | | case 'check': |
| | | return check; |
| | | case 'checkDiff': |
| | | return checkDiff; |
| | | default: |
| | | return { |
| | | list: ListGuesser, |
| | |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography } from '@mui/material'; |
| | | import * as Common from '@/utils/common'; |
| | | import { EDIT_MODE, REFERENCE_INPUT_PAGESIZE } from '@/config/setting'; |
| | | import EditBaseAside from "../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import EditBaseAside from "../../../components/EditBaseAside"; |
| | | import CustomerTopToolBar from "../../../components/EditTopToolBar"; |
| | | import CheckDiffItemList from "../checkDiffItem/CheckDiffItemList"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
| | | |
| | | return ( |
| | | <Toolbar sx={{ justifyContent: 'space-between' }}> |
| | | <SaveButton /> |
| | | <DeleteButton mutationMode="optimistic" /> |
| | | </Toolbar> |
| | | ) |
| | | } |
| | | |
| | | const CheckDiffEdit = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | return ( |
| | | <Edit |
| | | redirect="list" |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={<FormToolbar />} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | // validate={(values) => { }} |
| | | <> |
| | | <Edit |
| | | redirect="list" |
| | | sx={{marginBottom: 1}} |
| | | mutationMode={EDIT_MODE} |
| | | actions={<CustomerTopToolBar />} |
| | | aside={<EditBaseAside />} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={12} md={8}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.checkDiff.orderCode" |
| | | source="orderCode" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <SelectInput |
| | | label="table.field.checkDiff.checkType" |
| | | source="checkType" |
| | | choices={[ |
| | | { id: 0, name: '明盘' }, |
| | | { id: 1, name: '暗盘' }, |
| | | ]} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.checkDiff.areaId" |
| | | source="areaId" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.checkDiff.areaName" |
| | | source="areaName" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.checkDiff.anfme" |
| | | source="anfme" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.checkDiff.checkQty" |
| | | source="checkQty" |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.checkDiff.exceStatus" |
| | | source="exceStatus" |
| | | /> |
| | | </Stack> |
| | | <SimpleForm |
| | | shouldUnregister |
| | | warnWhenUnsavedChanges |
| | | toolbar={false} |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '100%' }} rowSpacing={3} columnSpacing={3} |
| | | sx={{ |
| | | "& .MuiFormLabel-root.MuiInputLabel-root.Mui-disabled": { |
| | | bgcolor: 'white', |
| | | WebkitTextFillColor: "rgba(0, 0, 0)" |
| | | }, |
| | | |
| | | "& .MuiInputBase-input.MuiFilledInput-input.Mui-disabled": { |
| | | bgcolor: 'white', |
| | | WebkitTextFillColor: "rgba(0, 0, 0)" |
| | | }, |
| | | "& .MuiFilledInput-root.MuiInputBase-sizeSmall": { |
| | | bgcolor: 'white', |
| | | } |
| | | }} |
| | | > |
| | | <Grid item xs={24} md={12} > |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | | </Typography> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.checkDiff.orderCode" |
| | | source="orderCode" |
| | | parse={v => v} |
| | | autoFocus |
| | | /> |
| | | <SelectInput |
| | | label="table.field.checkDiff.checkType" |
| | | source="checkType" |
| | | choices={[ |
| | | { id: 0, name: '明盘' }, |
| | | { id: 1, name: '暗盘' }, |
| | | ]} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.checkDiff.areaId" |
| | | source="areaId" |
| | | /> |
| | | <TextInput |
| | | label="table.field.checkDiff.areaName" |
| | | source="areaName" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.checkDiff.anfme" |
| | | source="anfme" |
| | | /> |
| | | <NumberInput |
| | | label="table.field.checkDiff.checkQty" |
| | | source="checkQty" |
| | | /> |
| | | <NumberInput |
| | | label="table.field.checkDiff.exceStatus" |
| | | source="exceStatus" |
| | | /> |
| | | </Stack> |
| | | </Grid> |
| | | </Grid> |
| | | <Grid item xs={12} md={4}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.common')} |
| | | </Typography> |
| | | <StatusSelectInput /> |
| | | <Box mt="2em" /> |
| | | <MemoInput /> |
| | | </Grid> |
| | | </Grid> |
| | | </SimpleForm> |
| | | </Edit > |
| | | </SimpleForm> |
| | | </Edit > |
| | | <CheckDiffItemList /> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <TextInput source="orderCode" label="table.field.checkDiff.orderCode" />, |
| | | <SelectInput source="checkType" label="table.field.checkDiff.checkType" |
| | | choices={[ |
| | |
| | | <NumberInput source="anfme" label="table.field.checkDiff.anfme" />, |
| | | <NumberInput source="checkQty" label="table.field.checkDiff.checkQty" />, |
| | | <NumberInput source="exceStatus" label="table.field.checkDiff.exceStatus" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | <NumberField source="anfme" label="table.field.checkDiff.anfme" /> |
| | | <NumberField source="checkQty" label="table.field.checkDiff.checkQty" /> |
| | | <NumberField source="exceStatus" label="table.field.checkDiff.exceStatus" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useGetRecordId, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <NumberInput source="checkId" label="table.field.checkDiffItem.checkId" />, |
| | | <TextInput source="orderCode" label="table.field.checkDiffItem.orderCode" />, |
| | | <TextInput source="maktx" label="table.field.checkDiffItem.maktx" />, |
| | |
| | | <NumberInput source="checkQty" label="table.field.checkDiffItem.checkQty" />, |
| | | <NumberInput source="exceStatus" label="table.field.checkDiffItem.exceStatus" />, |
| | | <TextInput source="reason" label="table.field.checkDiffItem.reason" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | |
| | | const CheckDiffItemList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const orderId = useGetRecordId(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | |
| | | }), |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | resource="checkDiffItem" |
| | | title={"menu.checkDiffItem"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | empty={false} |
| | | filters={filters} |
| | | filter={{checkId: orderId}} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='checkDiffItem' /> |
| | | <MyExportButton /> |
| | | </TopToolbar> |
| | |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='checkDiffItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <CheckDiffItemPanel />} |
| | | expand={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | |
| | | <NumberField source="checkQty" label="table.field.checkDiffItem.checkQty" /> |
| | | <NumberField source="exceStatus" label="table.field.checkDiffItem.exceStatus" /> |
| | | <TextField source="reason" label="table.field.checkDiffItem.reason" /> |
| | | |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField> |
| | |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <CheckDiffItemCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | <PageDrawer |
| | | title='CheckDiffItem Detail' |
| | | drawerVal={drawerVal} |
| | | setDrawerVal={setDrawerVal} |
| | | > |
| | | </PageDrawer> |
| | | </Box> |
| | | ) |
| | | } |
| | |
| | | @Autowired |
| | | private CheckDiffItemService checkDiffItemService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkDiffItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:checkDiff:list')") |
| | | @PostMapping("/checkDiffItem/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | |
| | | return R.ok().add(checkDiffItemService.page(pageParam, pageParam.buildWrapper(true))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkDiffItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:checkDiff:list')") |
| | | @PostMapping("/checkDiffItem/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(checkDiffItemService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkDiffItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:checkDiff:list')") |
| | | @PostMapping({"/checkDiffItem/many/{ids}", "/checkDiffItems/many/{ids}"}) |
| | | public R many(@PathVariable Long[] ids) { |
| | | return R.ok().add(checkDiffItemService.listByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkDiffItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:checkDiff:list')") |
| | | @GetMapping("/checkDiffItem/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(checkDiffItemService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkDiffItem:save')") |
| | | @PreAuthorize("hasAuthority('manager:checkDiff:save')") |
| | | @OperationLog("Create 盘点明细差异表") |
| | | @PostMapping("/checkDiffItem/save") |
| | | public R save(@RequestBody CheckDiffItem checkDiffItem) { |
| | |
| | | return R.ok("Save Success").add(checkDiffItem); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkDiffItem:update')") |
| | | @PreAuthorize("hasAuthority('manager:checkDiff:update')") |
| | | @OperationLog("Update 盘点明细差异表") |
| | | @PostMapping("/checkDiffItem/update") |
| | | public R update(@RequestBody CheckDiffItem checkDiffItem) { |
| | |
| | | return R.ok("Update Success").add(checkDiffItem); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkDiffItem:remove')") |
| | | @PreAuthorize("hasAuthority('manager:checkDiff:remove')") |
| | | @OperationLog("Delete 盘点明细差异表") |
| | | @PostMapping("/checkDiffItem/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | |
| | | return R.ok("Delete Success").add(ids); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkDiffItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:checkDiff:list')") |
| | | @PostMapping("/checkDiffItem/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:checkDiffItem:list')") |
| | | @PreAuthorize("hasAuthority('manager:checkDiff:list')") |
| | | @PostMapping("/checkDiffItem/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(checkDiffItemService.list(), CheckDiffItem.class), response); |
| | |
| | | private Double checkQty; |
| | | |
| | | /** |
| | | * 执行状态 |
| | | */ |
| | | @ApiModelProperty(value= "执行状态") |
| | | private Integer exceStatus; |
| | | |
| | | /** |
| | | * 差异原因 |
| | | */ |
| | | @ApiModelProperty(value= "差异原因") |
| | |
| | | |
| | | public CheckDiffItem() {} |
| | | |
| | | public CheckDiffItem(Long checkId,String orderCode,String maktx,String matnrCode,String spec,String model,String barcode,String batch,Double anfme,Double checkQty,Integer exceStatus,String reason,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | public CheckDiffItem(Long checkId,String orderCode,String maktx,String matnrCode,String spec,String model,String barcode,String batch,Double anfme,Double checkQty,String reason,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.checkId = checkId; |
| | | this.orderCode = orderCode; |
| | | this.maktx = maktx; |
| | |
| | | this.batch = batch; |
| | | this.anfme = anfme; |
| | | this.checkQty = checkQty; |
| | | this.exceStatus = exceStatus; |
| | | this.reason = reason; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.CheckDiffExceStatus; |
| | | import com.vincent.rsf.server.manager.enums.CheckExceStatus; |
| | | import com.vincent.rsf.server.manager.enums.TaskStsType; |
| | | import com.vincent.rsf.server.manager.enums.TaskType; |
| | | import com.vincent.rsf.server.manager.enums.*; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.manager.service.impl.LocServiceImpl; |
| | | import com.vincent.rsf.server.system.utils.SystemAuthUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private CheckOrderService checkOrderService; |
| | | @Autowired |
| | | private CheckOrderItemService checkOrderItemService; |
| | | @Autowired |
| | | private LocServiceImpl locService; |
| | | |
| | | /** |
| | | * @author Ryan |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void genReCheck() { |
| | | List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>() |
| | | .notExists("SELECT 1 FROM man_check_diff_item cdi WHERE id = cdi.task_item_id")); |
| | | .notExists("SELECT 1 FROM man_check_diff_item cdi WHERE id != cdi.task_item_id")); |
| | | if (taskItems.isEmpty()) { |
| | | return; |
| | | } |
| | |
| | | List<CheckDiffItem> diffItems = new ArrayList<>(); |
| | | CheckDiff finalCheckDiff = checkDiff; |
| | | items.forEach(item -> { |
| | | Task task = taskService.getById(item.getTaskId()); |
| | | if (Objects.isNull(task)) { |
| | | throw new CoolException("数据错误:任务不存在!!"); |
| | | } |
| | | CheckDiffItem checkDiffItem = new CheckDiffItem(); |
| | | BeanUtils.copyProperties(item, checkDiffItem); |
| | | checkDiffItem.setCheckId(finalCheckDiff.getId()) |
| | |
| | | .setTaskId(item.getTaskId()) |
| | | .setCreateBy(loginUserId) |
| | | .setCreateTime(new Date()) |
| | | .setBarcode(task.getBarcode()) |
| | | .setUpdateBy(loginUserId) |
| | | .setUpdateTime(new Date()) |
| | | .setOrderCode(finalCheckDiff.getOrderCode()); |
| | | diffItems.add(checkDiffItem); |
| | | |
| | | if (Objects.isNull(finalCheckDiff.getAreaId())) { |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>() |
| | | .eq(Loc::getCode, task.getOrgLoc()) |
| | | .eq(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_R.type)); |
| | | if (Objects.isNull(loc)) { |
| | | throw new CoolException("盘点库位不存在!!"); |
| | | } |
| | | finalCheckDiff.setAreaId(loc.getAreaId()).setAreaName(loc.getAreaId$()); |
| | | |
| | | if (!checkDiffService.updateById(finalCheckDiff)) { |
| | | throw new CoolException("库区信息修改失败!!"); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | if (!checkDiffItemService.saveBatch(diffItems)) { |