Browse Source

修改审批方式

qin_1
超级管理员 4 years ago
parent
commit
63b4266206
  1. 31
      gin_server_admin/api/admin/dutyassess/planversio.go
  2. 45
      gin_server_admin/api/index/evaluation/assessment.go
  3. 88
      gin_server_admin/api/index/evaluation/enter.go
  4. 310
      gin_server_admin/api/index/evaluation/evaluation.go
  5. 144
      gin_server_admin/api/index/evaluation/examineflow.go
  6. 93
      gin_server_admin/api/index/evaluation/flowsend.go
  7. 177
      gin_server_admin/api/index/evaluation/flowsendnew.go
  8. 57
      gin_server_admin/api/index/evaluation/lookquantita.go
  9. 76
      gin_server_admin/api/index/evaluation/type.go
  10. 40
      gin_server_admin/api/statistics/quantification/quant.go
  11. 88
      gin_server_admin/api/v1/assessment/set_evaluation_objectives.go
  12. 18
      gin_server_admin/api/v1/staff/staffpeople.go
  13. 10
      gin_server_admin/api/web/jixiaokaohe/enter.go
  14. 4
      gin_server_admin/api/web/jixiaokaohe/myduty.go
  15. 3
      gin_server_admin/api/wechatapp/callback/apphandle.go
  16. 8
      gin_server_admin/api/wechatapp/callback/rationcallback.go
  17. 168
      gin_server_admin/api/wechatapp/callback/updatehandle.go
  18. 41
      gin_server_admin/api/wechatapp/sendmessage/sendmsgHandle.go
  19. 279
      gin_server_admin/commonus/publichaneld.go
  20. 7
      gin_server_admin/commonus/timeSub.go
  21. 20
      gin_server_admin/model/assessmentmodel/dutyclass.go
  22. 3
      gin_server_admin/model/assessmentmodel/performance_appraisal.go
  23. 2
      gin_server_admin/router/assessment/assessmentrouter.go

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

