切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
a07c9e78c7e0c59664a1d993e802345b4b96791f
2 个父辈
e5ffce5a
7ef8e5b6
Merge branch 'dev-tangxvhui' into test
隐藏空白字符变更
内嵌
并排对比
正在显示
7 个修改的文件
包含
95 行增加
和
15 行删除
pkg/application/auth/service/auth.go
pkg/application/notify/app_message.go
pkg/constant/business_admin.go
pkg/constant/common.go
pkg/infrastructure/dao/task_dao.go
pkg/infrastructure/serviceGateway/httplib_mmm_open_api_service_gateway.go
pkg/port/beego/routers/auth.go
pkg/application/auth/service/auth.go
查看文件 @
a07c9e7
...
...
@@ -104,7 +104,7 @@ func (service *AuthService) MobileLogin(param *command.MobileLoginCommand) (map[
}
// 用户权限校验
// 登录平台ID,28-绩效管理后台 29-员工绩效
userAuthReply
,
err
:=
factory
.
BusinessAdminApi
()
.
GetUserAuth
(
int64
(
param
.
Muid
),
constant
.
IdPlatformUser
)
userAuthReply
,
err
:=
factory
.
BusinessAdminApi
()
.
GetUserAuth
(
int64
(
param
.
Muid
),
constant
.
PLATFORM_FONT_ID
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
"用户鉴权失败"
)
}
...
...
@@ -139,7 +139,7 @@ func (service *AuthService) MobileLogin(param *command.MobileLoginCommand) (map[
CompanyId
:
user
.
CompanyId
,
CompanyName
:
company
.
Name
,
Phone
:
user
.
Account
,
PlatformId
:
constant
.
IdPlatformUser
,
PlatformId
:
constant
.
PLATFORM_FONT_ID
,
Name
:
user
.
Name
,
AdminType
:
user
.
AdminType
,
}
...
...
pkg/application/notify/app_message.go
0 → 100644
查看文件 @
a07c9e7
package
notify
// 手机端 ,消息通知
// 定时任务检查业务,确定是否发送短信消息
// 关于反馈异常的消息通知;早上9点 开始检查,并确认发送的消息
func
taskRecordAnomaly
()
(
map
[
string
]
string
,
error
)
{
return
nil
,
nil
}
// 关于里程碑异常的消息通知;早上9点 开始检查,并确认发送的消息
func
taskStageAnomaly
()
(
map
[
string
]
string
,
error
)
{
return
nil
,
nil
}
...
...
pkg/constant/business_admin.go
查看文件 @
a07c9e7
...
...
@@ -13,12 +13,6 @@ var UCENTER_CHECK_ALT = "rsF0pL!6DwjBO735"
// 企业平台地址
var
BUSINESS_ADMIN_SERVICE_HOST
=
"http://suplus-business-admin-test.fjmaimaimai.com"
// 绩效管理平台ID
var
PLATFORM_ADMIN_ID
=
28
// 员工绩效平台ID
var
PLATFORM_FONT_ID
=
29
func
init
()
{
if
os
.
Getenv
(
"UCENTER_SERVICE_HOST"
)
!=
""
{
UCENTER_SERVICE_HOST
=
os
.
Getenv
(
"UCENTER_SERVICE_HOST"
)
...
...
pkg/constant/common.go
查看文件 @
a07c9e7
...
...
@@ -4,12 +4,6 @@ import "os"
const
SERVICE_NAME
=
"performance"
// 登录平台ID,28-绩效管理后台 29-员工绩效
const
(
IdPlatformAdmin
int
=
28
IdPlatformUser
int
=
29
)
var
LOG_LEVEL
=
"debug"
// 过期时间 7天时间
...
...
@@ -23,6 +17,14 @@ var UPLOAD_ZIP_PATH = "./uploads/zip"
// Env 判断当前环境变量
var
Env
=
"dev"
var
MMM_OPEN_API_SERVICE_HOST
=
"http://mmm-open-api-dev.fjmaimaimai.com"
// 绩效管理平台ID
var
PLATFORM_ADMIN_ID
=
28
// 员工绩效平台ID
var
PLATFORM_FONT_ID
=
29
func
init
()
{
if
os
.
Getenv
(
"LOG_LEVEL"
)
!=
""
{
LOG_LEVEL
=
os
.
Getenv
(
"LOG_LEVEL"
)
...
...
@@ -31,4 +33,8 @@ func init() {
if
os
.
Getenv
(
"ENV_MOD"
)
!=
""
{
Env
=
os
.
Getenv
(
"ENV_MOD"
)
}
//开放平台
if
os
.
Getenv
(
"MMM_OPEN_API_SERVICE_HOST"
)
!=
""
{
MMM_OPEN_API_SERVICE_HOST
=
os
.
Getenv
(
"MMM_OPEN_API_SERVICE_HOST"
)
}
}
...
...
pkg/infrastructure/dao/task_dao.go
查看文件 @
a07c9e7
...
...
@@ -427,6 +427,23 @@ func (d *TaskDao) TaskStageAnomalyByRelatedUser(relatedUserId int) ([]TaskStageD
return
result
,
err
}
// TaskStageAnomalyAll 获取所有异常的里程碑任务
func
(
d
TaskDao
)
TaskStageAnomalyAll
()
([]
TaskStageData
,
error
)
{
sqlStr
:=
`select
task_stage.id,
task_stage."name" ,
task.leader ->>'name' as leader_name
from task_stage
join task on task.id=task_stage.task_id
where 1=1
and task_stage.real_completed_at=0 and task_stage.plan_completed_at<extract(epoch from now()) `
result
:=
[]
TaskStageData
{}
tx
:=
d
.
transactionContext
.
PgTx
_
,
err
:=
tx
.
Query
(
&
result
,
sqlStr
)
return
result
,
err
}
type
TaskData2
struct
{
Id
int
`pg:"id"`
Name
string
`pg:"name"`
...
...
pkg/infrastructure/serviceGateway/httplib_mmm_open_api_service_gateway.go
0 → 100644
查看文件 @
a07c9e7
package
serviceGateway
import
(
"strings"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/constant"
)
type
HttplibMmmOpenApiServiceGateway
struct
{
httpLibBaseServiceGateway
}
// MessageOptions 个推参数
type
MessageOptions
struct
{
MmmType
int
`json:"mmmType"`
// 通知类型 0:系统透传消息 1:系统通知消息 默认:系统透传
Project
string
`json:"project"`
// 单一终端类型 项目编码 "mmm.tianlian.performance"
Projects
[]
string
`json:"projects"`
// 多终端类型
Receivers
[]
int64
`json:"receivers"`
// 消息接收者uid
Title
string
`json:"title"`
// 个推标题
Content
string
`json:"content"`
// 个推内容
}
// PushInfo 个推
func
(
serviceGateway
*
HttplibMmmOpenApiServiceGateway
)
PushInfo
(
msgType
int
,
projects
[]
string
,
uids
[]
int64
,
title
string
,
content
string
)
(
map
[
string
]
interface
{},
error
)
{
url
:=
strings
.
Join
([]
string
{
serviceGateway
.
baseURL
,
"v1"
,
"push"
,
"pushInfo"
},
"/"
)
serviceGateway
.
CreateRequest
(
"post"
,
url
)
options
:=
&
MessageOptions
{
MmmType
:
msgType
,
Projects
:
projects
,
Receivers
:
uids
,
Title
:
title
,
Content
:
content
,
}
serviceGateway
.
SetBody
(
options
)
response
:=
make
(
map
[
string
]
interface
{})
err
:=
serviceGateway
.
ToJson
(
&
response
)
return
response
,
err
}
func
NewHttplibMmmOpenApiServiceGateway
()
*
HttplibMmmOpenApiServiceGateway
{
return
&
HttplibMmmOpenApiServiceGateway
{
httpLibBaseServiceGateway
{
baseURL
:
constant
.
MMM_OPEN_API_SERVICE_HOST
,
},
}
}
...
...
pkg/port/beego/routers/auth.go
查看文件 @
a07c9e7
...
...
@@ -8,8 +8,10 @@ import (
func
init
()
{
web
.
Router
(
"/login"
,
&
controllers
.
AuthController
{},
"Post:Login"
)
//手机模块登录-旧
web
.
Router
(
"/login/mobile"
,
&
controllers
.
AuthController
{},
"Post:MobileLogin"
)
////手机模块登录-新
web
.
Router
(
"/v1/auth/authorize"
,
&
controllers
.
AuthController
{},
"Post:MobileLogin"
)
//
web
.
InsertFilter
(
"/auth/admin/*"
,
web
.
BeforeExec
,
middlewares
.
CheckAdminToken
())
web
.
Router
(
"/auth/admin/user"
,
&
controllers
.
AuthController
{},
"Get:User"
)
...
...
请
注册
或
登录
后发表评论