¶Ô±ÈÐÂÎļþ |
| | |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | enum Api { |
| | | equStatu = '/eims/board/equStatu', |
| | | monthMaint = '/eims/board/monthMainit', |
| | | monthReq = '/eims/board/monthReq', |
| | | spareWarn = '/eims/board/spareWarn', |
| | | todayInsp = '/eims/board/todayInsp', |
| | | todoList = '/eims/board/todoList' |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ãtodolistãæ¿åæ°æ® |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export function queryTodoList(params?: any) { |
| | | return requestClient.get<any[]>(Api.todoList, { params }); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ãå¤ä»¶åºåé¢è¦ãæ¿åæ°æ® |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | export function querySpareWarn(params?: any) { |
| | | return requestClient.get<any>(Api.spareWarn, { params }); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ã设å¤ç¶æãæ¿åæ°æ® |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | export function queryEquStatu(params?: any) { |
| | | return requestClient.get<any>(Api.equStatu, { params }); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ãç¹æ£ç»è®¡ãæ¿åæ°æ® |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | export function queryTodayInsp(params?: any) { |
| | | return requestClient.get<any>(Api.todayInsp, { params }); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ãæ¬æç»´ä¿®ãæ¿åæ°æ® |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | export function queryMonthReq(params?: any) { |
| | | return requestClient.get<any>(Api.monthReq, { params }); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ãæ¬æä¿å
»ãæ¿åæ°æ® |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | export function queryMonthMainit(params?: any) { |
| | | return requestClient.get<any>(Api.monthMaint, { params }); |
| | | } |
| | |
| | | import type { RepairResVO } from './model'; |
| | | |
| | | import type { ID, IDS } from '#/api/common'; |
| | | import type { ID, IDS, PageResult } from '#/api/common'; |
| | | |
| | | import { commonExport } from '#/api/helper'; |
| | | import { requestClient } from '#/api/request'; |
| | |
| | | */ |
| | | |
| | | export function listRepairRes(params?: any) { |
| | | return requestClient.get<RepairResVO[]>(Api.repairResList, { params }); |
| | | // return requestClient.get<RepairResVO[]>(Api.repairResList, { params }); |
| | | return requestClient.get<PageResult<RepairResVO>>(Api.repairResList, { params }); |
| | | } |
| | | |
| | | /** |
| | |
| | | <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"> |
| | | <Image :preview="false" :width="40" src="/src/assets/logo.png" /> |
| | | <Image :preview="false" :width="40" src="/static/menu/ico7.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"> |
| | | <Image :preview="false" :width="40" src="/src/assets/logo.png" /> |
| | | <Image :preview="false" :width="40" src="/static/menu/ico1.png" /> |
| | | <div class="flex flex-col ml-6 mr-2"> |
| | | <span class="text-xl font-bold">86.6h</span> |
| | | <span class="text-xl font-bold">0.0h</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"> |
| | | <Image :preview="false" :width="40" src="/src/assets/logo.png" /> |
| | | <Image :preview="false" :width="40" src="/static/menu/ico5.png" /> |
| | | <div class="flex flex-col ml-6 mr-2"> |
| | | <span class="text-xl font-bold">0å
</span> |
| | | <span class="mt-5 text-gray-500">ç»´ä¿æ»è´¹ç¨</span> |
| | |
| | | </DescriptionsItem> |
| | | </Descriptions> |
| | | </TabPane> |
| | | <TabPane key="2" tab="ç»´ä¿®">Content of Tab Pane 2</TabPane> |
| | | <!-- <TabPane key="2" tab="ç»´ä¿®">Content of Tab Pane 2</TabPane> |
| | | <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="6" tab="éä»¶">Content of Tab Pane 3</TabPane> |
| | | <TabPane key="7" 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> |
| | |
| | | title: 'å·¥å
·(æ²»å
·)åç§°', |
| | | field: 'fixtureName', |
| | | minWidth: 140, |
| | | fixed: 'left' |
| | | fixed: 'left', |
| | | slots: { default: 'fixtureName' } |
| | | }, |
| | | |
| | | { |
| | |
| | | |
| | | import { Modal, Switch, Upload } from 'ant-design-vue'; |
| | | |
| | | import { downloadImportTemplate, equImportData } from '#/api/eims/equ'; |
| | | import { downloadImportTemplate, fixtureImportData } from '#/api/eims/fixture'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | |
| | | const emit = defineEmits<{ reload: [] }>(); |
| | |
| | | file: fileList.value[0]!.originFileObj as Blob, |
| | | updateSupport: unref(checked), |
| | | }; |
| | | const { code, msg } = await equImportData(data); |
| | | const { code, msg } = await fixtureImportData(data); |
| | | let modal = Modal.success; |
| | | if (code === 200) { |
| | | emit('reload'); |
| | |
| | | <BasicModal |
| | | :close-on-click-modal="false" |
| | | :fullscreen-button="false" |
| | | title="设å¤å¯¼å
¥" |
| | | title="å·¥å
·å¯¼å
¥" |
| | | > |
| | | <!-- z-indexä¸è®¾ç½®ä¼é®æ¡æ¨¡æ¿ä¸è½½loading --> |
| | | <!-- æå¨å¤ç è䏿¯æ¾å
¥æä»¶å°±ä¸ä¼ --> |
| | |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams), |
| | | cellClick: (e: any) => { |
| | | const { row } = e; |
| | | handleBorroeList(row); |
| | | // handleBorroeList(row); |
| | | } |
| | | } |
| | | }); |
| | |
| | | <a-button v-access:code="['eims:fixture:export']" @click="handleDownloadExcel"> |
| | | {{ $t('pages.common.export') }} |
| | | </a-button> |
| | | <!-- <a-button v-access:code="['eims:fixture:import']" @click="handleImport"> |
| | | <a-button v-access:code="['eims:fixture:import']" @click="handleImport"> |
| | | {{ $t('pages.common.import') }} |
| | | </a-button>--> |
| | | </a-button> |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #fixtureName="{ row }"> |
| | | <Space> |
| | | <a-button type="link" @click="handleBorroeList(row)"> {{ row.fixtureName }}</a-button> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button v-access:code="['eims:fixture:edit']" @click.stop="handleEdit(row)"> |
| | |
| | | <script setup lang="ts"> |
| | | import { onMounted, ref } from 'vue'; |
| | | import { computed, onMounted, ref } from 'vue'; |
| | | import { useRouter } from 'vue-router'; |
| | | |
| | | import { EchartsUI, type EchartsUIType, useEcharts } from '@vben/plugins/echarts'; |
| | | |
| | | import { AlertTwoTone, NotificationTwoTone, TagTwoTone } from '@ant-design/icons-vue'; |
| | | import { Avatar, Card, Col, Image, Row } from 'ant-design-vue'; |
| | | import { Card, Col, Image, Row, Skeleton } from 'ant-design-vue'; |
| | | |
| | | import { queryEquStatu, queryMonthMainit, queryMonthReq, querySpareWarn, queryTodayInsp, queryTodoList } from '#/api/eims/dashboard'; |
| | | import { listEqu } from '#/api/eims/equ'; |
| | | import { listRepairRes } from '#/api/eims/repair-res'; |
| | | |
| | | const router = useRouter(); |
| | | |
| | | const equTotal = ref<number>(0); |
| | | const equFaultTotal = ref<number>(0); |
| | | |
| | | const showInstSkeleton = ref<boolean>(true); |
| | | const showEquStatuSkeleton = ref<boolean>(true); |
| | | const showInspSkeleton = ref<boolean>(true); |
| | | const showRepairSkeleton = ref<boolean>(true); |
| | | const showMaintSkeleton = ref<boolean>(true); |
| | | |
| | | const instChart = ref<EchartsUIType>(); |
| | | const { renderEcharts: renderInstChart } = useEcharts(instChart); |
| | | const useStatuChart = ref<EchartsUIType>(); |
| | | const { renderEcharts: renderUseChart } = useEcharts(useStatuChart); |
| | | const inspChart = ref<EchartsUIType>(); |
| | | const { renderEcharts: renderInspChart } = useEcharts(inspChart); |
| | | const repairChart = ref<EchartsUIType>(); |
| | | const { renderEcharts: renderRepairChart } = useEcharts(repairChart); |
| | | const faultChart = ref<EchartsUIType>(); |
| | | const { renderEcharts: renderFaultChart } = useEcharts(faultChart); |
| | | const maintenChart = ref<EchartsUIType>(); |
| | | const { renderEcharts: renderMaintenChart } = useEcharts(maintenChart); |
| | | const maintChart = ref<EchartsUIType>(); |
| | | const { renderEcharts: renderMaintChart } = useEcharts(maintChart); |
| | | |
| | | const todoItems = ref<any>([ |
| | | { |
| | | completed: false, |
| | | content: `å®¡æ¥æè¿æäº¤å°Gitä»åºçå端代ç ï¼ç¡®ä¿ä»£ç è´¨éåè§èã`, |
| | | date: '2024-07-30 11:00:00', |
| | | title: '审æ¥åç«¯ä»£ç æäº¤' |
| | | }, |
| | | { |
| | | completed: true, |
| | | content: `æ£æ¥å¹¶ä¼åç³»ç»æ§è½ï¼éä½CPU使ç¨çã`, |
| | | date: '2024-07-30 11:00:00', |
| | | title: 'ç³»ç»æ§è½ä¼å' |
| | | content: `为æåç³»ç»ç¨³å®æ§åç¨æ·ä½éªï¼è®¾å¤ç®¡çç³»ç»å°äº 2025å¹´5æ25æ¥ï¼æææ¥ï¼åæ¨0:00è³4:00 è¿è¡ä¾è¡ç³»ç»ç»´æ¤å级ãæé´ç³»ç»å¯è½ææ¶æ æ³è®¿é®ï¼è¯·æ¨æåå好ç¸å
³å®æã`, |
| | | date: '2025-05-18 10:12:00', |
| | | title: 'ç³»ç»ç»´æ¤éç¥' |
| | | }, |
| | | { |
| | | completed: false, |
| | | content: `è¿è¡ç³»ç»å®å
¨æ£æ¥ï¼ç¡®ä¿æ²¡æå®å
¨æ¼æ´ææªææç访é®ã `, |
| | | date: '2024-07-30 11:00:00', |
| | | title: 'å®å
¨æ£æ¥' |
| | | }, |
| | | |
| | | content: `为è¿ä¸æ¥è§èè®¾å¤æ
éå¤çæµç¨ï¼å³æ¥èµ·ææè®¾å¤æ¥ä¿®ééè¿ç³»ç»âæ
éæ¥ä¿®âæ¨¡åæäº¤ç³è¯·ï¼è¯·å¿å使ç¨çº¿ä¸çº¸è´¨æµç¨ãææ¯æ¯æäººåå°ä¾æ®å·¥åä¼å
çº§åæ¶ååºå¤çã`, |
| | | date: '2024-07-28 14:30:00', |
| | | title: 'æ°å¢è®¾å¤æ¥ä¿®æµç¨è¯´æ' |
| | | } |
| | | ]); |
| | | const commonFunctions = ref<any>([ |
| | | { |
| | | completed: false, |
| | | content: `ä¿®å¤ç¨æ·æ¥åç页é¢UIæ¾ç¤ºé®é¢ï¼ç¡®ä¿å¨ä¸åæµè§å¨ä¸æ¾ç¤ºä¸è´ã `, |
| | | date: '2024-07-30 11:00:00', |
| | | title: 'ä¿®å¤UIæ¾ç¤ºé®é¢' |
| | | menu: 'æ
éæ¥ä¿®', |
| | | path: '/repair/repairReq', |
| | | icon: '/static/menu/ico1.png' |
| | | }, |
| | | { |
| | | menu: '维修工å', |
| | | path: '/repair/repairRes', |
| | | icon: '/static/menu/ico2.png' |
| | | }, |
| | | { |
| | | menu: 'ç¹æ£æ±æ»', |
| | | path: '/inspect/st', |
| | | icon: '/static/menu/ico3.png' |
| | | }, |
| | | { |
| | | menu: 'ç¹æ£è®¡å', |
| | | path: '/inspect/plan', |
| | | icon: '/static/menu/ico4.png' |
| | | }, |
| | | { |
| | | menu: 'ä¿å
»æ±æ»', |
| | | path: '/maint/st', |
| | | icon: '/static/menu/ico5.png' |
| | | }, |
| | | { |
| | | menu: 'ä¿å
»è®¡å', |
| | | path: '/maint/plan', |
| | | icon: '/static/menu/ico6.png' |
| | | }, |
| | | { |
| | | menu: '设å¤å°è´¦', |
| | | path: '/equ/ledger', |
| | | icon: '/static/menu/ico7.png' |
| | | } |
| | | ]); |
| | | |
| | | onMounted(() => { |
| | | const todoMenu = ref<any>([ |
| | | { |
| | | menu: 'æ
éæ¥ä¿®', |
| | | path: '/repair/repairReq', |
| | | icon: '/static/menu/ico1.png' |
| | | }, |
| | | { |
| | | menu: '维修任å¡', |
| | | path: '/repair/repairRes', |
| | | icon: '/static/menu/ico2.png' |
| | | }, |
| | | { |
| | | menu: 'ç»´ä¿®è¯ä»·', |
| | | path: '/repair/repairRes', |
| | | icon: '/static/menu/ico2.png' |
| | | }, |
| | | { |
| | | menu: 'ç¹æ£ä»»å¡', |
| | | path: '/inspect/st', |
| | | icon: '/static/menu/ico3.png' |
| | | }, |
| | | { |
| | | menu: 'ä¿å
»ä»»å¡', |
| | | path: '/maint/st', |
| | | icon: '/static/menu/ico5.png' |
| | | }, |
| | | { |
| | | menu: 'ç¶æåæ´', |
| | | path: '/equ/equStatu', |
| | | icon: '/static/menu/ico5.png' |
| | | }, |
| | | { |
| | | menu: '设å¤å°è´¦', |
| | | path: '/equ/ledger', |
| | | icon: '/static/menu/ico7.png' |
| | | } |
| | | ]); |
| | | |
| | | // å¤ä»¶é¢è¦ |
| | | const spareWarn = ref<any>({}); |
| | | // 设å¤ä½¿ç¨ç¶æ |
| | | const equStatu = ref<any>({}); |
| | | // 仿¥ç¹æ£ |
| | | const todayInsp = ref<any>({}); |
| | | // æ¬ææ
é |
| | | const monthReq = ref<any>({}); |
| | | // æ¬æä¿å
» |
| | | const monthMaint = ref<any>({}); |
| | | |
| | | const spareMenu = ref<any>([ |
| | | { |
| | | menu: 'å¤ä»¶å°è´¦', |
| | | path: '/spare/index', |
| | | icon: '/static/menu/ico8.png' |
| | | }, |
| | | { |
| | | menu: 'å
¥åºå', |
| | | path: '/spare/in', |
| | | icon: '/static/menu/ico9.png' |
| | | }, |
| | | { |
| | | menu: 'åºåºå', |
| | | path: '/spare/out', |
| | | icon: '/static/menu/ico10.png' |
| | | } |
| | | ]); |
| | | |
| | | function itemClick(item: any) { |
| | | router.push(item.path); |
| | | } |
| | | function goToKnowledge() { |
| | | router.push('/faultKnow'); |
| | | } |
| | | |
| | | function initInstChart(data: any) { |
| | | showInstSkeleton.value = false; |
| | | renderInstChart({ |
| | | series: [ |
| | | { |
| | |
| | | formatter(value: number) { |
| | | switch (value) { |
| | | case 0.125: { |
| | | return 'Grade D'; |
| | | return '严éæ
é'; |
| | | } |
| | | case 0.375: { |
| | | return 'Grade C'; |
| | | return 'æ¥éç»´æ¤'; |
| | | } |
| | | case 0.625: { |
| | | return 'Grade B'; |
| | | return 'åºæ¬å¯ç¨'; |
| | | } |
| | | case 0.875: { |
| | | return 'Grade A'; |
| | | return 'å¯é è¿è¡'; |
| | | } |
| | | // No default |
| | | } |
| | |
| | | }, |
| | | data: [ |
| | | { |
| | | value: 0.95, |
| | | value: data?.normal, |
| | | name: 'æ£å¸¸è®¾å¤å æ¯' |
| | | } |
| | | ] |
| | |
| | | trigger: 'item' |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function initEquStatuChart(data: any) { |
| | | showEquStatuSkeleton.value = false; |
| | | const keyList = Object.keys(data); |
| | | const valueList = Object.values(data); |
| | | renderUseChart({ |
| | | tooltip: { |
| | | trigger: 'axis', |
| | |
| | | }, |
| | | yAxis: { |
| | | type: 'category', |
| | | data: ['å¾
æ£', 'å¨ç¨', 'åç¨', 'å
¶ä»', 'æ¥åº'] |
| | | data: keyList |
| | | }, |
| | | series: [ |
| | | { |
| | | name: '2012', |
| | | name: '2025', |
| | | type: 'bar', |
| | | data: [10, 63, 21, 91, 8], |
| | | data: valueList, |
| | | label: { |
| | | show: true, |
| | | position: 'right' |
| | |
| | | } |
| | | ] |
| | | }); |
| | | renderRepairChart({ |
| | | } |
| | | |
| | | function initInspChart(data: any) { |
| | | showInspSkeleton.value = false; |
| | | const nameList = data?.data.map((item) => item.name); |
| | | renderInspChart({ |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | title: { |
| | | left: '18%', // åºäºå®¹å¨å®½åº¦ç50% |
| | | top: '35%', |
| | | text: `{a|10个}\n{b|æªä¿®å¤}\n{c|仿¥æ°å¢ +1}`, |
| | | textStyle: { |
| | | rich: { |
| | | a: { |
| | | color: '#4E5766', |
| | | fontSize: 20, |
| | | lineHeight: 30, |
| | | align: 'center' |
| | | }, |
| | | b: { |
| | | color: '#1C2029', |
| | | fontSize: 18, |
| | | lineHeight: 30, |
| | | align: 'center' |
| | | }, |
| | | c: { |
| | | color: '#ef6666', |
| | | fontSize: 15, |
| | | lineHeight: 30, |
| | | align: 'center' |
| | | } |
| | | } |
| | | } |
| | | trigger: 'item', |
| | | formatter: '{a} <br/>{b}: {c} ({d}%)' |
| | | }, |
| | | legend: { |
| | | orient: 'vertical', |
| | | top: 'center', |
| | | right: 'right', |
| | | left: '70%' |
| | | data: nameList |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | name: 'ç¹æ£é¡¹', |
| | | type: 'pie', |
| | | radius: ['40%', '65%'], // è°æ´å
å¤åå¾ |
| | | center: ['30%', '50%'], // å°é¥¼å¾ä¸å¿å左移ä¸ç¹ |
| | | avoidLabelOverlap: false, |
| | | itemStyle: { |
| | | borderRadius: 10, |
| | | borderColor: '#fff', |
| | | borderWidth: 2 |
| | | }, |
| | | selectedMode: 'single', |
| | | radius: [0, '30%'], |
| | | label: { |
| | | show: false, |
| | | position: 'center' |
| | | }, |
| | | emphasis: { |
| | | label: { |
| | | show: false, |
| | | fontSize: 40, |
| | | fontWeight: 'bold' |
| | | } |
| | | position: 'inner', |
| | | fontSize: 14 |
| | | }, |
| | | labelLine: { |
| | | show: false |
| | | }, |
| | | data: [ |
| | | { value: 10, name: 'å¾
æ¥å' }, |
| | | { value: 8, name: 'å¾
ç»´ä¿®' }, |
| | | { value: 9, name: 'ç»´ä¿®ä¸' }, |
| | | { value: 16, name: 'å®¡æ ¸ä¸' }, |
| | | { value: 8, name: 'å
¶ä»' } |
| | | ] |
| | | } |
| | | ] |
| | | }); |
| | | renderFaultChart({ |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'shadow' |
| | | } |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | xAxis: [ |
| | | data: data?.sub |
| | | }, |
| | | { |
| | | type: 'category', |
| | | data: ['smt', 'è´´çæº', 'æ³¨è¶æº'], |
| | | axisTick: { |
| | | alignWithLabel: true |
| | | } |
| | | } |
| | | ], |
| | | yAxis: [ |
| | | { |
| | | type: 'value' |
| | | } |
| | | ], |
| | | series: [ |
| | | { |
| | | name: 'Direct', |
| | | type: 'bar', |
| | | barWidth: 20, |
| | | data: [10, 8, 12], |
| | | name: 'ç¹æ£', |
| | | type: 'pie', |
| | | radius: ['45%', '60%'], |
| | | labelLine: { |
| | | length: 30 |
| | | }, |
| | | label: { |
| | | show: true, |
| | | position: 'top' |
| | | } |
| | | show: true |
| | | }, |
| | | data: data?.data |
| | | } |
| | | ] |
| | | }); |
| | | renderMaintenChart({ |
| | | } |
| | | |
| | | function initRepairChart(data: any) { |
| | | showRepairSkeleton.value = false; |
| | | renderRepairChart({ |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | title: { |
| | | left: '21%', // åºäºå®¹å¨å®½åº¦ç50% |
| | | top: '40%', |
| | | text: `{a|æ»å°æ°}\n{b|20}`, |
| | | text: `{a|æ»æ
é}\n{b|${data?.data?.length}}`, |
| | | textStyle: { |
| | | rich: { |
| | | a: { |
| | |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | name: '设å¤ç»´ä¿®', |
| | | type: 'pie', |
| | | radius: ['40%', '65%'], // è°æ´å
å¤åå¾ |
| | | center: ['30%', '50%'], // å°é¥¼å¾ä¸å¿å左移ä¸ç¹ |
| | |
| | | labelLine: { |
| | | show: false |
| | | }, |
| | | data: [ |
| | | { value: 10, name: 'æªä¿å
»' }, |
| | | { value: 8, name: 'å¾
ä¿å
»' }, |
| | | { value: 9, name: 'ä¿å
»ä¸' }, |
| | | { value: 16, name: 'å¾
æ¥å' } |
| | | ] |
| | | data: data?.data |
| | | } |
| | | ] |
| | | }); |
| | | } |
| | | |
| | | function initMaintChart(data: any) { |
| | | showMaintSkeleton.value = false; |
| | | renderMaintChart({ |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | title: { |
| | | left: '21%', // åºäºå®¹å¨å®½åº¦ç50% |
| | | top: '40%', |
| | | text: `{a|æ»ä¿å
»}\n{b|${data?.data?.length}}`, |
| | | textStyle: { |
| | | rich: { |
| | | a: { |
| | | color: '#4E5766', |
| | | fontSize: 20, |
| | | lineHeight: 30, |
| | | align: 'center' |
| | | }, |
| | | b: { |
| | | color: '#1C2029', |
| | | fontSize: 18, |
| | | lineHeight: 30, |
| | | align: 'center' |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | legend: { |
| | | orient: 'vertical', |
| | | top: 'center', |
| | | right: 'right', |
| | | left: '70%' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'ä¿å
»', |
| | | type: 'pie', |
| | | radius: ['40%', '65%'], // è°æ´å
å¤åå¾ |
| | | center: ['30%', '50%'], // å°é¥¼å¾ä¸å¿å左移ä¸ç¹ |
| | | avoidLabelOverlap: false, |
| | | itemStyle: { |
| | | borderRadius: 10, |
| | | borderColor: '#fff', |
| | | borderWidth: 2 |
| | | }, |
| | | label: { |
| | | show: false, |
| | | position: 'center' |
| | | }, |
| | | emphasis: { |
| | | label: { |
| | | show: false, |
| | | fontSize: 40, |
| | | fontWeight: 'bold' |
| | | } |
| | | }, |
| | | labelLine: { |
| | | show: false |
| | | }, |
| | | data: data?.data |
| | | } |
| | | ] |
| | | }); |
| | | } |
| | | |
| | | async function initData() { |
| | | const equResult = await listEqu(); |
| | | const repairRes = await listRepairRes(); |
| | | const equCount = equResult?.total || 0; |
| | | const rpairTotal = repairRes?.total || 0; |
| | | const instData = { normal: 0 }; |
| | | if (rpairTotal > 0 && equCount > 0) { |
| | | equTotal.value = equCount; |
| | | equFaultTotal.value = rpairTotal; |
| | | instData.normal = (equCount - rpairTotal) / equCount; |
| | | } |
| | | initInstChart(instData); |
| | | |
| | | const todoList = await queryTodoList(); |
| | | todoMenu.value = todoMenu.value.map((frontendItem: any) => { |
| | | // æ¥æ¾å¯¹åºmenuçåç«¯æ°æ® |
| | | const backendItem = todoList?.find((item: any) => item.menu === frontendItem.menu); |
| | | // 妿æ¾å°äºå¯¹åºçåç«¯æ°æ®ï¼ååå¹¶ä¹ï¼ä¸è¦çå·²æç屿§ï¼ |
| | | if (backendItem) { |
| | | frontendItem = { ...frontendItem, ...backendItem }; |
| | | } |
| | | return frontendItem; |
| | | }); |
| | | spareWarn.value = await querySpareWarn(); |
| | | equStatu.value = await queryEquStatu(); |
| | | initEquStatuChart(equStatu.value); |
| | | const tInsp = (await queryTodayInsp()) || {}; |
| | | todayInsp.value = tInsp; |
| | | initInspChart(tInsp); |
| | | monthReq.value = (await queryMonthReq()) || {}; |
| | | initRepairChart(monthReq.value); |
| | | monthMaint.value = (await queryMonthMainit()) || {}; |
| | | initMaintChart(monthMaint.value); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | initData(); |
| | | }); |
| | | |
| | | const todayInspTotal = computed(() => { |
| | | return todayInsp.value?.data?.reduce((sum, item) => sum + item.value, 0); |
| | | }); |
| | | |
| | | const todayInspFinish = computed(() => { |
| | | return todayInsp.value?.data?.filter((item) => item.name === '已宿').reduce((sum, item) => sum + item.value, 0); |
| | | }); |
| | | |
| | | const finishReqCount = computed(() => { |
| | | const completedItem = monthReq.value?.data?.find((item) => item.name === '已宿'); |
| | | return completedItem ? completedItem.value : 0; |
| | | }); |
| | | |
| | | const reqCount = computed(() => { |
| | | // 已宿 |
| | | return monthReq.value?.data?.reduce((sum, item) => sum + item.value, 0); |
| | | }); |
| | | |
| | | const maintCount = computed(() => { |
| | | // 已宿 |
| | | return monthMaint.value?.data?.reduce((sum, item) => sum + item.value, 0); |
| | | }); |
| | | |
| | | const finishMaintCount = computed(() => { |
| | | const completedItem = monthMaint.value?.data?.find((item) => item.name === '已宿'); |
| | | return completedItem ? completedItem.value : 0; |
| | | }); |
| | | </script> |
| | | |
| | |
| | | <label class="ml-2">常ç¨åè½</label> |
| | | </template> |
| | | <Row> |
| | | <Col v-for="i in 9" :span="8" class="flex cursor-pointer flex-col items-center justify-center py-6 hover:bg-gray-100"> |
| | | <Avatar size="large" src="/src/assets/logo.png"> |
| | | <!-- <template #icon> |
| | | <UserOutlined /> |
| | | </template>--> |
| | | </Avatar> |
| | | <label class="mt-1">设å¤å°è´¦{{ i }}</label> |
| | | <Col |
| | | v-for="(item, index) in commonFunctions" |
| | | :key="index" |
| | | :span="8" |
| | | class="flex cursor-pointer flex-col items-center justify-center py-6 hover:bg-gray-100" |
| | | @click.stop="itemClick(item)" |
| | | > |
| | | <Image :preview="false" :src="item.icon" :width="35" /> |
| | | <label class="mt-1"> {{ item.menu }}</label> |
| | | </Col> |
| | | </Row> |
| | | </Card> |
| | |
| | | <TagTwoTone /> |
| | | <span class="ml-2">使ç¨ç¶æ</span> |
| | | </template> |
| | | |
| | | <EchartsUI ref="useStatuChart" height="400px" /> |
| | | <Skeleton :loading="showInstSkeleton" :paragraph="{ rows: 12, width: 400 }" active> |
| | | <EchartsUI ref="useStatuChart" height="400px" /> |
| | | </Skeleton> |
| | | </Card> |
| | | |
| | | <Card :bordered="false" class="section-height mt-2 rounded-none"> |
| | | <template #title> |
| | | <TagTwoTone /> |
| | | <span class="ml-2">设å¤ç»´ä¿®</span> |
| | | <span class="ml-2">仿¥ç¹æ£</span> |
| | | </template> |
| | | <div class="flex w-full flex-col justify-center items-center"> |
| | | <div class="flex w-full py-3"> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl">3</span> |
| | | <span>ååºè¶
æ¶</span> |
| | | </div> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl">1</span> |
| | | <span>ç»´ä¿®è¶
æ¶</span> |
| | | </div> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl">0</span> |
| | | <span>åæºè¶
æ¶</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <EchartsUI ref="repairChart" height="300px" width="400px" /> |
| | | </div> |
| | | <Skeleton :loading="showInspSkeleton" :paragraph="{ rows: 12, width: 400 }" active> |
| | | <div class="flex w-full flex-col justify-center items-center"> |
| | | <div class="flex w-full py-3"> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl">{{ todayInspTotal }}</span> |
| | | <span>ç¹æ£æ¹æ¬¡</span> |
| | | </div> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl"></span> |
| | | <span> </span> |
| | | </div> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl">{{ todayInspFinish }}</span> |
| | | <span>已宿</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <EchartsUI ref="inspChart" height="300px" width="400px" /> |
| | | </div> |
| | | </Skeleton> |
| | | </Card> |
| | | </div> |
| | | |
| | | <div class="mr-2 w-1/3"> |
| | | <Card :bordered="false" class="section-height flex justify-center rounded-none p-0"> |
| | | <div class="w-full"> |
| | | <EchartsUI ref="instChart" width="400px" /> |
| | | |
| | | <div class="flex justify-around pb-5"> |
| | | <div class="w-full pt-4"> |
| | | <Skeleton :loading="showInstSkeleton" :paragraph="{ rows: 12, width: 400 }" active> |
| | | <div> |
| | | <div class="text-center text-4xl">100<label class="ml-1 text-xl font-bold">å°</label></div> |
| | | <div class="text-center font-bold">è®¾å¤æ»æ°</div> |
| | | </div> |
| | | <EchartsUI ref="instChart" width="400px" /> |
| | | <div class="flex justify-around pb-5"> |
| | | <div> |
| | | <div class="text-center text-4xl">{{ equTotal }}<label class="ml-1 text-xl font-bold">å°</label></div> |
| | | <div class="text-center font-bold">è®¾å¤æ»æ°</div> |
| | | </div> |
| | | |
| | | <div> |
| | | <div class="text-center text-4xl text-red-500">5<label class="ml-1 text-xl font-bold">å°</label></div> |
| | | <div class="text-center font-bold">æ
éæ»æ°</div> |
| | | <div> |
| | | <div class="text-center text-4xl text-red-500">{{ equFaultTotal }}<label class="ml-1 text-xl font-bold">å°</label></div> |
| | | <div class="text-center font-bold">æ
éæ»æ°</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </Skeleton> |
| | | </div> |
| | | </Card> |
| | | <Card :bordered="false" class="section-height mt-2 rounded-none"> |
| | |
| | | <Card :bordered="false" class="section-height mt-2 rounded-none"> |
| | | <template #title> |
| | | <TagTwoTone /> |
| | | <span class="ml-2">æ
éç»è®¡</span> |
| | | <span class="ml-2">æ¬æç»´ä¿®</span> |
| | | </template> |
| | | <span class="text-gray-500 text-xs ml-3">æ
鿬¡æ°:10</span> |
| | | <EchartsUI ref="faultChart" height="360px" /> |
| | | </Card> |
| | | <Skeleton :loading="showRepairSkeleton" :paragraph="{ rows: 12, width: 400 }" active> |
| | | <div class="flex w-full flex-col justify-center items-center"> |
| | | <div class="flex w-full py-3"> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl">{{ reqCount || 0 }}</span> |
| | | <span>æ¬ææ¥ä¿®</span> |
| | | </div> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl">{{ monthReq?.today?.length || 0 }}</span> |
| | | <span>仿¥æ°å¢</span> |
| | | </div> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl">{{ finishReqCount }}</span> |
| | | <span>æ¬æå®æ</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <EchartsUI ref="repairChart" height="300px" width="400px" /> |
| | | </div> |
| | | </Skeleton> |
| | | </Card> |
| | | </div> |
| | | |
| | | <div class="w-1/3"> |
| | | <div class="flex h-14 items-center justify-around rounded-none bg-white p-0"> |
| | | <div class="flex h-10 w-28 cursor-pointer items-center justify-around rounded-sm hover:bg-gray-100" style="background: #eaf3fe"> |
| | | <Image :preview="false" :width="20" src="/src/assets/logo.png" /> |
| | | <span class="mr-2 font-bold" style="color: #2d83f4">æ
éç¥è¯åº</span> |
| | | <Image :preview="false" :width="20" src="/static/menu/ico11.png" /> |
| | | <span class="mr-2 font-bold" style="color: #2d83f4" @click="goToKnowledge()">æ
éç¥è¯åº</span> |
| | | </div> |
| | | <div class="flex h-10 w-28 cursor-pointer items-center justify-around rounded-sm hover:bg-gray-100" style="background: #eaeafe"> |
| | | <Image :preview="false" :width="20" src="/src/assets/logo.png" /> |
| | | <Image :preview="false" :width="20" src="/static/menu/ico12.png" /> |
| | | <span class="mr-2 font-bold" style="color: #5070e0">æºè½æç´¢</span> |
| | | </div> |
| | | <div class="flex h-10 w-28 cursor-pointer items-center justify-around rounded-sm hover:bg-gray-100" style="background: #ebf8f7"> |
| | | <Image :preview="false" :width="20" src="/src/assets/logo.png" /> |
| | | <Image :preview="false" :width="20" src="/static/menu/ico13.png" /> |
| | | <span class="mr-2 font-bold" style="color: #32b9af">帮å©ä¸å¿</span> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="todo-title mt-5">设å¤ç®¡ç</div> |
| | | <div class="flex w-full flex-wrap justify-between"> |
| | | <div |
| | | v-for="index in 12" |
| | | v-for="(item, index) in todoMenu" |
| | | :class="{ |
| | | 'justify-center': index % 3 == 2, |
| | | 'justify-end': index % 3 == 0, |
| | | 'mt-2': index > 3 |
| | | 'justify-center': (index + 1) % 3 == 2, |
| | | 'justify-end': (index + 1) % 3 == 0, |
| | | 'mt-2': index > 2 |
| | | }" |
| | | class="flex w-1/3" |
| | | @click="itemClick(item)" |
| | | > |
| | | <div class="todo-box cursor-pointer hover:bg-gray-100"> |
| | | <Image :preview="false" :width="20" src="/src/assets/logo.png" /> |
| | | <span>æ
éå®¡æ ¸</span> |
| | | <span>{{ index }}</span> |
| | | <Image :preview="false" :src="item?.icon" :width="20" /> |
| | | <span>{{ item.menu }}</span> |
| | | <span>{{ item?.count || 0 }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="todo-title mt-20">å¤ä»¶ç®¡ç</div> |
| | | <div class="todo-title mt-44">å¤ä»¶ç®¡ç</div> |
| | | <div class="flex w-full flex-wrap justify-between"> |
| | | <div |
| | | v-for="index in 3" |
| | | v-for="(item, index) in spareMenu" |
| | | :class="{ |
| | | 'justify-center': index % 3 == 2, |
| | | 'justify-end': index % 3 == 0 |
| | | 'justify-center': (index + 1) % 3 == 2, |
| | | 'justify-end': (index + 1) % 3 == 0 |
| | | }" |
| | | class="flex w-1/3" |
| | | @click="itemClick(item)" |
| | | > |
| | | <div class="todo-box border-gray-100"> |
| | | <Image :preview="false" :width="20" src="/src/assets/logo.png" /> |
| | | <span>æ
éå®¡æ ¸</span> |
| | | <span>{{ index }}</span> |
| | | <Image :preview="false" :src="item?.icon" :width="20" /> |
| | | <span>{{ item.menu }}</span> |
| | | <span>{{}}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="up-info-box w-1/2 flex h-40"> |
| | | <div class="w-1/2 flex items-center h-full justify-center flex-col"> |
| | | <div class="w-16"> |
| | | <span class="text-xl text-green-600">7</span> |
| | | <span class="text-xl text-green-600">{{ spareWarn?.upper || 0 }}</span> |
| | | <span class="ml-1">ç§</span> |
| | | </div> |
| | | <div class="w-16">é«äºä¸é</div> |
| | | </div> |
| | | <div class="w-1/2 h-full flex items-center justify-center"> |
| | | <Image :preview="false" src="/src/assets/img/img-up-limit.png" /> |
| | | <Image :preview="false" src="/static/img/img-up-limit.png" /> |
| | | </div> |
| | | </div> |
| | | <div class="low-info-box w-1/2 flex h-40"> |
| | | <div class="w-1/2 flex items-center h-full justify-center flex-col"> |
| | | <div class="w-16"> |
| | | <span class="text-xl text-red-600">10</span> |
| | | <span class="text-xl text-red-600">{{ spareWarn?.lower || 0 }}</span> |
| | | <span class="ml-1">ç§</span> |
| | | </div> |
| | | <div class="w-16">ä½äºä¸é</div> |
| | | </div> |
| | | <div class="w-1/2 h-full flex items-center justify-center"> |
| | | <Image :preview="false" src="/src/assets/img/img-lower-limit.png" /> |
| | | <Image :preview="false" src="/static/img/img-lower-limit.png" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <Card :bordered="false" class="section-height mt-2 rounded-none"> |
| | | <template #title> |
| | | <TagTwoTone /> |
| | | <span class="ml-2">设å¤ä¿å
»</span> |
| | | <span class="ml-2">æ¬æä¿å
»</span> |
| | | </template> |
| | | <div class="flex w-full flex-col justify-center items-center"> |
| | | <div class="flex w-full py-3"> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl">3</span> |
| | | <span>æªä¿å
»</span> |
| | | <Skeleton :loading="showMaintSkeleton" :paragraph="{ rows: 12, width: 400 }" active> |
| | | <div class="flex w-full flex-col justify-center items-center"> |
| | | <div class="flex w-full py-3"> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl">{{ maintCount || 0 }}</span> |
| | | <span>æ¬æä¿å
»</span> |
| | | </div> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl">{{ maintCount - finishMaintCount }}</span> |
| | | <span>æªå®æ</span> |
| | | </div> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl">{{ finishMaintCount }}</span> |
| | | <span>已宿</span> |
| | | </div> |
| | | </div> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl">1</span> |
| | | <span>æ¬æå°æ</span> |
| | | </div> |
| | | <div class="flex flex-col justify-center items-center w-1/3"> |
| | | <span class="font-bold text-xl">0</span> |
| | | <span>䏿尿</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <EchartsUI ref="maintenChart" height="300px" width="400px" /> |
| | | </div> |
| | | <EchartsUI ref="maintChart" height="300px" width="400px" /> |
| | | </div> |
| | | </Skeleton> |
| | | </Card> |
| | | </div> |
| | | </div> |
| | |
| | | export enum DictEnum { |
| | | EIMS_EQU_PART = 'eims_equ_part', // 设å¤é¨ä½ |
| | | EIMS_SPARE_UNIT = 'eims_spare_unit', // å¤ä»¶è®¡éåä½ |
| | | EIMS_EQU_UNIT = 'eims_equ_unit', // 设å¤çç¹ç¶æ |
| | | EIMS_FAULT_REASON = 'eims_fault_reason', // æ
éåå |
| | | EIMS_FIXTURE_STATUS = 'eims_fixture_status', // å·¥å
·ï¼æ²»å
·ï¼ç¶æ |
| | |
| | | EIMS_INVENTORY_STATU = 'inventory_statu', // 设å¤çç¹ç¶æ |
| | | EIMS_MAINT_TYPE = 'eims_maint_type', // ä¿å
»ç±»å |
| | | EIMS_ORDITM_STATUS = 'eims_orditm_status', // ä¿å
»å·¥åæç»å®æç¶æ |
| | | EIMS_SPARE_UNIT = 'eims_spare_unit', // å¤ä»¶è®¡éåä½ |
| | | EQU_IMPORT_STATU = 'equ_import_status', // 设å¤å¯¼å
¥ç¶æ |
| | | FIXTURE_BORROW_RECORD_STATUS = 'fixture_borrow_record_status', // å·¥å
·ï¼æ²»å
·ï¼åç¨è®°å½ç¶æ |
| | | FIXTURE_BORROW_STATUS = 'fixture_borrow_status', // å·¥å
·ï¼æ²»å
·ï¼åç¨ç¶æ |
| | |
| | | REPAIR_FAULT_TYPE = 'repair_fault_type', // æ
éç±»å« |
| | | REPAIR_RECORD_HANDLE = 'repair_record_handle', // ç»´ä¿®è®°å½æä½ |
| | | REPAIR_REQ_STATUS = 'repair_req_status', // æ¥ä¿®ç¶æ |
| | | SPARE_INOUT_TYPE = 'spare_inout_type', // å¤ä»¶åºå
¥åºç±»å 1-å
¥åºå 2-åºåºå |
| | | REPAIR_REQ_TYPE = 'repair_req_type', // æ¥ä¿®ç±»å |
| | | REPAIR_RES_STATUS = 'repair_res_status', // ç»´ä¿®ç¶æ |
| | | REPAIR_URGENCY_LEVEL = 'repair_urgency_level', // æ¥ä¿®ç´§æ¥ç¨åº¦ |
| | | SPARE_INOUT_TYPE = 'spare_inout_type', // å¤ä»¶åºå
¥åºç±»å 1-å
¥åºå 2-åºåºå |
| | | SYS_COMMON_STATUS = 'sys_common_status', |
| | | SYS_DEVICE_TYPE = 'sys_device_type', // 设å¤ç±»å |
| | | SYS_EQU_STATUS = 'sys_equ_status', // 设å¤ç¶æ |
| | |
| | | * 设å¤åä½unit |
| | | */ |
| | | String EIMS_EQU_UNIT = "eims_equ_unit"; |
| | | /** |
| | | * å·¥å
·åä½ |
| | | */ |
| | | String EIMS_FIXTURE_UNIT = "eims_fixture_unit"; |
| | | |
| | | /** |
| | | * 设å¤ç¶æ |
| | | */ |
| | | String EIMS_EQU_STATUS = "sys_equ_status"; |
| | | |
| | | interface EIMS_EQU_STATUS_DETAIL { |
| | | /** |
| | | * è¯ç¨ |
| | | */ |
| | | String CESHI = "0"; |
| | | /** |
| | | * ä½¿ç¨ |
| | | */ |
| | | String SHIYONG = "1"; |
| | | /** |
| | | * åç¨ |
| | | */ |
| | | String TINGYONG = "2"; |
| | | /** |
| | | * æ¥åº |
| | | */ |
| | | String BAOFEI = "3"; |
| | | /** |
| | | * é²ç½® |
| | | */ |
| | | String XIANZHI = "4"; |
| | | /** |
| | | * æ°å¢ |
| | | */ |
| | | String XINZENG = "5"; |
| | | } |
| | | |
| | | /** |
| | | * 设å¤å¯¼å
¥ç¶æ |
| | |
| | | String REPAIR_REQ_STATUS = "repair_req_status"; |
| | | |
| | | interface REPAIR_REQ_STATUS_DETAIL { |
| | | /** |
| | | * å¾
æ¥å |
| | | */ |
| | | String DAIJIEDAN = "0"; |
| | | /** |
| | | * å·²æ¥å |
| | | */ |
| | |
| | | String Y = "1"; // å·²ç¹æ£ |
| | | } |
| | | |
| | | /** |
| | | *ç¹æ£ç»æ |
| | | */ |
| | | String EIMS_INSPECT_RESULT = "eims_inspect_result"; |
| | | interface EIMS_INSPECT_RESULT_DETAIL { |
| | | String N = "2";// å¼å¸¸ |
| | | String Y = "1"; // æ£å¸¸ |
| | | } |
| | | |
| | | |
| | | /** |
| | | *å¤ä»¶åºå
¥åºç±»å |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.dromara.common.core.constant.DictConstants; |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.common.core.utils.DateUtils; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import org.dromara.eims.domain.*; |
| | | import org.dromara.eims.domain.bo.EimsEquBo; |
| | | import org.dromara.eims.domain.vo.EimsInspectStVo; |
| | | import org.dromara.eims.domain.vo.EimsMaintOrderVo; |
| | | import org.dromara.eims.domain.vo.EimsRepairReqVo; |
| | | import org.dromara.eims.mapper.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/board") |
| | | public class BoardController { |
| | | private final EimsRepairReqMapper reqMapper; |
| | | private final EimsRepairResMapper resMapper; |
| | | private final EimsInspectStMapper inspStMapper; |
| | | private final EimsInspectRecordMapper inspRecordMapper; |
| | | private final EimsMaintStMapper maintStMapper; |
| | | private final EimsEquStatuMapper equStatuMapper; |
| | | private final EimsSpareMapper spareMapper; |
| | | private final EimsEquMapper equMapper; |
| | | private final EimsMaintOrderMapper maintOrderMapper; |
| | | |
| | | @GetMapping("/todoList") |
| | | public R<List<Map<String,Object>>> todoList() { |
| | | List<Map<String,Object>> result = new ArrayList<>(); |
| | | |
| | | // æ¥ä¿®å-å¾
æ¥å |
| | | LambdaQueryWrapper<EimsRepairReq> reqWrapper = new LambdaQueryWrapper<>(); |
| | | // å¾
æ¥å |
| | | reqWrapper.eq(EimsRepairReq::getStatus, DictConstants.REPAIR_REQ_STATUS_DETAIL.DAIJIEDAN); |
| | | Long reqCount = reqMapper.selectCount(reqWrapper); |
| | | Map<String,Object> reqMap = new HashMap<>(); |
| | | reqMap.put("menu","æ
éæ¥ä¿®"); |
| | | reqMap.put("count",reqCount); |
| | | result.add(reqMap); |
| | | |
| | | |
| | | //维修工å-æªå®æ |
| | | LambdaQueryWrapper<EimsRepairRes> resWrapper = new LambdaQueryWrapper<>(); |
| | | // æªå®æ |
| | | resWrapper.ne(EimsRepairRes::getStatus, DictConstants.REPAIR_RES_STATUS_DETAIL.WANCHENG); |
| | | Long resCount = resMapper.selectCount(resWrapper); |
| | | Map<String,Object> resMap = new HashMap<>(); |
| | | resMap.put("menu","维修任å¡"); |
| | | resMap.put("count",resCount); |
| | | result.add(resMap); |
| | | |
| | | //维修工å-è¯ä»· |
| | | LambdaQueryWrapper<EimsRepairRes> evWrapper = new LambdaQueryWrapper<>(); |
| | | evWrapper.isNull(EimsRepairRes::getFbId); |
| | | Long evCount = resMapper.selectCount(evWrapper); |
| | | Map<String,Object> evMap = new HashMap<>(); |
| | | evMap.put("menu","ç»´ä¿®è¯ä»·"); |
| | | evMap.put("count",evCount); |
| | | result.add(evMap); |
| | | |
| | | //ç¹æ£æ±æ»ä»»å¡ |
| | | LambdaQueryWrapper<EimsInspectSt> inspStWrapper = new LambdaQueryWrapper<>(); |
| | | //æªç¹æ£ |
| | | inspStWrapper.eq(EimsInspectSt::getStatus, DictConstants.EIMS_INSPECT_STATUS_DETAIL.N); |
| | | Long inspStCount = inspStMapper.selectCount(inspStWrapper); |
| | | Map<String,Object> inspStMap = new HashMap<>(); |
| | | inspStMap.put("menu","ç¹æ£ä»»å¡"); |
| | | inspStMap.put("count",inspStCount); |
| | | result.add(inspStMap); |
| | | |
| | | //ä¿å
»æ±æ»ä»»å¡ |
| | | LambdaQueryWrapper<EimsMaintSt> maintStWrapper = new LambdaQueryWrapper<>(); |
| | | //æªå®æå·¥åæ±æ» |
| | | maintStWrapper.eq(EimsMaintSt::getStatus,DictConstants.MAINT_ORDER_ST_STATUS_DETAIL.N); |
| | | Long maintStCount = maintStMapper.selectCount(maintStWrapper); |
| | | Map<String,Object> maintStMap = new HashMap<>(); |
| | | maintStMap.put("menu","ä¿å
»ä»»å¡"); |
| | | maintStMap.put("count",maintStCount); |
| | | result.add(maintStMap); |
| | | |
| | | //设å¤ç¶æåæ´ |
| | | LambdaQueryWrapper<EimsEquStatu> equStatuWrapper = new LambdaQueryWrapper<>(); |
| | | equStatuWrapper.isNotNull(EimsEquStatu::getChangeDate); |
| | | // è·åå½åæ¥æ |
| | | LocalDate today = LocalDate.now(); |
| | | // æé å½å¤©ç 00:00:00 |
| | | LocalDateTime startOfDay = today.atStartOfDay(); |
| | | // æé å½å¤©ç 23:59:59 |
| | | LocalDateTime endOfDay = today.atTime(23, 59, 59); |
| | | // å®ä¹æ ¼å¼åæ¨¡æ¿ |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | // æ ¼å¼åè¾åº |
| | | String startStr = startOfDay.format(formatter); |
| | | String endStr = endOfDay.format(formatter); |
| | | equStatuWrapper.between(EimsEquStatu::getChangeDate,startStr,endStr); |
| | | Long equStatuCount = equStatuMapper.selectCount(equStatuWrapper); |
| | | Map<String,Object> equStatuMap = new HashMap<>(); |
| | | equStatuMap.put("menu","ç¶æåæ´"); |
| | | equStatuMap.put("count",equStatuCount); |
| | | result.add(equStatuMap); |
| | | |
| | | return R.ok(result); |
| | | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/spareWarn") |
| | | public R<Map<String,Object>> spareWarn() { |
| | | Map<String,Object> result = new HashMap<>(); |
| | | |
| | | LambdaQueryWrapper<EimsSpare> spareUpWrapper = new LambdaQueryWrapper<>(); |
| | | spareUpWrapper.isNotNull(EimsSpare::getUpperStock) |
| | | .isNotNull(EimsSpare::getActualStock) |
| | | .gt(EimsSpare::getActualStock, 0) |
| | | .gt(EimsSpare::getUpperStock, 0) |
| | | .apply("actual_stock > upper_stock"); |
| | | Long upper = spareMapper.selectCount(spareUpWrapper); |
| | | |
| | | result.put("upper",upper); |
| | | |
| | | LambdaQueryWrapper<EimsSpare> spareLowWrapper = new LambdaQueryWrapper<>(); |
| | | spareLowWrapper.isNotNull(EimsSpare::getLowerStock) |
| | | .isNotNull(EimsSpare::getActualStock) |
| | | .gt(EimsSpare::getActualStock, 0) |
| | | .gt(EimsSpare::getLowerStock, 0) |
| | | .apply("actual_stock < lower_stock"); |
| | | Long lower = spareMapper.selectCount(spareLowWrapper); |
| | | result.put("lower",lower); |
| | | |
| | | return R.ok(result); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¾å¤å¨ç¨ç¶æ |
| | | * @return |
| | | */ |
| | | @GetMapping("/equStatu") |
| | | public R<Map<String,Integer>> queryEquStatu() { |
| | | List<EimsEqu> eimsEqus = equMapper.selectList(); |
| | | Map<String, Integer> result = countStatus(eimsEqus); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»å¤©ç¹æ£æ°æ® |
| | | * @return |
| | | */ |
| | | @GetMapping("/todayInsp") |
| | | public R<Map<String,Object>> todayInsp() { |
| | | Map<String, Object> result = new HashMap<>(); |
| | | List<Map<String, Object>> data = new ArrayList<>(); |
| | | List<Map<String, Object>> sub = new ArrayList<>(); |
| | | |
| | | // åå§åä¸»æ°æ®ç»è®¡é¡¹ |
| | | data.add(createDataItem("已宿", 0)); |
| | | data.add(createDataItem("æªå®æ", 0)); |
| | | |
| | | // åå§åå项ç»è®¡ |
| | | sub.add(createSubItem("æ£å¸¸", 0)); |
| | | sub.add(createSubItem("å¼å¸¸", 0)); |
| | | sub.add(createSubItem("æªæ£", 0)); |
| | | |
| | | result.put("data", data); |
| | | result.put("sub", sub); |
| | | |
| | | // æ¥è¯¢ä»æ¥è®¡åå·¡æ£ä»»å¡ |
| | | LambdaQueryWrapper<EimsInspectSt> inspStWrapper = new LambdaQueryWrapper<>(); |
| | | inspStWrapper.eq(EimsInspectSt::getType, "Day"); |
| | | inspStWrapper.eq(EimsInspectSt::getPlanTime, DateUtils.dateTimeNow(DateUtils.YYYY_MM_DD)); |
| | | List<EimsInspectStVo> inspectStList = inspStMapper.selectVoList(inspStWrapper); |
| | | |
| | | if (inspectStList == null || inspectStList.isEmpty()) { |
| | | return R.ok(result); |
| | | } |
| | | |
| | | long completedCount = 0; |
| | | List<String> stIdList = new ArrayList<>(); |
| | | |
| | | for (EimsInspectStVo item : inspectStList) { |
| | | if (DictConstants.EIMS_INSPECT_STATUS_DETAIL.Y.equals(item.getStatus())) { |
| | | completedCount++; |
| | | } |
| | | stIdList.add(item.getStId()); |
| | | } |
| | | |
| | | int total = inspectStList.size(); |
| | | data.get(0).put("value", completedCount); |
| | | data.get(1).put("value", total - completedCount); |
| | | |
| | | // æ¥è¯¢å·¡æ£è®°å½ |
| | | List<EimsInspectRecord> recordList = Collections.emptyList(); |
| | | if (!stIdList.isEmpty()) { |
| | | QueryWrapper<EimsInspectRecord> recordWrapper = new QueryWrapper<>(); |
| | | recordWrapper.in("st_id", stIdList); |
| | | recordList = inspRecordMapper.selectList(recordWrapper); |
| | | } |
| | | |
| | | if (recordList == null || recordList.isEmpty()) { |
| | | return R.ok(result); |
| | | } |
| | | |
| | | long normalCount = 0; |
| | | long abnormalCount = 0; |
| | | |
| | | for (EimsInspectRecord record : recordList) { |
| | | String status = record.getStatus(); |
| | | if (DictConstants.EIMS_INSPECT_RESULT_DETAIL.Y.equals(status)) { |
| | | normalCount++; |
| | | } else if (DictConstants.EIMS_INSPECT_RESULT_DETAIL.N.equals(status)) { |
| | | abnormalCount++; |
| | | } |
| | | } |
| | | |
| | | int unCheckedCount = recordList.size() - (int) (normalCount + abnormalCount); |
| | | |
| | | sub.get(0).put("value", normalCount); |
| | | sub.get(1).put("value", abnormalCount); |
| | | sub.get(2).put("value", unCheckedCount); |
| | | |
| | | return R.ok(result); |
| | | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/monthReq") |
| | | public R<Map<String,Object>> monthReq() { |
| | | Map<String,Object> result = new HashMap<>(); |
| | | List<Map<String, Object>> statusList = new ArrayList<>(); |
| | | LocalDate today = LocalDate.now(); |
| | | LambdaQueryWrapper<EimsRepairReq> queryWrapper = new LambdaQueryWrapper<EimsRepairReq>() |
| | | .between(EimsRepairReq::getOccTime, |
| | | today.with(TemporalAdjusters.firstDayOfMonth()), |
| | | today.with(TemporalAdjusters.lastDayOfMonth())); |
| | | List<EimsRepairReqVo> reqList = reqMapper.selectVoList(queryWrapper); |
| | | long todayCount = reqList.stream() |
| | | .filter(r -> r.getReqTime() != null && |
| | | r.getReqTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate().isEqual(LocalDate.now())) |
| | | .count(); |
| | | if (reqList != null && !reqList.isEmpty()) { |
| | | // å设 reqList å·²ç»ä»æ°æ®åºæ¥è¯¢åºæ¥ï¼å¹¶ä¸ä¸ä¸ºç©º |
| | | Map<String, Long> statusCountMap = reqList.stream() |
| | | .collect(Collectors.groupingBy( |
| | | item -> { |
| | | switch (item.getStatus()) { |
| | | case "0": return "å¾
æ¥å"; |
| | | case "1": return "å·²æ¥å"; |
| | | case "2": return "ç»´ä¿®ä¸"; |
| | | case "3": return "已宿"; |
| | | default: return "æªç¥ç¶æ"; |
| | | } |
| | | }, |
| | | Collectors.counting() |
| | | )); |
| | | |
| | | // æåºå®é¡ºåºæåºçæ List<Map<String, Object>> |
| | | |
| | | statusList.add(Map.of("name", "å¾
æ¥å", "value", statusCountMap.getOrDefault("å¾
æ¥å", 0L))); |
| | | statusList.add(Map.of("name", "å·²æ¥å", "value", statusCountMap.getOrDefault("å·²æ¥å", 0L))); |
| | | statusList.add(Map.of("name", "ç»´ä¿®ä¸", "value", statusCountMap.getOrDefault("ç»´ä¿®ä¸", 0L))); |
| | | statusList.add(Map.of("name", "已宿", "value", statusCountMap.getOrDefault("已宿", 0L))); |
| | | } |
| | | result.put("data",statusList); |
| | | result.put("today",todayCount); |
| | | return R.ok(result); |
| | | |
| | | } |
| | | |
| | | @GetMapping("/monthMainit") |
| | | public R<Map<String,Object>> monthMainit() { |
| | | Map<String,Object> result = new HashMap<>(); |
| | | List<Map<String, Object>> statusList = new ArrayList<>(); |
| | | LocalDate today = LocalDate.now(); |
| | | LambdaQueryWrapper<EimsMaintOrder> queryWrapper = new LambdaQueryWrapper<EimsMaintOrder>() |
| | | .between(EimsMaintOrder::getPlanTime, |
| | | today.with(TemporalAdjusters.firstDayOfMonth()), |
| | | today.with(TemporalAdjusters.lastDayOfMonth())); |
| | | List<EimsMaintOrderVo> orderList = maintOrderMapper.selectVoList(queryWrapper); |
| | | long todayCount = orderList.stream() |
| | | .filter(r -> r.getPlanTime() != null && |
| | | r.getPlanTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate().isEqual(LocalDate.now())) |
| | | .count(); |
| | | if (orderList != null && !orderList.isEmpty()) { |
| | | |
| | | Map<String, Long> statusCountMap = orderList.stream() |
| | | .collect(Collectors.groupingBy( |
| | | item -> { |
| | | switch (item.getStatus()) { |
| | | case "0": return "å¾
ä¿å
»"; |
| | | case "1": return "ä¿å
»ä¸"; |
| | | case "2": return "å¾
éªè¯"; |
| | | case "3": return "已宿"; |
| | | default: return "æªç¥ç¶æ"; |
| | | } |
| | | }, |
| | | Collectors.counting() |
| | | )); |
| | | |
| | | // æåºå®é¡ºåºæåºçæ List<Map<String, Object>> |
| | | |
| | | statusList.add(Map.of("name", "å¾
ä¿å
»", "value", statusCountMap.getOrDefault("å¾
ä¿å
»", 0L))); |
| | | statusList.add(Map.of("name", "ä¿å
»ä¸", "value", statusCountMap.getOrDefault("ä¿å
»ä¸", 0L))); |
| | | statusList.add(Map.of("name", "å¾
éªè¯", "value", statusCountMap.getOrDefault("å¾
éªè¯", 0L))); |
| | | statusList.add(Map.of("name", "已宿", "value", statusCountMap.getOrDefault("已宿", 0L))); |
| | | } |
| | | result.put("data",statusList); |
| | | result.put("today",todayCount); |
| | | return R.ok(result); |
| | | |
| | | } |
| | | |
| | | // è¾
婿¹æ³ï¼åå»ºä¸»æ°æ®é¡¹ |
| | | private Map<String, Object> createDataItem(String name, long value) { |
| | | Map<String, Object> item = new HashMap<>(); |
| | | item.put("name", name); |
| | | item.put("value", value); |
| | | return item; |
| | | } |
| | | |
| | | // è¾
婿¹æ³ï¼åå»ºåæ°æ®é¡¹ |
| | | private Map<String, Object> createSubItem(String name, long value) { |
| | | Map<String, Object> item = new HashMap<>(); |
| | | item.put("name", name); |
| | | item.put("value", value); |
| | | return item; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç»è®¡åç¶æè®¾å¤æ°é |
| | | * @param eimsEqus |
| | | * @return |
| | | */ |
| | | public static Map<String, Integer> countStatus(List<EimsEqu> eimsEqus) { |
| | | Map<String, Integer> statusCount = new HashMap<>(); |
| | | Map<String, String> statusMap = new HashMap<String, String>() {{ |
| | | put("0", "è¯ç¨"); |
| | | put("1", "使ç¨"); |
| | | put("2", "åç¨"); |
| | | put("3", "æ¥åº"); |
| | | put("4", "é²ç½®"); |
| | | put("5", "æ°å¢"); |
| | | put("å
¶ä»", "å
¶ä»"); |
| | | }}; |
| | | |
| | | for (EimsEqu equ : eimsEqus) { |
| | | String status = equ.getStatus(); |
| | | status = (status == null || status.trim().isEmpty()) ? "å
¶ä»" : status; |
| | | if(statusMap.containsKey(status)){ |
| | | statusCount.put(statusMap.get(status), statusCount.getOrDefault(statusMap.get(status), 0) + 1); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | return statusCount; |
| | | } |
| | | |
| | | } |
| | |
| | | package org.dromara.eims.controller; |
| | | |
| | | import java.util.ArrayList; |
| | | 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.common.excel.core.ExcelResult; |
| | | import org.dromara.eims.domain.vo.EimsEquImportVo; |
| | | import org.dromara.eims.domain.vo.EimsEquVo; |
| | | import org.dromara.eims.domain.vo.EimsFixtureImportVo; |
| | | import org.dromara.eims.listener.EimsEquImportListener; |
| | | import org.dromara.eims.listener.EimsFixtureImportListener; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.dromara.common.idempotent.annotation.RepeatSubmit; |
| | |
| | | import org.dromara.eims.domain.bo.EimsFixtureBo; |
| | | import org.dromara.eims.service.IEimsFixtureService; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | | * å·¥å
·(æ²»å
·)å°è´¦ |
| | |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(eimsFixtureService.deleteWithValidByIds(List.of(ids), true)); |
| | | } |
| | | |
| | | /** |
| | | * 导å
¥æ°æ® |
| | | * |
| | | * @param file 导å
¥æä»¶ |
| | | * @param updateSupport æ¯å¦æ´æ°å·²å卿°æ® |
| | | */ |
| | | @Log(title = "å·¥å
·ç®¡ç", businessType = BusinessType.IMPORT) |
| | | @SaCheckPermission("eims:fixture:import") |
| | | @PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) |
| | | public R<Void> importData(@RequestPart("file") MultipartFile file, boolean updateSupport) throws Exception { |
| | | ExcelResult<EimsFixtureImportVo> result = ExcelUtil.importExcel(file.getInputStream(), EimsFixtureImportVo.class, new EimsFixtureImportListener(updateSupport)); |
| | | return R.ok(result.getAnalysis()); |
| | | } |
| | | |
| | | /** |
| | | * è·å导å
¥æ¨¡æ¿ |
| | | */ |
| | | @PostMapping("/importTemplate") |
| | | public void importTemplate(HttpServletResponse response) { |
| | | ExcelUtil.exportExcel(new ArrayList<>(), "è®¾å¤æ°æ®", EimsFixtureVo.class, response); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package org.dromara.eims.domain; |
| | | |
| | | import org.apache.poi.hpsf.Decimal; |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | |
| | | */ |
| | | private Long curBorrowId; |
| | | |
| | | /** |
| | | * æ°é |
| | | */ |
| | | private Integer amount; |
| | | |
| | | /** |
| | | * åç |
| | | */ |
| | | private String brand; |
| | | |
| | | /** |
| | | * åä½ |
| | | */ |
| | | private String unit; |
| | | |
| | | /** |
| | | * 使ç¨é¨é¨ |
| | | */ |
| | | private Long useDept; |
| | | |
| | | /** |
| | | * 管ç人 |
| | | */ |
| | | private Long manageUser; |
| | | |
| | | /** |
| | | * 管æ§éæ± |
| | | */ |
| | | private String isManage; |
| | | |
| | | /** |
| | | * åä»· |
| | | */ |
| | | private BigDecimal unitPrice; |
| | | |
| | | /** |
| | | * åç |
| | | */ |
| | | private String power; |
| | | |
| | | } |
| | |
| | | * æ±æ»ç±»å Day-æ¥æ±æ» Month-ææ±æ» |
| | | */ |
| | | private String type; |
| | | private String stId; |
| | | |
| | | /** |
| | | * æ é¢ |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import org.apache.poi.hpsf.Decimal; |
| | | import org.dromara.common.excel.annotation.ExcelDictFormat; |
| | | import org.dromara.common.excel.convert.ExcelDictConvert; |
| | | import org.dromara.eims.domain.EimsFixture; |
| | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | |
| | | private Long curBorrowId; |
| | | |
| | | |
| | | /** |
| | | * æ°é |
| | | */ |
| | | private Integer amount; |
| | | |
| | | /** |
| | | * åç |
| | | */ |
| | | private String brand; |
| | | |
| | | /** |
| | | * åä½ |
| | | */ |
| | | private String unit; |
| | | |
| | | /** |
| | | * 使ç¨é¨é¨ |
| | | */ |
| | | private Long useDept; |
| | | |
| | | /** |
| | | * 管ç人 |
| | | */ |
| | | private Long manageUser; |
| | | |
| | | /** |
| | | * 管æ§éæ± |
| | | */ |
| | | private String isManage; |
| | | |
| | | /** |
| | | * åä»· |
| | | */ |
| | | private BigDecimal unitPrice; |
| | | |
| | | /** |
| | | * åç |
| | | */ |
| | | private String power; |
| | | |
| | | |
| | | } |
| | |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | private String stId; |
| | | |
| | | |
| | | |
| | | //å端ç颿¥çæ¨¡å¼ day-æ¥è§å¾ month-æè§å¾ |
| | | private String viewMode; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.apache.poi.hpsf.Decimal; |
| | | import org.dromara.common.excel.annotation.ExcelDictFormat; |
| | | import org.dromara.common.excel.convert.ExcelDictConvert; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * å·¥å
·å¯¹è±¡å¯¼å
¥VO |
| | | * |
| | | * @author zhuguifei |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | public class EimsFixtureImportVo implements Serializable { |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * |
| | | */ |
| | | private Long id; |
| | | |
| | | |
| | | |
| | | /** |
| | | * æ²»å
·åç§° |
| | | */ |
| | | @ExcelProperty(value = "å·¥å
·åç§°") |
| | | @ColumnWidth(30) |
| | | private String fixtureName; |
| | | |
| | | /** |
| | | * åå· |
| | | */ |
| | | @ExcelProperty(value = "åå·") |
| | | @ColumnWidth(15) |
| | | private String modelNo; |
| | | |
| | | /** |
| | | * åç |
| | | */ |
| | | @ExcelProperty(value = "åç") |
| | | @ColumnWidth(20) |
| | | private String brand; |
| | | |
| | | /** |
| | | * æ°é |
| | | */ |
| | | @ExcelProperty(value = "æ°é") |
| | | @ColumnWidth(10) |
| | | private Integer amount; |
| | | |
| | | |
| | | /** |
| | | * åä½ |
| | | */ |
| | | @ExcelProperty(value = "åä½", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "eims_fixture_unit") |
| | | @ColumnWidth(10) |
| | | private String unit; |
| | | |
| | | /** |
| | | * èµäº§ç¼å· |
| | | */ |
| | | @ExcelProperty(value = "èµäº§ç¼å·") |
| | | @ColumnWidth(20) |
| | | private String assetNo; |
| | | |
| | | |
| | | /** |
| | | * 使ç¨é¨é¨ |
| | | */ |
| | | @ExcelProperty(value = "使ç¨é¨é¨") |
| | | @ColumnWidth(20) |
| | | private String useDeptStr; |
| | | private Long useDept; |
| | | |
| | | /** |
| | | * 管ç人 |
| | | */ |
| | | @ExcelProperty(value = "管ç人") |
| | | @ColumnWidth(12) |
| | | private String manageUserStr; |
| | | private Long manageUser; |
| | | |
| | | /** |
| | | * éè´æ¥æ |
| | | */ |
| | | @ExcelProperty(value = "éè´æ¥æ") |
| | | @ColumnWidth(24) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private String purchaseDateStr; |
| | | private Date purchaseDate; |
| | | |
| | | /** |
| | | * ä½¿ç¨æ¥æ |
| | | */ |
| | | @ExcelProperty(value = "ä½¿ç¨æ¥æ") |
| | | @ColumnWidth(24) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private String deployDateStr; |
| | | private Date deployDate; |
| | | |
| | | |
| | | /** |
| | | * 管æ§éæ± |
| | | */ |
| | | @ExcelProperty(value = "管æ§éæ±", converter = ExcelDictConvert.class) |
| | | @ColumnWidth(10) |
| | | @ExcelDictFormat(dictType = "eims_fixture_manage") |
| | | private String isManage; |
| | | |
| | | /** |
| | | * ç¶æï¼åå
¸ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ç¶æ", converter = ExcelDictConvert.class) |
| | | @ColumnWidth(10) |
| | | @ExcelDictFormat(dictType = "eims_fixture_status") |
| | | private String status; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * åä»· |
| | | */ |
| | | @ExcelProperty(value = "åä»·") |
| | | @ColumnWidth(10) |
| | | private String unitPriceStr; |
| | | private BigDecimal unitPrice; |
| | | |
| | | /** |
| | | * åç |
| | | */ |
| | | @ExcelProperty(value = "åç") |
| | | @ColumnWidth(15) |
| | | private String power; |
| | | |
| | | } |
| | |
| | | package org.dromara.eims.domain.vo; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.apache.poi.hpsf.Decimal; |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import org.dromara.common.translation.annotation.Translation; |
| | | import org.dromara.common.translation.constant.TransConstant; |
| | |
| | | /** |
| | | * |
| | | */ |
| | | @ExcelProperty(value = "") |
| | | private Long id; |
| | | |
| | | /** |
| | | * æ²»å
·ç¼ç |
| | | */ |
| | | @ExcelProperty(value = "æ²»å
·ç¼ç ") |
| | | private String fixtureCode; |
| | | |
| | | |
| | | /** |
| | | * æ²»å
·åç§° |
| | | */ |
| | | @ExcelProperty(value = "æ²»å
·åç§°") |
| | | @ExcelProperty(value = "å·¥å
·åç§°") |
| | | @ColumnWidth(30) |
| | | private String fixtureName; |
| | | |
| | | /** |
| | | * åå· |
| | | */ |
| | | @ExcelProperty(value = "åå·") |
| | | @ColumnWidth(15) |
| | | private String modelNo; |
| | | |
| | | /** |
| | | * åç |
| | | */ |
| | | @ExcelProperty(value = "åç") |
| | | @ColumnWidth(20) |
| | | private String brand; |
| | | |
| | | /** |
| | | * æ°é |
| | | */ |
| | | @ExcelProperty(value = "æ°é") |
| | | @ColumnWidth(10) |
| | | private Integer amount; |
| | | |
| | | |
| | | /** |
| | | * åä½ |
| | | */ |
| | | @ExcelProperty(value = "åä½", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "eims_fixture_unit") |
| | | @ColumnWidth(10) |
| | | private String unit; |
| | | |
| | | /** |
| | | * èµäº§ç¼å· |
| | | */ |
| | | @ExcelProperty(value = "èµäº§ç¼å·") |
| | | @ColumnWidth(20) |
| | | private String assetNo; |
| | | |
| | | |
| | | /** |
| | | * 使ç¨é¨é¨ |
| | | */ |
| | | @ExcelProperty(value = "使ç¨é¨é¨") |
| | | @ColumnWidth(20) |
| | | private Long useDept; |
| | | |
| | | /** |
| | | * 管ç人 |
| | | */ |
| | | @ExcelProperty(value = "管ç人") |
| | | @ColumnWidth(12) |
| | | private Long manageUser; |
| | | |
| | | /** |
| | | * éè´æ¥æ |
| | | */ |
| | | @ExcelProperty(value = "éè´æ¥æ") |
| | | @ColumnWidth(24) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date purchaseDate; |
| | | |
| | | /** |
| | | * ä½¿ç¨æ¥æ |
| | | */ |
| | | @ExcelProperty(value = "ä½¿ç¨æ¥æ") |
| | | @ColumnWidth(24) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date deployDate; |
| | | |
| | | |
| | | /** |
| | | * 管æ§éæ± |
| | | */ |
| | | @ExcelProperty(value = "管æ§éæ±", converter = ExcelDictConvert.class) |
| | | @ColumnWidth(10) |
| | | @ExcelDictFormat(dictType = "eims_fixture_manage") |
| | | private String isManage; |
| | | |
| | | /** |
| | | * ç¶æï¼åå
¸ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ç¶æ", converter = ExcelDictConvert.class) |
| | | @ColumnWidth(10) |
| | | @ExcelDictFormat(dictType = "eims_fixture_status") |
| | | private String status; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * åä»· |
| | | */ |
| | | @ExcelProperty(value = "åä»·") |
| | | @ColumnWidth(10) |
| | | private BigDecimal unitPrice; |
| | | |
| | | /** |
| | | * åç |
| | | */ |
| | | @ExcelProperty(value = "åç") |
| | | @ColumnWidth(15) |
| | | private String power; |
| | | |
| | | |
| | | /** |
| | | * æ²»å
·ç¼ç |
| | | */ |
| | | private String fixtureCode; |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * æ²»å
·ï¼å·¥å
·ï¼ç±»å |
| | | */ |
| | | @ExcelProperty(value = "æ²»å
፱Ȍ") |
| | | @Translation(type = TransConstant.FIXTURE_TYPE_ID_TO_NAME, mapper = "fixtureType") |
| | | private String fixtureTypeName; |
| | | |
| | | /** |
| | | * æ²»å
·æè¿° |
| | | */ |
| | | @ExcelProperty(value = "æ²»å
·æè¿°") |
| | | private String fixtureDesc; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * åç¨ç¶æ |
| | | */ |
| | | @ExcelProperty(value = "åç¨ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "fixture_borrow_status") |
| | | // @ExcelProperty(value = "åç¨ç¶æ", converter = ExcelDictConvert.class) |
| | | // @ExcelDictFormat(dictType = "fixture_borrow_status") |
| | | private String borrowStatus; |
| | | |
| | | /** |
| | |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "borrowUser") |
| | | private String borrowUserName; |
| | | |
| | | /** |
| | | * ç¶æï¼åå
¸ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "eims_fixture_status") |
| | | private String status; |
| | | |
| | | /** |
| | | * èµäº§ç¼å· |
| | | */ |
| | | @ExcelProperty(value = "èµäº§ç¼å·") |
| | | private String assetNo; |
| | | |
| | | /** |
| | | * åå· |
| | | */ |
| | | @ExcelProperty(value = "åå·") |
| | | private String modelNo; |
| | | |
| | | /** |
| | | * è§æ ¼ |
| | | */ |
| | | @ExcelProperty(value = "è§æ ¼") |
| | | private String specNo; |
| | | |
| | | /** |
| | | * å¶é å |
| | | */ |
| | | @ExcelProperty(value = "å¶é å") |
| | | private String madeIn; |
| | | |
| | | /** |
| | | * éè´æ¥æ |
| | | */ |
| | | @ExcelProperty(value = "éè´æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date purchaseDate; |
| | | |
| | | /** |
| | | * ä½¿ç¨æ¥æ |
| | | */ |
| | | @ExcelProperty(value = "ä½¿ç¨æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date deployDate; |
| | | |
| | | /** |
| | | * 使ç¨å¹´é |
| | | */ |
| | | @ExcelProperty(value = "使ç¨å¹´é") |
| | | private Long serviceLife; |
| | | |
| | | /** |
| | |
| | | private Long curBorrowId; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | private Integer abNormalNum; |
| | | |
| | | private String stId; |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.listener; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.exception.ExcelDataConvertException; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.hpsf.Decimal; |
| | | import org.dromara.common.core.constant.DictConstants; |
| | | import org.dromara.common.core.exception.ServiceException; |
| | | import org.dromara.common.core.service.DictService; |
| | | import org.dromara.common.core.utils.DateUtils; |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.excel.core.ExcelListener; |
| | | import org.dromara.common.excel.core.ExcelResult; |
| | | import org.dromara.common.satoken.utils.LoginHelper; |
| | | import org.dromara.eims.domain.EimsFixture; |
| | | import org.dromara.eims.domain.bo.EimsEquBo; |
| | | import org.dromara.eims.domain.vo.EimsEquImportVo; |
| | | import org.dromara.eims.domain.vo.EimsEquVo; |
| | | import org.dromara.eims.domain.vo.EimsFixtureImportVo; |
| | | import org.dromara.eims.domain.vo.EimsFixtureVo; |
| | | import org.dromara.eims.mapper.EimsFixtureMapper; |
| | | import org.dromara.eims.service.IEimsEquService; |
| | | import org.dromara.eims.service.IEimsFixtureService; |
| | | import org.dromara.system.domain.SysDept; |
| | | import org.dromara.system.domain.SysUser; |
| | | import org.dromara.system.domain.vo.SysDeptVo; |
| | | import org.dromara.system.domain.vo.SysUserVo; |
| | | import org.dromara.system.mapper.SysDeptMapper; |
| | | import org.dromara.system.mapper.SysUserMapper; |
| | | import org.dromara.system.service.ISysUserService; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | /** |
| | | * å·¥å
·èªå®ä¹å¯¼å
¥ |
| | | * |
| | | * @author zhuguifei |
| | | */ |
| | | @Slf4j |
| | | public class EimsFixtureImportListener extends AnalysisEventListener<EimsFixtureImportVo> implements ExcelListener<EimsFixtureImportVo> { |
| | | |
| | | private final EimsFixtureMapper fixtureMapper; |
| | | private final SysUserMapper sysUserMapper; |
| | | private final SysDeptMapper sysDeptMapper; |
| | | |
| | | private final DictService dictService; |
| | | // å½å导å
¥ç¨æ· |
| | | private final Long operUserId; |
| | | |
| | | private final Boolean isUpdateSupport; |
| | | |
| | | //unitåå
¸ |
| | | private final Map<String, String> unitDictMap; |
| | | |
| | | |
| | | private int successNum = 0; |
| | | private int coverNum = 0; |
| | | private int failureNum = 0; |
| | | private final StringBuilder successMsg = new StringBuilder(); |
| | | private final StringBuilder failureMsg = new StringBuilder(); |
| | | |
| | | public EimsFixtureImportListener(Boolean isUpdateSupport) { |
| | | this.fixtureMapper = SpringUtils.getBean(EimsFixtureMapper.class); |
| | | this.sysUserMapper = SpringUtils.getBean(SysUserMapper.class); |
| | | this.sysDeptMapper = SpringUtils.getBean(SysDeptMapper.class); |
| | | this.dictService = SpringUtils.getBean(DictService.class); |
| | | this.isUpdateSupport = isUpdateSupport; |
| | | this.operUserId = LoginHelper.getUserId(); |
| | | this.unitDictMap = dictService.getAllDictByDictType(DictConstants.EIMS_FIXTURE_UNIT); |
| | | } |
| | | |
| | | @Override |
| | | public void invoke(EimsFixtureImportVo fixtureVo, AnalysisContext context) { |
| | | try { |
| | | fixtureVo.setStatus("0"); |
| | | // æ ¹æ®èµäº§ç¼å·æ¥è¯¢å·¥å
·æ¯å¦å·²åå¨ |
| | | LambdaQueryWrapper<EimsFixture> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(EimsFixture::getAssetNo,fixtureVo.getAssetNo()); |
| | | EimsFixtureVo eimsFixtureVo = fixtureMapper.selectVoOne(queryWrapper); |
| | | // å¤çä¸è§åæ°æ® |
| | | //1.åä½unit-excel导å
¥æ°æ®ä¸åä½å段ä¸è§åï¼ç¹æ®å¤ç |
| | | // normalizeUnit(fixtureVo, unitDictMap); |
| | | //2.è´ä¹°æ¥æãéªæ¶æ¥æ ç¹æ®å¤ç |
| | | if (StringUtils.isNotEmpty(fixtureVo.getPurchaseDateStr())) { |
| | | try { |
| | | fixtureVo.setPurchaseDate(DateUtils.parseDate(fixtureVo.getPurchaseDateStr())); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | if (StringUtils.isNotEmpty(fixtureVo.getDeployDateStr())) { |
| | | try { |
| | | fixtureVo.setDeployDate(DateUtils.parseDate(fixtureVo.getDeployDateStr())); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | // 管ç人å¤ç |
| | | if (StringUtils.isNotEmpty(fixtureVo.getManageUserStr())) { |
| | | try { |
| | | LambdaQueryWrapper<SysUser> usrQueryWrapper = new LambdaQueryWrapper<>(); |
| | | usrQueryWrapper.eq(SysUser::getNickName,fixtureVo.getManageUserStr()); |
| | | SysUserVo sysUserVo = sysUserMapper.selectVoOne(usrQueryWrapper); |
| | | if(sysUserVo!=null){ |
| | | fixtureVo.setManageUser(sysUserVo.getUserId()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | // é¨é¨å¤ç |
| | | if (StringUtils.isNotEmpty(fixtureVo.getUseDeptStr())) { |
| | | try { |
| | | LambdaQueryWrapper<SysDept> dptQueryWrapper = new LambdaQueryWrapper<>(); |
| | | dptQueryWrapper.eq(SysDept::getDeptName,fixtureVo.getUseDeptStr()); |
| | | SysDeptVo deptVo = sysDeptMapper.selectVoOne(dptQueryWrapper); |
| | | if(deptVo!=null){ |
| | | fixtureVo.setUseDept(deptVo.getDeptId()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (StringUtils.isNotEmpty(fixtureVo.getUnitPriceStr())) { |
| | | try { |
| | | String priceStr = extractNumber(fixtureVo.getUnitPriceStr()); |
| | | int price = 0; |
| | | if (priceStr != null) { |
| | | price = Integer.parseInt(priceStr); |
| | | } |
| | | if(price>0){ |
| | | fixtureVo.setUnitPrice(new BigDecimal(price)); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | // éªè¯æ¯å¦åå¨ |
| | | if (ObjectUtil.isNull(eimsFixtureVo)) { |
| | | EimsFixture fixture = BeanUtil.toBean(fixtureVo, EimsFixture.class); |
| | | // TODO æ ¡éª |
| | | //ValidatorUtils.validate(equ); |
| | | |
| | | //æ·»å åæ®µé»è®¤å±æ§ |
| | | fixture.setCreateBy(operUserId); |
| | | fixtureMapper.insert(fixture); |
| | | successNum++; |
| | | successMsg.append("<br/>").append(successNum).append("ãå·¥å
· ").append(fixture.getFixtureName()).append(" 导å
¥æå"); |
| | | } else if (isUpdateSupport) { |
| | | EimsFixture fixture = BeanUtil.toBean(fixtureVo, EimsFixture.class); |
| | | fixture.setId(eimsFixtureVo.getId()); |
| | | fixture.setUpdateBy(operUserId); |
| | | fixture.setUpdateTime(new Date()); |
| | | fixtureMapper.updateById(fixture); |
| | | coverNum++; |
| | | successMsg.append("<br/>").append(successNum).append("ãå·¥å
· ").append(fixture.getFixtureName()).append(" æ´æ°æå"); |
| | | } else { |
| | | failureNum++; |
| | | failureMsg.append("<br/>").append(failureNum).append("ãå·¥å
· ").append(eimsFixtureVo.getFixtureName()).append(eimsFixtureVo.getAssetNo()).append(" å·²åå¨"); |
| | | } |
| | | } catch (Exception e) { |
| | | failureNum++; |
| | | String msg = "<br/>" + failureNum + "ãå·¥å
· " + fixtureVo.getFixtureName() + " 导å
¥å¤±è´¥ï¼"; |
| | | failureMsg.append(msg).append(e.getMessage()); |
| | | log.error(msg, e); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext context) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public ExcelResult<EimsFixtureImportVo> getExcelResult() { |
| | | return new ExcelResult<>() { |
| | | |
| | | @Override |
| | | public String getAnalysis() { |
| | | if (failureNum > 0) { |
| | | failureMsg.insert(0, "徿±æï¼å¯¼å
¥å¤±è´¥ï¼å
± " + failureNum + " æ¡æ°æ®æ ¼å¼ä¸æ£ç¡®ï¼é误å¦ä¸ï¼"); |
| | | throw new ServiceException(failureMsg.toString()); |
| | | } else { |
| | | successMsg.insert(0, "æåæ¨ï¼æ°æ®å·²å
¨é¨å¯¼å
¥æåï¼å
± " + (successNum + coverNum )+ " æ¡ï¼æ°æ®å¦ä¸ï¼"); |
| | | } |
| | | return successMsg.toString(); |
| | | } |
| | | |
| | | @Override |
| | | public List<EimsFixtureImportVo> getList() { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getErrorList() { |
| | | return null; |
| | | } |
| | | }; |
| | | } |
| | | |
| | | @Override |
| | | public void onException(Exception exception, AnalysisContext context) throws Exception { |
| | | log.error("è§£æå¤±è´¥ï¼ä½æ¯ç»§ç»è§£æä¸ä¸è¡:{}", exception.getMessage()); |
| | | // å¦ææ¯æä¸ä¸ªåå
æ ¼ç转æ¢å¼å¸¸ è½è·åå°å
·ä½è¡å· |
| | | // 妿è¦è·å头çä¿¡æ¯ é
åinvokeHeadMapä½¿ç¨ |
| | | if (exception instanceof ExcelDataConvertException) { |
| | | ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException) exception; |
| | | log.error("第{}è¡ï¼ç¬¬{}åè§£æå¼å¸¸ï¼æ°æ®ä¸º:{}", excelDataConvertException.getRowIndex(), |
| | | excelDataConvertException.getColumnIndex(), excelDataConvertException.getCellData()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æåæ°å |
| | | * @param input |
| | | * @return |
| | | */ |
| | | private static String extractNumber(String input) { |
| | | Pattern NUMBER_PATTERN = Pattern.compile("(\\d+(\\.\\d+)?)"); |
| | | Matcher matcher = NUMBER_PATTERN.matcher(input); |
| | | if (matcher.find()) { |
| | | return matcher.group(1); // è¿å第ä¸ä¸ªæè·ç»ï¼å³æ°åé¨å |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 为导å
¥è®¾å¤å¹é
åä½ |
| | | * |
| | | * @param fixtureVo |
| | | * @param unitDictMap |
| | | */ |
| | | private void normalizeUnit(EimsFixtureImportVo fixtureVo, Map<String, String> unitDictMap) { |
| | | if (fixtureVo == null || StringUtils.isEmpty(fixtureVo.getUnit()) || unitDictMap == null || unitDictMap.isEmpty()) { |
| | | return; |
| | | } |
| | | String originalUnit = fixtureVo.getUnit(); |
| | | //é¿å
é误åä½ |
| | | fixtureVo.setUnit(null); |
| | | for (Map.Entry<String, String> entry : unitDictMap.entrySet()) { |
| | | if (originalUnit.contains(entry.getValue())) { |
| | | fixtureVo.setUnit(entry.getValue()); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |