Browse Source

扫码登录

qin_1
超级管理员 4 years ago
parent
commit
ab508052e2
  1. 6
      gin_server_admin/README.md
  2. 35
      gin_server_admin/api/admin/dutyassess/assesstype.go
  3. 230
      gin_server_admin/api/admin/dutyassess/dutyes.go
  4. 86
      gin_server_admin/api/admin/dutyassess/dutyhandle.go
  5. 15
      gin_server_admin/api/admin/dutyassess/planversio.go
  6. 66
      gin_server_admin/api/admin/dutyassess/position.go
  7. 47
      gin_server_admin/api/index/assessment/assesshandle.go
  8. 6
      gin_server_admin/api/index/assessment/assesstype.go
  9. 15
      gin_server_admin/api/index/evaluation/evaluation.go
  10. 73
      gin_server_admin/api/index/evaluation/flowsend.go
  11. 47
      gin_server_admin/api/index/evaluation/type.go
  12. 7
      gin_server_admin/api/v1/fileuploaddownload/fileupdowntype.go
  13. 36
      gin_server_admin/api/v1/fileuploaddownload/fileuploaddown.go
  14. 72
      gin_server_admin/api/wechatapp/callback/updatehandle.go
  15. 455
      gin_server_admin/commonus/publichaneld.go
  16. 12
      gin_server_admin/commonus/publicstruct.go
  17. 16
      gin_server_admin/config.yaml
  18. 1
      gin_server_admin/config/config.go
  19. 1
      gin_server_admin/global/global.go
  20. 2
      gin_server_admin/initialize/gorm.go
  21. 5
      gin_server_admin/main.go
  22. 1
      gin_server_admin/middleware/myjwt.go
  23. 38
      gin_server_admin/model/assessmentmodel/dutyclass.go
  24. 42
      gin_server_admin/model/assessmentmodel/performance_appraisal.go
  25. 48
      gin_server_admin/model/hrsystem/administrative_organization.go
  26. 38
      gin_server_admin/model/hrsystem/administrative_organization_type.go
  27. 24
      gin_server_admin/model/hrsystem/duties.go
  28. 21
      gin_server_admin/model/hrsystem/job_class.go
  29. 49
      gin_server_admin/model/hrsystem/position.go
  30. 17
      gin_server_admin/model/systemuser/systemuser.go
  31. 2
      gin_server_admin/router/assessment/assessmentrouter.go
  32. 3
      gin_server_admin/router/systemadmin/dutyassess.go
  33. BIN
      gin_server_admin/uploads/16498262459573710.pptx
  34. BIN
      gin_server_admin/uploads/16498263631242604.pptx
  35. BIN
      gin_server_admin/uploads/16498263989092496.pptx
  36. BIN
      gin_server_admin/uploads/16498264252521120.pptx
  37. BIN
      gin_server_admin/uploads/《U8+拆并卡、更换加密申请》-高科(1)_20210318081549.doc
  38. 15
      gin_server_admin/其他支持文件/config.yaml

6
gin_server_admin/README.md

