部署步骤

  1. 更新到pg的方案版没有数据迁移步骤,之前使用的odb数据没用了
  2. 先删除原来的项目管理相关的表单流程和菜单,项目申请、项目变更、项目结项、项目成员周报、项目周报,不删除导入方案时可能会有问题

  3. 导入项目管理方案,修改配置参数。重新发布里面的流程,并创建流程菜单(现在导入没有导入菜单)

  4. 创建固定的菜单

    1. 项目总览列表 projectTotalView
    2. 项目总体视图 projectGantt
    3. 项目详情信息 projectDetailView 设置为隐藏
    4. 项目总览权限设置 projectRole
  5. 创建工单编号,具体可按照实际的规则来设置,并修改表单的工单编号

    1. [项目申请编号]
    2. [项目变更申请编号]
    3. [项目结项编号]
    4. [项目周报编号]
    5. [项目成员周报编号]
  6. 在postgresSQL数据库中创建以下表结构

DROP TABLE IF EXISTS "public"."BasicProject";
   CREATE TABLE "BasicProject"(
       "uuid" VARCHAR(36) NOT NULL, 
       "number" VARCHAR(50),
       "name" VARCHAR(100),
       "constructionDate" BIGINT,
       "type" VARCHAR(20),
       "level" VARCHAR(20),
       "budget" VARCHAR(20),
       "department" VARCHAR(30),
       "partner" VARCHAR(36),
       "desc" TEXT,
       "descAttach" TEXT,
       "projectState" VARCHAR(10),
       "projectChange" TEXT,
       "changeReason" TEXT,
       "projectConclusion" VARCHAR(50),
       "endDate" VARCHAR(30),
       "endDesc" TEXT,
       "endAttach" TEXT,
       "schedule" INT,
       "progress" float4,
       "projectApproval"  VARCHAR(36),
       "projectWeekReport" TEXT,
      "leader" varchar(36), 
      "leaderName" varchar(50), 
      "members" TEXT,
      "membersName" TEXT, 
      "queryDepartment"  TEXT,
      "queryRole"  TEXT,
      "departmentLeaderRead" BOOLEAN,
      "directLeaderRead" BOOLEAN,
       "createTime" VARCHAR(30),
       "updateTime" VARCHAR(30),
       "state" INT,
      "departmentLeader" VARCHAR(255),
       "directLeader" VARCHAR(255),
       PRIMARY KEY (uuid)
   );
   COMMENT ON COLUMN "BasicProject"."number" IS '项目编号';
   COMMENT ON COLUMN "BasicProject"."name" IS '项目名称';
   COMMENT ON COLUMN "BasicProject"."constructionDate" IS '建项日期';
   COMMENT ON COLUMN "BasicProject"."type" IS '项目类型';
   COMMENT ON COLUMN "BasicProject"."level" IS '项目级别';
   COMMENT ON COLUMN "BasicProject"."budget" IS '项目预算';
   COMMENT ON COLUMN "BasicProject"."department" IS '部门';
   COMMENT ON COLUMN "BasicProject"."partner" IS '供应商';
   COMMENT ON COLUMN "BasicProject"."desc" IS '项目简介';
   COMMENT ON COLUMN "BasicProject"."descAttach" IS '简介附件';
   COMMENT ON COLUMN "BasicProject"."projectState" IS '项目状态';
   COMMENT ON COLUMN "BasicProject"."projectChange" IS '项目变更工单';
   COMMENT ON COLUMN "BasicProject"."changeReason" IS '变更原因';
   COMMENT ON COLUMN "BasicProject"."projectConclusion" IS '项目结项工单';
   COMMENT ON COLUMN "BasicProject"."endDate" IS '结项时间';
   COMMENT ON COLUMN "BasicProject"."endDesc" IS '结项备注';
   COMMENT ON COLUMN "BasicProject"."endAttach" IS '结项附件';
   COMMENT ON COLUMN "BasicProject"."schedule" IS '总工期天数 所有阶段相加';
   COMMENT ON COLUMN "BasicProject"."progress" IS '总进度  (阶段1工期*进度+阶段2工期*进度+N)/项目总工期';
   COMMENT ON COLUMN "BasicProject"."projectApproval" IS '项目申请工单';
   COMMENT ON COLUMN "BasicProject"."projectWeekReport" IS '项目周报工单';
   COMMENT ON COLUMN "BasicProject"."leader" IS '项目负责人';
   COMMENT ON COLUMN "BasicProject"."leaderName" IS '项目负责人名字';
   COMMENT ON COLUMN "BasicProject"."members" IS '项目成员';
   COMMENT ON COLUMN "BasicProject"."membersName" IS '项目成员名字';
   COMMENT ON COLUMN "BasicProject"."queryDepartment" IS '可阅部门';
   COMMENT ON COLUMN "BasicProject"."queryRole" IS '可阅角色';
   COMMENT ON COLUMN "BasicProject"."departmentLeaderRead" IS '部门领导是否可阅';
   COMMENT ON COLUMN "BasicProject"."directLeaderRead" IS '直属领导是否可阅';
   COMMENT ON COLUMN "BasicProject"."createTime" IS '创建时间';
   COMMENT ON COLUMN "BasicProject"."updateTime" IS '更新时间';
   COMMENT ON COLUMN "BasicProject"."state" IS '状态';
   COMMENT ON COLUMN "public"."BasicProject"."departmentLeader" IS '部门领导';
   COMMENT ON COLUMN "public"."BasicProject"."directLeader" IS '直属领导';

   DROP TABLE IF EXISTS "BasicProjectStage";
   CREATE TABLE "BasicProjectStage" (
     "uuid" varchar(36) NOT NULL,
     "name" varchar(50)  NOT NULL,
     "stage" varchar(50) NOT NULL,
     "content" text ,
     "progress" float4,
     "startTime" BIGINT,
     "endTime" BIGINT,
     "sort" int4,
     "participants" text ,
     "participantsName" text ,
     "createTime" varchar(50) ,
     "updateTime" varchar(50) ,
     "state" int4,
       PRIMARY KEY(uuid)
   )
   ;
   COMMENT ON COLUMN "BasicProjectStage"."name" IS '阶段名称';
   COMMENT ON COLUMN "BasicProjectStage"."stage" IS '阶段名称';
   COMMENT ON COLUMN "BasicProjectStage"."content" IS '阶段内容';
   COMMENT ON COLUMN "BasicProjectStage"."progress" IS '阶段进度';
   COMMENT ON COLUMN "BasicProjectStage"."startTime" IS '阶段开始时间';
   COMMENT ON COLUMN "BasicProjectStage"."endTime" IS '阶段结束时间';
   COMMENT ON COLUMN "BasicProjectStage"."sort" IS '排序';
   COMMENT ON COLUMN "BasicProjectStage"."participants" IS '阶段参与人';
   COMMENT ON COLUMN "BasicProjectStage"."participants" IS '阶段参与人名字';


   DROP TABLE IF EXISTS "public"."BasicProjectPermission";
   CREATE TABLE "public"."BasicProjectPermission" (
       "uuid" VARCHAR(36) NOT NULL,
       "projects" text,
       "projectNames" text,
       "queryRole" text,
     "queryDepartment" text,
     "departmentLeaderRead" BOOLEAN,
     "directLeaderRead" BOOLEAN,
     "createTime" text,
     "updateTime" text,
     "state" int4,
       PRIMARY KEY(uuid)
   );
   COMMENT ON COLUMN "BasicProjectPermission"."projects" IS '项目Uuid';
   COMMENT ON COLUMN "BasicProjectPermission"."projectNames" IS '项目名称';
   COMMENT ON COLUMN "BasicProjectPermission"."queryRole" IS '可阅角色';
   COMMENT ON COLUMN "BasicProjectPermission"."queryDepartment" IS '可阅部门';
   COMMENT ON COLUMN "BasicProjectPermission"."departmentLeaderRead" IS '是否项目负责人部门领导可阅';
   COMMENT ON COLUMN "BasicProjectPermission"."directLeaderRead" IS '是否项目负责人直属领导可阅';

   DROP TABLE IF EXISTS "public"."BasicProjectChangeHistory";
   CREATE TABLE "public"."BasicProjectChangeHistory" (
       "uuid" varchar(36) NOT NULL,
     "name" varchar(50),
       "workNumber" VARCHAR(50),
     "applyTime" VARCHAR(50),
       "applyUser" VARCHAR(50),
       "processInstId" VARCHAR(50),
       "projectUuid" VARCHAR(50),
       "historyList" TEXT,
     "createTime" text,
     "updateTime" text,
     "state" int4,
       PRIMARY KEY(uuid)
   );
   COMMENT ON COLUMN "BasicProjectChangeHistory"."workNumber" IS '项目变更工单编号';
   COMMENT ON COLUMN "BasicProjectChangeHistory"."applyTime" IS '项目变更申请时间';
   COMMENT ON COLUMN "BasicProjectChangeHistory"."applyUser" IS '项目变更申请人';
   COMMENT ON COLUMN "BasicProjectChangeHistory"."processInstId" IS '项目变更processInstId';
   COMMENT ON COLUMN "BasicProjectChangeHistory"."projectUuid" IS '项目uuid';
   COMMENT ON COLUMN "BasicProjectChangeHistory"."historyList" IS '变更详情';


   DROP TABLE IF EXISTS "BasicProjectStageRelationship";
   CREATE TABLE "BasicProjectStageRelationship" (
     "uuid" VARCHAR(36) NOT NULL,
     "in_" VARCHAR(50) NOT NULL,
     "out_" VARCHAR(50) NOT NULL,
     "in_Class" VARCHAR(100),
     "out_Class" VARCHAR(100),
     "properties" text,
     "group_" text,
     "group_Class" text,
     "createTime" VARCHAR(50),
     "updateTime" VARCHAR(50),
     "state" INT,
      PRIMARY KEY(uuid)
   );

