¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { MaintOrderVO } from './model'; |
| | | |
| | | import type { ID, IDS } from '#/api/common'; |
| | | |
| | | import { commonExport } from '#/api/helper'; |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | enum Api { |
| | | maintOrderExport = '/eims/maintOrder/export', |
| | | maintOrderList = '/eims/maintOrder/list', |
| | | root = '/eims/maintOrder' |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»å·¥åå表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export function listMaintOrder(params?: any) { |
| | | return requestClient.get<MaintOrderVO[]>(Api.maintOrderList, { params }); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»å·¥åè¯¦ç» |
| | | * @param maintOrderId |
| | | */ |
| | | export function getMaintOrder(maintOrderId: ID) { |
| | | return requestClient.get<MaintOrderVO>(`${Api.root}/${maintOrderId}`); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿å
Ȍᴌ |
| | | * @param data |
| | | */ |
| | | export function addMaintOrder(data: any) { |
| | | return requestClient.postWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
Ȍᴌ |
| | | * @param data |
| | | */ |
| | | export function updateMaintOrder(data: any) { |
| | | return requestClient.putWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¿å
Ȍᴌ |
| | | * @param maintOrderId |
| | | */ |
| | | export function delMaintOrder(maintOrderId: IDS) { |
| | | return requestClient.deleteWithMsg<void>(`${Api.root}/${maintOrderId}`); |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | * @param |
| | | */ |
| | | export function maintOrderExport(data: any) { |
| | | return commonExport(Api.maintOrderExport, data); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface MaintOrderVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: number | string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | equId: number | string; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»ç±»åï¼åå
¸ï¼ |
| | | */ |
| | | maintType: string; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»å¨æ |
| | | */ |
| | | maintCycle: number; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»å¨æåä½ï¼åå
¸ï¼ |
| | | */ |
| | | maintCycleUnit: string; |
| | | |
| | | /** |
| | | * 计å表åä½- ä¿å
»è§åï¼åå
¸ï¼ä¿å
»æ¶é´è®¡ç®ï¼1-æå¨æ 2-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | */ |
| | | maintRule: string; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»äºº |
| | | */ |
| | | maintUser: number; |
| | | maintUserName: string; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»é¨é¨ |
| | | */ |
| | | maintDept: number; |
| | | |
| | | /** |
| | | * ä¿å
»åå· |
| | | */ |
| | | maintCode: string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | status: string; |
| | | |
| | | verifyUser: number; |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | verifyUserName: string; |
| | | |
| | | /** |
| | | * ä¿å
»è®¡åæ¶é´ |
| | | */ |
| | | planTime: string; |
| | | |
| | | /** |
| | | * ä¿å
»å¼å§æ¶é´ |
| | | */ |
| | | startTime: string; |
| | | |
| | | /** |
| | | * ä¿å
»ç»ææ¶é´ |
| | | */ |
| | | endTime: string; |
| | | |
| | | /** |
| | | * 计åid |
| | | */ |
| | | planId: number | string; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | createTime: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { MaintOrditmVO } from './model'; |
| | | |
| | | import type { ID, IDS, PageResult } from '#/api/common'; |
| | | |
| | | import { commonExport } from '#/api/helper'; |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | enum Api { |
| | | maintOrditmExport = '/eims/maintOrditm/export', |
| | | maintOrditmList = '/eims/maintOrditm/list', |
| | | root = '/eims/maintOrditm' |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥åæ¡ç®å表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export function listMaintOrditm(params?: any) { |
| | | return requestClient.get<PageResult<MaintOrditmVO>>(Api.maintOrditmList, { params }); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥åæ¡ç®è¯¦ç» |
| | | * @param maintOrditmId |
| | | */ |
| | | export function getMaintOrditm(maintOrditmId: ID) { |
| | | return requestClient.get<MaintOrditmVO>(`${Api.root}/${maintOrditmId}`); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å·¥åæ¡ç® |
| | | * @param data |
| | | */ |
| | | export function addMaintOrditm(data: any) { |
| | | return requestClient.postWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å·¥åæ¡ç® |
| | | * @param data |
| | | */ |
| | | export function updateMaintOrditm(data: any) { |
| | | return requestClient.putWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å·¥åæ¡ç® |
| | | * @param maintOrditmId |
| | | */ |
| | | export function delMaintOrditm(maintOrditmId: IDS) { |
| | | return requestClient.deleteWithMsg<void>(`${Api.root}/${maintOrditmId}`); |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | * @param |
| | | */ |
| | | export function maintOrditmExport(data: any) { |
| | | return commonExport(Api.maintOrditmExport, data); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface MaintOrditmVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: number | string; |
| | | |
| | | /** |
| | | * å·¥åid |
| | | */ |
| | | orderId: number | string; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | equId: number | string; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®åç§° |
| | | */ |
| | | itmName: string; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®æä½æ å |
| | | */ |
| | | itmAction: string; |
| | | |
| | | /** |
| | | * ä¿å
»æä½ç¨æ· |
| | | */ |
| | | itmUser: number; |
| | | |
| | | /** |
| | | * ä¿å
»æ¶é´ |
| | | */ |
| | | itmTime: string; |
| | | |
| | | /** |
| | | * å®æç¶æï¼åå
¸ï¼ |
| | | */ |
| | | status: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { MaintPlanVO } from './model'; |
| | | |
| | | import type { ID, IDS } from '#/api/common'; |
| | | |
| | | import { commonExport } from '#/api/helper'; |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | enum Api { |
| | | maintPlanExport = '/eims/maintPlan/export', |
| | | maintPlanList = '/eims/maintPlan/list', |
| | | root = '/eims/maintPlan' |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»è®¡åå表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export function listMaintPlan(params?: any) { |
| | | return requestClient.get<MaintPlanVO[]>(Api.maintPlanList, { params }); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»è®¡åè¯¦ç» |
| | | * @param maintPlanId |
| | | */ |
| | | export function getMaintPlan(maintPlanId: ID) { |
| | | return requestClient.get<MaintPlanVO>(`${Api.root}/${maintPlanId}`); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿å
»è®¡å |
| | | * @param data |
| | | */ |
| | | export function addMaintPlan(data: any) { |
| | | return requestClient.postWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
»è®¡å |
| | | * @param data |
| | | */ |
| | | export function updateMaintPlan(data: any) { |
| | | return requestClient.putWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¿å
»è®¡å |
| | | * @param maintPlanId |
| | | */ |
| | | export function delMaintPlan(maintPlanId: IDS) { |
| | | return requestClient.deleteWithMsg<void>(`${Api.root}/${maintPlanId}`); |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | * @param |
| | | */ |
| | | export function maintPlanExport(data: any) { |
| | | return commonExport(Api.maintPlanExport, data); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface MaintPlanVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: number | string; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | |
| | | */ |
| | | equId: number | string; |
| | | |
| | | /** |
| | | * ä¿å
»ç±»åï¼åå
¸ï¼ |
| | | */ |
| | | maintType: string; |
| | | |
| | | /** |
| | | * ä¿å
»å¨æ |
| | | */ |
| | | maintCycle: number; |
| | | |
| | | /** |
| | | * ä¿å
»å¨æåä½ï¼åå
¸ï¼ |
| | | */ |
| | | maintCycleUnit: string; |
| | | |
| | | /** |
| | | * ä¿å
»è§åï¼åå
¸ï¼ä¿å
»æ¶é´è®¡ç®ï¼1-æå¨æ 2-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | */ |
| | | maintRule: string; |
| | | |
| | | /** |
| | | * ä¿å
»äºº |
| | | */ |
| | | maintUser: number; |
| | | |
| | | /** |
| | | * ä¿å
»é¨é¨ |
| | | */ |
| | | maintDept: number; |
| | | |
| | | /** |
| | | * ç¶æï¼åå
¸ï¼ 0-å¯ç¨ 1-ç¦ç¨ |
| | | */ |
| | | status: string; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | maintFirstTime: string; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | maintLastTime: string; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | maintNextTime: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { MaintStandVO } from './model'; |
| | | |
| | | import type { ID, IDS, PageResult } from '#/api/common'; |
| | | |
| | | import { commonExport } from '#/api/helper'; |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | enum Api { |
| | | maintStandExport = '/eims/maintStand/export', |
| | | maintStandList = '/eims/maintStand/list', |
| | | root = '/eims/maintStand' |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»æ åå表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export function listMaintStand(params?: any) { |
| | | return requestClient.get<PageResult<MaintStandVO>>(Api.maintStandList, { params }); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»æ åè¯¦ç» |
| | | * @param maintStandId |
| | | */ |
| | | export function getMaintStand(maintStandId: ID) { |
| | | return requestClient.get<MaintStandVO>(`${Api.root}/${maintStandId}`); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿å
»æ å |
| | | * @param data |
| | | */ |
| | | export function addMaintStand(data: any) { |
| | | return requestClient.postWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
»æ å |
| | | * @param data |
| | | */ |
| | | export function updateMaintStand(data: any) { |
| | | return requestClient.putWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¿å
»æ å |
| | | * @param maintStandId |
| | | */ |
| | | export function delMaintStand(maintStandId: IDS) { |
| | | return requestClient.deleteWithMsg<void>(`${Api.root}/${maintStandId}`); |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | * @param |
| | | */ |
| | | export function maintStandExport(data: any) { |
| | | return commonExport(Api.maintStandExport, data); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface MaintStandVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: string | number; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | equId: string | number; |
| | | |
| | | /** |
| | | * 设å¤ç¼ç |
| | | */ |
| | | equCode: string; |
| | | |
| | | /** |
| | | * 设å¤ç±»å |
| | | */ |
| | | equTypeId: string | number; |
| | | |
| | | /** |
| | | * èµäº§ç¼å· |
| | | */ |
| | | assetNo: string; |
| | | |
| | | /** |
| | | * 设å¤åç§° |
| | | |
| | | */ |
| | | equName: string; |
| | | |
| | | /** |
| | | * 设å¤åå· |
| | | */ |
| | | modelNo: string; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®åç§° |
| | | */ |
| | | name: string; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®æ å |
| | | */ |
| | | stand: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | |
| | | } |
| | |
| | | WEIXIU = '2', // ç»´ä¿®ä¸ |
| | | YIJIEDAN = '1' // å·²æ¥å |
| | | } |
| | | |
| | | /** |
| | | * ä¿å
»å·¥åç¶æ |
| | | */ |
| | | export enum MAINT_ORDER_STATUS { |
| | | BAOYANG = '1', // ä¿å
»ç» |
| | | DAIBAOYANG = '0', // å¾
ä¿å
» |
| | | DAIYANZHENG = '2', // å¾
éªè¯ |
| | | WANCHENG = '3' // 宿 |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import { ref, watch } from 'vue'; |
| | | |
| | | import { Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | |
| | | interface Props { |
| | | reqKey: string; |
| | | reqValue: any; |
| | | title?: string; |
| | | listApi: (params: any) => Promise<any>; // 卿API彿° |
| | | columns?: VxeGridProps['columns']; |
| | | } |
| | | const props = defineProps<Props>(); |
| | | const columns = props?.columns?.filter((i) => i.field !== 'action'); |
| | | |
| | | const gridOptions: VxeGridProps = { |
| | | checkboxConfig: { |
| | | // é«äº® |
| | | highlight: true, |
| | | // 翻页æ¶ä¿çéä¸ç¶æ |
| | | reserve: true |
| | | // ç¹å»è¡éä¸ |
| | | // trigger: 'row' |
| | | }, |
| | | columns, |
| | | height: 'auto', |
| | | keepSource: true, |
| | | pagerConfig: {}, |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | const keyName = props.reqKey; |
| | | const keyValue = props.reqValue; |
| | | if (keyName && keyValue) { |
| | | const params = { [keyName]: props.reqValue }; |
| | | Object.assign(formValues, params); |
| | | } else { |
| | | // æªä¼ ååæ¥è¯¢ä¸ä¸ªä¸åå¨çå¼ |
| | | const params = { [keyName]: -1 }; |
| | | Object.assign(formValues, params); |
| | | } |
| | | return await props.listApi({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | rowConfig: { |
| | | isHover: true, |
| | | keyField: 'id' |
| | | }, |
| | | sortConfig: { |
| | | // è¿ç¨æåº |
| | | remote: true, |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true |
| | | }, |
| | | id: `basis-sub-table${props.reqValue}` |
| | | }; |
| | | |
| | | const [BasicTable, tableApi] = useVbenVxeGrid({ |
| | | gridOptions, |
| | | gridEvents: { |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams) |
| | | } |
| | | }); |
| | | |
| | | // ä½¿ç¨ watch çå¬ id çåå |
| | | watch( |
| | | () => props.reqValue, |
| | | (newVal, oldVal) => { |
| | | if (newVal !== oldVal && newVal) { |
| | | tableApi.query(); |
| | | } |
| | | }, |
| | | { immediate: false } |
| | | ); |
| | | /** |
| | | * TODO åç»æ©å±ç¹å»äºä»¶ |
| | | */ |
| | | const slotName = ref<string>('equName'); |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="w-full"> |
| | | <BasicTable :table-title="title"> |
| | | <template #[slotName]="{ row }"> |
| | | <Space> |
| | | <span>{{ row[slotName] }}</span> |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue'; |
| | | |
| | | import { useVbenModal } from '@vben/common-ui'; |
| | | |
| | | import { message } from 'ant-design-vue'; |
| | | |
| | | import MaintOrderView from '#/views/eims/maint-order/index.vue'; |
| | | |
| | | const emit = defineEmits<{ updateSelect: [any] }>(); |
| | | |
| | | const [BasicModal, modalApi] = useVbenModal({ |
| | | fullscreenButton: false, |
| | | draggable: true, |
| | | onCancel: handleCancel, |
| | | onConfirm: handleConfirm |
| | | }); |
| | | const innerView = ref(); |
| | | |
| | | async function handleConfirm() { |
| | | try { |
| | | modalApi.modalLoading(true); |
| | | const tableSelect = innerView.value.tableSelect(); |
| | | if (tableSelect.length > 1) { |
| | | message.error('æå¤åªè½éæ©ä¸æ¡æ°æ®ï¼'); |
| | | modalApi.modalLoading(false); |
| | | return false; |
| | | } |
| | | emit('updateSelect', tableSelect[0]); |
| | | await handleCancel(); |
| | | } catch (error) { |
| | | console.error(error); |
| | | } finally { |
| | | modalApi.modalLoading(false); |
| | | } |
| | | } |
| | | |
| | | async function handleCancel() { |
| | | modalApi.close(); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicModal :fullscreen-button="true" class="w-[800px]"> |
| | | <MaintOrderView ref="innerView" /> |
| | | </BasicModal> |
| | | </template> |
| | | |
| | | <style scoped></style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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: 'maintCode', |
| | | label: 'ä¿å
Ȍᴌ' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.EIMS_MAINT_TYPE) |
| | | }, |
| | | fieldName: 'maintType', |
| | | label: 'ä¿å
»ç±»å' |
| | | }, |
| | | { |
| | | component: 'TreeSelect', |
| | | // å¨draweréæ´æ° è¿éä¸éè¦é»è®¤çcomponentProps |
| | | defaultValue: undefined, |
| | | fieldName: 'maintDept', |
| | | label: 'ä¿å
»é¨é¨' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | showSearch: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'maintUser', |
| | | label: 'ä¿å
»äºº' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.MAINT_TIME_RULE) |
| | | }, |
| | | fieldName: 'maintRule', |
| | | label: '计ç®è§å' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.MAINT_ORDER_STATUS) |
| | | }, |
| | | fieldName: 'status', |
| | | label: 'ç¶æ' |
| | | } |
| | | ]; |
| | | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | | { type: 'checkbox', width: 60, fixed: 'left' }, |
| | | { |
| | | title: 'ä¿å
Ȍᴌ', |
| | | field: 'maintCode', |
| | | minWidth: 200, |
| | | fixed: 'left' |
| | | }, |
| | | |
| | | { |
| | | title: 'ç¶æ', |
| | | field: 'status', |
| | | minWidth: 80, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return renderDict(row.status, DictEnum.MAINT_ORDER_STATUS); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | field: 'equName', |
| | | minWidth: 200, |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: 'èµäº§ç¼å·', |
| | | field: 'assetNo', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: 'ä¿å
»ç±»å', |
| | | field: 'maintType', |
| | | minWidth: 120, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return renderDict(row.maintType, DictEnum.EIMS_MAINT_TYPE); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: 'ä¿å
»äºº', |
| | | field: 'maintUserName', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: '计åä¿å
»æ¶é´', |
| | | field: 'planTime', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: 'ä¿å
»å¼å§æ¶é´', |
| | | field: 'startTime', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: 'ä¿å
»ç»ææ¶é´', |
| | | field: 'endTime', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | 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', |
| | | fieldName: 'equId', |
| | | label: '设å¤id', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'maintCode', |
| | | label: 'ä¿å
»åå·' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equName', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | options: getDictOptions(DictEnum.EIMS_MAINT_TYPE), |
| | | optionType: 'button' |
| | | }, |
| | | fieldName: 'maintType', |
| | | defaultValue: '1', |
| | | label: 'ä¿å
»ç±»å' |
| | | }, |
| | | /* |
| | | { |
| | | component: 'InputNumber', |
| | | fieldName: 'maintCycle', |
| | | label: 'ä¿å
»å¨æ', |
| | | formItemClass: 'col-span-1', |
| | | componentProps: { |
| | | min: 1 |
| | | } |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | getPopupContainer, |
| | | options: getDictOptions(DictEnum.MAINT_CYCLE_UNIT) |
| | | }, |
| | | fieldName: 'maintCycleUnit', |
| | | formItemClass: 'col-span-1 w-[80px]', |
| | | labelWidth: 0, |
| | | label: '' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | getPopupContainer, |
| | | options: getDictOptions(DictEnum.MAINT_TIME_RULE) |
| | | }, |
| | | fieldName: 'maintRule', |
| | | label: 'ä¿å
»è§å ' |
| | | },*/ |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'maintUser', |
| | | label: 'ä¿å
»äººid', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'maintUserName', |
| | | label: 'ä¿å
»äºº' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'maintDept', |
| | | label: 'é¨é¨id', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | options: getDictOptions(DictEnum.MAINT_ORDER_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: 'startTime', |
| | | label: 'å¼å§æ¶é´' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | showTime: true, |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'endTime', |
| | | label: 'ç»ææ¶é´' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'verifyUser', |
| | | label: 'éªè¯äººid', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'verifyUserName', |
| | | label: 'éªè¯äºº' |
| | | }, |
| | | { |
| | | component: 'Textarea', |
| | | fieldName: 'remark', |
| | | label: '夿³¨' |
| | | } |
| | | ]; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import type { Recordable } from '@vben/types'; |
| | | |
| | | import { computed, onMounted, ref } from 'vue'; |
| | | |
| | | import { useAccess } from '@vben/access'; |
| | | import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { useUserStore } from '@vben/stores'; |
| | | import { addFullName, getPopupContainer, getVxePopupContainer } from '@vben/utils'; |
| | | |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { delMaintOrder, listMaintOrder, maintOrderExport } from '#/api/eims/maint-order'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import { MAINT_ORDER_STATUS } from '#/constants/dict'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import maintOrderDrawer from './maint-order-drawer.vue'; |
| | | import SubOrditm from './sub-orditm.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' |
| | | }; |
| | | |
| | | const gridOptions: VxeGridProps = { |
| | | checkboxConfig: { |
| | | // é«äº® |
| | | highlight: true, |
| | | // 翻页æ¶ä¿çéä¸ç¶æ |
| | | reserve: true |
| | | // ç¹å»è¡éä¸ |
| | | // trigger: 'row' |
| | | }, |
| | | columns, |
| | | height: 'auto', |
| | | keepSource: true, |
| | | pagerConfig: {}, |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | return await listMaintOrder({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | rowConfig: { |
| | | isHover: true, |
| | | keyField: 'id' |
| | | }, |
| | | sortConfig: { |
| | | // è¿ç¨æåº |
| | | remote: true, |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true |
| | | }, |
| | | id: 'maint-order-index' |
| | | }; |
| | | const orderId = ref<string>(); |
| | | const [BasicTable, tableApi] = useVbenVxeGrid({ |
| | | formOptions, |
| | | gridOptions, |
| | | gridEvents: { |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams), |
| | | cellClick: (e: any) => { |
| | | const { row } = e; |
| | | orderId.value = row.id; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | const [MaintOrderDrawer, maintOrderDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: maintOrderDrawer |
| | | }); |
| | | |
| | | function handleAdd() { |
| | | maintOrderDrawerApi.setData({}); |
| | | maintOrderDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | maintOrderDrawerApi.setData({ id: record.id }); |
| | | maintOrderDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleDelete(row: Recordable<any>) { |
| | | await delMaintOrder(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 delMaintOrder(ids); |
| | | await tableApi.query(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleDownloadExcel() { |
| | | commonDownloadExcel(maintOrderExport, 'ä¿å
»å·¥åè®°å½', tableApi.formApi.form.values, { |
| | | fieldMappingTime: formOptions.fieldMappingTime |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * åå§åé¨é¨éæ© |
| | | */ |
| | | 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.maintUser = undefined; |
| | | }, |
| | | placeholder: 'è¯·éæ©', |
| | | showSearch: true, |
| | | treeData: deptTree, |
| | | treeDefaultExpandAll: true, |
| | | treeLine: { showLeafIcon: false }, |
| | | // çéçåæ®µ |
| | | treeNodeFilterProp: 'label', |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ |
| | | treeNodeLabelProp: 'fullName' |
| | | }), |
| | | fieldName: 'maintDept' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ·çå è½½ |
| | | */ |
| | | 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: 'maintUser' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | |
| | | |
| | | onMounted(async () => { |
| | | await setupDeptSelect(); |
| | | }); |
| | | |
| | | async function handleEditStatus(record: Recordable<any>, status: string) { |
| | | maintOrderDrawerApi.setData({ id: record.id, status }); |
| | | maintOrderDrawerApi.open(); |
| | | } |
| | | |
| | | const userStore = useUserStore(); |
| | | const userId = userStore.userInfo?.userId; |
| | | const deptId = userStore.userInfo?.deptId; |
| | | const { hasAccessByRoles } = useAccess(); |
| | | const isSuperAdmin = computed(() => hasAccessByRoles(['superadmin'])); |
| | | const isLeader = computed(() => hasAccessByRoles(['leader'])); |
| | | |
| | | /** |
| | | * å¾
ä¿å
»ç¶æ-ä¿å
»äººæä½ |
| | | * @param row |
| | | */ |
| | | function daibaoyang(row: any) { |
| | | return (isSuperAdmin.value || isLeader.value || row.maintUser === userId) && row.status === MAINT_ORDER_STATUS.DAIBAOYANG; |
| | | } |
| | | |
| | | /** |
| | | * ä¿å
»ç¶æ-ä¿å
»äººæä½ |
| | | * @param row |
| | | */ |
| | | function baoyang(row: any) { |
| | | return (isSuperAdmin.value || isLeader.value || row.maintUser === userId) && row.status === MAINT_ORDER_STATUS.BAOYANG; |
| | | } |
| | | |
| | | /** |
| | | * å¾
éªè¯ç¶æ-éªè¯äººæä½ |
| | | * @param row |
| | | */ |
| | | function yanzheng(row: any) { |
| | | return (isSuperAdmin.value || isLeader.value || row.verifyUser === userId) && row.status === MAINT_ORDER_STATUS.DAIYANZHENG; |
| | | } |
| | | |
| | | // é䏿°æ® |
| | | function tableSelect() { |
| | | return tableApi.grid.getCheckboxRecords(); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px] flex-col"> |
| | | <BasicTable class="h-2/3" table-title="ä¿å
»å·¥åå表"> |
| | | <template #toolbar-tools> |
| | | <Space> |
| | | <a-button v-access:code="['eims:maintOrder:export']" @click="handleDownloadExcel"> |
| | | {{ $t('pages.common.export') }} |
| | | </a-button> |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | | type="primary" |
| | | v-access:code="['eims:maintOrder:remove']" |
| | | @click="handleMultiDelete" |
| | | > |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | <a-button type="primary" v-access:code="['eims:maintOrder: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 |
| | | v-if="daibaoyang(row)" |
| | | class="btn-success" |
| | | v-access:code="['eims:maintOrder:edit']" |
| | | @click.stop="handleEditStatus(row, MAINT_ORDER_STATUS.BAOYANG)" |
| | | > |
| | | ä¿å
» |
| | | </ghost-button> |
| | | <ghost-button |
| | | v-if="baoyang(row)" |
| | | class="btn-success" |
| | | v-access:code="['eims:maintOrder:edit']" |
| | | @click.stop="handleEditStatus(row, MAINT_ORDER_STATUS.DAIYANZHENG)" |
| | | > |
| | | 宿 |
| | | </ghost-button> |
| | | <ghost-button |
| | | v-if="yanzheng(row)" |
| | | class="btn-success" |
| | | v-access:code="['eims:maintOrder:edit']" |
| | | @click.stop="handleEditStatus(row, MAINT_ORDER_STATUS.WANCHENG)" |
| | | > |
| | | éªè¯ |
| | | </ghost-button> |
| | | <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)"> |
| | | <ghost-button danger v-access:code="['eims:maintOrder:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | | </Popconfirm> |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | | <!--<BasisSubTable :columns="maintStandCol" :list-api="listMaintStand" :req-value="equId" class="h-1/3" req-key="equId" title="ä¿å
»å®æ½é¡¹ç®" />--> |
| | | <SubOrditm :order-id="orderId" class="h-1/3" /> |
| | | </div> |
| | | <MaintOrderDrawer @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 { addMaintOrder, getMaintOrder, updateMaintOrder } from '#/api/eims/maint-order'; |
| | | 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 }; |
| | | const { status } = drawerApi.getData() as { status?: string }; |
| | | // ä»ä¿å
»è®¡å页é¢çæä¿å
Ȍᴌ |
| | | const { planOrder } = drawerApi.getData(); |
| | | isUpdate.value = !!id; |
| | | // æ°å¢-ä»ä¿å
»è®¡å页é¢çæä¿å
Ȍᴌ |
| | | if (!isUpdate.value && !id) { |
| | | await formApi.setValues(planOrder); |
| | | } |
| | | // éç½® |
| | | baoyangCol(false); |
| | | |
| | | // æ´æ° && èµå¼ |
| | | if (isUpdate.value && id) { |
| | | const record = await getMaintOrder(id); |
| | | /** |
| | | * æ´æ°ç¶æ |
| | | */ |
| | | if (status) { |
| | | record.status = status; |
| | | baoyangCol(true); |
| | | // TODO ç²¾ç»åæ§å¶è¾å
¥ |
| | | /* switch (status) { |
| | | case MAINT_ORDER_STATUS.BAOYANG: { |
| | | |
| | | break; |
| | | } |
| | | case MAINT_ORDER_STATUS.DAIYANZHENG: { |
| | | break; |
| | | } |
| | | }*/ |
| | | } |
| | | 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 ? updateMaintOrder(data) : addMaintOrder(data)); |
| | | emit('reload'); |
| | | await handleCancel(); |
| | | } catch (error) { |
| | | console.error(error); |
| | | } finally { |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | } |
| | | |
| | | function baoyangCol(disable: boolean) { |
| | | const show = disable; |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: { |
| | | disabled: show |
| | | }, |
| | | fieldName: 'maintType' |
| | | }, |
| | | { |
| | | componentProps: { |
| | | disabled: show |
| | | }, |
| | | fieldName: 'planTime' |
| | | }, |
| | | { |
| | | componentProps: { |
| | | disabled: show |
| | | }, |
| | | fieldName: 'status' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | 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({ 'maintUserName': user.nickName, 'maintUser': user.userId, 'maintDept': 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 #maintUserName="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 #maintCode="slotProps"> |
| | | <CodeInput v-bind="slotProps" :disabled="isUpdate" prefix="BYSD" /> |
| | | </template> |
| | | </BasicForm> |
| | | <EquModal class="w-[1200px]" @update-equ="updateEqu" /> |
| | | <UserModal class="w-[1200px]" @select-user="updateUser" /> |
| | | </BasicDrawer> |
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import type { Recordable } from '@vben/types'; |
| | | |
| | | import { nextTick, ref, watch } from 'vue'; |
| | | |
| | | import { useVbenDrawer } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { getVxePopupContainer } from '@vben/utils'; |
| | | |
| | | import { Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { listMaintOrditm } from '#/api/eims/maint-orditm'; |
| | | import { columns } from '#/views/eims/maint-orditm/data'; |
| | | import maintOrditmDrawer from '#/views/eims/maint-orditm/maint-orditm-drawer.vue'; |
| | | |
| | | interface Props { |
| | | orderId?: string; |
| | | } |
| | | |
| | | const props = defineProps<Props>(); |
| | | |
| | | const completed = ref<string>('已宿'); |
| | | // æªçç¹ |
| | | const uncompleted = ref<string>('æªå®æ'); |
| | | |
| | | const gridOptions: VxeGridProps = { |
| | | checkboxConfig: { |
| | | // é«äº® |
| | | highlight: true, |
| | | // 翻页æ¶ä¿çéä¸ç¶æ |
| | | reserve: true |
| | | // ç¹å»è¡éä¸ |
| | | // trigger: 'row' |
| | | }, |
| | | columns, |
| | | height: 'auto', |
| | | keepSource: true, |
| | | pagerConfig: {}, |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | if (props.orderId) { |
| | | const params = { orderId: props.orderId }; |
| | | Object.assign(formValues, params); |
| | | } else { |
| | | const params = { orderId: -1 }; |
| | | Object.assign(formValues, params); |
| | | } |
| | | return await listMaintOrditm({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | | }); |
| | | }, |
| | | querySuccess: () => { |
| | | nextTick(() => { |
| | | // eslint-disable-next-line no-use-before-define |
| | | const data = tableApi?.grid.getData(); |
| | | completed.value = '已宿'; |
| | | uncompleted.value = 'æªå®æ'; |
| | | if (data.length <= 0) return false; |
| | | const wc = data?.filter((i) => i.status === '1')?.length; |
| | | completed.value = `已宿(${wc})`; |
| | | uncompleted.value = `æªå®æ(${data.length - wc})`; |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | rowConfig: { |
| | | isHover: true, |
| | | keyField: 'id' |
| | | }, |
| | | sortConfig: { |
| | | // è¿ç¨æåº |
| | | remote: true, |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true |
| | | }, |
| | | id: 'sub-orditm-index' |
| | | }; |
| | | |
| | | const [BasicTable, tableApi] = useVbenVxeGrid({ |
| | | gridOptions, |
| | | gridEvents: { |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams) |
| | | } |
| | | }); |
| | | |
| | | const [MaintOrditmDrawer, maintOrditmDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: maintOrditmDrawer |
| | | }); |
| | | |
| | | function handleAdd() { |
| | | maintOrditmDrawerApi.setData({}); |
| | | maintOrditmDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | maintOrditmDrawerApi.setData({ id: record.id }); |
| | | maintOrditmDrawerApi.open(); |
| | | } |
| | | |
| | | // ä½¿ç¨ watch çå¬ resId çåå |
| | | watch( |
| | | () => props.orderId, |
| | | (newVal, oldVal) => { |
| | | if (newVal !== oldVal && newVal) { |
| | | tableApi.query(); |
| | | } |
| | | }, |
| | | { immediate: false } |
| | | ); |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="w-full"> |
| | | <BasicTable table-title="宿½é¡¹ç®"> |
| | | <template #toolbar-tools> |
| | | <Space> |
| | | <a-button>{{ uncompleted }}</a-button> |
| | | <a-button type="primary"> {{ completed }}</a-button> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #equName="{ row }"> |
| | | <Space> |
| | | <span>{{ row.equName }}</span> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button v-access:code="['eims:maintOrditm: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:maintOrditm:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | | </Popconfirm> |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | | <MaintOrditmDrawer @reload="tableApi.query()" /> |
| | | </div> |
| | | </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: 'èµäº§ç¼å·' |
| | | } |
| | | ]; |
| | | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | | { type: 'checkbox', width: 60, fixed: 'left' }, |
| | | { |
| | | title: 'ç¶æ', |
| | | field: 'status', |
| | | minWidth: 80, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return renderDict(row.status, DictEnum.EIMS_ORDITM_STATUS); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: '宿æ¶é´', |
| | | field: 'itmTime', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | field: 'equName', |
| | | minWidth: 160, |
| | | slots: { default: 'equName' } |
| | | }, |
| | | { |
| | | title: 'ä¿å
»é¡¹ç®', |
| | | field: 'itmName', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | title: 'é¡¹ç®æ å', |
| | | field: 'itmAction', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | title: 'ä¿å
»ç¨æ·', |
| | | field: 'itmUserName', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | field: 'action', |
| | | fixed: 'right', |
| | | slots: { default: 'action' }, |
| | | title: 'æä½', |
| | | width: 200 |
| | | } |
| | | ]; |
| | | |
| | | export const drawerSchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'orderId', |
| | | label: 'å·¥åid', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'orderName', |
| | | label: 'ä¿å
Ȍᴌ' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'id' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equId', |
| | | label: '设å¤id', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equName', |
| | | label: '设å¤åç§°', |
| | | componentProps: { |
| | | readonly: true |
| | | }, |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | showSearch: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'itmName', |
| | | label: 'ä¿å
»é¡¹ç®', |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'itmAction', |
| | | label: 'é¡¹ç®æ å', |
| | | componentProps: { |
| | | readonly: true |
| | | }, |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'itmUser', |
| | | label: 'ä¿å
»äººid', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'itmUserName', |
| | | label: 'ä¿å
»äºº' |
| | | }, |
| | | { |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | options: getDictOptions(DictEnum.EIMS_ORDITM_STATUS), |
| | | optionType: 'button' |
| | | }, |
| | | fieldName: 'status', |
| | | defaultValue: '0', |
| | | label: 'ç¶æ' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | showTime: true, |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'itmTime', |
| | | label: '宿æ¶é´' |
| | | }, |
| | | { |
| | | component: 'Textarea', |
| | | fieldName: 'remark', |
| | | label: '夿³¨' |
| | | } |
| | | ]; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import type { Recordable } from '@vben/types'; |
| | | |
| | | import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { getVxePopupContainer } from '@vben/utils'; |
| | | |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { delMaintOrditm, listMaintOrditm, maintOrditmExport } from '#/api/eims/maint-orditm'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import maintOrditmDrawer from './maint-orditm-drawer.vue'; |
| | | |
| | | const formOptions: VbenFormProps = { |
| | | commonConfig: { |
| | | labelWidth: 80, |
| | | componentProps: { |
| | | allowClear: true |
| | | } |
| | | }, |
| | | schema: querySchema(), |
| | | wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4' |
| | | }; |
| | | |
| | | const gridOptions: VxeGridProps = { |
| | | checkboxConfig: { |
| | | // é«äº® |
| | | highlight: true, |
| | | // 翻页æ¶ä¿çéä¸ç¶æ |
| | | reserve: true |
| | | // ç¹å»è¡éä¸ |
| | | // trigger: 'row' |
| | | }, |
| | | columns, |
| | | height: 'auto', |
| | | keepSource: true, |
| | | pagerConfig: {}, |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | return await listMaintOrditm({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | rowConfig: { |
| | | isHover: true, |
| | | keyField: 'id' |
| | | }, |
| | | sortConfig: { |
| | | // è¿ç¨æåº |
| | | remote: true, |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true |
| | | }, |
| | | id: 'maint-orditm-index' |
| | | }; |
| | | |
| | | const [BasicTable, tableApi] = useVbenVxeGrid({ |
| | | formOptions, |
| | | gridOptions, |
| | | gridEvents: { |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams) |
| | | } |
| | | }); |
| | | |
| | | const [MaintOrditmDrawer, maintOrditmDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: maintOrditmDrawer |
| | | }); |
| | | |
| | | function handleAdd() { |
| | | maintOrditmDrawerApi.setData({}); |
| | | maintOrditmDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | maintOrditmDrawerApi.setData({ id: record.id }); |
| | | maintOrditmDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleDelete(row: Recordable<any>) { |
| | | await delMaintOrditm(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 delMaintOrditm(ids); |
| | | await tableApi.query(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleDownloadExcel() { |
| | | commonDownloadExcel(maintOrditmExport, 'ä¿å
»å·¥åæç»è®°å½', tableApi.formApi.form.values, { |
| | | fieldMappingTime: formOptions.fieldMappingTime |
| | | }); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px]"> |
| | | <BasicTable class="flex-1 overflow-hidden" table-title="ä¿å
»å·¥åæç»å表"> |
| | | <template #toolbar-tools> |
| | | <Space> |
| | | <a-button v-access:code="['eims:maintOrditm:export']" @click="handleDownloadExcel"> |
| | | {{ $t('pages.common.export') }} |
| | | </a-button> |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | | type="primary" |
| | | v-access:code="['eims:maintOrditm:remove']" |
| | | @click="handleMultiDelete" |
| | | > |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | <a-button type="primary" v-access:code="['eims:maintOrditm: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 v-access:code="['eims:maintOrditm: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:maintOrditm:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | | </Popconfirm> |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |
| | | <MaintOrditmDrawer @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 { cloneDeep } from '@vben/utils'; |
| | | |
| | | import { InputSearch } from 'ant-design-vue'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { addMaintOrditm, getMaintOrditm, updateMaintOrditm } from '#/api/eims/maint-orditm'; |
| | | import { listMaintStand } from '#/api/eims/maint-stand'; |
| | | import orderModal from '#/views/eims/components/miant-order-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 |
| | | }, |
| | | 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; |
| | | // æ´æ° && èµå¼ |
| | | if (isUpdate.value && id) { |
| | | const record = await getMaintOrditm(id); |
| | | await formApi.setValues(record); |
| | | } |
| | | |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | }); |
| | | |
| | | /** |
| | | * å·¥åæç»çå è½½ |
| | | */ |
| | | async function setupOrditmOptions(equId: any) { |
| | | const params = { equId }; |
| | | const userPageResult = await listMaintStand({ |
| | | pageNum: 1, |
| | | pageSize: 50, |
| | | ...params |
| | | }); |
| | | const options = userPageResult?.rows.map((item) => ({ |
| | | label: item.name, |
| | | value: item.name |
| | | })); |
| | | // çé |
| | | const filterOption = (input: string, option: any) => { |
| | | return option.label.toLowerCase().includes(input.toLowerCase()); |
| | | }; |
| | | |
| | | const placeholder = options.length > 0 ? 'è¯·éæ©' : 'è¯¥å·¥åææ æç»'; |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: { |
| | | options, |
| | | placeholder, |
| | | filterOption, |
| | | async onSelect(name: string) { |
| | | const item = userPageResult?.rows.find((i) => i.name === name); |
| | | await formApi.setValues({ itmAction: item?.stand }); |
| | | } |
| | | }, |
| | | fieldName: 'itmName' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | async function handleConfirm() { |
| | | try { |
| | | drawerApi.drawerLoading(true); |
| | | const { valid } = await formApi.validate(); |
| | | if (!valid) { |
| | | return; |
| | | } |
| | | const data = cloneDeep(await formApi.getValues()); |
| | | await (isUpdate.value ? updateMaintOrditm(data) : addMaintOrditm(data)); |
| | | emit('reload'); |
| | | await handleCancel(); |
| | | } catch (error) { |
| | | console.error(error); |
| | | } finally { |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | } |
| | | |
| | | async function handleCancel() { |
| | | drawerApi.close(); |
| | | await formApi.resetForm(); |
| | | } |
| | | |
| | | // order modal |
| | | const [OrderModal, orderModalApi] = useVbenModal({ |
| | | connectedComponent: orderModal, |
| | | draggable: true, |
| | | title: '鿩工å' |
| | | }); |
| | | |
| | | function handleOrderModal() { |
| | | orderModalApi.setData({}); |
| | | orderModalApi.open(); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°éæ©çå·¥å |
| | | * @param order |
| | | */ |
| | | async function updateOrderSelect(order: any) { |
| | | await formApi.setValues({ 'orderId': order.id, 'orderName': order.maintCode, 'equId': order.equId, 'equName': order.equName }); |
| | | await setupOrditmOptions(order?.equId); |
| | | } |
| | | |
| | | // user modal |
| | | const [UserModal, userModalApi] = useVbenModal({ |
| | | connectedComponent: userModal, |
| | | draggable: true, |
| | | title: 'éæ©æå' |
| | | }); |
| | | |
| | | /** |
| | | * æå¼éæ©ç¨æ· |
| | | */ |
| | | function handleUserModal() { |
| | | userModalApi.setData({}); |
| | | userModalApi.open(); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°éæ©çç¨æ· |
| | | * @param user |
| | | */ |
| | | async function updateUserSelect(user: any) { |
| | | await formApi.setValues({ 'itmUser': user.userId, 'itmUserName': user.nickName }); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicDrawer :close-on-click-modal="false" :title="title" class="w-[600px]"> |
| | | <BasicForm> |
| | | <template #orderName="slotProps"> |
| | | <InputSearch :enter-button="true" placeholder="è¯·éæ©" @search="handleOrderModal" v-bind="slotProps" /> |
| | | </template> |
| | | <template #itmUserName="slotProps"> |
| | | <InputSearch :enter-button="true" placeholder="è¯·éæ©" @search="handleUserModal" v-bind="slotProps" /> |
| | | </template> |
| | | </BasicForm> |
| | | <OrderModal class="w-[1200px]" @update-select="updateOrderSelect" /> |
| | | <UserModal class="w-[1200px]" @select-user="updateUserSelect" /> |
| | | </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: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.EIMS_MAINT_TYPE) |
| | | }, |
| | | fieldName: 'maintType', |
| | | label: 'ä¿å
»ç±»å' |
| | | }, |
| | | { |
| | | component: 'TreeSelect', |
| | | // å¨draweréæ´æ° è¿éä¸éè¦é»è®¤çcomponentProps |
| | | defaultValue: undefined, |
| | | fieldName: 'maintDept', |
| | | label: 'ä¿å
»é¨é¨', |
| | | |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | showSearch: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'maintUser', |
| | | label: 'ä¿å
»äºº', |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.MAINT_TIME_RULE) |
| | | }, |
| | | fieldName: 'maintRule', |
| | | 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: 'maintType', |
| | | minWidth: 120, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return renderDict(row.maintType, DictEnum.EIMS_MAINT_TYPE); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: 'ä¿å
»äºº', |
| | | field: 'maintUserName', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: '循ç¯å¨æ', |
| | | field: 'maintCycleUnitName', |
| | | minWidth: 80 |
| | | }, |
| | | { |
| | | title: 'æ¶é´è®¡ç®è§å', |
| | | field: 'maintRule', |
| | | minWidth: 140, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | return renderDict(row.maintRule, DictEnum.MAINT_TIME_RULE); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: '馿¬¡æ§è¡æ¶é´', |
| | | field: 'maintFirstTime', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: '䏿¬¡æ§è¡æ¶é´', |
| | | field: 'maintLastTime', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: '䏿¬¡æ§è¡æ¶é´', |
| | | field: 'maintNextTime', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | 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: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | options: getDictOptions(DictEnum.EIMS_MAINT_TYPE), |
| | | optionType: 'button' |
| | | }, |
| | | fieldName: 'maintType', |
| | | defaultValue: '1', |
| | | label: 'ä¿å
»ç±»å' |
| | | }, |
| | | { |
| | | component: 'InputNumber', |
| | | fieldName: 'maintCycle', |
| | | label: 'ä¿å
»å¨æ', |
| | | formItemClass: 'col-span-1', |
| | | componentProps: { |
| | | min: 1 |
| | | } |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | getPopupContainer, |
| | | options: getDictOptions(DictEnum.MAINT_CYCLE_UNIT) |
| | | }, |
| | | fieldName: 'maintCycleUnit', |
| | | formItemClass: 'col-span-1 w-[80px]', |
| | | labelWidth: 0, |
| | | label: '' |
| | | }, |
| | | |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | getPopupContainer, |
| | | options: getDictOptions(DictEnum.MAINT_TIME_RULE) |
| | | }, |
| | | fieldName: 'maintRule', |
| | | label: 'ä¿å
»è§å ' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'maintUser', |
| | | label: 'ç¨æ·id', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'maintUserName', |
| | | label: 'ä¿å
»äºº' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'maintDept', |
| | | 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: 'maintFirstTime', |
| | | label: '馿¬¡æ§è¡æ¶é´' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD', |
| | | showTime: false, |
| | | valueFormat: 'YYYY-MM-DD', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'maintLastTime', |
| | | label: '䏿¬¡æ§è¡æ¶é´' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD', |
| | | showTime: false, |
| | | valueFormat: 'YYYY-MM-DD', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'maintNextTime', |
| | | 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 { delMaintPlan, listMaintPlan, maintPlanExport } from '#/api/eims/maint-plan'; |
| | | import { listMaintStand } from '#/api/eims/maint-stand'; |
| | | import { generateCode } from '#/api/eims/utils'; |
| | | 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 as maintSrandCol } from '#/views/eims/maint-stand/data'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import maintPlanDrawer from './maint-plan-drawer.vue'; |
| | | |
| | | 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' |
| | | }; |
| | | |
| | | const gridOptions: VxeGridProps = { |
| | | checkboxConfig: { |
| | | // é«äº® |
| | | highlight: true, |
| | | // 翻页æ¶ä¿çéä¸ç¶æ |
| | | reserve: true |
| | | // ç¹å»è¡éä¸ |
| | | // trigger: 'row' |
| | | }, |
| | | columns, |
| | | height: 'auto', |
| | | keepSource: true, |
| | | pagerConfig: {}, |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | return await listMaintPlan({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | rowConfig: { |
| | | isHover: true, |
| | | keyField: 'id' |
| | | }, |
| | | sortConfig: { |
| | | // è¿ç¨æåº |
| | | remote: true, |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true |
| | | }, |
| | | id: 'maint-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 [MaintPlanDrawer, maintPlanDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: maintPlanDrawer |
| | | }); |
| | | |
| | | const [MaintOrderDrawer, maintOrderDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: maintOrderDrawer, |
| | | }); |
| | | |
| | | function handleAdd() { |
| | | maintPlanDrawerApi.setData({}); |
| | | maintPlanDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | maintPlanDrawerApi.setData({ id: record.id }); |
| | | maintPlanDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleDelete(row: Recordable<any>) { |
| | | await delMaintPlan(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 delMaintPlan(ids); |
| | | await tableApi.query(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleDownloadExcel() { |
| | | commonDownloadExcel(maintPlanExport, 'ä¿å
»è®¡åè®°å½', tableApi.formApi.form.values, { |
| | | fieldMappingTime: formOptions.fieldMappingTime |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * çæä¿å
Ȍᴌ |
| | | * @param record |
| | | */ |
| | | async function handleAddOrder(record: Recordable<any>) { |
| | | /** |
| | | * çæä¿å
Ȍᴌcode |
| | | */ |
| | | const code = await generateCode('BYYJ'); |
| | | if (!code) { |
| | | Modal.error({ |
| | | content: 'çæä¿å
»å·¥å失败ï¼è¯·éè¯ï¼', |
| | | title: 'æç¤º' |
| | | }); |
| | | return false; |
| | | } |
| | | const planOrder = { |
| | | equId: record.equId, |
| | | equName: record.equName, |
| | | maintUser: record.maintUser, |
| | | maintUserName: record.maintUserName, |
| | | maintDept: record.maintDept, |
| | | maintDeptName: record.maintDeptName, |
| | | maintType: record.maintType, |
| | | planTime: record.maintNextTime, |
| | | status: MAINT_ORDER_STATUS.DAIBAOYANG, |
| | | maintCode: code |
| | | }; |
| | | |
| | | maintOrderDrawerApi.setData({ planOrder }); |
| | | maintOrderDrawerApi.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.maintUser = undefined; |
| | | }, |
| | | placeholder: 'è¯·éæ©', |
| | | showSearch: true, |
| | | treeData: deptTree, |
| | | treeDefaultExpandAll: true, |
| | | treeLine: { showLeafIcon: false }, |
| | | // çéçåæ®µ |
| | | treeNodeFilterProp: 'label', |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ |
| | | treeNodeLabelProp: 'fullName' |
| | | }), |
| | | fieldName: 'maintDept' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ·çå è½½ |
| | | */ |
| | | 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: 'maintUser' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | await setupDeptSelect(); |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px] flex-col"> |
| | | <BasicTable class="h-2/3" table-title="ä¿å
»è®¡åå表"> |
| | | <template #toolbar-tools> |
| | | <Space> |
| | | <a-button v-access:code="['eims:maintPlan:export']" @click="handleDownloadExcel"> |
| | | {{ $t('pages.common.export') }} |
| | | </a-button> |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | | type="primary" |
| | | v-access:code="['eims:maintPlan:remove']" |
| | | @click="handleMultiDelete" |
| | | > |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | <a-button type="primary" v-access:code="['eims:maintPlan: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:maintPlan:edit']" @click.stop="handleAddOrder(row)"> çæå·¥å </ghost-button> |
| | | <ghost-button v-access:code="['eims:maintPlan: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:maintPlan:remove']"> |
| | | {{ $t('pages.common.more') }} |
| | | </a-button> |
| | | </Dropdown> |
| | | </template> |
| | | </BasicTable> |
| | | <BasisSubTable :columns="maintSrandCol" :list-api="listMaintStand" :req-value="equId" class="h-1/3" req-key="equId" title="ä¿å
»å®æ½é¡¹ç®" /> |
| | | </div> |
| | | <MaintPlanDrawer @reload="tableApi.query()" /> |
| | | <MaintOrderDrawer @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 { addMaintPlan, getMaintPlan, updateMaintPlan } from '#/api/eims/maint-plan'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | 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', |
| | | fieldMappingTime: [['field4', ['phoneType', 'phoneNumber'], null]], |
| | | 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: 'maintLastTime' |
| | | }, |
| | | { |
| | | dependencies: { |
| | | show: () => isUpdate.value, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'maintNextTime' |
| | | } |
| | | ]); |
| | | // æ´æ° && èµå¼ |
| | | if (isUpdate.value && id) { |
| | | const record = await getMaintPlan(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 ? updateMaintPlan(data) : addMaintPlan(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(equ); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°éæ©çç¨æ· |
| | | * @param user |
| | | */ |
| | | async function updateUser(user: any) { |
| | | await formApi.setValues({ 'maintUserName': user.nickName, 'maintUser': user.userId, 'maintDept': 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 #maintUserName="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 { type FormSchemaGetter } from '#/adapter/form'; |
| | | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equName', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'assetNo', |
| | | label: 'èµäº§ç¼å·' |
| | | } |
| | | ]; |
| | | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | | { type: 'checkbox', width: 60, fixed: 'left' }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | field: 'equName', |
| | | minWidth: 200, |
| | | fixed: 'left', |
| | | slots: { default: 'equName' } |
| | | }, |
| | | { |
| | | title: 'èµäº§ç¼å·', |
| | | field: 'assetNo', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: 'ä¿å
»é¡¹ç®', |
| | | field: 'name', |
| | | minWidth: 300 |
| | | }, |
| | | { |
| | | title: 'é¡¹ç®æ å', |
| | | field: 'stand', |
| | | 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: 'equCode', |
| | | label: '设å¤ç¼ç ', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'assetNo', |
| | | label: 'èµäº§ç¼å·', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'modelNo', |
| | | label: '设å¤åå·', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | } |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equName', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | | component: 'Textarea', |
| | | fieldName: 'name', |
| | | label: '宿½é¡¹ç®' |
| | | }, |
| | | { |
| | | component: 'Textarea', |
| | | fieldName: 'stand', |
| | | label: '宿½æ å' |
| | | } |
| | | ]; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import type { Recordable } from '@vben/types'; |
| | | |
| | | import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { getVxePopupContainer } from '@vben/utils'; |
| | | |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { delMaintStand, listMaintStand, maintStandExport } from '#/api/eims/maint-stand'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import maintStandDrawer from './maint-stand-drawer.vue'; |
| | | |
| | | const formOptions: VbenFormProps = { |
| | | commonConfig: { |
| | | labelWidth: 80, |
| | | componentProps: { |
| | | allowClear: true |
| | | } |
| | | }, |
| | | schema: querySchema(), |
| | | wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4' |
| | | }; |
| | | |
| | | const gridOptions: VxeGridProps = { |
| | | checkboxConfig: { |
| | | // é«äº® |
| | | highlight: true, |
| | | // 翻页æ¶ä¿çéä¸ç¶æ |
| | | reserve: true |
| | | // ç¹å»è¡éä¸ |
| | | // trigger: 'row' |
| | | }, |
| | | columns, |
| | | height: 'auto', |
| | | keepSource: true, |
| | | pagerConfig: {}, |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | return await listMaintStand({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | rowConfig: { |
| | | isHover: true, |
| | | keyField: 'id' |
| | | }, |
| | | sortConfig: { |
| | | // è¿ç¨æåº |
| | | remote: true, |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true |
| | | }, |
| | | id: 'maint-stand-index' |
| | | }; |
| | | |
| | | const [BasicTable, tableApi] = useVbenVxeGrid({ |
| | | formOptions, |
| | | gridOptions, |
| | | gridEvents: { |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams) |
| | | } |
| | | }); |
| | | |
| | | const [MaintStandDrawer, maintStandDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: maintStandDrawer |
| | | }); |
| | | |
| | | function handleAdd() { |
| | | maintStandDrawerApi.setData({}); |
| | | maintStandDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | maintStandDrawerApi.setData({ id: record.id }); |
| | | maintStandDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleDelete(row: Recordable<any>) { |
| | | await delMaintStand(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 delMaintStand(ids); |
| | | await tableApi.query(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleDownloadExcel() { |
| | | commonDownloadExcel(maintStandExport, 'ä¿å
»æ åè®°å½', tableApi.formApi.form.values, { |
| | | fieldMappingTime: formOptions.fieldMappingTime |
| | | }); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px]"> |
| | | <BasicTable class="flex-1 overflow-hidden" table-title="ä¿å
»æ åå表"> |
| | | <template #toolbar-tools> |
| | | <Space> |
| | | <a-button v-access:code="['eims:maintStand:export']" @click="handleDownloadExcel"> |
| | | {{ $t('pages.common.export') }} |
| | | </a-button> |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | | type="primary" |
| | | v-access:code="['eims:maintStand:remove']" |
| | | @click="handleMultiDelete" |
| | | > |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | <a-button type="primary" v-access:code="['eims:maintStand: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 v-access:code="['eims:maintStand: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:maintStand:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | | </Popconfirm> |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |
| | | <MaintStandDrawer @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 { cloneDeep } from '@vben/utils'; |
| | | |
| | | import { InputSearch } from 'ant-design-vue'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { addMaintStand, getMaintStand, updateMaintStand } from '#/api/eims/maint-stand'; |
| | | |
| | | import equModal from '#/views/eims/components/equ-modal.vue'; |
| | | |
| | | import { drawerSchema } from './data'; |
| | | import type { MaintStandVO } from '#/api/eims/maint-stand/model'; |
| | | |
| | | 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 |
| | | }, |
| | | 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; |
| | | // æ´æ° && èµå¼ |
| | | if (isUpdate.value && id) { |
| | | const record = await getMaintStand(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 ? updateMaintStand(data) : addMaintStand(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(); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°éæ©çè®¾å¤ |
| | | * @param equ |
| | | */ |
| | | async function updateSelect(equ: any) { |
| | | await formApi.setValues(equ); |
| | | } |
| | | </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> |
| | | </BasicForm> |
| | | <EquModal class="w-[1200px]" @update-equ="updateSelect" /> |
| | | </BasicDrawer> |
| | | </template> |
| | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | | { type: 'checkbox', width: 60, fixed: 'left' }, |
| | | { |
| | | title: '设å¤(å·¥å
·)åç§°', |
| | | sortable: true, |
| | | minWidth: 150, |
| | | fixed: 'left', |
| | | slots: { |
| | | default: ({ row }) => { |
| | | if (row.reqType === REPAIR_REQ_TYPE.EQU) { |
| | | return row.equName; |
| | | } else if (row.reqType === REPAIR_REQ_TYPE.FIXTURE) { |
| | | return row.fixtureName; |
| | | } else { |
| | | return ''; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: 'æ¥ä¿®åå·', |
| | | field: 'code', |
| | | minWidth: 160, |
| | |
| | | field: 'reqTime', |
| | | sortable: true, |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | title: '设å¤(å·¥å
·)åç§°', |
| | | sortable: true, |
| | | minWidth: 150, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | if (row.reqType === REPAIR_REQ_TYPE.EQU) { |
| | | return row.equName; |
| | | } else if (row.reqType === REPAIR_REQ_TYPE.FIXTURE) { |
| | | return row.fixtureName; |
| | | } else { |
| | | return ''; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: 'æ
éç±»å«', |
| | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | | { type: 'checkbox', width: 60, fixed: 'left' }, |
| | | { |
| | | title: '设å¤(å·¥å
·)åç§°', |
| | | sortable: true, |
| | | minWidth: 150, |
| | | fixed: 'left', |
| | | slots: { |
| | | default: ({ row }) => { |
| | | if (!row.reqType) { |
| | | return ''; |
| | | } |
| | | |
| | | // æ ¹æ®ä¸åç请æ±ç±»åè¿åç¸åºçåç§° |
| | | switch (row.reqType) { |
| | | case REPAIR_REQ_TYPE.EQU: { |
| | | return row.equName; |
| | | } |
| | | case REPAIR_REQ_TYPE.FIXTURE: { |
| | | return row.fixtureName; |
| | | } |
| | | default: { |
| | | // å¦æè¯·æ±ç±»åæ¢ä¸æ¯ EQU ä¹ä¸æ¯ FIXTUREï¼åè¿å空å符串 |
| | | return ''; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: 'ç»´ä¿®åå·', |
| | | field: 'resCode', |
| | | minWidth: 160, |
| | |
| | | field: 'reqTime', |
| | | sortable: true, |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | title: '设å¤(å·¥å
·)åç§°', |
| | | sortable: true, |
| | | minWidth: 150, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | if (!row.reqType) { |
| | | return ''; |
| | | } |
| | | |
| | | // æ ¹æ®ä¸åç请æ±ç±»åè¿åç¸åºçåç§° |
| | | switch (row.reqType) { |
| | | case REPAIR_REQ_TYPE.EQU: { |
| | | return row.equName; |
| | | } |
| | | case REPAIR_REQ_TYPE.FIXTURE: { |
| | | return row.fixtureName; |
| | | } |
| | | default: { |
| | | // å¦æè¯·æ±ç±»åæ¢ä¸æ¯ EQU ä¹ä¸æ¯ FIXTUREï¼åè¿å空å符串 |
| | | return ''; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: 'æ
éç±»å«', |
| | |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { listRepairRecord } from '#/api/eims/repair-record'; |
| | | import { delRepairRes, listRepairRes, repairResExport } from '#/api/eims/repair-res'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import { REPAIR_RES_STATUS } from '#/constants/dict'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | import BasisSubTable from '#/views/eims/components/basis-sub-table.vue'; |
| | | |
| | | import RepairRecord from '../repair-record/index.vue'; |
| | | import fbPreviewDrawer from '../repair-fb/fb-preview-drawer.vue'; |
| | | import repairFbDrawer from '../repair-fb/repair-fb-drawer.vue'; |
| | | import { columns as repairRecordCol } from '../repair-record/data'; |
| | | import { columns, querySchema } from './data'; |
| | | import repairResDrawer from './repair-res-drawer.vue'; |
| | | |
| | | import repairFbDrawer from '../repair-fb/repair-fb-drawer.vue' |
| | | import fbPreviewDrawer from '../repair-fb/fb-preview-drawer.vue' |
| | | |
| | | const userStore = useUserStore(); |
| | | const userId = userStore.userInfo?.userId; |
| | |
| | | }); |
| | | |
| | | function handleAddFb(record: Recordable<any>) { |
| | | repairFbDrawerApi.setData({ resId: record.id, resCode: record.resCode, fbUser: userId, fbDept: deptId}); |
| | | repairFbDrawerApi.setData({ resId: record.id, resCode: record.resCode, fbUser: userId, fbDept: deptId }); |
| | | repairFbDrawerApi.open(); |
| | | } |
| | | |
| | |
| | | fbPreviewDrawerApi.setData({ id: record.fbId }); |
| | | fbPreviewDrawerApi.open(); |
| | | } |
| | | |
| | | |
| | | function handleAdd() { |
| | | repairResDrawerApi.setData({ resUser: userId, resDept: deptId }); |
| | |
| | | |
| | | const { hasAccessByRoles } = useAccess(); |
| | | const isSuperAdmin = computed(() => hasAccessByRoles(['superadmin'])); |
| | | |
| | | const isLeader = computed(() => hasAccessByRoles(['leader'])); |
| | | |
| | | function pingjiaAdd(row: any) { |
| | | return (isSuperAdmin.value || row.reqUser === userId) && row.status === REPAIR_RES_STATUS.WANCHENG && !row.fbId; |
| | | return (isSuperAdmin.value || isLeader.value || row.reqUser === userId) && row.status === REPAIR_RES_STATUS.WANCHENG && !row.fbId; |
| | | } |
| | | |
| | | function pingjiaDetail(row: any) { |
| | | return (isSuperAdmin.value || row.reqUser === userId) && row.status === REPAIR_RES_STATUS.WANCHENG && row.fbId; |
| | | return (isSuperAdmin.value || isLeader.value || row.reqUser === userId) && row.status === REPAIR_RES_STATUS.WANCHENG && row.fbId; |
| | | } |
| | | |
| | | function weixiu(row: any) { |
| | | return (isSuperAdmin.value || row.resUser === userId) && row.status === REPAIR_RES_STATUS.YIJIEDAN; |
| | | return (isSuperAdmin.value || isLeader.value || row.resUser === userId) && row.status === REPAIR_RES_STATUS.YIJIEDAN; |
| | | } |
| | | |
| | | function wancheng(row: any) { |
| | | return (isSuperAdmin.value || row.resUser === userId) && row.status === REPAIR_RES_STATUS.WEIXIU; |
| | | return (isSuperAdmin.value || isLeader.value || row.resUser === userId) && row.status === REPAIR_RES_STATUS.WEIXIU; |
| | | } |
| | | |
| | | async function handleDelete(row: Recordable<any>) { |
| | |
| | | |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button v-if="pingjiaAdd(row)" class="btn-success" v-access:code="['eims:repairRes:edit']" @click.stop="handleAddFb(row)"> è¯ä»· </ghost-button> |
| | | <ghost-button v-if="pingjiaDetail(row)" class="btn-success" v-access:code="['eims:repairRes:edit']" @click.stop="handleDetailFb(row)"> é
è¯ </ghost-button> |
| | | <ghost-button v-if="pingjiaAdd(row)" class="btn-success" v-access:code="['eims:repairRes:edit']" @click.stop="handleAddFb(row)"> |
| | | è¯ä»· |
| | | </ghost-button> |
| | | <ghost-button v-if="pingjiaDetail(row)" class="btn-success" v-access:code="['eims:repairRes:edit']" @click.stop="handleDetailFb(row)"> |
| | | é
è¯ |
| | | </ghost-button> |
| | | <ghost-button |
| | | v-if="weixiu(row)" |
| | | class="btn-success" |
| | |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | | <RepairRecord :res-id="resId" class="h-1/3" table-title="维修记å½" /> |
| | | <BasisSubTable :columns="repairRecordCol" :list-api="listRepairRecord" :req-value="resId" class="h-1/3" req-key="resId" title="æä½è®°å½" /> |
| | | </div> |
| | | <RepairResDrawer @reload="tableApi.query()" /> |
| | | <RepairFbDrawer @reload="tableApi.query()" /> |
| | |
| | | EIMS_FIXTURE_STATUS = 'eims_fixture_status', // å·¥å
·ï¼æ²»å
·ï¼ç¶æ |
| | | EIMS_INVENTORY_DETAIL_STATU = 'inventory_detail_statu', // 设å¤çç¹ç¶æ |
| | | EIMS_INVENTORY_STATU = 'inventory_statu', // 设å¤çç¹ç¶æ |
| | | EIMS_MAINT_TYPE = 'eims_maint_type', // ä¿å
»ç±»å |
| | | 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_TIME_RULE = 'maint_time_rule', // ä¿å
»è§å |
| | | REPAIR_FAULT_TYPE = 'repair_fault_type', // æ¥ä¿®ç¶æ |
| | | REPAIR_RECORD_HANDLE = 'repair_record_handle', // ç»´ä¿®è®°å½æä½ |
| | | REPAIR_REQ_STATUS = 'repair_req_status', // æ¥ä¿®ç¶æ |
| | |
| | | |
| | | --- # snail-job é
ç½® |
| | | snail-job: |
| | | enabled: false |
| | | enabled: true |
| | | # éè¦å¨ SnailJob åå°ç»ç®¡çå建对åºåç§°çç»,ç¶åå建任å¡çæ¶å鿩坹åºçç»,æè½æ£ç¡®åæ´¾ä»»å¡ |
| | | group: "ruoyi_group" |
| | | # SnailJob æ¥å
¥éªè¯ä»¤ç è¯¦è§ script/sql/snail_job.sql `sj_group_config` 表 |
| | |
| | | * æ¥ä¿®ç¶æ |
| | | */ |
| | | String REPAIR_REQ_STATUS = "repair_req_status"; |
| | | |
| | | interface REPAIR_REQ_STATUS_DETAIL { |
| | | /** |
| | | * å·²æ¥å |
| | |
| | | * 维修工åç¶æ |
| | | */ |
| | | String REPAIR_RES_STATUS = "repair_res_status"; |
| | | |
| | | interface REPAIR_RES_STATUS_DETAIL { |
| | | /** |
| | | * æ¥å |
| | |
| | | * 维修工åç¶æ |
| | | */ |
| | | String REPAIR_RECORD_HANDLE = "repair_record_handle"; |
| | | |
| | | interface REPAIR_RECORD_HANDLE_DETAIL { |
| | | /** |
| | | * æ°å¢ |
| | |
| | | String WANCHENG = "4"; |
| | | } |
| | | |
| | | /** |
| | | * ä¿å
»æ¶é´è®¡ç®è§å |
| | | */ |
| | | String MAINT_TIME_RULE = "maint_time_rule"; |
| | | |
| | | interface MAINT_TIME_RULE_DETAIL { |
| | | /** |
| | | * æåºå®å¨æ |
| | | */ |
| | | String CYCLE = "0"; |
| | | /** |
| | | * æä¸æ¬¡ä¿å
»æ¶é´ |
| | | */ |
| | | String LAST = "1"; |
| | | } |
| | | |
| | | /** |
| | | * ç³»ç»æ¾ç¤ºéè |
| | | */ |
| | | String SYS_NORMAL_DISABLE = "sys_normal_disable"; |
| | | |
| | | interface SYS_NORMAL_DISABLE_DETAIL { |
| | | String NORMAL = "0"; |
| | | String DISABLE = "1"; |
| | | } |
| | | |
| | | /** |
| | | * ä¿å
»æ¶é´åä½ |
| | | */ |
| | | String MAINT_CYCLE_UNIT = "maint_cycle_unit"; |
| | | |
| | | interface MAINT_CYCLE_UNIT_DETAIL { |
| | | String DAY = "1"; |
| | | String WEEK = "2"; |
| | | String MONTH = "3"; |
| | | String SEASON = "4"; |
| | | String YEAR = "5"; |
| | | } |
| | | |
| | | /** |
| | | * ä¿å
»å·¥åç¶æ |
| | | */ |
| | | String MAINT_ORDER_STATUS = "maint_order_status"; |
| | | |
| | | interface MAINT_ORDER_STATUS_DETAIL { |
| | | String BAOYANG = "1";// ä¿å
»ç» |
| | | String DAIBAOYANG = "0"; // å¾
ä¿å
» |
| | | String DAIYANZHENG = "2"; // å¾
éªè¯ |
| | | String WANCHENG = "3"; // 宿 |
| | | } |
| | | |
| | | /** |
| | | * ä¿å
»å·¥åé¡¹å®æç¶æ |
| | | */ |
| | | String EIMS_ORDITM_STATUS = "eims_orditm_status"; |
| | | interface EIMS_ORDITM_STATUS_DETAIL { |
| | | String WEIWANCHENG = "0";// æªå®æ |
| | | String YIWANCHENG = "1"; // 已宿 |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.common.core.service; |
| | | |
| | | public interface MaintOrderService { |
| | | /** |
| | | * éè¿ä¿å
»å·¥åIDæ¥è¯¢ä¿å
Ȍᴌcode |
| | | * |
| | | * @param orderIds ä¿å
»å·¥åID串éå·åé |
| | | * @return ä¿å
»å·¥åå称串éå·åé |
| | | */ |
| | | String selectMaintOrderCodeByIds(String orderIds); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 计ç®ç¸å·®å¤©æ° |
| | | */ |
| | | public static int differentDays(Date date1, Date date2) { |
| | | return (int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)); |
| | | } |
| | | |
| | | /** |
| | | * 计ç®ä¸¤ä¸ªæ¶é´å·® |
| | | */ |
| | | public static String getDatePoor(Date endDate, Date nowDate) { |
| | |
| | | */ |
| | | String REPAIR_RES_ID_TO_CODE = "repair_res_id_to_code"; |
| | | |
| | | /** |
| | | * ä¿å
»å·¥åid转code |
| | | */ |
| | | String MAINT_ORDER_ID_TO_CODE = "maint_order_id_to_code"; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.common.translation.core.impl; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import org.dromara.common.core.service.MaintOrderService; |
| | | import org.dromara.common.core.service.RepairResService; |
| | | import org.dromara.common.translation.annotation.TranslationType; |
| | | import org.dromara.common.translation.constant.TransConstant; |
| | | import org.dromara.common.translation.core.TranslationInterface; |
| | | |
| | | /** |
| | | * ä¿å
»å·¥åid转code |
| | | * |
| | | * @author zhuguifei |
| | | */ |
| | | @AllArgsConstructor |
| | | @TranslationType(type = TransConstant.MAINT_ORDER_ID_TO_CODE) |
| | | public class MaintOrderCodeTranslationImpl implements TranslationInterface<String> { |
| | | |
| | | private final MaintOrderService orderService; |
| | | |
| | | @Override |
| | | public String translation(Object key, String other) { |
| | | if (key instanceof String ids) { |
| | | return orderService.selectMaintOrderCodeByIds(ids); |
| | | } else if (key instanceof Long id) { |
| | | return orderService.selectMaintOrderCodeByIds(id.toString()); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | org.dromara.common.translation.core.impl.FixtureNameTranslationImpl |
| | | org.dromara.common.translation.core.impl.RepairReqCodeTranslationImpl |
| | | org.dromara.common.translation.core.impl.RepairResCodeTranslationImpl |
| | | org.dromara.common.translation.core.impl.MaintOrderCodeTranslationImpl |
| | |
| | | datasource: |
| | | type: com.zaxxer.hikari.HikariDataSource |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | url: jdbc:mysql://localhost:3306/eims?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | username: root |
| | | password: root |
| | | password: 123456 |
| | | hikari: |
| | | connection-timeout: 30000 |
| | | validation-timeout: 5000 |
| | |
| | | <artifactId>ruoyi-system</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.dromara</groupId> |
| | | <artifactId>ruoyi-common-job</artifactId> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.EimsMaintOrderVo; |
| | | import org.dromara.eims.domain.bo.EimsMaintOrderBo; |
| | | import org.dromara.eims.service.IEimsMaintOrderService; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * ä¿å
Ȍᴌ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-06 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/maintOrder") |
| | | public class EimsMaintOrderController extends BaseController { |
| | | |
| | | private final IEimsMaintOrderService eimsMaintOrderService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»å·¥åå表 |
| | | */ |
| | | @SaCheckPermission("eims:maintOrder:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<EimsMaintOrderVo> list(EimsMaintOrderBo bo, PageQuery pageQuery) { |
| | | // return eimsMaintOrderService.queryPageList(bo, pageQuery); |
| | | return eimsMaintOrderService.queryPageListCustom(bo, pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 导åºä¿å
»å·¥åå表 |
| | | */ |
| | | @SaCheckPermission("eims:maintOrder:export") |
| | | @Log(title = "ä¿å
Ȍᴌ", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(EimsMaintOrderBo bo, HttpServletResponse response) { |
| | | List<EimsMaintOrderVo> list = eimsMaintOrderService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "ä¿å
Ȍᴌ", EimsMaintOrderVo.class, response); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¿å
»å·¥å详ç»ä¿¡æ¯ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | @SaCheckPermission("eims:maintOrder:query") |
| | | @GetMapping("/{id}") |
| | | public R<EimsMaintOrderVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long id) { |
| | | return R.ok(eimsMaintOrderService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿å
Ȍᴌ |
| | | */ |
| | | @SaCheckPermission("eims:maintOrder:add") |
| | | @Log(title = "ä¿å
Ȍᴌ", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsMaintOrderBo bo) { |
| | | return toAjax(eimsMaintOrderService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
Ȍᴌ |
| | | */ |
| | | @SaCheckPermission("eims:maintOrder:edit") |
| | | @Log(title = "ä¿å
Ȍᴌ", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsMaintOrderBo bo) { |
| | | return toAjax(eimsMaintOrderService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¿å
Ȍᴌ |
| | | * |
| | | * @param ids 主é®ä¸² |
| | | */ |
| | | @SaCheckPermission("eims:maintOrder:remove") |
| | | @Log(title = "ä¿å
Ȍᴌ", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(eimsMaintOrderService.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.EimsMaintOrditmVo; |
| | | import org.dromara.eims.domain.bo.EimsMaintOrditmBo; |
| | | import org.dromara.eims.service.IEimsMaintOrditmService; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * å·¥åæ¡ç® |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-10 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/maintOrditm") |
| | | public class EimsMaintOrditmController extends BaseController { |
| | | |
| | | private final IEimsMaintOrditmService eimsMaintOrditmService; |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥åæ¡ç®å表 |
| | | */ |
| | | @SaCheckPermission("eims:maintOrditm:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<EimsMaintOrditmVo> list(EimsMaintOrditmBo bo, PageQuery pageQuery) { |
| | | return eimsMaintOrditmService.queryPageList(bo, pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 导åºå·¥åæ¡ç®å表 |
| | | */ |
| | | @SaCheckPermission("eims:maintOrditm:export") |
| | | @Log(title = "工忡ç®", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(EimsMaintOrditmBo bo, HttpServletResponse response) { |
| | | List<EimsMaintOrditmVo> list = eimsMaintOrditmService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "工忡ç®", EimsMaintOrditmVo.class, response); |
| | | } |
| | | |
| | | /** |
| | | * è·å工忡ç®è¯¦ç»ä¿¡æ¯ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | @SaCheckPermission("eims:maintOrditm:query") |
| | | @GetMapping("/{id}") |
| | | public R<EimsMaintOrditmVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long id) { |
| | | return R.ok(eimsMaintOrditmService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å·¥åæ¡ç® |
| | | */ |
| | | @SaCheckPermission("eims:maintOrditm:add") |
| | | @Log(title = "工忡ç®", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsMaintOrditmBo bo) { |
| | | return toAjax(eimsMaintOrditmService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å·¥åæ¡ç® |
| | | */ |
| | | @SaCheckPermission("eims:maintOrditm:edit") |
| | | @Log(title = "工忡ç®", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsMaintOrditmBo bo) { |
| | | return toAjax(eimsMaintOrditmService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å·¥åæ¡ç® |
| | | * |
| | | * @param ids 主é®ä¸² |
| | | */ |
| | | @SaCheckPermission("eims:maintOrditm:remove") |
| | | @Log(title = "工忡ç®", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(eimsMaintOrditmService.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.EimsMaintPlanVo; |
| | | import org.dromara.eims.domain.bo.EimsMaintPlanBo; |
| | | import org.dromara.eims.service.IEimsMaintPlanService; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * ä¿å
»è®¡å |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-04 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/maintPlan") |
| | | public class EimsMaintPlanController extends BaseController { |
| | | |
| | | private final IEimsMaintPlanService eimsMaintPlanService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»è®¡åå表 |
| | | */ |
| | | @SaCheckPermission("eims:maintPlan:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<EimsMaintPlanVo> list(EimsMaintPlanBo bo, PageQuery pageQuery) { |
| | | // return eimsMaintPlanService.queryPageList(bo, pageQuery); |
| | | return eimsMaintPlanService.queryPageListCustom(bo, pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 导åºä¿å
»è®¡åå表 |
| | | */ |
| | | @SaCheckPermission("eims:maintPlan:export") |
| | | @Log(title = "ä¿å
»è®¡å", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(EimsMaintPlanBo bo, HttpServletResponse response) { |
| | | List<EimsMaintPlanVo> list = eimsMaintPlanService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "ä¿å
»è®¡å", EimsMaintPlanVo.class, response); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¿å
»è®¡å详ç»ä¿¡æ¯ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | @SaCheckPermission("eims:maintPlan:query") |
| | | @GetMapping("/{id}") |
| | | public R<EimsMaintPlanVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long id) { |
| | | return R.ok(eimsMaintPlanService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿å
»è®¡å |
| | | */ |
| | | @SaCheckPermission("eims:maintPlan:add") |
| | | @Log(title = "ä¿å
»è®¡å", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsMaintPlanBo bo) { |
| | | return toAjax(eimsMaintPlanService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
»è®¡å |
| | | */ |
| | | @SaCheckPermission("eims:maintPlan:edit") |
| | | @Log(title = "ä¿å
»è®¡å", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsMaintPlanBo bo) { |
| | | return toAjax(eimsMaintPlanService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¿å
»è®¡å |
| | | * |
| | | * @param ids 主é®ä¸² |
| | | */ |
| | | @SaCheckPermission("eims:maintPlan:remove") |
| | | @Log(title = "ä¿å
»è®¡å", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(eimsMaintPlanService.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.EimsMaintStandVo; |
| | | import org.dromara.eims.domain.bo.EimsMaintStandBo; |
| | | import org.dromara.eims.service.IEimsMaintStandService; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * ä¿å
»æ å |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-04 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/maintStand") |
| | | public class EimsMaintStandController extends BaseController { |
| | | |
| | | private final IEimsMaintStandService eimsMaintStandService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»æ åå表 |
| | | */ |
| | | @SaCheckPermission("eims:maintStand:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<EimsMaintStandVo> list(EimsMaintStandBo bo, PageQuery pageQuery) { |
| | | return eimsMaintStandService.queryPageList(bo, pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 导åºä¿å
»æ åå表 |
| | | */ |
| | | @SaCheckPermission("eims:maintStand:export") |
| | | @Log(title = "ä¿å
»æ å", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(EimsMaintStandBo bo, HttpServletResponse response) { |
| | | List<EimsMaintStandVo> list = eimsMaintStandService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "ä¿å
»æ å", EimsMaintStandVo.class, response); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¿å
»æ å详ç»ä¿¡æ¯ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | @SaCheckPermission("eims:maintStand:query") |
| | | @GetMapping("/{id}") |
| | | public R<EimsMaintStandVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long id) { |
| | | return R.ok(eimsMaintStandService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿å
»æ å |
| | | */ |
| | | @SaCheckPermission("eims:maintStand:add") |
| | | @Log(title = "ä¿å
»æ å", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsMaintStandBo bo) { |
| | | return toAjax(eimsMaintStandService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
»æ å |
| | | */ |
| | | @SaCheckPermission("eims:maintStand:edit") |
| | | @Log(title = "ä¿å
»æ å", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsMaintStandBo bo) { |
| | | return toAjax(eimsMaintStandService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä¿å
»æ å |
| | | * |
| | | * @param ids 主é®ä¸² |
| | | */ |
| | | @SaCheckPermission("eims:maintStand:remove") |
| | | @Log(title = "ä¿å
»æ å", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(eimsMaintStandService.deleteWithValidByIds(List.of(ids), true)); |
| | | } |
| | | } |
| | |
| | | import org.dromara.common.core.constant.CacheConstants; |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.common.redis.utils.RedisUtils; |
| | | import org.dromara.eims.service.IEimsRepairResService; |
| | | import org.dromara.eims.service.IGenerateCodeService; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | |
| | | @RestController |
| | | @RequestMapping("/eims/generate") |
| | | public class GenerateCodeController { |
| | | |
| | | private final IGenerateCodeService eimsRepairResService; |
| | | /** |
| | | * æ ¹æ®åç¼çæåç§ç¼ç |
| | | * |
| | |
| | | @GetMapping("/{prefix}") |
| | | public R<String> generateCode(@NotNull(message = "ç±»åä¸è½ä¸ºç©º") |
| | | @PathVariable String prefix) { |
| | | String todayStr = DateTimeFormatter.ofPattern("yyyyMMdd").format(LocalDate.now()); |
| | | String key = CacheConstants.EIMS_GENERATE_CODE + ":" + prefix; |
| | | String code; |
| | | // 使ç¨Redisçååæ§æä½é¿å
å¹¶åé®é¢ |
| | | String oldCode = RedisUtils.getCacheObject(key); |
| | | if (oldCode != null && oldCode.contains(todayStr)) { |
| | | int no = Integer.parseInt(oldCode.substring(oldCode.length() - 4)); |
| | | code = String.format("%s%s%04d", prefix, todayStr, no + 1); |
| | | } else { |
| | | code = String.format("%s%s%04d", prefix, todayStr, 1); |
| | | } |
| | | // æ´æ°ç¼å |
| | | try { |
| | | RedisUtils.setCacheObject(key, code); |
| | | } catch (Exception e) { |
| | | return R.fail("çæç¼ç 失败ï¼è¯·ç¨åéè¯ï¼"); |
| | | } |
| | | |
| | | return R.ok("çææåï¼", code); |
| | | String code = eimsRepairResService.generateCode(prefix); |
| | | return code == null ? R.fail("çæå¤±è´¥ï¼") :R.ok("çææåï¼", code); |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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_maint_order |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-06 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("eims_maint_order") |
| | | public class EimsMaintOrder extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private Long equId; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»ç±»åï¼åå
¸ï¼ |
| | | */ |
| | | private String maintType; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»å¨æ |
| | | */ |
| | | private Long maintCycle; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»å¨æåä½ï¼åå
¸ï¼ |
| | | */ |
| | | private String maintCycleUnit; |
| | | |
| | | /** |
| | | * 计å表åä½- ä¿å
»è§åï¼åå
¸ï¼ä¿å
»æ¶é´è®¡ç®ï¼1-æå¨æ 2-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | */ |
| | | private String maintRule; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»äºº |
| | | */ |
| | | private Long maintUser; |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | private Long verifyUser; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»é¨é¨ |
| | | */ |
| | | private Long maintDept; |
| | | |
| | | /** |
| | | * ä¿å
»åå· |
| | | */ |
| | | private String maintCode; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * ä¿å
»è®¡åæ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date planTime; |
| | | |
| | | /** |
| | | * ä¿å
»å¼å§æ¶é´ |
| | | */ |
| | | private Date startTime; |
| | | |
| | | /** |
| | | * ä¿å
»ç»ææ¶é´ |
| | | */ |
| | | private Date endTime; |
| | | |
| | | /** |
| | | * 计åid |
| | | */ |
| | | private Long planId; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | 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_maint_orditm |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-10 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("eims_maint_orditm") |
| | | public class EimsMaintOrditm extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * å·¥åid |
| | | */ |
| | | private Long orderId; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | private Long equId; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®åç§° |
| | | */ |
| | | private String itmName; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®æä½æ å |
| | | */ |
| | | private String itmAction; |
| | | |
| | | /** |
| | | * ä¿å
»æä½ç¨æ· |
| | | */ |
| | | private Long itmUser; |
| | | |
| | | /** |
| | | * ä¿å
»æ¶é´ |
| | | */ |
| | | private Date itmTime; |
| | | |
| | | /** |
| | | * å®æç¶æï¼åå
¸ï¼ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain; |
| | | |
| | | import jakarta.validation.constraints.NotNull; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | | import org.dromara.common.core.validate.EditGroup; |
| | | 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_maint_plan |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-04 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("eims_maint_plan") |
| | | public class EimsMaintPlan extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | |
| | | */ |
| | | private Long equId; |
| | | |
| | | /** |
| | | * ä¿å
»ç±»åï¼åå
¸ï¼ |
| | | */ |
| | | private String maintType; |
| | | |
| | | /** |
| | | * ä¿å
»å¨æ |
| | | */ |
| | | private Long maintCycle; |
| | | |
| | | /** |
| | | * ä¿å
»å¨æåä½ï¼åå
¸ï¼ |
| | | */ |
| | | private String maintCycleUnit; |
| | | |
| | | /** |
| | | * ä¿å
»è§åï¼åå
¸ï¼ä¿å
»æ¶é´è®¡ç®ï¼1-æå¨æ 2-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | */ |
| | | private String maintRule; |
| | | |
| | | /** |
| | | * ä¿å
»äºº |
| | | */ |
| | | private Long maintUser; |
| | | |
| | | /** |
| | | * ä¿å
»é¨é¨ |
| | | */ |
| | | private Long maintDept; |
| | | |
| | | /** |
| | | * ç¶æï¼åå
¸ï¼ 0-å¯ç¨ 1-ç¦ç¨ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * 馿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date maintFirstTime; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date maintLastTime; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date maintNextTime; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 䏿¬¡çæå·¥åæ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date lastGenerateDate; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.io.Serial; |
| | | |
| | | /** |
| | | * ä¿å
»æ å对象 eims_maint_stand |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-04 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("eims_maint_stand") |
| | | public class EimsMaintStand extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | private Long equId; |
| | | |
| | | /** |
| | | * 设å¤ç¼ç |
| | | */ |
| | | private String equCode; |
| | | |
| | | /** |
| | | * 设å¤ç±»å |
| | | */ |
| | | private Long equTypeId; |
| | | |
| | | /** |
| | | * èµäº§ç¼å· |
| | | */ |
| | | private String assetNo; |
| | | |
| | | /** |
| | | * 设å¤åç§° |
| | | |
| | | */ |
| | | private String equName; |
| | | |
| | | /** |
| | | * 设å¤åå· |
| | | */ |
| | | private String modelNo; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®åç§° |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®æ å |
| | | */ |
| | | private String stand; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import org.dromara.eims.domain.EimsMaintOrder; |
| | | 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_maint_order |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-06 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = EimsMaintOrder.class, reverseConvertGenerate = false) |
| | | public class EimsMaintOrderBo extends BaseEntity { |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @NotNull(message = "idä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long id; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @NotNull(message = "设å¤idä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long equId; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»ç±»åï¼åå
¸ï¼ |
| | | */ |
| | | private String maintType; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»å¨æ |
| | | */ |
| | | private Long maintCycle; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»å¨æåä½ï¼åå
¸ï¼ |
| | | */ |
| | | private String maintCycleUnit; |
| | | |
| | | /** |
| | | * 计å表åä½- ä¿å
»è§åï¼åå
¸ï¼ä¿å
»æ¶é´è®¡ç®ï¼1-æå¨æ 2-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | */ |
| | | private String maintRule; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»äºº |
| | | */ |
| | | @NotNull(message = "计å表åä½-ä¿å
»äººä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long maintUser; |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | private Long verifyUser; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»é¨é¨ |
| | | */ |
| | | @NotNull(message = "计å表åä½-ä¿å
»é¨é¨ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long maintDept; |
| | | |
| | | /** |
| | | * ä¿å
»åå· |
| | | */ |
| | | @NotBlank(message = "ä¿å
»åå·ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String maintCode; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @NotBlank(message = "ç¶æä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String status; |
| | | |
| | | /** |
| | | * ä¿å
»è®¡åæ¶é´ |
| | | */ |
| | | @NotNull(message = "ä¿å
»è®¡åæ¶é´ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date planTime; |
| | | |
| | | /** |
| | | * ä¿å
»å¼å§æ¶é´ |
| | | */ |
| | | private Date startTime; |
| | | |
| | | /** |
| | | * ä¿å
»ç»ææ¶é´ |
| | | */ |
| | | private Date endTime; |
| | | |
| | | /** |
| | | * 计åid |
| | | */ |
| | | private Long planId; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | // å
³èè¡¨åæ®µ |
| | | private String equName; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import org.dromara.eims.domain.EimsMaintOrditm; |
| | | 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_maint_orditm |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-10 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = EimsMaintOrditm.class, reverseConvertGenerate = false) |
| | | public class EimsMaintOrditmBo extends BaseEntity { |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @NotNull(message = "ä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long id; |
| | | |
| | | /** |
| | | * å·¥åid |
| | | */ |
| | | @NotNull(message = "å·¥åidä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long orderId; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | @NotNull(message = "设å¤idä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long equId; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®åç§° |
| | | */ |
| | | @NotBlank(message = "ä¿å
»é¡¹ç®åç§°ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String itmName; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®æä½æ å |
| | | */ |
| | | private String itmAction; |
| | | |
| | | /** |
| | | * ä¿å
»æä½ç¨æ· |
| | | */ |
| | | @NotNull(message = "ä¿å
»æä½ç¨æ·ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long itmUser; |
| | | |
| | | /** |
| | | * ä¿å
»æ¶é´ |
| | | */ |
| | | private Date itmTime; |
| | | |
| | | /** |
| | | * å®æç¶æï¼åå
¸ï¼ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import org.dromara.eims.domain.EimsMaintPlan; |
| | | 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_maint_plan |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-04 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = EimsMaintPlan.class, reverseConvertGenerate = false) |
| | | public class EimsMaintPlanBo extends BaseEntity { |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @NotNull(message = "ä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | |
| | | */ |
| | | @NotNull(message = "设å¤id ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long equId; |
| | | |
| | | /** |
| | | * ä¿å
»ç±»åï¼åå
¸ï¼ |
| | | */ |
| | | @NotBlank(message = "ä¿å
»ç±»åï¼åå
¸ï¼ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String maintType; |
| | | |
| | | /** |
| | | * ä¿å
»å¨æ |
| | | */ |
| | | @NotNull(message = "ä¿å
»å¨æä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long maintCycle; |
| | | |
| | | /** |
| | | * ä¿å
»å¨æåä½ï¼åå
¸ï¼ |
| | | */ |
| | | @NotBlank(message = "ä¿å
»å¨æåä½ï¼åå
¸ï¼ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String maintCycleUnit; |
| | | |
| | | /** |
| | | * ä¿å
»è§åï¼åå
¸ï¼ä¿å
»æ¶é´è®¡ç®ï¼1-æå¨æ 2-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | */ |
| | | @NotBlank(message = "ä¿å
»è§åï¼åå
¸ï¼ä¿å
»æ¶é´è®¡ç®ï¼1-æå¨æ 2-æä¸æ¬¡ä¿å
»æ¶é´ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String maintRule; |
| | | |
| | | /** |
| | | * ä¿å
»äºº |
| | | */ |
| | | @NotNull(message = "ä¿å
»äººä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long maintUser; |
| | | |
| | | /** |
| | | * ä¿å
»é¨é¨ |
| | | */ |
| | | @NotNull(message = "ä¿å
»é¨é¨ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long maintDept; |
| | | |
| | | /** |
| | | * ç¶æï¼åå
¸ï¼ 0-å¯ç¨ 1-ç¦ç¨ |
| | | */ |
| | | @NotNull(message = "ç¶æï¼åå
¸ï¼ 0-å¯ç¨ 1-ç¦ç¨ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String status; |
| | | |
| | | /** |
| | | * 馿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @NotNull(message = "ä¿å
»è®¡å馿¬¡æ§è¡æ¶é´ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date maintFirstTime; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date maintLastTime; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date maintNextTime; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 䏿¬¡çæå·¥åæ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date lastGenerateDate; |
| | | |
| | | // å
³èè¡¨åæ®µ |
| | | private String equName; |
| | | private String assetNo; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import org.dromara.eims.domain.EimsMaintStand; |
| | | 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.*; |
| | | |
| | | /** |
| | | * ä¿å
»æ åä¸å¡å¯¹è±¡ eims_maint_stand |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-04 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = EimsMaintStand.class, reverseConvertGenerate = false) |
| | | public class EimsMaintStandBo extends BaseEntity { |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @NotNull(message = "ä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | @NotNull(message = "设å¤idä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long equId; |
| | | |
| | | /** |
| | | * 设å¤ç¼ç |
| | | */ |
| | | private String equCode; |
| | | |
| | | /** |
| | | * 设å¤ç±»å |
| | | */ |
| | | private Long equTypeId; |
| | | |
| | | /** |
| | | * èµäº§ç¼å· |
| | | */ |
| | | private String assetNo; |
| | | |
| | | /** |
| | | * 设å¤åç§° |
| | | |
| | | */ |
| | | private String equName; |
| | | |
| | | /** |
| | | * 设å¤åå· |
| | | */ |
| | | private String modelNo; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®åç§° |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®æ å |
| | | */ |
| | | private String stand; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @NotBlank(message = "夿³¨ä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.EimsMaintOrder; |
| | | 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 |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-06 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = EimsMaintOrder.class) |
| | | public class EimsMaintOrderVo extends BaseEntity implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ExcelProperty(value = "") |
| | | private Long id; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ExcelProperty(value = "") |
| | | 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 maintType; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»å¨æ |
| | | */ |
| | | @ExcelProperty(value = "计å表åä½-ä¿å
»å¨æ") |
| | | private Long maintCycle; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»å¨æåä½ï¼åå
¸ï¼ |
| | | */ |
| | | @ExcelProperty(value = "计å表åä½-ä¿å
»å¨æåä½", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(readConverterExp = "å=å
¸") |
| | | private String maintCycleUnit; |
| | | |
| | | /** |
| | | * 计å表åä½- ä¿å
»è§åï¼åå
¸ï¼ä¿å
»æ¶é´è®¡ç®ï¼1-æå¨æ 2-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "计å表åä½- ä¿å
»è§å", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(readConverterExp = "å=å
¸") |
| | | private String maintRule; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»äºº |
| | | */ |
| | | @ExcelProperty(value = "计å表åä½-ä¿å
»äºº") |
| | | private Long maintUser; |
| | | |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "maintUser") |
| | | private String maintUserName; |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | private Long verifyUser; |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "verifyUser") |
| | | private String verifyUserName; |
| | | |
| | | /** |
| | | * 计å表åä½-ä¿å
»é¨é¨ |
| | | */ |
| | | @ExcelProperty(value = "计å表åä½-ä¿å
»é¨é¨") |
| | | private Long maintDept; |
| | | |
| | | /** |
| | | * ä¿å
»åå· |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»åå·") |
| | | private String maintCode; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ExcelProperty(value = "") |
| | | private String status; |
| | | |
| | | /** |
| | | * ä¿å
»è®¡åæ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»è®¡åæ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date planTime; |
| | | |
| | | /** |
| | | * ä¿å
»å¼å§æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»å¼å§æ¶é´") |
| | | private Date startTime; |
| | | |
| | | /** |
| | | * ä¿å
»ç»ææ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»ç»ææ¶é´") |
| | | private Date endTime; |
| | | |
| | | /** |
| | | * 计åid |
| | | */ |
| | | @ExcelProperty(value = "计åid") |
| | | private Long planId; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.vo; |
| | | |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.dromara.common.translation.annotation.Translation; |
| | | import org.dromara.common.translation.constant.TransConstant; |
| | | import org.dromara.eims.domain.EimsMaintOrditm; |
| | | 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_orditm |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-10 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = EimsMaintOrditm.class) |
| | | public class EimsMaintOrditmVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ExcelProperty(value = "") |
| | | private Long id; |
| | | |
| | | /** |
| | | * å·¥åid |
| | | */ |
| | | @ExcelProperty(value = "å·¥åid") |
| | | private Long orderId; |
| | | |
| | | @Translation(type = TransConstant.MAINT_ORDER_ID_TO_CODE, mapper = "orderId") |
| | | private String orderName; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | @ExcelProperty(value = "设å¤id") |
| | | private Long equId; |
| | | |
| | | @Translation(type = TransConstant.EQU_ID_TO_NAME, mapper = "equId") |
| | | private String equName; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®åç§° |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»é¡¹ç®åç§°") |
| | | private String itmName; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®æä½æ å |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»é¡¹ç®æä½æ å") |
| | | private String itmAction; |
| | | |
| | | /** |
| | | * ä¿å
»æä½ç¨æ· |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»æä½ç¨æ·") |
| | | private Long itmUser; |
| | | |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "itmUser") |
| | | private String itmUserName; |
| | | |
| | | /** |
| | | * ä¿å
»æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»æ¶é´") |
| | | private Date itmTime; |
| | | |
| | | /** |
| | | * å®æç¶æï¼åå
¸ï¼ |
| | | */ |
| | | @ExcelProperty(value = "å®æç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "eims_orditm_status") |
| | | private String status; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.vo; |
| | | |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | | import org.dromara.common.core.validate.EditGroup; |
| | | import org.dromara.common.translation.annotation.Translation; |
| | | import org.dromara.common.translation.constant.TransConstant; |
| | | import org.dromara.eims.domain.EimsMaintPlan; |
| | | 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_plan |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-04 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = EimsMaintPlan.class) |
| | | public class EimsMaintPlanVo 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(dictType = "eims_maint_type") |
| | | private String maintType; |
| | | |
| | | /** |
| | | * ä¿å
»å¨æ |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»å¨æ") |
| | | private Long maintCycle; |
| | | |
| | | /** |
| | | * ä¿å
»å¨æåä½ï¼åå
¸ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»å¨æåä½", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "maint_cycle_unit") |
| | | private String maintCycleUnit; |
| | | |
| | | /** |
| | | * åæ®µæ¼æ¥ maintCycle + maintCycleUnitçdictLabel |
| | | */ |
| | | private String maintCycleUnitName; |
| | | |
| | | /** |
| | | * ä¿å
»è§åï¼åå
¸ï¼ä¿å
»æ¶é´è®¡ç®ï¼1-æå¨æ 2-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»è§å", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "maint_time_rule") |
| | | private String maintRule; |
| | | |
| | | /** |
| | | * ä¿å
»äºº |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»äºº") |
| | | private Long maintUser; |
| | | |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "maintUser") |
| | | private String maintUserName; |
| | | |
| | | /** |
| | | * ä¿å
»é¨é¨ |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»é¨é¨") |
| | | private Long maintDept; |
| | | |
| | | private String maintDeptName; |
| | | |
| | | /** |
| | | * ç¶æï¼åå
¸ï¼ 0-å¯ç¨ 1-ç¦ç¨ |
| | | */ |
| | | @ExcelProperty(value = "ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "sys_normal_disable") |
| | | private String status; |
| | | |
| | | /** |
| | | * 馿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date maintFirstTime; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "䏿¬¡æ§è¡æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date maintLastTime; |
| | | |
| | | /** |
| | | * 䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "䏿¬¡æ§è¡æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date maintNextTime; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | /** |
| | | * 䏿¬¡çæå·¥åæ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date lastGenerateDate; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.vo; |
| | | |
| | | import org.dromara.eims.domain.EimsMaintStand; |
| | | 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_stand |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-04 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = EimsMaintStand.class) |
| | | public class EimsMaintStandVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ExcelProperty(value = "") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | @ExcelProperty(value = "设å¤id") |
| | | private Long equId; |
| | | |
| | | /** |
| | | * 设å¤ç¼ç |
| | | */ |
| | | @ExcelProperty(value = "设å¤ç¼ç ") |
| | | private String equCode; |
| | | |
| | | /** |
| | | * 设å¤ç±»å |
| | | */ |
| | | @ExcelProperty(value = "设å¤ç±»å") |
| | | private Long equTypeId; |
| | | |
| | | /** |
| | | * èµäº§ç¼å· |
| | | */ |
| | | @ExcelProperty(value = "èµäº§ç¼å·") |
| | | private String assetNo; |
| | | |
| | | /** |
| | | * 设å¤åç§° |
| | | |
| | | */ |
| | | @ExcelProperty(value = "设å¤åç§°") |
| | | private String equName; |
| | | |
| | | /** |
| | | * 设å¤åå· |
| | | */ |
| | | @ExcelProperty(value = "设å¤åå·") |
| | | private String modelNo; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®åç§° |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»é¡¹ç®åç§°") |
| | | private String name; |
| | | |
| | | /** |
| | | * ä¿å
»é¡¹ç®æ å |
| | | */ |
| | | @ExcelProperty(value = "ä¿å
»é¡¹ç®æ å") |
| | | private String stand; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.job; |
| | | |
| | | import com.aizuda.snailjob.client.job.core.annotation.JobExecutor; |
| | | import com.aizuda.snailjob.client.job.core.dto.JobArgs; |
| | | import com.aizuda.snailjob.client.model.ExecuteResult; |
| | | import com.aizuda.snailjob.common.core.util.JsonUtil; |
| | | import com.aizuda.snailjob.common.log.SnailJobLog; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import org.dromara.common.core.constant.DictConstants; |
| | | import org.dromara.common.core.utils.DateUtils; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.eims.domain.*; |
| | | import org.dromara.eims.domain.bo.EimsMaintPlanBo; |
| | | import org.dromara.eims.domain.vo.EimsMaintPlanVo; |
| | | import org.dromara.eims.domain.vo.EimsMaintStandVo; |
| | | import org.dromara.eims.mapper.EimsMaintOrderMapper; |
| | | import org.dromara.eims.mapper.EimsMaintOrditmMapper; |
| | | import org.dromara.eims.mapper.EimsMaintPlanMapper; |
| | | import org.dromara.eims.mapper.EimsMaintStandMapper; |
| | | import org.dromara.eims.service.IEimsMaintOrderService; |
| | | import org.dromara.eims.service.IEimsMaintPlanService; |
| | | import org.dromara.eims.service.IGenerateCodeService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | @JobExecutor(name = "maintPlanToOrderJob") |
| | | public class MaintPlanToOrderJob { |
| | | private final EimsMaintOrderMapper orderMapper; |
| | | |
| | | private final EimsMaintStandMapper standMapper; |
| | | |
| | | private final EimsMaintOrditmMapper orditmMapper; |
| | | |
| | | private final EimsMaintPlanMapper planMapper; |
| | | |
| | | private final IGenerateCodeService codeService; |
| | | |
| | | |
| | | @SneakyThrows |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ExecuteResult jobExecute(JobArgs jobArgs) { |
| | | // è·åä»å¤©æ¥æ |
| | | |
| | | Date today = new Date(); |
| | | LambdaQueryWrapper<EimsMaintPlan> planBoQueryWrapper = Wrappers.lambdaQuery(); |
| | | // æ¥è¯¢å¯ç¨çä¿å
»è®¡å |
| | | planBoQueryWrapper.eq(EimsMaintPlan::getStatus, DictConstants.SYS_NORMAL_DISABLE_DETAIL.NORMAL); |
| | | // è¿æ»¤æ²¡æé¦æ¬¡è¿è¡æ¶é´ |
| | | planBoQueryWrapper.isNotNull(EimsMaintPlan::getMaintFirstTime); |
| | | // è¿æ»¤æ²¡æä¸æ¬¡è¿è¡æ¶é´ |
| | | planBoQueryWrapper.isNotNull(EimsMaintPlan::getMaintNextTime); |
| | | // è¿æ»¤æ²¡æä¿å
»å¨æçæ°æ® |
| | | planBoQueryWrapper.isNotNull(EimsMaintPlan::getMaintCycle); |
| | | planBoQueryWrapper.isNotNull(EimsMaintPlan::getMaintCycleUnit); |
| | | planBoQueryWrapper.isNotNull(EimsMaintPlan::getMaintRule); |
| | | |
| | | List<EimsMaintPlanVo> planVoList = planMapper.selectVoList(planBoQueryWrapper); |
| | | for (int i = 0; i < planVoList.size(); i++) { |
| | | EimsMaintPlanVo planVo = planVoList.get(i); |
| | | // ä¿å
»è®¡åaddçæ¶åä¼èªå¨çæä¸æ¬¡è¿è¡æ¶é´ |
| | | Date createOrderTime = planVo.getMaintNextTime(); |
| | | int day = DateUtils.differentDays(today,createOrderTime ); |
| | | // å¦æè®¡åçæå·¥åæ¥æå¤§äºä»å¤©åä¸çæå·¥å |
| | | if (day >= 1) { |
| | | continue; |
| | | } |
| | | |
| | | // 计ç®çæå·¥åæ¶é´ |
| | | Long maintCycle = planVo.getMaintCycle(); |
| | | String maintRule = planVo.getMaintRule(); |
| | | Date firstTime = planVo.getMaintFirstTime(); |
| | | Date lastTime = planVo.getMaintLastTime(); |
| | | Date nextTime = null; |
| | | String maintCycleUnit = planVo.getMaintCycleUnit(); |
| | | switch (maintCycleUnit) { |
| | | case DictConstants.MAINT_CYCLE_UNIT_DETAIL.DAY: |
| | | break; |
| | | case DictConstants.MAINT_CYCLE_UNIT_DETAIL.WEEK: |
| | | maintCycle *= 7; |
| | | break; |
| | | case DictConstants.MAINT_CYCLE_UNIT_DETAIL.MONTH: |
| | | maintCycle *= 30; |
| | | break; |
| | | case DictConstants.MAINT_CYCLE_UNIT_DETAIL.SEASON: |
| | | maintCycle *= 90; |
| | | break; |
| | | case DictConstants.MAINT_CYCLE_UNIT_DETAIL.YEAR: |
| | | maintCycle *= 365; |
| | | break; |
| | | } |
| | | // 馿¬¡ |
| | | if (lastTime == null ) { |
| | | nextTime = DateUtils.addDays(createOrderTime, maintCycle.intValue()); |
| | | } else { |
| | | nextTime = DateUtils.addDays(lastTime, maintCycle.intValue()); |
| | | } |
| | | EimsMaintOrder order = new EimsMaintOrder(); |
| | | BeanUtils.copyProperties(planVo, order); |
| | | order.setId(null); |
| | | order.setStatus(DictConstants.MAINT_ORDER_STATUS_DETAIL.DAIBAOYANG); |
| | | order.setPlanTime(createOrderTime); |
| | | order.setMaintCode(codeService.generateCode("BYZD")); |
| | | EimsMaintPlan plan = MapstructUtils.convert(planVo, EimsMaintPlan.class); |
| | | assert plan != null; |
| | | plan.setLastGenerateDate(new Date()); |
| | | plan.setMaintLastTime(createOrderTime); |
| | | plan.setMaintNextTime(nextTime); |
| | | boolean flag = orderMapper.insert(order) > 0; |
| | | //TODO çæå¤±è´¥ï¼æ·»å å¼å¸¸è®°å½ |
| | | if (!flag) continue; |
| | | planMapper.updateById(plan); |
| | | |
| | | //çæä¿å
»æç» |
| | | Long equId = plan.getEquId(); |
| | | List<EimsMaintStandVo> standList = standMapper.selectVoList(new LambdaQueryWrapper<EimsMaintStand>().eq(EimsMaintStand::getEquId, equId)); |
| | | //TODO 没æä¿å
»é¡¹ï¼æ·»å å¼å¸¸è®°å½ |
| | | if(standList.isEmpty()) continue; |
| | | for (int j = 0; j < standList.size(); j++) { |
| | | EimsMaintStandVo stand = standList.get(j); |
| | | EimsMaintOrditm itm = new EimsMaintOrditm(); |
| | | itm.setOrderId(order.getId()); |
| | | itm.setEquId(equId); |
| | | itm.setItmName(stand.getName()); |
| | | itm.setItmAction(stand.getStand()); |
| | | itm.setItmUser(order.getMaintUser()); |
| | | orditmMapper.insert(itm); |
| | | } |
| | | } |
| | | return ExecuteResult.success("ä¿å
»è®¡åçæä¿å
»å·¥åæå"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.EimsMaintOrder; |
| | | import org.dromara.eims.domain.EimsMaintPlan; |
| | | import org.dromara.eims.domain.vo.EimsMaintOrderVo; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import org.dromara.eims.domain.vo.EimsMaintPlanVo; |
| | | |
| | | /** |
| | | * ä¿å
»å·¥åMapperæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-06 |
| | | */ |
| | | public interface EimsMaintOrderMapper extends BaseMapperPlus<EimsMaintOrder, EimsMaintOrderVo> { |
| | | Page<EimsMaintOrderVo> selectMaintOrderList(@Param("page") Page<EimsMaintOrderVo> page, @Param(Constants.WRAPPER) Wrapper<EimsMaintOrder> queryWrapper); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import org.dromara.eims.domain.EimsMaintOrditm; |
| | | import org.dromara.eims.domain.vo.EimsMaintOrditmVo; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | |
| | | /** |
| | | * 工忡ç®Mapperæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-10 |
| | | */ |
| | | public interface EimsMaintOrditmMapper extends BaseMapperPlus<EimsMaintOrditm, EimsMaintOrditmVo> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.EimsMaintPlan; |
| | | import org.dromara.eims.domain.EimsRepairReq; |
| | | import org.dromara.eims.domain.vo.EimsMaintPlanVo; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import org.dromara.eims.domain.vo.EimsRepairReqVo; |
| | | |
| | | /** |
| | | * ä¿å
»è®¡åMapperæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-04 |
| | | */ |
| | | public interface EimsMaintPlanMapper extends BaseMapperPlus<EimsMaintPlan, EimsMaintPlanVo> { |
| | | Page<EimsMaintPlanVo> selectMaintPlanList(@Param("page") Page<EimsMaintPlanVo> page, @Param(Constants.WRAPPER) Wrapper<EimsMaintPlan> queryWrapper); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import org.dromara.eims.domain.EimsMaintStand; |
| | | import org.dromara.eims.domain.vo.EimsMaintStandVo; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | |
| | | /** |
| | | * ä¿å
»æ åMapperæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-04 |
| | | */ |
| | | public interface EimsMaintStandMapper extends BaseMapperPlus<EimsMaintStand, EimsMaintStandVo> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.eims.domain.vo.EimsMaintOrderVo; |
| | | import org.dromara.eims.domain.bo.EimsMaintOrderBo; |
| | | 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-06 |
| | | */ |
| | | public interface IEimsMaintOrderService { |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
Ȍᴌ |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return ä¿å
Ȍᴌ |
| | | */ |
| | | EimsMaintOrderVo queryById(Long id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ä¿å
»å·¥åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ä¿å
»å·¥åå页å表 |
| | | */ |
| | | TableDataInfo<EimsMaintOrderVo> queryPageList(EimsMaintOrderBo bo, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çä¿å
»å·¥åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ä¿å
»å·¥åå表 |
| | | */ |
| | | List<EimsMaintOrderVo> queryList(EimsMaintOrderBo bo); |
| | | |
| | | /** |
| | | * æ°å¢ä¿å
Ȍᴌ |
| | | * |
| | | * @param bo ä¿å
Ȍᴌ |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | Boolean insertByBo(EimsMaintOrderBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
Ȍᴌ |
| | | * |
| | | * @param bo ä¿å
Ȍᴌ |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(EimsMaintOrderBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ä¿å
»å·¥åä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ä¿å
»å·¥åå表-å¤è¡¨æ¥è¯¢ |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ä¿å
»å·¥åå页å表 |
| | | */ |
| | | TableDataInfo<EimsMaintOrderVo> queryPageListCustom(EimsMaintOrderBo bo, PageQuery pageQuery); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.eims.domain.vo.EimsMaintOrditmVo; |
| | | import org.dromara.eims.domain.bo.EimsMaintOrditmBo; |
| | | 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-10 |
| | | */ |
| | | public interface IEimsMaintOrditmService { |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥åæ¡ç® |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return å·¥åæ¡ç® |
| | | */ |
| | | EimsMaintOrditmVo queryById(Long id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢å·¥åæ¡ç®å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return 工忡ç®å页å表 |
| | | */ |
| | | TableDataInfo<EimsMaintOrditmVo> queryPageList(EimsMaintOrditmBo bo, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶ç工忡ç®å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return 工忡ç®å表 |
| | | */ |
| | | List<EimsMaintOrditmVo> queryList(EimsMaintOrditmBo bo); |
| | | |
| | | /** |
| | | * æ°å¢å·¥åæ¡ç® |
| | | * |
| | | * @param bo å·¥åæ¡ç® |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | Boolean insertByBo(EimsMaintOrditmBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹å·¥åæ¡ç® |
| | | * |
| | | * @param bo å·¥åæ¡ç® |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(EimsMaintOrditmBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤å·¥åæ¡ç®ä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.eims.domain.vo.EimsMaintPlanVo; |
| | | import org.dromara.eims.domain.bo.EimsMaintPlanBo; |
| | | 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-04 |
| | | */ |
| | | public interface IEimsMaintPlanService { |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»è®¡å |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return ä¿å
»è®¡å |
| | | */ |
| | | EimsMaintPlanVo queryById(Long id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ä¿å
»è®¡åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ä¿å
»è®¡åå页å表 |
| | | */ |
| | | TableDataInfo<EimsMaintPlanVo> queryPageList(EimsMaintPlanBo bo, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çä¿å
»è®¡åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ä¿å
»è®¡åå表 |
| | | */ |
| | | List<EimsMaintPlanVo> queryList(EimsMaintPlanBo bo); |
| | | |
| | | /** |
| | | * æ°å¢ä¿å
»è®¡å |
| | | * |
| | | * @param bo ä¿å
»è®¡å |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | Boolean insertByBo(EimsMaintPlanBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
»è®¡å |
| | | * |
| | | * @param bo ä¿å
»è®¡å |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(EimsMaintPlanBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ä¿å
»è®¡åä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ä¿å
»è®¡åå表-å¤è¡¨æ¥è¯¢ |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ä¿å
»è®¡åå页å表 |
| | | */ |
| | | TableDataInfo<EimsMaintPlanVo> queryPageListCustom(EimsMaintPlanBo bo, PageQuery pageQuery); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.eims.domain.vo.EimsMaintStandVo; |
| | | import org.dromara.eims.domain.bo.EimsMaintStandBo; |
| | | 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-04 |
| | | */ |
| | | public interface IEimsMaintStandService { |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»æ å |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return ä¿å
»æ å |
| | | */ |
| | | EimsMaintStandVo queryById(Long id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ä¿å
»æ åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ä¿å
»æ åå页å表 |
| | | */ |
| | | TableDataInfo<EimsMaintStandVo> queryPageList(EimsMaintStandBo bo, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çä¿å
»æ åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ä¿å
»æ åå表 |
| | | */ |
| | | List<EimsMaintStandVo> queryList(EimsMaintStandBo bo); |
| | | |
| | | /** |
| | | * æ°å¢ä¿å
»æ å |
| | | * |
| | | * @param bo ä¿å
»æ å |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | Boolean insertByBo(EimsMaintStandBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
»æ å |
| | | * |
| | | * @param bo ä¿å
»æ å |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(EimsMaintStandBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ä¿å
»æ åä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | public interface IGenerateCodeService { |
| | | String generateCode(String prefix); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service.impl; |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import lombok.SneakyThrows; |
| | | import org.dromara.common.core.constant.DictConstants; |
| | | import org.dromara.common.core.service.MaintOrderService; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | 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.EimsMaintOrditm; |
| | | import org.dromara.eims.domain.EimsMaintStand; |
| | | import org.dromara.eims.domain.vo.EimsMaintPlanVo; |
| | | import org.dromara.eims.domain.vo.EimsMaintStandVo; |
| | | import org.dromara.eims.domain.vo.EimsRepairResVo; |
| | | import org.dromara.eims.mapper.EimsMaintOrditmMapper; |
| | | import org.dromara.eims.mapper.EimsMaintStandMapper; |
| | | 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.EimsMaintOrderBo; |
| | | import org.dromara.eims.domain.vo.EimsMaintOrderVo; |
| | | import org.dromara.eims.domain.EimsMaintOrder; |
| | | import org.dromara.eims.mapper.EimsMaintOrderMapper; |
| | | import org.dromara.eims.service.IEimsMaintOrderService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * ä¿å
»å·¥åServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-06 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class EimsMaintOrderServiceImpl implements IEimsMaintOrderService, MaintOrderService { |
| | | |
| | | private final EimsMaintOrderMapper baseMapper; |
| | | private final EimsMaintOrditmMapper orditmMapper; |
| | | private final SysDeptMapper sysDeptMapper; |
| | | |
| | | private final EimsMaintStandMapper standMapper; |
| | | /** |
| | | * æ¥è¯¢ä¿å
Ȍᴌ |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return ä¿å
Ȍᴌ |
| | | */ |
| | | @Override |
| | | public EimsMaintOrderVo queryById(Long id){ |
| | | return baseMapper.selectVoById(id); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ä¿å
»å·¥åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ä¿å
»å·¥åå页å表 |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsMaintOrderVo> queryPageList(EimsMaintOrderBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<EimsMaintOrder> lqw = buildQueryWrapper(bo); |
| | | Page<EimsMaintOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | @Override |
| | | public TableDataInfo<EimsMaintOrderVo> queryPageListCustom(EimsMaintOrderBo bo, PageQuery pageQuery) { |
| | | Page<EimsMaintOrderVo> page = baseMapper.selectMaintOrderList(pageQuery.build(), buildWrapper(bo)); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çä¿å
»å·¥åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ä¿å
»å·¥åå表 |
| | | */ |
| | | @Override |
| | | public List<EimsMaintOrderVo> queryList(EimsMaintOrderBo bo) { |
| | | LambdaQueryWrapper<EimsMaintOrder> lqw = buildQueryWrapper(bo); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | private QueryWrapper<EimsMaintOrder> buildWrapper(EimsMaintOrderBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | QueryWrapper<EimsMaintOrder> qw = Wrappers.query(); |
| | | qw.like(StringUtils.isNotBlank(bo.getMaintCode()),"mo.maint_code", bo.getMaintCode()); |
| | | qw.like(bo.getEquName() != null, "equ.equ_name", bo.getEquName()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getMaintType()), "mo.maint_type", bo.getMaintType()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getMaintCycleUnit()), "mo.maint_cycle_unit", bo.getMaintCycleUnit()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getMaintRule()), "mo.maint_rule", bo.getMaintRule()); |
| | | qw.eq(bo.getMaintUser() != null, "mo.maint_user", bo.getMaintUser()); |
| | | qw.in(bo.getMaintDept() != null, "mo.maint_dept", getAllDescendantIds(bo.getMaintDept())); |
| | | qw.eq(bo.getStatus() != null, "mo.status", bo.getStatus()); |
| | | qw.orderByDesc("mo.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); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private LambdaQueryWrapper<EimsMaintOrder> buildQueryWrapper(EimsMaintOrderBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<EimsMaintOrder> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(bo.getEquId() != null, EimsMaintOrder::getEquId, bo.getEquId()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getMaintType()), EimsMaintOrder::getMaintType, bo.getMaintType()); |
| | | lqw.eq(bo.getMaintCycle() != null, EimsMaintOrder::getMaintCycle, bo.getMaintCycle()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getMaintCycleUnit()), EimsMaintOrder::getMaintCycleUnit, bo.getMaintCycleUnit()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getMaintRule()), EimsMaintOrder::getMaintRule, bo.getMaintRule()); |
| | | lqw.eq(bo.getMaintUser() != null, EimsMaintOrder::getMaintUser, bo.getMaintUser()); |
| | | lqw.eq(bo.getMaintDept() != null, EimsMaintOrder::getMaintDept, bo.getMaintDept()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getMaintCode()), EimsMaintOrder::getMaintCode, bo.getMaintCode()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), EimsMaintOrder::getStatus, bo.getStatus()); |
| | | lqw.eq(bo.getPlanTime() != null, EimsMaintOrder::getPlanTime, bo.getPlanTime()); |
| | | lqw.eq(bo.getPlanId() != null, EimsMaintOrder::getPlanId, bo.getPlanId()); |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿å
Ȍᴌ |
| | | * |
| | | * @param bo ä¿å
Ȍᴌ |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | @Override |
| | | public Boolean insertByBo(EimsMaintOrderBo bo) { |
| | | EimsMaintOrder add = MapstructUtils.convert(bo, EimsMaintOrder.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | | bo.setId(add.getId()); |
| | | |
| | | //çæä¿å
»æç» |
| | | Long equId = bo.getEquId(); |
| | | List<EimsMaintStandVo> standList = standMapper.selectVoList(new LambdaQueryWrapper<EimsMaintStand>().eq(EimsMaintStand::getEquId, equId)); |
| | | //TODO 没æä¿å
»é¡¹ï¼æ·»å å¼å¸¸è®°å½ |
| | | for (int j = 0; j < standList.size(); j++) { |
| | | EimsMaintStandVo stand = standList.get(j); |
| | | EimsMaintOrditm itm = new EimsMaintOrditm(); |
| | | itm.setOrderId(bo.getId()); |
| | | itm.setEquId(equId); |
| | | itm.setItmName(stand.getName()); |
| | | itm.setItmAction(stand.getStand()); |
| | | itm.setItmUser(bo.getMaintUser()); |
| | | orditmMapper.insert(itm); |
| | | } |
| | | |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
Ȍᴌ |
| | | * |
| | | * @param bo ä¿å
Ȍᴌ |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @SneakyThrows |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public Boolean updateByBo(EimsMaintOrderBo bo) { |
| | | EimsMaintOrder update = MapstructUtils.convert(bo, EimsMaintOrder.class); |
| | | |
| | | EimsMaintOrder old = baseMapper.selectById(bo.getId()); |
| | | |
| | | // ä¿å
»ç¶æåæ´å¾
å®¡æ ¸æ¶éè¦æ ¡éªä¿å
»é¡¹æ°æ® |
| | | if(old.getStatus().equals(DictConstants.MAINT_ORDER_STATUS_DETAIL.BAOYANG)&&bo.getStatus().equals(DictConstants.MAINT_ORDER_STATUS_DETAIL.DAIYANZHENG)){ |
| | | LambdaQueryWrapper<EimsMaintOrditm> itmQueryWrapper = Wrappers.lambdaQuery(); |
| | | itmQueryWrapper.eq(EimsMaintOrditm::getOrderId, bo.getId()); |
| | | List<EimsMaintOrditm> eimsMaintOrditms = orditmMapper.selectList(itmQueryWrapper); |
| | | List<EimsMaintOrditm> wwc = eimsMaintOrditms.stream().filter(item->!item.getStatus().equals(DictConstants.EIMS_ORDITM_STATUS_DETAIL.YIWANCHENG)).toList(); |
| | | if(!wwc.isEmpty()){ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | validEntityBeforeSave(update); |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(EimsMaintOrder entity){ |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ä¿å
»å·¥åä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if(isValid){ |
| | | //TODO åä¸äºä¸å¡ä¸çæ ¡éª,夿æ¯å¦éè¦æ ¡éª |
| | | } |
| | | return baseMapper.deleteByIds(ids) > 0; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String selectMaintOrderCodeByIds(String orderIds) { |
| | | List<String> list = new ArrayList<>(); |
| | | for (Long id : StringUtils.splitTo(orderIds, Convert::toLong)) { |
| | | EimsMaintOrderVo vo = SpringUtils.getAopProxy(this).queryById(id); |
| | | if (ObjectUtil.isNotNull(vo)) { |
| | | list.add(vo.getMaintCode()); |
| | | } |
| | | } |
| | | return String.join(StringUtils.SEPARATOR, list); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service.impl; |
| | | |
| | | 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.EimsMaintOrder; |
| | | import org.dromara.eims.mapper.EimsMaintOrderMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.bo.EimsMaintOrditmBo; |
| | | import org.dromara.eims.domain.vo.EimsMaintOrditmVo; |
| | | import org.dromara.eims.domain.EimsMaintOrditm; |
| | | import org.dromara.eims.mapper.EimsMaintOrditmMapper; |
| | | import org.dromara.eims.service.IEimsMaintOrditmService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * 工忡ç®Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-10 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class EimsMaintOrditmServiceImpl implements IEimsMaintOrditmService { |
| | | |
| | | private final EimsMaintOrditmMapper baseMapper; |
| | | private final EimsMaintOrderMapper orderMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥åæ¡ç® |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return å·¥åæ¡ç® |
| | | */ |
| | | @Override |
| | | public EimsMaintOrditmVo queryById(Long id){ |
| | | return baseMapper.selectVoById(id); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢å·¥åæ¡ç®å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return 工忡ç®å页å表 |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsMaintOrditmVo> queryPageList(EimsMaintOrditmBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<EimsMaintOrditm> lqw = buildQueryWrapper(bo); |
| | | Page<EimsMaintOrditmVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶ç工忡ç®å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return 工忡ç®å表 |
| | | */ |
| | | @Override |
| | | public List<EimsMaintOrditmVo> queryList(EimsMaintOrditmBo bo) { |
| | | LambdaQueryWrapper<EimsMaintOrditm> lqw = buildQueryWrapper(bo); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<EimsMaintOrditm> buildQueryWrapper(EimsMaintOrditmBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<EimsMaintOrditm> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(bo.getOrderId() != null, EimsMaintOrditm::getOrderId, bo.getOrderId()); |
| | | lqw.eq(bo.getEquId() != null, EimsMaintOrditm::getEquId, bo.getEquId()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getItmName()), EimsMaintOrditm::getItmName, bo.getItmName()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getItmAction()), EimsMaintOrditm::getItmAction, bo.getItmAction()); |
| | | lqw.eq(bo.getItmUser() != null, EimsMaintOrditm::getItmUser, bo.getItmUser()); |
| | | lqw.eq(bo.getItmTime() != null, EimsMaintOrditm::getItmTime, bo.getItmTime()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), EimsMaintOrditm::getStatus, bo.getStatus()); |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å·¥åæ¡ç® |
| | | * |
| | | * @param bo å·¥åæ¡ç® |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | @Override |
| | | public Boolean insertByBo(EimsMaintOrditmBo bo) { |
| | | EimsMaintOrditm add = MapstructUtils.convert(bo, EimsMaintOrditm.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | | bo.setId(add.getId()); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å·¥åæ¡ç® |
| | | * |
| | | * @param bo å·¥åæ¡ç® |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public Boolean updateByBo(EimsMaintOrditmBo bo) { |
| | | EimsMaintOrditm update = MapstructUtils.convert(bo, EimsMaintOrditm.class); |
| | | // 宿工åæç»åæ¥ä¿®æ¹å·¥åç¶æ |
| | | //1.ç¬¬ä¸æ¬¡å®æä¿å
»å·¥åæç»æä¿å
»å·¥åç¶æä¿®æ¹ä¸º ä¿å
»ä¸ |
| | | Long orderId = bo.getOrderId(); |
| | | EimsMaintOrder order = orderMapper.selectById(orderId); |
| | | if(bo.getStatus().equals(DictConstants.EIMS_ORDITM_STATUS_DETAIL.YIWANCHENG)){ |
| | | //没æå®ææ¶é´èªå¨æ·»å 宿æ¶é´ |
| | | if(bo.getItmTime()==null){ |
| | | update.setItmTime(new Date()); |
| | | } |
| | | if(order.getStatus().equals(DictConstants.MAINT_ORDER_STATUS_DETAIL.DAIBAOYANG)){ |
| | | order.setStatus(DictConstants.MAINT_ORDER_STATUS_DETAIL.BAOYANG); |
| | | if(order.getStartTime()==null){ |
| | | order.setStartTime(new Date()); |
| | | } |
| | | orderMapper.updateById(order); |
| | | } |
| | | } |
| | | validEntityBeforeSave(update); |
| | | boolean flag = baseMapper.updateById(update) > 0; |
| | | //2.æ¥è¯¢ææä¿å
»é¡¹æ¯å¦é½å·²å®æ |
| | | LambdaQueryWrapper<EimsMaintOrditm> queryWrapper = Wrappers.lambdaQuery(); |
| | | queryWrapper.eq(EimsMaintOrditm::getOrderId, bo.getOrderId()); |
| | | List<EimsMaintOrditm> eimsMaintOrditms = baseMapper.selectList(queryWrapper); |
| | | List<EimsMaintOrditm> wwc = eimsMaintOrditms.stream().filter(item->!item.getStatus().equals(DictConstants.EIMS_ORDITM_STATUS_DETAIL.YIWANCHENG)).toList(); |
| | | if(wwc.isEmpty()){ |
| | | order.setStatus(DictConstants.MAINT_ORDER_STATUS_DETAIL.DAIYANZHENG); |
| | | orderMapper.updateById(order); |
| | | } |
| | | |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(EimsMaintOrditm 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.constant.DictConstants; |
| | | 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.vo.EimsRepairResVo; |
| | | 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.EimsMaintPlanBo; |
| | | import org.dromara.eims.domain.vo.EimsMaintPlanVo; |
| | | import org.dromara.eims.domain.EimsMaintPlan; |
| | | import org.dromara.eims.mapper.EimsMaintPlanMapper; |
| | | import org.dromara.eims.service.IEimsMaintPlanService; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * ä¿å
»è®¡åServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-04 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class EimsMaintPlanServiceImpl implements IEimsMaintPlanService { |
| | | |
| | | private final EimsMaintPlanMapper baseMapper; |
| | | private final SysDeptMapper sysDeptMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»è®¡å |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return ä¿å
»è®¡å |
| | | */ |
| | | @Override |
| | | public EimsMaintPlanVo queryById(Long id) { |
| | | return baseMapper.selectVoById(id); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ä¿å
»è®¡åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ä¿å
»è®¡åå页å表 |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsMaintPlanVo> queryPageList(EimsMaintPlanBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<EimsMaintPlan> lqw = buildQueryWrapper(bo); |
| | | Page<EimsMaintPlanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | @Override |
| | | public TableDataInfo<EimsMaintPlanVo> queryPageListCustom(EimsMaintPlanBo bo, PageQuery pageQuery) { |
| | | Page<EimsMaintPlanVo> page = baseMapper.selectMaintPlanList(pageQuery.build(), buildWrapper(bo)); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çä¿å
»è®¡åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ä¿å
»è®¡åå表 |
| | | */ |
| | | @Override |
| | | public List<EimsMaintPlanVo> queryList(EimsMaintPlanBo bo) { |
| | | LambdaQueryWrapper<EimsMaintPlan> lqw = buildQueryWrapper(bo); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<EimsMaintPlan> buildQueryWrapper(EimsMaintPlanBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<EimsMaintPlan> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(bo.getEquId() != null, EimsMaintPlan::getEquId, bo.getEquId()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getMaintType()), EimsMaintPlan::getMaintType, bo.getMaintType()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getMaintCycleUnit()), EimsMaintPlan::getMaintCycleUnit, bo.getMaintCycleUnit()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getMaintRule()), EimsMaintPlan::getMaintRule, bo.getMaintRule()); |
| | | lqw.eq(bo.getMaintUser() != null, EimsMaintPlan::getMaintUser, bo.getMaintUser()); |
| | | lqw.eq(bo.getMaintDept() != null, EimsMaintPlan::getMaintDept, bo.getMaintDept()); |
| | | lqw.eq(bo.getStatus() != null, EimsMaintPlan::getStatus, bo.getStatus()); |
| | | return lqw; |
| | | } |
| | | |
| | | private QueryWrapper<EimsMaintPlan> buildWrapper(EimsMaintPlanBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | QueryWrapper<EimsMaintPlan> qw = Wrappers.query(); |
| | | qw.eq(bo.getEquId() != null, "mp.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.getMaintType()), "mp.maint_type", bo.getMaintType()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getMaintCycleUnit()), "mp.maint_cycle_unit", bo.getMaintCycleUnit()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getMaintRule()), "mp.maint_rule", bo.getMaintRule()); |
| | | qw.eq(bo.getMaintUser() != null, "mp.maint_user", bo.getMaintUser()); |
| | | qw.in(bo.getMaintDept() != null, "mp.maint_dept", getAllDescendantIds(bo.getMaintDept())); |
| | | qw.eq(bo.getStatus() != null, "mp.status", bo.getStatus()); |
| | | 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(EimsMaintPlanBo bo) { |
| | | setMaintNextTime(bo); |
| | | EimsMaintPlan add = MapstructUtils.convert(bo, EimsMaintPlan.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | | bo.setId(add.getId()); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * 计ç®ä¿å
»è®¡å䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | @SneakyThrows |
| | | private void setMaintNextTime(EimsMaintPlanBo bo) { |
| | | Date maintFirstTime = bo.getMaintFirstTime(); |
| | | Date maintLastTime = bo.getMaintLastTime(); |
| | | //䏿¬¡ä¿å
»æ¶é´è®¡ç®è§å 0-æåºå®å¨æ 1-æä¸æ¬¡ä¿å
»æ¶é´ |
| | | Date nextDate = (maintLastTime != null && bo.getMaintRule().equals(DictConstants.MAINT_TIME_RULE_DETAIL.LAST)) ? maintLastTime :maintFirstTime; |
| | | |
| | | //馿¬¡æ§è¡æ¶é´ä¸ºç©ºæåºå¼å¸¸ |
| | | if (maintFirstTime == null) { |
| | | throw new Exception("馿¬¡æ§è¡æ¶é´ä¸è½ä¸ºç©º!"); |
| | | } |
| | | //卿 |
| | | Long maintCycle = bo.getMaintCycle(); |
| | | //åä½ 1-天 2-å¨ 3-æ 4-å£ 5-å¹´ |
| | | String maintCycleUnit = bo.getMaintCycleUnit(); |
| | | switch (maintCycleUnit) { |
| | | case "1": |
| | | nextDate = DateUtils.addDays(nextDate, maintCycle.intValue()); |
| | | break; |
| | | case "2": |
| | | nextDate = DateUtils.addWeeks(nextDate, maintCycle.intValue()); |
| | | break; |
| | | case "3": |
| | | nextDate = DateUtils.addMonths(nextDate, maintCycle.intValue()); |
| | | break; |
| | | case "4": |
| | | nextDate = DateUtils.addMonths(nextDate, maintCycle.intValue() * 3); |
| | | break; |
| | | case "5": |
| | | nextDate = DateUtils.addYears(nextDate, maintCycle.intValue()); |
| | | break; |
| | | |
| | | } |
| | | bo.setMaintNextTime(nextDate); |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
»è®¡å |
| | | * |
| | | * @param bo ä¿å
»è®¡å |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @Override |
| | | public Boolean updateByBo(EimsMaintPlanBo bo) { |
| | | //setMaintNextTime(bo); |
| | | EimsMaintPlan update = MapstructUtils.convert(bo, EimsMaintPlan.class); |
| | | validEntityBeforeSave(update); |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(EimsMaintPlan 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 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.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.bo.EimsMaintStandBo; |
| | | import org.dromara.eims.domain.vo.EimsMaintStandVo; |
| | | import org.dromara.eims.domain.EimsMaintStand; |
| | | import org.dromara.eims.mapper.EimsMaintStandMapper; |
| | | import org.dromara.eims.service.IEimsMaintStandService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * ä¿å
»æ åServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-03-04 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class EimsMaintStandServiceImpl implements IEimsMaintStandService { |
| | | |
| | | private final EimsMaintStandMapper baseMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢ä¿å
»æ å |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return ä¿å
»æ å |
| | | */ |
| | | @Override |
| | | public EimsMaintStandVo queryById(Long id){ |
| | | return baseMapper.selectVoById(id); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ä¿å
»æ åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ä¿å
»æ åå页å表 |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsMaintStandVo> queryPageList(EimsMaintStandBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<EimsMaintStand> lqw = buildQueryWrapper(bo); |
| | | Page<EimsMaintStandVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çä¿å
»æ åå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ä¿å
»æ åå表 |
| | | */ |
| | | @Override |
| | | public List<EimsMaintStandVo> queryList(EimsMaintStandBo bo) { |
| | | LambdaQueryWrapper<EimsMaintStand> lqw = buildQueryWrapper(bo); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<EimsMaintStand> buildQueryWrapper(EimsMaintStandBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<EimsMaintStand> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(bo.getEquId() != null, EimsMaintStand::getEquId, bo.getEquId()); |
| | | lqw.eq(bo.getEquTypeId() != null, EimsMaintStand::getEquTypeId, bo.getEquTypeId()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getAssetNo()), EimsMaintStand::getAssetNo, bo.getAssetNo()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getEquName()), EimsMaintStand::getEquName, bo.getEquName()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getModelNo()), EimsMaintStand::getModelNo, bo.getModelNo()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getName()), EimsMaintStand::getName, bo.getName()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getStand()), EimsMaintStand::getStand, bo.getStand()); |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿å
»æ å |
| | | * |
| | | * @param bo ä¿å
»æ å |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | @Override |
| | | public Boolean insertByBo(EimsMaintStandBo bo) { |
| | | EimsMaintStand add = MapstructUtils.convert(bo, EimsMaintStand.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | | bo.setId(add.getId()); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å
»æ å |
| | | * |
| | | * @param bo ä¿å
»æ å |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @Override |
| | | public Boolean updateByBo(EimsMaintStandBo bo) { |
| | | EimsMaintStand update = MapstructUtils.convert(bo, EimsMaintStand.class); |
| | | validEntityBeforeSave(update); |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(EimsMaintStand 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 lombok.RequiredArgsConstructor; |
| | | import org.dromara.common.core.constant.CacheConstants; |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.common.redis.utils.RedisUtils; |
| | | import org.dromara.eims.service.IGenerateCodeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class GenerateCodeServiceImpl implements IGenerateCodeService { |
| | | @Override |
| | | public String generateCode(String prefix) { |
| | | String key = CacheConstants.EIMS_GENERATE_CODE + ":" + prefix; |
| | | String todayStr = DateTimeFormatter.ofPattern("yyyyMMdd").format(LocalDate.now()); |
| | | String code; |
| | | // 使ç¨Redisçååæ§æä½é¿å
å¹¶åé®é¢ |
| | | String oldCode = RedisUtils.getCacheObject(key); |
| | | if (oldCode != null && oldCode.contains(todayStr)) { |
| | | int no = Integer.parseInt(oldCode.substring(oldCode.length() - 4)); |
| | | code = String.format("%s%s%04d", prefix, todayStr, no + 1); |
| | | } else { |
| | | code = String.format("%s%s%04d", prefix, todayStr, 1); |
| | | } |
| | | |
| | | // æ´æ°ç¼å |
| | | try { |
| | | RedisUtils.setCacheObject(key, code); |
| | | return code; |
| | | } catch (Exception e) { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.EimsMaintOrderMapper"> |
| | | <resultMap type="org.dromara.eims.domain.vo.EimsMaintOrderVo" id="EimsMaintOrderResult"> |
| | | </resultMap> |
| | | <select id="selectMaintOrderList" resultMap="EimsMaintOrderResult"> |
| | | SELECT mo.*,equ.equ_name equName,equ.equ_code equCode,equ.asset_no assetNo,equ.model_no modelNo,mo.create_time createTime, |
| | | us.nick_name maintUserName,dp.dept_name maintDeptName,ue.nick_name verifyUserName, |
| | | CONCAT_WS('', mo.maint_cycle, dd.dict_label) maintCycleUnitName |
| | | FROM eims_maint_order mo |
| | | LEFT JOIN eims_equ equ ON mo.equ_id = equ.equ_id |
| | | LEFT JOIN sys_user us ON mo.maint_user = us.user_id |
| | | LEFT JOIN sys_user ue ON mo.verify_user = ue.user_id |
| | | LEFT JOIN sys_dept dp ON mo.maint_dept = dp.dept_id |
| | | LEFT JOIN sys_dict_data dd on dd.dict_type = 'maint_cycle_unit' and dd.dict_value = mo.maint_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.EimsMaintOrditmMapper"> |
| | | |
| | | </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.EimsMaintPlanMapper"> |
| | | <resultMap type="org.dromara.eims.domain.vo.EimsMaintPlanVo" id="EimsMaintPlanResult"> |
| | | </resultMap> |
| | | <select id="selectMaintPlanList" resultMap="EimsMaintPlanResult"> |
| | | SELECT mp.*,equ.equ_name equName,equ.equ_code equCode,equ.asset_no assetNo,equ.model_no modelNo, |
| | | us.nick_name maintUserName,dp.dept_name maintDeptName, |
| | | CONCAT_WS('', mp.maint_cycle, dd.dict_label) maintCycleUnitName |
| | | FROM eims_maint_plan mp |
| | | LEFT JOIN eims_equ equ ON mp.equ_id = equ.equ_id |
| | | LEFT JOIN sys_user us ON mp.maint_user = us.user_id |
| | | LEFT JOIN sys_dept dp ON mp.maint_dept = dp.dept_id |
| | | LEFT JOIN sys_dict_data dd on dd.dict_type = 'maint_cycle_unit' and dd.dict_value = mp.maint_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.EimsMaintStandMapper"> |
| | | |
| | | </mapper> |