Browse Source

编写统计前保存版本

qin_1
超级管理员 4 years ago
parent
commit
be7d7a8011
  1. 16
      gin_server_admin/README.md
  2. 71
      gin_server_admin/api/admin/dutyassess/assess.go
  3. 15
      gin_server_admin/api/admin/dutyassess/assesstype.go
  4. 19
      gin_server_admin/api/admin/dutyassess/dutyes.go
  5. 191
      gin_server_admin/api/admin/dutyassess/dutyhandle.go
  6. 73
      gin_server_admin/api/admin/dutyassess/planversio.go
  7. 54
      gin_server_admin/api/admin/systemuser/adminrole.go
  8. 79
      gin_server_admin/api/admin/systemuser/userhandle.go
  9. 36
      gin_server_admin/api/index/evaluation/assessment.go
  10. 59
      gin_server_admin/api/index/evaluation/evaluation.go
  11. 4
      gin_server_admin/api/index/evaluation/flowsend.go
  12. 26
      gin_server_admin/api/index/evaluation/lookquantita.go
  13. 9
      gin_server_admin/api/statistics/enter.go
  14. 33
      gin_server_admin/api/statistics/nature/enter.go
  15. 221
      gin_server_admin/api/statistics/nature/statistics.go
  16. 81
      gin_server_admin/api/v1/assessment/department_target.go
  17. 45
      gin_server_admin/api/v1/assessment/qualitative_evaluation.go
  18. 49
      gin_server_admin/api/v1/assessment/ration_evaluation.go
  19. 25
      gin_server_admin/api/v1/assessment/specificduty.go
  20. 36
      gin_server_admin/api/v1/assessment/target.go
  21. 5
      gin_server_admin/api/v1/custom/customhandle.go
  22. 77
      gin_server_admin/api/v1/examtestpage/examtype.go
  23. 283
      gin_server_admin/api/v1/examtestpage/grouphandle.go
  24. 24
      gin_server_admin/api/v1/shiyan/enter.go
  25. 394
      gin_server_admin/api/v1/shiyan/shiyan.go
  26. 53
      gin_server_admin/api/v1/staff/staffpeople.go
  27. 9
      gin_server_admin/api/web/enter.go
  28. 72
      gin_server_admin/api/web/jixiaokaohe/enter.go
  29. 192
      gin_server_admin/api/web/jixiaokaohe/myduty.go
  30. 25
      gin_server_admin/api/web/jixiaokaohe/people.go
  31. 253
      gin_server_admin/commonus/publichaneld.go
  32. 8
      gin_server_admin/commonus/publicstruct.go
  33. 10
      gin_server_admin/initialize/router.go
  34. 2
      gin_server_admin/middleware/myjwt.go
  35. 1
      gin_server_admin/model/assessmentmodel/dutyclass.go
  36. 4
      gin_server_admin/router/enter.go
  37. 2
      gin_server_admin/router/shiyan/sys_shiyan.go
  38. 5
      gin_server_admin/router/statisticsrouter/enter.go
  39. 17
      gin_server_admin/router/statisticsrouter/statistics.go
  40. 19
      gin_server_admin/router/webrouter/webrouter.go

16
gin_server_admin/README.md

