切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
庄敏学
2 years ago
提交
777276107f69a79481b721fad02a60b8678deb44
1 个父辈
6e5d8fcb
kafka
隐藏空白字符变更
内嵌
并排对比
正在显示
9 个修改的文件
包含
26 行增加
和
14 行删除
go_build_main_go
pkg/application/department/sync_data_service.go
pkg/application/user/sync_data_service.go
pkg/infrastructure/pg/models/comapny.go
pkg/infrastructure/pg/models/department.go
pkg/infrastructure/pg/models/positions.go
pkg/infrastructure/pg/models/user.go
pkg/infrastructure/repository/pg_user_repository.go
pkg/port/consumer/handle/business_admin.go
go_build_main_go
查看文件 @
7772761
不能预览此文件类型
pkg/application/department/sync_data_service.go
查看文件 @
7772761
...
...
@@ -131,10 +131,13 @@ func (srv SyncDataDepartmentService) editDepartment(param *command.EditDepartmen
if
departmentList
[
i
]
.
Id
==
param
.
Id
{
departmentList
[
i
]
.
CompanyId
=
param
.
CompanyId
departmentList
[
i
]
.
Name
=
param
.
Name
departmentList
[
i
]
.
Name
=
param
.
Path
departmentList
[
i
]
.
ChargeUserIds
=
param
.
ChargeUserIds
departmentList
[
i
]
.
Path
=
param
.
Path
departmentList
[
i
]
.
ChargeUserIds
=
make
([]
int64
,
0
)
departmentList
[
i
]
.
Level
=
param
.
Level
departmentList
[
i
]
.
ParentId
=
param
.
ParentId
if
len
(
param
.
ChargeUserIds
)
>
0
{
departmentList
[
i
]
.
ChargeUserIds
=
param
.
ChargeUserIds
}
continue
}
...
...
pkg/application/user/sync_data_service.go
查看文件 @
7772761
...
...
@@ -156,6 +156,9 @@ func (srv SyncDataUserService) UpdateUser(param *command.SaveUserCommand) error
newUser
.
AdminType
=
param
.
AdminType
newUser
.
Name
=
param
.
Name
newUser
.
Status
=
param
.
Status
newUser
.
PositionId
=
make
([]
int
,
0
)
newUser
.
DepartmentId
=
make
([]
int
,
0
)
newUser
.
UpdateAt
=
nowTime
if
len
(
userList
)
>
0
{
_
,
err
=
userRepo
.
Update
(
newUser
)
...
...
pkg/infrastructure/pg/models/comapny.go
查看文件 @
7772761
...
...
@@ -11,5 +11,5 @@ type Company struct {
Status
int
//公司状态,1正常 2禁用
UpdateAt
time
.
Time
//更新时间
CreateAt
time
.
Time
//创建时间
DeleteAt
*
time
.
Time
`
bun
:",soft_delete"`
//删除时间
DeleteAt
*
time
.
Time
`
pg
:",soft_delete"`
//删除时间
}
...
...
pkg/infrastructure/pg/models/department.go
查看文件 @
7772761
...
...
@@ -8,12 +8,12 @@ type Department struct {
tableName
struct
{}
`pg:"department"`
Id
int64
`pg:"pk:id"`
// 组织id
CompanyId
int64
// 公司编号
Level
int
// 组织级别
Level
int
`pg:",use_zero"`
// 组织级别
Name
string
// 组织名称
ParentId
int64
// 组织父级id
ParentId
int64
`pg:",use_zero"`
// 组织父级id
ChargeUserIds
[]
int64
// 主管uids
Path
string
// 组织路径
CreateAt
time
.
Time
// 创建时间
UpdateAt
time
.
Time
// 更新时间
DeleteAt
*
time
.
Time
`
bun
:",soft_delete"`
// 删除时间
DeleteAt
*
time
.
Time
`
pg
:",soft_delete"`
// 删除时间
}
...
...
pkg/infrastructure/pg/models/positions.go
查看文件 @
7772761
...
...
@@ -6,11 +6,11 @@ type Positions struct {
Id
int64
//ID
CompanyId
int64
//公司ID
Name
string
//职位名称
ParentId
int64
//父级职位
ParentId
int64
`pg:",use_zero"`
//父级职位
Path
string
//职位路径
Level
int
//层级
Level
int
`pg:",use_zero"`
//层级
Remarks
string
//备注
CreatedAt
time
.
Time
UpdatedAt
time
.
Time
DeletedAt
*
time
.
Time
`
bun
:",soft_delete"`
DeletedAt
*
time
.
Time
`
pg
:",soft_delete"`
}
...
...
pkg/infrastructure/pg/models/user.go
查看文件 @
7772761
...
...
@@ -16,5 +16,5 @@ type User struct {
PositionId
[]
int
// 用户职位
UpdateAt
time
.
Time
// 更新时间
CreateAt
time
.
Time
// 创建时间
DeleteAt
*
time
.
Time
`
bun
:",soft_delete"`
// 删除时间
DeleteAt
*
time
.
Time
`
pg
:",soft_delete"`
// 删除时间
}
...
...
pkg/infrastructure/repository/pg_user_repository.go
查看文件 @
7772761
...
...
@@ -97,7 +97,7 @@ func (repo *UserRepository) FindOne(queryOptions map[string]interface{}) (*domai
func
(
repo
*
UserRepository
)
Find
(
queryOptions
map
[
string
]
interface
{})
(
int
,
[]
*
domain
.
User
,
error
)
{
tx
:=
repo
.
transactionContext
.
PgTx
userModel
:=
[]
models
.
User
{}
query
:=
tx
.
Model
(
&
userModel
)
.
Where
(
"delete_at isnull"
)
.
query
:=
tx
.
Model
(
&
userModel
)
.
Where
(
"delete_at is
null"
)
.
Limit
(
20
)
if
v
,
ok
:=
queryOptions
[
"id"
];
ok
{
query
.
Where
(
"id=?"
,
v
)
...
...
pkg/port/consumer/handle/business_admin.go
查看文件 @
7772761
...
...
@@ -59,7 +59,9 @@ func SyncDataBusinessAdmin(msgData *sarama.ConsumerMessage) error {
err
=
companySrv
.
FromBusinessAdmin
(
&
msgBody
)
if
err
!=
nil
{
log
.
Logger
.
Error
(
"处理company消息失败"
+
err
.
Error
(),
map
[
string
]
interface
{}{
"data"
:
msgBody
,
"module"
:
msgBody
.
Module
,
"action"
:
msgBody
.
Action
,
"data"
:
string
(
msgBody
.
Data
),
})
return
err
}
...
...
@@ -68,7 +70,9 @@ func SyncDataBusinessAdmin(msgData *sarama.ConsumerMessage) error {
err
=
departmentSrv
.
FromBusinessAdmin
(
&
msgBody
)
if
err
!=
nil
{
log
.
Logger
.
Error
(
"处理department消息失败"
+
err
.
Error
(),
map
[
string
]
interface
{}{
"data"
:
msgBody
,
"module"
:
msgBody
.
Module
,
"action"
:
msgBody
.
Action
,
"data"
:
string
(
msgBody
.
Data
),
})
return
err
}
...
...
@@ -77,7 +81,9 @@ func SyncDataBusinessAdmin(msgData *sarama.ConsumerMessage) error {
err
=
employeeSrv
.
FromBusinessAdmin
(
&
msgBody
)
if
err
!=
nil
{
log
.
Logger
.
Error
(
"处理employee消息失败"
+
err
.
Error
(),
map
[
string
]
interface
{}{
"data"
:
msgBody
,
"module"
:
msgBody
.
Module
,
"action"
:
msgBody
.
Action
,
"data"
:
string
(
msgBody
.
Data
),
})
return
err
}
...
...
请
注册
或
登录
后发表评论