package quantification import ( "sync" "gin_server_admin/commonus" "gin_server_admin/model/common/response" "gin_server_admin/model/hrsystem" "github.com/gin-gonic/gin" ) type ApiGroup struct{} // 协程设置 var synergeticProcess = sync.WaitGroup{} // 数据锁统计 type dataLockStatistics struct { YearTime []string OrgMap []orgModelsAry mutext sync.RWMutex } // 读取锁数据 func (d *dataLockStatistics) readDataLock() ([]orgModelsAry, []string) { d.mutext.RLock() defer d.mutext.RUnlock() return d.OrgMap, d.YearTime } // 入口 func (a *ApiGroup) Index(c *gin.Context) { outPut := commonus.MapOut() response.Result(0, outPut, "手机量化考核入口", c) } // 获取指标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:平均值 AnalysisAngle int `json:"analysisangle"` //分析维度 1:行政组织;2:时间 } // 时间属性 type TimeAttributeMap struct { Class int `json:"class"` //0:全年;1:半年;2:季度;3:月度 Time []int `json:"time"` //class->0(0),Time->1(1:上半年,2:下半年),class->2(1:第一季度,2:第二季度,3:第三季度,4:第四季度),class->3(1:1月....12:12月) } // 组织架构 type orgModels struct { Id string `json:"id"` //组织ID Pid string `jsonL:"pid"` //上级 Name string `json:"name"` //名称 Level int64 `json:level` //等级 SunOrg []int64 `json:"sunorg"` //子集 } type orgModelsAry struct { orgModels Child []orgModels `json:"child"` } // 查询指标数据流水 type flowLogDataList struct { Id int64 `json:"id" gorm:"primaryKey;column:fld_id;type:bigint(20) unsigned;not null;comment:Id;index"` EvaluationPlan int64 `json:"evaluationplan" gorm:"column:fld_evaluation_id;type:bigint(20) unsigned;default:0;not null;comment:考核方案项目ID"` Key int64 `json:"key" gorm:"column:fld_flow_log;type:bigint(20) unsigned;default:0;not null;comment:识别标志"` Score int64 `json:"score" gorm:"column:fld_score;type:bigint(20) unsigned;default:0;not null;comment:数据"` EvaluationPlanFlow string `json:"evaluationplanflow" gorm:"column:fl_evaluation_id;type:mediumtext unsigned;default:0;not null;comment:考核方案项目ID"` KeyFlow int64 `json:"keyflow" gorm:"column:fl_key;type:bigint(20) unsigned;default:0;not null;comment:识别标志"` Year int64 `json:"year" gorm:"column:fl_year;type:int(7) unsigned;default:0;not null;comment:年分"` Quarter int64 `json:"quarter" gorm:"column:fl_quarter;type:int(2) unsigned;default:0;not null;comment:季度"` Month int64 `json:"month" gorm:"column:fl_month;type:int(2) unsigned;default:0;not null;comment:月"` Week int64 `json:"week" gorm:"column:fl_week;type:int(5) unsigned;default:0;not null;comment:周"` ToDay int64 `json:"today" gorm:"column:fl_day;type:int(5) unsigned;default:0;not null;comment:天"` DutyGroup int64 `json:"dutygroup" gorm:"column:fl_duty_group;type:bigint(20) unsigned;default:0;not null;comment:职责集团"` DutyDepartment int64 `json:"dutydepartment" gorm:"column:fl_duty_department;type:bigint(20) unsigned;default:0;not null;comment:职责部门"` } type OutGovCont struct { hrsystem.AdministrativeOrganization ClassName string `json:"classname" gorm:"column:classname;type:varchar(255) unsigned;default:'';not null;comment:行政组织分类名称"` Level int64 `json:"level" gorm:"column:level;type:int(5) unsigned;default:1;not null;comment:级别"` } // 时间维度构造 type TimeFrame struct { XLine string `json:"xline"` YearName string `json:"yearname"` Class int `json:"class"` Where []int `json:"where"` } // 时间维度输出构造 type GraphicStatistics struct { XLine []string `json:"xAxis"` //x轴维度 Cylindrical []string `json:"legend"` //柱形体名称集合 CylindricalData []series `json:"series"` //柱形体数值集合 } // 数值结构体 type series struct { Name string `json:"name"` //柱形体名称 Data []float64 `json:"data"` //对应X轴点位数值 } 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 AddDutyNewCont struct { Id string `json:"id"` //维度ID Name string `json:"name"` // Order int64 `json:"ordering"` ZhiFraction int `json:"zhiFraction"` Child []EvaluPross `json:"child"` //考核细则 } // 指标 type EvaluPross struct { Id string `json:"id"` //维度ID Name string `json:"name"` Content string `json:"content"` //指标说明 Unit string `json:"unit"` //单位"` ReferenceScore float64 `json:"referencescore"` //标准分值"` Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年"` CycleAttres int `json:"cycleattr"` //辅助计数"` State int `json:"state"` Score int64 `json:"score"` //分数 QualEvalId string `json:"qeid"` Status int `json:"status"` } // 查询成绩表月份明细 type detailedResults struct { Department string `json:"department"` //部门 Year int64 `json:"year"` //年 Months int `json:"month"` //月份 } // 输出程序月份详情表 type detailedResultsList struct { GroupId string `json:"group"` //集团Id GroupName string `json:"groupname"` //集团名称 DepartmentId string `json:"departmentid"` //部门ID DepartmentName string `json:"departmentname"` //部门名称 DimensionId string `json:"dimensionid"` //维度Id DimensionName string `json:"dimensionname"` //维度名称 DimensionWeight int64 `json:"dimensionweight"` //维度权重 TargetId string `json:"targetid"` //指标ID TargetName string `json:"targetname"` //指标名称 TargetCont string `json:"targetCont"` //指标说明 Targetweight int64 `json:"targetweight"` //指标权重 Type int `json:"type"` //1:定性;2:定量 Unit string `json:"unit"` //单位 Cycle int `json:"cycle"` //周期 Cycleattr int `json:"cycleattr"` //辅助参数 ExecutiveDepartment []string `json:"executivedepartment"` //执行部门 Score float64 `json:"score"` //得分 } // 定量流水全奖值、零奖值、封顶值 type FlowLogAllZreo struct { Id string `json:"id"` TargetId string `json:"targetid"` //指标ID` Zeroprize float64 `json:"zeroprize"` //零奖值"` Allprize float64 `json:"allprize"` //全奖值"` Capping float64 `json:"capping"` //封顶值"` } // 查询成绩表月份明细历史 type detailedResultsLog struct { TargetId string `json:"targetid"` //指标ID Department string `json:"department"` //部门 Year int64 `json:"year"` //年 Months int `json:"month"` //月份 } // 定量考核基础参数 type dingLiangKaoHe struct { Zeroprize float64 `json:"zeroprize"` //零奖值"` Allprize float64 `json:"allprize"` //全奖值"` Capping float64 `json:"capping"` //封顶值"` Actual float64 `json:"actual"` //实际值 CompletionRate float64 `json:"completionrate"` //达成率 Score float64 `json:"score"` //得分 MtOrAt int `json:"mtorat"` //手动还是自动 Cont string `json:"count"` //说明 } // 定性记录列表 type dingXingLogScoreList struct { AddOrSubtract int `json:"addorsubtract"` Score float64 `json:"score"` Time string `json:"time"` EvalUserCont []EvalUserContStruct `json:"evalusercont"` Cont string `json:"count"` //说明 } type EvalUserContStruct struct { Department string `json:"department"` UserName string `json:"username"` }