作者 tangxvhui

Merge branch 'test'

1 -绩效系统  
  1 +绩效系统
  2 +
  3 +
  4 +服务端地址:
  5 +test 环境 http://performance-back-test.fjmaimaimai.com/
  6 +prod 环境 http://performance-back-prd.fjmaimaimai.com/
  7 +
  8 +前端页面地址
  9 +test环境 https://enterprise-platform-dev.fjmaimaimai.com/#/login
1 -2022/11/10 09:28:21.494 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "company" ("id" bigserial, "logo" text, "name" text, "charge_user_ids" jsonb, "status" bigint, "update_at" timestamptz, "create_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
2 -2022/11/10 09:28:21.521 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "department" ("id" bigserial, "company_id" bigint, "level" bigint, "name" text, "parent_id" bigint, "charge_user_ids" jsonb, "path" text, "create_at" timestamptz, "update_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
3 -2022/11/10 09:28:21.548 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "user" ("id" bigserial, "account" text, "avatar_url" text, "company_id" bigint, "admin_type" bigint, "name" text, "email" text, "status" bigint, "department_id" jsonb, "update_at" timestamptz, "create_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
4 -2022/11/10 09:28:21.575 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "received_message" ("message_id" bigserial, "message_type" text, "message_body" text, "occurred_on" timestamptz, "create_at" timestamptz, PRIMARY KEY ("message_id")) null  
5 -2022/11/10 09:28:21.602 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "role" ("id" bigserial, "name" text, "type" bigint, "description" text, "company_id" bigint, "created_at" timestamptz, "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id")) null  
6 -2022/11/10 09:28:21.630 [D] [hook.go:130] performance COMMENT ON TABLE public."role" IS '角色'; null  
7 -2022/11/10 09:28:21.659 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".id IS 'ID'; null  
8 -2022/11/10 09:28:21.688 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".name IS '角色名称'; null  
9 -2022/11/10 09:28:21.716 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".type IS '角色类型(0角色可删、1系统预置角色不可删)'; null  
10 -2022/11/10 09:28:21.743 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".description IS '角色描述'; null  
11 -2022/11/10 09:28:21.771 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".company_id IS '公司ID'; null  
12 -2022/11/10 09:28:21.799 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".created_at IS '创建时间'; null  
13 -2022/11/10 09:28:21.828 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".updated_at IS '更新时间'; null  
14 -2022/11/10 09:28:21.856 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".deleted_at IS '删除时间'; null  
15 -2022/11/10 09:28:21.883 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "role_user" ("id" bigserial, "role_id" bigint, "user_id" bigint, "company_id" bigint, "created_at" timestamptz, "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id")) null  
16 -2022/11/10 09:28:21.911 [D] [hook.go:130] performance COMMENT ON TABLE public."role_user" IS '角色用户关系'; null  
17 -2022/11/10 09:28:21.937 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".id IS 'ID'; null  
18 -2022/11/10 09:28:21.964 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".role_id IS '角色ID'; null  
19 -2022/11/10 09:28:21.993 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".user_id IS '用户ID'; null  
20 -2022/11/10 09:28:22.020 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".company_id IS '公司ID'; null  
21 -2022/11/10 09:28:22.047 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".created_at IS '创建时间'; null  
22 -2022/11/10 09:28:22.075 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".updated_at IS '更新时间'; null  
23 -2022/11/10 09:28:22.102 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".deleted_at IS '删除时间'; null  
24 -2022/11/10 09:28:22.116 [I] [???:0] performance http server Running on http://:8082  
25 -2022/11/10 09:28:22.860 [E] [asm_amd64.s:1594] performance kafka: client has run out of available brokers to talk to (Is your cluster reachable?) []  
26 -2022/11/10 09:29:54.845 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "company" ("id" bigserial, "logo" text, "name" text, "charge_user_ids" jsonb, "status" bigint, "update_at" timestamptz, "create_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
27 -2022/11/10 09:29:54.873 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "department" ("id" bigserial, "company_id" bigint, "level" bigint, "name" text, "parent_id" bigint, "charge_user_ids" jsonb, "path" text, "create_at" timestamptz, "update_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
28 -2022/11/10 09:29:54.899 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "user" ("id" bigserial, "account" text, "avatar_url" text, "company_id" bigint, "admin_type" bigint, "name" text, "email" text, "status" bigint, "department_id" jsonb, "update_at" timestamptz, "create_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
29 -2022/11/10 09:29:54.926 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "received_message" ("message_id" bigserial, "message_type" text, "message_body" text, "occurred_on" timestamptz, "create_at" timestamptz, PRIMARY KEY ("message_id")) null  
30 -2022/11/10 09:29:54.953 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "role" ("id" bigserial, "name" text, "type" bigint, "description" text, "company_id" bigint, "created_at" timestamptz, "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id")) null  
31 -2022/11/10 09:29:54.981 [D] [hook.go:130] performance COMMENT ON TABLE public."role" IS '角色'; null  
32 -2022/11/10 09:29:55.009 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".id IS 'ID'; null  
33 -2022/11/10 09:29:55.037 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".name IS '角色名称'; null  
34 -2022/11/10 09:29:55.068 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".type IS '角色类型(0角色可删、1系统预置角色不可删)'; null  
35 -2022/11/10 09:29:55.094 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".description IS '角色描述'; null  
36 -2022/11/10 09:29:55.121 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".company_id IS '公司ID'; null  
37 -2022/11/10 09:29:55.149 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".created_at IS '创建时间'; null  
38 -2022/11/10 09:29:55.183 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".updated_at IS '更新时间'; null  
39 -2022/11/10 09:29:55.212 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".deleted_at IS '删除时间'; null  
40 -2022/11/10 09:29:55.243 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "role_user" ("id" bigserial, "role_id" bigint, "user_id" bigint, "company_id" bigint, "created_at" timestamptz, "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id")) null  
41 -2022/11/10 09:29:55.270 [D] [hook.go:130] performance COMMENT ON TABLE public."role_user" IS '角色用户关系'; null  
42 -2022/11/10 09:29:55.297 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".id IS 'ID'; null  
43 -2022/11/10 09:29:55.324 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".role_id IS '角色ID'; null  
44 -2022/11/10 09:29:55.351 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".user_id IS '用户ID'; null  
45 -2022/11/10 09:29:55.377 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".company_id IS '公司ID'; null  
46 -2022/11/10 09:29:55.403 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".created_at IS '创建时间'; null  
47 -2022/11/10 09:29:55.430 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".updated_at IS '更新时间'; null  
48 -2022/11/10 09:29:55.456 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".deleted_at IS '删除时间'; null  
49 -2022/11/10 09:29:55.466 [I] [???:0] performance http server Running on http://:8082  
50 -2022/11/10 09:29:56.217 [E] [asm_amd64.s:1594] performance kafka: client has run out of available brokers to talk to (Is your cluster reachable?) []  
51 -2022/11/10 09:30:15.476 [D] [router.go:977] performance | 127.0.0.1| 200 | 364.534µs| match| GET  /log r:/log  
52 -2022/11/10 09:30:15.546 [D] [router.go:977] performance | 127.0.0.1| 404 | 959.763µs| nomatch| GET  /favicon.ico  
53 -2022/11/10 15:07:19.528 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "company" ("id" bigserial, "logo" text, "name" text, "charge_user_ids" jsonb, "status" bigint, "update_at" timestamptz, "create_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
54 -2022/11/10 15:07:19.556 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "department" ("id" bigserial, "company_id" bigint, "level" bigint, "name" text, "parent_id" bigint, "charge_user_ids" jsonb, "path" text, "create_at" timestamptz, "update_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
55 -2022/11/10 15:07:19.583 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "user" ("id" bigserial, "account" text, "avatar_url" text, "company_id" bigint, "admin_type" bigint, "name" text, "email" text, "status" bigint, "department_id" jsonb, "update_at" timestamptz, "create_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
56 -2022/11/10 15:07:19.611 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "received_message" ("message_id" bigserial, "message_type" text, "message_body" text, "occurred_on" timestamptz, "create_at" timestamptz, PRIMARY KEY ("message_id")) null  
57 -2022/11/10 15:07:19.638 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "role" ("id" bigserial, "name" text, "type" bigint, "description" text, "company_id" bigint, "created_at" timestamptz, "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id")) null  
58 -2022/11/10 15:07:19.666 [D] [hook.go:130] performance COMMENT ON TABLE public."role" IS '角色'; null  
59 -2022/11/10 15:07:19.695 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".id IS 'ID'; null  
60 -2022/11/10 15:07:19.723 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".name IS '角色名称'; null  
61 -2022/11/10 15:07:19.750 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".type IS '角色类型(0角色可删、1系统预置角色不可删)'; null  
62 -2022/11/10 15:07:19.777 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".description IS '角色描述'; null  
63 -2022/11/10 15:07:19.805 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".company_id IS '公司ID'; null  
64 -2022/11/10 15:07:19.834 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".created_at IS '创建时间'; null  
65 -2022/11/10 15:07:19.861 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".updated_at IS '更新时间'; null  
66 -2022/11/10 15:07:19.889 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".deleted_at IS '删除时间'; null  
67 -2022/11/10 15:07:19.916 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "role_user" ("id" bigserial, "role_id" bigint, "user_id" bigint, "company_id" bigint, "created_at" timestamptz, "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id")) null  
68 -2022/11/10 15:07:19.944 [D] [hook.go:130] performance COMMENT ON TABLE public."role_user" IS '角色用户关系'; null  
69 -2022/11/10 15:07:19.971 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".id IS 'ID'; null  
70 -2022/11/10 15:07:19.998 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".role_id IS '角色ID'; null  
71 -2022/11/10 15:07:20.026 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".user_id IS '用户ID'; null  
72 -2022/11/10 15:07:20.054 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".company_id IS '公司ID'; null  
73 -2022/11/10 15:07:20.081 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".created_at IS '创建时间'; null  
74 -2022/11/10 15:07:20.109 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".updated_at IS '更新时间'; null  
75 -2022/11/10 15:07:20.136 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".deleted_at IS '删除时间'; null  
76 -2022/11/10 15:07:20.221 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "positions" ("id" bigserial, "company_id" bigint, "name" text, "parent_id" bigint, "path" text, "level" bigint, "remarks" text, "created_at" timestamptz, "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id")) null  
77 -2022/11/10 15:07:20.257 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "user_positions" ("id" bigserial, "company_id" bigint, "position_id" bigint, "user_id" bigint, "created_at" timestamptz, "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id")) null  
78 -2022/11/10 15:07:20.272 [I] [???:0] performance http server Running on http://:8082  
79 -2022/11/10 15:07:21.024 [E] [asm_amd64.s:1594] performance kafka: client has run out of available brokers to talk to (Is your cluster reachable?) []  
80 -2022/11/10 15:58:14.817 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "company" ("id" bigserial, "logo" text, "name" text, "charge_user_ids" jsonb, "status" bigint, "update_at" timestamptz, "create_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
81 -2022/11/10 15:58:14.843 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "department" ("id" bigserial, "company_id" bigint, "level" bigint, "name" text, "parent_id" bigint, "charge_user_ids" jsonb, "path" text, "create_at" timestamptz, "update_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
82 -2022/11/10 15:58:14.870 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "user" ("id" bigserial, "account" text, "avatar_url" text, "company_id" bigint, "admin_type" bigint, "name" text, "email" text, "status" bigint, "department_id" jsonb, "position_id" jsonb, "update_at" timestamptz, "create_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
83 -2022/11/10 15:58:14.897 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "received_message" ("message_id" bigserial, "message_type" text, "message_body" text, "occurred_on" timestamptz, "create_at" timestamptz, PRIMARY KEY ("message_id")) null  
84 -2022/11/10 15:58:14.924 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "role" ("id" bigserial, "name" text, "type" bigint, "description" text, "company_id" bigint, "created_at" timestamptz, "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id")) null  
85 -2022/11/10 15:58:14.952 [D] [hook.go:130] performance COMMENT ON TABLE public."role" IS '角色'; null  
86 -2022/11/10 15:58:14.979 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".id IS 'ID'; null  
87 -2022/11/10 15:58:15.006 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".name IS '角色名称'; null  
88 -2022/11/10 15:58:15.033 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".type IS '角色类型(0角色可删、1系统预置角色不可删)'; null  
89 -2022/11/10 15:58:15.060 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".description IS '角色描述'; null  
90 -2022/11/10 15:58:15.087 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".company_id IS '公司ID'; null  
91 -2022/11/10 15:58:15.114 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".created_at IS '创建时间'; null  
92 -2022/11/10 15:58:15.141 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".updated_at IS '更新时间'; null  
93 -2022/11/10 15:58:15.168 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".deleted_at IS '删除时间'; null  
94 -2022/11/10 15:58:15.194 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "role_user" ("id" bigserial, "role_id" bigint, "user_id" bigint, "company_id" bigint, "created_at" timestamptz, "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id")) null  
95 -2022/11/10 15:58:15.222 [D] [hook.go:130] performance COMMENT ON TABLE public."role_user" IS '角色用户关系'; null  
96 -2022/11/10 15:58:15.249 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".id IS 'ID'; null  
97 -2022/11/10 15:58:15.275 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".role_id IS '角色ID'; null  
98 -2022/11/10 15:58:15.302 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".user_id IS '用户ID'; null  
99 -2022/11/10 15:58:15.329 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".company_id IS '公司ID'; null  
100 -2022/11/10 15:58:15.356 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".created_at IS '创建时间'; null  
101 -2022/11/10 15:58:15.383 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".updated_at IS '更新时间'; null  
102 -2022/11/10 15:58:15.409 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".deleted_at IS '删除时间'; null  
103 -2022/11/10 15:58:15.435 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "positions" ("id" bigserial, "company_id" bigint, "name" text, "parent_id" bigint, "path" text, "level" bigint, "remarks" text, "created_at" timestamptz, "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id")) null  
104 -2022/11/10 15:58:15.450 [I] [???:0] performance http server Running on http://:8082  
105 -2022/11/10 15:58:16.194 [E] [asm_amd64.s:1594] performance kafka: client has run out of available brokers to talk to (Is your cluster reachable?) []  
106 -2022/11/10 16:16:09.220 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "company" ("id" bigserial, "logo" text, "name" text, "charge_user_ids" jsonb, "status" bigint, "update_at" timestamptz, "create_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
107 -2022/11/10 16:16:09.247 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "department" ("id" bigserial, "company_id" bigint, "level" bigint, "name" text, "parent_id" bigint, "charge_user_ids" jsonb, "path" text, "create_at" timestamptz, "update_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
108 -2022/11/10 16:16:09.274 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "user" ("id" bigserial, "account" text, "avatar_url" text, "company_id" bigint, "admin_type" bigint, "name" text, "email" text, "status" bigint, "department_id" jsonb, "position_id" jsonb, "update_at" timestamptz, "create_at" timestamptz, "delete_at" timestamptz, PRIMARY KEY ("id")) null  
109 -2022/11/10 16:16:09.302 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "received_message" ("message_id" bigserial, "message_type" text, "message_body" text, "occurred_on" timestamptz, "create_at" timestamptz, PRIMARY KEY ("message_id")) null  
110 -2022/11/10 16:16:09.330 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "role" ("id" bigserial, "name" text, "type" bigint, "description" text, "company_id" bigint, "created_at" timestamptz, "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id")) null  
111 -2022/11/10 16:16:09.359 [D] [hook.go:130] performance COMMENT ON TABLE public."role" IS '角色'; null  
112 -2022/11/10 16:16:09.386 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".id IS 'ID'; null  
113 -2022/11/10 16:16:09.415 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".name IS '角色名称'; null  
114 -2022/11/10 16:16:09.442 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".type IS '角色类型(0角色可删、1系统预置角色不可删)'; null  
115 -2022/11/10 16:16:09.470 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".description IS '角色描述'; null  
116 -2022/11/10 16:16:09.497 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".company_id IS '公司ID'; null  
117 -2022/11/10 16:16:09.524 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".created_at IS '创建时间'; null  
118 -2022/11/10 16:16:09.553 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".updated_at IS '更新时间'; null  
119 -2022/11/10 16:16:09.580 [D] [hook.go:130] performance COMMENT ON COLUMN public."role".deleted_at IS '删除时间'; null  
120 -2022/11/10 16:16:09.606 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "role_user" ("id" bigserial, "role_id" bigint, "user_id" bigint, "company_id" bigint, "created_at" timestamptz, "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id")) null  
121 -2022/11/10 16:16:09.633 [D] [hook.go:130] performance COMMENT ON TABLE public."role_user" IS '角色用户关系'; null  
122 -2022/11/10 16:16:09.660 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".id IS 'ID'; null  
123 -2022/11/10 16:16:09.687 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".role_id IS '角色ID'; null  
124 -2022/11/10 16:16:09.714 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".user_id IS '用户ID'; null  
125 -2022/11/10 16:16:09.750 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".company_id IS '公司ID'; null  
126 -2022/11/10 16:16:09.776 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".created_at IS '创建时间'; null  
127 -2022/11/10 16:16:09.803 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".updated_at IS '更新时间'; null  
128 -2022/11/10 16:16:09.831 [D] [hook.go:130] performance COMMENT ON COLUMN public."role_user".deleted_at IS '删除时间'; null  
129 -2022/11/10 16:16:09.857 [D] [hook.go:130] performance CREATE TABLE IF NOT EXISTS "positions" ("id" bigserial, "company_id" bigint, "name" text, "parent_id" bigint, "path" text, "level" bigint, "remarks" text, "created_at" timestamptz, "updated_at" timestamptz, "deleted_at" timestamptz, PRIMARY KEY ("id")) null  
130 -2022/11/10 16:16:09.873 [I] [???:0] performance http server Running on http://:8082  
131 -2022/11/10 16:16:10.621 [E] [asm_amd64.s:1594] performance kafka: client has run out of available brokers to talk to (Is your cluster reachable?) []  
不能预览此文件类型
@@ -313,6 +313,7 @@ func (rs *EvaluationCycleService) Remove(in *command.DeleteCycleCommand) (interf @@ -313,6 +313,7 @@ func (rs *EvaluationCycleService) Remove(in *command.DeleteCycleCommand) (interf
313 cycleTemplateRepository := factory.CreateEvaluationCycleTemplateRepository(map[string]interface{}{"transactionContext": transactionContext}) 313 cycleTemplateRepository := factory.CreateEvaluationCycleTemplateRepository(map[string]interface{}{"transactionContext": transactionContext})
314 projectRepository := factory.CreateEvaluationProjectRepository(map[string]interface{}{"transactionContext": transactionContext}) 314 projectRepository := factory.CreateEvaluationProjectRepository(map[string]interface{}{"transactionContext": transactionContext})
315 taskRepository := factory.CreateNodeTaskRepository(map[string]interface{}{"transactionContext": transactionContext}) 315 taskRepository := factory.CreateNodeTaskRepository(map[string]interface{}{"transactionContext": transactionContext})
  316 + staffRepository := factory.CreateStaffAssessTaskRepository(map[string]interface{}{"transactionContext": transactionContext})
316 317
317 // 删除周期 318 // 删除周期
318 cycle, err := cycleRepository.FindOne(map[string]interface{}{"id": in.Id}) 319 cycle, err := cycleRepository.FindOne(map[string]interface{}{"id": in.Id})
@@ -337,9 +338,14 @@ func (rs *EvaluationCycleService) Remove(in *command.DeleteCycleCommand) (interf @@ -337,9 +338,14 @@ func (rs *EvaluationCycleService) Remove(in *command.DeleteCycleCommand) (interf
337 if _, err := projectRepository.Remove(projects[i]); err != nil { 338 if _, err := projectRepository.Remove(projects[i]); err != nil {
338 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 339 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
339 } 340 }
  341 +
  342 + // 删除项目已生成的周期评估数据
  343 + if err := staffRepository.RemoveByProjectId(int(projects[i].Id)); err != nil {
  344 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  345 + }
340 } 346 }
341 347
342 - // 删除周期下的所有任务 348 + // 删除周期下的所有定时任务
343 tasks, err := taskRepository.Find(map[string]interface{}{"cycleId": in.Id}) 349 tasks, err := taskRepository.Find(map[string]interface{}{"cycleId": in.Id})
344 if err != nil { 350 if err != nil {
345 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 351 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -345,6 +345,7 @@ func (rs *EvaluationProjectService) Remove(in *command.DeleteProjectCommand) (in @@ -345,6 +345,7 @@ func (rs *EvaluationProjectService) Remove(in *command.DeleteProjectCommand) (in
345 345
346 projectRepository := factory.CreateEvaluationProjectRepository(map[string]interface{}{"transactionContext": transactionContext}) 346 projectRepository := factory.CreateEvaluationProjectRepository(map[string]interface{}{"transactionContext": transactionContext})
347 taskRepository := factory.CreateNodeTaskRepository(map[string]interface{}{"transactionContext": transactionContext}) 347 taskRepository := factory.CreateNodeTaskRepository(map[string]interface{}{"transactionContext": transactionContext})
  348 + staffRepository := factory.CreateStaffAssessTaskRepository(map[string]interface{}{"transactionContext": transactionContext})
348 349
349 project, err := projectRepository.FindOne(map[string]interface{}{"id": in.Id}) 350 project, err := projectRepository.FindOne(map[string]interface{}{"id": in.Id})
350 if err != nil { 351 if err != nil {
@@ -354,8 +355,13 @@ func (rs *EvaluationProjectService) Remove(in *command.DeleteProjectCommand) (in @@ -354,8 +355,13 @@ func (rs *EvaluationProjectService) Remove(in *command.DeleteProjectCommand) (in
354 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 355 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
355 } 356 }
356 357
357 - // 查看任务过程,移除项目关联的所有任务  
358 - tasks, err := taskRepository.Find(map[string]interface{}{"projectId": in.Id}) 358 + // 删除项目已生成的周期评估数据
  359 + if err := staffRepository.RemoveByProjectId(int(project.Id)); err != nil {
  360 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  361 + }
  362 +
  363 + // 移除项目关联的所有定时任务
  364 + tasks, err := taskRepository.Find(map[string]interface{}{"projectId": project.Id})
359 if err != nil { 365 if err != nil {
360 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 366 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
361 } 367 }
@@ -410,6 +416,11 @@ func (rs *EvaluationProjectService) List(in *command.QueryProjectCommand) (inter @@ -410,6 +416,11 @@ func (rs *EvaluationProjectService) List(in *command.QueryProjectCommand) (inter
410 _, users, _ := userRepository.Find(map[string]interface{}{"ids": pmpUserIds, "limit": len(pmpUserIds)}) 416 _, users, _ := userRepository.Find(map[string]interface{}{"ids": pmpUserIds, "limit": len(pmpUserIds)})
411 pmpUsers = users 417 pmpUsers = users
412 } 418 }
  419 +
  420 + if err := transactionContext.CommitTransaction(); err != nil {
  421 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  422 + }
  423 +
413 projectAdapters := adapter.TransformProjectListAdapter(projects, pmpUsers) 424 projectAdapters := adapter.TransformProjectListAdapter(projects, pmpUsers)
414 return tool_funs.SimpleWrapGridMap(total, projectAdapters), nil 425 return tool_funs.SimpleWrapGridMap(total, projectAdapters), nil
415 } 426 }
@@ -562,13 +573,7 @@ func (rs *EvaluationProjectService) CheckRecipients(in *command.CheckRecipientCo @@ -562,13 +573,7 @@ func (rs *EvaluationProjectService) CheckRecipients(in *command.CheckRecipientCo
562 repeatNum++ 573 repeatNum++
563 } 574 }
564 } 575 }
565 - //if repeatNum > 0 {  
566 - // return nil, application.ThrowError(application.BUSINESS_ERROR, fmt.Sprintf("有%d人已经在本周期其他项目内,需要将他们移除", repeatNum))  
567 - //}  
568 576
569 - if err != nil {  
570 - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())  
571 - }  
572 if err := transactionContext.CommitTransaction(); err != nil { 577 if err := transactionContext.CommitTransaction(); err != nil {
573 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 578 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
574 } 579 }
@@ -162,23 +162,6 @@ func (rs *EvaluationRuleService) Remove(in *command.DeleteRuleCommand) (interfac @@ -162,23 +162,6 @@ func (rs *EvaluationRuleService) Remove(in *command.DeleteRuleCommand) (interfac
162 return rule, nil 162 return rule, nil
163 } 163 }
164 164
165 -//func (rs *EvaluationRuleService) List(in *command.QueryRuleCommand) (interface{}, error) {  
166 -// transactionContext, err := factory.StartTransaction()  
167 -// if err != nil {  
168 -// return nil, err  
169 -// }  
170 -// defer func() {  
171 -// transactionContext.RollbackTransaction()  
172 -// }()  
173 -// ruleRepository := factory.CreateEvaluationRuleRepository(map[string]interface{}{"transactionContext": transactionContext})  
174 -//  
175 -// total, rules, err := ruleRepository.Find(tool_funs.SimpleStructToMap(in))  
176 -// if err != nil {  
177 -// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())  
178 -// }  
179 -// return tool_funs.SimpleWrapGridMap(total, rules), nil  
180 -//}  
181 -  
182 func (rs *EvaluationRuleService) ListRelCreator(in *command.QueryRuleCommand) (interface{}, error) { 165 func (rs *EvaluationRuleService) ListRelCreator(in *command.QueryRuleCommand) (interface{}, error) {
183 transactionContext, err := factory.ValidateStartTransaction(in) 166 transactionContext, err := factory.ValidateStartTransaction(in)
184 if err != nil { 167 if err != nil {
@@ -220,6 +203,8 @@ func (rs *EvaluationRuleService) ListRelCreator(in *command.QueryRuleCommand) (i @@ -220,6 +203,8 @@ func (rs *EvaluationRuleService) ListRelCreator(in *command.QueryRuleCommand) (i
220 ra := &adapter.RuleAdapter{} 203 ra := &adapter.RuleAdapter{}
221 ra.EvaluationRule = rule 204 ra.EvaluationRule = rule
222 ras = append(ras, ra) 205 ras = append(ras, ra)
  206 +
  207 + total += 1
223 } 208 }
224 209
225 _, users, _ := userRepository.Find(map[string]interface{}{"ids": creatorIds, "limit": len(creatorIds)}) 210 _, users, _ := userRepository.Find(map[string]interface{}{"ids": creatorIds, "limit": len(creatorIds)})
@@ -234,6 +219,11 @@ func (rs *EvaluationRuleService) ListRelCreator(in *command.QueryRuleCommand) (i @@ -234,6 +219,11 @@ func (rs *EvaluationRuleService) ListRelCreator(in *command.QueryRuleCommand) (i
234 ras[i].CreatorName = v 219 ras[i].CreatorName = v
235 } 220 }
236 } 221 }
  222 +
  223 + if err := transactionContext.CommitTransaction(); err != nil {
  224 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  225 + }
  226 +
237 return tool_funs.SimpleWrapGridMap(total, ras), nil 227 return tool_funs.SimpleWrapGridMap(total, ras), nil
238 } 228 }
239 229
@@ -271,5 +261,9 @@ func (rs *EvaluationRuleService) ListCreator(in *command.QueryCreatorCommand) (i @@ -271,5 +261,9 @@ func (rs *EvaluationRuleService) ListCreator(in *command.QueryCreatorCommand) (i
271 } 261 }
272 cas = append(cas, ca) 262 cas = append(cas, ca)
273 } 263 }
  264 +
  265 + if err := transactionContext.CommitTransaction(); err != nil {
  266 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  267 + }
274 return map[string]interface{}{"list": cas}, nil 268 return map[string]interface{}{"list": cas}, nil
275 } 269 }
@@ -280,30 +280,31 @@ func (srv StaffAssessServeice) AssessSelfList(param *query.AssessSelfListQuery) @@ -280,30 +280,31 @@ func (srv StaffAssessServeice) AssessSelfList(param *query.AssessSelfListQuery)
280 log.Logger.Error("获取用户信息," + err.Error()) 280 log.Logger.Error("获取用户信息," + err.Error())
281 return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取用户信息,"+err.Error()) 281 return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取用户信息,"+err.Error())
282 } 282 }
283 - departmentRepo := factory.CreateDepartmentRepository(map[string]interface{}{  
284 - "transactionContext": transactionContext,  
285 - })  
286 - var supperUserList []*domain.User  
287 - if len(userData.DepartmentId) > 0 {  
288 - _, departmentList, err := departmentRepo.Find(map[string]interface{}{  
289 - "ids": userData.DepartmentId,  
290 - })  
291 - if err != nil {  
292 - return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取部门信息,"+err.Error())  
293 - }  
294 - var chargeUserIds []int64  
295 - for _, v := range departmentList {  
296 - chargeUserIds = append(chargeUserIds, v.ChargeUserIds...)  
297 - }  
298 - if len(chargeUserIds) > 0 {  
299 - _, supperUserList, err = userRepo.Find(map[string]interface{}{  
300 - "ids": chargeUserIds,  
301 - })  
302 - if err != nil {  
303 - return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取员工上级信息,"+err.Error())  
304 - }  
305 - }  
306 - } 283 + // departmentRepo := factory.CreateDepartmentRepository(map[string]interface{}{
  284 + // "transactionContext": transactionContext,
  285 + // })
  286 + // var supperUserList []*domain.User
  287 + // if len(userData.DepartmentId) > 0 {
  288 + // _, departmentList, err := departmentRepo.Find(map[string]interface{}{
  289 + // "ids": userData.DepartmentId,
  290 + // })
  291 + // if err != nil {
  292 + // return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取部门信息,"+err.Error())
  293 + // }
  294 + // var chargeUserIds []int64
  295 + // for _, v := range departmentList {
  296 + // chargeUserIds = append(chargeUserIds, v.ChargeUserIds...)
  297 + // }
  298 + // if len(chargeUserIds) > 0 {
  299 + // _, supperUserList, err = userRepo.Find(map[string]interface{}{
  300 + // "ids": chargeUserIds,
  301 + // })
  302 + // if err != nil {
  303 + // return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取员工上级信息,"+err.Error())
  304 + // }
  305 + // }
  306 + // }
  307 + supperUserList, _ := srv.getStaffSuper(transactionContext, *userData)
