From 1c41e4ed4f3019988a1d4f902ecba3fb6532d292 Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Thu, 19 May 2022 08:27:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E7=BB=9F=E8=AE=A1=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/index/evaluation/assessment.go | 21 +- .../api/index/evaluation/evaluation.go | 2 +- .../api/index/evaluation/examineflow.go | 2 +- .../api/index/evaluation/flowsendnew.go | 6 + .../api/index/evaluation/lookquantita.go | 4 + gin_server_admin/api/index/evaluation/type.go | 6 + .../api/index/statistics/dataform.go | 4 +- .../api/index/statistics/enter.go | 4 + .../api/index/statistics/tablestatistics.go | 185 ++++++++++++++---- .../api/publichandle/userhandle/handel.go | 5 + gin_server_admin/api/reply/qual/controller.go | 2 +- gin_server_admin/api/v1/shiyan/shiyan.go | 19 +- gin_server_admin/commonus/publichaneld.go | 30 ++- 13 files changed, 228 insertions(+), 62 deletions(-) diff --git a/gin_server_admin/api/index/evaluation/assessment.go b/gin_server_admin/api/index/evaluation/assessment.go index 190916f..415245c 100644 --- a/gin_server_admin/api/index/evaluation/assessment.go +++ b/gin_server_admin/api/index/evaluation/assessment.go @@ -245,11 +245,26 @@ func StatisticsMonthQual(qualId []int64, dutyGroup, dutyDepartment, years, month where["sf_duty_department"] = dutyDepartment //加分 // var addSumScore float64 = 0 - global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score").Where("sf_evaluation_plan IN ?", qualId).Where(where).Where("sf_plus_reduce_score = 1").Where("sf_reply >= 2 AND sf_reply <> 4").Pluck("COALESCE(SUM(sf_score), 0) as addrescore", &addSumScore) - //加分 + // global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score").Where("sf_evaluation_plan IN ?", qualId).Where(where).Where("sf_plus_reduce_score = 1").Where("sf_reply >= 2 AND sf_reply <> 4").Pluck("COALESCE(SUM(sf_score), 0) as addrescore", &addSumScore) + + var jiaFenAry []TongjiFenShu + // global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score,sf_count").Where("sf_evaluation_plan IN ?", qualId).Where(where).Where("sf_plus_reduce_score = 1").Where("sf_reply >= 2 AND sf_reply <> 4").Find(&jiaFenAry) + global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score,sf_count").Where("sf_evaluation_plan IN ?", qualId).Where(where).Where("sf_plus_reduce_score = 1").Where("sf_reply IN (2,3)").Find(&jiaFenAry) + for _, jiav := range jiaFenAry { + addSumScore = addSumScore + (jiav.Score * jiav.Count) + } + + //减分 // var scoreReduction float64 = 0 - global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score").Where("sf_evaluation_plan IN ?", qualId).Where(where).Where("sf_plus_reduce_score = 2").Where("sf_reply >= 2 AND sf_reply <> 4").Pluck("COALESCE(SUM(sf_score), 0) as redurescore", &scoreReduction) + // global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score").Where("sf_evaluation_plan IN ?", qualId).Where(where).Where("sf_plus_reduce_score = 2").Where("sf_reply >= 2 AND sf_reply <> 4").Pluck("COALESCE(SUM(sf_score), 0) as redurescore", &scoreReduction) + var jianFenAry []TongjiFenShu + // global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score,sf_count").Where("sf_evaluation_plan IN ?", qualId).Where(where).Where("sf_plus_reduce_score = 2").Where("sf_reply >= 2 AND sf_reply <> 4").Find(&jianFenAry) + global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score,sf_count").Where("sf_evaluation_plan IN ?", qualId).Where(where).Where("sf_plus_reduce_score = 2").Where("sf_reply IN (2,3)").Find(&jianFenAry) + for _, jianv := range jianFenAry { + scoreReduction = scoreReduction + (jianv.Score * jianv.Count) + } + // fmt.Printf("scoreReduction----------->%v\n", jianFenAry) addSumScore = commonus.Decimal(addSumScore / 100) scoreReduction = commonus.Decimal(scoreReduction / 100) return diff --git a/gin_server_admin/api/index/evaluation/evaluation.go b/gin_server_admin/api/index/evaluation/evaluation.go index 41568ec..d115fb8 100644 --- a/gin_server_admin/api/index/evaluation/evaluation.go +++ b/gin_server_admin/api/index/evaluation/evaluation.go @@ -1432,7 +1432,7 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) { gerEvalErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", requestData.Id).Find(&evalProInfo).Error //fmt.Printf("9-----------1--------->%v\n", gerEvalErr) if gerEvalErr == nil { - fmt.Printf("evalProInfo.NextExecutor------->%v\n", evalProInfo.NextExecutor) + fmt.Printf("evalProInfo.NextExecutor------->%v-------》userCont.Key------->%v\n", evalProInfo.NextExecutor, userCont.Key) dutyCecorFlowInfo.IsSet = 2 isSetUser := strings.Split(evalProInfo.NextExecutor, ",") if len(isSetUser) > 0 { diff --git a/gin_server_admin/api/index/evaluation/examineflow.go b/gin_server_admin/api/index/evaluation/examineflow.go index 87798a9..0a2b10b 100644 --- a/gin_server_admin/api/index/evaluation/examineflow.go +++ b/gin_server_admin/api/index/evaluation/examineflow.go @@ -128,7 +128,7 @@ func (e *EvaluationInterface) ExamineFlow(c *gin.Context) { //7、发起人验收 var serverFlowInfo commonus.FlowAllMap serverFlowInfo.Step = 7 - serverFlowInfo.NodeName = commonus.GetSetpName(5) + serverFlowInfo.NodeName = commonus.GetSetpName(6) serverFlowInfo.State = 1 serverFlowInfo.Class = 1 serverFlowInfo.UserList = append(serverFlowInfo.UserList, GetApproveUser(userCont.Wechat)) diff --git a/gin_server_admin/api/index/evaluation/flowsendnew.go b/gin_server_admin/api/index/evaluation/flowsendnew.go index 583b4d9..2be3ad6 100644 --- a/gin_server_admin/api/index/evaluation/flowsendnew.go +++ b/gin_server_admin/api/index/evaluation/flowsendnew.go @@ -271,6 +271,12 @@ func (e *EvaluationInterface) PlusOrMinusPointsNew(c *gin.Context) { outMap["isTrueCall"] = isTrueCall outMap["callBackCont"] = callBackCont outMap["setval"] = 1 + + //修改定性审批流状态 + eiteScoreFlow := commonus.MapOut() + eiteScoreFlow["sf_eite_time"] = time.Now().Unix() + eiteScoreFlow["sf_reply"] = 2 + global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Where("`sf_key` = ?", keyNumber).Updates(&eiteScoreFlow) } else { //申请人不是是部门负责人 给本部门负责人发送审批 commonus.StepAddDataEs(keyNumber, 16182159043990656, 2, 1, 1, 1, 1, userCont.Key, requestData.Enclosure) diff --git a/gin_server_admin/api/index/evaluation/lookquantita.go b/gin_server_admin/api/index/evaluation/lookquantita.go index a8cc723..c1d5ca3 100644 --- a/gin_server_admin/api/index/evaluation/lookquantita.go +++ b/gin_server_admin/api/index/evaluation/lookquantita.go @@ -173,6 +173,10 @@ func (e *EvaluationInterface) SeeFlowLog(c *gin.Context) { startTime, endTime := commonus.GetAppointMonthStarAndEndTime(requestData.Time) gormDb = gormDb.Where("evaluation_process.ep_start_time BETWEEN ? AND ?", startTime, endTime) } + + if requestData.Class != 0 { + gormDb = gormDb.Where("evaluation_process.ep_type = ?", requestData.Class) + } /* 获取总共有多少记录 */ diff --git a/gin_server_admin/api/index/evaluation/type.go b/gin_server_admin/api/index/evaluation/type.go index 76ee793..3ce15a8 100644 --- a/gin_server_admin/api/index/evaluation/type.go +++ b/gin_server_admin/api/index/evaluation/type.go @@ -279,6 +279,7 @@ type FlowLogType struct { Department string `json:"department"` //部门 Time string `json:"time"` //时间 IsSet int `json:"isset"` //未处理 1:已审核;2:未审核 + Class int `json:"class"` //0:全部;1:定性;2:定量 } //流程记录输出 @@ -403,3 +404,8 @@ type QualEvalFlowLog struct { Department string `json:"department"` //部门 QualId int64 `json:"qualid"` //指标名称 } + +type TongjiFenShu struct { + Score float64 `json:"score" gorm:"column:sf_score;type:bigint(20) unsigned;default:0;not null;comment:分值(乘100录入)"` + Count float64 `json:"count" gorm:"column:sf_count;type:int(5) unsigned;default:1;not null;comment:发生次数"` +} diff --git a/gin_server_admin/api/index/statistics/dataform.go b/gin_server_admin/api/index/statistics/dataform.go index 379274e..a26e86b 100644 --- a/gin_server_admin/api/index/statistics/dataform.go +++ b/gin_server_admin/api/index/statistics/dataform.go @@ -627,7 +627,7 @@ func SubjectiveAuxiliaryCalculationSumMethod(where interface{}) (sumScore float6 var addSumScore float64 = 0 // global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score").Where(where).Where("sf_plus_reduce_score = 1").Pluck("COALESCE(SUM(sf_score), 0) as addrescore", &addSumScore) var jiaFenAry []TongjiFenShu - global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score").Where(where).Where("sf_plus_reduce_score = 1").Find(&jiaFenAry) + global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score,sf_count").Where(where).Where("sf_plus_reduce_score = 1").Find(&jiaFenAry) for _, jiav := range jiaFenAry { addSumScore = addSumScore + (jiav.Score * jiav.Count) } @@ -636,7 +636,7 @@ func SubjectiveAuxiliaryCalculationSumMethod(where interface{}) (sumScore float6 // global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score").Where(where).Where("sf_plus_reduce_score = 2").Pluck("COALESCE(SUM(sf_score), 0) as redurescore", &scoreReduction) var jianFenAry []TongjiFenShu - global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score").Where(where).Where("sf_plus_reduce_score = 2").Find(&jianFenAry) + global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score,sf_count").Where(where).Where("sf_plus_reduce_score = 2").Find(&jianFenAry) for _, jianv := range jianFenAry { scoreReduction = scoreReduction + (jianv.Score * jianv.Count) } diff --git a/gin_server_admin/api/index/statistics/enter.go b/gin_server_admin/api/index/statistics/enter.go index 4525743..7c507af 100644 --- a/gin_server_admin/api/index/statistics/enter.go +++ b/gin_server_admin/api/index/statistics/enter.go @@ -194,3 +194,7 @@ type TongjiFenShu struct { Score float64 `json:"score" gorm:"column:sf_score;type:bigint(20) unsigned;default:0;not null;comment:分值(乘100录入)"` Count float64 `json:"count" gorm:"column:sf_count;type:int(5) unsigned;default:1;not null;comment:发生次数"` } + +type banNian struct { + Month []int `json:"month"` +} diff --git a/gin_server_admin/api/index/statistics/tablestatistics.go b/gin_server_admin/api/index/statistics/tablestatistics.go index c70e17c..7a25ab5 100644 --- a/gin_server_admin/api/index/statistics/tablestatistics.go +++ b/gin_server_admin/api/index/statistics/tablestatistics.go @@ -167,16 +167,16 @@ func (d *dataLockStatistics) planVersiconProcess(pvInfo assessmentmodel.PlanVers }) for _, rsdv := range readStatisticsData { - for ik := 0; ik <= 1; ik++ { - var jiSuanZhiBuLing ScoreList - outCont.Score = append(outCont.Score, jiSuanZhiBuLing) - stccStatistics.ScoreVal = append(stccStatistics.ScoreVal, 0) - stccStatistics.AllPrize = append(stccStatistics.AllPrize, 0) - stccStatistics.ZeroPrize = append(stccStatistics.ZeroPrize, 0) - stccStatistics.CappingVal = append(stccStatistics.CappingVal, 0) - stccStatistics.ActualScore = append(stccStatistics.ActualScore, 0) - stccStatistics.Achievement = append(stccStatistics.Achievement, 0) - } + // for ik := 0; ik <= 1; ik++ { + // var jiSuanZhiBuLing ScoreList + // outCont.Score = append(outCont.Score, jiSuanZhiBuLing) + // stccStatistics.ScoreVal = append(stccStatistics.ScoreVal, 0) + // stccStatistics.AllPrize = append(stccStatistics.AllPrize, 0) + // stccStatistics.ZeroPrize = append(stccStatistics.ZeroPrize, 0) + // stccStatistics.CappingVal = append(stccStatistics.CappingVal, 0) + // stccStatistics.ActualScore = append(stccStatistics.ActualScore, 0) + // stccStatistics.Achievement = append(stccStatistics.Achievement, 0) + // } var jiSuanZhi ScoreList jiSuanZhi.Class = rsdv.Class @@ -204,19 +204,66 @@ func (d *dataLockStatistics) planVersiconProcess(pvInfo assessmentmodel.PlanVers stccStatistics.Achievement = append(stccStatistics.Achievement, rsdv.Achievement) } case 6: //年 - monthValue := commonus.TimeStampToDate(time.Now().Unix(), 12) - if commonus.TimeStampToDate(time.Now().Unix(), 11) != giveData.Year { - monthValue = "12" - } - monthValueInt, _ := strconv.Atoi(monthValue) + // monthValue := commonus.TimeStampToDate(time.Now().Unix(), 12) + // if commonus.TimeStampToDate(time.Now().Unix(), 11) != giveData.Year { + // monthValue = "12" + // } + // monthValueInt, _ := strconv.Atoi(monthValue) var tpsProcess tablePlanVersionStic - for i := 1; i <= monthValueInt; i++ { - wherStr := fmt.Sprintf("`sf_evaluation_plan` = %v AND `sf_duty_group` = %v AND `sf_duty_department` = %v AND `sf_year` = %v AND `sf_month` = %v", taskId, pvInfo.Group, pvInfo.Department, yserInt, i) - syncProcessDepartTarget.Add(1) - go tpsProcess.SubjectiveAuxiliaryCalculationSumMethod(wherStr, i, pcv.Status, 1, pcv.ReferenceScore) + // for i := 1; i <= monthValueInt; i++ { + // wherStr := fmt.Sprintf("`sf_evaluation_plan` = %v AND `sf_duty_group` = %v AND `sf_duty_department` = %v AND `sf_year` = %v AND `sf_month` = %v", taskId, pvInfo.Group, pvInfo.Department, yserInt, i) + // syncProcessDepartTarget.Add(1) + // go tpsProcess.SubjectiveAuxiliaryCalculationSumMethod(wherStr, i, pcv.Status, 1, pcv.ReferenceScore) + // } + wherStr := fmt.Sprintf("`sf_evaluation_plan` = %v AND `sf_duty_group` = %v AND `sf_duty_department` = %v AND `sf_year` = %v", taskId, pvInfo.Group, pvInfo.Department, yserInt) + syncProcessDepartTarget.Add(1) + go tpsProcess.SubjectiveAuxiliaryCalculationSumMethod(wherStr, 1, pcv.Status, 1, pcv.ReferenceScore) + syncProcessDepartTarget.Wait() + readStatisticsData := tpsProcess.readMyDayData() + //按照最大值排序 + sort.Slice(readStatisticsData, func(i int, j int) bool { + return readStatisticsData[i].Counter < readStatisticsData[j].Counter + }) + for _, rsdv := range readStatisticsData { + var jiSuanZhi ScoreList + jiSuanZhi.Class = rsdv.Class + jiSuanZhi.ScoreVal = rsdv.ScoreVal + jiSuanZhi.ActualScore = rsdv.ActualScore + jiSuanZhi.AllPrize = rsdv.AllPrize + jiSuanZhi.ZeroPrize = rsdv.ZeroPrize + jiSuanZhi.CappingVal = rsdv.CappingVal + jiSuanZhi.Achievement = rsdv.Achievement + + outCont.Score = append(outCont.Score, jiSuanZhi) + if len(rsdv.ExecutiveDepartment) > 0 { //写入执行考核的部门 + for _, edv := range rsdv.ExecutiveDepartment { + if commonus.IsItTrueString(edv, outCont.ExecutiveDepartment) == false { + outCont.ExecutiveDepartment = append(outCont.ExecutiveDepartment, edv) + } + } + } + + stccStatistics.ScoreVal = append(stccStatistics.ScoreVal, rsdv.ScoreVal) + stccStatistics.AllPrize = append(stccStatistics.AllPrize, rsdv.AllPrize) + stccStatistics.ZeroPrize = append(stccStatistics.ZeroPrize, rsdv.ZeroPrize) + stccStatistics.CappingVal = append(stccStatistics.CappingVal, rsdv.CappingVal) + stccStatistics.ActualScore = append(stccStatistics.ActualScore, rsdv.ActualScore) + stccStatistics.Achievement = append(stccStatistics.Achievement, rsdv.Achievement) } + case 7: //半年 + var tpsProcess tablePlanVersionStic + //上半年 + firstHalfwherStr := fmt.Sprintf("`sf_evaluation_plan` = %v AND `sf_duty_group` = %v AND `sf_duty_department` = %v AND `sf_year` = %v AND `sf_month` IN %v", taskId, pvInfo.Group, pvInfo.Department, yserInt, []int{1, 2, 3, 4, 5, 6}) + syncProcessDepartTarget.Add(1) + go tpsProcess.SubjectiveAuxiliaryCalculationSumMethod(firstHalfwherStr, 1, pcv.Status, 1, pcv.ReferenceScore) + //下半年 + secondHalfwherStr := fmt.Sprintf("`sf_evaluation_plan` = %v AND `sf_duty_group` = %v AND `sf_duty_department` = %v AND `sf_year` = %v AND `sf_month` IN %v", taskId, pvInfo.Group, pvInfo.Department, yserInt, []int{7, 8, 9, 10, 11, 12}) + syncProcessDepartTarget.Add(1) + go tpsProcess.SubjectiveAuxiliaryCalculationSumMethod(secondHalfwherStr, 2, pcv.Status, 1, pcv.ReferenceScore) + syncProcessDepartTarget.Wait() readStatisticsData := tpsProcess.readMyDayData() + //按照最大值排序 sort.Slice(readStatisticsData, func(i int, j int) bool { return readStatisticsData[i].Counter < readStatisticsData[j].Counter @@ -247,6 +294,7 @@ func (d *dataLockStatistics) planVersiconProcess(pvInfo assessmentmodel.PlanVers stccStatistics.ActualScore = append(stccStatistics.ActualScore, rsdv.ActualScore) stccStatistics.Achievement = append(stccStatistics.Achievement, rsdv.Achievement) } + default: //月 monthValue := commonus.TimeStampToDate(time.Now().Unix(), 12) if commonus.TimeStampToDate(time.Now().Unix(), 11) != giveData.Year { @@ -338,16 +386,16 @@ func (d *dataLockStatistics) planVersiconProcess(pvInfo assessmentmodel.PlanVers // fmt.Printf("排序------%v--------》%v--------》%v\n", pvInfo.Id, string(jsonVal), jsonErr) for _, rsdv := range readStatisticsData { - for ik := 0; ik <= 1; ik++ { - var jiSuanZhiBuLing ScoreList - outCont.Score = append(outCont.Score, jiSuanZhiBuLing) - stccStatistics.ScoreVal = append(stccStatistics.ScoreVal, 0) - stccStatistics.AllPrize = append(stccStatistics.AllPrize, 0) - stccStatistics.ZeroPrize = append(stccStatistics.ZeroPrize, 0) - stccStatistics.CappingVal = append(stccStatistics.CappingVal, 0) - stccStatistics.ActualScore = append(stccStatistics.ActualScore, 0) - stccStatistics.Achievement = append(stccStatistics.Achievement, 0) - } + // for ik := 0; ik <= 1; ik++ { + // var jiSuanZhiBuLing ScoreList + // outCont.Score = append(outCont.Score, jiSuanZhiBuLing) + // stccStatistics.ScoreVal = append(stccStatistics.ScoreVal, 0) + // stccStatistics.AllPrize = append(stccStatistics.AllPrize, 0) + // stccStatistics.ZeroPrize = append(stccStatistics.ZeroPrize, 0) + // stccStatistics.CappingVal = append(stccStatistics.CappingVal, 0) + // stccStatistics.ActualScore = append(stccStatistics.ActualScore, 0) + // stccStatistics.Achievement = append(stccStatistics.Achievement, 0) + // } var jiSuanZhi ScoreList jiSuanZhi.Class = rsdv.Class jiSuanZhi.ScoreVal = rsdv.ScoreVal @@ -374,18 +422,68 @@ func (d *dataLockStatistics) planVersiconProcess(pvInfo assessmentmodel.PlanVers stccStatistics.Achievement = append(stccStatistics.Achievement, rsdv.Achievement) } case 6: //年 - monthValue := commonus.TimeStampToDate(time.Now().Unix(), 12) - if commonus.TimeStampToDate(time.Now().Unix(), 11) != giveData.Year { - monthValue = "12" - } - monthValueInt, _ := strconv.Atoi(monthValue) + // monthValue := commonus.TimeStampToDate(time.Now().Unix(), 12) + // if commonus.TimeStampToDate(time.Now().Unix(), 11) != giveData.Year { + // monthValue = "12" + // } + // monthValueInt, _ := strconv.Atoi(monthValue) var tpsProcess tablePlanVersionStic - for i := 1; i <= monthValueInt; i++ { - // fmt.Printf("年--5-->%v--->%v-->%v\n", i, giveData.Year, yserInt) - wherStr := fmt.Sprintf("fld_evaluation_id = %v AND `fl_year` = %v AND `fl_duty_group` = %v AND `fl_duty_department` = %v AND `fl_month` = %v", taskId, yserInt, pvInfo.Group, pvInfo.Department, i) - syncProcessDepartTarget.Add(1) - go tpsProcess.conditionStatistics(wherStr, strconv.FormatInt(pvInfo.Group, 10), strconv.FormatInt(pvInfo.Department, 10), pv.Id, pcv.Id, i, pcv.Status, scoringMethod, 2, yserInt, pcv.ReferenceScore) + // for i := 1; i <= monthValueInt; i++ { + // // fmt.Printf("年--5-->%v--->%v-->%v\n", i, giveData.Year, yserInt) + // wherStr := fmt.Sprintf("fld_evaluation_id = %v AND `fl_year` = %v AND `fl_duty_group` = %v AND `fl_duty_department` = %v AND `fl_month` = %v", taskId, yserInt, pvInfo.Group, pvInfo.Department, i) + // syncProcessDepartTarget.Add(1) + // go tpsProcess.conditionStatistics(wherStr, strconv.FormatInt(pvInfo.Group, 10), strconv.FormatInt(pvInfo.Department, 10), pv.Id, pcv.Id, i, pcv.Status, scoringMethod, 2, yserInt, pcv.ReferenceScore) + // } + wherStr := fmt.Sprintf("fld_evaluation_id = %v AND `fl_year` = %v AND `fl_duty_group` = %v AND `fl_duty_department` = %v ", taskId, yserInt, pvInfo.Group, pvInfo.Department) + syncProcessDepartTarget.Add(1) + go tpsProcess.conditionStatistics(wherStr, strconv.FormatInt(pvInfo.Group, 10), strconv.FormatInt(pvInfo.Department, 10), pv.Id, pcv.Id, 1, pcv.Status, scoringMethod, 2, yserInt, pcv.ReferenceScore) + syncProcessDepartTarget.Wait() + readStatisticsData := tpsProcess.readMyDayData() + //按照最大值排序 + sort.Slice(readStatisticsData, func(i int, j int) bool { + return readStatisticsData[i].Counter < readStatisticsData[j].Counter + }) + // jsonVal, jsonErr := json.Marshal(readStatisticsData) + // fmt.Printf("排序------%v--------》%v--------》%v\n", pvInfo.Id, string(jsonVal), jsonErr) + + for _, rsdv := range readStatisticsData { + var jiSuanZhi ScoreList + jiSuanZhi.Class = rsdv.Class + jiSuanZhi.ScoreVal = rsdv.ScoreVal + jiSuanZhi.ActualScore = rsdv.ActualScore + jiSuanZhi.AllPrize = rsdv.AllPrize + jiSuanZhi.ZeroPrize = rsdv.ZeroPrize + jiSuanZhi.CappingVal = rsdv.CappingVal + jiSuanZhi.Achievement = rsdv.Achievement + + outCont.Score = append(outCont.Score, jiSuanZhi) + if len(rsdv.ExecutiveDepartment) > 0 { //写入执行考核的部门 + for _, edv := range rsdv.ExecutiveDepartment { + if commonus.IsItTrueString(edv, outCont.ExecutiveDepartment) == false { + outCont.ExecutiveDepartment = append(outCont.ExecutiveDepartment, edv) + } + } + } + + stccStatistics.ScoreVal = append(stccStatistics.ScoreVal, rsdv.ScoreVal) + stccStatistics.AllPrize = append(stccStatistics.AllPrize, rsdv.AllPrize) + stccStatistics.ZeroPrize = append(stccStatistics.ZeroPrize, rsdv.ZeroPrize) + stccStatistics.CappingVal = append(stccStatistics.CappingVal, rsdv.CappingVal) + stccStatistics.ActualScore = append(stccStatistics.ActualScore, rsdv.ActualScore) + stccStatistics.Achievement = append(stccStatistics.Achievement, rsdv.Achievement) } + case 7: + var tpsProcess tablePlanVersionStic + //上半年 + wherStr := fmt.Sprintf("fld_evaluation_id = %v AND `fl_year` = %v AND `fl_duty_group` = %v AND `fl_duty_department` = %v AND `fl_month` IN %v", taskId, yserInt, pvInfo.Group, pvInfo.Department, []int{1, 2, 3, 4, 5, 6}) + syncProcessDepartTarget.Add(1) + go tpsProcess.conditionStatistics(wherStr, strconv.FormatInt(pvInfo.Group, 10), strconv.FormatInt(pvInfo.Department, 10), pv.Id, pcv.Id, 1, pcv.Status, scoringMethod, 2, yserInt, pcv.ReferenceScore) + + //下半年 + secondwherStr := fmt.Sprintf("fld_evaluation_id = %v AND `fl_year` = %v AND `fl_duty_group` = %v AND `fl_duty_department` = %v AND `fl_month` IN %v", taskId, yserInt, pvInfo.Group, pvInfo.Department, []int{1, 2, 3, 4, 5, 6}) + syncProcessDepartTarget.Add(1) + go tpsProcess.conditionStatistics(secondwherStr, strconv.FormatInt(pvInfo.Group, 10), strconv.FormatInt(pvInfo.Department, 10), pv.Id, pcv.Id, 2, pcv.Status, scoringMethod, 2, yserInt, pcv.ReferenceScore) + syncProcessDepartTarget.Wait() readStatisticsData := tpsProcess.readMyDayData() //按照最大值排序 @@ -421,6 +519,7 @@ func (d *dataLockStatistics) planVersiconProcess(pvInfo assessmentmodel.PlanVers stccStatistics.ActualScore = append(stccStatistics.ActualScore, rsdv.ActualScore) stccStatistics.Achievement = append(stccStatistics.Achievement, rsdv.Achievement) } + default: //月 monthValue := commonus.TimeStampToDate(time.Now().Unix(), 12) if commonus.TimeStampToDate(time.Now().Unix(), 11) != giveData.Year { @@ -545,7 +644,7 @@ func (t *tablePlanVersionStic) conditionStatistics(wherStr, group, department, d } //定性 -/* +/*SubjectiveAuxiliaryCalculationSumMethod(wherStr string, i, status, class int, referenceScore int64) 统计分数 @wherStr 统计条件 @i 步进器 @@ -567,7 +666,8 @@ func (t *tablePlanVersionStic) SubjectiveAuxiliaryCalculationSumMethod(wherStr s // global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score").Where(wherStr).Where("sf_plus_reduce_score = 1").Pluck("COALESCE(SUM(sf_score), 0) as addrescore", &addSumScore) var jiaFenAry []TongjiFenShu - global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score").Where(wherStr).Where("sf_plus_reduce_score = 1").Find(&jiaFenAry) + // global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score,sf_count").Where(wherStr).Where("sf_plus_reduce_score = 1").Where("sf_reply >= 2 AND sf_reply <> 4").Find(&jiaFenAry) + global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score,sf_count").Where(wherStr).Where("sf_plus_reduce_score = 1").Where("sf_reply IN (2,3)").Find(&jiaFenAry) for _, jiav := range jiaFenAry { addSumScore = addSumScore + (jiav.Score * jiav.Count) } @@ -577,7 +677,8 @@ func (t *tablePlanVersionStic) SubjectiveAuxiliaryCalculationSumMethod(wherStr s // global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score").Where(wherStr).Where("sf_plus_reduce_score = 2").Pluck("COALESCE(SUM(sf_score), 0) as redurescore", &scoreReduction) var jianFenAry []TongjiFenShu - global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score").Where(wherStr).Where("sf_plus_reduce_score = 2").Find(&jianFenAry) + // global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score,sf_count").Where(wherStr).Where("sf_plus_reduce_score = 2").Where("sf_reply >= 2 AND sf_reply <> 4").Find(&jianFenAry) + global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_score,sf_count").Where(wherStr).Where("sf_plus_reduce_score = 2").Where("sf_reply IN (2,3)").Find(&jianFenAry) for _, jianv := range jianFenAry { scoreReduction = scoreReduction + (jianv.Score * jianv.Count) } diff --git a/gin_server_admin/api/publichandle/userhandle/handel.go b/gin_server_admin/api/publichandle/userhandle/handel.go index 38d06ca..1e69076 100644 --- a/gin_server_admin/api/publichandle/userhandle/handel.go +++ b/gin_server_admin/api/publichandle/userhandle/handel.go @@ -114,8 +114,13 @@ func (g *GeographyUnknown) GetLocationUserAddress(c *gin.Context) { redisToJsonAddressMap = append(redisToJsonAddressMap, redisToJsonAddress) } } + output := commonus.MapOut() output["addressMap"] = addressMap output["redisToJsonAddressMap"] = redisToJsonAddressMap + if len(addressMap) <= 0 { + response.Result(100, output, "数据获取失败!", c) + return + } response.Result(0, output, "数据获取成功!", c) } diff --git a/gin_server_admin/api/reply/qual/controller.go b/gin_server_admin/api/reply/qual/controller.go index 1f83ac8..dc72d08 100644 --- a/gin_server_admin/api/reply/qual/controller.go +++ b/gin_server_admin/api/reply/qual/controller.go @@ -655,7 +655,7 @@ func (a *ApiGroup) Operation(c *gin.Context) { registerCont.AddCont() //审批卡片跳转链接 cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v&num=%v", orderIdInt, strconv.FormatInt(registerNumber, 10)) - jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v&num=%v", orderIdInt, strconv.FormatInt(registerNumber, 10)) + jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v&num=%v", orderIdInt, strconv.FormatInt(registerNumber, 10)) jumpUrlTitle := "查看详情" sourceDesc := "抄送" diff --git a/gin_server_admin/api/v1/shiyan/shiyan.go b/gin_server_admin/api/v1/shiyan/shiyan.go index b12d22d..4bb3a97 100644 --- a/gin_server_admin/api/v1/shiyan/shiyan.go +++ b/gin_server_admin/api/v1/shiyan/shiyan.go @@ -35,21 +35,22 @@ func (a *ShiyanApi) AddBaseMenu(c *gin.Context) { // } // fmt.Printf("%v\n", answerMap) commonus.GetLastMonth() - // Fanxing[string]("123", []string{"ddf"}) + Fanxing(1, []int8{123}) response.Ok(c) } type faxingType interface { + int | int8 | int16 | int32 | int64 | string } -// func Fanxing[T any](key T, keyAry []T) bool { -// for _, v := range keyAry { -// if v == key { -// return false -// } -// } -// return true -// } +func Fanxing[T faxingType](key T, keyAry []T) bool { + for _, v := range keyAry { + if v == key { + return false + } + } + return true +} //get请求获参 func (a *ShiyanApi) GetRequestOperation(c *gin.Context) { diff --git a/gin_server_admin/commonus/publichaneld.go b/gin_server_admin/commonus/publichaneld.go index 30438f8..0b007b1 100644 --- a/gin_server_admin/commonus/publichaneld.go +++ b/gin_server_admin/commonus/publichaneld.go @@ -1361,6 +1361,9 @@ func GetOfficeWork(id, departmentId int64) (isTrue bool, roleUser []roleGroupBod isTrue = false departID := strconv.FormatInt(departmentId, 10) // var roleGroup systemuser.RoleGroup + if id == 0 { + return + } err := global.GVA_DB_Master.Where("`srg_id` = ?", id).First(&roleGroup).Error //16118387069540343 if err != nil { return @@ -1757,6 +1760,9 @@ func StepAddData(flowID, roleGroupId int64, nextStep, stepName, typeclass, state } } } + // if nextStep <= 0 && fav.Step == 7{ + + // } } } if len(userKeyMap) > 0 { @@ -1786,7 +1792,7 @@ func StepAddData(flowID, roleGroupId int64, nextStep, stepName, typeclass, state saveData["ep_state"] = state } - saveData["ep_next_cont"] = InsetFlowLog(state, stepInt, userKey, evalProCont.NextContent) + saveData["ep_next_cont"] = InsetFlowLog(state, stepInt, nextStep, userKey, evalProCont.NextContent) // fmt.Printf("Flow---Map:--->%v\n", saveData) caozuoMap := MapOut() @@ -1974,8 +1980,9 @@ func StepAddDataEs(flowID, roleGroupId int64, nextStep, stepName, typeclass, sta @recStrat 是否改正 @userKey 操作人key @flowMapStr 流程图字符串 +@nextStep 下一步 */ -func InsetFlowLog(state, stepInt int, userKey, flowMapStr string) (flowAllMap string) { +func InsetFlowLog(state, stepInt, nextStep int, userKey, flowMapStr string) (flowAllMap string) { // fmt.Printf("Flow_log:--Begin-->%v-->%v\n", stepInt, flowMapStr) var flowMap []FlowAllMap jsonErr := json.Unmarshal([]byte(flowMapStr), &flowMap) @@ -1994,6 +2001,8 @@ func InsetFlowLog(state, stepInt int, userKey, flowMapStr string) (flowAllMap st eiteFlowInfo.State = 2 } else if v.Step == stepInt { eiteFlowInfo.State = state + } else if nextStep <= 0 && v.Step == 7 { + eiteFlowInfo.State = 2 } else { eiteFlowInfo.State = 1 } @@ -2277,7 +2286,7 @@ func IntegrationFlowAll(flowID int64, class int) (flowAllMap string, flowMap []F //7、发起人验收 var serverFlowInfo FlowAllMap serverFlowInfo.Step = 7 - serverFlowInfo.NodeName = GetSetpName(5) + serverFlowInfo.NodeName = GetSetpName(6) serverFlowInfo.State = 1 serverFlowInfo.Class = 1 serverFlowInfo.UserList = GetFlowNodeMan(flowID, class, 1, 2) @@ -3143,6 +3152,21 @@ func IsItTrueString(id string, idAry []string) (isTrue bool) { return } +//判断是否存在泛型 +type faxingType interface { + int | int8 | int16 | int32 | int64 | string +} + +func IsInTrue[T faxingType](key T, keyAry []T) (isTrue bool) { + isTrue = false + for _, v := range keyAry { + if v == key { + return true + } + } + return +} + //获取多部门归属集团 func GetDuboDepart(departAry []string) (group []string) { fmt.Printf("DeparAry--------->%v\n", departAry)