Browse Source

方案BUG修复完成

v1_dev_2
超级管理员 3 years ago
parent
commit
10c8da5460
  1. 29
      api/version1/departmentseting/departmentweb/department.go
  2. 4
      api/version1/flowchart/entry.go
  3. 21
      api/version1/flowchart/myworkflow.go
  4. 129
      api/version1/postseting/postpc/scheme.go
  5. 22
      api/version1/postseting/postpc/type.go
  6. 2
      apirouter/v1/postseting/pc.go

29
api/version1/departmentseting/departmentweb/department.go

@ -357,7 +357,7 @@ func (g *GetDttsb) PerformCalculation(orgId, targetId, years string, month int)
# #
*/ */
func DepartTargetCompletionRate(actualValue, zeroPrize, allPrize, cappingPrize float64) (percentageComplete float64) { func DepartTargetCompletionRate(actualValue, zeroPrize, allPrize, cappingPrize float64) (percentageComplete float64) {
// fmt.Printf("计算达成率------->%v------->%v------->%v------->%v\n", actualValue, zeroPrize, allPrize, cappingPrize)
if allPrize == 0 && zeroPrize == 0 { //全奖值与零奖值都为0 那么达成率 100 if allPrize == 0 && zeroPrize == 0 { //全奖值与零奖值都为0 那么达成率 100
percentageComplete = 10000 percentageComplete = 10000
} else { } else {
@ -367,18 +367,28 @@ func DepartTargetCompletionRate(actualValue, zeroPrize, allPrize, cappingPrize f
} else { //实际结算值大于零奖值 } else { //实际结算值大于零奖值
chushu := actualValue - zeroPrize chushu := actualValue - zeroPrize
beiChuShu := allPrize - zeroPrize beiChuShu := allPrize - zeroPrize
// fmt.Printf("计算达成率-----2-->%v------->%v\n", chushu, beiChuShu)
if beiChuShu != 0 { if beiChuShu != 0 {
percentageComplete = publicmethod.DecimalEs(chushu/beiChuShu, 4) // percentageComplete = publicmethod.DecimalEs(chushu/beiChuShu, 4)
percentageComplete = chushu / beiChuShu
// fmt.Printf("计算达成率-----3-->%v------->%v------->%v\n", chushu, beiChuShu, percentageComplete)
if percentageComplete > 0 { if percentageComplete > 0 {
percentageComplete = percentageComplete * 10000 percentageComplete = percentageComplete * 10000
// fmt.Printf("计算达成率-----4-->%v------->%v------->%v\n", chushu, beiChuShu, percentageComplete)
if percentageComplete > cappingPrize { if percentageComplete > cappingPrize {
if cappingPrize != 0 {
percentageComplete = cappingPrize percentageComplete = cappingPrize
} else {
percentageComplete = 10000
} }
}
// fmt.Printf("计算达成率-----6-->%v------->%v------->%v------->%v\n", chushu, beiChuShu, percentageComplete, cappingPrize)
} }
} else { //被除数为0时 那么达成率0 } else { //被除数为0时 那么达成率0
percentageComplete = 0 percentageComplete = 0
} }
// fmt.Printf("计算达成率-----5-->%v------->%v------->%v\n", chushu, beiChuShu, percentageComplete)
} }
} else { //如果全奖值小于零奖值 执行一下操作 } else { //如果全奖值小于零奖值 执行一下操作
if actualValue >= zeroPrize { //实际结算值大于零奖值 那么达成率0 if actualValue >= zeroPrize { //实际结算值大于零奖值 那么达成率0
@ -400,6 +410,7 @@ func DepartTargetCompletionRate(actualValue, zeroPrize, allPrize, cappingPrize f
} }
} }
} }
fmt.Printf("计算达成率-----1-->%v------->%v------->%v------->%v------->%v\n", actualValue, zeroPrize, allPrize, cappingPrize, percentageComplete)
percentageComplete = publicmethod.DecimalEs(percentageComplete/100, 2) percentageComplete = publicmethod.DecimalEs(percentageComplete/100, 2)
return return
} }
@ -706,9 +717,12 @@ func (a *ApiMethod) TotalScoreOFOrgComesFromTimeSearch(c *gin.Context) {
//开启协程,分别获取行政组织时间总分 //开启协程,分别获取行政组织时间总分
var syncOrgTimeScore SyncOrgTimeAllScore var syncOrgTimeScore SyncOrgTimeAllScore
for _, v := range allOrgListCont { for _, v := range allOrgListCont {
// if v.Id == 354 {
sendData.XAxisVal = append(sendData.XAxisVal, v.Name) sendData.XAxisVal = append(sendData.XAxisVal, v.Name)
SyncSeting.Add(1) SyncSeting.Add(1)
go syncOrgTimeScore.OrgCalculateScore(v, currentYears, currentMonths) go syncOrgTimeScore.OrgCalculateScore(v, currentYears, currentMonths)
// }
} }
SyncSeting.Wait() SyncSeting.Wait()
scoreList, maxScore, minSchor := syncOrgTimeScore.readPlanTaskData() scoreList, maxScore, minSchor := syncOrgTimeScore.readPlanTaskData()
@ -826,6 +840,7 @@ func (s *SyncOrgTimeAllScore) OrgCalculateScore(orgCont modelshr.AdministrativeO
//判断是不是观察指标 //判断是不是观察指标
if sv.Status == 3 { if sv.Status == 3 {
getPoints = getPoints + float64(sv.ReferenceScore) getPoints = getPoints + float64(sv.ReferenceScore)
// fmt.Printf("sv-1-->%v--->%v--->%v\n", sv.Id, sv.Name, sv.ReferenceScore)
} else { } else {
if sv.Status == 1 && sv.Status != 3 { //判断指标是否启用并且不是观察指标 if sv.Status == 1 && sv.Status != 3 { //判断指标是否启用并且不是观察指标
//获取指标内容 //获取指标内容
@ -839,14 +854,16 @@ func (s *SyncOrgTimeAllScore) OrgCalculateScore(orgCont modelshr.AdministrativeO
//定性考核 //定性考核
dingXingScore := OrgSchemeDingXing(orgCont.Id, sv.ReferenceScore, targetInfo.Id, sv.Cycles, sv.Status, years, months) dingXingScore := OrgSchemeDingXing(orgCont.Id, sv.ReferenceScore, targetInfo.Id, sv.Cycles, sv.Status, years, months)
getPoints = getPoints + dingXingScore getPoints = getPoints + dingXingScore
// fmt.Printf("sv-2-->%v--->%v--->%v\n", sv.Id, sv.Name, dingXingScore)
} else { } else {
//定量考核 //定量考核
dingLiangScore := OrgSchemeDingLiang(orgCont.Id, sv.ReferenceScore, targetInfo.Id, sv.Cycles, sv.Status, years, months) dingLiangScore := OrgSchemeDingLiang(orgCont.Id, sv.ReferenceScore, targetInfo.Id, sv.Cycles, sv.Status, years, months)
getPoints = getPoints + dingLiangScore getPoints = getPoints + dingLiangScore
// fmt.Printf("sv-3-->%v--->%v--->%v\n", sv.Id, sv.Name, dingLiangScore)
} }
} }
} }
// fmt.Printf("sv--->%v--->%v--->%v\n", sv.Id, sv.Name, getPoints)
} }
} }
} }
@ -857,7 +874,7 @@ func (s *SyncOrgTimeAllScore) OrgCalculateScore(orgCont modelshr.AdministrativeO
currentMonthInt, _ := strconv.Atoi(currentMonth) currentMonthInt, _ := strconv.Atoi(currentMonth)
if currentYearsInt == yearsInt && monthsInt > currentMonthInt { if currentYearsInt == yearsInt && monthsInt > currentMonthInt {
getPoints = 0 getPoints = 0
fmt.Printf("currentYears:%v---->years:%v---->months:%v---->currentMonth:%v---->getPoints:%v\n", currentYearsInt, yearsInt, monthsInt, currentMonthInt, getPoints) // fmt.Printf("currentYears:%v---->years:%v---->months:%v---->currentMonth:%v---->getPoints:%v\n", currentYearsInt, yearsInt, monthsInt, currentMonthInt, getPoints)
} }
if s.AxisMax < getPoints { if s.AxisMax < getPoints {
@ -933,7 +950,7 @@ func OrgSchemeDingLiang(orgId, targetWeight, targetId int64, cycles, attribute i
dachenglv := DepartTargetCompletionRate(float64(v.Score), zeroPrize, allPrize, cappingPrize) dachenglv := DepartTargetCompletionRate(float64(v.Score), zeroPrize, allPrize, cappingPrize)
score = float64(targetWeight) * (dachenglv / 100) score = float64(targetWeight) * (dachenglv / 100)
resultValue = resultValue + score resultValue = resultValue + score
// fmt.Printf("自动得分------->%v------->%v------->%v------->%v\n", orgId, resultValue, dachenglv, score) fmt.Printf("自动得分------->%v------->%v------->%v------->%v------->%v------->%v------->%v------->%v\n", orgId, resultValue, dachenglv, score, zeroPrize, allPrize, cappingPrize, v.Score)
} else { } else {
resultValue = resultValue + publicmethod.DecimalEs(v.ScoringScore/100, 2) resultValue = resultValue + publicmethod.DecimalEs(v.ScoringScore/100, 2)
} }

4
api/version1/flowchart/entry.go

@ -31,6 +31,9 @@ type HaveApprovalRecord struct {
State int `json:"state"` // 0:全部;1:审批中;2:驳回;3:归档;4:删除 State int `json:"state"` // 0:全部;1:审批中;2:驳回;3:归档;4:删除
NameorNumber string `json:"nameornumber"` //申请人姓名或工号 NameorNumber string `json:"nameornumber"` //申请人姓名或工号
Title string `json:"title"` //标题 Title string `json:"title"` //标题
OrgId string `json:"orgid"` //行政组织
Years int `json:"years"`
Months int `json:"month"`
} }
// 输出审批记录值 // 输出审批记录值
@ -66,6 +69,7 @@ type OutPutFlowLog struct {
CurrentNode string `json:"currentnode"` //当前节点"` CurrentNode string `json:"currentnode"` //当前节点"`
CurrentNodeMan string `json:"currentnodeman"` //当前节点操作人"` CurrentNodeMan string `json:"currentnodeman"` //当前节点操作人"`
CreationDate string `json:"creationdate"` //创建日期"` CreationDate string `json:"creationdate"` //创建日期"`
OccurrenceTime string `json:"occurrencetime"` //发生时间"`
} }
// 输出工作流内容 // 输出工作流内容

