Browse Source

feat:fix bugs

dev
zhaobing’ 1 year ago
parent
commit
f208068854
  1. 144
      api/app/lib/schedule/workOrder.js
  2. 4
      web/client/src/sections/workOrder/containers/aboutMe.jsx
  3. 2
      web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx

144
api/app/lib/schedule/workOrder.js

@ -1,39 +1,39 @@
const schedule = require('node-schedule'); // const schedule = require('node-schedule');
const moment = require('moment') // const moment = require('moment')
module.exports = function (app, opts) { // module.exports = function (app, opts) {
const updateAttendance = app.fs.scheduleInit( // const updateAttendance = app.fs.scheduleInit(
{ // {
interval: '34 21 4 * * *', // interval: '34 21 4 * * *',
// interval: '34 */15 * * * *', // // interval: '34 */15 * * * *',
immediate: true, // immediate: true,
proRun: true, // proRun: true,
}, // },
async()=>{ // async()=>{
try{ // try{
const startTime = moment() // const startTime = moment()
const { models } = app.fs.dc // const { models } = app.fs.dc
const { clickHouse } = app.fs // const { clickHouse } = app.fs
const { database: camWorkflow } = clickHouse.camWorkflow.opts.config // const { database: camWorkflow } = clickHouse.camWorkflow.opts.config
//工单数据 // //工单数据
let workOrderNeedData = { // let workOrderNeedData = {
projectName: { // projectName: {
keyWord: ['项目名称'], // keyWord: ['项目名称'],
require: true, // require: true,
}, // },
applyTime: { // applyTime: {
keyWord: ['申请时间'], // keyWord: ['申请时间'],
require: true, // require: true,
}, // },
completionTime: { // completionTime: {
keyWord: ['处理完成时间'], // keyWord: ['处理完成时间'],
require: true, // require: true,
}, // },
state:{ // state:{
keyWord:[''], // keyWord:[''],
require: true, // require: true,
}, // },
@ -46,35 +46,35 @@ module.exports = function (app, opts) {
} // }
const attendanceRes = await clickHouse.pepEmis.query( // const attendanceRes = await clickHouse.pepEmis.query(
` // `
SELECT // SELECT
story.id AS historyId, // story.id AS historyId,
story.apply_user AS pepUserId, // story.apply_user AS pepUserId,
story.form_data AS formData, // story.form_data AS formData,
story.submit_form_data AS submitFormData, // story.submit_form_data AS submitFormData,
fform.form_schema AS formSchema, // fform.form_schema AS formSchema,
fprocess.name AS processName, // fprocess.name AS processName,
procin.state_ AS state, // procin.state_ AS state,
fform.id AS formId, // fform.id AS formId,
fversion.id AS versionId, // fversion.id AS versionId,
fgroup.name AS groupName // fgroup.name AS groupName
FROM // FROM
workflow_process_history AS story // workflow_process_history AS story
INNER JOIN workflow_process_version AS fversion // INNER JOIN workflow_process_version AS fversion
ON fversion.id = story.version_id // ON fversion.id = story.version_id
INNER JOIN workflow_process_form AS fform // INNER JOIN workflow_process_form AS fform
ON fform.id = fversion.form_id // ON fform.id = fversion.form_id
INNER JOIN workflow_process AS fprocess // INNER JOIN workflow_process AS fprocess
ON fprocess.id = fform.process_id // ON fprocess.id = fform.process_id
INNER JOIN workflow_group AS fgroup // INNER JOIN workflow_group AS fgroup
ON fgroup.id = fprocess.group_id // ON fgroup.id = fprocess.group_id
AND fgroup.name = '' // AND fgroup.name = ''
INNER JOIN ${camWorkflow}.act_hi_procinst AS procin // INNER JOIN ${camWorkflow}.act_hi_procinst AS procin
ON procin.id_ = story.procinst_id` // ON procin.id_ = story.procinst_id`
+` ${existOvertimeCount || existVacateCount ?`WHERE story.create_at > '2023-03-16 00:00:00'`: ''}` // +` ${existOvertimeCount || existVacateCount ?`WHERE story.create_at > '2023-03-16 00:00:00'`: ''}`
).toPromise() // ).toPromise()
@ -105,12 +105,12 @@ module.exports = function (app, opts) {
}catch(error){ // }catch(error){
} // }
} // }
); // );
return { // return {
updateAttendance, // updateAttendance,
} // }
} // }

4
web/client/src/sections/workOrder/containers/aboutMe.jsx

@ -83,7 +83,7 @@ const Rest = (props) => {
title: '项目名称', title: '项目名称',
dataIndex: 'pomsProject', dataIndex: 'pomsProject',
render: (text, record, index) => { render: (text, record, index) => {
return record.fsFormItemName==='运维中台售后问题处理工单'? return record.name==='运维中台售后问题处理工单'?
pomsProjectBasicAll?.find(item=>item.value==record?.pomsNeedData?.pomsProjectId?.value).label||'':record?.pomsNeedData?.projectName?.value || '' pomsProjectBasicAll?.find(item=>item.value==record?.pomsNeedData?.pomsProjectId?.value).label||'':record?.pomsNeedData?.projectName?.value || ''
} }
@ -91,7 +91,7 @@ const Rest = (props) => {
title: '申请内容描述', title: '申请内容描述',
dataIndex: 'applyContent', dataIndex: 'applyContent',
render: (text, record, index) => { render: (text, record, index) => {
return record.fsFormItemName==='运维中台售后问题处理工单'?record?.pomsNeedData?.detail?.value.length>5? return record.name==='运维中台售后问题处理工单'?record?.pomsNeedData?.detail?.value.length>5?
<Tooltip content={record?.pomsNeedData?.detail?.value}>{record?.pomsNeedData?.detail?.value.substring(0, 5) + '...'}</Tooltip>:record?.pomsNeedData?.detail?.value || '':record?.pomsNeedData?.applyContent?.value || '' <Tooltip content={record?.pomsNeedData?.detail?.value}>{record?.pomsNeedData?.detail?.value.substring(0, 5) + '...'}</Tooltip>:record?.pomsNeedData?.detail?.value || '':record?.pomsNeedData?.applyContent?.value || ''
} }
}, },

2
web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx

@ -72,7 +72,7 @@ const Rest = (props) => {
title: '项目名称', title: '项目名称',
dataIndex: 'pomsProject', dataIndex: 'pomsProject',
render: (text, record, index) => { render: (text, record, index) => {
return record.name==='运维中台售后问题处理工单'? return record.fsFormItemName==='运维中台售后问题处理工单'?
pomsProjectBasicAll?.find(item=>item.value==record?.pomsNeedData?.pomsProjectId?.value).label||'':record?.pomsNeedData?.projectName?.value || '' pomsProjectBasicAll?.find(item=>item.value==record?.pomsNeedData?.pomsProjectId?.value).label||'':record?.pomsNeedData?.projectName?.value || ''
} }

Loading…
Cancel
Save