@ -52,3 +52,9 @@
| `--timer` | timer | 定时器接口封装 | | `--timer` | timer | 定时器接口封装 |
| `--upload` | oss | oss接口封装 | | `--upload` | oss | oss接口封装 |
### LOG
#### 1 修改数据库
```
detailed_target 指标细则
qualitative_evaluation 定性考核

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

@ -242,6 +242,12 @@ type OutTargetCont struct {
DetailedTargetContent string `json:"detailedtargetcontent"` DetailedTargetContent string `json:"detailedtargetcontent"`
Operator []string `json:"operator"` Operator []string `json:"operator"`
OperatorAry []QualEvalArrt `json:"operatormap"` OperatorAry []QualEvalArrt `json:"operatormap"`
Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年
CycleAttres int `json:"cycleattr"` //辅助计数
CensorType int `json:"censortype"` //检查方式(1:现场检查;2:资料检查;3:事件触发)
CensorCont string `json:"censorcont"` //检查依据
CensorRate int `json:"censorrate"` //检查频次
} }
//获取定性指标->指标细则修改回显修改或新增 //获取定性指标->指标细则修改回显修改或新增
@ -253,6 +259,12 @@ type GetEiteTargetCont struct {
DetailedTargetName string `json:"detailedtargetname"` DetailedTargetName string `json:"detailedtargetname"`
DetailedTargetContent string `json:"detailedtargetcontent"` DetailedTargetContent string `json:"detailedtargetcontent"`
Operator []string `json:"operator"` Operator []string `json:"operator"`
Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年
CycleAttres int `json:"cycleattr"` //辅助计数
CensorType int `json:"censortype"` //检查方式(1:现场检查;2:资料检查;3:事件触发)
CensorCont string `json:"censorcont"` //检查依据
CensorRate int `json:"censorrate"` //检查频次
} }
//添加 定性考核指标关系指定 //添加 定性考核指标关系指定
@ -282,6 +294,9 @@ type QualEvalSunList struct {
MinScore int64 `json:"minscore"` //最小分*100保存 MinScore int64 `json:"minscore"` //最小分*100保存
MaxScore int64 `json:"maxscore"` //最大分*100保存 MaxScore int64 `json:"maxscore"` //最大分*100保存
AddOrReduce int `json:"addorreduce"` //1:减少;2:增加 AddOrReduce int `json:"addorreduce"` //1:减少;2:增加
CensorType int `json:"censortype"` //检查方式(1:现场检查;2:资料检查;3:事件触发)
CensorCont string `json:"censorcont"` //检查依据
CensorRate int `json:"censorrate"` //检查频次
} }
//添加 定性考核指标关系指定细则 //添加 定性考核指标关系指定细则
@ -408,6 +423,12 @@ type DutyPlanVersio struct {
State int `json:"state"` //状态 State int `json:"state"` //状态
} }
//岗位考核方案版本列表查询
type positionPlanVersio struct {
DutyPlanVersio
Position string `json:"position"` //岗位
}
//考核方案版本列表查询输出 //考核方案版本列表查询输出
type DutyPlanVersioOut struct { type DutyPlanVersioOut struct {
assessmentmodel.PlanVersio assessmentmodel.PlanVersio
@ -416,6 +437,14 @@ type DutyPlanVersioOut struct {
Time string `json:"time"` Time string `json:"time"`
} }
type positionPlanVersionOut struct {
assessmentmodel.PositionPlanVersio
GroupName string `json:"groupname"` //归属集团
DeaprtName string `json:"deaprtname"` //部门名称
PositionName string `json:"positionname"` //岗位名称
Time string `json:"time"`
}
//查看考核方案详情 //查看考核方案详情
type LookDutyVersio struct { type LookDutyVersio struct {
Key string `json:"key"` Key string `json:"key"`
@ -473,4 +502,10 @@ type EiteTargetContListSun struct {
TargetId string `json:"targetid"` //指标ID TargetId string `json:"targetid"` //指标ID
DepartmentMap []string `json:"departmentmap"` DepartmentMap []string `json:"departmentmap"`
Operator []string `json:"operator"` //操作人 Operator []string `json:"operator"` //操作人
Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年
CycleAttres int `json:"cycleattr"` //辅助计数
CensorType int `json:"censortype"` //检查方式(1:现场检查;2:资料检查;3:事件触发)
CensorCont string `json:"censorcont"` //检查依据
CensorRate int `json:"censorrate"` //检查频次
} }

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

@ -0,0 +1,230 @@
package dutyassess
import (
"fmt"
"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"
)
//判断考核细则是否存在(新规则)
/*
参数说明
@ascription 归属指标栏目
@title 指标细则
@explain 指标说明'
@explainId 指标明细ID
@ReferenceScore 分数
@CompanyCont 单位
@sunTargetId 子栏目
*/
// func JudgeDetailsCopy(ascription, title, explain, explainId, ReferenceScore, CompanyCont string, sunTargetId int64, addReduce int) (content assessmentmodel.DetailedTarget, isTrue bool)
// detailedTargetInfo, dtiIsTrue := commonus.JudgeDetailsCopy(requestData.Target, v.Title, v.Content, v.DetailedTarget, v.ReferenceScore, v.Unit, sunTargetCont.Id, v.AddOrReduce)
/*
参数说明
@ascription 归属指标栏目
@sunTargetId 子栏目
@detailedTarget 考核细则
*/
func JudgeDetailsCopyEs(ascription string, sunTargetId int64, detailedTarget QualEvalSunList) (content assessmentmodel.DetailedTarget, isTrue bool) {
if detailedTarget.AddOrReduce == 0 {
detailedTarget.AddOrReduce = 1
}
var minScoreInt int64
var maxScoreInt int64
scoreAry := strings.Split(detailedTarget.ReferenceScore, "-")
scoreLen := len(scoreAry)
// fmt.Printf("ScoreAry:%v----------->%v------------>%v------------>%v\n", ReferenceScore, scoreLen, scoreAry[0], scoreAry)
if scoreLen > 0 {
if scoreLen == 1 {
maxScore, _ := strconv.ParseFloat(scoreAry[0], 64)
zhhh := maxScore * 100
zhuanStr := strconv.FormatFloat(zhhh, 'f', -1, 64)
maxScoreInt, _ = strconv.ParseInt(strconv.FormatFloat(maxScore*100, 'f', -1, 64), 10, 64)
minScoreInt = 0
fmt.Printf("ScoreAry--1-----:%v----------->%v------------>%v------------>%v\n", maxScore, maxScoreInt, zhuanStr, zhhh)
} else {
minScore, _ := strconv.ParseFloat(scoreAry[0], 64)
maxScore, _ := strconv.ParseFloat(scoreAry[scoreLen-1], 64)
minScoreInt, _ = strconv.ParseInt(strconv.FormatFloat(minScore*100, 'f', -1, 64), 10, 64)
maxScoreInt, _ = strconv.ParseInt(strconv.FormatFloat(maxScore*100, 'f', -1, 64), 10, 64)
}
} else {
minScoreInt = 0
maxScoreInt = 0
}
isTrue = false
if detailedTarget.DetailedTarget != "" {
judgeIdErr := global.GVA_DB_Performanceappraisal.Where("`dt_id` = ?", detailedTarget.DetailedTarget).First(&content).Error
if judgeIdErr == nil {
eiteCont := commonus.MapOut()
if minScoreInt > maxScoreInt {
eiteCont["dt_min_score"] = maxScoreInt
eiteCont["dt_max_score"] = minScoreInt
} else {
eiteCont["dt_min_score"] = minScoreInt
eiteCont["dt_max_score"] = maxScoreInt
}
eiteCont["dt_title"] = detailedTarget.Title
eiteCont["dt_content"] = detailedTarget.CensorCont
eiteCont["dt_company"] = detailedTarget.Unit
eiteCont["dt_add_reduce"] = detailedTarget.AddOrReduce
eiteCont["dt_time"] = time.Now().Unix()
if detailedTarget.Cycles != 0 {
eiteCont["dt_cycle"] = detailedTarget.Cycles
}
if detailedTarget.CycleAttres != 0 {
eiteCont["dt_cycleattr"] = detailedTarget.CycleAttres
}
if detailedTarget.CensorType != 0 {
eiteCont["dt_censor_type"] = detailedTarget.CensorType
}
eiteCont["dt_censor_cont"] = detailedTarget.CensorCont
if detailedTarget.CensorRate != 0 {
eiteCont["dt_censor_rate"] = detailedTarget.CensorRate
}
global.GVA_DB_Performanceappraisal.Model(&content).Where("`dt_id` = ?", detailedTarget.DetailedTarget).Updates(&eiteCont)
// fmt.Printf("echo --------------1---------->%v\n", content)
isTrue = true
return
}
}
judgeErr := global.GVA_DB_Performanceappraisal.Where("`dt_parentid` = ? AND `dt_title` = ?", ascription, detailedTarget.Title).First(&content).Error
if judgeErr == nil {
isTrue = true
eiteCont := commonus.MapOut()
if minScoreInt > maxScoreInt {
eiteCont["dt_min_score"] = maxScoreInt
eiteCont["dt_max_score"] = minScoreInt
} else {
eiteCont["dt_min_score"] = minScoreInt
eiteCont["dt_max_score"] = maxScoreInt
}
eiteCont["dt_content"] = detailedTarget.CensorCont
eiteCont["dt_company"] = detailedTarget.Unit
eiteCont["dt_add_reduce"] = detailedTarget.AddOrReduce
eiteCont["dt_time"] = time.Now().Unix()
if detailedTarget.Cycles != 0 {
eiteCont["dt_cycle"] = detailedTarget.Cycles
}
if detailedTarget.CycleAttres != 0 {
eiteCont["dt_cycleattr"] = detailedTarget.CycleAttres
}
if detailedTarget.CensorType != 0 {
eiteCont["dt_censor_type"] = detailedTarget.CensorType
}
eiteCont["dt_censor_cont"] = detailedTarget.CensorCont
if detailedTarget.CensorRate != 0 {
eiteCont["dt_censor_rate"] = detailedTarget.CensorRate
}
global.GVA_DB_Performanceappraisal.Model(&content).Where("`dt_id` = ?", content.Id).Updates(&eiteCont)
// fmt.Printf("echo --------------2---------->%v\n", content)
return
}
ascriptionId, ascriptionErr := strconv.ParseInt(ascription, 10, 64)
if ascriptionErr != nil {
ascriptionId = 0
}
var minScoreIsTrue int64 = 0
var maxScoreIsTrue int64 = 0
if minScoreInt > maxScoreInt {
minScoreIsTrue = maxScoreInt
maxScoreIsTrue = minScoreInt
} else {
minScoreIsTrue = minScoreInt
maxScoreIsTrue = maxScoreInt
}
// fmt.Printf("ScoreAry---KKKK:%v----------->%v------------>%v------------>%v", minScoreIsTrue, maxScoreIsTrue, minScoreIsTrue, maxScoreIsTrue)
var saveColumEs assessmentmodel.DetailedTarget
saveColumEs.Title = detailedTarget.Title
saveColumEs.Content = detailedTarget.CensorCont
saveColumEs.ParentId = ascriptionId
saveColumEs.ParentIdSun = sunTargetId
saveColumEs.State = 1
saveColumEs.AddTime = time.Now().Unix()
saveColumEs.MinScore = minScoreIsTrue
saveColumEs.MaxScore = maxScoreIsTrue
saveColumEs.Company = detailedTarget.Unit
if detailedTarget.AddOrReduce > 0 {
saveColumEs.AddReduce = detailedTarget.AddOrReduce
} else {
saveColumEs.AddReduce = 1
}
if detailedTarget.CensorType > 0 {
saveColumEs.CensorType = detailedTarget.CensorType
} else {
saveColumEs.CensorType = 1
}
saveColumEs.CensorCont = detailedTarget.CensorCont
if detailedTarget.CensorRate > 0 {
saveColumEs.CensorRate = detailedTarget.CensorRate
} else {
saveColumEs.CensorRate = 1
}
var targetInfoCont assessmentmodel.EvaluationTarget
tarEvlWhe := commonus.MapOut()
tarEvlWhe["et_id"] = ascriptionId
targetInfoCont.GetCont(tarEvlWhe, "et_cycle", "et_cycleattr")
if detailedTarget.Cycles > 0 {
saveColumEs.Cycles = detailedTarget.Cycles
} else {
if targetInfoCont.Cycles > 1 {
saveColumEs.Cycles = targetInfoCont.Cycles
} else {
saveColumEs.Cycles = 4
}
}
if detailedTarget.CycleAttres > 0 {
saveColumEs.CycleAttres = detailedTarget.CycleAttres
} else {
if targetInfoCont.CycleAttres > 1 {
saveColumEs.CycleAttres = targetInfoCont.CycleAttres
} else {
saveColumEs.CycleAttres = 1
}
}
addErr := global.GVA_DB_Performanceappraisal.Create(&saveColumEs).Error
// saveColum := assessmentmodel.DetailedTarget{
// Title: detailedTarget.Title,
// Content: detailedTarget.CensorCont,
// ParentId: ascriptionId,
// ParentIdSun: sunTargetId,
// State: 1,
// AddTime: time.Now().Unix(),
// Company: detailedTarget.Unit,
// MinScore: minScoreIsTrue,
// MaxScore: maxScoreIsTrue,
// AddReduce: detailedTarget.AddOrReduce,
// Cycles: detailedTarget.Cycles,
// CycleAttres: detailedTarget.CycleAttres,
// }
// addErr := global.GVA_DB_Performanceappraisal.Create(&saveColum).Error
if addErr != nil {
// fmt.Printf("echo --------------3---------->%v\n", saveColum.Id)
return
}
// fmt.Printf("echo --------------4---------->%v\n", saveColum.Id)
isTrue = true
// content = saveColum
content = saveColumEs
return
}

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

@ -468,9 +468,25 @@ func (d *DutyAssessApi) EiteSunTargetName(c *gin.Context) {
eiteAssCont["content"] = string(eiteUserJson) eiteAssCont["content"] = string(eiteUserJson)
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.Assesstarget{}).Where("`at_id` = ?", assCont.Id).Updates(eiteAssCont) global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.Assesstarget{}).Where("`at_id` = ?", assCont.Id).Updates(eiteAssCont)
} }
// if len(detaTargetid) > 0{ if len(detaTargetid) > 0 {
// global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DetailedTarget{}).Where("`dt_id` IN ?", detaTargetid).Updates(eiteAssCont) eiteAssContDeite := commonus.MapOut()
// } eiteAssContDeite["dt_time"] = time.Now().Unix()
if requestData.Cycles > 0 {
eiteAssContDeite["dt_cycle"] = requestData.Cycles
}
if requestData.CycleAttres > 0 {
eiteAssContDeite["dt_cycleattr"] = requestData.CycleAttres
}
if requestData.CensorType > 0 {
eiteAssContDeite["dt_censor_type"] = requestData.CensorType
}
eiteAssContDeite["dt_censor_cont"] = requestData.CensorCont
if requestData.CensorRate > 0 {
eiteAssContDeite["dt_censor_rate"] = requestData.CensorRate
}
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DetailedTarget{}).Where("`dt_id` IN ?", detaTargetid).Updates(eiteAssContDeite)
}
} }
var oldId int64 var oldId int64
@ -628,7 +644,9 @@ func (d *DutyAssessApi) AddDutyRelation(c *gin.Context) {
var newAddId []int64 var newAddId []int64
for _, v := range requestData.EvaluationList { for _, v := range requestData.EvaluationList {
// detailedTargetInfo, dtiIsTrue := commonus.JudgeDetails(requestData.Target, v.Title, v.Content, v.DetailedTarget, sunTargetCont.Id) // 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) // detailedTargetInfo, dtiIsTrue := commonus.JudgeDetailsCopy(requestData.Target, v.Title, v.Content, v.DetailedTarget, v.ReferenceScore, v.Unit, sunTargetCont.Id, v.AddOrReduce)
detailedTargetInfo, dtiIsTrue := JudgeDetailsCopyEs(requestData.Target, sunTargetCont.Id, v)
/* /*
参数说明 参数说明
@ascription 归属指标栏目 @ascription 归属指标栏目
@ -1073,6 +1091,12 @@ func (d *DutyAssessApi) GetNewEiteDetailedTarget(c *gin.Context) {
outPutCont.DetailedTargetId = strconv.FormatInt(cont.Id, 10) outPutCont.DetailedTargetId = strconv.FormatInt(cont.Id, 10)
outPutCont.DetailedTargetName = cont.Title outPutCont.DetailedTargetName = cont.Title
outPutCont.DetailedTargetContent = cont.Content outPutCont.DetailedTargetContent = cont.Content
outPutCont.Cycles = cont.Cycles
outPutCont.CycleAttres = cont.CycleAttres
outPutCont.CensorType = cont.CensorType
outPutCont.CensorCont = cont.CensorCont
outPutCont.CensorRate = cont.CensorRate
//单位 //单位
outPutCont.Unit = cont.Company outPutCont.Unit = cont.Company
if cont.MinScore > 0 && cont.MaxScore > 0 { if cont.MinScore > 0 && cont.MaxScore > 0 {
@ -1147,7 +1171,59 @@ func (d *DutyAssessApi) NewEiteDetailedTarget(c *gin.Context) {
response.Result(104, errAssErr, "没有获取到数据!", c) response.Result(104, errAssErr, "没有获取到数据!", c)
return return
} }
detailedTargetInfo, dtiIsTrue := commonus.JudgeDetailsCopy(strconv.FormatInt(assCont.TargetId, 10), requestData.DetailedTargetName, requestData.DetailedTargetContent, requestData.Id, requestData.Score, requestData.Unit, assCont.SunTargetId, requestData.AddOrReduce) // detailedTargetInfo, dtiIsTrue := commonus.JudgeDetailsCopy(strconv.FormatInt(assCont.TargetId, 10), requestData.DetailedTargetName, requestData.DetailedTargetContent, requestData.Id, requestData.Score, requestData.Unit, assCont.SunTargetId, requestData.AddOrReduce)
//判断考核细则是否存在(新规则)
/*
参数说明
@ascription 归属指标栏目
@title 指标细则
@explain 指标说明'
@explainId 指标明细ID
@ReferenceScore 分数
@CompanyCont 单位
@sunTargetId 子栏目
*/
// func JudgeDetailsCopy(ascription, title, explain, explainId, ReferenceScore, CompanyCont string, sunTargetId int64, addReduce int) (content assessmentmodel.DetailedTarget, isTrue bool)
var detailedTarget QualEvalSunList
detailedTarget.DetailedTarget = requestData.Id //`json:"id"` //考核细则
detailedTarget.Title = requestData.DetailedTargetName //`json:"title"` //指标说明
detailedTarget.Content = requestData.DetailedTargetContent //`json:"content"` //指标说明
detailedTarget.Unit = requestData.Unit //`json:"unit"` //单位
detailedTarget.ReferenceScore = requestData.Score //`json:"referencescore"` //标准分值
detailedTarget.Cycles = requestData.Cycles //`json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年
detailedTarget.CycleAttres = requestData.CycleAttres // `json:"cycleattr"` //辅助计数
// detailedTarget.DepartmentId =requestData. `json:"parentid"` //执行考核部门ID
detailedTarget.Operator = requestData.Operator //`json:"userlist"` //考核执行人
// detailedTarget.MinScore =requestData. //`json:"minscore"` //最小分*100保存
// detailedTarget.MaxScore =requestData. //`json:"maxscore"` //最大分*100保存
detailedTarget.AddOrReduce = requestData.AddOrReduce //`json:"addorreduce"` //1:减少;2:增加
detailedTarget.CensorType = requestData.CensorType //`json:"censortype"` //检查方式(1:现场检查;2:资料检查;3:事件触发)
detailedTarget.CensorCont = requestData.CensorCont //`json:"censorcont"` //检查依据
detailedTarget.CensorRate = requestData.CensorRate //`json:"censorrate"` //检查频次
// Id string `json:"id"`
// Class int `json:"class"` //1、新增;2、修改
// SunTargerId string `json:"suntargetid"`
// SunTargetName string `json:"suntargetname"`
// DetailedTargetName string `json:"detailedtargetname"`
// DetailedTargetContent string `json:"detailedtargetcontent"`
// Operator []string `json:"operator"`
// Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年
// CycleAttres int `json:"cycleattr"` //辅助计数
// CensorType int `json:"censortype"` //检查方式(1:现场检查;2:资料检查;3:事件触发)
// CensorCont string `json:"censorcont"` //检查依据
// CensorRate int `json:"censorrate"` //检查频次
// AssId string `json:"assid"`
// Unit string `json:"unit"` //单位
// Score string `json:"score"` //分值
// AddOrReduce int `json:"addorreduce"` //1:减少;2:增加
detailedTargetInfo, dtiIsTrue := JudgeDetailsCopyEs(strconv.FormatInt(assCont.TargetId, 10), assCont.SunTargetId, detailedTarget)
if dtiIsTrue != true { if dtiIsTrue != true {
response.Result(105, errAssErr, "指标明细编辑失败!", c) response.Result(105, errAssErr, "指标明细编辑失败!", c)
return return

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

@ -269,15 +269,24 @@ func (d *DutyAssessApi) AddDepartDutyVersio(c *gin.Context) {
saveData.MinScore = getEvalTarCont.MinScore saveData.MinScore = getEvalTarCont.MinScore
saveData.MaxScore = getEvalTarCont.MaxScore saveData.MaxScore = getEvalTarCont.MaxScore
saveData.CensorType = getEvalTarCont.CensorType
saveData.CensorCont = getEvalTarCont.CensorCont
saveData.CensorRate = getEvalTarCont.CensorRate
// saveData.ReferenceScore = v_s.ReferenceScore //分值 // saveData.ReferenceScore = v_s.ReferenceScore //分值
saveData.State = judgeState //状态 saveData.State = judgeState //状态
saveData.Addtime = time.Now().Unix() saveData.Addtime = time.Now().Unix()
saveData.Eitetime = time.Now().Unix() saveData.Eitetime = time.Now().Unix()
saveData.Group = ae_v.Group //集团 saveData.Group = ae_v.Group //集团
evaDingXinglTarCont, _ := commonus.GetTargetInfo(ae_v.TargetId) //获取指标内容 if getEvalTarCont.Cycles > 0 {
saveData.Cycles = evaDingXinglTarCont.Cycles //1:班;2:天;3:周;4:月;5:季度;6:年 saveData.Cycles = getEvalTarCont.Cycles //1:班;2:天;3:周;4:月;5:季度;6:年
saveData.CycleAttres = evaDingXinglTarCont.CycleAttres //辅助计数 saveData.CycleAttres = getEvalTarCont.CycleAttres //辅助计数
} else {
evaDingXinglTarCont, _ := commonus.GetTargetInfo(ae_v.TargetId) //获取指标内容
saveData.Cycles = evaDingXinglTarCont.Cycles //1:班;2:天;3:周;4:月;5:季度;6:年
saveData.CycleAttres = evaDingXinglTarCont.CycleAttres //辅助计数
}
saveData.AcceptEvaluation = ae_v.DeaprtId //接受考核部门 saveData.AcceptEvaluation = ae_v.DeaprtId //接受考核部门
saveData.Content = getEvalTarCont.Content //描述 saveData.Content = getEvalTarCont.Content //描述

66
gin_server_admin/api/admin/dutyassess/position.go

@ -0,0 +1,66 @@
package dutyassess
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 (d *DutyAssessApi) PositionDepartPlanVersion(c *gin.Context) {
var requestData positionPlanVersio
err := c.ShouldBindJSON(&requestData)
if err != nil {
// response.Result(101, err, "数据获取失败!", c)
// return
}
gormDb := global.GVA_DB_Performanceappraisal
if requestData.Group != "" {
gormDb = gormDb.Where("`group` = ?", requestData.Group)
}
if requestData.DeaprtId != "" {
gormDb = gormDb.Where("`department` = ?", requestData.DeaprtId)
}
if requestData.Position != "" {
gormDb = gormDb.Where("`position` = ?", requestData.Position)
}
if requestData.Year != "" {
gormDb = gormDb.Where("`years` = ?", requestData.Year)
}
if requestData.Versio != "" {
gormDb = gormDb.Where("`version` LIKE ?", "%"+requestData.Versio+"%")
}
if requestData.VersioNum != "" {
gormDb = gormDb.Where("`key` LIKE ?", "%"+requestData.VersioNum+"%")
}
if requestData.State != 0 {
gormDb = gormDb.Where("`state` = ?", requestData.State)
} else {
gormDb = gormDb.Where("`state` IN (1,2)")
}
// response.Result(104, requestData, "没有查询到数据", c)
// return
var planVersio []positionPlanVersionOut
dataErr := gormDb.Order("`addtime` DESC").Find(&planVersio).Error
if dataErr != nil {
response.Result(104, dataErr, "没有查询到数据", c)
return
}
for i, v := range planVersio {
var groupCont hrsystem.AdministrativeOrganization
groupCont.GetCont(map[string]interface{}{"id": v.Group}, "name")
planVersio[i].GroupName = groupCont.Name
groupCont.GetCont(map[string]interface{}{"id": v.Department}, "name")
planVersio[i].DeaprtName = groupCont.Name
var positionCont hrsystem.Position
groupCont.GetCont(map[string]interface{}{"id": v.Department}, "name")
planVersio[i].PositionName = positionCont.Name
planVersio[i].Time = commonus.TimeStampToDate(v.AddTime, 20)
}
response.Result(0, planVersio, "获取成功", c)
}
//添加岗位

47
gin_server_admin/api/index/assessment/assesshandle.go

@ -2,6 +2,7 @@ package assessment
import ( import (
"encoding/json" "encoding/json"
"fmt"
"strconv" "strconv"
"time" "time"
@ -12,8 +13,11 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/global" "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/assessmentmodel"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response" "github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/systemuser"
"github.com/flipped-aurora/gin-vue-admin/server/model/testpage" "github.com/flipped-aurora/gin-vue-admin/server/model/testpage"
"github.com/flipped-aurora/gin-vue-admin/server/utils/redishandel"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/mitchellh/mapstructure"
) )
//考核入口 //考核入口
@ -22,6 +26,49 @@ func (a *Assessment) Index(c *gin.Context) {
response.Result(0, outPut, "用户端获取成功", c) response.Result(0, outPut, "用户端获取成功", c)
} }
//扫码登录回传
func (a *Assessment) ScanCode(c *gin.Context) {
var requestData scanCodeStr
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(101, err, "参数错误!请重新提交!", c)
return
}
var redisAdminInfo systemuser.RedisAdminInfo
redisClient := redishandel.RunRedis()
redisKey := fmt.Sprintf("system:SystemAdminInfo_%v_%v", global.GVA_CONFIG.RedisPrefix.Alias, requestData.UserKey)
tokenInfo, isTrue := redisClient.HashGetAll(redisKey)
if isTrue != true {
response.Result(102, err, "验证失败!不允许登录!", c)
return
}
identityErr := mapstructure.Decode(tokenInfo, &redisAdminInfo)
if identityErr != nil {
response.Result(103222, redisKey, "验证失败!不允许登录!", c)
return
}
if requestData.UserToken != redisAdminInfo.UserToken {
yanzheng := commonus.MapOut()
yanzheng["User"] = redisAdminInfo
yanzheng["redisKey"] = redisKey
yanzheng["UserToken"] = requestData.UserToken
yanzheng["RedisUserToken"] = redisAdminInfo.UserToken
response.Result(104, yanzheng, "验证失败!不允许登录!", c)
return
}
sendData := commonus.MapOut()
sendData["key"] = redisAdminInfo.UserKey
sendData["token"] = redisAdminInfo.UserToken
sendData["userinfo"] = redisAdminInfo
var jurisDiction []int64
json.Unmarshal([]byte(redisAdminInfo.JurisDiction), &jurisDiction)
sendData["Jurisdiction"] = jurisDiction
var menuOper []int64
json.Unmarshal([]byte(redisAdminInfo.MenuOper), &menuOper)
sendData["MenuOper"] = menuOper
response.Result(0, sendData, "用户端获取成功", c)
}
//获取要考核的列表 //获取要考核的列表
func (a *Assessment) MyAssEssMentList(c *gin.Context) { func (a *Assessment) MyAssEssMentList(c *gin.Context) {
var requestData getAssEssList var requestData getAssEssList

6
gin_server_admin/api/index/assessment/assesstype.go

@ -290,3 +290,9 @@ type LookSeeDutyCont struct {
DeductPointstext string `json:"deductPointstext"` DeductPointstext string `json:"deductPointstext"`
ExtraPointstext string `json:"extraPointstext"` ExtraPointstext string `json:"extraPointstext"`
} }
//扫码登录回传
type scanCodeStr struct {
UserKey string `json:"userkey"`
UserToken string `json:"usertoken"`
}

15
gin_server_admin/api/index/evaluation/evaluation.go

@ -1157,6 +1157,18 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
fmt.Printf("7-------------------->%v\n", danWeStr) fmt.Printf("7-------------------->%v\n", danWeStr)
dutyCecorFlowInfo.Reason = addScore.Reason dutyCecorFlowInfo.Reason = addScore.Reason
if addScore.Enclosure != "" {
var fujian []EnclosureFormat
json.Unmarshal([]byte(addScore.Enclosure), &fujian)
dutyCecorFlowInfo.Enclosure = fujian
// fmt.Printf("FileType----------------->%v------------->%v\n", jsonerr, addScore.Enclosure)
// enclosure, enclosureErr := json.Marshal(addScore.Enclosure)
// if enclosureErr == nil {
// dutyCecorFlowInfo.Enclosure = string(enclosure) //附件
// }
}
// dutyCecorFlowInfo.Enclosure =
//分数 //分数
sendScore := addScore.Score * int64(addScore.Count) sendScore := addScore.Score * int64(addScore.Count)
if addScore.PlusReduceScore == 1 { if addScore.PlusReduceScore == 1 {
@ -1226,6 +1238,9 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
recMeasInfo.RecCont = r_v.Content recMeasInfo.RecCont = r_v.Content
recMeasInfo.State = r_v.State recMeasInfo.State = r_v.State
recMeasInfo.TimeVal = commonus.TimeStampToDate(r_v.Time, 1) recMeasInfo.TimeVal = commonus.TimeStampToDate(r_v.Time, 1)
if r_v.Enclosure != "" && r_v.Enclosure != "null" {
json.Unmarshal([]byte(r_v.Enclosure), &recMeasInfo.Enclosure)
}
dutyCecorFlowInfo.RectifMeasures = append(dutyCecorFlowInfo.RectifMeasures, recMeasInfo) dutyCecorFlowInfo.RectifMeasures = append(dutyCecorFlowInfo.RectifMeasures, recMeasInfo)
} }
} }

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

