作者 郑周

Merge remote-tracking branch 'origin/test' into test

... ... @@ -57,7 +57,6 @@ type AssessCountLeveltItem struct {
// 评级数量
type LevalCodeCount struct {
Code string `json:"code"` //评级代码
Number int `json:"number"` //数量
ItemList []string `json:"itemList"` //对应的评估项名称
Code string `json:"code"` //评级代码
Number int `json:"number"` //数量
}
... ...
... ... @@ -3,6 +3,6 @@ package query
type ListTargetUserCycleQuery struct {
PageNumber int `json:"pageNumber"`
PageSize int `json:"pageSize"`
CompanyId int `json:"companyId"` //
CompanyId int `json:"-"` //
TargetUserId int `json:"targetUserId,string"` //评估的执行人,必填
}
... ...
... ... @@ -17,7 +17,7 @@ type ExportUserAssess2Commad struct {
type StaffAsessSelfCountLevel struct {
CompanyId int `cname:"公司ID" json:"-"`
TargetUserId int `json:"targetUserId"`
TargetUserId int `json:"targetUserId,string"`
ProjectId int `json:"projectId,string"`
CycleId int `cname:"周期ID" json:"cycleId,string"`
}
... ...
package service
// // excel表头部字段
// type excelTableHeader struct {
// Level1 string
// Level2 string
// Level3 string
// Level4 string
// }
... ... @@ -5,6 +5,7 @@ import (
"strconv"
"time"
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/infrastructure/dao"
... ... @@ -18,25 +19,24 @@ func TaskSendSummaryEvaluationV2() error {
str := fmt.Sprintf("下发周期评估耗时%.2f s", time.Since(nowTime).Seconds())
log.Logger.Info(str)
}()
var newPublisher summaryEvaluationPublisher
for {
projectList, err := getPrepareSummaryEvaluation()
cycleList, err := getPrepareEvaluationCycle()
if err != nil {
return err
}
if len(projectList) == 0 {
if len(cycleList) == 0 {
break
}
newPublisher = summaryEvaluationPublisher{}
for _, val := range projectList {
err = newPublisher.sendSummaryEvaluationV2(val)
err = sendSummaryEvaluationByCycle(cycleList[0])
if err != nil {
return err
}
}
return nil
}
func getPrepareSummaryEvaluation() ([]*domain.EvaluationProject, error) {
// 获取周期
func getPrepareEvaluationCycle() ([]*domain.EvaluationCycle, error) {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return nil, err
... ... @@ -47,56 +47,131 @@ func getPrepareSummaryEvaluation() ([]*domain.EvaluationProject, error) {
defer func() {
_ = transactionContext.RollbackTransaction()
}()
cycleRepo := factory.CreateEvaluationCycleRepository(map[string]interface{}{"transactionContext": transactionContext})
cycleList, err := cycleRepo.FindCycleEnd(1)
if err != nil {
return nil, fmt.Errorf("获取可用的周期数据,%s", err)
}
if err := transactionContext.CommitTransaction(); err != nil {
return nil, err
}
return cycleList, nil
}
// 获取可用的项目
// func getPrepareSummaryEvaluation(cycleId int) ([]*domain.EvaluationProject, error) {
// transactionContext, err := factory.CreateTransactionContext(nil)
// if err != nil {
// return nil, err
// }
// if err := transactionContext.StartTransaction(); err != nil {
// return nil, err
// }
// defer func() {
// _ = transactionContext.RollbackTransaction()
// }()
// projectRepo := factory.CreateEvaluationProjectRepository(map[string]interface{}{
// "transactionContext": transactionContext,
// })
// // 获取项目数据总数
// _, projectList, err := projectRepo.Find(map[string]interface{}{
// "cycleId": cycleId,
// "summaryState": domain.ProjectSummaryStateNo,
// "state": domain.ProjectStateEnable,
// "limit": 200,
// }, "template")
// if err != nil {
// return nil, fmt.Errorf("获取可用的项目数据,%s", err)
// }
// if err := transactionContext.CommitTransaction(); err != nil {
// return nil, err
// }
// return projectList, nil
// }
// 按周期下发 综合评估任务
func sendSummaryEvaluationByCycle(cycleParam *domain.EvaluationCycle) error {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return err
}
if err := transactionContext.StartTransaction(); err != nil {
return err
}
defer func() {
_ = transactionContext.RollbackTransaction()
}()
projectRepo := factory.CreateEvaluationProjectRepository(map[string]interface{}{
"transactionContext": transactionContext,
})
// 获取项目数据总数
_, projectList, err := projectRepo.Find(map[string]interface{}{
"endTime": time.Now(),
"cycleId": cycleParam.Id,
"summaryState": domain.ProjectSummaryStateNo,
"state": domain.ProjectStateEnable,
"limit": 200,
"limit": 500,
}, "template")
if err != nil {
return nil, fmt.Errorf("获取可用的项目数据,%s", err)
return fmt.Errorf("获取可用的项目数据,%s", err)
}
var newEvaluationList []domain.SummaryEvaluation
newPublisher := summaryEvaluationPublisher{}
for _, val := range projectList {
evaluationList, err := newPublisher.sendSummaryEvaluationV2(transactionContext, val, cycleParam)
if err != nil {
return fmt.Errorf("按项目下发综合评估任务数据,%s", err)
}
newEvaluationList = append(newEvaluationList, evaluationList...)
}
// 回填周期的状态
cycleDao := dao.NewEvaluationCycleDao(map[string]interface{}{"transactionContext": transactionContext})
err = cycleDao.UpdateSummaryState(cycleParam.Id, domain.ProjectSummaryStateYes)
if err != nil {
return fmt.Errorf("保存项目周期状态%s", err)
}
if err := transactionContext.CommitTransaction(); err != nil {
return nil, err
return err
}
err = sendSmsEvalation(newEvaluationList)
if err != nil {
return fmt.Errorf("设置短信消息%s", err)
}
return projectList, nil
return nil
}
// 下发周期综合评估
type summaryEvaluationPublisher struct {
userCache map[int64]*domain.User
departCache map[int]*domain.Department
cycleCache map[int64]*domain.EvaluationCycle
}
func (se *summaryEvaluationPublisher) sendSummaryEvaluationV2(projectParam *domain.EvaluationProject) error {
transactionContext, err := factory.CreateTransactionContext(nil)
if err != nil {
return err
}
if err := transactionContext.StartTransaction(); err != nil {
return err
}
defer func() {
_ = transactionContext.RollbackTransaction()
}()
func (se *summaryEvaluationPublisher) sendSummaryEvaluationV2(
transactionContext application.TransactionContext,
projectParam *domain.EvaluationProject, cycleData *domain.EvaluationCycle,
) ([]domain.SummaryEvaluation, error) {
// transactionContext, err := factory.CreateTransactionContext(nil)
// if err != nil {
// return err
// }
// if err := transactionContext.StartTransaction(); err != nil {
// return err
// }
// defer func() {
// _ = transactionContext.RollbackTransaction()
// }()
userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext})
departmentRepo := factory.CreateDepartmentRepository(map[string]interface{}{"transactionContext": transactionContext})
cycleRepo := factory.CreateEvaluationCycleRepository(map[string]interface{}{"transactionContext": transactionContext})
evaluationItemRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
_, evaluationItemList, err := evaluationItemRepo.Find(map[string]interface{}{
"evaluationProjectId": projectParam.Id,
"nodeType": int(domain.LinkNodeSelfAssessment),
})
if err != nil {
return err
return nil, err
}
if len(evaluationItemList) == 0 {
return nil
return nil, nil
}
nodeId := evaluationItemList[0].NodeId
executor360Map := map[int64]*domain.User{}
... ... @@ -111,20 +186,12 @@ func (se *summaryEvaluationPublisher) sendSummaryEvaluationV2(projectParam *doma
}
user360, err := se.getUserData(userRepo, int64(v.EvaluatorId))
if err != nil {
return fmt.Errorf("获取360用户%s", err)
return nil, fmt.Errorf("获取360用户%s", err)
}
executor360Map[user360.Id] = user360
}
//获取周期
cycleData, err := se.getCycleData(cycleRepo, projectParam.CycleId)
if err != nil {
return err
}
if cycleData == nil {
return nil
}
if cycleData.TimeEnd == nil {
return fmt.Errorf("周期%d:%s 结束时间错误", cycleData.Id, cycleData.Name)
return nil, fmt.Errorf("周期%d:%s 结束时间错误", cycleData.Id, cycleData.Name)
}
//自评的时间范围
beginTimeSelf := *cycleData.TimeEnd
... ... @@ -166,14 +233,14 @@ func (se *summaryEvaluationPublisher) sendSummaryEvaluationV2(projectParam *doma
}
targetUser, err := se.getUserData(userRepo, targetUserId)
if err != nil {
return fmt.Errorf("获取员工数据%s", err)
return nil, fmt.Errorf("获取员工数据%s", err)
}
if targetUser == nil {
continue
}
targetUserDepartment, err := se.getDepartmentData(departmentRepo, targetUser.DepartmentId)
if err != nil {
return fmt.Errorf("获取员工的部门数据%s", err)
return nil, fmt.Errorf("获取员工的部门数据%s", err)
}
evaluationTemp.TargetDepartment = []domain.StaffDepartment{}
evaluationTemp.Types = domain.EvaluationSelf
... ... @@ -254,39 +321,38 @@ func (se *summaryEvaluationPublisher) sendSummaryEvaluationV2(projectParam *doma
for i := range newEvaluationList {
err = summaryEvaluationRepo.Save(&newEvaluationList[i])
if err != nil {
return fmt.Errorf("保存周期综合评估%s", err)
return nil, fmt.Errorf("保存周期综合评估%s", err)
}
}
//回填项目的状态
projectDao := dao.NewEvaluationProjectDao(map[string]interface{}{"transactionContext": transactionContext})
err = projectDao.UpdateSummaryState(projectParam.Id, domain.ProjectSummaryStateYes)
if err != nil {
return fmt.Errorf("保存项目状态%s", err)
}
if err := transactionContext.CommitTransaction(); err != nil {
return err
return nil, fmt.Errorf("保存项目状态%s", err)
}
err = sendSmsEvalation(newEvaluationList)
return fmt.Errorf("设置短信发送%s", err)
// if err := transactionContext.CommitTransaction(); err != nil {
// return err
// }
return newEvaluationList, fmt.Errorf("设置短信发送%s", err)
}
// 获取周期设置数据
func (se *summaryEvaluationPublisher) getCycleData(cycleRepo domain.EvaluationCycleRepository, cycleId int64) (*domain.EvaluationCycle, error) {
var cycleData *domain.EvaluationCycle
if val, ok := se.cycleCache[cycleId]; ok {
cycleData = val
} else {
_, cycleList, err := cycleRepo.Find(map[string]interface{}{"id": cycleId})
if err != nil {
return nil, err
}
if len(cycleList) == 0 {
return nil, nil
}
cycleData = cycleList[0]
}
return cycleData, nil
}
// func (se *summaryEvaluationPublisher) getCycleData(cycleRepo domain.EvaluationCycleRepository, cycleId int64) (*domain.EvaluationCycle, error) {
// var cycleData *domain.EvaluationCycle
// if val, ok := se.cycleCache[cycleId]; ok {
// cycleData = val
// } else {
// _, cycleList, err := cycleRepo.Find(map[string]interface{}{"id": cycleId})
// if err != nil {
// return nil, err
// }
// if len(cycleList) == 0 {
// return nil, nil
// }
// cycleData = cycleList[0]
// }
// return cycleData, nil
// }
// 获取用户数据
func (se *summaryEvaluationPublisher) getUserData(userRepo domain.UserRepository, userId int64) (*domain.User, error) {
... ...
... ... @@ -21,16 +21,17 @@ type TemplateSimple struct {
}
type EvaluationCycle struct {
Id int64 `json:"id,string" comment:"ID"`
Name string `json:"name" comment:"名称"`
TimeStart *time.Time `json:"timeStart" comment:"起始时间"`
TimeEnd *time.Time `json:"timeEnd" comment:"截至时间"`
CompanyId int64 `json:"companyId,string" comment:"公司ID"`
CreatorId int64 `json:"creatorId,string" comment:"创建人ID"`
KpiCycle int `json:"kpiCycle" comment:"考核周期(1日、2周、3月)"`
CreatedAt time.Time `json:"createdAt" comment:"创建时间"`
UpdatedAt time.Time `json:"updatedAt" comment:"更新时间"`
DeletedAt *time.Time `json:"deletedAt" comment:"删除时间"`
Id int64 `json:"id,string" comment:"ID"`
Name string `json:"name" comment:"名称"`
TimeStart *time.Time `json:"timeStart" comment:"起始时间"`
TimeEnd *time.Time `json:"timeEnd" comment:"截至时间"`
CompanyId int64 `json:"companyId,string" comment:"公司ID"`
CreatorId int64 `json:"creatorId,string" comment:"创建人ID"`
KpiCycle int `json:"kpiCycle" comment:"考核周期(1日、2周、3月)"`
SummaryState ProjectSummaryState `json:"summaryState" comment:"周期评估是否下发"`
CreatedAt time.Time `json:"createdAt" comment:"创建时间"`
UpdatedAt time.Time `json:"updatedAt" comment:"更新时间"`
DeletedAt *time.Time `json:"deletedAt" comment:"删除时间"`
}
type EvaluationCycleRepository interface {
... ... @@ -39,4 +40,5 @@ type EvaluationCycleRepository interface {
FindOne(queryOptions map[string]interface{}) (*EvaluationCycle, error)
Find(queryOptions map[string]interface{}) (int64, []*EvaluationCycle, error)
Count(queryOptions map[string]interface{}) (int64, error)
FindCycleEnd(limit int) ([]*EvaluationCycle, error) // 获取已结束的周期,且还没下发周期评估
}
... ...
... ... @@ -34,6 +34,7 @@ type EvaluationProject struct {
DeletedAt *time.Time `json:"deletedAt" comment:"删除时间"`
}
// 周期评估的下发状态
type ProjectSummaryState int
const (
... ...
package dao
import (
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/infrastructure/pg/models"
)
type EvaluationCycleDao struct {
transactionContext *pgTransaction.TransactionContext
}
func NewEvaluationCycleDao(options map[string]interface{}) *EvaluationCycleDao {
var transactionContext *pgTransaction.TransactionContext
if value, ok := options["transactionContext"]; ok {
transactionContext = value.(*pgTransaction.TransactionContext)
}
return &EvaluationCycleDao{
transactionContext: transactionContext,
}
}
func (d *EvaluationCycleDao) UpdateSummaryState(id int64, status domain.ProjectSummaryState) error {
db := d.transactionContext.PgTx
_, err := db.Model(&models.EvaluationCycle{}).
Where("id=?", id).
Set("summary_state=?", int(status)).
Update()
return err
}
... ...
... ... @@ -1253,7 +1253,7 @@ group by level_value,category,"name" `
var result []AssessContentLevelCode
condition := []interface{}{
projectId, targetUserId, string(assessType), cycleId,
targetUserId, string(assessType), cycleId, projectId,
}
tx := d.transactionContext.PgTx
_, err := tx.Query(&result, sqlStr, condition...)
... ...
... ... @@ -174,33 +174,32 @@ func (d *StaffAssessDao) catchProjectIdByPermission(companyId int, cycleId int,
}
type TargetUserCycleProject struct {
CycleId string `pg:"cycle_id" json:"cycleId"` //周期id
CycleName string `pg:"cycle_name" json:"cycleName"` //周期名称
EvaluationProjectIds []string `pg:"evaluation_project_ids" json:"evaluationProjectIds"`
CycleId string `pg:"cycle_id" json:"cycleId"` //周期id
CycleName string `pg:"cycle_name" json:"cycleName"` //周期名称
EvaluationProjectId string `pg:"evaluation_project_id" json:"evaluationProjectId"`
EvaluationProjectName string `pg:"evaluation_project_name" json:"evaluationProjectName"`
TargetUserId string `pg:"target_user_id" json:"targetUserId"`
}
// 获取目标员工的自评周期和项目
func (d *StaffAssessDao) SearchTargetUserCycleProject(companyId int, targetUserId int, limit int, offset int) ([]TargetUserCycleProject, error) {
sqlStr := ` with t_staff_assess as (
select distinct staff_assess.cycle_id ,
staff_assess.cycle_name,
staff_assess.evaluation_project_id
from staff_assess
where 1=1
and staff_assess."types" ='self'
and staff_assess.deleted_at isnull
and staff_assess.target_user ->>'userId'='?'
and staff_assess.company_id=?
)
select
t_staff_assess.cycle_id,
t_staff_assess.cycle_name,
array_agg(to_char(t_staff_assess.evaluation_project_id,'9999999999999999999')) as evaluation_project_ids
from t_staff_assess
group by cycle_id,cycle_name
limit ? offset ?
sqlStr := `select distinct
staff_assess.cycle_name,
staff_assess.cycle_id ,
staff_assess.evaluation_project_id,
staff_assess.target_user ->>'userId' as target_user_id,
staff_assess.evaluation_project_name
from staff_assess ,staff_assess_task
where 1=1
and staff_assess_task.id =staff_assess.staff_assess_task_id
and staff_assess."types" ='self'
and staff_assess_task.deleted_at isnull
and staff_assess.deleted_at isnull
and staff_assess.target_user ->>'userId'='?'
and staff_assess.company_id=?
`
condition := []interface{}{companyId, targetUserId, limit, offset}
sqlStr += ` order by cycle_id desc limit ? offset ? `
condition := []interface{}{targetUserId, companyId, limit, offset}
result := []TargetUserCycleProject{}
tx := d.transactionContext.PgTx
_, err := tx.Query(&result, sqlStr, condition...)
... ...
... ... @@ -5,15 +5,16 @@ import (
)
type EvaluationCycle struct {
tableName struct{} `comment:"评估周期" pg:"evaluation_cycle"`
Id int64 `comment:"周期ID" pg:"pk:id"`
Name string `comment:"名称"`
TimeStart *time.Time `comment:"起始时间"`
TimeEnd *time.Time `comment:"截至时间"`
CompanyId int64 `comment:"公司ID"`
CreatorId int64 `comment:"创建人ID"`
KpiCycle int `comment:"考核周期(1日、2周、3月)"`
CreatedAt time.Time `comment:"创建时间"`
UpdatedAt time.Time `comment:"更新时间"`
DeletedAt *time.Time `comment:"删除时间"`
tableName struct{} `comment:"评估周期" pg:"evaluation_cycle"`
Id int64 `comment:"周期ID" pg:"pk:id"`
Name string `comment:"名称"`
TimeStart *time.Time `comment:"起始时间"`
TimeEnd *time.Time `comment:"截至时间"`
CompanyId int64 `comment:"公司ID"`
CreatorId int64 `comment:"创建人ID"`
KpiCycle int `comment:"考核周期(1日、2周、3月)"`
SummaryState int `comment:"周期评估是否下发" pg:",use_zero"`
CreatedAt time.Time `comment:"创建时间"`
UpdatedAt time.Time `comment:"更新时间"`
DeletedAt *time.Time `comment:"删除时间"`
}
... ...
... ... @@ -23,31 +23,33 @@ func NewEvaluationCycleRepository(transactionContext *pgTransaction.TransactionC
func (repo *EvaluationCycleRepository) TransformToDomain(m *models.EvaluationCycle) domain.EvaluationCycle {
return domain.EvaluationCycle{
Id: m.Id,
Name: m.Name,
TimeStart: m.TimeStart,
TimeEnd: m.TimeEnd,
CompanyId: m.CompanyId,
CreatorId: m.CreatorId,
KpiCycle: m.KpiCycle,
CreatedAt: m.CreatedAt.Local(),
UpdatedAt: m.UpdatedAt.Local(),
DeletedAt: m.DeletedAt,
Id: m.Id,
Name: m.Name,
TimeStart: m.TimeStart,
TimeEnd: m.TimeEnd,
CompanyId: m.CompanyId,
CreatorId: m.CreatorId,
KpiCycle: m.KpiCycle,
SummaryState: domain.ProjectSummaryState(m.SummaryState),
CreatedAt: m.CreatedAt.Local(),
UpdatedAt: m.UpdatedAt.Local(),
DeletedAt: m.DeletedAt,
}
}
func (repo *EvaluationCycleRepository) TransformToModel(d *domain.EvaluationCycle) models.EvaluationCycle {
return models.EvaluationCycle{
Id: d.Id,
Name: d.Name,
TimeStart: d.TimeStart,
TimeEnd: d.TimeEnd,
CompanyId: d.CompanyId,
CreatorId: d.CreatorId,
KpiCycle: d.KpiCycle,
CreatedAt: d.CreatedAt,
UpdatedAt: d.UpdatedAt,
DeletedAt: d.DeletedAt,
Id: d.Id,
Name: d.Name,
TimeStart: d.TimeStart,
TimeEnd: d.TimeEnd,
CompanyId: d.CompanyId,
CreatorId: d.CreatorId,
KpiCycle: d.KpiCycle,
SummaryState: int(d.SummaryState),
CreatedAt: d.CreatedAt,
UpdatedAt: d.UpdatedAt,
DeletedAt: d.DeletedAt,
}
}
... ... @@ -195,3 +197,25 @@ func (repo *EvaluationCycleRepository) Count(queryOptions map[string]interface{}
}
return int64(count), nil
}
// 获取已结束的周期
func (repo *EvaluationCycleRepository) FindCycleEnd(limit int) ([]*domain.EvaluationCycle, error) {
tx := repo.transactionContext.PgTx
var m []*models.EvaluationCycle
query := tx.Model(&m).
Where("deleted_at isnull").
Where("time_end<=?", time.Now()).
Where("summary_state=0").
Limit(limit)
err := query.Select()
if err != nil {
return nil, err
}
var arrays []*domain.EvaluationCycle
for _, v := range m {
d := repo.TransformToDomain(v)
arrays = append(arrays, &d)
}
return arrays, nil
}
... ...
... ... @@ -337,7 +337,22 @@ func (c *StaffAssessController) ListTargetUserSelfCycle() {
}
userReq := middlewares.GetUser(c.Ctx)
paramReq.CompanyId = int(userReq.CompanyId)
paramReq.TargetUserId = int(userReq.UserId)
data, err := srv.ListTargetUserSelfCycle(paramReq)
c.Response(data, err)
}
// ListTargetUserSelfCycle 按照周期获取员工的每日自评小结
func (c *StaffAssessController) GetStaffAsessSelfCountLevel() {
srv := service.NewStaffAssessServeice()
paramReq := &query.StaffAsessSelfCountLevel{}
err := c.BindJSON(paramReq)
if err != nil {
e := application.ThrowError(application.ARG_ERROR, "json 解析错误"+err.Error())
c.Response(nil, e)
return
}
userReq := middlewares.GetUser(c.Ctx)
paramReq.CompanyId = int(userReq.CompanyId)
data, err := srv.GetStaffAsessSelfCountLevel(paramReq)
c.Response(data, err)
}
... ...
... ... @@ -20,7 +20,6 @@ func init() {
web.NSCtrlPost("/cycle/day/content/export", (*controllers.StaffAssessController).ExportAssessContentCycleDay), //根据周期里的考核日期,导出员工填写评估内容列表
web.NSCtrlPost("/cycle/day/analysis", (*controllers.StaffAssessController).AnalysisData), //员工绩效-项目管理-矩阵分析
web.NSCtrlPost("/cycle/day/content/export2", (*controllers.StaffAssessController).ExportUserAssess2), //员工绩效-综合管理-导出绩效-个人
)
assessNS := web.NewNamespace("/v1/staff-assess",
... ... @@ -36,6 +35,7 @@ func init() {
web.NSCtrlPost("/summary/users-indicator", (*controllers.StaffAssessController).QueryMemberPerformanceIndicator), //员工绩效-综合管理-绩效导出指标
web.NSCtrlPost("/summary/export-indicator", (*controllers.StaffAssessController).ExportPerformanceIndicator), //员工绩效-综合管理-绩效导出指标
web.NSCtrlPost("/target_user/self/cycle", (*controllers.StaffAssessController).ListTargetUserSelfCycle), //获取员工自评的周期下拉列表
web.NSCtrlPost("/target_user/self/summary", (*controllers.StaffAssessController).GetStaffAsessSelfCountLevel), //获取员工每日自评小结
)
//v2 改版
assessTaskV2NS := web.NewNamespace("/v2/staff-assess-task",
... ...
-- 添加summary_cycle 表字段
ALTER TABLE public.evaluation_cycle
ADD summary_state int4 NOT NULL DEFAULT 0;
-- 初始化数据的值
UPDATE
public.evaluation_cycle
SET
summary_state = 1
WHERE
time_end <= now()
AND summary_state = 0;
... ...