7.如果更新了permission 1.5.3版本,需要执行以下SQL更新, orientdb用户增加直属领导属性

   insert into BasicPermissionPro content {
   "fieldName": "DirectLeader",
   "createTime": "2021-09-27 10:56:22",
   "name": "直属领导",
   "updateTime": "2021-09-27 10:56:22",
   "state": 0,
   "type": "单选框",
   "uuid": "1234551231234112222",
   "value": "BasicUser",
   "status": 0
   }

8.将workflow组件的配置属性值清空

   #项目管理定期生成项目周报
   project.cron=

9.由于项目中有使用供应商管理下拉的功能

  1. 如果当前项目不需要使用供应商管理功能,需要将项目申请和项目变更以及项目详情表单中的合作商下拉隐藏掉,因为后台代码没做兼容,所以还需要导入供应商管理表单。先执行建表语句,再导入供应商管理表单,导入的项目申请和项目变更表单中的合作商下拉使用的是数据集,如果当前环境没有该数据集,则自己创建一个供应商下拉数据集,并重新选择该数据集,防止打开表单的时候报错
  2. 如果当前项目需要使用供应商管理功能,就导入供应商管理方案。
供应商管理表单建表语句

   DROP TABLE IF EXISTS "public"."kform210323105939405_FormData";
    CREATE TABLE "public"."kform210323105939405_FormData" (
      "uuid" varchar(100) COLLATE "pg_catalog"."default",
      "createTime" varchar(100) COLLATE "pg_catalog"."default",
      "updateTime" varchar(100) COLLATE "pg_catalog"."default",
      "state" varchar(10) COLLATE "pg_catalog"."default",
      "customer" varchar(500) COLLATE "pg_catalog"."default",
      "sno" varchar(500) COLLATE "pg_catalog"."default",
      "saddr" varchar(500) COLLATE "pg_catalog"."default",
      "saddr1" text COLLATE "pg_catalog"."default",
      "saddr2" text COLLATE "pg_catalog"."default",
      "gys_type" varchar(500) COLLATE "pg_catalog"."default",
      "userinfo" text COLLATE "pg_catalog"."default",
      "business_matters" varchar(500) COLLATE "pg_catalog"."default",
      "contacts" varchar(500) COLLATE "pg_catalog"."default",
      "post" varchar(500) COLLATE "pg_catalog"."default",
      "telephone" varchar(500) COLLATE "pg_catalog"."default",
      "mobilephone" varchar(500) COLLATE "pg_catalog"."default",
      "other_contact" varchar(500) COLLATE "pg_catalog"."default",
      "remark" varchar(500) COLLATE "pg_catalog"."default",
      "person" varchar(500) COLLATE "pg_catalog"."default",
      "fujian" text COLLATE "pg_catalog"."default",
      "stime" varchar(500) COLLATE "pg_catalog"."default",
      "formData" text COLLATE "pg_catalog"."default"
    );