@ -110,10 +110,13 @@ func (e *EvaluationInterface) PlusOrMinusPoints(c *gin.Context) {
addScore.Quarter = commonus.ComputingTime(operationTime, 2) addScore.Quarter = commonus.ComputingTime(operationTime, 2)
addScore.Month = commonus.ComputingTime(operationTime, 3) addScore.Month = commonus.ComputingTime(operationTime, 3)
addScore.Week = commonus.ComputingTime(operationTime, 4) addScore.Week = commonus.ComputingTime(operationTime, 4)
enclosure, enclosureErr := json.Marshal(requestData.Enclosure) if len(requestData.Enclosure) > 0 {
if enclosureErr == nil { enclosure, enclosureErr := json.Marshal(requestData.Enclosure)
addScore.Enclosure = string(enclosure) //附件 if enclosureErr == nil {
addScore.Enclosure = string(enclosure) //附件
}
} }
addScore.DutyGroup = programme.Group //职责集团 addScore.DutyGroup = programme.Group //职责集团
addScore.DutyDepartment = programme.AcceptEvaluation //职责部门 addScore.DutyDepartment = programme.AcceptEvaluation //职责部门
addScore.Rectification = requestData.Rectification //1、需要整改;2:无需整改 addScore.Rectification = requestData.Rectification //1、需要整改;2:无需整改
@ -211,7 +214,8 @@ func (e *EvaluationInterface) PlusOrMinusPoints(c *gin.Context) {
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", keyNumber) cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", keyNumber)
if myIsTrue != 1 { if myIsTrue != 1 {
//写入当前流程步骤 //写入当前流程步骤
commonus.StepAddData(keyNumber, 0, 3, 1, 1, 2, 1, userCont.Key) // commonus.StepAddData(keyNumber, 0, 3, 1, 1, 2, 1, userCont.Key) //原
commonus.StepAddDataEs(keyNumber, 0, 3, 1, 1, 2, 1, userCont.Key, requestData.Enclosure)
//申请人也是部门负责人 //申请人也是部门负责人
//给相关部门内勤发送消息。确定相关责任人 //给相关部门内勤发送消息。确定相关责任人
sendUserIsTrue, sendUserList := commonus.GetSendMsgUser(16118387069540343, programme.AcceptEvaluation) //获取对应部门内勤 sendUserIsTrue, sendUserList := commonus.GetSendMsgUser(16118387069540343, programme.AcceptEvaluation) //获取对应部门内勤
@ -227,7 +231,8 @@ func (e *EvaluationInterface) PlusOrMinusPoints(c *gin.Context) {
} else { } else {
//写入当前流程步骤 //写入当前流程步骤
commonus.StepAddData(keyNumber, 16182159043990656, 2, 1, 1, 2, 1, userCont.Key) // commonus.StepAddData(keyNumber, 16182159043990656, 2, 1, 1, 2, 1, userCont.Key) //原
commonus.StepAddDataEs(keyNumber, 16182159043990656, 2, 1, 1, 2, 1, userCont.Key, requestData.Enclosure)
//申请人不是是部门负责人 给本部门负责人发送审批 //申请人不是是部门负责人 给本部门负责人发送审批
//获取发起人部门负责人 //获取发起人部门负责人
departmentIdInts, _ := strconv.ParseInt(userCont.DepartmentId, 10, 64) departmentIdInts, _ := strconv.ParseInt(userCont.DepartmentId, 10, 64)
@ -278,6 +283,23 @@ func (e *EvaluationInterface) PersonInCharge(c *gin.Context) {
response.Result(104, requestData, "未知考核项目!请检查你的提交是否正确!", c) response.Result(104, requestData, "未知考核项目!请检查你的提交是否正确!", c)
return return
} }
if requestData.Register == "" {
response.Result(1041, requestData, "未知考核项目!请检查你的提交是否正确!", c)
return
}
var registerCont assessmentmodel.Register
regWhere := commonus.MapOut()
regWhere["number"] = requestData.Register
regErr := registerCont.GetCont(regWhere)
if regErr == nil {
if registerCont.State != 1 {
response.Result(1041, requestData, "该考核项的责任划分您已经提交!请不要重复提交", c)
return
}
} else {
response.Result(1042, regErr, "未知考核项目!请检查你的提交是否正确!", c)
return
}
if len(requestData.UserList) < 1 { if len(requestData.UserList) < 1 {
response.Result(105, requestData, "请选择要考核的人员!", c) response.Result(105, requestData, "请选择要考核的人员!", c)
return return
@ -481,6 +503,10 @@ func (e *EvaluationInterface) PersonInCharge(c *gin.Context) {
response.Result(108, writeDataErr, "数据写入失败", c) response.Result(108, writeDataErr, "数据写入失败", c)
return return
} }
saveRegData := commonus.MapOut()
saveRegData["state"] = 2
saveRegData["time"] = time.Now().Unix()
registerCont.EiteCont(regWhere, saveRegData)
//审批节点写入责任人 //审批节点写入责任人
commonus.WriteFlowMainSet(orderId, userKeyMainAry) commonus.WriteFlowMainSet(orderId, userKeyMainAry)
flowSaveData := commonus.MapOut() flowSaveData := commonus.MapOut()
@ -592,6 +618,21 @@ func (e *EvaluationInterface) RectificationMeasures(c *gin.Context) {
response.Result(107, isTrue, "数据异常!!", c) response.Result(107, isTrue, "数据异常!!", c)
return return
} }
var registerCont assessmentmodel.Register
regWhere := commonus.MapOut()
regWhere["number"] = requestData.Register
regErr := registerCont.GetCont(regWhere)
if regErr == nil {
if registerCont.State != 1 {
response.Result(1041, requestData, "该考核项的责任划分您已经提交!请不要重复提交", c)
return
}
} else {
response.Result(1042, regErr, "未知考核项目!请检查你的提交是否正确!", c)
return
}
if requestData.Content == "" { if requestData.Content == "" {
response.Result(108, err, "请输入整改内容!", c) response.Result(108, err, "请输入整改内容!", c)
return return
@ -605,18 +646,32 @@ func (e *EvaluationInterface) RectificationMeasures(c *gin.Context) {
addRecMeas.Time = time.Now().Unix() addRecMeas.Time = time.Now().Unix()
addRecMeas.EiteTime = time.Now().Unix() addRecMeas.EiteTime = time.Now().Unix()
addRecMeas.Content = requestData.Content addRecMeas.Content = requestData.Content
enclosure, enclosureErr := json.Marshal(requestData.Enclosure)
if enclosureErr == nil { if len(requestData.Enclosure) > 0 {
addRecMeas.Enclosure = string(enclosure) enclosure, enclosureErr := json.Marshal(requestData.Enclosure)
if enclosureErr == nil {
addRecMeas.Enclosure = string(enclosure) //附件
}
} }
// enclosure, enclosureErr := json.Marshal(requestData.Enclosure)
// if enclosureErr == nil {
// addRecMeas.Enclosure = string(enclosure)
// }
addErr := global.GVA_DB_Performanceappraisal.Create(&addRecMeas).Error addErr := global.GVA_DB_Performanceappraisal.Create(&addRecMeas).Error
//步进内容 //步进内容
if addErr != nil { if addErr != nil {
response.Result(109, addErr, "数据写入失败", c) response.Result(109, addErr, "数据写入失败", c)
return return
} }
saveRegData := commonus.MapOut()
saveRegData["state"] = 2
saveRegData["time"] = time.Now().Unix()
registerCont.EiteCont(regWhere, saveRegData)
//写入流程步骤 //写入流程步骤
commonus.StepAddData(orderidval, 0, 6, 4, 1, 2, 5, userCont.Key) // commonus.StepAddData(orderidval, 0, 6, 4, 1, 2, 5, userCont.Key) //原
commonus.StepAddDataEs(orderidval, 0, 6, 4, 1, 2, 5, userCont.Key, requestData.Enclosure)
/* /*
向本部门负责人发送审批 向本部门负责人发送审批
*/ */

47
gin_server_admin/api/index/evaluation/type.go

@ -44,17 +44,26 @@ type QualEvalArrt struct {
Name string `json:"name"` Name string `json:"name"`
} }
//附件格式
type EnclosureFormat struct {
FileName string `json:"filename"` //附件名称
FilePath string `json:"filepath"` //附件地址
Type int `json:"type"` //附件类型
}
//加减分数据获取项 //加减分数据获取项
type addPlusOrMinusPoints struct { type addPlusOrMinusPoints struct {
PlanId string `json:"planid"` //方案id PlanId string `json:"planid"` //方案id
Addtime string `json:"time"` //检查时间 Addtime string `json:"time"` //检查时间
Type int `json:"type"` //1:加分;2:减分 Type int `json:"type"` //1:加分;2:减分
Score string `json:"score"` //分数 Score string `json:"score"` //分数
Count int `json:"count"` //次数 Count int `json:"count"` //次数
State int `json:"state"` //1、定分;2、区间分;3、不定性分值 State int `json:"state"` //1、定分;2、区间分;3、不定性分值
Reason string `json:"reason"` //原因 Reason string `json:"reason"` //原因
Rectification int `json:"rectification"` //1:整改;2:无需整改 Rectification int `json:"rectification"` //1:整改;2:无需整改
Enclosure []string `json:"enclosure"` //附件 // Enclosure []string `json:"enclosure"` //附件
// Enclosure []EnclosureFormat `json:"enclosure"` //附件
Enclosure []commonus.EnclosureFormat `json:"enclosure"` //附件
} }
type enclosureType struct { type enclosureType struct {
Type int `json:"type"` //1:加分;2:减分 Type int `json:"type"` //1:加分;2:减分
@ -75,6 +84,7 @@ type DivisionResponsibilityUser struct {
type DivisionResponsibilityTypes struct { type DivisionResponsibilityTypes struct {
Id string `json:"id"` //提交审批流ID Id string `json:"id"` //提交审批流ID
Register string `json:"register"` //挂号
UserList []DivisionResponsibilityUsers `json:"userlist"` //责任人 UserList []DivisionResponsibilityUsers `json:"userlist"` //责任人
} }
type DivisionResponsibilityUsers struct { type DivisionResponsibilityUsers struct {
@ -98,9 +108,12 @@ type FlowStep struct {
//改正措施数据提交 //改正措施数据提交
type CorrectiveMeasuresType struct { type CorrectiveMeasuresType struct {
OrderId string `json:"orderid"` OrderId string `json:"orderid"`
Content string `json:"content"` //整改内容 Content string `json:"content"` //整改内容
Enclosure []string `json:"enclosure"` //附件 Register string `json:"register"` //挂号
// Enclosure []string `json:"enclosure"` //附件
// Enclosure []EnclosureFormat `json:"enclosure"` //附件
Enclosure []commonus.EnclosureFormat `json:"enclosure"` //附件
} }
//添加定量考核 //添加定量考核
@ -142,6 +155,7 @@ type DutyCecorFlow struct {
TechnologicalProcess []TechnologicalProcessType `json:"technologicalprocess"` //流程 TechnologicalProcess []TechnologicalProcessType `json:"technologicalprocess"` //流程
FlowMapAll []commonus.FlowAllMap `json:"flowmapall"` //流程全貌 FlowMapAll []commonus.FlowAllMap `json:"flowmapall"` //流程全貌
LanMuName string `json:"lanmuname"` //前端栏目显示名称 LanMuName string `json:"lanmuname"` //前端栏目显示名称
Enclosure []EnclosureFormat `json:"enclosure"` //附件
} }
//审批流 //审批流
@ -173,10 +187,11 @@ type DivisiosibilityType struct {
//整改项目 //整改项目
type RectifMeasures struct { type RectifMeasures struct {
RecName string `json:"recname"` //整改人 RecName string `json:"recname"` //整改人
RecCont string `json:"reccont"` //整改内容 RecCont string `json:"reccont"` //整改内容
State int `json:"state"` //状态 State int `json:"state"` //状态
TimeVal string `json:"timeval"` //操作时间 TimeVal string `json:"timeval"` //操作时间
Enclosure []EnclosureFormat `json:"enclosure"` //附件
} }
//定量考核审批输出 //定量考核审批输出

7
gin_server_admin/api/v1/fileuploaddownload/fileupdowntype.go

@ -3,6 +3,7 @@ package fileuploaddownload
import ( import (
"bytes" "bytes"
"encoding/json" "encoding/json"
"fmt"
"io" "io"
"io/ioutil" "io/ioutil"
"mime/multipart" "mime/multipart"
@ -26,6 +27,8 @@ type UpLoadFileStruct struct {
CreatedAt time.Time `json:"CreatedAt"` CreatedAt time.Time `json:"CreatedAt"`
UpdatedAt time.Time `json:"UpdatedAt"` UpdatedAt time.Time `json:"UpdatedAt"`
FileSize int64 `json:"fileSize"` //大小 FileSize int64 `json:"fileSize"` //大小
Type int `json:"type"`
Size string `json:"size"`
} }
//文件基本属性 //文件基本属性
@ -111,8 +114,8 @@ func postFormDataWithSingleFile(filePath string, fileType int) (CallBackFileData
} }
// var CallBackFileData CallBackFileData // var CallBackFileData CallBackFileData
jsonErr := json.Unmarshal(b, &CallBackFileData) jsonErr := json.Unmarshal(b, &CallBackFileData)
// fmt.Println(string(b)) fmt.Println(string(b))
// fmt.Println(CallBackFileData) fmt.Println(CallBackFileData)
if jsonErr != nil { if jsonErr != nil {
CallBackFileData.Code = 105 CallBackFileData.Code = 105
// CallBackFileData.Msg = "解析返回数据失败!" // CallBackFileData.Msg = "解析返回数据失败!"

36
gin_server_admin/api/v1/fileuploaddownload/fileuploaddown.go

@ -1,6 +1,7 @@
package fileuploaddownload package fileuploaddownload
import ( import (
"fmt"
"os" "os"
"path" "path"
"strconv" "strconv"
@ -22,18 +23,27 @@ type urlData struct {
func (f *FileUploadDownload) LongRangeFileUpload(c *gin.Context) { func (f *FileUploadDownload) LongRangeFileUpload(c *gin.Context) {
_, fileHeader, fileErr := c.Request.FormFile("file") _, fileHeader, fileErr := c.Request.FormFile("file")
typePostForm := c.PostForm("type") typePostForm := c.PostForm("type")
var urlData urlData
// fmt.Printf("FileSize--------->%v\n", fileHeader.Size)
var urlData urlData
tageExt := path.Ext(fileHeader.Filename)
// fmt.Printf("Type------------------->%v\n", typePostForm)
if urlData.Type == 0 { if urlData.Type == 0 {
if typePostForm != "" { if typePostForm != "" {
typePostFormInt, _ := strconv.Atoi(typePostForm) typePostFormInt, _ := strconv.Atoi(typePostForm)
urlData.Type = typePostFormInt if typePostFormInt != 0 {
urlData.Type = typePostFormInt
} else {
urlData.Type = commonus.JudgeUpFileType(tageExt)
}
} else { } else {
urlData.Type = 1 // urlData.Type = 1
urlData.Type = commonus.JudgeUpFileType(tageExt)
} }
} }
// fmt.Printf("Type------------------->%v\n", urlData.Type)
if fileErr != nil { if fileErr != nil {
response.Result(101, fileHeader, "获取文件错误!", c) response.Result(101, fileHeader, "获取文件错误!", c)
return return
@ -44,14 +54,22 @@ func (f *FileUploadDownload) LongRangeFileUpload(c *gin.Context) {
// response.Result(0, fileHeader, "文件上传错误!", c) // response.Result(0, fileHeader, "文件上传错误!", c)
// return // return
// } // }
localFileSave := "uploads/" + fileHeader.Filename
transitionFileName := fmt.Sprintf("%v%v", commonus.GetFileNumberEs(), tageExt)
// fmt.Printf("转接------------>%v\n", transitionFileName)
// fmt.Printf("文件名长度------------>%v\n", len(fileHeader.Filename))
// localFileSave := "uploads/" + fileHeader.Filename
localFileSave := fmt.Sprintf("uploads/%v", transitionFileName)
// fmt.Printf("文件保存地址--1111->%v\n", localFileSave)
c.SaveUploadedFile(fileHeader, localFileSave) c.SaveUploadedFile(fileHeader, localFileSave)
// filePath := "G:/goobject/src/git_public/gin-vue-admin/gin_server_admin/go.mod" // filePath := "G:/goobject/src/git_public/gin-vue-admin/gin_server_admin/go.mod"
// strinUrl := "http://docu.hxgk.net/uploadfileing/uploadimging" // strinUrl := "http://docu.hxgk.net/uploadfileing/uploadimging"
// fmt.Printf("文件保存地址--->%v\n", localFileSave)
str, _ := os.Getwd() str, _ := os.Getwd()
filePath := str + "/" + localFileSave //文件转接物理地址 filePath := str + "/" + localFileSave //文件转接物理地址
// fmt.Printf("文件物理保存地址--->%v\n", filePath)
outPut := commonus.MapOut() outPut := commonus.MapOut()
// outPut["fileAttr"] = fileAttr // outPut["fileAttr"] = fileAttr
@ -59,7 +77,7 @@ func (f *FileUploadDownload) LongRangeFileUpload(c *gin.Context) {
fileCallBack := postFormDataWithSingleFile(filePath, urlData.Type) fileCallBack := postFormDataWithSingleFile(filePath, urlData.Type)
// outPut["msg"] = urlData // outPut["msg"] = urlData
if fileCallBack.Code != 0 && fileCallBack.Code != 1 { if fileCallBack.Code != 0 && fileCallBack.Code != 1 {
response.Result(102, outPut, fileCallBack.Msg, c) response.Result(102, fileCallBack, fileCallBack.Msg, c)
return return
} }
@ -72,10 +90,12 @@ func (f *FileUploadDownload) LongRangeFileUpload(c *gin.Context) {
upLoadFileStruct.UpdatedAt = time.Now() upLoadFileStruct.UpdatedAt = time.Now()
upLoadFileStruct.Key = fileCallBack.Data.NewName upLoadFileStruct.Key = fileCallBack.Data.NewName
upLoadFileStruct.Name = fileHeader.Filename upLoadFileStruct.Name = fileHeader.Filename
upLoadFileStruct.Tag = path.Ext(fileHeader.Filename) upLoadFileStruct.Tag = tageExt
upLoadFileStruct.Url = fileCallBack.Data.Callbackurl upLoadFileStruct.Url = fileCallBack.Data.Callbackurl
upLoadFileStruct.PhysicsPath = fileCallBack.Data.Physicspath upLoadFileStruct.PhysicsPath = fileCallBack.Data.Physicspath
upLoadFileStruct.FileSize = fileCallBack.Data.GetSize upLoadFileStruct.FileSize = fileCallBack.Data.GetSize
upLoadFileStruct.Type = urlData.Type
upLoadFileStruct.Size = commonus.FormatFileSize(fileCallBack.Data.GetSize)
// outPut["CallBackFileIng"] = postFormDataWithSingleFile(filePath, urlData.Type) // outPut["CallBackFileIng"] = postFormDataWithSingleFile(filePath, urlData.Type)
os.RemoveAll(filePath) //删除转接文件 os.RemoveAll(filePath) //删除转接文件

72
gin_server_admin/api/wechatapp/callback/updatehandle.go

@ -218,8 +218,16 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
// } else { // } else {
// quoteAreaTitle = fmt.Sprintf("扣除:%v%v\n", scoreFlowInfo.Score, programme.Unit) // quoteAreaTitle = fmt.Sprintf("扣除:%v%v\n", scoreFlowInfo.Score, programme.Unit)
// } // }
//生成唯一编号
registerNumber := commonus.GetFileNumberEs()
var registerCont assessmentmodel.Register
registerCont.Number = registerNumber
registerCont.State = 1
registerCont.Time = time.Now().Unix()
registerCont.AddCont()
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId) cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId)
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v", orderId) jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v&num=%v", orderId, strconv.FormatInt(registerNumber, 10))
jumpUrlTitle := "请前往处理" jumpUrlTitle := "请前往处理"
sourceDesc := "责任划分" sourceDesc := "责任划分"
// quoteAreaContent := programme // quoteAreaContent := programme
@ -290,13 +298,21 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
// } else { // } else {
// quoteAreaTitle = fmt.Sprintf("扣除:%v%v\n", flowContent.Score, unit) // quoteAreaTitle = fmt.Sprintf("扣除:%v%v\n", flowContent.Score, unit)
// } // }
//生成唯一编号
registerNumber := commonus.GetFileNumberEs()
var registerCont assessmentmodel.Register
registerCont.Number = registerNumber
registerCont.State = 1
registerCont.Time = time.Now().Unix()
registerCont.AddCont()
quoteAreaContent := flowContent.Reason quoteAreaContent := flowContent.Reason
twoLevelTitle := "部门负责人" twoLevelTitle := "部门负责人"
twoLevelKeyName := userContInfo.DepartmentName twoLevelKeyName := userContInfo.DepartmentName
twoLevelKeyValue := userContInfo.Name twoLevelKeyValue := userContInfo.Name
twoLevelUserId := t.FromUsername twoLevelUserId := t.FromUsername
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId) cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId)
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/rectification?id=%v", orderId) jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/rectification?id=%v&num=%v", orderId, strconv.FormatInt(registerNumber, 10))
jumpUrlTitle := "填写整改方案==============>GOTO" jumpUrlTitle := "填写整改方案==============>GOTO"
sourceDesc := "整改通知" sourceDesc := "整改通知"
var sendTextMsg sendmessage.TextNoticeTemplateMedium var sendTextMsg sendmessage.TextNoticeTemplateMedium
@ -607,13 +623,21 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
// } else { // } else {
// quoteAreaTitle = fmt.Sprintf("扣除:%v%v\n", flowContent.Score, unit) // quoteAreaTitle = fmt.Sprintf("扣除:%v%v\n", flowContent.Score, unit)
// } // }
//生成唯一编号
registerNumber := commonus.GetFileNumberEs()
var registerCont assessmentmodel.Register
registerCont.Number = registerNumber
registerCont.State = 1
registerCont.Time = time.Now().Unix()
registerCont.AddCont()
quoteAreaContent := flowContent.Reason quoteAreaContent := flowContent.Reason
twoLevelTitle := "部门负责人" twoLevelTitle := "部门负责人"
twoLevelKeyName := userContInfo.DepartmentName twoLevelKeyName := userContInfo.DepartmentName
twoLevelKeyValue := userContInfo.Name twoLevelKeyValue := userContInfo.Name
twoLevelUserId := t.FromUsername twoLevelUserId := t.FromUsername
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId) cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId)
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/qualitative?id=%v", orderId) jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/qualitative?id=%v&num=%v", orderId, strconv.FormatInt(registerNumber, 10))
jumpUrlTitle := "填写考核数据==============>GOTO" jumpUrlTitle := "填写考核数据==============>GOTO"
sourceDesc := "驳回" sourceDesc := "驳回"
taskId := strconv.FormatInt(commonus.GetFileNumberEs(), 10) taskId := strconv.FormatInt(commonus.GetFileNumberEs(), 10)
@ -674,8 +698,17 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
} }
} }
} }
//生成唯一编号
registerNumber := commonus.GetFileNumberEs()
var registerCont assessmentmodel.Register
registerCont.Number = registerNumber
registerCont.State = 1
registerCont.Time = time.Now().Unix()
registerCont.AddCont()
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId) cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId)
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v", orderId) jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v&num=%v", orderId, strconv.FormatInt(registerNumber, 10))
jumpUrlTitle := "请前往处理============>GOTO" jumpUrlTitle := "请前往处理============>GOTO"
sourceDesc := "驳回" sourceDesc := "驳回"
taskId := strconv.FormatInt(commonus.GetFileNumberEs(), 10) taskId := strconv.FormatInt(commonus.GetFileNumberEs(), 10)
@ -750,13 +783,21 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
} }
} }
} }
//生成唯一编号
registerNumber := commonus.GetFileNumberEs()
var registerCont assessmentmodel.Register
registerCont.Number = registerNumber
registerCont.State = 1
registerCont.Time = time.Now().Unix()
registerCont.AddCont()
// quoteAreaContent := flowContent.Reason // quoteAreaContent := flowContent.Reason
twoLevelTitle := "部门负责人" twoLevelTitle := "部门负责人"
twoLevelKeyName := userContInfo.DepartmentName twoLevelKeyName := userContInfo.DepartmentName
twoLevelKeyValue := userContInfo.Name twoLevelKeyValue := userContInfo.Name
twoLevelUserId := t.FromUsername twoLevelUserId := t.FromUsername
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId) cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId)
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/rectification?id=%v", orderId) jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/rectification?id=%v&num=%v", orderId, strconv.FormatInt(registerNumber, 10))
jumpUrlTitle := "重新填写整改方案==============>GOTO" jumpUrlTitle := "重新填写整改方案==============>GOTO"
sourceDesc := "驳回" sourceDesc := "驳回"
taskId := strconv.FormatInt(commonus.GetFileNumberEs(), 10) taskId := strconv.FormatInt(commonus.GetFileNumberEs(), 10)
@ -827,13 +868,21 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
} }
} }
} }
//生成唯一编号
registerNumber := commonus.GetFileNumberEs()
var registerCont assessmentmodel.Register
registerCont.Number = registerNumber
registerCont.State = 1
registerCont.Time = time.Now().Unix()
registerCont.AddCont()
// quoteAreaContent := flowContent.Reason // quoteAreaContent := flowContent.Reason
twoLevelTitle := "验收部门" twoLevelTitle := "验收部门"
twoLevelKeyName := userContInfo.DepartmentName twoLevelKeyName := userContInfo.DepartmentName
twoLevelKeyValue := userContInfo.Name twoLevelKeyValue := userContInfo.Name
twoLevelUserId := t.FromUsername twoLevelUserId := t.FromUsername
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId) cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId)
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/rectification?id=%v", orderId) jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/rectification?id=%v&num=%v", orderId, registerNumber)
jumpUrlTitle := "重新填写整改方案==============>GOTO" jumpUrlTitle := "重新填写整改方案==============>GOTO"
sourceDesc := "驳回" sourceDesc := "驳回"
var sendTextMsg sendmessage.TextNoticeTemplateMedium var sendTextMsg sendmessage.TextNoticeTemplateMedium
@ -884,12 +933,21 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
} }
} }
} }
//生成唯一编号
registerNumber := commonus.GetFileNumberEs()
var registerCont assessmentmodel.Register
registerCont.Number = registerNumber
registerCont.State = 1
registerCont.Time = time.Now().Unix()
registerCont.AddCont()
twoLevelTitle := "验收部门" twoLevelTitle := "验收部门"
twoLevelKeyName := userContInfo.DepartmentName twoLevelKeyName := userContInfo.DepartmentName
twoLevelKeyValue := userContInfo.Name twoLevelKeyValue := userContInfo.Name
twoLevelUserId := t.FromUsername twoLevelUserId := t.FromUsername
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId) cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId)
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/rectification?id=%v", orderId) jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/rectification?id=%v&num=%v", orderId, registerNumber)
jumpUrlTitle := "重新填写整改方案==============>GOTO" jumpUrlTitle := "重新填写整改方案==============>GOTO"
sourceDesc := "驳回" sourceDesc := "驳回"
sendUserSet := strings.Join(dutyOffUserList, "|") sendUserSet := strings.Join(dutyOffUserList, "|")

