40 changed files with 2351 additions and 310 deletions
@ -0,0 +1,9 @@ |
|||
package statistics |
|||
|
|||
import "github.com/flipped-aurora/gin-vue-admin/server/api/statistics/nature" |
|||
|
|||
type ApiGroup struct { |
|||
NatureApi nature.ApiGroup |
|||
} |
|||
|
|||
var ApiGroupApp = new(ApiGroup) |
|||
@ -0,0 +1,33 @@ |
|||
package nature |
|||
|
|||
type ApiGroup struct{} |
|||
|
|||
//获取指标ID
|
|||
type getTargetId[T any] struct { |
|||
TargetId []T `json:"targetid"` //指标
|
|||
} |
|||
|
|||
//定性考核查询参数
|
|||
type natureParameter struct { |
|||
TargetId []string `json:"targetid"` //指标
|
|||
Org []string `json:"org"` //行政组织
|
|||
Year []string `json:"year"` //年
|
|||
TimeAttribute []TimeAttributeMap `json:"timeattribute"` //时间辅助
|
|||
AccMethod []int `json:"accmethod"` //核算方式 1:合计值;2:平均值
|
|||
} |
|||
|
|||
//时间属性
|
|||
type TimeAttributeMap struct { |
|||
Class int `json:"class"` //0:全年;1:半年;2:季度;3:月度
|
|||
Time []int `json:"time"` //class->0(0),class->1(1:上半年,2:下半年),class->2(1:第一季度,2:第二季度,3:第三季度,4:第四季度),class->3(1:1月....12:12月)
|
|||
} |
|||
|
|||
//组织架构
|
|||
type orgModels struct { |
|||
Id string `json:"id"` |
|||
Name string `json:"name"` |
|||
} |
|||
type orgModelsAry struct { |
|||
orgModels |
|||
Child []orgModels `json:"child"` |
|||
} |
|||
@ -0,0 +1,221 @@ |
|||
package nature |
|||
|
|||
import ( |
|||
"strconv" |
|||
"strings" |
|||
"time" |
|||
|
|||
"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/gin-gonic/gin" |
|||
) |
|||
|
|||
//入口
|
|||
func (a *ApiGroup) Index(c *gin.Context) { |
|||
outPut := commonus.MapOut() |
|||
response.Result(0, outPut, "手机考核入口", c) |
|||
} |
|||
|
|||
//计算定性考核组织范围,及起止年份
|
|||
func (a *ApiGroup) GetTargetOrgAndYear(c *gin.Context) { |
|||
isTrue, _ := commonus.ClientIdentity() |
|||
if isTrue != true { |
|||
response.Result(101, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c) |
|||
return |
|||
} |
|||
var requestData getTargetId[string] |
|||
err := c.ShouldBindJSON(&requestData) |
|||
if err != nil { |
|||
response.Result(102, err, "数据获取失败!", c) |
|||
return |
|||
} |
|||
if len(requestData.TargetId) < 1 { |
|||
response.Result(102, err, "未获取到指标", c) |
|||
return |
|||
} |
|||
// group, isTrue := commonus.GetNewHrOrg(41)
|
|||
var accDepart []string |
|||
var orgMap []orgModelsAry |
|||
for _, v := range requestData.TargetId { |
|||
// fmt.Printf("v-------------->%v\n", v)
|
|||
var releDepart string |
|||
// var orgMap []orgModelsAry
|
|||
err := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationTarget{}).Select("et_relevant_departments").Where("`et_id` = ?", v).First(&releDepart).Error |
|||
if err == nil { |
|||
departAry := strings.Split(releDepart, ",") |
|||
// fmt.Printf("releDepart-------------->%v\n", departAry)
|
|||
if len(departAry) > 0 { |
|||
for _, vv := range departAry { |
|||
orgId, _ := strconv.ParseInt(vv, 10, 64) |
|||
group, isTrue := commonus.GetNewHrOrg(orgId) |
|||
|
|||
if commonus.IsItTrueString(vv, accDepart) { |
|||
accDepart = append(accDepart, vv) |
|||
} |
|||
|
|||
// fmt.Printf("Group-----%v----Depart----->%v\n", group, vv)
|
|||
if isTrue == true { |
|||
if len(orgMap) > 0 { |
|||
isYes := false |
|||
for oi, ov := range orgMap { |
|||
if ov.Id == strconv.FormatInt(group, 10) { |
|||
isYes = true |
|||
where := commonus.MapOut() |
|||
where["id"] = vv |
|||
orgCont, _ := commonus.GetNewOrgCont(where, "name") |
|||
var orgSunCont orgModels |
|||
orgSunCont.Id = vv |
|||
orgSunCont.Name = orgCont.Name |
|||
orgMap[oi].Child = append(orgMap[oi].Child, orgSunCont) |
|||
} |
|||
} |
|||
if isYes == false { |
|||
//写入集团信息
|
|||
where := commonus.MapOut() |
|||
where["id"] = group |
|||
orgCont, _ := commonus.GetNewOrgCont(where, "name") |
|||
var orgMapCont orgModelsAry |
|||
orgMapCont.Id = strconv.FormatInt(group, 10) |
|||
orgMapCont.Name = orgCont.Name |
|||
orgMap = append(orgMap, orgMapCont) |
|||
} |
|||
} else { |
|||
//写入集团信息
|
|||
where := commonus.MapOut() |
|||
where["id"] = group |
|||
orgCont, _ := commonus.GetNewOrgCont(where, "name") |
|||
var orgMapCont orgModelsAry |
|||
orgMapCont.Id = strconv.FormatInt(group, 10) |
|||
orgMapCont.Name = orgCont.Name |
|||
orgMap = append(orgMap, orgMapCont) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
//获取时间
|
|||
// targetIdAry := strings.Split(requestData.TargetId, ",")
|
|||
var progIdAry []int64 |
|||
var timeList []int64 |
|||
gromDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_id").Where("qe_target IN ?", requestData.TargetId) |
|||
if len(accDepart) > 0 { |
|||
gromDb = gromDb.Where("qe_accept_evaluation IN ?", accDepart) |
|||
} |
|||
quaEvaErr := gromDb.Find(&progIdAry).Error |
|||
if quaEvaErr == nil { |
|||
if len(progIdAry) > 0 { |
|||
var timeAry []int64 |
|||
scoFlowDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_happen_time").Where("sf_evaluation_plan IN ?", progIdAry) |
|||
|
|||
scoFlowErr := scoFlowDb.Find(&timeAry).Error |
|||
if scoFlowErr == nil { |
|||
// maxTime, minTime = commonus.NewUserModel(timeAry)
|
|||
if len(timeAry) > 0 { |
|||
timeList = commonus.UniqueSort(timeAry) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
var yearTime []string |
|||
if len(timeList) > 0 { |
|||
for _, tv := range timeList { |
|||
yearStr := commonus.TimeStampToDate(tv, 11) |
|||
if commonus.IsItTrueString(yearStr, yearTime) == false { |
|||
yearTime = append(yearTime, yearStr) |
|||
} |
|||
|
|||
} |
|||
} else { |
|||
yearStr := commonus.TimeStampToDate(time.Now().Unix(), 11) |
|||
yearTime = append(yearTime, yearStr) |
|||
} |
|||
// var outYear []string
|
|||
// if maxTime == 0 && minTime == 0 {
|
|||
// yearStr := commonus.TimeStampToDate(time.Now().Unix(), 11)
|
|||
// yearTime = append(yearTime, yearStr)
|
|||
// }
|
|||
outMap := commonus.MapOut() |
|||
outMap["grouplist"] = orgMap |
|||
outMap["timelist"] = yearTime |
|||
response.Result(0, outMap, "数据获取失败!", c) |
|||
} |
|||
|
|||
//获取存在的组织架构
|
|||
func getExistOrg(targetId string) []orgModelsAry { |
|||
var releDepart string |
|||
var orgMap []orgModelsAry |
|||
err := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationTarget{}).Select("et_relevant_departments").Where("`et_id` = ?", targetId).First(&releDepart).Error |
|||
if err == nil { |
|||
departAry := strings.Split(releDepart, ",") |
|||
// fmt.Printf("releDepart-------------->%v\n", departAry)
|
|||
if len(departAry) > 0 { |
|||
for _, vv := range departAry { |
|||
orgId, _ := strconv.ParseInt(vv, 10, 64) |
|||
group, isTrue := commonus.GetNewHrOrg(orgId) |
|||
|
|||
// fmt.Printf("Group-----%v----Depart----->%v\n", group, vv)
|
|||
if isTrue == true { |
|||
if len(orgMap) > 0 { |
|||
isYes := false |
|||
for oi, ov := range orgMap { |
|||
if ov.Id == strconv.FormatInt(group, 10) { |
|||
isYes = true |
|||
where := commonus.MapOut() |
|||
where["id"] = vv |
|||
orgCont, _ := commonus.GetNewOrgCont(where, "name") |
|||
var orgSunCont orgModels |
|||
orgSunCont.Id = vv |
|||
orgSunCont.Name = orgCont.Name |
|||
orgMap[oi].Child = append(orgMap[oi].Child, orgSunCont) |
|||
} |
|||
} |
|||
if isYes == false { |
|||
//写入集团信息
|
|||
where := commonus.MapOut() |
|||
where["id"] = group |
|||
orgCont, _ := commonus.GetNewOrgCont(where, "name") |
|||
var orgMapCont orgModelsAry |
|||
orgMapCont.Id = strconv.FormatInt(group, 10) |
|||
orgMapCont.Name = orgCont.Name |
|||
orgMap = append(orgMap, orgMapCont) |
|||
} |
|||
} else { |
|||
//写入集团信息
|
|||
where := commonus.MapOut() |
|||
where["id"] = group |
|||
orgCont, _ := commonus.GetNewOrgCont(where, "name") |
|||
var orgMapCont orgModelsAry |
|||
orgMapCont.Id = strconv.FormatInt(group, 10) |
|||
orgMapCont.Name = orgCont.Name |
|||
orgMap = append(orgMap, orgMapCont) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
return orgMap |
|||
} |
|||
|
|||
//定性考核统计
|
|||
func (a *ApiGroup) NatureStatistics(c *gin.Context) { |
|||
isTrue, _ := commonus.ClientIdentity() |
|||
if isTrue != true { |
|||
response.Result(101, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c) |
|||
return |
|||
} |
|||
var requestData natureParameter |
|||
err := c.ShouldBindJSON(&requestData) |
|||
if err != nil { |
|||
response.Result(102, err, "数据获取失败!", c) |
|||
return |
|||
} |
|||
if len(requestData.TargetId) < 1 { |
|||
response.Result(102, err, "未获取到指标", c) |
|||
return |
|||
} |
|||
// var scoreFlow []
|
|||
} |
|||
@ -1,7 +1,31 @@ |
|||
package shiyan |
|||
|
|||
import "sync" |
|||
|
|||
var synPro = sync.WaitGroup{} |
|||
|
|||
type ApiGroup struct { |
|||
// Code generated by github.com/flipped-aurora/gin-vue-admin/server Begin; DO NOT EDIT.
|
|||
ShiyanApi |
|||
// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
|
|||
} |
|||
|
|||
//输出迁移组织架构
|
|||
type outOrgCont struct { |
|||
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` |
|||
Superior int64 `json:"superior" gorm:"column:superior;type:bigint(20) unsigned;default:0;not null;comment:上级ID"` |
|||
OrganizationType int64 `json:"organizationtype" gorm:"column:organization_type;type:bigint(20) unsigned;default:0;not null;comment:行政组织类型"` |
|||
} |
|||
|
|||
//职务相关
|
|||
type jobAttber struct { |
|||
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"` |
|||
Number string `json:"number" gorm:"column:number;type:varchar(255) unsigned;default:'';not null;comment:编号"` |
|||
Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:名称"` |
|||
PersonInCharge int `json:"personincharge" gorm:"column:person_in_charge;type:tinyint(1) unsigned;default:0;not null;comment:是否为本部门负责人"` |
|||
Dutid int64 `json:"dutid" gorm:"column:dutid;type:bigint(20) unsigned;default:0;not null;comment:职务Id"` |
|||
Dutname string `json:"dutname" gorm:"column:dutname;type:varchar(255) unsigned;default:'';not null;comment:职务名称"` |
|||
DutNumber string `json:"dutnumber" gorm:"column:dutnumber;type:varchar(255) unsigned;default:'';not null;comment:职务编号"` |
|||
Jobid int64 `json:"jobid" gorm:"column:jobid;type:bigint(20) unsigned;default:0;not null;comment:职务分类Id"` |
|||
JobName string `json:"jobname" gorm:"column:jobname;type:varchar(255) unsigned;default:'';not null;comment:职务分类名称"` |
|||
} |
|||
|
|||
@ -0,0 +1,9 @@ |
|||
package web |
|||
|
|||
import "github.com/flipped-aurora/gin-vue-admin/server/api/web/jixiaokaohe" |
|||
|
|||
type WebApi struct { |
|||
AchApiGroup jixiaokaohe.ApiGroup |
|||
} |
|||
|
|||
var WebApiGroup = new(WebApi) |
|||
@ -0,0 +1,72 @@ |
|||
package jixiaokaohe |
|||
|
|||
import "github.com/flipped-aurora/gin-vue-admin/server/commonus" |
|||
|
|||
type ApiGroup struct{} |
|||
|
|||
//考核操作提交参数
|
|||
type taskParameterTitle struct { |
|||
Group string `json:"group"` //集团
|
|||
Department string `json:"department"` //部门
|
|||
Target string `json:"targets"` //指标id
|
|||
} |
|||
|
|||
type taskParameterTitleList struct { |
|||
commonus.PageSetLimt |
|||
Group string `json:"group"` //集团
|
|||
Department string `json:"department"` //部门
|
|||
Target string `json:"targets"` //指标id
|
|||
SunTarget string `json:"suntargets"` //指标id
|
|||
} |
|||
|
|||
//输出考核栏目
|
|||
type outTaskSunTarget struct { |
|||
taskParameterTitleList |
|||
ProjectName string `json:"projectName"` |
|||
} |
|||
|
|||
//输出指定人相关的考核细则
|
|||
type outMyTaskDiesTarget struct { |
|||
Id string `json:"id"` |
|||
Title string `json:"title"` |
|||
Standard string `json:"standard"` |
|||
Content string `json:"content"` |
|||
Unit string `json:"unit"` |
|||
taskParameterTitleList |
|||
} |
|||
|
|||
//新型定性考核细则列表输出
|
|||
type NewQualDetailOutList struct { |
|||
NewQualOutList |
|||
Id int64 `json:"id" gorm:"primaryKey;column:qe_id;type:bigint(20) unsigned;not null;comment:Id;index"` |
|||
DetailedTargetId int64 `json:"detailedtargetid" gorm:"column:qe_detailed_target;type:bigint(20) unsigned;default:0;not null;comment:考核细则"` |
|||
DetailedTargetTitle string `json:"detailedtargenttitle" gorm:"column:dt_title;type:text;comment:指标细则"` //指标明细
|
|||
DetailedTargetCont string `json:"detailedtargentcont"` //指标明细
|
|||
AddReduce int `json:"addreduce"` //1:减少;2:增加;3:无属性,现场确认加或减"`
|
|||
Company string `json:"company"` //单位
|
|||
Score string `json:"score"` |
|||
State int `json:"state"` //1、定分;2、区间分;3、不定性分值
|
|||
TargetSun int64 `json:"targetsun" gorm:"column:qe_target_sun;type:bigint(20) unsigned;default:0;not null;comment:考核指标子栏目"` |
|||
TargetSunId string `json:"targetsunid"` //子栏目ID
|
|||
TargetSunName string `json:"targetsunname"` //子栏目名称
|
|||
} |
|||
|
|||
//新型定性考核列表输出
|
|||
type NewQualOutList struct { |
|||
Group int64 `json:"group" gorm:"column:qe_group;type:bigint(20) unsigned;default:0;not null;comment:归属集团"` |
|||
GroupName string `json:"groupname"` //集团
|
|||
Department int64 `json:"department" gorm:"column:qe_accept_evaluation;type:bigint(20) unsigned;default:0;not null;comment:接受考核部门"` |
|||
DepartmentName string `json:"departmentname"` //部门
|
|||
Dimension int64 `json:"dimension" gorm:"column:qe_dimension;type:bigint(20) unsigned;default:0;not null;comment:考核维度"` |
|||
DimensionName string `json:"dimensionname"` //维度
|
|||
Target int64 `json:"target" gorm:"column:qe_target;type:bigint(20) unsigned;default:0;not null;comment:考核指标"` |
|||
Title string `json:"title" gorm:"column:et_title;type:varchar(255);comment:指标名称"` |
|||
ExtraPoints int64 `json:"extrapoints"` //加分总价
|
|||
ScoreReduction int64 `json:"scorereduction"` //减分总计
|
|||
} |
|||
|
|||
//考核方案输出
|
|||
type kaoHeFangAn struct { |
|||
Id int64 `json:"id" gorm:"primaryKey;column:qe_id;type:bigint(20) unsigned;not null;comment:Id;index"` |
|||
DetailedTarget int64 `json:"detailedtarget" gorm:"column:qe_detailed_target;type:bigint(20) unsigned;default:0;not null;comment:考核细则"` |
|||
} |
|||
@ -0,0 +1,192 @@ |
|||
package jixiaokaohe |
|||
|
|||
import ( |
|||
"fmt" |
|||
"strconv" |
|||
|
|||
"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/gin-gonic/gin" |
|||
) |
|||
|
|||
func (a *ApiGroup) Index(c *gin.Context) { |
|||
outPut := commonus.MapOut() |
|||
response.Result(0, outPut, "手机考核入口", c) |
|||
} |
|||
|
|||
//获取关于本人要进行的项目
|
|||
func (a *ApiGroup) AboutMyTask(c *gin.Context) { |
|||
isTrue, userCont := commonus.ClientIdentity() |
|||
if isTrue != true { |
|||
response.Result(101, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c) |
|||
return |
|||
} |
|||
var requestData taskParameterTitle |
|||
err := c.ShouldBindJSON(&requestData) |
|||
if err != nil { |
|||
response.Result(102, err, "数据获取失败!", c) |
|||
return |
|||
} |
|||
if requestData.Group == "" || requestData.Department == "" || requestData.Target == "" { |
|||
response.Result(103, err, "参数错误!请检查您的输入", c) |
|||
return |
|||
} |
|||
var targetId []int64 |
|||
gormDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_target_sun").Where("`qe_group` = ?", requestData.Group).Where("`qe_accept_evaluation` = ?", requestData.Department).Where("`qe_target` = ?", requestData.Target).Where("`qe_type` = 1 AND `qe_state` = 1 AND FIND_IN_SET(?,`qe_operator`)", userCont.Key).Group("qe_target_sun").Find(&targetId) |
|||
errDb := gormDb.Error |
|||
|
|||
if errDb != nil { |
|||
response.Result(103, errDb, "没有数据", c) |
|||
return |
|||
} |
|||
if len(targetId) < 1 { |
|||
response.Result(103, errDb, "没有数据", c) |
|||
return |
|||
} |
|||
var outSunTargetList []outTaskSunTarget |
|||
for _, v := range targetId { |
|||
var outSunTargetInfo outTaskSunTarget |
|||
outSunTargetInfo.Group = requestData.Group |
|||
outSunTargetInfo.Department = requestData.Department |
|||
outSunTargetInfo.Target = requestData.Target |
|||
outSunTargetInfo.SunTarget = strconv.FormatInt(v, 10) |
|||
|
|||
sunTarInfo, _ := commonus.GetQualitativeTargetInfo(v) |
|||
outSunTargetInfo.ProjectName = sunTarInfo.Title |
|||
outSunTargetList = append(outSunTargetList, outSunTargetInfo) |
|||
} |
|||
response.Result(0, outSunTargetList, "获取成功", c) |
|||
} |
|||
|
|||
//获取考核指标细则
|
|||
func (a *ApiGroup) TaskParameterTitleList(c *gin.Context) { |
|||
isTrue, userCont := commonus.ClientIdentity() |
|||
if isTrue != true { |
|||
response.Result(101, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c) |
|||
return |
|||
} |
|||
var requestData taskParameterTitleList |
|||
err := c.ShouldBindJSON(&requestData) |
|||
if requestData.Page < 0 { |
|||
requestData.Page = 1 |
|||
} |
|||
if requestData.PageSize < 0 { |
|||
requestData.PageSize = 20 |
|||
} |
|||
if err != nil { |
|||
response.Result(102, err, "数据获取失败!", c) |
|||
return |
|||
} |
|||
|
|||
if requestData.Group == "" || requestData.Department == "" || requestData.Target == "" || requestData.SunTarget == "" { |
|||
response.Result(103, err, "参数错误!请检查您的输入", c) |
|||
return |
|||
} |
|||
var targetId []kaoHeFangAn |
|||
gormDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_detailed_target,qe_id").Where("`qe_group` = ?", requestData.Group).Where("`qe_accept_evaluation` = ?", requestData.Department).Where("`qe_target` = ?", requestData.Target).Where("`qe_target_sun` = ?", requestData.SunTarget).Where("`qe_type` = 1 AND `qe_state` = 1 AND FIND_IN_SET(?,`qe_operator`)", userCont.Key).Limit(requestData.PageSize).Offset(commonus.CalculatePages(requestData.Page, requestData.PageSize)).Group("qe_detailed_target,qe_id").Find(&targetId) |
|||
errDb := gormDb.Error |
|||
|
|||
if errDb != nil { |
|||
response.Result(103, errDb, "没有数据", c) |
|||
return |
|||
} |
|||
if len(targetId) < 1 { |
|||
response.Result(103, errDb, "没有数据", c) |
|||
return |
|||
} |
|||
// var outDetailedTargetList []outMyTaskDiesTarget
|
|||
// for _, v := range targetId {
|
|||
// var outSunTargetInfo outMyTaskDiesTarget
|
|||
// outSunTargetInfo.Group = requestData.Group
|
|||
// outSunTargetInfo.Department = requestData.Department
|
|||
// outSunTargetInfo.Target = requestData.Target
|
|||
// outSunTargetInfo.SunTarget = requestData.SunTarget
|
|||
// outSunTargetInfo.Id = strconv.FormatInt(v, 10)
|
|||
// sunTarInfo, _ := commonus.GetDetailedTargetInfo(v)
|
|||
// outSunTargetInfo.Title = sunTarInfo.Title
|
|||
// outSunTargetInfo.Content = sunTarInfo.Content
|
|||
// if sunTarInfo.MinScore > 0 && sunTarInfo.MaxScore > 0 {
|
|||
// outSunTargetInfo.Standard = fmt.Sprintf("%v-%v", float64(sunTarInfo.MinScore)/100, float64(sunTarInfo.MaxScore)/100)
|
|||
// } else if sunTarInfo.MinScore > 0 && sunTarInfo.MaxScore <= 0 {
|
|||
// outSunTargetInfo.Standard = fmt.Sprintf("%v", float64(sunTarInfo.MinScore)/100)
|
|||
// } else if sunTarInfo.MinScore <= 0 && sunTarInfo.MaxScore > 0 {
|
|||
// outSunTargetInfo.Standard = fmt.Sprintf("%v", float64(sunTarInfo.MaxScore)/100)
|
|||
// } else {
|
|||
// outSunTargetInfo.Standard = "0"
|
|||
// }
|
|||
// outSunTargetInfo.Unit = sunTarInfo.Company
|
|||
// outDetailedTargetList = append(outDetailedTargetList, outSunTargetInfo)
|
|||
// }
|
|||
// response.Result(0, outDetailedTargetList, "获取成功", c)
|
|||
|
|||
var outContList []NewQualDetailOutList |
|||
for _, v := range targetId { |
|||
|
|||
var outCont NewQualDetailOutList |
|||
outCont.Id = v.Id |
|||
groupId, _ := strconv.ParseInt(requestData.Group, 10, 64) |
|||
outCont.Group = groupId |
|||
|
|||
where := commonus.MapOut() |
|||
where["id"] = groupId |
|||
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name") |
|||
outCont.GroupName = orgCont.Name |
|||
|
|||
whereDepart := commonus.MapOut() |
|||
whereDepart["id"] = requestData.Department |
|||
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name") |
|||
outCont.DepartmentName = orgContDepart.Name |
|||
|
|||
// _, groupCont := commonus.GetGroupCont(v.Group)
|
|||
// outCont.GroupName = groupCont.Name
|
|||
accDepartId, _ := strconv.ParseInt(requestData.Department, 10, 64) |
|||
outCont.Department = accDepartId |
|||
// _, departCont := commonus.GetBranchFactory(requestData.Department)
|
|||
// outCont.DepartmentName = departCont.Name
|
|||
|
|||
targetIDInf, _ := strconv.ParseInt(requestData.Target, 10, 64) |
|||
outCont.Target = targetIDInf |
|||
targetCont, _ := commonus.GetTargetInfo(targetIDInf) |
|||
outCont.Title = targetCont.Title |
|||
|
|||
outCont.Dimension = targetCont.Dimension |
|||
dimensionCont, _ := commonus.GetDutyClassInfo(targetCont.Dimension) |
|||
outCont.DimensionName = dimensionCont.Title |
|||
|
|||
//子栏目
|
|||
targetSunId, _ := strconv.ParseInt(requestData.SunTarget, 10, 64) |
|||
targetSunCont, _ := commonus.GetQualitativeTargetInfo(targetSunId) |
|||
outCont.Target = targetSunId |
|||
outCont.TargetSunId = strconv.FormatInt(targetSunId, 10) |
|||
outCont.TargetSunName = targetSunCont.Title |
|||
|
|||
detaiTargetCont, _ := commonus.GetDetailedTargetInfo(v.DetailedTarget) |
|||
|
|||
outCont.DetailedTargetId = detaiTargetCont.Id |
|||
outCont.DetailedTargetTitle = detaiTargetCont.Title |
|||
|
|||
outCont.DetailedTargetCont = detaiTargetCont.Content |
|||
outCont.AddReduce = detaiTargetCont.AddReduce |
|||
outCont.Company = detaiTargetCont.Company |
|||
outCont.State = 1 |
|||
if detaiTargetCont.MinScore > 0 && detaiTargetCont.MaxScore > 0 { |
|||
outCont.Score = fmt.Sprintf("%v-%v", float64(detaiTargetCont.MinScore)/100, float64(detaiTargetCont.MaxScore)/100) |
|||
outCont.State = 2 |
|||
} else if detaiTargetCont.MinScore > 0 && detaiTargetCont.MaxScore <= 0 { |
|||
outCont.Score = fmt.Sprintf("%v", float64(detaiTargetCont.MinScore)/100) |
|||
outCont.State = 1 |
|||
} else if detaiTargetCont.MinScore <= 0 && detaiTargetCont.MaxScore > 0 { |
|||
outCont.Score = fmt.Sprintf("%v", float64(detaiTargetCont.MaxScore)/100) |
|||
outCont.State = 1 |
|||
} else { |
|||
outCont.Score = "0" |
|||
outCont.State = 3 |
|||
} |
|||
|
|||
outContList = append(outContList, outCont) |
|||
} |
|||
response.Result(0, outContList, "获取成功!", c) |
|||
|
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package jixiaokaohe |
|||
|
|||
import ( |
|||
"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/common/response" |
|||
"github.com/flipped-aurora/gin-vue-admin/server/model/hrsystem" |
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
//获取个人信息
|
|||
func (a *ApiGroup) MyContent(c *gin.Context) { |
|||
isTrue, userCont := commonus.ClientIdentity() |
|||
if isTrue != true { |
|||
response.Result(101, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c) |
|||
return |
|||
} |
|||
var myInfo hrsystem.Personnel |
|||
err := global.GVA_DB_HrDataBase.Where("key = ?", userCont.Key).First(&myInfo).Error |
|||
if err != nil { |
|||
response.Result(102, err, "没有获取到数据!", c) |
|||
return |
|||
} |
|||
response.Result(0, myInfo, "获取成功!", c) |
|||
} |
|||
@ -0,0 +1,5 @@ |
|||
package statisticsrouter |
|||
|
|||
type RouterGroup struct { |
|||
StatisticsRouter |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
package statisticsrouter |
|||
|
|||
import ( |
|||
"github.com/flipped-aurora/gin-vue-admin/server/api/statistics" |
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
type StatisticsRouter struct{} |
|||
|
|||
func (s *StatisticsRouter) InitRouter(Router *gin.RouterGroup) { |
|||
CodeRouter := Router.Group("statistics") |
|||
var initApiRouter = statistics.ApiGroupApp.NatureApi |
|||
{ |
|||
CodeRouter.POST("", initApiRouter.Index) // 首页
|
|||
CodeRouter.POST("gettargetorgandyear", initApiRouter.GetTargetOrgAndYear) // 计算定性考核组织范围,及起止年份
|
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package webrouter |
|||
|
|||
import ( |
|||
"github.com/flipped-aurora/gin-vue-admin/server/api/web" |
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
type WebRouter struct{} |
|||
|
|||
func (s *WebRouter) InitRouter(Router *gin.RouterGroup) { |
|||
CodeRouter := Router.Group("webach") |
|||
var initApiRouter = web.WebApiGroup.AchApiGroup |
|||
{ |
|||
CodeRouter.POST("/", initApiRouter.Index) // 首页
|
|||
CodeRouter.POST("aboutmytask", initApiRouter.AboutMyTask) // 获取定性考核项目列表
|
|||
CodeRouter.POST("taskparametertitlelist", initApiRouter.TaskParameterTitleList) // 获取考核指标细则
|
|||
CodeRouter.POST("mycontent", initApiRouter.MyContent) // 获取个人信息
|
|||
} |
|||
} |
|||
Loading…
Reference in new issue