Browse Source

判断得分是否为零

master
超级管理员 3 years ago
parent
commit
48a3f2a2b5
  1. 6
      api/index/statistics/newstatistics.go
  2. 2
      api/index/statistics/tablestatistics.go
  3. 121
      api/statistics/quantification/summary_details.go
  4. 175
      commonus/publichaneld.go
  5. 2
      router/examtestpage/healthreporthandle.go

6
api/index/statistics/newstatistics.go

@ -58,7 +58,7 @@ func (t *tablePlanVersionStic) conditionStatisticsNew(group, department, dimensi
fmt.Printf("targetid------------->%v------------>%v---->%v\n", targetId, timeClass, string(jsCon)) fmt.Printf("targetid------------->%v------------>%v---->%v\n", targetId, timeClass, string(jsCon))
var mtScore float64 = 0 // var mtScore float64 = 0
var atScore float64 = 0 var atScore float64 = 0
var lastEvalId int64 var lastEvalId int64
// var scoreSum float64 = 0 // var scoreSum float64 = 0
@ -81,7 +81,7 @@ func (t *tablePlanVersionStic) conditionStatisticsNew(group, department, dimensi
} }
// scoreSum = scoreSum + atScore // scoreSum = scoreSum + atScore
// scoreSum = scoreSum + float64(v.Score) // scoreSum = scoreSum + float64(v.Score)
mtScore = mtScore + v.ScoringScore // mtScore = mtScore + v.ScoringScore
if v.DutyDepartment != 0 { if v.DutyDepartment != 0 {
whereDepart := commonus.MapOut() whereDepart := commonus.MapOut()
whereDepart["id"] = v.DutyDepartment whereDepart["id"] = v.DutyDepartment
@ -98,7 +98,7 @@ func (t *tablePlanVersionStic) conditionStatisticsNew(group, department, dimensi
dimensionIdInt, _ := strconv.ParseInt(dimensionId, 10, 64) dimensionIdInt, _ := strconv.ParseInt(dimensionId, 10, 64)
zeroPrize, allPrize, cappingPrize := GetAllZreoCapp(lastEvalId, groupId, departmentId, dimensionIdInt, targetIdInt, yserInt, int64(i), 0) zeroPrize, allPrize, cappingPrize := GetAllZreoCapp(lastEvalId, groupId, departmentId, dimensionIdInt, targetIdInt, yserInt, int64(i), 0)
// fmt.Printf("scoreSum--->%v------->mtScore--->%v---->zeroPrize--->%v---->allPrize--->%v---->cappingPrize--->%v---->typeClass---->%v\n", scoreSum, mtScore, zeroPrize, allPrize, cappingPrize, typeClass) // fmt.Printf("atScore--->%v------->mtScore--->%v---->zeroPrize--->%v---->allPrize--->%v---->cappingPrize--->%v---->typeClass---->%v\n", atScore, mtScore, zeroPrize, allPrize, cappingPrize, typeClass)
tableScoreCont.ActualScore, tableScoreCont.AllPrize, tableScoreCont.ZeroPrize, tableScoreCont.CappingVal, tableScoreCont.Achievement = commonus.CalculateScore(referenceScore, atScore, allPrize, zeroPrize, cappingPrize, typeClass) tableScoreCont.ActualScore, tableScoreCont.AllPrize, tableScoreCont.ZeroPrize, tableScoreCont.CappingVal, tableScoreCont.Achievement = commonus.CalculateScore(referenceScore, atScore, allPrize, zeroPrize, cappingPrize, typeClass)
// tableScoreCont.ActualScore, tableScoreCont.AllPrize, tableScoreCont.ZeroPrize, tableScoreCont.CappingVal, tableScoreCont.Achievement = commonus.CalculateScore(referenceScore, zhidongDongLiang, allPrize, zeroPrize, cappingPrize, typeClass) // tableScoreCont.ActualScore, tableScoreCont.AllPrize, tableScoreCont.ZeroPrize, tableScoreCont.CappingVal, tableScoreCont.Achievement = commonus.CalculateScore(referenceScore, zhidongDongLiang, allPrize, zeroPrize, cappingPrize, typeClass)

2
api/index/statistics/tablestatistics.go

@ -15,7 +15,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
//获取有效版本考核 // 获取有效版本考核
func (a *ApiGroup) GetPlanVersionValid(c *gin.Context) { func (a *ApiGroup) GetPlanVersionValid(c *gin.Context) {
isTrue, userCont := commonus.ClientIdentity() isTrue, userCont := commonus.ClientIdentity()
if isTrue != true { if isTrue != true {

121
api/statistics/quantification/summary_details.go

@ -58,53 +58,53 @@ 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 == "50" { if cv.Id == "52" {
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
groupCont.GetCont(map[string]interface{}{"`id`": planVersion.Group}, "name") groupCont.GetCont(map[string]interface{}{"`id`": planVersion.Group}, "name")
statisCont.GroupName = groupCont.Name //集团名称 statisCont.GroupName = groupCont.Name //集团名称
statisCont.DepartmentId = strconv.FormatInt(planVersion.Department, 10) //部门ID statisCont.DepartmentId = strconv.FormatInt(planVersion.Department, 10) //部门ID
var departCont hrsystem.AdministrativeOrganization var departCont hrsystem.AdministrativeOrganization
departCont.GetCont(map[string]interface{}{"`id`": planVersion.Department}, "name") departCont.GetCont(map[string]interface{}{"`id`": planVersion.Department}, "name")
statisCont.DepartmentName = departCont.Name //部门名称 statisCont.DepartmentName = departCont.Name //部门名称
statisCont.DimensionId = v.Id //维度Id statisCont.DimensionId = v.Id //维度Id
statisCont.DimensionName = v.Name //维度名称 statisCont.DimensionName = v.Name //维度名称
statisCont.DimensionWeight = int64(v.ZhiFraction) //维度权重 statisCont.DimensionWeight = int64(v.ZhiFraction) //维度权重
statisCont.TargetId = cv.Id //指标ID statisCont.TargetId = cv.Id //指标ID
statisCont.TargetName = cv.Name //指标名称 statisCont.TargetName = cv.Name //指标名称
statisCont.TargetCont = cv.Content //指标名称 statisCont.TargetCont = cv.Content //指标名称
statisCont.Targetweight = cv.ReferenceScore //指标权重 statisCont.Targetweight = cv.ReferenceScore //指标权重
var evalTargetCont assessmentmodel.EvaluationTarget var evalTargetCont assessmentmodel.EvaluationTarget
if cv.Id != "" && cv.Id != "0" { if cv.Id != "" && cv.Id != "0" {
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
} }
}
} }
statisCont.Type = evalTargetCont.Type //1:定性;2:定量
statisCont.Unit = cv.Unit //单位
statisCont.Cycle = cv.Cycles //周期
statisCont.Cycleattr = cv.CycleAttres //辅助参数
// statisCont.ExecutiveDepartment = //执行部门
// statisCont.Score = //得分
// if cv.Id != "" && cv.Id != "0" {
// // var targetCont assessmentmodel.EvaluationTarget
// // targetErr := global.GVA_DB_Performanceappraisal.Model(&targetCont).Select("et_type").Where("et_id = ?", cv.Id).First(&targetCont).Error
// if targetErr == nil {
// statisCont.Score, statisCont.ExecutiveDepartment = dingXingMonthSum(planVersion.Group, planVersion.Department, cv.ReferenceScore, requestData.Year, int64(requestData.Months), cv.Id)
// }
// }
lookStatistics = append(lookStatistics, statisCont)
} }
statisCont.Type = evalTargetCont.Type //1:定性;2:定量
statisCont.Unit = cv.Unit //单位
statisCont.Cycle = cv.Cycles //周期
statisCont.Cycleattr = cv.CycleAttres //辅助参数
// statisCont.ExecutiveDepartment = //执行部门
// statisCont.Score = //得分
// if cv.Id != "" && cv.Id != "0" {
// // var targetCont assessmentmodel.EvaluationTarget
// // targetErr := global.GVA_DB_Performanceappraisal.Model(&targetCont).Select("et_type").Where("et_id = ?", cv.Id).First(&targetCont).Error
// if targetErr == nil {
// statisCont.Score, statisCont.ExecutiveDepartment = dingXingMonthSum(planVersion.Group, planVersion.Department, cv.ReferenceScore, requestData.Year, int64(requestData.Months), cv.Id)
// }
// }
lookStatistics = append(lookStatistics, statisCont)
// }
} }
} }
@ -192,7 +192,7 @@ func DingLiangMonthSum(groupId, departmentId, weight, year, month int64, targetI
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
fmt.Printf("err ------flowDataLog------>%v------>%v\n", err, flowDataLog) fmt.Printf("err ------flowDataLog------>err:%v------>status:%v------>flowDataLog:%v\n", err, status, flowDataLog)
if err != nil || len(flowDataLog) < 1 { if err != nil || len(flowDataLog) < 1 {
score = float64(weight) score = float64(weight)
@ -224,10 +224,12 @@ func DingLiangMonthSum(groupId, departmentId, weight, year, month int64, targetI
default: default:
} }
sumScoreEs = sumScoreEs + sumScoreGet sumScoreEs = sumScoreEs + sumScoreGet
fmt.Printf("sumScoreEs--1--->%v\n", v.Score)
} else { } else {
sumScoreEs = sumScoreEs + (float64(v.ScoringScore) / 100) sumScoreEs = sumScoreEs + (float64(v.ScoringScore) / 100)
// sumScoreGet, _, _, _, _ := analysisReward(targetId, v.Baseline, float64(weight), float64(v.ScoringScore)) // sumScoreGet, _, _, _, _ := analysisReward(targetId, v.Baseline, float64(weight), float64(v.ScoringScore))
// sumScoreEs = sumScoreEs + sumScoreGet // sumScoreEs = sumScoreEs + sumScoreGet
fmt.Printf("sumScoreEs--2--->%v\n", sumScoreEs)
} }
} else { } else {
sumScoreEs = sumScoreEs + targetScore sumScoreEs = sumScoreEs + targetScore
@ -242,7 +244,7 @@ func DingLiangMonthSum(groupId, departmentId, weight, year, month int64, targetI
} }
} }
} }
// fmt.Printf("EvalDepartment--3--->%v\n", EvalDepartment) fmt.Printf("sumScoreEs--3--->%v\n", sumScoreEs)
score = sumScoreEs score = sumScoreEs
// if cycs != 4 { // if cycs != 4 {
// score = float64(weight) // score = float64(weight)
@ -277,12 +279,12 @@ func analysisReward(targetId, rewardCont string, targetScore, settlementScore fl
scoreVal = targetScore scoreVal = targetScore
return return
} }
settlementScore = settlementScore / 100
for _, v := range rewardAry { for _, v := range rewardAry {
if v.TargetId == targetId { if v.TargetId == targetId {
allPrize = v.Allprize allPrize = v.Allprize / 100
zeroPrize = v.Zeroprize zeroPrize = v.Zeroprize / 100
CappingVal = v.Capping CappingVal = v.Capping / 100
// fmt.Printf("%v----全奖--1-->%v--零奖------->%v----封顶值---->%v----指标---->%v----计算---->%v-----结果------->%v-----达成率------->%v\n", targetId, allPrize, zeroPrize, CappingVal, targetScore, settlementScore, scoreVal, achievement) // fmt.Printf("%v----全奖--1-->%v--零奖------->%v----封顶值---->%v----指标---->%v----计算---->%v-----结果------->%v-----达成率------->%v\n", targetId, allPrize, zeroPrize, CappingVal, targetScore, settlementScore, scoreVal, achievement)
@ -307,11 +309,19 @@ func analysisReward(targetId, rewardCont string, targetScore, settlementScore fl
// fmt.Printf("%v----全奖--4-->%v--零奖------->%v----封顶值---->%v----指标---->%v----计算---->%v-----结果------->%v-----达成率------->%v\n", targetId, allPrize, zeroPrize, CappingVal, targetScore, settlementScore, scoreVal, achievement) // fmt.Printf("%v----全奖--4-->%v--零奖------->%v----封顶值---->%v----指标---->%v----计算---->%v-----结果------->%v-----达成率------->%v\n", targetId, allPrize, zeroPrize, CappingVal, targetScore, settlementScore, scoreVal, achievement)
} else { } else {
if achievement*100 >= CappingVal/100 { if achievement*100 >= CappingVal/100 {
scoreVal = (CappingVal / 100) * targetScore / 100 if CappingVal > 0 {
scoreVal = (CappingVal / 100) * targetScore
// fmt.Printf("%v----全奖--6-1->%v--零奖------->%v----封顶值---->%v----指标---->%v----计算---->%v-----结果------->%v-----达成率------->%v\n", targetId, allPrize, zeroPrize, CappingVal, targetScore, settlementScore, scoreVal, achievement)
} else {
scoreVal = targetScore
// fmt.Printf("%v----全奖--6-2->%v--零奖------->%v----封顶值---->%v----指标---->%v----计算---->%v-----结果------->%v-----达成率------->%v\n", targetId, allPrize, zeroPrize, CappingVal, targetScore, settlementScore, scoreVal, achievement)
}
} else { } else {
scoreVal = (chuShu / beiChuShu) * targetScore scoreVal = (chuShu / beiChuShu) * targetScore
// fmt.Printf("%v----全奖--6-3->%v--零奖------->%v----封顶值---->%v----指标---->%v----计算---->%v-----结果------->%v-----达成率------->%v\n", targetId, allPrize, zeroPrize, CappingVal, targetScore, settlementScore, scoreVal, achievement)
} }
// fmt.Printf("%v----全奖--6-->%v--零奖------->%v----封顶值---->%v----指标---->%v----计算---->%v-----结果------->%v-----达成率------->%v\n", targetId, allPrize, zeroPrize, CappingVal, targetScore, settlementScore, scoreVal, achievement)
} }
achievement = commonus.DecimalEs(achievement*100, 4) achievement = commonus.DecimalEs(achievement*100, 4)
// fmt.Printf("%v----全奖--6-->%v--零奖------->%v----封顶值---->%v----指标---->%v----计算---->%v-----结果------->%v-----达成率------->%v\n", targetId, allPrize, zeroPrize, CappingVal, targetScore, settlementScore, scoreVal, achievement) // fmt.Printf("%v----全奖--6-->%v--零奖------->%v----封顶值---->%v----指标---->%v----计算---->%v-----结果------->%v-----达成率------->%v\n", targetId, allPrize, zeroPrize, CappingVal, targetScore, settlementScore, scoreVal, achievement)
@ -360,7 +370,12 @@ func analysisReward(targetId, rewardCont string, targetScore, settlementScore fl
} }
} }
scoreVal = commonus.Decimal(scoreVal) if settlementScore == 0 {
scoreVal = 0
} else {
scoreVal = commonus.Decimal(scoreVal)
}
allPrize = commonus.Decimal(allPrize) allPrize = commonus.Decimal(allPrize)
zeroPrize = commonus.Decimal(zeroPrize) zeroPrize = commonus.Decimal(zeroPrize)
CappingVal = commonus.Decimal(CappingVal) CappingVal = commonus.Decimal(CappingVal)