21
api/version1/flowchart/myworkflow.go

@ -72,6 +72,26 @@ func (a *ApiMethod) GetApprovalRecord(c *gin.Context) {
gormDb = gormDb.Where("`ep_setup_department` IN ? OR `ep_accept_department` IN ?", userIdentity.OrgList, userIdentity.OrgList) gormDb = gormDb.Where("`ep_setup_department` IN ? OR `ep_accept_department` IN ?", userIdentity.OrgList, userIdentity.OrgList)
default: default:
} }
if receivedValue.OrgId != "" {
gormDb = gormDb.Where("ep_accept_department = ? OR ep_setup_department = ?", receivedValue.OrgId, receivedValue.OrgId)
}
if receivedValue.Years != 0 {
if receivedValue.Months != 0 {
timeDay := fmt.Sprintf("%v-%v-01", receivedValue.Years, receivedValue.Months)
if receivedValue.Months <= 9 {
timeDay = fmt.Sprintf("%v-0%v-01", receivedValue.Years, receivedValue.Months)
}
startTime, endTime := publicmethod.GetAppointMonthStarAndEndTimeEs(timeDay)
gormDb = gormDb.Where("ep_happen_time BETWEEN ? AND ?", startTime, endTime)
} else {
startTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-01-01 00:00:00", receivedValue.Years))
endTime := publicmethod.DateToTimeStampOld(fmt.Sprintf("%v-12-31 23:59:59", receivedValue.Years))
gormDb = gormDb.Where("ep_happen_time BETWEEN ? AND ?", startTime, endTime)
}
}
fmt.Printf("userIdentity------------>%v\n", userIdentity) fmt.Printf("userIdentity------------>%v\n", userIdentity)
var total int64 var total int64
totalErr := gormDb.Count(&total).Error totalErr := gormDb.Count(&total).Error
@ -107,6 +127,7 @@ func (a *ApiMethod) GetApprovalRecord(c *gin.Context) {
sendCont.DetailedTarget = v.DetailedTarget //指标细则"` sendCont.DetailedTarget = v.DetailedTarget //指标细则"`
sendCont.AcceptDepartment = strconv.FormatInt(v.AcceptDepartment, 10) //接受考核部门"` sendCont.AcceptDepartment = strconv.FormatInt(v.AcceptDepartment, 10) //接受考核部门"`
sendCont.HappenTime = v.HappenTime //发生时间"` sendCont.HappenTime = v.HappenTime //发生时间"`
sendCont.OccurrenceTime = publicmethod.UnixTimeToDay(v.HappenTime, 14)
sendCont.FlowKey = strconv.FormatInt(v.FlowKey, 10) //工作流识别符"` sendCont.FlowKey = strconv.FormatInt(v.FlowKey, 10) //工作流识别符"`
sendCont.FlowVid = strconv.FormatInt(v.FlowVid, 10) //当前工作流版本号"` sendCont.FlowVid = strconv.FormatInt(v.FlowVid, 10) //当前工作流版本号"`
sendCont.EpOld = v.EpOld //1:旧流程;2:新流程"` sendCont.EpOld = v.EpOld //1:旧流程;2:新流程"`

129
api/version1/postseting/postpc/scheme.go

@ -26,7 +26,7 @@ func (a *ApiMethod) GetSchemeList(c *gin.Context) {
receivedValue.PageSize = 20 receivedValue.PageSize = 20
} }
var schemeList []modelskpi.PositionPlanVersio var schemeList []modelskpi.PositionPlanVersio
gormDb := overall.CONSTANT_DB_KPI.Model(&modelskpi.PositionPlanVersio{}).Where("`state` BETWEEN ? AND ?", 1, 2) gormDb := overall.CONSTANT_DB_KPI.Model(&modelskpi.PositionPlanVersio{})
if receivedValue.VersionNumber != "" { if receivedValue.VersionNumber != "" {
gormDb = gormDb.Where("`key` LIKE ?", "%"+receivedValue.VersionNumber+"%") gormDb = gormDb.Where("`key` LIKE ?", "%"+receivedValue.VersionNumber+"%")
} }
@ -40,10 +40,10 @@ func (a *ApiMethod) GetSchemeList(c *gin.Context) {
if receivedValue.OrgId != "" { if receivedValue.OrgId != "" {
gormDb = gormDb.Where("`orgid` = ?", receivedValue.OrgId) gormDb = gormDb.Where("`orgid` = ?", receivedValue.OrgId)
} }
if receivedValue.PostId != "" { if len(receivedValue.PostId) > 0 {
gormDb = gormDb.Where("`position` = ?", receivedValue.PostId) gormDb = gormDb.Where("`position` IN ?", receivedValue.PostId)
} }
if receivedValue.Year != 0 { if receivedValue.Year != "" {
gormDb = gormDb.Where("`years` = ?", receivedValue.Year) gormDb = gormDb.Where("`years` = ?", receivedValue.Year)
} }
if receivedValue.State != 0 { if receivedValue.State != 0 {
@ -52,7 +52,7 @@ func (a *ApiMethod) GetSchemeList(c *gin.Context) {
gormDb = gormDb.Where("`state` BETWEEN ? AND ?", 1, 2) gormDb = gormDb.Where("`state` BETWEEN ? AND ?", 1, 2)
} }
gormDb = publicmethod.PageTurningSettings(gormDb, receivedValue.Page, receivedValue.PageSize) gormDb = publicmethod.PageTurningSettings(gormDb, receivedValue.Page, receivedValue.PageSize)
err := gormDb.Order("`state` ASC").Order("`version` ASC").Order("`id` DESC").Find(&schemeList).Error err := gormDb.Order("`orgid` ASC").Order("`position` ASC").Order("`state` ASC").Order("`years` ASC").Order("`version` ASC").Order("`id` DESC").Find(&schemeList).Error
var total int64 var total int64
totalErr := gormDb.Count(&total).Error totalErr := gormDb.Count(&total).Error
if totalErr != nil { if totalErr != nil {
@ -90,7 +90,7 @@ func (a *ApiMethod) GetSchemeList(c *gin.Context) {
var postContInfo modelshr.Position var postContInfo modelshr.Position
postContInfo.GetCont(map[string]interface{}{"`id`": schemeList[i].Position}, "`name`") postContInfo.GetCont(map[string]interface{}{"`id`": schemeList[i].Position}, "`name`")
sendDataCont.PostName = postContInfo.Name //`归属岗位"` sendDataCont.PostName = postContInfo.Name //`归属岗位"`
sendDataCont.TimeStr = publicmethod.UnixTimeToDay(schemeList[i].AddTime, 1)
sendData = append(sendData, sendDataCont) sendData = append(sendData, sendDataCont)
} }
publicmethod.ResultList(0, receivedValue.Page, receivedValue.PageSize, total, int64(len(sendData)), sendData, c) publicmethod.ResultList(0, receivedValue.Page, receivedValue.PageSize, total, int64(len(sendData)), sendData, c)
@ -1183,6 +1183,7 @@ func (a *ApiMethod) EditSchemeStateOfDel(c *gin.Context) {
publicmethod.Result(1, err, c, "未知系统参数!") publicmethod.Result(1, err, c, "未知系统参数!")
return return
} }
where := map[string]interface{}{"`id`": receivedValue.Id} where := map[string]interface{}{"`id`": receivedValue.Id}
var oldSystemCont modelskpi.PositionPlanVersio var oldSystemCont modelskpi.PositionPlanVersio
err = oldSystemCont.GetCont(where) err = oldSystemCont.GetCont(where)
@ -1194,13 +1195,15 @@ func (a *ApiMethod) EditSchemeStateOfDel(c *gin.Context) {
saveData := publicmethod.MapOut[string]() saveData := publicmethod.MapOut[string]()
saveData["`state`"] = receivedValue.State saveData["`state`"] = receivedValue.State
saveData["`eitetime`"] = time.Now().Unix() saveData["`eitetime`"] = time.Now().Unix()
err = oldSystemCont.EiteCont(where, saveData) var editPostPlan modelskpi.PositionPlanVersio
err = editPostPlan.EiteCont(where, saveData)
} else { } else {
// if receivedValue.IsTrue != 1 { // if receivedValue.IsTrue != 1 {
saveData := publicmethod.MapOut[string]() saveData := publicmethod.MapOut[string]()
saveData["`state`"] = receivedValue.State saveData["`state`"] = receivedValue.State
saveData["`eitetime`"] = time.Now().Unix() saveData["`eitetime`"] = time.Now().Unix()
err = oldSystemCont.EiteCont(where, saveData) var editPostPlan modelskpi.PositionPlanVersio
err = editPostPlan.EiteCont(where, saveData)
// } else { // } else {
// err = overall.CONSTANT_DB_System_Permission.Where(where).Delete(&oldSystemCont).Error // err = overall.CONSTANT_DB_System_Permission.Where(where).Delete(&oldSystemCont).Error
// } // }
@ -1226,12 +1229,13 @@ func editSchemeOther(schemeCont modelskpi.PositionPlanVersio, state int) {
saveData["`eitetime`"] = time.Now().Unix() saveData["`eitetime`"] = time.Now().Unix()
overall.CONSTANT_DB_KPI.Model(&modelskpi.QualitativeEvaluationScheme{}).Where("`company_id` = ? AND `department_id` = ? AND `org_id` = ? AND `post_id` = ? AND `version_number` <> ?", schemeCont.Group, schemeCont.Department, schemeCont.OrgId, schemeCont.Position, schemeCont.Key).Updates(saveData) overall.CONSTANT_DB_KPI.Model(&modelskpi.QualitativeEvaluationScheme{}).Where("`company_id` = ? AND `department_id` = ? AND `org_id` = ? AND `post_id` = ? AND `version_number` <> ?", schemeCont.Group, schemeCont.Department, schemeCont.OrgId, schemeCont.Position, schemeCont.Key).Updates(saveData)
// 将本岗位下其他方案禁用 // 将本岗位下其他方案禁用
var oldSystemCont modelskpi.PositionPlanVersio // var oldSystemCont modelskpi.PositionPlanVersio
saveDataOther := publicmethod.MapOut[string]() saveDataOther := publicmethod.MapOut[string]()
saveDataOther["`state`"] = 2 saveDataOther["`state`"] = 2
saveDataOther["`eitetime`"] = time.Now().Unix() saveDataOther["`eitetime`"] = time.Now().Unix()
where := map[string]interface{}{"`id`": schemeCont.Id} // where := map[string]interface{}{"`id`": schemeCont.Id}
oldSystemCont.EiteCont(where, saveDataOther) // oldSystemCont.EiteCont(where, saveDataOther)
overall.CONSTANT_DB_KPI.Model(&modelskpi.PositionPlanVersio{}).Where("`position` = ? AND `state` = 1 AND `id` <> ?", schemeCont.Position, schemeCont.Id).Updates(saveDataOther)
//开启本岗位方案详情 //开启本岗位方案详情
var qesCont modelskpi.QualitativeEvaluationScheme var qesCont modelskpi.QualitativeEvaluationScheme
qesCont.EiteCont(map[string]interface{}{"`version_number`": schemeCont.Key}, map[string]interface{}{"`state": 1}) qesCont.EiteCont(map[string]interface{}{"`version_number`": schemeCont.Key}, map[string]interface{}{"`state": 1})
@ -1282,3 +1286,106 @@ func xieChengWeight(class, orgid, postid, dimensionIdInt64, target, hierarchy, q
dimWeight.Quote = quote //1:不是引用;2:引用部门"` dimWeight.Quote = quote //1:不是引用;2:引用部门"`
dimWeight.WriteTargetWeight() dimWeight.WriteTargetWeight()
} }
/*
*
@ 作者: 秦东
@ 时间: 2023-04-20 14:04:52
@ 功能: 获取岗位指标添加方案时使用
@ 参数
#
@ 返回值
#
@ 方法原型
#
*/
func (a *ApiMethod) HavePostTarget(c *gin.Context) {
var receivedValue publicmethod.PublicId
err := c.ShouldBindJSON(&receivedValue)
if err != nil {
publicmethod.Result(100, err, c)
return
}
if receivedValue.Id == "" {
publicmethod.Result(1, err, c, "未知岗位!请先选择岗位!")
return
}
var postCont modelshr.Position
err = postCont.GetCont(map[string]interface{}{"`id`": receivedValue.Id}, "administrative_organization")
if err != nil {
publicmethod.Result(1, err, c, "未知岗位!请先选择岗位!")
return
}
var targetId []int64
err = overall.CONSTANT_DB_KPI.Model(&modelskpi.TargetDepartment{}).Distinct("target_id").Where("`level` = 2 AND `state` = 1 AND `post_id` = ?", receivedValue.Id).Find(&targetId).Error
if err != nil && len(targetId) < 1 {
publicmethod.Result(105, err, c)
return
}
var postTargetListCont []modelskpi.PostTarget
err = overall.CONSTANT_DB_KPI.Where("`id` IN ?", targetId).Find(&postTargetListCont).Error
if err != nil && len(postTargetListCont) < 1 {
publicmethod.Result(105, err, c)
return
}
var postPlanScheme postScheme
postPlanScheme.OrgId = strconv.FormatInt(postCont.AdministrativeOrganization, 10)
postPlanScheme.PostId = receivedValue.Id
var dutyClassList []PostSchemeDiem
var dutyId []int64
var tarList []PostSchemeTar
for _, v := range postTargetListCont {
if !publicmethod.IsInTrue[int64](v.Dimension, dutyId) {
dutyId = append(dutyId, v.Dimension)
var dutyCont modelskpi.DutyClass
errs := dutyCont.GetCont(map[string]interface{}{"`id`": v.Dimension}, "`title`", `sort`)
if errs == nil {
var dyCont PostSchemeDiem
dyCont.Id = strconv.FormatInt(v.Dimension, 10)
dyCont.Name = dutyCont.Title
dyCont.Sort = dutyCont.Sort
dutyClassList = append(dutyClassList, dyCont)
}
}
var tarCont PostSchemeTar
tarCont.Id = strconv.FormatInt(v.Id, 10)
tarCont.Name = v.Title
tarCont.Content = "" //说明
tarCont.Score = 0 //分数
tarCont.State = 1 //状态:1:启用;2:禁用;3:观察
tarCont.Type = v.Type //1、定性指标;2、定量指标
tarCont.Dimension = strconv.FormatInt(v.Dimension, 10)
tarList = append(tarList, tarCont)
}
//根据维度序号排序
sort.Slice(dutyClassList, func(i, j int) bool {
return dutyClassList[i].Sort < dutyClassList[j].Sort
})
for _, dv := range dutyClassList {
var dyInfo schemeStructure
dyInfo.Id = dv.Id
dyInfo.Name = dv.Name
dyInfo.Sort = dv.Sort
dyInfo.Score = 0
for _, tv := range tarList {
if tv.Dimension == dv.Id {
var trInfo schemeTargetStructure
trInfo.Id = tv.Id
trInfo.Name = tv.Name
trInfo.Content = tv.Content //说明
trInfo.Score = tv.Score //分数
trInfo.State = tv.State //状态:1:启用;2:禁用;3:观察
trInfo.Type = tv.Type //1、定性指标;2、定量指标
dyInfo.Child = append(dyInfo.Child, trInfo)
}
}
postPlanScheme.PostChild = append(postPlanScheme.PostChild, dyInfo)
}
publicmethod.Result(0, postPlanScheme, c)
}

22
api/version1/postseting/postpc/type.go

@ -135,8 +135,8 @@ type postSchemeList struct {
CompanyId string `json:"companyid"` //归属公司"` CompanyId string `json:"companyid"` //归属公司"`
DepartmentId string `json:"departmentid"` //归属部门"` DepartmentId string `json:"departmentid"` //归属部门"`
OrgId string `json:"orgid"` //归属行政组织"` OrgId string `json:"orgid"` //归属行政组织"`
PostId string `json:"postid"` //`归属岗位"` PostId []string `json:"postid"` //`归属岗位"`
Year int `json:"year"` //`年度"` Year string `json:"year"` //`年度"`
State int `json:"state"` //`状态(1:启用;2:禁用;3:删除)"` State int `json:"state"` //`状态(1:启用;2:禁用;3:删除)"`
} }
@ -148,6 +148,7 @@ type sendPostSchemeList struct {
DepartmentName string `json:"departmentname"` //归属部门"` DepartmentName string `json:"departmentname"` //归属部门"`
OrgName string `json:"orgname"` //归属行政组织"` OrgName string `json:"orgname"` //归属行政组织"`
PostName string `json:"postname"` //`归属岗位"` PostName string `json:"postname"` //`归属岗位"`
TimeStr string `json:"timestr"` //`时间"`
} }
// 输出考核方案详细内容 // 输出考核方案详细内容
@ -462,3 +463,20 @@ type NewEditPostTargetCont struct {
publicmethod.PublicId publicmethod.PublicId
NewAddPostTargetInfo NewAddPostTargetInfo
} }
// 岗位方案指标列表
type PostSchemeDiem struct {
publicmethod.PublicId //id
publicmethod.PublicName //名称
Sort int `json:"sort"` //排序
}
type PostSchemeTar struct {
publicmethod.PublicId //id
publicmethod.PublicName //名称
Content string `json:"content"` //说明
Score float64 `json:"score"` //分数
State int `json:"state"` //状态:1:启用;2:禁用;3:观察
Type int `json:"type"` //1、定性指标;2、定量指标
Dimension string `json:"dimension"`
}

2
apirouter/v1/postseting/pc.go

@ -20,6 +20,8 @@ func (a *ApiRouter) RouterGroupPc(router *gin.RouterGroup) {
apiRouter.POST("get_post_scheme", methodBinding.GetPostScheme) //获取岗位方案内容列表 apiRouter.POST("get_post_scheme", methodBinding.GetPostScheme) //获取岗位方案内容列表
apiRouter.POST("get_copy_sheme_infor", methodBinding.GetCopyShemeInfor) //获取复制岗位考核方案 apiRouter.POST("get_copy_sheme_infor", methodBinding.GetCopyShemeInfor) //获取复制岗位考核方案
apiRouter.POST("have_post_target", methodBinding.HavePostTarget) //获取岗位指标(添加方案时使用)
apiRouter.POST("set_evaluation_objectives", methodBinding.SetEvaluationObjectives) //提交岗位定量目标设定 apiRouter.POST("set_evaluation_objectives", methodBinding.SetEvaluationObjectives) //提交岗位定量目标设定
apiRouter.POST("post_config_list", methodBinding.PostConfigList) //岗位定量考核目标列表 apiRouter.POST("post_config_list", methodBinding.PostConfigList) //岗位定量考核目标列表

Loading…
Cancel
Save