已添加31个文件
已复制2个文件
已重命名13个文件
已删除3个文件
已修改7个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { EquStatuVO } from './model'; |
| | | |
| | | import type { ID, IDS } from '#/api/common'; |
| | | |
| | | import { commonExport } from '#/api/helper'; |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | enum Api { |
| | | equStatuExport = '/eims/equStatu/export', |
| | | equStatuList = '/eims/equStatu/list', |
| | | root = '/eims/equStatu' |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤ç¶æè®°å½å表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export function listEquStatu(params?: any) { |
| | | return requestClient.get<EquStatuVO[]>(Api.equStatuList, { params }); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤ç¶æè®°å½è¯¦ç» |
| | | * @param statuId |
| | | */ |
| | | export function getEquStatu(statuId: ID) { |
| | | return requestClient.get<EquStatuVO>(`${Api.root}/${statuId}`); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤ç¶æè®°å½ |
| | | * @param data |
| | | */ |
| | | export function addEquStatu(data: any) { |
| | | return requestClient.postWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤ç¶æè®°å½ |
| | | * @param data |
| | | */ |
| | | export function updateEquStatu(data: any) { |
| | | return requestClient.putWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è®¾å¤ç¶æè®°å½ |
| | | * @param statuId |
| | | */ |
| | | export function delEquStatu(statuId: IDS) { |
| | | return requestClient.deleteWithMsg<void>(`${Api.root}/${statuId}`); |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | * @param |
| | | */ |
| | | export function equStatuExport(data: any) { |
| | | return commonExport(Api.equStatuExport, data); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface EquStatuVO { |
| | | /** |
| | | * 设å¤ç¶æè®°å½id |
| | | */ |
| | | equStatuId: string | number; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | equId: string | number; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | beforeChange: string; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | afterChange: string; |
| | | |
| | | /** |
| | | * åæ´æ¥æ |
| | | */ |
| | | changeDate: string; |
| | | |
| | | /** |
| | | * åæ´äºº |
| | | */ |
| | | changeUser: number; |
| | | |
| | | /** |
| | | * åæ´äººé¨é¨ |
| | | */ |
| | | userDept: number; |
| | | |
| | | /** |
| | | * åæ´æè¿° |
| | | */ |
| | | changeDesc: string; |
| | | |
| | | /** |
| | | * æè¿° |
| | | */ |
| | | remark: string; |
| | | |
| | | } |
| | | |
| | | export interface EquStatuForm extends BaseEntity { |
| | | /** |
| | | * 设å¤ç¶æè®°å½id |
| | | */ |
| | | equStatuId?: string | number; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | equId?: string | number; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | beforeChange?: string; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | afterChange?: string; |
| | | |
| | | /** |
| | | * åæ´æ¥æ |
| | | */ |
| | | changeDate?: string; |
| | | |
| | | /** |
| | | * åæ´äºº |
| | | */ |
| | | changeUser?: number; |
| | | |
| | | /** |
| | | * åæ´äººé¨é¨ |
| | | */ |
| | | userDept?: number; |
| | | |
| | | /** |
| | | * åæ´æè¿° |
| | | */ |
| | | changeDesc?: string; |
| | | |
| | | /** |
| | | * æè¿° |
| | | */ |
| | | remark?: string; |
| | | |
| | | } |
| | | |
| | | export interface EquStatuQuery extends PageQuery { |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | equId?: string | number; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | beforeChange?: string; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | afterChange?: string; |
| | | |
| | | /** |
| | | * åæ´æ¥æ |
| | | */ |
| | | changeDate?: string; |
| | | |
| | | /** |
| | | * åæ´äºº |
| | | */ |
| | | changeUser?: number; |
| | | |
| | | /** |
| | | * æ¥æèå´åæ° |
| | | */ |
| | | params?: any; |
| | | } |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { EquTrialVO } from './model'; |
| | | |
| | | import type { ID, IDS } from '#/api/common'; |
| | | |
| | | import { commonExport } from '#/api/helper'; |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | |
| | | enum Api { |
| | | equTrialExport = '/eims/equTrial/export', |
| | | equTrialList = '/eims/equTrial/list', |
| | | root = '/eims/equTrial' |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤è¯äº§è®°å½å表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export function listEquTrial(params?: any) { |
| | | return requestClient.get<EquTrialVO[]>(Api.equTrialList, { params }); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤è¯äº§è®°å½è¯¦ç» |
| | | * @param trialId |
| | | */ |
| | | export function getEquTrial(trialId: ID) { |
| | | return requestClient.get<EquTrialVO>(`${Api.root}/${trialId}`); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤è¯äº§è®°å½ |
| | | * @param data |
| | | */ |
| | | export function addEquTrial(data: any) { |
| | | return requestClient.postWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤è¯äº§è®°å½ |
| | | * @param data |
| | | */ |
| | | export function updateEquTrial(data: any) { |
| | | return requestClient.putWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è®¾å¤è¯äº§è®°å½ |
| | | * @param trialId |
| | | */ |
| | | export function delEquTrial(trialId: IDS) { |
| | | return requestClient.deleteWithMsg<void>(`${Api.root}/${trialId}`); |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | * @param |
| | | */ |
| | | export function equTrialExport(data: any) { |
| | | return commonExport(Api.equTrialExport, data); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface EquTrialVO { |
| | | /** |
| | | * è¯ç¨è®°å½id |
| | | */ |
| | | trialId: number | string; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | equId: number | string; |
| | | |
| | | /** |
| | | * è¯äº§æ°é |
| | | */ |
| | | trialNum: number; |
| | | |
| | | /** |
| | | * è¯äº§æ¥æ |
| | | */ |
| | | trialDate: string; |
| | | |
| | | /** |
| | | * è¯åæ°é |
| | | */ |
| | | proGoodNum: number; |
| | | |
| | | /** |
| | | * è¯åç |
| | | */ |
| | | proGoodRate: number; |
| | | |
| | | /** |
| | | * æä½äºº(id) |
| | | */ |
| | | operatorId: number | string; |
| | | |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | startTime: string; |
| | | |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | endTime: string; |
| | | |
| | | /** |
| | | * è¿è¡æ¶é¿ |
| | | */ |
| | | runTime: string; |
| | | |
| | | /** |
| | | * åæºæ¶é¿ |
| | | */ |
| | | stopTime: string; |
| | | |
| | | /** |
| | | * 计åè¿è¡æ¶é¿ |
| | | */ |
| | | planRunTime: string; |
| | | |
| | | /** |
| | | * è°è¯å±¥å |
| | | */ |
| | | debugHistory: string; |
| | | |
| | | /** |
| | | * 设å¤ç»¼åæç |
| | | */ |
| | | oee: number; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | } |
| | | |
| | | export interface EquTrialForm extends BaseEntity { |
| | | /** |
| | | * è¯ç¨è®°å½id |
| | | */ |
| | | trialId?: number | string; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | equId?: number | string; |
| | | |
| | | /** |
| | | * è¯äº§æ°é |
| | | */ |
| | | trialNum?: number; |
| | | |
| | | /** |
| | | * è¯äº§æ¥æ |
| | | */ |
| | | trialDate?: string; |
| | | |
| | | /** |
| | | * è¯åæ°é |
| | | */ |
| | | proGoodNum?: number; |
| | | |
| | | /** |
| | | * è¯åç |
| | | */ |
| | | proGoodRate?: number; |
| | | |
| | | /** |
| | | * æä½äºº(id) |
| | | */ |
| | | operatorId?: number | string; |
| | | |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | startTime?: string; |
| | | |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | endTime?: string; |
| | | |
| | | /** |
| | | * è¿è¡æ¶é¿ |
| | | */ |
| | | runTime?: string; |
| | | |
| | | /** |
| | | * åæºæ¶é¿ |
| | | */ |
| | | stopTime?: string; |
| | | |
| | | /** |
| | | * 计åè¿è¡æ¶é¿ |
| | | */ |
| | | planRunTime?: string; |
| | | |
| | | /** |
| | | * è°è¯å±¥å |
| | | */ |
| | | debugHistory?: string; |
| | | |
| | | /** |
| | | * 设å¤ç»¼åæç |
| | | */ |
| | | oee?: number; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark?: string; |
| | | } |
| | | |
| | | export interface EquTrialQuery extends PageQuery { |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | equId?: number | string; |
| | | |
| | | /** |
| | | * è¯äº§æ°é |
| | | */ |
| | | trialNum?: number; |
| | | |
| | | /** |
| | | * è¯äº§æ¥æ |
| | | */ |
| | | trialDate?: string; |
| | | |
| | | /** |
| | | * è¯åæ°é |
| | | */ |
| | | proGoodNum?: number; |
| | | |
| | | /** |
| | | * è¯åç |
| | | */ |
| | | proGoodRate?: number; |
| | | |
| | | /** |
| | | * æä½äºº(id) |
| | | */ |
| | | operatorId?: number | string; |
| | | |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | startTime?: string; |
| | | |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | endTime?: string; |
| | | |
| | | /** |
| | | * è¿è¡æ¶é¿ |
| | | */ |
| | | runTime?: string; |
| | | |
| | | /** |
| | | * åæºæ¶é¿ |
| | | */ |
| | | stopTime?: string; |
| | | |
| | | /** |
| | | * 计åè¿è¡æ¶é¿ |
| | | */ |
| | | planRunTime?: string; |
| | | |
| | | /** |
| | | * è°è¯å±¥å |
| | | */ |
| | | debugHistory?: string; |
| | | |
| | | /** |
| | | * 设å¤ç»¼åæç |
| | | */ |
| | | oee?: number; |
| | | |
| | | /** |
| | | * æ¥æèå´åæ° |
| | | */ |
| | | params?: any; |
| | | } |
| | |
| | | |
| | | import { getEqu } from '#/api/eims/equ'; |
| | | import equDrawer from '#/views/eims/equ/equ-drawer.vue'; |
| | | import EquTrial from '#/views/eims/equ-trial/index.vue'; |
| | | import EquStatu from '#/views/eims/equ-statu/index.vue'; |
| | | |
| | | const route = useRoute(); |
| | | const equId = route.params.equId as string; |
| | |
| | | |
| | | <div class="w-3/4 min-w-[640px] flex align-center justify-around"> |
| | | <Divider class="h-full" type="vertical" /> |
| | | <div class="flex w-1/4 h-full cursor-pointer items-center justify-center rounded-sm hover:bg-gray-100" |
| | | style="background: #f2f6fe"> |
| | | <div class="flex w-1/4 h-full cursor-pointer items-center justify-center rounded-sm hover:bg-gray-100" style="background: #f2f6fe"> |
| | | <Image :preview="false" :width="40" src="/src/assets/logo.png" /> |
| | | <div class="flex flex-col ml-6 mr-2"> |
| | | <span class="text-xl font-bold">100%</span> |
| | | <span class="mt-5 text-gray-500">设å¤å¥åº·åº¦</span> |
| | | </div> |
| | | </div> |
| | | <div class="flex w-1/4 h-full cursor-pointer items-center justify-center rounded-sm hover:bg-gray-100" |
| | | style="background: #fcf8ee"> |
| | | <div class="flex w-1/4 h-full cursor-pointer items-center justify-center rounded-sm hover:bg-gray-100" style="background: #fcf8ee"> |
| | | <Image :preview="false" :width="40" src="/src/assets/logo.png" /> |
| | | <div class="flex flex-col ml-6 mr-2"> |
| | | <span class="text-xl font-bold">86.6h</span> |
| | | <span class="mt-5 text-gray-500">å¹³åæ
éæ¶é´</span> |
| | | </div> |
| | | </div> |
| | | <div class="flex w-1/4 h-full cursor-pointer items-center justify-center rounded-sm hover:bg-gray-100" |
| | | style="background: #ecf5de"> |
| | | <div class="flex w-1/4 h-full cursor-pointer items-center justify-center rounded-sm hover:bg-gray-100" style="background: #ecf5de"> |
| | | <Image :preview="false" :width="40" src="/src/assets/logo.png" /> |
| | | <div class="flex flex-col ml-6 mr-2"> |
| | | <span class="text-xl font-bold">0å
</span> |
| | |
| | | <Descriptions class="mt-3" size="small" title="设å¤å¾ç"> |
| | | <DescriptionsItem> |
| | | <ImagePreviewGroup> |
| | | <Image :width="200" |
| | | src="https://shlanpu.cn/uploads/images/202404/ebb24dc0610cf8e83a19fb0f568bf530.png" /> |
| | | <Image :width="200" |
| | | src="https://shlanpu.cn/uploads/images/202404/c2212b8fc38bdd20e9d1cf79da40698d.jpg" /> |
| | | <Image :width="200" src="https://shlanpu.cn/uploads/images/202404/ebb24dc0610cf8e83a19fb0f568bf530.png" /> |
| | | <Image :width="200" src="https://shlanpu.cn/uploads/images/202404/c2212b8fc38bdd20e9d1cf79da40698d.jpg" /> |
| | | </ImagePreviewGroup> |
| | | </DescriptionsItem> |
| | | </Descriptions> |
| | |
| | | <TabPane key="3" tab="ä¿å
»">Content of Tab Pane 3</TabPane> |
| | | <TabPane key="4" tab="ç¹æ£">Content of Tab Pane 3</TabPane> |
| | | <TabPane key="5" tab="å¤ä»¶">Content of Tab Pane 3</TabPane> |
| | | <TabPane key="5" tab="éä»¶">Content of Tab Pane 3</TabPane> |
| | | <TabPane key="6" tab="设å¤å±¥å">Content of Tab Pane 3</TabPane> |
| | | <TabPane key="7" tab="è¯äº§è®°å½">Content of Tab Pane 3</TabPane> |
| | | <TabPane key="8" tab="ç¶æè®°å½">Content of Tab Pane 3</TabPane> |
| | | <TabPane key="6" tab="éä»¶">Content of Tab Pane 3</TabPane> |
| | | <TabPane key="7" tab="设å¤å±¥å">Content of Tab Pane 3</TabPane> |
| | | <TabPane key="8" tab="è¯äº§è®°å½"> |
| | | <EquTrial :equ-detail-flag="true" :equ-id="equId" /> |
| | | </TabPane> |
| | | <TabPane key="9" tab="ç¶æè®°å½"> |
| | | <EquStatu :equ-detail-flag="true" :equ-id="equId" /> |
| | | </TabPane> |
| | | </Tabs> |
| | | </Card> |
| | | </div> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { VxeGridProps } from '#/adapter/vxe-table'; |
| | | import type { DescItem } from '#/components/description'; |
| | | |
| | | import { DictEnum } from '@vben/constants'; |
| | | import { getPopupContainer } from '@vben/utils'; |
| | | |
| | | import { Tag } from 'ant-design-vue'; |
| | | |
| | | import { type FormSchemaGetter } from '#/adapter/form'; |
| | | import { getDictOptions } from '#/utils/dict'; |
| | | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | showSearch: true, |
| | | allowClear: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'equId', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | | component: 'RangePicker', |
| | | fieldName: 'changeDate', |
| | | label: 'åæ´æ¥æ' |
| | | } |
| | | ]; |
| | | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | | { type: 'checkbox', width: 60, fixed: 'left' }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | field: 'equName', |
| | | minWidth: 100, |
| | | fixed: 'left', |
| | | slots: { default: 'equName' } |
| | | }, |
| | | { |
| | | title: 'åæ´æ¥æ', |
| | | field: 'changeDate', |
| | | sortable: true, |
| | | minWidth: 180 |
| | | }, |
| | | { |
| | | title: 'åæ´å', |
| | | field: 'beforeChange', |
| | | sortable: true, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | const statu = row.beforeChange; |
| | | switch (statu) { |
| | | case '0': { |
| | | return <Tag color="cyan">è¯ç¨</Tag>; |
| | | } |
| | | case '1': { |
| | | return <Tag color="green">å
¥åº</Tag>; |
| | | } |
| | | case '2': { |
| | | return <Tag color="orange">è¿ç§»</Tag>; |
| | | } |
| | | case '3': { |
| | | return <Tag color="red">æ¥åº</Tag>; |
| | | } |
| | | case null: { |
| | | return ''; |
| | | } |
| | | // No default |
| | | } |
| | | return ''; |
| | | } |
| | | }, |
| | | minWidth: 80, |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: 'åæ´å', |
| | | field: 'afterChange', |
| | | sortable: true, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | const statu = row.afterChange; |
| | | switch (statu) { |
| | | case '0': { |
| | | return <Tag color="cyan">è¯ç¨</Tag>; |
| | | } |
| | | case '1': { |
| | | return <Tag color="green">å
¥åº</Tag>; |
| | | } |
| | | case '2': { |
| | | return <Tag color="orange">è¿ç§»</Tag>; |
| | | } |
| | | case '3': { |
| | | return <Tag color="red">æ¥åº</Tag>; |
| | | } |
| | | case null: { |
| | | return ''; |
| | | } |
| | | // No default |
| | | } |
| | | return ''; |
| | | } |
| | | }, |
| | | minWidth: 80, |
| | | fixed: 'left' |
| | | }, |
| | | |
| | | { |
| | | title: 'åæ´æè¿°', |
| | | field: 'changeDesc', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | title: 'åæ´äºº', |
| | | field: 'changeUserName', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | field: 'action', |
| | | fixed: 'right', |
| | | slots: { default: 'action' }, |
| | | title: 'æä½', |
| | | width: 200 |
| | | } |
| | | ]; |
| | | |
| | | export const drawerSchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Input', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'equStatuId' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | showSearch: true, |
| | | allowClear: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'equId', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD', |
| | | showTime: false, |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'changeDate', |
| | | label: 'åæ´æ¥æ' |
| | | }, |
| | | { |
| | | component: 'TreeSelect', |
| | | // å¨draweréæ´æ° è¿éä¸éè¦é»è®¤çcomponentProps |
| | | defaultValue: undefined, |
| | | fieldName: 'userDept', |
| | | label: 'åæ´äººé¨é¨', |
| | | help: `åæ´äººåæå±é¨é¨` |
| | | // rules: 'selectRequired', |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | showSearch: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'changeUser', |
| | | label: 'åæ´äºº', |
| | | help: `设å¤ç¶æåæ´æä½äººå` |
| | | }, |
| | | { |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | options: getDictOptions(DictEnum.SYS_EQU_STATUS), |
| | | optionType: 'button' |
| | | }, |
| | | fieldName: 'beforeChange', |
| | | label: 'åæ´å', |
| | | help: '设å¤åæ´åç¶æ' |
| | | }, |
| | | { |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | options: getDictOptions(DictEnum.SYS_EQU_STATUS), |
| | | optionType: 'button' |
| | | }, |
| | | fieldName: 'afterChange', |
| | | label: 'åæ´å', |
| | | help: '设å¤åæ´åç¶æ' |
| | | }, |
| | | { |
| | | component: 'Textarea', |
| | | fieldName: 'changeDesc', |
| | | label: 'åæ´æè¿°' |
| | | } |
| | | ]; |
| | | |
| | | export const descSchema: DescItem[] = [ |
| | | { |
| | | field: 'equName', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | | field: 'beforeChange', |
| | | label: 'åæ´å', |
| | | render(value) { |
| | | switch (value) { |
| | | case '0': { |
| | | return <Tag color="cyan">è¯ç¨</Tag>; |
| | | } |
| | | case '1': { |
| | | return <Tag color="green">å
¥åº</Tag>; |
| | | } |
| | | case '2': { |
| | | return <Tag color="orange">è¿ç§»</Tag>; |
| | | } |
| | | case '3': { |
| | | return <Tag color="red">æ¥åº</Tag>; |
| | | } |
| | | case null: { |
| | | return ''; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | field: 'afterChange', |
| | | label: 'åæ´å', |
| | | render(value) { |
| | | switch (value) { |
| | | case '0': { |
| | | return <Tag color="cyan">è¯ç¨</Tag>; |
| | | } |
| | | case '1': { |
| | | return <Tag color="green">å
¥åº</Tag>; |
| | | } |
| | | case '2': { |
| | | return <Tag color="orange">è¿ç§»</Tag>; |
| | | } |
| | | case '3': { |
| | | return <Tag color="red">æ¥åº</Tag>; |
| | | } |
| | | case null: { |
| | | return ''; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | field: 'changeDate', |
| | | label: 'åæ´æ¥æ' |
| | | }, |
| | | { |
| | | field: 'changeDesc', |
| | | label: 'åæ´æè¿°' |
| | | }, |
| | | { |
| | | field: 'changeUserName', |
| | | label: 'åæ´äºº' |
| | | } |
| | | ]; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import { computed, ref } from 'vue'; |
| | | |
| | | import { useVbenDrawer } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { addFullName, cloneDeep, getPopupContainer } from '@vben/utils'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { listEqu } from '#/api/eims/equ'; |
| | | import { addEquStatu, getEquStatu, updateEquStatu } from '#/api/eims/equ-statu'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | |
| | | 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; |
| | | // åå§å |
| | | await setupEquSelect(); |
| | | await setupDeptSelect(); |
| | | |
| | | // 设å¤è¯¦æ
页æå¼æå®è®¾å¤id |
| | | const { equId } = drawerApi.getData() as { equId?: number | string }; |
| | | if (equId) { |
| | | await formApi.setValues({ equId}); |
| | | } |
| | | // æ´æ° && èµå¼ |
| | | if (isUpdate.value && id) { |
| | | const record = await getEquStatu(id); |
| | | await formApi.setValues(record); |
| | | } |
| | | // 设å¤idæå¼æ¶ä¸å
许ç¼è¾ï¼1.ç¼è¾ 2.设å¤è¯¦æ
页æå¼ï¼ |
| | | const flag = equId !== undefined || isUpdate.value; |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: { |
| | | disabled: flag |
| | | }, |
| | | fieldName: 'equId' |
| | | } |
| | | ]); |
| | | |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | }); |
| | | |
| | | async function setupEquSelect() { |
| | | const equPageResult = await listEqu({ |
| | | pageNum: 1, |
| | | pageSize: 1000, |
| | | }); |
| | | // 使ç¨mapæ¥è·è¸ªå·²ç»éå°çequIdï¼ä½¿ç¨filteræ¥è¿æ»¤æéå¤çå
ç´ ã |
| | | const uniqueItems = equPageResult.rows.filter((item, index, self) => index === self.findIndex((tm) => tm.equId === item.equId)); |
| | | |
| | | const options = uniqueItems.map((item) => ({ |
| | | label: item.equName || item.equName, |
| | | value: item.equId |
| | | })); |
| | | // çé |
| | | 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(equId: number | string) { |
| | | const equ = equPageResult.rows.find((item) => item.equId === equId); |
| | | if (equ && equ.status !== undefined) { |
| | | await formApi.setValues({ beforeChange: equ.status }); |
| | | } |
| | | } |
| | | }, |
| | | fieldName: 'equId' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ·çå è½½ |
| | | */ |
| | | 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 ? 'è¯·éæ©' : '该é¨é¨ä¸ææ ç¨æ·'; |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: { options, placeholder, filterOption }, |
| | | fieldName: 'changeUser' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | /** |
| | | * åå§åé¨é¨éæ© |
| | | */ |
| | | async function setupDeptSelect() { |
| | | // updateSchema |
| | | const deptTree = await getDeptTree(); |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ å³ç¶èç¹ / åèç¹ |
| | | addFullName(deptTree, 'label', ' / '); |
| | | 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.respPerson = undefined; |
| | | }, |
| | | placeholder: 'è¯·éæ©', |
| | | showSearch: true, |
| | | treeData: deptTree, |
| | | treeDefaultExpandAll: true, |
| | | treeLine: { showLeafIcon: false }, |
| | | // çéçåæ®µ |
| | | treeNodeFilterProp: 'label', |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ |
| | | treeNodeLabelProp: 'fullName' |
| | | }), |
| | | fieldName: 'userDept' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | async function handleConfirm() { |
| | | try { |
| | | drawerApi.drawerLoading(true); |
| | | const { valid } = await formApi.validate(); |
| | | if (!valid) { |
| | | return; |
| | | } |
| | | const data = cloneDeep(await formApi.getValues()); |
| | | await (isUpdate.value ? updateEquStatu(data) : addEquStatu(data)); |
| | | emit('reload'); |
| | | await handleCancel(); |
| | | } catch (error) { |
| | | console.error(error); |
| | | } finally { |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | } |
| | | |
| | | async function handleCancel() { |
| | | drawerApi.close(); |
| | | await formApi.resetForm(); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicDrawer :close-on-click-modal="false" :title="title" class="w-[600px]"> |
| | | <BasicForm /> |
| | | </BasicDrawer> |
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import type { Recordable } from '@vben/types'; |
| | | |
| | | import { onMounted } from 'vue'; |
| | | |
| | | 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 { listEqu } from '#/api/eims/equ'; |
| | | import { delEquStatu, equStatuExport, listEquStatu } from '#/api/eims/equ-statu'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import equStatuDrawer from './equ-statu-drawer.vue'; |
| | | import statuPreviewDrawer from './statu-preview-drawer.vue'; |
| | | |
| | | // ä»è®¾å¤æç»æå¼é¡µé¢ 1.ä¸éè¦è®¾å¤çé 2.åªæ¥è¯¢å½åè®¾å¤æ°æ® |
| | | interface Props { |
| | | equDetailFlag?: boolean; |
| | | equId?: string; |
| | | } |
| | | |
| | | const props = withDefaults(defineProps<Props>(), { equDetailFlag: false, equId: undefined }); |
| | | |
| | | 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', |
| | | // æ¥æéæ©æ ¼å¼å |
| | | fieldMappingTime: [['changeDate', ['params[beginTime]', 'params[endTime]'], ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59']]] |
| | | }; |
| | | |
| | | const gridOptions: VxeGridProps = { |
| | | checkboxConfig: { |
| | | // é«äº® |
| | | highlight: true, |
| | | // 翻页æ¶ä¿çéä¸ç¶æ |
| | | reserve: true |
| | | // ç¹å»è¡éä¸ |
| | | // trigger: 'row' |
| | | }, |
| | | columns, |
| | | height: 'auto', |
| | | keepSource: true, |
| | | pagerConfig: {}, |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | // å¦æä¼ å
¥äºequIdååªæ¥è¯¢å½åidæ°æ® |
| | | if (props.equDetailFlag && props.equId) { |
| | | const queryEqu = { equId: props.equId }; |
| | | Object.assign(formValues, queryEqu); |
| | | } |
| | | |
| | | return await listEquStatu({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | rowConfig: { |
| | | isHover: true, |
| | | keyField: 'equStatuId' |
| | | }, |
| | | sortConfig: { |
| | | // è¿ç¨æåº |
| | | remote: true, |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true, |
| | | }, |
| | | id: 'eims-equ-statu-index' |
| | | }; |
| | | |
| | | const [BasicTable, tableApi] = useVbenVxeGrid({ |
| | | formOptions, |
| | | gridOptions, |
| | | gridEvents: { |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams), |
| | | }, |
| | | }); |
| | | |
| | | const [EquStatuDrawer, equStatuDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: equStatuDrawer |
| | | }); |
| | | |
| | | const [StatuPreviewDrawer, statuPreviewDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: statuPreviewDrawer |
| | | }); |
| | | |
| | | /** |
| | | * é¢è§ |
| | | * @param record |
| | | */ |
| | | function handlePreview(record: Recordable<any>) { |
| | | statuPreviewDrawerApi.setData({ record }); |
| | | statuPreviewDrawerApi.open(); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | await setupEquSelect(); |
| | | }); |
| | | |
| | | async function setupEquSelect() { |
| | | const equPageResult = await listEqu({ |
| | | pageNum: 1, |
| | | pageSize: 1000 |
| | | }); |
| | | if (!equPageResult || equPageResult.rows.length < 0) { |
| | | return false; |
| | | } |
| | | // 使ç¨mapæ¥è·è¸ªå·²ç»éå°çequIdï¼ä½¿ç¨filteræ¥è¿æ»¤æéå¤çå
ç´ ã |
| | | const uniqueItems = equPageResult.rows.filter((item, index, self) => index === self.findIndex((tm) => tm.equId === item.equId)); |
| | | |
| | | const options = uniqueItems.map((item) => ({ |
| | | label: item.equName || item.equName, |
| | | value: item.equId |
| | | })); |
| | | // çé |
| | | const filterOption = (input: string, option: any) => { |
| | | return option.label.toLowerCase().includes(input.toLowerCase()); |
| | | }; |
| | | |
| | | const placeholder = options.length > 0 ? 'è¯·éæ©' : 'ææ è®¾å¤è®°å½'; |
| | | // æ´æ°selectOptions |
| | | tableApi.formApi.updateSchema([ |
| | | { |
| | | componentProps: { |
| | | options, |
| | | placeholder, |
| | | filterOption |
| | | }, |
| | | dependencies: { |
| | | show: () => !props.equDetailFlag, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'equId' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | function handleAdd() { |
| | | // 设å¤è¯¦æ
页æå¼æ¶ åªè½æ°å¢æå®è®¾å¤idæ°æ® |
| | | if (props.equDetailFlag && props.equId) { |
| | | equStatuDrawerApi.setData({ equId: props.equId }); |
| | | } else { |
| | | equStatuDrawerApi.setData({}); |
| | | } |
| | | |
| | | equStatuDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | equStatuDrawerApi.setData({ id: record.equStatuId }); |
| | | equStatuDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleDelete(row: Recordable<any>) { |
| | | await delEquStatu(row.equStatuId); |
| | | await tableApi.query(); |
| | | } |
| | | |
| | | function handleMultiDelete() { |
| | | const rows = tableApi.grid.getCheckboxRecords(); |
| | | const ids = rows.map((row: any) => row.equStatuId); |
| | | Modal.confirm({ |
| | | title: 'æç¤º', |
| | | okType: 'danger', |
| | | content: `确认å é¤éä¸ç${ids.length}æ¡è®°å½åï¼`, |
| | | onOk: async () => { |
| | | await delEquStatu(ids); |
| | | await tableApi.query(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleDownloadExcel() { |
| | | commonDownloadExcel(equStatuExport, '设å¤ç¶æåæ´è®°å½', 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:equStatu:export']" @click="handleDownloadExcel"> |
| | | {{ $t('pages.common.export') }} |
| | | </a-button> |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | | type="primary" |
| | | v-access:code="['eims:equStatu:remove']" |
| | | @click="handleMultiDelete" |
| | | > |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | <a-button type="primary" v-access:code="['eims:equStatu: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:equStatu:edit']" @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | <ghost-button class="btn-success" v-access:code="['eims:equStatu:list']" @click.stop="handlePreview(row)"> |
| | | {{ $t('pages.common.preview') }} |
| | | </ghost-button> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['eims:equStatu:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | | </Popconfirm> |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |
| | | <EquStatuDrawer @reload="tableApi.query()" /> |
| | | <StatuPreviewDrawer /> |
| | | </Page> |
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import type { Recordable } from '@vben/types'; |
| | | |
| | | import { useVbenDrawer } from '@vben/common-ui'; |
| | | |
| | | import { Description, useDescription } from '#/components/description'; |
| | | |
| | | import { descSchema } from './data'; |
| | | |
| | | const [BasicDrawer, drawerApi] = useVbenDrawer({ |
| | | onOpenChange: handleOpenChange, |
| | | }); |
| | | |
| | | const [registerDescription, { setDescProps }] = useDescription({ |
| | | column: 1, |
| | | schema: descSchema, |
| | | }); |
| | | |
| | | function handleOpenChange(open: boolean) { |
| | | if (!open) { |
| | | return null; |
| | | } |
| | | const { record } = drawerApi.getData() as { record: Recordable<any> }; |
| | | setDescProps({ data: record }, true); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicDrawer :footer="false" class="w-[600px]" title="è¯äº§è®°å½æç»"> |
| | | <Description @register="registerDescription" /> |
| | | </BasicDrawer> |
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { VxeGridProps } from '#/adapter/vxe-table'; |
| | | import type { DescItem } from '#/components/description'; |
| | | |
| | | import { getPopupContainer } from '@vben/utils'; |
| | | |
| | | import { type FormSchemaGetter } from '#/adapter/form'; |
| | | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | showSearch: true, |
| | | allowClear: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'equId', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | | component: 'RangePicker', |
| | | fieldName: 'trialDate', |
| | | label: 'è¯äº§æ¥æ' |
| | | } |
| | | ]; |
| | | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | | { type: 'checkbox', width: 60, fixed: 'left' }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | field: 'equName', |
| | | minWidth: 100, |
| | | fixed: 'left', |
| | | slots: { default: 'equName' } |
| | | }, |
| | | |
| | | /* { |
| | | title: 'ç±»å', |
| | | slots: { |
| | | // eslint-disable-next-line no-empty-pattern |
| | | default: ({}) => { |
| | | return <Tag color="cyan">è¯ç¨</Tag>; |
| | | } |
| | | }, |
| | | minWidth: 80, |
| | | fixed: 'left' |
| | | },*/ |
| | | { |
| | | title: 'è¯äº§æ¥æ', |
| | | field: 'trialDate', |
| | | sortable: true, |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | title: 'è¯äº§æ°é', |
| | | field: 'trialNum', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: 'è¯åæ°é', |
| | | field: 'proGoodNum', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: 'è¯åç', |
| | | field: 'proGoodRate', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: '计åè¿è¡æ¶é¿', |
| | | field: 'planRunTime', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | title: 'è¿è¡æ¶é¿', |
| | | field: 'runTime', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: 'åæºæ¶é¿', |
| | | field: 'stopTime', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: 'è°è¯å±¥å', |
| | | field: 'debugHistory', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: '综åæç', |
| | | field: 'oee', |
| | | minWidth: 100 |
| | | }, |
| | | |
| | | { |
| | | title: 'æä½äºº', |
| | | field: 'operatorName', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | field: 'action', |
| | | fixed: 'right', |
| | | slots: { default: 'action' }, |
| | | title: 'æä½', |
| | | width: 200 |
| | | } |
| | | ]; |
| | | |
| | | export const drawerSchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Input', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'trialId' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | showSearch: true, |
| | | allowClear: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'equId', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD', |
| | | showTime: false, |
| | | valueFormat: 'YYYY-MM-DD', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'trialDate', |
| | | label: 'è¯äº§æ¥æ' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'trialNum', |
| | | label: 'è¯äº§æ°é' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'proGoodNum', |
| | | label: 'è¯åæ°é', |
| | | help: 'è¯äº§ä¸äº§ååæ ¼æ°' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'proGoodRate', |
| | | label: 'è¯åç', |
| | | help: 'è¯äº§ä¸äº§ååæ ¼ç' |
| | | }, |
| | | { |
| | | component: 'TimePicker', |
| | | componentProps: { |
| | | format: 'HH:mm:ss', |
| | | showTime: false, |
| | | valueFormat: 'HH:mm:ss', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'startTime', |
| | | label: 'å¼å§æ¶é´' |
| | | }, |
| | | { |
| | | component: 'TimePicker', |
| | | componentProps: { |
| | | format: 'HH:mm:ss', |
| | | showTime: false, |
| | | valueFormat: 'HH:mm:ss', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'endTime', |
| | | label: 'ç»ææ¶é´' |
| | | }, |
| | | { |
| | | component: 'TimePicker', |
| | | componentProps: { |
| | | format: 'HH:mm:ss', |
| | | showTime: false, |
| | | valueFormat: 'HH:mm:ss', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'planRunTime', |
| | | label: '计åè¿è¡æ¶é¿' |
| | | }, |
| | | { |
| | | component: 'TimePicker', |
| | | componentProps: { |
| | | format: 'HH:mm:ss', |
| | | showTime: false, |
| | | valueFormat: 'HH:mm:ss', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'runTime', |
| | | label: 'è¿è¡æ¶é¿' |
| | | }, |
| | | { |
| | | component: 'TimePicker', |
| | | componentProps: { |
| | | format: 'HH:mm:ss', |
| | | showTime: false, |
| | | valueFormat: 'HH:mm:ss', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'stopTime', |
| | | label: 'åæºæ¶é¿' |
| | | }, |
| | | { |
| | | component: 'Textarea', |
| | | formItemClass: 'items-baseline', |
| | | fieldName: 'debugHistory', |
| | | label: 'è°è¯å±¥å' |
| | | }, |
| | | { |
| | | component: 'TreeSelect', |
| | | // å¨draweréæ´æ° è¿éä¸éè¦é»è®¤çcomponentProps |
| | | defaultValue: undefined, |
| | | fieldName: 'operatorDept', |
| | | label: 'æä½äººé¨é¨', |
| | | help: `è¯äº§æä½äººåæå±é¨é¨` |
| | | // rules: 'selectRequired', |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | allowClear: true, |
| | | showSearch: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'operatorId', |
| | | label: 'æä½äºº', |
| | | help: `è¯äº§æä½äººå` |
| | | } |
| | | ]; |
| | | |
| | | export const descSchema: DescItem[] = [ |
| | | { |
| | | field: 'equName', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | | field: 'oee', |
| | | label: '综åæç' |
| | | }, |
| | | { |
| | | field: 'operatorName', |
| | | label: 'æä½äºº' |
| | | }, |
| | | { |
| | | field: 'trialDate', |
| | | label: 'è¯äº§æ¥æ' |
| | | }, |
| | | { |
| | | field: 'trialNum', |
| | | label: 'è¯äº§æ°é' |
| | | }, |
| | | { |
| | | field: 'proGoodNum', |
| | | label: 'è¯åæ°é' |
| | | }, |
| | | { |
| | | field: 'proGoodRate', |
| | | label: 'è¯åç' |
| | | }, |
| | | { |
| | | field: 'startTime', |
| | | label: 'å¼å§æ¶é´' |
| | | }, |
| | | { |
| | | field: 'endTime', |
| | | label: 'ç»ææ¶é´' |
| | | }, |
| | | { |
| | | field: 'planRunTime', |
| | | label: '计åè¿è¡æ¶é¿' |
| | | }, |
| | | { |
| | | field: 'runTime', |
| | | label: 'è¿è¡æ¶é¿' |
| | | }, |
| | | { |
| | | field: 'stopTime', |
| | | label: 'åæºæ¶é´' |
| | | }, |
| | | { |
| | | field: 'debugHistory', |
| | | label: '设å¤å±¥å' |
| | | } |
| | | ]; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import { computed, ref } from 'vue'; |
| | | |
| | | import { useVbenDrawer } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { addFullName, cloneDeep, getPopupContainer } from '@vben/utils'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { listEqu } from '#/api/eims/equ'; |
| | | import { addEquTrial, getEquTrial, updateEquTrial } from '#/api/eims/equ-trial'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | |
| | | 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 }; |
| | | // 设å¤è¯¦æ
页æå¼æå®è®¾å¤id |
| | | const { equId } = drawerApi.getData() as { equId?: number | string }; |
| | | if (equId) { |
| | | await formApi.setValues({ equId }); |
| | | } |
| | | isUpdate.value = !!id; |
| | | // åå§å |
| | | await setupEquSelect(); |
| | | await setupDeptSelect(); |
| | | // æ´æ° && èµå¼ |
| | | if (isUpdate.value && id) { |
| | | const record = await getEquTrial(id); |
| | | await formApi.setValues(record); |
| | | } |
| | | // 设å¤idæå¼æ¶ä¸å
许ç¼è¾ï¼1.ç¼è¾ 2.设å¤è¯¦æ
页æå¼ï¼ |
| | | const flag = equId !== undefined || isUpdate.value; |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: { |
| | | disabled: flag |
| | | }, |
| | | fieldName: 'equId' |
| | | } |
| | | ]); |
| | | |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | }); |
| | | |
| | | async function setupEquSelect() { |
| | | // status-0 åªæ¥è¯¢è¯ç¨è®¾å¤ |
| | | const params = { status: '0' }; |
| | | const equPageResult = await listEqu({ |
| | | pageNum: 1, |
| | | pageSize: 1000, |
| | | ...params |
| | | }); |
| | | // 使ç¨mapæ¥è·è¸ªå·²ç»éå°çequIdï¼ä½¿ç¨filteræ¥è¿æ»¤æéå¤çå
ç´ ã |
| | | const uniqueItems = equPageResult.rows.filter((item, index, self) => index === self.findIndex((tm) => tm.equId === item.equId)); |
| | | |
| | | const options = uniqueItems.map((item) => ({ |
| | | label: item.equName || item.equName, |
| | | value: item.equId |
| | | })); |
| | | // çé |
| | | const filterOption = (input: string, option: any) => { |
| | | return option.label.toLowerCase().includes(input.toLowerCase()); |
| | | }; |
| | | |
| | | const placeholder = options.length > 0 ? 'è¯·éæ©' : 'ææ è®¾å¤è®°å½'; |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: { |
| | | options, |
| | | placeholder, |
| | | filterOption |
| | | }, |
| | | fieldName: 'equId' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ·çå è½½ |
| | | */ |
| | | 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 ? 'è¯·éæ©' : '该é¨é¨ä¸ææ ç¨æ·'; |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: { options, placeholder, filterOption }, |
| | | fieldName: 'operatorId' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | /** |
| | | * åå§åé¨é¨éæ© |
| | | */ |
| | | async function setupDeptSelect() { |
| | | // updateSchema |
| | | const deptTree = await getDeptTree(); |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ å³ç¶èç¹ / åèç¹ |
| | | addFullName(deptTree, 'label', ' / '); |
| | | 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.respPerson = undefined; |
| | | }, |
| | | placeholder: 'è¯·éæ©', |
| | | showSearch: true, |
| | | treeData: deptTree, |
| | | treeDefaultExpandAll: true, |
| | | treeLine: { showLeafIcon: false }, |
| | | // çéçåæ®µ |
| | | treeNodeFilterProp: 'label', |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ |
| | | treeNodeLabelProp: 'fullName' |
| | | }), |
| | | fieldName: 'operatorDept' |
| | | } |
| | | ]); |
| | | } |
| | | async function handleConfirm() { |
| | | try { |
| | | drawerApi.drawerLoading(true); |
| | | const { valid } = await formApi.validate(); |
| | | if (!valid) { |
| | | return; |
| | | } |
| | | const data = cloneDeep(await formApi.getValues()); |
| | | await (isUpdate.value ? updateEquTrial(data) : addEquTrial(data)); |
| | | emit('reload'); |
| | | await handleCancel(); |
| | | } catch (error) { |
| | | console.error(error); |
| | | } finally { |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | } |
| | | |
| | | async function handleCancel() { |
| | | drawerApi.close(); |
| | | await formApi.resetForm(); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicDrawer :close-on-click-modal="false" :title="title" class="w-[600px]"> |
| | | <BasicForm /> |
| | | </BasicDrawer> |
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import type { Recordable } from '@vben/types'; |
| | | |
| | | import { onMounted } from 'vue'; |
| | | |
| | | 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 { listEqu } from '#/api/eims/equ'; |
| | | import { delEquTrial, equTrialExport, listEquTrial } from '#/api/eims/equ-trial'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import equTrialDrawer from './equ-trial-drawer.vue'; |
| | | import trialPreviewDrawer from './trial-preview-drawer.vue'; |
| | | |
| | | // ä»è®¾å¤æç»æå¼é¡µé¢ 1.ä¸éè¦è®¾å¤çé 2.åªæ¥è¯¢å½åè®¾å¤æ°æ® |
| | | interface Props { |
| | | equDetailFlag?: boolean; |
| | | equId?: string; |
| | | } |
| | | |
| | | const props = withDefaults(defineProps<Props>(), { equDetailFlag: false, equId: undefined }); |
| | | |
| | | 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', |
| | | // æ¥æéæ©æ ¼å¼å |
| | | fieldMappingTime: [['trialDate', ['params[beginTime]', 'params[endTime]'], ['YYYY-MM-DD', 'YYYY-MM-DD']]] |
| | | }; |
| | | |
| | | const gridOptions: VxeGridProps = { |
| | | checkboxConfig: { |
| | | // é«äº® |
| | | highlight: true, |
| | | // 翻页æ¶ä¿çéä¸ç¶æ |
| | | reserve: true |
| | | // ç¹å»è¡éä¸ |
| | | // trigger: 'row' |
| | | }, |
| | | columns, |
| | | height: 'auto', |
| | | keepSource: true, |
| | | pagerConfig: {}, |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | // å¦æä¼ å
¥äºequIdååªæ¥è¯¢å½åidæ°æ® |
| | | if (props.equDetailFlag && props.equId) { |
| | | const queryEqu = { equId: props.equId }; |
| | | Object.assign(formValues, queryEqu); |
| | | } |
| | | |
| | | return await listEquTrial({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | rowConfig: { |
| | | isHover: true, |
| | | keyField: 'trialId' |
| | | }, |
| | | sortConfig: { |
| | | // è¿ç¨æåº |
| | | remote: true, |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true, |
| | | }, |
| | | id: 'eims-equ-trial-index' |
| | | }; |
| | | |
| | | const [BasicTable, tableApi] = useVbenVxeGrid({ |
| | | formOptions, |
| | | gridOptions, |
| | | gridEvents: { |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams), |
| | | }, |
| | | }); |
| | | |
| | | const [EquTrialDrawer, equTrialDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: equTrialDrawer |
| | | }); |
| | | |
| | | const [TrialPreviewDrawer, trialPreviewDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: trialPreviewDrawer |
| | | }); |
| | | |
| | | /** |
| | | * é¢è§ |
| | | * @param record |
| | | */ |
| | | function handlePreview(record: Recordable<any>) { |
| | | trialPreviewDrawerApi.setData({ record }); |
| | | trialPreviewDrawerApi.open(); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | await setupEquSelect(); |
| | | }); |
| | | |
| | | async function setupEquSelect() { |
| | | // status-0 åªæ¥è¯¢è¯ç¨è®¾å¤ |
| | | const params = { status: '0' }; |
| | | const equPageResult = await listEqu({ |
| | | pageNum: 1, |
| | | pageSize: 1000, |
| | | ...params |
| | | }); |
| | | if (!equPageResult || equPageResult.rows.length < 0) { |
| | | return false; |
| | | } |
| | | // 使ç¨mapæ¥è·è¸ªå·²ç»éå°çequIdï¼ä½¿ç¨filteræ¥è¿æ»¤æéå¤çå
ç´ ã |
| | | const uniqueItems = equPageResult.rows.filter((item, index, self) => index === self.findIndex((tm) => tm.equId === item.equId)); |
| | | |
| | | const options = uniqueItems.map((item) => ({ |
| | | label: item.equName || item.equName, |
| | | value: item.equId |
| | | })); |
| | | // çé |
| | | const filterOption = (input: string, option: any) => { |
| | | return option.label.toLowerCase().includes(input.toLowerCase()); |
| | | }; |
| | | |
| | | const placeholder = options.length > 0 ? 'è¯·éæ©' : 'ææ è®¾å¤è®°å½'; |
| | | // æ´æ°selectOptions |
| | | tableApi.formApi.updateSchema([ |
| | | { |
| | | componentProps: { |
| | | options, |
| | | placeholder, |
| | | filterOption |
| | | }, |
| | | dependencies: { |
| | | show: () => !props.equDetailFlag, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'equId' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | function handleAdd() { |
| | | // 设å¤è¯¦æ
页æå¼æ¶ åªè½æ°å¢æå®è®¾å¤idæ°æ® |
| | | if (props.equDetailFlag && props.equId) { |
| | | equTrialDrawerApi.setData({ equId: props.equId }); |
| | | } else { |
| | | equTrialDrawerApi.setData({}); |
| | | } |
| | | |
| | | equTrialDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | equTrialDrawerApi.setData({ id: record.trialId }); |
| | | equTrialDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleDelete(row: Recordable<any>) { |
| | | await delEquTrial(row.trialId); |
| | | await tableApi.query(); |
| | | } |
| | | |
| | | function handleMultiDelete() { |
| | | const rows = tableApi.grid.getCheckboxRecords(); |
| | | const ids = rows.map((row: any) => row.trialId); |
| | | Modal.confirm({ |
| | | title: 'æç¤º', |
| | | okType: 'danger', |
| | | content: `确认å é¤éä¸ç${ids.length}æ¡è®°å½åï¼`, |
| | | onOk: async () => { |
| | | await delEquTrial(ids); |
| | | await tableApi.query(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleDownloadExcel() { |
| | | commonDownloadExcel(equTrialExport, 'è¯äº§è®°å½', 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:equTrial:export']" @click="handleDownloadExcel"> |
| | | {{ $t('pages.common.export') }} |
| | | </a-button> |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | | type="primary" |
| | | v-access:code="['eims:equTrial:remove']" |
| | | @click="handleMultiDelete" |
| | | > |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | <a-button type="primary" v-access:code="['eims:equTrial: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:equTrial:edit']" @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | <ghost-button class="btn-success" v-access:code="['eims:equTrial:list']" @click.stop="handlePreview(row)"> |
| | | {{ $t('pages.common.preview') }} |
| | | </ghost-button> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['eims:equTrial:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | | </Popconfirm> |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |
| | | <EquTrialDrawer @reload="tableApi.query()" /> |
| | | <TrialPreviewDrawer /> |
| | | </Page> |
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import type { Recordable } from '@vben/types'; |
| | | |
| | | import { useVbenDrawer } from '@vben/common-ui'; |
| | | |
| | | import { Description, useDescription } from '#/components/description'; |
| | | |
| | | import { descSchema } from './data'; |
| | | |
| | | const [BasicDrawer, drawerApi] = useVbenDrawer({ |
| | | onOpenChange: handleOpenChange, |
| | | }); |
| | | |
| | | const [registerDescription, { setDescProps }] = useDescription({ |
| | | column: 1, |
| | | schema: descSchema, |
| | | }); |
| | | |
| | | function handleOpenChange(open: boolean) { |
| | | if (!open) { |
| | | return null; |
| | | } |
| | | const { record } = drawerApi.getData() as { record: Recordable<any> }; |
| | | setDescProps({ data: record }, true); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicDrawer :footer="false" class="w-[600px]" title="è¯äº§è®°å½æç»"> |
| | | <Description @register="registerDescription" /> |
| | | </BasicDrawer> |
| | | </template> |
| | |
| | | }, |
| | | { |
| | | component: 'RangePicker', |
| | | fieldName: 'createTime', |
| | | fieldName: 'deployDate', |
| | | label: 'ä½¿ç¨æ¥æ' |
| | | } |
| | | ]; |
| | |
| | | { |
| | | title: 'ç¶æ', |
| | | field: 'status', |
| | | sortable: true, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | const statu = row.status; |
| | |
| | | { |
| | | title: 'èµäº§ç¼å·', |
| | | field: 'assetNo', |
| | | sortable: true, |
| | | minWidth: 100, |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: '设å¤ç¼å·', |
| | | field: 'equCode', |
| | | sortable: true, |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | |
| | | { |
| | | title: 'éè´æ¥æ', |
| | | field: 'purchaseDate', |
| | | sortable: true, |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | |
| | | { |
| | | title: '导å
¥ç¶æ', |
| | | field: 'importStatus', |
| | | slots: { default: 'importStatus' }, |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: 'çç¹æ å¿', |
| | | field: 'inventoryFlag', |
| | | slots: { default: 'inventoryFlag' }, |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | |
| | | fixed: 'right', |
| | | slots: { default: 'action' }, |
| | | title: 'æä½', |
| | | width: 180 |
| | | width: 200 |
| | | } |
| | | ]; |
| | | |
| | |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | // éä¸äºå°±åªè½ä¿®æ¹ ä¸è½é置为æ è´è´£äºº |
| | | allowClear: true, |
| | | showSearch: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'respPerson', |
| | |
| | | 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 ? 'è¯·éæ©' : '该é¨é¨ä¸ææ ç¨æ·'; |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: { options, placeholder }, |
| | | componentProps: { options, placeholder ,filterOption }, |
| | | fieldName: 'respPerson' |
| | | } |
| | | ]); |
| | |
| | | import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'; |
| | | import { getVxePopupContainer } from '@vben/utils'; |
| | | |
| | | import { Dropdown, Menu, MenuItem, Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps } from '#/adapter/vxe-table'; |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { delEqu, equExport, listEqu } from '#/api/eims/equ'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | |
| | |
| | | isHover: true, |
| | | keyField: 'equId' |
| | | }, |
| | | sortConfig: { |
| | | // è¿ç¨æåº |
| | | remote: true, |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true, |
| | | }, |
| | | id: 'eims-equ-index' |
| | | }; |
| | | |
| | | const [BasicTable, tableApi] = useVbenVxeGrid({ |
| | | formOptions, |
| | | gridOptions |
| | | gridOptions, |
| | | gridEvents: { |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams), |
| | | }, |
| | | }); |
| | | |
| | | const [EquDrawer, equDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: equDrawer |
| | | }); |
| | | |
| | | |
| | | |
| | | function handleAdd() { |
| | | equDrawerApi.setData({}); |
| | |
| | | }); |
| | | } |
| | | |
| | | function getImportStatus(row: any) { |
| | | const importStatus = row.importStatus === null || row.importStatus; |
| | | return importStatus ? 'æªå¯¼å
¥' : '已导å
¥'; |
| | | } |
| | | |
| | | function getInventoryFlag(row: any) { |
| | | const inventoryFlag = row.inventoryFlag === null || row.inventoryFlag; |
| | | return inventoryFlag ? 'æªçç¹' : 'å·²çç¹'; |
| | | } |
| | | |
| | | const router = useRouter(); |
| | | function handleDetail(record: Recordable<any>) { |
| | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px]"> |
| | | <EquTypeTree |
| | | v-model:select-dept-id="selectDeptId" |
| | | class="w-[260px]" |
| | | @reload="() => tableApi.reload()" |
| | | @select="() => tableApi.reload()" |
| | | /> |
| | | <EquTypeTree v-model:select-dept-id="selectDeptId" class="w-[260px]" @reload="() => tableApi.reload()" @select="() => tableApi.reload()" /> |
| | | <BasicTable class="flex-1 overflow-hidden" table-title="设å¤å表"> |
| | | <template #toolbar-tools> |
| | | <Space> |
| | | <a-button v-access:code="['eims:equ:export']" @click="handleDownloadExcel"> |
| | | {{ $t('pages.common.export') }} |
| | | </a-button> |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | | type="primary" |
| | | v-access:code="['eims:equ:remove']" |
| | | @click="handleMultiDelete" |
| | | > |
| | | <a-button :disabled="!vxeCheckboxChecked(tableApi)" danger type="primary" v-access:code="['eims:equ:remove']" @click="handleMultiDelete"> |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | <a-button type="primary" v-access:code="['eims:equ:add']" @click="handleAdd"> |
| | |
| | | |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button v-access:code="['system:role:edit']" @click.stop="handleEdit(row)"> |
| | | <ghost-button v-access:code="['eims:equ:edit']" @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | <ghost-button v-if="row.menuType !== 'F'" class="btn-success" v-access:code="['eims:equ:list']" @click="handleDetail(row)"> |
| | | {{ $t('pages.common.info') }} |
| | | </ghost-button> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['system:role:remove']" @click.stop=""> |
| | | <ghost-button danger v-access:code="['eims:equ:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | | </Popconfirm> |
| | | </Space> |
| | | <Dropdown :get-popup-container="getVxePopupContainer" placement="bottomRight"> |
| | | <template #overlay> |
| | | <Menu> |
| | | <MenuItem key="1" @click="handleDetail(row)"> 详æ
</MenuItem> |
| | | </Menu> |
| | | </template> |
| | | <a-button size="small" type="link"> |
| | | {{ $t('pages.common.more') }} |
| | | </a-button> |
| | | </Dropdown> |
| | | </template> |
| | | |
| | | <template #importStatus="{ row }"> |
| | | <span>{{ getImportStatus(row) }}</span> |
| | | </template> |
| | | |
| | | <template #inventoryFlag="{ row }"> |
| | | <span>{{ getInventoryFlag(row) }}</span> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.common.core.service; |
| | | |
| | | public interface EquService { |
| | | /** |
| | | * éè¿è®¾å¤IDæ¥è¯¢è®¾å¤ç±»ååç§° |
| | | * |
| | | * @param equIds 设å¤ID串éå·åé |
| | | * @return 设å¤å称串éå·åé |
| | | */ |
| | | String selectEquNameByIds(String equIds); |
| | | } |
| | |
| | | /** |
| | | * éè¿è®¾å¤ç±»åIDæ¥è¯¢è®¾å¤ç±»ååç§° |
| | | * |
| | | * @param equTypeIds é¨é¨ID串éå·åé |
| | | * @return é¨é¨å称串éå·åé |
| | | * @param equTypeIds 设å¤ç±»åID串éå·åé |
| | | * @return 设å¤ç±»åå称串éå·åé |
| | | */ |
| | | String selectEquTypeNameByIds(String equTypeIds); |
| | | } |
| | |
| | | String OSS_ID_TO_URL = "oss_id_to_url"; |
| | | |
| | | /** |
| | | * 设å¤åç§°id转åç§° |
| | | * 设å¤ç±»ååç§°id转åç§° |
| | | */ |
| | | String EQU_YPE_ID_TO_NAME = "equ_type_id_to_name"; |
| | | /** |
| | | * 设å¤åç§°id转åç§° |
| | | */ |
| | | String EQU_ID_TO_NAME = "equ_id_to_name"; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.common.translation.core.impl; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import org.dromara.common.core.service.EquService; |
| | | import org.dromara.common.core.service.EquTypeService; |
| | | import org.dromara.common.translation.annotation.TranslationType; |
| | | import org.dromara.common.translation.constant.TransConstant; |
| | | import org.dromara.common.translation.core.TranslationInterface; |
| | | |
| | | /** |
| | | * 设å¤ç¿»è¯å®ç° |
| | | * |
| | | * @author zhuguifei |
| | | */ |
| | | @AllArgsConstructor |
| | | @TranslationType(type = TransConstant.EQU_ID_TO_NAME) |
| | | public class EquNameTranslationImpl implements TranslationInterface<String> { |
| | | |
| | | private final EquService equService; |
| | | |
| | | @Override |
| | | public String translation(Object key, String other) { |
| | | if (key instanceof String ids) { |
| | | return equService.selectEquNameByIds(ids); |
| | | } else if (key instanceof Long id) { |
| | | return equService.selectEquNameByIds(id.toString()); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | org.dromara.common.translation.core.impl.UserNameTranslationImpl |
| | | org.dromara.common.translation.core.impl.NicknameTranslationImpl |
| | | org.dromara.common.translation.core.impl.EquTypeNameTranslationImpl |
| | | org.dromara.common.translation.core.impl.EquNameTranslationImpl |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/controller/SysEquController.java ÐÞ¸Ä |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.dromara.eims.domain.bo.SysEquBo; |
| | | import org.dromara.eims.domain.vo.SysEquVo; |
| | | import org.dromara.eims.service.ISysEquService; |
| | | import org.dromara.eims.domain.bo.EimsEquBo; |
| | | import org.dromara.eims.domain.vo.EimsEquVo; |
| | | import org.dromara.eims.service.IEimsEquService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.constraints.*; |
| | |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/equ") |
| | | public class SysEquController extends BaseController { |
| | | public class EimsEquController extends BaseController { |
| | | |
| | | private final ISysEquService sysEquipmentService; |
| | | private final IEimsEquService eimsEquipmentService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ã设å¤å°è´¦ãå表 |
| | | */ |
| | | @SaCheckPermission("system:equipment:list") |
| | | @SaCheckPermission("eims:equ:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysEquVo> list(SysEquBo bo, PageQuery pageQuery) { |
| | | return sysEquipmentService.queryPageList(bo, pageQuery); |
| | | public TableDataInfo<EimsEquVo> list(EimsEquBo bo, PageQuery pageQuery) { |
| | | return eimsEquipmentService.queryPageList(bo, pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 导åºã设å¤å°è´¦ãå表 |
| | | */ |
| | | @SaCheckPermission("system:equipment:export") |
| | | @SaCheckPermission("eims:equ:export") |
| | | @Log(title = "ã设å¤å°è´¦ã", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(SysEquBo bo, HttpServletResponse response) { |
| | | List<SysEquVo> list = sysEquipmentService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "ã设å¤å°è´¦ã", SysEquVo.class, response); |
| | | public void export(EimsEquBo bo, HttpServletResponse response) { |
| | | List<EimsEquVo> list = eimsEquipmentService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "ã设å¤å°è´¦ã", EimsEquVo.class, response); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param equId ä¸»é® |
| | | */ |
| | | @SaCheckPermission("system:equipment:query") |
| | | @SaCheckPermission("eims:equ:query") |
| | | @GetMapping("/{equId}") |
| | | public R<SysEquVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | public R<EimsEquVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long equId) { |
| | | return R.ok(sysEquipmentService.queryById(equId)); |
| | | return R.ok(eimsEquipmentService.queryById(equId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ã设å¤å°è´¦ã |
| | | */ |
| | | @SaCheckPermission("system:equipment:add") |
| | | @SaCheckPermission("eims:equ:add") |
| | | @Log(title = "ã设å¤å°è´¦ã", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody SysEquBo bo) { |
| | | return toAjax(sysEquipmentService.insertByBo(bo)); |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsEquBo bo) { |
| | | return toAjax(eimsEquipmentService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ã设å¤å°è´¦ã |
| | | */ |
| | | @SaCheckPermission("system:equipment:edit") |
| | | @SaCheckPermission("eims:equ:edit") |
| | | @Log(title = "ã设å¤å°è´¦ã", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysEquBo bo) { |
| | | return toAjax(sysEquipmentService.updateByBo(bo)); |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsEquBo bo) { |
| | | return toAjax(eimsEquipmentService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param equIds 主é®ä¸² |
| | | */ |
| | | @SaCheckPermission("system:equipment:remove") |
| | | @SaCheckPermission("eims:equ:remove") |
| | | @Log(title = "ã设å¤å°è´¦ã", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{equIds}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] equIds) { |
| | | return toAjax(sysEquipmentService.deleteWithValidByIds(List.of(equIds), true)); |
| | | return toAjax(eimsEquipmentService.deleteWithValidByIds(List.of(equIds), 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.EimsEquStatuVo; |
| | | import org.dromara.eims.domain.bo.EimsEquStatuBo; |
| | | import org.dromara.eims.service.IEimsEquStatuService; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * 设å¤ç¶æè®°å½ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-14 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/equStatu") |
| | | public class EimsEquStatuController extends BaseController { |
| | | |
| | | private final IEimsEquStatuService eimsEquStatuService; |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤ç¶æè®°å½å表 |
| | | */ |
| | | @SaCheckPermission("eims:equStatu:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<EimsEquStatuVo> list(EimsEquStatuBo bo, PageQuery pageQuery) { |
| | | return eimsEquStatuService.queryPageList(bo, pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 导åºè®¾å¤ç¶æè®°å½å表 |
| | | */ |
| | | @SaCheckPermission("eims:equStatu:export") |
| | | @Log(title = "设å¤ç¶æè®°å½", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(EimsEquStatuBo bo, HttpServletResponse response) { |
| | | List<EimsEquStatuVo> list = eimsEquStatuService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "设å¤ç¶æè®°å½", EimsEquStatuVo.class, response); |
| | | } |
| | | |
| | | /** |
| | | * è·å设å¤ç¶æè®°å½è¯¦ç»ä¿¡æ¯ |
| | | * |
| | | * @param equStatuId ä¸»é® |
| | | */ |
| | | @SaCheckPermission("eims:equStatu:query") |
| | | @GetMapping("/{equStatuId}") |
| | | public R<EimsEquStatuVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long equStatuId) { |
| | | return R.ok(eimsEquStatuService.queryById(equStatuId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤ç¶æè®°å½ |
| | | */ |
| | | @SaCheckPermission("eims:equStatu:add") |
| | | @Log(title = "设å¤ç¶æè®°å½", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsEquStatuBo bo) { |
| | | return toAjax(eimsEquStatuService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤ç¶æè®°å½ |
| | | */ |
| | | @SaCheckPermission("eims:equStatu:edit") |
| | | @Log(title = "设å¤ç¶æè®°å½", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsEquStatuBo bo) { |
| | | return toAjax(eimsEquStatuService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è®¾å¤ç¶æè®°å½ |
| | | * |
| | | * @param equStatuIds 主é®ä¸² |
| | | */ |
| | | @SaCheckPermission("eims:equStatu:remove") |
| | | @Log(title = "设å¤ç¶æè®°å½", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{equStatuIds}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] equStatuIds) { |
| | | return toAjax(eimsEquStatuService.deleteWithValidByIds(List.of(equStatuIds), 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.dromara.eims.domain.vo.EimsEquTrialVo; |
| | | 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.bo.EimsEquTrialBo; |
| | | import org.dromara.eims.service.IEimsEquTrialService; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * 设å¤è¯äº§è®°å½ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-09 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/equTrial") |
| | | public class EimsEquTrialController extends BaseController { |
| | | |
| | | private final IEimsEquTrialService eimsEquTrialService; |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤è¯äº§è®°å½å表 |
| | | */ |
| | | @SaCheckPermission("eims:equTrial:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<EimsEquTrialVo> list(EimsEquTrialBo bo, PageQuery pageQuery) { |
| | | return eimsEquTrialService.queryPageList(bo, pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 导åºè®¾å¤è¯äº§è®°å½å表 |
| | | */ |
| | | @SaCheckPermission("eims:equTrial:export") |
| | | @Log(title = "设å¤è¯äº§è®°å½", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(EimsEquTrialBo bo, HttpServletResponse response) { |
| | | List<EimsEquTrialVo> list = eimsEquTrialService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "设å¤è¯äº§è®°å½", EimsEquTrialVo.class, response); |
| | | } |
| | | |
| | | /** |
| | | * è·å设å¤è¯äº§è®°å½è¯¦ç»ä¿¡æ¯ |
| | | * |
| | | * @param trialId ä¸»é® |
| | | */ |
| | | @SaCheckPermission("eims:equTrial:query") |
| | | @GetMapping("/{trialId}") |
| | | public R<EimsEquTrialVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long trialId) { |
| | | return R.ok(eimsEquTrialService.queryById(trialId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤è¯äº§è®°å½ |
| | | */ |
| | | @SaCheckPermission("eims:equTrial:add") |
| | | @Log(title = "设å¤è¯äº§è®°å½", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsEquTrialBo bo) { |
| | | return toAjax(eimsEquTrialService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤è¯äº§è®°å½ |
| | | */ |
| | | @SaCheckPermission("eims:equTrial:edit") |
| | | @Log(title = "设å¤è¯äº§è®°å½", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsEquTrialBo bo) { |
| | | return toAjax(eimsEquTrialService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è®¾å¤è¯äº§è®°å½ |
| | | * |
| | | * @param trialIds 主é®ä¸² |
| | | */ |
| | | @SaCheckPermission("eims:equTrial:remove") |
| | | @Log(title = "设å¤è¯äº§è®°å½", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{trialIds}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] trialIds) { |
| | | return toAjax(eimsEquTrialService.deleteWithValidByIds(List.of(trialIds), true)); |
| | | } |
| | | } |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/controller/SysEquTypeController.java ÐÞ¸Ä |
| | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.constraints.*; |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import org.dromara.eims.domain.vo.EimsEquTypeVo; |
| | | 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.SysEquTypeVo; |
| | | import org.dromara.eims.domain.bo.SysEquTypeBo; |
| | | import org.dromara.eims.service.ISysEquTypeService; |
| | | import org.dromara.eims.domain.bo.EimsEquTypeBo; |
| | | import org.dromara.eims.service.IEimsEquTypeService; |
| | | |
| | | /** |
| | | * 设å¤ç±»å |
| | |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/equType") |
| | | public class SysEquTypeController extends BaseController { |
| | | public class EimsEquTypeController extends BaseController { |
| | | |
| | | private final ISysEquTypeService sysEquTypeService; |
| | | private final IEimsEquTypeService eimsEquTypeService; |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤ç±»åå表 |
| | | */ |
| | | @SaCheckPermission("eims:equType:list") |
| | | @GetMapping("/list") |
| | | public R<List<SysEquTypeVo>> list(SysEquTypeBo bo) { |
| | | List<SysEquTypeVo> list = sysEquTypeService.queryList(bo); |
| | | public R<List<EimsEquTypeVo>> list(EimsEquTypeBo bo) { |
| | | List<EimsEquTypeVo> list = eimsEquTypeService.queryList(bo); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | */ |
| | | @SaCheckPermission("eims:equType:list") |
| | | @GetMapping("/tree") |
| | | public R<List<Tree<Long>>> equTypeTree(SysEquTypeBo bo) { |
| | | return R.ok(sysEquTypeService.selectEquTypeTreeList(bo)); |
| | | public R<List<Tree<Long>>> equTypeTree(EimsEquTypeBo bo) { |
| | | return R.ok(eimsEquTypeService.selectEquTypeTreeList(bo)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @SaCheckPermission("eims:equType:export") |
| | | @Log(title = "设å¤ç±»å", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(SysEquTypeBo bo, HttpServletResponse response) { |
| | | List<SysEquTypeVo> list = sysEquTypeService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "设å¤ç±»å", SysEquTypeVo.class, response); |
| | | public void export(EimsEquTypeBo bo, HttpServletResponse response) { |
| | | List<EimsEquTypeVo> list = eimsEquTypeService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "设å¤ç±»å", EimsEquTypeVo.class, response); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @SaCheckPermission("eims:equType:query") |
| | | @GetMapping("/{equTypeId}") |
| | | public R<SysEquTypeVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | public R<EimsEquTypeVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long equTypeId) { |
| | | return R.ok(sysEquTypeService.queryById(equTypeId)); |
| | | return R.ok(eimsEquTypeService.queryById(equTypeId)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "设å¤ç±»å", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody SysEquTypeBo bo) { |
| | | return toAjax(sysEquTypeService.insertByBo(bo)); |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsEquTypeBo bo) { |
| | | return toAjax(eimsEquTypeService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "设å¤ç±»å", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysEquTypeBo bo) { |
| | | return toAjax(sysEquTypeService.updateByBo(bo)); |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsEquTypeBo bo) { |
| | | return toAjax(eimsEquTypeService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.warn("è¯·éæ©éè¦å é¤çæ°æ®"); |
| | | } |
| | | for (int i = 0; i < equTypeIds.length; i++) { |
| | | if (sysEquTypeService.hasChildByEquTypeId(equTypeIds[i])) { |
| | | if (eimsEquTypeService.hasChildByEquTypeId(equTypeIds[i])) { |
| | | return R.warn("åå¨åèå,ä¸å
许å é¤"); |
| | | } |
| | | } |
| | | |
| | | return toAjax(sysEquTypeService.deleteWithValidByIds(List.of(equTypeIds), true)); |
| | | return toAjax(eimsEquTypeService.deleteWithValidByIds(List.of(equTypeIds), true)); |
| | | } |
| | | } |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/SysEqu.java ÐÞ¸Ä |
| | |
| | | import java.io.Serial; |
| | | |
| | | /** |
| | | * ã设å¤å°è´¦ã对象 sys_equ |
| | | * ã设å¤å°è´¦ã对象 eims_equ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-04 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("sys_equ") |
| | | public class SysEqu extends BaseEntity { |
| | | @TableName("eims_equ") |
| | | public class EimsEqu extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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_equ_statu |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-14 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("eims_equ_statu") |
| | | public class EimsEquStatu extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 设å¤ç¶æè®°å½id |
| | | */ |
| | | @TableId(value = "equ_statu_id") |
| | | private Long equStatuId; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | private Long equId; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | private String beforeChange; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | private String afterChange; |
| | | |
| | | /** |
| | | * åæ´æ¥æ |
| | | */ |
| | | private Date changeDate; |
| | | |
| | | /** |
| | | * åæ´äºº |
| | | */ |
| | | private Long changeUser; |
| | | |
| | | /** |
| | | * åæ´äººé¨é¨ |
| | | */ |
| | | private Long userDept; |
| | | |
| | | /** |
| | | * åæ´æè¿° |
| | | */ |
| | | private String changeDesc; |
| | | |
| | | /** |
| | | * æè¿° |
| | | */ |
| | | 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_equ_trial |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("eims_equ_trial") |
| | | public class EimsEquTrial extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * è¯ç¨è®°å½id |
| | | */ |
| | | @TableId(value = "trial_id") |
| | | private Long trialId; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | private Long equId; |
| | | |
| | | /** |
| | | * è¯äº§æ°é |
| | | */ |
| | | private Long trialNum; |
| | | |
| | | /** |
| | | * è¯äº§æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date trialDate; |
| | | |
| | | /** |
| | | * è¯åæ°é |
| | | */ |
| | | private Long proGoodNum; |
| | | |
| | | /** |
| | | * è¯åç |
| | | */ |
| | | private Long proGoodRate; |
| | | |
| | | /** |
| | | * æä½äººé¨é¨ |
| | | */ |
| | | private Long operatorDept; |
| | | |
| | | /** |
| | | * æä½äºº(id) |
| | | */ |
| | | private Long operatorId; |
| | | |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date startTime; |
| | | |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date endTime; |
| | | |
| | | /** |
| | | * è¿è¡æ¶é¿ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date runTime; |
| | | |
| | | /** |
| | | * åæºæ¶é¿ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date stopTime; |
| | | |
| | | /** |
| | | * 计åè¿è¡æ¶é¿ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date planRunTime; |
| | | |
| | | /** |
| | | * è°è¯å±¥å |
| | | */ |
| | | private String debugHistory; |
| | | |
| | | /** |
| | | * 设å¤ç»¼åæç |
| | | */ |
| | | private Long oee; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/SysEquType.java ÐÞ¸Ä |
| | |
| | | import java.io.Serial; |
| | | |
| | | /** |
| | | * 设å¤ç±»å对象 sys_equ_type |
| | | * 设å¤ç±»å对象 eims_equ_type |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-06 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("sys_equ_type") |
| | | public class SysEquType extends BaseEntity { |
| | | @TableName("eims_equ_type") |
| | | public class EimsEquType extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/SysEquBo.java ÐÞ¸Ä |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.dromara.eims.domain.SysEqu; |
| | | import org.dromara.eims.domain.EimsEqu; |
| | | import io.github.linpeilie.annotations.AutoMapper; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * ã设å¤å°è´¦ãä¸å¡å¯¹è±¡ sys_equipment |
| | | * ã设å¤å°è´¦ãä¸å¡å¯¹è±¡ eims_equ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-04 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = SysEqu.class, reverseConvertGenerate = false) |
| | | public class SysEquBo extends BaseEntity { |
| | | @AutoMapper(target = EimsEqu.class, reverseConvertGenerate = false) |
| | | public class EimsEquBo extends BaseEntity { |
| | | |
| | | /** |
| | | * |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import org.dromara.eims.domain.EimsEquStatu; |
| | | 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_equ_statu |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-14 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = EimsEquStatu.class, reverseConvertGenerate = false) |
| | | public class EimsEquStatuBo extends BaseEntity { |
| | | |
| | | /** |
| | | * 设å¤ç¶æè®°å½id |
| | | */ |
| | | private Long equStatuId; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | private Long equId; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | private String beforeChange; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | private String afterChange; |
| | | |
| | | /** |
| | | * åæ´æ¥æ |
| | | */ |
| | | private Date changeDate; |
| | | |
| | | /** |
| | | * åæ´äºº |
| | | */ |
| | | private Long changeUser; |
| | | |
| | | /** |
| | | * åæ´äººé¨é¨ |
| | | */ |
| | | private Long userDept; |
| | | |
| | | /** |
| | | * åæ´æè¿° |
| | | */ |
| | | @NotBlank(message = "åæ´æè¿°ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String changeDesc; |
| | | |
| | | /** |
| | | * æè¿° |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import org.dromara.eims.domain.EimsEquTrial; |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | 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; |
| | | |
| | | /** |
| | | * 设å¤è¯äº§è®°å½ä¸å¡å¯¹è±¡ sys_equ_trial |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-09 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = EimsEquTrial.class, reverseConvertGenerate = false) |
| | | public class EimsEquTrialBo extends BaseEntity { |
| | | |
| | | /** |
| | | * è¯ç¨è®°å½id |
| | | */ |
| | | @NotNull(message = "è¯ç¨è®°å½idä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long trialId; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | private Long equId; |
| | | |
| | | /** |
| | | * è¯äº§æ°é |
| | | */ |
| | | private Long trialNum; |
| | | |
| | | /** |
| | | * è¯äº§æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date trialDate; |
| | | |
| | | /** |
| | | * è¯åæ°é |
| | | */ |
| | | private Long proGoodNum; |
| | | |
| | | /** |
| | | * è¯åç |
| | | */ |
| | | private Long proGoodRate; |
| | | |
| | | /** |
| | | * æä½äººé¨é¨ |
| | | */ |
| | | private Long operatorDept; |
| | | |
| | | /** |
| | | * æä½äºº(id) |
| | | */ |
| | | private Long operatorId; |
| | | |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date startTime; |
| | | |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date endTime; |
| | | |
| | | /** |
| | | * è¿è¡æ¶é¿ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date runTime; |
| | | |
| | | /** |
| | | * åæºæ¶é¿ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date stopTime; |
| | | |
| | | /** |
| | | * 计åè¿è¡æ¶é¿ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date planRunTime; |
| | | |
| | | /** |
| | | * è°è¯å±¥å |
| | | */ |
| | | private String debugHistory; |
| | | |
| | | /** |
| | | * 设å¤ç»¼åæç |
| | | */ |
| | | private Long oee; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/bo/SysEquTypeBo.java ÐÞ¸Ä |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import org.dromara.eims.domain.SysEquType; |
| | | import org.dromara.eims.domain.EimsEquType; |
| | | 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.*; |
| | | |
| | | /** |
| | | * 设å¤ç±»åä¸å¡å¯¹è±¡ sys_equ_type |
| | |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = SysEquType.class, reverseConvertGenerate = false) |
| | | public class SysEquTypeBo extends BaseEntity { |
| | | @AutoMapper(target = EimsEquType.class, reverseConvertGenerate = false) |
| | | public class EimsEquTypeBo extends BaseEntity { |
| | | |
| | | /** |
| | | * ç±»åid |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.EimsEquStatu; |
| | | 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_equ_statu |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-14 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = EimsEquStatu.class) |
| | | public class EimsEquStatuVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 设å¤ç¶æè®°å½id |
| | | */ |
| | | @ExcelProperty(value = "设å¤ç¶æè®°å½id") |
| | | private Long equStatuId; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | @ExcelProperty(value = "设å¤id") |
| | | private Long equId; |
| | | |
| | | /** |
| | | * 设å¤åç§° |
| | | */ |
| | | @Translation(type = TransConstant.EQU_ID_TO_NAME, mapper = "equId") |
| | | private String equName; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | @ExcelProperty(value = "åæ´åç¶æ") |
| | | private String beforeChange; |
| | | |
| | | /** |
| | | * åæ´åç¶æ |
| | | */ |
| | | @ExcelProperty(value = "åæ´åç¶æ") |
| | | private String afterChange; |
| | | |
| | | /** |
| | | * åæ´æ¥æ |
| | | */ |
| | | @ExcelProperty(value = "åæ´æ¥æ") |
| | | private Date changeDate; |
| | | |
| | | /** |
| | | * åæ´äºº |
| | | */ |
| | | private Long changeUser; |
| | | |
| | | @ExcelProperty(value = "åæ´äºº") |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "changeUser") |
| | | private String changeUserName; |
| | | |
| | | /** |
| | | * åæ´äººé¨é¨ |
| | | */ |
| | | @ExcelProperty(value = "åæ´äººé¨é¨") |
| | | private Long userDept; |
| | | |
| | | /** |
| | | * åæ´æè¿° |
| | | */ |
| | | @ExcelProperty(value = "åæ´æè¿°") |
| | | private String changeDesc; |
| | | |
| | | /** |
| | | * æè¿° |
| | | */ |
| | | @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.EimsEquTrial; |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import io.github.linpeilie.annotations.AutoMapper; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | |
| | | |
| | | /** |
| | | * 设å¤è¯äº§è®°å½è§å¾å¯¹è±¡ eims_equ_trial |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-09 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = EimsEquTrial.class) |
| | | public class EimsEquTrialVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * è¯ç¨è®°å½id |
| | | */ |
| | | @ExcelProperty(value = "è¯ç¨è®°å½id") |
| | | private Long trialId; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | @ExcelProperty(value = "设å¤id") |
| | | private Long equId; |
| | | /** |
| | | * 设å¤åç§° |
| | | */ |
| | | @Translation(type = TransConstant.EQU_ID_TO_NAME, mapper = "equId") |
| | | private String equName; |
| | | |
| | | /** |
| | | * è¯äº§æ°é |
| | | */ |
| | | @ExcelProperty(value = "è¯äº§æ°é") |
| | | private Long trialNum; |
| | | |
| | | /** |
| | | * è¯äº§æ¥æ |
| | | */ |
| | | @ExcelProperty(value = "è¯äº§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date trialDate; |
| | | |
| | | /** |
| | | * è¯åæ°é |
| | | */ |
| | | @ExcelProperty(value = "è¯åæ°é") |
| | | private Long proGoodNum; |
| | | |
| | | /** |
| | | * è¯åç |
| | | */ |
| | | @ExcelProperty(value = "è¯åç") |
| | | private Long proGoodRate; |
| | | |
| | | /** |
| | | * æä½äººé¨é¨ |
| | | */ |
| | | private Long operatorDept; |
| | | |
| | | /** |
| | | * æä½äºº(id) |
| | | */ |
| | | @ExcelProperty(value = "æä½äºº(id)") |
| | | private Long operatorId; |
| | | /** |
| | | * æä½äºº |
| | | */ |
| | | @ExcelProperty(value = "æä½äºº") |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "operatorId") |
| | | private String operatorName; |
| | | |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "å¼å§æ¶é´") |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date startTime; |
| | | |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "ç»ææ¶é´") |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date endTime; |
| | | |
| | | /** |
| | | * è¿è¡æ¶é¿ |
| | | */ |
| | | @ExcelProperty(value = "è¿è¡æ¶é¿") |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date runTime; |
| | | |
| | | /** |
| | | * åæºæ¶é¿ |
| | | */ |
| | | @ExcelProperty(value = "åæºæ¶é¿") |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date stopTime; |
| | | |
| | | /** |
| | | * 计åè¿è¡æ¶é¿ |
| | | */ |
| | | @ExcelProperty(value = "计åè¿è¡æ¶é¿") |
| | | @JsonFormat(pattern = "HH:mm:ss") |
| | | private Date planRunTime; |
| | | |
| | | /** |
| | | * è°è¯å±¥å |
| | | */ |
| | | @ExcelProperty(value = "è°è¯å±¥å") |
| | | private String debugHistory; |
| | | |
| | | /** |
| | | * 设å¤ç»¼åæç |
| | | */ |
| | | @ExcelProperty(value = "设å¤ç»¼åæç") |
| | | private Long oee; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | |
| | | } |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/SysEquTypeVo.java ÐÞ¸Ä |
| | |
| | | package org.dromara.eims.domain.vo; |
| | | |
| | | import org.dromara.eims.domain.SysEquType; |
| | | import org.dromara.eims.domain.EimsEquType; |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import org.dromara.common.excel.annotation.ExcelDictFormat; |
| | |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = SysEquType.class) |
| | | public class SysEquTypeVo implements Serializable { |
| | | @AutoMapper(target = EimsEquType.class) |
| | | public class EimsEquTypeVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | private List<SysEquTypeVo> children; |
| | | private List<EimsEquTypeVo> children; |
| | | |
| | | |
| | | } |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/domain/vo/SysEquVo.java ÐÞ¸Ä |
| | |
| | | import java.util.Date; |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | 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.SysEqu; |
| | | import org.dromara.eims.domain.EimsEqu; |
| | | import org.dromara.common.excel.annotation.ExcelDictFormat; |
| | | import org.dromara.common.excel.convert.ExcelDictConvert; |
| | | import io.github.linpeilie.annotations.AutoMapper; |
| | |
| | | |
| | | |
| | | /** |
| | | * ã设å¤å°è´¦ãè§å¾å¯¹è±¡ sys_equipment |
| | | * ã设å¤å°è´¦ãè§å¾å¯¹è±¡ eims_equ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-04 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = SysEqu.class) |
| | | public class SysEquVo implements Serializable { |
| | | @AutoMapper(target = EimsEqu.class) |
| | | public class EimsEquVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import org.dromara.eims.domain.EimsEqu; |
| | | import org.dromara.eims.domain.vo.EimsEquVo; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | |
| | | /** |
| | | * ã设å¤å°è´¦ãMapperæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-04 |
| | | */ |
| | | public interface EimsEquMapper extends BaseMapperPlus<EimsEqu, EimsEquVo> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import org.dromara.eims.domain.EimsEquStatu; |
| | | import org.dromara.eims.domain.vo.EimsEquStatuVo; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | |
| | | /** |
| | | * 设å¤ç¶æè®°å½Mapperæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-14 |
| | | */ |
| | | public interface EimsEquStatuMapper extends BaseMapperPlus<EimsEquStatu, EimsEquStatuVo> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import org.dromara.eims.domain.EimsEquTrial; |
| | | import org.dromara.eims.domain.vo.EimsEquTrialVo; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | |
| | | /** |
| | | * 设å¤è¯äº§è®°å½Mapperæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-09 |
| | | */ |
| | | public interface EimsEquTrialMapper extends BaseMapperPlus<EimsEquTrial, EimsEquTrialVo> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import org.dromara.eims.domain.EimsEquType; |
| | | import org.dromara.eims.domain.vo.EimsEquTypeVo; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | |
| | | /** |
| | | * 设å¤ç±»åMapperæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-06 |
| | | */ |
| | | public interface EimsEquTypeMapper extends BaseMapperPlus<EimsEquType, EimsEquTypeVo> { |
| | | |
| | | } |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/ISysEquService.java ÐÞ¸Ä |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | |
| | | import org.dromara.eims.domain.bo.SysEquBo; |
| | | import org.dromara.eims.domain.vo.SysEquVo; |
| | | import org.dromara.eims.domain.bo.EimsEquBo; |
| | | import org.dromara.eims.domain.vo.EimsEquVo; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | |
| | |
| | | * @author zhuguifei |
| | | * @date 2025-01-04 |
| | | */ |
| | | public interface ISysEquService { |
| | | public interface IEimsEquService { |
| | | |
| | | /** |
| | | * æ¥è¯¢ã设å¤å°è´¦ã |
| | |
| | | * @param equId ä¸»é® |
| | | * @return ã设å¤å°è´¦ã |
| | | */ |
| | | SysEquVo queryById(Long equId); |
| | | EimsEquVo queryById(Long equId); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ã设å¤å°è´¦ãå表 |
| | |
| | | * @param pageQuery å页忰 |
| | | * @return ã设å¤å°è´¦ãå页å表 |
| | | */ |
| | | TableDataInfo<SysEquVo> queryPageList(SysEquBo bo, PageQuery pageQuery); |
| | | TableDataInfo<EimsEquVo> queryPageList(EimsEquBo bo, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çã设å¤å°è´¦ãå表 |
| | |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ã设å¤å°è´¦ãå表 |
| | | */ |
| | | List<SysEquVo> queryList(SysEquBo bo); |
| | | List<EimsEquVo> queryList(EimsEquBo bo); |
| | | |
| | | /** |
| | | * æ°å¢ã设å¤å°è´¦ã |
| | |
| | | * @param bo ã设å¤å°è´¦ã |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | Boolean insertByBo(SysEquBo bo); |
| | | Boolean insertByBo(EimsEquBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ã设å¤å°è´¦ã |
| | |
| | | * @param bo ã设å¤å°è´¦ã |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(SysEquBo bo); |
| | | Boolean updateByBo(EimsEquBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ã设å¤å°è´¦ãä¿¡æ¯ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.eims.domain.vo.EimsEquStatuVo; |
| | | import org.dromara.eims.domain.bo.EimsEquStatuBo; |
| | | 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-01-14 |
| | | */ |
| | | public interface IEimsEquStatuService { |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤ç¶æè®°å½ |
| | | * |
| | | * @param equStatuId ä¸»é® |
| | | * @return 设å¤ç¶æè®°å½ |
| | | */ |
| | | EimsEquStatuVo queryById(Long equStatuId); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢è®¾å¤ç¶æè®°å½å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return 设å¤ç¶æè®°å½å页å表 |
| | | */ |
| | | TableDataInfo<EimsEquStatuVo> queryPageList(EimsEquStatuBo bo, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶ç设å¤ç¶æè®°å½å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return 设å¤ç¶æè®°å½å表 |
| | | */ |
| | | List<EimsEquStatuVo> queryList(EimsEquStatuBo bo); |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤ç¶æè®°å½ |
| | | * |
| | | * @param bo 设å¤ç¶æè®°å½ |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | Boolean insertByBo(EimsEquStatuBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤ç¶æè®°å½ |
| | | * |
| | | * @param bo 设å¤ç¶æè®°å½ |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(EimsEquStatuBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤è®¾å¤ç¶æè®°å½ä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.eims.domain.vo.EimsEquTrialVo; |
| | | import org.dromara.eims.domain.bo.EimsEquTrialBo; |
| | | 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-01-09 |
| | | */ |
| | | public interface IEimsEquTrialService { |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤è¯äº§è®°å½ |
| | | * |
| | | * @param trialId ä¸»é® |
| | | * @return 设å¤è¯äº§è®°å½ |
| | | */ |
| | | EimsEquTrialVo queryById(Long trialId); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢è®¾å¤è¯äº§è®°å½å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return 设å¤è¯äº§è®°å½å页å表 |
| | | */ |
| | | TableDataInfo<EimsEquTrialVo> queryPageList(EimsEquTrialBo bo, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶ç设å¤è¯äº§è®°å½å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return 设å¤è¯äº§è®°å½å表 |
| | | */ |
| | | List<EimsEquTrialVo> queryList(EimsEquTrialBo bo); |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤è¯äº§è®°å½ |
| | | * |
| | | * @param bo 设å¤è¯äº§è®°å½ |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | Boolean insertByBo(EimsEquTrialBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤è¯äº§è®°å½ |
| | | * |
| | | * @param bo 设å¤è¯äº§è®°å½ |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(EimsEquTrialBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤è®¾å¤è¯äº§è®°å½ä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | } |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/ISysEquTypeService.java ÐÞ¸Ä |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import cn.hutool.core.lang.tree.Tree; |
| | | import org.dromara.eims.domain.vo.SysEquTypeVo; |
| | | import org.dromara.eims.domain.bo.SysEquTypeBo; |
| | | import org.dromara.eims.domain.bo.EimsEquTypeBo; |
| | | import org.dromara.eims.domain.vo.EimsEquTypeVo; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | |
| | | * @author zhuguifei |
| | | * @date 2025-01-06 |
| | | */ |
| | | public interface ISysEquTypeService { |
| | | public interface IEimsEquTypeService { |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤ç±»å |
| | |
| | | * @param equTypeId ä¸»é® |
| | | * @return 设å¤ç±»å |
| | | */ |
| | | SysEquTypeVo queryById(Long equTypeId); |
| | | EimsEquTypeVo queryById(Long equTypeId); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return 设å¤ç±»åå表 |
| | | */ |
| | | List<SysEquTypeVo> queryList(SysEquTypeBo bo); |
| | | List<EimsEquTypeVo> queryList(EimsEquTypeBo bo); |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤ç±»å |
| | |
| | | * @param bo 设å¤ç±»å |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | Boolean insertByBo(SysEquTypeBo bo); |
| | | Boolean insertByBo(EimsEquTypeBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤ç±»å |
| | |
| | | * @param bo 设å¤ç±»å |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(SysEquTypeBo bo); |
| | | Boolean updateByBo(EimsEquTypeBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤è®¾å¤ç±»åä¿¡æ¯ |
| | |
| | | * @param bo |
| | | * @return æ å表 |
| | | */ |
| | | List<Tree<Long>> selectEquTypeTreeList(SysEquTypeBo bo); |
| | | List<Tree<Long>> selectEquTypeTreeList(EimsEquTypeBo bo); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.dromara.common.core.service.EquService; |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | import org.dromara.eims.domain.EimsEqu; |
| | | import org.dromara.eims.domain.EimsEquType; |
| | | import org.dromara.eims.domain.bo.EimsEquBo; |
| | | import org.dromara.eims.domain.vo.EimsEquTypeVo; |
| | | import org.dromara.eims.domain.vo.EimsEquVo; |
| | | import org.dromara.eims.mapper.EimsEquMapper; |
| | | import org.dromara.eims.mapper.EimsEquTypeMapper; |
| | | import org.dromara.eims.service.IEimsEquService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * ã设å¤å°è´¦ãServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-04 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class EimsEquServiceImpl implements IEimsEquService, EquService { |
| | | |
| | | private final EimsEquMapper baseMapper; |
| | | private final EimsEquTypeMapper equTypeMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢ã设å¤å°è´¦ã |
| | | * |
| | | * @param equId ä¸»é® |
| | | * @return ã设å¤å°è´¦ã |
| | | */ |
| | | @Override |
| | | public EimsEquVo queryById(Long equId){ |
| | | return baseMapper.selectVoById(equId); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ã设å¤å°è´¦ãå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ã设å¤å°è´¦ãå页å表 |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsEquVo> queryPageList(EimsEquBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<EimsEqu> lqw = buildQueryWrapper(bo); |
| | | Page<EimsEquVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çã设å¤å°è´¦ãå表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ã设å¤å°è´¦ãå表 |
| | | */ |
| | | @Override |
| | | public List<EimsEquVo> queryList(EimsEquBo bo) { |
| | | LambdaQueryWrapper<EimsEqu> lqw = buildQueryWrapper(bo); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<EimsEqu> buildQueryWrapper(EimsEquBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<EimsEqu> lqw = Wrappers.lambdaQuery(); |
| | | lqw.like(StringUtils.isNotBlank(bo.getAssetNo()), EimsEqu::getAssetNo, bo.getAssetNo()); |
| | | Long equTypeId = bo.getEquTypeId(); |
| | | /** |
| | | * equTypeId = 0 æ¶æ¥è¯¢ææè®¾å¤ï¼é»è®¤æ ¹ç®å½id为0ï¼è¯¦è§SysEquTypeServiceImplä¸selectEquTypeTreeListï¼ |
| | | * equTypeId 为å
¶ä»å¼æ¶åªæ¥å½å设å¤ç±»åidåå代设å¤ç±»åid |
| | | */ |
| | | if (equTypeId != null && equTypeId > 0) { |
| | | List<Long> allDescendantIds = getAllDescendantIds(equTypeId); |
| | | lqw.in(EimsEqu::getEquTypeId,allDescendantIds); |
| | | } |
| | | |
| | | lqw.like(StringUtils.isNotBlank(bo.getEquName()), EimsEqu::getEquName, bo.getEquName()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getModelNo()), EimsEqu::getModelNo, bo.getModelNo()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getMadeIn()), EimsEqu::getMadeIn, bo.getMadeIn()); |
| | | lqw.eq(bo.getRatedPower() != null, EimsEqu::getRatedPower, bo.getRatedPower()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getPlateInfo()), EimsEqu::getPlateInfo, bo.getPlateInfo()); |
| | | lqw.eq(bo.getPurchaseDate() != null, EimsEqu::getPurchaseDate, bo.getPurchaseDate()); |
| | | lqw.eq(bo.getStatus() != null, EimsEqu::getStatus, bo.getStatus()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getLocation()), EimsEqu::getLocation, bo.getLocation()); |
| | | lqw.eq(bo.getDeptUsed() != null, EimsEqu::getDeptUsed, bo.getDeptUsed()); |
| | | lqw.eq(bo.getRespPerson() != null, EimsEqu::getRespPerson, bo.getRespPerson()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getContactPhone()), EimsEqu::getContactPhone, bo.getContactPhone()); |
| | | lqw.eq(bo.getDeployDate() != null, EimsEqu::getDeployDate, bo.getDeployDate()); |
| | | lqw.eq(bo.getTrialDate() != null, EimsEqu::getTrialDate, bo.getTrialDate()); |
| | | lqw.eq(bo.getPlanAcceptDate() != null, EimsEqu::getPlanAcceptDate, bo.getPlanAcceptDate()); |
| | | lqw.eq(bo.getActualAcceptDate() != null, EimsEqu::getActualAcceptDate, bo.getActualAcceptDate()); |
| | | lqw.eq(bo.getImportStatus() != null, EimsEqu::getImportStatus, bo.getImportStatus()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getEquCode()), EimsEqu::getEquCode, bo.getEquCode()); |
| | | lqw.eq(bo.getInventoryFlag() != null, EimsEqu::getInventoryFlag, bo.getInventoryFlag()); |
| | | lqw.eq(bo.getInventoryDate() != null, EimsEqu::getInventoryDate, bo.getInventoryDate()); |
| | | lqw.eq(bo.getServiceLife() != null, EimsEqu::getServiceLife, bo.getServiceLife()); |
| | | lqw.between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | EimsEqu::getDeployDate, params.get("beginTime"), params.get("endTime")); |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®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<EimsEquType> equTypeWrapper = new QueryWrapper<>(); |
| | | equTypeWrapper.lambda().eq(EimsEquType::getParentId, currentId); |
| | | |
| | | List<EimsEquTypeVo> children = equTypeMapper.selectVoList(equTypeWrapper); |
| | | if (children != null && !children.isEmpty()) { |
| | | for (EimsEquTypeVo child : children) { |
| | | Long childId = child.getEquTypeId(); |
| | | collector.add(childId); |
| | | collectDescendants(childId, collector); |
| | | } |
| | | } |
| | | } |
| | | /** |
| | | * æ°å¢ã设å¤å°è´¦ã |
| | | * |
| | | * @param bo ã设å¤å°è´¦ã |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | @Override |
| | | public Boolean insertByBo(EimsEquBo bo) { |
| | | EimsEqu add = MapstructUtils.convert(bo, EimsEqu.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | | bo.setEquId(add.getEquId()); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ã设å¤å°è´¦ã |
| | | * |
| | | * @param bo ã设å¤å°è´¦ã |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @Override |
| | | public Boolean updateByBo(EimsEquBo bo) { |
| | | EimsEqu update = MapstructUtils.convert(bo, EimsEqu.class); |
| | | validEntityBeforeSave(update); |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(EimsEqu 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 selectEquNameByIds(String equIds) { |
| | | List<String> list = new ArrayList<>(); |
| | | for (Long id : StringUtils.splitTo(equIds, Convert::toLong)) { |
| | | EimsEquVo vo = SpringUtils.getAopProxy(this).queryById(id); |
| | | if (ObjectUtil.isNotNull(vo)) { |
| | | list.add(vo.getEquName()); |
| | | } |
| | | } |
| | | return String.join(StringUtils.SEPARATOR, list); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.dromara.eims.domain.EimsEqu; |
| | | import org.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.bo.EimsEquStatuBo; |
| | | import org.dromara.eims.domain.vo.EimsEquStatuVo; |
| | | import org.dromara.eims.domain.EimsEquStatu; |
| | | import org.dromara.eims.mapper.EimsEquStatuMapper; |
| | | import org.dromara.eims.service.IEimsEquStatuService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * 设å¤ç¶æè®°å½Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-14 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class EimsEquStatuServiceImpl implements IEimsEquStatuService { |
| | | |
| | | private final EimsEquStatuMapper baseMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤ç¶æè®°å½ |
| | | * |
| | | * @param equStatuId ä¸»é® |
| | | * @return 设å¤ç¶æè®°å½ |
| | | */ |
| | | @Override |
| | | public EimsEquStatuVo queryById(Long equStatuId){ |
| | | return baseMapper.selectVoById(equStatuId); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢è®¾å¤ç¶æè®°å½å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return 设å¤ç¶æè®°å½å页å表 |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsEquStatuVo> queryPageList(EimsEquStatuBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<EimsEquStatu> lqw = buildQueryWrapper(bo); |
| | | Page<EimsEquStatuVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶ç设å¤ç¶æè®°å½å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return 设å¤ç¶æè®°å½å表 |
| | | */ |
| | | @Override |
| | | public List<EimsEquStatuVo> queryList(EimsEquStatuBo bo) { |
| | | LambdaQueryWrapper<EimsEquStatu> lqw = buildQueryWrapper(bo); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<EimsEquStatu> buildQueryWrapper(EimsEquStatuBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<EimsEquStatu> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(bo.getEquId() != null, EimsEquStatu::getEquId, bo.getEquId()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getBeforeChange()), EimsEquStatu::getBeforeChange, bo.getBeforeChange()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getAfterChange()), EimsEquStatu::getAfterChange, bo.getAfterChange()); |
| | | lqw.eq(bo.getChangeUser() != null, EimsEquStatu::getChangeUser, bo.getChangeUser()); |
| | | lqw.between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | EimsEquStatu::getChangeDate, params.get("beginTime"), params.get("endTime")); |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤ç¶æè®°å½ |
| | | * |
| | | * @param bo 设å¤ç¶æè®°å½ |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | @Override |
| | | public Boolean insertByBo(EimsEquStatuBo bo) { |
| | | EimsEquStatu add = MapstructUtils.convert(bo, EimsEquStatu.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | | bo.setEquStatuId(add.getEquStatuId()); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤ç¶æè®°å½ |
| | | * |
| | | * @param bo 设å¤ç¶æè®°å½ |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @Override |
| | | public Boolean updateByBo(EimsEquStatuBo bo) { |
| | | EimsEquStatu update = MapstructUtils.convert(bo, EimsEquStatu.class); |
| | | validEntityBeforeSave(update); |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(EimsEquStatu 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.dromara.eims.domain.EimsEquTrial; |
| | | import org.dromara.eims.domain.bo.EimsEquTrialBo; |
| | | import org.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.vo.EimsEquTrialVo; |
| | | import org.dromara.eims.mapper.EimsEquTrialMapper; |
| | | import org.dromara.eims.service.IEimsEquTrialService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * 设å¤è¯äº§è®°å½Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-01-09 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class EimsEquTrialServiceImpl implements IEimsEquTrialService { |
| | | |
| | | private final EimsEquTrialMapper baseMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤è¯äº§è®°å½ |
| | | * |
| | | * @param trialId ä¸»é® |
| | | * @return 设å¤è¯äº§è®°å½ |
| | | */ |
| | | @Override |
| | | public EimsEquTrialVo queryById(Long trialId){ |
| | | return baseMapper.selectVoById(trialId); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢è®¾å¤è¯äº§è®°å½å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return 设å¤è¯äº§è®°å½å页å表 |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsEquTrialVo> queryPageList(EimsEquTrialBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<EimsEquTrial> lqw = buildQueryWrapper(bo); |
| | | Page<EimsEquTrialVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶ç设å¤è¯äº§è®°å½å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return 设å¤è¯äº§è®°å½å表 |
| | | */ |
| | | @Override |
| | | public List<EimsEquTrialVo> queryList(EimsEquTrialBo bo) { |
| | | LambdaQueryWrapper<EimsEquTrial> lqw = buildQueryWrapper(bo); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<EimsEquTrial> buildQueryWrapper(EimsEquTrialBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<EimsEquTrial> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(bo.getEquId() != null, EimsEquTrial::getEquId, bo.getEquId()); |
| | | lqw.eq(bo.getTrialNum() != null, EimsEquTrial::getTrialNum, bo.getTrialNum()); |
| | | lqw.eq(bo.getTrialDate() != null, EimsEquTrial::getTrialDate, bo.getTrialDate()); |
| | | lqw.eq(bo.getProGoodNum() != null, EimsEquTrial::getProGoodNum, bo.getProGoodNum()); |
| | | lqw.eq(bo.getProGoodRate() != null, EimsEquTrial::getProGoodRate, bo.getProGoodRate()); |
| | | lqw.eq(bo.getOperatorId() != null, EimsEquTrial::getOperatorId, bo.getOperatorId()); |
| | | lqw.eq(bo.getStartTime() != null, EimsEquTrial::getStartTime, bo.getStartTime()); |
| | | lqw.eq(bo.getEndTime() != null, EimsEquTrial::getEndTime, bo.getEndTime()); |
| | | lqw.eq(bo.getRunTime() != null, EimsEquTrial::getRunTime, bo.getRunTime()); |
| | | lqw.eq(bo.getStopTime() != null, EimsEquTrial::getStopTime, bo.getStopTime()); |
| | | lqw.eq(bo.getPlanRunTime() != null, EimsEquTrial::getPlanRunTime, bo.getPlanRunTime()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getDebugHistory()), EimsEquTrial::getDebugHistory, bo.getDebugHistory()); |
| | | lqw.eq(bo.getOee() != null, EimsEquTrial::getOee, bo.getOee()); |
| | | lqw.between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | EimsEquTrial::getTrialDate, params.get("beginTime"), params.get("endTime")); |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è®¾å¤è¯äº§è®°å½ |
| | | * |
| | | * @param bo 设å¤è¯äº§è®°å½ |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | @Override |
| | | public Boolean insertByBo(EimsEquTrialBo bo) { |
| | | EimsEquTrial add = MapstructUtils.convert(bo, EimsEquTrial.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | | bo.setTrialId(add.getTrialId()); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¾å¤è¯äº§è®°å½ |
| | | * |
| | | * @param bo 设å¤è¯äº§è®°å½ |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @Override |
| | | public Boolean updateByBo(EimsEquTrialBo bo) { |
| | | EimsEquTrial update = MapstructUtils.convert(bo, EimsEquTrial.class); |
| | | validEntityBeforeSave(update); |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(EimsEquTrial entity){ |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤è®¾å¤è¯äº§è®°å½ä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if(isValid){ |
| | | //TODO åä¸äºä¸å¡ä¸çæ ¡éª,夿æ¯å¦éè¦æ ¡éª |
| | | } |
| | | return baseMapper.deleteByIds(ids) > 0; |
| | | } |
| | | } |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/java/org/dromara/eims/service/impl/SysEquTypeServiceImpl.java ÐÞ¸Ä |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.dromara.common.core.utils.TreeBuildUtils; |
| | | import org.dromara.eims.domain.EimsEquType; |
| | | import org.dromara.eims.domain.bo.EimsEquTypeBo; |
| | | import org.dromara.eims.domain.vo.EimsEquTypeVo; |
| | | import org.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.bo.SysEquTypeBo; |
| | | import org.dromara.eims.domain.vo.SysEquTypeVo; |
| | | import org.dromara.eims.domain.SysEquType; |
| | | import org.dromara.eims.mapper.SysEquTypeMapper; |
| | | import org.dromara.eims.service.ISysEquTypeService; |
| | | import org.dromara.eims.mapper.EimsEquTypeMapper; |
| | | import org.dromara.eims.service.IEimsEquTypeService; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class SysEquTypeServiceImpl implements ISysEquTypeService, EquTypeService { |
| | | public class EimsEquTypeServiceImpl implements IEimsEquTypeService, EquTypeService { |
| | | |
| | | private final SysEquTypeMapper baseMapper; |
| | | private final EimsEquTypeMapper baseMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤ç±»å |
| | |
| | | * @return 设å¤ç±»å |
| | | */ |
| | | @Override |
| | | public SysEquTypeVo queryById(Long equTypeId){ |
| | | public EimsEquTypeVo queryById(Long equTypeId){ |
| | | return baseMapper.selectVoById(equTypeId); |
| | | } |
| | | |
| | |
| | | * @return 设å¤ç±»åå表 |
| | | */ |
| | | @Override |
| | | public List<SysEquTypeVo> queryList(SysEquTypeBo bo) { |
| | | LambdaQueryWrapper<SysEquType> lqw = buildQueryWrapper(bo); |
| | | public List<EimsEquTypeVo> queryList(EimsEquTypeBo bo) { |
| | | LambdaQueryWrapper<EimsEquType> lqw = buildQueryWrapper(bo); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<SysEquType> buildQueryWrapper(SysEquTypeBo bo) { |
| | | private LambdaQueryWrapper<EimsEquType> buildQueryWrapper(EimsEquTypeBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<SysEquType> lqw = Wrappers.lambdaQuery(); |
| | | lqw.like(StringUtils.isNotBlank(bo.getTypeName()), SysEquType::getTypeName, bo.getTypeName()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getTypeCode()), SysEquType::getTypeCode, bo.getTypeCode()); |
| | | lqw.eq(bo.getParentId() != null, SysEquType::getParentId, bo.getParentId()); |
| | | lqw.eq(bo.getOrderNum() != null, SysEquType::getOrderNum, bo.getOrderNum()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getMenuType()), SysEquType::getMenuType, bo.getMenuType()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getIcon()), SysEquType::getIcon, bo.getIcon()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysEquType::getStatus, bo.getStatus()); |
| | | LambdaQueryWrapper<EimsEquType> lqw = Wrappers.lambdaQuery(); |
| | | lqw.like(StringUtils.isNotBlank(bo.getTypeName()), EimsEquType::getTypeName, bo.getTypeName()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getTypeCode()), EimsEquType::getTypeCode, bo.getTypeCode()); |
| | | lqw.eq(bo.getParentId() != null, EimsEquType::getParentId, bo.getParentId()); |
| | | lqw.eq(bo.getOrderNum() != null, EimsEquType::getOrderNum, bo.getOrderNum()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getMenuType()), EimsEquType::getMenuType, bo.getMenuType()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getIcon()), EimsEquType::getIcon, bo.getIcon()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), EimsEquType::getStatus, bo.getStatus()); |
| | | return lqw; |
| | | } |
| | | |
| | |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | @Override |
| | | public Boolean insertByBo(SysEquTypeBo bo) { |
| | | SysEquType add = MapstructUtils.convert(bo, SysEquType.class); |
| | | public Boolean insertByBo(EimsEquTypeBo bo) { |
| | | EimsEquType add = MapstructUtils.convert(bo, EimsEquType.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @Override |
| | | public Boolean updateByBo(SysEquTypeBo bo) { |
| | | SysEquType update = MapstructUtils.convert(bo, SysEquType.class); |
| | | public Boolean updateByBo(EimsEquTypeBo bo) { |
| | | EimsEquType update = MapstructUtils.convert(bo, EimsEquType.class); |
| | | validEntityBeforeSave(update); |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(SysEquType entity){ |
| | | private void validEntityBeforeSave(EimsEquType entity){ |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public boolean hasChildByEquTypeId(Long equTypeId) { |
| | | return baseMapper.exists(new LambdaQueryWrapper<SysEquType>().eq(SysEquType::getParentId, equTypeId)); |
| | | return baseMapper.exists(new LambdaQueryWrapper<EimsEquType>().eq(EimsEquType::getParentId, equTypeId)); |
| | | } |
| | | /** |
| | | * è·å设å¤ç±»åæ å表 |
| | |
| | | * @return æ å表 |
| | | */ |
| | | @Override |
| | | public List<Tree<Long>> selectEquTypeTreeList(SysEquTypeBo bo) { |
| | | public List<Tree<Long>> selectEquTypeTreeList(EimsEquTypeBo bo) { |
| | | // åªæ¥è¯¢æªç¦ç¨é¨é¨ |
| | | bo.setStatus(UserConstants.DEPT_NORMAL); |
| | | LambdaQueryWrapper<SysEquType> lqw = buildQueryWrapper(bo); |
| | | List<SysEquTypeVo> equTypeVoList = baseMapper.selectVoList(lqw); |
| | | LambdaQueryWrapper<EimsEquType> lqw = buildQueryWrapper(bo); |
| | | List<EimsEquTypeVo> equTypeVoList = baseMapper.selectVoList(lqw); |
| | | |
| | | for (int i = 0; i < equTypeVoList.size(); i++) { |
| | | SysEquTypeVo sysEquTypeVo = equTypeVoList.get(i); |
| | | if(sysEquTypeVo.getParentId() == null){ |
| | | EimsEquTypeVo eimsEquTypeVo = equTypeVoList.get(i); |
| | | if(eimsEquTypeVo.getParentId() == null){ |
| | | equTypeVoList.get(i).setParentId(0L); |
| | | } |
| | | } |
| | | //å æ ¹ç®å½ |
| | | SysEquTypeVo root = new SysEquTypeVo(); |
| | | EimsEquTypeVo root = new EimsEquTypeVo(); |
| | | root.setEquTypeId(0L); |
| | | root.setMenuType("M"); |
| | | root.setTypeName("ææè®¾å¤"); |
| | |
| | | * @param equTypeVoList 设å¤ç±»åå表 |
| | | * @return 䏿æ ç»æå表 |
| | | */ |
| | | public List<Tree<Long>> buildEquTypeTreeSelect(List<SysEquTypeVo> equTypeVoList) { |
| | | public List<Tree<Long>> buildEquTypeTreeSelect(List<EimsEquTypeVo> equTypeVoList) { |
| | | if (CollUtil.isEmpty(equTypeVoList)) { |
| | | return CollUtil.newArrayList(); |
| | | } |
| | |
| | | public String selectEquTypeNameByIds(String equTypeIds) { |
| | | List<String> list = new ArrayList<>(); |
| | | for (Long id : StringUtils.splitTo(equTypeIds, Convert::toLong)) { |
| | | SysEquTypeVo vo = SpringUtils.getAopProxy(this).queryById(id); |
| | | EimsEquTypeVo vo = SpringUtils.getAopProxy(this).queryById(id); |
| | | if (ObjectUtil.isNotNull(vo)) { |
| | | list.add(vo.getTypeName()); |
| | | } |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/resources/mapper/eims/SysEquMapper.xml ÐÞ¸Ä |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.dromara.eims.mapper.SysEquMapper"> |
| | | <mapper namespace="org.dromara.eims.mapper.EimsEquMapper"> |
| | | |
| | | </mapper> |
copy from eims/ruoyi-modules/lb-eims/src/main/resources/mapper/eims/SysEquTypeMapper.xml
copy to eims/ruoyi-modules/lb-eims/src/main/resources/mapper/eims/EimsEquStatuMapper.xml
Îļþ´Ó eims/ruoyi-modules/lb-eims/src/main/resources/mapper/eims/SysEquTypeMapper.xml ¸´ÖÆ |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.dromara.eims.mapper.SysEquTypeMapper"> |
| | | <mapper namespace="org.dromara.eims.mapper.EimsEquStatuMapper"> |
| | | |
| | | </mapper> |
ÎļþÃû´Ó eims/ruoyi-modules/lb-eims/src/main/resources/mapper/eims/SysEquTypeMapper.xml ÐÞ¸Ä |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.dromara.eims.mapper.SysEquTypeMapper"> |
| | | <mapper namespace="org.dromara.eims.mapper.EimsEquTrialMapper"> |
| | | |
| | | </mapper> |
copy from eims/ruoyi-modules/lb-eims/src/main/resources/mapper/eims/SysEquTypeMapper.xml
copy to eims/ruoyi-modules/lb-eims/src/main/resources/mapper/eims/EimsEquTypeMapper.xml
Îļþ´Ó eims/ruoyi-modules/lb-eims/src/main/resources/mapper/eims/SysEquTypeMapper.xml ¸´ÖÆ |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.dromara.eims.mapper.SysEquTypeMapper"> |
| | | <mapper namespace="org.dromara.eims.mapper.EimsEquTypeMapper"> |
| | | |
| | | </mapper> |