diff --git a/api/.vscode/launch.json b/api/.vscode/launch.json index e5a2104..e78fb7e 100644 --- a/api/.vscode/launch.json +++ b/api/.vscode/launch.json @@ -24,8 +24,8 @@ "-g postgres://FashionAdmin:123456@10.8.30.166:5432/POMS", "-k 10.8.30.72:29092,10.8.30.73:29092,10.8.30.74:29092", "-e http://10.8.30.60:9200", - // "-c https://camundatest.anxinyun.cn", - // "-r fs-workflow", + "-c https://camundatest.anxinyun.cn", + "-r fs-workflow", // "-e http://10.8.30.60:5601", "--iotaProxy http://10.8.30.157:17007", // @@ -40,8 +40,8 @@ // 测试 // "--apiEmisUrl http://10.8.30.161:1111", // "--apiEmisUrl http://10.8.30.161:31111/", - "--apiEmisUrl https://pepca-demo.anxinyun.cn/_api", - // "--apiEmisUrl http://localhost:14000", + // "--apiEmisUrl https://pepca-demo.anxinyun.cn/_api", + "--apiEmisUrl http://localhost:14000", "--apiVcmpUrl http://localhost:4000", "--apiIotAuth http://localhost:4200", "--godUrl https://restapi.amap.com/v3", diff --git a/api/app/lib/controllers/form/index.js b/api/app/lib/controllers/form/index.js index 9c17fb2..03b2aa4 100644 --- a/api/app/lib/controllers/form/index.js +++ b/api/app/lib/controllers/form/index.js @@ -11,41 +11,41 @@ async function getUnfinished (ctx) { const assignee='fsUser'+userInfo.pepUserId const BeforeAssignUser='fsBeforeAssignUser'+userInfo.pepUserId const AfterAssignUser='fsAfterAssignUser'+userInfo.pepUserId - + // and pro.business_key_ in ('831') + // and pro.business_key_ in ('840','834','831') 测试环境的对应的business_key_(运维中台技术申请工单),(运维中台售后问题处理工单),(运维中台工单) + try{ let all=await clickHouse.camWorkflow.query(` - SELECT DISTINCT * - FROM ( - SELECT * - FROM ( - SELECT DISTINCT RES.* - FROM act_hi_taskinst RES, act_hi_procinst PRO - WHERE 1 = 1 - AND RES.end_time_ IS NULL - AND 1 = 1 - AND RES.assignee_ = '${assignee}' - AND RES.proc_inst_id_ = PRO.proc_inst_id_ - AND PRO.business_key_ in ('160','159') - ) RES - UNION ALL - SELECT * - FROM ( - SELECT DISTINCT RES.* - FROM act_hi_taskinst RES - WHERE 1 = 1 - AND RES.end_time_ IS NULL - AND 1 = 1 - AND RES.id_ IN ( - SELECT id_ - FROM act_hi_varinst VAR - WHERE name_ IN ('${BeforeAssignUser}','${AfterAssignUser}') - AND var_type_ IS NOT NULL - AND var_type_ = 'string' - AND text_ IS NOT NULL - AND text_ = 'pending' - ) - ) RES - ) AS res; + select distinct * from( + select * from ( + select distinct RES.* + from act_hi_taskinst RES,act_hi_procinst pro + WHERE RES.end_time_ is null + and RES.assignee_ = '${assignee}' + and pro.proc_inst_id_=RES.proc_inst_id_ + and pro.business_key_ in ('840','834','831') + ) RES + union all + select * from ( + select distinct RES.* + from act_hi_taskinst RES, act_hi_varinst VAR,act_hi_procinst pro + WHERE RES.end_time_ is null + and VAR.name_ in ('${AfterAssignUser}', '${BeforeAssignUser}') + and VAR.task_id_ = RES.id_ + and pro.proc_inst_id_=RES.proc_inst_id_ + and pro.business_key_ in ('840','834','831') + and (( VAR.var_type_ is not null and VAR.var_type_ = 'string' and VAR.text_ is not null and VAR.text_ = 'pending' )) + ) RES ) as res,act_hi_varinst t + +where + t.proc_inst_id_=res.proc_inst_id_ +and t.name_='backout' +and t.task_id_ is null +and t.var_type_ is not null +and t.var_type_='boolean' +and t.long_ is not null +and t.long_=0 + `).toPromise() const procinstIds = [...new Set(all.map(e => e.proc_inst_id_))]; // 获取流程实例变量 diff --git a/api/app/lib/index.js b/api/app/lib/index.js index 0b9bef1..b8c4758 100644 --- a/api/app/lib/index.js +++ b/api/app/lib/index.js @@ -49,7 +49,7 @@ module.exports.entry = function (app, router, opts) { // 鉴权中间件 router.use(authenticator(app, opts)); //camundarest - // router.use(camundarest(app, router, opts.camundarest)); + router.use(camundarest(app, router, opts.camundarest)); // 日志记录 // router.use(apiLog(app, opts)); diff --git a/api/config.js b/api/config.js index e1ea0ab..b3a226d 100644 --- a/api/config.js +++ b/api/config.js @@ -13,8 +13,8 @@ args.option(['g', 'pg'], 'postgre 服务 URL'); args.option(['f', 'fileHost'], '文件中心本地化存储: WebApi 服务器地址(必填), 该服务器提供文件上传Web服务'); args.option(['k', 'kafka'], 'kafka 服务 URL'); args.option(['e', 'es'], 'es 服务 URL'); -// args.option(['c', 'camundaHost'], 'camunda rest host'); -// args.option(['r', 'camundaRoot'], 'camunda rest root'); +args.option(['c', 'camundaHost'], 'camunda rest host'); +args.option(['r', 'camundaRoot'], 'camunda rest root'); args.option('iotaProxy', '以太代理') args.option('redisHost', 'redisHost'); @@ -66,8 +66,8 @@ const flags = args.parse(process.argv); const POMS_DB = process.env.POMS_DB || flags.pg; const LOCAL_SVR_ORIGIN = process.env.LOCAL_SVR_ORIGIN || flags.fileHost; //项企 -// const FS_CAMUNDA_HOST = process.env.CAMUNDA_HOST || flags.camundaHost; -// const FS_CAMUNDA_ROOT = process.env.CAMUNDA_ROOT || flags.camundaRoot; +const FS_CAMUNDA_HOST = process.env.CAMUNDA_HOST || flags.camundaHost; +const FS_CAMUNDA_ROOT = process.env.CAMUNDA_ROOT || flags.camundaRoot; // kafka const ANXINCLOUD_KAFKA_BROKERS = process.env.ANXINCLOUD_KAFKA_BROKERS || flags.kafka; @@ -135,24 +135,28 @@ const ES_PLATFORM_NAME = process.env.ES_PLATFORM_NAME || flags.esPlatformName || 'anxinyun'; const ANXINCLOUD_ES_NODES_REST = process.env.ANXINCLOUD_ES_NODES_REST || flags.es; // //business_key -// const BUSINESS_KEY=process.env.BUSINESS_KEY||['160','161'] - -const requireParams = { - // FS_CAMUNDA_HOST, FS_CAMUNDA_ROOT, - POMS_DB, - IOTA_REDIS_SERVER_HOST, IOTA_REDIS_SERVER_PORT, - ANXINCLOUD_KAFKA_BROKERS, - GOD_KEY, - API_ANXINYUN_URL, - API_EMIS_URL, - API_VCMP_URL, - API_IOT_AUTH, - QINIU_DOMAIN_QNDMN_RESOURCE, QINIU_BUCKET_RESOURCE, QINIU_AK, QINIU_SK, - CLICKHOUST_URL, CLICKHOUST_PORT, - CLICKHOUST_ANXINCLOUD, CLICKHOUST_PEP_EMIS, CLICKHOUST_PROJECT_MANAGE, CLICKHOUST_VCMP, CLICKHOUST_DATA_ALARM, CLICKHOUST_IOT, - // CLICKHOUST_CAM_WORKFLOW, - CONFIRM_ALARM_ANXIN_USER_ID, - VCMP_APP_ID, VCMP_APP_SECRET, +// const BUSINESS_KEY=process.env.BUSINESS_KEY||['834','840'] +if ( + // !BUSINESS_KEY|| + !FS_CAMUNDA_HOST || !FS_CAMUNDA_ROOT || + !POMS_DB + || !IOTA_REDIS_SERVER_HOST || !IOTA_REDIS_SERVER_PORT + || !ANXINCLOUD_KAFKA_BROKERS + || !GOD_KEY + || !API_ANXINYUN_URL + || !API_EMIS_URL + || !API_VCMP_URL + || !API_IOT_AUTH + || !QINIU_DOMAIN_QNDMN_RESOURCE || !QINIU_BUCKET_RESOURCE || !QINIU_AK || !QINIU_SK + || !CLICKHOUST_URL || !CLICKHOUST_PORT + || !CLICKHOUST_ANXINCLOUD || !CLICKHOUST_PEP_EMIS || !CLICKHOUST_PROJECT_MANAGE || !CLICKHOUST_VCMP || !CLICKHOUST_DATA_ALARM || !CLICKHOUST_IOT + // || !CLICKHOUST_CAM_WORKFLOW + || !CONFIRM_ALARM_ANXIN_USER_ID + || !VCMP_APP_ID || !VCMP_APP_SECRET +) { + console.log('缺少启动参数,异常退出'); + args.showHelp(); + process.exit(-1); } Object.keys(requireParams).forEach(key => { @@ -182,11 +186,11 @@ const product = { entry: require('./app').entry, opts: { dev, - // BUSINESS_KEY, - // camundarest: { - // host: FS_CAMUNDA_HOST, - // root: FS_CAMUNDA_ROOT - // }, + // business_key:BUSINESS_KEY, + camundarest: { + host: FS_CAMUNDA_HOST, + root: FS_CAMUNDA_ROOT + }, exclude: [ // "*", { p: '/attachments/:p', o: 'POST' }, diff --git a/web/client/src/layout/actions/index.js b/web/client/src/layout/actions/index.js index 4e98b4d..7d06765 100644 --- a/web/client/src/layout/actions/index.js +++ b/web/client/src/layout/actions/index.js @@ -2,8 +2,9 @@ import * as global from './global' import * as socket from './webSocket'; - +import * as workOrders from './workOrders' export default { ...global, ...socket, + ...workOrders }; \ No newline at end of file diff --git a/web/client/src/layout/actions/workOrders.js b/web/client/src/layout/actions/workOrders.js new file mode 100644 index 0000000..7881bbe --- /dev/null +++ b/web/client/src/layout/actions/workOrders.js @@ -0,0 +1,15 @@ +'use strict'; + +import { ApiTable, basicAction } from '$utils' + +export function getWorkOrders () { //获取工单的待办 + console.log('xxxxx',ApiTable.workOrders) + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_WORK_ORDERS', + url: `${ApiTable.workOrders}`, + msg: { option: '获取工单的待办' }, + reducer: { name: 'workOrders' } + }); +} \ No newline at end of file diff --git a/web/client/src/layout/components/header/index.jsx b/web/client/src/layout/components/header/index.jsx index 9c1814e..3d7bfc4 100644 --- a/web/client/src/layout/components/header/index.jsx +++ b/web/client/src/layout/components/header/index.jsx @@ -8,11 +8,12 @@ import { IconTreeTriangleDown, IconSearch, IconEdit, IconDelete } from '@douyinf import CustomProjGroupModal from './components/customProjGroupModal' import PerfectScrollbar from "perfect-scrollbar"; import "./index.less"; +import layout from '../../containers/layout'; let newScrollbar; const Header = (props) => { const { dispatch, history, user, actions, socket, headerItems, tochange, projectGroup } = props; - const { install, projectGroup: projectGroupAC } = actions + const { install, projectGroup: projectGroupAC,layout } = actions const [pomsList, setPomsList] = useState([]) const [pomsName, setPomsName] = useState('全局') const [pepProjectId, setPepProjectId] = useState() @@ -23,6 +24,8 @@ const Header = (props) => { const [customProjGroupModalVis, setCustomProjGroupModalVis] = useState(false) const [customProjGroupDelPopVis, setCustomProjGroupDelPopVis] = useState(false) const [customProjGroupEditData, setCustomProjGroupEditData] = useState(null) + const [count,setCount]=useState(0)//待办工单数量 + // console.log('actions1',actions) let userRole = user?.pomsUserInfo?.role let modalRole = [] if (userRole) { @@ -52,7 +55,14 @@ const Header = (props) => { } }) getProjGroup() + dispatch(layout.getWorkOrders()).then((res)=>{ + if(res.success){ + setCount(res.payload.data?.count) + } + }) + } + }, []) useEffect(() => { @@ -287,8 +297,7 @@ const Header = (props) => { {item.hasOwnProperty('items') && item.items.map((ite, idx) => ( diff --git a/web/client/src/sections/workOrder/containers/aboutMe.jsx b/web/client/src/sections/workOrder/containers/aboutMe.jsx index e84b097..86ab190 100644 --- a/web/client/src/sections/workOrder/containers/aboutMe.jsx +++ b/web/client/src/sections/workOrder/containers/aboutMe.jsx @@ -121,11 +121,18 @@ const Rest = (props) => { return record?.pomsNeedData?.handlingPerson?.value ? allPepUsersIncludeDel.find(u => u.id == record?.pomsNeedData?.handlingPerson?.value)?.name : '' } }, + // { + // title: '处理结果', + // dataIndex: 'handlingResult', + // render: (text, record, index) => { + // return record?.pomsNeedData?.handlingResult?.value || '' + // } + // }, { - title: '处理结果', - dataIndex: 'handlingResult', + title: '事项名称', + dataIndex: 'fsFormItemName', render: (text, record, index) => { - return record?.pomsNeedData?.handlingResult?.value || '' + return record?.name || '' } }, { diff --git a/web/client/src/sections/workOrder/containers/initiated.jsx b/web/client/src/sections/workOrder/containers/initiated.jsx index 2d53ac7..335ec38 100644 --- a/web/client/src/sections/workOrder/containers/initiated.jsx +++ b/web/client/src/sections/workOrder/containers/initiated.jsx @@ -16,7 +16,6 @@ const Rest = (props) => { const [workflowModalType, setWorkflowModalType] = useState('') const [checkProcessInstanceId, setCheckProcessInstanceId] = useState(null) const [params, setParams] = useState({}) - useEffect(() => { backlogData() if (!pomsProjectBasicAll.length) { @@ -112,11 +111,18 @@ const Rest = (props) => { return record?.pomsNeedData?.handlingPerson?.value ? allPepUsersIncludeDel.find(u => u.id == record?.pomsNeedData?.handlingPerson?.value)?.name : '' } }, + // { + // title: '处理结果', + // dataIndex: 'handlingResult', + // render: (text, record, index) => { + // return record?.pomsNeedData?.handlingResult?.value || '' + // } + // }, { - title: '处理结果', - dataIndex: 'handlingResult', + title: '事项名称', + dataIndex: 'fsFormItemName', render: (text, record, index) => { - return record?.pomsNeedData?.handlingResult?.value || '' + return record?.name || '' } }, { diff --git a/web/client/src/sections/workOrder/containers/preserve.jsx b/web/client/src/sections/workOrder/containers/preserve.jsx index 5e3337f..0a2ca66 100644 --- a/web/client/src/sections/workOrder/containers/preserve.jsx +++ b/web/client/src/sections/workOrder/containers/preserve.jsx @@ -113,11 +113,18 @@ const Rest = (props) => { return record?.pomsNeedData?.handlingPerson?.value ? allPepUsersIncludeDel.find(u => u.id == record?.pomsNeedData?.handlingPerson?.value)?.name : '' } }, + // { + // title: '处理结果', + // dataIndex: 'handlingResult', + // render: (text, record, index) => { + // return record?.pomsNeedData?.handlingResult?.value || '' + // } + // }, { - title: '处理结果', - dataIndex: 'handlingResult', + title: '事项名称', + dataIndex: 'fsFormItemName', render: (text, record, index) => { - return record?.pomsNeedData?.handlingResult?.value || '' + return record?.name || '' } }, { diff --git a/web/client/src/sections/workOrder/containers/receipt.jsx b/web/client/src/sections/workOrder/containers/receipt.jsx index df6b217..cd0487c 100644 --- a/web/client/src/sections/workOrder/containers/receipt.jsx +++ b/web/client/src/sections/workOrder/containers/receipt.jsx @@ -123,11 +123,18 @@ const Rest = (props) => { return record?.pomsNeedData?.handlingPerson?.value ? allPepUsersIncludeDel.find(u => u.id == record?.pomsNeedData?.handlingPerson?.value)?.name : '' } }, + // { + // title: '处理结果', + // dataIndex: 'handlingResult', + // render: (text, record, index) => { + // return record?.pomsNeedData?.handlingResult?.value || '' + // } + // }, { - title: '处理结果', - dataIndex: 'handlingResult', + title: '事项名称', + dataIndex: 'fsFormItemName', render: (text, record, index) => { - return record?.pomsNeedData?.handlingResult?.value || '' + return record?.name || '' } }, { diff --git a/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx b/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx index ec7ce73..a2c5ba8 100644 --- a/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx +++ b/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx @@ -106,11 +106,18 @@ const Rest = (props) => { return record?.pomsNeedData?.handlingPerson?.value ? allPepUsersIncludeDel.find(u => u.id == record?.pomsNeedData?.handlingPerson?.value)?.name : '' } }, + // { + // title: '处理结果', + // dataIndex: 'handlingResult', + // render: (text, record, index) => { + // return record?.pomsNeedData?.handlingResult?.value || '' + // } + // }, { - title: '处理结果', - dataIndex: 'handlingResult', + title: '事项名称', + dataIndex: 'fsFormItemName', render: (text, record, index) => { - return record?.pomsNeedData?.handlingResult?.value || '' + return record?.fsFormItemName || '' } }, { diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index b6391a4..dab66f3 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -143,6 +143,8 @@ export const ApiTable = { respondRecord: 'respond-record', + //待办工单 + workOrders:'unfinished' }; // 项企的接口 @@ -161,7 +163,7 @@ export const EmisApiTable = { getApprovalActionUrl: 'process-instance/audit/{type}', // 审批、撤销操作 //删除草稿 delDraftUrl: 'process/drafts/{draftId}', - + }