@ -25,6 +25,7 @@
├── timer
└── upload
```
## 文件说明
| 文件夹 | 说明 | 描述 |
| ------------ | ----------------------- | --------------------------- |
@ -58,3 +59,18 @@
```
detailed_target 指标细则
qualitative_evaluation 定性考核
```
### 记录要操作的对照表
assesstarget
department_dimension_weight
division_responsibilities
evaluationtarget
flow_log
plan_versio
qualitative_evaluation
qualitative_target
rectification_measures
score_flow
target_weight

71
gin_server_admin/api/admin/dutyassess/assess.go

@ -1,6 +1,7 @@
package dutyassess
import (
"encoding/json"
"strconv"
"strings"
"time"
@ -465,14 +466,24 @@ func (e *DutyAssessApi) LookQuantitativeConfig(c *gin.Context) {
outCont.Time = v.Time
outCont.State = v.State
outCont.DimensionId = strconv.FormatInt(v.Dimension, 10)
gErr, groupInfo := commonus.GetGroupCont(v.Group)
if gErr == true {
outCont.GroupTitle = groupInfo.Name
}
dErr, departmentInfo := commonus.GetBranchFactory(v.DepartmentId)
if dErr == true {
outCont.DimensionTitle = departmentInfo.Name
}
where := commonus.MapOut()
where["id"] = v.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
outCont.GroupTitle = orgCont.Name
// gErr, groupInfo := commonus.GetGroupCont(v.Group)
// if gErr == true {
// outCont.GroupTitle = groupInfo.Name
// }
whereDepart := commonus.MapOut()
whereDepart["id"] = v.DepartmentId
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
outCont.DimensionTitle = orgContDepart.Name
// dErr, departmentInfo := commonus.GetBranchFactory(v.DepartmentId)
// if dErr == true {
// outCont.DimensionTitle = departmentInfo.Name
// }
targetInfo, tErr := commonus.GetTargetInfo(v.Target)
if tErr == true {
outCont.TargetTitle = targetInfo.Title
@ -609,15 +620,26 @@ func (d *DutyAssessApi) GetDepartForDuty(c *gin.Context) {
userCont.Id = v
userCont.Name = usCont.Name
userCont.Icon = usCont.Icon
_, groupInfo := commonus.GetGroupCont(usCont.Group)
userCont.GroupName = groupInfo.Name
_, bfInfo := commonus.GetBranchFactory(usCont.DepartmentId)
userCont.DepartmentName = bfInfo.Name
where := commonus.MapOut()
where["id"] = usCont.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
userCont.GroupName = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = usCont.DepartmentId
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
userCont.DepartmentName = orgContDepart.Name
// _, groupInfo := commonus.GetGroupCont(usCont.Group)
// userCont.GroupName = groupInfo.Name
// _, bfInfo := commonus.GetBranchFactory(usCont.DepartmentId)
// userCont.DepartmentName = bfInfo.Name
userCont.Number = usCont.Number
outInfor.UserListAry = append(outInfor.UserListAry, userCont)
}
}
response.Result(0, outInfor, "获取失败失败!", c)
response.Result(0, outInfor, "获取成功!", c)
}
//修改已知定性考核指标关联部门
@ -663,6 +685,29 @@ func (d *DutyAssessApi) EiteDepartForDuty(c *gin.Context) {
saveDataSun["q_time"] = time.Now().Unix()
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeTarget{}).Where("`q_id` IN ?", sunTargetId).Updates(saveDataSun)
}
//考核细则
var detarTarget []string
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.Assesstarget{}).Select("content").Where("`group` = ? AND `dimension` = ? AND `targetid` = ?", requestData.Group, requestData.Dimension, requestData.TargetId).Find(&detarTarget)
if len(detarTarget) > 0 {
for _, dtv := range detarTarget {
var detarCont []DutyAssEssTarget
jsonErr := json.Unmarshal([]byte(dtv), detarCont)
if jsonErr == nil {
if len(detarCont) > 0 {
for _, dcv := range detarCont {
eiteDetailedTarget := commonus.MapOut()
eiteDetailedTarget["dt_id"] = dcv.Id
savDTCont := commonus.MapOut()
savDTCont["dt_paretment"] = strings.Join(requestData.DepartAry, ",")
savDTCont["dt_time"] = time.Now().Unix()
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DetailedTarget{}).Where(eiteDetailedTarget).Updates(savDTCont)
}
}
}
}
}
response.Result(0, sunTargetId, "编辑成功!", c)
}

15
gin_server_admin/api/admin/dutyassess/assesstype.go

@ -157,6 +157,13 @@ type TargetContOutCont struct {
DepartNameMap []string `json:"departnamemap"` //子栏目部门
ScoreIng string `json:"scoreing"` //分值
QualEvalId string `json:"qualevalid"`
CyclesDetTar int `json:"cycledettar"` //1:班;2:天;3:周;4:月;5:季度;6:年
CycleDetTarAttres int `json:"cycleattrdettar"` //辅助计数
CensorType []string `json:"censortype"` //检查方式(1:现场检查;2:资料检查;3:事件触发)
CensorCont string `json:"censorcont"` //检查依据
CensorRate int `json:"censorrate"` //检查频次
}
//定性考核列表输出
@ -248,6 +255,8 @@ type OutTargetCont struct {
CensorType []string `json:"censortype"` //检查方式(1:现场检查;2:资料检查;3:事件触发)
CensorCont string `json:"censorcont"` //检查依据
CensorRate int `json:"censorrate"` //检查频次
DepartmentId []string `json:"departmentid"` //接受考核的部门
}
//获取定性指标->指标细则修改回显修改或新增
@ -265,6 +274,7 @@ type GetEiteTargetCont struct {
CensorType []string `json:"censortype"` //检查方式(1:现场检查;2:资料检查;3:事件触发)
CensorCont string `json:"censorcont"` //检查依据
CensorRate int `json:"censorrate"` //检查频次
DepartmentId []string `json:"departmentid"` //接受考核的部门
}
//添加 定性考核指标关系指定
@ -303,6 +313,7 @@ type QualEvalSunList struct {
type DutyAssEssTarget struct {
Id int64 `json:"id"`
Operator []string `json:"operator"` //考核执行人
Department []string `json:"department"` //部门
}
//查看定性指标详情列表
@ -311,6 +322,10 @@ type LookTargetContList struct {
TargetId string `json:"targetid"`
Dimension string `json:"dimension"` //考核维度
DepartId string `json:"departid"` //部门
CensorType []string `json:"censortype"` //检查方式(1:现场检查;2:资料检查;3:事件触发)
CensorCont string `json:"censorcont"` //检查依据
CensorRate int `json:"censorrate"` //检查频次
}
//查看定性指标细则提交参数

19
gin_server_admin/api/admin/dutyassess/dutyes.go

@ -27,10 +27,11 @@ import (
/*
参数说明
@ascription 归属指标栏目
@departStr 接受考核的部门
@sunTargetId 子栏目
@detailedTarget 考核细则
*/
func JudgeDetailsCopyEs(ascription string, sunTargetId int64, detailedTarget QualEvalSunList) (content assessmentmodel.DetailedTarget, isTrue bool) {
func JudgeDetailsCopyEs(ascription, departStr string, sunTargetId int64, detailedTarget QualEvalSunList) (content assessmentmodel.DetailedTarget, isTrue bool) {
if detailedTarget.AddOrReduce == 0 {
detailedTarget.AddOrReduce = 1
@ -72,7 +73,7 @@ func JudgeDetailsCopyEs(ascription string, sunTargetId int64, detailedTarget Qua
eiteCont["dt_max_score"] = maxScoreInt
}
eiteCont["dt_title"] = detailedTarget.Title
eiteCont["dt_content"] = detailedTarget.CensorCont
eiteCont["dt_content"] = detailedTarget.Content
eiteCont["dt_company"] = detailedTarget.Unit
eiteCont["dt_add_reduce"] = detailedTarget.AddOrReduce
eiteCont["dt_time"] = time.Now().Unix()
@ -92,6 +93,10 @@ func JudgeDetailsCopyEs(ascription string, sunTargetId int64, detailedTarget Qua
eiteCont["dt_censor_rate"] = detailedTarget.CensorRate
}
if departStr != "" {
eiteCont["dt_paretment"] = departStr
}
global.GVA_DB_Performanceappraisal.Model(&content).Where("`dt_id` = ?", detailedTarget.DetailedTarget).Updates(&eiteCont)
// fmt.Printf("echo --------------1---------->%v\n", content)
isTrue = true
@ -109,7 +114,7 @@ func JudgeDetailsCopyEs(ascription string, sunTargetId int64, detailedTarget Qua
eiteCont["dt_min_score"] = minScoreInt
eiteCont["dt_max_score"] = maxScoreInt
}
eiteCont["dt_content"] = detailedTarget.CensorCont
eiteCont["dt_content"] = detailedTarget.Content
eiteCont["dt_company"] = detailedTarget.Unit
eiteCont["dt_add_reduce"] = detailedTarget.AddOrReduce
eiteCont["dt_time"] = time.Now().Unix()
@ -128,7 +133,9 @@ func JudgeDetailsCopyEs(ascription string, sunTargetId int64, detailedTarget Qua
if detailedTarget.CensorRate != 0 {
eiteCont["dt_censor_rate"] = detailedTarget.CensorRate
}
if departStr != "" {
eiteCont["dt_paretment"] = departStr
}
global.GVA_DB_Performanceappraisal.Model(&content).Where("`dt_id` = ?", content.Id).Updates(&eiteCont)
// fmt.Printf("echo --------------2---------->%v\n", content)
return
@ -153,7 +160,7 @@ func JudgeDetailsCopyEs(ascription string, sunTargetId int64, detailedTarget Qua
var saveColumEs assessmentmodel.DetailedTarget
saveColumEs.Title = detailedTarget.Title
saveColumEs.Content = detailedTarget.CensorCont
saveColumEs.Content = detailedTarget.Content
saveColumEs.ParentId = ascriptionId
saveColumEs.ParentIdSun = sunTargetId
saveColumEs.State = 1
@ -200,7 +207,7 @@ func JudgeDetailsCopyEs(ascription string, sunTargetId int64, detailedTarget Qua
saveColumEs.CycleAttres = 1
}
}
saveColumEs.Paretment = departStr
addErr := global.GVA_DB_Performanceappraisal.Create(&saveColumEs).Error
// saveColum := assessmentmodel.DetailedTarget{

191
gin_server_admin/api/admin/dutyassess/dutyhandle.go

@ -484,6 +484,9 @@ func (d *DutyAssessApi) EiteSunTargetName(c *gin.Context) {
if requestData.CensorRate > 0 {
eiteAssContDeite["dt_censor_rate"] = requestData.CensorRate
}
if len(requestData.DepartmentMap) > 0 {
eiteAssContDeite["dt_paretment"] = strings.Join(requestData.DepartmentMap, ",")
}
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DetailedTarget{}).Where("`dt_id` IN ?", detaTargetid).Updates(eiteAssContDeite)
}
@ -606,7 +609,7 @@ func (d *DutyAssessApi) AddDutyRelation(c *gin.Context) {
response.Result(106, err, "请添加测评详情!", c)
return
}
fmt.Printf("kjh------11------>%v\n", requestData)
// fmt.Printf("kjh------11------>%v\n", requestData)
sunTarDepartStr := strings.Join(requestData.AcceptDepartmentId, ",")
//获取子目标情况
sunTargetCont, sunTargetErr := commonus.JudgeColumn(requestData.Target, requestData.TargetSun, requestData.TargetSunTitle, sunTarDepartStr)
@ -645,8 +648,10 @@ func (d *DutyAssessApi) AddDutyRelation(c *gin.Context) {
for _, v := range requestData.EvaluationList {
// detailedTargetInfo, dtiIsTrue := commonus.JudgeDetails(requestData.Target, v.Title, v.Content, v.DetailedTarget, sunTargetCont.Id)
// detailedTargetInfo, dtiIsTrue := commonus.JudgeDetailsCopy(requestData.Target, v.Title, v.Content, v.DetailedTarget, v.ReferenceScore, v.Unit, sunTargetCont.Id, v.AddOrReduce)
// fmt.Printf("关联部门------11------>%v\n", sunTarDepartStr)
// panic(sunTarDepartStr)
detailedTargetInfo, dtiIsTrue := JudgeDetailsCopyEs(requestData.Target, sunTarDepartStr, sunTargetCont.Id, v)
detailedTargetInfo, dtiIsTrue := JudgeDetailsCopyEs(requestData.Target, sunTargetCont.Id, v)
/*
参数说明
@ascription 归属指标栏目
@ -700,11 +705,11 @@ func (d *DutyAssessApi) AddDutyRelation(c *gin.Context) {
}
var sunTarId []int64
judgeARkTErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.Assesstarget{}).Select("`suntargetid`").Where("`group` = ? AND `dimension` = ? AND `targetid` = ? ", groupInt, dimensionInt, targetInt).Find(&sunTarId).Error
fmt.Printf("kjh------1------>%v------>%v\n", sunTarId, judgeARkTErr)
// fmt.Printf("kjh------1------>%v------>%v\n", sunTarId, judgeARkTErr)
if judgeARkTErr == nil {
var sunTarDepartMap []string
judgeSunTarkTErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeTarget{}).Select("`q_depart`").Where("`q_id` IN ?", sunTarId).Find(&sunTarDepartMap).Error
fmt.Printf("kjh------2------>%v\n", sunTarDepartMap)
// fmt.Printf("kjh------2------>%v\n", sunTarDepartMap)
if judgeSunTarkTErr == nil {
// var departStrAry []string
for _, vvk := range sunTarDepartMap {
@ -721,7 +726,7 @@ func (d *DutyAssessApi) AddDutyRelation(c *gin.Context) {
eiteContkk["departmentmap"] = strings.Join(guanLianBuMen, ",")
eiteContkk["time"] = time.Now().Unix()
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.Assesstarget{}).Where("`suntargetid` IN ?", sunTarId).Updates(eiteContkk)
fmt.Printf("kjh------3------>%v\n", eiteContkk)
// fmt.Printf("kjh------3------>%v\n", eiteContkk)
}
if judgeARTErr == nil {
@ -858,22 +863,42 @@ func (d *DutyAssessApi) GetDutyRelationList(c *gin.Context) {
outCont.CycleAttres = tarCont.CycleAttres //辅助计数"`
outCont.State = 1
outCont.DepartmentId, outCont.DepartmentAry = commonus.GetBranchDepartAry(strings.Split(v.Departmentmap, ","))
// outCont.DepartmentId, outCont.DepartmentAry = commonus.GetBranchDepartAry(strings.Split(v.Departmentmap, ","))
outCont.DepartmentId, outCont.DepartmentAry = commonus.GetNewOrgList(strings.Split(v.Departmentmap, ","))
shenPiRen := strings.Split(tarCont.Report, ",")
outCont.UserList = shenPiRen
for _, v := range shenPiRen {
usCont, usErr := commonus.GetWorkUser(v)
// usCont, usErr := commonus.GetWorkUser(v)
userWher := commonus.MapOut()
userWher["key"] = v
usCont, usErr := commonus.GetNewHrPeopleInfo(userWher)
// GetWorkUser
if usErr == true {
var userCont QualEvalArrt
userCont.Id = v
userCont.Name = usCont.Name
userCont.Icon = usCont.Icon
_, groupInfo := commonus.GetGroupCont(usCont.Group)
userCont.GroupName = groupInfo.Name
_, bfInfo := commonus.GetBranchFactory(usCont.DepartmentId)
userCont.DepartmentName = bfInfo.Name
where := commonus.MapOut()
// where["id"] = usCont.Group
where["id"] = usCont.Company
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name", "abbreviation")
userCont.GroupName = orgCont.Name
if orgCont.Abbreviation != "" {
userCont.GroupName = orgCont.Abbreviation
}
whereDepart := commonus.MapOut()
// whereDepart["id"] = usCont.DepartmentId
whereDepart["id"] = usCont.Deparment
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
userCont.DepartmentName = orgContDepart.Name
// _, groupInfo := commonus.GetGroupCont(usCont.Group)
// userCont.GroupName = groupInfo.Name
// _, bfInfo := commonus.GetBranchFactory(usCont.DepartmentId)
// userCont.DepartmentName = bfInfo.Name
userCont.Number = usCont.Number
outCont.UserListAry = append(outCont.UserListAry, userCont)
}
@ -905,7 +930,11 @@ func (d *DutyAssessApi) LookDutyTargetInfo(c *gin.Context) {
return
}
var assessInfoList []assessmentmodel.Assesstarget
assErr := global.GVA_DB_Performanceappraisal.Where("`group` = ? AND `dimension` = ? AND `targetid` = ?", requestData.Group, requestData.Dimension, requestData.TargetId).Find(&assessInfoList).Error
goromDb := global.GVA_DB_Performanceappraisal.Where("`group` = ? AND `dimension` = ? AND `targetid` = ?", requestData.Group, requestData.Dimension, requestData.TargetId)
// if requestData.DepartId != "" {
// goromDb = goromDb.Where("FIND_IN_SET(?,`qe_operator`)", requestData.DepartId)
// }
assErr := goromDb.Find(&assessInfoList).Error
if assErr != nil {
response.Result(105, assErr, "没有获取到数据!", c)
return
@ -917,15 +946,28 @@ func (d *DutyAssessApi) LookDutyTargetInfo(c *gin.Context) {
uotCont.Type = 1
//集团
uotCont.Group = requestData.Group
_, groupCont := commonus.GetGroupCont(v.Group)
uotCont.GroupNAme = groupCont.Name
// _, groupCont := commonus.GetGroupCont(v.Group)
// uotCont.GroupNAme = groupCont.Name
where := commonus.MapOut()
where["id"] = v.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
uotCont.GroupNAme = orgCont.Name
//执行部门
uotCont.DepartmentId = v.Departmentmap
_, departInfoAry := commonus.GetBranchDepartAry(strings.Split(v.Departmentmap, ","))
_, DepartmentAry := commonus.GetNewOrgList(strings.Split(v.Departmentmap, ","))
var depNameMap []string
for _, sep_v := range departInfoAry {
for _, sep_v := range DepartmentAry {
depNameMap = append(depNameMap, sep_v.Parentname)
}
// _, departInfoAry := commonus.GetBranchDepartAry(strings.Split(v.Departmentmap, ","))
// var depNameMap []string
// for _, sep_v := range departInfoAry {
// depNameMap = append(depNameMap, sep_v.Parentname)
// }
uotCont.DepartmentName = strings.Join(depNameMap, ",")
uotCont.DepartNameMap = depNameMap
//维度
@ -942,15 +984,15 @@ func (d *DutyAssessApi) LookDutyTargetInfo(c *gin.Context) {
sunTarDepartMap := strings.Split(info.Depart, ",")
uotCont.DepartIdMap = sunTarDepartMap
//查询部门
isShow := false
if requestData.DepartId != "" {
if commonus.IsItTrueString(requestData.DepartId, sunTarDepartMap) == true {
isShow = true
}
} else {
isShow = true
}
isShow := true
// if requestData.DepartId != "" {
// if commonus.IsItTrueString(requestData.DepartId, sunTarDepartMap) == true {
// isShow = true
// }
// } else {
// isShow = true
// }
// fmt.Printf("isShow-------->%v-------->%v-------->%v---->%v\n", isShow, requestData.DepartId, sunTarDepartMap, v.SunTargetId)
if isShow == true {
uotCont.TargetSunName = info.Title
//拆解指标详情
@ -965,7 +1007,47 @@ func (d *DutyAssessApi) LookDutyTargetInfo(c *gin.Context) {
uotCont.DetailedTarget = strconv.FormatInt(d_v.Id, 10)
uotCont.UserList = d_v.Operator
dtCont, _ := commonus.GetDetailedTargetInfo(d_v.Id)
// dtCont, _ := commonus.GetDetailedTargetInfo(d_v.Id)
// isDepartAry := strings.Split(dtCont.Paretment, ",")
// isShowTar := false
// if len(isDepartAry) > 0 && requestData.DepartId != "" {
// if commonus.IsItTrueString(requestData.DepartId, isDepartAry) == true {
// isShowTar = true
// } else {
// isShowTar = false
// }
// } else {
// isShowTar = true
// }
isShowTar := false
var dtCont assessmentmodel.DetailedTarget
gormDbDetaTar := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DetailedTarget{}).Where("dt_id = ?", d_v.Id)
if requestData.DepartId != "" {
gormDbDetaTar = gormDbDetaTar.Where("FIND_IN_SET(?,`dt_paretment`)", requestData.DepartId)
}
if requestData.CensorRate != 0 {
gormDbDetaTar = gormDbDetaTar.Where("dt_censor_rate = ?", requestData.CensorRate)
}
if requestData.CensorCont != "" {
gormDbDetaTar = gormDbDetaTar.Where("dt_censor_cont LIKE ?", "%"+requestData.CensorCont+"%")
}
errDetaTar := gormDbDetaTar.First(&dtCont).Error
if errDetaTar == nil {
if len(requestData.CensorType) > 0 {
conCensorType := strings.Split(dtCont.CensorType, ",")
for _, cvk := range requestData.CensorType {
if commonus.IsItTrueString(cvk, conCensorType) == true {
isShowTar = true
}
}
} else {
isShowTar = true
}
}
fmt.Printf("isShowTar-------->%v---->%v---->%v\n", isShowTar, requestData.DepartId, dtCont)
if isShowTar == true {
uotCont.DetailedTargetName = dtCont.Title
uotCont.Content = dtCont.Content
uotCont.Unit = dtCont.Company
@ -973,6 +1055,12 @@ func (d *DutyAssessApi) LookDutyTargetInfo(c *gin.Context) {
uotCont.MinScore = float64(dtCont.MinScore) / 100
uotCont.MaxScore = float64(dtCont.MaxScore) / 100
uotCont.CyclesDetTar = dtCont.Cycles //`json:"cycledettar"` //1:班;2:天;3:周;4:月;5:季度;6:年
uotCont.CycleDetTarAttres = dtCont.CycleAttres //`json:"cycleattrdettar"` //辅助计数
uotCont.CensorType = strings.Split(dtCont.CensorType, ",") //`json:"censortype"` //检查方式(1:现场检查;2:资料检查;3:事件触发)
uotCont.CensorCont = dtCont.CensorCont //`json:"censorcont"` //检查依据
uotCont.CensorRate = dtCont.CensorRate //`json:"censorrate"` //检查频次
uotCont.ScoreIng = "0"
if dtCont.MinScore > 0 && dtCont.MaxScore > 0 {
uotCont.ScoreIng = fmt.Sprintf("%v-%v", float64(dtCont.MinScore)/100, float64(dtCont.MaxScore)/100)
@ -990,10 +1078,21 @@ func (d *DutyAssessApi) LookDutyTargetInfo(c *gin.Context) {
userCont.Id = u_v
userCont.Name = usCont.Name
userCont.Icon = usCont.Icon
_, groupInfo := commonus.GetGroupCont(usCont.Group)
userCont.GroupName = groupInfo.Name
_, bfInfo := commonus.GetBranchFactory(usCont.DepartmentId)
userCont.DepartmentName = bfInfo.Name
where := commonus.MapOut()
where["id"] = usCont.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
userCont.GroupName = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = usCont.DepartmentId
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
userCont.DepartmentName = orgContDepart.Name
// _, groupInfo := commonus.GetGroupCont(usCont.Group)
// userCont.GroupName = groupInfo.Name
// _, bfInfo := commonus.GetBranchFactory(usCont.DepartmentId)
// userCont.DepartmentName = bfInfo.Name
userCont.Number = usCont.Number
uotCont.UserListAry = append(uotCont.UserListAry, userCont)
}
@ -1001,6 +1100,8 @@ func (d *DutyAssessApi) LookDutyTargetInfo(c *gin.Context) {
uotContAry = append(uotContAry, uotCont)
}
}
} else {
uotContAry = append(uotContAry, uotCont)
}
@ -1109,6 +1210,9 @@ func (d *DutyAssessApi) GetNewEiteDetailedTarget(c *gin.Context) {
} else {
outPutCont.Score = "0"
}
if cont.Paretment != "" {
outPutCont.DepartmentId = strings.Split(cont.Paretment, ",")
}
//解析考核方案内的指标关联人
//拆解指标详情
var detailedList []DutyAssEssTarget
@ -1122,10 +1226,21 @@ func (d *DutyAssessApi) GetNewEiteDetailedTarget(c *gin.Context) {
userCont.Id = us_key
userCont.Name = usCont.Name
userCont.Icon = usCont.Icon
_, groupInfo := commonus.GetGroupCont(usCont.Group)
userCont.GroupName = groupInfo.Name
_, bfInfo := commonus.GetBranchFactory(usCont.DepartmentId)
userCont.DepartmentName = bfInfo.Name
where := commonus.MapOut()
where["id"] = usCont.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
userCont.GroupName = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = usCont.DepartmentId
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
userCont.DepartmentName = orgContDepart.Name
// _, groupInfo := commonus.GetGroupCont(usCont.Group)
// userCont.GroupName = groupInfo.Name
// _, bfInfo := commonus.GetBranchFactory(usCont.DepartmentId)
// userCont.DepartmentName = bfInfo.Name
userCont.Number = usCont.Number
outPutCont.OperatorAry = append(outPutCont.OperatorAry, userCont)
outPutCont.Operator = append(outPutCont.Operator, us_key)
@ -1172,6 +1287,12 @@ func (d *DutyAssessApi) NewEiteDetailedTarget(c *gin.Context) {
response.Result(104, errAssErr, "没有获取到数据!", c)
return
}
var departmentStr string
if len(requestData.DepartmentId) > 0 {
departmentStr = strings.Join(requestData.DepartmentId, ",")
} else {
departmentStr = assCont.Departmentmap
}
// detailedTargetInfo, dtiIsTrue := commonus.JudgeDetailsCopy(strconv.FormatInt(assCont.TargetId, 10), requestData.DetailedTargetName, requestData.DetailedTargetContent, requestData.Id, requestData.Score, requestData.Unit, assCont.SunTargetId, requestData.AddOrReduce)
//判断考核细则是否存在(新规则)
@ -1224,7 +1345,7 @@ func (d *DutyAssessApi) NewEiteDetailedTarget(c *gin.Context) {
// Score string `json:"score"` //分值
// AddOrReduce int `json:"addorreduce"` //1:减少;2:增加
detailedTargetInfo, dtiIsTrue := JudgeDetailsCopyEs(strconv.FormatInt(assCont.TargetId, 10), assCont.SunTargetId, detailedTarget)
detailedTargetInfo, dtiIsTrue := JudgeDetailsCopyEs(strconv.FormatInt(assCont.TargetId, 10), departmentStr, assCont.SunTargetId, detailedTarget)
if dtiIsTrue != true {
response.Result(105, errAssErr, "指标明细编辑失败!", c)
return

73
gin_server_admin/api/admin/dutyassess/planversio.go

@ -53,10 +53,18 @@ func (d *DutyAssessApi) DepartDutyPlanVersion(c *gin.Context) {
return
}
for i, v := range planVersio {
_, groupCont := commonus.GetGroupCont(v.Group)
planVersio[i].GroupName = groupCont.Name
_, departMent := commonus.GetBranchFactory(v.Department)
planVersio[i].DeaprtName = departMent.Name
where := commonus.MapOut()
where["id"] = v.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
planVersio[i].GroupName = orgCont.Name
// _, groupCont := commonus.GetGroupCont(v.Group)
// planVersio[i].GroupName = groupCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = v.Department
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
planVersio[i].DeaprtName = orgContDepart.Name
// _, departMent := commonus.GetBranchFactory(v.Department)
// planVersio[i].DeaprtName = departMent.Name
planVersio[i].Time = commonus.TimeStampToDate(v.AddTime, 20)
}
response.Result(0, planVersio, "获取成功", c)
@ -78,8 +86,14 @@ func (d *DutyAssessApi) AddDepartDutyVersio(c *gin.Context) {
if groupErr != nil {
groupId = 0
}
_, groupCont := commonus.GetGroupCont(groupId)
groupInitials := commonus.ChinaToPinYinFirstWord(groupCont.Name) //获取集团首字母
where := commonus.MapOut()
where["id"] = groupId
orgCont, _ := commonus.GetNewOrgCont(where, "id", "abbreviation")
groupInitials := commonus.ChinaToPinYinFirstWord(orgCont.Abbreviation) //获取集团首字母
// _, groupCont := commonus.GetGroupCont(groupId)
// groupInitials := commonus.ChinaToPinYinFirstWord(groupCont.Name) //获取集团首字母
if requestData.DepartmentId == "" {
response.Result(103, err, "数据获取失败!", c)
return
@ -365,15 +379,27 @@ func (d *DutyAssessApi) LookDepartDutyVersio(c *gin.Context) {
uotCont.Id = strconv.FormatInt(v.Id, 10)
uotCont.Type = v.Type
uotCont.Group = strconv.FormatInt(v.Group, 10)
groupErr, groupCont := commonus.GetGroupCont(v.Group)
if groupErr == true {
uotCont.GroupNAme = groupCont.Name
}
where := commonus.MapOut()
where["id"] = v.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
uotCont.GroupNAme = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = v.AcceptEvaluation
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
uotCont.DepartmentName = orgContDepart.Name
// groupErr, groupCont := commonus.GetGroupCont(v.Group)
// if groupErr == true {
// uotCont.GroupNAme = groupCont.Name
// }
uotCont.DepartmentId = strconv.FormatInt(v.AcceptEvaluation, 10)
deparConErr, deparConCont := commonus.GetBranchFactory(v.AcceptEvaluation)
if deparConErr == true {
uotCont.DepartmentName = deparConCont.Name
}
// deparConErr, deparConCont := commonus.GetBranchFactory(v.AcceptEvaluation)
// if deparConErr == true {
// uotCont.DepartmentName = deparConCont.Name
// }
uotCont.Dimension = strconv.FormatInt(v.Dimension, 10)
dutyClassCont, dutyClassErr := commonus.GetDutyClassInfo(v.Dimension)
if dutyClassErr == true {
@ -428,10 +454,21 @@ func (d *DutyAssessApi) LookDepartDutyVersio(c *gin.Context) {
userCont.Id = u_v
userCont.Name = usCont.Name
userCont.Icon = usCont.Icon
_, groupInfo := commonus.GetGroupCont(usCont.Group)
userCont.GroupName = groupInfo.Name
_, bfInfo := commonus.GetBranchFactory(usCont.DepartmentId)
userCont.DepartmentName = bfInfo.Name
where := commonus.MapOut()
where["id"] = usCont.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
userCont.GroupName = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = usCont.DepartmentId
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
userCont.DepartmentName = orgContDepart.Name
// _, groupInfo := commonus.GetGroupCont(usCont.Group)
// userCont.GroupName = groupInfo.Name
// _, bfInfo := commonus.GetBranchFactory(usCont.DepartmentId)
// userCont.DepartmentName = bfInfo.Name
userCont.Number = usCont.Number
uotCont.UserListAry = append(uotCont.UserListAry, userCont)
}

54
gin_server_admin/api/admin/systemuser/adminrole.go

@ -77,14 +77,25 @@ func (s *SystemRoleApi) SystemRoleList(c *gin.Context) {
printRoleCont.MenuOper = val.MenuOper
printRoleCont.Wand = val.Wand
printRoleCont.Group = val.Group
groupIsTrue, groupCont := commonus.GetGroupCont(val.Group)
if groupIsTrue == true {
printRoleCont.GroupName = groupCont.Name
}
bfIsTrue, bfCont := commonus.GetBranchFactory(val.Attribute)
if bfIsTrue == true {
printRoleCont.BranchFactoryName = bfCont.Name
}
where := commonus.MapOut()
where["id"] = val.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
printRoleCont.GroupName = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = val.Attribute
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
printRoleCont.BranchFactoryName = orgContDepart.Name
// groupIsTrue, groupCont := commonus.GetGroupCont(val.Group)
// if groupIsTrue == true {
// printRoleCont.GroupName = groupCont.Name
// }
// bfIsTrue, bfCont := commonus.GetBranchFactory(val.Attribute)
// if bfIsTrue == true {
// printRoleCont.BranchFactoryName = bfCont.Name
// }
json.Unmarshal([]byte(val.Jurisdiction), &printRoleCont.JurisdictionPower)
json.Unmarshal([]byte(val.MenuOper), &printRoleCont.MenuoperPower)
printRoleListMap = append(printRoleListMap, printRoleCont)
@ -337,14 +348,25 @@ func (s *SystemRoleApi) GetSystemRole(c *gin.Context) {
printRoleCont.MenuOper = systemRoleCont.MenuOper
printRoleCont.Wand = systemRoleCont.Wand
printRoleCont.Group = systemRoleCont.Group
groupIsTrue, groupCont := commonus.GetGroupCont(systemRoleCont.Group)
if groupIsTrue == true {
printRoleCont.GroupName = groupCont.Name
}
bfIsTrue, bfCont := commonus.GetBranchFactory(systemRoleCont.Attribute)
if bfIsTrue == true {
printRoleCont.BranchFactoryName = bfCont.Name
}
where := commonus.MapOut()
where["id"] = systemRoleCont.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
printRoleCont.GroupName = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = systemRoleCont.Attribute
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
printRoleCont.BranchFactoryName = orgContDepart.Name
// groupIsTrue, groupCont := commonus.GetGroupCont(systemRoleCont.Group)
// if groupIsTrue == true {
// printRoleCont.GroupName = groupCont.Name
// }
// bfIsTrue, bfCont := commonus.GetBranchFactory(systemRoleCont.Attribute)
// if bfIsTrue == true {
// printRoleCont.BranchFactoryName = bfCont.Name
// }
json.Unmarshal([]byte(systemRoleCont.Jurisdiction), &printRoleCont.JurisdictionPower)
json.Unmarshal([]byte(systemRoleCont.MenuOper), &printRoleCont.MenuoperPower)
response.Result(0, printRoleCont, "数据获取成功!", c)

79
gin_server_admin/api/admin/systemuser/userhandle.go

@ -4,7 +4,6 @@ import (
"strconv"
"time"
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/assessment"
"github.com/flipped-aurora/gin-vue-admin/server/commonus"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
@ -84,14 +83,24 @@ func (s *SystemUserApi) AdminList(c *gin.Context) {
sysAdminInfo.Tel = val.Tel
sysAdminInfo.TimeAttr = val.TimeAttr
isTrueGroup, groupCont := assessment.GetGroupCont(val.Group)
if isTrueGroup == true {
sysAdminInfo.GroupName = groupCont.Name
}
isTrueBranFact, branFactCont := assessment.GetBranchFactory(val.Attribute)
if isTrueBranFact == true {
sysAdminInfo.BranchFactoryName = branFactCont.Name
}
where := commonus.MapOut()
where["id"] = val.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
sysAdminInfo.GroupName = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = val.Attribute
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
sysAdminInfo.BranchFactoryName = orgContDepart.Name
// isTrueGroup, groupCont := assessment.GetGroupCont(val.Group)
// if isTrueGroup == true {
// sysAdminInfo.GroupName = groupCont.Name
// }
// isTrueBranFact, branFactCont := assessment.GetBranchFactory(val.Attribute)
// if isTrueBranFact == true {
// sysAdminInfo.BranchFactoryName = branFactCont.Name
// }
isTrueRole, adminRoleCont := GetAdminRoleInfo(val.Role)
if isTrueRole == true {
@ -136,14 +145,24 @@ func GetSysAdminLoginInfo(userName, userPwd string) (isTrue bool, sysAdminInfo a
sysAdminInfo.Tel = userInfo.Tel
sysAdminInfo.TimeAttr = userInfo.TimeAttr
isTrueGroup, groupCont := assessment.GetGroupCont(userInfo.Group)
if isTrueGroup == true {
sysAdminInfo.GroupName = groupCont.Name
}
isTrueBranFact, branFactCont := assessment.GetBranchFactory(userInfo.Attribute)
if isTrueBranFact == true {
sysAdminInfo.BranchFactoryName = branFactCont.Name
}
where := commonus.MapOut()
where["id"] = userInfo.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
sysAdminInfo.GroupName = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = userInfo.Attribute
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
sysAdminInfo.BranchFactoryName = orgContDepart.Name
// isTrueGroup, groupCont := assessment.GetGroupCont(userInfo.Group)
// if isTrueGroup == true {
// sysAdminInfo.GroupName = groupCont.Name
// }
// isTrueBranFact, branFactCont := assessment.GetBranchFactory(userInfo.Attribute)
// if isTrueBranFact == true {
// sysAdminInfo.BranchFactoryName = branFactCont.Name
// }
isTrueRole, adminRoleCont := GetAdminRoleInfo(userInfo.Role)
if isTrueRole == true {
@ -378,14 +397,24 @@ func (s *SystemUserApi) GetSystemAdminCont(c *gin.Context) {
sysAdminInfo.Tel = userInfo.Tel
sysAdminInfo.TimeAttr = userInfo.TimeAttr
isTrueGroup, groupCont := assessment.GetGroupCont(userInfo.Group)
if isTrueGroup == true {
sysAdminInfo.GroupName = groupCont.Name
}
isTrueBranFact, branFactCont := assessment.GetBranchFactory(userInfo.Attribute)
if isTrueBranFact == true {
sysAdminInfo.BranchFactoryName = branFactCont.Name
}
where := commonus.MapOut()
where["id"] = userInfo.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
sysAdminInfo.GroupName = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = userInfo.Attribute
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
sysAdminInfo.BranchFactoryName = orgContDepart.Name
// isTrueGroup, groupCont := assessment.GetGroupCont(userInfo.Group)
// if isTrueGroup == true {
// sysAdminInfo.GroupName = groupCont.Name
// }
// isTrueBranFact, branFactCont := assessment.GetBranchFactory(userInfo.Attribute)
// if isTrueBranFact == true {
// sysAdminInfo.BranchFactoryName = branFactCont.Name
// }
isTrueRole, adminRoleCont := GetAdminRoleInfo(userInfo.Role)
if isTrueRole == true {

36
gin_server_admin/api/index/evaluation/assessment.go

@ -44,11 +44,20 @@ func (e *EvaluationInterface) NewQualitative(c *gin.Context) {
for _, v := range qualEvaList {
var outCont NewQualOutList
outCont.Group = v.Group
_, groupCont := commonus.GetGroupCont(v.Group)
outCont.GroupName = groupCont.Name
where := commonus.MapOut()
where["id"] = v.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
outCont.GroupName = orgCont.Name
// _, groupCont := commonus.GetGroupCont(v.Group)
// outCont.GroupName = groupCont.Name
outCont.Department = v.Department
_, departCont := commonus.GetBranchFactory(v.Department)
outCont.DepartmentName = departCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = v.Department
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
outCont.DepartmentName = orgContDepart.Name
// _, departCont := commonus.GetBranchFactory(v.Department)
// outCont.DepartmentName = departCont.Name
outCont.Dimension = v.Dimension
dimensionCont, _ := commonus.GetDutyClassInfo(v.Dimension)
outCont.DimensionName = dimensionCont.Title
@ -94,11 +103,22 @@ func (e *EvaluationInterface) NewGetQualDetailedTarget(c *gin.Context) {
var outCont NewQualDetailOutList
outCont.Id = v.Id
outCont.Group = v.Group
_, groupCont := commonus.GetGroupCont(v.Group)
outCont.GroupName = groupCont.Name
where := commonus.MapOut()
where["id"] = v.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
outCont.GroupName = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = v.Department
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
outCont.DepartmentName = orgContDepart.Name
// _, groupCont := commonus.GetGroupCont(v.Group)
// outCont.GroupName = groupCont.Name
outCont.Department = v.Department
_, departCont := commonus.GetBranchFactory(v.Department)
outCont.DepartmentName = departCont.Name
// _, departCont := commonus.GetBranchFactory(v.Department)
// outCont.DepartmentName = departCont.Name
outCont.Dimension = v.Dimension
dimensionCont, _ := commonus.GetDutyClassInfo(v.Dimension)
outCont.DimensionName = dimensionCont.Title

59
gin_server_admin/api/index/evaluation/evaluation.go

@ -49,15 +49,26 @@ func (e *EvaluationInterface) QualitativeEvaluation(c *gin.Context) {
uotCont.Id = strconv.FormatInt(v.Id, 10)
uotCont.Type = v.Type
uotCont.Group = strconv.FormatInt(v.Group, 10)
groupErr, groupCont := commonus.GetGroupCont(v.Group)
if groupErr == true {
uotCont.GroupNAme = groupCont.Name
}
where := commonus.MapOut()
where["id"] = v.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
uotCont.GroupNAme = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = v.AcceptEvaluation
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
uotCont.DepartmentName = orgContDepart.Name
// groupErr, groupCont := commonus.GetGroupCont(v.Group)
// if groupErr == true {
// uotCont.GroupNAme = groupCont.Name
// }
uotCont.DepartmentId = strconv.FormatInt(v.AcceptEvaluation, 10)
deparConErr, deparConCont := commonus.GetBranchFactory(v.AcceptEvaluation)
if deparConErr == true {
uotCont.DepartmentName = deparConCont.Name
}
// deparConErr, deparConCont := commonus.GetBranchFactory(v.AcceptEvaluation)
// if deparConErr == true {
// uotCont.DepartmentName = deparConCont.Name
// }
uotCont.Dimension = strconv.FormatInt(v.Dimension, 10)
dutyClassCont, dutyClassErr := commonus.GetDutyClassInfo(v.Dimension)
if dutyClassErr == true {
@ -757,15 +768,26 @@ func (e *EvaluationInterface) QualitativeEvalRation(c *gin.Context) {
uotCont.Id = strconv.FormatInt(v.Id, 10)
uotCont.Type = v.Type
uotCont.Group = strconv.FormatInt(v.Group, 10)
groupErr, groupCont := commonus.GetGroupCont(v.Group)
if groupErr == true {
uotCont.GroupNAme = groupCont.Name
}
where := commonus.MapOut()
where["id"] = v.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
uotCont.GroupNAme = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = v.AcceptEvaluation
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
uotCont.DepartmentName = orgContDepart.Name
// groupErr, groupCont := commonus.GetGroupCont(v.Group)
// if groupErr == true {
// uotCont.GroupNAme = groupCont.Name
// }
uotCont.DepartmentId = strconv.FormatInt(v.AcceptEvaluation, 10)
deparConErr, deparConCont := commonus.GetBranchFactory(v.AcceptEvaluation)
if deparConErr == true {
uotCont.DepartmentName = deparConCont.Name
}
// deparConErr, deparConCont := commonus.GetBranchFactory(v.AcceptEvaluation)
// if deparConErr == true {
// uotCont.DepartmentName = deparConCont.Name
// }
uotCont.Dimension = strconv.FormatInt(v.Dimension, 10)
dutyClassCont, dutyClassErr := commonus.GetDutyClassInfo(v.Dimension)
if dutyClassErr == true {
@ -1010,6 +1032,11 @@ func (e *EvaluationInterface) AddFlowRationLog(c *gin.Context) {
addFlowLogErr := gromDb.Create(&flowLog).Error
addFlowLogDataErr := gromDb.Create(&flowDataLogAry).Error
commonus.StepAddData(keyNumber, 16182159043990656, 2, 7, 2, 2, 1, userCont.Key)
response.Result(0, flowLog, "数据写入成功", c)
return
//暂停审核方便录入测试数据
//fmt.Printf("%v---------------------->%v\n", addFlowLogErr, addFlowLogDataErr)
if addFlowLogErr == nil && addFlowLogDataErr == nil {
affairDbErr := gromDb.Commit().Error

4
gin_server_admin/api/index/evaluation/flowsend.go

@ -204,6 +204,10 @@ func (e *EvaluationInterface) PlusOrMinusPoints(c *gin.Context) {
}
}
commonus.StepAddDataEs(keyNumber, 0, 3, 1, 1, 2, 1, userCont.Key, requestData.Enclosure)
response.Result(0, addScore, "数据写入成功", c)
return
//暂停审核方便录入测试数据
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", keyNumber)
if myIsTrue != 1 {
//写入当前流程步骤

26
gin_server_admin/api/index/evaluation/lookquantita.go

@ -82,14 +82,24 @@ func (e *EvaluationInterface) LookQuantitativeConfig(c *gin.Context) {
outCont.Time = v.Time
outCont.State = v.State
gErr, groupInfo := commonus.GetGroupCont(v.Group)
if gErr == true {
outCont.GroupTitle = groupInfo.Name
}
dErr, departmentInfo := commonus.GetBranchFactory(v.DepartmentId)
if dErr == true {
outCont.DimensionTitle = departmentInfo.Name
}
where := commonus.MapOut()
where["id"] = v.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
outCont.GroupTitle = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = v.DepartmentId
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
outCont.DimensionTitle = orgContDepart.Name
// gErr, groupInfo := commonus.GetGroupCont(v.Group)
// if gErr == true {
// outCont.GroupTitle = groupInfo.Name
// }
// dErr, departmentInfo := commonus.GetBranchFactory(v.DepartmentId)
// if dErr == true {
// outCont.DimensionTitle = departmentInfo.Name
// }
targetInfo, tErr := commonus.GetTargetInfo(v.Target)
if tErr == true {
outCont.TargetTitle = targetInfo.Title

9
gin_server_admin/api/statistics/enter.go

@ -0,0 +1,9 @@
package statistics
import "github.com/flipped-aurora/gin-vue-admin/server/api/statistics/nature"
type ApiGroup struct {
NatureApi nature.ApiGroup
}
var ApiGroupApp = new(ApiGroup)

33
gin_server_admin/api/statistics/nature/enter.go

@ -0,0 +1,33 @@
package nature
type ApiGroup struct{}
//获取指标ID
type getTargetId[T any] struct {
TargetId []T `json:"targetid"` //指标
}
//定性考核查询参数
type natureParameter struct {
TargetId []string `json:"targetid"` //指标
Org []string `json:"org"` //行政组织
Year []string `json:"year"` //年
TimeAttribute []TimeAttributeMap `json:"timeattribute"` //时间辅助
AccMethod []int `json:"accmethod"` //核算方式 1:合计值;2:平均值
}
//时间属性
type TimeAttributeMap struct {
Class int `json:"class"` //0:全年;1:半年;2:季度;3:月度
Time []int `json:"time"` //class->0(0),class->1(1:上半年,2:下半年),class->2(1:第一季度,2:第二季度,3:第三季度,4:第四季度),class->3(1:1月....12:12月)
}
//组织架构
type orgModels struct {
Id string `json:"id"`
Name string `json:"name"`
}
type orgModelsAry struct {
orgModels
Child []orgModels `json:"child"`
}

221
gin_server_admin/api/statistics/nature/statistics.go

@ -0,0 +1,221 @@
package nature
import (
"strconv"
"strings"
"time"
"github.com/flipped-aurora/gin-vue-admin/server/commonus"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/assessmentmodel"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/gin-gonic/gin"
)
//入口
func (a *ApiGroup) Index(c *gin.Context) {
outPut := commonus.MapOut()
response.Result(0, outPut, "手机考核入口", c)
}
//计算定性考核组织范围,及起止年份
func (a *ApiGroup) GetTargetOrgAndYear(c *gin.Context) {
isTrue, _ := commonus.ClientIdentity()
if isTrue != true {
response.Result(101, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c)
return
}
var requestData getTargetId[string]
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(102, err, "数据获取失败!", c)
return
}
if len(requestData.TargetId) < 1 {
response.Result(102, err, "未获取到指标", c)
return
}
// group, isTrue := commonus.GetNewHrOrg(41)
var accDepart []string
var orgMap []orgModelsAry
for _, v := range requestData.TargetId {
// fmt.Printf("v-------------->%v\n", v)
var releDepart string
// var orgMap []orgModelsAry
err := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationTarget{}).Select("et_relevant_departments").Where("`et_id` = ?", v).First(&releDepart).Error
if err == nil {
departAry := strings.Split(releDepart, ",")
// fmt.Printf("releDepart-------------->%v\n", departAry)
if len(departAry) > 0 {
for _, vv := range departAry {
orgId, _ := strconv.ParseInt(vv, 10, 64)
group, isTrue := commonus.GetNewHrOrg(orgId)
if commonus.IsItTrueString(vv, accDepart) {
accDepart = append(accDepart, vv)
}
// fmt.Printf("Group-----%v----Depart----->%v\n", group, vv)
if isTrue == true {
if len(orgMap) > 0 {
isYes := false
for oi, ov := range orgMap {
if ov.Id == strconv.FormatInt(group, 10) {
isYes = true
where := commonus.MapOut()
where["id"] = vv
orgCont, _ := commonus.GetNewOrgCont(where, "name")
var orgSunCont orgModels
orgSunCont.Id = vv
orgSunCont.Name = orgCont.Name
orgMap[oi].Child = append(orgMap[oi].Child, orgSunCont)
}
}
if isYes == false {
//写入集团信息
where := commonus.MapOut()
where["id"] = group
orgCont, _ := commonus.GetNewOrgCont(where, "name")
var orgMapCont orgModelsAry
orgMapCont.Id = strconv.FormatInt(group, 10)
orgMapCont.Name = orgCont.Name
orgMap = append(orgMap, orgMapCont)
}
} else {
//写入集团信息
where := commonus.MapOut()
where["id"] = group
orgCont, _ := commonus.GetNewOrgCont(where, "name")
var orgMapCont orgModelsAry
orgMapCont.Id = strconv.FormatInt(group, 10)
orgMapCont.Name = orgCont.Name
orgMap = append(orgMap, orgMapCont)
}
}
}
}
}
}
//获取时间
// targetIdAry := strings.Split(requestData.TargetId, ",")
var progIdAry []int64
var timeList []int64
gromDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_id").Where("qe_target IN ?", requestData.TargetId)
if len(accDepart) > 0 {
gromDb = gromDb.Where("qe_accept_evaluation IN ?", accDepart)
}
quaEvaErr := gromDb.Find(&progIdAry).Error
if quaEvaErr == nil {
if len(progIdAry) > 0 {
var timeAry []int64
scoFlowDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Select("sf_happen_time").Where("sf_evaluation_plan IN ?", progIdAry)
scoFlowErr := scoFlowDb.Find(&timeAry).Error
if scoFlowErr == nil {
// maxTime, minTime = commonus.NewUserModel(timeAry)
if len(timeAry) > 0 {
timeList = commonus.UniqueSort(timeAry)
}
}
}
}
var yearTime []string
if len(timeList) > 0 {
for _, tv := range timeList {
yearStr := commonus.TimeStampToDate(tv, 11)
if commonus.IsItTrueString(yearStr, yearTime) == false {
yearTime = append(yearTime, yearStr)
}
}
} else {
yearStr := commonus.TimeStampToDate(time.Now().Unix(), 11)
yearTime = append(yearTime, yearStr)
}
// var outYear []string
// if maxTime == 0 && minTime == 0 {
// yearStr := commonus.TimeStampToDate(time.Now().Unix(), 11)
// yearTime = append(yearTime, yearStr)
// }
outMap := commonus.MapOut()
outMap["grouplist"] = orgMap
outMap["timelist"] = yearTime
response.Result(0, outMap, "数据获取失败!", c)
}
//获取存在的组织架构
func getExistOrg(targetId string) []orgModelsAry {
var releDepart string
var orgMap []orgModelsAry
err := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationTarget{}).Select("et_relevant_departments").Where("`et_id` = ?", targetId).First(&releDepart).Error
if err == nil {
departAry := strings.Split(releDepart, ",")
// fmt.Printf("releDepart-------------->%v\n", departAry)
if len(departAry) > 0 {
for _, vv := range departAry {
orgId, _ := strconv.ParseInt(vv, 10, 64)
group, isTrue := commonus.GetNewHrOrg(orgId)
// fmt.Printf("Group-----%v----Depart----->%v\n", group, vv)
if isTrue == true {
if len(orgMap) > 0 {
isYes := false
for oi, ov := range orgMap {
if ov.Id == strconv.FormatInt(group, 10) {
isYes = true
where := commonus.MapOut()
where["id"] = vv
orgCont, _ := commonus.GetNewOrgCont(where, "name")
var orgSunCont orgModels
orgSunCont.Id = vv
orgSunCont.Name = orgCont.Name
orgMap[oi].Child = append(orgMap[oi].Child, orgSunCont)
}
}
if isYes == false {
//写入集团信息
where := commonus.MapOut()
where["id"] = group
orgCont, _ := commonus.GetNewOrgCont(where, "name")
var orgMapCont orgModelsAry
orgMapCont.Id = strconv.FormatInt(group, 10)
orgMapCont.Name = orgCont.Name
orgMap = append(orgMap, orgMapCont)
}
} else {
//写入集团信息
where := commonus.MapOut()
where["id"] = group
orgCont, _ := commonus.GetNewOrgCont(where, "name")
var orgMapCont orgModelsAry
orgMapCont.Id = strconv.FormatInt(group, 10)
orgMapCont.Name = orgCont.Name
orgMap = append(orgMap, orgMapCont)
}
}
}
}
}
return orgMap
}
//定性考核统计
func (a *ApiGroup) NatureStatistics(c *gin.Context) {
isTrue, _ := commonus.ClientIdentity()
if isTrue != true {
response.Result(101, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c)
return
}
var requestData natureParameter
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(102, err, "数据获取失败!", c)
return
}
if len(requestData.TargetId) < 1 {
response.Result(102, err, "未获取到指标", c)
return
}
// var scoreFlow []
}

81
gin_server_admin/api/v1/assessment/department_target.go

@ -134,15 +134,26 @@ func (d *DutyHandle) DepartmentTaskList(c *gin.Context) {
uotCont.Id = strconv.FormatInt(v.Id, 10)
uotCont.Type = v.Type
uotCont.Group = strconv.FormatInt(v.Group, 10)
groupErr, groupCont := commonus.GetGroupCont(v.Group)
if groupErr == true {
uotCont.GroupNAme = groupCont.Name
}
where := commonus.MapOut()
where["id"] = v.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
uotCont.GroupNAme = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = v.AcceptEvaluation
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
uotCont.DepartmentName = orgContDepart.Name
// groupErr, groupCont := commonus.GetGroupCont(v.Group)
// if groupErr == true {
// uotCont.GroupNAme = groupCont.Name
// }
uotCont.DepartmentId = strconv.FormatInt(v.AcceptEvaluation, 10)
deparConErr, deparConCont := commonus.GetBranchFactory(v.AcceptEvaluation)
if deparConErr == true {
uotCont.DepartmentName = deparConCont.Name
}
// deparConErr, deparConCont := commonus.GetBranchFactory(v.AcceptEvaluation)
// if deparConErr == true {
// uotCont.DepartmentName = deparConCont.Name
// }
uotCont.Dimension = strconv.FormatInt(v.Dimension, 10)
dutyClassCont, dutyClassErr := commonus.GetDutyClassInfo(v.Dimension)
if dutyClassErr == true {
@ -230,15 +241,26 @@ func (d *DutyHandle) DetailsAssessmentScheme(c *gin.Context) {
uotCont.Id = strconv.FormatInt(systemBFCont.Id, 10)
uotCont.Type = systemBFCont.Type
uotCont.Group = strconv.FormatInt(systemBFCont.Group, 10)
groupErr, groupCont := commonus.GetGroupCont(systemBFCont.Group)
if groupErr == true {
uotCont.GroupNAme = groupCont.Name
}
where := commonus.MapOut()
where["id"] = systemBFCont.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
uotCont.GroupNAme = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = systemBFCont.AcceptEvaluation
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
uotCont.DepartmentName = orgContDepart.Name
// groupErr, groupCont := commonus.GetGroupCont(systemBFCont.Group)
// if groupErr == true {
// uotCont.GroupNAme = groupCont.Name
// }
uotCont.DepartmentId = strconv.FormatInt(systemBFCont.AcceptEvaluation, 10)
deparConErr, deparConCont := commonus.GetBranchFactory(systemBFCont.AcceptEvaluation)
if deparConErr == true {
uotCont.DepartmentName = deparConCont.Name
}
// deparConErr, deparConCont := commonus.GetBranchFactory(systemBFCont.AcceptEvaluation)
// if deparConErr == true {
// uotCont.DepartmentName = deparConCont.Name
// }
uotCont.Dimension = strconv.FormatInt(systemBFCont.Dimension, 10)
dutyClassCont, dutyClassErr := commonus.GetDutyClassInfo(systemBFCont.Dimension)
if dutyClassErr == true {
@ -420,15 +442,26 @@ func (d *DutyHandle) QualEvalTargetTree(c *gin.Context) {
uotCont.Id = strconv.FormatInt(v.Id, 10)
uotCont.Type = v.Type
uotCont.Group = strconv.FormatInt(v.Group, 10)
groupErr, groupCont := commonus.GetGroupCont(v.Group)
if groupErr == true {
uotCont.GroupNAme = groupCont.Name
}
where := commonus.MapOut()
where["id"] = v.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
uotCont.GroupNAme = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = v.AcceptEvaluation
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
uotCont.DepartmentName = orgContDepart.Name
// groupErr, groupCont := commonus.GetGroupCont(v.Group)
// if groupErr == true {
// uotCont.GroupNAme = groupCont.Name
// }
uotCont.DepartmentId = strconv.FormatInt(v.AcceptEvaluation, 10)
deparConErr, deparConCont := commonus.GetBranchFactory(v.AcceptEvaluation)
if deparConErr == true {
uotCont.DepartmentName = deparConCont.Name
}
// deparConErr, deparConCont := commonus.GetBranchFactory(v.AcceptEvaluation)
// if deparConErr == true {
// uotCont.DepartmentName = deparConCont.Name
// }
uotCont.Dimension = strconv.FormatInt(v.Dimension, 10)
dutyClassCont, dutyClassErr := commonus.GetDutyClassInfo(v.Dimension)
if dutyClassErr == true {

45
gin_server_admin/api/v1/assessment/qualitative_evaluation.go

@ -142,14 +142,26 @@ func (d *dataLockStatistics) addQualEvalList(departmentId string, addData AddQua
groupInt, _ := strconv.ParseInt(addData.Group, 10, 64)
departidInt, _ := strconv.ParseInt(departmentId, 10, 64)
_, groupCont := commonus.GetGroupCont(groupInt)
_, deparConCont := commonus.GetBranchFactory(departidInt)
// _, groupCont := commonus.GetGroupCont(groupInt)
// _, deparConCont := commonus.GetBranchFactory(departidInt)
where := commonus.MapOut()
where["id"] = groupInt
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
// outCont.GroupName = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = departidInt
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
// outCont.DepartmentName = orgContDepart.Name
msg := commonus.MapOut()
if dtIsTrue == true {
msg["msg"] = fmt.Sprintf("%v-%v《%v》考核细则录入失败!请重新处理此方案!->ID:%v", groupCont.Name, deparConCont.Name, dtCont.Title, v.DetailedTarget)
// msg["msg"] = fmt.Sprintf("%v-%v《%v》考核细则录入失败!请重新处理此方案!->ID:%v", groupCont.Name, deparConCont.Name, dtCont.Title, v.DetailedTarget)
msg["msg"] = fmt.Sprintf("%v-%v《%v》考核细则录入失败!请重新处理此方案!->ID:%v", orgCont.Name, orgContDepart.Name, dtCont.Title, v.DetailedTarget)
} else {
msg["msg"] = fmt.Sprintf("%v-%v《%v》考核细则录入失败!请重新处理此方案", groupCont.Name, deparConCont.Name, v.DetailedTarget)
// msg["msg"] = fmt.Sprintf("%v-%v《%v》考核细则录入失败!请重新处理此方案", groupCont.Name, deparConCont.Name, v.DetailedTarget)
msg["msg"] = fmt.Sprintf("%v-%v《%v》考核细则录入失败!请重新处理此方案", orgCont.Name, orgContDepart.Name, v.DetailedTarget)
}
d.dataErrMap = append(d.dataErrMap, msg)
@ -189,10 +201,17 @@ func (d *DutyHandle) GetQualEvalList(c *gin.Context) {
var aualEvalArrtAry []QualEvalListOut
for _, v := range fileAry {
var aualEvalArrtCont QualEvalListOut
groupErr, groupCont := commonus.GetGroupCont(v)
if groupErr == true {
where := commonus.MapOut()
where["id"] = v
orgCont, groupErr := commonus.GetNewOrgCont(where, "id", "name")
// outCont.GroupName = orgCont.Name
// groupErr, groupCont := commonus.GetGroupCont(v)
if groupErr == nil {
aualEvalArrtCont.Id = strconv.FormatInt(v, 10)
aualEvalArrtCont.Name = groupCont.Name
// aualEvalArrtCont.Name = groupCont.Name
aualEvalArrtCont.Name = orgCont.Name
//归档分厂-部室
departAry, departAryErr := deparmentList(v, requestData.DepartmentId)
if departAryErr == true {
@ -217,11 +236,17 @@ func deparmentList(groupID int64, departmentIDStr string) (contentList []QualEva
listDepartErr := gormDbDepart.Find(&fileDepartAry).Error
if listDepartErr == nil {
for _, v := range fileDepartAry {
deparConErr, deparConCont := commonus.GetBranchFactory(v)
whereDepart := commonus.MapOut()
whereDepart["id"] = v
orgContDepart, deparConErr := commonus.GetNewOrgCont(whereDepart, "id", "name")
// userCont.DepartmentName = orgContDepart.Name
// deparConErr, deparConCont := commonus.GetBranchFactory(v)
var deparCont QualEvalListOutDepart
if deparConErr == true {
if deparConErr == nil {
deparCont.Id = strconv.FormatInt(v, 10)
deparCont.Name = deparConCont.Name
deparCont.Name = orgContDepart.Name
//归档维度
dimensionAry, dimensionAryErr := dimensionList(groupID, v)
if dimensionAryErr == true {

49
gin_server_admin/api/v1/assessment/ration_evaluation.go

@ -148,13 +148,30 @@ func (d *dataLockStatistics) addRationContList(deparmentId string, addData AddRa
groupInt, _ := strconv.ParseInt(addData.Group, 10, 64)
departidInt, _ := strconv.ParseInt(deparmentId, 10, 64)
_, groupCont := commonus.GetGroupCont(groupInt)
_, deparConCont := commonus.GetBranchFactory(departidInt)
where := commonus.MapOut()
where["id"] = groupInt
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
// outCont.GroupName = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = departidInt
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
// _, groupCont := commonus.GetGroupCont(groupInt)
// _, deparConCont := commonus.GetBranchFactory(departidInt)
msg := commonus.MapOut()
// if dtIsTrue == true {
// msg["msg"] = fmt.Sprintf("%v-%v定量考核《%v》考核项目已经存在!请重新处理此方案!->ID:%v", groupCont.Name, deparConCont.Name, dtCont.Title, detailedTargetInts)
// } else {
// msg["msg"] = fmt.Sprintf("%v-%v定量考核《%v》考核项目已经存在!请重新处理此方案!", groupCont.Name, deparConCont.Name, detailedTargetInts)
// }
if dtIsTrue == true {
msg["msg"] = fmt.Sprintf("%v-%v定量考核《%v》考核项目已经存在!请重新处理此方案!->ID:%v", groupCont.Name, deparConCont.Name, dtCont.Title, detailedTargetInts)
// msg["msg"] = fmt.Sprintf("%v-%v《%v》考核细则录入失败!请重新处理此方案!->ID:%v", groupCont.Name, deparConCont.Name, dtCont.Title, v.DetailedTarget)
msg["msg"] = fmt.Sprintf("%v-%v《%v》考核项目已经存在!请重新处理此方案!->ID:%v", orgCont.Name, orgContDepart.Name, dtCont.Title, detailedTargetInts)
} else {
msg["msg"] = fmt.Sprintf("%v-%v定量考核《%v》考核项目已经存在!请重新处理此方案!", groupCont.Name, deparConCont.Name, detailedTargetInts)
// msg["msg"] = fmt.Sprintf("%v-%v《%v》考核细则录入失败!请重新处理此方案", groupCont.Name, deparConCont.Name, v.DetailedTarget)
msg["msg"] = fmt.Sprintf("%v-%v《%v》考核项目已经存在!请重新处理此方案!", orgCont.Name, orgContDepart.Name, detailedTargetInts)
}
d.dataErrMap = append(d.dataErrMap, msg)
@ -213,10 +230,16 @@ func (d *DutyHandle) RationList(c *gin.Context) {
var aualEvalArrtAry []QualEvalRationListOut
for _, v := range fileAry {
var aualEvalArrtCont QualEvalRationListOut
groupErr, groupCont := commonus.GetGroupCont(v)
if groupErr == true {
where := commonus.MapOut()
where["id"] = v
orgCont, groupErr := commonus.GetNewOrgCont(where, "id", "name")
// outCont.GroupName = orgCont.Name
// groupErr, groupCont := commonus.GetGroupCont(v)
if groupErr == nil {
aualEvalArrtCont.Id = strconv.FormatInt(v, 10)
aualEvalArrtCont.Name = groupCont.Name
aualEvalArrtCont.Name = orgCont.Name
// 归档分厂-部室
departAry, departAryErr := deparmentRationList(v, requestData.DepartmentId)
if departAryErr == true {
@ -241,11 +264,17 @@ func deparmentRationList(groupID int64, departmentIDStr string) (contentList []Q
listDepartErr := gormDbDepart.Find(&fileDepartAry).Error
if listDepartErr == nil {
for _, v := range fileDepartAry {
deparConErr, deparConCont := commonus.GetBranchFactory(v)
whereDepart := commonus.MapOut()
whereDepart["id"] = v
orgContDepart, deparConErr := commonus.GetNewOrgCont(whereDepart, "id", "name")
// outCont.DepartmentName = orgContDepart.Name
// deparConErr, deparConCont := commonus.GetBranchFactory(v)
var deparCont QualEvalRationListOutDepart
if deparConErr == true {
if deparConErr == nil {
deparCont.Id = strconv.FormatInt(v, 10)
deparCont.Name = deparConCont.Name
deparCont.Name = orgContDepart.Name
//归档维度
dimensionAry, dimensionAryErr := dimensionRationList(groupID, v)
if dimensionAryErr == true {

25
gin_server_admin/api/v1/assessment/specificduty.go

@ -84,10 +84,14 @@ func (d *DutyHandle) SpecificDutyList(c *gin.Context) {
dutyCont.DutyTitle = dutyContInfo.Title
}
isTrueGroup, groupCont := GetGroupCont(val.Group)
if isTrueGroup == true {
dutyCont.GroupTitle = groupCont.Name
}
where := commonus.MapOut()
where["id"] = val.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
dutyCont.GroupTitle = orgCont.Name
// isTrueGroup, groupCont := GetGroupCont(val.Group)
// if isTrueGroup == true {
// dutyCont.GroupTitle = groupCont.Name
// }
//具体职责
dutyCont.ParentId = strconv.FormatInt(val.PartId, 10)
@ -360,10 +364,15 @@ func (d *DutyHandle) GetSpecDutyCont(c *gin.Context) {
dutyOutInfo.DutyTitle = dutyCont.Title
}
isTrueGroup, groupCont := GetGroupCont(dutyOutInfo.Group)
if isTrueGroup == true {
dutyOutInfo.GroupTitle = groupCont.Name
}
where := commonus.MapOut()
where["id"] = dutyOutInfo.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
dutyOutInfo.GroupTitle = orgCont.Name
// isTrueGroup, groupCont := GetGroupCont(dutyOutInfo.Group)
// if isTrueGroup == true {
// dutyOutInfo.GroupTitle = groupCont.Name
// }
//具体职责
dutyOutInfo.ParentId = strconv.FormatInt(dutyOutInfo.PartId, 10)

36
gin_server_admin/api/v1/assessment/target.go

@ -109,16 +109,28 @@ func (d *DutyHandle) GetTargetList(c *gin.Context) {
if tg_val.RelevantDepartments != "" {
departIdAry := strings.Split(tg_val.RelevantDepartments, ",")
for _, dia_val := range departIdAry {
diaInt, diaIntErr := strconv.ParseInt(dia_val, 10, 64)
if diaIntErr == nil {
diaValErr, diaVal := GetBranchFactory(diaInt)
if diaValErr == true {
where := commonus.MapOut()
where["id"] = dia_val
orgCont, orgErr := commonus.GetNewOrgCont(where, "id", "name")
if orgErr == nil {
var bfCont outTargetAttr
bfCont.Key = dia_val
bfCont.Title = diaVal.Name
bfCont.Title = orgCont.Name
outMapCont.RelevantDepartmentMap = append(outMapCont.RelevantDepartmentMap, bfCont)
}
}
// diaInt, diaIntErr := strconv.ParseInt(dia_val, 10, 64)
// if diaIntErr == nil {
// diaValErr, diaVal := GetBranchFactory(diaInt)
// if diaValErr == true {
// var bfCont outTargetAttr
// bfCont.Key = dia_val
// bfCont.Title = diaVal.Name
// outMapCont.RelevantDepartmentMap = append(outMapCont.RelevantDepartmentMap, bfCont)
// }
// }
}
}
@ -172,11 +184,17 @@ func (d *DutyHandle) GetTargetList(c *gin.Context) {
for _, rgeup_val := range rangeGroupIdAry {
rgeIntGup, rgeIntGupErr := strconv.ParseInt(rgeup_val, 10, 64)
if rgeIntGupErr == nil {
rgeValGupErr, rgeValGup := GetGroupCont(rgeIntGup)
if rgeValGupErr == true {
where := commonus.MapOut()
where["id"] = rgeIntGup
orgCont, rgeValGupErr := commonus.GetNewOrgCont(where, "id", "name")
// outCont.GroupName = orgCont.Name
// rgeValGupErr, rgeValGup := GetGroupCont(rgeIntGup)
if rgeValGupErr == nil {
var bfContRge outTargetAttr
bfContRge.Key = rgeup_val
bfContRge.Title = rgeValGup.Name
bfContRge.Title = orgCont.Name
outMapCont.VisibleRangeGroupMap = append(outMapCont.VisibleRangeGroupMap, bfContRge)
}
}

5
gin_server_admin/api/v1/custom/customhandle.go

@ -371,7 +371,7 @@ func (cu *CustomHandle) ScanCodeLogin(c *gin.Context) {
var md5JiaMiNumber commonus.Md5Encryption
md5JiaMiNumber.Md5EncryptionInit(userAdmin.Name)
userKeyCode := md5JiaMi.Md5EncryptionAlgorithm()
userKeyCode := md5JiaMiNumber.Md5EncryptionAlgorithm()
sha1Str := userKeyCode + userAdmin.Name + userAdmin.PassWord + md5Token
sha1Token := commonus.Sha1Encryption(sha1Str)
@ -455,7 +455,7 @@ func (cu *CustomHandle) ScanCodeLogin(c *gin.Context) {
var md5JiaMiNumber commonus.Md5Encryption
md5JiaMiNumber.Md5EncryptionInit(user.Number)
userKeyCode := md5JiaMi.Md5EncryptionAlgorithm()
userKeyCode := md5JiaMiNumber.Md5EncryptionAlgorithm()
sha1Str := userKeyCode + user.Number + user.Password + md5Token
sha1Token := commonus.Sha1Encryption(sha1Str)
@ -511,6 +511,7 @@ func (cu *CustomHandle) ScanCodeLogin(c *gin.Context) {
redisClient.SetRedisDb(5)
redisClient.SetRedisTime(10800)
redisClient.HashMsetAdd(redisFileKey, writeRedisData)
fmt.Printf("Login------->%v---------->%v\n", userKeyCode, md5Token)
response.Result(0, saveData, "登录成功!", c)
}

77
gin_server_admin/api/v1/examtestpage/examtype.go

@ -1,6 +1,9 @@
package examtestpage
import "github.com/flipped-aurora/gin-vue-admin/server/commonus"
import (
"github.com/flipped-aurora/gin-vue-admin/server/commonus"
"github.com/flipped-aurora/gin-vue-admin/server/model/hrsystem"
)
//获取集团架构参数
type getGroupType struct {
@ -10,6 +13,8 @@ type getGroupType struct {
//获取集团及分厂架构
type getGroupDepart struct {
Id int64 `json:"id"`
IdStr string `json:"idstr"`
Level int `json:"level"`
}
//组织架构员工对照表
@ -29,3 +34,73 @@ type QueryHealthReportType struct {
StartTime string `json:"starttime"`
EndTime string `json:"endtime"`
}
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:级别"`
}
//Hr系统组织架构
type outGov struct {
ID int64 `json:"id"`
Name string `json:"name"`
Address bool `json:"address"`
WxId string `json:"wxId"`
JdId string `json:"jdId"`
Attributes int64 `json:"attributes"`
Superior int64 `json:"superior"`
Sort int `json:"sort"`
Date string `json:"date"`
QueryId int `json:"queryid"`
SingId int `json:"singid"`
ErgodicID string `json:"ergodicid"`
ClassName string `json:"classname"`
Level int64 `json:"level"`
}
type govThree struct {
outGov
Child []govThree `json:"children"`
}
//部门数组
type govDepart struct {
ID int64 `json:"id"`
Name string `json:"name"`
State int `json:"State"`
Uid int `json:"Uid"`
Time int64 `json:"time"`
Attributes int64 `json:"attributes"`
Superior int64 `json:"superior"`
Group int64 `json:"group"`
WechatId string `json:"wechatid"`
ClassName string `json:"classname"`
Level int64 `json:"level"`
}
type govDepartThree struct {
govDepart
Child []govDepartThree `json:"children"`
}
type govUserCont struct {
ID int64 `json:"id"`
Name string `json:"name"`
Number string `json:"number"`
WechatId string `json:"wechatid"`
ClassName string `json:"classname"`
Level int64 `json:"level"`
Superior int64 `json:"superior"`
UserList []peopleList `json:"child"`
}
type peopleList struct {
ID int64 `json:"id"`
Name string `json:"name"`
Number string `json:"number"`
Key string `json:"key"`
WechatId string `json:"wechatid"`
}
type govUserContThree struct {
govUserCont
Child []govUserContThree `json:"govlist"`
}

283
gin_server_admin/api/v1/examtestpage/grouphandle.go

@ -10,6 +10,7 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/commonus"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/hrsystem"
"github.com/flipped-aurora/gin-vue-admin/server/model/testpage"
"github.com/flipped-aurora/gin-vue-admin/server/model/wechat"
"github.com/flipped-aurora/gin-vue-admin/server/utils/redishandel"
@ -862,58 +863,116 @@ func (g *GroupHandleApi) RefreshDataBaseUser(c *gin.Context) {
//获取集团和分厂架构
func (g *GroupHandleApi) GetGroupDepartMap(c *gin.Context) {
var requestData getGroupDepart
err := c.ShouldBindJSON(&requestData)
if err != nil {
c.ShouldBindJSON(&requestData)
if requestData.Id == 0 && requestData.IdStr == "" {
requestData.Id = 0
}
gormDb := global.GVA_DB_WatchDate.Model(&wechat.GroupForm{}).Where("`g_parentid` = 1 AND `g_sate` = 1")
if requestData.Id != 0 {
gormDb = gormDb.Where("`g_id` = ?", requestData.Id)
if requestData.IdStr != "" {
idInt64, _ := strconv.ParseInt(requestData.IdStr, 10, 64)
requestData.Id = idInt64
}
var groupMap []GroupMap
groupErr := gormDb.Order("g_id ASC").Find(&groupMap).Error
var govMap []OutGovCont
gormDb := global.GVA_DB_HrDataBase.Model(&hrsystem.AdministrativeOrganization{}).Select("administrative_organization.*,aot.name as classname,aot.level").Joins("left join administrative_organization_type as aot on aot.id = administrative_organization.organization_type").Where("administrative_organization.`state` = 1")
if requestData.Level != 0 {
gormDb = gormDb.Where("aot.level <= ?", requestData.Level)
}
groupErr := gormDb.Find(&govMap).Error
if groupErr != nil {
response.Result(103, groupErr, "数据获取失败!", c)
return
}
var departList []testpage.BranchFactoryHasMany
// err = global.GVA_DB_Master.Preload("WorkshopSectionStruct").Where("bf_group = ?", 3).Find(&departList)
// groupAry := map[int]interface{}{}
var groupMapStruct []TableData
for i, v := range groupMap {
// fmt.Printf("%v\n", v.Id)
err = global.GVA_DB_Master.Preload("WorkshopSectionStruct").Where("bf_group = ?", v.Id).Find(&departList).Error
if err == nil {
var groupTypeStruct TableData
groupTypeStruct.ID = v.Id
groupTypeStruct.Name = v.Name
groupTypeStruct.Address = true
groupTypeStruct.WxId = strconv.FormatInt(v.Id, 10)
groupTypeStruct.JdId = v.JinDieId
groupTypeStruct.Attributes = 1
groupTypeStruct.Sort = i + 1
groupTypeStruct.QueryId = 1
groupTypeStruct.Date = commonus.TimeStampToDate(v.Time, 6)
groupTypeStruct.ErgodicID = fmt.Sprintf("%v_%v", v.Id, i)
bfErr, bfInfo := GetBranchFactoryMapEs(v.Id, i)
if bfErr == true {
groupTypeStruct.Children = bfInfo
}
groupTypeStruct.SingId = i + 1 + 3
// groupAry[i] = openGroupMap(departList)
groupMapStruct = append(groupMapStruct, groupTypeStruct)
}
}
sendMap := commonus.MapOut()
sendMap["list"] = groupMapStruct
// fmt.Printf("%v\n", groupMap)
// response.Ok(c)
response.Result(0, sendMap, "获取成功", c)
}
var gTreeAry []outGov
for i, v := range govMap {
var govInfo outGov
govInfo.ID = v.Id
govInfo.Name = v.Name
govInfo.Address = true
govInfo.WxId = strconv.FormatInt(v.Id, 10)
govInfo.JdId = "1"
govInfo.Attributes = 1
govInfo.Superior = v.Superior
govInfo.Sort = i + 1
govInfo.QueryId = 1
govInfo.Date = commonus.TimeStampToDate(v.Time, 6)
govInfo.ErgodicID = v.Number //fmt.Sprintf("%v_%v", v.Id, i)
govInfo.SingId = i + 1 + 3
govInfo.ClassName = v.ClassName
govInfo.Level = v.Level
gTreeAry = append(gTreeAry, govInfo)
}
govMapThree := GovThreeList(requestData.Id, gTreeAry)
response.Result(0, govMapThree, "获取成功", c)
}
//递归树
func GovThreeList(parentId int64, govAry []outGov) []govThree {
var govMap []govThree
for _, v := range govAry {
// var zhucont govThree
if v.Superior == parentId {
child := GovThreeList(v.ID, govAry)
govMap = append(govMap, govThree{v, child})
}
}
return govMap
}
// func (g *GroupHandleApi) GetGroupDepartMap(c *gin.Context) {
// var requestData getGroupDepart
// err := c.ShouldBindJSON(&requestData)
// if err != nil {
// }
// gormDb := global.GVA_DB_WatchDate.Model(&wechat.GroupForm{}).Where("`g_parentid` = 1 AND `g_sate` = 1")
// if requestData.Id != 0 {
// gormDb = gormDb.Where("`g_id` = ?", requestData.Id)
// }
// var groupMap []GroupMap
// groupErr := gormDb.Order("g_id ASC").Find(&groupMap).Error
// if groupErr != nil {
// response.Result(103, groupErr, "数据获取失败!", c)
// return
// }
// var departList []testpage.BranchFactoryHasMany
// // err = global.GVA_DB_Master.Preload("WorkshopSectionStruct").Where("bf_group = ?", 3).Find(&departList)
// // groupAry := map[int]interface{}{}
// var groupMapStruct []TableData
// for i, v := range groupMap {
// // fmt.Printf("%v\n", v.Id)
// err = global.GVA_DB_Master.Preload("WorkshopSectionStruct").Where("bf_group = ?", v.Id).Find(&departList).Error
// if err == nil {
// var groupTypeStruct TableData
// groupTypeStruct.ID = v.Id
// groupTypeStruct.Name = v.Name
// groupTypeStruct.Address = true
// groupTypeStruct.WxId = strconv.FormatInt(v.Id, 10)
// groupTypeStruct.JdId = v.JinDieId
// groupTypeStruct.Attributes = 1
// groupTypeStruct.Sort = i + 1
// groupTypeStruct.QueryId = 1
// groupTypeStruct.Date = commonus.TimeStampToDate(v.Time, 6)
// groupTypeStruct.ErgodicID = fmt.Sprintf("%v_%v", v.Id, i)
// bfErr, bfInfo := GetBranchFactoryMapEs(v.Id, i)
// if bfErr == true {
// groupTypeStruct.Children = bfInfo
// }
// groupTypeStruct.SingId = i + 1 + 3
// // groupAry[i] = openGroupMap(departList)
// groupMapStruct = append(groupMapStruct, groupTypeStruct)
// }
// }
// sendMap := commonus.MapOut()
// sendMap["list"] = groupMapStruct
// // fmt.Printf("%v\n", groupMap)
// // response.Ok(c)
// response.Result(0, sendMap, "获取成功", c)
// }
//获得分厂名称
func GetBranchFactoryMap(id int64) (isTrue bool, ContInfo []testpage.BranchFactory) {
@ -956,6 +1015,42 @@ func GetBranchFactoryMapEs(id int64, jbq int) (isTrue bool, ContInfo []bfMapJbqL
//获取集团架构人员信息对照表
func (g *GroupHandleApi) GetGroupUser(c *gin.Context) {
var requestData getGroupDepart
c.ShouldBindJSON(&requestData)
if requestData.Id == 0 && requestData.IdStr == "" {
requestData.Id = 0
}
if requestData.IdStr != "" {
idInt64, _ := strconv.ParseInt(requestData.IdStr, 10, 64)
requestData.Id = idInt64
}
var govMap []OutGovCont
gormDb := global.GVA_DB_HrDataBase.Model(&hrsystem.AdministrativeOrganization{}).Select("administrative_organization.*,aot.id as aotid,aot.name as classname,aot.level").Joins("left join administrative_organization_type as aot on aot.id = administrative_organization.organization_type").Where("administrative_organization.`state` = 1 AND aot.id IN (1,2,3,5)")
if requestData.Level != 0 {
gormDb = gormDb.Where("aot.level <= ?", requestData.Level)
}
groupErr := gormDb.Find(&govMap).Error
if groupErr != nil {
response.Result(103, groupErr, "数据获取失败!", c)
return
}
var departAry []govUserCont
for _, v := range govMap {
var departInfo govUserCont
departInfo.ID = v.Id //`json:"id"`
departInfo.Name = v.Name //`json:"name"`
departInfo.Number = v.Number //`json:"State"`
departInfo.ClassName = v.ClassName //`json:"classname"`
departInfo.Level = v.Level //`json:"level"`
departInfo.Superior = v.Superior
departInfo.UserList = getUserList(v.Id)
departAry = append(departAry, departInfo)
}
govMapThree := GovUserThreeList(requestData.Id, departAry)
response.Result(0, govMapThree, "获取成功", c)
}
func (g *GroupHandleApi) GetGroupUserOld(c *gin.Context) {
var requestData groupRequest
err := c.ShouldBindJSON(&requestData)
if err != nil {
@ -1034,7 +1129,7 @@ type departSelect struct {
}
//获取分厂列表
func (g *GroupHandleApi) GetDepartmentList(c *gin.Context) {
func (g *GroupHandleApi) GetDepartmentListOld(c *gin.Context) {
var requestData commonus.SetIds
err := c.ShouldBindJSON(&requestData)
if err != nil {
@ -1059,3 +1154,97 @@ func (g *GroupHandleApi) GetDepartmentList(c *gin.Context) {
}
response.Result(0, bfList, "数据获取成功!", c)
}
//获取分厂列表
func (g *GroupHandleApi) GetDepartmentList(c *gin.Context) {
var requestData getGroupDepart
c.ShouldBindJSON(&requestData)
if requestData.Id == 0 && requestData.IdStr == "" {
requestData.Id = 0
}
if requestData.IdStr != "" {
idInt64, _ := strconv.ParseInt(requestData.IdStr, 10, 64)
requestData.Id = idInt64
}
var govMap []OutGovCont
gormDb := global.GVA_DB_HrDataBase.Model(&hrsystem.AdministrativeOrganization{}).Select("administrative_organization.*,aot.name as classname,aot.level").Joins("left join administrative_organization_type as aot on aot.id = administrative_organization.organization_type").Where("administrative_organization.`state` = 1")
if requestData.Level != 0 {
gormDb = gormDb.Where("aot.level <= ?", requestData.Level)
}
groupErr := gormDb.Find(&govMap).Error
if groupErr != nil {
response.Result(103, groupErr, "数据获取失败!", c)
return
}
var departAry []govDepart
for _, v := range govMap {
var departInfo govDepart
departInfo.ID = v.Id //`json:"id"`
departInfo.Name = v.Name //`json:"name"`
departInfo.State = v.State //`json:"State"`
departInfo.Uid = 1 //`json:"Uid"`
departInfo.Time = v.Time //`json:"time"`
departInfo.Attributes = 1 //`json:"attributes"`
departInfo.Superior = v.Superior //`json:"superior"`
departInfo.Group = v.OrganizationType //`json:"group"`
departInfo.WechatId = strconv.FormatInt(v.WechatOrganizationId, 10) //`json:"wechatid"`
departInfo.ClassName = v.ClassName //`json:"classname"`
departInfo.Level = v.Level //`json:"level"`
departAry = append(departAry, departInfo)
}
govMapThree := GovDepartThreeList(requestData.Id, departAry)
response.Result(0, govMapThree, "获取成功", c)
}
//递归树
func GovDepartThreeList(parentId int64, govAry []govDepart) []govDepartThree {
var govMap []govDepartThree
for _, v := range govAry {
// var zhucont govThree
if v.Superior == parentId {
child := GovDepartThreeList(v.ID, govAry)
govMap = append(govMap, govDepartThree{v, child})
}
}
return govMap
}
//递归树
func GovUserThreeList(parentId int64, govAry []govUserCont) []govUserContThree {
var govMap []govUserContThree
for _, v := range govAry {
// var zhucont govThree
if v.Superior == parentId {
child := GovUserThreeList(v.ID, govAry)
govMap = append(govMap, govUserContThree{v, child})
}
}
return govMap
}
//获取Hr人员信息
func getUserList(departmentId int64) (userList []peopleList) {
var userAry []hrsystem.Personnel
err := global.GVA_DB_HrDataBase.Model(&hrsystem.Personnel{}).Select("`id`,`number`,`name`,`wechat`,`work_wechat`,`key`").Where("state = 1 AND FIND_IN_SET(?,`deparment`)", departmentId).Find(&userAry).Error
// err := global.GVA_DB_HrDataBase.Model(&hrsystem.Personnel{}).Select("`id`,`number`,`name`,`wechat`,`work_wechat`,`key`,admin_org").Where("state = 1 AND admin_org = ?", departmentId).Find(&userAry).Error
if err != nil {
return
}
for _, v := range userAry {
var userCont peopleList
userCont.ID = v.Id //`json:"id"`
userCont.Name = v.Name //`json:"name"`
userCont.Number = v.Number //`json:"number"`
userCont.Key = strconv.FormatInt(v.Key, 10) //`json:"key"`
userCont.WechatId = v.Wechat //`json:"wechatid"`
if v.WorkWechat != "" {
userCont.WechatId = v.WorkWechat
}
userList = append(userList, userCont)
}
return
}

24
gin_server_admin/api/v1/shiyan/enter.go

@ -1,7 +1,31 @@
package shiyan
import "sync"
var synPro = sync.WaitGroup{}
type ApiGroup struct {
// Code generated by github.com/flipped-aurora/gin-vue-admin/server Begin; DO NOT EDIT.
ShiyanApi
// Code generated by github.com/flipped-aurora/gin-vue-admin/server End; DO NOT EDIT.
}
//输出迁移组织架构
type outOrgCont struct {
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"`
Superior int64 `json:"superior" gorm:"column:superior;type:bigint(20) unsigned;default:0;not null;comment:上级ID"`
OrganizationType int64 `json:"organizationtype" gorm:"column:organization_type;type:bigint(20) unsigned;default:0;not null;comment:行政组织类型"`
}
//职务相关
type jobAttber struct {
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"`
Number string `json:"number" gorm:"column:number;type:varchar(255) unsigned;default:'';not null;comment:编号"`
Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:名称"`
PersonInCharge int `json:"personincharge" gorm:"column:person_in_charge;type:tinyint(1) unsigned;default:0;not null;comment:是否为本部门负责人"`
Dutid int64 `json:"dutid" gorm:"column:dutid;type:bigint(20) unsigned;default:0;not null;comment:职务Id"`
Dutname string `json:"dutname" gorm:"column:dutname;type:varchar(255) unsigned;default:'';not null;comment:职务名称"`
DutNumber string `json:"dutnumber" gorm:"column:dutnumber;type:varchar(255) unsigned;default:'';not null;comment:职务编号"`
Jobid int64 `json:"jobid" gorm:"column:jobid;type:bigint(20) unsigned;default:0;not null;comment:职务分类Id"`
JobName string `json:"jobname" gorm:"column:jobname;type:varchar(255) unsigned;default:'';not null;comment:职务分类名称"`
}

394
gin_server_admin/api/v1/shiyan/shiyan.go

@ -7,6 +7,7 @@ import (
"math"
"os"
"strconv"
"strings"
"time"
"github.com/flipped-aurora/gin-vue-admin/server/api/textcomparison"
@ -16,6 +17,7 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/model/approvalprocess"
"github.com/flipped-aurora/gin-vue-admin/server/model/assessmentmodel"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/hrsystem"
"github.com/flipped-aurora/gin-vue-admin/server/model/testpage"
"github.com/flipped-aurora/gin-vue-admin/server/model/wechat"
"github.com/flipped-aurora/gin-vue-admin/server/utils/redishandel"
@ -1441,3 +1443,395 @@ func GetGuishuDepart(targetId int64) (departStr string) {
}
return
}
//数据迁移
func (s *ShiyanApi) DataQianyi(c *gin.Context) {
var assTarCont []assessmentmodel.Assesstarget
assErr := global.GVA_DB_Performanceappraisal.Find(&assTarCont).Error
if assErr == nil {
for _, assV := range assTarCont {
// synPro.Add(1)
qianyiAssTar(assV.Id, assV.Group, assV.Departmentmap)
}
}
//部门考核指标权重
var deparDimeWeigh []assessmentmodel.DepartmentDimensionWeight
ddwErr := global.GVA_DB_Performanceappraisal.Find(&deparDimeWeigh).Error
if ddwErr == nil {
for _, ddwV := range deparDimeWeigh {
// synPro.Add(1)
qianyiDdwTar(ddwV.Id, ddwV.Group, ddwV.DepartmentId)
}
}
//划分责任
var divRes []assessmentmodel.DivisionResponsibilities
divresErr := global.GVA_DB_Performanceappraisal.Find(&divRes).Error
if divresErr == nil {
for _, divresV := range divRes {
// synPro.Add(1)
qianyidivresTar(divresV.Id, divresV.Group, divresV.Department, divresV.EvaluationGroup, divresV.EvaluationDepartment)
}
}
//测评指标
var evalTar []assessmentmodel.EvaluationTarget
evalTarErr := global.GVA_DB_Performanceappraisal.Find(&evalTar).Error
if evalTarErr == nil {
for _, evalTarV := range evalTar {
// synPro.Add(1)
qianyievalTarTar(evalTarV.Id, evalTarV.RelevantDepartments)
}
}
//考核方案版本内容
var planVersio []assessmentmodel.PlanVersio
planVersioErr := global.GVA_DB_Performanceappraisal.Find(&planVersio).Error
if planVersioErr == nil {
for _, planVersioV := range planVersio {
// synPro.Add(1)
qianyiplanVersioTar(planVersioV.Id, planVersioV.Group, planVersioV.Department)
}
}
//定性考核
var qualEval []assessmentmodel.QualitativeEvaluation
qualEvalErr := global.GVA_DB_Performanceappraisal.Find(&qualEval).Error
if qualEvalErr == nil {
for _, qualEvalV := range qualEval {
// synPro.Add(1)
qianyiqualEvalTar(qualEvalV.Id, qualEvalV.Group, qualEvalV.AcceptEvaluation, qualEvalV.DepartmentId)
}
}
//定性指标子栏目
var qualTar []assessmentmodel.QualitativeTarget
qualTarErr := global.GVA_DB_Performanceappraisal.Find(&qualTar).Error
if qualTarErr == nil {
for _, qualTarV := range qualTar {
// synPro.Add(1)
qianyiqualTarTar(qualTarV.Id, qualTarV.Depart)
}
}
//整改措施
var recMea []assessmentmodel.RectificationMeasures
recMeaErr := global.GVA_DB_Performanceappraisal.Find(&recMea).Error
if recMeaErr == nil {
for _, recMeaV := range recMea {
// synPro.Add(1)
qianyirecMeaTar(recMeaV.Id, recMeaV.Group, recMeaV.Department)
}
}
//分数流水
var scoreFlowCont []assessmentmodel.ScoreFlow
scoreFlowContErr := global.GVA_DB_Performanceappraisal.Find(&scoreFlowCont).Error
if scoreFlowContErr == nil {
for _, scoreFlowContV := range scoreFlowCont {
// synPro.Add(1)
qianyiscoreFlowContTar(scoreFlowContV.Id, scoreFlowContV.EvaluationGroup, scoreFlowContV.EvaluationDepartment, scoreFlowContV.DutyGroup, scoreFlowContV.DutyDepartment)
}
}
// synPro.Wait()
}
//
//分数流水
func qianyiscoreFlowContTar(id, groupId, departStr, evaGroup, evalDep int64) {
saveData := commonus.MapOut()
saveData["sf_eite_time"] = time.Now().Unix()
// groupIdInt,departId := getUserOrgSchool
saveData["sf_evaluation_group"] = getGroupToOrg(groupId)
saveData["sf_evaluation_department"] = getDepartToOrgInt(departStr)
saveData["sf_duty_group"] = getGroupToOrg(evaGroup)
saveData["sf_duty_department"] = getDepartToOrgInt(evalDep)
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Where("sf_id = ?", id).Updates(saveData)
}
//整改措施
func qianyirecMeaTar(id, groupId, departStr int64) {
// defer synPro.Done()
saveData := commonus.MapOut()
saveData["rm_eite_time"] = time.Now().Unix()
saveData["rm_group"] = getGroupToOrg(groupId)
saveData["rm_department"] = getDepartToOrgInt(departStr)
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.RectificationMeasures{}).Where("rm_id = ?", id).Updates(saveData)
}
//定性指标子栏目
func qianyiqualTarTar(id int64, departStr string) {
saveData := commonus.MapOut()
saveData["q_time"] = time.Now().Unix()
saveData["q_depart"] = getDepartToOrg(departStr)
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeTarget{}).Where("q_id = ?", id).Updates(saveData)
}
//定性考核
func qianyiqualEvalTar(id, groupId, departInt int64, departStr string) {
saveData := commonus.MapOut()
saveData["qe_eitetime"] = time.Now().Unix()
saveData["qe_group"] = getGroupToOrg(groupId)
saveData["qe_accept_evaluation"] = getDepartToOrgInt(departInt)
saveData["qe_department_id"] = getDepartToOrg(departStr)
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Where("qe_id = ?", id).Updates(saveData)
}
//考核方案版本内容
func qianyiplanVersioTar(id, groupId, departStr int64) {
// defer synPro.Done()
saveData := commonus.MapOut()
saveData["eitetime"] = time.Now().Unix()
// groupIdInt,departId := getUserOrgSchool
saveData["group"] = getGroupToOrg(groupId)
saveData["department"] = getDepartToOrgInt(departStr)
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.PlanVersio{}).Where("id = ?", id).Updates(saveData)
}
//测评指标
func qianyievalTarTar(id int64, departStr string) {
saveData := commonus.MapOut()
saveData["et_time"] = time.Now().Unix()
saveData["et_relevant_departments"] = getDepartToOrg(departStr)
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationTarget{}).Where("et_id = ?", id).Updates(saveData)
}
//划分责任
func qianyidivresTar(id, groupId, departStr, evaGroup, evalDep int64) {
saveData := commonus.MapOut()
saveData["df_eite_time"] = time.Now().Unix()
// groupIdInt,departId := getUserOrgSchool
saveData["df_group"] = getGroupToOrg(groupId)
saveData["df_department_id"] = getDepartToOrgInt(departStr)
saveData["df_evaluation_group"] = getGroupToOrg(evaGroup)
saveData["df_evaluation_department"] = getDepartToOrgInt(evalDep)
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DivisionResponsibilities{}).Where("df_id = ?", id).Updates(saveData)
}
//迁移部门考核指标权重
func qianyiDdwTar(id, groupId, departStr int64) {
// defer synPro.Done()
saveData := commonus.MapOut()
saveData["ddw_time"] = time.Now().Unix()
// groupIdInt,departId := getUserOrgSchool
saveData["ddw_group"] = getGroupToOrg(groupId)
saveData["ddw_derpatment"] = getDepartToOrgInt(departStr)
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DepartmentDimensionWeight{}).Where("ddw_id = ?", id).Updates(saveData)
}
//迁移考核指标
func qianyiAssTar(id, groupId int64, departStr string) {
// defer synPro.Done()
// fmt.Printf("AssTar--------->%v---->%v---->%v\n", id, groupId, departStr)
saveData := commonus.MapOut()
saveData["time"] = time.Now().Unix()
// groupIdInt,departId := getUserOrgSchool
saveData["group"] = getGroupToOrg(groupId)
saveData["departmentmap"] = getDepartToOrg(departStr)
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.Assesstarget{}).Where("at_id = ?", id).Updates(saveData)
// fmt.Printf("AssAry-----%v------>%v\n", id, saveData)
}
//获取集团对照码
func getGroupToOrg(group int64) (groupId int64) {
groupId = 0
groupAry := map[int64]int64{3: 2}
for gi, gv := range groupAry {
if gi == group {
groupId = gv
break
}
}
if groupId == 0 {
groupId = group
}
return
}
//获取部门对照码
func getDepartToOrgInt(depart int64) (departStr string) {
departAry := map[int64]string{
11: "3",
12: "4",
9: "5",
14: "6",
13: "7",
15: "8",
5: "9",
6: "10",
8: "11",
2: "13",
1: "14",
3: "15",
16: "16",
17: "17",
39: "19",
50: "20",
7: "41",
4: "42",
}
for si, sv := range departAry {
if depart == si {
departStr = sv
return
}
}
if departStr == "" {
departStr = strconv.FormatInt(depart, 10)
}
return
}
func getDepartToOrg(depart string) (departStr string) {
departAry := map[int64]string{
11: "3",
12: "4",
9: "5",
14: "6",
13: "7",
15: "8",
5: "9",
6: "10",
8: "11",
2: "13",
1: "14",
3: "15",
16: "16",
17: "17",
39: "19",
50: "20",
7: "41",
4: "42",
}
var depAry []string
oldDepartAry := strings.Split(depart, ",")
for _, v := range oldDepartAry {
vInt64, _ := strconv.ParseInt(v, 10, 64)
for si, sv := range departAry {
if vInt64 == si {
if commonus.IsItTrueString(sv, depAry) == false {
depAry = append(depAry, sv)
}
}
}
}
departStr = strings.Join(depAry, ",")
return
}
//获取人员组织架构信息
func getUserOrgSchool(group, depart int64) (gro int64, department string) {
groupAry := map[int64]int64{3: 2}
for gi, gv := range groupAry {
if gi == group {
gro = gv
break
}
}
//部门对照
//部门
var buMen string
// departAry := map[int64]string{
// 11: "3",
// 12: "4",
// 9: "5",
// 14: "6",
// 13: "7",
// 15: "8",
// 5: "9",
// 6: "10",
// 8: "11",
// 2: "13",
// 1: "14",
// 3: "15",
// 16: "16",
// 17: "17",
// 39: "19",
// 50: "20",
// 7: "12,41",
// 4: "12,42",
// }
departAry := map[int64]string{
11: "3",
12: "4",
9: "5",
14: "6",
13: "7",
15: "8",
5: "9",
6: "10",
8: "11",
2: "13",
1: "14",
3: "15",
16: "16",
17: "17",
39: "19",
50: "20",
7: "41",
4: "42",
}
for di, dv := range departAry {
if depart == di {
buMen = dv
break
}
}
// _, org = getOrgSchool(workid)
// departId, org := getOrgSchool(workid)
// if departId != 0 {
// buMen = fmt.Sprintf("%v,%v", buMen, departId)
// }
if buMen == "" {
buMen = strconv.FormatInt(depart, 10)
}
department = buMen
return
}
//获取组织架构对照
func getOrgSchool(id int64) (deparmentId, orgId int64) {
var orgInfo outOrgCont
err := global.GVA_DB_HrDataBase.Model(&hrsystem.AdministrativeOrganization{}).Select("id,organization_type,superior").Where("schoole = ?", id).First(&orgInfo).Error
if err != nil {
deparmentId = 0
orgId = 0
return
}
if orgInfo.OrganizationType == 5 {
var suoOrgInfo hrsystem.AdministrativeOrganization
whereAry := commonus.MapOut()
whereAry["id"] = orgInfo.Superior
supErr := suoOrgInfo.GetCont(whereAry)
if supErr == nil {
deparmentId = suoOrgInfo.Id
}
}
orgId = orgInfo.Id
return
}
//获取hr系统中的职务
func getHrPosition(posId int64) int64 {
var id int64
err := global.GVA_DB_HrDataBase.Model(&hrsystem.Position{}).Select("id").Where("`school` = ?", posId).First(&id).Error
if err == nil {
return id
}
return 0
}
//获取职务相关属性
func getJobInfo(jobId int64) (cont jobAttber, err error) {
var positionInfo hrsystem.Position
// err = global.GVA_DB_HrDataBase.Table(fmt.Sprintf("%s p", positionInfo.TableName())).Select("p.id,p.number,p.name,p.person_in_charge,d.id as dutid,d.name as dutname,d.number as dutnumber,j.id as jobid,j.name as jobname").Joins("left join duties as d on d.id = p.duties").Joins("left join job_class as j on j.id = d.job_type").Where("`p`.`id` = ?", jobId).First(&cont).Error
err = global.GVA_DB_HrDataBase.Model(&positionInfo).Select("position.id,position.number,position.name,position.person_in_charge,d.id as dutid,d.name as dutname,d.number as dutnumber,j.id as jobid,j.name as jobname").Joins("left join duties as d on d.id = position.duties").Joins("left join job_class as j on j.id = d.job_type").Where("`position`.`id` = ?", jobId).First(&cont).Error
return
}

53
gin_server_admin/api/v1/staff/staffpeople.go

@ -3,7 +3,6 @@ package staff
import (
"strconv"
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/assessment"
"github.com/flipped-aurora/gin-vue-admin/server/commonus"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
@ -118,14 +117,24 @@ func (s *StaffPeople) StaffList(c *gin.Context) {
staffInfo.KeyStr = strconv.FormatInt(val.Key, 10)
isTrueBranFact, branFactCont := assessment.GetBranchFactory(val.DepartmentId)
if isTrueBranFact == true {
staffInfo.BranchFactory = branFactCont.Name
}
isTrueGroup, groupCont := assessment.GetGroupCont(val.Group)
if isTrueGroup == true {
staffInfo.GroupTitle = groupCont.Name
}
where := commonus.MapOut()
where["id"] = val.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
staffInfo.GroupTitle = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = val.DepartmentId
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
staffInfo.BranchFactory = orgContDepart.Name
// isTrueBranFact, branFactCont := assessment.GetBranchFactory(val.DepartmentId)
// if isTrueBranFact == true {
// staffInfo.BranchFactory = branFactCont.Name
// }
// isTrueGroup, groupCont := assessment.GetGroupCont(val.Group)
// if isTrueGroup == true {
// staffInfo.GroupTitle = groupCont.Name
// }
isTrueWork, workCont := commonus.GetWorkShopSection(val.WorkshopId)
if isTrueWork == true {
@ -192,14 +201,24 @@ func GetUserWork(userName, userPwd string) (isTrue bool, staffInfo staffOutInfo)
staffInfo.KeyStr = strconv.FormatInt(userInfo.Key, 10)
isTrueBranFact, branFactCont := assessment.GetBranchFactory(userInfo.DepartmentId)
if isTrueBranFact == true {
staffInfo.BranchFactory = branFactCont.Name
}
isTrueGroup, groupCont := assessment.GetGroupCont(userInfo.Group)
if isTrueGroup == true {
staffInfo.GroupTitle = groupCont.Name
}
where := commonus.MapOut()
where["id"] = userInfo.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
staffInfo.GroupTitle = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = userInfo.DepartmentId
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
staffInfo.BranchFactory = orgContDepart.Name
// isTrueBranFact, branFactCont := assessment.GetBranchFactory(userInfo.DepartmentId)
// if isTrueBranFact == true {
// staffInfo.BranchFactory = branFactCont.Name
// }
// isTrueGroup, groupCont := assessment.GetGroupCont(userInfo.Group)
// if isTrueGroup == true {
// staffInfo.GroupTitle = groupCont.Name
// }
isTrueWork, workCont := commonus.GetWorkShopSection(userInfo.WorkshopId)
if isTrueWork == true {

9
gin_server_admin/api/web/enter.go

@ -0,0 +1,9 @@
package web
import "github.com/flipped-aurora/gin-vue-admin/server/api/web/jixiaokaohe"
type WebApi struct {
AchApiGroup jixiaokaohe.ApiGroup
}
var WebApiGroup = new(WebApi)

72
gin_server_admin/api/web/jixiaokaohe/enter.go

@ -0,0 +1,72 @@
package jixiaokaohe
import "github.com/flipped-aurora/gin-vue-admin/server/commonus"
type ApiGroup struct{}
//考核操作提交参数
type taskParameterTitle struct {
Group string `json:"group"` //集团
Department string `json:"department"` //部门
Target string `json:"targets"` //指标id
}
type taskParameterTitleList struct {
commonus.PageSetLimt
Group string `json:"group"` //集团
Department string `json:"department"` //部门
Target string `json:"targets"` //指标id
SunTarget string `json:"suntargets"` //指标id
}
//输出考核栏目
type outTaskSunTarget struct {
taskParameterTitleList
ProjectName string `json:"projectName"`
}
//输出指定人相关的考核细则
type outMyTaskDiesTarget struct {
Id string `json:"id"`
Title string `json:"title"`
Standard string `json:"standard"`
Content string `json:"content"`
Unit string `json:"unit"`
taskParameterTitleList
}
//新型定性考核细则列表输出
type NewQualDetailOutList struct {
NewQualOutList
Id int64 `json:"id" gorm:"primaryKey;column:qe_id;type:bigint(20) unsigned;not null;comment:Id;index"`
DetailedTargetId int64 `json:"detailedtargetid" gorm:"column:qe_detailed_target;type:bigint(20) unsigned;default:0;not null;comment:考核细则"`
DetailedTargetTitle string `json:"detailedtargenttitle" gorm:"column:dt_title;type:text;comment:指标细则"` //指标明细
DetailedTargetCont string `json:"detailedtargentcont"` //指标明细
AddReduce int `json:"addreduce"` //1:减少;2:增加;3:无属性,现场确认加或减"`
Company string `json:"company"` //单位
Score string `json:"score"`
State int `json:"state"` //1、定分;2、区间分;3、不定性分值
TargetSun int64 `json:"targetsun" gorm:"column:qe_target_sun;type:bigint(20) unsigned;default:0;not null;comment:考核指标子栏目"`
TargetSunId string `json:"targetsunid"` //子栏目ID
TargetSunName string `json:"targetsunname"` //子栏目名称
}
//新型定性考核列表输出
type NewQualOutList struct {
Group int64 `json:"group" gorm:"column:qe_group;type:bigint(20) unsigned;default:0;not null;comment:归属集团"`
GroupName string `json:"groupname"` //集团
Department int64 `json:"department" gorm:"column:qe_accept_evaluation;type:bigint(20) unsigned;default:0;not null;comment:接受考核部门"`
DepartmentName string `json:"departmentname"` //部门
Dimension int64 `json:"dimension" gorm:"column:qe_dimension;type:bigint(20) unsigned;default:0;not null;comment:考核维度"`
DimensionName string `json:"dimensionname"` //维度
Target int64 `json:"target" gorm:"column:qe_target;type:bigint(20) unsigned;default:0;not null;comment:考核指标"`
Title string `json:"title" gorm:"column:et_title;type:varchar(255);comment:指标名称"`
ExtraPoints int64 `json:"extrapoints"` //加分总价
ScoreReduction int64 `json:"scorereduction"` //减分总计
}
//考核方案输出
type kaoHeFangAn struct {
Id int64 `json:"id" gorm:"primaryKey;column:qe_id;type:bigint(20) unsigned;not null;comment:Id;index"`
DetailedTarget int64 `json:"detailedtarget" gorm:"column:qe_detailed_target;type:bigint(20) unsigned;default:0;not null;comment:考核细则"`
}

192
gin_server_admin/api/web/jixiaokaohe/myduty.go

@ -0,0 +1,192 @@
package jixiaokaohe
import (
"fmt"
"strconv"
"github.com/flipped-aurora/gin-vue-admin/server/commonus"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/assessmentmodel"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/gin-gonic/gin"
)
func (a *ApiGroup) Index(c *gin.Context) {
outPut := commonus.MapOut()
response.Result(0, outPut, "手机考核入口", c)
}
//获取关于本人要进行的项目
func (a *ApiGroup) AboutMyTask(c *gin.Context) {
isTrue, userCont := commonus.ClientIdentity()
if isTrue != true {
response.Result(101, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c)
return
}
var requestData taskParameterTitle
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(102, err, "数据获取失败!", c)
return
}
if requestData.Group == "" || requestData.Department == "" || requestData.Target == "" {
response.Result(103, err, "参数错误!请检查您的输入", c)
return
}
var targetId []int64
gormDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_target_sun").Where("`qe_group` = ?", requestData.Group).Where("`qe_accept_evaluation` = ?", requestData.Department).Where("`qe_target` = ?", requestData.Target).Where("`qe_type` = 1 AND `qe_state` = 1 AND FIND_IN_SET(?,`qe_operator`)", userCont.Key).Group("qe_target_sun").Find(&targetId)
errDb := gormDb.Error
if errDb != nil {
response.Result(103, errDb, "没有数据", c)
return
}
if len(targetId) < 1 {
response.Result(103, errDb, "没有数据", c)
return
}
var outSunTargetList []outTaskSunTarget
for _, v := range targetId {
var outSunTargetInfo outTaskSunTarget
outSunTargetInfo.Group = requestData.Group
outSunTargetInfo.Department = requestData.Department
outSunTargetInfo.Target = requestData.Target
outSunTargetInfo.SunTarget = strconv.FormatInt(v, 10)
sunTarInfo, _ := commonus.GetQualitativeTargetInfo(v)
outSunTargetInfo.ProjectName = sunTarInfo.Title
outSunTargetList = append(outSunTargetList, outSunTargetInfo)
}
response.Result(0, outSunTargetList, "获取成功", c)
}
//获取考核指标细则
func (a *ApiGroup) TaskParameterTitleList(c *gin.Context) {
isTrue, userCont := commonus.ClientIdentity()
if isTrue != true {
response.Result(101, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c)
return
}
var requestData taskParameterTitleList
err := c.ShouldBindJSON(&requestData)
if requestData.Page < 0 {
requestData.Page = 1
}
if requestData.PageSize < 0 {
requestData.PageSize = 20
}
if err != nil {
response.Result(102, err, "数据获取失败!", c)
return
}
if requestData.Group == "" || requestData.Department == "" || requestData.Target == "" || requestData.SunTarget == "" {
response.Result(103, err, "参数错误!请检查您的输入", c)
return
}
var targetId []kaoHeFangAn
gormDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_detailed_target,qe_id").Where("`qe_group` = ?", requestData.Group).Where("`qe_accept_evaluation` = ?", requestData.Department).Where("`qe_target` = ?", requestData.Target).Where("`qe_target_sun` = ?", requestData.SunTarget).Where("`qe_type` = 1 AND `qe_state` = 1 AND FIND_IN_SET(?,`qe_operator`)", userCont.Key).Limit(requestData.PageSize).Offset(commonus.CalculatePages(requestData.Page, requestData.PageSize)).Group("qe_detailed_target,qe_id").Find(&targetId)
errDb := gormDb.Error
if errDb != nil {
response.Result(103, errDb, "没有数据", c)
return
}
if len(targetId) < 1 {
response.Result(103, errDb, "没有数据", c)
return
}
// var outDetailedTargetList []outMyTaskDiesTarget
// for _, v := range targetId {
// var outSunTargetInfo outMyTaskDiesTarget
// outSunTargetInfo.Group = requestData.Group
// outSunTargetInfo.Department = requestData.Department
// outSunTargetInfo.Target = requestData.Target
// outSunTargetInfo.SunTarget = requestData.SunTarget
// outSunTargetInfo.Id = strconv.FormatInt(v, 10)
// sunTarInfo, _ := commonus.GetDetailedTargetInfo(v)
// outSunTargetInfo.Title = sunTarInfo.Title
// outSunTargetInfo.Content = sunTarInfo.Content
// if sunTarInfo.MinScore > 0 && sunTarInfo.MaxScore > 0 {
// outSunTargetInfo.Standard = fmt.Sprintf("%v-%v", float64(sunTarInfo.MinScore)/100, float64(sunTarInfo.MaxScore)/100)
// } else if sunTarInfo.MinScore > 0 && sunTarInfo.MaxScore <= 0 {
// outSunTargetInfo.Standard = fmt.Sprintf("%v", float64(sunTarInfo.MinScore)/100)
// } else if sunTarInfo.MinScore <= 0 && sunTarInfo.MaxScore > 0 {
// outSunTargetInfo.Standard = fmt.Sprintf("%v", float64(sunTarInfo.MaxScore)/100)
// } else {
// outSunTargetInfo.Standard = "0"
// }
// outSunTargetInfo.Unit = sunTarInfo.Company
// outDetailedTargetList = append(outDetailedTargetList, outSunTargetInfo)
// }
// response.Result(0, outDetailedTargetList, "获取成功", c)
var outContList []NewQualDetailOutList
for _, v := range targetId {
var outCont NewQualDetailOutList
outCont.Id = v.Id
groupId, _ := strconv.ParseInt(requestData.Group, 10, 64)
outCont.Group = groupId
where := commonus.MapOut()
where["id"] = groupId
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
outCont.GroupName = orgCont.Name
whereDepart := commonus.MapOut()
whereDepart["id"] = requestData.Department
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
outCont.DepartmentName = orgContDepart.Name
// _, groupCont := commonus.GetGroupCont(v.Group)
// outCont.GroupName = groupCont.Name
accDepartId, _ := strconv.ParseInt(requestData.Department, 10, 64)
outCont.Department = accDepartId
// _, departCont := commonus.GetBranchFactory(requestData.Department)
// outCont.DepartmentName = departCont.Name
targetIDInf, _ := strconv.ParseInt(requestData.Target, 10, 64)
outCont.Target = targetIDInf
targetCont, _ := commonus.GetTargetInfo(targetIDInf)
outCont.Title = targetCont.Title
outCont.Dimension = targetCont.Dimension
dimensionCont, _ := commonus.GetDutyClassInfo(targetCont.Dimension)
outCont.DimensionName = dimensionCont.Title
//子栏目
targetSunId, _ := strconv.ParseInt(requestData.SunTarget, 10, 64)
targetSunCont, _ := commonus.GetQualitativeTargetInfo(targetSunId)
outCont.Target = targetSunId
outCont.TargetSunId = strconv.FormatInt(targetSunId, 10)
outCont.TargetSunName = targetSunCont.Title
detaiTargetCont, _ := commonus.GetDetailedTargetInfo(v.DetailedTarget)
outCont.DetailedTargetId = detaiTargetCont.Id
outCont.DetailedTargetTitle = detaiTargetCont.Title
outCont.DetailedTargetCont = detaiTargetCont.Content
outCont.AddReduce = detaiTargetCont.AddReduce
outCont.Company = detaiTargetCont.Company
outCont.State = 1
if detaiTargetCont.MinScore > 0 && detaiTargetCont.MaxScore > 0 {
outCont.Score = fmt.Sprintf("%v-%v", float64(detaiTargetCont.MinScore)/100, float64(detaiTargetCont.MaxScore)/100)
outCont.State = 2
} else if detaiTargetCont.MinScore > 0 && detaiTargetCont.MaxScore <= 0 {
outCont.Score = fmt.Sprintf("%v", float64(detaiTargetCont.MinScore)/100)
outCont.State = 1
} else if detaiTargetCont.MinScore <= 0 && detaiTargetCont.MaxScore > 0 {
outCont.Score = fmt.Sprintf("%v", float64(detaiTargetCont.MaxScore)/100)
outCont.State = 1
} else {
outCont.Score = "0"
outCont.State = 3
}
outContList = append(outContList, outCont)
}
response.Result(0, outContList, "获取成功!", c)
}

25
gin_server_admin/api/web/jixiaokaohe/people.go

@ -0,0 +1,25 @@
package jixiaokaohe
import (
"github.com/flipped-aurora/gin-vue-admin/server/commonus"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/hrsystem"
"github.com/gin-gonic/gin"
)
//获取个人信息
func (a *ApiGroup) MyContent(c *gin.Context) {
isTrue, userCont := commonus.ClientIdentity()
if isTrue != true {
response.Result(101, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c)
return
}
var myInfo hrsystem.Personnel
err := global.GVA_DB_HrDataBase.Where("key = ?", userCont.Key).First(&myInfo).Error
if err != nil {
response.Result(102, err, "没有获取到数据!", c)
return
}
response.Result(0, myInfo, "获取成功!", c)
}

253
gin_server_admin/commonus/publichaneld.go

@ -3,9 +3,11 @@ package commonus
//公共函数类
import (
"bytes"
"crypto/rand"
"encoding/json"
"fmt"
"math"
"math/big"
"regexp"
"strconv"
"strings"
@ -62,6 +64,20 @@ func BubbleSort(slice []int64) []int64 {
return slice
}
//编号,纯数字
func TableNumber(class ...string) (number int64) {
result, _ := rand.Int(rand.Reader, big.NewInt(8999))
numberTeam := result.Int64() + 1000
numberStr := fmt.Sprintf("%v%v", time.Now().Unix(), numberTeam)
if len(class) > 0 {
resultLong, _ := rand.Int(rand.Reader, big.NewInt(8999999))
numberTeamLong := resultLong.Int64() + 1000000
numberStr = fmt.Sprintf("%v%v", time.Now().Unix(), numberTeamLong)
}
number, _ = strconv.ParseInt(numberStr, 10, 64)
return
}
//获取公司,分厂,工段
func GetGroupInfo(id int64) (isTrue bool, groupStruct wechat.GroupForm) {
isTrue = false
@ -697,6 +713,18 @@ func getOrgCont(id string) (oldId, orgName string) {
return
}
//获取新行政组织内容
func GetNewOrgCont(where interface{}, field ...string) (orgCont hrsystem.AdministrativeOrganization, err error) {
gormDb := global.GVA_DB_HrDataBase.Model(&hrsystem.AdministrativeOrganization{})
if len(field) > 0 {
fieldStr := strings.Join(field, ",")
gormDb = gormDb.Select(fieldStr)
}
gormDb = gormDb.Where(where)
err = gormDb.First(&orgCont).Error
return
}
//获取员工公司职务
func getPositionCont(id int64) (oldId, orgName string) {
var orgInfo hrsystem.Position
@ -1128,6 +1156,22 @@ func GetDetailedTargetInfo(id int64) (content assessmentmodel.DetailedTarget, is
return
}
//获取考核指标细则
func GetDetailedTargetInfoWher(wher interface{}, filed ...string) (content assessmentmodel.DetailedTarget, isTrue bool) {
isTrue = false
goromDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DetailedTarget{})
if len(filed) > 0 {
fieldStr := strings.Join(filed, ",")
goromDb = goromDb.Select(fieldStr)
}
err := goromDb.Where(wher).First(&content).Error
if err == nil {
isTrue = true
}
return
}
//获取考核指标细则
func GetDetailedTargetInfoTitle(id int64, title string) (content assessmentmodel.DetailedTarget, isTrue bool) {
isTrue = false
@ -1909,6 +1953,12 @@ func WriteFlowMainSet(orderId int64, userKey []int64) {
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
// where := MapOut()
// where["id"] = userCont.Group
// orgCont, _ := GetNewOrgCont(where, "id", "name")
// returnUser.GroupName = orgCont.Name
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
@ -2188,6 +2238,10 @@ func GetFlowNodeMan(flowID int64, class, style, writeLog int) (manInfo []UserLis
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
// where := MapOut()
// where["id"] = userCont.Group
// orgCont, _ := GetNewOrgCont(where, "id", "name")
// returnUser.GroupName = orgCont.Name
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
@ -2212,6 +2266,10 @@ func GetFlowNodeMan(flowID int64, class, style, writeLog int) (manInfo []UserLis
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
// where := MapOut()
// where["id"] = userCont.Group
// orgCont, _ := GetNewOrgCont(where, "id", "name")
// returnUser.GroupName = orgCont.Name
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
@ -2236,6 +2294,12 @@ func GetFlowNodeMan(flowID int64, class, style, writeLog int) (manInfo []UserLis
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
// where := MapOut()
// where["id"] = userCont.Group
// orgCont, _ := GetNewOrgCont(where, "id", "name")
// returnUser.GroupName = orgCont.Name
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
@ -2260,6 +2324,12 @@ func GetFlowNodeMan(flowID int64, class, style, writeLog int) (manInfo []UserLis
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
// where := MapOut()
// where["id"] = userCont.Group
// orgCont, _ := GetNewOrgCont(where, "id", "name")
// returnUser.GroupName = orgCont.Name
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
@ -2281,11 +2351,22 @@ func GetFlowNodeMan(flowID int64, class, style, writeLog int) (manInfo []UserLis
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
// where := MapOut()
// where["id"] = userCont.Group
// orgCont, _ := GetNewOrgCont(where, "id", "name")
// returnUser.GroupName = orgCont.Name
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
_, bfInfo := GetBranchFactory(userCont.DepartmentId)
returnUser.DepartmentName = bfInfo.Name
whereDepart := MapOut()
whereDepart["id"] = userCont.DepartmentId
orgContDepart, _ := GetNewOrgCont(whereDepart, "id", "name")
returnUser.DepartmentName = orgContDepart.Name
// _, bfInfo := GetBranchFactory(userCont.DepartmentId)
// returnUser.DepartmentName = bfInfo.Name
returnUser.WorkshopId = userCont.WorkshopId
_, wsInfo := GetWorkShopSection(userCont.WorkshopId)
returnUser.WorkshopName = wsInfo.Name
@ -2347,6 +2428,12 @@ func GetFlowNodeManEs(flowID int64, class, style, writeLog int, encFile []Enclos
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
// where := MapOut()
// where["id"] = userCont.Group
// orgCont, _ := GetNewOrgCont(where, "id", "name")
// returnUser.GroupName = orgCont.Name
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
@ -2371,6 +2458,12 @@ func GetFlowNodeManEs(flowID int64, class, style, writeLog int, encFile []Enclos
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
// where := MapOut()
// where["id"] = userCont.Group
// orgCont, _ := GetNewOrgCont(where, "id", "name")
// returnUser.GroupName = orgCont.Name
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
@ -2395,6 +2488,12 @@ func GetFlowNodeManEs(flowID int64, class, style, writeLog int, encFile []Enclos
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
// where := MapOut()
// where["id"] = userCont.Group
// orgCont, _ := GetNewOrgCont(where, "id", "name")
// returnUser.GroupName = orgCont.Name
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
@ -2419,6 +2518,12 @@ func GetFlowNodeManEs(flowID int64, class, style, writeLog int, encFile []Enclos
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
// where := MapOut()
// where["id"] = userCont.Group
// orgCont, _ := GetNewOrgCont(where, "id", "name")
// returnUser.GroupName = orgCont.Name
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
@ -2803,11 +2908,21 @@ func IsItTrueString(id string, idAry []string) (isTrue bool) {
//获取多部门归属集团
func GetDuboDepart(departAry []string) (group []string) {
fmt.Printf("DeparAry--------->%v\n", departAry)
for _, v := range departAry {
departID, _ := strconv.ParseInt(v, 10, 64)
isTrue, bfInfo := GetBranchFactory(departID)
// isTrue, bfInfo := GetBranchFactory(departID)
// if isTrue == true {
// bfGetID := strconv.FormatInt(bfInfo.Group, 10)
// if IsItTrueString(bfGetID, group) == false {
// group = append(group, bfGetID)
// }
// }
groupId, isTrue := GetNewHrOrg(departID)
fmt.Printf("groupId----->%v\n", groupId)
if isTrue == true {
bfGetID := strconv.FormatInt(bfInfo.Group, 10)
bfGetID := strconv.FormatInt(groupId, 10)
if IsItTrueString(bfGetID, group) == false {
group = append(group, bfGetID)
}
@ -2816,6 +2931,55 @@ func GetDuboDepart(departAry []string) (group []string) {
return
}
//获取新HR系统的集团
func GetNewHrOrg(departID int64) (groupId int64, isTrue bool) {
isTrue = false
var govMap OutGovCont
err := global.GVA_DB_HrDataBase.Model(&hrsystem.AdministrativeOrganization{}).Select("administrative_organization.*,aot.name as classname,aot.level").Joins("left join administrative_organization_type as aot on aot.id = administrative_organization.organization_type").Where("administrative_organization.`state` = 1 AND administrative_organization.id = ?", departID).Find(&govMap).Error
if err != nil {
return
}
// fmt.Printf("ZongJie----1-->%v\n", groupId)
if govMap.Level <= 2 {
isTrue = true
groupId = govMap.Id
// fmt.Printf("ZongJie---2--->%v\n", groupId)
return
} else {
groupId = diGuiOrg(govMap.Superior)
// fmt.Printf("ZongJie--3---->%v\n", groupId)
if groupId > 0 {
isTrue = true
}
}
// fmt.Printf("ZongJie---4--->%v\n", groupId)
return
}
//递归查找集团
func diGuiOrg(superior int64) (groupId int64) {
// fmt.Printf("DiGui----->%v\n", superior)
// return
// groupId = 0
var govMap OutGovCont
err := global.GVA_DB_HrDataBase.Model(&hrsystem.AdministrativeOrganization{}).Select("administrative_organization.*,aot.name as classname,aot.level").Joins("left join administrative_organization_type as aot on aot.id = administrative_organization.organization_type").Where("administrative_organization.`state` = 1 AND administrative_organization.id = ?", superior).Find(&govMap).Error
if err != nil {
return
}
// fmt.Printf("Id----%v------>%v------------>%v\n", govMap.Name, superior, govMap.Level)
if govMap.Level <= 2 {
// fmt.Printf("out---->%v--->%v\n", govMap, govMap.Id)
groupId = govMap.Id
return
} else {
// fmt.Printf("digui---->%v\n", govMap)
groupId = diGuiOrg(govMap.Superior)
}
// fmt.Printf("@@@@@@@@@@------>%v\n", govMap.Id)
return
}
//批量获取相关人员部门id
func GetDepartmentByUserBast(userKey []string) (userDepartmentId []string) {
if len(userKey) < 1 {
@ -2964,6 +3128,23 @@ func GetBranchDepartAry(departIdAry []string) (departId []int64, departAry []Dep
return
}
//获取新组织架构的行政信息
func GetNewOrgList(departIdAry []string) (departId []int64, departAry []DepartmentAryType) {
for _, v := range departIdAry {
where := MapOut()
where["id"] = v
orgCont, orgErr := GetNewOrgCont(where, "id", "name")
if orgErr == nil {
departId = append(departId, orgCont.Id)
var departcont DepartmentAryType
departcont.Parentname = orgCont.Name
departcont.Parentid = v
departAry = append(departAry, departcont)
}
}
return
}
//判断考核细则是否存在(新规则)
/*
参数说明
@ -3338,3 +3519,67 @@ func FormatFileSize(fileSize int64) (size string) {
return fmt.Sprintf("%.2fEB", float64(fileSize)/float64(1024*1024*1024*1024*1024))
}
}
//获取最大最小值
func NewUserModel(ary []int64) (max, min int64) {
if len(ary) < 0 {
return
}
// var teamMax T
for _, v := range ary {
if v > max {
max = v
}
if v < min {
min = v
}
}
return
}
//去重和排序
func UniqueSort(slice []int64) []int64 {
var quChong []int64
if len(slice) < 1 {
return quChong
}
//去重
for _, v := range slice {
if IsItTrue(v, quChong) == false {
quChong = append(quChong, v)
}
}
//排序
return SortForMerge(quChong, 0, len(quChong)-1)
}
//插入排序
func SortForMerge(arr []int64, left, right int) []int64 {
for i := left; i <= right; i++ {
temp := arr[i]
var j int
for j = i; j > left && arr[j-1] > temp; j-- { //定位
arr[j] = arr[j-1]
}
arr[j] = temp
}
return arr
}
//获取用户信息
func GetNewHrPeopleInfo(where interface{}, filed ...string) (ueInfo hrsystem.Personnel, isTrue bool) {
isTrue = false
// var ueInfo hrsystem.Personnel
gormDb := global.GVA_DB_HrDataBase.Model(&hrsystem.Personnel{})
if len(filed) > 0 {
fieldStr := strings.Join(filed, ",")
gormDb = gormDb.Select(fieldStr)
}
err := gormDb.Where(where).First(&ueInfo).Error
if err != nil {
return
}
isTrue = true
return
}

8
gin_server_admin/commonus/publicstruct.go

@ -1,5 +1,7 @@
package commonus
import "github.com/flipped-aurora/gin-vue-admin/server/model/hrsystem"
//公共变量
type SetId struct {
Id int64 `json:"id"`
@ -138,3 +140,9 @@ type EnclosureFormat struct {
FilePath string `json:"filepath"` //附件地址
Type int `json:"type"` //附件类型
}
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:级别"`
}

10
gin_server_admin/initialize/router.go

@ -61,6 +61,12 @@ func Routers() *gin.Engine {
publicApprove := router.RouterGroupApp.PublicApprove.Geography //公共Api
webApiInit := router.RouterGroupApp.WebApiRoute //手机端
// StatisticsRouter
statisAppRove := router.RouterGroupApp.StatisticsRouter //统计相关
/**
企业微信相关
*/
@ -160,6 +166,10 @@ func Routers() *gin.Engine {
dutyAssEss.InitDutyHandelRouter(MyCustomPrivateGroup) //前端数据考核
dutyAssEss.InitEvaluationRouter(MyCustomPrivateGroup) //用户端数据考核
ExamineApprove.InitShiyanRouter(MyCustomPrivateGroup) //前端审批相关
webApiInit.InitRouter(MyCustomPrivateGroup) //手机的接口
statisAppRove.InitRouter(MyCustomPrivateGroup) //统计相关
}
//自定义后台登录
MyCustomSystemGroup := Router.Group("")

2
gin_server_admin/middleware/myjwt.go

@ -254,7 +254,7 @@ func ScanCodeLogin() gin.HandlerFunc {
var md5JiaMiNumber commonus.Md5Encryption
md5JiaMiNumber.Md5EncryptionInit(myCustomIdentify.UserNumber)
userKeyCode := md5JiaMi.Md5EncryptionAlgorithm()
userKeyCode := md5JiaMiNumber.Md5EncryptionAlgorithm()
sha1Str := userKeyCode + myCustomIdentify.UserNumber + myCustomIdentify.UserPwd + md5Token
sha1Token := commonus.Sha1Encryption(sha1Str)

1
gin_server_admin/model/assessmentmodel/dutyclass.go

@ -237,6 +237,7 @@ type DetailedTarget struct {
CensorRate int `json:"censorrate" gorm:"column:dt_censor_rate;type:int(5) unsigned;default:1;not null;comment:检查频次"`
Cycles int `json:"cycle" gorm:"column:dt_cycle;type:tinyint(1) unsigned;default:1;not null;comment:1:班;2:天;3:周;4:月;5:季度;6:年"`
CycleAttres int `json:"cycleattr" gorm:"column:dt_cycleattr;type:int(9) unsigned;default:1;not null;comment:辅助计数"`
Paretment string `json:"paretment" gorm:"column:dt_paretment;type:longtext;comment:接受考核的部门"`
}
func (DetailedTarget *DetailedTarget) TableName() string {

4
gin_server_admin/router/enter.go

@ -11,9 +11,11 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/router/publichandel"
"github.com/flipped-aurora/gin-vue-admin/server/router/shiyan"
"github.com/flipped-aurora/gin-vue-admin/server/router/staffrouter"
"github.com/flipped-aurora/gin-vue-admin/server/router/statisticsrouter"
"github.com/flipped-aurora/gin-vue-admin/server/router/system"
"github.com/flipped-aurora/gin-vue-admin/server/router/systemadmin"
"github.com/flipped-aurora/gin-vue-admin/server/router/uploaddownload"
"github.com/flipped-aurora/gin-vue-admin/server/router/webrouter"
"github.com/flipped-aurora/gin-vue-admin/server/router/wechatapp"
"github.com/flipped-aurora/gin-vue-admin/server/router/wechatcallbackrouter"
)
@ -34,6 +36,8 @@ type RouterGroup struct {
WorkWeChatApp wechatapp.RouterGroup
ExamApprove examapprove.RouterGroup
PublicApprove publichandel.RouterGroup
WebApiRoute webrouter.WebRouter
StatisticsRouter statisticsrouter.RouterGroup
}
var RouterGroupApp = new(RouterGroup)

2
gin_server_admin/router/shiyan/sys_shiyan.go

@ -36,5 +36,7 @@ func (s *ShiyanRouter) InitShiyanRouter(Router *gin.RouterGroup) {
shiyanCodeRouter.POST("jiami", authorityApi.JiaMi) //比对文本
shiyanCodeRouter.POST("suntar", authorityApi.SunTar)
shiyanCodeRouter.POST("dataqianyi", authorityApi.DataQianyi) //数据迁移
}
}

5
gin_server_admin/router/statisticsrouter/enter.go

@ -0,0 +1,5 @@
package statisticsrouter
type RouterGroup struct {
StatisticsRouter
}

17
gin_server_admin/router/statisticsrouter/statistics.go

@ -0,0 +1,17 @@
package statisticsrouter
import (
"github.com/flipped-aurora/gin-vue-admin/server/api/statistics"
"github.com/gin-gonic/gin"
)
type StatisticsRouter struct{}
func (s *StatisticsRouter) InitRouter(Router *gin.RouterGroup) {
CodeRouter := Router.Group("statistics")
var initApiRouter = statistics.ApiGroupApp.NatureApi
{
CodeRouter.POST("", initApiRouter.Index) // 首页
CodeRouter.POST("gettargetorgandyear", initApiRouter.GetTargetOrgAndYear) // 计算定性考核组织范围,及起止年份
}
}

19
gin_server_admin/router/webrouter/webrouter.go

@ -0,0 +1,19 @@
package webrouter
import (
"github.com/flipped-aurora/gin-vue-admin/server/api/web"
"github.com/gin-gonic/gin"
)
type WebRouter struct{}
func (s *WebRouter) InitRouter(Router *gin.RouterGroup) {
CodeRouter := Router.Group("webach")
var initApiRouter = web.WebApiGroup.AchApiGroup
{
CodeRouter.POST("/", initApiRouter.Index) // 首页
CodeRouter.POST("aboutmytask", initApiRouter.AboutMyTask) // 获取定性考核项目列表
CodeRouter.POST("taskparametertitlelist", initApiRouter.TaskParameterTitleList) // 获取考核指标细则
CodeRouter.POST("mycontent", initApiRouter.MyContent) // 获取个人信息
}
}
Loading…
Cancel
Save