Browse Source

2022.03.15修改版

qin_1
超级管理员 4 years ago
parent
commit
af2a28d31b
  1. 102
      gin_server_admin/api/admin/dutyassess/assesstype.go
  2. 427
      gin_server_admin/api/admin/dutyassess/dutyhandle.go
  3. 34
      gin_server_admin/api/index/evaluation/evaluation.go
  4. 19
      gin_server_admin/api/index/evaluation/flowsend.go
  5. 107
      gin_server_admin/api/index/evaluation/lookquantita.go
  6. 27
      gin_server_admin/api/index/evaluation/type.go
  7. 6
      gin_server_admin/api/v1/assessment/department_target.go
  8. 2
      gin_server_admin/api/v1/assessment/dutyhandle.go
  9. 2
      gin_server_admin/api/v1/assessment/dutytype.go
  10. 45
      gin_server_admin/api/v1/assessment/newassessment.go
  11. 6
      gin_server_admin/api/v1/assessment/ration_evaluation.go
  12. 16
      gin_server_admin/api/v1/assessment/target.go
  13. 43
      gin_server_admin/api/v1/shiyan/shiyan.go
  14. 2
      gin_server_admin/api/wechatapp/callback/apphandle.go
  15. 9
      gin_server_admin/api/wechatapp/callback/rationcallback.go
  16. 58
      gin_server_admin/api/wechatapp/callback/updatehandle.go
  17. 535
      gin_server_admin/commonus/publichaneld.go
  18. 40
      gin_server_admin/commonus/publicstruct.go
  19. 5
      gin_server_admin/commonus/timeSub.go
  20. 4
      gin_server_admin/model/assessmentmodel/performance_appraisal.go
  21. 4
      gin_server_admin/router/assessment/assessmentrouter.go
  22. 2
      gin_server_admin/router/shiyan/sys_shiyan.go
  23. 7
      gin_server_admin/router/systemadmin/dutyassess.go

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

@ -96,3 +96,105 @@ type OutQuantitativeConfig struct {
TargetTitle string `json:"targettitle"` //指标 TargetTitle string `json:"targettitle"` //指标
DetailedTargetTitle string `json:"detailedtargenttitle"` //指标明细 DetailedTargetTitle string `json:"detailedtargenttitle"` //指标明细
} }
//输出定性指标列表
type DutySelectList struct {
assessmentmodel.EvaluationTarget
DepartmentList []string
}
//考核方案细则列表输出
type TargetContOutCont struct {
Id string `json:"id"`
Type int `json:"type"`
Group string `json:"group"`
GroupNAme string `json:"groupname"`
DepartmentId string `json:"parentid"`
DepartmentName string `json:"parentname"`
Dimension string `json:"dimension"`
DimensionName string `json:"dimensionname"`
DimensionWeight int64 `json:"dimensionweight"` //维度权重
Target string `json:"target"`
TargetName string `json:"targetname"`
TargetWeight int64 `json:"targetweight"` //指标权重
TargetSun string `json:"targetsun"`
TargetSunName string `json:"targetsunname"`
DetailedTarget string `json:"detailedtarget"`
DetailedTargetName string `json:"detailedtargetname"`
Content string `json:"content"` //指标说明
Unit string `json:"unit"` //单位"`
ReferenceScore int64 `json:"referencescore"` //标准分值"`
Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年"`
CycleAttres int `json:"cycleattr"` //辅助计数"`
State int `json:"state"`
UserList []string `json:"userlist"` //执行人列表
UserListAry []QualEvalArrt `json:"userlistary"` //执行人列表
}
//定性考核列表输出
type QualEvalArrt struct {
Id string `json:"id"`
Name string `json:"name"`
}
//输出定性考核列表
type OutDutyList struct {
Id string `json:"id"`
Target string `json:"target"` //指标ID
TargetName string `json:"targetname"` //指标名称
Dimension string `json:"dimension"` //维度ID
DimensionName string `json:"dimensionname"` //维度名称
Content string `json:"content"` //指标说明
Unit string `json:"unit"` //单位"`
ReferenceScore int64 `json:"referencescore"` //标准分值"`
Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年"`
CycleAttres int `json:"cycleattr"` //辅助计数"`
State int `json:"state"`
DepartmentId []int64 `json:"departmentid"`
DepartmentAry []DepartmentAryType `json:"departmentmap"`
}
type DepartmentAryType struct {
Parentid string `json:"parentid"`
Parentname string `json:"parentname"`
}
//根据指标ID获取相关信息
type TargetFormId struct {
OutDutyList
SunTargetList []SunTargetListType `json:"sunlist"`
Reportmap []string `json:"reportmap"`
}
type SunTargetListType struct {
DetailedTargetType
DetailedTarget []DetailedTargetType `json:"detailedtarget"`
}
type DetailedTargetType struct {
Id string `json:"Id"`
Title string `json:"Title"`
UserList []string `json:"userlist"` //执行人列表
UserListAry []QualEvalArrt `json:"userlistary"` //执行人列表
}
//获取定性指标->指标细则修改回显
type OutTargetCont struct {
Id string `json:"id"`
SunTargerId string `json:"suntargetid"`
SunTargetName string `json:"suntargetname"`
SunTargerList []QualEvalArrt `json:"suntargetlist"`
DetailedTargetId string `json:"detailedtargetid"`
DetailedTargetName string `json:"detailedtargetname"`
DetailedTargetContent string `json:"detailedtargetcontent"`
Operator []string `json:"operator"`
OperatorAry []QualEvalArrt `json:"operatormap"`
}
//获取定性指标->指标细则修改回显修改或新增
type GetEiteTargetCont struct {
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"`
}

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

