作者 tangxvhui

Merge branch 'dev-tangxvhui' into test

... ... @@ -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,
}
... ...
package notify
// 手机端 ,消息通知
// 定时任务检查业务,确定是否发送短信消息
// 关于反馈异常的消息通知;早上9点 开始检查,并确认发送的消息
func taskRecordAnomaly() (map[string]string, error) {
return nil, nil
}
// 关于里程碑异常的消息通知;早上9点 开始检查,并确认发送的消息
func taskStageAnomaly() (map[string]string, error) {
return nil, nil
}
... ...
... ... @@ -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")
... ...
... ... @@ -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")
}
}
... ...
... ... @@ -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"`
... ...
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,
},
}
}
... ...
... ... @@ -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")
... ...