Browse Source

岗位被考核人定性指标列表

master
超级管理员 3 years ago
parent
commit
4235ac5646
  1. 9
      api/version1/honoraryArchives/honors.go
  2. 2
      api/version1/honoraryArchives/type.go
  3. 86
      api/version1/postseting/postweb/posttarget.go
  4. 14
      api/version1/postseting/postweb/type.go
  5. 1
      apirouter/v1/postseting/web.go
  6. 4
      models/modelskpi/sheme_people.go

9
api/version1/honoraryArchives/honors.go

@ -399,5 +399,14 @@ func (a *ApiMethod) GetHonorsCont(c *gin.Context) {
outData.Userid = carrierTypeCont.Userid //归属人员"` outData.Userid = carrierTypeCont.Userid //归属人员"`
outData.Time = carrierTypeCont.Time //创建时间"` outData.Time = carrierTypeCont.Time //创建时间"`
outData.State = carrierTypeCont.State //状态(1:启用;2:禁用;3:删除)"` outData.State = carrierTypeCont.State //状态(1:启用;2:禁用;3:删除)"`
if carrierTypeCont.AwardTime != 0 {
outData.AwardTimeStr = publicmethod.UnixTimeToDay(carrierTypeCont.AwardTime, 14)
}
if carrierTypeCont.AwardTime != 0 {
outData.TermOfValidityStr = publicmethod.UnixTimeToDay(carrierTypeCont.TermOfValidity, 14)
} else {
outData.TermOfValidityStr = "永久"
}
publicmethod.Result(0, outData, c) publicmethod.Result(0, outData, c)
} }

2
api/version1/honoraryArchives/type.go