@ -0,0 +1,427 @@
package dutyassess
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 (d *DutyAssessApi) SelectDutyList(c *gin.Context) {
var evalTargetList []assessmentmodel.EvaluationTarget
err := global.GVA_DB_Performanceappraisal.Where("`et_type` = 1 AND `et_state` = 1").Find(&evalTargetList).Error
if err != nil {
response.Result(101, err, "没有数据!", c)
return
}
var listAry []DutySelectList
for _, v := range evalTargetList {
var cont DutySelectList
cont.Id = v.Id
cont.Title = v.Title
cont.Type = v.Type
cont.State = v.State
cont.AddTime = v.AddTime
cont.Share = v.Share
cont.RelevantDepartments = v.RelevantDepartments
cont.Dimension = v.Dimension
cont.Key = v.Key
cont.Report = v.Report
cont.Uniteing = v.Uniteing
cont.Cycles = v.Cycles
cont.CycleAttres = v.CycleAttres
cont.VisibleRange = v.VisibleRange
cont.VisibleRangeGroup = v.VisibleRangeGroup
cont.DepartmentList = strings.Split(v.RelevantDepartments, ",")
listAry = append(listAry, cont)
}
response.Result(0, listAry, "查询完成!", c)
}
//定性考核列表(部门方案用的)
func (d *DutyAssessApi) DutyDepartmentList(c *gin.Context) {
var requestData getDepartAssObtains
err := c.ShouldBindJSON(&requestData)
if err != nil {
// response.Result(101, err, "参数错误!请重新提交!", c)
// return
}
var targetId []int64
gormDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_target")
if requestData.DepartID != "" {
gormDb = gormDb.Where("`qe_accept_evaluation` = ?", requestData.DepartID)
}
gormDb = gormDb.Where("`qe_state` = 1 AND `qe_type` = 1")
listTargetErr := gormDb.Group("qe_target").Find(&targetId).Error
if listTargetErr != nil {
response.Result(101, listTargetErr, "没有数据!", c)
return
}
var targetList []OutDutyList
for _, v := range targetId {
var targetCont OutDutyList
targetCont.Id = strconv.FormatInt(v, 10)
tarCont, _ := commonus.GetTargetInfo(v)
targetCont.Target = strconv.FormatInt(v, 10) //指标ID
targetCont.TargetName = tarCont.Title //指标名称
targetCont.Dimension = strconv.FormatInt(tarCont.Dimension, 10) //维度ID
dutyClassCont, dutyClassErr := commonus.GetDutyClassInfo(tarCont.Dimension)
if dutyClassErr == true {
targetCont.DimensionName = dutyClassCont.Title //维度名称
}
targetCont.Content = "" //指标说明
targetCont.Unit = tarCont.Uniteing //单位"`
targetCont.ReferenceScore = 0 //标准分值"`
targetCont.Cycles = tarCont.Cycles //1:班;2:天;3:周;4:月;5:季度;6:年"`
targetCont.CycleAttres = tarCont.CycleAttres //辅助计数"`
targetCont.State = 1
targetCont.DepartmentId, targetCont.DepartmentAry = GetDutyFangAnDepart(v, 1)
targetList = append(targetList, targetCont)
}
// var qualitativeEvaluationAry []assessmentmodel.QualitativeEvaluation
response.Result(0, targetList, "查询完成!", c)
}
//获取方案中的所有所有相关部们
func GetDutyFangAnDepart(dutyId int64, class int) (departId []int64, departAry []DepartmentAryType) {
err := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_accept_evaluation").Where("`qe_state` = 1 AND `qe_target` = ? AND `qe_type` = ?", dutyId, class).Group("qe_accept_evaluation").Find(&departId).Error
if err != nil {
return
}
for _, v := range departId {
deparConErr, deparConCont := commonus.GetBranchFactory(v)
if deparConErr == true {
var departcont DepartmentAryType
departcont.Parentname = deparConCont.Name
departcont.Parentid = strconv.FormatInt(v, 10)
departAry = append(departAry, departcont)
}
}
return
}
//根据指标ID获取列表信息
func (d *DutyAssessApi) IdToTargetSunList(c *gin.Context) {
var requestData commonus.SetIds
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(101, err, "数据获取失败!", c)
return
}
if requestData.Id == 0 && requestData.OutId == "" {
response.Result(102, err, "参数错误!请重新提交!", c)
return
}
if requestData.OutId != "" {
idInt, inIntErr := strconv.ParseInt(requestData.OutId, 10, 64)
if inIntErr == nil {
requestData.Id = idInt
}
}
tarCont, isTrue := commonus.GetTargetInfo(requestData.Id)
if isTrue != true {
response.Result(103, err, "数据获取失败!", c)
return
}
var targetCont TargetFormId
targetCont.Id = strconv.FormatInt(requestData.Id, 10)
targetCont.Target = strconv.FormatInt(requestData.Id, 10) //指标ID
targetCont.TargetName = tarCont.Title //指标名称
targetCont.Dimension = strconv.FormatInt(tarCont.Dimension, 10) //维度ID
dutyClassCont, dutyClassErr := commonus.GetDutyClassInfo(tarCont.Dimension)
if dutyClassErr == true {
targetCont.DimensionName = dutyClassCont.Title //维度名称
}
targetCont.Content = "" //指标说明
targetCont.Unit = tarCont.Uniteing //单位"`
targetCont.ReferenceScore = 0 //标准分值"`
targetCont.Cycles = tarCont.Cycles //1:班;2:天;3:周;4:月;5:季度;6:年"`
targetCont.CycleAttres = tarCont.CycleAttres //辅助计数"`
targetCont.State = 1
targetCont.DepartmentId, targetCont.DepartmentAry = GetDutyFangAnDepart(requestData.Id, 1)
targetCont.SunTargetList = GetSunTargetList(requestData.Id, tarCont.Dimension, targetCont.DepartmentId)
targetCont.Reportmap = strings.Split(tarCont.Report, ",")
// for _, vv := range jieguo {
// targetCont.SunTargetList = append(targetCont.SunTargetList, vv)
// }
// targetCont.SunTargetList = jieguo
// jsonstr, _ := json.Marshal(targetCont)
// fmt.Printf("+++++++++>%v----->\n", string(jsonstr))
response.Result(0, targetCont, "查询完成!", c)
}
//获取子指标和指标详情
func GetSunTargetList(targetId, demID int64, parAryId []int64) (cont []SunTargetListType) {
var qualTargetCont []assessmentmodel.QualitativeTarget
err := global.GVA_DB_Performanceappraisal.Where("`q_state` = 1 AND `q_parent_id` = ?", targetId).Find(&qualTargetCont).Error
if err != nil {
return
}
// fmt.Printf("%v\n", qualTargetCont)
for _, v := range qualTargetCont {
var sunCont SunTargetListType
sunCont.Id = strconv.FormatInt(v.Id, 10)
sunCont.Title = v.Title
sunCont.DetailedTarget = GetDetailTrager(targetId, v.Id, demID, parAryId)
// fmt.Printf("-->%v-->%v\n", v.Id, v.Title)
cont = append(cont, sunCont)
}
// fmt.Printf("=========>%v\n", cont)
return
}
//获取指标详情
func GetDetailTrager(targetId, detId, demID int64, parAryId []int64) (cont []DetailedTargetType) {
var qualTargetCont []assessmentmodel.DetailedTarget
err := global.GVA_DB_Performanceappraisal.Where("`dt_state` = 1 AND `dt_parentid` = ? AND `dt_parentid_sun` = ?", targetId, detId).Find(&qualTargetCont).Error
if err != nil {
return
}
for _, v := range qualTargetCont {
var sunCont DetailedTargetType
sunCont.Id = strconv.FormatInt(v.Id, 10)
sunCont.Title = v.Title
sunCont.UserList, sunCont.UserListAry = GetOperator(demID, targetId, detId, v.Id, parAryId)
cont = append(cont, sunCont)
}
return
}
//获取执行人
func GetOperator(dimID, tarId, sunTarId, detaId int64, parAryId []int64) (UserList []string, UserListAry []QualEvalArrt) {
var qualEval []assessmentmodel.QualitativeEvaluation
err := global.GVA_DB_Performanceappraisal.Where("`qe_state` = 1 AND `qe_dimension` = ? AND `qe_target` = ? AND `qe_target_sun` = ? AND `qe_detailed_target` = ? AND `qe_accept_evaluation` IN ?", dimID, tarId, sunTarId, detaId, parAryId).Find(&qualEval).Error
if err != nil {
return
}
for _, v := range qualEval {
if v.Operator != "" {
usAry := strings.Split(v.Operator, ",")
if len(usAry) > 0 {
for _, vv := range usAry {
if commonus.IsItTrueString(vv, UserList) == false {
UserList = append(UserList, vv)
usCont, usErr := commonus.GetUserInfoPublic([]string{"worker_man.wm_number", "worker_man_data.wmd_name"}, map[string]interface{}{"wm_key": vv})
if usErr == true {
var userCont QualEvalArrt
userCont.Id = vv
userCont.Name = usCont.Name
UserListAry = append(UserListAry, userCont)
}
}
}
}
}
}
return
}
//获取定性指标->指标细则修改回显
func (d *DutyAssessApi) GetDetailedTargetCallBack(c *gin.Context) {
var requestData commonus.SetIds
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(101, err, "数据获取失败!", c)
return
}
if requestData.Id == 0 && requestData.OutId == "" {
response.Result(102, err, "参数错误!请重新提交!", c)
return
}
if requestData.OutId != "" {
idInt, inIntErr := strconv.ParseInt(requestData.OutId, 10, 64)
if inIntErr == nil {
requestData.Id = idInt
}
}
var cont assessmentmodel.QualitativeEvaluation
errErr := global.GVA_DB_Performanceappraisal.Where("`qe_id` = ?", requestData.Id).Find(&cont).Error
if errErr != nil {
response.Result(103, err, "没有获取到数据!", c)
return
}
//输出格式
var content OutTargetCont
content.Id = strconv.FormatInt(requestData.Id, 10)
//获取子栏目信息
sunTargetCont, _ := commonus.GetQualitativeTargetInfo(cont.TargetSun)
content.SunTargerId = strconv.FormatInt(sunTargetCont.Id, 10)
content.SunTargetName = sunTargetCont.Title
//获取指标细则信息
detaileInfo, _ := commonus.GetDetailedTargetInfo(cont.DetailedTarget)
content.DetailedTargetId = strconv.FormatInt(detaileInfo.Id, 10)
content.DetailedTargetName = detaileInfo.Title
content.DetailedTargetContent = detaileInfo.Content
shenPiRen := strings.Split(cont.Operator, ",")
content.Operator = shenPiRen
for _, v := range shenPiRen {
usCont, usErr := commonus.GetUserInfoPublic([]string{"worker_man.wm_number", "worker_man_data.wmd_name"}, map[string]interface{}{"wm_key": v})
if usErr == true {
var userCont QualEvalArrt
userCont.Id = v
userCont.Name = usCont.Name
content.OperatorAry = append(content.OperatorAry, userCont)
}
}
//获取所有子栏目
var qualTar []assessmentmodel.QualitativeTarget
quaTarErr := global.GVA_DB_Performanceappraisal.Where("`q_parent_id` = ?", cont.Target).Find(&qualTar).Error
if quaTarErr == nil {
for _, s_v := range qualTar {
var sunTarCont QualEvalArrt
sunTarCont.Id = strconv.FormatInt(s_v.Id, 10)
sunTarCont.Name = s_v.Title
content.SunTargerList = append(content.SunTargerList, sunTarCont)
}
}
response.Result(0, content, "获取成功!", c)
}
//获取定性指标->指标细则修改回显
func (d *DutyAssessApi) EiteDetailedTargetCallBack(c *gin.Context) {
var requestData GetEiteTargetCont
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(101, err, "数据获取失败!", c)
return
}
if requestData.Id == "" {
response.Result(102, err, "参数错误!请重新提交!", c)
return
}
var cont assessmentmodel.QualitativeEvaluation
errErr := global.GVA_DB_Performanceappraisal.Where("`qe_id` = ?", requestData.Id).Find(&cont).Error
if errErr != nil {
response.Result(103, err, "未能获取到数据!", c)
return
}
isTrue := false
if requestData.Class != 1 {
isTrue = NewEiteData(requestData, cont)
} else {
isTrue = NewAddData(requestData, cont)
}
if isTrue == false {
response.Result(104, err, "数据处理失败", c)
return
}
response.Result(0, err, "数据处理成功", c)
}
//新增
func NewAddData(getData GetEiteTargetCont, oldData assessmentmodel.QualitativeEvaluation) (isTrue bool) {
isTrue = false
var detailedTargetInfo assessmentmodel.DetailedTarget
detailedTargetInfo.Title = getData.DetailedTargetName
detailedTargetInfo.Content = getData.DetailedTargetContent
detailedTargetInfo.ParentId = oldData.Target
detailedTargetInfo.ParentIdSun = oldData.TargetSun
detailedTargetInfo.State = 1
detailedTargetInfo.AddTime = time.Now().Unix()
addErr := global.GVA_DB_Performanceappraisal.Create(&detailedTargetInfo).Error
if addErr != nil {
return
}
var saveData assessmentmodel.QualitativeEvaluation
saveData.Title = oldData.Title
saveData.DepartmentId = oldData.DepartmentId
saveData.Dimension = oldData.Dimension
saveData.Target = oldData.Target
saveData.TargetSun = oldData.TargetSun
saveData.DetailedTarget = detailedTargetInfo.Id
saveData.Type = oldData.Type
saveData.Weight = oldData.Weight
saveData.Unit = oldData.Unit
saveData.ReferenceScore = oldData.ReferenceScore
saveData.State = oldData.State
saveData.Addtime = time.Now().Unix()
saveData.Eitetime = time.Now().Unix()
saveData.Group = oldData.Group
saveData.QualEvalId = oldData.QualEvalId
saveData.Cycles = oldData.Cycles
saveData.CycleAttres = oldData.CycleAttres
saveData.AcceptEvaluation = oldData.AcceptEvaluation
saveData.Operator = oldData.Operator
saveData.Content = oldData.Content
addErrQE := global.GVA_DB_Performanceappraisal.Create(&saveData).Error
if addErrQE != nil {
return
}
isTrue = true
return
}
//修改
func NewEiteData(getData GetEiteTargetCont, oldData assessmentmodel.QualitativeEvaluation) (isTrue bool) {
isTrue = false
eiteDetailedInfo := commonus.MapOut()
eiteDetailedInfo["dt_time"] = time.Now().Unix()
if getData.DetailedTargetName != "" {
eiteDetailedInfo["dt_title"] = getData.DetailedTargetName
}
if getData.DetailedTargetContent != "" {
eiteDetailedInfo["dt_content"] = getData.DetailedTargetContent
}
eiteDetaInfoErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DetailedTarget{}).Where("`dt_id` = ?", oldData.DetailedTarget).Updates(&eiteDetailedInfo).Error
if eiteDetaInfoErr != nil {
return
}
if len(getData.Operator) > 0 {
eiteQualEvlInfo := commonus.MapOut()
eiteQualEvlInfo["qe_eitetime"] = time.Now().Unix()
eiteQualEvlInfo["qe_operator"] = strings.Join(getData.Operator, ",")
eiteQualEvlInfo["qe_department_id"] = strings.Join(commonus.GetDepartmentByUserBast(getData.Operator), ",")
eiteDetaQuaInfoErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Where("`qe_id` = ?", oldData.Id).Updates(&eiteQualEvlInfo).Error
if eiteDetaQuaInfoErr != nil {
return
}
}
isTrue = true
return
}
//修改子栏目名称
func (d *DutyAssessApi) EiteSunTargetName(c *gin.Context) {
var requestData QualEvalArrt
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(101, err, "数据获取失败!", c)
return
}
if requestData.Id == "" {
response.Result(102, err, "参数错误!请重新提交!", c)
return
}
if requestData.Name == "" {
response.Result(103, err, "参数错误!请重新提交!", c)
return
}
var oldId int64
errCont := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeTarget{}).Select("q_id").Where("`q_id` = ?", requestData.Id).First(&oldId).Error
if errCont != nil {
response.Result(104, err, "没有该数据!", c)
return
}
eiteCont := commonus.MapOut()
eiteCont["q_time"] = time.Now().Unix()
eiteCont["q_title"] = requestData.Name
errEiteCont := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeTarget{}).Where("`q_id` = ?", requestData.Id).Updates(&eiteCont).Error
if errEiteCont != nil {
response.Result(105, err, "修改失败!", c)
return
}
response.Result(0, err, "数据处理成功", c)
}

34
gin_server_admin/api/index/evaluation/evaluation.go

