Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
# Conflicts:
# rsf-admin/.env
| | |
| | | VITE_BASE_IP=localhost |
| | | VITE_BASE_IP=192.168.4.13 |
| | | # VITE_BASE_IP=47.76.147.249 |
| | | VITE_BASE_PORT=8080 |
| | |
| | | disQty: "disQty", |
| | | safeQty: "safeQty", |
| | | picPath: "picPath", |
| | | trackCode: "trackCode", |
| | | }, |
| | | dictType: { |
| | | code: "Code", |
| | |
| | | siteInit: 'site init', |
| | | batch: 'batch', |
| | | confirm: 'confirm', |
| | | cancel: "cancel", |
| | | top: "top", |
| | | resort: "sort", |
| | | subzone: 'subzone', |
| | | bindmatnr: 'bind matnr', |
| | | bindloc: 'bind loc', |
| | |
| | | qlyInspect: { |
| | | asnId: "收货通知单号", |
| | | asnCode: "收货通知单编码", |
| | | code: "编码", |
| | | code: "质检单编码", |
| | | wkType: "业务类型", |
| | | safeQty: "合格数量", |
| | | dlyQty: "送货数量", |
| | |
| | | disQty: "不合数量", |
| | | safeQty: "合格数量", |
| | | picPath: "图片路径", |
| | | trackCode: "条形码", |
| | | }, |
| | | dictType: { |
| | | code: "字典编码", |
| | |
| | | poDetlCode: "PO单编码", |
| | | matnrId: "物料标识", |
| | | maktx: "物料名称", |
| | | maktxCode: "物料编码", |
| | | matnrCode: "物料编码", |
| | | anfme: "数量", |
| | | stockUnit: "库存单位", |
| | | purQty: "计划收货数量", |
| | |
| | | siteInit: '站点初始化', |
| | | batch: '批量操作', |
| | | confirm: '确认', |
| | | cancel: "取消", |
| | | top: "置顶", |
| | | resort: "排序", |
| | | subzone: '绑定分区', |
| | | bindmatnr: '绑定物料', |
| | | bindloc: '绑定库位', |
| | |
| | | editable: false, |
| | | }, |
| | | { |
| | | field: 'maktxCode', |
| | | headerName: translate('table.field.asnOrderItem.maktxCode'), |
| | | field: 'matnrCode', |
| | | headerName: translate('table.field.asnOrderItem.matnrCode'), |
| | | width: 130, |
| | | editable: false, |
| | | }, |
| | |
| | | field: 'poDetlCode', |
| | | headerName: translate('table.field.asnOrderItem.poDetlCode') |
| | | }, |
| | | // { |
| | | // field: 'matnrCode', |
| | | // headerName: translate('table.field.asnOrderItem.matnrCode') |
| | | // }, |
| | | { |
| | | field: 'matnrCode', |
| | | headerName: translate('table.field.asnOrderItem.matnrCode') |
| | | }, |
| | | { |
| | | field: 'maktx', |
| | | headerName: translate('table.field.asnOrderItem.maktx'), |
| | |
| | | }}> |
| | | |
| | | <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '4px', alignItems: 'center' }}> |
| | | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" variant="outlined" sx={{ width: '300px' }} /> |
| | | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" variant="outlined" sx={{ width: '300px' }} size="small" /> |
| | | |
| | | <div style={{ display: 'flex', gap: '10px' }}> |
| | | <PrintsButton rows={selectedRows} /> |
| | |
| | | return { |
| | | matnrId: el.id, |
| | | maktx: el.name, |
| | | maktxCode: el.code, |
| | | matnrCode: el.code, |
| | | stockUnit: el.stockUnit || '', |
| | | purUnit: el.purchaseUnit || '', |
| | | ...dynamicFields |
| | |
| | | const [columns, setColumns] = useState([ |
| | | // { field: 'id', headerName: 'ID', width: 100 }, |
| | | { field: 'name', headerName: translate('table.field.matnr.name'), width: 300 }, |
| | | { field: 'code', headerName: translate('table.field.matnr.code'), width: 100 }, |
| | | { field: 'code', headerName: translate('table.field.matnr.code'), width: 200 }, |
| | | { field: 'groupId$', headerName: translate('table.field.matnr.groupId'), width: 100 }, |
| | | { field: 'spec', headerName: translate('table.field.matnr.spec'), width: 100 }, |
| | | { field: 'model', headerName: translate('table.field.matnr.model'), width: 100 }, |
| | |
| | | }}> |
| | | |
| | | <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '4px', alignItems: 'center' }}> |
| | | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" variant="outlined" sx={{ width: '300px' }} /> |
| | | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" variant="outlined" sx={{ width: '300px' }} size="small" /> |
| | | |
| | | <div style={{ display: 'flex', gap: '10px' }}> |
| | | </div> |
| | |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'asnId', 'statusBool']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="asnId" label="table.field.qlyInspect.asnId" /> |
| | | <NumberField source="asnCode" label="table.field.qlyInspect.asnCode" /> |
| | | <TextField source="code" label="table.field.qlyInspect.code" /> |
| | | <TextField source="isptStatus$" label="table.field.qlyInspect.isptStatus" /> |
| | | <TextField source="wkType$" label="table.field.qlyInspect.wkType" /> |
| | | <NumberField source="asnId" label="table.field.qlyInspect.asnId" /> |
| | | <NumberField source="asnCode" label="table.field.qlyInspect.asnCode" /> |
| | | <NumberField source="safeQty" label="table.field.qlyInspect.safeQty" /> |
| | | <NumberField source="dlyQty" label="table.field.qlyInspect.dlyQty" /> |
| | | <NumberField source="rcptQty" label="table.field.qlyInspect.rcptQty" /> |
| | |
| | | }, |
| | | { |
| | | field: 'matnrCode', |
| | | headerName: translate('table.field.qlyIsptItem.matnrCode') |
| | | headerName: translate('table.field.qlyIsptItem.matnrCode'), |
| | | width: 200 |
| | | }, |
| | | { |
| | | field: 'maktx', |
| | | headerName: translate('table.field.qlyIsptItem.maktx'), |
| | | width: 200 |
| | | }, |
| | | // { |
| | | // field: 'trackCode', |
| | | // headerName: translate('table.field.qlyIsptItem.trackCode'), |
| | | // width: 200 |
| | | // }, |
| | | // { |
| | | // field: 'label', |
| | | // headerName: translate('table.field.qlyIsptItem.label') |
| | |
| | | headerName: translate('table.field.qlyIsptItem.safeQty') |
| | | }, |
| | | { |
| | | field: 'picPath', |
| | | headerName: translate('table.field.qlyIsptItem.picPath') |
| | | } |
| | | field: 'isptResult$', |
| | | headerName: translate('table.field.qlyIsptItem.isptResult') |
| | | }, |
| | | // { |
| | | // field: 'picPath', |
| | | // headerName: translate('table.field.qlyIsptItem.picPath') |
| | | // } |
| | | ]; |
| | | |
| | | const maktxChange = (value) => { |
| | |
| | | }}> |
| | | |
| | | <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '4px', alignItems: 'center' }}> |
| | | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" variant="outlined" sx={{ width: '300px' }} /> |
| | | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" variant="outlined" sx={{ width: '300px' }} size="small" /> |
| | | |
| | | <div style={{ display: 'flex', gap: '10px' }}> |
| | | </div> |
| | |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | Button, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import SwapVertIcon from '@mui/icons-material/SwapVert'; |
| | | import AlignVerticalTopIcon from '@mui/icons-material/AlignVerticalTop'; |
| | | import TaskAltIcon from '@mui/icons-material/TaskAlt'; |
| | | import CancelIcon from '@mui/icons-material/Cancel'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | |
| | | <SearchInput source="condition" alwaysOn />, |
| | | <DateInput label='common.time.after' source="timeStart" alwaysOn />, |
| | | <DateInput label='common.time.before' source="timeEnd" alwaysOn />, |
| | | |
| | | <TextInput source="taskCode" label="table.field.task.taskCode" />, |
| | | <NumberInput source="taskStatus" label="table.field.task.taskStatus" />, |
| | | <NumberInput source="taskType" label="table.field.task.taskType" />, |
| | |
| | | <TextInput source="expCode" label="table.field.task.expCode" />, |
| | | <DateInput source="startTime" label="table.field.task.startTime" />, |
| | | <DateInput source="endTime" label="table.field.task.endTime" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | |
| | | const TaskList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | |
| | |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.task"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | // empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */} |
| | | <SelectColumnsButton preferenceKey='task' /> |
| | | <MyExportButton /> |
| | | {/* <MyExportButton /> */} |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='task' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | // bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | bulkActionButtons={ |
| | | <> |
| | | <BulkResortButton /> |
| | | <BulkCancelButton /> |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} /> |
| | | </> |
| | | } |
| | | rowClick={(id, resource, record) => false} |
| | | expand={() => <TaskPanel />} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | // expand={() => <TaskPanel />} |
| | | // expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'robotCode', 'exceStatus', 'expDesc', 'expCode', 'sort']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="taskCode" label="table.field.task.taskCode" /> |
| | |
| | | <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"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | {/* <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> */} |
| | | <DoneButton sx={{ padding: '1px', fontSize: '.75rem' }} ></DoneButton> |
| | | <CancelButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | <SetTopButton sx={{ padding: '1px', fontSize: '.75rem' }} ></SetTopButton> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <TaskCreate |
| | | {/* <TaskCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | /> */} |
| | | <PageDrawer |
| | | title='Task Detail' |
| | | drawerVal={drawerVal} |
| | |
| | | } |
| | | |
| | | export default TaskList; |
| | | /** |
| | | * 完成操作 |
| | | * @returns |
| | | */ |
| | | const DoneButton = () => { |
| | | const record = useRecordContext(); |
| | | const clickComplete = () => { |
| | | completeTask([record]) |
| | | }; |
| | | //完成任务 |
| | | const completeTask = async (row) => { } |
| | | return ( |
| | | <Button |
| | | onClick={clickComplete} |
| | | label="toolbar.complete"> |
| | | <TaskAltIcon /> |
| | | </Button> |
| | | ) |
| | | } |
| | | |
| | | /** |
| | | * 取消按钮 |
| | | * @returns |
| | | */ |
| | | const CancelButton = () => { |
| | | const record = useRecordContext(); |
| | | const clickCancel = () => { |
| | | cancleTask([record]) |
| | | }; |
| | | //取消任务 |
| | | const cancleTask = async (row) => {} |
| | | return ( |
| | | <Button |
| | | onClick={clickCancel} |
| | | label="toolbar.cancel"> |
| | | <CancelIcon /> |
| | | </Button> |
| | | ) |
| | | } |
| | | /** |
| | | * 置顶操作 |
| | | * @returns |
| | | */ |
| | | const SetTopButton = () => { |
| | | const record = useRecordContext(); |
| | | const clickTop = () => { |
| | | topTask([record]) |
| | | }; |
| | | //置顶任务 |
| | | const topTask = async (row) => { } |
| | | return ( |
| | | <Button |
| | | onClick={clickTop} |
| | | label="toolbar.top"> |
| | | <AlignVerticalTopIcon /> |
| | | </Button> |
| | | ) |
| | | } |
| | | |
| | | /** |
| | | * 批量取消 |
| | | * @returns |
| | | */ |
| | | const BulkCancelButton = () => { |
| | | const record = useRecordContext(); |
| | | const clickCancel = () => { |
| | | cancleTask([record]) |
| | | }; |
| | | //取消任务 |
| | | const cancleTask = async (row) => {} |
| | | return ( |
| | | <Button |
| | | onClick={clickCancel} |
| | | label="toolbar.cancel"> |
| | | <CancelIcon /> |
| | | </Button> |
| | | ) |
| | | } |
| | | |
| | | /** |
| | | * 批量排序 |
| | | * @returns |
| | | */ |
| | | const BulkResortButton = () => { |
| | | const record = useRecordContext(); |
| | | const bulkResort = () => { |
| | | resortTask([record]) |
| | | }; |
| | | //批量排序 |
| | | const resortTask = async (row) => { } |
| | | return ( |
| | | <Button |
| | | onClick={bulkResort} |
| | | label="toolbar.resort"> |
| | | <SwapVertIcon /> |
| | | </Button> |
| | | ) |
| | | |
| | | } |
| | |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <TextInput |
| | | label="table.field.taskItem.sourceCode" |
| | | source="sourceCode" |
| | | parse={v => v} |
| | | /> |
| | | </Grid> |
| | | <Grid item xs={6} display="flex" gap={1}> |
| | | <NumberInput |
| | | label="table.field.taskItem.matnrId" |
| | | source="matnrId" |
| | |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.taskItem.sourceCode" |
| | | source="sourceCode" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.taskItem.matnrId" |
| | | source="matnrId" |
| | |
| | | <TextInput source="batch" label="table.field.taskItem.batch" />, |
| | | <TextInput source="spec" label="table.field.taskItem.spec" />, |
| | | <TextInput source="model" label="table.field.taskItem.model" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | | <SelectInput |
| | | label="common.field.status" |
| | |
| | | }}> |
| | | |
| | | <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '4px', alignItems: 'center' }}> |
| | | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" variant="outlined" sx={{ width: '300px' }} /> |
| | | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" variant="outlined" sx={{ width: '300px' }} size="small" /> |
| | | |
| | | <div style={{ display: 'flex', gap: '10px' }}> |
| | | </div> |
| | |
| | | }}> |
| | | |
| | | <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '4px', alignItems: 'center' }}> |
| | | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" variant="outlined" sx={{ width: '300px' }} /> |
| | | <TextField value={maktx} onChange={(e) => maktxChange(e.target.value)} label="搜索物料" variant="outlined" sx={{ width: '300px' }} size="small" /> |
| | | |
| | | <div style={{ display: 'flex', gap: '10px' }}> |
| | | </div> |
| | |
| | | <NumberField source="matnrId" label="table.field.warehouseAreasItem.matnrId" /> |
| | | <TextField source="matnrName" label="table.field.warehouseAreasItem.matnrName" /> |
| | | <TextField source="matnrCode" label="table.field.warehouseAreasItem.matnrCode" /> |
| | | <TextField source="trackCode" label="table.field.warehouseAreasItem.barcode" /> |
| | | <TextField source="barcode" label="table.field.warehouseAreasItem.barcode" /> |
| | | <NumberField source="anfme" label="table.field.warehouseAreasItem.anfme" /> |
| | | <TextField source="batch" label="table.field.warehouseAreasItem.batch" /> |
| | | <TextField source="unit" label="table.field.warehouseAreasItem.unit" /> |
| | |
| | | package com.vincent.rsf.server.api.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.controller.params.CheckObjParams; |
| | | import com.vincent.rsf.server.api.controller.params.OpStockParams; |
| | | import com.vincent.rsf.server.api.controller.params.OtherReceiptParams; |
| | | import com.vincent.rsf.server.api.controller.params.ReceiptParams; |
| | | import com.vincent.rsf.server.api.service.MobileService; |
| | | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderItem; |
| | | import com.vincent.rsf.server.manager.entity.QlyIsptItem; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import com.vincent.rsf.server.system.controller.param.LoginParam; |
| | |
| | | } |
| | | return mobileService.receiptToWarehouse(params); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | @PostMapping("/orders/other") |
| | |
| | | return mobileService.confirmIspt(id); |
| | | } |
| | | |
| | | @ApiOperation("快速质检信息") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:list')") |
| | | @PostMapping("/inspect/query") |
| | | public R checkObjs(@RequestBody CheckObjParams params) { |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("快带质检") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:update')") |
| | | @PostMapping("/inspect/check/update") |
| | | public R checkUpdate(@RequestBody QlyIsptItem params) { |
| | | if (Objects.isNull(params)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return mobileService.checkUpdate(params); |
| | | } |
| | | |
| | | @ApiOperation("获取上架信息") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:list')") |
| | | @PostMapping("/stock/operate") |
| | | public R operateToStock(@RequestBody OpStockParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return mobileService.operateToStock(params); |
| | | } |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.api.controller.params; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "OpStockParams", description = "人工上架参数") |
| | | public class OpStockParams { |
| | | |
| | | @ApiModelProperty("拖盘码") |
| | | private String barcode; |
| | | @ApiModelProperty("单号") |
| | | private String asnCode; |
| | | @ApiModelProperty("物料编码") |
| | | private String matnrCode; |
| | | } |
| | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("ID") |
| | | private Long id; |
| | | @ApiModelProperty("质检单") |
| | | private String isptCode; |
| | | @ApiModelProperty("物料编码") |
| | |
| | | private String splrBatch; |
| | | @ApiModelProperty("收货数量") |
| | | private Double rcptQty; |
| | | @ApiModelProperty("送货数量") |
| | | private Double dlyQty; |
| | | @ApiModelProperty("合格数量") |
| | | private Double safeQty; |
| | | @ApiModelProperty("不合格数量") |
| | | private Double disQty; |
| | | @ApiModelProperty("图片路径") |
| | | private String picPath; |
| | | @ApiModelProperty("质检结果") |
| | | private String isptResult; |
| | | @ApiModelProperty("备注") |
| | | private String memo; |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.api.entity.dto; |
| | | |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderItem; |
| | | |
| | | public class OperateStockDto extends AsnOrderItem { |
| | | |
| | | |
| | | } |
| | |
| | |
|
| | | public enum TaskStsType {
|
| | |
|
| | | //任务状态
|
| | | GENERATE_IN(1L, "创建入库任务"),
|
| | | WCS_EXECUTE_IN(2L, "RCS任务已下发"),
|
| | | WCS_CONTAINER_RECEIVE(3L, "RCS容器到达"),
|
| | |
|
| | | WCS_CONVEYOR_START(4L, "RCS容器流动任务已下发"),
|
| | |
|
| | | WCS_TOTE_LOAD(5L, "RCS取箱完成"),
|
| | |
|
| | | WCS_TOTE_UNLOAD(6L, "RCS放箱完成"),
|
| | |
|
| | | WCS_PUTAWAY_SUCESS(7L, "RCS任务完成"),
|
| | |
|
| | | // WCS_PUTAWAY_FAILED(11L, "任务失败"),
|
| | |
| | | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.server.api.controller.params.CheckObjParams; |
| | | import com.vincent.rsf.server.api.controller.params.OpStockParams; |
| | | import com.vincent.rsf.server.api.controller.params.OtherReceiptParams; |
| | | import com.vincent.rsf.server.api.controller.params.ReceiptParams; |
| | | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; |
| | |
| | | R checkObjs(CheckObjParams params); |
| | | |
| | | R checkUpdate(QlyIsptItem params); |
| | | |
| | | R operateToStock(OpStockParams params); |
| | | } |
| | |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.controller.params.CheckObjParams; |
| | | import com.vincent.rsf.server.api.controller.params.OpStockParams; |
| | | import com.vincent.rsf.server.api.controller.params.OtherReceiptParams; |
| | | import com.vincent.rsf.server.api.controller.params.ReceiptParams; |
| | | import com.vincent.rsf.server.api.entity.dto.CheckObjDto; |
| | |
| | | import com.vincent.rsf.server.system.service.FieldsService; |
| | | import com.vincent.rsf.server.system.service.UserLoginService; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import org.apache.tika.utils.StringUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | @Autowired |
| | | private FieldsItemService fieldsItemService; |
| | | |
| | | @Autowired |
| | | private LocService locService; |
| | | |
| | | |
| | | /** |
| | | * @author Ryan |
| | |
| | | */ |
| | | @Override |
| | | public R getOrderByCode(String barcode) { |
| | | if (StringUtils.isEmpty(barcode)) { |
| | | if (StringUtils.isBlank(barcode)) { |
| | | return R.error("标签码不能为空!!"); |
| | | } |
| | | List<AsnOrderItem> asnOrderItem = asnOrderItemMapper.selectList(new LambdaQueryWrapper<AsnOrderItem>().eq(AsnOrderItem::getTrackCode, barcode)); |
| | |
| | | CheckObjDto objDto = new CheckObjDto(); |
| | | objDto.setIsptCode(inspect.getCode()) |
| | | .setAsnCode(inspect.getAsnCode()) |
| | | .setId(isptItem.getId()) |
| | | .setMatnrCode(isptItem.getMatnrCode()) |
| | | .setMaktx(isptItem.getMaktx()) |
| | | .setDisQty(isptItem.getDisQty()) |
| | | .setDlyQty(isptItem.getDlyQty()) |
| | | .setRcptQty(isptItem.getRcptQty()) |
| | | .setIsptResult(isptItem.getIsptResult()) |
| | | .setSplrBatch(isptItem.getSplrBatch()) |
| | | .setSplrName(isptItem.getSplrName()) |
| | | .setPicPath(isptItem.getPicPath()) |
| | |
| | | */ |
| | | @Override |
| | | public R checkUpdate(QlyIsptItem params) { |
| | | if (Objects.isNull(params.getId()) || Objects.isNull(params.getIspectId())) { |
| | | if (Objects.isNull(params.getId())) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | IsptItemsParams itemsParams = new IsptItemsParams(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 人工上架 |
| | | * @param |
| | | * @return |
| | | * @time 2025/4/2 16:33 |
| | | */ |
| | | @Override |
| | | public R operateToStock(OpStockParams params) { |
| | | if (org.apache.commons.lang3.StringUtils.isBlank(params.getBarcode())) { |
| | | throw new CoolException("拖盘码不能为空!!"); |
| | | } |
| | | if (StringUtils.isBlank(params.getAsnCode())) { |
| | | throw new CoolException("单据不能为空!!"); |
| | | } |
| | | if (StringUtils.isBlank(params.getMatnrCode())) { |
| | | throw new CoolException("物料编码不能为空!!"); |
| | | } |
| | | AsnOrder asnOrders = asnOrderMapper.getOne(new LambdaQueryWrapper<AsnOrder>().eq(AsnOrder::getCode, params.getAsnCode())); |
| | | if (Objects.isNull(asnOrders)) { |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | | List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getBarcode, params.getBarcode())); |
| | | if (!locs.isEmpty()) { |
| | | throw new CoolException("拖盘已使用"); |
| | | } |
| | | List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, params.getBarcode())); |
| | | if (!waitPakins.isEmpty()) { |
| | | throw new CoolException("拖盘已使用!!"); |
| | | } |
| | | List<AsnOrderItem> orderItems = asnOrderItemMapper.selectList(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .eq(AsnOrderItem::getAsnId, asnOrders.getId()) |
| | | .eq(AsnOrderItem::getMatnrCode, params.getMatnrCode())); |
| | | if (orderItems.isEmpty()) { |
| | | throw new CoolException("单据明细不存在!!"); |
| | | } |
| | | List<AsnOrderItem> stocks = new ArrayList<>(); |
| | | orderItems.forEach(item -> { |
| | | item.setBarcode(params.getBarcode()); |
| | | stocks.add(item); |
| | | }); |
| | | return R.ok(stocks); |
| | | } |
| | | |
| | | /** |
| | | * 获取ReceiptDetlsDtos |
| | | */ |
| | | private R getAsnOrderItem(List<AsnOrderItem> items) { |
New file |
| | |
| | | package com.vincent.rsf.server.common; |
| | | |
| | | |
| | | import com.vincent.rsf.framework.generators.ReactGenerator; |
| | | import com.vincent.rsf.framework.generators.constant.SqlOsType; |
| | | |
| | | /** |
| | | * Created by vincent on 2019-06-04 |
| | | */ |
| | | public class CodeBuilder { |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | ReactGenerator generator = new ReactGenerator(); |
| | | generator.backendPrefixPath = "rsf-server/"; |
| | | generator.frontendPrefixPath = "rsf-admin/"; |
| | | |
| | | generator.sqlOsType = SqlOsType.MYSQL; |
| | | generator.url="192.168.4.24:3306/rsf"; |
| | | generator.username="root"; |
| | | generator.password="34821015"; |
| | | // generator.url="47.97.1.152:51433;databasename=jkasrs"; |
| | | // generator.username="sa"; |
| | | // generator.password="Zoneyung@zy56$"; |
| | | |
| | | generator.table="man_ispt_histories"; |
| | | generator.tableDesc="任务工作档"; |
| | | generator.packagePath="com.vincent.rsf.server.manager"; |
| | | |
| | | generator.build(); |
| | | } |
| | | /* |
| | | CREATE TABLE `man_tablename` ( |
| | | `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID', |
| | | `code` VARCHAR(255) DEFAULT NULL COMMENT '编号', |
| | | `name` VARCHAR(255) DEFAULT NULL COMMENT '名称(*)', |
| | | `status` INT(1) NOT NULL DEFAULT '1' COMMENT '状态{1:正常,0:冻结}', |
| | | `deleted` INT(1) NOT NULL DEFAULT '0' COMMENT '是否删除{1:是,0:否}', |
| | | `tenant_id` INT(11) DEFAULT NULL COMMENT '租户[sys_tenant]', |
| | | `create_by` BIGINT(20) DEFAULT NULL COMMENT '添加人员[sys_user]', |
| | | `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间', |
| | | `update_by` BIGINT(20) DEFAULT NULL COMMENT '修改人员[sys_user]', |
| | | `update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', |
| | | `memo` VARCHAR(255) DEFAULT NULL COMMENT '备注', |
| | | PRIMARY KEY (`id`) |
| | | ) ENGINE=INNODB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; |
| | | */ |
| | | |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | | import com.vincent.rsf.server.common.annotation.OperationLog; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | |
| | | import com.vincent.rsf.server.manager.service.TaskItemService; |
| | | import com.vincent.rsf.server.manager.service.TaskService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | ExcelUtil.build(ExcelUtil.create(taskService.list(), Task.class), response); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:task:update')") |
| | | @ApiOperation("完成任务") |
| | | @GetMapping("/task/complete/{id}") |
| | | public R completeTask(@PathVariable String id) { |
| | | if (Objects.isNull(id)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | return taskService.completeTask(id); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; |
| | | import com.vincent.rsf.server.manager.entity.TaskItem; |
| | | import com.vincent.rsf.server.manager.entity.WaitPakin; |
| | | import com.vincent.rsf.server.manager.entity.WaitPakinItem; |
| | | import com.vincent.rsf.server.manager.service.TaskItemService; |
| | | import com.vincent.rsf.server.manager.service.TaskService; |
| | | import com.vincent.rsf.server.manager.service.WaitPakinItemService; |
| | | import com.vincent.rsf.server.manager.service.WaitPakinService; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Api(tags = "组拖通知档") |
| | | @RestController |
| | |
| | | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private TaskItemService taskItemService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:list')") |
| | | @PostMapping("/waitPakin/page") |
| | |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:remove')") |
| | | @OperationLog("Delete 组拖档") |
| | | @PostMapping("/waitPakin/remove/{ids}") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R remove(@PathVariable Long[] ids) { |
| | | List<WaitPakinItem> pakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>() |
| | | .in(WaitPakinItem::getPakinId, ids)); |
| | | if (!pakinItems.isEmpty()) { |
| | | return R.error("组拖档有明细任务"); |
| | | List<Long> list = pakinItems.stream().map(WaitPakinItem::getId).collect(Collectors.toList()); |
| | | List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().in(TaskItem::getSource, list)); |
| | | if (!taskItems.isEmpty()) { |
| | | return R.error("组拖档有明细任务"); |
| | | } |
| | | } |
| | | if (!waitPakinService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | | if (!waitPakinItemService.removeByIds(pakinItems)) { |
| | | throw new CoolException("明细删除失败!!"); |
| | | } |
| | | return R.ok("Delete Success").add(ids); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | | import com.vincent.rsf.server.common.annotation.OperationLog; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.TaskItem; |
| | | import com.vincent.rsf.server.manager.entity.WaitPakinItem; |
| | | import com.vincent.rsf.server.manager.service.TaskItemService; |
| | | import com.vincent.rsf.server.manager.service.WaitPakinItemService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | @Autowired |
| | | private WaitPakinItemService waitPakinItemService; |
| | | @Autowired |
| | | private TaskItemService taskItemService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:waitPakinItem:list')") |
| | | @PostMapping("/waitPakinItem/page") |
| | |
| | | @OperationLog("Delete 组拖档明细") |
| | | @PostMapping("/waitPakinItem/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (Objects.isNull(ids) || ids.length < 1) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().in(TaskItem::getSource, ids)); |
| | | if (!taskItems.isEmpty()) { |
| | | throw new CoolException("有任务明细未完成"); |
| | | } |
| | | if (!waitPakinItemService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | |
| | | public class AsnOrderItem implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 主单ID |
| | | */ |
| | | @ApiModelProperty(value= "主单ID") |
| | | private Long ispectId; |
| | | |
| | | @ApiModelProperty("质检单状态") |
| | | private String isptStatus; |
| | | |
| | | @ApiModelProperty("单据明细ID") |
| | | private Long asnItemId; |
| | | |
| | | /** |
| | | * 编号 |
| | | */ |
| | | @ApiModelProperty(value= "编号") |
| | | private String matnrCode; |
| | | |
| | | /** |
| | | * 物料名称 |
| | | */ |
| | | @ApiModelProperty(value= "物料名称") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 标签 |
| | | */ |
| | | @ApiModelProperty(value= "标签") |
| | | private String label; |
| | | |
| | | /**∂ |
| | | * 供应商名称 |
| | | */ |
| | | @ApiModelProperty(value= "供应商名称") |
| | | private String splrName; |
| | | |
| | | /** |
| | | * 供应商批次 |
| | | */ |
| | | @ApiModelProperty(value= "供应商批次") |
| | | private String splrBatch; |
| | | |
| | | /** |
| | | * 库存批次 |
| | | */ |
| | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @TableName("man_stock") |
| | | public class Stock implements Serializable { |
| | | |
| | |
| | | * ASN单据, 带出PO单 |
| | | */ |
| | | @ApiModelProperty(value= "ASN单据, 带出PO单") |
| | | private String asnOrder; |
| | | private Long asnId; |
| | | @ApiModelProperty("订单编码") |
| | | private String asnCode; |
| | | |
| | | /** |
| | | * ERP凭证 |
| | | */ |
| | | @ApiModelProperty(value= "ERP凭证") |
| | | private String erpToken; |
| | | @ApiModelProperty(value= "plat凭证") |
| | | private String platToken; |
| | | |
| | | /** |
| | | * ERP单号 |
| | | * plat单号 |
| | | */ |
| | | @ApiModelProperty(value= "ERP单号") |
| | | private String erpOrder; |
| | | @ApiModelProperty(value= "plat单号") |
| | | private String platOrderNo; |
| | | |
| | | /** |
| | | * ERP库存地址 |
| | | * plat库存地址 |
| | | */ |
| | | @ApiModelProperty(value= "ERP库存地址") |
| | | private String erpStkAdr; |
| | | @ApiModelProperty(value= "plat库存地址") |
| | | private String platStkAdr; |
| | | |
| | | /** |
| | | * 合同标识 |
| | |
| | | |
| | | public Stock() {} |
| | | |
| | | public Stock(String asnOrder,String erpToken,String erpOrder,String erpStkAdr,String contractId,String lockReason,Short lockStatus,String locker,Date lockedTime,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.asnOrder = asnOrder; |
| | | this.erpToken = erpToken; |
| | | this.erpOrder = erpOrder; |
| | | this.erpStkAdr = erpStkAdr; |
| | | public Stock(String asnOrder,String platToken,String platOrder,String platStkAdr,String contractId,String lockReason,Short lockStatus,String locker,Date lockedTime,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.platOrderNo = asnOrder; |
| | | this.platToken = platToken; |
| | | this.platOrderNo = platOrder; |
| | | this.platStkAdr = platStkAdr; |
| | | this.contractId = contractId; |
| | | this.lockReason = lockReason; |
| | | this.lockStatus = lockStatus; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @TableName("man_stock_item") |
| | | public class StockItem implements Serializable { |
| | | |
| | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 任务明细ID |
| | | */ |
| | | @ApiModelProperty("任务明细ID") |
| | | private Long taskItemId; |
| | | |
| | | /** |
| | | * 库存外键标识 |
| | | */ |
| | | @ApiModelProperty(value= "库存外键标识") |
| | | private String stockId; |
| | | private Long stockId; |
| | | |
| | | /** |
| | | * 物料标识 |
| | |
| | | * 锁定原因 |
| | | */ |
| | | @ApiModelProperty(value= "锁定原因") |
| | | @TableField(exist = false) |
| | | private String lockReason; |
| | | |
| | | /** |
| | | * 锁定状态 |
| | | */ |
| | | @ApiModelProperty(value= "锁定状态") |
| | | @TableField(exist = false) |
| | | private Short lockStatus; |
| | | |
| | | /** |
| | | * 锁定人 |
| | | */ |
| | | @ApiModelProperty(value= "锁定人") |
| | | @TableField(exist = false) |
| | | private String locker; |
| | | |
| | | /** |
| | | * 锁定时间 |
| | | */ |
| | | @ApiModelProperty(value= "锁定时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | @TableField(exist = false) |
| | | private Date lockedTime; |
| | | |
| | | /** |
| | |
| | | |
| | | public StockItem() {} |
| | | |
| | | public StockItem(String stockId,Long matnrId,Long asnItemId, String code,String matnrk,Double anfme,Double workQty,Double qty,Double weight,String unit,Long shipperId,String splrId,String brand,String batch,String prodTime,Long inspectId,String splrBtch,String asnOrder,String erpToken,String erpOrder,String erpStkAdr,Long locId,String barcode,Double purPrice,String lockReason,Short lockStatus,String locker,Date lockedTime,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | public StockItem(Long stockId,Long matnrId,Long asnItemId, String code,String matnrk,Double anfme,Double workQty,Double qty,Double weight,String unit,Long shipperId,String splrId,String brand,String batch,String prodTime,Long inspectId,String splrBtch,String asnOrder,String erpToken,String erpOrder,String erpStkAdr,Long locId,String barcode,Double purPrice,String lockReason,Short lockStatus,String locker,Date lockedTime,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.stockId = stockId; |
| | | this.matnrId = matnrId; |
| | | this.asnItemId = asnItemId; |
New file |
| | |
| | | package com.vincent.rsf.server.manager.schedules; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.entity.enums.TaskStsType; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.enums.LocStsType; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.sql.Array; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author Ryan |
| | | * 任务工作档 |
| | | */ |
| | | @Component |
| | | public class TaskSchedules { |
| | | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private TaskItemService taskItemService; |
| | | @Autowired |
| | | private StockItemService stockItemService; |
| | | @Autowired |
| | | private PurchaseService purchaseService; |
| | | @Autowired |
| | | private AsnOrderService asnOrderService; |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | @Autowired |
| | | private StockService stockService; |
| | | @Autowired |
| | | private LocService locService; |
| | | /** |
| | | * @author Ryan |
| | | * @description 完成入库,更新库存 |
| | | * @param |
| | | * @return |
| | | * @time 2025/4/2 12:37 |
| | | */ |
| | | @Scheduled(cron = "0 0/05 * * * ? ") |
| | | // @Scheduled(cron = "0/5 * * * * ?") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void completeInStock() { |
| | | List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getTaskStatus, TaskStsType.COMPLETE_IN.id)); |
| | | if (tasks.isEmpty()) { |
| | | return; |
| | | } |
| | | List<Long> list = tasks.stream().map(Task::getId).collect(Collectors.toList()); |
| | | List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().eq(TaskItem::getTaskId, list)); |
| | | if (taskItems.isEmpty()) { |
| | | throw new CoolException("任务明细为空!!"); |
| | | } |
| | | /**对任务明细按订单进行分组*/ |
| | | Map<Long, List<TaskItem>> orderMap = taskItems.stream().collect(Collectors.groupingBy(TaskItem::getOrderId)); |
| | | List<StockItem> stockItems = new ArrayList<>(); |
| | | orderMap.keySet().forEach(key -> { |
| | | AsnOrder order = asnOrderService.getOne(new LambdaQueryWrapper<AsnOrder>() |
| | | .eq(AsnOrder::getId, key) |
| | | .select(AsnOrder::getId, AsnOrder::getPoCode, AsnOrder::getCode)); |
| | | 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())); |
| | | stock.setPlatOrderNo(purchase.getPlatCode()).setPlatToken(purchase.getPlatId()); |
| | | } |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_STOCK_CODE, null); |
| | | if (StringUtils.isBlank(ruleCode)) { |
| | | throw new CoolException("当前业务:" + SerialRuleCode.SYS_STOCK_CODE + ",编码规则不存在!!"); |
| | | } |
| | | stock.setAsnId(order.getId()).setAsnCode(order.getCode()); |
| | | if (!stockService.save(stock)) { |
| | | throw new CoolException("库存保存失败!!"); |
| | | } |
| | | List<TaskItem> items = orderMap.get(key); |
| | | for (TaskItem item : items) { |
| | | /**通过任务明细中的taskId查询,获取TASK的目标库位信息*/ |
| | | Task taskServiceOne = taskService.getOne(new LambdaQueryWrapper<Task>() |
| | | .select(Task::getId, Task::getTargLoc, Task::getOrgLoc, Task::getBarcode) |
| | | .eq(Task::getId, item.getTaskId())); |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, taskServiceOne.getTargLoc())); |
| | | if (Objects.isNull(loc)) { |
| | | throw new CoolException("库位不存在!!"); |
| | | } |
| | | AsnOrderItem orderItem = asnOrderItemService.getOne(new LambdaQueryWrapper<AsnOrderItem>().eq(AsnOrderItem::getId, item.getOrderItemId())); |
| | | if (Objects.isNull(orderItem)) { |
| | | throw new CoolException("单据明细不存在!!"); |
| | | } |
| | | StockItem stockItem = new StockItem(); |
| | | BeanUtils.copyProperties(orderItem, stockItem); |
| | | stockItem.setAsnItemId(item.getOrderItemId()) |
| | | .setBarcode(taskServiceOne.getBarcode()) |
| | | .setLocId(loc.getId()) |
| | | .setId(null) |
| | | .setStockId(stock.getId()); |
| | | stockItems.add(stockItem); |
| | | } |
| | | if (!stockItemService.saveBatch(stockItems)) { |
| | | throw new CoolException("库存修改架失败!!"); |
| | | } |
| | | }); |
| | | /**修改库位状态为F.在库*/ |
| | | List<String> locCodes = tasks.stream().map(Task::getTargLoc).collect(Collectors.toList()); |
| | | if (!locService.update(new LambdaUpdateWrapper<Loc>().set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_F.type).in(Loc::getCode, locCodes))) { |
| | | throw new CoolException("库位状态修改失败!!"); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | public interface TaskService extends IService<Task> { |
| | | |
| | | R generateTasks(List<WaitPakin> waitPakin, Long loginUserId); |
| | | |
| | | R completeTask(String id); |
| | | } |
| | |
| | | throw new CoolException("ASN单据不能为空!!"); |
| | | } |
| | | List<PoItemsDto> items = purchaseMapper.poList(asnIds); |
| | | if (items.isEmpty()) { |
| | | throw new CoolException("物料所属采购单据不存在!!"); |
| | | } |
| | | if (reportMsgService.reportInspectNotify(items)) { |
| | | return true; |
| | | } else { |
| | |
| | | List<AsnOrderItem> orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .like(!Objects.isNull(params.get("maktx")), AsnOrderItem::getMaktx, params.get("maktx")) |
| | | .eq(!Objects.isNull(params.get("matnrCode")), AsnOrderItem::getMatnrCode, params.get("matnrCode"))); |
| | | |
| | | if (orderItems.isEmpty()) { |
| | | return new ArrayList<>(); |
| | | } |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vincent.rsf.server.manager.utils.LocManageUtil; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.enums.LocStsType; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | private TaskItemService taskItemService; |
| | | @Autowired |
| | | private WaitPakinItemService waitPakinItemService; |
| | | @Autowired |
| | | private LocService locService; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | * @time 2025/3/29 15:59 |
| | | */ |
| | | @Override |
| | | public R generateTasks(List<WaitPakin> waitPakin, Long loginUserId) { |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public synchronized R generateTasks(List<WaitPakin> waitPakin, Long loginUserId) { |
| | | if (Objects.isNull(waitPakin) || waitPakin.isEmpty()) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | |
| | | if (!this.save(task)) { |
| | | throw new CoolException("任务保存失败!!"); |
| | | } |
| | | if (!locService.update(new LambdaUpdateWrapper<Loc>().eq(Loc::getCode, pakin.getCode()) |
| | | .set(Loc::getUseStatus, LocStsType.LOC_STS_TYPE_S.type).set(Loc::getBarcode, pakin.getBarcode()))) { |
| | | throw new CoolException("库位预约失败!!"); |
| | | } |
| | | |
| | | /**获取组拖明细**/ |
| | | List<WaitPakinItem> waitPakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>().eq(WaitPakinItem::getPakinId, pakin.getId())); |
| | | if (waitPakinItems.isEmpty()) { |
| | |
| | | if (!taskItemService.saveBatch(taskItems)) { |
| | | throw new CoolException("任务明细保存失败!!"); |
| | | } |
| | | |
| | | |
| | | |
| | | }); |
| | | //TODO 任务生成完成需修改任务ASN订单状态为执行中,组拖删除需判断是否有子任务在执行 |
| | | |
| | | return R.ok("任务生成完毕!"); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 完成任务 |
| | | * @param |
| | | * @return |
| | | * @time 2025/4/2 11:15 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R completeTask(String id) { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.controller.params.PakinItem; |
| | | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrder; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderItem; |
| | | import com.vincent.rsf.server.manager.entity.WaitPakinItem; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.mapper.WaitPakinMapper; |
| | | import com.vincent.rsf.server.manager.entity.WaitPakin; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderItemService; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderService; |
| | | import com.vincent.rsf.server.manager.service.WaitPakinItemService; |
| | | import com.vincent.rsf.server.manager.service.WaitPakinService; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.parameters.P; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private WaitPakinItemService waitPakinItemService; |
| | | @Autowired |
| | | private LocService locService; |
| | | |
| | | /** |
| | | * @author Ryan |
| | |
| | | throw new CoolException("参数错误:托盘码为空!!"); |
| | | } |
| | | |
| | | List<WaitPakin> list = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, waitPakin.getBarcode())); |
| | | if (!list.isEmpty()) { |
| | | List<String> stringList = list.stream().map(WaitPakin::getCode).collect(Collectors.toList()); |
| | | String join = StringUtils.join(stringList, ","); |
| | | throw new CoolException("拖盘码:" + waitPakin.getBarcode() + "已被组拖单:" + join + "使用!!"); |
| | | } |
| | | |
| | | List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getBarcode, waitPakin.getBarcode())); |
| | | if (!locs.isEmpty()) { |
| | | List<String> locCodes = locs.stream().map(Loc::getCode).collect(Collectors.toList()); |
| | | String join = StringUtils.join(locCodes, ","); |
| | | throw new CoolException("拖盘码:" + waitPakin.getBarcode() + "已被库位:" + join + "使用!!"); |
| | | } |
| | | |
| | | double sum = waitPakin.getItems().stream().mapToDouble(PakinItem::getReceiptQty).sum(); |
| | | |
| | | WaitPakin pakin = new WaitPakin(); |
| | |
| | | * 任务编码生成规则 |
| | | */ |
| | | public final static String SYS_TASK_CODE = "sys_task_code"; |
| | | |
| | | /** |
| | | * 仓库编码规则 |
| | | */ |
| | | public final static String SYS_STOCK_CODE = "sys_stock_code"; |
| | | } |
| | |
| | | # global-config:
|
| | | # field-strategy: 0
|
| | | configuration:
|
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
| | | map-underscore-to-camel-case: true
|
| | | cache-enabled: true
|
| | | call-setters-on-nulls: true
|