7个文件已添加
27 文件已重命名
22个文件已修改
| | |
| | | companys: 'Companys', |
| | | serialRuleItem: 'SerialRuleItem', |
| | | serialRule: 'SerialRule', |
| | | asnOrder: 'AsnOrder', |
| | | asnOrderItem: 'AsnOrderItem', |
| | | purchase: 'Purchase', |
| | | purchaseItem: 'PurchaseItem', |
| | | whMat: 'Warehouse Mat', |
| | | }, |
| | | table: { |
| | |
| | | size: "size", |
| | | minWeight: "minWeight", |
| | | maxWeight: "maxWeight", |
| | | } |
| | | }, |
| | | asnOrder: { |
| | | code: "Code", |
| | | poCode: "poCode", |
| | | poId: "poId", |
| | | type: "Type", |
| | | wkType: "wkType", |
| | | anfme: "anfme", |
| | | qty: "qty", |
| | | logisNo: "logisNo", |
| | | arrTime: "Arrived", |
| | | rleStatus: "Release", |
| | | ntyStatus: "Notify", |
| | | }, |
| | | asnOrderItem: { |
| | | asnId: "asnId", |
| | | asnCode: "asnCode", |
| | | poDetlId: "poDetlId", |
| | | poDetlCode: "poDetlCode", |
| | | matnrId: "matnrId", |
| | | matnk: "matnk", |
| | | anfme: "anfme", |
| | | stockUnit: "stockUnit", |
| | | purQty: "purQty", |
| | | purUnit: "purUnit", |
| | | qty: "qty", |
| | | splrCode: "splrCode", |
| | | splrName: "splrName", |
| | | qrcode: "qrcode", |
| | | barcode: "barcode", |
| | | packName: "packName", |
| | | ntyStatus: "ntyStatus", |
| | | }, |
| | | purchaseItem: { |
| | | purchaseId: "purchaseId", |
| | | erpItemId: "erpItemId", |
| | | matnrCode: "matnrCode", |
| | | matnrName: "matnrName", |
| | | unit: "unit", |
| | | anfme: "anfme", |
| | | qty: "qty", |
| | | nromQty: "nromQty", |
| | | asnQty: "asnQty", |
| | | printQty: "printQty", |
| | | splrName: "splrName", |
| | | splrCode: "splrCode", |
| | | splrBatch: "splrBatch", |
| | | }, |
| | | purchase: { |
| | | code: "code", |
| | | erpId: "erpId", |
| | | type: "type", |
| | | wkType: "wkType", |
| | | source: "source", |
| | | preArr: "preArr", |
| | | anfme: "anfme", |
| | | qty: "qty", |
| | | workQty: "workQty", |
| | | channel: "channel", |
| | | erpCode: "erpCode", |
| | | project: "project", |
| | | startTime: "startTime", |
| | | endTime: "endTime", |
| | | }, |
| | | purchaseItem: { |
| | | purchaseId: "purchaseId", |
| | | erpItemId: "erpItemId", |
| | | matnrCode: "matnrCode", |
| | | matnrName: "matnrName", |
| | | unit: "unit", |
| | | anfme: "anfme", |
| | | qty: "qty", |
| | | nromQty: "nromQty", |
| | | asnQty: "asnQty", |
| | | printQty: "printQty", |
| | | splrName: "splrName", |
| | | splrCode: "splrCode", |
| | | splrBatch: "splrBatch", |
| | | }, |
| | | } |
| | | }, |
| | | page: { |
| | |
| | | companys: '往来企业', |
| | | serialRuleItem: '编码规则子表', |
| | | serialRule: '编码规则', |
| | | asnOrder: '收货通知单', |
| | | asnOrderItem: '收货明细', |
| | | purchase: 'PO单', |
| | | purchaseItem: 'PO单明细', |
| | | whMat: '库区物料关系', |
| | | }, |
| | | table: { |
| | |
| | | size: "尺寸", |
| | | minWeight: "最小重量", |
| | | maxWeight: "最大重量", |
| | | } |
| | | }, |
| | | asnOrder: { |
| | | code: "编码", |
| | | poCode: "PO编码", |
| | | poId: "PO标识", |
| | | type: "单据类型", |
| | | wkType: "业务类型", |
| | | anfme: "数量", |
| | | qty: "已完成数量", |
| | | logisNo: "logisNo", |
| | | arrTime: "预计到达时间", |
| | | rleStatus: "释放状态", |
| | | ntyStatus: "质检上报状态", |
| | | }, |
| | | asnOrderItem: { |
| | | asnId: "主单标识", |
| | | asnCode: "主单编码", |
| | | poDetlId: "PO单标识", |
| | | poDetlCode: "PO单编码", |
| | | matnrId: "物料标识", |
| | | matnk: "物料名称", |
| | | anfme: "数量", |
| | | stockUnit: "库存单位", |
| | | purQty: "采购数量", |
| | | purUnit: "采购单位", |
| | | qty: "已完成数量", |
| | | splrCode: "供应商编码", |
| | | splrName: "供应商名称", |
| | | qrcode: "二维码", |
| | | barcode: "条形码", |
| | | packName: "包装名称", |
| | | ntyStatus: "报检状态", |
| | | }, |
| | | purchase: { |
| | | code: "编码", |
| | | erpId: "erp标识", |
| | | type: "单据类型", |
| | | wkType: "业务类型", |
| | | source: "来源", |
| | | preArr: "预计到达", |
| | | anfme: "数量", |
| | | qty: "已完成数量", |
| | | workQty: "执行中数量", |
| | | channel: "收货通道", |
| | | erpCode: "Erp编码", |
| | | project: "项目名称", |
| | | startTime: "开始时间", |
| | | endTime: "结束时间", |
| | | }, |
| | | purchaseItem: { |
| | | purchaseId: "PO主单标识", |
| | | erpItemId: "erp明细标识", |
| | | matnrCode: "物料编码", |
| | | matnrName: "物料名称", |
| | | unit: "计量单位", |
| | | anfme: "数量", |
| | | qty: "已完成", |
| | | nromQty: "标包数量", |
| | | asnQty: "单据数量", |
| | | printQty: "打印数量", |
| | | splrName: "供应商名称", |
| | | splrCode: "供应商编码", |
| | | splrBatch: "供应商批次", |
| | | }, |
| | | } |
| | | }, |
| | | page: { |
| | |
| | | import matnrGroup from './basicInfo/matnrGroup'; |
| | | import warehouse from './basicInfo/warehouse'; |
| | | import warehouseAreas from './warehouseAreas'; |
| | | import loc from './loc'; |
| | | import loc from './basicInfo/loc'; |
| | | import container from './container'; |
| | | import contract from './contract'; |
| | | import qlyInspect from './qlyInspect'; |
| | | import dictType from './dictType'; |
| | | import dictData from './dictData'; |
| | | import dictType from './system/dicts/dictType'; |
| | | import dictData from './system/dicts/dictData'; |
| | | import companys from './basicInfo/companys'; |
| | | import serialRuleItem from './serialRuleItem'; |
| | | import serialRule from './serialRule'; |
| | | import serialRuleItem from './system/serialRuleItem'; |
| | | import serialRule from './system/serialRule'; |
| | | import whMat from './basicInfo/whMat'; |
| | | import asnOrder from './asnOrder'; |
| | | import asnOrderItem from './asnOrderItem'; |
| | | import purchaseItem from './purchaseItem'; |
| | | import purchase from './purchase'; |
| | | |
| | | |
| | | const ResourceContent = (node) => { |
| | |
| | | return serialRule; |
| | | case 'whMat': |
| | | return whMat; |
| | | case 'asnOrder': |
| | | return asnOrder; |
| | | case 'asnOrderItem': |
| | | return asnOrderItem; |
| | | case 'purchaseItem': |
| | | return purchaseItem; |
| | | case 'purchase': |
| | | return purchase; |
| | | default: |
| | | return { |
| | | list: ListGuesser, |
File was renamed from rsf-admin/src/page/loc/LocCreate.jsx |
| | |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | |
| | | const LocCreate = (props) => { |
| | | const { open, setOpen } = props; |
File was renamed from rsf-admin/src/page/loc/LocEdit.jsx |
| | |
| | | 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 MemoInput from "../../components/MemoInput"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
File was renamed from rsf-admin/src/page/loc/LocList.jsx |
| | |
| | | import { styled } from '@mui/material/styles'; |
| | | import LocCreate from "./LocCreate"; |
| | | import LocPanel from "./LocPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import MyField from "../../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | |
File was renamed from rsf-admin/src/page/loc/LocPanel.jsx |
| | |
| | | useTranslate, |
| | | useRecordContext, |
| | | } from 'react-admin'; |
| | | import PanelTypography from "../components/PanelTypography"; |
| | | import PanelTypography from "../../components/PanelTypography"; |
| | | import * as Common from '@/utils/common' |
| | | |
| | | const LocPanel = () => { |
File was renamed from rsf-admin/src/page/dictData/DictDataCreate.jsx |
| | |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import DialogCloseButton from "../../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../../components/StatusSelectInput"; |
| | | import MemoInput from "../../../components/MemoInput"; |
| | | |
| | | const DictDataCreate = (props) => { |
| | | const { open, setOpen } = props; |
File was renamed from rsf-admin/src/page/dictData/DictDataEdit.jsx |
| | |
| | | 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 MemoInput from "../../../components/MemoInput"; |
| | | import StatusSelectInput from "../../../components/StatusSelectInput"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
File was renamed from rsf-admin/src/page/dictData/DictDataList.jsx |
| | |
| | | import { styled } from '@mui/material/styles'; |
| | | import DictDataCreate from "./DictDataCreate"; |
| | | import DictDataPanel from "./DictDataPanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import EmptyData from "../../../components/EmptyData"; |
| | | import MyCreateButton from "../../../components/MyCreateButton"; |
| | | import MyExportButton from '../../../components/MyExportButton'; |
| | | import PageDrawer from "../../../components/PageDrawer"; |
| | | import MyField from "../../../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import CustomerTopToolBar from "../components/EditTopToolBar"; |
| | | import CustomerTopToolBar from "../../../components/EditTopToolBar"; |
| | | |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
File was renamed from rsf-admin/src/page/dictData/DictDataPanel.jsx |
| | |
| | | useTranslate, |
| | | useRecordContext, |
| | | } from 'react-admin'; |
| | | import PanelTypography from "../components/PanelTypography"; |
| | | import PanelTypography from "../../../components/PanelTypography"; |
| | | import * as Common from '@/utils/common' |
| | | |
| | | const DictDataPanel = () => { |
File was renamed from rsf-admin/src/page/dictType/DictTypeCreate.jsx |
| | |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import DialogCloseButton from "../../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../../components/StatusSelectInput"; |
| | | import MemoInput from "../../../components/MemoInput"; |
| | | |
| | | const DictTypeCreate = (props) => { |
| | | const { open, setOpen } = props; |
File was renamed from rsf-admin/src/page/dictType/DictTypeEdit.jsx |
| | |
| | | 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 MemoInput from "../../../components/MemoInput"; |
| | | import StatusSelectInput from "../../../components/StatusSelectInput"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
File was renamed from rsf-admin/src/page/dictType/DictTypeList.jsx |
| | |
| | | import { styled } from '@mui/material/styles'; |
| | | import DictTypeCreate from "./DictTypeCreate"; |
| | | import DictTypePanel from "./DictTypePanel"; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import MyCreateButton from "../components/MyCreateButton"; |
| | | import MyExportButton from '../components/MyExportButton'; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import MyField from "../components/MyField"; |
| | | import EmptyData from "../../../components/EmptyData"; |
| | | import MyCreateButton from "../../../components/MyCreateButton"; |
| | | import MyExportButton from '../../../components/MyExportButton'; |
| | | import PageDrawer from "../../../components/PageDrawer"; |
| | | import MyField from "../../../components/MyField"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | |
File was renamed from rsf-admin/src/page/dictType/DictTypePanel.jsx |
| | |
| | | useTranslate, |
| | | useRecordContext, |
| | | } from 'react-admin'; |
| | | import PanelTypography from "../components/PanelTypography"; |
| | | import PanelTypography from "../../../components/PanelTypography"; |
| | | import * as Common from '@/utils/common' |
| | | |
| | | const DictTypePanel = () => { |
File was renamed from rsf-admin/src/page/serialRule/SerialRuleEdit.jsx |
| | |
| | | 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 MemoInput from "../../components/MemoInput"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
File was renamed from rsf-admin/src/page/serialRule/SerialRulePanel.jsx |
| | |
| | | useTranslate, |
| | | useRecordContext, |
| | | } from 'react-admin'; |
| | | import PanelTypography from "../components/PanelTypography"; |
| | | import PanelTypography from "../../components/PanelTypography"; |
| | | import * as Common from '@/utils/common' |
| | | |
| | | const SerialRulePanel = () => { |
File was renamed from rsf-admin/src/page/serialRuleItem/SerialRuleItemCreate.jsx |
| | |
| | | Grid, |
| | | Box, |
| | | } from '@mui/material'; |
| | | import DialogCloseButton from "../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../components/StatusSelectInput"; |
| | | import MemoInput from "../components/MemoInput"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import MemoInput from "../../components/MemoInput"; |
| | | |
| | | const SerialRuleItemCreate = (props) => { |
| | | const { open, setOpen } = props; |
File was renamed from rsf-admin/src/page/serialRuleItem/SerialRuleItemEdit.jsx |
| | |
| | | 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 MemoInput from "../../components/MemoInput"; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | |
| | | const FormToolbar = () => { |
| | | const { getValues } = useFormContext(); |
File was renamed from rsf-admin/src/page/serialRuleItem/SerialRuleItemPanel.jsx |
| | |
| | | useTranslate, |
| | | useRecordContext, |
| | | } from 'react-admin'; |
| | | import PanelTypography from "../components/PanelTypography"; |
| | | import PanelTypography from "../../components/PanelTypography"; |
| | | import * as Common from '@/utils/common' |
| | | |
| | | const SerialRuleItemPanel = () => { |
New file |
| | |
| | | package com.vincent.rsf.common.domain;
|
| | |
|
| | | import lombok.Data;
|
| | | import lombok.experimental.Accessors;
|
| | | import java.io.Serializable;
|
| | | import java.util.Map;
|
| | |
|
| | | /***
|
| | | * 下发任务响应Bean
|
| | | */
|
| | | @Data
|
| | | @Accessors(chain = true)
|
| | | public class CommonReponse implements Serializable {
|
| | |
|
| | | /***
|
| | | * 响应状态码。
|
| | | * 0:表示接口请求成功。
|
| | | * 其他值:表示接口请求失败,详细信息请参考错误码。
|
| | | */
|
| | | private Integer code;
|
| | | /**
|
| | | *返回信息说明。
|
| | | * 成功:"success"。
|
| | | * 其他:详细描述。
|
| | | * */
|
| | | private String msg;
|
| | | /**
|
| | | *返回的响应数据结构。
|
| | | * */
|
| | | private Map<String, Object> data;
|
| | | }
|
| | |
| | | arrTime: "arrTime", |
| | | rleStatus: "rleStatus", |
| | | name: "name", |
| | | ntyStatus: "ntyStatus", |
| | | }, |
| | | |
| | | -- ResourceContent |
| | |
| | | -- mysql |
| | | insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `tenant_id`, `status`) values ( 'menu.asnOrderItem', '0', '/manager/asnOrderItem', 'asnOrderItem', '0' , '0', '1' , '1'); |
| | | |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query ASN单据', '', '1', 'manager:asnOrderItem:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create ASN单据', '', '1', 'manager:asnOrderItem:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update ASN单据', '', '1', 'manager:asnOrderItem:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete ASN单据', '', '1', 'manager:asnOrderItem:remove', '3', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query ASN单据', '139', '1', 'manager:asnOrderItem:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create ASN单据', '139', '1', 'manager:asnOrderItem:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update ASN单据', '139', '1', 'manager:asnOrderItem:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete ASN单据', '139', '1', 'manager:asnOrderItem:remove', '3', '1', '1'); |
| | | |
| | | -- locale menu name |
| | | asnOrderItem: 'AsnOrderItem', |
| | |
| | | qrcode: "qrcode", |
| | | barcode: "barcode", |
| | | packName: "packName", |
| | | ntyStatus: "ntyStatus", |
| | | }, |
| | | |
| | | -- ResourceContent |
New file |
| | |
| | | package com.vincent.rsf.server.api.config; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title RemotesInfoProperties |
| | | * @description |
| | | * @create 2025/3/7 09:48 |
| | | */ |
| | | @Data |
| | | @Configuration |
| | | @ConfigurationProperties(prefix = "platform.erp") |
| | | public class RemotesInfoProperties { |
| | | |
| | | /** |
| | | * 接口host |
| | | */ |
| | | private String host; |
| | | /** |
| | | * 端口号 |
| | | */ |
| | | private String port; |
| | | |
| | | /** |
| | | * 接口链接前缀 |
| | | */ |
| | | private String prePath; |
| | | |
| | | @Data |
| | | @Configuration |
| | | @ConfigurationProperties(prefix = "platform.erp.api") |
| | | public class ApiInfo { |
| | | /** |
| | | * 一键上报质检接口 |
| | | */ |
| | | private String notifyInspect; |
| | | } |
| | | |
| | | public String getBaseUrl() { |
| | | return this.host + ":" + this.port + "/" + this.prePath; |
| | | } |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.api.config; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title RestTemplateConfig |
| | | * @description |
| | | * @create 2025/3/7 10:01 |
| | | */ |
| | | |
| | | @Configuration |
| | | public class RestTemplateConfig { |
| | | |
| | | @Bean |
| | | public RestTemplate getInstant() { |
| | | return new RestTemplate(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.api.entity.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title PoItemsDto |
| | | * @description |
| | | * @create 2025/3/7 08:49 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "PoItemsDto", description = "PO单据") |
| | | public class PoItemsDto implements Serializable { |
| | | |
| | | @ApiModelProperty("PO单明细标识") |
| | | private String id; |
| | | |
| | | @ApiModelProperty("PO主单标识") |
| | | private String purchaseId; |
| | | |
| | | @ApiModelProperty("Erp明细单标识") |
| | | private String erpItemId; |
| | | |
| | | @ApiModelProperty("物料编码") |
| | | private String matnrCode; |
| | | |
| | | @ApiModelProperty("物料名称") |
| | | private String matnrName; |
| | | |
| | | @ApiModelProperty("计量单位") |
| | | private String unit; |
| | | |
| | | @ApiModelProperty("数量") |
| | | private String anfme; |
| | | |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.api.entity.params; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title ErpInspectItem |
| | | * @description |
| | | * @create 2025/3/7 09:35 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "ErpInspectItem", description = "Erp质检单据明细") |
| | | public class ErpInspectItem { |
| | | |
| | | /** |
| | | * erp明细编码 |
| | | */ |
| | | public String poItemId; |
| | | |
| | | /** |
| | | * 物料编码 |
| | | */ |
| | | public String matnrCode; |
| | | |
| | | /** |
| | | * 计量单位 |
| | | */ |
| | | public String unit; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | public Double anfme; |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.api.entity.params; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title ErpInspectParams |
| | | * @description |
| | | * @create 2025/3/6 15:08 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "ErpInspectParams", description = "Erp质检单据") |
| | | public class ErpInspectParams implements Serializable { |
| | | |
| | | /** |
| | | * 主单标识 |
| | | */ |
| | | public String poId; |
| | | /** |
| | | * 主单编码 |
| | | */ |
| | | private String poCode; |
| | | /** |
| | | * 质检明细 |
| | | */ |
| | | private List<ErpInspectItem> children; |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | import com.vincent.rsf.server.api.controller.params.Order; |
| | | import com.vincent.rsf.server.api.entity.dto.PoItemsDto; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public interface ErpApiService { |
| | | |
| | | boolean syncPurchasee(List<Order> orders); |
| | | |
| | | boolean reportInspectNotify(List<PoItemsDto> items); |
| | | } |
| | |
| | | package com.vincent.rsf.server.api.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.vincent.rsf.common.domain.CommonReponse; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.controller.params.OrderItem; |
| | | import com.vincent.rsf.server.api.config.RemotesInfoProperties; |
| | | import com.vincent.rsf.server.api.entity.dto.PoItemsDto; |
| | | import com.vincent.rsf.server.api.entity.enums.OrderType; |
| | | import com.vincent.rsf.server.api.entity.params.ErpInspectItem; |
| | | import com.vincent.rsf.server.api.entity.params.ErpInspectParams; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrder; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderItem; |
| | | import com.vincent.rsf.server.manager.entity.PurchaseItem; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderItemService; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderService; |
| | | import com.vincent.rsf.server.manager.service.PurchaseItemService; |
| | | import com.vincent.rsf.server.manager.service.PurchaseService; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import com.vincent.rsf.server.api.service.ErpApiService; |
| | | import com.vincent.rsf.server.manager.entity.Purchase; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.LinkedMultiValueMap; |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author Ryan |
| | |
| | | * @description |
| | | * @create 2025/3/4 16:27 |
| | | */ |
| | | @Service |
| | | public class ErpApiServiceImpl extends ServiceImpl implements ErpApiService { |
| | | @Slf4j |
| | | @Service("erpApiService") |
| | | public class ErpApiServiceImpl implements ErpApiService { |
| | | |
| | | @Autowired |
| | | private PurchaseService purchaseService; |
| | | |
| | | @Autowired |
| | | private PurchaseItemService purchaseItemService; |
| | | |
| | | @Autowired |
| | | private AsnOrderService asnOrderService; |
| | | |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | @Autowired |
| | | private RemotesInfoProperties remotesInfoProperties; |
| | | @Autowired |
| | | private RemotesInfoProperties.ApiInfo apiInfo; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 上报质检列表 |
| | | * @params [items 列表] |
| | | * @return boolean |
| | | * @time 2025/3/7 09:12 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean reportInspectNotify(List<PoItemsDto> items) { |
| | | if (items.isEmpty()) { |
| | | throw new CoolException("上报内容为空!!"); |
| | | } |
| | | List<ErpInspectParams> inspectParams = new ArrayList<>(); |
| | | Map<String, List<PoItemsDto>> listMap = items.stream().collect(Collectors.groupingBy(PoItemsDto::getPurchaseId)); |
| | | listMap.keySet().forEach(key -> { |
| | | Purchase purchase = purchaseService.getOne(new LambdaQueryWrapper<Purchase>().eq(Purchase::getId, Long.valueOf(key))); |
| | | if (Objects.isNull(purchase)) { |
| | | throw new CoolException("采购单信息有误!!"); |
| | | } |
| | | ErpInspectParams params = new ErpInspectParams(); |
| | | List<ErpInspectItem> inspectItems = new ArrayList<>(); |
| | | //赋值erp主单编码,编号 |
| | | params.setPoId(purchase.getErpId()) |
| | | .setPoCode(purchase.getErpCode()); |
| | | List<PoItemsDto> dtos = listMap.get(key); |
| | | if (dtos.isEmpty()) { |
| | | throw new CoolException("单据信息错误!!"); |
| | | } |
| | | dtos.forEach(dto -> { |
| | | ErpInspectItem inspect= new ErpInspectItem(); |
| | | BeanUtils.copyProperties(dto, inspect); |
| | | //赋值erp明细编码 |
| | | inspect.setPoItemId(dto.getErpItemId()); |
| | | inspectItems.add(inspect); |
| | | }); |
| | | params.setChildren(inspectItems); |
| | | inspectParams.add(params); |
| | | |
| | | }); |
| | | |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | //获取上报质检接口 |
| | | String url = remotesInfoProperties.getBaseUrl() + apiInfo.getNotifyInspect(); |
| | | // 设置请求参数 |
| | | params.add("params", JSONObject.toJSONString(inspectParams)); |
| | | log.info("请求地址:{},请求参数:{}", url, JSONObject.toJSONString(inspectParams)); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.add("Content-Type", "application/json"); |
| | | HttpEntity httpEntity = new HttpEntity<>(params, headers); |
| | | // 请求 |
| | | ResponseEntity<String> exchange = restTemplate.exchange(url, HttpMethod.POST, httpEntity, String.class); |
| | | log.info("下发任务 返回结果:{}", exchange); |
| | | if (Objects.isNull(exchange.getBody()) || exchange.getBody() == null) { |
| | | throw new CoolException("下发任务失败!!"); |
| | | } else { |
| | | CommonReponse reponse = (CommonReponse) JSON.parse(exchange.getBody()); |
| | | if (reponse.getCode() == 0) { |
| | | //修改asn上报状态 |
| | | Set<String> itemSets = items.stream().map(PoItemsDto::getId).collect(Collectors.toSet()); |
| | | Set<Long> longSet = new HashSet<>(); |
| | | itemSets.forEach(set -> { |
| | | longSet.add(Long.parseLong(set)); |
| | | }); |
| | | |
| | | List<AsnOrderItem> asnOrderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().in(AsnOrderItem::getPoDetlId, longSet)); |
| | | if (asnOrderItems.isEmpty()) { |
| | | throw new CoolException("ASN单据不存在!!"); |
| | | } |
| | | List<Long> list = asnOrderItems.stream().map(AsnOrderItem::getId).collect(Collectors.toList()); |
| | | |
| | | /************************** 修改ASN明细单状态 ******************************/ |
| | | |
| | | |
| | | if (!asnOrderItemService.update(new LambdaUpdateWrapper<AsnOrderItem>().in(AsnOrderItem::getId, list).set(AsnOrderItem::getStatus, 1))) { |
| | | throw new CoolException("ASN明细单据状态修改失败!!"); |
| | | } |
| | | |
| | | /************************** 修改ASN主单数据 ******************************/ |
| | | //获取ASN明细订单标识 |
| | | List<Long> ids = asnOrderItems.stream().map(AsnOrderItem::getAsnId).collect(Collectors.toList()); |
| | | //ASN明细单据分组 |
| | | Map<Long, List<AsnOrderItem>> asnIds = asnOrderItems.stream().collect(Collectors.groupingBy(AsnOrderItem::getAsnId)); |
| | | ids.forEach(id -> { |
| | | int count = asnOrderService.count(new LambdaQueryWrapper<AsnOrder>().in(AsnOrder::getId, id)); |
| | | if (count == asnIds.get(id).size()) { |
| | | if (!asnOrderService.update(new LambdaUpdateWrapper<AsnOrder>().eq(AsnOrder::getId, id).set(AsnOrder::getStatus, 1))) { |
| | | throw new CoolException("ASN主单状态修改失败!!"); |
| | | } |
| | | } else { |
| | | if (!asnOrderService.update(new LambdaUpdateWrapper<AsnOrder>().eq(AsnOrder::getId, id).set(AsnOrder::getStatus, 2))) { |
| | | throw new CoolException("ASN主单状态修改失败!!"); |
| | | } |
| | | } |
| | | }); |
| | | return true; |
| | | } else { |
| | | throw new CoolException(reponse.getMsg()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | // generator.username="sa"; |
| | | // generator.password="Zoneyung@zy56$"; |
| | | |
| | | generator.table="man_asn_order_item"; |
| | | generator.tableDesc="ASN单据"; |
| | | generator.table="man_purchase_item"; |
| | | 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', |
| | | `uuid` VARCHAR(255) DEFAULT NULL COMMENT '编号', |
| | | `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:否}', |
New file |
| | |
| | | package com.vincent.rsf.server.common.config; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title SysStockFlowProperties |
| | | * @description |
| | | * @create 2025/3/5 17:02 |
| | | */ |
| | | @Data |
| | | @Configuration |
| | | @ConfigurationProperties(prefix = "stock") |
| | | public class SysStockProperties { |
| | | |
| | | |
| | | /** |
| | | * wms是否允许打印货物标签, 默认可打印 |
| | | */ |
| | | private Boolean flagPrinter; |
| | | |
| | | /** |
| | | * 是否自动生成ASN单(默认:是),为『否』则开启PO单手动生成ASN单功能 |
| | | */ |
| | | private Boolean flagAutoAsn; |
| | | |
| | | |
| | | |
| | | @Data |
| | | @Configuration |
| | | @ConfigurationProperties(prefix = "stock.inspect") |
| | | public class InspectProperties { |
| | | /** |
| | | * 是否开启上架校验 |
| | | */ |
| | | private Boolean flagAvailable; |
| | | |
| | | /** |
| | | * 是否开启收货校验, 上架校验和收货校验,只会开启一个 |
| | | */ |
| | | private Boolean flagReceiving; |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | import com.vincent.rsf.server.manager.entity.AsnOrder; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | @Api(tags = "ASN入库通知单") |
| | | public class AsnOrderController extends BaseController { |
| | | |
| | | @Autowired |
| | |
| | | ExcelUtil.build(ExcelUtil.create(asnOrderService.list(), AsnOrder.class), response); |
| | | } |
| | | |
| | | /** |
| | | * 质检上报 |
| | | * @param orders |
| | | * @return |
| | | */ |
| | | @PostMapping("/asnOrder/inspect") |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | public R notifyInspect(@RequestBody List<AsnOrder> orders) { |
| | | if (orders.isEmpty()) { |
| | | return R.error("上报单据不能为空!!"); |
| | | } |
| | | if (asnOrderService.notifyInspect(orders)) { |
| | | return R.ok("质检上报成功!!"); |
| | | } else { |
| | | return R.error("一键上报失败!!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | private Date arrTime; |
| | | |
| | | /** |
| | | * 质检上报状态 |
| | | */ |
| | | @ApiModelProperty("上报状态 0:未上报, 1:已上报") |
| | | private Integer ntyStatus; |
| | | |
| | | /** |
| | | * 释放状态 0: 正常 1: 已释放 |
| | | */ |
| | | @ApiModelProperty(value= "释放状态 0: 正常 1: 已释放 ") |
| | |
| | | @ApiModelProperty(value= "单据类型") |
| | | private String type; |
| | | |
| | | |
| | | @ApiModelProperty(value = "erp主单标识") |
| | | private String erpId; |
| | | |
| | | /** |
| | | * 单据来源 |
| | | */ |
| | | @ApiModelProperty(value= "单据来源") |
| | | private String from; |
| | | private String source; |
| | | |
| | | /** |
| | | * 预计到达时间 |
| | |
| | | |
| | | public Purchase() {} |
| | | |
| | | public Purchase(String code,String type,String from,Date preArr,Double anfme,Double qty,Double workQty,String channel,String erpCode,Date startTime,Date endTime,String project,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | public Purchase(String code,String type,String source,String erpId ,Date preArr,Double anfme,Double qty,Double workQty,String channel,String erpCode,Date startTime,Date endTime,String project,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.code = code; |
| | | this.type = type; |
| | | this.from = from; |
| | | this.source = source; |
| | | this.erpId = erpId; |
| | | this.preArr = preArr; |
| | | this.anfme = anfme; |
| | | this.qty = qty; |
| | |
| | | * erp行号 |
| | | */ |
| | | @ApiModelProperty(value= "erp行号") |
| | | private String erpId; |
| | | private String erpItemId; |
| | | |
| | | /** |
| | | * 物料编码 |
| | |
| | | |
| | | public PurchaseItem() {} |
| | | |
| | | public PurchaseItem(Long purchaseId,String erpId,String matnrCode,String matnrName,String unit,Double anfme,Double qty,Double nromQty,Double asnQty,Double printQty,String splrName,String splrCode,String splrBatch,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | public PurchaseItem(Long purchaseId,String erpItemId,String matnrCode,String matnrName,String unit,Double anfme,Double qty,Double nromQty,Double asnQty,Double printQty,String splrName,String splrCode,String splrBatch,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.purchaseId = purchaseId; |
| | | this.erpId = erpId; |
| | | this.erpItemId = erpItemId; |
| | | this.matnrCode = matnrCode; |
| | | this.matnrName = matnrName; |
| | | this.unit = unit; |
| | |
| | | package com.vincent.rsf.server.manager.mapper; |
| | | |
| | | import com.vincent.rsf.server.api.entity.dto.PoItemsDto; |
| | | import com.vincent.rsf.server.manager.entity.Purchase; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface PurchaseMapper extends BaseMapper<Purchase> { |
| | | |
| | | List<PoItemsDto> poList(@Param("ids") Set<Long> ids); |
| | | } |
File was renamed from rsf-server/src/main/java/com/vincent/rsf/server/manager/utils/ScheduleJobs.java |
| | |
| | | package com.vincent.rsf.server.manager.utils; |
| | | package com.vincent.rsf.server.manager.schedules; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.config.SysStockProperties; |
| | | import com.vincent.rsf.server.common.utils.DateUtils; |
| | | 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.utils.SerialRuleUtils; |
| | | 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 javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | |
| | | @Resource |
| | | private SysStockProperties flowProperties; |
| | | /** |
| | | * @author Ryan |
| | | * @description 根据PO单据生成ASN单,自动生成ASN单为全量生成 |
| | |
| | | @Scheduled(cron = "0 0/30 * * * ? ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void genAsnOrder() { |
| | | //判断是否开启自动生成ASN单据 |
| | | if (!flowProperties.getFlagAutoAsn()) { |
| | | return; |
| | | } |
| | | //获取未生成ASN单据 |
| | | List<Purchase> purchases = purchaseService.list(new LambdaQueryWrapper<Purchase>().eq(Purchase::getStatus, 0)); |
| | | //采购单为空,直接跳出当前任务 |
| | |
| | | throw new CoolException("子列表数据为空,请查询PO单是否正确录入!!"); |
| | | } |
| | | AsnOrder order = new AsnOrder(); |
| | | //根据编码规则生成ASN单号 |
| | | String code = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_ASN_ORDER, purchase); |
| | | order.setAnfme(purchase.getAnfme()) |
| | | .setCode(code) |
| | | .setArrTime(purchase.getPreArr()) |
| | | .setQty(purchase.getQty()) |
| | | .setPoId(purchase.getId()) |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrder; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface AsnOrderService extends IService<AsnOrder> { |
| | | |
| | | boolean notifyInspect(List<AsnOrder> orders); |
| | | } |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.api.entity.dto.PoItemsDto; |
| | | import com.vincent.rsf.server.api.service.ErpApiService; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderItem; |
| | | import com.vincent.rsf.server.manager.entity.Purchase; |
| | | import com.vincent.rsf.server.manager.entity.PurchaseItem; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderItemMapper; |
| | | import com.vincent.rsf.server.manager.mapper.AsnOrderMapper; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrder; |
| | | import com.vincent.rsf.server.manager.mapper.PurchaseMapper; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description |
| | | * @throws |
| | | * @return |
| | | * @time 2025/3/7 08:02 |
| | | */ |
| | | @Service("asnOrderService") |
| | | public class AsnOrderServiceImpl extends ServiceImpl<AsnOrderMapper, AsnOrder> implements AsnOrderService { |
| | | |
| | | @Autowired |
| | | private ErpApiService erpApiService; |
| | | @Resource |
| | | private PurchaseMapper purchaseMapper; |
| | | |
| | | @Resource |
| | | private AsnOrderItemMapper asnOrderItemMapper; |
| | | |
| | | @Override |
| | | public boolean notifyInspect(List<AsnOrder> orders) { |
| | | if (orders.isEmpty()) { |
| | | throw new CoolException("上报参数不能为空!!"); |
| | | } |
| | | Set<Long> asnIds = orders.stream().map(AsnOrder::getId).collect(Collectors.toSet()); |
| | | if (asnIds.isEmpty()) { |
| | | throw new CoolException("ASN单据不能为空!!"); |
| | | } |
| | | List<PoItemsDto> items = purchaseMapper.poList(asnIds); |
| | | if (erpApiService.reportInspectNotify(items)) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | */ |
| | | public class SerialRuleCode { |
| | | |
| | | /** |
| | | * 系统PO单同步编码规则 |
| | | */ |
| | | public final static String PURCHASE_CODE = "sys_purchase_code"; |
| | | |
| | | /** |
| | | * ASN通知单生成编码规则 |
| | | */ |
| | | public final static String SYS_ASN_ORDER = "sys_ans_order"; |
| | | } |
| | |
| | | .getOne(new LambdaQueryWrapper<SerialRule>() |
| | | .eq(SerialRule::getCode, code)); |
| | | if (Objects.isNull(serialRule)) { |
| | | throw new CoolException("采购编码规则不存在!!"); |
| | | throw new CoolException("当前业务:" + code + ",编码规则不存在!!"); |
| | | } |
| | | SerialRuleItemService serialRuleItemService = SpringUtils.getBean(SerialRuleItemService.class); |
| | | |
| | |
| | | -- mysql |
| | | insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `tenant_id`, `status`) values ( 'menu.purchase', '0', '/manager/purchase', 'purchase', '0' , '0', '1' , '1'); |
| | | |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query ERP采购单', '', '1', 'manager:purchase:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create ERP采购单', '', '1', 'manager:purchase:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update ERP采购单', '', '1', 'manager:purchase:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete ERP采购单', '', '1', 'manager:purchase:remove', '3', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query 采购单', '148', '1', 'manager:purchase:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create 采购单', '148', '1', 'manager:purchase:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update 采购单', '148', '1', 'manager:purchase:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete 采购单', '148', '1', 'manager:purchase:remove', '3', '1', '1'); |
| | | |
| | | -- locale menu name |
| | | purchase: 'Purchase', |
| | |
| | | -- locale field |
| | | purchase: { |
| | | code: "code", |
| | | erpId: "erpId", |
| | | type: "type", |
| | | from: "from", |
| | | wkType: "wkType", |
| | | source: "source", |
| | | preArr: "preArr", |
| | | anfme: "anfme", |
| | | qty: "qty", |
| | | workQty: "workQty", |
| | | channel: "channel", |
| | | erpCode: "erpCode", |
| | | project: "project", |
| | | startTime: "startTime", |
| | | endTime: "endTime", |
| | | project: "project", |
| | | }, |
| | | |
| | | -- ResourceContent |
| | |
| | | -- mysql |
| | | insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `tenant_id`, `status`) values ( 'menu.purchaseItem', '0', '/manager/purchaseItem', 'purchaseItem', '0' , '0', '1' , '1'); |
| | | |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query ERP采购单', '', '1', 'manager:purchaseItem:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create ERP采购单', '', '1', 'manager:purchaseItem:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update ERP采购单', '', '1', 'manager:purchaseItem:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete ERP采购单', '', '1', 'manager:purchaseItem:remove', '3', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Query 采购明细单', '153', '1', 'manager:purchaseItem:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Create 采购明细单', '153', '1', 'manager:purchaseItem:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Update 采购明细单', '153', '1', 'manager:purchaseItem:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `tenant_id`, `status`) values ( 'Delete 采购明细单', '153', '1', 'manager:purchaseItem:remove', '3', '1', '1'); |
| | | |
| | | -- locale menu name |
| | | purchaseItem: 'PurchaseItem', |
| | |
| | | -- locale field |
| | | purchaseItem: { |
| | | purchaseId: "purchaseId", |
| | | erpId: "erpId", |
| | | erpItemId: "erpItemId", |
| | | matnrCode: "matnrCode", |
| | | matnrName: "matnrName", |
| | | unit: "unit", |
| | | anfme: "anfme", |
| | | qty: "qty", |
| | | nomQty: "nomQty", |
| | | nromQty: "nromQty", |
| | | asnQty: "asnQty", |
| | | printQty: "printQty", |
| | | pulrName: "pulrName", |
| | | pulrCode: "pulrCode", |
| | | pulrBatch: "pulrBatch", |
| | | splrName: "splrName", |
| | | splrCode: "splrCode", |
| | | splrBatch: "splrBatch", |
| | | }, |
| | | |
| | | -- ResourceContent |
| | |
| | | password: xltys1995 |
| | | port: 6379 |
| | | timeout: 5000 |
| | | index: 15 |
| | | index: 15 |
| | | |
| | | #平台接口信息配置(如:ERP, QMS, WCS等) |
| | | platform: |
| | | #企业ERP平台 |
| | | erp: |
| | | #localhost |
| | | host: http://127.0.0.1 |
| | | #端口号 |
| | | port: 8080 |
| | | #接品链接前缀 |
| | | prePath: rsf-server |
| | | #接口明细 |
| | | api: |
| | | #质检上报接口 |
| | | notifyInspect: /report/inspect |
| | | |
| | | #仓库功能参数配置 |
| | | stock: |
| | | #是否允许打印货物标签, 默认允许打印,也可由供应商提供标签 |
| | | flagPrinter: false |
| | | #是否自动生成ASN单(默认:是),为『否』则开启PO单手动生成ASN单功能 |
| | | flagAutoAsn: true |
| | | #质检功能 是否校验上架(默认:是),是否校验收货(默认:否) |
| | | inspect: |
| | | #判断是后检验合格后,才允许上架 |
| | | flagAvailable: true |
| | | #判断是否校验合格后,才允许收货 |
| | | flagReceiving: false |
| | |
| | | password: xltys1995 |
| | | port: 6379 |
| | | timeout: 5000 |
| | | index: 11 |
| | | index: 11 |
| | | |
| | | stock: |
| | | flagAvailable: true |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.vincent.rsf.server.manager.mapper.PurchaseMapper"> |
| | | |
| | | <select id="poList" resultType="com.vincent.rsf.server.api.entity.dto.PoItemsDto"> |
| | | SELECT |
| | | id, |
| | | purchase_id, |
| | | erp_item_id, |
| | | matnr_code, |
| | | matnr_name, |
| | | unit, |
| | | anfme |
| | | FROM |
| | | man_purchase_item mpi |
| | | WHERE |
| | | id IN ( SELECT po_detl_id FROM man_asn_order_item |
| | | <where> |
| | | 1 = 1 |
| | | <if test="ids != null and ids.size() > 0"> |
| | | <foreach collection="ids" index="index" item="item" separator="," open="AND asn_id IN (" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | ) |
| | | </select> |
| | | </mapper> |