@ -72,7 +72,8 @@ func (d *DutyAssessApi) DepartDutyPlanVersion(c *gin.Context) {
// response.Result(104, requestData, "没有查询到数据", c) // response.Result(104, requestData, "没有查询到数据", c)
// return // return
var planVersio []DutyPlanVersioOut var planVersio []DutyPlanVersioOut
dataErr := gormDb.Order("`group` ASC").Order("`department` ASC").Order("`state` ASC").Order("`addtime` ASC").Find(&planVersio).Error // dataErr := gormDb.Order("`group` ASC").Order("`department` ASC").Order("`state` ASC").Order("`addtime` ASC").Find(&planVersio).Error
dataErr := gormDb.Order("`group` ASC").Order("`department` ASC").Order("`addtime` DESC").Find(&planVersio).Error
if dataErr != nil { if dataErr != nil {
response.Result(104, dataErr, "没有查询到数据", c) response.Result(104, dataErr, "没有查询到数据", c)
return return
@ -558,7 +559,7 @@ func (d *DutyAssessApi) OnOffDepartDutyVersio(c *gin.Context) {
} }
//判断是否可以执行该操作 //判断是否可以执行该操作
if judgeOnOffVersio(ContInfo, requestData.IsTrue) == true { if judgeOnOffVersio(ContInfo, requestData.IsTrue) == true {
response.Result(103, ContInfo, "要禁用的方案还有未走完的审批流程!请不要进行此操作!", c) response.Result(1003, ContInfo, "要禁用的方案还有未走完的审批流程!请不要进行此操作!", c)
return return
} }
//获取 //获取
@ -568,7 +569,7 @@ func (d *DutyAssessApi) OnOffDepartDutyVersio(c *gin.Context) {
eiteOtherData["state"] = 2 eiteOtherData["state"] = 2
eiteOtherData["eitetime"] = time.Now().Unix() eiteOtherData["eitetime"] = time.Now().Unix()
// global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.PlanVersio{}).Where("`group` = ? AND `department` = ? AND `yeares` = ?", ContInfo.Group, ContInfo.Department, ContInfo.Year).Updates(eiteOtherData) // global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.PlanVersio{}).Where("`group` = ? AND `department` = ? AND `yeares` = ?", ContInfo.Group, ContInfo.Department, ContInfo.Year).Updates(eiteOtherData)
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.PlanVersio{}).Where("`group` = ? AND `department` = ?", ContInfo.Group, ContInfo.Department).Updates(eiteOtherData) global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.PlanVersio{}).Where("`group` = ? AND `department` = ? AND `state` <> 3 AND `key` <> ?", ContInfo.Group, ContInfo.Department, requestData.Key).Updates(eiteOtherData)
} }
eiteData := commonus.MapOut() eiteData := commonus.MapOut()
@ -581,6 +582,24 @@ func (d *DutyAssessApi) OnOffDepartDutyVersio(c *gin.Context) {
eiteQuerData["qe_eitetime"] = time.Now().Unix() eiteQuerData["qe_eitetime"] = time.Now().Unix()
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Where("`qe_qual_eval_id` = ?", requestData.Key).Updates(eiteQuerData) global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Where("`qe_qual_eval_id` = ?", requestData.Key).Updates(eiteQuerData)
var planKey []assessmentmodel.PlanVersio
plankeErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.PlanVersio{}).Where("`group` = ? AND `department` = ? AND `state` <> 3 AND `key` <> ?", ContInfo.Group, ContInfo.Department, requestData.Key).Find(&planKey).Error
if plankeErr == nil {
var keyPlanStr []string
for _, plv := range planKey {
keyPlanStr = append(keyPlanStr, plv.Key)
}
if requestData.State == 1 {
if len(keyPlanStr) > 0 {
eiteQuerDataAll := commonus.MapOut()
eiteQuerDataAll["qe_state"] = 2
eiteQuerDataAll["qe_eitetime"] = time.Now().Unix()
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Where("`qe_qual_eval_id` IN ?", keyPlanStr).Updates(eiteQuerDataAll)
}
}
}
if errOne != nil { if errOne != nil {
response.Result(102, errOne, "修改失败", c) response.Result(102, errOne, "修改失败", c)
return return
@ -718,8 +737,10 @@ func (d *DutyAssessApi) EiteDepartExplain(c *gin.Context) {
eiteData := commonus.MapOut() eiteData := commonus.MapOut()
eiteData["qe_eitetime"] = time.Now().Unix() eiteData["qe_eitetime"] = time.Now().Unix()
eiteData["qe_content"] = requestData.Content eiteData["qe_content"] = requestData.Content
if requestData.State == 2 { if requestData.State > 0 {
eiteData["qe_state"] = requestData.State eiteData["qe_state"] = requestData.State
} else {
eiteData["qe_state"] = 2
} }
if len(requestData.Operator) > 0 { if len(requestData.Operator) > 0 {
eiteData["qe_operator"] = strings.Join(requestData.Operator, ",") eiteData["qe_operator"] = strings.Join(requestData.Operator, ",")
@ -767,7 +788,7 @@ func eitePlanVersion(key string, tarId string, state int, contStr string) {
chidCont.State = state // `json:"state"` chidCont.State = state // `json:"state"`
chidCont.Score = cv.Score // `json:"score"` //分数 chidCont.Score = cv.Score // `json:"score"` //分数
chidCont.QualEvalId = cv.QualEvalId // `json:"qeid"` chidCont.QualEvalId = cv.QualEvalId // `json:"qeid"`
chidCont.Status = cv.Status // `json:"status"` chidCont.Status = state // `json:"status"`
} else { } else {
chidCont.Id = cv.Id chidCont.Id = cv.Id
chidCont.Name = cv.Name // `json:"name"` chidCont.Name = cv.Name // `json:"name"`

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

@ -91,7 +91,7 @@ func (e *EvaluationInterface) NewGetQualDetailedTarget(c *gin.Context) {
return return
} }
var qualEvaList []NewQualDetailOutList var qualEvaList []NewQualDetailOutList
gormDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_id,qe_group,qe_accept_evaluation,qe_dimension,qe_target,et_title,qe_detailed_target,dt_title,qe_target_sun").Joins("left join evaluationtarget on evaluationtarget.et_id = qualitative_evaluation.qe_target").Joins("left join detailed_target on detailed_target.dt_id = qualitative_evaluation.qe_detailed_target").Where("`qe_type` = 1 AND `qe_state` = 1 AND FIND_IN_SET(?,`qe_operator`)", userCont.Key) gormDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_id,qe_group,qe_accept_evaluation,qe_dimension,qe_target,et_title,qe_detailed_target,dt_title,qe_target_sun,qe_qual_eval_id").Joins("left join evaluationtarget on evaluationtarget.et_id = qualitative_evaluation.qe_target").Joins("left join detailed_target on detailed_target.dt_id = qualitative_evaluation.qe_detailed_target").Where("`qe_type` = 1 AND `qe_state` = 1 AND FIND_IN_SET(?,`qe_operator`)", userCont.Key)
gormDb = gormDb.Where("`qe_group` = ?", requestData.Group).Where("`qe_accept_evaluation` = ?", requestData.Department).Where("`qe_target` = ?", requestData.Target) gormDb = gormDb.Where("`qe_group` = ?", requestData.Group).Where("`qe_accept_evaluation` = ?", requestData.Department).Where("`qe_target` = ?", requestData.Target)
if requestData.Title != "" { if requestData.Title != "" {
gormDb = gormDb.Where("`dt_title` LIKE ?", "%"+requestData.Title+"%") gormDb = gormDb.Where("`dt_title` LIKE ?", "%"+requestData.Title+"%")
@ -109,6 +109,8 @@ func (e *EvaluationInterface) NewGetQualDetailedTarget(c *gin.Context) {
outCont.Id = v.Id outCont.Id = v.Id
outCont.Group = v.Group outCont.Group = v.Group
outCont.PlanVersionNumber = v.PlanVersionNumber
where := commonus.MapOut() where := commonus.MapOut()
where["id"] = v.Group where["id"] = v.Group
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name") orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")
@ -177,3 +179,44 @@ func AllZreoConfig(cycles int) (monthInt int64) {
} }
return return
} }
//获取定量考核任务列表===>筛出已经提交的数据
func (e *EvaluationInterface) QualitativeEvalRationNew(c *gin.Context) {
isTrue, userCont := commonus.ClientIdentity()
if isTrue != true {
response.Result(1001, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c)
return
}
var requestData GetRationFlowLog
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(102, err, "数据获取失败!", c)
return
}
//获取当月的起止时间
startMonth, endMonth := commonus.GetAppointMonthStarAndEndTimeInt(time.Now().Unix())
//获取当月内所有的审批流程的部门及指标ID
// var qualEvalFlowLogList QualEvalFlowLog
var evalId []int64
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.FlowLog{}).Select("fl_evaluation_id").Where("fl_time BETWEEN ? AND ?", startMonth, endMonth).Find(&evalId)
var qualEvaList []assessmentmodel.QualitativeEvaluation
gormDbIng := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qualitative_evaluation.*")
gormDbIng = gormDbIng.Where("`qe_type` = 2 AND `qe_state` = 1 AND FIND_IN_SET(?,`qe_operator`)", userCont.Key)
gormDbIng = gormDbIng.Not(map[string]interface{}{"qe_id": evalId})
if requestData.GroupId != "" {
gormDbIng = gormDbIng.Where("qe_group = ?", requestData.GroupId)
}
if requestData.DepartmentID != "" {
gormDbIng = gormDbIng.Where("qe_accept_evaluation = ?", requestData.DepartmentID)
}
if requestData.TargetId != "" {
gormDbIng = gormDbIng.Where("qe_target = ?", requestData.TargetId)
}
listErr := gormDbIng.Order("qe_type ASC,qe_group ASC,qe_accept_evaluation ASC,qe_dimension ASC,qe_target ASC,qe_target_sun ASC,qe_detailed_target ASC").Find(&qualEvaList).Error
if listErr != nil || len(qualEvaList) < 1 {
response.Result(102, qualEvaList, "您没有要参加的考核项目!", c)
return
}
}

88
gin_server_admin/api/index/evaluation/enter.go

@ -1,6 +1,94 @@
package evaluation package evaluation
import (
"github.com/flipped-aurora/gin-vue-admin/server/commonus"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/assessmentmodel"
)
//数据评估 //数据评估
type ApiGroup struct { type ApiGroup struct {
EvaluationApi EvaluationInterface EvaluationApi EvaluationInterface
} }
//获取定量考核目标
/*
@targetScore 指标分值
@resultval 结算值
@group 集团
@depart 部门
@dimen 维度
@target 指标
@deaTarget 细则
@year 年份
@timecopy 辅助计数
返回说明
@scoreVal 计算得分
@allPrize 全奖值
@zeroPrize 零奖值
@CappingVal 封顶值
@achievement 达成率
*/
func GetQuantitativeConfig(targetScore int64, resultval float64, group, depart, dimen, target, deaTarget string, year int64, timecopy int64) (scoreVal, allPrize, zeroPrize, CappingVal, achievement float64) {
scoreVal = 0
allPrize = 0
zeroPrize = 0
CappingVal = 0
achievement = 0
var qualConfig assessmentmodel.QuantitativeConfig
gormDb := global.GVA_DB_Performanceappraisal.Where("`group` = ? AND `departmentid` = ? AND `dimension` = ? AND `target` = ? AND `year` = ?", group, depart, dimen, target, year)
if deaTarget != "0" {
gormDb = gormDb.Where("targetconfig = ?", deaTarget)
}
// if timecopy != 0 {
// gormDb = gormDb.Where("timecopy = ?", timecopy)
// }
gormDb = gormDb.Where("timecopy = ?", timecopy)
err := gormDb.First(&qualConfig).Error
// fmt.Printf("达成率--0-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", group, depart, dimen, target, year, allPrize, zeroPrize, CappingVal, achievement, err)
if err != nil {
return
}
allPrize = qualConfig.Allprize / 100
zeroPrize = qualConfig.Zeroprize / 100
CappingVal = qualConfig.CappingVal / 100
chuShu := resultval - float64(qualConfig.Zeroprize)
beiChuShu := float64(qualConfig.Allprize) - float64(qualConfig.Zeroprize)
if beiChuShu > 0 {
achievement = commonus.Decimal(chuShu / beiChuShu)
scoreVal = achievement * (resultval / 100)
achievement = commonus.Decimal(achievement * 100)
if achievement >= CappingVal {
scoreVal = CappingVal * float64(targetScore) / 100
}
} else {
scoreVal = float64(targetScore)
}
// if qualConfig.CappingVal != 0 && resultval >= qualConfig.CappingVal {
// scoreVal = float64(targetScore)
// achievement = 100
// // fmt.Printf("达成率--1-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", group, depart, dimen, target, year, allPrize, zeroPrize, CappingVal, achievement)
// } else {
// chuShu := resultval - float64(qualConfig.Zeroprize)
// beiChuShu := float64(qualConfig.Allprize) - float64(qualConfig.Zeroprize)
// if beiChuShu > 0 {
// achievement = commonus.Decimal(chuShu / beiChuShu)
// scoreVal = achievement * (resultval / 100)
// if scoreVal >= CappingVal {
// scoreVal = CappingVal * float64(targetScore)
// }
// fmt.Printf("达成率--2-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", group, depart, dimen, target, year, allPrize, zeroPrize, CappingVal, achievement, resultval)
// } else {
// scoreVal = float64(targetScore)
// // fmt.Printf("达成率--3-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", group, depart, dimen, target, year, allPrize, zeroPrize, CappingVal, achievement)
// }
// }
// fmt.Printf("达成率--4-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", group, depart, dimen, target, year, allPrize, zeroPrize, CappingVal, achievement)
return
}

310
gin_server_admin/api/index/evaluation/evaluation.go

@ -739,6 +739,14 @@ func (e *EvaluationInterface) QualitativeEvalRation(c *gin.Context) {
return return
} }
//获取当月的起止时间
startMonth, endMonth := commonus.GetAppointMonthStarAndEndTimeInt(time.Now().Unix())
//获取当月内所有的审批流程的部门及指标ID
// var qualEvalFlowLogList QualEvalFlowLog
var evalId []int64
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.FlowLog{}).Select("fl_evaluation_id").Where("fl_time BETWEEN ? AND ?", startMonth, endMonth).Find(&evalId)
// var qualEvaList []assessmentmodel.QualitativeEvaluation // var qualEvaList []assessmentmodel.QualitativeEvaluation
// var detailsId []int64 // var detailsId []int64
// listErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_accept_evaluation").Where("`qe_type` = 1 AND `qe_state` = 1 AND FIND_IN_SET(?,`qe_operator`)", userCont.Key).Group("qe_accept_evaluation").Find(&detailsId).Error // listErr := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_accept_evaluation").Where("`qe_type` = 1 AND `qe_state` = 1 AND FIND_IN_SET(?,`qe_operator`)", userCont.Key).Group("qe_accept_evaluation").Find(&detailsId).Error
@ -750,12 +758,18 @@ func (e *EvaluationInterface) QualitativeEvalRation(c *gin.Context) {
var qualEvaList []assessmentmodel.QualitativeEvaluation var qualEvaList []assessmentmodel.QualitativeEvaluation
gormDbIng := global.GVA_DB_Performanceappraisal gormDbIng := global.GVA_DB_Performanceappraisal
gormDbIng = gormDbIng.Where("`qe_type` = 2 AND `qe_state` = 1 AND FIND_IN_SET(?,`qe_operator`)", userCont.Key) gormDbIng = gormDbIng.Where("`qe_type` = 2 AND `qe_state` = 1 AND FIND_IN_SET(?,`qe_operator`)", userCont.Key)
if len(evalId) > 0 {
gormDbIng = gormDbIng.Not(map[string]interface{}{"qe_id": evalId})
}
if requestData.GroupId != "" { if requestData.GroupId != "" {
gormDbIng = gormDbIng.Where("qe_group = ?", requestData.GroupId) gormDbIng = gormDbIng.Where("qe_group = ?", requestData.GroupId)
} }
if requestData.DepartmentID != "" { if requestData.DepartmentID != "" {
gormDbIng = gormDbIng.Where("qe_accept_evaluation = ?", requestData.DepartmentID) gormDbIng = gormDbIng.Where("qe_accept_evaluation = ?", requestData.DepartmentID)
} }
if requestData.TargetId != "" {
gormDbIng = gormDbIng.Where("qe_target = ?", requestData.TargetId)
}
listErr := gormDbIng.Order("qe_type ASC,qe_group ASC,qe_accept_evaluation ASC,qe_dimension ASC,qe_target ASC,qe_target_sun ASC,qe_detailed_target ASC").Find(&qualEvaList).Error listErr := gormDbIng.Order("qe_type ASC,qe_group ASC,qe_accept_evaluation ASC,qe_dimension ASC,qe_target ASC,qe_target_sun ASC,qe_detailed_target ASC").Find(&qualEvaList).Error
if listErr != nil || len(qualEvaList) < 1 { if listErr != nil || len(qualEvaList) < 1 {
response.Result(102, qualEvaList, "您没有要参加的考核项目!", c) response.Result(102, qualEvaList, "您没有要参加的考核项目!", c)
@ -763,7 +777,7 @@ func (e *EvaluationInterface) QualitativeEvalRation(c *gin.Context) {
} }
var uotContAry []TargetContOutCont var uotContAry []TargetContOutCont
for _, v := range qualEvaList { for _, v := range qualEvaList {
kickOut := 1 //踢出设置 // kickOut := 1 //踢出设置
var uotCont TargetContOutCont var uotCont TargetContOutCont
uotCont.Id = strconv.FormatInt(v.Id, 10) uotCont.Id = strconv.FormatInt(v.Id, 10)
uotCont.Type = v.Type uotCont.Type = v.Type
@ -779,6 +793,7 @@ func (e *EvaluationInterface) QualitativeEvalRation(c *gin.Context) {
orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name") orgContDepart, _ := commonus.GetNewOrgCont(whereDepart, "id", "name")
uotCont.DepartmentName = orgContDepart.Name uotCont.DepartmentName = orgContDepart.Name
uotCont.PlanVersionNumber = v.QualEvalId
// groupErr, groupCont := commonus.GetGroupCont(v.Group) // groupErr, groupCont := commonus.GetGroupCont(v.Group)
// if groupErr == true { // if groupErr == true {
// uotCont.GroupNAme = groupCont.Name // uotCont.GroupNAme = groupCont.Name
@ -849,7 +864,7 @@ func (e *EvaluationInterface) QualitativeEvalRation(c *gin.Context) {
uotCont.ZeroPrize = strconv.FormatFloat(float64(quanTitCont.Zeroprize)/100, 'f', -1, 64) uotCont.ZeroPrize = strconv.FormatFloat(float64(quanTitCont.Zeroprize)/100, 'f', -1, 64)
uotCont.AllPrize = strconv.FormatFloat(float64(quanTitCont.Allprize)/100, 'f', -1, 64) uotCont.AllPrize = strconv.FormatFloat(float64(quanTitCont.Allprize)/100, 'f', -1, 64)
uotCont.CappingVal = quanTitCont.CappingVal / 100
//获取实际值 //获取实际值
shiJiZhi := commonus.MapOut() shiJiZhi := commonus.MapOut()
shiJiZhi["fl_evaluation_user"] = userCont.Key shiJiZhi["fl_evaluation_user"] = userCont.Key
@ -903,10 +918,10 @@ func (e *EvaluationInterface) QualitativeEvalRation(c *gin.Context) {
uotCont.ReachScore = 0 uotCont.ReachScore = 0
} }
judgeActualValue := commonus.GetTimeIntervalDutyJudge(shiJiZhi, v.Id) //判断当前条件下时候又审批中和审批通过的 // judgeActualValue := commonus.GetTimeIntervalDutyJudge(shiJiZhi, v.Id) //判断当前条件下时候又审批中和审批通过的
if judgeActualValue > 0 { // if judgeActualValue > 0 {
kickOut = 2 // kickOut = 2
} // }
//计算达成率 //计算达成率
if quanTitCont.Zeroprize == 0 && quanTitCont.Allprize == 0 { if quanTitCont.Zeroprize == 0 && quanTitCont.Allprize == 0 {
uotCont.Reach = "未设置目标值" uotCont.Reach = "未设置目标值"
@ -916,7 +931,7 @@ func (e *EvaluationInterface) QualitativeEvalRation(c *gin.Context) {
if dividend == 0 { if dividend == 0 {
uotCont.Reach = "未设置目标值" uotCont.Reach = "未设置目标值"
} else { } else {
uotCont.Reach = fmt.Sprintf("((实际值-零奖值)/(全奖值-零奖值))*指标权重\n((S-Z)/(A-Z))*W") uotCont.Reach = fmt.Sprintf("((实际值-零奖值)/(全奖值-零奖值))*指标权重")
// reachValue := ((divisor / 100) / (float64(dividend) / 100)) * 100 // reachValue := ((divisor / 100) / (float64(dividend) / 100)) * 100
// if reachValue < 0 { // if reachValue < 0 {
// uotCont.Reach = "0%" // uotCont.Reach = "0%"
@ -929,10 +944,10 @@ func (e *EvaluationInterface) QualitativeEvalRation(c *gin.Context) {
} }
uotCont.Reason = "" uotCont.Reason = ""
uotCont.DetailedTarget = strconv.FormatInt(v.DetailedTarget, 10) uotCont.DetailedTarget = strconv.FormatInt(v.DetailedTarget, 10)
if kickOut == 1 { // if kickOut == 1 {
uotContAry = append(uotContAry, uotCont) // uotContAry = append(uotContAry, uotCont)
} // }
// uotContAry = append(uotContAry, uotCont) uotContAry = append(uotContAry, uotCont)
} }
response.Result(0, uotContAry, "用户端个人要执行的考核任务", c) response.Result(0, uotContAry, "用户端个人要执行的考核任务", c)
} }
@ -960,6 +975,13 @@ func (e *EvaluationInterface) AddFlowRationLog(c *gin.Context) {
return return
} }
todaying := commonus.ComputingTime(time.Now().Unix(), 5)
if todaying > 10 {
// response.Result(1051, todaying, "不在可提交数据提时间期限内!不可提交数据。请每月10号前提交数据!。", c)
// return
}
var requestData AddRationFlowLog var requestData AddRationFlowLog
err := c.ShouldBindJSON(&requestData) err := c.ShouldBindJSON(&requestData)
if err != nil { if err != nil {
@ -979,6 +1001,10 @@ func (e *EvaluationInterface) AddFlowRationLog(c *gin.Context) {
return return
} }
//判断是否已经添加的条件
existenceProess := commonus.MapOut()
existenceProess["fl_planversion"] = requestData.PlanVersionNumber
operationTime := time.Now().Unix() operationTime := time.Now().Unix()
keyNumber := commonus.GetFileNumberEs() keyNumber := commonus.GetFileNumberEs()
var flowLog assessmentmodel.FlowLog var flowLog assessmentmodel.FlowLog
@ -986,6 +1012,7 @@ func (e *EvaluationInterface) AddFlowRationLog(c *gin.Context) {
flowLog.Key = keyNumber flowLog.Key = keyNumber
flowLog.Time = time.Now().Unix() flowLog.Time = time.Now().Unix()
flowLog.EiteTime = time.Now().Unix() flowLog.EiteTime = time.Now().Unix()
flowLog.PlanVersion = requestData.PlanVersionNumber
if requestData.Addtime != "" { if requestData.Addtime != "" {
timeOccurrence := commonus.DateToTimeStamp(requestData.Addtime) //发生时间 timeOccurrence := commonus.DateToTimeStamp(requestData.Addtime) //发生时间
flowLog.Year = commonus.ComputingTime(timeOccurrence, 1) flowLog.Year = commonus.ComputingTime(timeOccurrence, 1)
@ -993,6 +1020,13 @@ func (e *EvaluationInterface) AddFlowRationLog(c *gin.Context) {
flowLog.Month = commonus.ComputingTime(timeOccurrence, 3) flowLog.Month = commonus.ComputingTime(timeOccurrence, 3)
flowLog.Week = commonus.ComputingTime(timeOccurrence, 4) flowLog.Week = commonus.ComputingTime(timeOccurrence, 4)
flowLog.ToDay = commonus.ComputingTime(timeOccurrence, 5) flowLog.ToDay = commonus.ComputingTime(timeOccurrence, 5)
existenceProess["fl_year"] = commonus.ComputingTime(timeOccurrence, 1)
existenceProess["fl_quarter"] = commonus.ComputingTime(timeOccurrence, 2)
existenceProess["fl_month"] = commonus.ComputingTime(timeOccurrence, 3)
existenceProess["fl_week"] = commonus.ComputingTime(timeOccurrence, 4)
existenceProess["fl_day"] = commonus.ComputingTime(timeOccurrence, 5)
} else { } else {
lastMonth, _, _ := commonus.GetLastMonth() lastMonth, _, _ := commonus.GetLastMonth()
@ -1005,74 +1039,147 @@ func (e *EvaluationInterface) AddFlowRationLog(c *gin.Context) {
flowLog.Month = commonus.ComputingTime(operationTime, 3) flowLog.Month = commonus.ComputingTime(operationTime, 3)
flowLog.Week = commonus.ComputingTime(operationTime, 4) flowLog.Week = commonus.ComputingTime(operationTime, 4)
flowLog.ToDay = commonus.ComputingTime(operationTime, 5) flowLog.ToDay = commonus.ComputingTime(operationTime, 5)
existenceProess["fl_year"] = commonus.ComputingTime(operationTime, 1)
existenceProess["fl_quarter"] = commonus.ComputingTime(operationTime, 2)
existenceProess["fl_month"] = commonus.ComputingTime(operationTime, 3)
existenceProess["fl_week"] = commonus.ComputingTime(operationTime, 4)
existenceProess["fl_day"] = commonus.ComputingTime(operationTime, 5)
} }
flowLog.EvaluationDepartment = departmentId flowLog.EvaluationDepartment = departmentId
flowLog.EvaluationUser = userKey flowLog.EvaluationUser = userKey
flowLog.EvaluationGroup = userGroup flowLog.EvaluationGroup = userGroup
// existenceProess["fl_evaluation_department"] = departmentId
// existenceProess["fl_evaluation_user"] = userKey
// existenceProess["fl_evaluation_group"] = userGroup
dutyGroup, dutyGroupErr := strconv.ParseInt(requestData.GroupId, 10, 64) dutyGroup, dutyGroupErr := strconv.ParseInt(requestData.GroupId, 10, 64)
if dutyGroupErr == nil { if dutyGroupErr == nil {
flowLog.DutyGroup = dutyGroup flowLog.DutyGroup = dutyGroup
existenceProess["fl_duty_group"] = dutyGroup
} }
departIdInt, departIdIntErr := strconv.ParseInt(requestData.DepartmentID, 10, 64) departIdInt, departIdIntErr := strconv.ParseInt(requestData.DepartmentID, 10, 64)
if departIdIntErr == nil { if departIdIntErr == nil {
flowLog.DutyDepartment = departIdInt flowLog.DutyDepartment = departIdInt
existenceProess["fl_duty_department"] = departIdInt
} }
flowLog.Reply = 1 flowLog.Reply = 1
var evaluationIdStr string
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.FlowLog{}).Select("fl_evaluation_id").Where(existenceProess).First(&evaluationIdStr)
var evaluationIdStrAry []string
if evaluationIdStr != "" {
evaluationIdStrAry = strings.Split(evaluationIdStr, ",")
}
var flowDataLogAry []assessmentmodel.FlowLogData var flowDataLogAry []assessmentmodel.FlowLogData
var reason string var reason string
var evaluationPlan []string //方案ID var evaluationPlan []string //方案ID
var yiTianJianMingc []string
// jsonMapStr, _ := json.Marshal(requestData.List) // jsonMapStr, _ := json.Marshal(requestData.List)
json.Marshal(requestData.List) json.Marshal(requestData.List)
//fmt.Printf("OutJsonMap-----1------>%\n", string(jsonMapStr)) //fmt.Printf("OutJsonMap-----1------>%\n", string(jsonMapStr))
for i, v := range requestData.List { for i, v := range requestData.List {
var flowDataLog assessmentmodel.FlowLogData
evaluationPlan = append(evaluationPlan, v.Id) if len(evaluationIdStrAry) > 0 {
evaluationPlanid, evaluationPlanidErr := strconv.ParseInt(v.Id, 10, 64) if commonus.IsItTrueString(v.Id, evaluationIdStrAry) == false {
if evaluationPlanidErr == nil { var flowDataLog assessmentmodel.FlowLogData
flowDataLog.EvaluationPlan = evaluationPlanid evaluationPlan = append(evaluationPlan, v.Id)
} evaluationPlanid, evaluationPlanidErr := strconv.ParseInt(v.Id, 10, 64)
flowDataLog.Key = keyNumber if evaluationPlanidErr == nil {
flowDataLog.Score = commonus.GetDuyCycle(v.Actual, 100) flowDataLog.EvaluationPlan = evaluationPlanid
flowDataLog.Content = v.Reason }
flowDataLog.Enclosure = strings.Join(v.Enclosure, ",") flowDataLog.Key = keyNumber
if v.ScoringMethod == 2 { flowDataLog.Score = commonus.GetDuyCycle(v.Actual, 100)
flowDataLog.ScoringMethod = 2 flowDataLog.Content = v.Reason
flowDataLog.ScoringScore = v.ScoringScore flowDataLog.Enclosure = strings.Join(v.Enclosure, ",")
} else { if v.ScoringMethod == 2 {
flowDataLog.ScoringMethod = 1 flowDataLog.ScoringMethod = 2
flowDataLog.ScoringScore = 0 flowDataLog.ScoringScore = v.ScoringScore
}
flowDataLog.Time = time.Now().Unix()
targetInfo, targetInfoErr := commonus.GetQualitativeEvaluation(strconv.FormatInt(evaluationPlanid, 10))
tarInfo, _ := commonus.GetTargetInfo(targetInfo.Target)
if i == 0 {
if targetInfoErr == true {
if v.Reason != "" {
reason = fmt.Sprintf("%v :%v%v\n备注:%v", tarInfo.Title, v.Actual, v.Unit, v.Reason)
} else { } else {
reason = fmt.Sprintf("%v :%v%v", tarInfo.Title, v.Actual, v.Unit) flowDataLog.ScoringMethod = 1
flowDataLog.ScoringScore = 0
} }
// flowDataLog.PlanVersion = v.PlanVersionNumber
flowDataLog.Time = time.Now().Unix()
targetInfo, targetInfoErr := commonus.GetQualitativeEvaluation(strconv.FormatInt(evaluationPlanid, 10))
tarInfo, _ := commonus.GetTargetInfo(targetInfo.Target)
if i == 0 {
if targetInfoErr == true {
if v.Reason != "" {
reason = fmt.Sprintf("%v :%v%v\n备注:%v", tarInfo.Title, v.Actual, v.Unit, v.Reason)
} else {
reason = fmt.Sprintf("%v :%v%v", tarInfo.Title, v.Actual, v.Unit)
}
}
} else {
if targetInfoErr == true {
if v.Reason != "" {
reason = fmt.Sprintf("%v\n%v :%v%v\n备注:%v", reason, tarInfo.Title, v.Actual, v.Unit, v.Reason)
} else {
reason = fmt.Sprintf("%v\n%v :%v%v", reason, tarInfo.Title, v.Actual, v.Unit)
}
}
}
flowDataLogAry = append(flowDataLogAry, flowDataLog)
} else {
yiTianJianMingc = append(yiTianJianMingc, v.TargetName)
} }
} else { } else {
if targetInfoErr == true { var flowDataLog assessmentmodel.FlowLogData
if v.Reason != "" { evaluationPlan = append(evaluationPlan, v.Id)
reason = fmt.Sprintf("%v\n%v :%v%v\n备注:%v", reason, tarInfo.Title, v.Actual, v.Unit, v.Reason) evaluationPlanid, evaluationPlanidErr := strconv.ParseInt(v.Id, 10, 64)
} else { if evaluationPlanidErr == nil {
reason = fmt.Sprintf("%v\n%v :%v%v", reason, tarInfo.Title, v.Actual, v.Unit) flowDataLog.EvaluationPlan = evaluationPlanid
}
flowDataLog.Key = keyNumber
flowDataLog.Score = commonus.GetDuyCycle(v.Actual, 100)
flowDataLog.Content = v.Reason
flowDataLog.Enclosure = strings.Join(v.Enclosure, ",")
if v.ScoringMethod == 2 {
flowDataLog.ScoringMethod = 2
flowDataLog.ScoringScore = v.ScoringScore
} else {
flowDataLog.ScoringMethod = 1
flowDataLog.ScoringScore = 0
}
flowDataLog.PlanVersion = requestData.PlanVersionNumber
flowDataLog.Time = time.Now().Unix()
targetInfo, targetInfoErr := commonus.GetQualitativeEvaluation(strconv.FormatInt(evaluationPlanid, 10))
tarInfo, _ := commonus.GetTargetInfo(targetInfo.Target)
if i == 0 {
if targetInfoErr == true {
if v.Reason != "" {
reason = fmt.Sprintf("%v :%v%v\n备注:%v", tarInfo.Title, v.Actual, v.Unit, v.Reason)
} else {
reason = fmt.Sprintf("%v :%v%v", tarInfo.Title, v.Actual, v.Unit)
}
} }
} else {
if targetInfoErr == true {
if v.Reason != "" {
reason = fmt.Sprintf("%v\n%v :%v%v\n备注:%v", reason, tarInfo.Title, v.Actual, v.Unit, v.Reason)
} else {
reason = fmt.Sprintf("%v\n%v :%v%v", reason, tarInfo.Title, v.Actual, v.Unit)
}
}
} }
flowDataLogAry = append(flowDataLogAry, flowDataLog)
} }
flowDataLogAry = append(flowDataLogAry, flowDataLog)
} }
gromDb := global.GVA_DB_Performanceappraisal.Begin() gromDb := global.GVA_DB_Performanceappraisal.Begin()
flowLog.EvaluationPlan = strings.Join(evaluationPlan, ",") flowLog.EvaluationPlan = strings.Join(evaluationPlan, ",")
if len(flowDataLogAry) <= 0 {
response.Result(0, yiTianJianMingc, "您的数据已经提交!请不要重复提交!", c)
return
}
addFlowLogErr := gromDb.Create(&flowLog).Error addFlowLogErr := gromDb.Create(&flowLog).Error
addFlowLogDataErr := gromDb.Create(&flowDataLogAry).Error addFlowLogDataErr := gromDb.Create(&flowDataLogAry).Error
@ -1093,7 +1200,7 @@ func (e *EvaluationInterface) AddFlowRationLog(c *gin.Context) {
} }
// UpEvaluationProcessApproval(keyNumber, 16182159043990656, keyNumber, 1, userCont.Key) // UpEvaluationProcessApproval(keyNumber, 16182159043990656, keyNumber, 1, userCont.Key)
commonus.StepAddData(keyNumber, 16182159043990656, 2, 7, 2, 2, 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 := ""
@ -1120,23 +1227,28 @@ func (e *EvaluationInterface) AddFlowRationLog(c *gin.Context) {
//fmt.Printf("1、更新发送信息返回:%v-----------%v----------->%v-----%v\n", string(callbakcMsg), isTrueCall, callBackCont, sendText) //fmt.Printf("1、更新发送信息返回:%v-----------%v----------->%v-----%v\n", string(callbakcMsg), isTrueCall, callBackCont, sendText)
response.Result(0, affairDbErr, "数据写入成功!", c) response.Result(0, yiTianJianMingc, "数据提交成功!", c)
} else { } else {
gromDb.Rollback() gromDb.Rollback()
response.Result(118, affairDbErr, "数据写入失败!", c) response.Result(118, yiTianJianMingc, "数据提交失败!", c)
} }
} else { } else {
affairDbErr := gromDb.Rollback().Error affairDbErr := gromDb.Rollback().Error
if affairDbErr == nil { if affairDbErr == nil {
response.Result(119, affairDbErr, "数据写入失败!", c) response.Result(119, yiTianJianMingc, "数据提交失败!", c)
} else { } else {
response.Result(120, affairDbErr, "数据写入失败!", c) response.Result(120, yiTianJianMingc, "数据提交失败!", c)
} }
} }
} }
//查看定性考核审批列表 //查看定性考核审批列表
func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) { func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
isTrue, userCont := commonus.ClientIdentity()
if isTrue != true {
response.Result(1001, userCont, "您的身份令牌已经失效!请重新登录获取身份令牌!", c)
return
}
var requestData commonus.SetIds var requestData commonus.SetIds
err := c.ShouldBindJSON(&requestData) err := c.ShouldBindJSON(&requestData)
if err != nil { if err != nil {
@ -1320,6 +1432,14 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
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
//fmt.Printf("9-----------1--------->%v\n", gerEvalErr) //fmt.Printf("9-----------1--------->%v\n", gerEvalErr)
if gerEvalErr == nil { if gerEvalErr == nil {
fmt.Printf("evalProInfo.NextExecutor------->%v\n", evalProInfo.NextExecutor)
dutyCecorFlowInfo.IsSet = 2
isSetUser := strings.Split(evalProInfo.NextExecutor, ",")
if len(isSetUser) > 0 {
if commonus.IsItTrueString(userCont.Key, isSetUser) == true {
dutyCecorFlowInfo.IsSet = 1
}
}
var flowStepAryMaps []FlowStep var flowStepAryMaps []FlowStep
jsonFlowErr := json.Unmarshal([]byte(evalProInfo.Content), &flowStepAryMaps) jsonFlowErr := json.Unmarshal([]byte(evalProInfo.Content), &flowStepAryMaps)
//fmt.Printf("9-----------2--------->%v\n", flowStepAryMaps) //fmt.Printf("9-----------2--------->%v\n", flowStepAryMaps)
@ -1334,10 +1454,11 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
//fmt.Printf("9-----------4-----2---->%v\n", fw_v) //fmt.Printf("9-----------4-----2---->%v\n", fw_v)
if workUserErr == true { if workUserErr == true {
//fmt.Printf("9-----------4-----1---->%v\n", workUserErr) //fmt.Printf("9-----------4-----1---->%v\n", workUserErr)
bfErr, bf := commonus.GetBranchFactory(workUser.DepartmentId) // bfErr, bf := commonus.GetBranchFactory(workUser.DepartmentId)
bf, bfErr := commonus.GetNewOrgCont(workUser.DepartmentId)
//fmt.Printf("9-----------4-----3---->%v\n", bfErr) //fmt.Printf("9-----------4-----3---->%v\n", bfErr)
if bfErr == true { if bfErr == nil {
getGroupRoleInfoErr, getGroupRoleInfo, roleGroupInfo := commonus.GetOfficeWork(fw_v.RoleGroup, int64(bf.WechatId)) getGroupRoleInfoErr, getGroupRoleInfo, roleGroupInfo := commonus.GetOfficeWork(fw_v.RoleGroup, int64(bf.WechatOrganizationId))
//fmt.Printf("9-----------4-----5---->%v---->%v---->%v\n", getGroupRoleInfoErr, getGroupRoleInfo, roleGroupInfo) //fmt.Printf("9-----------4-----5---->%v---->%v---->%v\n", getGroupRoleInfoErr, getGroupRoleInfo, roleGroupInfo)
if getGroupRoleInfoErr == true { if getGroupRoleInfoErr == true {
flowLog.GroupName = roleGroupInfo.Title flowLog.GroupName = roleGroupInfo.Title
@ -1395,6 +1516,11 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
//查看定量考核列表 //查看定量考核列表
func (d *EvaluationInterface) LookRationkScoreFlow(c *gin.Context) { func (d *EvaluationInterface) LookRationkScoreFlow(c *gin.Context) {
isTrue, userCont := commonus.ClientIdentity()
if isTrue != true {
response.Result(1001, userCont, "您的身份令牌已经失效!请重新登录获取身份令牌!", c)
return
}
var requestData commonus.SetIds var requestData commonus.SetIds
err := c.ShouldBindJSON(&requestData) err := c.ShouldBindJSON(&requestData)
if err != nil { if err != nil {
@ -1417,18 +1543,65 @@ func (d *EvaluationInterface) LookRationkScoreFlow(c *gin.Context) {
response.Result(103, err, "参数错误!请重新提交!", c) response.Result(103, err, "参数错误!请重新提交!", c)
return return
} }
var flowLogInfo assessmentmodel.FlowLog
getErrs := global.GVA_DB_Performanceappraisal.Where("`fl_key` = ?", requestData.Id).First(&flowLogInfo).Error
var planVersioCont assessmentmodel.PlanVersio
global.GVA_DB_Performanceappraisal.Where("`key` = ?", flowLogInfo.PlanVersion).First(&planVersioCont)
var planVersioInfo []AddDutyNewCont
if planVersioCont.Content != "" {
json.Unmarshal([]byte(planVersioCont.Content), &planVersioInfo)
// jsonErr := json.Unmarshal([]byte(planVersioCont.Content), &planVersioInfo)
// if jsonErr == nil {
// for _, v := range planVersioInfo {
// for _, cv := range v.Child {
// if cv.Id == strconv.FormatInt(planVersioCont.Id, 10) {
// targetScore = cv.ReferenceScore
// }
// }
// }
// }
}
// var flowLogInfo
var outList []RationOutStruct var outList []RationOutStruct
for _, v := range flowDataLog { for _, v := range flowDataLog {
var targetScore int64 = 0
var outContt RationOutStruct var outContt RationOutStruct
outContt.Id = strconv.FormatInt(v.Id, 10) outContt.Id = strconv.FormatInt(v.Id, 10)
outContt.FlowId = strconv.FormatInt(v.Key, 10) outContt.FlowId = strconv.FormatInt(v.Key, 10)
targetCont, targetContErr := commonus.LookRationInfo(v.EvaluationPlan) targetCont, targetContErr := commonus.LookRationInfo(v.EvaluationPlan)
if targetContErr == true { if targetContErr == true {
outContt.Title = targetCont.Title outContt.Title = targetCont.Title
outContt.Unit = targetCont.Unit outContt.Unit = targetCont.Unit
outContt.Cycles = targetCont.Cycles outContt.Cycles = targetCont.Cycles
outContt.CycleAttres = targetCont.CycleAttres outContt.CycleAttres = targetCont.CycleAttres
var monthQues int64 = 1
switch targetCont.Cycles {
case 5:
monthQues = flowLogInfo.Quarter
case 6:
monthQues = 1
default:
monthQues = flowLogInfo.Month
}
if len(planVersioInfo) > 0 {
for _, pviv := range planVersioInfo {
for _, pvivcv := range pviv.Child {
if pvivcv.Id == strconv.FormatInt(targetCont.Target, 10) {
targetScore = pvivcv.ReferenceScore
}
}
}
}
outContt.Weight = float64(targetScore)
//获取指标
var tarGetId int64
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_target").Where("`qe_id` = ?", v.EvaluationPlan).First(&tarGetId)
// outContt.Actual, outContt.AllPrize, outContt.ZeroPrize, outContt.CappingVal, outContt.Achievement = GetQuantitativeConfig(targetScore, float64(v.Score), strconv.FormatInt(flowLogInfo.DutyGroup, 10), strconv.FormatInt(flowLogInfo.DutyDepartment, 10), strconv.FormatInt(targetCont.Dimension, 10), strconv.FormatInt(tarGetId, 10), strconv.FormatInt(targetCont.DetailedTarget, 10), flowLogInfo.Year, monthQues)
// targetScore = v.Score
outContt.Actual, outContt.AllPrize, outContt.ZeroPrize, outContt.CappingVal, outContt.Achievement = GetQuantitativeConfig(targetScore, float64(v.Score), strconv.FormatInt(flowLogInfo.DutyGroup, 10), strconv.FormatInt(flowLogInfo.DutyDepartment, 10), strconv.FormatInt(targetCont.Dimension, 10), strconv.FormatInt(tarGetId, 10), strconv.FormatInt(targetCont.DetailedTarget, 10), flowLogInfo.Year, monthQues)
} }
outContt.Score = float64(v.Score) / 100 outContt.Score = float64(v.Score) / 100
outContt.Content = v.Content outContt.Content = v.Content
@ -1444,6 +1617,9 @@ func (d *EvaluationInterface) LookRationkScoreFlow(c *gin.Context) {
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
//fmt.Printf("9-----------1--------->%v\n", gerEvalErr) //fmt.Printf("9-----------1--------->%v\n", gerEvalErr)
var isShenPi int = 2
if gerEvalErr == nil { if gerEvalErr == nil {
var flowStepAryMaps []FlowStep var flowStepAryMaps []FlowStep
jsonFlowErr := json.Unmarshal([]byte(evalProInfo.Content), &flowStepAryMaps) jsonFlowErr := json.Unmarshal([]byte(evalProInfo.Content), &flowStepAryMaps)
@ -1459,10 +1635,11 @@ func (d *EvaluationInterface) LookRationkScoreFlow(c *gin.Context) {
// //fmt.Printf("9-----------4-----2---->%v\n", fw_v) // //fmt.Printf("9-----------4-----2---->%v\n", fw_v)
if workUserErr == true { if workUserErr == true {
// //fmt.Printf("9-----------4-----1---->%v\n", workUserErr) // //fmt.Printf("9-----------4-----1---->%v\n", workUserErr)
bfErr, bf := commonus.GetBranchFactory(workUser.DepartmentId) // bfErr, bf := commonus.GetBranchFactory(workUser.DepartmentId)
bf, bfErr := commonus.GetNewOrgCont(workUser.DepartmentId)
// //fmt.Printf("9-----------4-----3---->%v\n", bfErr) // //fmt.Printf("9-----------4-----3---->%v\n", bfErr)
if bfErr == true { if bfErr == nil {
getGroupRoleInfoErr, getGroupRoleInfo, roleGroupInfo := commonus.GetOfficeWork(fw_v.RoleGroup, int64(bf.WechatId)) getGroupRoleInfoErr, getGroupRoleInfo, roleGroupInfo := commonus.GetOfficeWork(fw_v.RoleGroup, int64(bf.WechatOrganizationId))
// //fmt.Printf("9-----------4-----5---->%v---->%v---->%v\n", getGroupRoleInfoErr, getGroupRoleInfo, roleGroupInfo) // //fmt.Printf("9-----------4-----5---->%v---->%v---->%v\n", getGroupRoleInfoErr, getGroupRoleInfo, roleGroupInfo)
if getGroupRoleInfoErr == true { if getGroupRoleInfoErr == true {
flowLog.GroupName = roleGroupInfo.Title flowLog.GroupName = roleGroupInfo.Title
@ -1512,6 +1689,13 @@ func (d *EvaluationInterface) LookRationkScoreFlow(c *gin.Context) {
if jsonFlowErr == nil { if jsonFlowErr == nil {
} }
} }
fmt.Printf("evalProInfo.NextExecutor-------------->%v\n", evalProInfo.NextExecutor)
if evalProInfo.NextExecutor != "" {
zhiXingRenAry := strings.Split(evalProInfo.NextExecutor, ",")
if commonus.IsItTrueString(userCont.Key, zhiXingRenAry) == true {
isShenPi = 1
}
}
} }
outListMap := commonus.MapOut() outListMap := commonus.MapOut()
@ -1519,20 +1703,22 @@ func (d *EvaluationInterface) LookRationkScoreFlow(c *gin.Context) {
outListMap["flowLog"] = flowLogList outListMap["flowLog"] = flowLogList
outListMap["flowall"] = flowAllMapList outListMap["flowall"] = flowAllMapList
outListMap["title"] = "" outListMap["title"] = ""
var flowLogInfo assessmentmodel.FlowLog outListMap["isset"] = isShenPi
getErrs := global.GVA_DB_Performanceappraisal.Where("`fl_key` = ?", requestData.Id).First(&flowLogInfo).Error
if getErrs == nil { if getErrs == nil {
titlekUserInfo, _ := commonus.GetWorkUser(strconv.FormatInt(flowLogInfo.EvaluationUser, 10)) titlekUserInfo, _ := commonus.GetNewHrPeopleInfo(map[string]interface{}{"`key`": flowLogInfo.EvaluationUser}, "`name`")
titleStr := fmt.Sprintf("%v提交的%v年%v月%v日定量考核数据上报", titlekUserInfo.Name, flowLogInfo.Year, flowLogInfo.Month, flowLogInfo.ToDay) // titlekUserInfo, _ := commonus.GetWorkUser(strconv.FormatInt(flowLogInfo.EvaluationUser, 10))
gErr, groupInfo := commonus.GetGroupCont(flowLogInfo.DutyGroup) titleStr := fmt.Sprintf("%v提交的%v年%v月定量考核数据", titlekUserInfo.Name, flowLogInfo.Year, flowLogInfo.Month)
if gErr == true { // gErr, groupInfo := commonus.GetGroupCont(flowLogInfo.DutyGroup)
groupInfo, gErr := commonus.GetNewOrgCont(flowLogInfo.DutyGroup)
if gErr == nil {
outListMap["groupname"] = groupInfo.Name outListMap["groupname"] = groupInfo.Name
} else { } else {
outListMap["groupname"] = "" outListMap["groupname"] = ""
} }
dErr, BranchInfo := commonus.GetBranchFactory(flowLogInfo.DutyDepartment) // dErr, BranchInfo := commonus.GetBranchFactory(flowLogInfo.DutyDepartment)
if dErr == true { BranchInfo, dErr := commonus.GetNewOrgCont(flowLogInfo.DutyDepartment)
if dErr == nil {
outListMap["departmentname"] = BranchInfo.Name outListMap["departmentname"] = BranchInfo.Name
titleStr = fmt.Sprintf("%v%v", BranchInfo.Name, titleStr) titleStr = fmt.Sprintf("%v%v", BranchInfo.Name, titleStr)
} else { } else {

144
gin_server_admin/api/index/evaluation/examineflow.go

@ -66,81 +66,85 @@ func (e *EvaluationInterface) ExamineFlow(c *gin.Context) {
} }
} }
flowMap = append(flowMap, twoFlowInfo) flowMap = append(flowMap, twoFlowInfo)
//3、被考核部门内勤进行责任划分
var threeFlowInfo commonus.FlowAllMap if requestData.PlusReduction != 1 {
threeFlowInfo.Step = 3 //3、被考核部门内勤进行责任划分
threeFlowInfo.NodeName = commonus.GetSetpName(3) var threeFlowInfo commonus.FlowAllMap
threeFlowInfo.State = 1 threeFlowInfo.Step = 3
threeFlowInfo.Class = 1 threeFlowInfo.NodeName = commonus.GetSetpName(3)
threeFlowInfo.State = 1
// threeorgCont, _ := commonus.GetNewOrgCont(map[string]interface{}{"`id`": qualEvalInfo.AcceptEvaluation}, "id", "wechat_organization_id") threeFlowInfo.Class = 1
// sendUserIsTrueThree, sendUserListThree := commonus.GetSendMsgUserAry(16118387069540343, threeorgCont.WechatOrganizationId)
sendUserIsTrueThree, sendUserListThree := commonus.GetSendMsgUserAry(16118387069540343, qualEvalInfo.AcceptEvaluation) // threeorgCont, _ := commonus.GetNewOrgCont(map[string]interface{}{"`id`": qualEvalInfo.AcceptEvaluation}, "id", "wechat_organization_id")
if sendUserIsTrueThree == true { // sendUserIsTrueThree, sendUserListThree := commonus.GetSendMsgUserAry(16118387069540343, threeorgCont.WechatOrganizationId)
for _, v := range sendUserListThree { sendUserIsTrueThree, sendUserListThree := commonus.GetSendMsgUserAry(16118387069540343, qualEvalInfo.AcceptEvaluation)
threeFlowInfo.UserList = append(threeFlowInfo.UserList, GetApproveUser(v)) if sendUserIsTrueThree == true {
for _, v := range sendUserListThree {
threeFlowInfo.UserList = append(threeFlowInfo.UserList, GetApproveUser(v))
}
} }
} flowMap = append(flowMap, threeFlowInfo)
flowMap = append(flowMap, threeFlowInfo) //4、被考核部门负责人对责任划分确认
//4、被考核部门负责人对责任划分确认 var fourFlowInfo commonus.FlowAllMap
var fourFlowInfo commonus.FlowAllMap fourFlowInfo.Step = 4
fourFlowInfo.Step = 4 fourFlowInfo.NodeName = commonus.GetSetpName(7)
fourFlowInfo.NodeName = commonus.GetSetpName(7) fourFlowInfo.State = 1
fourFlowInfo.State = 1 fourFlowInfo.Class = 1
fourFlowInfo.Class = 1
// fourorgCont, _ := commonus.GetNewOrgCont(map[string]interface{}{"`id`": qualEvalInfo.AcceptEvaluation}, "id", "wechat_organization_id")
// fourorgCont, _ := commonus.GetNewOrgCont(map[string]interface{}{"`id`": qualEvalInfo.AcceptEvaluation}, "id", "wechat_organization_id") // sendUserIsTrueFour, sendUserListFour := commonus.GetSendMsgUserAry(16182159043990656, fourorgCont.WechatOrganizationId)
// sendUserIsTrueFour, sendUserListFour := commonus.GetSendMsgUserAry(16182159043990656, fourorgCont.WechatOrganizationId) sendUserIsTrueFour, sendUserListFour := commonus.GetSendMsgUserAry(16182159043990656, qualEvalInfo.AcceptEvaluation)
sendUserIsTrueFour, sendUserListFour := commonus.GetSendMsgUserAry(16182159043990656, qualEvalInfo.AcceptEvaluation) if sendUserIsTrueFour == true {
if sendUserIsTrueFour == true { for _, v := range sendUserListFour {
for _, v := range sendUserListFour { fourFlowInfo.UserList = append(fourFlowInfo.UserList, GetApproveUser(v))
fourFlowInfo.UserList = append(fourFlowInfo.UserList, GetApproveUser(v)) }
} }
} flowMap = append(flowMap, fourFlowInfo)
flowMap = append(flowMap, fourFlowInfo) if requestData.IsCorrection == 1 {
if requestData.IsCorrection == 1 { //5、整改人节点。由内勤指定
//5、整改人节点。由内勤指定 var fiveFlowInfo commonus.FlowAllMap
var fiveFlowInfo commonus.FlowAllMap fiveFlowInfo.Step = 5
fiveFlowInfo.Step = 5 fiveFlowInfo.NodeName = commonus.GetSetpName(4)
fiveFlowInfo.NodeName = commonus.GetSetpName(4) fiveFlowInfo.State = 1
fiveFlowInfo.State = 1 fiveFlowInfo.Class = 2
fiveFlowInfo.Class = 2 // fiveFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 5,encFile)
// fiveFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 5,encFile) flowMap = append(flowMap, fiveFlowInfo)
flowMap = append(flowMap, fiveFlowInfo) //6、被考核部门负责人对整改措施确认
//6、被考核部门负责人对整改措施确认 var sixFlowInfo commonus.FlowAllMap
var sixFlowInfo commonus.FlowAllMap sixFlowInfo.Step = 6
sixFlowInfo.Step = 6 sixFlowInfo.NodeName = commonus.GetSetpName(7)
sixFlowInfo.NodeName = commonus.GetSetpName(7) sixFlowInfo.State = 1
sixFlowInfo.State = 1 sixFlowInfo.Class = 1
sixFlowInfo.Class = 1
// sixorgCont, _ := commonus.GetNewOrgCont(map[string]interface{}{"`id`": qualEvalInfo.AcceptEvaluation}, "id", "wechat_organization_id")
// sixorgCont, _ := commonus.GetNewOrgCont(map[string]interface{}{"`id`": qualEvalInfo.AcceptEvaluation}, "id", "wechat_organization_id") // sendUserIsTrueSix, sendUserListSix := commonus.GetSendMsgUserAry(16182159043990656, sixorgCont.WechatOrganizationId)
// sendUserIsTrueSix, sendUserListSix := commonus.GetSendMsgUserAry(16182159043990656, sixorgCont.WechatOrganizationId) sendUserIsTrueSix, sendUserListSix := commonus.GetSendMsgUserAry(16182159043990656, qualEvalInfo.AcceptEvaluation)
sendUserIsTrueSix, sendUserListSix := commonus.GetSendMsgUserAry(16182159043990656, qualEvalInfo.AcceptEvaluation) if sendUserIsTrueSix == true {
if sendUserIsTrueSix == true { for _, v := range sendUserListSix {
for _, v := range sendUserListSix { sixFlowInfo.UserList = append(sixFlowInfo.UserList, GetApproveUser(v))
sixFlowInfo.UserList = append(sixFlowInfo.UserList, GetApproveUser(v)) }
} }
flowMap = append(flowMap, sixFlowInfo)
//7、发起人验收
var serverFlowInfo commonus.FlowAllMap
serverFlowInfo.Step = 7
serverFlowInfo.NodeName = commonus.GetSetpName(5)
serverFlowInfo.State = 1
serverFlowInfo.Class = 1
serverFlowInfo.UserList = append(serverFlowInfo.UserList, GetApproveUser(userCont.Wechat))
flowMap = append(flowMap, serverFlowInfo)
} else {
//5、发起人验收
// var serverEsFlowInfo commonus.FlowAllMap
// serverEsFlowInfo.Step = 5
// serverEsFlowInfo.NodeName = commonus.GetSetpName(5)
// serverEsFlowInfo.State = 1
// serverEsFlowInfo.Class = 1
// serverEsFlowInfo.UserList = append(serverEsFlowInfo.UserList, GetApproveUser(userCont.Wechat))
// flowMap = append(flowMap, serverEsFlowInfo)
} }
flowMap = append(flowMap, sixFlowInfo)
//7、发起人验收
var serverFlowInfo commonus.FlowAllMap
serverFlowInfo.Step = 7
serverFlowInfo.NodeName = commonus.GetSetpName(5)
serverFlowInfo.State = 1
serverFlowInfo.Class = 1
serverFlowInfo.UserList = append(serverFlowInfo.UserList, GetApproveUser(userCont.Wechat))
flowMap = append(flowMap, serverFlowInfo)
} else {
//5、发起人验收
var serverEsFlowInfo commonus.FlowAllMap
serverEsFlowInfo.Step = 5
serverEsFlowInfo.NodeName = commonus.GetSetpName(5)
serverEsFlowInfo.State = 1
serverEsFlowInfo.Class = 1
serverEsFlowInfo.UserList = append(serverEsFlowInfo.UserList, GetApproveUser(userCont.Wechat))
flowMap = append(flowMap, serverEsFlowInfo)
} }
} else { } else {
//定量 //定量
//审批结束 //审批结束

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

@ -105,6 +105,7 @@ func (e *EvaluationInterface) PlusOrMinusPoints(c *gin.Context) {
var addScore assessmentmodel.ScoreFlow var addScore assessmentmodel.ScoreFlow
addScore.EvaluationPlan = planIdInt //考核方案项目ID addScore.EvaluationPlan = planIdInt //考核方案项目ID
addScore.PlusReduceScore = requestData.Type //1:加分;2:减分 addScore.PlusReduceScore = requestData.Type //1:加分;2:减分
addScore.PlanVersion = requestData.PlanVersionNumber
//分值转化 //分值转化
scoreStringToInt64 := commonus.GetDuyCycle(requestData.Score, 100) scoreStringToInt64 := commonus.GetDuyCycle(requestData.Score, 100)
@ -219,8 +220,9 @@ func (e *EvaluationInterface) PlusOrMinusPoints(c *gin.Context) {
twoLevelTitle := "考核上报部门:" twoLevelTitle := "考核上报部门:"
twoLevelKeyName := "" twoLevelKeyName := ""
execDerpatErr, execDerpat := commonus.GetBranchFactory(departmentId) // execDerpatErr, execDerpat := commonus.GetBranchFactory(departmentId)
if execDerpatErr == true { execDerpat, execDerpatErr := commonus.GetNewOrgCont(departmentId)
if execDerpatErr == nil {
twoLevelKeyName = execDerpat.Name twoLevelKeyName = execDerpat.Name
} }
var twoLevelKeyValue string = "" var twoLevelKeyValue string = ""
@ -239,27 +241,60 @@ func (e *EvaluationInterface) PlusOrMinusPoints(c *gin.Context) {
// return // return
//暂停审核方便录入测试数据 //暂停审核方便录入测试数据
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 {
//写入当前流程步骤
// commonus.StepAddData(keyNumber, 0, 3, 1, 1, 2, 1, userCont.Key) //原
commonus.StepAddDataEs(keyNumber, 0, 3, 1, 1, 1, 1, userCont.Key, requestData.Enclosure)
//申请人也是部门负责人
//给相关部门内勤发送消息。确定相关责任人
sendUserIsTrue, sendUserList := commonus.GetSendMsgUser(16118387069540343, programme.AcceptEvaluation) //获取对应部门内勤
if sendUserIsTrue != true {
response.Result(0, sendUserList, "未指定相关部门处理人!未能向相关人员发送考核项目!请手动发起!", c)
return
}
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v", keyNumber)
jumpUrlTitle := "请前往处理"
sourceDesc := "责任划分"
var sendTextMsg sendmessage.TextNoticeTemplateMedium
sendTextMsg.SendMsgTextShare(sendUserList, taskId, title, desc, subtitle, reason, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, cardJumpUrl, jumpUrl, jumpUrlTitle, sourceDesc)
if requestData.Type != 1 {
if myIsTrue != 1 {
//写入当前流程步骤
// commonus.StepAddData(keyNumber, 0, 3, 1, 1, 2, 1, userCont.Key) //原
commonus.StepAddDataEs(keyNumber, 0, 3, 1, 1, 1, 1, userCont.Key, requestData.Enclosure)
//申请人也是部门负责人
//给相关部门内勤发送消息。确定相关责任人
sendUserIsTrue, sendUserList := commonus.GetSendMsgUser(16118387069540343, programme.AcceptEvaluation) //获取对应部门内勤
if sendUserIsTrue != true {
response.Result(0, sendUserList, "未指定相关部门处理人!未能向相关人员发送考核项目!请手动发起!", c)
return
}
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v", keyNumber)
jumpUrlTitle := "请前往处理"
sourceDesc := "责任划分"
var sendTextMsg sendmessage.TextNoticeTemplateMedium
sendTextMsg.SendMsgTextShare(sendUserList, taskId, title, desc, subtitle, reason, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, cardJumpUrl, jumpUrl, jumpUrlTitle, sourceDesc)
} else {
//写入当前流程步骤
// commonus.StepAddData(keyNumber, 16182159043990656, 2, 1, 1, 2, 1, userCont.Key) //原
commonus.StepAddDataEs(keyNumber, 16182159043990656, 2, 1, 1, 1, 1, userCont.Key, requestData.Enclosure)
//申请人不是是部门负责人 给本部门负责人发送审批
//获取发起人部门负责人
departmentIdInts, _ := strconv.ParseInt(userCont.Deparment, 10, 64)
_, sendUserList := commonus.GetSendMsgUserAry(16182159043990656, departmentIdInts) //获取对应部门负责人
sendUserStr := strings.Join(sendUserList, "|")
//按钮
var buttonMap []sendmessage.ButtonListtype
var buttonCont sendmessage.ButtonListtype
buttonCont.Type = 0
buttonCont.Text = "批准"
buttonCont.Style = 1
buttonCont.Key = fmt.Sprintf("duty_%v_1_%v", keyNumber, 0)
buttonMap = append(buttonMap, buttonCont)
buttonCont.Type = 0
buttonCont.Text = "驳回"
buttonCont.Style = 3
buttonCont.Key = fmt.Sprintf("duty_%v_2_%v", keyNumber, 0)
buttonMap = append(buttonMap, buttonCont)
// response.Result(0, buttonCont, "数据写入成功", c)
// return
var sendTextMsg sendmessage.ButtonNoticeTemplateMedium
callbakcMsg, isTrueCall, callBackCont := sendTextMsg.SendButtonShare(sendUserStr, taskId, "部门负责人审批", title, desc, subtitle, reason, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, cardJumpUrl, buttonMap)
outData := commonus.MapOut()
outData["callbakcMsg"] = string(callbakcMsg)
outData["isTrueCall"] = isTrueCall
outData["callBackCont"] = callBackCont
response.Result(0, outData, "数据写入成功", c)
}
} else { } else {
//写入当前流程步骤 commonus.StepAddDataEs(keyNumber, 16182159043990656, 2, 7, 1, 1, 1, userCont.Key, requestData.Enclosure)
// commonus.StepAddData(keyNumber, 16182159043990656, 2, 1, 1, 2, 1, userCont.Key) //原
commonus.StepAddDataEs(keyNumber, 16182159043990656, 2, 1, 1, 1, 1, userCont.Key, requestData.Enclosure)
//申请人不是是部门负责人 给本部门负责人发送审批 //申请人不是是部门负责人 给本部门负责人发送审批
//获取发起人部门负责人 //获取发起人部门负责人
departmentIdInts, _ := strconv.ParseInt(userCont.Deparment, 10, 64) departmentIdInts, _ := strconv.ParseInt(userCont.Deparment, 10, 64)
@ -278,6 +313,8 @@ func (e *EvaluationInterface) PlusOrMinusPoints(c *gin.Context) {
buttonCont.Style = 3 buttonCont.Style = 3
buttonCont.Key = fmt.Sprintf("duty_%v_2_%v", keyNumber, 0) buttonCont.Key = fmt.Sprintf("duty_%v_2_%v", keyNumber, 0)
buttonMap = append(buttonMap, buttonCont) buttonMap = append(buttonMap, buttonCont)
// response.Result(0, buttonCont, "数据写入成功", c)
// return
var sendTextMsg sendmessage.ButtonNoticeTemplateMedium var sendTextMsg sendmessage.ButtonNoticeTemplateMedium
callbakcMsg, isTrueCall, callBackCont := sendTextMsg.SendButtonShare(sendUserStr, taskId, "部门负责人审批", title, desc, subtitle, reason, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, cardJumpUrl, buttonMap) callbakcMsg, isTrueCall, callBackCont := sendTextMsg.SendButtonShare(sendUserStr, taskId, "部门负责人审批", title, desc, subtitle, reason, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, cardJumpUrl, buttonMap)
outData := commonus.MapOut() outData := commonus.MapOut()
@ -324,8 +361,14 @@ func (e *EvaluationInterface) PersonInCharge(c *gin.Context) {
return return
} }
} else { } else {
response.Result(1042, regErr, "未知考核项目!请检查你的提交是否正确!", c) // response.Result(1042, regErr, "未知考核项目!请检查你的提交是否正确!", c)
return // return
registerNumber, _ := strconv.ParseInt(requestData.Register, 10, 64)
var registerCont assessmentmodel.Register
registerCont.Number = registerNumber
registerCont.State = 1
registerCont.Time = time.Now().Unix()
registerCont.AddCont()
} }
if len(requestData.UserList) < 1 { if len(requestData.UserList) < 1 {
response.Result(105, requestData, "请选择要考核的人员!", c) response.Result(105, requestData, "请选择要考核的人员!", c)
@ -345,7 +388,7 @@ func (e *EvaluationInterface) PersonInCharge(c *gin.Context) {
} }
} }
//写入审批流程 //写入审批流程
commonus.StepAddData(orderId, 0, 4, 3, 1, 1, 3, userCont.Key) commonus.StepAddData(orderId, 0, 4, 3, 1, 2, 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
@ -693,7 +736,7 @@ func (e *EvaluationInterface) RectificationMeasures(c *gin.Context) {
registerCont.EiteCont(regWhere, saveRegData) registerCont.EiteCont(regWhere, saveRegData)
//写入流程步骤 //写入流程步骤
// commonus.StepAddData(orderidval, 0, 6, 4, 1, 2, 5, userCont.Key) //原 // commonus.StepAddData(orderidval, 0, 6, 4, 1, 2, 5, userCont.Key) //原
commonus.StepAddDataEs(orderidval, 0, 6, 4, 1, 1, 5, userCont.Key, requestData.Enclosure) commonus.StepAddDataEs(orderidval, 0, 6, 4, 1, 2, 5, userCont.Key, requestData.Enclosure)
/* /*
向本部门负责人发送审批 向本部门负责人发送审批
*/ */

177
gin_server_admin/api/index/evaluation/flowsendnew.go

@ -0,0 +1,177 @@
package evaluation
import (
"encoding/json"
"fmt"
"strconv"
"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 (e *EvaluationInterface) PlusOrMinusPointsNew(c *gin.Context) {
isTrue, userCont := commonus.ClientIdentity()
if isTrue != true {
response.Result(1001, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c)
return
}
var requestData addPlusOrMinusPoints
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(102, err, "数据获取失败!", c)
return
}
if requestData.PlanId == "" {
response.Result(103, requestData, "未知考核项目!请检查你的提交是否正确!", c)
return
}
planIdInt, planIdIntErr := strconv.ParseInt(requestData.PlanId, 10, 64)
if planIdIntErr != nil {
response.Result(104, requestData, "未知考核项目!请检查你的提交是否正确!", c)
return
}
//获取考核项目内容
var programme assessmentmodel.QualitativeEvaluation
judgeProgramme := global.GVA_DB_Performanceappraisal.Where("`qe_id` = ?", planIdInt).First(&programme).Error
if judgeProgramme != nil {
response.Result(105, programme, "未知考核项目!请检查你的提交是否正确!", c)
return
}
if requestData.Type == 0 {
response.Result(106, requestData, "请问您是要进行加分还是减分?请指定,谢谢!", c)
return
}
countFrequency := 1
if requestData.Count != 0 {
countFrequency = requestData.Count
}
switch requestData.State {
case 2, 3:
if requestData.Score == "" {
response.Result(107, requestData, "请您输入要操作的分数,谢谢!", c)
return
}
tijaoFenshu := commonus.GetDuyCycle(requestData.Score, 100)
if tijaoFenshu > programme.MaxScore {
response.Result(107, requestData, fmt.Sprintf("您提交的分数操作允许提交的最大值(最大值:%v)!", float64(programme.MaxScore)/100), c)
return
}
if tijaoFenshu < programme.MinScore {
response.Result(107, requestData, fmt.Sprintf("您提交的分数操作允许提交的最大值(最小值:%v)!", float64(programme.MinScore)/100), c)
return
}
case 1:
//获取分数
requestData.Score = strconv.FormatInt(programme.MaxScore, 10)
default:
if requestData.Score == "" {
response.Result(107, requestData, "请您输入要操作的分数,谢谢!", c)
return
}
}
if requestData.Reason == "" {
response.Result(108, requestData, "请输入您的原因,谢谢!", c)
return
}
if requestData.Addtime == "" {
response.Result(108, requestData, "请输入您的检查时间,谢谢!", c)
return
}
if requestData.Rectification == 0 {
requestData.Rectification = 2
}
var correctionTime int64 = 0
if requestData.Rectification == 1 {
if requestData.CorrectionTime == "" {
response.Result(108, requestData, "请输入整改期限,谢谢!", c)
return
}
var corrTimeErr bool = false
correctionTime, corrTimeErr = commonus.DateToTimeStampEs(requestData.CorrectionTime)
if corrTimeErr == false {
response.Result(108, requestData, "请输入整改期限时间格式不对,谢谢!", c)
return
}
}
operationTime := time.Now().Unix()
keyNumber := commonus.GetFileNumberEs()
var addScore assessmentmodel.ScoreFlow
addScore.EvaluationPlan = planIdInt //考核方案项目ID
addScore.PlusReduceScore = requestData.Type //1:加分;2:减分
addScore.PlanVersion = requestData.PlanVersionNumber
//分值转化
scoreStringToInt64 := commonus.GetDuyCycle(requestData.Score, 100)
addScore.Score = scoreStringToInt64 //分值(乘100录入)
addScore.Key = keyNumber //识别标志
addScore.Reason = requestData.Reason //操作原因
addScore.Time = operationTime
addScore.EiteTime = operationTime
addScore.Count = countFrequency //发生次数
timeOccurrence := commonus.DateToTimeStamp(requestData.Addtime) //发生时间
addScore.HappenTime = timeOccurrence
// addScore.HappenTime = commonus.DateToTimeStamp(requestData.Addtime) //发生时间
departmentId, departmentIdErr := strconv.ParseInt(userCont.Deparment, 10, 64)
if departmentIdErr == nil {
addScore.EvaluationDepartment = departmentId //测评部门
}
userKey, userKeyErr := strconv.ParseInt(userCont.Key, 10, 64)
if userKeyErr == nil {
addScore.EvaluationUser = userKey //测评人
}
userGroup, userGroupErr := strconv.ParseInt(userCont.Company, 10, 64)
if userGroupErr == nil {
addScore.EvaluationGroup = userGroup //测评集团
}
//获取拆分时间节
addScore.Year = commonus.ComputingTime(timeOccurrence, 1)
addScore.Quarter = commonus.ComputingTime(timeOccurrence, 2)
addScore.Month = commonus.ComputingTime(timeOccurrence, 3)
addScore.Week = commonus.ComputingTime(timeOccurrence, 4)
// addScore.Year = commonus.ComputingTime(operationTime, 1)
// addScore.Quarter = commonus.ComputingTime(operationTime, 2)
// addScore.Month = commonus.ComputingTime(operationTime, 3)
// addScore.Week = commonus.ComputingTime(operationTime, 4)
if len(requestData.Enclosure) > 0 {
enclosure, enclosureErr := json.Marshal(requestData.Enclosure)
if enclosureErr == nil {
addScore.Enclosure = string(enclosure) //附件
}
}
addScore.DutyGroup = programme.Group //职责集团
addScore.DutyDepartment = programme.AcceptEvaluation //职责部门
addScore.Rectification = requestData.Rectification //1、需要整改;2:无需整改
addScore.Reply = 1
addScore.CorrectionTime = correctionTime
addErr := global.GVA_DB_Performanceappraisal.Create(&addScore).Error
//步进内容
if addErr != nil {
response.Result(109, addErr, "数据写入失败", c)
return
}
myIsTrue := 1
if requestData.Type != 1 {
//减分
if myIsTrue != 1 {
//申请人也是部门负责人
commonus.StepAddDataEs(keyNumber, 0, 3, 1, 1, 1, 1, userCont.Key, requestData.Enclosure)
} else {
//申请人不是是部门负责人 给本部门负责人发送审批
commonus.StepAddDataEs(keyNumber, 16182159043990656, 2, 1, 1, 1, 1, userCont.Key, requestData.Enclosure)
}
} else {
//加分
commonus.StepAddDataEs(keyNumber, 16182159043990656, 2, 7, 1, 1, 1, userCont.Key, requestData.Enclosure)
}
response.Result(0, requestData, "数据写入成功", c)
}

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

@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"strconv" "strconv"
"strings"
"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"
@ -129,12 +130,15 @@ func (e *EvaluationInterface) SeeFlowLog(c *gin.Context) {
if requestData.Page <= 0 { if requestData.Page <= 0 {
requestData.Page = 1 requestData.Page = 1
} }
if requestData.IsSet == 0 {
requestData.IsSet = 1
}
offSetPage := commonus.CalculatePages(requestData.Page, requestData.PageSize) offSetPage := commonus.CalculatePages(requestData.Page, requestData.PageSize)
// var evalProContList []assessmentmodel.EvaluationProcess // var evalProContList []assessmentmodel.EvaluationProcess
var evalProContList []accPerFlowLog var evalProContList []accPerFlowLog
gormDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationProcess{}) gormDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationProcess{})
gormDb = gormDb.Select("evaluation_process.*,sf.sf_duty_department,sf.sf_evaluation_plan,fl.fl_evaluation_id,fl.fl_evaluation_department,qe.qe_dimension,qe.qe_target,qe.qe_detailed_target,dc.title,et.et_title,dt.dt_title") gormDb = gormDb.Select("evaluation_process.*,sf.sf_duty_department,sf.sf_evaluation_plan,fl.fl_evaluation_id,fl.fl_evaluation_department,qe.qe_dimension,qe.qe_target,qe.qe_detailed_target,dc.title,et.et_title,dt.dt_title,qe.qe_accept_evaluation")
gormDb = gormDb.Joins(("left join score_flow as sf on sf.sf_key = evaluation_process.ep_order_key")) gormDb = gormDb.Joins(("left join score_flow as sf on sf.sf_key = evaluation_process.ep_order_key"))
gormDb = gormDb.Joins(("left join flow_log as fl on fl.fl_key = evaluation_process.ep_order_key")) gormDb = gormDb.Joins(("left join flow_log as fl on fl.fl_key = evaluation_process.ep_order_key"))
@ -152,7 +156,14 @@ func (e *EvaluationInterface) SeeFlowLog(c *gin.Context) {
gormDb = gormDb.Where("sf.sf_duty_department = ? OR fl.fl_evaluation_department = ?", requestData.Department, requestData.Department) gormDb = gormDb.Where("sf.sf_duty_department = ? OR fl.fl_evaluation_department = ?", requestData.Department, requestData.Department)
} }
} }
gormDb = gormDb.Where("FIND_IN_SET(?,`ep_participants`)", userCont.Key) // gormDb = gormDb.Where("FIND_IN_SET(?,`ep_participants`)", userCont.Key)
if requestData.IsSet == 1 {
gormDb = gormDb.Where("FIND_IN_SET(?,`ep_participants`) OR NOT FIND_IN_SET(?,`ep_next_executor`)", userCont.Key, userCont.Key)
} else {
gormDb = gormDb.Where("FIND_IN_SET(?,`ep_participants`) OR FIND_IN_SET(?,`ep_next_executor`)", userCont.Key, userCont.Key)
}
if requestData.State != 0 { if requestData.State != 0 {
gormDb = gormDb.Where("evaluation_process.ep_state = ?", requestData.State) gormDb = gormDb.Where("evaluation_process.ep_state = ?", requestData.State)
} else { } else {
@ -171,7 +182,8 @@ func (e *EvaluationInterface) SeeFlowLog(c *gin.Context) {
total = 0 total = 0
} }
//获取记录数据 //获取记录数据
evaErr := gormDb.Order("ep_id ASC").Limit(requestData.PageSize).Offset(offSetPage).Find(&evalProContList).Error evaErr := gormDb.Order("ep_state ASC,ep_id DESC").Limit(requestData.PageSize).Offset(offSetPage).Find(&evalProContList).Error
// evaErr := gormDb.Order("ep_id DESC").Limit(requestData.PageSize).Offset(offSetPage).Find(&evalProContList).Error
if evaErr != nil { if evaErr != nil {
response.Result(104, evaErr, "数据获取失败!", c) response.Result(104, evaErr, "数据获取失败!", c)
return return
@ -185,6 +197,16 @@ func (e *EvaluationInterface) SeeFlowLog(c *gin.Context) {
flowLogListCont.OutId = orderId flowLogListCont.OutId = orderId
flowLogListCont.Class = v.TypeClass flowLogListCont.Class = v.TypeClass
flowLogListCont.MonthDays = commonus.TimeStampToDate(v.StartTime, 15) flowLogListCont.MonthDays = commonus.TimeStampToDate(v.StartTime, 15)
flowLogListCont.IsSet = 1
isSetUser := strings.Split(v.NextExecutor, ",")
if len(isSetUser) > 0 {
if commonus.IsItTrueString(userCont.Key, isSetUser) == true {
flowLogListCont.IsSet = 2
}
}
fmt.Printf("TypeClass ---------%v\n", v.TypeClass)
if v.TypeClass == 1 { if v.TypeClass == 1 {
//获取考核项目关联项目 //获取考核项目关联项目
targettitle, detailedRulesTitle, _, _, scoreFlowCont, qualEvalInfo, dutyTarDetErr := commonus.GetDutyAssociatedItems(orderId) targettitle, detailedRulesTitle, _, _, scoreFlowCont, qualEvalInfo, dutyTarDetErr := commonus.GetDutyAssociatedItems(orderId)
@ -199,8 +221,21 @@ func (e *EvaluationInterface) SeeFlowLog(c *gin.Context) {
flowLogListCont.CycleAttres = qualEvalInfo.CycleAttres flowLogListCont.CycleAttres = qualEvalInfo.CycleAttres
if qualEvalInfo.AcceptEvaluation != 0 { if qualEvalInfo.AcceptEvaluation != 0 {
whereDepart := commonus.MapOut() whereDepart := commonus.MapOut()
whereDepart["id"] = qualEvalInfo.AcceptEvaluation whereDepart["id"] = v.AcceptEvaluation
orgContDer, orgContDerErr := commonus.GetNewOrgCont(whereDepart, "name")
if orgContDerErr == nil {
if departTitleName == "" {
departTitleName = orgContDer.Name
} else {
departTitleName = fmt.Sprintf("%v、%v", departTitleName, orgContDer.Name)
}
flowLogListCont.ExecutiveDepartment = append(flowLogListCont.ExecutiveDepartment, orgContDer.Name)
}
} else {
whereDepart := commonus.MapOut()
whereDepart["id"] = v.AcceptEvaluation
orgContDer, orgContDerErr := commonus.GetNewOrgCont(whereDepart, "name") orgContDer, orgContDerErr := commonus.GetNewOrgCont(whereDepart, "name")
fmt.Printf("whereDepart ---------->%v------->%v-------->%v-------->%v\n", v.TypeClass, whereDepart, orgContDerErr, orgContDer)
if orgContDerErr == nil { if orgContDerErr == nil {
if departTitleName == "" { if departTitleName == "" {
departTitleName = orgContDer.Name departTitleName = orgContDer.Name
@ -221,6 +256,20 @@ func (e *EvaluationInterface) SeeFlowLog(c *gin.Context) {
flowLogListCont.Week = scoreFlowCont.Week //`json:"week"` //周"` flowLogListCont.Week = scoreFlowCont.Week //`json:"week"` //周"`
flowLogListCont.Days = commonus.ComputingTime(scoreFlowCont.HappenTime, 5) //`json:"days"` //天 flowLogListCont.Days = commonus.ComputingTime(scoreFlowCont.HappenTime, 5) //`json:"days"` //天
} else {
var departTitleName string
whereDepart := commonus.MapOut()
whereDepart["id"] = v.AcceptEvaluation
orgContDer, orgContDerErr := commonus.GetNewOrgCont(whereDepart, "name")
fmt.Printf("whereDepart ---------->%v------->%v-------->%v-------->%v\n", v.TypeClass, whereDepart, orgContDerErr, orgContDer)
if orgContDerErr == nil {
if departTitleName == "" {
departTitleName = orgContDer.Name
} else {
departTitleName = fmt.Sprintf("%v、%v", departTitleName, orgContDer.Name)
}
flowLogListCont.ExecutiveDepartment = append(flowLogListCont.ExecutiveDepartment, orgContDer.Name)
}
} }
} else { } else {
flowLogInfo, flowLogErr := commonus.GetFlowLog(orderId) flowLogInfo, flowLogErr := commonus.GetFlowLog(orderId)

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

@ -31,15 +31,19 @@ type TargetContOutCont struct {
State int `json:"state"` State int `json:"state"`
UserList []string `json:"userlist"` //执行人列表 UserList []string `json:"userlist"` //执行人列表
UserListAry []QualEvalArrt `json:"userlistary"` //执行人列表 UserListAry []QualEvalArrt `json:"userlistary"` //执行人列表
Actual string `json:"actual"` //实际值
ZeroPrize string `json:"zeroprize"` //零奖值 Actual string `json:"actual"` //实际值
AllPrize string `json:"allprize"` //全奖奖值 ZeroPrize string `json:"zeroprize"` //零奖值
Reach string `json:"reach"` //达成率 AllPrize string `json:"allprize"` //全奖奖值
ReachScore float64 `json:"reachscore"` //达成率 Reach string `json:"reach"` //达成率公式
Reason string `json:"reason"` //说明 ReachScore float64 `json:"reachscore"` //达成率
ScoringMethod int64 `json:"scoringmethod"` CappingVal float64 `json:"cappingcal"` //封顶值
DimensionWeight int64 `json:"dimensionweight"` //权重
TargetWeight int64 `json:"targetweight"` //权重 Reason string `json:"reason"` //说明
ScoringMethod int64 `json:"scoringmethod"`
DimensionWeight int64 `json:"dimensionweight"` //权重
TargetWeight int64 `json:"targetweight"` //权重
PlanVersionNumber string `json:"planversionnumber"` //版本号
} }
//定性考核列表输出 //定性考核列表输出
@ -68,7 +72,8 @@ type addPlusOrMinusPoints struct {
CorrectionTime string `json:"correctiontime"` //整改期限 CorrectionTime string `json:"correctiontime"` //整改期限
// Enclosure []string `json:"enclosure"` //附件 // Enclosure []string `json:"enclosure"` //附件
// Enclosure []EnclosureFormat `json:"enclosure"` //附件 // Enclosure []EnclosureFormat `json:"enclosure"` //附件
Enclosure []commonus.EnclosureFormat `json:"enclosure"` //附件 Enclosure []commonus.EnclosureFormat `json:"enclosure"` //附件
PlanVersionNumber string `json:"planversionnumber"` //版本号
} }
type enclosureType struct { type enclosureType struct {
Type int `json:"type"` //1:加分;2:减分 Type int `json:"type"` //1:加分;2:减分
@ -123,28 +128,31 @@ type CorrectiveMeasuresType struct {
//添加定量考核 //添加定量考核
type AddRationFlowLog struct { type AddRationFlowLog struct {
GroupId string `json:"groupid"` GroupId string `json:"groupid"`
DepartmentID string `json:"departmentid"` DepartmentID string `json:"departmentid"`
Addtime string `json:"time"` //检查时间 Addtime string `json:"time"` //检查时间
List []RationLogList `json:"list"` PlanVersionNumber string `json:"planversionnumber"` //版本号
List []RationLogList `json:"list"`
} }
type RationLogList struct { type RationLogList struct {
Id string `json:"id"` Id string `json:"id"`
// Score int64 `json:"score` // Score int64 `json:"score`
Actual string `json:"actual` Actual string `json:"actual`
Unit string `json:"unit` Unit string `json:"unit`
// Content string `json:"content"` //原因 TargetName string `json:"targetname"` //原因
Reason string `json:"reason"` //原因 Reason string `json:"reason"` //原因
Enclosure []string `json:"enclosure"` //附件 Enclosure []string `json:"enclosure"` //附件
ScoringMethod int `json:"scoringmethod"` //计分方式(1:自动;2:手动)"` ScoringMethod int `json:"scoringmethod"` //计分方式(1:自动;2:手动)"`
ScoringScore int64 `json:"scoringscore"` //手动分"` ScoringScore float64 `json:"scoringscore"` //手动分"`
// PlanVersionNumber string `json:"planversionnumber"` //版本号
} }
//获取定量考核列表 //获取定量考核列表
type GetRationFlowLog struct { type GetRationFlowLog struct {
GroupId string `json:"groupid"` GroupId string `json:"groupid"`
DepartmentID string `json:"departmentid"` DepartmentID string `json:"departmentid"`
TargetId string `json:"targetid"`
} }
//定性指标流程展示 //定性指标流程展示
@ -164,6 +172,7 @@ type DutyCecorFlow struct {
FlowMapAll []commonus.FlowAllMap `json:"flowmapall"` //流程全貌 FlowMapAll []commonus.FlowAllMap `json:"flowmapall"` //流程全貌
LanMuName string `json:"lanmuname"` //前端栏目显示名称 LanMuName string `json:"lanmuname"` //前端栏目显示名称
Enclosure []EnclosureFormat `json:"enclosure"` //附件 Enclosure []EnclosureFormat `json:"enclosure"` //附件
IsSet int `json:"isset"` //是否已经审批
} }
//审批流 //审批流
@ -210,8 +219,14 @@ type RationOutStruct struct {
Unit string `json:"unit"` //单位"` Unit string `json:"unit"` //单位"`
Score float64 `json:score` //分数\ Score float64 `json:score` //分数\
Content string `json:"content"` Content string `json:"content"`
Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年"` Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年"`
CycleAttres int `json:"cycleattr"` //辅助计数"` CycleAttres int `json:"cycleattr"` //辅助计数"`
Actual float64 `json:"actual"` //实际值
ZeroPrize float64 `json:"zeroprize"` //零奖值
AllPrize float64 `json:"allprize"` //全奖奖值
CappingVal float64 `json:"CappingVal"` //封顶值
Achievement float64 `json:"achievement"` //达成率
Weight float64 `json:"weight"`
} }
//定量考核目标设定查询 //定量考核目标设定查询
@ -252,6 +267,7 @@ type FlowLogType struct {
Title string `json:"title"` //指标 Title string `json:"title"` //指标
Department string `json:"department"` //部门 Department string `json:"department"` //部门
Time string `json:"time"` //时间 Time string `json:"time"` //时间
IsSet int `json:"isset"` //未处理 1:已审核;2:未审核
} }
//流程记录输出 //流程记录输出
@ -274,6 +290,8 @@ type FlowLogListOut struct {
Week int64 `json:"week"` //周"` Week int64 `json:"week"` //周"`
Days int64 `json:"days"` //天 Days int64 `json:"days"` //天
MonthDays string `json:"monthdays"` //提报日期 MonthDays string `json:"monthdays"` //提报日期
IsSet int `json:"isset"` //是否已经审批
} }
//新定性考核列表 //新定性考核列表
@ -317,14 +335,16 @@ type NewQualDetailOutList struct {
Score string `json:"score"` Score string `json:"score"`
State int `json:"state"` //1、定分;2、区间分;3、不定性分值 State int `json:"state"` //1、定分;2、区间分;3、不定性分值
TargetSun int64 `json:"targetsun" gorm:"column:qe_target_sun;type:bigint(20) unsigned;default:0;not null;comment:考核指标子栏目"` TargetSun int64 `json:"targetsun" gorm:"column:qe_target_sun;type:bigint(20) unsigned;default:0;not null;comment:考核指标子栏目"`
TargetSunId string `json:"targetsunid"` //子栏目ID TargetSunId string `json:"targetsunid"` //子栏目ID
TargetSunName string `json:"targetsunname"` //子栏目名称 TargetSunName string `json:"targetsunname"` //子栏目名称
PlanVersionNumber string `json:"planversionnumber" gorm:"column:qe_qual_eval_id;type:varchar(200) unsigned;default:0;not null;comment:性质考核方案"` //版本号
} }
//定量或者定性考核审批流程全图 //定量或者定性考核审批流程全图
type getExamineFlow struct { type getExamineFlow struct {
Id string `json:"id"` //考核项目ID Id string `json:"id"` //考核项目ID
IsCorrection int `json:"iscorrection"` //是否整改 IsCorrection int `json:"iscorrection"` //是否整改
PlusReduction int `json:"plusreduction"` //加减分
} }
type AddDutyNewCont struct { type AddDutyNewCont struct {
@ -362,4 +382,12 @@ type accPerFlowLog struct {
DetailedTarget int64 `json:"detailedtarget" gorm:"column:qe_detailed_target;type:bigint(20) unsigned;default:0;not null;comment:考核细则"` DetailedTarget int64 `json:"detailedtarget" gorm:"column:qe_detailed_target;type:bigint(20) unsigned;default:0;not null;comment:考核细则"`
DetailedTitle string `json:"title" gorm:"column:dt_title;type:text;comment:指标细则"` DetailedTitle string `json:"title" gorm:"column:dt_title;type:text;comment:指标细则"`
TargetTitle string `json:"title" gorm:"column:et_title;type:varchar(255);comment:指标名称"` TargetTitle string `json:"title" gorm:"column:et_title;type:varchar(255);comment:指标名称"`
AcceptEvaluation int64 `json:"acceptevaluation" gorm:"column:qe_accept_evaluation;type:bigint(20) unsigned;default:0;not null;comment:接受考核部门"`
}
//新定性考核列表
type QualEvalFlowLog struct {
Group string `json:"group"` //集团
Department string `json:"department"` //部门
QualId int64 `json:"qualid"` //指标名称
} }

40
gin_server_admin/api/statistics/quantification/quant.go

@ -453,22 +453,34 @@ func GetQuantitativeConfig(targetScore int64, resultval float64, group, depart,
zeroPrize = qualConfig.Zeroprize / 100 zeroPrize = qualConfig.Zeroprize / 100
CappingVal = qualConfig.CappingVal / 100 CappingVal = qualConfig.CappingVal / 100
if qualConfig.CappingVal != 0 && resultval >= qualConfig.CappingVal { chuShu := resultval - float64(qualConfig.Zeroprize)
scoreVal = float64(targetScore) beiChuShu := float64(qualConfig.Allprize) - float64(qualConfig.Zeroprize)
achievement = 100 if beiChuShu > 0 {
// fmt.Printf("达成率--1-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", group, depart, dimen, target, year, allPrize, zeroPrize, CappingVal, achievement) achievement = commonus.Decimal(chuShu / beiChuShu)
} else { scoreVal = achievement * (resultval / 100)
chuShu := resultval - float64(qualConfig.Zeroprize) if achievement >= CappingVal {
beiChuShu := float64(qualConfig.Allprize) - float64(qualConfig.Zeroprize) scoreVal = CappingVal * float64(targetScore)
if beiChuShu > 0 {
achievement = commonus.Decimal(chuShu / beiChuShu)
scoreVal = achievement * (resultval / 100)
fmt.Printf("达成率--2-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", group, depart, dimen, target, year, allPrize, zeroPrize, CappingVal, achievement, resultval)
} else {
scoreVal = float64(targetScore)
// fmt.Printf("达成率--3-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", group, depart, dimen, target, year, allPrize, zeroPrize, CappingVal, achievement)
} }
} else {
scoreVal = float64(targetScore)
} }
// if qualConfig.CappingVal != 0 && resultval >= qualConfig.CappingVal {
// scoreVal = float64(targetScore)
// achievement = 100
// // fmt.Printf("达成率--1-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", group, depart, dimen, target, year, allPrize, zeroPrize, CappingVal, achievement)
// } else {
// chuShu := resultval - float64(qualConfig.Zeroprize)
// beiChuShu := float64(qualConfig.Allprize) - float64(qualConfig.Zeroprize)
// if beiChuShu > 0 {
// achievement = commonus.Decimal(chuShu / beiChuShu)
// scoreVal = achievement * (resultval / 100)
// fmt.Printf("达成率--2-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", group, depart, dimen, target, year, allPrize, zeroPrize, CappingVal, achievement, resultval)
// } else {
// scoreVal = float64(targetScore)
// // fmt.Printf("达成率--3-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", group, depart, dimen, target, year, allPrize, zeroPrize, CappingVal, achievement)
// }
// }
// fmt.Printf("达成率--4-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", group, depart, dimen, target, year, allPrize, zeroPrize, CappingVal, achievement) // fmt.Printf("达成率--4-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v-->%v\n", group, depart, dimen, target, year, allPrize, zeroPrize, CappingVal, achievement)
return return
} }

88
gin_server_admin/api/v1/assessment/set_evaluation_objectives.go

@ -108,20 +108,22 @@ func (d *DutyHandle) SetEvaluationObjectives(c *gin.Context) {
if v.Zeroprize < 0 { if v.Zeroprize < 0 {
saveDataCont.Zeroprize = 0 saveDataCont.Zeroprize = 0
} else { } else {
if v.Zeroprize > 100 { // if v.Zeroprize > 100 {
saveDataCont.Zeroprize = 10000 // saveDataCont.Zeroprize = 10000
} else { // } else {
saveDataCont.Zeroprize = v.Zeroprize * 100 // saveDataCont.Zeroprize = v.Zeroprize * 100
} // }
saveDataCont.Zeroprize = v.Zeroprize * 100
} }
if v.Allprize < 0 { if v.Allprize < 0 {
saveDataCont.Allprize = 0 saveDataCont.Allprize = 0
} else { } else {
if v.Allprize > 100 { // if v.Allprize > 100 {
saveDataCont.Allprize = 10000 // saveDataCont.Allprize = 10000
} else { // } else {
saveDataCont.Allprize = v.Allprize * 100 // saveDataCont.Allprize = v.Allprize * 100
} // }
saveDataCont.Allprize = v.Allprize * 100
} }
if v.Capping > 0 { if v.Capping > 0 {
saveDataCont.Capping = 1 saveDataCont.Capping = 1
@ -158,20 +160,22 @@ func (d *DutyHandle) SetEvaluationObjectives(c *gin.Context) {
if v.Zeroprize < 0 { if v.Zeroprize < 0 {
saveDataCont.Zeroprize = 0 saveDataCont.Zeroprize = 0
} else { } else {
if v.Zeroprize > 100 { // if v.Zeroprize > 100 {
saveDataCont.Zeroprize = 10000 // saveDataCont.Zeroprize = 10000
} else { // } else {
saveDataCont.Zeroprize = v.Zeroprize * 100 // saveDataCont.Zeroprize = v.Zeroprize * 100
} // }
saveDataCont.Zeroprize = v.Zeroprize * 100
} }
if v.Allprize < 0 { if v.Allprize < 0 {
saveDataCont.Allprize = 0 saveDataCont.Allprize = 0
} else { } else {
if v.Allprize > 100 { // if v.Allprize > 100 {
saveDataCont.Allprize = 10000 // saveDataCont.Allprize = 10000
} else { // } else {
saveDataCont.Allprize = v.Allprize * 100 // saveDataCont.Allprize = v.Allprize * 100
} // }
saveDataCont.Allprize = v.Allprize * 100
} }
if v.Capping > 0 { if v.Capping > 0 {
saveDataCont.Capping = 1 saveDataCont.Capping = 1
@ -209,20 +213,22 @@ func (d *DutyHandle) SetEvaluationObjectives(c *gin.Context) {
if v.Zeroprize < 0 { if v.Zeroprize < 0 {
saveDataCont.Zeroprize = 0 saveDataCont.Zeroprize = 0
} else { } else {
if v.Zeroprize > 100 { // if v.Zeroprize > 100 {
saveDataCont.Zeroprize = 10000 // saveDataCont.Zeroprize = 10000
} else { // } else {
saveDataCont.Zeroprize = v.Zeroprize * 100 // saveDataCont.Zeroprize = v.Zeroprize * 100
} // }
saveDataCont.Zeroprize = v.Zeroprize * 100
} }
if v.Allprize < 0 { if v.Allprize < 0 {
saveDataCont.Allprize = 0 saveDataCont.Allprize = 0
} else { } else {
if v.Allprize > 100 { // if v.Allprize > 100 {
saveDataCont.Allprize = 10000 // saveDataCont.Allprize = 10000
} else { // } else {
saveDataCont.Allprize = v.Allprize * 100 // saveDataCont.Allprize = v.Allprize * 100
} // }
saveDataCont.Allprize = v.Allprize * 100
} }
if v.Capping > 0 { if v.Capping > 0 {
saveDataCont.Capping = 1 saveDataCont.Capping = 1
@ -241,20 +247,22 @@ func (d *DutyHandle) SetEvaluationObjectives(c *gin.Context) {
if v.Zeroprize < 0 { if v.Zeroprize < 0 {
eiteDataMap["zeroprize"] = 0 eiteDataMap["zeroprize"] = 0
} else { } else {
if v.Zeroprize > 100 { // if v.Zeroprize > 100 {
eiteDataMap["zeroprize"] = 10000 // eiteDataMap["zeroprize"] = 10000
} else { // } else {
eiteDataMap["zeroprize"] = v.Zeroprize * 100 // eiteDataMap["zeroprize"] = v.Zeroprize * 100
} // }
eiteDataMap["zeroprize"] = v.Zeroprize * 100
} }
if v.Allprize < 0 { if v.Allprize < 0 {
eiteDataMap["allprize"] = 0 eiteDataMap["allprize"] = 0
} else { } else {
if v.Allprize > 100 { // if v.Allprize > 100 {
eiteDataMap["allprize"] = 10000 // eiteDataMap["allprize"] = 10000
} else { // } else {
eiteDataMap["allprize"] = v.Allprize * 100 // eiteDataMap["allprize"] = v.Allprize * 100
} // }
eiteDataMap["allprize"] = v.Allprize * 100
} }
if v.Capping > 0 { if v.Capping > 0 {

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

@ -302,3 +302,21 @@ func getOrgCont(id string) (oldId, orgName string) {
orgName = orgInfo.Name orgName = orgInfo.Name
return return
} }
//获得员工列表
func (s *StaffPeople) StaffListes(c *gin.Context) {
// var requestData staffRequest
// err := c.ShouldBindJSON(&requestData)
// if err != nil {
// // response.Result(101, err, "参数错误!请重新提交!", c)
// // return
// }
// if requestData.PageSize == 0 {
// requestData.PageSize = 20
// }
// if requestData.Page <= 0 {
// requestData.Page = 1
// }
// offSetPage := commonus.CalculatePages(requestData.Page, requestData.PageSize)
}

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

@ -47,8 +47,9 @@ type NewQualDetailOutList struct {
Score string `json:"score"` Score string `json:"score"`
State int `json:"state"` //1、定分;2、区间分;3、不定性分值 State int `json:"state"` //1、定分;2、区间分;3、不定性分值
TargetSun int64 `json:"targetsun" gorm:"column:qe_target_sun;type:bigint(20) unsigned;default:0;not null;comment:考核指标子栏目"` TargetSun int64 `json:"targetsun" gorm:"column:qe_target_sun;type:bigint(20) unsigned;default:0;not null;comment:考核指标子栏目"`
TargetSunId string `json:"targetsunid"` //子栏目ID TargetSunId string `json:"targetsunid"` //子栏目ID
TargetSunName string `json:"targetsunname"` //子栏目名称 TargetSunName string `json:"targetsunname"` //子栏目名称
PlanVersionNumber string `json:"planversionnumber"` //版本号
} }
//新型定性考核列表输出 //新型定性考核列表输出
@ -67,6 +68,7 @@ type NewQualOutList struct {
//考核方案输出 //考核方案输出
type kaoHeFangAn struct { type kaoHeFangAn struct {
Id int64 `json:"id" gorm:"primaryKey;column:qe_id;type:bigint(20) unsigned;not null;comment:Id;index"` Id int64 `json:"id" gorm:"primaryKey;column:qe_id;type:bigint(20) unsigned;not null;comment:Id;index"`
DetailedTarget int64 `json:"detailedtarget" gorm:"column:qe_detailed_target;type:bigint(20) unsigned;default:0;not null;comment:考核细则"` DetailedTarget int64 `json:"detailedtarget" gorm:"column:qe_detailed_target;type:bigint(20) unsigned;default:0;not null;comment:考核细则"`
QualEvalId string `json:"qualevalid" gorm:"column:qe_qual_eval_id;type:varchar(200) unsigned;default:0;not null;comment:性质考核方案"`
} }

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

@ -85,7 +85,7 @@ func (a *ApiGroup) TaskParameterTitleList(c *gin.Context) {
return return
} }
var targetId []kaoHeFangAn var targetId []kaoHeFangAn
gormDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_detailed_target,qe_id").Where("`qe_group` = ?", requestData.Group).Where("`qe_accept_evaluation` = ?", requestData.Department).Where("`qe_target` = ?", requestData.Target).Where("`qe_target_sun` = ?", requestData.SunTarget).Where("`qe_type` = 1 AND `qe_state` = 1 AND FIND_IN_SET(?,`qe_operator`)", userCont.Key).Limit(requestData.PageSize).Offset(commonus.CalculatePages(requestData.Page, requestData.PageSize)).Group("qe_detailed_target,qe_id").Find(&targetId) gormDb := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeEvaluation{}).Select("qe_detailed_target,qe_id,qe_qual_eval_id").Where("`qe_group` = ?", requestData.Group).Where("`qe_accept_evaluation` = ?", requestData.Department).Where("`qe_target` = ?", requestData.Target).Where("`qe_target_sun` = ?", requestData.SunTarget).Where("`qe_type` = 1 AND `qe_state` = 1 AND FIND_IN_SET(?,`qe_operator`)", userCont.Key).Limit(requestData.PageSize).Offset(commonus.CalculatePages(requestData.Page, requestData.PageSize)).Group("qe_detailed_target,qe_id").Find(&targetId)
errDb := gormDb.Error errDb := gormDb.Error
if errDb != nil { if errDb != nil {
@ -129,6 +129,8 @@ func (a *ApiGroup) TaskParameterTitleList(c *gin.Context) {
groupId, _ := strconv.ParseInt(requestData.Group, 10, 64) groupId, _ := strconv.ParseInt(requestData.Group, 10, 64)
outCont.Group = groupId outCont.Group = groupId
outCont.PlanVersionNumber = v.QualEvalId
where := commonus.MapOut() where := commonus.MapOut()
where["id"] = groupId where["id"] = groupId
orgCont, _ := commonus.GetNewOrgCont(where, "id", "name") orgCont, _ := commonus.GetNewOrgCont(where, "id", "name")

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

@ -275,9 +275,10 @@ func WorkWechatMailList(changeType string, decryptMsg []byte) {
func WechatCallBackDataWruteRedis(redisKey, redisVal, class string) { func WechatCallBackDataWruteRedis(redisKey, redisVal, class string) {
redisClient := redishandel.RunRedis() redisClient := redishandel.RunRedis()
redisClient.SetRedisDb(2) redisClient.SetRedisDb(2)
redisClient.SetRedisTime(0) redisClient.SetRedisTime(604800)
switch class { switch class {
case "lpush": //列表 case "lpush": //列表
redisClient.SetRedisTime(31536000)
locationJson, locationErr := redisClient.Lindex(redisKey, 0) locationJson, locationErr := redisClient.Lindex(redisKey, 0)
if locationErr != nil { if locationErr != nil {
redisClient.Lpush(redisKey, redisVal) redisClient.Lpush(redisKey, redisVal)

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

@ -86,11 +86,11 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleRation(orderId, clickEnte
tarInfo, _ := commonus.GetTargetInfo(targetInfo.Target) tarInfo, _ := commonus.GetTargetInfo(targetInfo.Target)
if ii == 0 { if ii == 0 {
if targetInfoErr == true { if targetInfoErr == true {
quoteAreaContent = fmt.Sprintf("%v :%v%v", tarInfo.Title, vv.Score, targetInfo.Unit) quoteAreaContent = fmt.Sprintf("%v :%v%v", tarInfo.Title, float64(vv.Score)/100, targetInfo.Unit)
} }
} else { } else {
if targetInfoErr == true { if targetInfoErr == true {
quoteAreaContent = fmt.Sprintf("%v\n%v :%v%v", quoteAreaContent, tarInfo.Title, vv.Score, targetInfo.Unit) quoteAreaContent = fmt.Sprintf("%v\n%v :%v%v", quoteAreaContent, tarInfo.Title, float64(vv.Score)/100, targetInfo.Unit)
} }
} }
} }
@ -150,11 +150,11 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleRation(orderId, clickEnte
tarInfo, _ := commonus.GetTargetInfo(targetInfo.Target) tarInfo, _ := commonus.GetTargetInfo(targetInfo.Target)
if ii == 0 { if ii == 0 {
if targetInfoErr == true { if targetInfoErr == true {
quoteAreaContent = fmt.Sprintf("%v :%v%v", tarInfo.Title, vv.Score, targetInfo.Unit) quoteAreaContent = fmt.Sprintf("%v :%v%v", tarInfo.Title, float64(vv.Score)/100, targetInfo.Unit)
} }
} else { } else {
if targetInfoErr == true { if targetInfoErr == true {
quoteAreaContent = fmt.Sprintf("%v\n%v :%v%v", quoteAreaContent, tarInfo.Title, vv.Score, targetInfo.Unit) quoteAreaContent = fmt.Sprintf("%v\n%v :%v%v", quoteAreaContent, tarInfo.Title, float64(vv.Score)/100, targetInfo.Unit)
} }
} }
} }

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

@ -131,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, 1, 1, 1, strconv.FormatInt(userContInfo.Key, 10)) commonus.StepAddData(orderIdInt, 0, 1, 1, 1, 2, 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)
@ -150,7 +150,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, 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 {
@ -165,78 +165,97 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
t.UpdateButtonIng(otherUser, buttonClickNAmeOtherEs) t.UpdateButtonIng(otherUser, buttonClickNAmeOtherEs)
} }
} }
//向相关部门内勤发送确认责任人信息
//1、获取责任部门内勤信息 if scoreFlowInfo.PlusReduceScore == 1 {
officWorkUserIsTrue, officWorkUserList := commonus.GetSendMsgUser(16118387069540343, scoreFlowInfo.DutyDepartment) //获取对应部门内勤 commonus.StepAddData(orderIdInt, 16182159043990656, 1, 2, 1, 2, 2, strconv.FormatInt(userContInfo.Key, 10))
if officWorkUserIsTrue != true { flowSaveData := commonus.MapOut()
fmt.Printf("Step------5------->\n") flowSaveData["sf_reply"] = 3
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId) flowSaveData["sf_eite_time"] = time.Now().Unix()
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v", orderId) commonus.EiteScoreFlow(orderIdInt, flowSaveData)
sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl)
return evalProcSaveData := commonus.MapOut()
} evalProcSaveData["ep_state"] = 2
taskId := strconv.FormatInt(commonus.GetFileNumberEs(), 10) evalProcSaveData["ep_time"] = time.Now().Unix()
var programme assessmentmodel.QualitativeEvaluation // var evalProc assessmentmodel.EvaluationProcess
judgeProgramme := global.GVA_DB_Performanceappraisal.Where("`qe_id` = ?", scoreFlowInfo.EvaluationPlan).First(&programme).Error global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationProcess{}).Where("`ep_order_key` = ?", orderId).Updates(&evalProcSaveData)
if judgeProgramme != nil {
fmt.Printf("Step------6------->\n") } else {
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId) commonus.StepAddData(orderIdInt, 16182159043990656, 3, 2, 1, 2, 2, strconv.FormatInt(userContInfo.Key, 10))
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v", orderId)
sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl) //向相关部门内勤发送确认责任人信息
return //1、获取责任部门内勤信息
} officWorkUserIsTrue, officWorkUserList := commonus.GetSendMsgUser(16118387069540343, scoreFlowInfo.DutyDepartment) //获取对应部门内勤
//确定标题 if officWorkUserIsTrue != true {
var title string = "" fmt.Printf("Step------5------->\n")
//一级标题副本内容 cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId)
var desc string = "" jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v", orderId)
detailedTargetCont, detailedTargetErr := commonus.GetDetailedTargetInfo(programme.DetailedTarget) //获取指标细则 sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl)
if detailedTargetErr == true { return
tarInf, tarErr := commonus.GetTargetInfo(detailedTargetCont.ParentId) //获取指标信息 }
if tarErr == true { taskId := strconv.FormatInt(commonus.GetFileNumberEs(), 10)
title = tarInf.Title //一级标题,建议不超过36个字 var programme assessmentmodel.QualitativeEvaluation
desc = detailedTargetCont.Title //一级标题辅助信息,建议不超过44个字 judgeProgramme := global.GVA_DB_Performanceappraisal.Where("`qe_id` = ?", scoreFlowInfo.EvaluationPlan).First(&programme).Error
if judgeProgramme != nil {
fmt.Printf("Step------6------->\n")
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId)
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v", orderId)
sendErrMsg(t.FromUsername, orderId, "此审批流程已经关闭!请联系发起人!", "此审批流程已经关闭!请联系发起人!", userContInfo.DepartmentName, userContInfo.Name, cardJumpUrl, jumpUrl)
return
}
//确定标题
var title string = ""
//一级标题副本内容
var desc string = ""
detailedTargetCont, detailedTargetErr := commonus.GetDetailedTargetInfo(programme.DetailedTarget) //获取指标细则
if detailedTargetErr == true {
tarInf, tarErr := commonus.GetTargetInfo(detailedTargetCont.ParentId) //获取指标信息
if tarErr == true {
title = tarInf.Title //一级标题,建议不超过36个字
desc = detailedTargetCont.Title //一级标题辅助信息,建议不超过44个字
} else {
title = detailedTargetCont.Title //一级标题,建议不超过36个字
}
} else { } else {
title = detailedTargetCont.Title //一级标题,建议不超过36个字 tarInf, tarErr := commonus.GetTargetInfo(programme.Target) //获取指标信息
if tarErr == true {
title = tarInf.Title //一级标题,建议不超过36个字
} else {
title = strconv.FormatInt(programme.DetailedTarget, 10) //一级标题,建议不超过36个字
}
} }
} else { var quoteAreaTitle string = ""
tarInf, tarErr := commonus.GetTargetInfo(programme.Target) //获取指标信息 sendScore := scoreFlowInfo.Score * int64(scoreFlowInfo.Count)
if tarErr == true { if scoreFlowInfo.PlusReduceScore == 1 {
title = tarInf.Title //一级标题,建议不超过36个字 quoteAreaTitle = fmt.Sprintf("考核加分:%v\n", float64(sendScore)/100)
} else { } else {
title = strconv.FormatInt(programme.DetailedTarget, 10) //一级标题,建议不超过36个字 quoteAreaTitle = fmt.Sprintf("考核减分:%v\n", float64(sendScore)/100)
} }
// if scoreFlowInfo.PlusReduceScore == 1 {
// quoteAreaTitle = fmt.Sprintf("加:%v%v\n", scoreFlowInfo.Score, programme.Unit)
// } else {
// quoteAreaTitle = fmt.Sprintf("扣除:%v%v\n", scoreFlowInfo.Score, programme.Unit)
// }
//生成唯一编号
registerNumber := commonus.GetFileNumberEs()
var registerCont assessmentmodel.Register
registerCont.Number = registerNumber
registerCont.State = 1
registerCont.Time = time.Now().Unix()
registerCont.AddCont()
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId)
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v&num=%v", orderId, strconv.FormatInt(registerNumber, 10))
jumpUrlTitle := "请前往处理"
sourceDesc := "责任划分"
// quoteAreaContent := programme
var sendTextMsg sendmessage.TextNoticeTemplateMedium
sendTextMsg.SendMsgTextShare(officWorkUserList, taskId, title, desc, quoteAreaTitle, scoreFlowInfo.Reason, "考核上报部门", userContInfo.DepartmentName, userContInfo.Name, t.FromUsername, cardJumpUrl, jumpUrl, jumpUrlTitle, sourceDesc)
flowSaveData := commonus.MapOut()
flowSaveData["sf_reply"] = 2
flowSaveData["sf_eite_time"] = time.Now().Unix()
commonus.EiteScoreFlow(orderIdInt, flowSaveData)
} }
var quoteAreaTitle string = ""
sendScore := scoreFlowInfo.Score * int64(scoreFlowInfo.Count)
if scoreFlowInfo.PlusReduceScore == 1 {
quoteAreaTitle = fmt.Sprintf("考核加分:%v\n", float64(sendScore)/100)
} else {
quoteAreaTitle = fmt.Sprintf("考核减分:%v\n", float64(sendScore)/100)
}
// if scoreFlowInfo.PlusReduceScore == 1 {
// quoteAreaTitle = fmt.Sprintf("加:%v%v\n", scoreFlowInfo.Score, programme.Unit)
// } else {
// quoteAreaTitle = fmt.Sprintf("扣除:%v%v\n", scoreFlowInfo.Score, programme.Unit)
// }
//生成唯一编号
registerNumber := commonus.GetFileNumberEs()
var registerCont assessmentmodel.Register
registerCont.Number = registerNumber
registerCont.State = 1
registerCont.Time = time.Now().Unix()
registerCont.AddCont()
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v", orderId)
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v&num=%v", orderId, strconv.FormatInt(registerNumber, 10))
jumpUrlTitle := "请前往处理"
sourceDesc := "责任划分"
// quoteAreaContent := programme
var sendTextMsg sendmessage.TextNoticeTemplateMedium
sendTextMsg.SendMsgTextShare(officWorkUserList, taskId, title, desc, quoteAreaTitle, scoreFlowInfo.Reason, "考核上报部门", userContInfo.DepartmentName, userContInfo.Name, t.FromUsername, cardJumpUrl, jumpUrl, jumpUrlTitle, sourceDesc)
flowSaveData := commonus.MapOut()
flowSaveData["sf_reply"] = 2
flowSaveData["sf_eite_time"] = time.Now().Unix()
commonus.EiteScoreFlow(orderIdInt, flowSaveData)
case 3: case 3:
//责任划分(相关部门内勤) //责任划分(相关部门内勤)
case 4: case 4:
@ -317,7 +336,7 @@ 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)) commonus.StepAddData(orderIdInt, 16182159043990656, 5, 7, 1, 2, 4, strconv.FormatInt(userContInfo.Key, 10))
} else { } else {
//不需要整改 //不需要整改
@ -391,14 +410,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)) commonus.StepAddData(orderIdInt, 16182159043990656, 7, 7, 1, 2, 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, 1, 1, 6, strconv.FormatInt(userContInfo.Key, 10)) commonus.StepAddData(orderIdInt, 16182159043990656, 7, 7, 1, 2, 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 {
@ -487,6 +506,13 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
scoreFlowMap["sf_reply"] = 3 scoreFlowMap["sf_reply"] = 3
scoreFlowMap["sf_eite_time"] = time.Now().Unix() scoreFlowMap["sf_eite_time"] = time.Now().Unix()
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Where("`sf_id` = ?", scoreFlowInfo.Id).Updates(scoreFlowMap) global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.ScoreFlow{}).Where("`sf_id` = ?", scoreFlowInfo.Id).Updates(scoreFlowMap)
evalProcSaveData := commonus.MapOut()
evalProcSaveData["ep_state"] = 2
evalProcSaveData["ep_time"] = time.Now().Unix()
// var evalProc assessmentmodel.EvaluationProcess
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationProcess{}).Where("`ep_order_key` = ?", orderId).Updates(&evalProcSaveData)
//2、获取要抄送人员名单 //2、获取要抄送人员名单
var sendUserAry []string var sendUserAry []string
//2.1 获取发起人部门负责人 //2.1 获取发起人部门负责人

41
gin_server_admin/api/wechatapp/sendmessage/sendmsgHandle.go

@ -46,9 +46,13 @@ func SendMsgPublic(sendUserList, Title, Desc, Unit, Reason, handleUrl string, Ty
sendTextMsg.TemplateCard.SubTitleText = "考核上报部门:" sendTextMsg.TemplateCard.SubTitleText = "考核上报部门:"
execDerpatCont := "" execDerpatCont := ""
// execDerpatCont := "考核部门:" // execDerpatCont := "考核部门:"
execDerpatErr, execDerpat := commonus.GetBranchFactory(departmentId) // execDerpatErr, execDerpat := commonus.GetBranchFactory(departmentId)
if execDerpatErr == true { // if execDerpatErr == true {
execDerpatCont = execDerpatCont + execDerpat.Name // execDerpatCont = execDerpatCont + execDerpat.Name
// }
execDerpat, execDerpatErr := commonus.GetNewOrgCont(departmentId)
if execDerpatErr == nil {
execDerpatCont = execDerpat.Name
} }
htalConListStrCon.KeyName = execDerpatCont htalConListStrCon.KeyName = execDerpatCont
//获取操作人 //获取操作人
@ -132,9 +136,13 @@ func SendButtonPublic(sendUserList, Title, Desc, subtitle, reason string, depart
sendTextMsg.TemplateCard.SubTitleText = "责任部门:" sendTextMsg.TemplateCard.SubTitleText = "责任部门:"
execDerpatCont := "" execDerpatCont := ""
// execDerpatCont := "考核部门:" // execDerpatCont := "考核部门:"
execDerpatErr, execDerpat := commonus.GetBranchFactory(departmentId) // execDerpatErr, execDerpat := commonus.GetBranchFactory(departmentId)
if execDerpatErr == true { // if execDerpatErr == true {
execDerpatCont = execDerpatCont + execDerpat.Name // execDerpatCont = execDerpatCont + execDerpat.Name
// }
execDerpat, execDerpatErr := commonus.GetNewOrgCont(departmentId)
if execDerpatErr == nil {
execDerpatCont = execDerpat.Name
} }
htalConListStrCon.KeyName = execDerpatCont htalConListStrCon.KeyName = execDerpatCont
//获取操作人 //获取操作人
@ -201,10 +209,15 @@ func SendButtonPublicRation(sendUserList, Title, Desc, subtitle, reason string,
sendTextMsg.TemplateCard.SubTitleText = "责任部门:" sendTextMsg.TemplateCard.SubTitleText = "责任部门:"
execDerpatCont := "" execDerpatCont := ""
// execDerpatCont := "考核部门:" // execDerpatCont := "考核部门:"
execDerpatErr, execDerpat := commonus.GetBranchFactory(departmentId) // execDerpatErr, execDerpat := commonus.GetBranchFactory(departmentId)
if execDerpatErr == true { // if execDerpatErr == true {
execDerpatCont = execDerpatCont + execDerpat.Name // execDerpatCont = execDerpatCont + execDerpat.Name
// }
execDerpat, execDerpatErr := commonus.GetNewOrgCont(departmentId)
if execDerpatErr == nil {
execDerpatCont = execDerpat.Name
} }
htalConListStrCon.KeyName = execDerpatCont htalConListStrCon.KeyName = execDerpatCont
//获取操作人 //获取操作人
userFileStr := "wm_number,qywx_key,wx_key" userFileStr := "wm_number,qywx_key,wx_key"
@ -285,9 +298,13 @@ func SendMsgTxtPublic(sendUserList, Title, Desc, Unit, Reason, handleUrl, scoreR
sendTextMsg.TemplateCard.SubTitleText = subTitleText sendTextMsg.TemplateCard.SubTitleText = subTitleText
execDerpatCont := "" execDerpatCont := ""
// execDerpatCont := "考核部门:" // execDerpatCont := "考核部门:"
execDerpatErr, execDerpat := commonus.GetBranchFactory(departmentId) // execDerpatErr, execDerpat := commonus.GetBranchFactory(departmentId)
if execDerpatErr == true { // if execDerpatErr == true {
execDerpatCont = execDerpatCont + execDerpat.Name // execDerpatCont = execDerpatCont + execDerpat.Name
// }
execDerpat, execDerpatErr := commonus.GetNewOrgCont(departmentId)
if execDerpatErr == nil {
execDerpatCont = execDerpat.Name
} }
htalConListStrCon.KeyName = execDerpatCont htalConListStrCon.KeyName = execDerpatCont
//获取操作人 //获取操作人

279
gin_server_admin/commonus/publichaneld.go

@ -1388,11 +1388,17 @@ func GetOfficeWork(id, departmentId int64) (isTrue bool, roleUser []roleGroupBod
//获取企业微信信息接收人 //获取企业微信信息接收人
func GetSendMsgUser(id, departmentId int64) (isTrue bool, userStr string) { func GetSendMsgUser(id, departmentId int64) (isTrue bool, userStr string) {
isTrue = false isTrue = false
err, departmentCont := GetBranchFactory(departmentId) // err, departmentCont := GetBranchFactory(departmentId)
if err != true { // if err != true {
// return
// }
departWhere := MapOut()
departWhere["id"] = departmentId
departmentCont, errDepart := GetNewOrgCont(departWhere, "wechat_organization_id")
if errDepart != nil {
return return
} }
err, roleGroup, _ := GetOfficeWork(id, int64(departmentCont.WechatId)) err, roleGroup, _ := GetOfficeWork(id, int64(departmentCont.WechatOrganizationId))
if err != true { if err != true {
return return
} }
@ -1586,10 +1592,13 @@ func GetWorkUser(key string) (userCont testpage.PersonalDetails, isTrue bool) {
} }
type sendMsg struct { type sendMsg struct {
Title string `json:"title"` Title string `json:"title"`
Unit string `json:"unit"` //单位"` Unit string `json:"unit"` //单位"`
Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年"` Cycles int `json:"cycle"` //1:班;2:天;3:周;4:月;5:季度;6:年"`
CycleAttres int `json:"cycleattr"` //辅助计数"` CycleAttres int `json:"cycleattr"` //辅助计数"`
Dimension int64 `json:"dimension"` //维度"`
Target int64 `json:"target"` //指标"`
DetailedTarget int64 `json:"detailedtarget"` //指标细则"`
} }
//查看定量考核数据 //查看定量考核数据
@ -1601,6 +1610,7 @@ func LookRationInfo(id int64) (cont sendMsg, isTrue bool) {
} }
cont.Cycles = qeInfo.Cycles cont.Cycles = qeInfo.Cycles
cont.CycleAttres = qeInfo.CycleAttres cont.CycleAttres = qeInfo.CycleAttres
cont.Target = qeInfo.Target
targetCong, isTrues := GetTargetInfo(qeInfo.Target) targetCong, isTrues := GetTargetInfo(qeInfo.Target)
if isTrues == false { if isTrues == false {
return return
@ -1615,6 +1625,8 @@ func LookRationInfo(id int64) (cont sendMsg, isTrue bool) {
} }
} }
cont.Dimension = qeInfo.Dimension
cont.DetailedTarget = qeInfo.DetailedTarget
return return
} }
@ -1670,13 +1682,39 @@ func StepAddData(flowID, roleGroupId int64, nextStep, stepName, typeclass, state
if flowStepErr == nil { if flowStepErr == nil {
evalProCont.Content = string(flowStepJson) evalProCont.Content = string(flowStepJson)
} }
evalProCont.Participants = userKey evalProCont.Participants = userKey
evalProCont.NextContent = IntegrationFlowAll(flowID, typeclass)
evalProCont.NextStep = nextStep
if nextStep != 0 {
var flowAry []FlowAllMap
evalProCont.NextContent, flowAry = IntegrationFlowAll(flowID, typeclass)
var userKeyMap []string
for _, fav := range flowAry {
if fav.Step == nextStep {
for _, facv := range fav.UserList {
if IsItTrueString(facv.Id, userKeyMap) == false {
userKeyMap = append(userKeyMap, facv.Id)
}
}
}
}
if len(userKeyMap) > 0 {
evalProCont.NextExecutor = strings.Join(userKeyMap, ",")
} else {
evalProCont.NextExecutor = ""
}
} else {
evalProCont.NextExecutor = ""
}
global.GVA_DB_Performanceappraisal.Create(&evalProCont) global.GVA_DB_Performanceappraisal.Create(&evalProCont)
} else { } else {
var flowStepAry []FlowStep var flowStepAry []FlowStep
var flowStepArys []FlowStep var flowStepArys []FlowStep
json.Unmarshal([]byte(evalProCont.Content), &flowStepAry) json.Unmarshal([]byte(evalProCont.Content), &flowStepAry)
var userKeyMap []string
for _, f_v := range flowStepAry { for _, f_v := range flowStepAry {
if f_v.Step == evalProCont.Step { if f_v.Step == evalProCont.Step {
f_v.State = 2 f_v.State = 2
@ -1702,10 +1740,35 @@ func StepAddData(flowID, roleGroupId int64, nextStep, stepName, typeclass, state
if flowStepErr == nil { if flowStepErr == nil {
saveData["ep_cont"] = string(flowStepJson) saveData["ep_cont"] = string(flowStepJson)
} }
saveData["ep_next_step"] = nextStep
if nextStep > 0 {
var flowContAry []FlowAllMap
json.Unmarshal([]byte(evalProCont.NextContent), &flowContAry)
if len(flowContAry) > 0 {
for _, fav := range flowContAry {
if fav.Step == nextStep {
for _, facv := range fav.UserList {
if IsItTrueString(facv.Id, userKeyMap) == false {
userKeyMap = append(userKeyMap, facv.Id)
}
}
}
}
}
if len(userKeyMap) > 0 {
saveData["ep_next_executor"] = strings.Join(userKeyMap, ",")
} else {
saveData["ep_next_executor"] = ""
}
} else {
saveData["ep_next_executor"] = ""
}
saveData["ep_participants"] = fmt.Sprintf("%v,%v", evalProCont.Participants, userKey) saveData["ep_participants"] = fmt.Sprintf("%v,%v", evalProCont.Participants, userKey)
saveData["ep_state"] = state saveData["ep_state"] = state
saveData["ep_next_cont"] = InsetFlowLog(state, stepInt, userKey, evalProCont.NextContent) saveData["ep_next_cont"] = InsetFlowLog(state, stepInt, userKey, evalProCont.NextContent)
fmt.Printf("Flow---Map:--->%v\n", saveData) // fmt.Printf("Flow---Map:--->%v\n", saveData)
caozuoMap := MapOut() caozuoMap := MapOut()
caozuoMap["flowID"] = flowID caozuoMap["flowID"] = flowID
@ -1717,8 +1780,8 @@ func StepAddData(flowID, roleGroupId int64, nextStep, stepName, typeclass, state
caozuoMap["stepInt"] = stepInt caozuoMap["stepInt"] = stepInt
caozuoMap["userKey"] = userKey caozuoMap["userKey"] = userKey
caozuoMap["NextContent"] = evalProCont.NextContent caozuoMap["NextContent"] = evalProCont.NextContent
mapJson, _ := json.Marshal(caozuoMap) // mapJson, _ := json.Marshal(caozuoMap)
fmt.Printf("Flow---Map:--Out---->%v\n", string(mapJson)) // fmt.Printf("Flow---Map:--Out---->%v\n", string(mapJson))
// flowID, roleGroupId int64, nextStep, stepName, typeclass, state, stepInt int, userKey string // flowID, roleGroupId int64, nextStep, stepName, typeclass, state, stepInt int, userKey string
EiteDutiesInfoes(evalProCont.Id, saveData) EiteDutiesInfoes(evalProCont.Id, saveData)
} }
@ -1755,7 +1818,31 @@ func StepAddDataEs(flowID, roleGroupId int64, nextStep, stepName, typeclass, sta
evalProCont.Content = string(flowStepJson) evalProCont.Content = string(flowStepJson)
} }
evalProCont.Participants = userKey evalProCont.Participants = userKey
evalProCont.NextContent = IntegrationFlowAllEs(flowID, typeclass, encFile)
var flowAry []FlowAllMap
evalProCont.NextContent, flowAry = IntegrationFlowAllEs(flowID, typeclass, encFile)
evalProCont.NextStep = nextStep
if nextStep > 0 {
var userKeyMap []string
for _, fav := range flowAry {
if fav.Step == nextStep {
for _, facv := range fav.UserList {
if IsItTrueString(facv.Id, userKeyMap) == false {
userKeyMap = append(userKeyMap, facv.Id)
}
}
}
}
if len(userKeyMap) > 0 {
evalProCont.NextExecutor = strings.Join(userKeyMap, ",")
} else {
evalProCont.NextExecutor = ""
}
} else {
evalProCont.NextExecutor = ""
}
global.GVA_DB_Performanceappraisal.Create(&evalProCont) global.GVA_DB_Performanceappraisal.Create(&evalProCont)
} else { } else {
var flowStepAry []FlowStep var flowStepAry []FlowStep
@ -1786,10 +1873,37 @@ func StepAddDataEs(flowID, roleGroupId int64, nextStep, stepName, typeclass, sta
if flowStepErr == nil { if flowStepErr == nil {
saveData["ep_cont"] = string(flowStepJson) saveData["ep_cont"] = string(flowStepJson)
} }
saveData["ep_next_step"] = nextStep
if nextStep > 0 {
var userKeyMap []string
var flowContAry []FlowAllMap
json.Unmarshal([]byte(evalProCont.NextContent), &flowContAry)
if len(flowContAry) > 0 {
for _, fav := range flowContAry {
if fav.Step == nextStep {
for _, facv := range fav.UserList {
if IsItTrueString(facv.Id, userKeyMap) == false {
userKeyMap = append(userKeyMap, facv.Id)
}
}
}
}
}
if len(userKeyMap) > 0 {
saveData["ep_next_executor"] = strings.Join(userKeyMap, ",")
} else {
saveData["ep_next_executor"] = ""
}
} else {
saveData["ep_next_executor"] = ""
}
saveData["ep_participants"] = fmt.Sprintf("%v,%v", evalProCont.Participants, userKey) saveData["ep_participants"] = fmt.Sprintf("%v,%v", evalProCont.Participants, userKey)
saveData["ep_state"] = state saveData["ep_state"] = state
saveData["ep_next_cont"] = InsetFlowLogEs(state, stepInt, userKey, evalProCont.NextContent, encFile) saveData["ep_next_cont"] = InsetFlowLogEs(state, stepInt, userKey, evalProCont.NextContent, encFile)
fmt.Printf("Flow---Map:--->%v\n", saveData) // fmt.Printf("Flow---Map:--->%v\n", saveData)
caozuoMap := MapOut() caozuoMap := MapOut()
caozuoMap["flowID"] = flowID caozuoMap["flowID"] = flowID
@ -1801,8 +1915,8 @@ func StepAddDataEs(flowID, roleGroupId int64, nextStep, stepName, typeclass, sta
caozuoMap["stepInt"] = stepInt caozuoMap["stepInt"] = stepInt
caozuoMap["userKey"] = userKey caozuoMap["userKey"] = userKey
caozuoMap["NextContent"] = evalProCont.NextContent caozuoMap["NextContent"] = evalProCont.NextContent
mapJson, _ := json.Marshal(caozuoMap) // mapJson, _ := json.Marshal(caozuoMap)
fmt.Printf("Flow---Map:--Out---->%v\n", string(mapJson)) // fmt.Printf("Flow---Map:--Out---->%v\n", string(mapJson))
// flowID, roleGroupId int64, nextStep, stepName, typeclass, state, stepInt int, userKey string // flowID, roleGroupId int64, nextStep, stepName, typeclass, state, stepInt int, userKey string
EiteDutiesInfoes(evalProCont.Id, saveData) EiteDutiesInfoes(evalProCont.Id, saveData)
} }
@ -2054,8 +2168,8 @@ func WriteFlowMainSet(orderId int64, userKey []int64) {
/* /*
@class 流程类型 @class 流程类型
*/ */
func IntegrationFlowAll(flowID int64, class int) (flowAllMap string) { func IntegrationFlowAll(flowID int64, class int) (flowAllMap string, flowMap []FlowAllMap) {
var flowMap []FlowAllMap // var flowMap []FlowAllMap
//1、创建 //1、创建
var oneFlowInfo FlowAllMap var oneFlowInfo FlowAllMap
oneFlowInfo.Step = 1 oneFlowInfo.Step = 1
@ -2069,7 +2183,7 @@ func IntegrationFlowAll(flowID int64, class int) (flowAllMap string) {
// fmt.Print("Flow_log:-->%v") // fmt.Print("Flow_log:-->%v")
if class == 1 { if class == 1 {
//定性
var scoreFlowCont assessmentmodel.ScoreFlow var scoreFlowCont assessmentmodel.ScoreFlow
flowLogErr := global.GVA_DB_Performanceappraisal.Where("sf_key = ?", flowID).First(&scoreFlowCont).Error flowLogErr := global.GVA_DB_Performanceappraisal.Where("sf_key = ?", flowID).First(&scoreFlowCont).Error
if flowLogErr == nil { if flowLogErr == nil {
@ -2153,8 +2267,8 @@ func IntegrationFlowAll(flowID int64, class int) (flowAllMap string) {
return return
} }
func IntegrationFlowAllEs(flowID int64, class int, encFile []EnclosureFormat) (flowAllMap string) { func IntegrationFlowAllEs(flowID int64, class int, encFile []EnclosureFormat) (flowAllMap string, flowMap []FlowAllMap) {
var flowMap []FlowAllMap // var flowMap []FlowAllMap
//1、创建 //1、创建
var oneFlowInfo FlowAllMap var oneFlowInfo FlowAllMap
oneFlowInfo.Step = 1 oneFlowInfo.Step = 1
@ -2172,64 +2286,75 @@ func IntegrationFlowAllEs(flowID int64, class int, encFile []EnclosureFormat) (f
var scoreFlowCont assessmentmodel.ScoreFlow var scoreFlowCont assessmentmodel.ScoreFlow
flowLogErr := global.GVA_DB_Performanceappraisal.Where("sf_key = ?", flowID).First(&scoreFlowCont).Error flowLogErr := global.GVA_DB_Performanceappraisal.Where("sf_key = ?", flowID).First(&scoreFlowCont).Error
if flowLogErr == nil { if flowLogErr == nil {
//2、创建人部门负责人审核 if scoreFlowCont.PlusReduceScore != 1 {
var twoFlowInfo FlowAllMap //2、创建人部门负责人审核
twoFlowInfo.Step = 2 var twoFlowInfo FlowAllMap
twoFlowInfo.NodeName = GetSetpName(2) twoFlowInfo.Step = 2
twoFlowInfo.State = 1 twoFlowInfo.NodeName = GetSetpName(2)
twoFlowInfo.Class = 1 twoFlowInfo.State = 1
twoFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 3, 2, encFile) twoFlowInfo.Class = 1
flowMap = append(flowMap, twoFlowInfo) twoFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 3, 2, encFile)
//3、被考核部门内勤进行责任划分 flowMap = append(flowMap, twoFlowInfo)
var threeFlowInfo FlowAllMap //3、被考核部门内勤进行责任划分
threeFlowInfo.Step = 3 var threeFlowInfo FlowAllMap
threeFlowInfo.NodeName = GetSetpName(3) threeFlowInfo.Step = 3
threeFlowInfo.State = 1 threeFlowInfo.NodeName = GetSetpName(3)
threeFlowInfo.Class = 1 threeFlowInfo.State = 1
threeFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 4, 2, encFile) threeFlowInfo.Class = 1
flowMap = append(flowMap, threeFlowInfo) threeFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 4, 2, encFile)
//4、被考核部门负责人对责任划分确认 flowMap = append(flowMap, threeFlowInfo)
var fourFlowInfo FlowAllMap //4、被考核部门负责人对责任划分确认
fourFlowInfo.Step = 4 var fourFlowInfo FlowAllMap
fourFlowInfo.NodeName = GetSetpName(7) fourFlowInfo.Step = 4
fourFlowInfo.State = 1 fourFlowInfo.NodeName = GetSetpName(7)
fourFlowInfo.Class = 1 fourFlowInfo.State = 1
fourFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 5, 2, encFile) fourFlowInfo.Class = 1
flowMap = append(flowMap, fourFlowInfo) fourFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 5, 2, encFile)
if scoreFlowCont.Rectification == 1 { flowMap = append(flowMap, fourFlowInfo)
//5、整改人节点。由内勤指定 if scoreFlowCont.Rectification == 1 {
var fiveFlowInfo FlowAllMap //5、整改人节点。由内勤指定
fiveFlowInfo.Step = 5 var fiveFlowInfo FlowAllMap
fiveFlowInfo.NodeName = GetSetpName(4) fiveFlowInfo.Step = 5
fiveFlowInfo.State = 1 fiveFlowInfo.NodeName = GetSetpName(4)
fiveFlowInfo.Class = 2 fiveFlowInfo.State = 1
// fiveFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 5,encFile) fiveFlowInfo.Class = 2
flowMap = append(flowMap, fiveFlowInfo) // fiveFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 5,encFile)
//6、被考核部门负责人对整改措施确认 flowMap = append(flowMap, fiveFlowInfo)
var sixFlowInfo FlowAllMap //6、被考核部门负责人对整改措施确认
sixFlowInfo.Step = 6 var sixFlowInfo FlowAllMap
sixFlowInfo.NodeName = GetSetpName(7) sixFlowInfo.Step = 6
sixFlowInfo.State = 1 sixFlowInfo.NodeName = GetSetpName(7)
sixFlowInfo.Class = 1 sixFlowInfo.State = 1
sixFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 5, 2, encFile) sixFlowInfo.Class = 1
flowMap = append(flowMap, sixFlowInfo) sixFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 5, 2, encFile)
//7、发起人验收 flowMap = append(flowMap, sixFlowInfo)
var serverFlowInfo FlowAllMap //7、发起人验收
serverFlowInfo.Step = 7 var serverFlowInfo FlowAllMap
serverFlowInfo.NodeName = GetSetpName(5) serverFlowInfo.Step = 7
serverFlowInfo.State = 1 serverFlowInfo.NodeName = GetSetpName(5)
serverFlowInfo.Class = 1 serverFlowInfo.State = 1
serverFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 1, 2, encFile) serverFlowInfo.Class = 1
flowMap = append(flowMap, serverFlowInfo) serverFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 1, 2, encFile)
flowMap = append(flowMap, serverFlowInfo)
} else {
//5、发起人验收
var serverEsFlowInfo FlowAllMap
serverEsFlowInfo.Step = 5
serverEsFlowInfo.NodeName = GetSetpName(5)
serverEsFlowInfo.State = 1
serverEsFlowInfo.Class = 1
serverEsFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 1, 2, encFile)
flowMap = append(flowMap, serverEsFlowInfo)
}
} else { } else {
//5、发起人验收 //2、创建人部门负责人审核
var serverEsFlowInfo FlowAllMap var twoFlowInfo FlowAllMap
serverEsFlowInfo.Step = 5 twoFlowInfo.Step = 2
serverEsFlowInfo.NodeName = GetSetpName(5) twoFlowInfo.NodeName = GetSetpName(2)
serverEsFlowInfo.State = 1 twoFlowInfo.State = 1
serverEsFlowInfo.Class = 1 twoFlowInfo.Class = 1
serverEsFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 1, 2, encFile) twoFlowInfo.UserList = GetFlowNodeManEs(flowID, class, 3, 2, encFile)
flowMap = append(flowMap, serverEsFlowInfo) flowMap = append(flowMap, twoFlowInfo)
} }
} }

7
gin_server_admin/commonus/timeSub.go

@ -509,3 +509,10 @@ func GetAppointMonthStarAndEndTime(dayTime string) (startTime, endTime int64) {
endTime, _ = DateToTimeStampEs(endTimeStr) endTime, _ = DateToTimeStampEs(endTimeStr)
return return
} }
//获取指定月的起止时间
func GetAppointMonthStarAndEndTimeInt(monthStartTime int64) (monthStartTimgStamp, monthEndTimeStamp int64) {
t := time.Unix(monthStartTime, 0)
monthStartTimgStamp, monthEndTimeStamp = GetMonthStartOrEndTime(t)
return
}

20
gin_server_admin/model/assessmentmodel/dutyclass.go

@ -361,6 +361,7 @@ type FlowLog struct {
DutyGroup int64 `json:"dutygroup" gorm:"column:fl_duty_group;type:bigint(20) unsigned;default:0;not null;comment:职责集团"` DutyGroup int64 `json:"dutygroup" gorm:"column:fl_duty_group;type:bigint(20) unsigned;default:0;not null;comment:职责集团"`
DutyDepartment int64 `json:"dutydepartment" gorm:"column:fl_duty_department;type:bigint(20) unsigned;default:0;not null;comment:职责部门"` DutyDepartment int64 `json:"dutydepartment" gorm:"column:fl_duty_department;type:bigint(20) unsigned;default:0;not null;comment:职责部门"`
Reply int `json:"reply" gorm:"column:fl_reply;type:int(2) unsigned;default:1;not null;comment:状态(0:删除;1:起草;2:审批;3:通过)"` Reply int `json:"reply" gorm:"column:fl_reply;type:int(2) unsigned;default:1;not null;comment:状态(0:删除;1:起草;2:审批;3:通过)"`
PlanVersion string `json:"planversion" gorm:"column:fl_planversion;type:varchar(255);comment:版本号"`
} }
func (FlowLog *FlowLog) TableName() string { func (FlowLog *FlowLog) TableName() string {
@ -369,15 +370,16 @@ func (FlowLog *FlowLog) TableName() string {
//定量考核数据流 //定量考核数据流
type FlowLogData struct { type FlowLogData struct {
Id int64 `json:"id" gorm:"primaryKey;column:fld_id;type:bigint(20) unsigned;not null;comment:Id;index"` Id int64 `json:"id" gorm:"primaryKey;column:fld_id;type:bigint(20) unsigned;not null;comment:Id;index"`
EvaluationPlan int64 `json:"evaluationplan" gorm:"column:fld_evaluation_id;type:bigint(20) unsigned;default:0;not null;comment:考核方案项目ID"` EvaluationPlan int64 `json:"evaluationplan" gorm:"column:fld_evaluation_id;type:bigint(20) unsigned;default:0;not null;comment:考核方案项目ID"`
Key int64 `json:"key" gorm:"column:fld_flow_log;type:bigint(20) unsigned;default:0;not null;comment:识别标志"` Key int64 `json:"key" gorm:"column:fld_flow_log;type:bigint(20) unsigned;default:0;not null;comment:识别标志"`
Score int64 `json:"score" gorm:"column:fld_score;type:bigint(20) unsigned;default:0;not null;comment:数据"` Score int64 `json:"score" gorm:"column:fld_score;type:bigint(20) unsigned;default:0;not null;comment:数据"`
Content string `json:"content" gorm:"column:fld_cont;type:mediumtext;comment:描述"` Content string `json:"content" gorm:"column:fld_cont;type:mediumtext;comment:描述"`
Enclosure string `json:"enclosure" gorm:"column:fld_enclosure;type:longtext;comment:附件"` Enclosure string `json:"enclosure" gorm:"column:fld_enclosure;type:longtext;comment:附件"`
Time int64 `json:"time" gorm:"column:fld_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` Time int64 `json:"time" gorm:"column:fld_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
ScoringMethod int `json:"scoringmethod" gorm:"column:fld_scoring_method;type:int(1) unsigned;default:1;not null;comment:计分方式(1:自动;2:手动)"` ScoringMethod int `json:"scoringmethod" gorm:"column:fld_scoring_method;type:int(1) unsigned;default:1;not null;comment:计分方式(1:自动;2:手动)"`
ScoringScore int64 `json:"scoringscore" gorm:"column:fld_scoring_score;type:bigint(20) unsigned;default:0;not null;comment:手动分"` ScoringScore float64 `json:"scoringscore" gorm:"column:fld_scoring_score;type:bigint(20) unsigned;default:0;not null;comment:手动分"`
PlanVersion string `json:"planversion" gorm:"column:fld_planversion;type:varchar(255);comment:版本号"`
} }
func (FlowLogData *FlowLogData) TableName() string { func (FlowLogData *FlowLogData) TableName() string {

3
gin_server_admin/model/assessmentmodel/performance_appraisal.go

@ -32,6 +32,7 @@ type ScoreFlow struct {
HappenTime int64 `json:"happentime" gorm:"column:sf_happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"` HappenTime int64 `json:"happentime" gorm:"column:sf_happen_time;type:bigint(20) unsigned;default:0;not null;comment:发生时间"`
Count int `json:"count" gorm:"column:sf_count;type:int(5) unsigned;default:1;not null;comment:发生次数"` Count int `json:"count" gorm:"column:sf_count;type:int(5) unsigned;default:1;not null;comment:发生次数"`
CorrectionTime int64 `json:"correctiontime" gorm:"column:sf_correctiontime;type:bigint(20) unsigned;default:0;not null;comment:整改期限"` CorrectionTime int64 `json:"correctiontime" gorm:"column:sf_correctiontime;type:bigint(20) unsigned;default:0;not null;comment:整改期限"`
PlanVersion string `json:"planversion" gorm:"column:sf_planversion;type:varchar(255);comment:版本号"`
} }
func (ScoreFlow *ScoreFlow) TableName() string { func (ScoreFlow *ScoreFlow) TableName() string {
@ -74,6 +75,8 @@ type EvaluationProcess struct {
TypeClass int `json:"type" gorm:"column:ep_type;type:tinyint(1) unsigned;default:1;not null;comment:1、定性;2、定量"` 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:参与人"` Participants string `json:"participants" gorm:"column:ep_participants;type:mediumtext;comment:参与人"`
StartTime int64 `json:"starttime" gorm:"column:ep_start_time;type:bigint(20) unsigned;default:0;not null;comment:流程开始时间"` StartTime int64 `json:"starttime" gorm:"column:ep_start_time;type:bigint(20) unsigned;default:0;not null;comment:流程开始时间"`
NextStep int `json:"nextstep" gorm:"column:ep_next_step;type:int(7) unsigned;default:1;not null;comment:下一步"`
NextExecutor string `json:"nextexecutor" gorm:"column:ep_next_executor;type:mediumtext;comment:下一步执行人"`
} }
func (EvaluationProcess *EvaluationProcess) TableName() string { func (EvaluationProcess *EvaluationProcess) TableName() string {

2
gin_server_admin/router/assessment/assessmentrouter.go

@ -210,5 +210,7 @@ func (s *AssessmentRouter) InitEvaluationRouter(Router *gin.RouterGroup) {
dutyIndexCodeRouter.POST("newgetqualdetailedtarget", authorityIndexApi.NewGetQualDetailedTarget) //获取新定性考核详细指标 dutyIndexCodeRouter.POST("newgetqualdetailedtarget", authorityIndexApi.NewGetQualDetailedTarget) //获取新定性考核详细指标
dutyIndexCodeRouter.POST("examineflow", authorityIndexApi.ExamineFlow) // 流程图 dutyIndexCodeRouter.POST("examineflow", authorityIndexApi.ExamineFlow) // 流程图
dutyIndexCodeRouter.POST("plusorminuspointsnew", authorityIndexApi.PlusOrMinusPointsNew) // 加减分NEW(内部审批方法)
} }
} }

Loading…
Cancel
Save