Browse Source

校正部门考核数据

master
超级管理员 3 years ago
parent
commit
ab71b506d1
  1. 19
      api/index/statistics/enter.go
  2. 7
      api/index/statistics/newstatistics.go
  3. 589
      api/index/statistics/queryresults.go
  4. 3
      api/statistics/quantification/enter.go
  5. 62
      api/statistics/quantification/summary_details.go
  6. 43
      api/v1/positionkpi/entry.go
  7. 27
      api/v1/positionkpi/posttarget.go
  8. 583
      api/v1/positionkpi/posttargetcont.go
  9. 70
      api/v1/shiyan/shiyan.go
  10. 2
      commonus/wechatapp.go
  11. 1
      model/assessmentmodel/dutyclass.go
  12. 6
      model/assessmentmodel/post_target_details.go
  13. 5
      router/index/statisticsroute/programme.go
  14. 14
      router/postrouter/post_target.go
  15. 2
      router/shiyan/sys_shiyan.go

19
api/index/statistics/enter.go

@ -54,6 +54,25 @@ func (d *dataLockStatistics) readMyDayData() []TargetContOutCont {
return d.outData return d.outData
} }
// 计算部门每月成绩分数
type countEveryDepartmentMonthScore struct {
outData []everyDepartmentScore
mutext sync.RWMutex
}
// 部门月分数
type everyDepartmentScore struct {
MonthVal int64 `json:"monthval"`
Score float64 `json:"score"`
}
// 读取锁数据
func (c *countEveryDepartmentMonthScore) readMyDayData() []everyDepartmentScore {
c.mutext.RLock()
defer c.mutext.RUnlock()
return c.outData
}
// 考核方案版本列表查询 // 考核方案版本列表查询
type DutyPlanVersio struct { type DutyPlanVersio struct {
Group string `json:"group"` //归属集团 Group string `json:"group"` //归属集团

7
api/index/statistics/newstatistics.go

@ -216,7 +216,7 @@ func (a *ApiGroup) DepartmentTranscript(c *gin.Context) {
var orgAry []hrsystem.AdministrativeOrganization var orgAry []hrsystem.AdministrativeOrganization
for _, ov := range orgList { for _, ov := range orgList {
orgAry = append(orgAry, ov) orgAry = append(orgAry, ov)
// if ov.Id == 281 || ov.Id == 280 { if ov.Id == 280 {
var ovlist []hrsystem.AdministrativeOrganization var ovlist []hrsystem.AdministrativeOrganization
ovErr := global.GVA_DB_HrDataBase.Where("state = 1").Where("ispower = 1 AND superior = ?", ov.Id).Find(&ovlist).Error ovErr := global.GVA_DB_HrDataBase.Where("state = 1").Where("ispower = 1 AND superior = ?", ov.Id).Find(&ovlist).Error
if ovErr == nil { if ovErr == nil {
@ -227,7 +227,7 @@ func (a *ApiGroup) DepartmentTranscript(c *gin.Context) {
} }
// } else { // } else {
// orgAry = append(orgAry, ov) // orgAry = append(orgAry, ov)
// } }
} }
currentYear := commonus.ComputingTime(time.Now().Unix(), 1) currentYear := commonus.ComputingTime(time.Now().Unix(), 1)
@ -244,6 +244,7 @@ func (a *ApiGroup) DepartmentTranscript(c *gin.Context) {
} }
syncProcess.Wait() syncProcess.Wait()
readStatisticsData := deaprtmenTranscript.readTranscriptData() readStatisticsData := deaprtmenTranscript.readTranscriptData()
// fmt.Printf("readStatisticsData------>%v\n", readStatisticsData)
var AScore float64 = 0 var AScore float64 = 0
var BScore float64 = 0 var BScore float64 = 0
var CScore float64 = 0 var CScore float64 = 0
@ -543,6 +544,8 @@ func (t *TranscriptTableData) StatisticalResults(group string, orgCont hrsystem.
var planVersion assessmentmodel.PlanVersio var planVersion assessmentmodel.PlanVersio
err := global.GVA_DB_Performanceappraisal.Where("state = 1 AND department = ?", orgCont.Id).First(&planVersion).Error err := global.GVA_DB_Performanceappraisal.Where("state = 1 AND department = ?", orgCont.Id).First(&planVersion).Error
// fmt.Printf("planVersion------------>%v\n", planVersion)
// return
if err == nil { if err == nil {
var planVersioInfo []AddDutyNewCont var planVersioInfo []AddDutyNewCont
jsonErr := json.Unmarshal([]byte(planVersion.Content), &planVersioInfo) jsonErr := json.Unmarshal([]byte(planVersion.Content), &planVersioInfo)

589
api/index/statistics/queryresults.go

@ -0,0 +1,589 @@
package statistics
import (
"encoding/json"
"fmt"
"strconv"
"time"
"github.com/flipped-aurora/gin-vue-admin/server/api/statistics/quantification"
"github.com/flipped-aurora/gin-vue-admin/server/commonus"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/assessmentmodel"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/hrsystem"
"github.com/gin-gonic/gin"
)
// 计算成绩表
func (a *ApiGroup) Queryresults(c *gin.Context) {
isTrue, userCont := commonus.ClientIdentity()
if isTrue != true {
response.Result(101, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c)
return
}
var requestData TranscriptTable
c.ShouldBindJSON(&requestData)
//获取当前访问人的公司组织架构
var orgList []hrsystem.AdministrativeOrganization
gromDb := global.GVA_DB_HrDataBase.Model(&hrsystem.AdministrativeOrganization{}).Where("ispower = 1 AND state = 1 AND organization_type > 2")
if requestData.Group != "" {
gromDb = gromDb.Where("superior = ?", requestData.Group)
} else {
gromDb = gromDb.Where("superior = ?", userCont.Company)
}
if requestData.Department != "" {
gromDb = gromDb.Where("`id` = ?", requestData.Department)
}
err := gromDb.Find(&orgList).Error
if err != nil {
response.Result(102, err, "没有查询到数据", c)
return
}
if len(orgList) <= 0 {
response.Result(103, err, "没有查询到数据", c)
return
}
var orgAry []hrsystem.AdministrativeOrganization
for _, ov := range orgList {
sunOrgList, orgSunErr := getSunOrgList(ov.Id)
if orgSunErr == nil && len(sunOrgList) > 0 {
for _, sv := range sunOrgList {
orgAry = append(orgAry, sv)
}
} else {
orgAry = append(orgAry, ov)
}
}
//计算要查询的年份
currentYear := commonus.ComputingTime(time.Now().Unix(), 1)
todayYear := currentYear
if requestData.Year != "" {
yearInt64, _ := strconv.ParseInt(requestData.Year, 10, 64)
currentYear = yearInt64
}
//计算月
var monthTody []int64
if len(requestData.Month) < 1 {
if currentYear == todayYear {
monthTodyIng := commonus.ComputingTime(time.Now().Unix(), 3)
var montInt64 int64
for montInt64 = 1; montInt64 <= monthTodyIng; montInt64++ {
monthTody = append(monthTody, montInt64)
}
} else {
var montInt64All int64
for montInt64All = 1; montInt64All <= 12; montInt64All++ {
monthTody = append(monthTody, montInt64All)
}
}
} else {
for _, mmv := range requestData.Month {
monthTody = append(monthTody, int64(mmv))
}
}
//保证月份不为负数
if len(monthTody) < 1 {
monthTody = append(monthTody, 1)
}
/*
设定协程
遍历行政组织并发计算
*/
var deaprtmenTranscript TranscriptTableData
for _, v := range orgAry {
syncProcess.Add(1)
go deaprtmenTranscript.StaticticsDepartmentResult(userCont.Company, v, currentYear, monthTody)
}
syncProcess.Wait() //等待所有协程完毕
readStatisticsData := deaprtmenTranscript.readTranscriptData() //读取通道数据
fmt.Printf("readStatisticsData----------->%v\n", readStatisticsData)
var AScore float64 = 0
var BScore float64 = 0
var CScore float64 = 0
var DScore float64 = 0
var EScore float64 = 0
var FScore float64 = 0
var GScore float64 = 0
var HScore float64 = 0
var IScore float64 = 0
var JScore float64 = 0
var KScore float64 = 0
var LScore float64 = 0
jiBuQi := 0
var echarsList TranscriptTableDateListChars
var echarsListOrg TranscriptTableDateListChars
if len(requestData.Month) > 0 {
var monthAry []int
for i := 1; i <= 12; i++ {
if commonus.IsInTrue[int](i, requestData.Month) == true && commonus.IsInTrue[string](fmt.Sprintf("%v月", i), echarsList.XLine) == false {
echarsList.XLine = append(echarsList.XLine, fmt.Sprintf("%v月", i))
monthAry = append(monthAry, i)
echarsListOrg.Cylindrical = append(echarsListOrg.Cylindrical, fmt.Sprintf("%v月", i))
}
}
} else {
echarsList.XLine = append(echarsList.XLine, "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月")
}
var orgFen orgShierTongji
// var dfgfd []YlineData
for _, readv := range readStatisticsData {
AScore = AScore + readv.A
BScore = BScore + readv.B
CScore = CScore + readv.C
DScore = DScore + readv.D
EScore = EScore + readv.E
FScore = FScore + readv.F
GScore = GScore + readv.G
HScore = HScore + readv.H
IScore = IScore + readv.I
JScore = JScore + readv.J
KScore = KScore + readv.K
LScore = LScore + readv.L
jiBuQi++
echarsList.Cylindrical = append(echarsList.Cylindrical, readv.Department)
echarsListOrg.XLine = append(echarsListOrg.XLine, readv.Department)
var cyLineAry_1 YlineData
cyLineAry_1.Name = readv.Department
// var yZhoue YlineData
if readv.A == -10000 {
readv.A = 0
}
if readv.B == -10000 {
readv.B = 0
}
if readv.C == -10000 {
readv.C = 0
}
if readv.D == -10000 {
readv.D = 0
}
if readv.E == -10000 {
readv.E = 0
}
if readv.F == -10000 {
readv.F = 0
}
if readv.G == -10000 {
readv.G = 0
}
if readv.H == -10000 {
readv.H = 0
}
if readv.I == -10000 {
readv.I = 0
}
if readv.J == -10000 {
readv.J = 0
}
if readv.K == -10000 {
readv.K = 0
}
if readv.L == -10000 {
readv.L = 0
}
if len(requestData.Month) > 0 {
if commonus.IsInTrue[int](1, requestData.Month) == true {
// echarsList.XLine = append(echarsList.XLine, fmt.Sprintf("%v月", 1))
cyLineAry_1.Data = append(cyLineAry_1.Data, readv.A)
}
if commonus.IsInTrue[int](2, requestData.Month) == true {
// echarsList.XLine = append(echarsList.XLine, fmt.Sprintf("%v月", 2))
cyLineAry_1.Data = append(cyLineAry_1.Data, readv.B)
}
if commonus.IsInTrue[int](3, requestData.Month) == true {
// echarsList.XLine = append(echarsList.XLine, fmt.Sprintf("%v月", 3))
cyLineAry_1.Data = append(cyLineAry_1.Data, readv.C)
}
if commonus.IsInTrue[int](4, requestData.Month) == true {
// echarsList.XLine = append(echarsList.XLine, fmt.Sprintf("%v月", 4))
cyLineAry_1.Data = append(cyLineAry_1.Data, readv.D)
}
if commonus.IsInTrue[int](5, requestData.Month) == true {
// echarsList.XLine = append(echarsList.XLine, fmt.Sprintf("%v月", 5))
cyLineAry_1.Data = append(cyLineAry_1.Data, readv.E)
}
if commonus.IsInTrue[int](6, requestData.Month) == true {
// echarsList.XLine = append(echarsList.XLine, fmt.Sprintf("%v月", 6))
cyLineAry_1.Data = append(cyLineAry_1.Data, readv.F)
}
if commonus.IsInTrue[int](7, requestData.Month) == true {
// echarsList.XLine = append(echarsList.XLine, fmt.Sprintf("%v月", 7))
cyLineAry_1.Data = append(cyLineAry_1.Data, readv.G)
}
if commonus.IsInTrue[int](8, requestData.Month) == true {
// echarsList.XLine = append(echarsList.XLine, fmt.Sprintf("%v月", 8))
cyLineAry_1.Data = append(cyLineAry_1.Data, readv.H)
}
if commonus.IsInTrue[int](9, requestData.Month) == true {
// echarsList.XLine = append(echarsList.XLine, fmt.Sprintf("%v月", 9))
cyLineAry_1.Data = append(cyLineAry_1.Data, readv.I)
}
if commonus.IsInTrue[int](10, requestData.Month) == true {
// echarsList.XLine = append(echarsList.XLine, fmt.Sprintf("%v月", 10))
cyLineAry_1.Data = append(cyLineAry_1.Data, readv.J)
}
if commonus.IsInTrue[int](11, requestData.Month) == true {
// echarsList.XLine = append(echarsList.XLine, fmt.Sprintf("%v月", 11))
cyLineAry_1.Data = append(cyLineAry_1.Data, readv.K)
}
if commonus.IsInTrue[int](12, requestData.Month) == true {
// echarsList.XLine = append(echarsList.XLine, fmt.Sprintf("%v月", 12))
cyLineAry_1.Data = append(cyLineAry_1.Data, readv.L)
}
} else {
cyLineAry_1.Data = append(cyLineAry_1.Data, readv.A, readv.B, readv.C, readv.D, readv.E, readv.F, readv.G, readv.H, readv.I, readv.J, readv.K, readv.L)
// cyLineAry_2.Data = append(cyLineAry_1.Data, readv.A, readv.B, readv.C, readv.D, readv.E, readv.F, readv.G, readv.H, readv.I, readv.J, readv.K, readv.L)
}
orgFen.A = append(orgFen.A, readv.A)
orgFen.B = append(orgFen.B, readv.B)
orgFen.C = append(orgFen.C, readv.C)
orgFen.D = append(orgFen.D, readv.D)
orgFen.E = append(orgFen.E, readv.E)
orgFen.F = append(orgFen.F, readv.F)
orgFen.G = append(orgFen.G, readv.G)
orgFen.H = append(orgFen.H, readv.H)
orgFen.I = append(orgFen.I, readv.I)
orgFen.J = append(orgFen.J, readv.J)
orgFen.K = append(orgFen.K, readv.K)
orgFen.L = append(orgFen.L, readv.L)
echarsList.YLine = append(echarsList.YLine, cyLineAry_1)
// echarsListOrg.YLine = append(echarsListOrg.YLine, cyLineAry_2)
}
if jiBuQi > 0 {
var pingJunFen TranscriptTableDateList
pingJunFen.DepartmentId = "0"
pingJunFen.Department = "平均分"
pingJunFen.A = commonus.Decimal(AScore / float64(jiBuQi))
pingJunFen.B = commonus.Decimal(BScore / float64(jiBuQi))
pingJunFen.C = commonus.Decimal(CScore / float64(jiBuQi))
pingJunFen.D = commonus.Decimal(DScore / float64(jiBuQi))
pingJunFen.E = commonus.Decimal(EScore / float64(jiBuQi))
pingJunFen.F = commonus.Decimal(FScore / float64(jiBuQi))
pingJunFen.G = commonus.Decimal(GScore / float64(jiBuQi))
pingJunFen.H = commonus.Decimal(HScore / float64(jiBuQi))
pingJunFen.I = commonus.Decimal(IScore / float64(jiBuQi))
pingJunFen.J = commonus.Decimal(JScore / float64(jiBuQi))
pingJunFen.K = commonus.Decimal(KScore / float64(jiBuQi))
pingJunFen.L = commonus.Decimal(LScore / float64(jiBuQi))
readStatisticsData = append(readStatisticsData, pingJunFen)
}
var monthInt []int
if len(requestData.Month) <= 0 {
for dkj := 1; dkj <= 12; dkj++ {
monthInt = append(monthInt, dkj)
}
} else {
monthInt = requestData.Month
}
for _, mvv := range monthInt {
switch mvv {
case 1:
var cyLineAry_2 YlineData
cyLineAry_2.Name = "1月"
cyLineAry_2.Data = orgFen.A
echarsListOrg.YLine = append(echarsListOrg.YLine, cyLineAry_2)
case 2:
var cyLineAry_2 YlineData
cyLineAry_2.Name = "2月"
cyLineAry_2.Data = orgFen.B
echarsListOrg.YLine = append(echarsListOrg.YLine, cyLineAry_2)
case 3:
var cyLineAry_2 YlineData
cyLineAry_2.Name = "3月"
cyLineAry_2.Data = orgFen.C
echarsListOrg.YLine = append(echarsListOrg.YLine, cyLineAry_2)
case 4:
var cyLineAry_2 YlineData
cyLineAry_2.Name = "4月"
cyLineAry_2.Data = orgFen.D
echarsListOrg.YLine = append(echarsListOrg.YLine, cyLineAry_2)
case 5:
var cyLineAry_2 YlineData
cyLineAry_2.Name = "5月"
cyLineAry_2.Data = orgFen.E
echarsListOrg.YLine = append(echarsListOrg.YLine, cyLineAry_2)
case 6:
var cyLineAry_2 YlineData
cyLineAry_2.Name = "6月"
cyLineAry_2.Data = orgFen.F
echarsListOrg.YLine = append(echarsListOrg.YLine, cyLineAry_2)
case 7:
var cyLineAry_2 YlineData
cyLineAry_2.Name = "7月"
cyLineAry_2.Data = orgFen.G
echarsListOrg.YLine = append(echarsListOrg.YLine, cyLineAry_2)
case 8:
var cyLineAry_2 YlineData
cyLineAry_2.Name = "8月"
cyLineAry_2.Data = orgFen.H
echarsListOrg.YLine = append(echarsListOrg.YLine, cyLineAry_2)
case 9:
var cyLineAry_2 YlineData
cyLineAry_2.Name = "9月"
cyLineAry_2.Data = orgFen.I
echarsListOrg.YLine = append(echarsListOrg.YLine, cyLineAry_2)
case 10:
var cyLineAry_2 YlineData
cyLineAry_2.Name = "10月"
cyLineAry_2.Data = orgFen.G
echarsListOrg.YLine = append(echarsListOrg.YLine, cyLineAry_2)
case 11:
var cyLineAry_2 YlineData
cyLineAry_2.Name = "11月"
cyLineAry_2.Data = orgFen.K
echarsListOrg.YLine = append(echarsListOrg.YLine, cyLineAry_2)
case 12:
var cyLineAry_2 YlineData
cyLineAry_2.Name = "12月"
cyLineAry_2.Data = orgFen.L
echarsListOrg.YLine = append(echarsListOrg.YLine, cyLineAry_2)
}
}
outData := commonus.MapOut()
outData["readStatisticsData"] = readStatisticsData
outData["echarsList"] = echarsList
outData["echarsListOrg"] = echarsListOrg
response.Result(0, outData, "查询完成", c)
}
// 获取下级行政组织是否有主行政部门
func getSunOrgList(orgId int64) (orgList []hrsystem.AdministrativeOrganization, ovErr error) {
ovErr = global.GVA_DB_HrDataBase.Where("state = 1").Where("ispower = 1 AND superior = ?", orgId).Find(&orgList).Error
return
}
/*
统计部门月度成绩
@group 集团
@orgCont 行政组织相关信息
@year 查询的年份
@month 查询月份边界
*/
func (t *TranscriptTableData) StaticticsDepartmentResult(group string, orgCont hrsystem.AdministrativeOrganization, year int64, month []int64) {
/*
锁操作
*/
t.mutext.Lock()
defer t.mutext.Unlock()
groupId, _ := strconv.ParseInt(group, 10, 64)
//获取要计算部门当前执行的考核方案表
var planVersionInfo assessmentmodel.PlanVersio
err := global.GVA_DB_Performanceappraisal.Where("state = 1 AND department = ?", orgCont.Id).First(&planVersionInfo).Error
if err == nil {
//将考核方案解析
var planVersioInfo []AddDutyNewCont
jsonErr := json.Unmarshal([]byte(planVersionInfo.Content), &planVersioInfo)
if jsonErr == nil {
var pingJunFen TranscriptTableDateList
pingJunFen.DepartmentId = strconv.FormatInt(orgCont.Id, 10)
pingJunFen.Department = orgCont.Name
// var i int64
var everyMonthScore countEveryDepartmentMonthScore
// for i = 1; i <= month; i++ {
// syncProcessDepartTarget.Add(1)
// //按月份计算
// go everyMonthScore.everyMonthCalculate(groupId, orgCont.Id, year, i, planVersioInfo)
// }
for _, v := range month {
syncProcessDepartTarget.Add(1)
//按月份计算
go everyMonthScore.everyMonthCalculate(groupId, orgCont.Id, year, v, planVersioInfo)
}
syncProcessDepartTarget.Wait()
everyMonthScoreList := everyMonthScore.readMyDayData()
for _, emslv := range everyMonthScoreList {
fmt.Printf("emslv---->%v\n", emslv)
switch emslv.MonthVal {
case 1:
pingJunFen.A = emslv.Score
case 2:
pingJunFen.B = emslv.Score
case 3:
pingJunFen.C = emslv.Score
case 4:
pingJunFen.D = emslv.Score
case 5:
pingJunFen.E = emslv.Score
case 6:
pingJunFen.F = emslv.Score
case 7:
pingJunFen.G = emslv.Score
case 8:
pingJunFen.H = emslv.Score
case 9:
pingJunFen.I = emslv.Score
case 10:
pingJunFen.J = emslv.Score
case 11:
pingJunFen.K = emslv.Score
case 12:
pingJunFen.L = emslv.Score
default:
}
}
var monthIsFalse int64
for monthIsFalse = 1; monthIsFalse <= 12; monthIsFalse++ {
if commonus.IsInTrue[int64](monthIsFalse, month) == false {
switch monthIsFalse {
case 1:
pingJunFen.A = -10000
case 2:
pingJunFen.B = -10000
case 3:
pingJunFen.C = -10000
case 4:
pingJunFen.D = -10000
case 5:
pingJunFen.E = -10000
case 6:
pingJunFen.F = -10000
case 7:
pingJunFen.G = -10000
case 8:
pingJunFen.H = -10000
case 9:
pingJunFen.I = -10000
case 10:
pingJunFen.J = -10000
case 11:
pingJunFen.K = -10000
case 12:
pingJunFen.L = -10000
default:
}
}
}
// if month < 12 {
// beginLostMonth := month + 1
// for ; beginLostMonth <= 12; beginLostMonth++ {
// switch beginLostMonth {
// case 1:
// pingJunFen.A = -10000
// case 2:
// pingJunFen.B = -10000
// case 3:
// pingJunFen.C = -10000
// case 4:
// pingJunFen.D = -10000
// case 5:
// pingJunFen.E = -10000
// case 6:
// pingJunFen.F = -10000
// case 7:
// pingJunFen.G = -10000
// case 8:
// pingJunFen.H = -10000
// case 9:
// pingJunFen.I = -10000
// case 10:
// pingJunFen.J = -10000
// case 11:
// pingJunFen.K = -10000
// case 12:
// pingJunFen.L = -10000
// default:
// }
// }
// }
fmt.Printf("month---->%v\n", pingJunFen)
t.ScoreStatistics = append(t.ScoreStatistics, pingJunFen)
}
}
syncProcess.Done() //结束本协程
}
/*
按月份统计部门总成绩
@groupId 集团ID
@orgId 行政组织ID
@year
@month
@planVersion 部门当前执行的考核版本
*/
func (c *countEveryDepartmentMonthScore) everyMonthCalculate(groupId, orgId, year, month int64, planVersion []AddDutyNewCont) {
/*
锁操作
*/
c.mutext.Lock()
defer c.mutext.Unlock()
var weiDuScore float64 = 0 //维度分值
var zhiBiaoScore float64 = 0 //指标标准分值
var sumScore float64 = 0 //计算得分
for _, v := range planVersion { //维度
weiDuScore = weiDuScore + float64(v.ZhiFraction)
for _, sv := range v.Child { //指标
zhiBiaoScore = zhiBiaoScore + float64(sv.ReferenceScore)
if sv.Status == 3 {
sumScore = sumScore + float64(sv.ReferenceScore)
} else {
if sv.Status == 1 && sv.Status != 3 { //判断指标是否启用并且不是观察指标
var targetInfo assessmentmodel.EvaluationTarget
targetInfo.GetCont(map[string]interface{}{"et_id": sv.Id}, "et_type,et_cycle")
if sv.Cycles == 0 { //判断统计方式
sv.Cycles = targetInfo.Cycles
}
if targetInfo.Type == 1 { //定性考核
countScore, _ := quantification.DingXingMonthSum(groupId, orgId, sv.ReferenceScore, year, month, sv.Id, sv.Cycles, sv.Status)
sumScore = sumScore + countScore
} else { //定量考核
countScores, _ := quantification.DingLiangMonthSum(groupId, orgId, sv.ReferenceScore, year, month, sv.Id, sv.Cycles, sv.Status)
sumScore = sumScore + countScores
}
// switch sv.Cycles {
// case 5: //季度统计
// case 6: //年统计
// case 7: //半年统计
// default: //月度统计
// if targetInfo.Type == 1 { //定性考核
// countScore, _ := quantification.DingXingMonthSum(groupId, orgId, sv.ReferenceScore, year, month, sv.Id, sv.Cycles, sv.Status)
// sumScore = sumScore + countScore
// } else { //定量考核
// countScores, _ := quantification.DingLiangMonthSum(groupId, orgId, sv.ReferenceScore, year, month, sv.Id, sv.Cycles, sv.Status)
// sumScore = sumScore + countScores
// }
// }
}
}
}
}
var everyMonthScoreInfo everyDepartmentScore
everyMonthScoreInfo.MonthVal = month
everyMonthScoreInfo.Score = commonus.Decimal(sumScore)
c.outData = append(c.outData, everyMonthScoreInfo)
syncProcessDepartTarget.Done() //结束本协程
}

3
api/statistics/quantification/enter.go

@ -193,6 +193,8 @@ type dingLiangKaoHe struct {
Actual float64 `json:"actual"` //实际值 Actual float64 `json:"actual"` //实际值
CompletionRate float64 `json:"completionrate"` //达成率 CompletionRate float64 `json:"completionrate"` //达成率
Score float64 `json:"score"` //得分 Score float64 `json:"score"` //得分
MtOrAt int `json:"mtorat"` //手动还是自动
Cont string `json:"count"` //说明
} }
// 定性记录列表 // 定性记录列表
@ -201,6 +203,7 @@ type dingXingLogScoreList struct {
Score float64 `json:"score"` Score float64 `json:"score"`
Time string `json:"time"` Time string `json:"time"`
EvalUserCont []EvalUserContStruct `json:"evalusercont"` EvalUserCont []EvalUserContStruct `json:"evalusercont"`
Cont string `json:"count"` //说明
} }
type EvalUserContStruct struct { type EvalUserContStruct struct {

62
api/statistics/quantification/summary_details.go

@ -38,7 +38,7 @@ func (a *ApiGroup) SummaryDetails(c *gin.Context) {
} }
//获取部门版本 //获取部门版本
var planVersion assessmentmodel.PlanVersio var planVersion assessmentmodel.PlanVersio
pvErr := global.GVA_DB_Performanceappraisal.Where("department = ? AND state = 1", requestData.Department).First(&planVersion).Error pvErr := global.GVA_DB_Performanceappraisal.Where("department = ? AND state = 1", requestData.Department).Order("department desc").First(&planVersion).Error
if pvErr != nil { if pvErr != nil {
response.Result(103, err, "没有查询到数据!", c) response.Result(103, err, "没有查询到数据!", c)
return return
@ -58,7 +58,7 @@ func (a *ApiGroup) SummaryDetails(c *gin.Context) {
var lookStatistics []detailedResultsList var lookStatistics []detailedResultsList
for _, v := range planVersionCont { //维度 for _, v := range planVersionCont { //维度
for _, cv := range v.Child { //指标 for _, cv := range v.Child { //指标
// if cv.Id == "18" { // if cv.Id == "50" {
var statisCont detailedResultsList var statisCont detailedResultsList
statisCont.GroupId = strconv.FormatInt(planVersion.Group, 10) //集团Id statisCont.GroupId = strconv.FormatInt(planVersion.Group, 10) //集团Id
var groupCont hrsystem.AdministrativeOrganization var groupCont hrsystem.AdministrativeOrganization
@ -80,10 +80,10 @@ func (a *ApiGroup) SummaryDetails(c *gin.Context) {
targetErr := evalTargetCont.GetCont(map[string]interface{}{"`et_id`": cv.Id}, "et_type") targetErr := evalTargetCont.GetCont(map[string]interface{}{"`et_id`": cv.Id}, "et_type")
if targetErr == nil { if targetErr == nil {
if evalTargetCont.Type == 1 { if evalTargetCont.Type == 1 {
statisCont.Score, statisCont.ExecutiveDepartment = dingXingMonthSum(planVersion.Group, planVersion.Department, cv.ReferenceScore, requestData.Year, int64(requestData.Months), cv.Id, cv.Cycles, cv.Status) statisCont.Score, statisCont.ExecutiveDepartment = DingXingMonthSum(planVersion.Group, planVersion.Department, cv.ReferenceScore, requestData.Year, int64(requestData.Months), cv.Id, cv.Cycles, cv.Status)
sumScore = sumScore + statisCont.Score sumScore = sumScore + statisCont.Score
} else { } else {
statisCont.Score, statisCont.ExecutiveDepartment = dingLiangMonthSum(planVersion.Group, planVersion.Department, cv.ReferenceScore, requestData.Year, int64(requestData.Months), cv.Id, cv.Cycles, cv.Status) statisCont.Score, statisCont.ExecutiveDepartment = DingLiangMonthSum(planVersion.Group, planVersion.Department, cv.ReferenceScore, requestData.Year, int64(requestData.Months), cv.Id, cv.Cycles, cv.Status)
sumScore = sumScore + statisCont.Score sumScore = sumScore + statisCont.Score
} }
@ -112,7 +112,17 @@ func (a *ApiGroup) SummaryDetails(c *gin.Context) {
} }
// 定性月份分值合计 // 定性月份分值合计
func dingXingMonthSum(groupId, departmentId, weight, year, month int64, targetId string, cycs, status int) (score float64, EvalDepartment []string) { /*
@groupId 集团
@departmentId 部门
@weight 权重
@year
@month
@targetId 指标ID
@cycs 12345季度6
@status 1启用2禁用3观察
*/
func DingXingMonthSum(groupId, departmentId, weight, year, month int64, targetId string, cycs, status int) (score float64, EvalDepartment []string) {
//获取减分 //获取减分
var minusPoints float64 = 0 var minusPoints float64 = 0
@ -168,10 +178,24 @@ func dingXingMonthSum(groupId, departmentId, weight, year, month int64, targetId
} }
// 获取定量考核分值 // 获取定量考核分值
func dingLiangMonthSum(groupId, departmentId, weight, year, month int64, targetId string, cycs, status int) (score float64, EvalDepartment []string) { /*
@groupId 集团
@departmentId 部门
@weight 权重
@year
@month
@targetId 指标ID
@cycs 12345季度6
@status 1启用2禁用3观察
*/
func DingLiangMonthSum(groupId, departmentId, weight, year, month int64, targetId string, cycs, status int) (score float64, EvalDepartment []string) {
var flowDataLog []assessmentmodel.FlowDataLogType var flowDataLog []assessmentmodel.FlowDataLogType
err := global.GVA_DB_Performanceappraisal.Where("`group` = ? AND `department` = ? AND `year` = ? AND `month` = ? AND `targetid` = ?", groupId, departmentId, year, month, targetId).Find(&flowDataLog).Error err := global.GVA_DB_Performanceappraisal.Where("`group` = ? AND `department` = ? AND `year` = ? AND `month` = ? AND `targetid` = ?", groupId, departmentId, year, month, targetId).Find(&flowDataLog).Error
if err != nil {
fmt.Printf("err ------flowDataLog------>%v------>%v\n", err, flowDataLog)
if err != nil || len(flowDataLog) < 1 {
score = float64(weight)
return return
} }
var sumScore float64 = 0 var sumScore float64 = 0
@ -377,15 +401,23 @@ func (a *ApiGroup) SummaryDetailsLiangLog(c *gin.Context) {
// response.Result(103, err, "没有查询到数据!", c) // response.Result(103, err, "没有查询到数据!", c)
// return // return
// } // }
var list []dingLiangKaoHe
//获取定量考核数据列表 //获取定量考核数据列表
var flowDataLog []assessmentmodel.FlowDataLogType var flowDataLog []assessmentmodel.FlowDataLogType
flowErr := global.GVA_DB_Performanceappraisal.Where("`department` = ? AND `targetid` = ? AND `year` = ? AND `month` = ?", requestData.Department, requestData.TargetId, requestData.Year, requestData.Months).Find(&flowDataLog).Error flowErr := global.GVA_DB_Performanceappraisal.Where("`department` = ? AND `targetid` = ? AND `year` = ? AND `month` = ?", requestData.Department, requestData.TargetId, requestData.Year, requestData.Months).Find(&flowDataLog).Error
if flowErr != nil { if flowErr != nil {
//获取部门现行考核版本
var departPlanVersion assessmentmodel.PlanVersio
dpvErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.PlanVersio{}).Where("`state` = 1 AND `department` = ?", requestData.Department).First(&departPlanVersion).Error
if dpvErr == nil {
} else {
response.Result(104, err, "没有查询到数据!", c) response.Result(104, err, "没有查询到数据!", c)
return return
} }
var list []dingLiangKaoHe
}
for _, v := range flowDataLog { for _, v := range flowDataLog {
_, targetScore, status, cycle, _ := getPlanVersion(v.Edition, strconv.FormatInt(v.TargetId, 10)) _, targetScore, status, cycle, _ := getPlanVersion(v.Edition, strconv.FormatInt(v.TargetId, 10))
var listCont dingLiangKaoHe var listCont dingLiangKaoHe
@ -393,11 +425,15 @@ func (a *ApiGroup) SummaryDetailsLiangLog(c *gin.Context) {
if v.ScoringMethod == 1 { if v.ScoringMethod == 1 {
listCont.Actual = float64(v.Score) listCont.Actual = float64(v.Score)
settlementScore = float64(v.Score) settlementScore = float64(v.Score)
listCont.Score, listCont.Allprize, listCont.Zeroprize, listCont.Capping, listCont.CompletionRate = analysisReward(strconv.FormatInt(v.TargetId, 10), v.Baseline, targetScore, settlementScore)
} else { } else {
listCont.Actual = float64(v.ScoringScore) listCont.Actual = float64(v.ScoringScore)
settlementScore = float64(v.ScoringScore) // settlementScore = float64(v.ScoringScore)
_, listCont.Allprize, listCont.Zeroprize, listCont.Capping, listCont.CompletionRate = analysisReward(strconv.FormatInt(v.TargetId, 10), v.Baseline, targetScore, settlementScore)
listCont.Score = float64(v.ScoringScore)
} }
listCont.MtOrAt = v.ScoringMethod
listCont.Cont = v.Content
//获取定量流水全奖、零奖、封顶值 //获取定量流水全奖、零奖、封顶值
/* /*
@targetId 指标ID @targetId 指标ID
@ -412,7 +448,7 @@ func (a *ApiGroup) SummaryDetailsLiangLog(c *gin.Context) {
@achievement 达成率 @achievement 达成率
*/ */
// func analysisReward(targetId, rewardCont string, targetScore, settlementScore float64) (scoreVal, allPrize, zeroPrize, CappingVal, achievement float64) // func analysisReward(targetId, rewardCont string, targetScore, settlementScore float64) (scoreVal, allPrize, zeroPrize, CappingVal, achievement float64)
listCont.Score, listCont.Allprize, listCont.Zeroprize, listCont.Capping, listCont.CompletionRate = analysisReward(strconv.FormatInt(v.TargetId, 10), v.Baseline, targetScore, settlementScore)
if status == 3 { if status == 3 {
listCont.Score = targetScore listCont.Score = targetScore
} }
@ -516,7 +552,7 @@ func (a *ApiGroup) SummaryDetailsXingLog(c *gin.Context) {
myCong.GetCont(map[string]interface{}{"`key`": v.EvaluationUser}, "`name`") myCong.GetCont(map[string]interface{}{"`key`": v.EvaluationUser}, "`name`")
evalUser.UserName = myCong.Name evalUser.UserName = myCong.Name
} }
flowScoreCont.Cont = v.Reason
flowScoreCont.EvalUserCont = append(flowScoreCont.EvalUserCont, evalUser) flowScoreCont.EvalUserCont = append(flowScoreCont.EvalUserCont, evalUser)
flowScoreList = append(flowScoreList, flowScoreCont) flowScoreList = append(flowScoreList, flowScoreCont)
} }

43
api/v1/positionkpi/entry.go

@ -106,6 +106,8 @@ type postContList struct {
Evidence string `json:"evidence"` //客观证据 Evidence string `json:"evidence"` //客观证据
Explain string `json:"explain"` //备注说明 Explain string `json:"explain"` //备注说明
ReportAry []string `json:"reportary"` //提报人 ReportAry []string `json:"reportary"` //提报人
PunishMode int `json:"punishmode"` //处罚方式 1:扣分;2:现金处罚;3:扣分加现金
CashStandard string `json:"cashstandard"` //现金标准
} }
// 查看岗位定性考核细则列表 // 查看岗位定性考核细则列表
@ -136,3 +138,44 @@ type editTargetPostData struct {
idType idType
PostId []string `json:"postid"` PostId []string `json:"postid"`
} }
// 输出岗位子栏目
type sunPostTergetCont struct {
assessmentmodel.PostSunTarget
DepartmentId string `json:"departmentid"` //行政组织
PostId []string `json:"postid"`
Departmentmap []departmentmap `json:"departmentmap"`
}
// 获取修改定性考核子栏目的参数
type getDingXingSunTaget struct {
idType
Title string `json:"title"`
DepartmentId string `json:"departmentid"` //行政组织
PostId []string `json:"postid"` //岗位
ReportAry []string `json:"reportary"` //提报人
}
// 单一添加定性考核详细细则
type oneAddDetails struct {
SunTargetId string `json:"suntargetid"` //栏目id
postContList
PostId []string `json:"postid"` //岗位
}
// 输出定性考核细则内容
type outDetailsCont struct {
assessmentmodel.PostTargetDetails
ScoreStandard string `json:"scorestandard"` //考核标准
InspMethod []string `json:"inspmethod"` //检查方式(1:现场检查;2:资料检查;3:事件触发)
PostAry []idAndName `json:"postary"` //岗位
ReportAry []reportUser `json:"reportary"` //提报人
CashStandard string `json:"cashstandard"` //现金标准
}
// 修改指标细则
type editPostDetails struct {
Id string `json:"id"` //栏目id
postContList
PostId []string `json:"postid"` //岗位
}

27
api/v1/positionkpi/posttarget.go

@ -215,9 +215,34 @@ func (a *ApiMethod) EditState(c *gin.Context) {
} }
} }
} }
if postTargetCont.Type == 1 {
if requestData.State != 3 {
eidtDingXing(postTargetCont.Id, requestData.State)
} else {
if requestData.IsTrue == 1 {
var postSunTargetInfo assessmentmodel.PostSunTarget
postSunTargetInfo.DelCont(map[string]interface{}{"`parent_id`": postTargetCont.Id})
var postDetailsInfo assessmentmodel.PostTargetDetails
postDetailsInfo.DelCont(map[string]interface{}{"`parent_id`": postTargetCont.Id})
} else {
eidtDingXing(postTargetCont.Id, requestData.State)
}
}
}
response.Result(0, saveData, "数据编辑成功!", c) response.Result(0, saveData, "数据编辑成功!", c)
} }
// 编辑定性考核关联项目
/*
*/
func eidtDingXing(postTarKey int64, delVal int) {
var postSunTargetInfo assessmentmodel.PostSunTarget
postSunTargetInfo.EditCont(map[string]interface{}{"`parent_id`": postTarKey}, map[string]interface{}{"`state`": delVal, "`time`": time.Now().Unix()})
var postDetailsInfo assessmentmodel.PostTargetDetails
postDetailsInfo.EditCont(map[string]interface{}{"`parentid`": postTarKey}, map[string]interface{}{"`state`": delVal, "`time`": time.Now().Unix()})
}
// 岗位指标列表 // 岗位指标列表
func (a *ApiMethod) PostTargetList(c *gin.Context) { func (a *ApiMethod) PostTargetList(c *gin.Context) {
var requestData postTargetList var requestData postTargetList
@ -312,5 +337,3 @@ func (a *ApiMethod) PostTargetList(c *gin.Context) {
printData := commonus.OutPutList(total, int64(countSum), requestData.Page, requestData.PageSize, postTargetListAry) printData := commonus.OutPutList(total, int64(countSum), requestData.Page, requestData.PageSize, postTargetListAry)
response.Result(0, printData, "查询成功!", c) response.Result(0, printData, "查询成功!", c)
} }
//

583
api/v1/positionkpi/posttargetcont.go

@ -172,6 +172,26 @@ func (a *ApiMethod) AddPostTargetCont(c *gin.Context) {
maxScoreInt = 0 maxScoreInt = 0
} }
var minMoney int64 //罚款或奖励最高金额
var maxMoney int64 //罚款或奖励最新金额
moneyAry := strings.Split(lv.CashStandard, "-")
moneyAryLen := len(moneyAry)
if moneyAryLen > 0 {
if moneyAryLen == 1 {
maxMoneyEs, _ := strconv.ParseFloat(moneyAry[0], 64)
maxMoney, _ = strconv.ParseInt(strconv.FormatFloat(maxMoneyEs*100, 'f', -1, 64), 10, 64)
minMoney = 0
} else {
maxMoneyEs, _ := strconv.ParseFloat(moneyAry[moneyAryLen-1], 64)
maxMoney, _ = strconv.ParseInt(strconv.FormatFloat(maxMoneyEs*100, 'f', -1, 64), 10, 64)
minMoneyEs, _ := strconv.ParseFloat(moneyAry[0], 64)
minMoney, _ = strconv.ParseInt(strconv.FormatFloat(minMoneyEs*100, 'f', -1, 64), 10, 64)
}
} else {
minMoney = 0
maxMoney = 0
}
var saveCont assessmentmodel.PostTargetDetails var saveCont assessmentmodel.PostTargetDetails
saveCont.Title = lv.Title //指标细则"` saveCont.Title = lv.Title //指标细则"`
saveCont.Content = lv.Explain //备注说明"` saveCont.Content = lv.Explain //备注说明"`
@ -190,6 +210,12 @@ func (a *ApiMethod) AddPostTargetCont(c *gin.Context) {
saveCont.CycleAttres = lv.CycleAttr //辅助计数"` saveCont.CycleAttres = lv.CycleAttr //辅助计数"`
saveCont.Paretment = deartmentIdInt //接受考核的部门"` saveCont.Paretment = deartmentIdInt //接受考核的部门"`
saveCont.ParetmentPost = strings.Join(requestData.PostId, ",") //接受考核的部门岗位"` saveCont.ParetmentPost = strings.Join(requestData.PostId, ",") //接受考核的部门岗位"`
saveCont.Reportary = strings.Join(lv.ReportAry, ",") //接受考核的部门岗位"`
saveCont.Punishmode = lv.PunishMode //处罚或奖励方式 1:分数;2:现金;3:分数加现金
saveCont.Minmoney = minMoney //最高罚款*100保存"`
saveCont.Maxmoney = maxMoney //最低罚款*100保存"`
saveData = append(saveData, saveCont) saveData = append(saveData, saveCont)
} }
if len(saveData) < 1 { if len(saveData) < 1 {
@ -282,7 +308,7 @@ func (a *ApiMethod) PostTargetSunList(c *gin.Context) {
total = 0 total = 0
} }
err := gormDb.Order("`id` desc").Limit(requestData.PageSize).Offset(commonus.CalculatePages(requestData.Page, requestData.PageSize)).Find(&postDetails).Error err := gormDb.Order("`parentid_sun` asc").Order("`id` desc").Limit(requestData.PageSize).Offset(commonus.CalculatePages(requestData.Page, requestData.PageSize)).Find(&postDetails).Error
if err != nil { if err != nil {
response.Result(103, err.Error(), "没有数据!", c) response.Result(103, err.Error(), "没有数据!", c)
return return
@ -338,15 +364,560 @@ func (a *ApiMethod) EditPostTargetQual(c *gin.Context) {
return return
} }
if requestData.Id == "" { if requestData.Id == "" {
response.Result(100, err, "您的请求数据不合法", c) response.Result(101, err, "您的请求数据不合法", c)
return
}
if len(requestData.PostId) < 1 {
response.Result(102, err, "请指定要关联的岗位", c)
return
}
postAryStr := strings.Join(requestData.PostId, ",")
where := commonus.MapOut()
where["`id`"] = requestData.Id
var postTargetInfo assessmentmodel.PostTarget
postTarErr := postTargetInfo.EditCont(where, map[string]interface{}{"departments_post": postAryStr})
if postTarErr == nil {
var sunPostTerget assessmentmodel.PostSunTarget
sunPostTerget.EditCont(map[string]interface{}{"parent_id": requestData.Id}, map[string]interface{}{"depart_post": postAryStr})
var postTarDeta assessmentmodel.PostTargetDetails
postTarDeta.EditCont(map[string]interface{}{"parentid": requestData.Id}, map[string]interface{}{"paretment_post": postAryStr})
} else {
response.Result(103, err, "修改失败!", c)
return
}
response.Result(0, err, "修改完成", c)
}
// 获取子栏目内容
func (a *ApiMethod) GetSunTargetInfo(c *gin.Context) {
var requestData idType
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(100, err, "数据格式不正确!", c)
return
}
if requestData.Id == "" {
response.Result(101, err, "您的请求数据不合法", c)
return
}
var sunTargetCont sunPostTergetCont
getErr := sunTargetCont.GetCont(map[string]interface{}{"`id`": requestData.Id})
if getErr != nil {
response.Result(102, err, "此栏目不存在!请检查数据!", c)
return
}
sunTargetCont.DepartmentId = strconv.FormatInt(sunTargetCont.Depart, 10)
sunTargetCont.PostId = strings.Split(sunTargetCont.DepartPost, ",")
var reporManList []string
manListErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.PostTargetDetails{}).Select("`reportary` ").Where("`parentid` = ? AND `parentid_sun` = ? AND `paretment` = ?").First(&reporManList).Error
if manListErr == nil {
var manList []string
if len(reporManList) > 0 {
for _, v := range reporManList {
detMan := strings.Split(v, ",")
if len(detMan) > 0 {
for _, mv := range detMan {
if commonus.IsInTrue[string](mv, manList) == false {
manList = append(manList, mv)
}
}
}
}
}
if len(manList) > 0 {
var manContList []hrsystem.PersonArchives
manErr := global.GVA_DB_HrDataBase.Model(&hrsystem.PersonArchives{}).Select("`key`,`name`").Where("`key` IN ?", manList).Find(&manContList).Error
if manErr == nil {
for _, mcv := range manContList {
var manInfo departmentmap
manInfo.Parentid = strconv.FormatInt(mcv.Key, 10)
manInfo.Parentname = mcv.Name
sunTargetCont.Departmentmap = append(sunTargetCont.Departmentmap, manInfo)
}
}
}
}
response.Result(102, sunTargetCont, "此栏目不存在!请检查数据!", c)
}
// 编辑定性考核子栏目
func (a *ApiMethod) EidtSunTargetPost(c *gin.Context) {
var requestData getDingXingSunTaget
c.ShouldBindJSON(&requestData)
if requestData.Id == "" || requestData.DepartmentId == "" || requestData.Title == "" {
response.Result(101, requestData, "您的请求数据不合法", c)
return return
} }
if len(requestData.PostId) < 1 { if len(requestData.PostId) < 1 {
response.Result(100, err, "请指定要关联的岗位", c) response.Result(101, requestData, "请选择关联岗位", c)
return
}
if len(requestData.ReportAry) < 1 {
response.Result(101, requestData, "请选择关联上报人", c)
return
}
where := commonus.MapOut()
where["`id`"] = requestData.Id
var sunTarCont assessmentmodel.PostSunTarget
err := sunTarCont.GetCont(where)
if err != nil {
response.Result(101, requestData, "没有该子栏目!", c)
return
}
saveData := commonus.MapOut()
if requestData.Title != sunTarCont.Title {
saveData["title"] = requestData.Title
}
saveData["depart"] = requestData.DepartmentId
saveData["depart_post"] = strings.Join(requestData.PostId, ",")
saveData["time"] = time.Now().Unix()
saveErr := sunTarCont.EditCont(where, saveData)
if saveErr != nil {
response.Result(101, saveErr, "编辑失败!", c)
return return
} }
// postAryStr := strings.Join(, ",") detaWher := commonus.MapOut()
// where := commonus.MapOut() detaWher["parentid"] = sunTarCont.ParentId
// where["`id`"] = requestData.Id detaWher["parentid_sun"] = sunTarCont.Id
detaWher["paretment"] = sunTarCont.Depart
saveDetaCont := commonus.MapOut()
saveDetaCont["paretment_post"] = strings.Join(requestData.PostId, ",")
saveDetaCont["reportary"] = strings.Join(requestData.ReportAry, ",")
saveDetaCont["time"] = time.Now().Unix()
var saveDetaInfo assessmentmodel.PostTargetDetails
saveDetaInfo.EditCont(detaWher, saveDetaCont)
response.Result(0, saveErr, "编辑成功!", c)
}
// 删除指标
func (a *ApiMethod) DelSunTarget(c *gin.Context) {
var requestData editState
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(100, err, "数据格式不正确!", c)
return
}
if requestData.Id == "" {
response.Result(101, requestData, "您的请求数据不合法", c)
return
}
if requestData.State == 0 {
requestData.State = 1
}
if requestData.IsTrue == 0 {
requestData.IsTrue = 2
}
where := commonus.MapOut()
where["`id`"] = requestData.Id
var sunTarCont assessmentmodel.PostSunTarget
sunErr := sunTarCont.GetCont(where)
if sunErr != nil {
response.Result(101, sunErr, "没有查询到数据!", c)
return
}
if requestData.State != 3 {
eidtDingXing(sunTarCont.Id, requestData.State)
} else {
if requestData.IsTrue != 1 {
eidtDingXing(sunTarCont.Id, requestData.State)
} else {
var postSunTargetInfo assessmentmodel.PostSunTarget
postSunTargetInfo.DelCont(map[string]interface{}{"`parent_id`": sunTarCont.Id})
var postDetailsInfo assessmentmodel.PostTargetDetails
postDetailsInfo.DelCont(map[string]interface{}{"`parent_id`": sunTarCont.Id})
}
}
}
// 添加单条定性指标细则
func (a *ApiMethod) AddPostDetaCont(c *gin.Context) {
var requestData oneAddDetails
c.ShouldBindJSON(&requestData)
if requestData.SunTargetId == "" {
response.Result(101, requestData, "您的请求数据不合法", c)
return
}
var sunTarCont assessmentmodel.PostSunTarget
sunErr := sunTarCont.GetCont(map[string]interface{}{"`id`": requestData.SunTargetId}, "`parent_id`", "`depart`", "`depart_post`")
if sunErr != nil {
response.Result(101, requestData, "您的请求数据不合法", c)
return
}
if requestData.Title == "" {
response.Result(101, requestData, "请输入细则名称", c)
return
}
switch requestData.PunishMode {
case 2:
if requestData.CashStandard == "" {
response.Result(101, requestData, "请输入考核现金标准", c)
return
}
case 3:
if requestData.ReferenceScore == "" {
response.Result(101, requestData, "请输入考核标准", c)
return
}
if requestData.CashStandard == "" {
response.Result(101, requestData, "请输入考核现金标准", c)
return
}
if requestData.Unit == "" {
response.Result(101, requestData, "请输入考核单位", c)
return
}
default:
requestData.PunishMode = 1
if requestData.ReferenceScore == "" {
response.Result(101, requestData, "请输入考核标准", c)
return
}
if requestData.Unit == "" {
response.Result(101, requestData, "请输入考核单位", c)
return
}
}
if requestData.Class == 0 {
requestData.Class = 1
}
if len(requestData.Inspect) < 1 {
requestData.Inspect = append(requestData.Inspect, "1")
}
if requestData.Cycle == 0 {
requestData.Cycle = 4
}
if requestData.CycleAttr == 0 {
requestData.CycleAttr = 1
}
var tarGerCont assessmentmodel.PostTarget
tarGerCont.GetCont(map[string]interface{}{"`id`": sunTarCont.ParentId})
var tiBaoRen string
if len(requestData.ReportAry) < 1 {
if tarGerCont.Report == "" {
response.Result(101, requestData, "请选择提报人!", c)
return
}
tiBaoRen = tarGerCont.Report
} else {
tiBaoRen = strings.Join(requestData.ReportAry, ",")
}
var minScoreInt int64
var maxScoreInt int64
scoreAry := strings.Split(requestData.ReferenceScore, "-")
scoreLen := len(scoreAry)
// fmt.Printf("ScoreAry:%v----------->%v------------>%v------------>%v\n", ReferenceScore, scoreLen, scoreAry[0], scoreAry)
if scoreLen > 0 {
if scoreLen == 1 {
maxScore, _ := strconv.ParseFloat(scoreAry[0], 64)
// zhhh := maxScore * 100
// zhuanStr := strconv.FormatFloat(zhhh, 'f', -1, 64)
maxScoreInt, _ = strconv.ParseInt(strconv.FormatFloat(maxScore*100, 'f', -1, 64), 10, 64)
minScoreInt = 0
} else {
minScore, _ := strconv.ParseFloat(scoreAry[0], 64)
maxScore, _ := strconv.ParseFloat(scoreAry[scoreLen-1], 64)
minScoreInt, _ = strconv.ParseInt(strconv.FormatFloat(minScore*100, 'f', -1, 64), 10, 64)
maxScoreInt, _ = strconv.ParseInt(strconv.FormatFloat(maxScore*100, 'f', -1, 64), 10, 64)
}
} else {
minScoreInt = 0
maxScoreInt = 0
}
var minMoney int64 //罚款或奖励最高金额
var maxMoney int64 //罚款或奖励最新金额
moneyAry := strings.Split(requestData.CashStandard, "-")
moneyAryLen := len(moneyAry)
if moneyAryLen > 0 {
if moneyAryLen == 1 {
maxMoneyEs, _ := strconv.ParseFloat(moneyAry[0], 64)
maxMoney, _ = strconv.ParseInt(strconv.FormatFloat(maxMoneyEs*100, 'f', -1, 64), 10, 64)
minMoney = 0
} else {
maxMoneyEs, _ := strconv.ParseFloat(moneyAry[moneyAryLen-1], 64)
maxMoney, _ = strconv.ParseInt(strconv.FormatFloat(maxMoneyEs*100, 'f', -1, 64), 10, 64)
minMoneyEs, _ := strconv.ParseFloat(moneyAry[0], 64)
minMoney, _ = strconv.ParseInt(strconv.FormatFloat(minMoneyEs*100, 'f', -1, 64), 10, 64)
}
} else {
minMoney = 0
maxMoney = 0
}
var saveCont assessmentmodel.PostTargetDetails
saveCont.Title = requestData.Title //指标细则"`
saveCont.Content = requestData.Explain //备注说明"`
saveCont.ParentId = sunTarCont.ParentId //归属指标栏目"`
saveCont.ParentIdSun = sunTarCont.Id //归属指标子栏目"`
saveCont.State = 1 //状态(1:启用;2:禁用;3:删除)"`
saveCont.AddTime = time.Now().Unix() //制定时间"`
saveCont.MinScore = minScoreInt //最小分*100保存"`
saveCont.MaxScore = maxScoreInt //最大分*100保存"`
saveCont.Company = requestData.Unit //单位"`
saveCont.AddReduce = requestData.Class //1:减少;2:增加;3:无属性,现场确认加或减"`
saveCont.CensorType = strings.Join(requestData.Inspect, ",") //检查方式"`
saveCont.CensorCont = requestData.Evidence //客观证据"`
saveCont.CensorRate = requestData.Cycle //检查频次"`
saveCont.Cycles = requestData.CycleAttr //1:班;2:天;3:周;4:月;5:季度;6:年"`
saveCont.CycleAttres = requestData.CycleAttr //辅助计数"`
saveCont.Paretment = sunTarCont.Depart //接受考核的部门"`
saveCont.ParetmentPost = strings.Join(requestData.PostId, ",") //接受考核的部门岗位"`
saveCont.Reportary = tiBaoRen //提报人"`
saveCont.Punishmode = requestData.PunishMode //处罚或奖励方式 1:分数;2:现金;3:分数加现金
saveCont.Minmoney = minMoney //最高罚款*100保存"`
saveCont.Maxmoney = maxMoney //最低罚款*100保存"`
saveErr := global.GVA_DB_Performanceappraisal.Create(&saveCont).Error
if saveErr != nil {
response.Result(101, saveErr, "数据写入失败!请重新写入!", c)
return
}
response.Result(0, saveErr, "数据写入成功!", c)
}
// 获取指标细则内容
func (a *ApiMethod) GetDetailsCont(c *gin.Context) {
var requestData idType
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(100, err, "数据格式不正确!", c)
return
}
if requestData.Id == "" {
response.Result(101, err, "您的请求数据不合法", c)
return
}
var detaCont outDetailsCont
detaErr := detaCont.GetCont(map[string]interface{}{"`id`": requestData.Id})
if detaErr != nil {
response.Result(101, detaErr, "该指标细则不存在!", c)
return
}
if detaCont.MinScore != 0 {
detaCont.ScoreStandard = fmt.Sprintf("%v-%v", commonus.DecimalEs(float64(detaCont.MinScore)/100, 2), commonus.DecimalEs(float64(detaCont.MaxScore)/100, 2))
} else {
detaCont.ScoreStandard = fmt.Sprintf("%v", commonus.DecimalEs(float64(detaCont.MaxScore)/100, 2))
}
if detaCont.Minmoney != 0 {
detaCont.CashStandard = fmt.Sprintf("%v-%v", commonus.DecimalEs(float64(detaCont.Minmoney)/100, 2), commonus.DecimalEs(float64(detaCont.Maxmoney)/100, 2))
} else {
detaCont.CashStandard = fmt.Sprintf("%v", commonus.DecimalEs(float64(detaCont.Maxmoney)/100, 2))
}
detaCont.InspMethod = strings.Split(detaCont.CensorType, ",")
//关联岗位
postAry := strings.Split(detaCont.ParetmentPost, ",")
var inAryPost []string
if len(postAry) > 0 {
for _, pv := range postAry {
if commonus.IsInTrue[string](pv, inAryPost) == false {
inAryPost = append(inAryPost, pv)
var postCont hrsystem.Position
postConErr := postCont.GetCont(map[string]interface{}{"`id`": pv}, "`name`")
if postConErr == nil {
var postContL idAndName
postContL.Id = pv
postContL.Name = postCont.Name
detaCont.PostAry = append(detaCont.PostAry, postContL)
}
}
}
}
//提报人
repalyMan := strings.Split(detaCont.Reportary, ",")
var reply []string
if len(repalyMan) > 0 {
for _, mv := range repalyMan {
if commonus.IsInTrue[string](mv, reply) == false {
reply = append(reply, mv)
var manCont hrsystem.PersonArchives
manErr := manCont.GetCont(map[string]interface{}{"`key`": mv}, "`name`", "`icon`", `number`)
if manErr == nil {
var reporContMan reportUser
reporContMan.Id = mv
reporContMan.Name = manCont.Name
reporContMan.Icon = manCont.Icon
reporContMan.Number = manCont.Number
detaCont.ReportAry = append(detaCont.ReportAry, reporContMan)
}
}
}
}
response.Result(0, detaCont, "数据获取成功!", c)
}
// 修改定性考核指标细则
func (a *ApiMethod) EditDeatilsCont(c *gin.Context) {
var requestData editPostDetails
c.ShouldBindJSON(&requestData)
if requestData.Id == "" {
response.Result(101, requestData, "您的请求数据不合法", c)
return
}
where := commonus.MapOut()
where["`id`"] = requestData.Id
var detaCont assessmentmodel.PostTargetDetails
detaErr := detaCont.GetCont(where)
if detaErr != nil {
response.Result(101, detaErr, "该指标细则不存在!", c)
return
}
saveData := commonus.MapOut()
if requestData.Title != "" && requestData.Title != detaCont.Title {
saveData["title"] = requestData.Title
}
if requestData.ReferenceScore != "" {
referStr := ""
if detaCont.MinScore != 0 {
referStr = fmt.Sprintf("%v-%v", commonus.DecimalEs(float64(detaCont.MinScore)/100, 2), commonus.DecimalEs(float64(detaCont.MaxScore)/100, 2))
} else {
referStr = fmt.Sprintf("%v", commonus.DecimalEs(float64(detaCont.MaxScore)/100, 2))
}
if requestData.ReferenceScore != referStr {
scoreAry := strings.Split(requestData.ReferenceScore, "-")
scoreLen := len(scoreAry)
if scoreLen > 0 {
if scoreLen == 1 {
maxScore, _ := strconv.ParseFloat(scoreAry[0], 64)
saveData["max_score"], _ = strconv.ParseInt(strconv.FormatFloat(maxScore*100, 'f', -1, 64), 10, 64)
saveData["min_score"] = 0
} else {
minScore, _ := strconv.ParseFloat(scoreAry[0], 64)
maxScore, _ := strconv.ParseFloat(scoreAry[scoreLen-1], 64)
saveData["min_score"], _ = strconv.ParseInt(strconv.FormatFloat(minScore*100, 'f', -1, 64), 10, 64)
saveData["max_score"], _ = strconv.ParseInt(strconv.FormatFloat(maxScore*100, 'f', -1, 64), 10, 64)
}
} else {
saveData["min_score"] = 0
saveData["max_score"] = 0
}
}
}
if requestData.Unit != "" && requestData.Unit != detaCont.Company {
saveData["company"] = requestData.Unit
}
if requestData.Class != 0 && requestData.Class != detaCont.AddReduce {
saveData["add_reduce"] = requestData.Class
}
if len(requestData.Inspect) > 0 {
insStr := strings.Join(requestData.Inspect, ",")
if insStr != detaCont.CensorType {
saveData["censor_type"] = insStr
}
}
if requestData.Cycle != 0 && requestData.Cycle != detaCont.Cycles {
saveData["cycle"] = requestData.Cycle
}
if requestData.CycleAttr != 0 && requestData.CycleAttr != detaCont.CycleAttres {
saveData["cycleattr"] = requestData.CycleAttr
}
if requestData.Evidence != "" && requestData.Evidence != detaCont.Company {
saveData["censor_cont"] = requestData.Evidence
}
if requestData.Explain != "" && requestData.Explain != detaCont.Company {
saveData["Content"] = requestData.Explain
}
if len(requestData.ReportAry) > 0 {
repInsStr := strings.Join(requestData.ReportAry, ",")
if repInsStr != detaCont.CensorType {
saveData["reportary"] = repInsStr
}
}
if requestData.PunishMode != 0 && requestData.PunishMode != detaCont.Punishmode {
saveData["punishmode"] = requestData.PunishMode
}
if requestData.CashStandard != "" {
referMoneryStr := ""
if detaCont.MinScore != 0 {
referMoneryStr = fmt.Sprintf("%v-%v", commonus.DecimalEs(float64(detaCont.MinScore)/100, 2), commonus.DecimalEs(float64(detaCont.MaxScore)/100, 2))
} else {
referMoneryStr = fmt.Sprintf("%v", commonus.DecimalEs(float64(detaCont.MaxScore)/100, 2))
}
if requestData.CashStandard != referMoneryStr {
moneyAry := strings.Split(requestData.CashStandard, "-")
moneyAryLen := len(moneyAry)
if moneyAryLen > 0 {
if moneyAryLen == 1 {
maxMoneyEs, _ := strconv.ParseFloat(moneyAry[0], 64)
saveData["maxmoney"], _ = strconv.ParseInt(strconv.FormatFloat(maxMoneyEs*100, 'f', -1, 64), 10, 64)
saveData["minmoney"] = 0
} else {
maxMoneyEs, _ := strconv.ParseFloat(moneyAry[moneyAryLen-1], 64)
saveData["maxmoney"], _ = strconv.ParseInt(strconv.FormatFloat(maxMoneyEs*100, 'f', -1, 64), 10, 64)
minMoneyEs, _ := strconv.ParseFloat(moneyAry[0], 64)
saveData["minmoney"], _ = strconv.ParseInt(strconv.FormatFloat(minMoneyEs*100, 'f', -1, 64), 10, 64)
}
} else {
saveData["maxmoney"] = 0
saveData["minmoney"] = 0
}
}
}
if len(saveData) > 0 {
saveData["time"] = time.Now().Unix()
saveErr := detaCont.EditCont(where, saveData)
if saveErr != nil {
response.Result(101, saveErr, "编辑失败!", c)
return
}
}
response.Result(0, saveData, "编辑成功!", c)
}
// 删除指标细则
func (a *ApiMethod) EidtPostTarDetailsStrte(c *gin.Context) {
var requestData editState
c.ShouldBindJSON(&requestData)
if requestData.Id == "" {
response.Result(100, requestData, "请输入指标名称!", c)
return
}
if requestData.State == 0 {
requestData.State = 1
}
if requestData.IsTrue == 0 {
requestData.IsTrue = 2
}
where := commonus.MapOut()
where["`id`"] = requestData.Id
var detaCont assessmentmodel.PostTargetDetails
detaErr := detaCont.GetCont(where)
if detaErr != nil {
response.Result(101, detaErr, "该指标细则不存在!", c)
return
}
if requestData.State != 3 {
saveData := commonus.MapOut()
saveData["state"] = requestData.State
saveData["time"] = time.Now().Unix()
saveErr := detaCont.EditCont(where, saveData)
if saveErr != nil {
response.Result(101, saveErr, "编辑失败!", c)
return
}
} else {
if requestData.IsTrue != 1 {
saveData := commonus.MapOut()
saveData["state"] = requestData.State
saveData["time"] = time.Now().Unix()
saveErr := detaCont.EditCont(where, saveData)
if saveErr != nil {
response.Result(101, saveErr, "编辑失败!", c)
return
}
} else {
saveErr := detaCont.DelCont(where)
if saveErr != nil {
response.Result(101, saveErr, "编辑失败!", c)
return
}
}
}
response.Result(0, detaCont, "编辑成功!", c)
} }

70
api/v1/shiyan/shiyan.go

@ -2972,4 +2972,74 @@ func (s *ShiyanApi) DelFlowDataUser(c *gin.Context) {
//定性审核 //定性审核
global.GVA_DB_Performanceappraisal.Where("sf_evaluation_user = ?", requestData.Id).Delete(&assessmentmodel.ScoreFlow{}) global.GVA_DB_Performanceappraisal.Where("sf_evaluation_user = ?", requestData.Id).Delete(&assessmentmodel.ScoreFlow{})
response.Result(0, requestData, "处理完毕", c) response.Result(0, requestData, "处理完毕", c)
//判断定量考核有无后续数据
var flowKeyAll []int64
allErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.FlowLog{}).Select("`fl_key`").Find(&flowKeyAll).Error
if allErr == nil {
for _, v := range flowKeyAll {
var flowData assessmentmodel.FlowLogData
delErr := global.GVA_DB_Performanceappraisal.Where("fld_flow_log = ?", v).First(&flowData).Error
if delErr != nil {
global.GVA_DB_Performanceappraisal.Where("fl_key = ?", v).Delete(&assessmentmodel.FlowLog{})
}
}
}
}
// 查看定量考核是否有审批流程
func (s *ShiyanApi) DingLiangPass(c *gin.Context) {
var flowKey []int64
flErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.FlowLog{}).Select("`fl_key`").Find(&flowKey).Error
if flErr != nil {
response.Result(1000, flErr, "没有数据", c)
return
}
if len(flowKey) < 1 {
response.Result(10001, flErr, "没有数据", c)
return
}
var errVal []int64
for _, v := range flowKey {
var evalProCont assessmentmodel.EvaluationProcess
evalErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationProcess{}).Select("`ep_id`").Where("ep_order_key = ?", v).First(&evalProCont).Error
if evalErr != nil {
if commonus.IsInTrue[int64](v, errVal) == false {
errVal = append(errVal, v)
}
}
}
if len(errVal) > 0 {
global.GVA_DB_Performanceappraisal.Where("fld_flow_log IN ?", errVal).Delete(&assessmentmodel.FlowLogData{})
global.GVA_DB_Performanceappraisal.Where("fl_key IN ?", errVal).Delete(&assessmentmodel.FlowLog{})
}
response.Result(0, errVal, "处理完成", c)
}
// 定性考核没有审批流的数据
func (s *ShiyanApi) DingXingPass(c *gin.Context) {
var flowKey []int64
flErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("`sf_key`").Find(&flowKey).Error
if flErr != nil {
response.Result(1000, flErr, "没有数据", c)
return
}
if len(flowKey) < 1 {
response.Result(10001, flErr, "没有数据", c)
return
}
var errVal []int64
for _, v := range flowKey {
var evalProCont assessmentmodel.EvaluationProcess
evalErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationProcess{}).Select("`ep_id`").Where("ep_order_key = ?", v).First(&evalProCont).Error
if evalErr != nil {
if commonus.IsInTrue[int64](v, errVal) == false {
errVal = append(errVal, v)
}
}
}
if len(errVal) > 0 {
global.GVA_DB_Performanceappraisal.Where("sf_key IN ?", errVal).Delete(&assessmentmodel.ScoreFlow{})
}
response.Result(0, errVal, "处理完成", c)
} }