175
commonus/publichaneld.go

@ -26,13 +26,13 @@ import (
"gorm.io/gorm" "gorm.io/gorm"
) )
//遍历所有父类 // 遍历所有父类
type ErgodicStruct struct { type ErgodicStruct struct {
ParentId int64 ParentId int64
Date []int64 Date []int64
} }
//遍历组织架构 // 遍历组织架构
func (e *ErgodicStruct) ErgodicParentClassGroup(id int64, groupStruct []wechat.GroupForm) { func (e *ErgodicStruct) ErgodicParentClassGroup(id int64, groupStruct []wechat.GroupForm) {
for _, v := range groupStruct { for _, v := range groupStruct {
if e.ParentId == 1 { if e.ParentId == 1 {
@ -52,7 +52,7 @@ func (e *ErgodicStruct) ErgodicParentClassGroup(id int64, groupStruct []wechat.G
} }
} }
//冒泡排序法 // 冒泡排序法
func BubbleSort(slice []int64) []int64 { func BubbleSort(slice []int64) []int64 {
for n := 0; n <= len(slice); n++ { for n := 0; n <= len(slice); n++ {
for i := 1; i < len(slice)-n; i++ { for i := 1; i < len(slice)-n; i++ {
@ -75,7 +75,7 @@ func BubbleSortInt(slice []int) []int {
return slice return slice
} }
//编号,纯数字 // 编号,纯数字
func TableNumber(class ...string) (number int64) { func TableNumber(class ...string) (number int64) {
result, _ := rand.Int(rand.Reader, big.NewInt(8999)) result, _ := rand.Int(rand.Reader, big.NewInt(8999))
numberTeam := result.Int64() + 1000 numberTeam := result.Int64() + 1000
@ -89,7 +89,7 @@ func TableNumber(class ...string) (number int64) {
return return
} }
//获取公司,分厂,工段 // 获取公司,分厂,工段
func GetGroupInfo(id int64) (isTrue bool, groupStruct wechat.GroupForm) { func GetGroupInfo(id int64) (isTrue bool, groupStruct wechat.GroupForm) {
isTrue = false isTrue = false
redisClient := redishandel.RunRedis() redisClient := redishandel.RunRedis()
@ -120,7 +120,7 @@ func GetGroupInfo(id int64) (isTrue bool, groupStruct wechat.GroupForm) {
return return
} }
//获主数据库员工信息(微信版本) // 获主数据库员工信息(微信版本)
func GetMainDataBaseUserInfo(weChatId string) (isTrue bool, myInfo testpage.WorkMan) { func GetMainDataBaseUserInfo(weChatId string) (isTrue bool, myInfo testpage.WorkMan) {
isTrue = false isTrue = false
err := global.GVA_DB_Master.Where("qywx_key = ? or wx_key = ?", weChatId, weChatId).First(&myInfo).Error //获取集团信息 err := global.GVA_DB_Master.Where("qywx_key = ? or wx_key = ?", weChatId, weChatId).First(&myInfo).Error //获取集团信息
@ -196,7 +196,7 @@ func GetMainDataBaseUserInfo(weChatId string) (isTrue bool, myInfo testpage.Work
return return
} }
//获取成员信息 // 获取成员信息
func GetWechatUserInfo(weChatId string) (us UserListStruct) { func GetWechatUserInfo(weChatId string) (us UserListStruct) {
if weChatId == "" { if weChatId == "" {
return return
@ -225,7 +225,7 @@ func GetWechatUserInfo(weChatId string) (us UserListStruct) {
return return
} }
//添加企业微信组织 // 添加企业微信组织
func AddWechatGroup(id int64, groupStruct wechat.GroupForm) (groupInfo wechat.GroupForm, isTrue bool) { func AddWechatGroup(id int64, groupStruct wechat.GroupForm) (groupInfo wechat.GroupForm, isTrue bool) {
isTrue = false isTrue = false
groupFrameWork, isTrueErr := GetWechatFramework(id) groupFrameWork, isTrueErr := GetWechatFramework(id)
@ -294,7 +294,7 @@ func AddWechatGroup(id int64, groupStruct wechat.GroupForm) (groupInfo wechat.Gr
return return
} }
//获取成员信息列表(企业威信数据库) // 获取成员信息列表(企业威信数据库)
func GetMemberList() (userStruct []wechat.WechatUsers, isTrue bool) { func GetMemberList() (userStruct []wechat.WechatUsers, isTrue bool) {
isTrue = false isTrue = false
var userAry []wechat.WechatUsers var userAry []wechat.WechatUsers
@ -451,14 +451,14 @@ func GetMemberList() (userStruct []wechat.WechatUsers, isTrue bool) {
return return
} }
//获取全国风险地区列表(企鹅接口 https://view.inews.qq.com/g2/getOnsInfo?name=disease_h5) // 获取全国风险地区列表(企鹅接口 https://view.inews.qq.com/g2/getOnsInfo?name=disease_h5)
func NationalRiskArea() []byte { func NationalRiskArea() []byte {
nationalUrl := "https://view.inews.qq.com/g2/getOnsInfo?name=disease_h5" nationalUrl := "https://view.inews.qq.com/g2/getOnsInfo?name=disease_h5"
userInfo := CurlGet(nationalUrl) userInfo := CurlGet(nationalUrl)
return userInfo return userInfo
} }
//获取全国风险地区列表数据处理 // 获取全国风险地区列表数据处理
func GetNationalRiskArea() (riskAreaCityList []RegionalRiskLevel, isTrue bool) { func GetNationalRiskArea() (riskAreaCityList []RegionalRiskLevel, isTrue bool) {
isTrue = false isTrue = false
redisClient := redishandel.RunRedis() redisClient := redishandel.RunRedis()
@ -541,7 +541,7 @@ func GetNationalRiskArea() (riskAreaCityList []RegionalRiskLevel, isTrue bool) {
return return
} }
//写入异常人员列表 // 写入异常人员列表
func WriteInMan(wechat, calCulTime string, groupId int64) { func WriteInMan(wechat, calCulTime string, groupId int64) {
if wechat == "" { if wechat == "" {
return return
@ -570,14 +570,14 @@ func WriteInMan(wechat, calCulTime string, groupId int64) {
} }
} }
//通用查询结果到map结构 // 通用查询结果到map结构
type GormTopMap struct { type GormTopMap struct {
Db *gorm.DB Db *gorm.DB
TableName string TableName string
WhereMap map[string]interface{} WhereMap map[string]interface{}
} }
//输出Map查询数据库结果(多行) // 输出Map查询数据库结果(多行)
func (g *GormTopMap) PublicOrmToMap() (returnData []map[string]interface{}) { func (g *GormTopMap) PublicOrmToMap() (returnData []map[string]interface{}) {
if len(g.WhereMap) > 0 { if len(g.WhereMap) > 0 {
g.Db.Table(g.TableName).Where(g.WhereMap).Find(&returnData) g.Db.Table(g.TableName).Where(g.WhereMap).Find(&returnData)
@ -587,7 +587,7 @@ func (g *GormTopMap) PublicOrmToMap() (returnData []map[string]interface{}) {
return return
} }
//输出Map查询数据库结果(单行) // 输出Map查询数据库结果(单行)
func (g *GormTopMap) PublicOrmToMapOne() (returnData map[string]interface{}) { func (g *GormTopMap) PublicOrmToMapOne() (returnData map[string]interface{}) {
var selectData []map[string]interface{} var selectData []map[string]interface{}
if len(g.WhereMap) > 0 { if len(g.WhereMap) > 0 {
@ -601,7 +601,7 @@ func (g *GormTopMap) PublicOrmToMapOne() (returnData map[string]interface{}) {
return return
} }
//判断地址中是否还有http或https // 判断地址中是否还有http或https
func JudgeHttpOrHttps(urlStr string) (isTrue bool) { func JudgeHttpOrHttps(urlStr string) (isTrue bool) {
isTrue = false isTrue = false
re := regexp.MustCompile(`(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?`) re := regexp.MustCompile(`(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?`)
@ -617,7 +617,7 @@ func JudgeHttpOrHttps(urlStr string) (isTrue bool) {
return return
} }
//获取工段信息 // 获取工段信息
func GetWorkShopSection(id int64) (isTrue bool, workShopesStruct testpage.WorkShopsection) { //工段表结构 func GetWorkShopSection(id int64) (isTrue bool, workShopesStruct testpage.WorkShopsection) { //工段表结构
isTrue = false isTrue = false
err := global.GVA_DB_Master.Where("ws_id = ?", id).First(&workShopesStruct).Error //获取工段信息 err := global.GVA_DB_Master.Where("ws_id = ?", id).First(&workShopesStruct).Error //获取工段信息
@ -628,7 +628,7 @@ func GetWorkShopSection(id int64) (isTrue bool, workShopesStruct testpage.WorkSh
return return
} }
//用户端身份解析 // 用户端身份解析
func ClientIdentity() (isTrue bool, redisUserInfo testpage.RedisUserInfo) { func ClientIdentity() (isTrue bool, redisUserInfo testpage.RedisUserInfo) {
// keyStr := strconv.FormatInt(global.GVA_INDEX_USERKEY, 10) // keyStr := strconv.FormatInt(global.GVA_INDEX_USERKEY, 10)
// redisClient := redishandel.RunRedis() // redisClient := redishandel.RunRedis()
@ -661,7 +661,7 @@ func ClientIdentity() (isTrue bool, redisUserInfo testpage.RedisUserInfo) {
return return
} }
//获取用户信息 // 获取用户信息
func getPeopleInfo() (redisUserInfo testpage.RedisUserInfo, isTrue bool) { func getPeopleInfo() (redisUserInfo testpage.RedisUserInfo, isTrue bool) {
isTrue = false isTrue = false
var ueInfo hrsystem.PersonArchives var ueInfo hrsystem.PersonArchives
@ -731,7 +731,7 @@ func getPeopleInfo() (redisUserInfo testpage.RedisUserInfo, isTrue bool) {
return return
} }
//获取权限点位 // 获取权限点位
func getRoleInt(roleId string) (menuStr, buttonStr string) { func getRoleInt(roleId string) (menuStr, buttonStr string) {
var roleInfo systemuser.SystemRole var roleInfo systemuser.SystemRole
err := global.GVA_DB_Master.Where("`r_id` = ?", roleId).First(&roleInfo).Error err := global.GVA_DB_Master.Where("`r_id` = ?", roleId).First(&roleInfo).Error
@ -743,7 +743,7 @@ func getRoleInt(roleId string) (menuStr, buttonStr string) {
return return
} }
//获取员工公司组织 // 获取员工公司组织
func getOrgCont(id string) (oldId, orgName string) { func getOrgCont(id string) (oldId, orgName string) {
var orgInfo hrsystem.AdministrativeOrganization var orgInfo hrsystem.AdministrativeOrganization
err := global.GVA_DB_HrDataBase.Where("`id` = ?", id).First(&orgInfo).Error err := global.GVA_DB_HrDataBase.Where("`id` = ?", id).First(&orgInfo).Error
@ -755,7 +755,7 @@ func getOrgCont(id string) (oldId, orgName string) {
return return
} }
//获取新行政组织内容 // 获取新行政组织内容
func GetNewOrgCont(where interface{}, field ...string) (orgCont hrsystem.AdministrativeOrganization, err error) { func GetNewOrgCont(where interface{}, field ...string) (orgCont hrsystem.AdministrativeOrganization, err error) {
gormDb := global.GVA_DB_HrDataBase.Model(&hrsystem.AdministrativeOrganization{}) gormDb := global.GVA_DB_HrDataBase.Model(&hrsystem.AdministrativeOrganization{})
if len(field) > 0 { if len(field) > 0 {
@ -767,7 +767,7 @@ func GetNewOrgCont(where interface{}, field ...string) (orgCont hrsystem.Adminis
return return
} }
//获取员工公司职务 // 获取员工公司职务
func getPositionCont(id int64) (oldId, orgName string) { func getPositionCont(id int64) (oldId, orgName string) {
var orgInfo hrsystem.Position var orgInfo hrsystem.Position
err := global.GVA_DB_HrDataBase.Where("`id` = ?", id).First(&orgInfo).Error err := global.GVA_DB_HrDataBase.Where("`id` = ?", id).First(&orgInfo).Error
@ -779,7 +779,7 @@ func getPositionCont(id int64) (oldId, orgName string) {
return return
} }
//自定义管理端身份解析 // 自定义管理端身份解析
func AdminClientIdentity() (isTrue bool, redisAdminInfo systemuser.RedisAdminInfo) { func AdminClientIdentity() (isTrue bool, redisAdminInfo systemuser.RedisAdminInfo) {
// keyStr := strconv.FormatInt(global.GVA_ADMIN_USERKEY, 10) // keyStr := strconv.FormatInt(global.GVA_ADMIN_USERKEY, 10)
// redisClient := redishandel.RunRedis() // redisClient := redishandel.RunRedis()
@ -796,7 +796,7 @@ func AdminClientIdentity() (isTrue bool, redisAdminInfo systemuser.RedisAdminInf
return return
} }
//更具微信ID获取员工信息 // 更具微信ID获取员工信息
func GetUesrContForWechatID(wechatId string) (isTrue bool, myCont PublicUserCont) { func GetUesrContForWechatID(wechatId string) (isTrue bool, myCont PublicUserCont) {
redisClient := redishandel.RunRedis() redisClient := redishandel.RunRedis()
isTrue = false isTrue = false
@ -1055,7 +1055,7 @@ func GetUesrContForWechatID(wechatId string) (isTrue bool, myCont PublicUserCont
return return
} }
//计算年龄 // 计算年龄
func CalculateAge(birthday int64) (shengRi int) { func CalculateAge(birthday int64) (shengRi int) {
dangQianShijian := time.Now().Unix() dangQianShijian := time.Now().Unix()
ageFloat := float64(dangQianShijian) - float64(birthday) ageFloat := float64(dangQianShijian) - float64(birthday)
@ -1322,7 +1322,7 @@ func GetUesrContForWechatIDOld(wechatId string) (isTrue bool, myCont PublicUserC
return return
} }
//获得分厂名称 // 获得分厂名称
func GetBranchFactory(id int64) (isTrue bool, ContInfo hrsystem.AdministrativeOrganization) { func GetBranchFactory(id int64) (isTrue bool, ContInfo hrsystem.AdministrativeOrganization) {
isTrue = false isTrue = false
err := global.GVA_DB_HrDataBase.Where("`Id` = ?", id).First(&ContInfo).Error err := global.GVA_DB_HrDataBase.Where("`Id` = ?", id).First(&ContInfo).Error
@ -1340,7 +1340,7 @@ func GetBranchFactoryOld(id int64) (isTrue bool, ContInfo testpage.BranchFactory
return return
} }
//获取职务信息 // 获取职务信息
func GetPosition(id int64) (isTrue bool, content hrsystem.Position) { func GetPosition(id int64) (isTrue bool, content hrsystem.Position) {
isTrue = false isTrue = false
err := global.GVA_DB_HrDataBase.Where("`id` = ?", id).First(&content).Error err := global.GVA_DB_HrDataBase.Where("`id` = ?", id).First(&content).Error
@ -1359,7 +1359,7 @@ func GetPositionOld(id int64) (isTrue bool, content testpage.Position) {
return return
} }
//获取班组信息 // 获取班组信息
func GetTeaming(id int64) (isTrue bool, content hrsystem.TeamGroup) { func GetTeaming(id int64) (isTrue bool, content hrsystem.TeamGroup) {
isTrue = false isTrue = false
err := global.GVA_DB_HrDataBase.Where("`id` = ?", id).First(&content).Error err := global.GVA_DB_HrDataBase.Where("`id` = ?", id).First(&content).Error
@ -1369,7 +1369,7 @@ func GetTeaming(id int64) (isTrue bool, content hrsystem.TeamGroup) {
return return
} }
//获取职务最大权重ID // 获取职务最大权重ID
func GetPositionMaxWeight(departmentID int64) (isTrue bool, content testpage.Position) { func GetPositionMaxWeight(departmentID int64) (isTrue bool, content testpage.Position) {
isTrue = false isTrue = false
selectData := MapOut() selectData := MapOut()
@ -1384,7 +1384,7 @@ func GetPositionMaxWeight(departmentID int64) (isTrue bool, content testpage.Pos
return return
} }
//获取职责内容 // 获取职责内容
func GetDutyContDepart(id int64) (isTrue bool, dutyAssClass DutyAssClass) { func GetDutyContDepart(id int64) (isTrue bool, dutyAssClass DutyAssClass) {
isTrue = false isTrue = false
var dutyCont assessmentmodel.DepartDuty var dutyCont assessmentmodel.DepartDuty
@ -1420,7 +1420,7 @@ func GetDutyContDepart(id int64) (isTrue bool, dutyAssClass DutyAssClass) {
return return
} }
//获取集团信息 // 获取集团信息
func GetGroupCont(id int64) (isTrue bool, ContInfo wechat.GroupForm) { func GetGroupCont(id int64) (isTrue bool, ContInfo wechat.GroupForm) {
isTrue = false isTrue = false
err := global.GVA_DB_WatchDate.Where("g_id = ?", id).First(&ContInfo).Error err := global.GVA_DB_WatchDate.Where("g_id = ?", id).First(&ContInfo).Error
@ -1430,7 +1430,7 @@ func GetGroupCont(id int64) (isTrue bool, ContInfo wechat.GroupForm) {
return return
} }
//获取考核细则相关内容 // 获取考核细则相关内容
func GetDutyCont(field, whereData interface{}) (isTrue bool, outData map[string]interface{}) { func GetDutyCont(field, whereData interface{}) (isTrue bool, outData map[string]interface{}) {
isTrue = false isTrue = false
errAss := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DutyContent{}).Select(field).Where(whereData).First(&outData).Error errAss := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DutyContent{}).Select(field).Where(whereData).First(&outData).Error
@ -1441,7 +1441,7 @@ func GetDutyCont(field, whereData interface{}) (isTrue bool, outData map[string]
return return
} }
//获取人员信息 // 获取人员信息
func GetUserInfoPublic(field interface{}, whereMap map[string]interface{}) (userCont hrsystem.ManCont, isTrue bool) { func GetUserInfoPublic(field interface{}, whereMap map[string]interface{}) (userCont hrsystem.ManCont, isTrue bool) {
isTrue = false isTrue = false
// var userInfo testpage.WorkMan // var userInfo testpage.WorkMan
@ -1462,7 +1462,7 @@ func GetUserInfoPublicOld(field interface{}, whereMap map[string]interface{}) (u
return return
} }
//获取考核指标信息 // 获取考核指标信息
func GetTargetInfo(id int64) (content assessmentmodel.EvaluationTarget, isTrue bool) { func GetTargetInfo(id int64) (content assessmentmodel.EvaluationTarget, isTrue bool) {
isTrue = false isTrue = false
err := global.GVA_DB_Performanceappraisal.Where("et_id = ?", id).First(&content).Error err := global.GVA_DB_Performanceappraisal.Where("et_id = ?", id).First(&content).Error
@ -1472,7 +1472,7 @@ func GetTargetInfo(id int64) (content assessmentmodel.EvaluationTarget, isTrue b
return return
} }
//获取考核指标信息 // 获取考核指标信息
func GetQualitativeTargetInfo(id int64) (content assessmentmodel.QualitativeTarget, isTrue bool) { func GetQualitativeTargetInfo(id int64) (content assessmentmodel.QualitativeTarget, isTrue bool) {
isTrue = false isTrue = false
err := global.GVA_DB_Performanceappraisal.Where("q_id = ?", id).First(&content).Error err := global.GVA_DB_Performanceappraisal.Where("q_id = ?", id).First(&content).Error
@ -1482,7 +1482,7 @@ func GetQualitativeTargetInfo(id int64) (content assessmentmodel.QualitativeTarg
return return
} }
//获取考核指标细则 // 获取考核指标细则
func GetDetailedTargetInfo(id int64) (content assessmentmodel.DetailedTarget, isTrue bool) { func GetDetailedTargetInfo(id int64) (content assessmentmodel.DetailedTarget, isTrue bool) {
isTrue = false isTrue = false
if id == 0 { if id == 0 {
@ -1496,7 +1496,7 @@ func GetDetailedTargetInfo(id int64) (content assessmentmodel.DetailedTarget, is
return return
} }
//获取考核指标细则 // 获取考核指标细则
func GetDetailedTargetInfoWher(wher interface{}, filed ...string) (content assessmentmodel.DetailedTarget, isTrue bool) { func GetDetailedTargetInfoWher(wher interface{}, filed ...string) (content assessmentmodel.DetailedTarget, isTrue bool) {
isTrue = false isTrue = false
goromDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DetailedTarget{}) goromDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DetailedTarget{})
@ -1512,7 +1512,7 @@ func GetDetailedTargetInfoWher(wher interface{}, filed ...string) (content asses
return return
} }
//获取考核指标细则 // 获取考核指标细则
func GetDetailedTargetInfoTitle(id int64, title string) (content assessmentmodel.DetailedTarget, isTrue bool) { func GetDetailedTargetInfoTitle(id int64, title string) (content assessmentmodel.DetailedTarget, isTrue bool) {
isTrue = false isTrue = false
gormDb := global.GVA_DB_Performanceappraisal gormDb := global.GVA_DB_Performanceappraisal
@ -1526,7 +1526,7 @@ func GetDetailedTargetInfoTitle(id int64, title string) (content assessmentmodel
return return
} }
//获取考核类别 // 获取考核类别
func GetDutyClassInfo(id int64) (content assessmentmodel.DutyClass, isTrue bool) { func GetDutyClassInfo(id int64) (content assessmentmodel.DutyClass, isTrue bool) {
isTrue = false isTrue = false
err := global.GVA_DB_Performanceappraisal.Where("id = ?", id).First(&content).Error err := global.GVA_DB_Performanceappraisal.Where("id = ?", id).First(&content).Error
@ -1536,7 +1536,7 @@ func GetDutyClassInfo(id int64) (content assessmentmodel.DutyClass, isTrue bool)
return return
} }
//添加维度指标或维度权重 // 添加维度指标或维度权重
func AddDimenTargetWeight(setType, group, departmentID, dimensionId, targetId int64) { func AddDimenTargetWeight(setType, group, departmentID, dimensionId, targetId int64) {
var weightSum int64 = 0 var weightSum int64 = 0
// fmt.Printf("1-----@---2------->%v\n", targetId) // fmt.Printf("1-----@---2------->%v\n", targetId)
@ -1635,7 +1635,7 @@ func AddDimensionWeight(setType, group, departmentID, dimensionId int64) {
} }
} }
//获取维度或指标权重 // 获取维度或指标权重
func GetDimesionTargetWeight(setType, group, departmentID, dimensionId, targetId int64) (weight int64) { func GetDimesionTargetWeight(setType, group, departmentID, dimensionId, targetId int64) (weight int64) {
var ddwCont assessmentmodel.DepartmentDimensionWeight var ddwCont assessmentmodel.DepartmentDimensionWeight
gormDb := global.GVA_DB_Performanceappraisal gormDb := global.GVA_DB_Performanceappraisal
@ -1654,7 +1654,7 @@ func GetDimesionTargetWeight(setType, group, departmentID, dimensionId, targetId
return return
} }
//根据部门获取内勤数据 // 根据部门获取内勤数据
func GetOfficeWork(id, departmentId int64) (isTrue bool, roleUser []roleGroupBodyAry, roleGroup systemuser.RoleGroup) { func GetOfficeWork(id, departmentId int64) (isTrue bool, roleUser []roleGroupBodyAry, roleGroup systemuser.RoleGroup) {
isTrue = false isTrue = false
departID := strconv.FormatInt(departmentId, 10) departID := strconv.FormatInt(departmentId, 10)
@ -1686,7 +1686,7 @@ func GetOfficeWork(id, departmentId int64) (isTrue bool, roleUser []roleGroupBod
return return
} }
//获取企业微信信息接收人 // 获取企业微信信息接收人
func GetSendMsgUser(id, departmentId int64) (isTrue bool, userStr string) { func GetSendMsgUser(id, departmentId int64) (isTrue bool, userStr string) {
isTrue = false isTrue = false
// err, departmentCont := GetBranchFactory(departmentId) // err, departmentCont := GetBranchFactory(departmentId)
@ -1714,7 +1714,7 @@ func GetSendMsgUser(id, departmentId int64) (isTrue bool, userStr string) {
return return
} }
//获取企业微信信息接收人数组形态 // 获取企业微信信息接收人数组形态
func GetSendMsgUserAry(id, departmentId int64) (isTrue bool, userStr []string) { func GetSendMsgUserAry(id, departmentId int64) (isTrue bool, userStr []string) {
isTrue = false isTrue = false
// err, departmentCont := GetBranchFactory(departmentId) // err, departmentCont := GetBranchFactory(departmentId)
@ -1746,7 +1746,7 @@ func GetSendMsgUserAry(id, departmentId int64) (isTrue bool, userStr []string) {
return return
} }
//获取加减分订单 // 获取加减分订单
func GetScoreFlow(orderId string) (content assessmentmodel.ScoreFlow, isTrue bool) { func GetScoreFlow(orderId string) (content assessmentmodel.ScoreFlow, isTrue bool) {
isTrue = false isTrue = false
judgeErr := global.GVA_DB_Performanceappraisal.Where("`sf_key` = ?", orderId).First(&content).Error judgeErr := global.GVA_DB_Performanceappraisal.Where("`sf_key` = ?", orderId).First(&content).Error
@ -1756,7 +1756,7 @@ func GetScoreFlow(orderId string) (content assessmentmodel.ScoreFlow, isTrue boo
return return
} }
//审批流程 // 审批流程
func GetEvaluationProcess(orderId string) (content assessmentmodel.EvaluationProcess, isTrue bool) { func GetEvaluationProcess(orderId string) (content assessmentmodel.EvaluationProcess, isTrue bool) {
isTrue = false isTrue = false
judgeErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", orderId).First(&content).Error judgeErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", orderId).First(&content).Error
@ -1766,7 +1766,7 @@ func GetEvaluationProcess(orderId string) (content assessmentmodel.EvaluationPro
return return
} }
//考核方案 // 考核方案
func GetQualitativeEvaluation(orderId string) (content assessmentmodel.QualitativeEvaluation, isTrue bool) { func GetQualitativeEvaluation(orderId string) (content assessmentmodel.QualitativeEvaluation, isTrue bool) {
isTrue = false isTrue = false
judgeErr := global.GVA_DB_Performanceappraisal.Where("`qe_id` = ?", orderId).First(&content).Error judgeErr := global.GVA_DB_Performanceappraisal.Where("`qe_id` = ?", orderId).First(&content).Error
@ -1809,7 +1809,7 @@ func GetDutyAssociatedItems(orderId string) (targettitle, detailedRulesTitle, de
return return
} }
//获取加减分订单 // 获取加减分订单
func GetFlowLog(orderId string) (content assessmentmodel.FlowLog, isTrue bool) { func GetFlowLog(orderId string) (content assessmentmodel.FlowLog, isTrue bool) {
isTrue = false isTrue = false
judgeErr := global.GVA_DB_Performanceappraisal.Where("`fl_key` = ?", orderId).First(&content).Error judgeErr := global.GVA_DB_Performanceappraisal.Where("`fl_key` = ?", orderId).First(&content).Error
@ -1851,7 +1851,7 @@ func GetDutyRationtedItems(orderId string) (targettitle, detailedRulesTitle, det
return return
} }
//获取角色组 // 获取角色组
func GetRoleGroup(id int64) (roleGroup systemuser.RoleGroup, isTrue bool) { func GetRoleGroup(id int64) (roleGroup systemuser.RoleGroup, isTrue bool) {
isTrue = false isTrue = false
err := global.GVA_DB_Master.Where("`srg_id` = ?", id).First(&roleGroup).Error //16118387069540343 err := global.GVA_DB_Master.Where("`srg_id` = ?", id).First(&roleGroup).Error //16118387069540343
@ -1862,7 +1862,7 @@ func GetRoleGroup(id int64) (roleGroup systemuser.RoleGroup, isTrue bool) {
return return
} }
//根据userkey 用户获取信息 // 根据userkey 用户获取信息
func GetWorkUser(key string) (userCont hrsystem.PersonArchives, isTrue bool) { func GetWorkUser(key string) (userCont hrsystem.PersonArchives, isTrue bool) {
isTrue = false isTrue = false
userErr := global.GVA_DB_HrDataBase.Model(&userCont).Where("`key` = ?", key).First(&userCont).Error userErr := global.GVA_DB_HrDataBase.Model(&userCont).Where("`key` = ?", key).First(&userCont).Error
@ -1930,7 +1930,7 @@ type sendMsg struct {
DetailedTarget int64 `json:"detailedtarget"` //指标细则"` DetailedTarget int64 `json:"detailedtarget"` //指标细则"`
} }
//查看定量考核数据 // 查看定量考核数据
func LookRationInfo(id int64) (cont sendMsg, isTrue bool) { func LookRationInfo(id int64) (cont sendMsg, isTrue bool) {
isTrue = false isTrue = false
qeInfo, isTrue := GetQualitativeEvaluation(strconv.FormatInt(id, 10)) qeInfo, isTrue := GetQualitativeEvaluation(strconv.FormatInt(id, 10))
@ -1959,7 +1959,7 @@ func LookRationInfo(id int64) (cont sendMsg, isTrue bool) {
return return
} }
//获取企业微信对照表 // 获取企业微信对照表
func GetWorkWechatDuiZhao(openid string) (userInfoStruct wechat.WechatUsers, isTrue bool) { func GetWorkWechatDuiZhao(openid string) (userInfoStruct wechat.WechatUsers, isTrue bool) {
isTrue = false isTrue = false
myErr := global.GVA_DB_WatchDate.Where("userid = ?", openid).First(&userInfoStruct).Error myErr := global.GVA_DB_WatchDate.Where("userid = ?", openid).First(&userInfoStruct).Error
@ -2459,7 +2459,7 @@ func InsetFlowLogEs(state, stepInt int, userKey, flowMapStr string, encFile []En
return return
} }
//写入责任分配节点人员信息 // 写入责任分配节点人员信息
func WriteFlowMainSet(orderId int64, userKey []int64) { func WriteFlowMainSet(orderId int64, userKey []int64) {
fmt.Printf("Zeren--1-->%v\n", userKey) fmt.Printf("Zeren--1-->%v\n", userKey)
if len(userKey) < 1 { if len(userKey) < 1 {
@ -3156,7 +3156,7 @@ func GetFlowNodeManEs(flowID int64, class, style, writeLog int, encFile []Enclos
return return
} }
//编辑流程步进器 // 编辑流程步进器
func EiteDutiesInfoes(saveId int64, saveData map[string]interface{}) (isTrue bool, infoErr error) { func EiteDutiesInfoes(saveId int64, saveData map[string]interface{}) (isTrue bool, infoErr error) {
isTrue = false isTrue = false
infoErr = global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationProcess{}).Where("`ep_id` = ?", saveId).Updates(saveData).Error infoErr = global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationProcess{}).Where("`ep_id` = ?", saveId).Updates(saveData).Error
@ -3167,7 +3167,7 @@ func EiteDutiesInfoes(saveId int64, saveData map[string]interface{}) (isTrue boo
return return
} }
//步骤名称 // 步骤名称
func GetSetpName(setId int) (setpName string) { func GetSetpName(setId int) (setpName string) {
switch setId { switch setId {
case 1: case 1:
@ -3201,7 +3201,7 @@ func Round(val float64, precision int) float64 {
return math.Floor(val*p+0.5) / p return math.Floor(val*p+0.5) / p
} }
//获取班组成员 // 获取班组成员
func GetTeamUserList(group, department, postId, teamId string) (userCont []hrsystem.ManCont, isTrue bool) { func GetTeamUserList(group, department, postId, teamId string) (userCont []hrsystem.ManCont, isTrue bool) {
wheAry := MapOut() wheAry := MapOut()
wheAry["company"] = group wheAry["company"] = group
@ -3234,7 +3234,7 @@ func GetTeamUserListOld(group, department, postId, teamId string) (userCont []te
return return
} }
//编辑分数流水 // 编辑分数流水
func EiteScoreFlow(saveId int64, saveData map[string]interface{}) (isTrue bool, infoErr error) { func EiteScoreFlow(saveId int64, saveData map[string]interface{}) (isTrue bool, infoErr error) {
isTrue = false isTrue = false
infoErr = global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Where("`sf_key` = ?", saveId).Updates(saveData).Error infoErr = global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Where("`sf_key` = ?", saveId).Updates(saveData).Error
@ -3245,7 +3245,7 @@ func EiteScoreFlow(saveId int64, saveData map[string]interface{}) (isTrue bool,
return return
} }
//获取通用责任划分 // 获取通用责任划分
func GetDivisionOfResponsibility(orderId string, class int) (contList []map[string]interface{}, err error) { func GetDivisionOfResponsibility(orderId string, class int) (contList []map[string]interface{}, err error) {
var dataContList []assessmentmodel.DivisionResponsibilities var dataContList []assessmentmodel.DivisionResponsibilities
err = global.GVA_DB_Performanceappraisal.Where("`df_sf_id` = ?", orderId).Order("df_type ASC").Find(&dataContList).Error err = global.GVA_DB_Performanceappraisal.Where("`df_sf_id` = ?", orderId).Order("df_type ASC").Find(&dataContList).Error
@ -3481,7 +3481,7 @@ func GetDivisionOfResponsibility(orderId string, class int) (contList []map[stri
return return
} }
//判断是否存在 // 判断是否存在
func IsItTrue(id int64, idAry []int64) (isTrue bool) { func IsItTrue(id int64, idAry []int64) (isTrue bool) {
isTrue = false isTrue = false
for _, v := range idAry { for _, v := range idAry {
@ -3511,7 +3511,7 @@ func IsItTrueString(id string, idAry []string) (isTrue bool) {
return return
} }
//判断是否存在泛型 // 判断是否存在泛型
type faxingType interface { type faxingType interface {
int | int8 | int16 | int32 | int64 | string int | int8 | int16 | int32 | int64 | string
} }
@ -3526,7 +3526,7 @@ func IsInTrue[T faxingType](key T, keyAry []T) (isTrue bool) {
return return
} }
//获取多部门归属集团 // 获取多部门归属集团
func GetDuboDepart(departAry []string) (group []string) { func GetDuboDepart(departAry []string) (group []string) {
fmt.Printf("DeparAry--------->%v\n", departAry) fmt.Printf("DeparAry--------->%v\n", departAry)
for _, v := range departAry { for _, v := range departAry {
@ -3551,7 +3551,7 @@ func GetDuboDepart(departAry []string) (group []string) {
return return
} }
//获取新HR系统的集团 // 获取新HR系统的集团
func GetNewHrOrg(departID int64) (groupId int64, isTrue bool) { func GetNewHrOrg(departID int64) (groupId int64, isTrue bool) {
isTrue = false isTrue = false
var govMap OutGovCont var govMap OutGovCont
@ -3577,7 +3577,7 @@ func GetNewHrOrg(departID int64) (groupId int64, isTrue bool) {
return return
} }
//递归查找集团 // 递归查找集团
func diGuiOrg(superior int64) (groupId int64) { func diGuiOrg(superior int64) (groupId int64) {
// fmt.Printf("DiGui----->%v\n", superior) // fmt.Printf("DiGui----->%v\n", superior)
// return // return
@ -3601,7 +3601,7 @@ func diGuiOrg(superior int64) (groupId int64) {
return return
} }
//批量获取相关人员部门id // 批量获取相关人员部门id
func GetDepartmentByUserBast(userKey []string) (userDepartmentId []string) { func GetDepartmentByUserBast(userKey []string) (userDepartmentId []string) {
if len(userKey) < 1 { if len(userKey) < 1 {
return return
@ -3774,7 +3774,7 @@ func GetBranchDepartAry(departIdAry []string) (departId []int64, departAry []Dep
return return
} }
//获取新组织架构的行政信息 // 获取新组织架构的行政信息
func GetNewOrgList(departIdAry []string) (departId []int64, departAry []DepartmentAryType) { func GetNewOrgList(departIdAry []string) (departId []int64, departAry []DepartmentAryType) {
for _, v := range departIdAry { for _, v := range departIdAry {
where := MapOut() where := MapOut()
@ -4047,14 +4047,14 @@ func AddWeight(group, dimension, derpatment, target string, score, class int64)
return return
} }
//获取定量考核目标设定 // 获取定量考核目标设定
func GetQuantitativeConfig(whereData interface{}) (cont assessmentmodel.QuantitativeConfig) { func GetQuantitativeConfig(whereData interface{}) (cont assessmentmodel.QuantitativeConfig) {
global.GVA_DB_Performanceappraisal.Where(whereData).First(&cont) global.GVA_DB_Performanceappraisal.Where(whereData).First(&cont)
fmt.Printf("TargrtCont------1------>%v\n", cont) fmt.Printf("TargrtCont------1------>%v\n", cont)
return return
} }
//获取定量考核时间内审批通过的考核数据 // 获取定量考核时间内审批通过的考核数据
func GetTimeIntervalDuty(whereData interface{}, schemeID int64) (actual float64) { func GetTimeIntervalDuty(whereData interface{}, schemeID int64) (actual float64) {
jsonStr, _ := json.Marshal(whereData) jsonStr, _ := json.Marshal(whereData)
fmt.Printf("jsonStr------1------>%v\n", string(jsonStr)) fmt.Printf("jsonStr------1------>%v\n", string(jsonStr))
@ -4071,14 +4071,14 @@ func GetTimeIntervalDuty(whereData interface{}, schemeID int64) (actual float64)
return return
} }
//获取指定审批流方案数据 // 获取指定审批流方案数据
func GetSchemeFlowData(flowKwy, schemeID int64) (weightSum float64) { func GetSchemeFlowData(flowKwy, schemeID int64) (weightSum float64) {
weightSum = 0 weightSum = 0
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.FlowLogData{}).Where("`fld_evaluation_id` = ? AND `fld_flow_log` = ?", schemeID, flowKwy).Pluck("COALESCE(SUM(fld_score), 0) as qe_reference_score", &weightSum) global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.FlowLogData{}).Where("`fld_evaluation_id` = ? AND `fld_flow_log` = ?", schemeID, flowKwy).Pluck("COALESCE(SUM(fld_score), 0) as qe_reference_score", &weightSum)
return return
} }
//获取float字符串转化成Int64 // 获取float字符串转化成Int64
func GetDuyCycle(scoreStr string, multiple int64) (scoreInt64 int64) { func GetDuyCycle(scoreStr string, multiple int64) (scoreInt64 int64) {
coreFloat64, _ := strconv.ParseFloat(scoreStr, 64) //将字符串转换成float64 coreFloat64, _ := strconv.ParseFloat(scoreStr, 64) //将字符串转换成float64
scoreFloat64ToStr := strconv.FormatFloat(coreFloat64*float64(multiple), 'f', -1, 64) //将乘以系数后的数值转换成字符串 scoreFloat64ToStr := strconv.FormatFloat(coreFloat64*float64(multiple), 'f', -1, 64) //将乘以系数后的数值转换成字符串
@ -4086,7 +4086,7 @@ func GetDuyCycle(scoreStr string, multiple int64) (scoreInt64 int64) {
return return
} }
//获取判断定量考核时间内审批中和通过的考核数据 // 获取判断定量考核时间内审批中和通过的考核数据
func GetTimeIntervalDutyJudge(whereData interface{}, schemeID int64) (actual float64) { func GetTimeIntervalDutyJudge(whereData interface{}, schemeID int64) (actual float64) {
jsonStr, _ := json.Marshal(whereData) jsonStr, _ := json.Marshal(whereData)
fmt.Printf("jsonStr------1------>%v\n", string(jsonStr)) fmt.Printf("jsonStr------1------>%v\n", string(jsonStr))
@ -4103,7 +4103,7 @@ func GetTimeIntervalDutyJudge(whereData interface{}, schemeID int64) (actual flo
return return
} }
//判断子栏目是否归属此部门 // 判断子栏目是否归属此部门
func JudegSunTarToDepart(sunId, departId int64) (isTrue bool) { func JudegSunTarToDepart(sunId, departId int64) (isTrue bool) {
isTrue = false isTrue = false
var title string var title string
@ -4114,7 +4114,7 @@ func JudegSunTarToDepart(sunId, departId int64) (isTrue bool) {
return return
} }
//中文首字母大写 // 中文首字母大写
func ChinaToPinYinFirstWord(wordStr string) (firstWord string) { func ChinaToPinYinFirstWord(wordStr string) (firstWord string) {
pinYinSub := pinyin.NewArgs() pinYinSub := pinyin.NewArgs()
rows := pinyin.Pinyin(wordStr, pinYinSub) rows := pinyin.Pinyin(wordStr, pinYinSub)
@ -4128,7 +4128,7 @@ func ChinaToPinYinFirstWord(wordStr string) (firstWord string) {
return return
} }
//判断文件上传的TYPE // 判断文件上传的TYPE
func JudgeUpFileType(extTage string) int { func JudgeUpFileType(extTage string) int {
images := []string{".jpg", ".jpeg", ".png", ".gif", ".bmp", ".avif", ".webp", ".tif", ".pcx", ".tga", ".exif", ".fpx", ".svg", ".psd", ".cdr", ".pcd", ".dxf", ".ufo", ".hdri", ".eps", ".flic", ".ai", ".ico", ".emf", ".raw", ".WMF", ".avif", ".apng", ".Webp", ".BMP", ".PCX", ".TIF", ".GIF", ".JPEG", ".JPG", ".TGA", ".EXIF", ".FPX", ".SVG", ".PSD", ".CDR", ".PCD", ".DXF", ".UFO", ".EPS", ".AI", ".PNG", ".HDRI", ".RAW", ".WMF", ".FLIC", ".EMF", ".APNG", ".ICO"} images := []string{".jpg", ".jpeg", ".png", ".gif", ".bmp", ".avif", ".webp", ".tif", ".pcx", ".tga", ".exif", ".fpx", ".svg", ".psd", ".cdr", ".pcd", ".dxf", ".ufo", ".hdri", ".eps", ".flic", ".ai", ".ico", ".emf", ".raw", ".WMF", ".avif", ".apng", ".Webp", ".BMP", ".PCX", ".TIF", ".GIF", ".JPEG", ".JPG", ".TGA", ".EXIF", ".FPX", ".SVG", ".PSD", ".CDR", ".PCD", ".DXF", ".UFO", ".EPS", ".AI", ".PNG", ".HDRI", ".RAW", ".WMF", ".FLIC", ".EMF", ".APNG", ".ICO"}
videoExt := []string{".mp4", ".avi", ".3gp", ".flv", ".rm", ".rmvb", ".wmv", ".mpeg", ".mpeg1", ".mpeg2", ".divx", ".xvid", ".dv", ".mkv", ".asf", ".asx", ".mov", ".m4v", ".dat", ".mkv", ".vob", ".ogg", ".mod", ".MP4", ".3GP", ".AVI", ".RM", ".RMVB", ".WMV", ".MPEG", ".MPEG1", ".MPEG2", ".DivX", ".XVID", ".DV", ".MKV", ".MOV", ".OGG", ".MOD", ".M4V", ".DAT", ".VOB"} videoExt := []string{".mp4", ".avi", ".3gp", ".flv", ".rm", ".rmvb", ".wmv", ".mpeg", ".mpeg1", ".mpeg2", ".divx", ".xvid", ".dv", ".mkv", ".asf", ".asx", ".mov", ".m4v", ".dat", ".mkv", ".vob", ".ogg", ".mod", ".MP4", ".3GP", ".AVI", ".RM", ".RMVB", ".WMV", ".MPEG", ".MPEG1", ".MPEG2", ".DivX", ".XVID", ".DV", ".MKV", ".MOV", ".OGG", ".MOD", ".M4V", ".DAT", ".VOB"}
@ -4167,7 +4167,7 @@ func FormatFileSize(fileSize int64) (size string) {
} }
} }
//获取最大最小值 // 获取最大最小值
func NewUserModel(ary []int64) (max, min int64) { func NewUserModel(ary []int64) (max, min int64) {
if len(ary) < 0 { if len(ary) < 0 {
@ -4185,7 +4185,7 @@ func NewUserModel(ary []int64) (max, min int64) {
return return
} }
//去重和排序 // 去重和排序
func UniqueSort(slice []int64) []int64 { func UniqueSort(slice []int64) []int64 {
var quChong []int64 var quChong []int64
if len(slice) < 1 { if len(slice) < 1 {
@ -4201,7 +4201,7 @@ func UniqueSort(slice []int64) []int64 {
return SortForMerge(quChong, 0, len(quChong)-1) return SortForMerge(quChong, 0, len(quChong)-1)
} }
//插入排序 // 插入排序
func SortForMerge(arr []int64, left, right int) []int64 { func SortForMerge(arr []int64, left, right int) []int64 {
for i := left; i <= right; i++ { for i := left; i <= right; i++ {
temp := arr[i] temp := arr[i]
@ -4214,7 +4214,7 @@ func SortForMerge(arr []int64, left, right int) []int64 {
return arr return arr
} }
//获取用户信息 // 获取用户信息
// func GetNewHrPeopleInfo(where interface{}, filed ...string) (ueInfo hrsystem.Personnel, isTrue bool) { // func GetNewHrPeopleInfo(where interface{}, filed ...string) (ueInfo hrsystem.Personnel, isTrue bool) {
func GetNewHrPeopleInfo(where interface{}, filed ...string) (ueInfo hrsystem.ManCont, isTrue bool) { func GetNewHrPeopleInfo(where interface{}, filed ...string) (ueInfo hrsystem.ManCont, isTrue bool) {
isTrue = false isTrue = false
@ -4255,7 +4255,7 @@ func DecimalEs(value float64, weishu int) float64 {
return value return value
} }
//判断是否为闰年 // 判断是否为闰年
func IsLeapYear(year int64) bool { //y == 2000,2004 func IsLeapYear(year int64) bool { //y == 2000,2004
//判断是否为闰年 //判断是否为闰年
if year%4 == 0 && year%100 != 0 || year%400 == 0 { if year%4 == 0 && year%100 != 0 || year%400 == 0 {
@ -4265,7 +4265,8 @@ func IsLeapYear(year int64) bool { //y == 2000,2004
return false return false
} }
/*WriteReplyLog(orderId, acceptDepartment, launchDepartment, launchUser, state, title, content) /*
WriteReplyLog(orderId, acceptDepartment, launchDepartment, launchUser, state, title, content)
@orderId 审批单key @orderId 审批单key
@title 节点名称 @title 节点名称
@acceptDepartment 接受考核部门 @acceptDepartment 接受考核部门
@ -4312,7 +4313,7 @@ func CalculateScore(targetScore int64, resultval, allPrizes, zeroPrizes, Capping
CappingVal = CappingVals / 100 CappingVal = CappingVals / 100
resultval = resultval / 100 resultval = resultval / 100
fmt.Printf("达成率--1-->%v-->%v-->%v-->%v-->%v\n", targetScore, resultval, allPrize, zeroPrize, CappingVal) fmt.Printf("达成率--1-->targetScore:%v-->resultval:%v-->allPrize:%v-->zeroPrize:%v-->CappingVal:%v\n", targetScore, resultval, allPrize, zeroPrize, CappingVal)
//不修正精度的达成率 //不修正精度的达成率
var achievementAll float64 = 0 var achievementAll float64 = 0
@ -4348,12 +4349,18 @@ func CalculateScore(targetScore int64, resultval, allPrizes, zeroPrizes, Capping
} else { } else {
if achievement*100 >= CappingVal { if achievement*100 >= CappingVal {
//如果达成率大于等于封顶值 //如果达成率大于等于封顶值
scoreVal = CappingVal * float64(targetScore) / 100 if CappingVal > 0 {
scoreVal = CappingVal * float64(targetScore)
} else {
scoreVal = float64(targetScore)
}
} else { } else {
// scoreVal = achievement * (float64(targetScore)) // scoreVal = achievement * (float64(targetScore))
scoreVal = achievementAll * (float64(targetScore)) scoreVal = achievementAll * (float64(targetScore))
} }
fmt.Printf("达成率--9-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement) fmt.Printf("达成率--9-->targetScore:%v-->resultval:%v-->scoreVal:%v-->allPrize:%v-->zeroPrize:%v-->CappingVal:%v-->achievement:%v\n", targetScore, resultval, scoreVal, allPrize, zeroPrize, CappingVal, achievement)
} }
achievement = DecimalEs(achievement*100, 4) achievement = DecimalEs(achievement*100, 4)
} else { } else {
@ -4419,7 +4426,7 @@ func CalculateScore(targetScore int64, resultval, allPrizes, zeroPrizes, Capping
return return
} }
//递归查找指定部门所有子类 // 递归查找指定部门所有子类
func DiGuiOrgSun(superior int64, idary []int64) (groupId []int64) { func DiGuiOrgSun(superior int64, idary []int64) (groupId []int64) {
// fmt.Printf("DiGui----->%v\n", superior) // fmt.Printf("DiGui----->%v\n", superior)
// return // return

2
router/examtestpage/healthreporthandle.go

@ -5,7 +5,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
//集团框架相关处理数据 // 集团框架相关处理数据
type HealthReportHandleRouter struct{} type HealthReportHandleRouter struct{}
func (g *GroupHandleRouter) InitHealthReporRouter(Router *gin.RouterGroup) (R gin.IRoutes) { func (g *GroupHandleRouter) InitHealthReporRouter(Router *gin.RouterGroup) (R gin.IRoutes) {

Loading…
Cancel
Save