已添加38个文件
已复制5个文件
已重命名9个文件
已删除4个文件
已修改16个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { InspectPlanVO } from './model'; |
| | | |
| | | import type { ID, IDS } from '#/api/common'; |
| | | |
| | | import { commonExport } from '#/api/helper'; |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | enum Api { |
| | | inspectPlanExport = '/eims/inspectPlan/export', |
| | | inspectPlanList = '/eims/inspectPlan/list', |
| | | root = '/eims/inspectPlan' |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£è®¡åå表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export function listInspPlan(params?: any) { |
| | | return requestClient.get<InspectPlanVO[]>(Api.inspectPlanList, { params }); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£è®¡åè¯¦ç» |
| | | * @param inspectPlanId |
| | | */ |
| | | export function getInspPlan(inspectPlanId: ID) { |
| | | return requestClient.get<InspectPlanVO>(`${Api.root}/${inspectPlanId}`); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç¹æ£è®¡å |
| | | * @param data |
| | | */ |
| | | export function addInspPlan(data: any) { |
| | | return requestClient.postWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¹æ£è®¡å |
| | | * @param data |
| | | */ |
| | | export function updateInspPlan(data: any) { |
| | | return requestClient.putWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç¹æ£è®¡å |
| | | * @param inspectPlanId |
| | | */ |
| | | export function delInspPlan(inspectPlanId: IDS) { |
| | | return requestClient.deleteWithMsg<void>(`${Api.root}/${inspectPlanId}`); |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | * @param |
| | | */ |
| | | export function inspPlanExport(data: any) { |
| | | return commonExport(Api.inspectPlanExport, data); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface InspectPlanVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: number | string; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | |
| | | */ |
| | | equId: number | string; |
| | | /** |
| | | * 设å¤åç§° |
| | | |
| | | */ |
| | | equName: string; |
| | | /** |
| | | * èµäº§ç¼å· |
| | | |
| | | */ |
| | | assteNo: string; |
| | | |
| | | /** |
| | | * ç¹æ£ç±»åï¼åå
¸ï¼ |
| | | */ |
| | | inspType: string; |
| | | |
| | | /** |
| | | * ç¹æ£é¡¹åç§° |
| | | */ |
| | | inspName: string; |
| | | |
| | | /** |
| | | * ç¹æ£é¡¹ç¼å· |
| | | */ |
| | | inspNo: number; |
| | | |
| | | /** |
| | | * ç¹æ£è¯´æ |
| | | */ |
| | | inspDesc: string; |
| | | |
| | | /** |
| | | * ç¹æ£å¨æ |
| | | */ |
| | | inspCycle: number; |
| | | |
| | | /** |
| | | * ç¹æ£å¨æåä½ï¼åå
¸ï¼ |
| | | */ |
| | | inspCycleUnit: string; |
| | | |
| | | /** |
| | | * ç¹æ£è§åï¼åå
¸ï¼ä¿å
»æ¶é´è®¡ç®ï¼1-æå¨æ 2-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | */ |
| | | inspRule: string; |
| | | |
| | | /** |
| | | * ç¹æ£äºº |
| | | */ |
| | | inspUser: number; |
| | | |
| | | /** |
| | | * ç¹æ£é¨é¨ |
| | | */ |
| | | inspDept: number; |
| | | |
| | | /** |
| | | * ç¶æï¼åå
¸ï¼ 0-å¯ç¨ 1-ç¦ç¨ |
| | | */ |
| | | status: string; |
| | | |
| | | /** |
| | | * 馿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | inspFirstTime: string; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | inspLastTime: string; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | inspNextTime: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { InspectRecordVO } from './model'; |
| | | |
| | | import type { ID, IDS } from '#/api/common'; |
| | | |
| | | import { commonExport } from '#/api/helper'; |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | enum Api { |
| | | inspRecordExport = '/eims/inspRecord/export', |
| | | inspRecordList = '/eims/inspRecord/list', |
| | | root = '/eims/inspRecord' |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£è®°å½å表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export function listInspRecord(params?: any) { |
| | | return requestClient.get<InspectRecordVO[]>(Api.inspRecordList, { params }); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£è®°å½è¯¦ç» |
| | | * @param inspRecordId |
| | | */ |
| | | export function getInspRecord(inspRecordId: ID) { |
| | | return requestClient.get<InspectRecordVO>(`${Api.root}/${inspRecordId}`); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç¹æ£è®°å½ |
| | | * @param data |
| | | */ |
| | | export function addInspRecord(data: any) { |
| | | return requestClient.postWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¹æ£è®°å½ |
| | | * @param data |
| | | */ |
| | | export function updateInspRecord(data: any) { |
| | | return requestClient.putWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç¹æ£è®°å½ |
| | | * @param inspRecordId |
| | | */ |
| | | export function delInspRecord(inspRecordId: IDS) { |
| | | return requestClient.deleteWithMsg<void>(`${Api.root}/${inspRecordId}`); |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | * @param |
| | | */ |
| | | export function inspRecordExport(data: any) { |
| | | return commonExport(Api.inspRecordExport, data); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface InspectRecordVO { |
| | | /** |
| | | * id |
| | | */ |
| | | id: string | number; |
| | | |
| | | /** |
| | | * 设å¤di |
| | | */ |
| | | equId: string | number; |
| | | /** |
| | | * 设å¤åç§° |
| | | |
| | | */ |
| | | equName: string; |
| | | /** |
| | | * èµäº§ç¼å· |
| | | |
| | | */ |
| | | assteNo: string; |
| | | |
| | | /** |
| | | * ç¹æ£åç§° |
| | | */ |
| | | inspName: string; |
| | | |
| | | /** |
| | | * ç¹æ£æè¿° |
| | | */ |
| | | inspDesc: string; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | status: string; |
| | | |
| | | /** |
| | | * ç¹æ£ç¼ç |
| | | */ |
| | | inspCode: string; |
| | | |
| | | /** |
| | | * å¼è®°å½æ¹å¼ï¼åå
¸ï¼ |
| | | */ |
| | | recordMode: string; |
| | | |
| | | /** |
| | | * åèå¼ |
| | | */ |
| | | referenceValue: string; |
| | | |
| | | /** |
| | | * ä¸é |
| | | */ |
| | | upperLimit: string; |
| | | |
| | | /** |
| | | * ä¸é |
| | | */ |
| | | lowLimit: string; |
| | | |
| | | /** |
| | | * æ£æ¥å¼ |
| | | */ |
| | | checkValue: string; |
| | | |
| | | /** |
| | | * ç¹æ£ç»æï¼åå
¸ï¼ |
| | | */ |
| | | inspResult: string; |
| | | |
| | | /** |
| | | * ç¹æ£æ¶é´ |
| | | */ |
| | | inspTime: string; |
| | | |
| | | /** |
| | | * 计åç¹æ£æ¥æ |
| | | */ |
| | | planTime: string; |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | verifyUser: number; |
| | | |
| | | /** |
| | | * 计åid |
| | | */ |
| | | planId: string | number; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { InspectStVO } from './model'; |
| | | |
| | | import type { ID, IDS } from '#/api/common'; |
| | | |
| | | import { commonExport } from '#/api/helper'; |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | enum Api { |
| | | inspectStExport = '/eims/inspectSt/export', |
| | | inspectStList = '/eims/inspectSt/list', |
| | | root = '/eims/inspectSt' |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£æ±æ»å表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export function listInspectSt(params?: any) { |
| | | return requestClient.get<InspectStVO[]>(Api.inspectStList, { params }); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£æ±æ»è¯¦ç» |
| | | * @param inspectStId |
| | | */ |
| | | export function getInspectSt(inspectStId: ID) { |
| | | return requestClient.get<InspectStVO>(`${Api.root}/${inspectStId}`); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç¹æ£æ±æ» |
| | | * @param data |
| | | */ |
| | | export function addInspectSt(data: any) { |
| | | return requestClient.postWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¹æ£æ±æ» |
| | | * @param data |
| | | */ |
| | | export function updateInspectSt(data: any) { |
| | | return requestClient.putWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç¹æ£æ±æ» |
| | | * @param inspectStId |
| | | */ |
| | | export function delInspectSt(inspectStId: IDS) { |
| | | return requestClient.deleteWithMsg<void>(`${Api.root}/${inspectStId}`); |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | * @param |
| | | */ |
| | | export function inspectStExport(data: any) { |
| | | return commonExport(Api.inspectStExport, data); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface InspectStVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: number | string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | title: string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | equId: number | string; |
| | | status: string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | planTime: string; |
| | | |
| | | /** |
| | | * ä¿å
»äºº |
| | | */ |
| | | maintUser: number; |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | verifyUser: number; |
| | | verifyTime: string; |
| | | |
| | | /** |
| | | * ç¹è®°äºé¡¹ |
| | | */ |
| | | specialNote: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | } |
| | | |
| | |
| | | maintType: string; |
| | | |
| | | /** |
| | | * å·¥ä½æè¿° |
| | | */ |
| | | maintDesc: string; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»å¨æ |
| | | */ |
| | | maintCycle: number; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { MaintStVO } from './model'; |
| | | |
| | | import type { ID, IDS } from '#/api/common'; |
| | | |
| | | import { commonExport } from '#/api/helper'; |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | enum Api { |
| | | maintStExport = '/eims/maintSt/export', |
| | | maintStList = '/eims/maintSt/list', |
| | | root = '/eims/maintSt' |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»æ±æ»å表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export function listMaintSt(params?: any) { |
| | | return requestClient.get<MaintStVO[]>(Api.maintStList, { params }); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»æ±æ»è¯¦ç» |
| | | * @param maintStId |
| | | */ |
| | | export function getMaintSt(maintStId: ID) { |
| | | return requestClient.get<MaintStVO>(`${Api.root}/${maintStId}`); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿å
»æ±æ» |
| | | * @param data |
| | | */ |
| | | export function addMaintSt(data: any) { |
| | | return requestClient.postWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
»æ±æ» |
| | | * @param data |
| | | */ |
| | | export function updateMaintSt(data: any) { |
| | | return requestClient.putWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¿å
»æ±æ» |
| | | * @param maintStId |
| | | */ |
| | | export function delMaintSt(maintStId: IDS) { |
| | | return requestClient.deleteWithMsg<void>(`${Api.root}/${maintStId}`); |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | * @param |
| | | */ |
| | | export function maintStExport(data: any) { |
| | | return commonExport(Api.maintStExport, data); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface MaintStVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: number | string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | title: string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | equId: number | string; |
| | | status: string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | planTime: string; |
| | | |
| | | /** |
| | | * ä¿å
»äºº |
| | | */ |
| | | maintUser: number; |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | verifyUser: number; |
| | | verifyTime: string; |
| | | |
| | | /** |
| | | * ç¹è®°äºé¡¹ |
| | | */ |
| | | specialNote: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | } |
| | | |
| | |
| | | DAIYANZHENG = '2', // å¾
éªè¯ |
| | | WANCHENG = '3' // 宿 |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ä¿å
»å·¥åç¶æ |
| | | */ |
| | | export enum EIMS_INSPECT_STATUS { |
| | | YIDIANJIAN = '1', // å·²ç¹æ£ |
| | | WEIDIANJIAN = '0', // æªç¹æ£ |
| | | DAIYANZHENG = '2', // å¾
éªè¯ |
| | | WANCHENG = '3' // 宿 |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { VxeGridProps } from '#/adapter/vxe-table'; |
| | | |
| | | import { DictEnum } from '@vben/constants'; |
| | | import { getPopupContainer } from '@vben/utils'; |
| | | |
| | | import { type FormSchemaGetter } from '#/adapter/form'; |
| | | import { getDictOptions } from '#/utils/dict'; |
| | | import { renderDict } from '#/utils/render'; |
| | | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equName', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'assetNo', |
| | | label: 'èµäº§ç¼å·' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.EIMS_INSPECT_TYPE) |
| | | }, |
| | | fieldName: 'inspType', |
| | | label: 'ç¹æ£ç±»å' |
| | | }, |
| | | { |
| | | component: 'TreeSelect', |
| | | // å¨draweréæ´æ° è¿éä¸éè¦é»è®¤çcomponentProps |
| | | defaultValue: undefined, |
| | | fieldName: 'inspDept', |
| | | label: 'ç¹æ£é¨é¨', |
| | | |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | showSearch: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'inspUser', |
| | | label: 'ç¹æ£äºº', |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE) |
| | | }, |
| | | fieldName: 'status', |
| | | label: 'ç¶æ' |
| | | }, |
| | | ]; |
| | | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | | { type: 'checkbox', width: 60, fixed: 'left' }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | field: 'equName', |
| | | minWidth: 200, |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: 'èµäº§ç¼å·', |
| | | field: 'assetNo', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
| | | field: 'status', |
| | | minWidth: 80, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return renderDict(row.status, DictEnum.SYS_NORMAL_DISABLE); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: 'ç¹æ£é¡¹', |
| | | field: 'inspName', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | title: 'ç¹æ£ç±»å', |
| | | field: 'inspType', |
| | | minWidth: 120, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return renderDict(row.inspType, DictEnum.EIMS_INSPECT_TYPE); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: 'ç¹æ£äºº', |
| | | field: 'inspUserName', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: '循ç¯å¨æ', |
| | | field: 'inspCycleUnitName', |
| | | minWidth: 80 |
| | | }, |
| | | { |
| | | title: 'æ¶é´è®¡ç®è§å', |
| | | field: 'inspRule', |
| | | minWidth: 140, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return renderDict(row.inspRule, DictEnum.MAINT_TIME_RULE); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: '馿¬¡æ§è¡æ¶é´', |
| | | field: 'inspFirstTime', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: '䏿¬¡æ§è¡æ¶é´', |
| | | field: 'inspLastTime', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: '䏿¬¡æ§è¡æ¶é´', |
| | | field: 'inspNextTime', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | field: 'createTime', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | field: 'action', |
| | | fixed: 'right', |
| | | slots: { default: 'action' }, |
| | | title: 'æä½', |
| | | width: 200 |
| | | } |
| | | ]; |
| | | |
| | | export const drawerSchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Input', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'id' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equId', |
| | | label: '设å¤id', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equName', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'inspName', |
| | | label: 'ç¹æ£é¡¹' |
| | | }, |
| | | { |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | options: getDictOptions(DictEnum.EIMS_INSPECT_TYPE), |
| | | optionType: 'button' |
| | | }, |
| | | fieldName: 'inspType', |
| | | defaultValue: '1', |
| | | label: 'ç¹æ£ç±»å' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'inspDesc', |
| | | label: 'ç¹æ£è¯´æ' |
| | | }, |
| | | { |
| | | component: 'InputNumber', |
| | | fieldName: 'inspCycle', |
| | | label: 'ç¹æ£å¨æ', |
| | | formItemClass: 'col-span-1', |
| | | componentProps: { |
| | | min: 1 |
| | | } |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | getPopupContainer, |
| | | options: getDictOptions(DictEnum.MAINT_CYCLE_UNIT) |
| | | }, |
| | | fieldName: 'inspCycleUnit', |
| | | formItemClass: 'col-span-1 w-[80px]', |
| | | labelWidth: 0, |
| | | label: '' |
| | | }, |
| | | |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | getPopupContainer, |
| | | options: getDictOptions(DictEnum.MAINT_TIME_RULE) |
| | | }, |
| | | fieldName: 'inspRule', |
| | | label: 'ç¹æ£è§å ' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'inspUser', |
| | | label: 'ç¨æ·id', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'inspUserName', |
| | | label: 'ç¹æ£äºº' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'inspDept', |
| | | label: 'é¨é¨id', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE), |
| | | optionType: 'button' |
| | | }, |
| | | fieldName: 'status', |
| | | defaultValue: '0', |
| | | label: 'ç¶æ' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD', |
| | | showTime: false, |
| | | valueFormat: 'YYYY-MM-DD', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'inspFirstTime', |
| | | label: '馿¬¡ä¿å
»æ¶é´' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD', |
| | | showTime: false, |
| | | valueFormat: 'YYYY-MM-DD', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'inspLastTime', |
| | | label: '䏿¬¡ä¿å
»æ¶é´' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD', |
| | | showTime: false, |
| | | valueFormat: 'YYYY-MM-DD', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'inspNextTime', |
| | | label: '䏿¬¡ä¿å
»æ¶é´', |
| | | }, |
| | | { |
| | | component: 'Textarea', |
| | | fieldName: 'remark', |
| | | label: '夿³¨' |
| | | } |
| | | ]; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import type { Recordable } from '@vben/types'; |
| | | |
| | | import { onMounted, ref } from 'vue'; |
| | | |
| | | import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { addFullName, getPopupContainer, getVxePopupContainer } from '@vben/utils'; |
| | | |
| | | import { Dropdown, Menu, MenuItem, Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { delInspPlan, inspPlanExport, listInspPlan } from '#/api/eims/insp-plan'; |
| | | import { generateCode } from '#/api/eims/utils'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import { EIMS_INSPECT_STATUS } from '#/constants/dict'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | import inspRecordDrawer from '#/views/eims/insp-record/insp-record-drawer.vue'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import inspPlanDrawer from './insp-plan-drawer.vue'; |
| | | |
| | | defineExpose({ |
| | | tableSelect |
| | | }); |
| | | |
| | | const formOptions: VbenFormProps = { |
| | | commonConfig: { |
| | | labelWidth: 80, |
| | | componentProps: { |
| | | allowClear: true |
| | | } |
| | | }, |
| | | collapsed: true, |
| | | schema: querySchema(), |
| | | wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', |
| | | // æ¥æéæ©æ ¼å¼å |
| | | fieldMappingTime: [['planTime', ['params[beginPlanTime]', 'params[endPlanTime]'], ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59']]] |
| | | }; |
| | | |
| | | const gridOptions: VxeGridProps = { |
| | | checkboxConfig: { |
| | | // é«äº® |
| | | highlight: true, |
| | | // 翻页æ¶ä¿çéä¸ç¶æ |
| | | reserve: true |
| | | // ç¹å»è¡éä¸ |
| | | // trigger: 'row' |
| | | }, |
| | | columns, |
| | | height: 'auto', |
| | | keepSource: true, |
| | | pagerConfig: {}, |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | return await listInspPlan({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | rowConfig: { |
| | | isHover: true, |
| | | keyField: 'id' |
| | | }, |
| | | sortConfig: { |
| | | // è¿ç¨æåº |
| | | remote: true, |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true |
| | | }, |
| | | id: 'insp-plan-index' |
| | | }; |
| | | const equId = ref<string>(); |
| | | const [BasicTable, tableApi] = useVbenVxeGrid({ |
| | | formOptions, |
| | | gridOptions, |
| | | gridEvents: { |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams), |
| | | cellClick: (e: any) => { |
| | | const { row } = e; |
| | | equId.value = row.equId; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | const [InspPlanDrawer, inspPlanDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: inspPlanDrawer |
| | | }); |
| | | |
| | | const [InspRecordDrawer, inspRecordDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: inspRecordDrawer |
| | | }); |
| | | |
| | | function handleAdd() { |
| | | inspPlanDrawerApi.setData({}); |
| | | inspPlanDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | inspPlanDrawerApi.setData({ id: record.id }); |
| | | inspPlanDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleDelete(row: Recordable<any>) { |
| | | await delInspPlan(row.id); |
| | | await tableApi.query(); |
| | | } |
| | | |
| | | function handleMultiDelete() { |
| | | const rows = tableApi.grid.getCheckboxRecords(); |
| | | const ids = rows.map((row: any) => row.id); |
| | | Modal.confirm({ |
| | | title: 'æç¤º', |
| | | okType: 'danger', |
| | | content: `确认å é¤éä¸ç${ids.length}æ¡è®°å½åï¼`, |
| | | onOk: async () => { |
| | | await delInspPlan(ids); |
| | | await tableApi.query(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleDownloadExcel() { |
| | | commonDownloadExcel(inspPlanExport, 'ç¹æ£è®¡åè®°å½', tableApi.formApi.form.values, { |
| | | fieldMappingTime: formOptions.fieldMappingTime |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * çæç¹æ£è®°å½ |
| | | * @param record |
| | | */ |
| | | async function handleAddOrder(record: Recordable<any>) { |
| | | /** |
| | | * çæç¹æ£è®°å½code |
| | | */ |
| | | const code = await generateCode('DJSD'); |
| | | if (!code) { |
| | | Modal.error({ |
| | | content: 'çæç¹æ£è®°å½å¤±è´¥ï¼è¯·éè¯ï¼', |
| | | title: 'æç¤º' |
| | | }); |
| | | return false; |
| | | } |
| | | const planInsp = { |
| | | equId: record.equId, |
| | | planId: record.id, |
| | | equName: record.equName, |
| | | inspUser: record.inspUser, |
| | | inspUserName: record.inspUserName, |
| | | inspDept: record.inspDept, |
| | | inspDeptName: record.inspDeptName, |
| | | inspType: record.inspType, |
| | | planTime: record.inspNextTime, |
| | | status: EIMS_INSPECT_STATUS.WEIDIANJIAN, |
| | | inspCode: code, |
| | | inspName: record.inspName |
| | | }; |
| | | |
| | | inspRecordDrawerApi.setData({ planInsp }); |
| | | inspRecordDrawerApi.open(); |
| | | // await addMaintOrder(order.value); |
| | | } |
| | | /** |
| | | * åå§åé¨é¨éæ© |
| | | */ |
| | | async function setupDeptSelect() { |
| | | // updateSchema |
| | | const deptTree = await getDeptTree(); |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ å³ç¶èç¹ / åèç¹ |
| | | addFullName(deptTree, 'label', ' / '); |
| | | tableApi.formApi.updateSchema([ |
| | | { |
| | | componentProps: (formModel) => ({ |
| | | class: 'w-full', |
| | | fieldNames: { |
| | | key: 'id', |
| | | value: 'id', |
| | | children: 'children' |
| | | }, |
| | | getPopupContainer, |
| | | async onSelect(deptId: number | string) { |
| | | /** æ ¹æ®é¨é¨IDå è½½ç¨æ· */ |
| | | await setupUserOptions(deptId); |
| | | /** åååéè¦éæ°éæ©ç¨æ· */ |
| | | formModel.inspUser = undefined; |
| | | }, |
| | | placeholder: 'è¯·éæ©', |
| | | showSearch: true, |
| | | treeData: deptTree, |
| | | treeDefaultExpandAll: true, |
| | | treeLine: { showLeafIcon: false }, |
| | | // çéçåæ®µ |
| | | treeNodeFilterProp: 'label', |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ |
| | | treeNodeLabelProp: 'fullName' |
| | | }), |
| | | fieldName: 'inspDept' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ·çå è½½ |
| | | */ |
| | | async function setupUserOptions(deptId: any) { |
| | | const params = { deptId }; |
| | | const userPageResult = await userList({ |
| | | pageNum: 1, |
| | | pageSize: 500, |
| | | ...params |
| | | }); |
| | | const options = userPageResult.rows.map((item) => ({ |
| | | label: item.nickName || item.userName, |
| | | value: item.userId |
| | | })); |
| | | // çé |
| | | const filterOption = (input: string, option: any) => { |
| | | return option.label.toLowerCase().includes(input.toLowerCase()); |
| | | }; |
| | | |
| | | const placeholder = options.length > 0 ? 'è¯·éæ©' : '该é¨é¨ä¸ææ ç¨æ·'; |
| | | tableApi.formApi.updateSchema([ |
| | | { |
| | | componentProps: { options, placeholder, filterOption }, |
| | | fieldName: 'inspUser' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | await setupDeptSelect(); |
| | | }); |
| | | |
| | | // é䏿°æ® |
| | | function tableSelect() { |
| | | return tableApi.grid.getCheckboxRecords(); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px] flex-col"> |
| | | <BasicTable table-title="ç¹æ£è®¡åå表"> |
| | | <template #toolbar-tools> |
| | | <Space> |
| | | <a-button v-access:code="['eims:inspectPlan:export']" @click="handleDownloadExcel"> |
| | | {{ $t('pages.common.export') }} |
| | | </a-button> |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | | type="primary" |
| | | v-access:code="['eims:inspectPlan:remove']" |
| | | @click="handleMultiDelete" |
| | | > |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | <a-button type="primary" v-access:code="['eims:inspectPlan:add']" @click="handleAdd"> |
| | | {{ $t('pages.common.add') }} |
| | | </a-button> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #equName="{ row }"> |
| | | <Space> |
| | | <span>{{ row.equName }}</span> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button class="btn-success" v-access:code="['eims:inspectPlan:edit']" @click.stop="handleAddOrder(row)"> çæç¹æ£ </ghost-button> |
| | | <ghost-button v-access:code="['eims:inspectPlan:edit']" @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | </Space> |
| | | <Dropdown :get-popup-container="getVxePopupContainer" placement="bottomRight"> |
| | | <template #overlay> |
| | | <Menu> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" @confirm="handleDelete(row)"> |
| | | <MenuItem key="1" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </MenuItem> |
| | | </Popconfirm> |
| | | </Menu> |
| | | </template> |
| | | <a-button size="small" type="link" v-access:code="['eims:inspectPlan:remove']"> |
| | | {{ $t('pages.common.more') }} |
| | | </a-button> |
| | | </Dropdown> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |
| | | <InspPlanDrawer @reload="tableApi.query()" /> |
| | | <InspRecordDrawer @reload="tableApi.query()" /> |
| | | </Page> |
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import { computed, ref } from 'vue'; |
| | | |
| | | import { useVbenDrawer, useVbenModal } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { addFullName, cloneDeep, getPopupContainer } from '@vben/utils'; |
| | | |
| | | import { InputSearch } from 'ant-design-vue'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { addInspPlan, getInspPlan, updateInspPlan } from '#/api/eims/insp-plan'; |
| | | import equModal from '#/views/eims/components/equ-modal.vue'; |
| | | import userModal from '#/views/eims/components/user-modal.vue'; |
| | | |
| | | import { drawerSchema } from './data'; |
| | | |
| | | const emit = defineEmits<{ reload: [] }>(); |
| | | |
| | | const isUpdate = ref(false); |
| | | const title = computed(() => { |
| | | return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add'); |
| | | }); |
| | | |
| | | const [BasicForm, formApi] = useVbenForm({ |
| | | commonConfig: { |
| | | formItemClass: 'col-span-2', |
| | | componentProps: { |
| | | class: 'w-full' |
| | | }, |
| | | labelWidth: 120 |
| | | }, |
| | | layout: 'horizontal', |
| | | schema: drawerSchema(), |
| | | showDefaultActions: false, |
| | | wrapperClass: 'grid-cols-2' |
| | | }); |
| | | |
| | | const [BasicDrawer, drawerApi] = useVbenDrawer({ |
| | | onCancel: handleCancel, |
| | | onConfirm: handleConfirm, |
| | | async onOpenChange(isOpen) { |
| | | if (!isOpen) { |
| | | return null; |
| | | } |
| | | drawerApi.drawerLoading(true); |
| | | const { id } = drawerApi.getData() as { id?: number | string }; |
| | | isUpdate.value = !!id; |
| | | |
| | | formApi.updateSchema([ |
| | | { |
| | | dependencies: { |
| | | show: () => isUpdate.value, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'inspFirstTime' |
| | | }, |
| | | { |
| | | dependencies: { |
| | | show: () => isUpdate.value, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'inspLastTime' |
| | | } |
| | | ]); |
| | | // æ´æ° && èµå¼ |
| | | if (isUpdate.value && id) { |
| | | const record = await getInspPlan(id); |
| | | await formApi.setValues(record); |
| | | } |
| | | |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | }); |
| | | |
| | | async function handleConfirm() { |
| | | try { |
| | | drawerApi.drawerLoading(true); |
| | | const { valid } = await formApi.validate(); |
| | | if (!valid) { |
| | | return; |
| | | } |
| | | const data = cloneDeep(await formApi.getValues()); |
| | | await (isUpdate.value ? updateInspPlan(data) : addInspPlan(data)); |
| | | emit('reload'); |
| | | await handleCancel(); |
| | | } catch (error) { |
| | | console.error(error); |
| | | } finally { |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | } |
| | | |
| | | async function handleCancel() { |
| | | drawerApi.close(); |
| | | await formApi.resetForm(); |
| | | } |
| | | |
| | | // equ modal |
| | | const [EquModal, equModalApi] = useVbenModal({ |
| | | connectedComponent: equModal, |
| | | draggable: true, |
| | | title: 'éæ©è®¾å¤' |
| | | }); |
| | | |
| | | function handleEquModal() { |
| | | equModalApi.setData({}); |
| | | equModalApi.open(); |
| | | } |
| | | |
| | | // user modal |
| | | const [UserModal, userModalApi] = useVbenModal({ |
| | | connectedComponent: userModal, |
| | | draggable: true, |
| | | title: 'éæ©ç¹æ£äºº' |
| | | }); |
| | | |
| | | function handleUserModal() { |
| | | userModalApi.setData({}); |
| | | userModalApi.open(); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°éæ©çè®¾å¤ |
| | | * @param equ |
| | | */ |
| | | async function updateEqu(equ: any) { |
| | | await formApi.setValues({ 'equId': equ.equId, 'equName': equ.equName }); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°éæ©çç¨æ· |
| | | * @param user |
| | | */ |
| | | async function updateUser(user: any) { |
| | | await formApi.setValues({ 'inspUserName': user.nickName, 'inspUser': user.userId, 'inspDept': user.deptId }); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicDrawer :close-on-click-modal="false" :title="title" class="w-[600px]"> |
| | | <BasicForm> |
| | | <template #equName="slotProps"> |
| | | <InputSearch :enter-button="true" placeholder="è¯·éæ©" @search="handleEquModal" v-bind="slotProps" /> |
| | | </template> |
| | | <template #inspUserName="slotProps"> |
| | | <InputSearch :enter-button="true" placeholder="è¯·éæ©" @search="handleUserModal" v-bind="slotProps" /> |
| | | </template> |
| | | </BasicForm> |
| | | <EquModal class="w-[1200px]" @update-equ="updateEqu" /> |
| | | <UserModal class="w-[1200px]" @select-user="updateUser" /> |
| | | </BasicDrawer> |
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { VxeGridProps } from '#/adapter/vxe-table'; |
| | | |
| | | import { DictEnum } from '@vben/constants'; |
| | | import { getPopupContainer } from '@vben/utils'; |
| | | |
| | | import { type FormSchemaGetter } from '#/adapter/form'; |
| | | import { getDictOptions } from '#/utils/dict'; |
| | | import { renderDict } from '#/utils/render'; |
| | | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equName', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'assetNo', |
| | | label: 'èµäº§ç¼å·' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'inspName', |
| | | label: 'ç¹æ£é¡¹' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.EIMS_INSPECT_STATUS) |
| | | }, |
| | | fieldName: 'status', |
| | | label: 'ç¶æ' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.EIMS_INSPECT_RESULT) |
| | | }, |
| | | fieldName: 'maintType', |
| | | label: 'ç¹æ£ç»æ' |
| | | }, |
| | | { |
| | | component: 'TreeSelect', |
| | | // å¨draweréæ´æ° è¿éä¸éè¦é»è®¤çcomponentProps |
| | | defaultValue: undefined, |
| | | fieldName: 'inspDept', |
| | | label: 'ç¹æ£é¨é¨' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | showSearch: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'inspUser', |
| | | label: 'ç¹æ£äºº' |
| | | } |
| | | ]; |
| | | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | | { type: 'checkbox', width: 60, fixed: 'left' }, |
| | | { |
| | | title: 'ç¹æ£ç¼å·', |
| | | field: 'inspCode', |
| | | minWidth: 200, |
| | | fixed: 'left' |
| | | }, |
| | | |
| | | { |
| | | title: 'ç¶æ', |
| | | field: 'status', |
| | | minWidth: 80, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return renderDict(row.status, DictEnum.EIMS_INSPECT_STATUS); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | field: 'equName', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | title: 'èµäº§ç¼å·', |
| | | field: 'assetNo', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: 'ç¹æ£é¡¹', |
| | | field: 'inspName', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: 'ç¹æ£ç»æ', |
| | | field: 'inspResult', |
| | | minWidth: 80, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | if (!row.inspResult) return ''; |
| | | return renderDict(row.inspResult, DictEnum.EIMS_INSPECT_RESULT); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: 'ç¹æ£ç±»å', |
| | | field: 'inspType', |
| | | minWidth: 120, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return renderDict(row.inspType, DictEnum.EIMS_INSPECT_TYPE); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: 'ç¹æ£äºº', |
| | | field: 'inspUserName', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: '计åç¹æ£æ¶é´', |
| | | field: 'planTime', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: 'ç¹æ£æ¶é´', |
| | | field: 'inspTime', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | title: 'ç¹æ£æè¿°', |
| | | field: 'inspDesc', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | title: 'éªè¯äºº', |
| | | field: 'verifyUserName', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | field: 'createTime', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | field: 'action', |
| | | fixed: 'right', |
| | | slots: { default: 'action' }, |
| | | title: 'æä½', |
| | | width: 200 |
| | | } |
| | | ]; |
| | | |
| | | export const drawerSchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Input', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'id' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'planId' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equId', |
| | | label: '设å¤id', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'inspCode', |
| | | label: 'ç¹æ£ç¼å·' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'inspName', |
| | | label: 'ç¹æ£é¡¹' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equName', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | options: getDictOptions(DictEnum.EIMS_INSPECT_TYPE), |
| | | optionType: 'button' |
| | | }, |
| | | fieldName: 'inspType', |
| | | defaultValue: '1', |
| | | label: 'ç¹æ£ç±»å' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'inspUser', |
| | | label: 'ç¹æ£äººid', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'inspUserName', |
| | | label: 'ç¹æ£äºº' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'inspDept', |
| | | label: 'é¨é¨id', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | options: getDictOptions(DictEnum.EIMS_INSPECT_STATUS), |
| | | optionType: 'button' |
| | | }, |
| | | fieldName: 'status', |
| | | defaultValue: '0', |
| | | label: 'ç¶æ' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD', |
| | | showTime: false, |
| | | valueFormat: 'YYYY-MM-DD', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'planTime', |
| | | label: '计åç¹æ£æ¥æ' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | showTime: true, |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'inspTime', |
| | | label: 'ç¹æ£æ¶é´' |
| | | }, |
| | | { |
| | | component: 'Textarea', |
| | | fieldName: 'inspDesc', |
| | | label: 'ç¹æ£æè¿°' |
| | | }, |
| | | { |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | options: getDictOptions(DictEnum.EIMS_INSPECT_RESULT), |
| | | optionType: 'button' |
| | | }, |
| | | fieldName: 'inspResult', |
| | | label: 'ç¹æ£ç»æ' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'verifyUser', |
| | | label: 'éªè¯äººid', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'verifyUserName', |
| | | label: 'éªè¯äºº' |
| | | }, |
| | | { |
| | | component: 'Textarea', |
| | | fieldName: 'remark', |
| | | label: '夿³¨' |
| | | } |
| | | ]; |
copy from eims-ui/apps/web-antd/src/views/eims/maint-order-st/index.vue
copy to eims-ui/apps/web-antd/src/views/eims/insp-record/index.vue
Îļþ´Ó eims-ui/apps/web-antd/src/views/eims/maint-order-st/index.vue ¸´ÖÆ |
| | |
| | | <script setup lang="ts"> |
| | | import type { Recordable } from '@vben/types'; |
| | | |
| | | import { onMounted, ref } from 'vue'; |
| | | |
| | | import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { addFullName, getPopupContainer, getVxePopupContainer } from '@vben/utils'; |
| | | |
| | | import { Popconfirm, Space } from 'ant-design-vue'; |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { listMaintOrderGroupDetail } from '#/api/eims/maint-order'; |
| | | import { delMaintOrderSt, listMaintOrderSt } from '#/api/eims/maint-order-st'; |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { delInspRecord, inspRecordExport, listInspRecord } from '#/api/eims/insp-record'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import BasisSubTable from '#/views/eims/components/basis-sub-table.vue'; |
| | | import { columns as orderCol } from '#/views/eims/maint-order/data'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import maintOrderStDrawer from './maint-order-st-drawer.vue'; |
| | | import type { Recordable } from '@vben/types'; |
| | | import { MAINT_ORDER_STATUS } from '#/constants/dict'; |
| | | import { $t } from '@vben/locales'; |
| | | import inspRecordDrawer from './insp-record-drawer.vue'; |
| | | |
| | | defineExpose({ |
| | | tableSelect |
| | |
| | | }, |
| | | collapsed: true, |
| | | schema: querySchema(), |
| | | wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', |
| | | // æ¥æéæ©æ ¼å¼å |
| | | fieldMappingTime: [['planTime', ['params[beginPlanTime]', 'params[endPlanTime]'], ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59']]] |
| | | wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4' |
| | | }; |
| | | |
| | | const gridOptions: VxeGridProps = { |
| | |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | return await listMaintOrderSt({ |
| | | return await listInspRecord({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true |
| | | }, |
| | | id: 'maint-order-group-index' |
| | | id: 'insp-record-index' |
| | | }; |
| | | const orderId = ref<string>(); |
| | | const [BasicTable, tableApi] = useVbenVxeGrid({ |
| | |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams), |
| | | cellClick: (e: any) => { |
| | | const { row } = e; |
| | | orderId.value = `${row.equId}_${row.planTime}`; |
| | | orderId.value = row.id; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | const [InspRecordDrawer, inspRecordDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: inspRecordDrawer |
| | | }); |
| | | |
| | | function handleAdd() { |
| | | inspRecordDrawerApi.setData({}); |
| | | inspRecordDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | inspRecordDrawerApi.setData({ id: record.id }); |
| | | inspRecordDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleDelete(row: Recordable<any>) { |
| | | await delInspRecord(row.id); |
| | | await tableApi.query(); |
| | | } |
| | | |
| | | function handleMultiDelete() { |
| | | const rows = tableApi.grid.getCheckboxRecords(); |
| | | const ids = rows.map((row: any) => row.id); |
| | | Modal.confirm({ |
| | | title: 'æç¤º', |
| | | okType: 'danger', |
| | | content: `确认å é¤éä¸ç${ids.length}æ¡è®°å½åï¼`, |
| | | onOk: async () => { |
| | | await delInspRecord(ids); |
| | | await tableApi.query(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleDownloadExcel() { |
| | | commonDownloadExcel(inspRecordExport, 'ç¹æ£è®°å½', tableApi.formApi.form.values, { |
| | | fieldMappingTime: formOptions.fieldMappingTime |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * åå§åé¨é¨éæ© |
| | |
| | | /** æ ¹æ®é¨é¨IDå è½½ç¨æ· */ |
| | | await setupUserOptions(deptId); |
| | | /** åååéè¦éæ°éæ©ç¨æ· */ |
| | | formModel.maintUser = undefined; |
| | | formModel.inspUser = undefined; |
| | | }, |
| | | placeholder: 'è¯·éæ©', |
| | | showSearch: true, |
| | |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ |
| | | treeNodeLabelProp: 'fullName' |
| | | }), |
| | | fieldName: 'maintDept' |
| | | fieldName: 'inspDept' |
| | | } |
| | | ]); |
| | | } |
| | |
| | | tableApi.formApi.updateSchema([ |
| | | { |
| | | componentProps: { options, placeholder, filterOption }, |
| | | fieldName: 'maintUser' |
| | | fieldName: 'inspUser' |
| | | } |
| | | ]); |
| | | } |
| | | const [MaintOrderStDrawer, maintOrderStDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: maintOrderStDrawer |
| | | }); |
| | | |
| | | function handleAdd() { |
| | | maintOrderStDrawerApi.setData({}); |
| | | maintOrderStDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | maintOrderStDrawerApi.setData({ id: record.id }); |
| | | maintOrderStDrawerApi.open(); |
| | | } |
| | | async function handleDelete(row: Recordable<any>) { |
| | | await delMaintOrderSt(row.id); |
| | | await tableApi.query(); |
| | | } |
| | | |
| | | |
| | | onMounted(async () => { |
| | | await setupDeptSelect(); |
| | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px] flex-col"> |
| | | <BasicTable class="h-3/5" table-title="ä¿å
»å·¥åå表"> |
| | | <BasicTable table-title="ç¹æ£è®°å½å表"> |
| | | <template #toolbar-tools> |
| | | <Space /> |
| | | <Space> |
| | | <a-button v-access:code="['eims:inspectRecord:export']" @click="handleDownloadExcel"> |
| | | {{ $t('pages.common.export') }} |
| | | </a-button> |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | | type="primary" |
| | | v-access:code="['eims:inspectRecord:remove']" |
| | | @click="handleMultiDelete" |
| | | > |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | <!-- <a-button type="primary" v-access:code="['eims:inspectRecord:add']" @click="handleAdd"> |
| | | {{ $t('pages.common.add') }} |
| | | </a-button>--> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #equName="{ row }"> |
| | |
| | | <span>{{ row.equName }}</span> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button v-access:code="['eims:maintOrderSt:edit']" @click.stop="handleEdit(row)"> |
| | | <ghost-button v-access:code="['eims:inspectRecord:edit']" @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" |
| | | @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['eims:maintOrderSt:remove']" @click.stop=""> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['eims:inspectRecord:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | | </Popconfirm> |
| | | </Space> |
| | | </template> |
| | | |
| | | </BasicTable> |
| | | <BasisSubTable |
| | | :columns="orderCol" |
| | | :list-api="listMaintOrderGroupDetail" |
| | | :req-value="orderId" |
| | | class="h-2/5" |
| | | req-key="maintCode" |
| | | title="ä¿å
»å®æ½é¡¹ç®" |
| | | /> |
| | | <!--<BasisSubTable :columns="maintStandCol" :list-api="listMaintStand" :req-value="equId" class="h-1/3" req-key="equId" title="ä¿å
»å®æ½é¡¹ç®" />--> |
| | | </div> |
| | | <MaintOrderStDrawer @reload="tableApi.query()" /> |
| | | <InspRecordDrawer @reload="tableApi.query()" /> |
| | | </Page> |
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import { computed, ref } from 'vue'; |
| | | |
| | | import { useVbenDrawer, useVbenModal } from '@vben/common-ui'; |
| | | import { cloneDeep } from '@vben/utils'; |
| | | |
| | | import { InputSearch } from 'ant-design-vue'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { addInspRecord, getInspRecord, updateInspRecord } from '#/api/eims/insp-record'; |
| | | import CodeInput from '#/views/eims/components/code-input.vue'; |
| | | import equModal from '#/views/eims/components/equ-modal.vue'; |
| | | import userModal from '#/views/eims/components/user-modal.vue'; |
| | | |
| | | import { drawerSchema } from './data'; |
| | | |
| | | |
| | | const emit = defineEmits<{ reload: [] }>(); |
| | | |
| | | const isUpdate = ref(false); |
| | | const title = computed(() => { |
| | | return isUpdate.value ? 'ç¼è¾ç¹æ£è®°å½' : 'æ°å¢ç¹æ£è®°å½'; |
| | | }); |
| | | |
| | | const [BasicForm, formApi] = useVbenForm({ |
| | | commonConfig: { |
| | | formItemClass: 'col-span-2', |
| | | componentProps: { |
| | | class: 'w-full' |
| | | }, |
| | | labelWidth: 120 |
| | | }, |
| | | schema: drawerSchema(), |
| | | showDefaultActions: false, |
| | | wrapperClass: 'grid-cols-2' |
| | | }); |
| | | |
| | | const [BasicDrawer, drawerApi] = useVbenDrawer({ |
| | | onCancel: handleCancel, |
| | | onConfirm: handleConfirm, |
| | | async onOpenChange(isOpen) { |
| | | if (!isOpen) { |
| | | return null; |
| | | } |
| | | drawerApi.drawerLoading(true); |
| | | const { id } = drawerApi.getData() as { id?: number | string }; |
| | | isUpdate.value = !!id; |
| | | // ä»ç¹æ£è®¡å页é¢çæç¹æ£è®°å½ |
| | | const { planInsp } = drawerApi.getData(); |
| | | isUpdate.value = !!id; |
| | | // æ°å¢-ä»ç¹æ£è®¡å页é¢çæç¹æ£è®°å½ |
| | | if (!isUpdate.value && !id) { |
| | | await formApi.setValues(planInsp); |
| | | } |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: { |
| | | disabled: isUpdate.value |
| | | }, |
| | | fieldName: 'inspName' |
| | | } |
| | | ]); |
| | | // æ´æ° && èµå¼ |
| | | if (isUpdate.value && id) { |
| | | const record = await getInspRecord(id); |
| | | await formApi.setValues(record); |
| | | } |
| | | |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | }); |
| | | |
| | | |
| | | async function handleConfirm() { |
| | | try { |
| | | drawerApi.drawerLoading(true); |
| | | const { valid } = await formApi.validate(); |
| | | if (!valid) { |
| | | return; |
| | | } |
| | | const data = cloneDeep(await formApi.getValues()); |
| | | await (isUpdate.value ? updateInspRecord(data) : addInspRecord(data)); |
| | | emit('reload'); |
| | | await handleCancel(); |
| | | } catch (error) { |
| | | console.error(error); |
| | | } finally { |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | async function handleCancel() { |
| | | drawerApi.close(); |
| | | await formApi.resetForm(); |
| | | } |
| | | |
| | | // equ modal |
| | | const [EquModal, equModalApi] = useVbenModal({ |
| | | connectedComponent: equModal, |
| | | draggable: true, |
| | | title: 'éæ©è®¾å¤' |
| | | }); |
| | | |
| | | function handleEquModal() { |
| | | equModalApi.setData({}); |
| | | equModalApi.open(); |
| | | } |
| | | |
| | | // user modal |
| | | const [UserModal, userModalApi] = useVbenModal({ |
| | | connectedComponent: userModal, |
| | | draggable: true, |
| | | title: 'éæ©ç¹æ£äºº' |
| | | }); |
| | | |
| | | const userType = ref<number | undefined>(undefined); |
| | | |
| | | function handleUserModal(type: number) { |
| | | userType.value = type; |
| | | userModalApi.setData({}); |
| | | userModalApi.open(); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°éæ©çè®¾å¤ |
| | | * @param equ |
| | | */ |
| | | async function updateEqu(equ: any) { |
| | | await formApi.setValues({equId:equ.equId,equName:equ.equName}); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°éæ©çç¨æ· |
| | | * @param user |
| | | */ |
| | | async function updateUser(user: any) { |
| | | if (userType.value === 1) { |
| | | await formApi.setValues({ 'inspUserName': user.nickName, 'inspUser': user.userId, 'inspDept': user.deptId }); |
| | | } else if (userType.value === 2) { |
| | | await formApi.setValues({ 'verifyUserName': user.nickName, 'verifyUser': user.userId, 'verifyDept': user.deptId }); |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicDrawer :close-on-click-modal="false" :title="title" class="w-[600px]"> |
| | | <BasicForm> |
| | | <template #equName="slotProps"> |
| | | <InputSearch :enter-button="true" placeholder="è¯·éæ©" @search="handleEquModal" v-bind="slotProps" |
| | | :disabled="isUpdate" /> |
| | | </template> |
| | | <template #inspUserName="slotProps"> |
| | | <InputSearch :enter-button="true" placeholder="è¯·éæ©" @search="handleUserModal(1)" v-bind="slotProps" /> |
| | | </template> |
| | | <template #verifyUserName="slotProps"> |
| | | <InputSearch :enter-button="true" placeholder="è¯·éæ©" @search="handleUserModal(2)" v-bind="slotProps" /> |
| | | </template> |
| | | <template #inspCode="slotProps"> |
| | | <CodeInput v-bind="slotProps" :disabled="isUpdate" prefix="DJSD" /> |
| | | </template> |
| | | </BasicForm> |
| | | <EquModal class="w-[1200px]" @update-equ="updateEqu" /> |
| | | <UserModal class="w-[1200px]" @select-user="updateUser" /> |
| | | </BasicDrawer> |
| | | </template> |
copy from eims-ui/apps/web-antd/src/views/eims/maint-order-st/data.tsx
copy to eims-ui/apps/web-antd/src/views/eims/insp-st/data.tsx
Îļþ´Ó eims-ui/apps/web-antd/src/views/eims/maint-order-st/data.tsx ¸´ÖÆ |
| | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equName', |
| | | label: '设å¤åç§°' |
| | | fieldName: 'title', |
| | | label: 'æ é¢' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'assetNo', |
| | | label: 'èµäº§ç¼å·' |
| | | }, |
| | | { |
| | | component: 'RangePicker', |
| | |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.MAINT_ORDER_ST_STATUS) |
| | | options: getDictOptions(DictEnum.EIMS_INSPECT_STATUS) |
| | | }, |
| | | fieldName: 'status', |
| | | label: 'ç¶æ' |
| | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | | { type: 'checkbox', width: 60, fixed: 'left' }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | field: 'equName', |
| | | title: 'æ é¢', |
| | | field: 'title', |
| | | minWidth: 200, |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: '计åä¿å
»æ¥æ', |
| | | title: 'ä¿å
»å¹´æ', |
| | | field: 'planTime', |
| | | minWidth: 200 |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
| | |
| | | minWidth: 80, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return renderDict(row.status, DictEnum.MAINT_ORDER_ST_STATUS); |
| | | return renderDict(row.status, DictEnum.EIMS_INSPECT_STATUS); |
| | | } |
| | | } |
| | | }, |
| | |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: '工忻æ°', |
| | | field: 'orderCount', |
| | | title: 'ç¹æ£æ»æ°', |
| | | field: 'recordCount', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: 'å¾
ä¿å
»', |
| | | field: 'dbyCount', |
| | | title: 'æªç¹æ£', |
| | | field: 'unCheckCount', |
| | | minWidth: 80, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return <Tag color="orange">{row.dbyCount}</Tag>; |
| | | return <Tag color="orange">{row.unCheckCount}</Tag>; |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: 'ä¿å
»ä¸', |
| | | field: 'byCount', |
| | | title: 'å·²ç¹æ£', |
| | | field: 'checkCount', |
| | | minWidth: 80, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return <Tag color="blue">{row.byCount}</Tag>; |
| | | return <Tag color="blue">{row.checkCount}</Tag>; |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: 'å¾
éªè¯', |
| | | field: 'dyzCount', |
| | | title: 'æ£å¸¸', |
| | | field: 'normalNum', |
| | | minWidth: 80, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return <Tag color="purple">{row.dyzCount}</Tag>; |
| | | return <Tag color="success">{row.normalNum}</Tag>; |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: '宿', |
| | | field: 'wcCount', |
| | | title: 'å¼å¸¸', |
| | | field: 'abNormalNum', |
| | | minWidth: 80, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return <Tag color="success">{row.wcCount}</Tag>; |
| | | return <Tag color="red">{row.abNormalNum}</Tag>; |
| | | } |
| | | } |
| | | }, |
| | |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: 'ç¨½æ¥æ¶é´', |
| | | field: 'verifyTime', |
| | | title: 'ç¹æ£æ¶é´', |
| | | field: 'inspTime', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'planTime', |
| | | label: '计åä¿å
»æ¥æ' |
| | | label: '计åç¹æ£æ¥æ' |
| | | }, |
| | | { |
| | | component: 'Input', |
copy from eims-ui/apps/web-antd/src/views/eims/maint-order-st/index.vue
copy to eims-ui/apps/web-antd/src/views/eims/insp-st/index.vue
Îļþ´Ó eims-ui/apps/web-antd/src/views/eims/maint-order-st/index.vue ¸´ÖÆ |
| | |
| | | import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'; |
| | | import { addFullName, getPopupContainer, getVxePopupContainer } from '@vben/utils'; |
| | | |
| | | import { Popconfirm, Space } from 'ant-design-vue'; |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { listMaintOrderGroupDetail } from '#/api/eims/maint-order'; |
| | | import { delMaintOrderSt, listMaintOrderSt } from '#/api/eims/maint-order-st'; |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { delMaintOrder, listMaintOrderGroupDetail } from '#/api/eims/maint-order'; |
| | | import { delInspectSt, listInspectSt } from '#/api/eims/insp-st'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import BasisSubTable from '#/views/eims/components/basis-sub-table.vue'; |
| | | import { columns as orderCol } from '#/views/eims/maint-order/data'; |
| | | import { columns as recordCol } from '#/views/eims/insp-record/data'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import maintOrderStDrawer from './maint-order-st-drawer.vue'; |
| | | import inspStDrawer from './insp-st-drawer.vue'; |
| | | import type { Recordable } from '@vben/types'; |
| | | import { MAINT_ORDER_STATUS } from '#/constants/dict'; |
| | | import { $t } from '@vben/locales'; |
| | | |
| | | defineExpose({ |
| | |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | return await listMaintOrderSt({ |
| | | return await listInspectSt({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true |
| | | }, |
| | | id: 'maint-order-group-index' |
| | | id: 'insp-st-index' |
| | | }; |
| | | const orderId = ref<string>(); |
| | | const recordId = ref<string>(); |
| | | const [BasicTable, tableApi] = useVbenVxeGrid({ |
| | | formOptions, |
| | | gridOptions, |
| | |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams), |
| | | cellClick: (e: any) => { |
| | | const { row } = e; |
| | | orderId.value = `${row.equId}_${row.planTime}`; |
| | | recordId.value = `${row.equId}_${row.planTime}`; |
| | | } |
| | | } |
| | | }); |
| | |
| | | /** æ ¹æ®é¨é¨IDå è½½ç¨æ· */ |
| | | await setupUserOptions(deptId); |
| | | /** åååéè¦éæ°éæ©ç¨æ· */ |
| | | formModel.maintUser = undefined; |
| | | formModel.inspUser = undefined; |
| | | }, |
| | | placeholder: 'è¯·éæ©', |
| | | showSearch: true, |
| | |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ |
| | | treeNodeLabelProp: 'fullName' |
| | | }), |
| | | fieldName: 'maintDept' |
| | | fieldName: 'inspDept' |
| | | } |
| | | ]); |
| | | } |
| | |
| | | tableApi.formApi.updateSchema([ |
| | | { |
| | | componentProps: { options, placeholder, filterOption }, |
| | | fieldName: 'maintUser' |
| | | fieldName: 'inspUser' |
| | | } |
| | | ]); |
| | | } |
| | | const [MaintOrderStDrawer, maintOrderStDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: maintOrderStDrawer |
| | | const [InspStDrawer, inspStDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: inspStDrawer |
| | | }); |
| | | |
| | | function handleAdd() { |
| | | maintOrderStDrawerApi.setData({}); |
| | | maintOrderStDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | maintOrderStDrawerApi.setData({ id: record.id }); |
| | | maintOrderStDrawerApi.open(); |
| | | inspStDrawerApi.setData({ id: record.id }); |
| | | inspStDrawerApi.open(); |
| | | } |
| | | async function handleDelete(row: Recordable<any>) { |
| | | await delMaintOrderSt(row.id); |
| | | await delInspectSt(row.id); |
| | | await tableApi.query(); |
| | | } |
| | | |
| | | function handleMultiDelete() { |
| | | const rows = tableApi.grid.getCheckboxRecords(); |
| | | const ids = rows.map((row: any) => row.id); |
| | | Modal.confirm({ |
| | | title: 'æç¤º', |
| | | okType: 'danger', |
| | | content: `确认å é¤éä¸ç${ids.length}æ¡è®°å½åï¼`, |
| | | onOk: async () => { |
| | | await delInspectSt(ids); |
| | | await tableApi.query(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | await setupDeptSelect(); |
| | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px] flex-col"> |
| | | <BasicTable class="h-3/5" table-title="ä¿å
»å·¥åå表"> |
| | | <BasicTable class="h-2/3" table-title="ç¹æ£è®°å½å表"> |
| | | <template #toolbar-tools> |
| | | <Space /> |
| | | <Space > |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | | type="primary" |
| | | v-access:code="['eims:inspectSt:remove']" |
| | | @click="handleMultiDelete" |
| | | > |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #equName="{ row }"> |
| | |
| | | </template> |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button v-access:code="['eims:maintOrderSt:edit']" @click.stop="handleEdit(row)"> |
| | | <ghost-button v-access:code="['eims:inspectSt:edit']" @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" |
| | | @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['eims:maintOrderSt:remove']" @click.stop=""> |
| | | <ghost-button danger v-access:code="['eims:inspectSt:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | | </Popconfirm> |
| | |
| | | |
| | | </BasicTable> |
| | | <BasisSubTable |
| | | :columns="orderCol" |
| | | :columns="recordCol" |
| | | :list-api="listMaintOrderGroupDetail" |
| | | :req-value="orderId" |
| | | class="h-2/5" |
| | | :req-value="recordId" |
| | | class="h-1/3" |
| | | req-key="maintCode" |
| | | title="ä¿å
»å®æ½é¡¹ç®" |
| | | /> |
| | | </div> |
| | | <MaintOrderStDrawer @reload="tableApi.query()" /> |
| | | <InspStDrawer @reload="tableApi.query()" /> |
| | | </Page> |
| | | </template> |
copy from eims-ui/apps/web-antd/src/views/eims/maint-order-st/maint-order-st-drawer.vue
copy to eims-ui/apps/web-antd/src/views/eims/insp-st/insp-st-drawer.vue
Îļþ´Ó eims-ui/apps/web-antd/src/views/eims/maint-order-st/maint-order-st-drawer.vue ¸´ÖÆ |
| | |
| | | import { InputSearch } from 'ant-design-vue'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { getMaintOrderSt, updateMaintOrderSt } from '#/api/eims/maint-order-st'; |
| | | import { getInspectSt, updateInspectSt } from '#/api/eims/insp-st'; |
| | | import userModal from '#/views/eims/components/user-modal.vue'; |
| | | |
| | | import { drawerSchema } from './data'; |
| | |
| | | |
| | | const isUpdate = ref(false); |
| | | const title = computed(() => { |
| | | return isUpdate.value ? 'ä¿å
»å·¥åæ±æ»ç¨½æ¥' : 'ä¿å
»å·¥åæ±æ»'; |
| | | return isUpdate.value ? 'ç¹æ£è®°å½æ±æ»ç¨½æ¥' : 'ç¹æ£è®°å½æ±æ»'; |
| | | }); |
| | | |
| | | const [BasicForm, formApi] = useVbenForm({ |
| | |
| | | isUpdate.value = !!id; |
| | | // æ´æ° && èµå¼ |
| | | if (isUpdate.value && id) { |
| | | const record = await getMaintOrderSt(id); |
| | | const record = await getInspectSt(id); |
| | | await formApi.setValues(record); |
| | | } |
| | | |
| | |
| | | } |
| | | const data = cloneDeep(await formApi.getValues()); |
| | | // await (isUpdate.value ? updateMaintOrderSt(data) : addMaintOrderSt(data)); |
| | | await (isUpdate.value ? updateMaintOrderSt(data) : updateMaintOrderSt(data)); |
| | | await (isUpdate.value ? updateInspectSt(data) : updateInspectSt(data)); |
| | | emit('reload'); |
| | | await handleCancel(); |
| | | } catch (error) { |
| | |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: 'å·¥ä½æè¿°', |
| | | field: 'maintDesc', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | title: 'éªè¯äºº', |
| | | field: 'verifyUserName', |
| | | minWidth: 160 |
| | |
| | | component: 'Input', |
| | | fieldName: 'maintCode', |
| | | label: 'ä¿å
»åå·' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'maintName', |
| | | label: 'ä¿å
»é¡¹' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | |
| | | label: 'ç»ææ¶é´' |
| | | }, |
| | | { |
| | | component: 'Textarea', |
| | | fieldName: 'maintDesc', |
| | | label: 'å·¥ä½æè¿°' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'verifyUser', |
| | | label: 'éªè¯äººid', |
| | |
| | | ]); |
| | | } |
| | | |
| | | |
| | | |
| | | onMounted(async () => { |
| | | await setupDeptSelect(); |
| | | }); |
| | |
| | | > |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | <a-button type="primary" v-access:code="['eims:maintOrder:add']" @click="handleAdd"> |
| | | <!-- <a-button type="primary" v-access:code="['eims:maintOrder:add']" @click="handleAdd"> |
| | | {{ $t('pages.common.add') }} |
| | | </a-button> |
| | | </a-button>--> |
| | | </Space> |
| | | </template> |
| | | |
| | |
| | | <ghost-button v-access:code="['eims:maintOrder:edit']" @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" |
| | | @confirm="handleDelete(row)"> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['eims:maintOrder:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | |
| | | </template> |
| | | </BasicTable> |
| | | <!--<BasisSubTable :columns="maintStandCol" :list-api="listMaintStand" :req-value="equId" class="h-1/3" req-key="equId" title="ä¿å
»å®æ½é¡¹ç®" />--> |
| | | |
| | | </div> |
| | | <MaintOrderDrawer @reload="tableApi.query()" /> |
| | | </Page> |
| | |
| | | } |
| | | // éç½® |
| | | baoyangCol(false); |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: { |
| | | disabled: isUpdate.value |
| | | }, |
| | | fieldName: 'maintName' |
| | | } |
| | | ]); |
| | | |
| | | // æ´æ° && èµå¼ |
| | | if (isUpdate.value && id) { |
| | |
| | | disabled: show |
| | | }, |
| | | fieldName: 'status' |
| | | }, |
| | | { |
| | | componentProps: { |
| | | disabled: show |
| | | }, |
| | | fieldName: 'maintName' |
| | | } |
| | | ]); |
| | | } |
| | |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | field: 'createTime', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | field: 'action', |
| | | fixed: 'right', |
| | | slots: { default: 'action' }, |
| | |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import { MAINT_ORDER_STATUS } from '#/constants/dict'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | import BasisSubTable from '#/views/eims/components/basis-sub-table.vue'; |
| | | import maintOrderDrawer from '#/views/eims/maint-order/maint-order-drawer.vue'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | |
| | | maintType: record.maintType, |
| | | planTime: record.maintNextTime, |
| | | status: MAINT_ORDER_STATUS.DAIBAOYANG, |
| | | maintCode: code |
| | | maintCode: code, |
| | | maintName: record.maintName |
| | | }; |
| | | |
| | | maintOrderDrawerApi.setData({ planOrder }); |
ÎļþÃû´Ó eims-ui/apps/web-antd/src/views/eims/maint-order-st/data.tsx ÐÞ¸Ä |
| | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equName', |
| | | label: '设å¤åç§°' |
| | | fieldName: 'title', |
| | | label: 'æ é¢' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'assetno', |
| | | label: 'èµäº§ç¼å·' |
| | | }, |
| | | { |
| | | component: 'RangePicker', |
| | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | | { type: 'checkbox', width: 60, fixed: 'left' }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | field: 'equName', |
| | | title: 'æ é¢', |
| | | field: 'title', |
| | | minWidth: 200, |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: '计åä¿å
»æ¥æ', |
| | | title: 'ä¿å
»å¹´æ', |
| | | field: 'planTime', |
| | | minWidth: 200 |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
ÎļþÃû´Ó eims-ui/apps/web-antd/src/views/eims/maint-order-st/index.vue ÐÞ¸Ä |
| | |
| | | <script setup lang="ts"> |
| | | import type { Recordable } from '@vben/types'; |
| | | |
| | | import { onMounted, ref } from 'vue'; |
| | | |
| | | import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { addFullName, getPopupContainer, getVxePopupContainer } from '@vben/utils'; |
| | | |
| | | import { Popconfirm, Space } from 'ant-design-vue'; |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { listMaintOrderGroupDetail } from '#/api/eims/maint-order'; |
| | | import { delMaintOrderSt, listMaintOrderSt } from '#/api/eims/maint-order-st'; |
| | | import { delMaintSt, listMaintSt } from '#/api/eims/maint-st'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import BasisSubTable from '#/views/eims/components/basis-sub-table.vue'; |
| | | import { columns as orderCol } from '#/views/eims/maint-order/data'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import maintOrderStDrawer from './maint-order-st-drawer.vue'; |
| | | import type { Recordable } from '@vben/types'; |
| | | import { MAINT_ORDER_STATUS } from '#/constants/dict'; |
| | | import { $t } from '@vben/locales'; |
| | | import maintStDrawer from './maint-st-drawer.vue'; |
| | | |
| | | defineExpose({ |
| | | tableSelect |
| | |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | return await listMaintOrderSt({ |
| | | return await listMaintSt({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | |
| | | } |
| | | ]); |
| | | } |
| | | const [MaintOrderStDrawer, maintOrderStDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: maintOrderStDrawer |
| | | const [MaintStDrawer, maintStDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: maintStDrawer |
| | | }); |
| | | |
| | | function handleAdd() { |
| | | maintOrderStDrawerApi.setData({}); |
| | | maintOrderStDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | maintOrderStDrawerApi.setData({ id: record.id }); |
| | | maintOrderStDrawerApi.open(); |
| | | maintStDrawerApi.setData({ id: record.id }); |
| | | maintStDrawerApi.open(); |
| | | } |
| | | async function handleDelete(row: Recordable<any>) { |
| | | await delMaintOrderSt(row.id); |
| | | await delMaintSt(row.id); |
| | | await tableApi.query(); |
| | | } |
| | | |
| | | function handleMultiDelete() { |
| | | const rows = tableApi.grid.getCheckboxRecords(); |
| | | const ids = rows.map((row: any) => row.id); |
| | | Modal.confirm({ |
| | | title: 'æç¤º', |
| | | okType: 'danger', |
| | | content: `确认å é¤éä¸ç${ids.length}æ¡è®°å½åï¼`, |
| | | onOk: async () => { |
| | | await delMaintSt(ids); |
| | | await tableApi.query(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | await setupDeptSelect(); |
| | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px] flex-col"> |
| | | <BasicTable class="h-3/5" table-title="ä¿å
»å·¥åå表"> |
| | | <BasicTable class="h-2/3" table-title="ä¿å
»å·¥åå表"> |
| | | <template #toolbar-tools> |
| | | <Space /> |
| | | <Space> |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | | type="primary" |
| | | v-access:code="['eims:maintSt:remove']" |
| | | @click="handleMultiDelete" |
| | | > |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #equName="{ row }"> |
| | |
| | | </template> |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button v-access:code="['eims:maintOrderSt:edit']" @click.stop="handleEdit(row)"> |
| | | <ghost-button v-access:code="['eims:maintSt:edit']" @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" |
| | | @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['eims:maintOrderSt:remove']" @click.stop=""> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['eims:maintSt:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | | </Popconfirm> |
| | | </Space> |
| | | </template> |
| | | |
| | | </BasicTable> |
| | | <BasisSubTable |
| | | :columns="orderCol" |
| | | :list-api="listMaintOrderGroupDetail" |
| | | :req-value="orderId" |
| | | class="h-2/5" |
| | | class="h-1/3" |
| | | req-key="maintCode" |
| | | title="ä¿å
»å®æ½é¡¹ç®" |
| | | /> |
| | | </div> |
| | | <MaintOrderStDrawer @reload="tableApi.query()" /> |
| | | <MaintStDrawer @reload="tableApi.query()" /> |
| | | </Page> |
| | | </template> |
ÎļþÃû´Ó eims-ui/apps/web-antd/src/views/eims/maint-order-st/maint-order-st-drawer.vue ÐÞ¸Ä |
| | |
| | | import { cloneDeep } from '@vben/utils'; |
| | | |
| | | import { InputSearch } from 'ant-design-vue'; |
| | | import { getMaintSt, updateMaintSt } from '#/api/eims/maint-st'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { getMaintOrderSt, updateMaintOrderSt } from '#/api/eims/maint-order-st'; |
| | | import userModal from '#/views/eims/components/user-modal.vue'; |
| | | |
| | | import { drawerSchema } from './data'; |
| | |
| | | isUpdate.value = !!id; |
| | | // æ´æ° && èµå¼ |
| | | if (isUpdate.value && id) { |
| | | const record = await getMaintOrderSt(id); |
| | | const record = await getMaintSt(id); |
| | | await formApi.setValues(record); |
| | | } |
| | | |
| | |
| | | } |
| | | const data = cloneDeep(await formApi.getValues()); |
| | | // await (isUpdate.value ? updateMaintOrderSt(data) : addMaintOrderSt(data)); |
| | | await (isUpdate.value ? updateMaintOrderSt(data) : updateMaintOrderSt(data)); |
| | | await (isUpdate.value ? updateMaintSt(data) : updateMaintSt(data)); |
| | | emit('reload'); |
| | | await handleCancel(); |
| | | } catch (error) { |
| | |
| | | export enum DictEnum { |
| | | EIMS_EQU_UNIT = 'eims_equ_unit', // 设å¤çç¹ç¶æ |
| | | EIMS_FIXTURE_STATUS = 'eims_fixture_status', // å·¥å
·ï¼æ²»å
·ï¼ç¶æ |
| | | EIMS_INSPECT_TYPE = 'eims_inspect_type', // ç¹æ£ç±»å |
| | | EIMS_INVENTORY_DETAIL_STATU = 'inventory_detail_statu', // 设å¤çç¹ç¶æ |
| | | EIMS_INVENTORY_STATU = 'inventory_statu', // 设å¤çç¹ç¶æ |
| | | EIMS_MAINT_TYPE = 'eims_maint_type', // ä¿å
»ç±»å |
| | | EIMS_INSPECT_RESULT = 'eims_inspect_result', // ç¹æ£ç»æ |
| | | EIMS_ORDITM_STATUS = 'eims_orditm_status', // ä¿å
»å·¥åæç»å®æç¶æ |
| | | EQU_IMPORT_STATU = 'equ_import_status', // 设å¤å¯¼å
¥ç¶æ |
| | | FIXTURE_BORROW_RECORD_STATUS = 'fixture_borrow_record_status', // å·¥å
·ï¼æ²»å
·ï¼åç¨è®°å½ç¶æ |
| | | FIXTURE_BORROW_STATUS = 'fixture_borrow_status', // å·¥å
·ï¼æ²»å
·ï¼åç¨ç¶æ |
| | | MAINT_CYCLE_UNIT = 'maint_cycle_unit', // ä¿å
»å¨æåä½ |
| | | MAINT_ORDER_STATUS = 'maint_order_status', // ä¿å
»å·¥åç¶æ |
| | | MAINT_ORDER_ST_STATUS = 'maint_order_st_status', // ä¿å
»å·¥åæ±æ»ç¨½æ¥ç¶æ |
| | | MAINT_ORDER_STATUS = 'maint_order_status', // ä¿å
»å·¥åç¶æ |
| | | EIMS_INSPECT_STATUS = 'eims_inspect_status', // ç¹æ£ç¶æ |
| | | MAINT_TIME_RULE = 'maint_time_rule', // ä¿å
»è§å |
| | | REPAIR_FAULT_TYPE = 'repair_fault_type', // æ¥ä¿®ç¶æ |
| | | REPAIR_RECORD_HANDLE = 'repair_record_handle', // ç»´ä¿®è®°å½æä½ |
| | |
| | | String N = "0";// æªå®æ |
| | | String Y = "1"; // 已宿 |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import lombok.RequiredArgsConstructor; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.constraints.*; |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.dromara.common.idempotent.annotation.RepeatSubmit; |
| | | import org.dromara.common.log.annotation.Log; |
| | | import org.dromara.common.web.core.BaseController; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | | import org.dromara.common.core.validate.EditGroup; |
| | | import org.dromara.common.log.enums.BusinessType; |
| | | import org.dromara.common.excel.utils.ExcelUtil; |
| | | import org.dromara.eims.domain.vo.EimsInspectPlanVo; |
| | | import org.dromara.eims.domain.bo.EimsInspectPlanBo; |
| | | import org.dromara.eims.service.IEimsInspectPlanService; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * ç¹æ£è®¡å |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-12 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/inspectPlan") |
| | | public class EimsInspectPlanController extends BaseController { |
| | | |
| | | private final IEimsInspectPlanService eimsInspectPlanService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£è®¡åå表 |
| | | */ |
| | | @SaCheckPermission("eims:inspectPlan:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<EimsInspectPlanVo> list(EimsInspectPlanBo bo, PageQuery pageQuery) { |
| | | // return eimsInspectPlanService.queryPageList(bo, pageQuery); |
| | | return eimsInspectPlanService.queryPageListCustom(bo, pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 导åºç¹æ£è®¡åå表 |
| | | */ |
| | | @SaCheckPermission("eims:inspectPlan:export") |
| | | @Log(title = "ç¹æ£è®¡å", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(EimsInspectPlanBo bo, HttpServletResponse response) { |
| | | List<EimsInspectPlanVo> list = eimsInspectPlanService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "ç¹æ£è®¡å", EimsInspectPlanVo.class, response); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¹æ£è®¡å详ç»ä¿¡æ¯ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | @SaCheckPermission("eims:inspectPlan:query") |
| | | @GetMapping("/{id}") |
| | | public R<EimsInspectPlanVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long id) { |
| | | return R.ok(eimsInspectPlanService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç¹æ£è®¡å |
| | | */ |
| | | @SaCheckPermission("eims:inspectPlan:add") |
| | | @Log(title = "ç¹æ£è®¡å", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsInspectPlanBo bo) { |
| | | return toAjax(eimsInspectPlanService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¹æ£è®¡å |
| | | */ |
| | | @SaCheckPermission("eims:inspectPlan:edit") |
| | | @Log(title = "ç¹æ£è®¡å", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsInspectPlanBo bo) { |
| | | return toAjax(eimsInspectPlanService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç¹æ£è®¡å |
| | | * |
| | | * @param ids 主é®ä¸² |
| | | */ |
| | | @SaCheckPermission("eims:inspectPlan:remove") |
| | | @Log(title = "ç¹æ£è®¡å", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(eimsInspectPlanService.deleteWithValidByIds(List.of(ids), true)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import lombok.RequiredArgsConstructor; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.constraints.*; |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.dromara.common.idempotent.annotation.RepeatSubmit; |
| | | import org.dromara.common.log.annotation.Log; |
| | | import org.dromara.common.web.core.BaseController; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | | import org.dromara.common.core.validate.EditGroup; |
| | | import org.dromara.common.log.enums.BusinessType; |
| | | import org.dromara.common.excel.utils.ExcelUtil; |
| | | import org.dromara.eims.domain.vo.EimsInspectRecordVo; |
| | | import org.dromara.eims.domain.bo.EimsInspectRecordBo; |
| | | import org.dromara.eims.service.IEimsInspectRecordService; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * ç¹æ£è®°å½ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-13 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/inspRecord") |
| | | public class EimsInspectRecordController extends BaseController { |
| | | |
| | | private final IEimsInspectRecordService eimsInspectRecordService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£è®°å½å表 |
| | | */ |
| | | @SaCheckPermission("eims:inspectRecord:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<EimsInspectRecordVo> list(EimsInspectRecordBo bo, PageQuery pageQuery) { |
| | | // return eimsInspectRecordService.queryPageList(bo, pageQuery); |
| | | return eimsInspectRecordService.queryPageListCustom(bo, pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 导åºç¹æ£è®°å½å表 |
| | | */ |
| | | @SaCheckPermission("eims:inspectRecord:export") |
| | | @Log(title = "ç¹æ£è®°å½", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(EimsInspectRecordBo bo, HttpServletResponse response) { |
| | | List<EimsInspectRecordVo> list = eimsInspectRecordService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "ç¹æ£è®°å½", EimsInspectRecordVo.class, response); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¹æ£è®°å½è¯¦ç»ä¿¡æ¯ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | @SaCheckPermission("eims:inspectRecord:query") |
| | | @GetMapping("/{id}") |
| | | public R<EimsInspectRecordVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long id) { |
| | | return R.ok(eimsInspectRecordService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç¹æ£è®°å½ |
| | | */ |
| | | @SaCheckPermission("eims:inspectRecord:add") |
| | | @Log(title = "ç¹æ£è®°å½", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsInspectRecordBo bo) { |
| | | return toAjax(eimsInspectRecordService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¹æ£è®°å½ |
| | | */ |
| | | @SaCheckPermission("eims:inspectRecord:edit") |
| | | @Log(title = "ç¹æ£è®°å½", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsInspectRecordBo bo) { |
| | | return toAjax(eimsInspectRecordService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç¹æ£è®°å½ |
| | | * |
| | | * @param ids 主é®ä¸² |
| | | */ |
| | | @SaCheckPermission("eims:inspectRecord:remove") |
| | | @Log(title = "ç¹æ£è®°å½", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(eimsInspectRecordService.deleteWithValidByIds(List.of(ids), true)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import lombok.RequiredArgsConstructor; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.constraints.*; |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.dromara.common.idempotent.annotation.RepeatSubmit; |
| | | import org.dromara.common.log.annotation.Log; |
| | | import org.dromara.common.web.core.BaseController; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | | import org.dromara.common.core.validate.EditGroup; |
| | | import org.dromara.common.log.enums.BusinessType; |
| | | import org.dromara.common.excel.utils.ExcelUtil; |
| | | import org.dromara.eims.domain.vo.EimsInspectStVo; |
| | | import org.dromara.eims.domain.bo.EimsInspectStBo; |
| | | import org.dromara.eims.service.IEimsInspectStService; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * ç¹æ£æ±æ» |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-14 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/inspectSt") |
| | | public class EimsInspectStController extends BaseController { |
| | | |
| | | private final IEimsInspectStService eimsInspectStService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£æ±æ»å表 |
| | | */ |
| | | @SaCheckPermission("eims:inspectSt:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<EimsInspectStVo> list(EimsInspectStBo bo, PageQuery pageQuery) { |
| | | return eimsInspectStService.queryPageList(bo, pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 导åºç¹æ£æ±æ»å表 |
| | | */ |
| | | @SaCheckPermission("eims:inspectSt:export") |
| | | @Log(title = "ç¹æ£æ±æ»", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(EimsInspectStBo bo, HttpServletResponse response) { |
| | | List<EimsInspectStVo> list = eimsInspectStService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "ç¹æ£æ±æ»", EimsInspectStVo.class, response); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¹æ£æ±æ»è¯¦ç»ä¿¡æ¯ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | @SaCheckPermission("eims:inspectSt:query") |
| | | @GetMapping("/{id}") |
| | | public R<EimsInspectStVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long id) { |
| | | return R.ok(eimsInspectStService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç¹æ£æ±æ» |
| | | */ |
| | | @SaCheckPermission("eims:inspectSt:add") |
| | | @Log(title = "ç¹æ£æ±æ»", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsInspectStBo bo) { |
| | | return toAjax(eimsInspectStService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¹æ£æ±æ» |
| | | */ |
| | | @SaCheckPermission("eims:inspectSt:edit") |
| | | @Log(title = "ç¹æ£æ±æ»", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsInspectStBo bo) { |
| | | return toAjax(eimsInspectStService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç¹æ£æ±æ» |
| | | * |
| | | * @param ids 主é®ä¸² |
| | | */ |
| | | @SaCheckPermission("eims:inspectSt:remove") |
| | | @Log(title = "ç¹æ£æ±æ»", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(eimsInspectStService.deleteWithValidByIds(List.of(ids), true)); |
| | | } |
| | | } |
| | |
| | | package org.dromara.eims.controller; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.ZoneId; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | @SaCheckPermission("eims:maintOrder:list") |
| | | @GetMapping("/groupList") |
| | | public TableDataInfo<MaintOrdeGroupVo> group(EimsMaintOrderBo bo, PageQuery pageQuery) { |
| | | // return eimsMaintOrderService.queryPageList(bo, pageQuery); |
| | | return eimsMaintOrderService.queryPageGroupList(bo, pageQuery); |
| | | } |
| | | |
| | |
| | | } |
| | | String[] split = maintCode.split("_"); |
| | | bo.setEquId(Long.valueOf(split[0])); |
| | | bo.setPlanTime(DateUtils.parseDate(split[1])); |
| | | bo.setMaintCode(null); |
| | | // return eimsMaintOrderService.queryPageList(bo, pageQuery); |
| | | LocalDate planTime = DateUtils.parseDate(split[1]).toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | LocalDate startOfMonth = planTime.with(TemporalAdjusters.firstDayOfMonth()); |
| | | LocalDate endOfMonth = planTime.with(TemporalAdjusters.lastDayOfMonth()); |
| | | Map<String, Object> params = bo.getParams(); |
| | | params.put("beginPlanTime",startOfMonth); |
| | | params.put("endPlanTime",endOfMonth); |
| | | |
| | | return eimsMaintOrderService.queryPageListCustom(bo, pageQuery); |
| | | } |
| | | |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/controller/EimsMaintOrderStController.java ÐÞ¸Ä |
| | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.constraints.*; |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import org.dromara.eims.domain.bo.EimsMaintStBo; |
| | | import org.dromara.eims.domain.vo.EimsMaintStVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.dromara.common.idempotent.annotation.RepeatSubmit; |
| | |
| | | import org.dromara.common.core.validate.EditGroup; |
| | | import org.dromara.common.log.enums.BusinessType; |
| | | import org.dromara.common.excel.utils.ExcelUtil; |
| | | import org.dromara.eims.domain.vo.EimsMaintOrderStVo; |
| | | import org.dromara.eims.domain.bo.EimsMaintOrderStBo; |
| | | import org.dromara.eims.service.IEimsMaintOrderStService; |
| | | import org.dromara.eims.service.IEimsMaintStService; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | |
| | | /** |
| | |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/maintOrderSt") |
| | | public class EimsMaintOrderStController extends BaseController { |
| | | @RequestMapping("/eims/maintSt") |
| | | public class EimsMaintStController extends BaseController { |
| | | |
| | | private final IEimsMaintOrderStService eimsMaintOrderStService; |
| | | private final IEimsMaintStService eimsMaintStService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»å·¥åæ±æ»å表 |
| | | */ |
| | | @SaCheckPermission("eims:maintOrderSt:list") |
| | | @SaCheckPermission("eims:maintSt:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<EimsMaintOrderStVo> list(EimsMaintOrderStBo bo, PageQuery pageQuery) { |
| | | return eimsMaintOrderStService.queryPageList(bo, pageQuery); |
| | | public TableDataInfo<EimsMaintStVo> list(EimsMaintStBo bo, PageQuery pageQuery) { |
| | | return eimsMaintStService.queryPageList(bo, pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 导åºä¿å
»å·¥åæ±æ»å表 |
| | | */ |
| | | @SaCheckPermission("eims:maintOrderSt:export") |
| | | @SaCheckPermission("eims:maintSt:export") |
| | | @Log(title = "ä¿å
»å·¥åæ±æ»", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(EimsMaintOrderStBo bo, HttpServletResponse response) { |
| | | List<EimsMaintOrderStVo> list = eimsMaintOrderStService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "ä¿å
»å·¥åæ±æ»", EimsMaintOrderStVo.class, response); |
| | | public void export(EimsMaintStBo bo, HttpServletResponse response) { |
| | | List<EimsMaintStVo> list = eimsMaintStService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "ä¿å
»å·¥åæ±æ»", EimsMaintStVo.class, response); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | @SaCheckPermission("eims:maintOrderSt:query") |
| | | @SaCheckPermission("eims:maintSt:query") |
| | | @GetMapping("/{id}") |
| | | public R<EimsMaintOrderStVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | public R<EimsMaintStVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long id) { |
| | | return R.ok(eimsMaintOrderStService.queryById(id)); |
| | | return R.ok(eimsMaintStService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿å
»å·¥åæ±æ» |
| | | */ |
| | | @SaCheckPermission("eims:maintOrderSt:add") |
| | | @SaCheckPermission("eims:maintSt:add") |
| | | @Log(title = "ä¿å
»å·¥åæ±æ»", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsMaintOrderStBo bo) { |
| | | return toAjax(eimsMaintOrderStService.insertByBo(bo)); |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsMaintStBo bo) { |
| | | return toAjax(eimsMaintStService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
»å·¥åæ±æ» |
| | | */ |
| | | @SaCheckPermission("eims:maintOrderSt:edit") |
| | | @SaCheckPermission("eims:maintSt:edit") |
| | | @Log(title = "ä¿å
»å·¥åæ±æ»", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsMaintOrderStBo bo) { |
| | | return toAjax(eimsMaintOrderStService.updateByBo(bo)); |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsMaintStBo bo) { |
| | | return toAjax(eimsMaintStService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param ids 主é®ä¸² |
| | | */ |
| | | @SaCheckPermission("eims:maintOrderSt:remove") |
| | | @SaCheckPermission("eims:maintSt:remove") |
| | | @Log(title = "ä¿å
»å·¥åæ±æ»", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | |
| | | return eimsMaintOrderStService.deleteWithValidByIds(List.of(ids), true); |
| | | return eimsMaintStService.deleteWithValidByIds(List.of(ids), true); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain; |
| | | |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.io.Serial; |
| | | |
| | | /** |
| | | * ç¹æ£è®¡å对象 eims_inspect_plan |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-12 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("eims_inspect_plan") |
| | | public class EimsInspectPlan extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | |
| | | */ |
| | | private Long equId; |
| | | |
| | | /** |
| | | * ç¹æ£ç±»åï¼åå
¸ï¼ |
| | | */ |
| | | private String inspType; |
| | | |
| | | /** |
| | | * ç¹æ£é¡¹åç§° |
| | | */ |
| | | private String inspName; |
| | | |
| | | /** |
| | | * ç¹æ£é¡¹ç¼å· |
| | | */ |
| | | private Long inspNo; |
| | | |
| | | /** |
| | | * ç¹æ£è¯´æ |
| | | */ |
| | | private String inspDesc; |
| | | |
| | | /** |
| | | * ç¹æ£å¨æ |
| | | */ |
| | | private Long inspCycle; |
| | | |
| | | /** |
| | | * ç¹æ£å¨æåä½ï¼åå
¸ï¼ |
| | | */ |
| | | private String inspCycleUnit; |
| | | |
| | | /** |
| | | * ç¹æ£è§åï¼åå
¸ï¼ä¿å
»æ¶é´è®¡ç®ï¼1-æå¨æ 2-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | */ |
| | | private String inspRule; |
| | | |
| | | /** |
| | | * ç¹æ£äºº |
| | | */ |
| | | private Long inspUser; |
| | | |
| | | /** |
| | | * ç¹æ£é¨é¨ |
| | | */ |
| | | private Long inspDept; |
| | | |
| | | /** |
| | | * ç¶æï¼åå
¸ï¼ 0-å¯ç¨ 1-ç¦ç¨ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * 馿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date inspFirstTime; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date inspLastTime; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date inspNextTime; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain; |
| | | |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.io.Serial; |
| | | |
| | | /** |
| | | * ç¹æ£è®°å½å¯¹è±¡ eims_inspect_record |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-13 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("eims_inspect_record") |
| | | public class EimsInspectRecord extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设å¤di |
| | | */ |
| | | private Long equId; |
| | | |
| | | /** |
| | | * ç¹æ£åç§° |
| | | */ |
| | | private String inspName; |
| | | |
| | | /** |
| | | * ç¹æ£æè¿° |
| | | */ |
| | | private String inspDesc; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * ç¹æ£ç¼ç |
| | | */ |
| | | private String inspCode; |
| | | |
| | | /** |
| | | * ç¹æ£äºº |
| | | */ |
| | | private Long inspUser; |
| | | |
| | | /** |
| | | * ç¹æ£é¨é¨ |
| | | */ |
| | | private Long inspDept; |
| | | |
| | | /** |
| | | * å¼è®°å½æ¹å¼ï¼åå
¸ï¼ |
| | | */ |
| | | private String recordMode; |
| | | |
| | | /** |
| | | * åèå¼ |
| | | */ |
| | | private String referenceValue; |
| | | |
| | | /** |
| | | * ä¸é |
| | | */ |
| | | private String upperLimit; |
| | | |
| | | /** |
| | | * ä¸é |
| | | */ |
| | | private String lowLimit; |
| | | |
| | | /** |
| | | * æ£æ¥å¼ |
| | | */ |
| | | private String checkValue; |
| | | |
| | | /** |
| | | * ç¹æ£ç»æï¼åå
¸ï¼ |
| | | */ |
| | | private String inspResult; |
| | | |
| | | /** |
| | | * ç¹æ£ç±»åï¼åå
¸ï¼ |
| | | */ |
| | | private String inspType; |
| | | |
| | | |
| | | /** |
| | | * ç¹æ£æ¶é´ |
| | | */ |
| | | private Date inspTime; |
| | | |
| | | /** |
| | | * 计åç¹æ£æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date planTime; |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | private Long verifyUser; |
| | | |
| | | /** |
| | | * 计åid |
| | | */ |
| | | private Long planId; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
copy from eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/EimsMaintOrderSt.java
copy to eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/EimsInspectSt.java
Îļþ´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/EimsMaintOrderSt.java ¸´ÖÆ |
| | |
| | | import java.io.Serial; |
| | | |
| | | /** |
| | | * ä¿å
»å·¥åæ±æ»å¯¹è±¡ eims_maint_order_st |
| | | * ç¹æ£æ±æ»å¯¹è±¡ eims_inspect_st |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-12 |
| | | * @date 2025-03-14 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("eims_maint_order_st") |
| | | public class EimsMaintOrderSt extends BaseEntity { |
| | | @TableName("eims_inspect_st") |
| | | public class EimsInspectSt extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | private Long id; |
| | | |
| | | /** |
| | | * |
| | | * æ é¢ |
| | | */ |
| | | private String title; |
| | | |
| | | /** |
| | | * |
| | | * 设å¤id |
| | | */ |
| | | private String equId; |
| | | private Long equId; |
| | | |
| | | /** |
| | | * |
| | | * è®¡åæ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date planTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date verifyTime; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * ä¿å
»äºº |
| | | * ç¹æ£äºº |
| | | */ |
| | | private Long maintUser; |
| | | |
| | | private Long inspUser; |
| | | /** |
| | | * éªè¯äºº |
| | | * 稽æ¥äºº |
| | | */ |
| | | private Long verifyUser; |
| | | |
| | | /** |
| | | * ç¨½æ¥æ¥æ |
| | | */ |
| | | private Date verifyTime; |
| | | |
| | | /** |
| | | * ç¹è®°äºé¡¹ |
| | |
| | | private String remark; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | private String maintCode; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ |
| | | */ |
| | | private String maintName; |
| | | /** |
| | | * å·¥ä½æè¿° |
| | | */ |
| | | private String maintDesc; |
| | | /** |
| | | * |
| | | */ |
| | | private String status; |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/EimsMaintOrderSt.java ÐÞ¸Ä |
| | |
| | | import java.io.Serial; |
| | | |
| | | /** |
| | | * ä¿å
»å·¥åæ±æ»å¯¹è±¡ eims_maint_order_st |
| | | * ä¿å
»å·¥åæ±æ»å¯¹è±¡ eims_maint_st |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-12 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("eims_maint_order_st") |
| | | public class EimsMaintOrderSt extends BaseEntity { |
| | | @TableName("eims_maint_st") |
| | | public class EimsMaintSt extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | /** |
| | | * |
| | | */ |
| | | private String equId; |
| | | private Long equId; |
| | | |
| | | /** |
| | | * |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import org.dromara.eims.domain.EimsInspectPlan; |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | | import org.dromara.common.core.validate.EditGroup; |
| | | import io.github.linpeilie.annotations.AutoMapper; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | /** |
| | | * ç¹æ£è®¡åä¸å¡å¯¹è±¡ eims_inspect_plan |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-12 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = EimsInspectPlan.class, reverseConvertGenerate = false) |
| | | public class EimsInspectPlanBo extends BaseEntity { |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @NotNull(message = "ä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | |
| | | */ |
| | | @NotNull(message = "设å¤id ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long equId; |
| | | |
| | | /** |
| | | * ç¹æ£ç±»åï¼åå
¸ï¼ |
| | | */ |
| | | private String inspType; |
| | | |
| | | /** |
| | | * ç¹æ£é¡¹åç§° |
| | | */ |
| | | @NotBlank(message = "ç¹æ£é¡¹åç§°ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String inspName; |
| | | |
| | | /** |
| | | * ç¹æ£é¡¹ç¼å· |
| | | */ |
| | | private Long inspNo; |
| | | |
| | | /** |
| | | * ç¹æ£è¯´æ |
| | | */ |
| | | private String inspDesc; |
| | | |
| | | /** |
| | | * ç¹æ£å¨æ |
| | | */ |
| | | @NotNull(message = "ç¹æ£å¨æä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long inspCycle; |
| | | |
| | | /** |
| | | * ç¹æ£å¨æåä½ï¼åå
¸ï¼ |
| | | */ |
| | | @NotBlank(message = "ç¹æ£å¨æåä½ï¼åå
¸ï¼ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String inspCycleUnit; |
| | | |
| | | /** |
| | | * ç¹æ£è§åï¼åå
¸ï¼ä¿å
»æ¶é´è®¡ç®ï¼1-æå¨æ 2-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | */ |
| | | private String inspRule; |
| | | |
| | | /** |
| | | * ç¹æ£äºº |
| | | */ |
| | | @NotNull(message = "ç¹æ£äººä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long inspUser; |
| | | |
| | | /** |
| | | * ç¹æ£é¨é¨ |
| | | */ |
| | | private Long inspDept; |
| | | |
| | | /** |
| | | * ç¶æï¼åå
¸ï¼ 0-å¯ç¨ 1-ç¦ç¨ |
| | | */ |
| | | @NotBlank(message = "ç¶æï¼åå
¸ï¼ 0-å¯ç¨ 1-ç¦ç¨ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String status; |
| | | |
| | | /** |
| | | * 馿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date inspFirstTime; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date inspLastTime; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @NotNull(message = "䏿¬¡æ§è¡æ¶é´ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date inspNextTime; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | // å¤è¡¨æ¥è¯¢å段 |
| | | private String equName; |
| | | private String assetNo; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import org.dromara.eims.domain.EimsInspectRecord; |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | | import org.dromara.common.core.validate.EditGroup; |
| | | import io.github.linpeilie.annotations.AutoMapper; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | /** |
| | | * ç¹æ£è®°å½ä¸å¡å¯¹è±¡ eims_inspect_record |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-13 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = EimsInspectRecord.class, reverseConvertGenerate = false) |
| | | public class EimsInspectRecordBo extends BaseEntity { |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @NotNull(message = "idä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设å¤di |
| | | */ |
| | | @NotNull(message = "设å¤diä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long equId; |
| | | |
| | | private String equName; |
| | | private String assetNo; |
| | | |
| | | /** |
| | | * ç¹æ£åç§° |
| | | */ |
| | | @NotBlank(message = "ç¹æ£åç§°ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String inspName; |
| | | |
| | | /** |
| | | * ç¹æ£æè¿° |
| | | */ |
| | | private String inspDesc; |
| | | |
| | | /** |
| | | * ç¹æ£ç±»å |
| | | */ |
| | | private String inspType; |
| | | |
| | | /** |
| | | * ç¹æ£äºº |
| | | */ |
| | | private Long inspUser; |
| | | |
| | | /** |
| | | * ç¹æ£é¨é¨ |
| | | */ |
| | | private Long inspDept; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | @NotBlank(message = "ç¶æä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String status; |
| | | |
| | | /** |
| | | * ç¹æ£ç¼ç |
| | | */ |
| | | @NotBlank(message = "ç¹æ£ç¼ç ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String inspCode; |
| | | |
| | | /** |
| | | * å¼è®°å½æ¹å¼ï¼åå
¸ï¼ |
| | | */ |
| | | private String recordMode; |
| | | |
| | | /** |
| | | * åèå¼ |
| | | */ |
| | | private String referenceValue; |
| | | |
| | | /** |
| | | * ä¸é |
| | | */ |
| | | private String upperLimit; |
| | | |
| | | /** |
| | | * ä¸é |
| | | */ |
| | | private String lowLimit; |
| | | |
| | | /** |
| | | * æ£æ¥å¼ |
| | | */ |
| | | private String checkValue; |
| | | |
| | | /** |
| | | * ç¹æ£ç»æï¼åå
¸ï¼ |
| | | */ |
| | | private String inspResult; |
| | | |
| | | /** |
| | | * ç¹æ£æ¶é´ |
| | | */ |
| | | private Date inspTime; |
| | | |
| | | /** |
| | | * 计åç¹æ£æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date planTime; |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | private Long verifyUser; |
| | | |
| | | /** |
| | | * 计åid |
| | | */ |
| | | private Long planId; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import org.dromara.eims.domain.EimsInspectSt; |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | | import org.dromara.common.core.validate.EditGroup; |
| | | import io.github.linpeilie.annotations.AutoMapper; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | /** |
| | | * ç¹æ£æ±æ»ä¸å¡å¯¹è±¡ eims_inspect_st |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-14 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = EimsInspectSt.class, reverseConvertGenerate = false) |
| | | public class EimsInspectStBo extends BaseEntity { |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @NotNull(message = "ä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long id; |
| | | |
| | | /** |
| | | * æ é¢ |
| | | */ |
| | | @NotBlank(message = "æ é¢ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String title; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | @NotNull(message = "设å¤idä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long equId; |
| | | private String equName; |
| | | private String assetNo; |
| | | |
| | | /** |
| | | * è®¡åæ¶é´ |
| | | */ |
| | | @NotNull(message = "è®¡åæ¶é´ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Date planTime; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | private String status; |
| | | /** |
| | | * ç¹æ£äºº |
| | | */ |
| | | private Long inspUser; |
| | | /** |
| | | * 稽æ¥äºº |
| | | */ |
| | | private Long verifyUser; |
| | | |
| | | /** |
| | | * ç¨½æ¥æ¥æ |
| | | */ |
| | | private Date verifyTime; |
| | | |
| | | /** |
| | | * ç¹è®°äºé¡¹ |
| | | */ |
| | | private String specialNote; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | private String maintCode; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ |
| | | */ |
| | | private String maintName; |
| | | |
| | | /** |
| | | * å·¥ä½æè¿° |
| | | */ |
| | | private String maintDesc; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @NotBlank(message = "ç¶æä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/EimsMaintOrderStBo.java ÐÞ¸Ä |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import org.dromara.eims.domain.EimsMaintOrderSt; |
| | | import org.dromara.eims.domain.EimsMaintSt; |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | | import org.dromara.common.core.validate.EditGroup; |
| | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | /** |
| | | * ä¿å
»å·¥åæ±æ»ä¸å¡å¯¹è±¡ eims_maint_order_st |
| | | * ä¿å
»å·¥åæ±æ»ä¸å¡å¯¹è±¡ eims_maint_st |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-12 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = EimsMaintOrderSt.class, reverseConvertGenerate = false) |
| | | public class EimsMaintOrderStBo extends BaseEntity { |
| | | @AutoMapper(target = EimsMaintSt.class, reverseConvertGenerate = false) |
| | | public class EimsMaintStBo extends BaseEntity { |
| | | |
| | | /** |
| | | * |
| | |
| | | * |
| | | */ |
| | | @NotBlank(message = "ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String equId; |
| | | |
| | | private Long equId; |
| | | private String equName; |
| | | private String assetNo; |
| | | /** |
| | | * |
| | | */ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.vo; |
| | | |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import org.dromara.common.translation.annotation.Translation; |
| | | import org.dromara.common.translation.constant.TransConstant; |
| | | import org.dromara.eims.domain.EimsInspectPlan; |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import org.dromara.common.excel.annotation.ExcelDictFormat; |
| | | import org.dromara.common.excel.convert.ExcelDictConvert; |
| | | import io.github.linpeilie.annotations.AutoMapper; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | |
| | | /** |
| | | * ç¹æ£è®¡åè§å¾å¯¹è±¡ eims_inspect_plan |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-12 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = EimsInspectPlan.class) |
| | | public class EimsInspectPlanVo extends BaseEntity implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ExcelProperty(value = "") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | |
| | | */ |
| | | @ExcelProperty(value = "设å¤id") |
| | | private Long equId; |
| | | |
| | | @Translation(type = TransConstant.EQU_ID_TO_NAME, mapper = "equId") |
| | | private String equName; |
| | | |
| | | |
| | | private String assetNo; |
| | | |
| | | /** |
| | | * ç¹æ£ç±»åï¼åå
¸ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£ç±»å", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(readConverterExp = "å=å
¸") |
| | | private String inspType; |
| | | |
| | | /** |
| | | * ç¹æ£é¡¹åç§° |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£é¡¹åç§°") |
| | | private String inspName; |
| | | |
| | | /** |
| | | * ç¹æ£é¡¹ç¼å· |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£é¡¹ç¼å·") |
| | | private Long inspNo; |
| | | |
| | | /** |
| | | * ç¹æ£è¯´æ |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£è¯´æ") |
| | | private String inspDesc; |
| | | |
| | | /** |
| | | * ç¹æ£å¨æ |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£å¨æ") |
| | | private Long inspCycle; |
| | | |
| | | /** |
| | | * ç¹æ£å¨æåä½ï¼åå
¸ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£å¨æåä½", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(readConverterExp = "å=å
¸") |
| | | private String inspCycleUnit; |
| | | |
| | | /** |
| | | * ç¹æ£è§åï¼åå
¸ï¼ä¿å
»æ¶é´è®¡ç®ï¼1-æå¨æ 2-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£è§å", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(readConverterExp = "å=å
¸") |
| | | private String inspRule; |
| | | |
| | | /** |
| | | * ç¹æ£äºº |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£äºº") |
| | | private Long inspUser; |
| | | |
| | | |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "inspUser") |
| | | private String inspUserName; |
| | | |
| | | /** |
| | | * ç¹æ£é¨é¨ |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£é¨é¨") |
| | | private Long inspDept; |
| | | @Translation(type = TransConstant.DEPT_ID_TO_NAME, mapper = "inspDept") |
| | | private String inspDeptName; |
| | | |
| | | /** |
| | | * ç¶æï¼åå
¸ï¼ 0-å¯ç¨ 1-ç¦ç¨ |
| | | */ |
| | | @ExcelProperty(value = "ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(readConverterExp = "å=å
¸") |
| | | private String status; |
| | | |
| | | /** |
| | | * 馿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "馿¬¡æ§è¡æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date inspFirstTime; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "䏿¬¡æ§è¡æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date inspLastTime; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "䏿¬¡æ§è¡æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date inspNextTime; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 循ç¯å¨æ |
| | | */ |
| | | private String inspCycleUnitName; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.vo; |
| | | |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import org.dromara.common.translation.annotation.Translation; |
| | | import org.dromara.common.translation.constant.TransConstant; |
| | | import org.dromara.eims.domain.EimsInspectRecord; |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import org.dromara.common.excel.annotation.ExcelDictFormat; |
| | | import org.dromara.common.excel.convert.ExcelDictConvert; |
| | | import io.github.linpeilie.annotations.AutoMapper; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | |
| | | /** |
| | | * ç¹æ£è®°å½è§å¾å¯¹è±¡ eims_inspect_record |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-13 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = EimsInspectRecord.class) |
| | | public class EimsInspectRecordVo extends BaseEntity implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @ExcelProperty(value = "id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设å¤di |
| | | */ |
| | | @ExcelProperty(value = "设å¤di") |
| | | private Long equId; |
| | | |
| | | |
| | | @Translation(type = TransConstant.EQU_ID_TO_NAME, mapper = "equId") |
| | | private String equName; |
| | | |
| | | private String assetNo; |
| | | |
| | | /** |
| | | * ç¹æ£åç§° |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£åç§°") |
| | | private String inspName; |
| | | |
| | | /** |
| | | * ç¹æ£äºº |
| | | */ |
| | | private Long inspUser; |
| | | |
| | | |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "inspUser") |
| | | private String inspUserName; |
| | | |
| | | /** |
| | | * ç¹æ£é¨é¨ |
| | | */ |
| | | private Long inspDept; |
| | | @Translation(type = TransConstant.DEPT_ID_TO_NAME, mapper = "inspDept") |
| | | private String inspDeptName; |
| | | |
| | | /** |
| | | * ç¹æ£æè¿° |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£æè¿°") |
| | | private String inspDesc; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | @ExcelProperty(value = "ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "eims_inspect_status") |
| | | private String status; |
| | | |
| | | /** |
| | | * ç¹æ£ç¼ç |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£ç¼ç ") |
| | | private String inspCode; |
| | | |
| | | /** |
| | | * å¼è®°å½æ¹å¼ï¼åå
¸ï¼ |
| | | */ |
| | | @ExcelProperty(value = "å¼è®°å½æ¹å¼", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(readConverterExp = "å=å
¸") |
| | | private String recordMode; |
| | | |
| | | /** |
| | | * åèå¼ |
| | | */ |
| | | @ExcelProperty(value = "åèå¼") |
| | | private String referenceValue; |
| | | |
| | | /** |
| | | * ä¸é |
| | | */ |
| | | @ExcelProperty(value = "ä¸é") |
| | | private String upperLimit; |
| | | |
| | | /** |
| | | * ä¸é |
| | | */ |
| | | @ExcelProperty(value = "ä¸é") |
| | | private String lowLimit; |
| | | |
| | | /** |
| | | * æ£æ¥å¼ |
| | | */ |
| | | @ExcelProperty(value = "æ£æ¥å¼") |
| | | private String checkValue; |
| | | |
| | | /** |
| | | * ç¹æ£ç»æï¼åå
¸ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£ç»æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "eims_inspect_result") |
| | | private String inspResult; |
| | | |
| | | /** |
| | | * ç¹æ£ç±»åï¼åå
¸ï¼ |
| | | */ |
| | | @ExcelDictFormat(dictType = "eims_inspect_type") |
| | | private String inspType; |
| | | |
| | | |
| | | /** |
| | | * ç¹æ£æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£æ¶é´") |
| | | private Date inspTime; |
| | | |
| | | /** |
| | | * 计åç¹æ£æ¥æ |
| | | */ |
| | | @ExcelProperty(value = "计åç¹æ£æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date planTime; |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | @ExcelProperty(value = "éªè¯äºº") |
| | | private Long verifyUser; |
| | | |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "verifyUser") |
| | | private String verifyUserName; |
| | | |
| | | /** |
| | | * 计åid |
| | | */ |
| | | @ExcelProperty(value = "计åid") |
| | | private Long planId; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.vo; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import org.dromara.common.translation.annotation.Translation; |
| | | import org.dromara.common.translation.constant.TransConstant; |
| | | import org.dromara.eims.domain.EimsInspectSt; |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import org.dromara.common.excel.annotation.ExcelDictFormat; |
| | | import org.dromara.common.excel.convert.ExcelDictConvert; |
| | | import io.github.linpeilie.annotations.AutoMapper; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | |
| | | |
| | | /** |
| | | * ç¹æ£æ±æ»è§å¾å¯¹è±¡ eims_inspect_st |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-14 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = EimsInspectSt.class) |
| | | public class EimsInspectStVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ExcelProperty(value = "") |
| | | private Long id; |
| | | |
| | | /** |
| | | * æ é¢ |
| | | */ |
| | | @ExcelProperty(value = "æ é¢") |
| | | private String title; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | @ExcelProperty(value = "设å¤id") |
| | | private Long equId; |
| | | private String equName; |
| | | private String assetNo; |
| | | |
| | | /** |
| | | * è®¡åæ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "è®¡åæ¶é´") |
| | | private Date planTime; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | @ExcelProperty(value = "ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "eims_inspect_status") |
| | | private String status; |
| | | |
| | | /** |
| | | * ç¹æ£äºº |
| | | */ |
| | | @ExcelProperty(value = "ç¹æ£äºº") |
| | | private Long inspUser; |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "inspUser") |
| | | private String inspUserName; |
| | | |
| | | /** |
| | | * 稽æ¥äºº |
| | | */ |
| | | @ExcelProperty(value = "稽æ¥äºº") |
| | | private Long verifyUser; |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "verifyUser") |
| | | private String verifyUserName; |
| | | |
| | | /** |
| | | * ç¨½æ¥æ¥æ |
| | | */ |
| | | @ExcelProperty(value = "ç¨½æ¥æ¥æ") |
| | | private Date verifyTime; |
| | | |
| | | /** |
| | | * ç¹è®°äºé¡¹ |
| | | */ |
| | | @ExcelProperty(value = "ç¹è®°äºé¡¹") |
| | | private String specialNote; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * è®°å½æ»æ° |
| | | */ |
| | | private Integer recordCount; |
| | | /** |
| | | * å·²ç¹æ£è®°å½ |
| | | */ |
| | | private Integer checkCount; |
| | | /** |
| | | * æªç¹æ£è®°å½ |
| | | */ |
| | | private Integer unCheckCount; |
| | | /** |
| | | * ç»æ-æ£å¸¸æ° |
| | | */ |
| | | private Integer normalNum; |
| | | /** |
| | | * ç»æ-å¼å¸¸æ° |
| | | */ |
| | | private Integer abNormalNum; |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | private Date planTime; |
| | | |
| | | /** |
| | | * å·¥ä½æè¿° |
| | | */ |
| | | private String maintDesc; |
| | | |
| | | /** |
| | | * ä¿å
»å¼å§æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»å¼å§æ¶é´") |
| | |
| | | |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import org.dromara.common.translation.annotation.Translation; |
| | | import org.dromara.common.translation.constant.TransConstant; |
| | | import org.dromara.eims.domain.EimsMaintPlan; |
| | |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = EimsMaintPlan.class) |
| | | public class EimsMaintPlanVo implements Serializable { |
| | | public class EimsMaintPlanVo extends BaseEntity implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/EimsMaintOrderStVo.java ÐÞ¸Ä |
| | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import org.dromara.common.translation.annotation.Translation; |
| | | import org.dromara.common.translation.constant.TransConstant; |
| | | import org.dromara.eims.domain.EimsMaintOrderSt; |
| | | import org.dromara.eims.domain.EimsMaintSt; |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import org.dromara.common.excel.annotation.ExcelDictFormat; |
| | | import org.dromara.common.excel.convert.ExcelDictConvert; |
| | | import io.github.linpeilie.annotations.AutoMapper; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * ä¿å
»å·¥åæ±æ»è§å¾å¯¹è±¡ eims_maint_order_st |
| | | * ä¿å
»å·¥åæ±æ»è§å¾å¯¹è±¡ eims_maint_st |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-12 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = EimsMaintOrderSt.class) |
| | | public class EimsMaintOrderStVo implements Serializable { |
| | | @AutoMapper(target = EimsMaintSt.class) |
| | | public class EimsMaintStVo extends BaseEntity implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | * |
| | | */ |
| | | @ExcelProperty(value = "") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM") |
| | | private Date planTime; |
| | | /** |
| | | *ç¨½æ¥æ¥æ |
| | |
| | | order.setStatus(DictConstants.MAINT_ORDER_STATUS_DETAIL.DAIBAOYANG); |
| | | order.setPlanTime(oldNext); |
| | | order.setPlanId(planVo.getId()); |
| | | order.setMaintName(planVo.getMaintName()); |
| | | order.setMaintCode(codeService.generateCode("BYZD")); |
| | | EimsMaintPlan plan = MapstructUtils.convert(planVo, EimsMaintPlan.class); |
| | | assert plan != null; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import org.dromara.eims.domain.EimsInspectPlan; |
| | | import org.dromara.eims.domain.vo.EimsInspectPlanVo; |
| | | |
| | | /** |
| | | * ç¹æ£è®¡åMapperæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-12 |
| | | */ |
| | | public interface EimsInspectPlanMapper extends BaseMapperPlus<EimsInspectPlan, EimsInspectPlanVo> { |
| | | Page<EimsInspectPlanVo> selectInspPlanList(@Param("page") Page<EimsInspectPlanVo> page, @Param(Constants.WRAPPER) Wrapper<EimsInspectPlan> queryWrapper); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import org.dromara.eims.domain.EimsInspectRecord; |
| | | import org.dromara.eims.domain.vo.EimsInspectRecordVo; |
| | | |
| | | /** |
| | | * ç¹æ£è®°å½Mapperæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-13 |
| | | */ |
| | | public interface EimsInspectRecordMapper extends BaseMapperPlus<EimsInspectRecord, EimsInspectRecordVo> { |
| | | Page<EimsInspectRecordVo> selectInspRecordList(@Param("page") Page<EimsInspectRecordVo> page, @Param(Constants.WRAPPER) Wrapper<EimsInspectRecord> queryWrapper); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.dromara.eims.domain.EimsInspectSt; |
| | | import org.dromara.eims.domain.EimsMaintSt; |
| | | import org.dromara.eims.domain.vo.EimsInspectStVo; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import org.dromara.eims.domain.vo.EimsMaintStVo; |
| | | |
| | | /** |
| | | * ç¹æ£æ±æ»Mapperæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-14 |
| | | */ |
| | | public interface EimsInspectStMapper extends BaseMapperPlus<EimsInspectSt, EimsInspectStVo> { |
| | | Page<EimsInspectStVo> selectInspStList(@Param("page") Page<EimsInspectStVo> page, @Param(Constants.WRAPPER) Wrapper<EimsInspectSt> queryWrapper); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.dromara.eims.domain.EimsMaintSt; |
| | | import org.dromara.eims.domain.vo.EimsMaintStVo; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | |
| | | /** |
| | | * ä¿å
»å·¥åæ±æ»Mapperæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-12 |
| | | */ |
| | | public interface EimsMaintStMapper extends BaseMapperPlus<EimsMaintSt, EimsMaintStVo> { |
| | | |
| | | Page<EimsMaintStVo> selectMaintStList(@Param("page") Page<EimsMaintStVo> page, @Param(Constants.WRAPPER) Wrapper<EimsMaintSt> queryWrapper); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.eims.domain.vo.EimsInspectPlanVo; |
| | | import org.dromara.eims.domain.bo.EimsInspectPlanBo; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¹æ£è®¡åServiceæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-12 |
| | | */ |
| | | public interface IEimsInspectPlanService { |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£è®¡å |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return ç¹æ£è®¡å |
| | | */ |
| | | EimsInspectPlanVo queryById(Long id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ç¹æ£è®¡åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ç¹æ£è®¡åå页å表 |
| | | */ |
| | | TableDataInfo<EimsInspectPlanVo> queryPageList(EimsInspectPlanBo bo, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çç¹æ£è®¡åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ç¹æ£è®¡åå表 |
| | | */ |
| | | List<EimsInspectPlanVo> queryList(EimsInspectPlanBo bo); |
| | | |
| | | /** |
| | | * æ°å¢ç¹æ£è®¡å |
| | | * |
| | | * @param bo ç¹æ£è®¡å |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | Boolean insertByBo(EimsInspectPlanBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¹æ£è®¡å |
| | | * |
| | | * @param bo ç¹æ£è®¡å |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(EimsInspectPlanBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ç¹æ£è®¡åä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ç¹æ£è®¡åå表-å¤è¡¨æ¥è¯¢ |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ç¹æ£è®¡åå页å表 |
| | | */ |
| | | TableDataInfo<EimsInspectPlanVo> queryPageListCustom(EimsInspectPlanBo bo, PageQuery pageQuery); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.eims.domain.vo.EimsInspectRecordVo; |
| | | import org.dromara.eims.domain.bo.EimsInspectRecordBo; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¹æ£è®°å½Serviceæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-13 |
| | | */ |
| | | public interface IEimsInspectRecordService { |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£è®°å½ |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return ç¹æ£è®°å½ |
| | | */ |
| | | EimsInspectRecordVo queryById(Long id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ç¹æ£è®°å½å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ç¹æ£è®°å½å页å表 |
| | | */ |
| | | TableDataInfo<EimsInspectRecordVo> queryPageList(EimsInspectRecordBo bo, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çç¹æ£è®°å½å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ç¹æ£è®°å½å表 |
| | | */ |
| | | List<EimsInspectRecordVo> queryList(EimsInspectRecordBo bo); |
| | | |
| | | /** |
| | | * æ°å¢ç¹æ£è®°å½ |
| | | * |
| | | * @param bo ç¹æ£è®°å½ |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | Boolean insertByBo(EimsInspectRecordBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¹æ£è®°å½ |
| | | * |
| | | * @param bo ç¹æ£è®°å½ |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(EimsInspectRecordBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ç¹æ£è®°å½ä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ç¹æ£è®°å½å表-å¤è¡¨æ¥è¯¢ |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ç¹æ£è®°å½å页å表 |
| | | */ |
| | | TableDataInfo<EimsInspectRecordVo> queryPageListCustom(EimsInspectRecordBo bo, PageQuery pageQuery); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.eims.domain.vo.EimsInspectStVo; |
| | | import org.dromara.eims.domain.bo.EimsInspectStBo; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¹æ£æ±æ»Serviceæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-14 |
| | | */ |
| | | public interface IEimsInspectStService { |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£æ±æ» |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return ç¹æ£æ±æ» |
| | | */ |
| | | EimsInspectStVo queryById(Long id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ç¹æ£æ±æ»å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ç¹æ£æ±æ»å页å表 |
| | | */ |
| | | TableDataInfo<EimsInspectStVo> queryPageList(EimsInspectStBo bo, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çç¹æ£æ±æ»å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ç¹æ£æ±æ»å表 |
| | | */ |
| | | List<EimsInspectStVo> queryList(EimsInspectStBo bo); |
| | | |
| | | /** |
| | | * æ°å¢ç¹æ£æ±æ» |
| | | * |
| | | * @param bo ç¹æ£æ±æ» |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | Boolean insertByBo(EimsInspectStBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¹æ£æ±æ» |
| | | * |
| | | * @param bo ç¹æ£æ±æ» |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(EimsInspectStBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ç¹æ£æ±æ»ä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | } |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/IEimsMaintOrderStService.java ÐÞ¸Ä |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.eims.domain.vo.EimsMaintOrderStVo; |
| | | import org.dromara.eims.domain.bo.EimsMaintOrderStBo; |
| | | import org.dromara.eims.domain.bo.EimsMaintStBo; |
| | | import org.dromara.eims.domain.vo.EimsMaintStVo; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | |
| | |
| | | * @author zhuguifei |
| | | * @date 2025-03-12 |
| | | */ |
| | | public interface IEimsMaintOrderStService { |
| | | public interface IEimsMaintStService { |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»å·¥åæ±æ» |
| | |
| | | * @param id ä¸»é® |
| | | * @return ä¿å
»å·¥åæ±æ» |
| | | */ |
| | | EimsMaintOrderStVo queryById(Long id); |
| | | EimsMaintStVo queryById(Long id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ä¿å
»å·¥åæ±æ»å表 |
| | |
| | | * @param pageQuery å页忰 |
| | | * @return ä¿å
»å·¥åæ±æ»å页å表 |
| | | */ |
| | | TableDataInfo<EimsMaintOrderStVo> queryPageList(EimsMaintOrderStBo bo, PageQuery pageQuery); |
| | | TableDataInfo<EimsMaintStVo> queryPageList(EimsMaintStBo bo, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çä¿å
»å·¥åæ±æ»å表 |
| | |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ä¿å
»å·¥åæ±æ»å表 |
| | | */ |
| | | List<EimsMaintOrderStVo> queryList(EimsMaintOrderStBo bo); |
| | | List<EimsMaintStVo> queryList(EimsMaintStBo bo); |
| | | |
| | | /** |
| | | * æ°å¢ä¿å
»å·¥åæ±æ» |
| | |
| | | * @param bo ä¿å
»å·¥åæ±æ» |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | Boolean insertByBo(EimsMaintOrderStBo bo); |
| | | Boolean insertByBo(EimsMaintStBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
»å·¥åæ±æ» |
| | |
| | | * @param bo ä¿å
»å·¥åæ±æ» |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(EimsMaintOrderStBo bo); |
| | | Boolean updateByBo(EimsMaintStBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ä¿å
»å·¥åæ±æ»ä¿¡æ¯ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.dromara.eims.domain.vo.EimsMaintPlanVo; |
| | | import org.dromara.system.domain.SysDept; |
| | | import org.dromara.system.domain.vo.SysDeptVo; |
| | | import org.dromara.system.mapper.SysDeptMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.bo.EimsInspectPlanBo; |
| | | import org.dromara.eims.domain.vo.EimsInspectPlanVo; |
| | | import org.dromara.eims.domain.EimsInspectPlan; |
| | | import org.dromara.eims.mapper.EimsInspectPlanMapper; |
| | | import org.dromara.eims.service.IEimsInspectPlanService; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * ç¹æ£è®¡åServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-12 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class EimsInspectPlanServiceImpl implements IEimsInspectPlanService { |
| | | |
| | | private final EimsInspectPlanMapper baseMapper; |
| | | private final SysDeptMapper sysDeptMapper; |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£è®¡å |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return ç¹æ£è®¡å |
| | | */ |
| | | @Override |
| | | public EimsInspectPlanVo queryById(Long id){ |
| | | return baseMapper.selectVoById(id); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ç¹æ£è®¡åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ç¹æ£è®¡åå页å表 |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsInspectPlanVo> queryPageList(EimsInspectPlanBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<EimsInspectPlan> lqw = buildQueryWrapper(bo); |
| | | Page<EimsInspectPlanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | @Override |
| | | public TableDataInfo<EimsInspectPlanVo> queryPageListCustom(EimsInspectPlanBo bo, PageQuery pageQuery) { |
| | | Page<EimsInspectPlanVo> page = baseMapper.selectInspPlanList(pageQuery.build(), buildWrapper(bo)); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çç¹æ£è®¡åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ç¹æ£è®¡åå表 |
| | | */ |
| | | @Override |
| | | public List<EimsInspectPlanVo> queryList(EimsInspectPlanBo bo) { |
| | | LambdaQueryWrapper<EimsInspectPlan> lqw = buildQueryWrapper(bo); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<EimsInspectPlan> buildQueryWrapper(EimsInspectPlanBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<EimsInspectPlan> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(bo.getEquId() != null, EimsInspectPlan::getEquId, bo.getEquId()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getInspType()), EimsInspectPlan::getInspType, bo.getInspType()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getInspName()), EimsInspectPlan::getInspName, bo.getInspName()); |
| | | lqw.eq(bo.getInspNo() != null, EimsInspectPlan::getInspNo, bo.getInspNo()); |
| | | lqw.eq(bo.getInspCycle() != null, EimsInspectPlan::getInspCycle, bo.getInspCycle()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getInspCycleUnit()), EimsInspectPlan::getInspCycleUnit, bo.getInspCycleUnit()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getInspRule()), EimsInspectPlan::getInspRule, bo.getInspRule()); |
| | | lqw.eq(bo.getInspUser() != null, EimsInspectPlan::getInspUser, bo.getInspUser()); |
| | | lqw.eq(bo.getInspDept() != null, EimsInspectPlan::getInspDept, bo.getInspDept()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), EimsInspectPlan::getStatus, bo.getStatus()); |
| | | return lqw; |
| | | } |
| | | private QueryWrapper<EimsInspectPlan> buildWrapper(EimsInspectPlanBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | QueryWrapper<EimsInspectPlan> qw = Wrappers.query(); |
| | | qw.eq(bo.getEquId() != null, "ip.equ_id", bo.getEquId()); |
| | | qw.like(bo.getEquName() != null, "equ.equ_name", bo.getEquName()); |
| | | qw.like(bo.getAssetNo() != null, "equ.asset_no", bo.getAssetNo()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getInspType()), "ip.insp_type", bo.getInspType()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getInspCycleUnit()), "ip.insp_cycle_unit", bo.getInspCycleUnit()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getInspRule()), "ip.insp_rule", bo.getInspRule()); |
| | | qw.eq(bo.getInspUser() != null, "ip.insp_user", bo.getInspUser()); |
| | | qw.in(bo.getInspDept() != null, "ip.insp_dept", getAllDescendantIds(bo.getInspDept())); |
| | | qw.eq(bo.getStatus() != null, "ip.status", bo.getStatus()); |
| | | qw.between(params.get("beginPlanTime") != null && params.get("endPlanTime") != null, |
| | | "a.plam_time", params.get("beginPlanTime"), params.get("endPlanTime")); |
| | | qw.orderByDesc("ip.create_time"); |
| | | |
| | | return qw; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®idï¼è·åææå代id |
| | | * |
| | | * @param rootId |
| | | * @return |
| | | */ |
| | | public List<Long> getAllDescendantIds(Long rootId) { |
| | | List<Long> result = new ArrayList<>(); |
| | | result.add(rootId); |
| | | collectDescendants(rootId, result); |
| | | return result; |
| | | } |
| | | |
| | | private void collectDescendants(Long currentId, List<Long> collector) { |
| | | QueryWrapper<SysDept> sysDeptWrapper = new QueryWrapper<>(); |
| | | sysDeptWrapper.lambda().eq(SysDept::getParentId, currentId); |
| | | |
| | | List<SysDeptVo> children = sysDeptMapper.selectVoList(sysDeptWrapper); |
| | | if (children != null && !children.isEmpty()) { |
| | | for (SysDeptVo child : children) { |
| | | Long childId = child.getDeptId(); |
| | | collector.add(childId); |
| | | collectDescendants(childId, collector); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢ç¹æ£è®¡å |
| | | * |
| | | * @param bo ç¹æ£è®¡å |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | @Override |
| | | public Boolean insertByBo(EimsInspectPlanBo bo) { |
| | | EimsInspectPlan add = MapstructUtils.convert(bo, EimsInspectPlan.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | | bo.setId(add.getId()); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¹æ£è®¡å |
| | | * |
| | | * @param bo ç¹æ£è®¡å |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @Override |
| | | public Boolean updateByBo(EimsInspectPlanBo bo) { |
| | | EimsInspectPlan update = MapstructUtils.convert(bo, EimsInspectPlan.class); |
| | | validEntityBeforeSave(update); |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(EimsInspectPlan entity){ |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ç¹æ£è®¡åä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if(isValid){ |
| | | //TODO åä¸äºä¸å¡ä¸çæ ¡éª,夿æ¯å¦éè¦æ ¡éª |
| | | } |
| | | return baseMapper.deleteByIds(ids) > 0; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import lombok.SneakyThrows; |
| | | import org.dromara.common.core.utils.DateUtils; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.dromara.eims.domain.EimsInspectPlan; |
| | | import org.dromara.eims.domain.EimsMaintPlan; |
| | | import org.dromara.eims.domain.vo.EimsMaintOrderVo; |
| | | import org.dromara.eims.mapper.EimsInspectPlanMapper; |
| | | import org.dromara.eims.mapper.EimsMaintPlanMapper; |
| | | import org.dromara.system.domain.SysDept; |
| | | import org.dromara.system.domain.vo.SysDeptVo; |
| | | import org.dromara.system.mapper.SysDeptMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.bo.EimsInspectRecordBo; |
| | | import org.dromara.eims.domain.vo.EimsInspectRecordVo; |
| | | import org.dromara.eims.domain.EimsInspectRecord; |
| | | import org.dromara.eims.mapper.EimsInspectRecordMapper; |
| | | import org.dromara.eims.service.IEimsInspectRecordService; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * ç¹æ£è®°å½Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-13 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class EimsInspectRecordServiceImpl implements IEimsInspectRecordService { |
| | | |
| | | private final EimsInspectRecordMapper baseMapper; |
| | | private final SysDeptMapper sysDeptMapper; |
| | | private final EimsInspectPlanMapper planMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£è®°å½ |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return ç¹æ£è®°å½ |
| | | */ |
| | | @Override |
| | | public EimsInspectRecordVo queryById(Long id){ |
| | | return baseMapper.selectVoById(id); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ç¹æ£è®°å½å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ç¹æ£è®°å½å页å表 |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsInspectRecordVo> queryPageList(EimsInspectRecordBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<EimsInspectRecord> lqw = buildQueryWrapper(bo); |
| | | Page<EimsInspectRecordVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | @Override |
| | | public TableDataInfo<EimsInspectRecordVo> queryPageListCustom(EimsInspectRecordBo bo, PageQuery pageQuery) { |
| | | Page<EimsInspectRecordVo> page = baseMapper.selectInspRecordList(pageQuery.build(), buildWrapper(bo)); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çç¹æ£è®°å½å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ç¹æ£è®°å½å表 |
| | | */ |
| | | @Override |
| | | public List<EimsInspectRecordVo> queryList(EimsInspectRecordBo bo) { |
| | | LambdaQueryWrapper<EimsInspectRecord> lqw = buildQueryWrapper(bo); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<EimsInspectRecord> buildQueryWrapper(EimsInspectRecordBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<EimsInspectRecord> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(bo.getEquId() != null, EimsInspectRecord::getEquId, bo.getEquId()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getInspName()), EimsInspectRecord::getInspName, bo.getInspName()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), EimsInspectRecord::getStatus, bo.getStatus()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getInspCode()), EimsInspectRecord::getInspCode, bo.getInspCode()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getInspResult()), EimsInspectRecord::getInspResult, bo.getInspResult()); |
| | | lqw.eq(bo.getInspTime() != null, EimsInspectRecord::getInspTime, bo.getInspTime()); |
| | | lqw.eq(bo.getPlanTime() != null, EimsInspectRecord::getPlanTime, bo.getPlanTime()); |
| | | lqw.eq(bo.getVerifyUser() != null, EimsInspectRecord::getVerifyUser, bo.getVerifyUser()); |
| | | return lqw; |
| | | } |
| | | |
| | | private QueryWrapper<EimsInspectRecord> buildWrapper(EimsInspectRecordBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | QueryWrapper<EimsInspectRecord> qw = Wrappers.query(); |
| | | qw.like(StringUtils.isNotBlank(bo.getInspCode()),"ir.insp_code", bo.getInspCode()); |
| | | qw.like(StringUtils.isNotBlank(bo.getInspName()),"ir.insp_name", bo.getInspName()); |
| | | qw.like(bo.getEquName() != null, "equ.equ_name", bo.getEquName()); |
| | | qw.like(bo.getAssetNo() != null, "equ.asset_no", bo.getAssetNo()); |
| | | qw.like(bo.getEquId() != null, "equ.equ_id", bo.getEquId()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getInspType()), "ir.insp_type", bo.getInspType()); |
| | | qw.eq(bo.getInspUser() != null, "ir.insp_user", bo.getInspUser()); |
| | | qw.in(bo.getInspDept() != null, "ir.insp_dept", getAllDescendantIds(bo.getInspDept())); |
| | | qw.eq(bo.getStatus() != null, "ir.status", bo.getStatus()); |
| | | qw.eq(bo.getInspResult() != null, "ir.insp_result", bo.getInspResult()); |
| | | qw.eq(bo.getPlanTime()!=null, |
| | | "ir.plan_time", bo.getPlanTime()); |
| | | qw.orderByDesc("ir.create_time"); |
| | | return qw; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®idï¼è·åææå代id |
| | | * |
| | | * @param rootId |
| | | * @return |
| | | */ |
| | | public List<Long> getAllDescendantIds(Long rootId) { |
| | | List<Long> result = new ArrayList<>(); |
| | | result.add(rootId); |
| | | collectDescendants(rootId, result); |
| | | return result; |
| | | } |
| | | |
| | | private void collectDescendants(Long currentId, List<Long> collector) { |
| | | QueryWrapper<SysDept> sysDeptWrapper = new QueryWrapper<>(); |
| | | sysDeptWrapper.lambda().eq(SysDept::getParentId, currentId); |
| | | |
| | | List<SysDeptVo> children = sysDeptMapper.selectVoList(sysDeptWrapper); |
| | | if (children != null && !children.isEmpty()) { |
| | | for (SysDeptVo child : children) { |
| | | Long childId = child.getDeptId(); |
| | | collector.add(childId); |
| | | collectDescendants(childId, collector); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢ç¹æ£è®°å½ |
| | | * |
| | | * @param bo ç¹æ£è®°å½ |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | @Override |
| | | public Boolean insertByBo(EimsInspectRecordBo bo) { |
| | | EimsInspectRecord add = MapstructUtils.convert(bo, EimsInspectRecord.class); |
| | | |
| | | //éè¿ä¿å
»è®¡åçæçæ°æ®éè¦æ´æ°ä¿å
»è®¡å |
| | | Long planId = bo.getPlanId(); |
| | | if(planId!=null){ |
| | | EimsInspectPlan plan = planMapper.selectById(planId); |
| | | setInspNextTime(plan); |
| | | planMapper.updateById(plan); |
| | | } |
| | | |
| | | |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | | bo.setId(add.getId()); |
| | | } |
| | | return flag; |
| | | } |
| | | /** |
| | | * 计ç®ç¹æ£è®¡å䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @SneakyThrows |
| | | private void setInspNextTime(EimsInspectPlan bo) { |
| | | Date oldNext = bo.getInspNextTime(); |
| | | //TODO 䏿¬¡ç¹æ£æ¶é´è®¡ç®è§å 0-æåºå®å¨æ 1-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | Date newNext = null; |
| | | |
| | | //䏿¬¡æ¬¡æ§è¡æ¶é´ä¸ºç©ºæåºå¼å¸¸ |
| | | if (oldNext == null) { |
| | | throw new Exception("䏿¬¡ç¹æ£æ¶é´ä¸è½ä¸ºç©º!"); |
| | | } |
| | | //卿 |
| | | Long maintCycle = bo.getInspCycle(); |
| | | //åä½ 1-天 2-å¨ 3-æ 4-å£ 5-å¹´ |
| | | String maintCycleUnit = bo.getInspCycleUnit(); |
| | | switch (maintCycleUnit) { |
| | | case "1": |
| | | newNext = DateUtils.addDays(oldNext, maintCycle.intValue()); |
| | | break; |
| | | case "2": |
| | | newNext = DateUtils.addWeeks(oldNext, maintCycle.intValue()); |
| | | break; |
| | | case "3": |
| | | newNext = DateUtils.addMonths(oldNext, maintCycle.intValue()); |
| | | break; |
| | | case "4": |
| | | newNext = DateUtils.addMonths(oldNext, maintCycle.intValue() * 3); |
| | | break; |
| | | case "5": |
| | | newNext = DateUtils.addYears(oldNext, maintCycle.intValue()); |
| | | break; |
| | | |
| | | } |
| | | bo.setInspNextTime(newNext); |
| | | if(bo.getInspFirstTime()==null){ |
| | | bo.setInspFirstTime(oldNext); |
| | | } |
| | | bo.setInspLastTime(oldNext); |
| | | |
| | | |
| | | } |
| | | /** |
| | | * ä¿®æ¹ç¹æ£è®°å½ |
| | | * |
| | | * @param bo ç¹æ£è®°å½ |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @Override |
| | | public Boolean updateByBo(EimsInspectRecordBo bo) { |
| | | EimsInspectRecord update = MapstructUtils.convert(bo, EimsInspectRecord.class); |
| | | validEntityBeforeSave(update); |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(EimsInspectRecord entity){ |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ç¹æ£è®°å½ä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if(isValid){ |
| | | //TODO åä¸äºä¸å¡ä¸çæ ¡éª,夿æ¯å¦éè¦æ ¡éª |
| | | } |
| | | return baseMapper.deleteByIds(ids) > 0; |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.dromara.common.core.constant.DictConstants; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.dromara.eims.domain.EimsInspectRecord; |
| | | import org.dromara.eims.domain.vo.EimsInspectRecordVo; |
| | | import org.dromara.eims.mapper.EimsInspectRecordMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.bo.EimsInspectStBo; |
| | | import org.dromara.eims.domain.vo.EimsInspectStVo; |
| | | import org.dromara.eims.domain.EimsInspectSt; |
| | | import org.dromara.eims.mapper.EimsInspectStMapper; |
| | | import org.dromara.eims.service.IEimsInspectStService; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.ZoneId; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * ç¹æ£æ±æ»Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-14 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class EimsInspectStServiceImpl implements IEimsInspectStService { |
| | | |
| | | private final EimsInspectStMapper baseMapper; |
| | | private final EimsInspectRecordMapper recordMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¹æ£æ±æ» |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return ç¹æ£æ±æ» |
| | | */ |
| | | @Override |
| | | public EimsInspectStVo queryById(Long id){ |
| | | return baseMapper.selectVoById(id); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ç¹æ£æ±æ»å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ç¹æ£æ±æ»å页å表 |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsInspectStVo> queryPageList(EimsInspectStBo bo, PageQuery pageQuery) { |
| | | QueryWrapper<EimsInspectSt> lqw = buildWrapper(bo); |
| | | Page<EimsInspectStVo> result = baseMapper.selectInspStList(pageQuery.build(), lqw); |
| | | // å¡«å
æ°æ® |
| | | fillStData(result); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | private void fillStData(Page<EimsInspectStVo> result) { |
| | | List<EimsInspectStVo> records = result.getRecords(); |
| | | for (int i = 0; i < records.size(); i++) { |
| | | EimsInspectStVo stVo = records.get(i); |
| | | |
| | | //2.ç»è®¡æ°æ® |
| | | LambdaQueryWrapper<EimsInspectRecord> recordLqw = Wrappers.lambdaQuery(); |
| | | recordLqw.eq(EimsInspectRecord::getEquId, stVo.getEquId()); |
| | | LocalDate planTime = stVo.getPlanTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | LocalDate startOfMonth = planTime.with(TemporalAdjusters.firstDayOfMonth()); |
| | | LocalDate endOfMonth = planTime.with(TemporalAdjusters.lastDayOfMonth()); |
| | | recordLqw.between(EimsInspectRecord::getPlanTime, startOfMonth, endOfMonth); |
| | | // æ§è¡æ¥è¯¢ |
| | | List<EimsInspectRecordVo> recordList = recordMapper.selectVoList(recordLqw); |
| | | // TODO æ ¹æ®åå
¸eims_inspect_status |
| | | Map<String, Long> cMap = recordList.stream() |
| | | .filter(order -> List.of("0", "1").contains(order.getStatus())) |
| | | .collect(Collectors.groupingBy(EimsInspectRecordVo::getStatus, Collectors.counting())); |
| | | // TODO æ ¹æ®åå
¸eims_inspect_result |
| | | Map<String, Long> rMap = recordList.stream() |
| | | .filter(order ->order.getInspResult()!=null && List.of("1", "2").contains(order.getInspResult())) |
| | | .collect(Collectors.groupingBy(EimsInspectRecordVo::getStatus, Collectors.counting())); |
| | | |
| | | stVo.setRecordCount(recordList.size()); |
| | | stVo.setUnCheckCount(cMap.getOrDefault("0", 0L).intValue()); |
| | | stVo.setCheckCount(cMap.getOrDefault("1", 0L).intValue()); |
| | | |
| | | stVo.setNormalNum(rMap.getOrDefault("1", 0L).intValue()); |
| | | stVo.setAbNormalNum(rMap.getOrDefault("2", 0L).intValue()); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çç¹æ£æ±æ»å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ç¹æ£æ±æ»å表 |
| | | */ |
| | | @Override |
| | | public List<EimsInspectStVo> queryList(EimsInspectStBo bo) { |
| | | LambdaQueryWrapper<EimsInspectSt> lqw = buildQueryWrapper(bo); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<EimsInspectSt> buildQueryWrapper(EimsInspectStBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<EimsInspectSt> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(bo.getEquId() != null, EimsInspectSt::getEquId, bo.getEquId()); |
| | | lqw.eq(bo.getPlanTime() != null, EimsInspectSt::getPlanTime, bo.getPlanTime()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), EimsInspectSt::getStatus, bo.getStatus()); |
| | | lqw.eq(bo.getInspUser() != null, EimsInspectSt::getInspUser, bo.getInspUser()); |
| | | lqw.eq(bo.getVerifyUser() != null, EimsInspectSt::getVerifyUser, bo.getVerifyUser()); |
| | | lqw.eq(bo.getVerifyTime() != null, EimsInspectSt::getVerifyTime, bo.getVerifyTime()); |
| | | return lqw; |
| | | } |
| | | private QueryWrapper<EimsInspectSt> buildWrapper(EimsInspectStBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | QueryWrapper<EimsInspectSt> qw = Wrappers.query(); |
| | | qw.like(StringUtils.isNotBlank(bo.getTitle()), "st.title", bo.getTitle()); |
| | | qw.like(StringUtils.isNotBlank(bo.getEquName()), "equ.equ_name", bo.getEquName()); |
| | | qw.like(StringUtils.isNotBlank(bo.getAssetNo()), "equ.asset_no", bo.getAssetNo()); |
| | | qw.between(params.get("beginPlanTime") != null && params.get("endPlanTime") != null, |
| | | "st.plan_time", params.get("beginPlanTime"), params.get("endPlanTime")); |
| | | qw.eq(bo.getInspUser() != null, "st.maint_user", bo.getInspUser()); |
| | | qw.eq(bo.getVerifyUser() != null, "st.verify_user", bo.getVerifyUser()); |
| | | qw.eq(bo.getStatus() != null, "st.status", bo.getStatus()); |
| | | qw.orderByDesc( "st.create_time"); |
| | | return qw; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç¹æ£æ±æ» |
| | | * |
| | | * @param bo ç¹æ£æ±æ» |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | @Override |
| | | public Boolean insertByBo(EimsInspectStBo bo) { |
| | | EimsInspectSt add = MapstructUtils.convert(bo, EimsInspectSt.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | | bo.setId(add.getId()); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¹æ£æ±æ» |
| | | * |
| | | * @param bo ç¹æ£æ±æ» |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @Override |
| | | public Boolean updateByBo(EimsInspectStBo bo) { |
| | | EimsInspectSt update = MapstructUtils.convert(bo, EimsInspectSt.class); |
| | | |
| | | if(bo.getVerifyUser()!=null){ |
| | | EimsInspectSt st = baseMapper.selectById(bo.getId()); |
| | | String status = st.getStatus(); |
| | | if(status==null || status.equals(DictConstants.MAINT_ORDER_ST_STATUS_DETAIL.N)){ |
| | | if(update.getVerifyTime()==null) update.setStatus(DictConstants.MAINT_ORDER_ST_STATUS_DETAIL.Y); |
| | | if(update.getVerifyTime()==null) update.setVerifyTime(new Date()); |
| | | } |
| | | } |
| | | validEntityBeforeSave(update); |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(EimsInspectSt entity){ |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ç¹æ£æ±æ»ä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if(isValid){ |
| | | //TODO åä¸äºä¸å¡ä¸çæ ¡éª,夿æ¯å¦éè¦æ ¡éª |
| | | } |
| | | return baseMapper.deleteByIds(ids) > 0; |
| | | } |
| | | } |
| | |
| | | qw.eq(bo.getStatus() != null, "mo.status", bo.getStatus()); |
| | | qw.eq(bo.getPlanTime()!=null, |
| | | "mo.plan_time", bo.getPlanTime()); |
| | | qw.between(params.get("beginPlanTime") != null && params.get("endPlanTime") != null, |
| | | "mo.plan_time", params.get("beginPlanTime"), params.get("endPlanTime")); |
| | | qw.orderByDesc("mo.create_time"); |
| | | return qw; |
| | | } |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/EimsMaintOrderStServiceImpl.java ÐÞ¸Ä |
| | |
| | | package org.dromara.eims.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import lombok.SneakyThrows; |
| | | import org.dromara.common.core.constant.DictConstants; |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.common.core.domain.model.LoginUser; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.dromara.common.satoken.utils.LoginHelper; |
| | | import org.dromara.eims.domain.EimsEqu; |
| | | import org.dromara.eims.domain.EimsMaintOrder; |
| | | import org.dromara.eims.domain.EimsMaintSt; |
| | | import org.dromara.eims.domain.bo.EimsMaintStBo; |
| | | import org.dromara.eims.domain.vo.EimsMaintOrderVo; |
| | | import org.dromara.eims.domain.vo.EimsMaintStVo; |
| | | import org.dromara.eims.mapper.EimsEquMapper; |
| | | import org.dromara.eims.mapper.EimsMaintOrderMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.bo.EimsMaintOrderStBo; |
| | | import org.dromara.eims.domain.vo.EimsMaintOrderStVo; |
| | | import org.dromara.eims.domain.EimsMaintOrderSt; |
| | | import org.dromara.eims.mapper.EimsMaintOrderStMapper; |
| | | import org.dromara.eims.service.IEimsMaintOrderStService; |
| | | import org.dromara.eims.mapper.EimsMaintStMapper; |
| | | import org.dromara.eims.service.IEimsMaintStService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDate; |
| | |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class EimsMaintOrderStServiceImpl implements IEimsMaintOrderStService { |
| | | public class EimsMaintStServiceImpl implements IEimsMaintStService { |
| | | |
| | | private final EimsMaintOrderStMapper baseMapper; |
| | | private final EimsMaintStMapper baseMapper; |
| | | private final EimsEquMapper equMapper; |
| | | private final EimsMaintOrderMapper orderMapper; |
| | | |
| | |
| | | * @return ä¿å
»å·¥åæ±æ» |
| | | */ |
| | | @Override |
| | | public EimsMaintOrderStVo queryById(Long id) { |
| | | public EimsMaintStVo queryById(Long id) { |
| | | return baseMapper.selectVoById(id); |
| | | } |
| | | |
| | |
| | | * @return ä¿å
»å·¥åæ±æ»å页å表 |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsMaintOrderStVo> queryPageList(EimsMaintOrderStBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<EimsMaintOrderSt> lqw = buildQueryWrapper(bo); |
| | | Page<EimsMaintOrderStVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | public TableDataInfo<EimsMaintStVo> queryPageList(EimsMaintStBo bo, PageQuery pageQuery) { |
| | | Page<EimsMaintStVo> result = baseMapper.selectMaintStList(pageQuery.build(), buildWrapper(bo)); |
| | | // å¡«å
æ°æ® |
| | | fillStData(result); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | private void fillStData(Page<EimsMaintOrderStVo> result) { |
| | | List<EimsMaintOrderStVo> records = result.getRecords(); |
| | | private void fillStData(Page<EimsMaintStVo> result) { |
| | | List<EimsMaintStVo> records = result.getRecords(); |
| | | for (int i = 0; i < records.size(); i++) { |
| | | EimsMaintOrderStVo stVo = records.get(i); |
| | | EimsMaintStVo stVo = records.get(i); |
| | | //1.å¡«å
è®¾å¤ |
| | | EimsEqu eimsEqu = equMapper.selectById(stVo.getEquId()); |
| | | stVo.setAssetNo(eimsEqu.getAssetNo()); |
| | |
| | | LambdaQueryWrapper<EimsMaintOrder> orderLqw = Wrappers.lambdaQuery(); |
| | | orderLqw.eq(EimsMaintOrder::getEquId, stVo.getEquId()); |
| | | LocalDate planTime = stVo.getPlanTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | ; |
| | | LocalDate startOfMonth = planTime.with(TemporalAdjusters.firstDayOfMonth()); |
| | | LocalDate endOfMonth = planTime.with(TemporalAdjusters.lastDayOfMonth()); |
| | | orderLqw.between(EimsMaintOrder::getPlanTime, startOfMonth, endOfMonth); |
| | |
| | | * @return ä¿å
»å·¥åæ±æ»å表 |
| | | */ |
| | | @Override |
| | | public List<EimsMaintOrderStVo> queryList(EimsMaintOrderStBo bo) { |
| | | LambdaQueryWrapper<EimsMaintOrderSt> lqw = buildQueryWrapper(bo); |
| | | public List<EimsMaintStVo> queryList(EimsMaintStBo bo) { |
| | | LambdaQueryWrapper<EimsMaintSt> lqw = buildQueryWrapper(bo); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<EimsMaintOrderSt> buildQueryWrapper(EimsMaintOrderStBo bo) { |
| | | private LambdaQueryWrapper<EimsMaintSt> buildQueryWrapper(EimsMaintStBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<EimsMaintOrderSt> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getTitle()), EimsMaintOrderSt::getTitle, bo.getTitle()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getEquId()), EimsMaintOrderSt::getEquId, bo.getEquId()); |
| | | lqw.eq(bo.getPlanTime() != null, EimsMaintOrderSt::getPlanTime, bo.getPlanTime()); |
| | | lqw.eq(bo.getMaintUser() != null, EimsMaintOrderSt::getMaintUser, bo.getMaintUser()); |
| | | lqw.eq(bo.getVerifyUser() != null, EimsMaintOrderSt::getVerifyUser, bo.getVerifyUser()); |
| | | LambdaQueryWrapper<EimsMaintSt> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getTitle()), EimsMaintSt::getTitle, bo.getTitle()); |
| | | lqw.eq(bo.getPlanTime() != null, EimsMaintSt::getPlanTime, bo.getPlanTime()); |
| | | lqw.eq(bo.getMaintUser() != null, EimsMaintSt::getMaintUser, bo.getMaintUser()); |
| | | lqw.eq(bo.getVerifyUser() != null, EimsMaintSt::getVerifyUser, bo.getVerifyUser()); |
| | | return lqw; |
| | | } |
| | | |
| | | |
| | | private QueryWrapper<EimsMaintSt> buildWrapper(EimsMaintStBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | QueryWrapper<EimsMaintSt> qw = Wrappers.query(); |
| | | qw.like(StringUtils.isNotBlank(bo.getTitle()), "st.title", bo.getTitle()); |
| | | qw.like(StringUtils.isNotBlank(bo.getEquName()), "equ.equ_name", bo.getEquName()); |
| | | qw.like(StringUtils.isNotBlank(bo.getAssetNo()), "equ.asset_no", bo.getAssetNo()); |
| | | qw.between(params.get("beginPlanTime") != null && params.get("endPlanTime") != null, |
| | | "st.plan_time", params.get("beginPlanTime"), params.get("endPlanTime")); |
| | | qw.eq(bo.getMaintUser() != null, "st.maint_user", bo.getMaintUser()); |
| | | qw.eq(bo.getVerifyUser() != null, "st.verify_user", bo.getVerifyUser()); |
| | | qw.eq(bo.getStatus() != null, "st.status", bo.getStatus()); |
| | | qw.orderByDesc( "st.create_time"); |
| | | return qw; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | @Override |
| | | public Boolean insertByBo(EimsMaintOrderStBo bo) { |
| | | EimsMaintOrderSt add = MapstructUtils.convert(bo, EimsMaintOrderSt.class); |
| | | public Boolean insertByBo(EimsMaintStBo bo) { |
| | | EimsMaintSt add = MapstructUtils.convert(bo, EimsMaintSt.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @Override |
| | | public Boolean updateByBo(EimsMaintOrderStBo bo) { |
| | | EimsMaintOrderSt update = MapstructUtils.convert(bo, EimsMaintOrderSt.class); |
| | | public Boolean updateByBo(EimsMaintStBo bo) { |
| | | EimsMaintSt update = MapstructUtils.convert(bo, EimsMaintSt.class); |
| | | |
| | | if(bo.getVerifyUser()!=null){ |
| | | EimsMaintOrderSt eimsMaintOrderSt = baseMapper.selectById(bo.getId()); |
| | | String status = eimsMaintOrderSt.getStatus(); |
| | | EimsMaintSt eimsMaintSt = baseMapper.selectById(bo.getId()); |
| | | String status = eimsMaintSt.getStatus(); |
| | | if(status==null || status.equals(DictConstants.MAINT_ORDER_ST_STATUS_DETAIL.N)){ |
| | | if(update.getVerifyTime()==null) update.setStatus(DictConstants.MAINT_ORDER_ST_STATUS_DETAIL.Y); |
| | | if(update.getVerifyTime()==null) update.setVerifyTime(new Date()); |
| | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(EimsMaintOrderSt entity) { |
| | | private void validEntityBeforeSave(EimsMaintSt entity) { |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | } |
| | | |
| | |
| | | } |
| | | AtomicBoolean flag = new AtomicBoolean(false); |
| | | ids.stream().anyMatch(id -> { |
| | | EimsMaintOrderStVo stVo = baseMapper.selectVoById(id); |
| | | EimsMaintStVo stVo = baseMapper.selectVoById(id); |
| | | LocalDate planTime = stVo.getPlanTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | LocalDate startOfMonth = planTime.with(TemporalAdjusters.firstDayOfMonth()); |
| | | LocalDate endOfMonth = planTime.with(TemporalAdjusters.lastDayOfMonth()); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.dromara.eims.mapper.EimsInspectPlanMapper"> |
| | | <resultMap type="org.dromara.eims.domain.vo.EimsInspectPlanVo" id="EimsInspectPlanResult"> |
| | | </resultMap> |
| | | <select id="selectInspPlanList" resultMap="EimsInspectPlanResult"> |
| | | SELECT ip.*,equ.equ_name equName,equ.equ_code equCode,equ.asset_no assetNo,equ.model_no modelNo, |
| | | us.nick_name inspUserName,dp.dept_name inspDeptName, |
| | | CONCAT_WS('', ip.insp_cycle, dd.dict_label) inspCycleUnitName |
| | | FROM eims_inspect_plan ip |
| | | LEFT JOIN eims_equ equ ON ip.equ_id = equ.equ_id |
| | | LEFT JOIN sys_user us ON ip.insp_user = us.user_id |
| | | LEFT JOIN sys_dept dp ON ip.insp_dept = dp.dept_id |
| | | LEFT JOIN sys_dict_data dd on dd.dict_type = 'maint_cycle_unit' and dd.dict_value = ip.insp_cycle_unit |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.dromara.eims.mapper.EimsInspectRecordMapper"> |
| | | |
| | | <resultMap type="org.dromara.eims.domain.vo.EimsInspectRecordVo" id="EimsInspRecordVoResult"> |
| | | </resultMap> |
| | | <select id="selectInspRecordList" resultMap="EimsInspRecordVoResult"> |
| | | SELECT ir.*,equ.equ_name equName,equ.equ_code equCode,equ.asset_no assetNo,equ.model_no modelNo,ir.create_time createTime, |
| | | us.nick_name inspUserName,dp.dept_name inspDeptName,ue.nick_name verifyUserName |
| | | FROM eims_inspect_record ir |
| | | LEFT JOIN eims_equ equ ON ir.equ_id = equ.equ_id |
| | | LEFT JOIN sys_user us ON ir.insp_user = us.user_id |
| | | LEFT JOIN sys_user ue ON ir.verify_user = ue.user_id |
| | | LEFT JOIN sys_dept dp ON ir.insp_dept = dp.dept_id |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.dromara.eims.mapper.EimsInspectStMapper"> |
| | | <resultMap type="org.dromara.eims.domain.vo.EimsInspectStVo" id="MaintInspStVoResult"> |
| | | </resultMap> |
| | | <select id="selectInspStList" resultMap="MaintInspStVoResult"> |
| | | SELECT st.*,equ.equ_name equName,equ.asset_no assetNo FROM eims_inspect_st st |
| | | LEFT JOIN eims_equ equ on st.equ_id = equ.equ_id |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.dromara.eims.mapper.EimsMaintStMapper"> |
| | | <resultMap type="org.dromara.eims.domain.vo.EimsMaintStVo" id="MaintMaintStVoResult"> |
| | | </resultMap> |
| | | <select id="selectMaintStList" resultMap="MaintMaintStVoResult"> |
| | | SELECT st.*,equ.equ_name equName,equ.asset_no assetNo FROM eims_maint_st st |
| | | LEFT JOIN eims_equ equ on st.equ_id = equ.equ_id |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | </mapper> |