455
gin_server_admin/commonus/publichaneld.go

@ -1530,6 +1530,89 @@ func StepAddData(flowID, roleGroupId int64, nextStep, stepName, typeclass, state
} }
} }
func StepAddDataEs(flowID, roleGroupId int64, nextStep, stepName, typeclass, state, stepInt int, userKey string, encFile []EnclosureFormat) {
if state < 1 {
state = 1
}
var evalProCont assessmentmodel.EvaluationProcess
judgeErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", flowID).First(&evalProCont).Error
var flowStepAryMap []FlowStep
if judgeErr != nil {
var flowSteping FlowStep
flowSteping.Step = 1
flowSteping.StepName = GetSetpName(stepName) //步骤名称
flowSteping.Key = strconv.FormatInt(flowID, 10) //流程ID
flowSteping.State = 2 // (1:为操作;2:已操作;3:驳回)
flowSteping.RoleGroup = roleGroupId //角色组
flowSteping.NextStep = 2 //下一步 1:创建;2:创建人部门负责人审批:3:责任划分;4:责任部门审批;5:主要责任人整改;6:责任部门审批;7:验收
flowSteping.ClickName = userKey //操作人
flowSteping.AddTime = time.Now().Unix() //添加时间
flowStepAryMap = append(flowStepAryMap, flowSteping)
evalProCont.OrderKey = flowID
evalProCont.Step = 1
evalProCont.State = state
evalProCont.TypeClass = typeclass
evalProCont.Time = time.Now().Unix()
evalProCont.RoleGroup = roleGroupId
flowStepJson, flowStepErr := json.Marshal(flowStepAryMap)
if flowStepErr == nil {
evalProCont.Content = string(flowStepJson)
}
evalProCont.Participants = userKey
evalProCont.NextContent = IntegrationFlowAllEs(flowID, typeclass, encFile)
global.GVA_DB_Performanceappraisal.Create(&evalProCont)
} else {
var flowStepAry []FlowStep
var flowStepArys []FlowStep
json.Unmarshal([]byte(evalProCont.Content), &flowStepAry)
for _, f_v := range flowStepAry {
if f_v.Step == evalProCont.Step {
f_v.State = 2
}
flowStepArys = append(flowStepArys, f_v)
}
var flowStep FlowStep
flowStep.Step = evalProCont.Step + 1
flowStep.StepName = GetSetpName(stepName) //步骤名称
flowStep.Key = strconv.FormatInt(flowID, 10)
flowStep.State = 2
flowStep.RoleGroup = roleGroupId
flowStep.NextStep = nextStep
flowStep.ClickName = userKey
flowStep.AddTime = time.Now().Unix()
flowStepArys = append(flowStepArys, flowStep)
saveData := MapOut()
saveData["ep_time"] = time.Now().Unix()
saveData["ep_role_group"] = roleGroupId
saveData["ep_step"] = evalProCont.Step + 1
flowStepJson, flowStepErr := json.Marshal(flowStepArys)
if flowStepErr == nil {
saveData["ep_cont"] = string(flowStepJson)
}
saveData["ep_participants"] = fmt.Sprintf("%v,%v", evalProCont.Participants, userKey)
saveData["ep_state"] = state
saveData["ep_next_cont"] = InsetFlowLogEs(state, stepInt, userKey, evalProCont.NextContent, encFile)
fmt.Printf("Flow---Map:--->%v\n", saveData)
caozuoMap := MapOut()
caozuoMap["flowID"] = flowID
caozuoMap["roleGroupId"] = roleGroupId
caozuoMap["nextStep"] = nextStep
caozuoMap["stepName"] = stepName
caozuoMap["typeclass"] = typeclass
caozuoMap["state"] = state
caozuoMap["stepInt"] = stepInt
caozuoMap["userKey"] = userKey
caozuoMap["NextContent"] = evalProCont.NextContent
mapJson, _ := json.Marshal(caozuoMap)
fmt.Printf("Flow---Map:--Out---->%v\n", string(mapJson))
// flowID, roleGroupId int64, nextStep, stepName, typeclass, state, stepInt int, userKey string
EiteDutiesInfoes(evalProCont.Id, saveData)
}
}
//流程操作解析 //流程操作解析
/* /*
@state 状态 @state 状态
@ -1611,6 +1694,80 @@ func InsetFlowLog(state, stepInt int, userKey, flowMapStr string) (flowAllMap st
return return
} }
func InsetFlowLogEs(state, stepInt int, userKey, flowMapStr string, encFile []EnclosureFormat) (flowAllMap string) {
// fmt.Printf("Flow_log:--Begin-->%v-->%v\n", stepInt, flowMapStr)
var flowMap []FlowAllMap
jsonErr := json.Unmarshal([]byte(flowMapStr), &flowMap)
// fmt.Printf("Flow_log:--Begin---Err---->%v\n", jsonErr)
if jsonErr != nil {
flowAllMap = flowMapStr
return
}
// fmt.Printf("Flow_log:--Begin-1->%v-->%v", stepInt, flowMapStr)
var eiteFlowMap []FlowAllMap
for _, v := range flowMap {
var eiteFlowInfo FlowAllMap
eiteFlowInfo.Step = v.Step
eiteFlowInfo.NodeName = v.NodeName
if v.Step < stepInt {
eiteFlowInfo.State = 2
} else if v.Step == stepInt {
eiteFlowInfo.State = state
} else {
eiteFlowInfo.State = 1
}
eiteFlowInfo.Class = v.Class
// fmt.Printf("Flow_log:--Step-->%v-->%v\n", v.Step, stepInt)
if v.Step == stepInt {
var userClickAry []UserListFlowAll
for _, u_v := range v.UserList {
var userClick UserListFlowAll
userClick.Id = u_v.Id
userClick.Name = u_v.Name
userClick.Icon = u_v.Icon
userClick.Wechat = u_v.Wechat
userClick.Group = u_v.Group
userClick.GroupName = u_v.GroupName
userClick.DepartmentId = u_v.DepartmentId
userClick.DepartmentName = u_v.DepartmentName
userClick.WorkshopId = u_v.WorkshopId
userClick.WorkshopName = u_v.WorkshopName
userClick.PostId = u_v.PostId
userClick.PostName = u_v.PostName
userClick.Tema = u_v.Tema
userClick.TemaName = u_v.TemaName
userClick.Wechat = u_v.Wechat
// fmt.Printf("Flow_log:--UsekKey-->%v-->%v\n", u_v.Id, userKey)
if u_v.Id == userKey {
var logListMap LogList
logListMap.State = state
logListMap.TimeVal = GetToDayAll()
logListMap.Enclosure = encFile
userClick.LogList = append(userClick.LogList, logListMap)
}
userClickAry = append(userClickAry, userClick)
}
eiteFlowInfo.UserList = userClickAry
} else {
eiteFlowInfo.UserList = v.UserList
}
eiteFlowMap = append(eiteFlowMap, eiteFlowInfo)
}
jsonStr, jsonErrSet := json.Marshal(eiteFlowMap)
// fmt.Printf("Flow_log:--jsonErr-->%v-->%v\n", jsonErrSet, string(jsonStr))
if jsonErrSet == nil {
flowAllMap = string(jsonStr)
}
return
}
//写入责任分配节点人员信息 //写入责任分配节点人员信息
func WriteFlowMainSet(orderId int64, userKey []int64) { func WriteFlowMainSet(orderId int64, userKey []int64) {
fmt.Printf("Zeren--1-->%v\n", userKey) fmt.Printf("Zeren--1-->%v\n", userKey)
@ -1795,6 +1952,105 @@ func IntegrationFlowAll(flowID int64, class int) (flowAllMap string) {
return return
} }
func IntegrationFlowAllEs(flowID int64, class int, encFile []EnclosureFormat) (flowAllMap string) {
var flowMap []FlowAllMap
//1、创建
var oneFlowInfo FlowAllMap
oneFlowInfo.Step = 1
oneFlowInfo.NodeName = GetSetpName(1)
oneFlowInfo.State = 2
oneFlowInfo.Class = 1
oneFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 1, 1, encFile)
flowMap = append(flowMap, oneFlowInfo)
// fmt.Print("Flow_log:-->%v")
if class == 1 {
var scoreFlowCont assessmentmodel.ScoreFlow
flowLogErr := global.GVA_DB_Performanceappraisal.Where("sf_key = ?", flowID).First(&scoreFlowCont).Error
if flowLogErr == nil {
//2、创建人部门负责人审核
var twoFlowInfo FlowAllMap
twoFlowInfo.Step = 2
twoFlowInfo.NodeName = GetSetpName(2)
twoFlowInfo.State = 1
twoFlowInfo.Class = 1
twoFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 3, 2, encFile)
flowMap = append(flowMap, twoFlowInfo)
//3、被考核部门内勤进行责任划分
var threeFlowInfo FlowAllMap
threeFlowInfo.Step = 3
threeFlowInfo.NodeName = GetSetpName(3)
threeFlowInfo.State = 1
threeFlowInfo.Class = 1
threeFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 4, 2, encFile)
flowMap = append(flowMap, threeFlowInfo)
//4、被考核部门负责人对责任划分确认
var fourFlowInfo FlowAllMap
fourFlowInfo.Step = 4
fourFlowInfo.NodeName = GetSetpName(7)
fourFlowInfo.State = 1
fourFlowInfo.Class = 1
fourFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 5, 2, encFile)
flowMap = append(flowMap, fourFlowInfo)
if scoreFlowCont.Rectification == 1 {
//5、整改人节点。由内勤指定
var fiveFlowInfo FlowAllMap
fiveFlowInfo.Step = 5
fiveFlowInfo.NodeName = GetSetpName(4)
fiveFlowInfo.State = 1
fiveFlowInfo.Class = 2
// fiveFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 5,encFile)
flowMap = append(flowMap, fiveFlowInfo)
//6、被考核部门负责人对整改措施确认
var sixFlowInfo FlowAllMap
sixFlowInfo.Step = 6
sixFlowInfo.NodeName = GetSetpName(7)
sixFlowInfo.State = 1
sixFlowInfo.Class = 1
sixFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 5, 2, encFile)
flowMap = append(flowMap, sixFlowInfo)
//7、发起人验收
var serverFlowInfo FlowAllMap
serverFlowInfo.Step = 7
serverFlowInfo.NodeName = GetSetpName(5)
serverFlowInfo.State = 1
serverFlowInfo.Class = 1
serverFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 1, 2, encFile)
flowMap = append(flowMap, serverFlowInfo)
} else {
//5、发起人验收
var serverEsFlowInfo FlowAllMap
serverEsFlowInfo.Step = 5
serverEsFlowInfo.NodeName = GetSetpName(5)
serverEsFlowInfo.State = 1
serverEsFlowInfo.Class = 1
serverEsFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 1, 2, encFile)
flowMap = append(flowMap, serverEsFlowInfo)
}
}
} else {
//定量
//1、创建
var twoFlowInfo FlowAllMap
twoFlowInfo.Step = 2
twoFlowInfo.NodeName = GetSetpName(7)
twoFlowInfo.State = 1
twoFlowInfo.Class = 1
twoFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 5, 2, encFile)
flowMap = append(flowMap, twoFlowInfo)
}
flowAllMapByte, eer := json.Marshal(flowMap)
if eer == nil {
flowAllMap = string(flowAllMapByte)
}
return
}
//获取节点操作人 //获取节点操作人
/* /*
@flowID 流程ID @flowID 流程ID
@ -1960,6 +2216,166 @@ func GetFlowNodeMan(flowID int64, class, style, writeLog int) (manInfo []UserLis
return return
} }
func GetFlowNodeManEs(flowID int64, class, style, writeLog int, encFile []EnclosureFormat) (manInfo []UserListFlowAll) {
var goDu FlowNodePeopleInfo
if class == 1 {
var scoreFlowCont assessmentmodel.ScoreFlow
flowLogErr := global.GVA_DB_Performanceappraisal.Where("sf_key = ?", flowID).First(&scoreFlowCont).Error
if flowLogErr == nil {
goDu.EvalCont.Group = scoreFlowCont.EvaluationGroup
goDu.EvalCont.DepartmentId = scoreFlowCont.EvaluationDepartment
goDu.EvalCont.Id = strconv.FormatInt(scoreFlowCont.EvaluationUser, 10)
goDu.DutyCont.Group = scoreFlowCont.DutyGroup
goDu.DutyCont.DepartmentId = scoreFlowCont.DutyDepartment
}
} else {
var flowCont assessmentmodel.FlowLog
flowLogErrs := global.GVA_DB_Performanceappraisal.Where("fl_key = ?", flowID).First(&flowCont).Error
if flowLogErrs == nil {
goDu.EvalCont.Group = flowCont.EvaluationGroup
goDu.EvalCont.DepartmentId = flowCont.EvaluationDepartment
goDu.EvalCont.Id = strconv.FormatInt(flowCont.EvaluationUser, 10)
goDu.DutyCont.Group = flowCont.DutyGroup
goDu.DutyCont.DepartmentId = flowCont.DutyDepartment
}
}
//1、测评人;2,测评人部门内勤;3、测评人部门负责人;4、被测评部门内勤;5、被测评部门负责人
switch style {
case 2:
sendUserIsTrue, sendUserList := GetSendMsgUserAry(16118387069540343, goDu.EvalCont.DepartmentId)
if sendUserIsTrue == true {
for _, v := range sendUserList {
_, userCont := GetUesrContForWechatID(v)
var returnUser UserListFlowAll
returnUser.Id = strconv.FormatInt(userCont.Key, 10)
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
returnUser.DepartmentName = userCont.DepartmentName
returnUser.WorkshopId = userCont.WorkshopId
returnUser.WorkshopName = userCont.WorkshopName
returnUser.PostId = userCont.PostId
returnUser.PostName = userCont.PostName
returnUser.Tema = userCont.Tema
returnUser.TemaName = userCont.TemaName
returnUser.Wechat = userCont.WechatId
manInfo = append(manInfo, returnUser)
}
}
case 3:
sendUserIsTrue, sendUserList := GetSendMsgUserAry(16182159043990656, goDu.EvalCont.DepartmentId)
if sendUserIsTrue == true {
for _, v := range sendUserList {
_, userCont := GetUesrContForWechatID(v)
var returnUser UserListFlowAll
returnUser.Id = strconv.FormatInt(userCont.Key, 10)
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
returnUser.DepartmentName = userCont.DepartmentName
returnUser.WorkshopId = userCont.WorkshopId
returnUser.WorkshopName = userCont.WorkshopName
returnUser.PostId = userCont.PostId
returnUser.PostName = userCont.PostName
returnUser.Tema = userCont.Tema
returnUser.TemaName = userCont.TemaName
returnUser.Wechat = userCont.WechatId
manInfo = append(manInfo, returnUser)
}
}
case 4:
sendUserIsTrue, sendUserList := GetSendMsgUserAry(16118387069540343, goDu.DutyCont.DepartmentId)
if sendUserIsTrue == true {
for _, v := range sendUserList {
_, userCont := GetUesrContForWechatID(v)
var returnUser UserListFlowAll
returnUser.Id = strconv.FormatInt(userCont.Key, 10)
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
returnUser.DepartmentName = userCont.DepartmentName
returnUser.WorkshopId = userCont.WorkshopId
returnUser.WorkshopName = userCont.WorkshopName
returnUser.PostId = userCont.PostId
returnUser.PostName = userCont.PostName
returnUser.Tema = userCont.Tema
returnUser.TemaName = userCont.TemaName
returnUser.Wechat = userCont.WechatId
manInfo = append(manInfo, returnUser)
}
}
case 5:
sendUserIsTrue, sendUserList := GetSendMsgUserAry(16182159043990656, goDu.DutyCont.DepartmentId)
if sendUserIsTrue == true {
for _, v := range sendUserList {
_, userCont := GetUesrContForWechatID(v)
var returnUser UserListFlowAll
returnUser.Id = strconv.FormatInt(userCont.Key, 10)
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
returnUser.DepartmentName = userCont.DepartmentName
returnUser.WorkshopId = userCont.WorkshopId
returnUser.WorkshopName = userCont.WorkshopName
returnUser.PostId = userCont.PostId
returnUser.PostName = userCont.PostName
returnUser.Tema = userCont.Tema
returnUser.TemaName = userCont.TemaName
returnUser.Wechat = userCont.WechatId
manInfo = append(manInfo, returnUser)
}
}
default:
var returnUser UserListFlowAll
userCont, _ := GetWorkUser(goDu.EvalCont.Id)
returnUser.Id = goDu.EvalCont.Id
returnUser.Name = userCont.Name
returnUser.Icon = userCont.Icon
returnUser.Group = userCont.Group
_, groupCont := GetGroupCont(userCont.Group)
returnUser.GroupName = groupCont.Name
returnUser.DepartmentId = userCont.DepartmentId
_, bfInfo := GetBranchFactory(userCont.DepartmentId)
returnUser.DepartmentName = bfInfo.Name
returnUser.WorkshopId = userCont.WorkshopId
_, wsInfo := GetWorkShopSection(userCont.WorkshopId)
returnUser.WorkshopName = wsInfo.Name
returnUser.PostId = userCont.PostId
_, posCont := GetPosition(userCont.PostId)
returnUser.PostName = posCont.Name
returnUser.Tema = userCont.Tema
_, temCont := GetTeaming(userCont.Tema)
returnUser.TemaName = temCont.Name
returnUser.Wechat = userCont.WechatId
if writeLog == 1 {
// oneFlowInfo?
var logListMap LogList
logListMap.State = 2
logListMap.TimeVal = GetToDayAll()
logListMap.Enclosure = encFile
returnUser.LogList = append(returnUser.LogList, logListMap)
}
manInfo = append(manInfo, returnUser)
}
return
}
//编辑流程步进器 //编辑流程步进器
func EiteDutiesInfoes(saveId int64, saveData map[string]interface{}) (isTrue bool, infoErr error) { func EiteDutiesInfoes(saveId int64, saveData map[string]interface{}) (isTrue bool, infoErr error) {
@ -2789,3 +3205,42 @@ func ChinaToPinYinFirstWord(wordStr string) (firstWord string) {
} }
return return
} }
//判断文件上传的TYPE
func JudgeUpFileType(extTage string) int {
images := []string{".jpg", ".jpeg", ".png", ".gif", ".bmp", ".avif", ".webp", ".tif", ".pcx", ".tga", ".exif", ".fpx", ".svg", ".psd", ".cdr", ".pcd", ".dxf", ".ufo", ".hdri", ".eps", ".flic", ".ai", ".ico", ".emf", ".raw", ".WMF", ".avif", ".apng", ".Webp", ".BMP", ".PCX", ".TIF", ".GIF", ".JPEG", ".JPG", ".TGA", ".EXIF", ".FPX", ".SVG", ".PSD", ".CDR", ".PCD", ".DXF", ".UFO", ".EPS", ".AI", ".PNG", ".HDRI", ".RAW", ".WMF", ".FLIC", ".EMF", ".APNG", ".ICO"}
videoExt := []string{".mp4", ".avi", ".3gp", ".flv", ".rm", ".rmvb", ".wmv", ".mpeg", ".mpeg1", ".mpeg2", ".divx", ".xvid", ".dv", ".mkv", ".asf", ".asx", ".mov", ".m4v", ".dat", ".mkv", ".vob", ".ogg", ".mod", ".MP4", ".3GP", ".AVI", ".RM", ".RMVB", ".WMV", ".MPEG", ".MPEG1", ".MPEG2", ".DivX", ".XVID", ".DV", ".MKV", ".MOV", ".OGG", ".MOD", ".M4V", ".DAT", ".VOB"}
officeExt := []string{".doc", ".docx", ".xml", ".xls", ".xlsx", ".ppt", ".pptx", ".pot", ".PPS", ".dot", ".mht", ".xlt"}
zipExt := []string{".rar", ".zip", ".7z", ".ar", ".bz", ".car", ".dar", ".cpgz", ".f", ".ha"}
if IsItTrueString(extTage, images) == true {
return 1
}
if IsItTrueString(extTage, videoExt) == true {
return 2
}
if IsItTrueString(extTage, officeExt) == true {
return 3
}
if IsItTrueString(extTage, zipExt) == true {
return 4
}
return 5
}
// 字节的单位转换 保留两位小数
func FormatFileSize(fileSize int64) (size string) {
if fileSize < 1024 {
//return strconv.FormatInt(fileSize, 10) + "B"
return fmt.Sprintf("%.2fB", float64(fileSize)/float64(1))
} else if fileSize < (1024 * 1024) {
return fmt.Sprintf("%.2fKB", float64(fileSize)/float64(1024))
} else if fileSize < (1024 * 1024 * 1024) {
return fmt.Sprintf("%.2fMB", float64(fileSize)/float64(1024*1024))
} else if fileSize < (1024 * 1024 * 1024 * 1024) {
return fmt.Sprintf("%.2fGB", float64(fileSize)/float64(1024*1024*1024))
} else if fileSize < (1024 * 1024 * 1024 * 1024 * 1024) {
return fmt.Sprintf("%.2fTB", float64(fileSize)/float64(1024*1024*1024*1024))
} else { //if fileSize < (1024 * 1024 * 1024 * 1024 * 1024 * 1024)
return fmt.Sprintf("%.2fEB", float64(fileSize)/float64(1024*1024*1024*1024*1024))
}
}

12
gin_server_admin/commonus/publicstruct.go

@ -116,8 +116,9 @@ type UserListFlowAll struct {
//节点操作人操作记录 //节点操作人操作记录
type LogList struct { type LogList struct {
State int `json:"state"` //状态 1、未操作;2、通过;3、驳回 State int `json:"state"` //状态 1、未操作;2、通过;3、驳回
TimeVal string `json:"time"` TimeVal string `json:"time"`
Enclosure []EnclosureFormat `json:"enclosure"` //附件
} }
//流程操作节点操作人信息 //流程操作节点操作人信息
@ -130,3 +131,10 @@ type DepartmentAryType struct {
Parentid string `json:"parentid"` Parentid string `json:"parentid"`
Parentname string `json:"parentname"` Parentname string `json:"parentname"`
} }
//附件格式
type EnclosureFormat struct {
FileName string `json:"filename"` //附件名称
FilePath string `json:"filepath"` //附件地址
Type int `json:"type"` //附件类型
}

16
gin_server_admin/config.yaml

@ -311,6 +311,18 @@ mysqlWechatCallBack:
log-mode: false log-mode: false
log-zap: "" log-zap: ""
#HR系统
hrdatabase:
path: '127.0.0.1:3306'
config: 'charset=utf8mb4&parseTime=True&loc=Local'
db-name: 'human_resources'
username: 'root'
password: 'root'
max-idle-conns: 100
max-open-conns: 1500
log-mode: false
log-zap: ""
#企业微信相关设置 #企业微信相关设置
workwechatid: workwechatid:
@ -359,8 +371,8 @@ healthreports: #健康上报
secretstr: 'smjpGmFo5wp18BZGiLaECFr84Blv429v_GFdKp4_0YQ' secretstr: 'smjpGmFo5wp18BZGiLaECFr84Blv429v_GFdKp4_0YQ'
privateConfig: #私人配置 privateConfig: #私人配置
visit: 'http://docu.hxgk.net/uploadfileing/uploadimging' # visit: 'http://docu.hxgk.net/uploadfileing/uploadimging'
# visit: 'http://docs.hxgk.group/uploadfileing/uploadimging' visit: 'http://docs.hxgk.group/uploadfileing/uploadimging'
appKey: 'heng_xin_gao_ke_AppKey' appKey: 'heng_xin_gao_ke_AppKey'

1
gin_server_admin/config/config.go

@ -29,6 +29,7 @@ type Server struct {
MysqlApprovalProcess Mysql `mapstructure:"mysqlApprovalProcess" json:"mysqlApprovalProcess" yaml:"mysqlApprovalProcess"` MysqlApprovalProcess Mysql `mapstructure:"mysqlApprovalProcess" json:"mysqlApprovalProcess" yaml:"mysqlApprovalProcess"`
MysqlPerformanceappraisal Mysql `mapstructure:"mysqlPerformanceappraisal" json:"mysqlPerformanceappraisal" yaml:"mysqlPerformanceappraisal"` MysqlPerformanceappraisal Mysql `mapstructure:"mysqlPerformanceappraisal" json:"mysqlPerformanceappraisal" yaml:"mysqlPerformanceappraisal"`
MysqlWechatCallBack Mysql `mapstructure:"mysqlWechatCallBack" json:"mysqlWechatCallBack" yaml:"mysqlWechatCallBack"` MysqlWechatCallBack Mysql `mapstructure:"mysqlWechatCallBack" json:"mysqlWechatCallBack" yaml:"mysqlWechatCallBack"`
HrDataBase Mysql `mapstructure:"hrdatabase" json:"hrdatabase" yaml:"hrdatabase"`
// oss // oss
Local Local `mapstructure:"local" json:"local" yaml:"local"` Local Local `mapstructure:"local" json:"local" yaml:"local"`

1
gin_server_admin/global/global.go

@ -41,6 +41,7 @@ var (
GVA_DB_ApprovalProcess *gorm.DB GVA_DB_ApprovalProcess *gorm.DB
GVA_DB_Performanceappraisal *gorm.DB GVA_DB_Performanceappraisal *gorm.DB
GVA_DB_WechatCallBack *gorm.DB GVA_DB_WechatCallBack *gorm.DB
GVA_DB_HrDataBase *gorm.DB
//企业微信专用redis //企业微信专用redis
GVA_REDIS_WeChat *redis.Client GVA_REDIS_WeChat *redis.Client

2
gin_server_admin/initialize/gorm.go

@ -158,6 +158,8 @@ func GormMysqlChange(setDataBaseName string) *gorm.DB {
m = global.GVA_CONFIG.MysqlPerformanceappraisal m = global.GVA_CONFIG.MysqlPerformanceappraisal
case "mysqlWechatCallBack": case "mysqlWechatCallBack":
m = global.GVA_CONFIG.MysqlWechatCallBack m = global.GVA_CONFIG.MysqlWechatCallBack
case "hrdatabase":
m = global.GVA_CONFIG.HrDataBase
default: default:
m = global.GVA_CONFIG.Mysql m = global.GVA_CONFIG.Mysql
} }

5
gin_server_admin/main.go

@ -89,6 +89,11 @@ func main() {
fmt.Printf("%v==>数据库mysqlWechatCallBack初始化成功\n", global.GVA_DB_WechatCallBack) fmt.Printf("%v==>数据库mysqlWechatCallBack初始化成功\n", global.GVA_DB_WechatCallBack)
} }
global.GVA_DB_HrDataBase = initialize.GormMysqlChange("hrdatabase")
if global.GVA_DB_Performanceappraisal != nil {
fmt.Printf("%v==>hrdatabase\n", global.GVA_DB_HrDataBase)
}
scheduledtask.TimeTask() scheduledtask.TimeTask()
// fmt.Printf("WEiXin------>%v===>%v----->%v----->%v\n", global.GVA_CONFIG.WorkWechatId, global.GVA_CONFIG.WorkWechatSchool, global.GVA_CONFIG.WorkWechatMailList, global.GVA_CONFIG.WorkHealthReport) // fmt.Printf("WEiXin------>%v===>%v----->%v----->%v\n", global.GVA_CONFIG.WorkWechatId, global.GVA_CONFIG.WorkWechatSchool, global.GVA_CONFIG.WorkWechatMailList, global.GVA_CONFIG.WorkHealthReport)
// fmt.Printf("jkskd => %v===>%v----->%v\n", global.GVA_CONFIG.MyConfig.AppKey, global.GVA_CONFIG.MyConfig.Visit, global.GVA_CONFIG) // fmt.Printf("jkskd => %v===>%v----->%v\n", global.GVA_CONFIG.MyConfig.AppKey, global.GVA_CONFIG.MyConfig.Visit, global.GVA_CONFIG)

1
gin_server_admin/middleware/myjwt.go

@ -136,6 +136,7 @@ func SystemAuthentication() gin.HandlerFunc {
c.Abort() c.Abort()
return return
} }
userAgent = "250"
var md5JiaMi commonus.Md5Encryption var md5JiaMi commonus.Md5Encryption
md5JiaMi.Md5EncryptionInit(userAgent) md5JiaMi.Md5EncryptionInit(userAgent)
md5Token := md5JiaMi.Md5EncryptionAlgorithm() md5Token := md5JiaMi.Md5EncryptionAlgorithm()

38
gin_server_admin/model/assessmentmodel/dutyclass.go

@ -1,5 +1,7 @@
package assessmentmodel package assessmentmodel
import "github.com/flipped-aurora/gin-vue-admin/server/global"
//职责类别 //职责类别
type DutyClass struct { type DutyClass struct {
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id"` Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id"`
@ -192,6 +194,16 @@ type EvaluationTarget struct {
func (EvaluationTarget *EvaluationTarget) TableName() string { func (EvaluationTarget *EvaluationTarget) TableName() string {
return "evaluationtarget" return "evaluationtarget"
} }
func (e *EvaluationTarget) GetCont(whereAry interface{}, filed ...string) error {
gormDb := global.GVA_DB_Performanceappraisal.Model(&e)
if len(filed) > 0 {
for _, v := range filed {
gormDb = gormDb.Select(v)
}
}
err := gormDb.Where(whereAry).First(&e).Error
return err
}
//定性测评指标子栏目 //定性测评指标子栏目
type QualitativeTarget struct { type QualitativeTarget struct {
@ -220,6 +232,11 @@ type DetailedTarget struct {
MaxScore int64 `json:"maxscore" gorm:"column:dt_max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"` MaxScore int64 `json:"maxscore" gorm:"column:dt_max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"`
Company string `json:"company" gorm:"column:dt_company;type:varchar(20) unsigned;default:0;not null;comment:单位"` Company string `json:"company" gorm:"column:dt_company;type:varchar(20) unsigned;default:0;not null;comment:单位"`
AddReduce int `json:"addreduce" gorm:"column:dt_add_reduce;type:int(1) unsigned;default:1;not null;comment:1:减少;2:增加;3:无属性,现场确认加或减"` AddReduce int `json:"addreduce" gorm:"column:dt_add_reduce;type:int(1) unsigned;default:1;not null;comment:1:减少;2:增加;3:无属性,现场确认加或减"`
CensorType int `json:"censortype" gorm:"column:dt_censor_type;type:tinyint(1) unsigned;default:1;not null;comment:检查方式"`
CensorCont string `json:"censorcont" gorm:"column:dt_censor_cont;type:longtext;comment:检查依据"`
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:辅助计数"`
} }
func (DetailedTarget *DetailedTarget) TableName() string { func (DetailedTarget *DetailedTarget) TableName() string {
@ -266,6 +283,9 @@ type QualitativeEvaluation struct {
Content string `json:"content" gorm:"column:qe_content;type:text;comment:补充说明"` Content string `json:"content" gorm:"column:qe_content;type:text;comment:补充说明"`
MinScore int64 `json:"minscore" gorm:"column:qe_min_score;type:bigint(20) unsigned;default:0;not null;comment:最小分*100保存"` MinScore int64 `json:"minscore" gorm:"column:qe_min_score;type:bigint(20) unsigned;default:0;not null;comment:最小分*100保存"`
MaxScore int64 `json:"maxscore" gorm:"column:qe_max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"` MaxScore int64 `json:"maxscore" gorm:"column:qe_max_score;type:bigint(20) unsigned;default:0;not null;comment:最大分*100保存"`
CensorType int `json:"censortype" gorm:"column:qe_censor_type;type:tinyint(1) unsigned;default:1;not null;comment:检查方式"`
CensorCont string `json:"censorcont" gorm:"column:qe_censor_cont;type:longtext;comment:检查依据"`
CensorRate int `json:"censorrate" gorm:"column:qe_censor_rate;type:int(5) unsigned;default:1;not null;comment:检查频次"`
} }
func (QualitativeEvaluation *QualitativeEvaluation) TableName() string { func (QualitativeEvaluation *QualitativeEvaluation) TableName() string {
@ -402,3 +422,21 @@ type PlanVersio struct {
func (PlanVersio *PlanVersio) TableName() string { func (PlanVersio *PlanVersio) TableName() string {
return "plan_versio" return "plan_versio"
} }
//考核方案版本管理
type PositionPlanVersio struct {
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"`
Group int64 `json:"group" gorm:"column:group;type:bigint(20) unsigned;default:0;not null;comment:归属集团"`
Department int64 `json:"department" gorm:"column:department;type:bigint(20) unsigned;default:0;comment:归属部门"`
Position int64 `json:"position" gorm:"column:position;type:bigint(20) unsigned;default:0;comment:归属岗位"`
Key string `json:"key" gorm:"column:key;type:varchar(200) unsigned;default:0;not null;comment:编码"`
Versio string `json:"versio" gorm:"column:versio;type:varchar(20) unsigned;default:0;not null;comment:版本号"`
Year int64 `json:"year" gorm:"column:years;type:int(5) unsigned;default:0;not null;comment:年度"`
State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"`
AddTime int64 `json:"addtime" gorm:"column:addtime;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
EiteTime int64 `json:"eitetime" gorm:"column:eitetime;type:bigint(20) unsigned;default:0;not null;comment:修改时间"`
}
func (PositionPlanVersio *PositionPlanVersio) TableName() string {
return "position_plan_version"
}

42
gin_server_admin/model/assessmentmodel/performance_appraisal.go

@ -1,5 +1,11 @@
package assessmentmodel package assessmentmodel
import (
"strings"
"github.com/flipped-aurora/gin-vue-admin/server/global"
)
//分数流水 //分数流水
type ScoreFlow struct { type ScoreFlow struct {
Id int64 `json:"id" gorm:"primaryKey;column:sf_id;type:bigint(20) unsigned;not null;comment:Id"` Id int64 `json:"id" gorm:"primaryKey;column:sf_id;type:bigint(20) unsigned;not null;comment:Id"`
@ -89,3 +95,39 @@ type RectificationMeasures struct {
func (RectificationMeasures *RectificationMeasures) TableName() string { func (RectificationMeasures *RectificationMeasures) TableName() string {
return "rectification_measures" return "rectification_measures"
} }
//挂号
type Register struct {
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null"`
Number int64 `json:"userkey" gorm:"column:number;type:bigint(20) unsigned;default:0;not null;comment:号码"`
State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:1:正常;2:已经使用"`
Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
}
func (Register *Register) TableName() string {
return "register"
}
//添加
func (r *Register) AddCont() (err error) {
err = global.GVA_DB_Performanceappraisal.Create(&r).Error
return
}
//编辑内容
func (r *Register) EiteCont(whereMap interface{}, saveData interface{}) (err error) {
err = global.GVA_DB_Performanceappraisal.Model(&r).Where(whereMap).Updates(saveData).Error
return
}
//获取内容
func (r *Register) GetCont(whereMap interface{}, field ...string) (err error) {
gormDb := global.GVA_DB_Performanceappraisal.Model(&r)
if len(field) > 0 {
fieldStr := strings.Join(field, ",")
gormDb = gormDb.Select(fieldStr)
}
gormDb = gormDb.Where(whereMap)
err = gormDb.First(&r).Error
return
}

48
gin_server_admin/model/hrsystem/administrative_organization.go

@ -0,0 +1,48 @@
package hrsystem
import (
"strings"
"github.com/flipped-aurora/gin-vue-admin/server/global"
)
//行政组织
type AdministrativeOrganization 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(50) unsigned;default:'';not null;comment:行政编码"`
Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:组织名称"`
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:行政组织类型"`
Abbreviation string `json:"abbreviation" gorm:"column:abbreviation;type:varchar(255) unsigned;default:'';not null;comment:行政组织简称"`
Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"`
WechatOrganizationId int64 `json:"wechatorganizationid" gorm:"column:wechat_organization_id;type:bigint(20) unsigned;default:0;not null;comment:微信组织架构对照码"`
}
func (AdministrativeOrganization *AdministrativeOrganization) TableName() string {
return "administrative_organization"
}
//编辑行政组织内容
func (cont *AdministrativeOrganization) EiteCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) {
err = global.GVA_DB_HrDataBase.Model(&cont).Where(whereMap).Updates(saveData).Error
return
}
//获取行政组织内容
func (cont *AdministrativeOrganization) GetCont(whereMap map[string]interface{}, field ...string) (err error) {
gormDb := global.GVA_DB_HrDataBase.Model(&cont)
if len(field) > 0 {
fieldStr := strings.Join(field, ",")
gormDb = gormDb.Select(fieldStr)
}
gormDb = gormDb.Where(whereMap)
err = gormDb.First(&cont).Error
return
}
//根据条件获取总数
func (cont *AdministrativeOrganization) CountCont(whereMap map[string]interface{}) (countId int64) {
global.GVA_DB_HrDataBase.Model(&cont).Where(whereMap).Count(&countId)
return
}

38
gin_server_admin/model/hrsystem/administrative_organization_type.go

@ -0,0 +1,38 @@
package hrsystem
import (
"strings"
"github.com/flipped-aurora/gin-vue-admin/server/global"
)
//行政组织类型
type AdministrativeOrganizationType struct {
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"`
Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:类型名称"`
Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"`
Level int64 `json:"level" gorm:"column:level;type:int(5) unsigned;default:1;not null;comment:级别"`
}
func (AdministrativeOrganizationType *AdministrativeOrganizationType) TableName() string {
return "administrative_organization_type"
}
//编辑职务分类内容
func (cont *AdministrativeOrganizationType) EiteCont(whereMap interface{}, saveData map[string]interface{}) (err error) {
err = global.GVA_DB_HrDataBase.Model(&cont).Where(whereMap).Updates(saveData).Error
return
}
//获取详细内容
func (cont *AdministrativeOrganizationType) GetCont(whereMap interface{}, field ...string) (err error) {
gormDb := global.GVA_DB_HrDataBase.Model(&cont)
if len(field) > 0 {
fieldStr := strings.Join(field, ",")
gormDb = gormDb.Select(fieldStr)
}
gormDb = gormDb.Where(whereMap)
err = gormDb.First(&cont).Error
return
}

24
gin_server_admin/model/hrsystem/duties.go

@ -0,0 +1,24 @@
package hrsystem
import "github.com/flipped-aurora/gin-vue-admin/server/global"
//职务
type Duties struct {
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"`
Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:职务名称"`
JobType int64 `json:"jobtype" gorm:"column:job_type;type:bigint(20) unsigned;default:0;not null;comment:归属职务类型"`
Weight int64 `json:"weight" gorm:"column:weight;type:bigint(20) unsigned;default:1;not null;comment:权重"`
Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
Number string `json:"number" gorm:"column:number;type:varchar(50) unsigned;default:'';not null;comment:编码"`
State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"`
}
func (Duties *Duties) TableName() string {
return "duties"
}
//编辑职务分类内容
func (Duties *Duties) EiteCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) {
err = global.GVA_DB_HrDataBase.Model(&Duties).Where(whereMap).Updates(saveData).Error
return
}

21
gin_server_admin/model/hrsystem/job_class.go

@ -0,0 +1,21 @@
package hrsystem
import "github.com/flipped-aurora/gin-vue-admin/server/global"
//职务分类
type JobClass struct {
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id;index"`
Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:职务分类名称"`
Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"`
}
func (JobClass *JobClass) TableName() string {
return "job_class"
}
//编辑职务分类内容
func (JobClass *JobClass) EiteJobClassCont(whereMap map[string]interface{}, saveData map[string]interface{}) (err error) {
err = global.GVA_DB_HrDataBase.Model(&JobClass).Where(whereMap).Updates(saveData).Error
return
}

49
gin_server_admin/model/hrsystem/position.go

@ -0,0 +1,49 @@
package hrsystem
import (
"strings"
"github.com/flipped-aurora/gin-vue-admin/server/global"
)
//职位(岗位)
type Position 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(50) unsigned;default:'';not null;comment:职位编码"`
Name string `json:"name" gorm:"column:name;type:varchar(255) unsigned;default:'';not null;comment:职位名称"`
Duties int64 `json:"duties" gorm:"column:duties;type:bigint(20) unsigned;default:0;not null;comment:职务"`
Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"`
AdministrativeOrganization int64 `json:"administrativeorganization" gorm:"column:administrative_organization;type:bigint(20) unsigned;default:0;not null;comment:归属行政组织"`
Superior int64 `json:"superior" gorm:"column:superior;type:bigint(20) unsigned;default:0;not null;comment:上级ID"`
PersonInCharge int `json:"personincharge" gorm:"column:person_in_charge;type:int(1) unsigned;default:2;not null;comment:是否为本部门负责人(1:是;2:否)"`
Department int64 `json:"department" gorm:"column:department;type:bigint(20) unsigned;default:0;not null;comment:部门"`
}
func (Position *Position) TableName() string {
return "position"
}
//编辑职务分类内容
func (cont *Position) EiteCont(whereMap interface{}, saveData interface{}) (err error) {
err = global.GVA_DB_HrDataBase.Model(&cont).Where(whereMap).Updates(saveData).Error
return
}
//获取行政组织内容
func (cont *Position) GetCont(whereMap interface{}, field ...string) (err error) {
gormDb := global.GVA_DB_HrDataBase.Model(&cont)
if len(field) > 0 {
fieldStr := strings.Join(field, ",")
gormDb = gormDb.Select(fieldStr)
}
gormDb = gormDb.Where(whereMap)
err = gormDb.First(&cont).Error
return
}
//根据条件获取总数
func (cont *Position) CountCont(whereMap interface{}) (countId int64) {
global.GVA_DB_HrDataBase.Model(&cont).Where(whereMap).Count(&countId)
return
}

17
gin_server_admin/model/systemuser/systemuser.go

@ -82,3 +82,20 @@ type RedisAdminInfo struct {
Role string `json:"role"` Role string `json:"role"`
RoleName string `json:"roleName"` RoleName string `json:"roleName"`
} }
type RedisAdminInfoNew struct {
UserKey string `json:"userkey"`
UserNumber string `json:"usernumber"`
UserPwd string `json:"userpwd"`
UserToken string `json:"usertoken"`
JurisDiction string `json:"jurisdiction"`
MenuOper string `json:"menuOper"`
Wand string `json:"wand"`
Name string `json:"name"`
GroupName string `json:"groupname"`
Group string `json:"group"`
AttriBute string `json:"attribute"`
BranchFactoryName string `json:"branchfactoryname"`
Role string `json:"role"`
RoleName string `json:"roleName"`
}

2
gin_server_admin/router/assessment/assessmentrouter.go

@ -157,6 +157,8 @@ func (s *AssessmentRouter) NoInitDutyHandelRouter(Router *gin.RouterGroup) {
dutyIndexCodeRouter.POST("getteamlist", authorityIndexApi.GetTeamList) // 获取班组 dutyIndexCodeRouter.POST("getteamlist", authorityIndexApi.GetTeamList) // 获取班组
dutyIndexCodeRouter.POST("scancode", authorityIndexApi.ScanCode) // token扫码验证
} }
} }

3
gin_server_admin/router/systemadmin/dutyassess.go

@ -50,6 +50,9 @@ func (a *AdminRouter) InitStaffRouter(Router *gin.RouterGroup) {
adminRouter.POST("geteitesuntarterinfo", authorityApi.GetEiteSunTarterInfo) //获取考核方法要修改的数据 adminRouter.POST("geteitesuntarterinfo", authorityApi.GetEiteSunTarterInfo) //获取考核方法要修改的数据
//岗位考核
adminRouter.POST("positiondepartplanversion", authorityApi.PositionDepartPlanVersion) //岗位考核列表方案版本列表
} }
} }

BIN
gin_server_admin/uploads/16498262459573710.pptx

Binary file not shown.

BIN
gin_server_admin/uploads/16498263631242604.pptx

Binary file not shown.

BIN
gin_server_admin/uploads/16498263989092496.pptx

Binary file not shown.

BIN
gin_server_admin/uploads/16498264252521120.pptx

Binary file not shown.

BIN
gin_server_admin/uploads/《U8+拆并卡、更换加密申请》-高科(1)_20210318081549.doc

Binary file not shown.

15
gin_server_admin/其他支持文件/config.yaml

@ -268,6 +268,17 @@ mysqlWechatCallBack:
max-open-conns: 1500 max-open-conns: 1500
log-mode: false log-mode: false
log-zap: "" log-zap: ""
#HR系统
hrdatabase:
path: '127.0.0.1:3306'
config: 'charset=utf8mb4&parseTime=True&loc=Local'
db-name: 'human_resources'
username: 'human_resources'
password: 'hn4FaeBtePdnw2K6'
max-idle-conns: 100
max-open-conns: 1500
log-mode: false
log-zap: ""
@ -308,6 +319,6 @@ healthreports: #健康上报
secretstr: 'smjpGmFo5wp18BZGiLaECFr84Blv429v_GFdKp4_0YQ' secretstr: 'smjpGmFo5wp18BZGiLaECFr84Blv429v_GFdKp4_0YQ'
privateConfig: #私人配置 privateConfig: #私人配置
visit: 'http://docu.hxgk.net/uploadfileing/uploadimging' #visit: 'http://docu.hxgk.net/uploadfileing/uploadimging'
# visit: 'http://docs.hxgk.group/uploadfileing/uploadimging' visit: 'http://docs.hxgk.group/uploadfileing/uploadimging'
appKey: 'heng_xin_gao_ke_AppKey' appKey: 'heng_xin_gao_ke_AppKey'
Loading…
Cancel
Save