@ -2137,3 +2137,65 @@ func (s *ShiyanApi) Shujuyichang(c *gin.Context) {
fmt . Printf ( "%v %v %v %v-%v %v %v\n" , v . Title , orgContDer . Name , commonus . Decimal ( v . Score / 100 ) , v . Year , v . Month , userContDer . Name , v . ScoringScore )
fmt . Printf ( "%v %v %v %v-%v %v %v\n" , v . Title , orgContDer . Name , commonus . Decimal ( v . Score / 100 ) , v . Year , v . Month , userContDer . Name , v . ScoringScore )
}
}
}
}
//归档部门考核方案版本时间周期问题
func ( s * ShiyanApi ) DepartmentPlanVersion ( c * gin . Context ) {
//获取考核方案
var assessTargetContentList [ ] assessmentmodel . PlanVersio
planVersioErr := global . GVA_DB_Performanceappraisal . Find ( & assessTargetContentList ) . Error
if planVersioErr != nil {
response . Result ( 103 , planVersioErr , "数据获取失败!" , c )
return
}
for _ , v := range assessTargetContentList {
var planVersioInfo [ ] AddDutyNewCont
jsonErr := json . Unmarshal ( [ ] byte ( v . Content ) , & planVersioInfo )
if jsonErr == nil {
var planVersionList [ ] AddDutyNewCont
for _ , pv := range planVersioInfo {
var plvAry AddDutyNewCont
plvAry . Id = pv . Id
plvAry . Name = pv . Name
plvAry . ZhiFraction = pv . ZhiFraction
for _ , pvChild := range pv . Child {
var pvcList EvaluPross
pvcList . Id = pvChild . Id
pvcList . Name = pvChild . Content
pvcList . Unit = pvChild . Unit
pvcList . ReferenceScore = pvChild . ReferenceScore
var qualEvalCont assessmentmodel . QualitativeEvaluation
qualErr := qualEvalCont . GetCont ( map [ string ] interface { } { "`qe_qual_eval_id`" : v . Key , "qe_dimension" : pv . Id , "qe_target" : pvChild . Id , "qe_accept_evaluation" : v . Department } , "`qe_cycle`,`qe_cycleattr`" )
if qualErr == nil {
pvcList . Cycles = qualEvalCont . Cycles
pvcList . CycleAttres = qualEvalCont . CycleAttres
} else {
var evalTarCont assessmentmodel . EvaluationTarget
evalErr := evalTarCont . GetCont ( map [ string ] interface { } { "et_id" : pvChild . Id } , "`et_cycle`,`et_cycleattr`" )
if evalErr == nil {
pvcList . Cycles = evalTarCont . Cycles
pvcList . CycleAttres = evalTarCont . CycleAttres
}
}
pvcList . State = pvChild . State
pvcList . Score = pvChild . Score
pvcList . QualEvalId = pvChild . QualEvalId
pvcList . Status = pvChild . Status
plvAry . Child = append ( plvAry . Child , pvcList )
}
planVersionList = append ( planVersionList , plvAry )
}
if len ( planVersionList ) > 0 {
jsonVal , _ := json . Marshal ( planVersionList )
saveDataJson := commonus . MapOut ( )
saveDataJson [ "content" ] = string ( jsonVal )
global . GVA_DB_Performanceappraisal . Model ( & assessmentmodel . PlanVersio { } ) . Where ( "id = ?" , v . Id ) . Updates ( saveDataJson )
}
}
}
response . Result ( 0 , planVersioErr , "完成!" , c )
}