307 if err := transactionContext.CommitTransaction(); err != nil { 308 if err := transactionContext.CommitTransaction(); err != nil {
308 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 309 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
309 } 310 }
@@ -325,7 +326,7 @@ func (srv StaffAssessServeice) AssessSelfList(param *query.AssessSelfListQuery) @@ -325,7 +326,7 @@ func (srv StaffAssessServeice) AssessSelfList(param *query.AssessSelfListQuery)
325 UserName: userData.Name, 326 UserName: userData.Name,
326 CompanyName: companyData.Name, 327 CompanyName: companyData.Name,
327 SupperUserName: "", 328 SupperUserName: "",
328 - DutyTime: userData.CreatedAt.Local().Format("2006-01-02 15:04:05"), 329 + DutyTime: userData.EntryTime,
329 } 330 }
330 for _, v := range supperUserList { 331 for _, v := range supperUserList {
331 userInfo.SupperUserName = userInfo.SupperUserName + v.Name + " " 332 userInfo.SupperUserName = userInfo.SupperUserName + v.Name + " "
@@ -1003,6 +1004,9 @@ func (srv StaffAssessServeice) getAssessSelfInfoUncompleted(transactionContext a @@ -1003,6 +1004,9 @@ func (srv StaffAssessServeice) getAssessSelfInfoUncompleted(transactionContext a
1003 if err != nil { 1004 if err != nil {
1004 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取项目填写内容"+err.Error()) 1005 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取项目填写内容"+err.Error())
1005 } 1006 }
  1007 + if projectData.Template == nil {
  1008 + return nil, nil
  1009 + }
1006 var linkNode *domain.LinkNode 1010 var linkNode *domain.LinkNode
1007 for _, v := range projectData.Template.LinkNodes { 1011 for _, v := range projectData.Template.LinkNodes {
1008 if v.Id == int64(assess.LinkNodeId) { 1012 if v.Id == int64(assess.LinkNodeId) {
@@ -1013,11 +1017,23 @@ func (srv StaffAssessServeice) getAssessSelfInfoUncompleted(transactionContext a @@ -1013,11 +1017,23 @@ func (srv StaffAssessServeice) getAssessSelfInfoUncompleted(transactionContext a
1013 if linkNode == nil { 1017 if linkNode == nil {
1014 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "未获得评估环节配置"+err.Error()) 1018 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "未获得评估环节配置"+err.Error())
1015 } 1019 }
  1020 +
  1021 + var nodeContentList []*domain.NodeContent
  1022 + if len(linkNode.NodeContents) > 0 {
  1023 + nodeContentList = linkNode.NodeContents
  1024 + } else {
  1025 + //如果当前节点没有评估内容,就去 使用自评节点的评估内容
  1026 + for _, v := range projectData.Template.LinkNodes {
  1027 + if v.Type == domain.LinkNodeSelfAssessment {
  1028 + nodeContentList = v.NodeContents
  1029 + }
  1030 + }
  1031 + }
1016 ruleRepo := factory.CreateEvaluationRuleRepository(map[string]interface{}{ 1032 ruleRepo := factory.CreateEvaluationRuleRepository(map[string]interface{}{
1017 "transactionContext": transactionContext, 1033 "transactionContext": transactionContext,
1018 }) 1034 })
1019 ruleMap := map[int64]*domain.EvaluationRule{} 1035 ruleMap := map[int64]*domain.EvaluationRule{}
1020 - for _, v := range linkNode.NodeContents { 1036 + for _, v := range nodeContentList {
1021 if _, ok := ruleMap[v.RuleId]; ok { 1037 if _, ok := ruleMap[v.RuleId]; ok {
1022 continue 1038 continue
1023 } 1039 }
@@ -1031,7 +1047,7 @@ func (srv StaffAssessServeice) getAssessSelfInfoUncompleted(transactionContext a @@ -1031,7 +1047,7 @@ func (srv StaffAssessServeice) getAssessSelfInfoUncompleted(transactionContext a
1031 1047
1032 var contentList []*domain.StaffAssessContent 1048 var contentList []*domain.StaffAssessContent
1033 nowTime := time.Now() 1049 nowTime := time.Now()
1034 - for i, v := range linkNode.NodeContents { 1050 + for i, v := range nodeContentList {
1035 item := &domain.StaffAssessContent{ 1051 item := &domain.StaffAssessContent{
1036 Id: 0, 1052 Id: 0,
1037 StaffAssessId: assess.Id, 1053 StaffAssessId: assess.Id,
@@ -1057,6 +1073,7 @@ func (srv StaffAssessServeice) getAssessSelfInfoUncompleted(transactionContext a @@ -1057,6 +1073,7 @@ func (srv StaffAssessServeice) getAssessSelfInfoUncompleted(transactionContext a
1057 ritem := domain.AssessContemtRemark{ 1073 ritem := domain.AssessContemtRemark{
1058 Title: vv.Title, 1074 Title: vv.Title,
1059 HintText: vv.HintText, 1075 HintText: vv.HintText,
  1076 + Definition: vv.Definition,
1060 RemarkText: "", 1077 RemarkText: "",
1061 } 1078 }
1062 remarks = append(remarks, ritem) 1079 remarks = append(remarks, ritem)
@@ -1696,14 +1713,12 @@ func (srv StaffAssessServeice) SaveAssessInfo(param *command.SaveAssessInfoComma @@ -1696,14 +1713,12 @@ func (srv StaffAssessServeice) SaveAssessInfo(param *command.SaveAssessInfoComma
1696 continue 1713 continue
1697 } 1714 }
1698 v.Value = item.Value 1715 v.Value = item.Value
1699 - if len(item.Value) > 0 {  
1700 - //填入评估值描述  
1701 - reteResult, err := v.Rule.ScoreOrRating(&v.Value)  
1702 - if err != nil {  
1703 - return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())  
1704 - }  
1705 - v.ReteResult = reteResult 1716 + //填入评估值描述
  1717 + reteResult, err := v.Rule.ScoreOrRating(&v.Value)
  1718 + if err != nil {
  1719 + return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
1706 } 1720 }
  1721 + v.ReteResult = reteResult
1707 for ii := range v.Remark { 1722 for ii := range v.Remark {
1708 for _, vvv := range item.Remark { 1723 for _, vvv := range item.Remark {
1709 if v.Remark[ii].Title == vvv.Title { 1724 if v.Remark[ii].Title == vvv.Title {
@@ -3,6 +3,7 @@ package service @@ -3,6 +3,7 @@ package service
3 import ( 3 import (
4 "github.com/linmadan/egglib-go/core/application" 4 "github.com/linmadan/egglib-go/core/application"
5 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory" 5 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
  6 + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/adapter"
6 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/command" 7 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/command"
7 ) 8 )
8 9
@@ -28,3 +29,16 @@ func (srv StaffAssessServeice) InvokCreateStaffAssessTask(param *command.CreateS @@ -28,3 +29,16 @@ func (srv StaffAssessServeice) InvokCreateStaffAssessTask(param *command.CreateS
28 } 29 }
29 return data, nil 30 return data, nil
30 } 31 }
  32 +
  33 +//保存员工绩效评估填写过程中即写即存的内容
  34 +func (srv StaffAssessServeice) SaveAssessContentTemp(param *command.SaveAssessInfoCommand) error {
  35 +
  36 + return nil
  37 +}
  38 +
  39 +//获取员工绩效评估填写内容
  40 +//临时数据存在时就获取临时数据
  41 +//不存在就获取实际保存的数据
  42 +func (srv StaffAssessServeice) GetAssessContentTemp(param *command.SaveAssessInfoCommand) (*adapter.AssessInfoResp, error) {
  43 + return nil, nil
  44 +}
@@ -145,7 +145,7 @@ func GenerateSysRule(companyId int64) *EvaluationRule { @@ -145,7 +145,7 @@ func GenerateSysRule(companyId int64) *EvaluationRule {
145 145
146 newRule := &EvaluationRule{ 146 newRule := &EvaluationRule{
147 Id: 0, 147 Id: 0,
148 - Name: "评级(默认)", 148 + Name: "评级",
149 Remark: "", 149 Remark: "",
150 CompanyId: companyId, 150 CompanyId: companyId,
151 CreatorId: 0, 151 CreatorId: 0,
@@ -24,6 +24,7 @@ type StaffAssessContent struct { @@ -24,6 +24,7 @@ type StaffAssessContent struct {
24 type AssessContemtRemark struct { 24 type AssessContemtRemark struct {
25 Title string `json:"title"` //comment:"填写标题" 25 Title string `json:"title"` //comment:"填写标题"
26 HintText string `json:"hintText"` // comment:"文本内容提示" 26 HintText string `json:"hintText"` // comment:"文本内容提示"
  27 + Definition string `json:"definition"` //comment:"定义"
27 RemarkText string `json:"remarkText"` // comment:"填写文本内容" 28 RemarkText string `json:"remarkText"` // comment:"填写文本内容"
28 } 29 }
29 30
  1 +package domain
  2 +
  3 +import "time"
  4 +
  5 +//填写的评估内容,临时保存的数据
  6 +type StaffAssessContentTemp struct {
  7 + Id int `json:"id"` //id
  8 + StaffAssessId int `json:"staffAssessId"` //用户需要的评估项id
  9 + SortBy int `json:"sortBy"` //排序
  10 + Category string `json:"category"` //类别
  11 + Name string `json:"name"` //名称
  12 + Remark []AssessContemtRemark `json:"remark"` //填写的反馈
  13 + Value string `json:"value"` //评估填写的值
  14 + CreatedAt time.Time `json:"createdAt"` //数据创建时间
  15 + UpdatedAt time.Time `json:"updatedAt"` //数据更新时间
  16 + DeletedAt *time.Time `json:"deletedAt"`
  17 +}
  18 +
  19 +type StaffAssessContentTempRepository interface {
  20 + Save(param *StaffAssessContentTemp) (*StaffAssessContentTemp, error)
  21 + Remove(id int) error
  22 + FindOne(queryOptions map[string]interface{}) (*StaffAssessContentTemp, error)
  23 + Find(queryOptions map[string]interface{}) (int, []*StaffAssessContentTemp, error)
  24 +}
@@ -41,4 +41,5 @@ type StaffAssessTaskRepository interface { @@ -41,4 +41,5 @@ type StaffAssessTaskRepository interface {
41 Remove(id int) error 41 Remove(id int) error
42 FindOne(queryOptions map[string]interface{}) (*StaffAssessTask, error) 42 FindOne(queryOptions map[string]interface{}) (*StaffAssessTask, error)
43 Find(queryOptions map[string]interface{}) (int, []*StaffAssessTask, error) 43 Find(queryOptions map[string]interface{}) (int, []*StaffAssessTask, error)
  44 + RemoveByProjectId(id int) error
44 } 45 }
@@ -69,6 +69,7 @@ func (d *StaffAssessDao) SearchAssessTaskMe(executorId int, companyId int, limit @@ -69,6 +69,7 @@ func (d *StaffAssessDao) SearchAssessTaskMe(executorId int, companyId int, limit
69 sqlStr := `SELECT DISTINCT staff_assess_task.* FROM staff_assess_task 69 sqlStr := `SELECT DISTINCT staff_assess_task.* FROM staff_assess_task
70 JOIN staff_assess ON staff_assess_task."id" = staff_assess."staff_assess_task_id" 70 JOIN staff_assess ON staff_assess_task."id" = staff_assess."staff_assess_task_id"
71 WHERE staff_assess.company_id=? 71 WHERE staff_assess.company_id=?
  72 + and staff_assess_task.deleted_at isnull
72 and staff_assess.executor->>'userId'='?' 73 and staff_assess.executor->>'userId'='?'
73 order by staff_assess_task.id desc 74 order by staff_assess_task.id desc
74 limit ? offset ? 75 limit ? offset ?
@@ -88,6 +89,7 @@ func (d *StaffAssessDao) CountAssessTaskMe(executorId int, companyId int) (int, @@ -88,6 +89,7 @@ func (d *StaffAssessDao) CountAssessTaskMe(executorId int, companyId int) (int,
88 sqlStr := `SELECT count( DISTINCT staff_assess_task."id") FROM staff_assess_task 89 sqlStr := `SELECT count( DISTINCT staff_assess_task."id") FROM staff_assess_task
89 JOIN staff_assess ON staff_assess_task."id" = staff_assess."staff_assess_task_id" 90 JOIN staff_assess ON staff_assess_task."id" = staff_assess."staff_assess_task_id"
90 WHERE staff_assess.company_id=? 91 WHERE staff_assess.company_id=?
  92 + and staff_assess_task.deleted_at isnull
91 and staff_assess.executor->>'userId'='?' 93 and staff_assess.executor->>'userId'='?'
92 ` 94 `
93 tx := d.transactionContext.PgTx 95 tx := d.transactionContext.PgTx
@@ -25,10 +25,3 @@ type StaffAssessContent struct { @@ -25,10 +25,3 @@ type StaffAssessContent struct {
25 UpdatedAt time.Time //数据更新时间 25 UpdatedAt time.Time //数据更新时间
26 DeletedAt *time.Time 26 DeletedAt *time.Time
27 } 27 }
28 -  
29 -type StaffAssessContentRepository interface {  
30 - Save(param *StaffAssessContent) (*StaffAssessContent, error)  
31 - Remove(id int) error  
32 - FindOne(queryOptions map[string]interface{}) (*StaffAssessContent, error)  
33 - Find(queryOptions map[string]interface{}) (int, []*StaffAssessContent, error)  
34 -}  
  1 +package models
  2 +
  3 +import (
  4 + "time"
  5 +
  6 + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
  7 +)
  8 +
  9 +// 填写的评估内容
  10 +type StaffAssessContentTemp struct {
  11 + tableName struct{} `pg:"staff_assess_content_temp" comment:"填写的评估项"`
  12 + Id int `pg:",pk"` //id
  13 + StaffAssessId int //用户需要的评估项id
  14 + SortBy int //排序
  15 + Category string //类别
  16 + Name string //名称
  17 + PromptTitle string //问题标题
  18 + PromptText string //提示项正文
  19 + Value string //评估填写的值
  20 + ReteResult string //评估的结果
  21 + Rule domain.EvaluationRule
  22 + Remark []domain.AssessContemtRemark
  23 + Weight int //权重
  24 + CreatedAt time.Time //数据创建时间
  25 + UpdatedAt time.Time //数据更新时间
  26 + DeletedAt *time.Time
  27 +}
  1 +package repository
  2 +
  3 +import (
  4 + "errors"
  5 + "fmt"
  6 + "time"
  7 +
  8 + "github.com/go-pg/pg/v10"
  9 + pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
  10 + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
  11 + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/infrastructure/pg/models"
  12 +)
  13 +
  14 +type StaffAssessContentTempRepository struct {
  15 + transactionContext *pgTransaction.TransactionContext
  16 +}
  17 +
  18 +// var _ domain.StaffAssessContentRepository = (*StaffAssessContentTempRepository)(nil)
  19 +
  20 +func NewStaffAssessContentTempRepository(transactionContext *pgTransaction.TransactionContext) *StaffAssessContentTempRepository {
  21 + return &StaffAssessContentTempRepository{transactionContext: transactionContext}
  22 +}
  23 +
  24 +func (repo *StaffAssessContentTempRepository) TransformToDomain(d *models.StaffAssessContent) *domain.StaffAssessContent {
  25 + return &domain.StaffAssessContent{
  26 + Id: d.Id,
  27 + StaffAssessId: d.StaffAssessId,
  28 + SortBy: d.SortBy,
  29 + Category: d.Category,
  30 + Name: d.Name,
  31 + PromptTitle: d.PromptTitle,
  32 + PromptText: d.PromptText,
  33 + Remark: d.Remark,
  34 + Value: d.Value,
  35 + ReteResult: d.ReteResult,
  36 + Rule: d.Rule,
  37 + Weight: d.Weight,
  38 + CreatedAt: d.CreatedAt,
  39 + UpdatedAt: d.UpdatedAt,
  40 + DeletedAt: nil,
  41 + }
  42 +}
  43 +
  44 +func (repo *StaffAssessContentTempRepository) Save(d *domain.StaffAssessContent) (*domain.StaffAssessContent, error) {
  45 + saveModel := models.StaffAssessContent{
  46 + Id: d.Id,
  47 + StaffAssessId: d.StaffAssessId,
  48 + SortBy: d.SortBy,
  49 + Category: d.Category,
  50 + Name: d.Name,
  51 + PromptTitle: d.PromptTitle,
  52 + PromptText: d.PromptText,
  53 + Remark: d.Remark,
  54 + Value: d.Value,
  55 + ReteResult: d.ReteResult,
  56 + Rule: d.Rule,
  57 + CreatedAt: d.CreatedAt,
  58 + UpdatedAt: d.UpdatedAt,
  59 + Weight: d.Weight,
  60 + DeletedAt: nil,
  61 + }
  62 + tx := repo.transactionContext.PgTx
  63 + var err error
  64 + if saveModel.Id == 0 {
  65 + _, err = tx.Model(&saveModel).Insert()
  66 + if err != nil {
  67 + return nil, err
  68 + }
  69 + } else {
  70 + _, err = tx.Model(&saveModel).WherePK().Update()
  71 + if err != nil {
  72 + return nil, err
  73 + }
  74 + }
  75 + d.Id = saveModel.Id
  76 + return d, nil
  77 +}
  78 +
  79 +func (repo *StaffAssessContentTempRepository) Remove(id int) error {
  80 + tx := repo.transactionContext.PgTx
  81 + nowTime := time.Now()
  82 + _, err := tx.Model(&models.StaffAssessContent{}).
  83 + Where("id=?", id).
  84 + Set("deleted_at=?", nowTime).
  85 + Update()
  86 + return err
  87 +}
  88 +
  89 +func (repo *StaffAssessContentTempRepository) FindOne(queryOptions map[string]interface{}) (*domain.StaffAssessContent, error) {
  90 + tx := repo.transactionContext.PgTx
  91 + m := new(models.StaffAssessContent)
  92 + query := tx.Model(m)
  93 + query.Where("deleted_at isnull")
  94 + if id, ok := queryOptions["id"]; ok {
  95 + query.Where("id=?", id)
  96 + }
  97 + if err := query.First(); err != nil {
  98 + if errors.Is(err, pg.ErrNoRows) {
  99 + return nil, fmt.Errorf("没有此资源")
  100 + } else {
  101 + return nil, err
  102 + }
  103 + }
  104 + u := repo.TransformToDomain(m)
  105 + return u, nil
  106 +}
  107 +
  108 +func (repo *StaffAssessContentTempRepository) Find(queryOptions map[string]interface{}) (int, []*domain.StaffAssessContent, error) {
  109 + tx := repo.transactionContext.PgTx
  110 + var m []*models.StaffAssessContent
  111 + query := tx.Model(&m).
  112 + Where("deleted_at isnull")
  113 + if companyId, ok := queryOptions["companyId"]; ok {
  114 + query.Where("company_id = ?", companyId)
  115 + }
  116 + if v, ok := queryOptions["limit"].(int); ok {
  117 + query.Limit(v)
  118 + }
  119 + if v, ok := queryOptions["offset"].(int); ok {
  120 + query.Offset(v)
  121 + }
  122 + if v, ok := queryOptions["staffAssessId"]; ok {
  123 + query.Where("staff_assess_id=?", v)
  124 + }
  125 + count, err := query.SelectAndCount()
  126 + if err != nil {
  127 + return 0, nil, err
  128 + }
  129 + var arrays []*domain.StaffAssessContent
  130 + for _, v := range m {
  131 + d := repo.TransformToDomain(v)
  132 + arrays = append(arrays, d)
  133 + }
  134 + return count, arrays, nil
  135 +}
@@ -137,3 +137,13 @@ func (repo *StaffAssessTaskRepository) Find(queryOptions map[string]interface{}) @@ -137,3 +137,13 @@ func (repo *StaffAssessTaskRepository) Find(queryOptions map[string]interface{})
137 } 137 }
138 return count, arrays, nil 138 return count, arrays, nil
139 } 139 }
  140 +
  141 +func (repo *StaffAssessTaskRepository) RemoveByProjectId(id int) error {
  142 + tx := repo.transactionContext.PgTx
  143 + nowTime := time.Now()
  144 + _, err := tx.Model(&models.StaffAssessTask{}).
  145 + Where("evaluation_project_id=?", id).
  146 + Set("deleted_at=?", nowTime).
  147 + Update()
  148 + return err
  149 +}