@ -195,7 +195,8 @@ func (e *EvaluationInterface) AdditionAndSubtractionScore(c *gin.Context) {
return return
} }
commonus.StepAddData(keyNumber, 0, 2, 1, userCont.Key) commonus.StepAddData(keyNumber, 0, 2, 1, 1, 1, 1, userCont.Key)
// /* // /*
// @flowID 流程ID // @flowID 流程ID
// @userKey 操作人key // @userKey 操作人key
@ -916,7 +917,9 @@ func (e *EvaluationInterface) AddFlowRationLog(c *gin.Context) {
// response.Result(0, sendUserList, "未指定相关部门处理人!未能向相关人员发送考核项目!请手动发起!", c) // response.Result(0, sendUserList, "未指定相关部门处理人!未能向相关人员发送考核项目!请手动发起!", c)
// return // return
} }
UpEvaluationProcessApproval(keyNumber, 16182159043990656, keyNumber, 1, userCont.Key) // UpEvaluationProcessApproval(keyNumber, 16182159043990656, keyNumber, 1, userCont.Key)
commonus.StepAddData(keyNumber, 16182159043990656, 2, 7, 2, 1, 1, userCont.Key)
mainTitle := fmt.Sprintf("%v数据表", commonus.TimeStampToDate(operationTime, 10)) mainTitle := fmt.Sprintf("%v数据表", commonus.TimeStampToDate(operationTime, 10))
mainTitleDesc := "" mainTitleDesc := ""
@ -975,6 +978,7 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
requestData.Id = idInt requestData.Id = idInt
} }
} }
var titleVal string = ""
fmt.Printf("1-------------------->\n") fmt.Printf("1-------------------->\n")
var addScore assessmentmodel.ScoreFlow var addScore assessmentmodel.ScoreFlow
gerErr := global.GVA_DB_Performanceappraisal.Where("`sf_key` = ?", requestData.Id).Find(&addScore).Error gerErr := global.GVA_DB_Performanceappraisal.Where("`sf_key` = ?", requestData.Id).Find(&addScore).Error
@ -1000,12 +1004,14 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
dimInfo, dimInfoErr := commonus.GetDutyClassInfo(qualEvalCont.Dimension) dimInfo, dimInfoErr := commonus.GetDutyClassInfo(qualEvalCont.Dimension)
if dimInfoErr == true { if dimInfoErr == true {
dutyCecorFlowInfo.Dimension = dimInfo.Title dutyCecorFlowInfo.Dimension = dimInfo.Title
titleVal = dimInfo.Title
} }
} }
if qualEvalCont.Target != 0 { if qualEvalCont.Target != 0 {
target, targetErr := commonus.GetTargetInfo(qualEvalCont.Target) target, targetErr := commonus.GetTargetInfo(qualEvalCont.Target)
if targetErr == true { if targetErr == true {
dutyCecorFlowInfo.Target = target.Title dutyCecorFlowInfo.Target = target.Title
titleVal = target.Title
} }
} }
@ -1013,6 +1019,7 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
tarsun, tarsunErr := commonus.GetQualitativeTargetInfo(qualEvalCont.TargetSun) tarsun, tarsunErr := commonus.GetQualitativeTargetInfo(qualEvalCont.TargetSun)
if tarsunErr == true { if tarsunErr == true {
dutyCecorFlowInfo.TargetSun = tarsun.Title dutyCecorFlowInfo.TargetSun = tarsun.Title
titleVal = tarsun.Title
} }
} }
if qualEvalCont.DetailedTarget != 0 { if qualEvalCont.DetailedTarget != 0 {
@ -1020,6 +1027,7 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
if detaTarErr == true { if detaTarErr == true {
dutyCecorFlowInfo.DetailedTarget = detaTar.Title dutyCecorFlowInfo.DetailedTarget = detaTar.Title
dutyCecorFlowInfo.Content = detaTar.Content dutyCecorFlowInfo.Content = detaTar.Content
titleVal = detaTar.Title
} }
} }
fmt.Printf("7-------------------->%v\n", requestData.Id) fmt.Printf("7-------------------->%v\n", requestData.Id)
@ -1149,7 +1157,14 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
} }
} }
} }
//流程全面
var flowAllMapList []commonus.FlowAllMap
jsonFlowErrers := json.Unmarshal([]byte(evalProInfo.NextContent), &flowAllMapList)
if jsonFlowErrers == nil {
dutyCecorFlowInfo.FlowMapAll = flowAllMapList
} }
}
dutyCecorFlowInfo.Title = titleVal
response.Result(0, dutyCecorFlowInfo, "获取成功", c) response.Result(0, dutyCecorFlowInfo, "获取成功", c)
} }
@ -1196,6 +1211,7 @@ func (d *EvaluationInterface) LookRationkScoreFlow(c *gin.Context) {
return return
} }
//流程查看 //流程查看
var flowAllMapList []commonus.FlowAllMap
var flowLogList []TechnologicalProcessType var flowLogList []TechnologicalProcessType
var evalProInfo assessmentmodel.EvaluationProcess var evalProInfo assessmentmodel.EvaluationProcess
gerEvalErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", requestData.Id).Find(&evalProInfo).Error gerEvalErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", requestData.Id).Find(&evalProInfo).Error
@ -1261,13 +1277,24 @@ func (d *EvaluationInterface) LookRationkScoreFlow(c *gin.Context) {
} }
} }
} }
//流程图全面
// flowAllMapList
if evalProInfo.NextContent != "" {
jsonFlowErr := json.Unmarshal([]byte(evalProInfo.NextContent), &flowAllMapList)
if jsonFlowErr == nil {
}
}
} }
outListMap := commonus.MapOut() outListMap := commonus.MapOut()
outListMap["List"] = outList outListMap["List"] = outList
outListMap["flowLog"] = flowLogList outListMap["flowLog"] = flowLogList
outListMap["flowall"] = flowAllMapList
outListMap["title"] = ""
var flowLogInfo assessmentmodel.FlowLog var flowLogInfo assessmentmodel.FlowLog
getErrs := global.GVA_DB_Performanceappraisal.Where("`fl_key` = ?", requestData.Id).First(&flowLogInfo).Error getErrs := global.GVA_DB_Performanceappraisal.Where("`fl_key` = ?", requestData.Id).First(&flowLogInfo).Error
if getErrs == nil { if getErrs == nil {
titleStr := fmt.Sprintf("%v年%v月%v日数据上报", flowLogInfo.Year, flowLogInfo.Month, flowLogInfo.ToDay)
gErr, groupInfo := commonus.GetGroupCont(flowLogInfo.DutyGroup) gErr, groupInfo := commonus.GetGroupCont(flowLogInfo.DutyGroup)
if gErr == true { if gErr == true {
outListMap["groupname"] = groupInfo.Name outListMap["groupname"] = groupInfo.Name
@ -1278,10 +1305,11 @@ func (d *EvaluationInterface) LookRationkScoreFlow(c *gin.Context) {
dErr, BranchInfo := commonus.GetBranchFactory(flowLogInfo.DutyDepartment) dErr, BranchInfo := commonus.GetBranchFactory(flowLogInfo.DutyDepartment)
if dErr == true { if dErr == true {
outListMap["departmentname"] = BranchInfo.Name outListMap["departmentname"] = BranchInfo.Name
titleStr = fmt.Sprintf("%v%v", BranchInfo.Name, titleStr)
} else { } else {
outListMap["departmentname"] = "" outListMap["departmentname"] = ""
} }
outListMap["title"] = titleStr
} }
response.Result(0, outListMap, "查询成功", c) response.Result(0, outListMap, "查询成功", c)

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

@ -182,7 +182,7 @@ 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, userCont.Key) commonus.StepAddData(keyNumber, 0, 3, 1, 1, 1, 1, userCont.Key)
//申请人也是部门负责人 //申请人也是部门负责人
//给相关部门内勤发送消息。确定相关责任人 //给相关部门内勤发送消息。确定相关责任人
sendUserIsTrue, sendUserList := commonus.GetSendMsgUser(16118387069540343, programme.AcceptEvaluation) //获取对应部门内勤 sendUserIsTrue, sendUserList := commonus.GetSendMsgUser(16118387069540343, programme.AcceptEvaluation) //获取对应部门内勤
@ -198,7 +198,7 @@ func (e *EvaluationInterface) PlusOrMinusPoints(c *gin.Context) {
} else { } else {
//写入当前流程步骤 //写入当前流程步骤
commonus.StepAddData(keyNumber, 16182159043990656, 2, 1, userCont.Key) commonus.StepAddData(keyNumber, 16182159043990656, 2, 1, 1, 1, 1, userCont.Key)
//申请人不是是部门负责人 给本部门负责人发送审批 //申请人不是是部门负责人 给本部门负责人发送审批
//获取发起人部门负责人 //获取发起人部门负责人
departmentIdInts, _ := strconv.ParseInt(userCont.DepartmentId, 10, 64) departmentIdInts, _ := strconv.ParseInt(userCont.DepartmentId, 10, 64)
@ -267,7 +267,7 @@ func (e *EvaluationInterface) PersonInCharge(c *gin.Context) {
} }
} }
//写入审批流程 //写入审批流程
commonus.StepAddData(orderId, 0, 4, 3, userCont.Key) commonus.StepAddData(orderId, 0, 4, 3, 1, 1, 3, userCont.Key)
var scoreFlowInfo assessmentmodel.ScoreFlow var scoreFlowInfo assessmentmodel.ScoreFlow
judegFlowErr := global.GVA_DB_Performanceappraisal.Where("`sf_key` = ?", orderId).First(&scoreFlowInfo).Error judegFlowErr := global.GVA_DB_Performanceappraisal.Where("`sf_key` = ?", orderId).First(&scoreFlowInfo).Error
if judegFlowErr != nil { if judegFlowErr != nil {
@ -288,9 +288,13 @@ func (e *EvaluationInterface) PersonInCharge(c *gin.Context) {
return return
} }
//同一订单下,删除原有的,再从新分配。
global.GVA_DB_Performanceappraisal.Where("df_sf_id = ?", orderId).Delete(&assessmentmodel.DivisionResponsibilities{})
var reason string //引用文本描述 var reason string //引用文本描述
var saveDataAry []assessmentmodel.DivisionResponsibilities var saveDataAry []assessmentmodel.DivisionResponsibilities
var userKeyAry []int64 var userKeyAry []int64
var userKeyMainAry []int64
var MainResponsiblePerson MainResponsiblePersonType var MainResponsiblePerson MainResponsiblePersonType
var teamIsTrue int = 1 var teamIsTrue int = 1
for _, v := range requestData.UserList { for _, v := range requestData.UserList {
@ -333,7 +337,9 @@ func (e *EvaluationInterface) PersonInCharge(c *gin.Context) {
saveDataCont.Group = userConting.Group saveDataCont.Group = userConting.Group
saveDataCont.Department = userConting.DepartmentId saveDataCont.Department = userConting.DepartmentId
saveDataCont.Tema = userConting.Tema saveDataCont.Tema = userConting.Tema
if v.Type != 3 {
userKeyAry = append(userKeyAry, userConting.Key) userKeyAry = append(userKeyAry, userConting.Key)
}
var zeren string var zeren string
switch v.Type { switch v.Type {
case 1: case 1:
@ -343,6 +349,7 @@ func (e *EvaluationInterface) PersonInCharge(c *gin.Context) {
MainResponsiblePerson.Department = userConting.DepartmentId MainResponsiblePerson.Department = userConting.DepartmentId
MainResponsiblePerson.WorkshopId = userConting.WorkshopId MainResponsiblePerson.WorkshopId = userConting.WorkshopId
MainResponsiblePerson.Tema = userConting.Tema MainResponsiblePerson.Tema = userConting.Tema
userKeyMainAry = append(userKeyMainAry, userConting.Key)
case 2: case 2:
zeren = "互保责任人" zeren = "互保责任人"
case 3: case 3:
@ -444,6 +451,8 @@ func (e *EvaluationInterface) PersonInCharge(c *gin.Context) {
response.Result(108, writeDataErr, "数据写入失败", c) response.Result(108, writeDataErr, "数据写入失败", c)
return return
} }
//审批节点写入责任人
commonus.WriteFlowMainSet(orderId, userKeyMainAry)
flowSaveData := commonus.MapOut() flowSaveData := commonus.MapOut()
flowSaveData["sf_reply"] = 2 flowSaveData["sf_reply"] = 2
flowSaveData["sf_eite_time"] = time.Now().Unix() flowSaveData["sf_eite_time"] = time.Now().Unix()
@ -568,7 +577,7 @@ func (e *EvaluationInterface) RectificationMeasures(c *gin.Context) {
return return
} }
//写入流程步骤 //写入流程步骤
commonus.StepAddData(orderidval, 0, 6, 4, userCont.Key) commonus.StepAddData(orderidval, 0, 6, 4, 1, 1, 5, userCont.Key)
/* /*
向本部门负责人发送审批 向本部门负责人发送审批
*/ */
@ -645,3 +654,5 @@ func (e *EvaluationInterface) RectificationMeasures(c *gin.Context) {
response.Result(0, outData, "数据写入成功", c) response.Result(0, outData, "数据写入成功", c)
} }
//

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

@ -1,6 +1,10 @@
package evaluation package evaluation
import ( import (
"encoding/json"
"fmt"
"strconv"
"github.com/flipped-aurora/gin-vue-admin/server/commonus" "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/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/assessmentmodel" "github.com/flipped-aurora/gin-vue-admin/server/model/assessmentmodel"
@ -98,3 +102,106 @@ func (e *EvaluationInterface) LookQuantitativeConfig(c *gin.Context) {
} }
response.Result(0, outList, "获取成功!", c) response.Result(0, outList, "获取成功!", c)
} }
//查看审批流程
func (e *EvaluationInterface) SeeFlowLog(c *gin.Context) {
isTrue, userCont := commonus.ClientIdentity()
if isTrue != true {
response.Result(101, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c)
return
}
var requestData FlowLogType
c.ShouldBindJSON(&requestData)
if requestData.PageSize == 0 {
requestData.PageSize = 20
}
if requestData.Page <= 0 {
requestData.Page = 1
}
offSetPage := commonus.CalculatePages(requestData.Page, requestData.PageSize)
var evalProContList []assessmentmodel.EvaluationProcess
gormDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationProcess{}).Where("FIND_IN_SET(?,`ep_participants`)", userCont.Key)
if requestData.State != 0 {
gormDb = gormDb.Where("ep_state = ?", requestData.State)
}
/*
获取总共有多少记录
*/
var total int64
totalErr := gormDb.Count(&total).Error
if totalErr != nil {
total = 0
}
//获取记录数据
evaErr := gormDb.Order("ep_id ASC").Limit(requestData.PageSize).Offset(offSetPage).Find(&evalProContList).Error
if evaErr != nil {
response.Result(104, evaErr, "数据获取失败!", c)
return
}
var flowLogListOut []FlowLogListOut
for _, v := range evalProContList {
var flowLogListCont FlowLogListOut
orderId := strconv.FormatInt(v.OrderKey, 10)
flowLogListCont.OutId = orderId
flowLogListCont.Class = v.TypeClass
if v.TypeClass == 1 {
//获取考核项目关联项目
targettitle, detailedRulesTitle, _, _, scoreFlowCont, dutyTarDetErr := commonus.GetDutyAssociatedItems(orderId)
if dutyTarDetErr == true {
if detailedRulesTitle != "" {
flowLogListCont.Title = fmt.Sprintf("%v", detailedRulesTitle)
} else {
flowLogListCont.Title = fmt.Sprintf("%v", targettitle)
}
addUser, addUserErr := commonus.GetWorkUser(strconv.FormatInt(scoreFlowCont.EvaluationUser, 10))
if addUserErr == true {
flowLogListCont.FounDer = addUser.Name
}
}
} else {
flowLogInfo, flowLogErr := commonus.GetFlowLog(orderId)
if flowLogErr == true {
flowLogListCont.Title = fmt.Sprintf("%v-%v-%v数据上报", flowLogInfo.Year, flowLogInfo.Month, flowLogInfo.ToDay)
addUser, addUserErr := commonus.GetWorkUser(strconv.FormatInt(flowLogInfo.EvaluationUser, 10))
if addUserErr == true {
flowLogListCont.FounDer = addUser.Name
}
}
}
//解析审批流
var flowLog []FlowStep
jsonFlowErr := json.Unmarshal([]byte(v.Content), &flowLog)
setpLen := len(flowLog)
if jsonFlowErr == nil {
//得到当前步进值
currentSetp := setpLen - 1
if currentSetp < 0 {
currentSetp = 0
}
flowLogListCont.Node = flowLog[currentSetp].StepName
addUser, addUserErr := commonus.GetWorkUser(flowLog[currentSetp].ClickName)
if addUserErr == true {
flowLogListCont.CurrentPeo = addUser.Name
}
}
switch v.State {
case 2:
flowLogListCont.Result = "审批通过"
flowLogListCont.Condition = "已结束"
case 3:
flowLogListCont.Result = "驳回"
flowLogListCont.Condition = "审批中"
default:
flowLogListCont.Result = "审批中"
flowLogListCont.Condition = "审批中"
}
flowLogListOut = append(flowLogListOut, flowLogListCont)
}
countSum := len(flowLogListOut)
printData := commonus.OutPutList(total, int64(countSum), requestData.Page, requestData.PageSize, flowLogListOut)
response.Result(0, printData, "查询成功!", c)
}

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

@ -1,6 +1,9 @@
package evaluation package evaluation
import "github.com/flipped-aurora/gin-vue-admin/server/model/assessmentmodel" import (
"github.com/flipped-aurora/gin-vue-admin/server/commonus"
"github.com/flipped-aurora/gin-vue-admin/server/model/assessmentmodel"
)
type EvaluationInterface struct{} type EvaluationInterface struct{}
@ -116,6 +119,7 @@ type GetRationFlowLog struct {
//定性指标流程展示 //定性指标流程展示
type DutyCecorFlow struct { type DutyCecorFlow struct {
Title string `json:"title"` //审批流标识
OrderId string `json:"orderid"` //审批流标识 OrderId string `json:"orderid"` //审批流标识
Dimension string `json:"dimension"` //维度 Dimension string `json:"dimension"` //维度
Target string `json:"target"` //指标 Target string `json:"target"` //指标
@ -126,7 +130,8 @@ type DutyCecorFlow struct {
ReasonInfo string `json:"reasoninfo"` // ReasonInfo string `json:"reasoninfo"` //
DivisionResponsibility []DivisiosibilityType `json:"divresbil"` //责任划分 DivisionResponsibility []DivisiosibilityType `json:"divresbil"` //责任划分
RectifMeasures []RectifMeasures `json:"rectifmeasures"` //整改措施 RectifMeasures []RectifMeasures `json:"rectifmeasures"` //整改措施
TechnologicalProcess []TechnologicalProcessType `technologicalprocess` //流程 TechnologicalProcess []TechnologicalProcessType `json:"technologicalprocess"` //流程
FlowMapAll []commonus.FlowAllMap `json:"flowmapall"` //流程全貌
} }
//审批流 //审批流
@ -204,3 +209,21 @@ type MainResponsiblePersonType struct {
Tema int64 `json:"tema"` Tema int64 `json:"tema"`
Weight int64 `json:"weight"` Weight int64 `json:"weight"`
} }
//流程记录
type FlowLogType struct {
commonus.PageSetLimt
State int `json:"state"` //状态
}
//流程记录输出
type FlowLogListOut struct {
OutId string `json:"outid"` //id
Title string `json:"tittle"` //流程名
Node string `json:"node"` //当前节点
CurrentPeo string `json:"currentpeo"` //当前负责人
FounDer string `json:"founder"` //创建人
Condition string `json:"condition"` //审批状态
Result string `json:"result"` //审批结果
Class int `json:"class"` //1、定性;2、定量
}

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

@ -105,6 +105,9 @@ func (d *DutyHandle) DepartmentTaskList(c *gin.Context) {
if requestData.Group != "" { if requestData.Group != "" {
gormDb = gormDb.Where("`qe_group` = ?", requestData.Group) gormDb = gormDb.Where("`qe_group` = ?", requestData.Group)
} }
// if requestData.DepartmentId != "" {
// gormDb = gormDb.Where("`qe_accept_evaluation` = ?", requestData.DepartmentId)
// }
if requestData.DepartmentId != "" { if requestData.DepartmentId != "" {
gormDb = gormDb.Where("`qe_accept_evaluation` = ?", requestData.DepartmentId) gormDb = gormDb.Where("`qe_accept_evaluation` = ?", requestData.DepartmentId)
} }
@ -118,6 +121,7 @@ func (d *DutyHandle) DepartmentTaskList(c *gin.Context) {
if requestData.TargetSun != "" { if requestData.TargetSun != "" {
gormDb = gormDb.Where("`qe_target_sun` = ?", requestData.TargetSun) gormDb = gormDb.Where("`qe_target_sun` = ?", requestData.TargetSun)
} }
gormDb = gormDb.Where("`qe_state` = 1")
listTargetErr := gormDb.Order("qe_group asc,qe_accept_evaluation asc,qe_dimension asc,qe_type asc,qe_target asc,qe_target_sun asc").Find(&qualitativeEvaluationAry).Error listTargetErr := gormDb.Order("qe_group asc,qe_accept_evaluation asc,qe_dimension asc,qe_type asc,qe_target asc,qe_target_sun asc").Find(&qualitativeEvaluationAry).Error
if listTargetErr != nil || len(qualitativeEvaluationAry) < 1 { if listTargetErr != nil || len(qualitativeEvaluationAry) < 1 {
@ -762,7 +766,7 @@ func (d *DutyHandle) AddDepartmentDutyInfo(c *gin.Context) {
} else { } else {
fmt.Printf("judge----------------6-----1------>%v\n", v_s) fmt.Printf("judge----------------6-----1------>%v\n", v_s)
var qualEvalId []int64 var qualEvalId []int64
judgeQualEvalErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_id").Where("`qe_group` = ? AND FIND_IN_SET(%v,`qe_department_id`) AND `qe_dimension` = ? AND `qe_target` = ?", groupId, departId, v.Id, v_s.Id).Find(&qualEvalId).Error judgeQualEvalErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_id").Where("`qe_group` = ? AND FIND_IN_SET(?,`qe_department_id`) AND `qe_dimension` = ? AND `qe_target` = ?", groupId, departId, v.Id, v_s.Id).Find(&qualEvalId).Error
if judgeQualEvalErr == nil { if judgeQualEvalErr == nil {
if len(qualEvalId) > 0 { if len(qualEvalId) > 0 {
eiteIdAry = append(eiteIdAry, 2) eiteIdAry = append(eiteIdAry, 2)

2
gin_server_admin/api/v1/assessment/dutyhandle.go

@ -37,6 +37,8 @@ func (d *DutyHandle) DutyClassList(c *gin.Context) {
whereMap := commonus.MapOut() whereMap := commonus.MapOut()
if requestData.State != 0 { if requestData.State != 0 {
whereMap["state"] = requestData.State whereMap["state"] = requestData.State
} else {
whereMap["state"] = 1
} }
var dutyClassAry []assessmentmodel.DutyClass var dutyClassAry []assessmentmodel.DutyClass
if requestData.Title != "" { if requestData.Title != "" {

2
gin_server_admin/api/v1/assessment/dutytype.go

@ -279,6 +279,7 @@ type listTarget struct {
RelevantDepartments []string `json:"relevantdepartments"` //相关部门 RelevantDepartments []string `json:"relevantdepartments"` //相关部门
VisibleRangeGroup []string `json:"visiblerangegroup"` //可见范围(集团) VisibleRangeGroup []string `json:"visiblerangegroup"` //可见范围(集团)
VisibleRangeDepart []string `json:"visiblerangedepart"` //可见范围(分厂) VisibleRangeDepart []string `json:"visiblerangedepart"` //可见范围(分厂)
Dimension string `json:"dimension"` //维度 (待定是否使用)
} }
//添加指标 //添加指标
@ -316,6 +317,7 @@ type outTargetAttr struct {
//详细内容输出 //详细内容输出
type outTargetInfo struct { type outTargetInfo struct {
assessmentmodel.EvaluationTarget assessmentmodel.EvaluationTarget
GroupMap []string `json:"group"`
DimensionIdStr string `json:"dimensionidstr"` DimensionIdStr string `json:"dimensionidstr"`
RelevantDepartmentMap []string `json:"relevantdepartmentsmap"` RelevantDepartmentMap []string `json:"relevantdepartmentsmap"`
ReportMap []string `json:"reportmap"` ReportMap []string `json:"reportmap"`

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

@ -1,7 +1,6 @@
package assessment package assessment
import ( import (
"encoding/json"
"fmt" "fmt"
"strconv" "strconv"
"strings" "strings"
@ -20,8 +19,8 @@ func (d *dataLockStatistics) AddCardAssEss(deparmentId string, addData AddQualEv
sunTargetCont, sunTargetErr := judgeColumn(addData.Target, addData.TargetSun, addData.TargetSunTitle) sunTargetCont, sunTargetErr := judgeColumn(addData.Target, addData.TargetSun, addData.TargetSunTitle)
if sunTargetErr != true { if sunTargetErr != true {
} }
jsonCont, _ := json.Marshal(sunTargetCont) // jsonCont, _ := json.Marshal(sunTargetCont)
fmt.Printf("jsonKKKK----------------->%v\n", string(jsonCont)) // fmt.Printf("jsonKKKK----------------->%v\n", string(jsonCont))
groupInt, groupIntErr := strconv.ParseInt(addData.Group, 10, 64) groupInt, groupIntErr := strconv.ParseInt(addData.Group, 10, 64)
if groupIntErr != nil { if groupIntErr != nil {
groupInt = 1 groupInt = 1
@ -51,9 +50,12 @@ func (d *dataLockStatistics) AddCardAssEss(deparmentId string, addData AddQualEv
} }
addDepartDimension(addData.Group, strconv.FormatInt(dimensionInt, 10), addData.Dimension, 1) addDepartDimension(addData.Group, strconv.FormatInt(dimensionInt, 10), addData.Dimension, 1)
var jiBuQi int = 0
var saveDataAry []assessmentmodel.QualitativeEvaluation var saveDataAry []assessmentmodel.QualitativeEvaluation
for _, v := range addData.EvaluationList { for _, v := range addData.EvaluationList {
wheAry := commonus.MapOut()
var saveData assessmentmodel.QualitativeEvaluation var saveData assessmentmodel.QualitativeEvaluation
saveData.Group = groupInt saveData.Group = groupInt
@ -68,6 +70,13 @@ func (d *dataLockStatistics) AddCardAssEss(deparmentId string, addData AddQualEv
saveData.Target = targetInt saveData.Target = targetInt
saveData.TargetSun = sunTargetCont.Id saveData.TargetSun = sunTargetCont.Id
wheAry["qe_dimension"] = dimensionInt
wheAry["qe_target"] = targetInt
wheAry["qe_target_sun"] = sunTargetCont.Id
wheAry["qe_group"] = groupInt
wheAry["qe_type"] = addData.Type
// targetSunInt, targetSunIntErr := strconv.ParseInt(addData.TargetSun, 10, 64) // targetSunInt, targetSunIntErr := strconv.ParseInt(addData.TargetSun, 10, 64)
// if targetSunIntErr == nil { // if targetSunIntErr == nil {
// saveData.TargetSun = targetSunInt // saveData.TargetSun = targetSunInt
@ -75,6 +84,7 @@ func (d *dataLockStatistics) AddCardAssEss(deparmentId string, addData AddQualEv
explainCont, explainErr := judgeDetails(addData.Target, v.Title, v.Content, v.DetailedTarget, sunTargetCont.Id) explainCont, explainErr := judgeDetails(addData.Target, v.Title, v.Content, v.DetailedTarget, sunTargetCont.Id)
if explainErr == true { if explainErr == true {
saveData.DetailedTarget = explainCont.Id saveData.DetailedTarget = explainCont.Id
wheAry["qe_detailed_target"] = explainCont.Id
} }
// detailedTargetInt, detailedTargetIntErr := strconv.ParseInt(v.DetailedTarget, 10, 64) // detailedTargetInt, detailedTargetIntErr := strconv.ParseInt(v.DetailedTarget, 10, 64)
// if detailedTargetIntErr == nil { // if detailedTargetIntErr == nil {
@ -92,10 +102,28 @@ func (d *dataLockStatistics) AddCardAssEss(deparmentId string, addData AddQualEv
if departmentIdInt != 0 { if departmentIdInt != 0 {
saveData.AcceptEvaluation = departmentIdInt saveData.AcceptEvaluation = departmentIdInt
wheAry["qe_accept_evaluation"] = departmentIdInt
} }
saveData.Operator = strings.Join(v.Operator, ",") saveData.Operator = strings.Join(v.Operator, ",")
saveData.DepartmentId = strings.Join(GetDepartmentByUserBast(v.Operator), ",") saveData.DepartmentId = strings.Join(GetDepartmentByUserBast(v.Operator), ",")
//判断该项目是否存在!
judgeIsSet := global.GVA_DB_Performanceappraisal.Where(wheAry).First(&saveData).Error
if judgeIsSet == nil {
jiBuQi++
eiteData := commonus.MapOut()
eiteData["qe_unit"] = v.Unit
eiteData["qe_reference_score"] = v.ReferenceScore
eiteData["qe_eitetime"] = time.Now().Unix()
eiteData["qe_cycle"] = v.Cycles
eiteData["qe_cycleattr"] = v.CycleAttres
eiteData["qe_content"] = v.Content
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Where("qe_id = ?", saveData.Id).Updates(&eiteData)
} else {
saveDataAry = append(saveDataAry, saveData) saveDataAry = append(saveDataAry, saveData)
}
msg := commonus.MapOut() msg := commonus.MapOut()
msg["msg"] = saveData msg["msg"] = saveData
d.dataMap = append(d.dataMap, msg) d.dataMap = append(d.dataMap, msg)
@ -107,15 +135,18 @@ func (d *dataLockStatistics) AddCardAssEss(deparmentId string, addData AddQualEv
msg["data"] = saveDataAry msg["data"] = saveDataAry
msg["msg"] = fmt.Sprintf("《%v》考核维度录入失败!请重新处理此方案", addData.Dimension) msg["msg"] = fmt.Sprintf("《%v》考核维度录入失败!请重新处理此方案", addData.Dimension)
d.dataErrMap = append(d.dataErrMap, msg) d.dataErrMap = append(d.dataErrMap, msg)
} else {
commonus.AddDimenTargetWeight(int64(addData.Type), groupInt, departmentIdInt, dimensionInt, targetInt)
} }
} }
commonus.AddDimenTargetWeight(int64(addData.Type), groupInt, departmentIdInt, dimensionInt, targetInt)
syncProcess.Done() syncProcess.Done()
} }
//判断该子栏目是否存在 //判断该子栏目是否存在
/*
@ascription 指标ID
@columId 子指标ID
@title 指标名称
*/
func judgeColumn(ascription, columId, title string) (content assessmentmodel.QualitativeTarget, isTrue bool) { func judgeColumn(ascription, columId, title string) (content assessmentmodel.QualitativeTarget, isTrue bool) {
isTrue = false isTrue = false
if columId != "" { if columId != "" {

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

@ -65,6 +65,12 @@ func (d *DutyHandle) AddRation(c *gin.Context) {
} }
//关联集团部门考核维度 //关联集团部门考核维度
/*
@groupID 集团
@departId 部门
@dimensionId 维度
@key 1定性考核2定量考核
*/
func addDepartDimension(groupID, departId, dimensionId string, key int64) { func addDepartDimension(groupID, departId, dimensionId string, key int64) {
judgeMap := commonus.MapOut() judgeMap := commonus.MapOut()
judgeErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DepartmentDimension{}).Select("dd_id").Where("`dd_group` = ? AND `dd_department` = ? AND `dd_dimension` = ?", groupID, departId, dimensionId).First(&judgeMap).Error judgeErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DepartmentDimension{}).Select("dd_id").Where("`dd_group` = ? AND `dd_department` = ? AND `dd_dimension` = ?", groupID, departId, dimensionId).First(&judgeMap).Error

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

@ -41,6 +41,9 @@ func (d *DutyHandle) GetTargetList(c *gin.Context) {
if requestData.Share != 0 { if requestData.Share != 0 {
gormDb = gormDb.Where("`et_share` = ?", requestData.Share) gormDb = gormDb.Where("`et_share` = ?", requestData.Share)
} }
if requestData.Dimension != "" {
gormDb = gormDb.Where("`et_dimension` = ?", requestData.Dimension)
}
if requestData.Title != "" { if requestData.Title != "" {
gormDb = gormDb.Where("(`et_title` LIKE ?)", "%"+requestData.Title+"%") gormDb = gormDb.Where("(`et_title` LIKE ?)", "%"+requestData.Title+"%")
} }
@ -338,6 +341,7 @@ func (d *DutyHandle) GetTarget(c *gin.Context) {
} }
if systemEvalCont.RelevantDepartments != "" { if systemEvalCont.RelevantDepartments != "" {
systemEvalCont.RelevantDepartmentMap = strings.Split(systemEvalCont.RelevantDepartments, ",") systemEvalCont.RelevantDepartmentMap = strings.Split(systemEvalCont.RelevantDepartments, ",")
systemEvalCont.GroupMap = commonus.GetDuboDepart(strings.Split(systemEvalCont.RelevantDepartments, ","))
} }
if systemEvalCont.Report != "" { if systemEvalCont.Report != "" {
systemEvalCont.ReportMap = strings.Split(systemEvalCont.Report, ",") systemEvalCont.ReportMap = strings.Split(systemEvalCont.Report, ",")
@ -384,6 +388,16 @@ func (d *DutyHandle) DelTarget(c *gin.Context) {
if requestData.State == 0 { if requestData.State == 0 {
requestData.State = 1 requestData.State = 1
} }
//判断该指标是否已经被使用过
// var qualitativeEvaluationAry []assessmentmodel.QualitativeEvaluation
var qeId int64 = 0
judgeErrQe := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_id").Where("`qe_state` IN (1,2) AND `qe_target` = ?", requestData.Id).Find(&qeId)
if judgeErrQe == nil {
if qeId != 0 {
response.Result(103, qeId, "该指标已经再考核方案中使用!请先解除使用关系,再进行删除操作!", c)
return
}
}
saveData := commonus.MapOut() saveData := commonus.MapOut()
saveData["et_state"] = requestData.State saveData["et_state"] = requestData.State
saveData["et_time"] = time.Now().Unix() saveData["et_time"] = time.Now().Unix()
@ -464,6 +478,8 @@ func (d *DutyHandle) EiteTarget(c *gin.Context) {
return return
} }
saveData["et_relevant_departments"] = strings.Join(requestData.RelevantDepartments, ",") saveData["et_relevant_departments"] = strings.Join(requestData.RelevantDepartments, ",")
} else {
saveData["et_relevant_departments"] = ""
} }
} }
if requestData.Dimension != "" { if requestData.Dimension != "" {

43
gin_server_admin/api/v1/shiyan/shiyan.go

@ -13,6 +13,7 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/commonus" "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/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/approvalprocess" "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/common/response"
"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/model/wechat" "github.com/flipped-aurora/gin-vue-admin/server/model/wechat"
@ -1298,3 +1299,45 @@ func (s *ShiyanApi) DateTime(c *gin.Context) {
quer := commonus.ComputingTime(requestData.Time, requestData.Type) quer := commonus.ComputingTime(requestData.Time, requestData.Type)
response.Result(0, quer, "查询成功", c) response.Result(0, quer, "查询成功", c)
} }
//校正权重
func (s *ShiyanApi) CorrectionWeight(c *gin.Context) {
var ddwList assessmentmodel.DepartmentDimensionWeight
err := global.GVA_DB_Performanceappraisal.Find(&ddwList)
if err != nil {
fmt.Println()
return
}
}
//考核方案去重
func (s *ShiyanApi) DeltDutyChongfu(c *gin.Context) {
var list []assessmentmodel.QualitativeEvaluation
err := global.GVA_DB_Performanceappraisal.Find(&list).Error
if err != nil {
response.Result(0, err, "没有数据", c)
return
}
for _, v := range list {
DelteGroup(v.Group, v.AcceptEvaluation, v.Dimension, v.Target, v.TargetSun, v.DetailedTarget, v.DepartmentId)
}
}
//执行去重删除操作
func DelteGroup(group, depart, dime, target, suntar, detaid int64, runDepart string) {
var countId []int64
err := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_id").Where("`qe_group` = ? AND `qe_accept_evaluation` = ? AND `qe_dimension` = ? AND `qe_target` = ? AND `qe_target_sun` = ? AND `qe_detailed_target` = ? AND `qe_department_id` = ?", group, depart, dime, target, suntar, detaid, runDepart).Find(&countId).Error
if err != nil {
return
}
if len(countId) < 2 {
return
}
for i, v := range countId {
if i != 0 {
fmt.Printf("%v\n", v)
global.GVA_DB_Performanceappraisal.Where("`qe_id` = ?", v).Delete(&assessmentmodel.QualitativeEvaluation{})
}
}
}

2
gin_server_admin/api/wechatapp/callback/apphandle.go

@ -180,7 +180,7 @@ func (c *CallBackData) DecryptMessage(cs *gin.Context) (echoMsg string) {
} }
// fmt.Printf("yyyyyyyy------------->%v\n", string(jsonStr)) // fmt.Printf("yyyyyyyy------------->%v\n", string(jsonStr))
if msgContent.Event != "LOCATION" { if msgContent.Event != "LOCATION" {
global.GVA_DB_WechatCallBack.Create(&callbackLog) // global.GVA_DB_WechatCallBack.Create(&callbackLog)
} }
return return
} }

9
gin_server_admin/api/wechatapp/callback/rationcallback.go

@ -6,7 +6,6 @@ import (
"strings" "strings"
"time" "time"
evals "github.com/flipped-aurora/gin-vue-admin/server/api/index/evaluation"
"github.com/flipped-aurora/gin-vue-admin/server/api/wechatapp/sendmessage" "github.com/flipped-aurora/gin-vue-admin/server/api/wechatapp/sendmessage"
"github.com/flipped-aurora/gin-vue-admin/server/commonus" "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/global"
@ -49,9 +48,10 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleRation(orderId, clickEnte
} }
if clickEnter == "1" { if clickEnter == "1" {
userKeyStr := strconv.FormatInt(userContInfo.Key, 10) userKeyStr := strconv.FormatInt(userContInfo.Key, 10)
evals.UpEvaluationProcessApproval(scoreFlowInfo.Key, 16182159043990656, 0, 2, userKeyStr) // evals.UpEvaluationProcessApproval(scoreFlowInfo.Key, 16182159043990656, 0, 2, userKeyStr)
commonus.StepAddData(scoreFlowInfo.Key, 16182159043990656, 3, 7, 2, 2, 2, userKeyStr)
saveData := commonus.MapOut() saveData := commonus.MapOut()
saveData["fl_reply"] = 2 saveData["fl_reply"] = 3
saveData["fl_eite_time"] = time.Now().Unix() saveData["fl_eite_time"] = time.Now().Unix()
EiteDutiesInfoes(scoreFlowInfo.Key, saveData) EiteDutiesInfoes(scoreFlowInfo.Key, saveData)
@ -112,7 +112,8 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleRation(orderId, clickEnte
fmt.Printf("2、更新发送信息返回:%v-----------%v----------->%v-----\n", string(callbakcMsg), isTrueCall, callBackCont) fmt.Printf("2、更新发送信息返回:%v-----------%v----------->%v-----\n", string(callbakcMsg), isTrueCall, callBackCont)
} else { } else {
userKeyStr := strconv.FormatInt(userContInfo.Key, 10) userKeyStr := strconv.FormatInt(userContInfo.Key, 10)
evals.UpEvaluationProcessApproval(scoreFlowInfo.Key, 16182159043990656, 0, 2, userKeyStr) // evals.UpEvaluationProcessApproval(scoreFlowInfo.Key, 16182159043990656, 0, 2, userKeyStr)
commonus.StepAddData(scoreFlowInfo.Key, 16182159043990656, 1, 7, 2, 3, 2, userKeyStr)
saveData := commonus.MapOut() saveData := commonus.MapOut()
saveData["fl_reply"] = 2 saveData["fl_reply"] = 2
saveData["fl_eite_time"] = time.Now().Unix() saveData["fl_eite_time"] = time.Now().Unix()

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

@ -26,21 +26,24 @@ func templateEventPush(eventMsg []byte) {
fmt.Printf("button======>%v\n", msgContent.EventKey) fmt.Printf("button======>%v\n", msgContent.EventKey)
buttonClick := strings.Split(msgContent.EventKey, "_") buttonClick := strings.Split(msgContent.EventKey, "_")
buttonLen := len(buttonClick)
fmt.Printf("Step------ButtionAry------->%v=====>%v\n", buttonClick, buttonLen)
if buttonLen >= 3 {
for i, v := range buttonClick {
if len(buttonClick) >= 3 { fmt.Printf("%v====================>%v==================>%v\n", i, v, buttonClick[1])
// for i, v := range buttonClick { }
// fmt.Printf("%v====================>%v==================>%v\n", i, v, buttonClick[1])
// }
switch buttonClick[0] { switch buttonClick[0] {
case "duty": //数据考核审批工作 case "duty": //数据考核审批工作
// fmt.Printf("@@@@\n") fmt.Printf("@@@@\n")
// msgContent.ButtonTemplateCallBackHandle(buttonClick[1], buttonClick[2]) // msgContent.ButtonTemplateCallBackHandle(buttonClick[1], buttonClick[2])
msgContent.ButtonTemplateCallBackHandleBackups(buttonClick[1], buttonClick[2]) msgContent.ButtonTemplateCallBackHandleBackups(buttonClick[1], buttonClick[2])
case "ration": case "ration":
msgContent.ButtonTemplateCallBackHandleRation(buttonClick[1], buttonClick[2]) msgContent.ButtonTemplateCallBackHandleRation(buttonClick[1], buttonClick[2])
default: default:
} }
} else {
fmt.Printf("Step------Buttion------->%v\n", buttonClick)
} }
jsonStr, _ := json.Marshal(msgContent) jsonStr, _ := json.Marshal(msgContent)
@ -72,47 +75,55 @@ func sendErrMsg(userKey, orderId, title, cont, DepartmentName, Name, cardJumpUrl
@clickEnter 1同意2驳回 @clickEnter 1同意2驳回
*/ */
func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnter string) { func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnter string) {
fmt.Printf("Step------Begin------->\n")
//1、获取点击人信息 //1、获取点击人信息
userContInfoIstrue, userContInfo := commonus.GetUesrContForWechatID(t.FromUsername) userContInfoIstrue, userContInfo := commonus.GetUesrContForWechatID(t.FromUsername)
if userContInfoIstrue != true { if userContInfoIstrue != true {
fmt.Printf("Step------1------->\n")
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", orderId)
sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl) sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!1", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl)
return return
} }
//2、获取审批单信息 //2、获取审批单信息
var scoreFlowInfo assessmentmodel.ScoreFlow var scoreFlowInfo assessmentmodel.ScoreFlow
judegFlowErr := global.GVA_DB_Performanceappraisal.Where("`sf_key` = ?", orderId).First(&scoreFlowInfo).Error judegFlowErr := global.GVA_DB_Performanceappraisal.Where("`sf_key` = ?", orderId).First(&scoreFlowInfo).Error
if judegFlowErr != nil { if judegFlowErr != nil {
fmt.Printf("Step------2------->%v------>%v\n", orderId, judegFlowErr)
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", orderId)
sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl) sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!2", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl)
return return
} }
//3、获取审批流程 //3、获取审批流程
var evalProc assessmentmodel.EvaluationProcess var evalProc assessmentmodel.EvaluationProcess
judgeErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", orderId).First(&evalProc).Error judgeErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", orderId).First(&evalProc).Error
if judgeErr != nil { if judgeErr != nil {
fmt.Printf("Step------3------->\n")
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", orderId)
sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl) sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!3", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl)
return return
} }
fmt.Printf("Step------3----1--->\n")
//解析审批流 //解析审批流
var flowLog []evals.FlowStep var flowLog []evals.FlowStep
jsonFlowErr := json.Unmarshal([]byte(evalProc.Content), &flowLog) jsonFlowErr := json.Unmarshal([]byte(evalProc.Content), &flowLog)
setpLen := len(flowLog) setpLen := len(flowLog)
if jsonFlowErr != nil || setpLen < 1 { if jsonFlowErr != nil || setpLen < 1 {
fmt.Printf("Step------4------->\n")
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", orderId)
sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl) sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!4", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl)
return return
} }
//得到当前步进值 //得到当前步进值
currentSetp := setpLen - 1 currentSetp := setpLen - 1
if currentSetp < 0 { if currentSetp < 0 {
currentSetp = 0 currentSetp = 0
} }
fmt.Printf("Step------4---1---->%v\n", flowLog[currentSetp].NextStep)
//判断通过还是驳回 //判断通过还是驳回
if clickEnter == "1" { if clickEnter == "1" {
//同意 //同意
@ -120,7 +131,7 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
switch flowLog[currentSetp].NextStep { switch flowLog[currentSetp].NextStep {
case 1: case 1:
orderIdInt, _ := strconv.ParseInt(orderId, 10, 64) orderIdInt, _ := strconv.ParseInt(orderId, 10, 64)
commonus.StepAddData(orderIdInt, 0, 1, 1, strconv.FormatInt(userContInfo.Key, 10)) commonus.StepAddData(orderIdInt, 0, 1, 1, 1, 1, 1, strconv.FormatInt(userContInfo.Key, 10))
//发起人 //发起人
taskId := strconv.FormatInt(commonus.GetFileNumberEs(), 10) taskId := strconv.FormatInt(commonus.GetFileNumberEs(), 10)
evaluationPlanStr := strconv.FormatInt(scoreFlowInfo.EvaluationPlan, 10) evaluationPlanStr := strconv.FormatInt(scoreFlowInfo.EvaluationPlan, 10)
@ -138,7 +149,7 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
case 2: case 2:
//发起人部门负责人 //发起人部门负责人
orderIdInt, _ := strconv.ParseInt(orderId, 10, 64) orderIdInt, _ := strconv.ParseInt(orderId, 10, 64)
commonus.StepAddData(orderIdInt, 16182159043990656, 3, 2, strconv.FormatInt(userContInfo.Key, 10)) commonus.StepAddData(orderIdInt, 16182159043990656, 3, 2, 1, 1, 2, strconv.FormatInt(userContInfo.Key, 10))
//获取发起人部门负责人 //获取发起人部门负责人
sendUserIsTrue, sendUserList := commonus.GetSendMsgUserAry(16182159043990656, userContInfo.DepartmentId) //获取发起人部门负责人 sendUserIsTrue, sendUserList := commonus.GetSendMsgUserAry(16182159043990656, userContInfo.DepartmentId) //获取发起人部门负责人
if sendUserIsTrue == true { if sendUserIsTrue == true {
@ -157,6 +168,7 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
//1、获取责任部门内勤信息 //1、获取责任部门内勤信息
officWorkUserIsTrue, officWorkUserList := commonus.GetSendMsgUser(16118387069540343, scoreFlowInfo.DutyDepartment) //获取对应部门内勤 officWorkUserIsTrue, officWorkUserList := commonus.GetSendMsgUser(16118387069540343, scoreFlowInfo.DutyDepartment) //获取对应部门内勤
if officWorkUserIsTrue != true { if officWorkUserIsTrue != true {
fmt.Printf("Step------5------->\n")
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", orderId)
sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl) sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl)
@ -166,6 +178,7 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
var programme assessmentmodel.QualitativeEvaluation var programme assessmentmodel.QualitativeEvaluation
judgeProgramme := global.GVA_DB_Performanceappraisal.Where("`qe_id` = ?", scoreFlowInfo.EvaluationPlan).First(&programme).Error judgeProgramme := global.GVA_DB_Performanceappraisal.Where("`qe_id` = ?", scoreFlowInfo.EvaluationPlan).First(&programme).Error
if judgeProgramme != nil { if judgeProgramme != nil {
fmt.Printf("Step------6------->\n")
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", orderId)
sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl) sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl)
@ -225,7 +238,7 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
//是否需要整改 //是否需要整改
if scoreFlowInfo.Rectification == 1 { if scoreFlowInfo.Rectification == 1 {
//需要整改 //需要整改
commonus.StepAddData(orderIdInt, 16182159043990656, 5, 7, strconv.FormatInt(userContInfo.Key, 10))
//获取主要责任人 //获取主要责任人
var personLiable []string var personLiable []string
teamBility, teamErr := commonus.GetDivisionOfResponsibility(orderId, 1) teamBility, teamErr := commonus.GetDivisionOfResponsibility(orderId, 1)
@ -240,6 +253,8 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
fmt.Printf("发送整改通知!没有主要负责人%v\n", teamBility) fmt.Printf("发送整改通知!没有主要负责人%v\n", teamBility)
} }
sendUserList := strings.Join(personLiable, "|") sendUserList := strings.Join(personLiable, "|")
fmt.Printf("Setp-------6----------->%v----------->%v\n", sendUserList, personLiable)
//获取考核项目关联项目 //获取考核项目关联项目
targettitle, detailedRulesTitle, detailedRulesInfo, unit, flowContent, _ := commonus.GetDutyAssociatedItems(orderId) targettitle, detailedRulesTitle, detailedRulesInfo, unit, flowContent, _ := commonus.GetDutyAssociatedItems(orderId)
//一级文本处理 //一级文本处理
@ -272,9 +287,10 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
sourceDesc := "整改通知" sourceDesc := "整改通知"
var sendTextMsg sendmessage.TextNoticeTemplateMedium var sendTextMsg sendmessage.TextNoticeTemplateMedium
sendTextMsg.SendMsgTextShare(sendUserList, taskId, title, desc, quoteAreaTitle, quoteAreaContent, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, cardJumpUrl, jumpUrl, jumpUrlTitle, sourceDesc) sendTextMsg.SendMsgTextShare(sendUserList, taskId, title, desc, quoteAreaTitle, quoteAreaContent, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, cardJumpUrl, jumpUrl, jumpUrlTitle, sourceDesc)
commonus.StepAddData(orderIdInt, 16182159043990656, 5, 7, 1, 1, 4, strconv.FormatInt(userContInfo.Key, 10))
} else { } else {
//不需要整改 //不需要整改
commonus.StepAddData(orderIdInt, 16182159043990656, 7, 7, strconv.FormatInt(userContInfo.Key, 10))
//获取发起人信息 //获取发起人信息
var sendUser string = "" var sendUser string = ""
faQiRen, _ := commonus.GetWorkUser(strconv.FormatInt(scoreFlowInfo.EvaluationUser, 10)) faQiRen, _ := commonus.GetWorkUser(strconv.FormatInt(scoreFlowInfo.EvaluationUser, 10))
@ -338,13 +354,14 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
buttonMap = append(buttonMap, buttonCont) buttonMap = append(buttonMap, buttonCont)
var sendTextMsg sendmessage.ButtonNoticeTemplateMedium var sendTextMsg sendmessage.ButtonNoticeTemplateMedium
sendTextMsg.SendButtonShare(sendUser, taskId, "验收", title, desc, subtitle, reason, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, cardJumpUrl, buttonMap) sendTextMsg.SendButtonShare(sendUser, taskId, "验收", title, desc, subtitle, reason, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, cardJumpUrl, buttonMap)
commonus.StepAddData(orderIdInt, 16182159043990656, 7, 7, 1, 1, 4, strconv.FormatInt(userContInfo.Key, 10))
} }
case 5: case 5:
//主要责任人整改 //主要责任人整改
case 6: case 6:
//责任部门审批(部门负责人) //责任部门审批(部门负责人)
orderIdInt, _ := strconv.ParseInt(orderId, 10, 64) //流程Key orderIdInt, _ := strconv.ParseInt(orderId, 10, 64) //流程Key
commonus.StepAddData(orderIdInt, 16182159043990656, 7, 7, strconv.FormatInt(userContInfo.Key, 10)) commonus.StepAddData(orderIdInt, 16182159043990656, 7, 7, 1, 1, 6, strconv.FormatInt(userContInfo.Key, 10))
sendButtonIsTrue, sendButtonList := commonus.GetSendMsgUserAry(16182159043990656, userContInfo.DepartmentId) //获取发起人部门负责人 sendButtonIsTrue, sendButtonList := commonus.GetSendMsgUserAry(16182159043990656, userContInfo.DepartmentId) //获取发起人部门负责人
if sendButtonIsTrue == true { if sendButtonIsTrue == true {
buttonClickNAmeOtherEs := fmt.Sprintf("%v%v", userContInfo.Name, "已批准") buttonClickNAmeOtherEs := fmt.Sprintf("%v%v", userContInfo.Name, "已批准")
@ -445,6 +462,7 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
sendUserAry = append(sendUserAry, dutyOff_v) sendUserAry = append(sendUserAry, dutyOff_v)
} }
} }
commonus.StepAddData(scoreFlowInfo.Id, 0, 0, 1, 1, 2, 7, strconv.FormatInt(userContInfo.Key, 10))
sendMsgToUserList := strings.Join(sendUserAry, "|") sendMsgToUserList := strings.Join(sendUserAry, "|")
taskId := strconv.FormatInt(commonus.GetFileNumberEs(), 10) taskId := strconv.FormatInt(commonus.GetFileNumberEs(), 10)
@ -503,7 +521,7 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
case 2: case 2:
//发起人部门负责人 //发起人部门负责人
orderIdInt, _ := strconv.ParseInt(orderId, 10, 64) //流程Key orderIdInt, _ := strconv.ParseInt(orderId, 10, 64) //流程Key
commonus.StepAddData(orderIdInt, 16182159043990656, 1, 2, strconv.FormatInt(userContInfo.Key, 10)) commonus.StepAddData(orderIdInt, 16182159043990656, 1, 2, 1, 3, 2, strconv.FormatInt(userContInfo.Key, 10))
sendButtonIsTrue, sendButtonList := commonus.GetSendMsgUserAry(16182159043990656, userContInfo.DepartmentId) //获取发起人部门负责人 sendButtonIsTrue, sendButtonList := commonus.GetSendMsgUserAry(16182159043990656, userContInfo.DepartmentId) //获取发起人部门负责人
if sendButtonIsTrue == true { if sendButtonIsTrue == true {
buttonClickNAmeOtherEs := fmt.Sprintf("%v%v", userContInfo.Name, "已驳回") buttonClickNAmeOtherEs := fmt.Sprintf("%v%v", userContInfo.Name, "已驳回")
@ -563,7 +581,7 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
} }
//退回到本部门内勤 //退回到本部门内勤
orderIdInt, _ := strconv.ParseInt(orderId, 10, 64) //流程Key orderIdInt, _ := strconv.ParseInt(orderId, 10, 64) //流程Key
commonus.StepAddData(orderIdInt, 16182159043990656, 3, 7, strconv.FormatInt(userContInfo.Key, 10)) commonus.StepAddData(orderIdInt, 16182159043990656, 3, 7, 1, 3, 4, strconv.FormatInt(userContInfo.Key, 10))
//1、获取本部门内勤 //1、获取本部门内勤
_, butCallBackUser := commonus.GetSendMsgUser(16118387069540343, userContInfo.DepartmentId) //获取对应部门内勤(高科) _, butCallBackUser := commonus.GetSendMsgUser(16118387069540343, userContInfo.DepartmentId) //获取对应部门内勤(高科)
//获取考核项目关联项目 //获取考核项目关联项目
@ -618,7 +636,7 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
} }
//退回到主要责任人 //退回到主要责任人
orderIdInt, _ := strconv.ParseInt(orderId, 10, 64) //流程Key orderIdInt, _ := strconv.ParseInt(orderId, 10, 64) //流程Key
commonus.StepAddData(orderIdInt, 16182159043990656, 5, 7, strconv.FormatInt(userContInfo.Key, 10)) commonus.StepAddData(orderIdInt, 16182159043990656, 5, 7, 1, 3, 6, strconv.FormatInt(userContInfo.Key, 10))
//获取主要责任人 //获取主要责任人
var personLiable []string var personLiable []string
teamBility, teamErr := commonus.GetDivisionOfResponsibility(orderId, 1) teamBility, teamErr := commonus.GetDivisionOfResponsibility(orderId, 1)
@ -688,7 +706,7 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
//是否需要整改 //是否需要整改
if scoreFlowInfo.Rectification == 1 { if scoreFlowInfo.Rectification == 1 {
//存在整改 //存在整改
commonus.StepAddData(orderIdInt, 0, 5, 5, strconv.FormatInt(userContInfo.Key, 10)) commonus.StepAddData(orderIdInt, 0, 5, 5, 1, 3, 7, strconv.FormatInt(userContInfo.Key, 10))
//获取主要责任人 //获取主要责任人
var personLiable []string var personLiable []string
teamBility, teamErr := commonus.GetDivisionOfResponsibility(orderId, 1) teamBility, teamErr := commonus.GetDivisionOfResponsibility(orderId, 1)
@ -752,7 +770,7 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
sendTextMsg.SendMsgTextShare(sendUserList, taskId, title, desc, mainTitleDesc, reason, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, cardJumpUrl, jumpUrl, jumpUrlTitle, sourceDesc) sendTextMsg.SendMsgTextShare(sendUserList, taskId, title, desc, mainTitleDesc, reason, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, cardJumpUrl, jumpUrl, jumpUrlTitle, sourceDesc)
} else { } else {
//不需要整改 //不需要整改
commonus.StepAddData(orderIdInt, 0, 3, 5, strconv.FormatInt(userContInfo.Key, 10)) commonus.StepAddData(orderIdInt, 0, 3, 5, 1, 3, 7, strconv.FormatInt(userContInfo.Key, 10))
//2.3、获取职责部门内勤 //2.3、获取职责部门内勤
_, dutyOffUserList := commonus.GetSendMsgUserAry(16118387069540343, scoreFlowInfo.DutyDepartment) //获取职责部门内勤 _, dutyOffUserList := commonus.GetSendMsgUserAry(16118387069540343, scoreFlowInfo.DutyDepartment) //获取职责部门内勤
//获取考核项目关联项目 //获取考核项目关联项目

535
gin_server_admin/commonus/publichaneld.go

@ -1046,7 +1046,7 @@ func AddDimenTargetWeight(setType, group, departmentID, dimensionId, targetId in
var weightSum int64 = 0 var weightSum int64 = 0
// fmt.Printf("1-----@---2------->%v\n", targetId) // fmt.Printf("1-----@---2------->%v\n", targetId)
if targetId != 0 { if targetId != 0 {
weghtErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Where("`qe_group` = ? AND `qe_accept_evaluation` = ? AND `qe_dimension` = ? AND `qe_target` = ?", group, departmentID, dimensionId, targetId).Pluck("COALESCE(SUM(qe_reference_score), 0) as qe_reference_score", &weightSum).Error weghtErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Where("`qe_state` = 1 AND `qe_group` = ? AND `qe_accept_evaluation` = ? AND `qe_dimension` = ? AND `qe_target` = ?", group, departmentID, dimensionId, targetId).Pluck("COALESCE(SUM(qe_reference_score), 0) as qe_reference_score", &weightSum).Error
// msg = fmt.Sprintf("1-----@---1------->%v\n", weightSum) // msg = fmt.Sprintf("1-----@---1------->%v\n", weightSum)
if weghtErr == nil { if weghtErr == nil {
@ -1097,7 +1097,7 @@ func AddDimensionWeight(setType, group, departmentID, dimensionId int64) {
var weightSum int64 = 0 var weightSum int64 = 0
fmt.Printf("1-------@-------->%v\n", departmentID) fmt.Printf("1-------@-------->%v\n", departmentID)
if dimensionId != 0 { if dimensionId != 0 {
weghtErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Where("`qe_group` = ? AND `qe_accept_evaluation` = ? AND `qe_dimension` = ?", group, departmentID, dimensionId).Pluck("COALESCE(SUM(qe_reference_score), 0) as qe_reference_score", &weightSum).Error weghtErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Where("`qe_state` = 1 AND `qe_group` = ? AND `qe_accept_evaluation` = ? AND `qe_dimension` = ?", group, departmentID, dimensionId).Pluck("COALESCE(SUM(qe_reference_score), 0) as qe_reference_score", &weightSum).Error
if weghtErr == nil { if weghtErr == nil {
var ddwCont assessmentmodel.DepartmentDimensionWeight var ddwCont assessmentmodel.DepartmentDimensionWeight
judgeTrue := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DepartmentDimensionWeight{}).Select("ddw_id").Where("`ddw_hierarchy` = 1 AND `ddw_group` = ? AND `ddw_derpatment` = ? AND `ddw_dimension` = ?", group, departmentID, dimensionId).First(&ddwCont).Error judgeTrue := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.DepartmentDimensionWeight{}).Select("ddw_id").Where("`ddw_hierarchy` = 1 AND `ddw_group` = ? AND `ddw_derpatment` = ? AND `ddw_dimension` = ?", group, departmentID, dimensionId).First(&ddwCont).Error
@ -1357,6 +1357,25 @@ func GetWorkUser(key string) (userCont testpage.PersonalDetails, isTrue bool) {
if userErr == nil { if userErr == nil {
isTrue = true isTrue = true
} }
iconUrl := ""
if userCont.Icon == "" {
if userCont.WechatId != "" {
wechatInfo, wechatErr := GetWorkWechatDuiZhao(userCont.WechatId)
if wechatErr == true {
iconUrl = wechatInfo.Avatar
userCont.Icon = iconUrl
}
}
if userCont.WorkWechatId != "" {
if iconUrl == "" {
wechatWorkInfo, wechatWorkErr := GetWorkWechatDuiZhao(userCont.WorkWechatId)
if wechatWorkErr == true {
iconUrl = wechatWorkInfo.Avatar
userCont.Icon = iconUrl
}
}
}
}
return return
} }
@ -1405,10 +1424,16 @@ func GetWorkWechatDuiZhao(openid string) (userInfoStruct wechat.WechatUsers, isT
@userKey 操作人key @userKey 操作人key
@roleGroupId 角色组Id @roleGroupId 角色组Id
@stepName 步骤名称 @stepName 步骤名称
@typeclass 1定性2定量
@state 状态
@stepInt 当前是第几部 @stepInt 当前是第几部
@recStrat 是否改正
@nextStep 下一步 @nextStep 下一步
*/ */
func StepAddData(flowID, roleGroupId int64, nextStep, stepName int, userKey string) { func StepAddData(flowID, roleGroupId int64, nextStep, stepName, typeclass, state, stepInt int, userKey string) {
if state < 1 {
state = 1
}
var evalProCont assessmentmodel.EvaluationProcess var evalProCont assessmentmodel.EvaluationProcess
judgeErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", flowID).First(&evalProCont).Error judgeErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", flowID).First(&evalProCont).Error
var flowStepAryMap []FlowStep var flowStepAryMap []FlowStep
@ -1423,6 +1448,20 @@ func StepAddData(flowID, roleGroupId int64, nextStep, stepName int, userKey stri
flowSteping.ClickName = userKey //操作人 flowSteping.ClickName = userKey //操作人
flowSteping.AddTime = time.Now().Unix() //添加时间 flowSteping.AddTime = time.Now().Unix() //添加时间
flowStepAryMap = append(flowStepAryMap, flowSteping) 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 = IntegrationFlowAll(flowID, typeclass)
global.GVA_DB_Performanceappraisal.Create(&evalProCont)
} else { } else {
var flowStepAry []FlowStep var flowStepAry []FlowStep
var flowStepArys []FlowStep var flowStepArys []FlowStep
@ -1452,10 +1491,403 @@ func StepAddData(flowID, roleGroupId int64, nextStep, stepName int, userKey stri
if flowStepErr == nil { if flowStepErr == nil {
saveData["ep_cont"] = string(flowStepJson) saveData["ep_cont"] = string(flowStepJson)
} }
saveData["ep_participants"] = fmt.Sprintf("%v,%v", evalProCont.Participants, userKey)
saveData["ep_state"] = state
saveData["ep_next_cont"] = InsetFlowLog(state, stepInt, userKey, evalProCont.NextContent)
EiteDutiesInfoes(evalProCont.Id, saveData) EiteDutiesInfoes(evalProCont.Id, saveData)
} }
} }
//流程操作解析
/*
@state 状态
@stepInt 当前是第几部
@recStrat 是否改正
@userKey 操作人key
@flowMapStr 流程图字符串
*/
func InsetFlowLog(state, stepInt int, userKey, flowMapStr string) (flowAllMap string) {
var flowMap []FlowAllMap
jsonErr := json.Unmarshal([]byte(flowMapStr), flowMap)
if jsonErr != nil {
flowAllMap = flowMapStr
return
}
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 = v.State
} else {
eiteFlowInfo.State = 1
}
eiteFlowInfo.Class = v.Class
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
if u_v.Id == userKey {
var logListMap LogList
logListMap.State = state
logListMap.TimeVal = GetToDayAll()
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)
if jsonErrSet == nil {
flowAllMap = string(jsonStr)
}
return
}
//写入责任分配节点人员信息
func WriteFlowMainSet(orderId int64, userKey []int64) {
if len(userKey) < 1 {
return
}
var evalProCont assessmentmodel.EvaluationProcess
judgeErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", orderId).First(&evalProCont).Error
if judgeErr != nil {
return
}
flowAllMapOldStr := evalProCont.NextContent
var flowMap []FlowAllMap
jsonErr := json.Unmarshal([]byte(evalProCont.NextContent), flowMap)
if jsonErr != nil {
return
}
var eiteFlowMap []FlowAllMap
for _, v := range flowMap {
var eiteFlowInfo FlowAllMap
eiteFlowInfo.Step = v.Step
eiteFlowInfo.NodeName = v.NodeName
eiteFlowInfo.State = v.State
eiteFlowInfo.Class = v.Class
if v.Step == 5 {
var userClickAry []UserListFlowAll
for _, u_v := range userKey {
_, userCont := GetUesrContForWechatID(strconv.FormatInt(u_v, 10))
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
userClickAry = append(userClickAry, returnUser)
}
eiteFlowInfo.UserList = userClickAry
} else {
eiteFlowInfo.UserList = v.UserList
}
eiteFlowMap = append(eiteFlowMap, eiteFlowInfo)
}
jsonStr, jsonErrSet := json.Marshal(eiteFlowMap)
if jsonErrSet == nil {
flowAllMapOldStr = string(jsonStr)
}
saveEiteData := MapOut()
saveEiteData["ep_time"] = time.Now().Unix()
saveEiteData["ep_next_cont"] = flowAllMapOldStr
EiteDutiesInfoes(evalProCont.Id, saveEiteData)
}
//组合流程图全面
/*
@class 流程类型
*/
func IntegrationFlowAll(flowID int64, class int) (flowAllMap string) {
var flowMap []FlowAllMap
//1、创建
var oneFlowInfo FlowAllMap
oneFlowInfo.Step = 1
oneFlowInfo.NodeName = GetSetpName(1)
oneFlowInfo.State = 2
oneFlowInfo.Class = 1
oneFlowInfo.UserList = GetFlowNodeMan(flowID, class, 1)
flowMap = append(flowMap, oneFlowInfo)
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 = GetFlowNodeMan(flowID, class, 3)
flowMap = append(flowMap, twoFlowInfo)
//3、被考核部门内勤进行责任划分
var threeFlowInfo FlowAllMap
threeFlowInfo.Step = 3
threeFlowInfo.NodeName = GetSetpName(3)
threeFlowInfo.State = 1
threeFlowInfo.Class = 1
threeFlowInfo.UserList = GetFlowNodeMan(flowID, class, 4)
flowMap = append(flowMap, threeFlowInfo)
//4、被考核部门负责人对责任划分确认
var fourFlowInfo FlowAllMap
fourFlowInfo.Step = 4
fourFlowInfo.NodeName = GetSetpName(7)
fourFlowInfo.State = 1
fourFlowInfo.Class = 1
fourFlowInfo.UserList = GetFlowNodeMan(flowID, class, 5)
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 = GetFlowNodeMan(flowID, class, 5)
flowMap = append(flowMap, fiveFlowInfo)
//6、被考核部门负责人对整改措施确认
var sixFlowInfo FlowAllMap
sixFlowInfo.Step = 6
sixFlowInfo.NodeName = GetSetpName(7)
sixFlowInfo.State = 1
sixFlowInfo.Class = 1
sixFlowInfo.UserList = GetFlowNodeMan(flowID, class, 5)
flowMap = append(flowMap, sixFlowInfo)
//7、发起人验收
var serverFlowInfo FlowAllMap
serverFlowInfo.Step = 7
serverFlowInfo.NodeName = GetSetpName(5)
serverFlowInfo.State = 1
serverFlowInfo.Class = 1
serverFlowInfo.UserList = GetFlowNodeMan(flowID, class, 1)
flowMap = append(flowMap, serverFlowInfo)
} else {
//5、发起人验收
var serverEsFlowInfo FlowAllMap
serverEsFlowInfo.Step = 5
serverEsFlowInfo.NodeName = GetSetpName(5)
serverEsFlowInfo.State = 1
serverEsFlowInfo.Class = 1
serverEsFlowInfo.UserList = GetFlowNodeMan(flowID, class, 1)
flowMap = append(flowMap, serverEsFlowInfo)
}
}
} else {
//定量
//1、创建
var twoFlowInfo FlowAllMap
twoFlowInfo.Step = 2
twoFlowInfo.NodeName = GetSetpName(7)
twoFlowInfo.State = 1
twoFlowInfo.Class = 1
twoFlowInfo.UserList = GetFlowNodeMan(flowID, class, 5)
flowMap = append(flowMap, twoFlowInfo)
}
flowAllMapByte, eer := json.Marshal(flowMap)
if eer == nil {
flowAllMap = string(flowAllMapByte)
}
return
}
//获取节点操作人
/*
@flowID 流程ID
@class 1定性2定量
@style 1测评人2测评人部门内勤3测评人部门负责人4被测评部门内勤5被测评部门负责人
*/
func GetFlowNodeMan(flowID int64, class, style int) (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
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) {
isTrue = false isTrue = false
@ -1561,15 +1993,28 @@ func GetDivisionOfResponsibility(orderId string, class int) (contList []map[stri
} }
cont["weight"] = v.Weight cont["weight"] = v.Weight
cont["userkey"] = v.UserKey cont["userkey"] = v.UserKey
//获取人员信息
userCont, userContErr := GetWorkUser(strconv.FormatInt(v.UserKey, 10))
cont["wechatid"] = ""
if v.UserName != "" { if v.UserName != "" {
cont["username"] = v.UserName cont["username"] = v.UserName
if userContErr == true {
if userCont.WechatId != "" {
cont["wechatid"] = userCont.WechatId
}
if userCont.WorkWechatId != "" {
cont["wechatid"] = userCont.WorkWechatId
}
}
} else { } else {
//获取人员信息
userCont, userContErr := GetWorkUser(strconv.FormatInt(v.UserKey, 10))
if userContErr == true { if userContErr == true {
cont["username"] = userCont.Name cont["username"] = userCont.Name
} else { if userCont.WechatId != "" {
cont["username"] = v.UserName cont["wechatid"] = userCont.WechatId
}
if userCont.WorkWechatId != "" {
cont["wechatid"] = userCont.WorkWechatId
}
} }
} }
cont["groupid"] = v.Group cont["groupid"] = v.Group
@ -1624,15 +2069,28 @@ func GetDivisionOfResponsibility(orderId string, class int) (contList []map[stri
} }
cont["weight"] = v.Weight cont["weight"] = v.Weight
cont["userkey"] = v.UserKey cont["userkey"] = v.UserKey
//获取人员信息
userCont, userContErr := GetWorkUser(strconv.FormatInt(v.UserKey, 10))
cont["wechatid"] = ""
if v.UserName != "" { if v.UserName != "" {
cont["username"] = v.UserName cont["username"] = v.UserName
if userContErr == true {
if userCont.WechatId != "" {
cont["wechatid"] = userCont.WechatId
}
if userCont.WorkWechatId != "" {
cont["wechatid"] = userCont.WorkWechatId
}
}
} else { } else {
//获取人员信息
userCont, userContErr := GetWorkUser(strconv.FormatInt(v.UserKey, 10))
if userContErr == true { if userContErr == true {
cont["username"] = userCont.Name cont["username"] = userCont.Name
} else { if userCont.WechatId != "" {
cont["username"] = v.UserName cont["wechatid"] = userCont.WechatId
}
if userCont.WorkWechatId != "" {
cont["wechatid"] = userCont.WorkWechatId
}
} }
} }
cont["groupid"] = v.Group cont["groupid"] = v.Group
@ -1737,3 +2195,58 @@ func GetDivisionOfResponsibility(orderId string, class int) (contList []map[stri
} }
return return
} }
//判断是否存在
func IsItTrue(id int64, idAry []int64) (isTrue bool) {
isTrue = false
for _, v := range idAry {
if v == id {
return true
}
}
return
}
func IsItTrueString(id string, idAry []string) (isTrue bool) {
isTrue = false
for _, v := range idAry {
if v == id {
return true
}
}
return
}
//获取多部门归属集团
func GetDuboDepart(departAry []string) (group []string) {
for _, v := range departAry {
departID, _ := strconv.ParseInt(v, 10, 64)
isTrue, bfInfo := GetBranchFactory(departID)
if isTrue == true {
bfGetID := strconv.FormatInt(bfInfo.Group, 10)
if IsItTrueString(bfGetID, group) == false {
group = append(group, bfGetID)
}
}
}
return
}
//批量获取相关人员部门id
func GetDepartmentByUserBast(userKey []string) (userDepartmentId []string) {
if len(userKey) < 1 {
return
}
var usDepartId []int64
usDepartErr := global.GVA_DB_Master.Model(&testpage.WorkMan{}).Select("wm_bf_id").Where("`wm_key` IN ?", userKey).Group("wm_bf_id").Find(&usDepartId).Error
if usDepartErr != nil {
return
}
if len(usDepartId) < 1 {
return
}
for _, v := range usDepartId {
userDepartmentId = append(userDepartmentId, strconv.FormatInt(v, 10))
}
return
}

40
gin_server_admin/commonus/publicstruct.go

@ -85,3 +85,43 @@ type FlowStep struct {
StepName string `json:"stepname"` //步骤名称 StepName string `json:"stepname"` //步骤名称
NextStep int `json:"nextstep"` //下一步 1:内勤;2:部门负责人:3:整改;4:整改后部门负责;5:归档起草人 NextStep int `json:"nextstep"` //下一步 1:内勤;2:部门负责人:3:整改;4:整改后部门负责;5:归档起草人
} }
//流程全貌
type FlowAllMap struct {
Step int `json:"step"` //步伐
NodeName string `json:"nodename"` //节点名称
State int `json:"state"` //状态 1、不点亮;2、点亮
Class int `json:"class"` //节点类型 1、普通节点;2、运行中指定节点
UserList []UserListFlowAll `json:"userlist"` //节点操作人
}
//节点操作人
type UserListFlowAll struct {
Id string `json:"id"` //操作人ID
Name string `json:"name"` //操作人姓名
Icon string `json:"icon"` //操作人头像
Wechat string `json:"wechat"` //微信Openid
Group int64 `json:"group"` //集团公司
GroupName string `json:"groupname"` //分厂名称
DepartmentId int64 `json:"departmentid"` //分厂Id
DepartmentName string `json:"departmentname"` //分厂名称
WorkshopId int64 `json:"workshopid"` //工段Id
WorkshopName string `json:"workshopname"` //工段名称
PostId int64 `json:"postid"` //职务Id
PostName string `json:"postname"` //职务名称
Tema int64 `json:"tema"` //班组Id
TemaName string `json:"temaname"` //班组名称
LogList []LogList `json:"log"` //操作记录
}
//节点操作人操作记录
type LogList struct {
State int `json:"state"` //状态 1、未操作;2、通过;3、驳回
TimeVal string `json:"time"`
}
//流程操作节点操作人信息
type FlowNodePeopleInfo struct {
EvalCont UserListFlowAll `json:"evalcont"`
DutyCont UserListFlowAll `json:"dutycont"`
}

5
gin_server_admin/commonus/timeSub.go

@ -96,6 +96,11 @@ func GetToDay() (yesterday string) {
yesTime := now.AddDate(0, 0, 0).Format("2006-01-02") // 获取昨天的时间 yesTime := now.AddDate(0, 0, 0).Format("2006-01-02") // 获取昨天的时间
return yesTime return yesTime
} }
func GetToDayAll() (yesterday string) {
now := time.Now()
yesTime := now.AddDate(0, 0, 0).Format("2006-01-02 15:04:05") // 获取昨天的时间
return yesTime
}
/* /*
获取昨天时间 获取昨天时间

4
gin_server_admin/model/assessmentmodel/performance_appraisal.go

@ -61,8 +61,10 @@ type EvaluationProcess struct {
Content string `json:"content" gorm:"column:ep_cont;type:longtext;comment:流程步进值"` Content string `json:"content" gorm:"column:ep_cont;type:longtext;comment:流程步进值"`
NextContent string `json:"nextcontent" gorm:"column:ep_next_cont;type:mediumtext;comment:下一步内容"` NextContent string `json:"nextcontent" gorm:"column:ep_next_cont;type:mediumtext;comment:下一步内容"`
Time int64 `json:"time" gorm:"column:ep_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` Time int64 `json:"time" gorm:"column:ep_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
State int `json:"state" gorm:"column:ep_state;type:int(2) unsigned;default:1;not null;comment:状态(1:正常,2:禁用;3:废弃;4:删除)"` State int `json:"state" gorm:"column:ep_state;type:int(2) unsigned;default:1;not null;comment:1:审批,2:通过;3:驳回;"`
RoleGroup int64 `json:"rolegroup" gorm:"column:ep_role_group;type:bigint(20) unsigned;default:0;not null;comment:角色组"` RoleGroup int64 `json:"rolegroup" gorm:"column:ep_role_group;type:bigint(20) unsigned;default:0;not null;comment:角色组"`
TypeClass int `json:"type" gorm:"column:ep_type;type:tinyint(1) unsigned;default:1;not null;comment:1、定性;2、定量"`
Participants string `json:"participants" gorm:"column:ep_participants;type:mediumtext;comment:参与人"`
} }
func (EvaluationProcess *EvaluationProcess) TableName() string { func (EvaluationProcess *EvaluationProcess) TableName() string {

4
gin_server_admin/router/assessment/assessmentrouter.go

@ -189,7 +189,9 @@ func (s *AssessmentRouter) InitEvaluationRouter(Router *gin.RouterGroup) {
dutyIndexCodeRouter.POST("additionandsubtractionscore", authorityIndexApi.AdditionAndSubtractionScore) // 加减分 dutyIndexCodeRouter.POST("additionandsubtractionscore", authorityIndexApi.AdditionAndSubtractionScore) // 加减分
dutyIndexCodeRouter.POST("plusorminuspoints", authorityIndexApi.PlusOrMinusPoints) // 加减分NEW dutyIndexCodeRouter.POST("plusorminuspoints", authorityIndexApi.PlusOrMinusPoints) // 加减分NEW
dutyIndexCodeRouter.POST("adddivisionresponsibility", authorityIndexApi.AddDivisionResponsibility) // 划分责任人 dutyIndexCodeRouter.POST("adddivisionresponsibility", authorityIndexApi.AddDivisionResponsibility) // 划分责任人
dutyIndexCodeRouter.POST("rersonincharge", authorityIndexApi.PersonInCharge) // 划分责任人NEW
dutyIndexCodeRouter.POST("addcorrectivemeasures", authorityIndexApi.AddCorrectiveMeasures) //添加整改措施 dutyIndexCodeRouter.POST("addcorrectivemeasures", authorityIndexApi.AddCorrectiveMeasures) //添加整改措施
dutyIndexCodeRouter.POST("rectificationmeasures", authorityIndexApi.RectificationMeasures) //添加整改措施NEW
dutyIndexCodeRouter.POST("qualitativeevalration", authorityIndexApi.QualitativeEvalRation) // 定量考核列表 dutyIndexCodeRouter.POST("qualitativeevalration", authorityIndexApi.QualitativeEvalRation) // 定量考核列表
dutyIndexCodeRouter.POST("addflowrationlog", authorityIndexApi.AddFlowRationLog) // 添加定量考核列表 dutyIndexCodeRouter.POST("addflowrationlog", authorityIndexApi.AddFlowRationLog) // 添加定量考核列表
@ -198,5 +200,7 @@ func (s *AssessmentRouter) InitEvaluationRouter(Router *gin.RouterGroup) {
dutyIndexCodeRouter.POST("lookrationkscoreflow", authorityIndexApi.LookRationkScoreFlow) // 查看定量考核审批列表 dutyIndexCodeRouter.POST("lookrationkscoreflow", authorityIndexApi.LookRationkScoreFlow) // 查看定量考核审批列表
dutyIndexCodeRouter.POST("lookquantitativeconfig", authorityIndexApi.LookQuantitativeConfig) // 查看定量考核目标设定 dutyIndexCodeRouter.POST("lookquantitativeconfig", authorityIndexApi.LookQuantitativeConfig) // 查看定量考核目标设定
dutyIndexCodeRouter.POST("seeflowlog", authorityIndexApi.SeeFlowLog) // 流程列表
} }
} }

2
gin_server_admin/router/shiyan/sys_shiyan.go

@ -28,5 +28,7 @@ func (s *ShiyanRouter) InitShiyanRouter(Router *gin.RouterGroup) {
shiyanCodeRouter.POST("/getrequestoperation", authorityApi.GetRequestOperation) shiyanCodeRouter.POST("/getrequestoperation", authorityApi.GetRequestOperation)
shiyanCodeRouter.POST("/datetime", authorityApi.DateTime) //测试时间 shiyanCodeRouter.POST("/datetime", authorityApi.DateTime) //测试时间
shiyanCodeRouter.GET("deltdutychongfu", authorityApi.DeltDutyChongfu) //方案去重
} }
} }

7
gin_server_admin/router/systemadmin/dutyassess.go

@ -19,5 +19,12 @@ func (a *AdminRouter) InitStaffRouter(Router *gin.RouterGroup) {
adminRouter.POST("getdepartevaluate", authorityApi.GetDepartEvaluate) //获取部门考核列表 adminRouter.POST("getdepartevaluate", authorityApi.GetDepartEvaluate) //获取部门考核列表
adminRouter.POST("getdepartmentassesslist", authorityApi.GetDepartmentAssessList) //获取考核列表 adminRouter.POST("getdepartmentassesslist", authorityApi.GetDepartmentAssessList) //获取考核列表
adminRouter.POST("lookquantitativeconfig", authorityApi.LookQuantitativeConfig) // 查看定量考核目标设定 adminRouter.POST("lookquantitativeconfig", authorityApi.LookQuantitativeConfig) // 查看定量考核目标设定
adminRouter.POST("selectdutylist", authorityApi.SelectDutyList) //获取定性考核列表用于下拉列表
adminRouter.POST("dutydepartmentlist", authorityApi.DutyDepartmentList) //获取定性考核列表用于列表展示
adminRouter.POST("idtotargetsunlist", authorityApi.IdToTargetSunList) //根据指标ID获取列表信息
adminRouter.POST("getdetailedtargetcallback", authorityApi.GetDetailedTargetCallBack) //获取定性指标->指标细则修改回显
adminRouter.POST("eitedetailedtargetcallback", authorityApi.EiteDetailedTargetCallBack) //获取定性指标->指标细则修改回显与新增
adminRouter.POST("eitesuntargetname", authorityApi.EiteSunTargetName) //修改子栏目名称
} }
} }

Loading…
Cancel
Save