供应商下拉数据集SQL

select uuid as value,customer as label from "kform210323105939405_FormData"

10.之前添加过项目管理相关的网关要先删掉,插入新的项目管理网关

先查一下这个SQL,看看查出来的网关是不是都是项目管理的,是的话就全部删掉
select * FROM "BasicGatewayRoute" WHERE sourcepath like '%/ops/itsm/project%'
--DELETE FROM "BasicGatewayRoute" WHERE sourcepath like '%/ops/itsm/project%';

INSERT INTO "BasicGatewayRoute" VALUES ('a3171220-e3ba-43ad-9e0f-4ad46ecfdfd4', '项目列表', '/ops/itsm/project/getProjectList', 'itsm', NULL, 'ItsmGetProjectListScript', '查询', NULL, NULL, NULL, NULL, NULL, 0, NULL, 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('ff0b8b04-bb03-4102-85b9-6b9f06c50747', '个人所属未结项项目', '/ops/itsm/project/getUnCloseProjectByLeader', 'itsm', NULL, 'ItsmGetUnCloseProjectByLeaderScript', '查询', NULL, NULL, NULL, NULL, NULL, 0, NULL, 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('f40a96b5-1c86-4b39-87f8-da495c67c47f', '项目详情', '/ops/itsm/project/getProjectByUuid', 'itsm', NULL, 'ItsmGetProjectByUuidScript', '查询', NULL, NULL, NULL, NULL, NULL, 0, NULL, 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('21dc6d85-7419-42dd-9f16-7022a7919e69', '项目关联标签页列表', '/ops/itsm/project/getProjectRelationList', 'itsm', NULL, 'ItsmGetProjectRelationListScript', '查询', NULL, NULL, NULL, NULL, NULL, 0, NULL, 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('dbbe7930-bef7-4277-8c19-710568336af7', '项目变更历史', '/ops/itsm/project/getProjectChangeHistory', 'itsm', NULL, 'ItsmGetProjectChangeHistoryScript', '查询', NULL, NULL, NULL, NULL, NULL, 0, NULL, 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('74de216f-f057-402f-b9ec-37947f8997fd', '甘特图', '/ops/itsm/project/getProjectGanttChart', 'itsm', NULL, 'ItsmGetProjectGanttChartScript', '查询', NULL, NULL, NULL, NULL, NULL, 0, NULL, 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('932ef3bd-65ec-4121-bd62-8e983bf07ba2', '项目下拉(有权限)', '/ops/itsm/project/getProjectSelectList', 'itsm', NULL, 'ItsmGetProjectSelectListScript', '查询', NULL, NULL, NULL, NULL, NULL, 0, NULL, 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('924ef52a-7267-41d6-af8b-18ae77da72ad', '项目下拉(无权限)', '/ops/itsm/project/getAllProjectSelectList', 'itsm', NULL, 'ItsmGetAllProjectSelectListScript', '查询', NULL, NULL, NULL, NULL, NULL, 0, NULL, 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('74e08531-7642-4f57-8ff1-9270665ea1eb', '项目权限列表', '/ops/itsm/project/getProjectPermissionList', 'itsm', NULL, 'ItsmGetProjectPermissionListScript', '查询', NULL, NULL, NULL, NULL, NULL, 0, NULL, 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('abbdff9b-4c7d-4063-b3a9-7235af2a2d7c', '获取项目权限', '/ops/itsm/project/getProjectPermission', 'itsm', NULL, 'ItsmGetProjectPermissionScript', '查询', NULL, NULL, NULL, NULL, NULL, 0, NULL, 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('d4fdfa81-55b4-41de-a6dc-ef3c06ac0be3', '保存项目权限', '/ops/itsm/project/saveProjectPermission', 'itsm', NULL, 'ItsmSaveProjectPermissionScript', '操作', NULL, NULL, NULL, NULL, NULL, 0, NULL, 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('728e249b-eaa3-42f8-a3ed-1aaa05c69591', '删除项目权限', '/ops/itsm/project/deleteProjectPermission', 'itsm', NULL, 'ItsmDeleteProjectPermissionScript', '操作', NULL, NULL, NULL, NULL, NULL, 0, NULL, 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('7dc7609376164ed1bed77eba6121adce', '新增项目', '/ops/itsm/project/saveProject', NULL, NULL, 'ItsmSaveProjectScript', '操作', '新增项目', '', '', '', '2021-02-03 11:20:45', 0, '2021-02-03 11:20:45', 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('215fcbac560049338425d590cbb7375f', '更新项目', '/ops/itsm/project/updateProject', NULL, NULL, 'ItsmUpdateProjectScript', '操作', '更新项目', '', '', '', '2021-02-03 11:20:57', 0, '2021-02-03 11:20:57', 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('563832e64d8e41d3985cf7a2fa9f863f', '关闭项目', '/ops/itsm/project/closeProject', NULL, NULL, 'ItsmCloseProjectScript', '操作', '关闭项目', '', '', '', '2021-02-03 11:21:49', 0, '2021-02-03 11:21:49', 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('5f7859737e27418aa156f5c4e3fc1b05', '项目列表', '/ops/itsm/project/getProjectList', NULL, NULL, 'ItsmGetProjectListScript', '查询', '项目列表', '', '', '', '2021-02-03 11:22:01', 0, '2021-02-03 11:22:01', 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('35a2cb2b599143c0a035d2ce676177f8', '校验项目名称唯一性', '/ops/itsm/project/checkProjectName', NULL, NULL, 'ItsmCheckProjectNameScript', '操作', '校验项目名称唯一性', '', '', '', '2021-02-03 11:22:12', 0, '2021-02-03 11:22:12', 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');
INSERT INTO "BasicGatewayRoute" VALUES ('a946a7b98c4d40e99e0a4fa1f273585d', '更新项目阶段', '/ops/itsm/project/updateProjectStageProgress', NULL, NULL, 'ItsmUpdateProjectStageProgressScript', '操作', '更新项目阶段', '', '', '', '2021-02-03 11:22:23', 0, '2021-02-03 11:22:23', 't', 'script', 'fc956e4f5af54ad2af454ec352cea19b');