| | |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/maint/maint-st", |
| | | "type": "page", |
| | | "layout": "default", |
| | | "style": { |
| | | "navigationBarTitleText": "ä¿å
»æ±æ»" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/my/index", |
| | | "type": "page", |
| | | "layout": "tabbar", |
| | |
| | | }, */ |
| | | { |
| | | id: 1, |
| | | name: 'ç¹æ£æ¦è§', |
| | | icon: '/static/menu/menu1.png', |
| | | name: 'ç¹æ£æ±æ»', |
| | | icon: '/static/menu/menu2.png', |
| | | path: 'pages/inspect/insp-st', |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: 'ç¹æ£æ±æ»', |
| | | icon: '/static/menu/menu2.png', |
| | | path: 'pages/inspect/insp-st', |
| | | name: 'ä¿å
»æ±æ»', |
| | | icon: '/static/menu/menu1.png', |
| | | path: 'pages/maint/maint-st', |
| | | }, |
| | | { |
| | | id: 3, |
| | |
| | | </view> |
| | | </wd-collapse-item> |
| | | </wd-collapse> |
| | | <view class="w-full h-[1rpx] bg-base"></view> |
| | | <wd-textarea |
| | | label="ç¹è®°äºé¡¹" |
| | | label-width="200rpx" |
| | | type="textarea" |
| | | v-model="inspSt.specialNote" |
| | | auto-height |
| | | :maxlength="200" |
| | | show-word-limit |
| | | placeholder="请è¾å
¥ç¹è®°äºé¡¹" |
| | | clearable |
| | | /> |
| | | </view> |
| | | </z-paging> |
| | | </template> |
| | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store' |
| | | import { getInspStRecordList, updateInspRecord, updateInspRecordBatch } from '@/service/inspect' |
| | | import { getInspStRecordList, updateInspectSt, updateInspRecordBatch } from '@/service/inspect' |
| | | import { useToast, useMessage } from 'wot-design-uni' |
| | | import type { CollapseInstance } from 'wot-design-uni/components/wd-collapse/types' |
| | | const message = useMessage() |
| | |
| | | } |
| | | |
| | | interface InspSt { |
| | | id: string |
| | | inspCode: string |
| | | equName: string |
| | | assetNo: string |
| | | planTimeStr?: string |
| | | status: string |
| | | inspUser: number | string |
| | | specialNote: string |
| | | } |
| | | |
| | | const dataChange = ref(false) |
| | |
| | | |
| | | // ç¹æ£æ±æ»æ°æ®(ä¸ä¸ªé¡µé¢ä¼ å¼) |
| | | const inspSt = reactive<InspSt>({ |
| | | id: '', |
| | | inspCode: '', |
| | | equName: '', |
| | | assetNo: '', |
| | | planTimeStr: '', |
| | | status: '', |
| | | inspUser: '', |
| | | specialNote: '', |
| | | }) |
| | | |
| | | const paging = ref(null) |
| | |
| | | } |
| | | |
| | | function inspResultClick(item: any) { |
| | | // userStore?.userInfo?.realName |
| | | // userStore?.userInfo?.userId |
| | | } |
| | | |
| | | const goBack = () => { |
| | |
| | | const params = { |
| | | inspRecordList: dataList.value, |
| | | } |
| | | // æ´æ°ç¹æ£è®°å½ |
| | | updateInspRecordBatch(params) |
| | | .then((res: any) => { |
| | | updateInspSt(resolve) |
| | | }) |
| | | .catch((res) => { |
| | | console.error(res) |
| | | }) |
| | | } |
| | | function updateInspSt(resolve: any) { |
| | | // æ´æ°ç¹æ£æ±æ» |
| | | inspSt.status = '1' |
| | | updateInspectSt(inspSt) |
| | | .then((res: any) => { |
| | | paging.value.reload() |
| | | uni.$emit('insp-st-refresh') |
| | | resolve(true) |
| | | }) |
| | | .catch((res) => { |
| | |
| | | { deep: true }, |
| | | ) |
| | | onLoad((options) => { |
| | | inspSt.id = options.id |
| | | inspSt.inspCode = options.inspCode |
| | | inspSt.equName = options.equName |
| | | inspSt.assetNo = options.assetNo |
| | | inspSt.planTimeStr = options.planTimeStr |
| | | inspSt.specialNote = options?.specialNote |
| | | inspSt.inspUser = userStore?.userInfo?.userId |
| | | }) |
| | | |
| | | const dataCount = computed(() => dataList.value.length) |
| | |
| | | </view> |
| | | |
| | | <view class="flex items-center"> |
| | | <text class="text-color-gray text-mini">{{ item.planTimeStr }}</text> |
| | | <text class="text-color-gray text-mini"> |
| | | {{ |
| | | viewMode === 'Day' ? item.planTimeStr : item?.planTimeStr?.substring(0, 7) || '' |
| | | }} |
| | | </text> |
| | | </view> |
| | | </view> |
| | | </template> |
| | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { getInspStList } from '@/service/inspect' |
| | | import { onShow } from '@dcloudio/uni-app' |
| | | |
| | | const viewMode = ref<string>('Day') |
| | | const equName = ref<string>('ææè®¾å¤') |
| | |
| | | ]) |
| | | const equList = ref<Record<string, any>[]>([{ label: 'ææè®¾å¤', value: 'ææè®¾å¤' }]) |
| | | function handleViewMode({ value }) { |
| | | console.log(value) |
| | | reloadData() |
| | | } |
| | | function handleEquName({ value }) { |
| | | console.log(value) |
| | |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | // è¿éçpageNoåpageSizeä¼èªå¨è®¡ç®å¥½ï¼ç´æ¥ä¼ ç»æå¡å¨å³å¯ |
| | | // è¿éç请æ±åªæ¯æ¼ç¤ºï¼è¯·æ¿æ¢æèªå·±ç项ç®çç½ç»è¯·æ±ï¼å¹¶å¨ç½ç»è¯·æ±åè°ä¸éè¿paging.value.complete(请æ±åæ¥çæ°ç»)å°è¯·æ±ç»æä¼ ç»z-paging |
| | | getInspStList({ pageNum, pageSize }) |
| | | getInspStList({ pageNum, pageSize, viewMode: viewMode.value }) |
| | | .then((res: any) => { |
| | | // 请å¿å¨ç½ç»è¯·æ±åè°ä¸ç»dataListèµå¼ï¼ï¼åªéè¦è°ç¨completeå°±å¯ä»¥äº |
| | | console.log(res) |
| | | paging.value.complete(res.rows) |
| | | }) |
| | | .catch((res) => { |
| | |
| | | function itemClick(item) { |
| | | const inspCode = `${item.equId}_${item.planTime}_${viewMode.value}` |
| | | uni.navigateTo({ |
| | | url: `/pages/inspect/insp-record?inspCode=${inspCode}&equName=${item.equName}&assetNo=${item.assetNo}&planTimeStr=${item.planTimeStr}`, |
| | | url: `/pages/inspect/insp-record?id=${item.id}&inspCode=${inspCode}&specialNote=${item.specialNote ?? ''}&equName=${item.equName ?? ''}&assetNo=${item.assetNo ?? ''}&planTimeStr=${item.planTimeStr ?? ''}`, |
| | | }) |
| | | } |
| | | |
| | | function reloadData() { |
| | | paging.value.reload() |
| | | } |
| | | onLoad(() => { |
| | | queryList() |
| | | uni.$on('insp-st-refresh', reloadData) |
| | | }) |
| | | onUnload(() => { |
| | | uni.$off('insp-st-refres', reloadData) |
| | | }) |
| | | </script> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | layout: 'default', |
| | | style: { |
| | | navigationBarTitleText: 'ä¿å
»æ±æ»', |
| | | }, |
| | | } |
| | | </route> |
| | | |
| | | <template> |
| | | <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time> |
| | | <template #top> |
| | | <wd-drop-menu> |
| | | <wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" /> |
| | | <wd-drop-menu-item v-model="status" :options="statusList" @change="handleStatus" /> |
| | | </wd-drop-menu> |
| | | <wd-divider></wd-divider> |
| | | </template> |
| | | <view class="bg-base"> |
| | | <view class="w-full h-[24rpx]"></view> |
| | | <wd-card type="rectangle" v-for="(item, index) in dataList" :key="item.id"> |
| | | <template #title> |
| | | <view class="flex justify-between"> |
| | | <view class="flex items-center menu-title-box"> |
| | | <view class="menu-indicator"></view> |
| | | <view class="ml-1 text-sm align-center">{{ item.equName }}</view> |
| | | <view class="text-color-gray ml-2 text-mini">{{ item.assetNo }}</view> |
| | | </view> |
| | | |
| | | <view class="flex items-center"> |
| | | <text class="text-color-gray text-mini"> |
| | | {{ status === 'Day' ? item?.planTimeStr : item?.planTimeStr?.substring(0, 7) || '' }} |
| | | </text> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | <view class="flex h-[100rpx]" items-center> |
| | | <image class="slot-img text-center" src="/static/images/camera.png" /> |
| | | <view class="flex-1"> |
| | | <view class="text-color-gray text-xs mt-1 flex"> |
| | | <text class="mr-3">ç¹æ£æ»æ°: {{ item.recordCount }}</text> |
| | | | |
| | | <text class="mx-3">å·²ç¹æ£: {{ item.checkCount }}</text> |
| | | | |
| | | <text class="ml-3">æªç¹æ£: {{ item.unCheckCount }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-2 flex"> |
| | | <text class="mr-3">æ£å¸¸: {{ item.normalNum }}</text> |
| | | | |
| | | <text class="mx-3">å¼å¸¸: {{ item.abNormalNum }}</text> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-2 flex"> |
| | | <text>ç¶æï¼</text> |
| | | <template v-if="item.recordCount === item.checkCount"> |
| | | <wd-icon class="icon-color-success" name="check-outline" size="40rpx"></wd-icon> |
| | | <text class="ml-1">已宿</text> |
| | | </template> |
| | | <template v-else> |
| | | <wd-icon class="icon-color-base" name="detection" size="40rpx"></wd-icon> |
| | | <text class="ml-1">è¿è¡ä¸</text> |
| | | </template> |
| | | </view> |
| | | </view> |
| | | <wd-button size="small" icon="edit-outline" @click.stop="itemClick(item)">æç»</wd-button> |
| | | </view> |
| | | </wd-card> |
| | | </view> |
| | | </z-paging> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { getMaintStList } from '@/service/maint' |
| | | |
| | | interface QueryParams { |
| | | pageNum: number |
| | | pageSize: number |
| | | equName?: string |
| | | status?: string |
| | | } |
| | | |
| | | const status = ref<string>('-1') |
| | | const equName = ref<string>('-1') |
| | | |
| | | const statusList = ref<Record<string, any>[]>([ |
| | | { label: 'å
¨é¨', value: '-1' }, |
| | | { label: 'å¾
ä¿å
»', value: '0' }, |
| | | { label: 'ä¿å
»ä¸', value: '1' }, |
| | | { label: 'å¾
éªè¯', value: '2' }, |
| | | { label: '已宿', value: '3' }, |
| | | ]) |
| | | const equList = ref<Record<string, any>[]>([{ label: 'ææè®¾å¤', value: '-1' }]) |
| | | function handleStatus({ value }) {} |
| | | function handleEquName({ value }) { |
| | | console.log(value) |
| | | } |
| | | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | | |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | // è¿éçpageNoåpageSizeä¼èªå¨è®¡ç®å¥½ï¼ç´æ¥ä¼ ç»æå¡å¨å³å¯ |
| | | // è¿éç请æ±åªæ¯æ¼ç¤ºï¼è¯·æ¿æ¢æèªå·±ç项ç®çç½ç»è¯·æ±ï¼å¹¶å¨ç½ç»è¯·æ±åè°ä¸éè¿paging.value.complete(请æ±åæ¥çæ°ç»)å°è¯·æ±ç»æä¼ ç»z-paging |
| | | const params: QueryParams = { |
| | | pageNum, |
| | | pageSize, |
| | | equName: equName.value, |
| | | status: status.value, |
| | | } |
| | | if (equName.value === '-1') { |
| | | delete params.equName |
| | | } |
| | | if (status.value === '-1') { |
| | | delete params.status |
| | | } |
| | | |
| | | getMaintStList(params) |
| | | .then((res: any) => { |
| | | // 请å¿å¨ç½ç»è¯·æ±åè°ä¸ç»dataListèµå¼ï¼ï¼åªéè¦è°ç¨completeå°±å¯ä»¥äº |
| | | paging.value.complete(res.rows) |
| | | }) |
| | | .catch((res) => { |
| | | // å¦æè¯·æ±å¤±è´¥åpaging.value.complete(false)ï¼ä¼èªå¨å±ç¤ºéè¯¯é¡µé¢ |
| | | // 注æï¼æ¯æ¬¡é½éè¦å¨catchä¸åè¿å¥è¯å¾éº»ç¦ï¼z-pagingæä¾äºæ¹æ¡å¯ä»¥å
¨å±ç»ä¸å¤ç |
| | | // å¨åºå±çç½ç»è¯·æ±æåºå¼å¸¸æ¶ï¼åuni.$emit('z-paging-error-emit');å³å¯ |
| | | paging.value.complete(false) |
| | | }) |
| | | } |
| | | |
| | | function itemClick(item) { |
| | | const inspCode = `${item.equId}_${item.planTime}_${status.value}` |
| | | uni.navigateTo({ |
| | | url: `/pages/inspect/insp-record?id=${item.id}&inspCode=${inspCode}&specialNote=${item.specialNote ?? ''}&equName=${item.equName ?? ''}&assetNo=${item.assetNo ?? ''}&planTimeStr=${item.planTimeStr ?? ''}`, |
| | | }) |
| | | } |
| | | |
| | | function reloadData() { |
| | | paging.value.reload() |
| | | } |
| | | onLoad(() => { |
| | | queryList() |
| | | uni.$on('maint-st-refresh', reloadData) |
| | | }) |
| | | onUnload(() => { |
| | | uni.$off('maint-st-refres', reloadData) |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .menu-title-box { |
| | | } |
| | | |
| | | .slot-img { |
| | | width: 72rpx; |
| | | height: 72rpx; |
| | | margin-right: 24rpx; |
| | | } |
| | | .statu-img { |
| | | width: 60rpx; |
| | | height: 40rpx; |
| | | } |
| | | .text-mini { |
| | | font-size: 22rpx; |
| | | } |
| | | |
| | | .menu-indicator { |
| | | width: 6rpx; |
| | | height: 26rpx; |
| | | border-radius: 10rpx; |
| | | background-color: $uni-color-primary; |
| | | } |
| | | :deep(.wd-card__footer) { |
| | | padding: 10rpx !important; |
| | | } |
| | | :deep(.wd-card__title-content) { |
| | | padding: 24rpx 0 !important; |
| | | } |
| | | </style> |
| | |
| | | * ç¹æ£æ±æ»å表 |
| | | */ |
| | | export const getInspStList = (params: any) => { |
| | | params.viewMode = 'Day' |
| | | return http.get<InspectStVO[]>('/eims/inspectSt/list', params) |
| | | } |
| | | |
| | |
| | | * @param data |
| | | */ |
| | | export const updateInspRecord = (data: any) => { |
| | | return http.post<void>('/eims/inspRecord', data) |
| | | return http.put<void>('/eims/inspRecord', data) |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ´æ°ç¹æ£è®°å½ |
| | | * @param data |
| | | */ |
| | | export const updateInspRecordBatch = (data: any) => { |
| | | return http.put<void>('/eims/inspRecord/editBatch', data) |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°ç¹æ£æ±æ» |
| | | * @param data |
| | | */ |
| | | export const updateInspectSt = (data: any) => { |
| | | return http.put<void>('/eims/inspectSt', data) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface MaintStVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: number | string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | title: string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | equId: number | string; |
| | | status: string; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | planTime: string; |
| | | |
| | | /** |
| | | * ä¿å
»äºº |
| | | */ |
| | | maintUser: number; |
| | | |
| | | /** |
| | | * éªè¯äºº |
| | | */ |
| | | verifyUser: number; |
| | | verifyTime: string; |
| | | |
| | | /** |
| | | * ç¹è®°äºé¡¹ |
| | | */ |
| | | specialNote: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { http } from '@/utils/http' |
| | | import type { MaintStVO } from './maint.d' |
| | | |
| | | /** |
| | | * ä¿å
»æ±æ»å表 |
| | | */ |
| | | export const getMaintStList = (params: any) => { |
| | | return http.get<MaintStVO[]>('/eims/maintSt/list', params) |
| | | } |
| | |
| | | "/pages/inspect/insp-record" | |
| | | "/pages/inspect/insp-st" | |
| | | "/pages/login/index" | |
| | | "/pages/maint/maint-st" | |
| | | "/pages/my/index" | |
| | | "/pages/spare/index"; |
| | | } |
| | |
| | | uni.navigateTo({ url: redirectRoute }) |
| | | reject(res) |
| | | } else { |
| | | // å
¶ä»é误 -> æ ¹æ®å端é误信æ¯è½»æç¤º |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: (res.data as IResData<T>).msg || '请æ±é误', |
| | | }) |
| | | reject(res) |
| | | } |
| | | } else if (res.statusCode === 401) { |
| | | // 401é误 -> æ¸
çç¨æ·ä¿¡æ¯ï¼è·³è½¬å°ç»å½é¡µ |
| | |
| | | { |
| | | title: 'ä¿å
»æ¶é´', |
| | | field: 'planTimeStr', |
| | | minWidth: 200 |
| | | minWidth: 200, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | // 夿æ¯å¦éè¦æ¾ç¤ºæ¶é´ |
| | | if (!row.type) return ''; |
| | | |
| | | // è·ååå§æ¶é´å符串 |
| | | const fullDate = row.planTimeStr; |
| | | |
| | | // æ ¹æ®æ¡ä»¶å³å®æ¾ç¤ºæ ¼å¼ |
| | | // ç¤ºä¾æ¡ä»¶ï¼å¦æ status æ¯æä¸ªç¹å®å¼ï¼ä¾å¦ 'monthly'ï¼ï¼åæ¾ç¤º YYYY-MM |
| | | if (row.type === 'Month') { |
| | | return fullDate.slice(0, 7); // æªåå 7 个å符ï¼å¾å° YYYY-MM |
| | | } |
| | | // é»è®¤æ¾ç¤ºå®æ´æ¥æ YYYY-MM-DD |
| | | return fullDate; |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | title: 'ç¶æ', |
| | |
| | | const monBtn = ref<any>('primary'); |
| | | |
| | | function queryData(type: ViewMode) { |
| | | // TODO æ¥è§å¾åæè§å¾å端已ç»ä¸æ¹æ³ å端å¯å 餿¥è§å¾å¤ä½é
ç½® |
| | | if (type === ViewMode.Day) { |
| | | dayBtn.value = 'primary'; |
| | | monBtn.value = 'default'; |
| | | curViewMode.value = ViewMode.Day; |
| | | tableApi.setGridOptions(gridOptions2); |
| | | // tableApi.setGridOptions(gridOptions2); |
| | | } else if (type === ViewMode.Month) { |
| | | dayBtn.value = 'default'; |
| | | monBtn.value = 'primary'; |
| | | curViewMode.value = ViewMode.Month; |
| | | tableApi.setGridOptions(gridOptions); |
| | | // tableApi.setGridOptions(gridOptions); |
| | | } |
| | | tableApi.query(); |
| | | } |
| | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px] flex-col"> |
| | | <BasicTable class="h-2/3" table-title="ç¹æ£è®°å½å表"> |
| | | <BasicTable class="h-2/3" table-title="ç¹æ£æ±æ»å表"> |
| | | <template #toolbar-tools> |
| | | <Space> |
| | | <Button :type="dayBtn" @click.stop="queryData(ViewMode.Day)">æ¥è§å¾</Button> |
| | |
| | | <ghost-button v-access:code="['eims:inspectSt:edit']" @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" |
| | | @confirm="handleDelete(row)"> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['eims:inspectSt:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | | <BasisSubTable :columns="recordCol" :list-api="listInspStRecord" :req-value="recordId" class="h-1/3" |
| | | req-key="inspCode" title="ç¹æ£è®°å½" /> |
| | | <BasisSubTable :columns="recordCol" :list-api="listInspStRecord" :req-value="recordId" class="h-1/3" req-key="inspCode" title="ç¹æ£è®°å½" /> |
| | | </div> |
| | | <InspStDrawer @reload="tableApi.query()" /> |
| | | </Page> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | import org.dromara.common.core.utils.DateUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.eims.domain.bo.EimsMaintOrderBo; |
| | | import org.dromara.eims.domain.bo.InspectRecordBo; |
| | | import org.dromara.eims.domain.vo.EimsMaintOrderVo; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | Map<String, Object> params = bo.getParams(); |
| | | params.put("beginPlanTime",startOfMonth); |
| | | params.put("endPlanTime",endOfMonth); |
| | | params.put("type","Month"); |
| | | } |
| | | return eimsInspectRecordService.queryPageListCustom(bo, pageQuery); |
| | | } |
| | |
| | | return toAjax(eimsInspectRecordService.updateByBo(bo)); |
| | | } |
| | | |
| | | @SaCheckPermission("eims:inspectRecord:edit") |
| | | @Log(title = "ç¹æ£è®°å½-æ¹éä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping("editBatch") |
| | | public R<Void> editBatch(@Validated(EditGroup.class) @RequestBody InspectRecordBo bo) { |
| | | return toAjax(eimsInspectRecordService.updateBatchByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç¹æ£è®°å½ |
| | | * |
| | |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | /** |
| | | * æ±æ»ç±»å Day-æ¥æ±æ» Month-ææ±æ» |
| | | */ |
| | | private String type; |
| | | |
| | | /** |
| | | * æ é¢ |
| | |
| | | */ |
| | | @NotNull(message = "ä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long id; |
| | | /** |
| | | * æ±æ»ç±»å Day-æ¥æ±æ» Month-ææ±æ» |
| | | */ |
| | | private String type; |
| | | |
| | | /** |
| | | * æ é¢ |
| | | */ |
| | | @NotBlank(message = "æ é¢ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String title; |
| | | |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | | @NotNull(message = "设å¤idä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long equId; |
| | | private String equName; |
| | | private String assetNo; |
| | |
| | | /** |
| | | * è®¡åæ¶é´ |
| | | */ |
| | | @NotNull(message = "è®¡åæ¶é´ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Date planTime; |
| | | |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class InspectRecordBo { |
| | | /** |
| | | * ç§»å¨ç«¯æ¹éæ´æ° |
| | | */ |
| | | private List<EimsInspectRecordBo> inspRecordList; |
| | | } |
| | |
| | | */ |
| | | @ExcelProperty(value = "æ é¢") |
| | | private String title; |
| | | |
| | | /** |
| | | * æ±æ»ç±»å Day-æ¥æ±æ» Month-ææ±æ» |
| | | */ |
| | | private String type; |
| | | /** |
| | | * 设å¤id |
| | | */ |
| | |
| | | */ |
| | | public interface EimsInspectRecordMapper extends BaseMapperPlus<EimsInspectRecord, EimsInspectRecordVo> { |
| | | Page<EimsInspectRecordVo> selectInspRecordList(@Param("page") Page<EimsInspectRecordVo> page, @Param(Constants.WRAPPER) Wrapper<EimsInspectRecord> queryWrapper); |
| | | // TODO æ¥è§å¾åæè§å¾ç»ä¸æ¥å£ï¼å¾
å é¤ |
| | | Page<EimsInspectStVo> selectInspRecordDayList(@Param("page") Page<EimsInspectStVo> page, @Param(Constants.WRAPPER) Wrapper<EimsInspectSt> queryWrapper); |
| | | |
| | | } |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.eims.domain.bo.EimsInspectStBo; |
| | | import org.dromara.eims.domain.bo.InspectRecordBo; |
| | | import org.dromara.eims.domain.vo.EimsInspectRecordVo; |
| | | import org.dromara.eims.domain.bo.EimsInspectRecordBo; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(EimsInspectRecordBo bo); |
| | | Boolean updateBatchByBo(InspectRecordBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ç¹æ£è®°å½ä¿¡æ¯ |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import lombok.SneakyThrows; |
| | | import org.dromara.common.core.constant.DictConstants; |
| | | import org.dromara.common.core.domain.model.LoginUser; |
| | | import org.dromara.common.core.utils.DateUtils; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.dromara.common.satoken.utils.LoginHelper; |
| | | import org.dromara.eims.domain.EimsInspectPlan; |
| | | import org.dromara.eims.domain.EimsInspectSt; |
| | | import org.dromara.eims.domain.EimsMaintPlan; |
| | | import org.dromara.eims.domain.bo.EimsInspectStBo; |
| | | import org.dromara.eims.domain.bo.InspectRecordBo; |
| | | import org.dromara.eims.domain.vo.EimsInspectStVo; |
| | | import org.dromara.eims.domain.vo.EimsMaintOrderVo; |
| | | import org.dromara.eims.mapper.EimsInspectPlanMapper; |
| | |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean updateBatchByBo(InspectRecordBo bo) { |
| | | LoginUser loginUser = LoginHelper.getLoginUser(); |
| | | List<EimsInspectRecord> inspRecordList = MapstructUtils.convert(bo.getInspRecordList(), EimsInspectRecord.class); |
| | | inspRecordList.forEach(item->{ |
| | | // æ´æ°ä¸ºå·²ç¹æ£ |
| | | item.setStatus(DictConstants.EIMS_INSPECT_STATUS_DETAIL.Y); |
| | | item.setInspTime(new Date()); |
| | | item.setInspUser(loginUser.getUserId()); |
| | | }); |
| | | return baseMapper.updateBatchById(inspRecordList); |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | |
| | | import org.dromara.eims.service.IEimsInspectStService; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.ZoneId; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.*; |
| | |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsInspectStVo> queryPageList(EimsInspectStBo bo, PageQuery pageQuery) { |
| | | bo.setType(bo.getViewMode()); |
| | | // æè§å¾ |
| | | if(bo.getViewMode().equals("Month")){ |
| | | // if(bo.getViewMode().equals("Month")){ |
| | | QueryWrapper<EimsInspectSt> qw = buildWrapper(bo); |
| | | Page<EimsInspectStVo> result = baseMapper.selectInspStList(pageQuery.build(), qw); |
| | | // å¡«å
æ°æ® |
| | | fillStData(result); |
| | | fillStData(result,bo.getViewMode()); |
| | | return TableDataInfo.build(result); |
| | | // æ¥è§å¾ |
| | | }else if(bo.getViewMode().equals("Day")){ |
| | | Page<EimsInspectStVo> result = recordMapper.selectInspRecordDayList(pageQuery.build(), buildGroupWrapper(bo)); |
| | | return TableDataInfo.build(result); |
| | | // }else if(bo.getViewMode().equals("Day")){ |
| | | // Page<EimsInspectStVo> result = recordMapper.selectInspRecordDayList(pageQuery.build(), buildGroupWrapper(bo)); |
| | | // return TableDataInfo.build(result); |
| | | // } |
| | | |
| | | // return null; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | private void fillStData(Page<EimsInspectStVo> result) { |
| | | /** |
| | | * |
| | | * @param result |
| | | * @param type Day-æ¥è§å¾ Month-æè§å¾ |
| | | */ |
| | | private void fillStData(Page<EimsInspectStVo> result,String type) { |
| | | List<EimsInspectStVo> records = result.getRecords(); |
| | | for (int i = 0; i < records.size(); i++) { |
| | | EimsInspectStVo stVo = records.get(i); |
| | |
| | | LambdaQueryWrapper<EimsInspectRecord> recordLqw = Wrappers.lambdaQuery(); |
| | | recordLqw.eq(EimsInspectRecord::getEquId, stVo.getEquId()); |
| | | LocalDate planTime = stVo.getPlanTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
| | | // æè§å¾æ¥è¯¢èå´ |
| | | LocalDate startOfMonth = planTime.with(TemporalAdjusters.firstDayOfMonth()); |
| | | LocalDate endOfMonth = planTime.with(TemporalAdjusters.lastDayOfMonth()); |
| | | |
| | | // æ¥è§å¾æ¥è¯¢èå´ |
| | | if(type.equals("Day")){ |
| | | recordLqw.between(EimsInspectRecord::getPlanTime, planTime, planTime); |
| | | }else { |
| | | // æè§å¾æ¥è¯¢èå´ |
| | | recordLqw.between(EimsInspectRecord::getPlanTime, startOfMonth, endOfMonth); |
| | | } |
| | | |
| | | |
| | | // æ§è¡æ¥è¯¢ |
| | | List<EimsInspectRecordVo> recordList = recordMapper.selectVoList(recordLqw); |
| | | // TODO æ ¹æ®åå
¸eims_inspect_status |
| | |
| | | // TODO æ ¹æ®åå
¸eims_inspect_result |
| | | Map<String, Long> rMap = recordList.stream() |
| | | .filter(order ->order.getInspResult()!=null && List.of("1", "2").contains(order.getInspResult())) |
| | | .collect(Collectors.groupingBy(EimsInspectRecordVo::getStatus, Collectors.counting())); |
| | | .collect(Collectors.groupingBy(EimsInspectRecordVo::getInspResult, Collectors.counting())); |
| | | |
| | | stVo.setRecordCount(recordList.size()); |
| | | stVo.setUnCheckCount(cMap.getOrDefault("0", 0L).intValue()); |
| | |
| | | qw.like(StringUtils.isNotBlank(bo.getTitle()), "st.title", bo.getTitle()); |
| | | qw.like(StringUtils.isNotBlank(bo.getEquName()), "equ.equ_name", bo.getEquName()); |
| | | qw.like(StringUtils.isNotBlank(bo.getAssetNo()), "equ.asset_no", bo.getAssetNo()); |
| | | qw.eq( "st.type", bo.getType()); |
| | | qw.between(params.get("beginPlanTime") != null && params.get("endPlanTime") != null, |
| | | "st.plan_time", params.get("beginPlanTime"), params.get("endPlanTime")); |
| | | qw.eq(bo.getInspUser() != null, "st.maint_user", bo.getInspUser()); |
| | |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |
| | | |
| | | |
| | | <!--TODO æ¥è§å¾åæè§å¾ç»ä¸æ¥å£ï¼å¾
å é¤--> |
| | | <select id="selectInspRecordDayList" resultMap="EimsInspectStVoResult"> |
| | | SELECT |
| | | MAX(ir.id) id, |
| | |
| | | <resultMap type="org.dromara.eims.domain.vo.EimsInspectStVo" id="MaintInspStVoResult"> |
| | | </resultMap> |
| | | <select id="selectInspStList" resultMap="MaintInspStVoResult"> |
| | | SELECT st.*,equ.equ_name equName,equ.asset_no assetNo, DATE_FORMAT(st.plan_time, '%Y-%m') as planTimeStr FROM eims_inspect_st st |
| | | SELECT st.*,equ.equ_name equName,equ.asset_no assetNo, DATE_FORMAT(st.plan_time, '%Y-%m-%d') as planTimeStr FROM eims_inspect_st st |
| | | LEFT JOIN eims_equ equ on st.equ_id = equ.equ_id |
| | | ${ew.getCustomSqlSegment} |
| | | </select> |