refactor(wcs): 统一审计字段类型并优化下拉列表查询参数

新增 WcsBaseEntity 接口统一管理审计字段,替换各模块的 BaseEntity 继承
引入 WcsDropdownQuery 类型优化下拉列表查询参数,避免分页参数污染
main
zch 2 months ago
parent f13cfd86c8
commit 2d196ecc38

@ -1,6 +1,7 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DeviceHostVO, DeviceHostForm, DeviceHostId, DeviceHostIds, DeviceHostQuery } from '@/api/wcs/deviceHost/types';
import type { WcsDropdownQuery } from '@/api/wcs/types';
/**
*
@ -20,7 +21,7 @@ export const listDeviceHost = (query?: DeviceHostQuery): AxiosPromise<DeviceHost
*
* @param query
*/
export const getDeviceHostList = (query?: Partial<DeviceHostQuery>): AxiosPromise<DeviceHostVO[]> => {
export const getDeviceHostList = (query?: WcsDropdownQuery<DeviceHostQuery>): AxiosPromise<DeviceHostVO[]> => {
return request({
url: '/wcs/deviceHost/getDeviceHostList',
method: 'get',

@ -1,3 +1,5 @@
import type { WcsBaseEntity } from '../types';
export type DeviceHostId = string | number;
export type DeviceHostIds = DeviceHostId[];
@ -55,10 +57,9 @@ export interface DeviceHostVO {
createdByName: string;
/** 更新人名称 */
updatedByName: string;
}
export interface DeviceHostForm extends BaseEntity {
export interface DeviceHostForm extends WcsBaseEntity {
/**
*
*/
@ -98,21 +99,9 @@ export interface DeviceHostForm extends BaseEntity {
*
*/
remark?: string;
/**
*
*/
createdTime?: string;
createdBy?: string | number;
updatedBy?: string | number;
createdByName?: string;
updatedByName?: string;
}
export interface DeviceHostQuery extends PageQuery {
/**
*
*/

@ -1,6 +1,7 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DeviceInfoVO, DeviceInfoForm, DeviceInfoId, DeviceInfoIds, DeviceInfoQuery } from '@/api/wcs/deviceInfo/types';
import type { WcsDropdownQuery } from '@/api/wcs/types';
/**
*
@ -20,7 +21,7 @@ export const listDeviceInfo = (query?: DeviceInfoQuery): AxiosPromise<DeviceInfo
*
* @param query
*/
export const getDeviceInfoList = (query?: Partial<DeviceInfoQuery>): AxiosPromise<DeviceInfoVO[]> => {
export const getDeviceInfoList = (query?: WcsDropdownQuery<DeviceInfoQuery>): AxiosPromise<DeviceInfoVO[]> => {
return request({
url: '/wcs/deviceInfo/getDeviceInfoList',
method: 'get',

@ -1,3 +1,5 @@
import type { WcsBaseEntity } from '../types';
export type DeviceInfoId = string | number;
export type DeviceInfoIds = DeviceInfoId[];
@ -58,10 +60,9 @@ export interface DeviceInfoVO {
createdByName: string;
/** 更新人名称 */
updatedByName: string;
}
export interface DeviceInfoForm extends BaseEntity {
export interface DeviceInfoForm extends WcsBaseEntity {
/**
*
*/
@ -101,21 +102,9 @@ export interface DeviceInfoForm extends BaseEntity {
*
*/
remark?: string;
/**
*
*/
createdTime?: string;
createdBy?: string | number;
updatedBy?: string | number;
createdByName?: string;
updatedByName?: string;
}
export interface DeviceInfoQuery extends PageQuery {
/**
*
*/

@ -1,3 +1,5 @@
import type { WcsBaseEntity } from '../types';
export type DeviceParamId = string | number;
export type DeviceParamIds = DeviceParamId[];
@ -68,10 +70,9 @@ export interface DeviceParamVO {
createdByName: string;
/** 更新人名称 */
updatedByName: string;
}
export interface DeviceParamForm extends BaseEntity {
export interface DeviceParamForm extends WcsBaseEntity {
/**
*
*/
@ -121,21 +122,9 @@ export interface DeviceParamForm extends BaseEntity {
*
*/
remark?: string;
/**
*
*/
createdTime?: string;
createdBy?: string | number;
updatedBy?: string | number;
createdByName?: string;
updatedByName?: string;
}
export interface DeviceParamQuery extends PageQuery {
/**
*
*/

@ -1,3 +1,5 @@
import type { WcsBaseEntity } from '../types';
export type LocationInfoId = string | number;
export type LocationInfoIds = LocationInfoId[];
@ -95,10 +97,9 @@ export interface LocationInfoVO {
createdByName: string;
/** 更新人名称 */
updatedByName: string;
}
export interface LocationInfoForm extends BaseEntity {
export interface LocationInfoForm extends WcsBaseEntity {
/**
*
*/
@ -173,21 +174,9 @@ export interface LocationInfoForm extends BaseEntity {
*
*/
remark?: string;
/**
*
*/
createdTime?: string;
createdBy?: string | number;
updatedBy?: string | number;
createdByName?: string;
updatedByName?: string;
}
export interface LocationInfoQuery extends PageQuery {
/**
*
*/

@ -1,6 +1,7 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MaterialInfoVO, MaterialInfoForm, MaterialInfoId, MaterialInfoIds, MaterialInfoQuery } from '@/api/wcs/materialInfo/types';
import type { WcsDropdownQuery } from '@/api/wcs/types';
/**
*
@ -20,7 +21,7 @@ export const listMaterialInfo = (query?: MaterialInfoQuery): AxiosPromise<Materi
*
* @param query
*/
export const getMaterialInfoList = (query?: Partial<MaterialInfoQuery>): AxiosPromise<MaterialInfoVO[]> => {
export const getMaterialInfoList = (query?: WcsDropdownQuery<MaterialInfoQuery>): AxiosPromise<MaterialInfoVO[]> => {
return request({
url: '/wcs/materialInfo/getMaterialInfoList',
method: 'get',

@ -1,3 +1,5 @@
import type { WcsBaseEntity } from '../types';
export type MaterialInfoId = string | number;
export type MaterialInfoIds = MaterialInfoId[];
@ -60,10 +62,9 @@ export interface MaterialInfoVO {
createdByName: string;
/** 更新人名称 */
updatedByName: string;
}
export interface MaterialInfoForm extends BaseEntity {
export interface MaterialInfoForm extends WcsBaseEntity {
/**
*
*/
@ -108,21 +109,9 @@ export interface MaterialInfoForm extends BaseEntity {
*
*/
remark?: string;
/**
*
*/
createdTime?: string;
createdBy?: string | number;
updatedBy?: string | number;
createdByName?: string;
updatedByName?: string;
}
export interface MaterialInfoQuery extends PageQuery {
/**
*
*/

@ -1,3 +1,5 @@
import type { WcsBaseEntity } from '../types';
export type PathDetailsId = string | number;
export type PathDetailsIds = PathDetailsId[];
@ -45,10 +47,9 @@ export interface PathDetailsVO {
createdByName: string;
/** 更新人名称 */
updatedByName: string;
}
export interface PathDetailsForm extends BaseEntity {
export interface PathDetailsForm extends WcsBaseEntity {
/**
*
*/
@ -78,21 +79,9 @@ export interface PathDetailsForm extends BaseEntity {
*
*/
remark?: string;
/**
*
*/
createdTime?: string;
createdBy?: string | number;
updatedBy?: string | number;
createdByName?: string;
updatedByName?: string;
}
export interface PathDetailsQuery extends PageQuery {
/**
*
*/

@ -1,6 +1,7 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PathInfoVO, PathInfoForm, PathInfoId, PathInfoIds, PathInfoQuery } from '@/api/wcs/pathInfo/types';
import type { WcsDropdownQuery } from '@/api/wcs/types';
/**
*
@ -20,7 +21,7 @@ export const listPathInfo = (query?: PathInfoQuery): AxiosPromise<PathInfoVO[]>
*
* @param query
*/
export const getPathInfoList = (query?: Partial<PathInfoQuery>): AxiosPromise<PathInfoVO[]> => {
export const getPathInfoList = (query?: WcsDropdownQuery<PathInfoQuery>): AxiosPromise<PathInfoVO[]> => {
return request({
url: '/wcs/pathInfo/getPathInfoList',
method: 'get',

@ -1,4 +1,5 @@
import type { PathDetailsForm, PathDetailsVO } from '../pathDetails/types';
import type { WcsBaseEntity } from '../types';
export type PathInfoId = string | number;
export type PathInfoIds = PathInfoId[];
@ -47,7 +48,7 @@ export interface PathInfoVO {
updatedByName: string;
}
export interface PathInfoForm extends BaseEntity {
export interface PathInfoForm extends WcsBaseEntity {
/**
*
*/
@ -78,16 +79,6 @@ export interface PathInfoForm extends BaseEntity {
* 使 any
*/
details?: PathDetailsForm[];
/**
*
*/
createdTime?: string;
createdBy?: string | number;
updatedBy?: string | number;
createdByName?: string;
updatedByName?: string;
}
export interface PathInfoQuery extends PageQuery {

@ -1,6 +1,7 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { StoreInfoVO, StoreInfoForm, StoreInfoId, StoreInfoIds, StoreInfoQuery } from '@/api/wcs/storeInfo/types';
import type { WcsDropdownQuery } from '@/api/wcs/types';
/**
*
@ -20,7 +21,7 @@ export const listStoreInfo = (query?: StoreInfoQuery): AxiosPromise<StoreInfoVO[
*
* @param query
*/
export const getStoreInfoList = (query?: Partial<StoreInfoQuery>): AxiosPromise<StoreInfoVO[]> => {
export const getStoreInfoList = (query?: WcsDropdownQuery<StoreInfoQuery>): AxiosPromise<StoreInfoVO[]> => {
return request({
url: '/wcs/storeInfo/getStoreInfoList',
method: 'get',

@ -1,3 +1,5 @@
import type { WcsBaseEntity } from '../types';
export type StoreInfoId = string | number;
export type StoreInfoIds = StoreInfoId[];
@ -40,10 +42,9 @@ export interface StoreInfoVO {
createdByName: string;
/** 更新人名称 */
updatedByName: string;
}
export interface StoreInfoForm extends BaseEntity {
export interface StoreInfoForm extends WcsBaseEntity {
/**
*
*/
@ -68,21 +69,9 @@ export interface StoreInfoForm extends BaseEntity {
*
*/
remark?: string;
/**
*
*/
createdTime?: string;
createdBy?: string | number;
updatedBy?: string | number;
createdByName?: string;
updatedByName?: string;
}
export interface StoreInfoQuery extends PageQuery {
/**
*
*/

@ -1,3 +1,5 @@
import type { WcsBaseEntity } from '../types';
export type TaskDetailId = string | number;
export type TaskDetailIds = TaskDetailId[];
@ -110,10 +112,9 @@ export interface TaskDetailVO {
createdByName: string;
/** 更新人名称 */
updatedByName: string;
}
export interface TaskDetailForm extends BaseEntity {
export interface TaskDetailForm extends WcsBaseEntity {
/**
*
*/
@ -188,26 +189,9 @@ export interface TaskDetailForm extends BaseEntity {
*
*/
remark?: string;
/**
*
*/
createdTime?: string;
/**
*
*/
updatedTime?: string;
createdBy?: string | number;
updatedBy?: string | number;
createdByName?: string;
updatedByName?: string;
}
export interface TaskDetailQuery extends PageQuery {
/**
*
*/

@ -1,4 +1,5 @@
import { TaskDetailForm, TaskDetailVO } from '../taskDetail/types';
import type { TaskDetailForm, TaskDetailVO } from '../taskDetail/types';
import type { WcsBaseEntity } from '../types';
export type TaskQueueId = string | number;
export type TaskQueueIds = TaskQueueId[];
@ -115,10 +116,9 @@ export interface TaskQueueVO {
createdByName: string;
/** 更新人名称 */
updatedByName: string;
}
export interface TaskQueueForm extends BaseEntity {
export interface TaskQueueForm extends WcsBaseEntity {
/**
*
*/
@ -194,28 +194,11 @@ export interface TaskQueueForm extends BaseEntity {
*/
remark?: string;
/**
*
*/
createdTime?: string;
/**
*
*/
updatedTime?: string;
/** 实时任务明细列表 */
details?: TaskDetailForm[];
createdBy?: string | number;
updatedBy?: string | number;
createdByName?: string;
updatedByName?: string;
}
export interface TaskQueueQuery extends PageQuery {
/**
*
*/

@ -0,0 +1,15 @@
export interface WcsBaseEntity {
/**
* hw-wcs created_time/updated_time
* RuoYi BaseEntity createTime/updateTime
*/
createdTime?: string;
updatedTime?: string;
createdBy?: string | number;
updatedBy?: string | number;
}
/**
* params PageQuery 使 any
*/
export type WcsDropdownQuery<TQuery extends PageQuery> = Partial<Omit<TQuery, 'pageNum' | 'pageSize'>>;
Loading…
Cancel
Save