2
commonus/wechatapp.go

@ -535,7 +535,7 @@ func GetReportJobInfo(jobid, date string) (ca *CallBackReportJobInfo, isTrue boo
kk = string(addDePartMent) kk = string(addDePartMent)
var sendCallBackDate CallBackReportJobInfo var sendCallBackDate CallBackReportJobInfo
err = json.Unmarshal(addDePartMent, &sendCallBackDate) err = json.Unmarshal(addDePartMent, &sendCallBackDate)
// fmt.Printf("json23 ===>%v------>%v\n", sendCallBackDate, string(addDePartMent)) fmt.Printf("json23 ===>%v===>%v===>%v------>%v\n", getWechatApiUrl, string(sendJsonData), sendCallBackDate, string(addDePartMent))
if sendCallBackDate.Errcode == 0 { if sendCallBackDate.Errcode == 0 {
isTrue = true isTrue = true
} }

1
model/assessmentmodel/dutyclass.go

@ -602,6 +602,7 @@ type FlowDataLogType struct {
ToDay int64 `json:"today" gorm:"column:today;type:int(5) unsigned;default:0;not null;comment:天"` ToDay int64 `json:"today" gorm:"column:today;type:int(5) unsigned;default:0;not null;comment:天"`
TargetId int64 `json:"targetid" gorm:"column:targetid;type:bigint(20) unsigned;default:0;not null;comment:指标ID"` TargetId int64 `json:"targetid" gorm:"column:targetid;type:bigint(20) unsigned;default:0;not null;comment:指标ID"`
Edition string `json:"edition" gorm:"column:edition;type:longtext;comment:版本号 "` Edition string `json:"edition" gorm:"column:edition;type:longtext;comment:版本号 "`
Content string `json:"content" gorm:"column:content;type:longtext;comment:评测内容 "`
} }
func (FlowDataLogType *FlowDataLogType) TableName() string { func (FlowDataLogType *FlowDataLogType) TableName() string {

6
model/assessmentmodel/post_target_details.go

@ -13,7 +13,7 @@ type PostTargetDetails struct {
Content string `json:"content" gorm:"column:content;type:text;comment:指标说明"` Content string `json:"content" gorm:"column:content;type:text;comment:指标说明"`
ParentId int64 `json:"parentid" gorm:"column:parentid;type:bigint(20) unsigned;default:0;not null;comment:归属指标栏目"` ParentId int64 `json:"parentid" gorm:"column:parentid;type:bigint(20) unsigned;default:0;not null;comment:归属指标栏目"`
ParentIdSun int64 `json:"parentidsun" gorm:"column:parentid_sun;type:bigint(20) unsigned;default:0;not null;comment:归属指标子栏目"` ParentIdSun int64 `json:"parentidsun" gorm:"column:parentid_sun;type:bigint(20) unsigned;default:0;not null;comment:归属指标子栏目"`
State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` State int `json:"state" gorm:"column:state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"`
AddTime int64 `json:"addtime" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:制定时间"` AddTime int64 `json:"addtime" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:制定时间"`
MinScore int64 `json:"minscore" gorm:"column:min_score;type:bigint(20) unsigned;default:0;not null;comment:最小分*100保存"` MinScore int64 `json:"minscore" gorm:"column:min_score;type:bigint(20) unsigned;default:0;not null;comment:最小分*100保存"`
MaxScore int64 `json:"maxscore" gorm:"column:max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"` MaxScore int64 `json:"maxscore" gorm:"column:max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"`
@ -26,6 +26,10 @@ type PostTargetDetails struct {
CycleAttres int `json:"cycleattr" gorm:"column:cycleattr;type:int(9) unsigned;default:1;not null;comment:辅助计数"` CycleAttres int `json:"cycleattr" gorm:"column:cycleattr;type:int(9) unsigned;default:1;not null;comment:辅助计数"`
Paretment int64 `json:"paretment" gorm:"column:paretment;type:bigint(20);comment:接受考核的部门"` Paretment int64 `json:"paretment" gorm:"column:paretment;type:bigint(20);comment:接受考核的部门"`
ParetmentPost string `json:"paretmentpost" gorm:"column:paretment_post;type:longtext;comment:接受考核的部门岗位"` ParetmentPost string `json:"paretmentpost" gorm:"column:paretment_post;type:longtext;comment:接受考核的部门岗位"`
Reportary string `json:"reportary" gorm:"column:reportary;type:longtext;comment:提报人"`
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 (PostTargetDetails *PostTargetDetails) TableName() string { func (PostTargetDetails *PostTargetDetails) TableName() string {

5
router/index/statisticsroute/programme.go

@ -19,6 +19,9 @@ func (s *StatisticsRoute) InitRouter(Router *gin.RouterGroup) {
shiyanCodeRouter.POST("departperappdatastatistics", authorityApi.DepartPerAppDataStatistics) //绩效考核数据统计 shiyanCodeRouter.POST("departperappdatastatistics", authorityApi.DepartPerAppDataStatistics) //绩效考核数据统计
shiyanCodeRouter.POST("getplanversionvalid", authorityApi.GetPlanVersionValid) //绩效考核数据统计(改版) shiyanCodeRouter.POST("getplanversionvalid", authorityApi.GetPlanVersionValid) //绩效考核数据统计(改版)
shiyanCodeRouter.POST("departmenttranscript", authorityApi.DepartmentTranscript) //成绩表查询 // shiyanCodeRouter.POST("departmenttranscript", authorityApi.DepartmentTranscript) //成绩表查询
// shiyanCodeRouter.POST("queryresults", authorityApi.Queryresults) //成绩表查询(新)
shiyanCodeRouter.POST("departmenttranscript", authorityApi.Queryresults) //成绩表查询
shiyanCodeRouter.POST("queryresults", authorityApi.DepartmentTranscript) //成绩表查询(新)
} }
} }

14
router/postrouter/post_target.go

@ -25,5 +25,19 @@ func (p *PostTargetKpiRouter) InitRouter(Router *gin.RouterGroup) {
routerApi.POST("targetorglist", apiRouter.TargetOrgList) //获取指标关联的岗位 routerApi.POST("targetorglist", apiRouter.TargetOrgList) //获取指标关联的岗位
routerApi.POST("addposttargetcont", apiRouter.AddPostTargetCont) //添加岗位细则 routerApi.POST("addposttargetcont", apiRouter.AddPostTargetCont) //添加岗位细则
routerApi.POST("posttargetsunlist", apiRouter.PostTargetSunList) //岗位定性考核列表 routerApi.POST("posttargetsunlist", apiRouter.PostTargetSunList) //岗位定性考核列表
routerApi.POST("editposttargetaual", apiRouter.EditPostTargetQual) //修改定性指标关联岗位
/*
岗位定性指标子栏目
*/
routerApi.POST("getsuntargetinfo", apiRouter.GetSunTargetInfo) //获取子栏目内容
routerApi.POST("eidtsuntargetpost", apiRouter.EidtSunTargetPost) //编辑定性考核子栏目
routerApi.POST("delsuntarget", apiRouter.DelSunTarget) //删除定性考核指标子栏目
/*
定性指标细则
*/
routerApi.POST("addpostdetacont", apiRouter.AddPostDetaCont) //添加单条定性指标细则
routerApi.POST("getdetailscont", apiRouter.GetDetailsCont) //获取指标细则内容
routerApi.POST("editdeatilscont", apiRouter.EditDeatilsCont) //修改定性考核指标细则
routerApi.POST("eidtposttardetailsstrte", apiRouter.EidtPostTarDetailsStrte) //删除定性考核指标细则
} }
} }

2
router/shiyan/sys_shiyan.go

@ -55,5 +55,7 @@ func (s *ShiyanRouter) InitShiyanRouter(Router *gin.RouterGroup) {
shiyanCodeRouter.POST("correctingorg", authorityApi.CorrectingOrg) //校正行政组织 shiyanCodeRouter.POST("correctingorg", authorityApi.CorrectingOrg) //校正行政组织
shiyanCodeRouter.POST("delflowdatauser", authorityApi.DelFlowDataUser) //删除人员提交数据 shiyanCodeRouter.POST("delflowdatauser", authorityApi.DelFlowDataUser) //删除人员提交数据
shiyanCodeRouter.POST("dingliangpass", authorityApi.DingLiangPass) //处理定量没有审批流的数据
shiyanCodeRouter.POST("dingxingpass", authorityApi.DingXingPass) //定性考核没有审批流的数据
} }
} }

Loading…
Cancel
Save