@ -81,5 +81,7 @@ type honorslist struct {
// 查询荣誉详情输出 // 查询荣誉详情输出
type lookHonorsCont struct { type lookHonorsCont struct {
modelshonory.HonoraryArchives modelshonory.HonoraryArchives
AwardTimeStr string `json:"awardtimestr"` //获奖时间
TermOfValidityStr string `json:"termvaliditytr"` //获奖时间
ImgUrl []modelshonory.PhotosGallery `json:"imgurl"` //图片集 ImgUrl []modelshonory.PhotosGallery `json:"imgurl"` //图片集
} }

86
api/version1/postseting/postweb/posttarget.go

@ -1,11 +1,13 @@
package postweb package postweb
import ( import (
"fmt"
"key_performance_indicators/models/modelshr" "key_performance_indicators/models/modelshr"
"key_performance_indicators/models/modelskpi" "key_performance_indicators/models/modelskpi"
"key_performance_indicators/overall" "key_performance_indicators/overall"
"key_performance_indicators/overall/publicmethod" "key_performance_indicators/overall/publicmethod"
"strconv" "strconv"
"strings"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@ -92,7 +94,7 @@ func (a *ApiMethod) GetPostNature(c *gin.Context) {
//获取被考核人本岗位的考核项目 //获取被考核人本岗位的考核项目
var itemList []modelskpi.ShemePeople var itemList []modelskpi.ShemePeople
err = overall.CONSTANT_DB_KPI.Where("`state` = 1 AND `attribute` = 1 AND `run_state` <> 2 AND `org_id` = ? AND `post_id` = ? AND `man_key` = ?", userCont.MainDeparment, userCont.Position, context.Key).Find(&itemList).Error err = overall.CONSTANT_DB_KPI.Where("`state` IN (1,3) AND `type` = 2 AND `attribute` = 1 AND `run_state` <> 2 AND `org_id` = ? AND `post_id` = ? AND `man_key` = ?", userCont.MainDeparment, userCont.Position, context.Key).Find(&itemList).Error
if err != nil || len(itemList) < 1 { if err != nil || len(itemList) < 1 {
publicmethod.Result(107, err, c) publicmethod.Result(107, err, c)
return return
@ -147,7 +149,7 @@ func (a *ApiMethod) GetPostRation(c *gin.Context) {
//获取被考核人本岗位的考核项目 //获取被考核人本岗位的考核项目
var itemList []modelskpi.ShemePeople var itemList []modelskpi.ShemePeople
err = overall.CONSTANT_DB_KPI.Where("`state` = 1 AND `attribute` = 2 AND `run_state` <> 2 AND `org_id` = ? AND `post_id` = ? AND `man_key` = ?", userCont.MainDeparment, userCont.Position, context.Key).Find(&itemList).Error err = overall.CONSTANT_DB_KPI.Where("`state` IN (1,3) AND `type` = 2 AND `attribute` = 2 AND `run_state` <> 2 AND `org_id` = ? AND `post_id` = ? AND `man_key` = ?", userCont.MainDeparment, userCont.Position, context.Key).Find(&itemList).Error
if err != nil || len(itemList) < 1 { if err != nil || len(itemList) < 1 {
publicmethod.Result(107, err, c) publicmethod.Result(107, err, c)
return return
@ -181,6 +183,10 @@ func (a *ApiMethod) GetPostDeimensoInfo(c *gin.Context) {
publicmethod.Result(101, receivedValue, c) publicmethod.Result(101, receivedValue, c)
return return
} }
if receivedValue.DimensionId == "" {
publicmethod.Result(101, receivedValue, c)
return
}
if receivedValue.TargetId == "" { if receivedValue.TargetId == "" {
publicmethod.Result(101, receivedValue, c) publicmethod.Result(101, receivedValue, c)
return return
@ -197,9 +203,81 @@ func (a *ApiMethod) GetPostDeimensoInfo(c *gin.Context) {
//获取被考核人本岗位的考核项目 //获取被考核人本岗位的考核项目
var itemList []modelskpi.ShemePeople var itemList []modelskpi.ShemePeople
err = overall.CONSTANT_DB_KPI.Where("`state` = 1 AND `attribute` = 2 AND `run_state` <> 2 AND `org_id` = ? AND `post_id` = ? AND `man_key` = ?", userCont.MainDeparment, userCont.Position, context.Key).Find(&itemList).Error gormDb := overall.CONSTANT_DB_KPI.Where("`state` IN (1,3) AND `type` = 2 AND `attribute` = 1 AND `run_state` <> 2 AND `dimension_id` = ? AND `target_id` = ? AND `org_id` = ? AND `post_id` = ? AND `man_key` = ?", receivedValue.DimensionId, receivedValue.TargetId, userCont.MainDeparment, userCont.Position, context.Key)
if err != nil || len(itemList) < 1 { gormDb = publicmethod.PageTurningSettings(gormDb, receivedValue.Page, receivedValue.PageSize)
errGorm := gormDb.Order("`son_target_id` DESC").Find(&itemList).Error
var total int64
totalErr := gormDb.Count(&total).Error
if totalErr != nil {
total = 0
}
if errGorm != nil || len(itemList) < 1 {
publicmethod.Result(107, err, c) publicmethod.Result(107, err, c)
return return
} }
var outList []outNatureDimeCont
for _, v := range itemList {
var outCont outNatureDimeCont
outCont.Id = v.Id
outCont.VersionNumber = v.VersionNumber // 版本编号"`
outCont.CompanyId = v.CompanyId // 归属公司"`
outCont.DepartmentId = v.DepartmentId // 归属部门"`
outCont.OrgId = v.OrgId // 归属行政组织"`
outCont.PostId = v.PostId // 归属岗位"`
outCont.Title = v.Title //考核项名称"`
outCont.DimensionId = v.DimensionId //维度"`
outCont.TargetId = v.TargetId // 指标"`
outCont.SonTargetId = v.SonTargetId //子栏目"`
outCont.DetailsId = v.DetailsId //细则"`
outCont.Attribute = v.Attribute // 属性 1:定性考核;2:定量考核"`
outCont.MinScore = v.MinScore // 最小分*100保存"`
outCont.MaxScore = v.MaxScore //最大分*100保存"`
outCont.ScoringMethod = v.ScoringMethod //计分方式(1:自动;2:手动)"`
outCont.State = v.State //状态(1:启用;2:禁用;3:删除)"`
outCont.Addtime = v.Addtime //添加时间"`
outCont.Eitetime = v.Eitetime // 编辑时间"`
outCont.CensorType = v.CensorType //检查方式(1:现场检查;2:资料检查;3:事件触发)"`
outCont.Source = v.Source //来源(1:岗位;2:部门引用)"`
outCont.RunState = v.RunState //运行状态(1:启用;2:禁用;3:观察)"`
outCont.Type = v.Type //类型(1:公司级;2:部门级)"`
outCont.ReportPerson = v.ReportPerson //上报人"`
outCont.ManDepartment = v.ManDepartment //提报人所在部门"`
outCont.Class = v.Class //1:定性考核;2:定量考核"`
outCont.Level = v.Level //类型(1:指标;2:子目标;3:细则)"`
outCont.Punishmode = v.Punishmode //处罚方式 1:扣分;2:现金处罚;3:扣分加现金
outCont.Maxmoney = v.Maxmoney //最高罚款
outCont.Minmoney = v.Minmoney //最低罚款
if v.CensorType != "" {
outCont.CensorTypeAry = strings.Split(v.CensorType, ",")
}
if v.DetailsId != 0 {
//获取指标信息
if v.Source == 1 { //岗位
var targetCont modelskpi.PostTargetDetails
targetCont.GetCont(map[string]interface{}{"`id`": v.DetailsId}, "content", "add_reduce", "censor_cont")
outCont.Context = targetCont.Content //指标说明"`
outCont.AddReduce = targetCont.AddReduce //1:减少;2:增加;3:无属性,现场确认加或减"`
outCont.CensorCont = targetCont.CensorCont //检查依据"`
} else { //部门
var departTarDeta modelskpi.DetailedTarget
departTarDeta.GetCont(map[string]interface{}{"`dt_id`": v.DetailsId}, "`dt_add_reduce`")
outCont.Context = departTarDeta.Content //指标说明"`
outCont.AddReduce = departTarDeta.AddReduce //1:减少;2:增加;3:无属性,现场确认加或减"`
outCont.CensorCont = departTarDeta.CensorCont //检查依据"`
}
}
if v.MinScore != 0 {
outCont.ScoreStr = fmt.Sprintf("%v-%v", v.MinScore, v.MaxScore)
} else {
outCont.ScoreStr = fmt.Sprintf("%v", v.MaxScore)
}
if v.Minmoney != 0 {
outCont.MoneyStr = fmt.Sprintf("%v-%v", v.Minmoney, v.Maxmoney)
} else {
outCont.MoneyStr = fmt.Sprintf("%v", v.Maxmoney)
}
outList = append(outList, outCont)
}
publicmethod.ResultList(0, receivedValue.Page, receivedValue.PageSize, total, int64(len(outList)), outList, c)
} }

14
api/version1/postseting/postweb/type.go

@ -1,6 +1,7 @@
package postweb package postweb
import ( import (
"key_performance_indicators/models/modelskpi"
"key_performance_indicators/overall/publicmethod" "key_performance_indicators/overall/publicmethod"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
@ -40,6 +41,19 @@ type outPostRation struct {
// 获取指定人的定性考核细则列表 // 获取指定人的定性考核细则列表
type getNatureDimeList struct { type getNatureDimeList struct {
publicmethod.PagesTurn
UserKey string `json:"userkey"` UserKey string `json:"userkey"`
DimensionId string `json:"dimensionid"` //维度
TargetId string `json:"targetid"` TargetId string `json:"targetid"`
} }
// 输出定性考核细则内容
type outNatureDimeCont struct {
modelskpi.ShemePeople
CensorTypeAry []string `json:"censortypeary"`
Context string `json:"content"` //指标说明
AddReduce int `json:"addreduce"` //1:减少;2:增加;3:无属性,现场确认加或减
CensorCont string `json:"censorcont"` //检查依据
ScoreStr string `json:"scorestr"` //基础考核标准
MoneyStr string `json:"moneystr"` //现金
}

1
apirouter/v1/postseting/web.go

@ -18,5 +18,6 @@ func (a *ApiRouter) RouterGroupWeb(router *gin.RouterGroup) {
apiRouter.POST("getposttarget", methodBinding.GetPostTarget) //获取指定人要考核的项目列表 apiRouter.POST("getposttarget", methodBinding.GetPostTarget) //获取指定人要考核的项目列表
apiRouter.POST("getpostnature", methodBinding.GetPostNature) //定性指标列表 apiRouter.POST("getpostnature", methodBinding.GetPostNature) //定性指标列表
apiRouter.POST("getpostration", methodBinding.GetPostRation) //定量指标列表 apiRouter.POST("getpostration", methodBinding.GetPostRation) //定量指标列表
apiRouter.POST("get_post_deimenso_info", methodBinding.GetPostDeimensoInfo) //获取岗位定性考核指标细则列表
} }
} }

4
models/modelskpi/sheme_people.go

@ -35,6 +35,10 @@ type ShemePeople struct {
ManDepartment int64 `json:"mandepartment" gorm:"column:man_department;type:bigint(20) unsigned;default:0;not null;comment:提报人所在部门"` ManDepartment int64 `json:"mandepartment" gorm:"column:man_department;type:bigint(20) unsigned;default:0;not null;comment:提报人所在部门"`
Class int `json:"class" gorm:"column:tr_class;type:tinyint(1) unsigned;default:1;not null;comment:1:定性考核;2:定量考核"` Class int `json:"class" gorm:"column:tr_class;type:tinyint(1) unsigned;default:1;not null;comment:1:定性考核;2:定量考核"`
Level int `json:"level" gorm:"column:tr_level;type:tinyint(1) unsigned;default:1;not null;comment:类型(1:指标;2:子目标;3:细则)"` Level int `json:"level" gorm:"column:tr_level;type:tinyint(1) unsigned;default:1;not null;comment:类型(1:指标;2:子目标;3:细则)"`
Punishmode int `json:"punishmode" gorm:"column:punishmode;type:tinyint(1) unsigned;default:1;not null;comment:处罚方式 1:扣分;2:现金处罚;3:扣分加现金"`
Maxmoney int64 `json:"maxmoney" gorm:"column:maxmoney;type:bigint(20) unsigned;default:0;not null;comment:最高罚款"`
Minmoney int64 `json:"minmoney" gorm:"column:minmoney;type:bigint(20) unsigned;default:0;not null;comment:最低罚款"`
} }
func (ShemePeople *ShemePeople) TableName() string { func (ShemePeople *ShemePeople) TableName() string {

Loading…
Cancel
Save