|
|
@ -6,8 +6,10 @@ import ( |
|
|
"fmt" |
|
|
"fmt" |
|
|
"strconv" |
|
|
"strconv" |
|
|
"strings" |
|
|
"strings" |
|
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
"github.com/flipped-aurora/gin-vue-admin/server/api/index/evaluation" |
|
|
// evals "github.com/flipped-aurora/gin-vue-admin/server/api/index/evaluation"
|
|
|
|
|
|
evals "github.com/flipped-aurora/gin-vue-admin/server/api/index/evaluation" |
|
|
"github.com/flipped-aurora/gin-vue-admin/server/api/wechatapp/sendmessage" |
|
|
"github.com/flipped-aurora/gin-vue-admin/server/api/wechatapp/sendmessage" |
|
|
"github.com/flipped-aurora/gin-vue-admin/server/commonus" |
|
|
"github.com/flipped-aurora/gin-vue-admin/server/commonus" |
|
|
"github.com/flipped-aurora/gin-vue-admin/server/global" |
|
|
"github.com/flipped-aurora/gin-vue-admin/server/global" |
|
|
@ -53,41 +55,79 @@ func templateEventPush(eventMsg []byte) { |
|
|
|
|
|
|
|
|
//按钮模板回调处理
|
|
|
//按钮模板回调处理
|
|
|
func (t *TemplateCardPush) ButtonTemplateCallBackHandle(scoreFlowKey, clickEnter string) { |
|
|
func (t *TemplateCardPush) ButtonTemplateCallBackHandle(scoreFlowKey, clickEnter string) { |
|
|
|
|
|
buttonClickNAme := "已批准" |
|
|
|
|
|
buttonClickNAmeOther := "其他人已批准" |
|
|
|
|
|
if clickEnter == "1" { |
|
|
|
|
|
t.UpdateButton(t.FromUsername, buttonClickNAme) |
|
|
|
|
|
} else { |
|
|
|
|
|
buttonClickNAme = "已驳回" |
|
|
|
|
|
buttonClickNAmeOther = "其他人已驳回" |
|
|
|
|
|
t.UpdateButton(t.FromUsername, buttonClickNAme) |
|
|
|
|
|
} |
|
|
|
|
|
//获取点击人信息
|
|
|
|
|
|
userContInfoIstrue, userContInfo := commonus.GetUesrContForWechatID(t.FromUsername) |
|
|
var scoreFlowInfo assessmentmodel.ScoreFlow |
|
|
var scoreFlowInfo assessmentmodel.ScoreFlow |
|
|
judegFlowErr := global.GVA_DB_Performanceappraisal.Where("`sf_key` = ?", scoreFlowKey).First(&scoreFlowInfo).Error |
|
|
judegFlowErr := global.GVA_DB_Performanceappraisal.Where("`sf_key` = ?", scoreFlowKey).First(&scoreFlowInfo).Error |
|
|
fmt.Printf("1@@@@%v\n", scoreFlowInfo) |
|
|
fmt.Printf("1@@@@%v\n", scoreFlowInfo) |
|
|
if judegFlowErr != nil { |
|
|
if judegFlowErr != nil { |
|
|
|
|
|
_, butCallBackUser := commonus.GetSendMsgUser(16182159043990656, userContInfo.DepartmentId) //获取对应部门负责人(高科)
|
|
|
|
|
|
userCallAry := strings.Split(butCallBackUser, "|") |
|
|
|
|
|
t.OtherClickButton(userCallAry, buttonClickNAme) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
fmt.Printf("scoreFlowKey ----------------------------------> %v\n", scoreFlowKey) |
|
|
//获取审批流程
|
|
|
//获取审批流程
|
|
|
var flowLog []evaluation.FlowStep |
|
|
// evaluation.FlowStep
|
|
|
|
|
|
var flowLog []evals.FlowStep |
|
|
var evalProc assessmentmodel.EvaluationProcess |
|
|
var evalProc assessmentmodel.EvaluationProcess |
|
|
judgeErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", scoreFlowKey).First(&evalProc).Error |
|
|
judgeErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", scoreFlowKey).First(&evalProc).Error |
|
|
if judgeErr != nil { |
|
|
if judgeErr != nil { |
|
|
|
|
|
_, butCallBackUser := commonus.GetSendMsgUser(16182159043990656, userContInfo.DepartmentId) //获取对应部门负责人(高科)
|
|
|
|
|
|
userCallAry := strings.Split(butCallBackUser, "|") |
|
|
|
|
|
t.OtherClickButton(userCallAry, buttonClickNAme) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
fmt.Printf("scoreFlowKey -----------------%v-----------------> %v\n", scoreFlowKey, evalProc.Content) |
|
|
|
|
|
|
|
|
jsonFlowErr := json.Unmarshal([]byte(evalProc.Content), &flowLog) |
|
|
jsonFlowErr := json.Unmarshal([]byte(evalProc.Content), &flowLog) |
|
|
if jsonFlowErr != nil || len(flowLog) < 1 { |
|
|
if jsonFlowErr != nil || len(flowLog) < 1 { |
|
|
|
|
|
_, butCallBackUser := commonus.GetSendMsgUser(16182159043990656, userContInfo.DepartmentId) //获取对应部门负责人(高科)
|
|
|
|
|
|
userCallAry := strings.Split(butCallBackUser, "|") |
|
|
|
|
|
t.OtherClickButton(userCallAry, buttonClickNAme) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if userContInfoIstrue == true { |
|
|
|
|
|
|
|
|
|
|
|
if flowLog[len(flowLog)-1].Step == 1 { |
|
|
|
|
|
_, butCallBackUser := commonus.GetSendMsgUser(16118387069540343, userContInfo.DepartmentId) //获取对应部门内勤(高科)
|
|
|
|
|
|
userCallAry := strings.Split(butCallBackUser, "|") |
|
|
|
|
|
t.OtherClickButton(userCallAry, buttonClickNAmeOther) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if flowLog[len(flowLog)-1].Step == 2 || flowLog[len(flowLog)-1].Step == 4 { |
|
|
|
|
|
_, butCallBackUser := commonus.GetSendMsgUser(16182159043990656, userContInfo.DepartmentId) //获取对应部门负责人(高科)
|
|
|
|
|
|
userCallAry := strings.Split(butCallBackUser, "|") |
|
|
|
|
|
t.OtherClickButton(userCallAry, buttonClickNAmeOther) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
fmt.Printf("3@@@@%v\n", scoreFlowInfo) |
|
|
fmt.Printf("3@@@@%v\n", scoreFlowInfo) |
|
|
if len(flowLog) < 1 { |
|
|
if len(flowLog) < 1 { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
sendUserList, _ := GetCaoZuoRen(flowLog[len(flowLog)-1].Step, scoreFlowInfo) |
|
|
sendUserList, _ := GetCaoZuoRen(flowLog[len(flowLog)-1].Step, scoreFlowInfo) |
|
|
// fmt.Printf("1ssss@@@@%v\n", scoreFlowInfo)
|
|
|
// fmt.Printf("1ssss@@@@%v\n", scoreFlowInfo)
|
|
|
buttonClickNAme := "已批准" |
|
|
|
|
|
buttonClickNAmeOther := "其他人已批准" |
|
|
|
|
|
fmt.Printf("45@@@@%v\n", flowLog[len(flowLog)-1].Step) |
|
|
fmt.Printf("45@@@@%v\n", flowLog[len(flowLog)-1].Step) |
|
|
if clickEnter == "1" { |
|
|
if clickEnter == "1" { |
|
|
//1:内勤;2:部门负责人:3:整改;4:整改后部门负责;5:归档起草人
|
|
|
//1:内勤;2:部门负责人:3:整改;4:整改后部门负责;5:归档起草人
|
|
|
switch flowLog[len(flowLog)-1].Step { |
|
|
switch flowLog[len(flowLog)-1].NextStep { |
|
|
case 1: |
|
|
case 1: |
|
|
case 2: |
|
|
case 2: |
|
|
//是否需要整改
|
|
|
//是否需要整改
|
|
|
if scoreFlowInfo.Rectification != 1 { |
|
|
if scoreFlowInfo.Rectification == 1 { |
|
|
evaluation.UpEvaluationProcessApproval(scoreFlowInfo.Key, 0, scoreFlowInfo.Key, 3) |
|
|
keyNumber := commonus.GetFileNumberEs() |
|
|
|
|
|
evals.UpEvaluationProcessApproval(scoreFlowInfo.Key, 0, keyNumber, 3) |
|
|
_, sendUserList = commonus.GetSendMsgUser(16182159043990656, scoreFlowInfo.DutyDepartment) //获取对应部门负责人(高科)
|
|
|
_, sendUserList = commonus.GetSendMsgUser(16182159043990656, scoreFlowInfo.DutyDepartment) //获取对应部门负责人(高科)
|
|
|
userAry := strings.Split(sendUserList, "|") |
|
|
userAry := strings.Split(sendUserList, "|") |
|
|
var userKeyInt int64 = 0 |
|
|
var userKeyInt int64 = 0 |
|
|
@ -101,16 +141,81 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandle(scoreFlowKey, clickEnter |
|
|
if judegdivisErr == nil { |
|
|
if judegdivisErr == nil { |
|
|
userKeyInt = divisResponInfo.UserKey |
|
|
userKeyInt = divisResponInfo.UserKey |
|
|
} |
|
|
} |
|
|
SendRectifyMsg(sendUserList, scoreFlowInfo.Reason, scoreFlowInfo.EvaluationPlan, scoreFlowInfo.Key, scoreFlowInfo.DutyDepartment, userKeyInt, scoreFlowInfo.Score, scoreFlowInfo.PlusReduceScore) |
|
|
callbakcMsg, isTrueCall, callBackCont, sendTextMsg := SendRectifyMsg(sendUserList, scoreFlowInfo.Reason, scoreFlowInfo.EvaluationPlan, scoreFlowInfo.Key, scoreFlowInfo.DutyDepartment, userKeyInt, scoreFlowInfo.Score, keyNumber, scoreFlowInfo.PlusReduceScore) |
|
|
// callbakcMsg, isTrueCall, callBackCont, sendTextMsg := SendRectifyMsg(sendUserList, scoreFlowInfo.Reason, scoreFlowInfo.EvaluationPlan, scoreFlowInfo.Key, scoreFlowInfo.DutyDepartment, userKeyInt, scoreFlowInfo.Score, scoreFlowInfo.PlusReduceScore)
|
|
|
fmt.Printf("更新销售发送信息返回:%v-----------%v----------->%v------》%v\n", string(callbakcMsg), isTrueCall, callBackCont, sendTextMsg) |
|
|
// fmt.Printf("更新销售:%v-----------%v-----------%v-----------%v\n", scoreFlowInfo.DutyDepartment, userKeyInt, sendUserList, userAry[0])
|
|
|
|
|
|
// fmt.Printf("更新销售发送信息返回:%v-----------%v----------->%v------》%v\n", string(callbakcMsg), isTrueCall, callBackCont, sendTextMsg)
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
buttonClickAry := strings.Split(t.EventKey, "_") |
|
|
buttonClickAry := strings.Split(t.EventKey, "_") |
|
|
if len(buttonClickAry) < 4 { |
|
|
if len(buttonClickAry) < 4 { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
evaluation.UpEvaluationProcessApproval(scoreFlowInfo.Key, 0, scoreFlowInfo.Key, 5) |
|
|
keyNumber := commonus.GetFileNumberEs() |
|
|
|
|
|
evals.UpEvaluationProcessApproval(scoreFlowInfo.Key, 0, keyNumber, 5) |
|
|
|
|
|
_, sendUserListing := commonus.GetSendMsgUser(16182159043990656, scoreFlowInfo.DutyDepartment) //获取对应部门负责人(高科)
|
|
|
|
|
|
userAry := strings.Split(sendUserListing, "|") |
|
|
|
|
|
var userKeyInt int64 = 0 |
|
|
|
|
|
if len(userAry) > 0 { |
|
|
|
|
|
_, userConts := commonus.GetUesrContForWechatID(userAry[0]) |
|
|
|
|
|
userKeyInt = userConts.Key |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//获取信息接收人
|
|
|
|
|
|
sendUserList := "" |
|
|
|
|
|
userFileStr := "wm_number,qywx_key,wx_key" |
|
|
|
|
|
//操作人条件
|
|
|
|
|
|
userWherAry := commonus.MapOut() |
|
|
|
|
|
// userWherAry["wm_key"] = "WoBenShanLiang_3" //"WoBenShanLiang_3"
|
|
|
|
|
|
userWherAry["wm_key"] = scoreFlowInfo.EvaluationUser |
|
|
|
|
|
userConting, userIsTrue := commonus.GetUserInfoPublic(userFileStr, userWherAry) |
|
|
|
|
|
if userIsTrue == true { |
|
|
|
|
|
if userConting.WechatId != "" { |
|
|
|
|
|
sendUserList = userConting.WechatId |
|
|
|
|
|
} |
|
|
|
|
|
if userConting.WorkWechatId != "" { |
|
|
|
|
|
sendUserList = userConting.WorkWechatId |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var programme assessmentmodel.QualitativeEvaluation |
|
|
|
|
|
judgeProgramme := global.GVA_DB_Performanceappraisal.Where("`qe_id` = ?", scoreFlowInfo.EvaluationPlan).First(&programme).Error |
|
|
|
|
|
if judgeProgramme != nil { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
var mainTitle string = "" |
|
|
|
|
|
if programme.DetailedTarget != 0 { |
|
|
|
|
|
detailedTargetCont, detailedTargetErr := commonus.GetDetailedTargetInfo(programme.DetailedTarget) |
|
|
|
|
|
if detailedTargetErr == true { |
|
|
|
|
|
mainTitle = detailedTargetCont.Title |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
detailedTargetCont, detailedTargetErr := commonus.GetTargetInfo(programme.Target) |
|
|
|
|
|
if detailedTargetErr == true { |
|
|
|
|
|
mainTitle = detailedTargetCont.Title |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// var recMeasCont assessmentmodel.RectificationMeasures
|
|
|
|
|
|
// judgeRecMeas := global.GVA_DB_Performanceappraisal.Where("`rm_id` = ?", buttonClickAry[3]).First(&recMeasCont).Error
|
|
|
|
|
|
// if judgeRecMeas != nil {
|
|
|
|
|
|
// // return
|
|
|
|
|
|
// }
|
|
|
|
|
|
mainTitleDesc := programme.Content |
|
|
|
|
|
subtitle := "整改内容:" |
|
|
|
|
|
reason := "" |
|
|
|
|
|
// reason := recMeasCont.Content
|
|
|
|
|
|
//获取当前执行人信息
|
|
|
|
|
|
commonus.GetUesrContForWechatID(t.ToUsername) |
|
|
|
|
|
|
|
|
|
|
|
// SendRectifyReceipt(sendUserList, mainTitle, mainTitleDesc, subtitle, reason, scoreFlowInfo.DutyDepartment, userKeyInt, keyNumber, scoreFlowInfo.Key, recMeasCont.Id)
|
|
|
|
|
|
SendRectifyReceipt(sendUserList, mainTitle, mainTitleDesc, subtitle, reason, scoreFlowInfo.DutyDepartment, userKeyInt, keyNumber, scoreFlowInfo.Key, 0) |
|
|
|
|
|
} |
|
|
|
|
|
case 3: |
|
|
|
|
|
case 4: |
|
|
|
|
|
buttonClickAry := strings.Split(t.EventKey, "_") |
|
|
|
|
|
if len(buttonClickAry) < 4 { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
keyNumber := commonus.GetFileNumberEs() |
|
|
|
|
|
evals.UpEvaluationProcessApproval(scoreFlowInfo.Key, 0, keyNumber, 5) |
|
|
_, sendUserListing := commonus.GetSendMsgUser(16182159043990656, scoreFlowInfo.DutyDepartment) //获取对应部门负责人(高科)
|
|
|
_, sendUserListing := commonus.GetSendMsgUser(16182159043990656, scoreFlowInfo.DutyDepartment) //获取对应部门负责人(高科)
|
|
|
userAry := strings.Split(sendUserListing, "|") |
|
|
userAry := strings.Split(sendUserListing, "|") |
|
|
var userKeyInt int64 = 0 |
|
|
var userKeyInt int64 = 0 |
|
|
@ -165,21 +270,441 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandle(scoreFlowKey, clickEnter |
|
|
//获取当前执行人信息
|
|
|
//获取当前执行人信息
|
|
|
commonus.GetUesrContForWechatID(t.ToUsername) |
|
|
commonus.GetUesrContForWechatID(t.ToUsername) |
|
|
|
|
|
|
|
|
keyNumber := commonus.GetFileNumberEs() |
|
|
// keyNumber := commonus.GetFileNumberEs()
|
|
|
SendRectifyReceipt(sendUserList, mainTitle, mainTitleDesc, subtitle, reason, scoreFlowInfo.DutyDepartment, userKeyInt, keyNumber, scoreFlowInfo.Key, recMeasCont.Id) |
|
|
SendRectifyReceipt(sendUserList, mainTitle, mainTitleDesc, subtitle, reason, scoreFlowInfo.DutyDepartment, userKeyInt, keyNumber, scoreFlowInfo.Key, recMeasCont.Id) |
|
|
|
|
|
case 5: |
|
|
|
|
|
evals.UpEvaluationProcessApproval(scoreFlowInfo.Key, 0, 0, 1) |
|
|
|
|
|
flowSaveData := commonus.MapOut() |
|
|
|
|
|
flowSaveData["sf_reply"] = 3 |
|
|
|
|
|
flowSaveData["sf_eite_time"] = time.Now().Unix() |
|
|
|
|
|
evals.EiteScoreFlow(scoreFlowInfo.Key, flowSaveData) |
|
|
|
|
|
fmt.Printf("=========================>\n") |
|
|
|
|
|
//发送消息
|
|
|
|
|
|
sendUserIsTrue, sendUserList := commonus.GetSendMsgUser(16118387069540343, scoreFlowInfo.DutyDepartment) //获取对应部门内勤
|
|
|
|
|
|
if sendUserIsTrue != true { |
|
|
|
|
|
// response.Result(0, sendUserList, "未指定相关部门处理人!未能向相关人员发送考核项目!请手动发起!", c)
|
|
|
|
|
|
// return
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var programme assessmentmodel.QualitativeEvaluation |
|
|
|
|
|
judgeProgramme := global.GVA_DB_Performanceappraisal.Where("`qe_id` = ?", scoreFlowInfo.EvaluationPlan).First(&programme).Error |
|
|
|
|
|
if judgeProgramme != nil { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
var mainTitle string = "" |
|
|
|
|
|
if programme.DetailedTarget != 0 { |
|
|
|
|
|
detailedTargetCont, detailedTargetErr := commonus.GetDetailedTargetInfo(programme.DetailedTarget) |
|
|
|
|
|
if detailedTargetErr == true { |
|
|
|
|
|
mainTitle = detailedTargetCont.Title |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
detailedTargetCont, detailedTargetErr := commonus.GetTargetInfo(programme.Target) |
|
|
|
|
|
if detailedTargetErr == true { |
|
|
|
|
|
mainTitle = detailedTargetCont.Title |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var recMeasCont assessmentmodel.RectificationMeasures |
|
|
|
|
|
judgeRecMeas := global.GVA_DB_Performanceappraisal.Where("`rm_id` = ?", scoreFlowInfo.Key).Find(&recMeasCont).Error |
|
|
|
|
|
if judgeRecMeas == nil { |
|
|
|
|
|
// return
|
|
|
|
|
|
} |
|
|
|
|
|
mainTitleDesc := programme.Content |
|
|
|
|
|
subtitle := "整改内容:" |
|
|
|
|
|
|
|
|
|
|
|
scoreReason := recMeasCont.Content |
|
|
|
|
|
subTitleText := "考核部门" |
|
|
|
|
|
keyNumber := commonus.GetFileNumberEs() |
|
|
|
|
|
//发送整改通知
|
|
|
|
|
|
handleUrl := fmt.Sprintf("http://www.hxgk.group?orderid=%v", scoreFlowInfo.Key) |
|
|
|
|
|
callbakcMsg, isTrueCall, callBackCont, sendTextMsg := sendmessage.SendMsgTxtPublic(sendUserList, mainTitle, mainTitleDesc, programme.Unit, subtitle, handleUrl, scoreReason, subTitleText, scoreFlowInfo.PlusReduceScore, scoreFlowInfo.EvaluationDepartment, scoreFlowInfo.EvaluationUser, scoreFlowInfo.Score, keyNumber, "查看整改详情!") |
|
|
|
|
|
fmt.Printf("流程结束:%v-----------%v----------->%v------》%v\n", string(callbakcMsg), isTrueCall, callBackCont, sendTextMsg) |
|
|
|
|
|
default: |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
fmt.Printf("close==========3===============>%v\n", flowLog[len(flowLog)-1].Step) |
|
|
|
|
|
//1:内勤;2:部门负责人:3:整改;4:整改后部门负责;5:归档起草人
|
|
|
|
|
|
switch flowLog[len(flowLog)-1].NextStep { |
|
|
|
|
|
case 1: |
|
|
|
|
|
|
|
|
|
|
|
case 2: |
|
|
|
|
|
fmt.Printf("close==========2===============>\n") |
|
|
|
|
|
evals.UpEvaluationProcessReject(scoreFlowInfo.Key, 16118387069540343, 0, 1) |
|
|
|
|
|
//发送消息
|
|
|
|
|
|
sendUserIsTrue, sendUserList := commonus.GetSendMsgUser(16118387069540343, scoreFlowInfo.DutyDepartment) //获取对应部门内勤
|
|
|
|
|
|
if sendUserIsTrue != true { |
|
|
|
|
|
// response.Result(0, sendUserList, "未指定相关部门处理人!未能向相关人员发送考核项目!请手动发起!", c)
|
|
|
|
|
|
// return
|
|
|
|
|
|
} |
|
|
|
|
|
taskId := commonus.GetFileNumberEs() |
|
|
|
|
|
targettitle, detailedRulesTitle, detailedRulesInfo, unitStr, flowContent, _ := commonus.GetDutyAssociatedItems(scoreFlowKey) |
|
|
|
|
|
title := flowContent.Reason |
|
|
|
|
|
if title == "" { |
|
|
|
|
|
if detailedRulesInfo != "" { |
|
|
|
|
|
title = detailedRulesInfo |
|
|
|
|
|
} else if detailedRulesTitle != "" { |
|
|
|
|
|
title = detailedRulesInfo |
|
|
|
|
|
} else { |
|
|
|
|
|
title = targettitle |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
var desc string |
|
|
|
|
|
if flowContent.PlusReduceScore == 1 { |
|
|
|
|
|
desc = fmt.Sprintf("增加:%v%v", flowContent.Score, unitStr) |
|
|
|
|
|
} else { |
|
|
|
|
|
desc = fmt.Sprintf("扣除:%v%v", flowContent.Score, unitStr) |
|
|
|
|
|
} |
|
|
|
|
|
quoteAreaTitle := "责任划分" |
|
|
|
|
|
var divisionResponsibilities []assessmentmodel.DivisionResponsibilities |
|
|
|
|
|
dRBerr := global.GVA_DB_Performanceappraisal.Where("df_sf_id = ?", scoreFlowKey).Find(&divisionResponsibilities).Error |
|
|
|
|
|
var quoteAreaContent string |
|
|
|
|
|
if dRBerr == nil { |
|
|
|
|
|
for _, drb_val := range divisionResponsibilities { |
|
|
|
|
|
var zeren string |
|
|
|
|
|
switch drb_val.Type { |
|
|
|
|
|
case 1: |
|
|
|
|
|
zeren = "主要责任人" |
|
|
|
|
|
case 2: |
|
|
|
|
|
zeren = "互保责任人" |
|
|
case 3: |
|
|
case 3: |
|
|
|
|
|
zeren = "责任班组" |
|
|
case 4: |
|
|
case 4: |
|
|
|
|
|
zeren = "责任班组长" |
|
|
case 5: |
|
|
case 5: |
|
|
|
|
|
zeren = "主管" |
|
|
|
|
|
case 6: |
|
|
|
|
|
zeren = "三大员" |
|
|
|
|
|
case 7: |
|
|
|
|
|
zeren = "厂长、主任" |
|
|
default: |
|
|
default: |
|
|
|
|
|
zeren = "主要责任人" |
|
|
|
|
|
} |
|
|
|
|
|
quoteAreaContent = quoteAreaContent + fmt.Sprintf("%v:%v 责任占比:%v\n", zeren, drb_val.UserName, drb_val.Weight) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
roleGroupInfo, roleGroupInfoIstrue := commonus.GetRoleGroup(16182159043990656) |
|
|
|
|
|
twoLevelTitle := "" |
|
|
|
|
|
if roleGroupInfoIstrue == true { |
|
|
|
|
|
twoLevelTitle = roleGroupInfo.Title |
|
|
|
|
|
} |
|
|
|
|
|
twoLevelKeyName := roleGroupInfo.Title |
|
|
|
|
|
twoLevelKeyValue := roleGroupInfo.Title |
|
|
|
|
|
userWechatErr, userWechat := commonus.GetUesrContForWechatID(t.FromUsername) |
|
|
|
|
|
if userWechatErr == true { |
|
|
|
|
|
twoLevelKeyName = userWechat.DepartmentName |
|
|
|
|
|
twoLevelKeyValue = userWechat.Name |
|
|
|
|
|
} |
|
|
|
|
|
twoLevelUserId := t.FromUsername |
|
|
|
|
|
fmt.Printf("close============3=============>\n") |
|
|
|
|
|
jumpUrl := fmt.Sprintf("http://www.hxgk.group?orderid=%v", scoreFlowKey) |
|
|
|
|
|
jumpUrlTitle := "请前往处理被驳回的任务" |
|
|
|
|
|
sourceDesc := "驳回" |
|
|
|
|
|
var sendTextMsg sendmessage.TextNoticeTemplateMedium |
|
|
|
|
|
callbakcMsg, isTrueCall, callBackCont := sendTextMsg.SendNewsMsgText(sendUserList, strconv.FormatInt(taskId, 10), title, desc, quoteAreaTitle, quoteAreaContent, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, jumpUrl, jumpUrlTitle, sourceDesc) |
|
|
|
|
|
fmt.Printf("更新发送信息返回:%v-----------%v----------->%v-----\n", string(callbakcMsg), isTrueCall, callBackCont) |
|
|
|
|
|
case 3: |
|
|
|
|
|
case 4: |
|
|
|
|
|
buttonClickAry := strings.Split(t.EventKey, "_") |
|
|
|
|
|
if len(buttonClickAry) < 4 { |
|
|
|
|
|
fmt.Printf("未知整改措施--》:%v\n", t.EventKey) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
var recMeasCont assessmentmodel.RectificationMeasures |
|
|
|
|
|
judgeRecMeas := global.GVA_DB_Performanceappraisal.Where("`rm_id` = ?", buttonClickAry[3]).First(&recMeasCont).Error |
|
|
|
|
|
if judgeRecMeas != nil { |
|
|
|
|
|
fmt.Printf("未知整改措施--->:%v\n", t.EventKey) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
taskId := commonus.GetFileNumberEs() |
|
|
|
|
|
evals.UpEvaluationProcessReject(scoreFlowInfo.Key, 0, taskId, 3) |
|
|
|
|
|
//获取接收人是谁 第一责任人
|
|
|
|
|
|
var weChatStr []string |
|
|
|
|
|
var divisResponInfo []assessmentmodel.DivisionResponsibilities |
|
|
|
|
|
judegdivisErr := global.GVA_DB_Performanceappraisal.Where("`df_type` = 1 AND `df_sf_id` = ?", scoreFlowKey).Find(&divisResponInfo).Error |
|
|
|
|
|
if judegdivisErr == nil { |
|
|
|
|
|
//获取操作人
|
|
|
|
|
|
userFileStr := "wm_number,qywx_key,wx_key" |
|
|
|
|
|
for _, dri_v := range divisResponInfo { |
|
|
|
|
|
//操作人条件
|
|
|
|
|
|
userWherAry := commonus.MapOut() |
|
|
|
|
|
// userWherAry["wm_key"] = "WoBenShanLiang_3" //"WoBenShanLiang_3"
|
|
|
|
|
|
userWherAry["wm_key"] = dri_v.UserKey |
|
|
|
|
|
userConting, userIsTrue := commonus.GetUserInfoPublic(userFileStr, userWherAry) |
|
|
|
|
|
if userIsTrue == true { |
|
|
|
|
|
if userConting.WechatId != "" && userConting.WorkWechatId != "" { |
|
|
|
|
|
weChatStr = append(weChatStr, userConting.WorkWechatId) |
|
|
|
|
|
} else if userConting.WechatId != "" && userConting.WorkWechatId == "" { |
|
|
|
|
|
weChatStr = append(weChatStr, userConting.WechatId) |
|
|
|
|
|
} else if userConting.WechatId == "" && userConting.WorkWechatId != "" { |
|
|
|
|
|
weChatStr = append(weChatStr, userConting.WorkWechatId) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
targettitle, detailedRulesTitle, detailedRulesInfo, unitStr, flowContent, _ := commonus.GetDutyAssociatedItems(scoreFlowKey) |
|
|
|
|
|
title := flowContent.Reason |
|
|
|
|
|
if title == "" { |
|
|
|
|
|
if detailedRulesInfo != "" { |
|
|
|
|
|
title = detailedRulesInfo |
|
|
|
|
|
} else if detailedRulesTitle != "" { |
|
|
|
|
|
title = detailedRulesInfo |
|
|
|
|
|
} else { |
|
|
|
|
|
title = targettitle |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
var desc string |
|
|
|
|
|
if flowContent.PlusReduceScore == 1 { |
|
|
|
|
|
desc = fmt.Sprintf("增加:%v%v", flowContent.Score, unitStr) |
|
|
|
|
|
} else { |
|
|
|
|
|
desc = fmt.Sprintf("扣除:%v%v", flowContent.Score, unitStr) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sendUserList := strings.Join(weChatStr, "|") |
|
|
|
|
|
var sendTextMsg sendmessage.TextNoticeTemplateMedium |
|
|
|
|
|
|
|
|
|
|
|
quoteAreaTitle := "整改方案" |
|
|
|
|
|
quoteAreaContent := recMeasCont.Content |
|
|
|
|
|
|
|
|
|
|
|
roleGroupInfo, roleGroupInfoIstrue := commonus.GetRoleGroup(16182159043990656) //部门负责人
|
|
|
|
|
|
twoLevelTitle := "" |
|
|
|
|
|
if roleGroupInfoIstrue == true { |
|
|
|
|
|
twoLevelTitle = roleGroupInfo.Title |
|
|
|
|
|
} |
|
|
|
|
|
twoLevelKeyName := roleGroupInfo.Title |
|
|
|
|
|
twoLevelKeyValue := roleGroupInfo.Title |
|
|
|
|
|
userWechatErr, userWechat := commonus.GetUesrContForWechatID(t.FromUsername) |
|
|
|
|
|
if userWechatErr == true { |
|
|
|
|
|
twoLevelKeyName = userWechat.DepartmentName |
|
|
|
|
|
twoLevelKeyValue = userWechat.Name |
|
|
|
|
|
} |
|
|
|
|
|
twoLevelUserId := t.FromUsername |
|
|
|
|
|
jumpUrl := fmt.Sprintf("http://www.hxgk.group?orderid=%v", scoreFlowKey) |
|
|
|
|
|
jumpUrlTitle := "请前往处理被驳回的任务" |
|
|
|
|
|
sourceDesc := "驳回" |
|
|
|
|
|
callbakcMsg, isTrueCall, callBackCont := sendTextMsg.SendNewsMsgText(sendUserList, strconv.FormatInt(taskId, 10), title, desc, quoteAreaTitle, quoteAreaContent, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, jumpUrl, jumpUrlTitle, sourceDesc) |
|
|
|
|
|
fmt.Printf("更新发送信息返回:%v-----------%v----------->%v-----\n", string(callbakcMsg), isTrueCall, callBackCont) |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
buttonClickNAme = "已驳回" |
|
|
fmt.Printf("未找到责任人:%v-----------%v-----\n", judegdivisErr, divisResponInfo) |
|
|
buttonClickNAmeOther = "其他人已驳回" |
|
|
} |
|
|
scoreFlowKeyId, scoreFlowKeyErr := strconv.ParseInt(scoreFlowKey, 10, 64) |
|
|
case 5: |
|
|
if scoreFlowKeyErr == nil { |
|
|
taskId := commonus.GetFileNumberEs() |
|
|
evaluation.UpEvaluationProcessReject(scoreFlowKeyId) |
|
|
buttonClickAry := strings.Split(t.EventKey, "_") |
|
|
|
|
|
if len(buttonClickAry) < 4 { |
|
|
|
|
|
evals.UpEvaluationProcessReject(scoreFlowInfo.Key, 0, taskId, 1) |
|
|
|
|
|
//发送消息
|
|
|
|
|
|
sendUserIsTrue, sendUserList := commonus.GetSendMsgUser(16118387069540343, scoreFlowInfo.DutyDepartment) //获取对应部门内勤
|
|
|
|
|
|
if sendUserIsTrue != true { |
|
|
|
|
|
// response.Result(0, sendUserList, "未指定相关部门处理人!未能向相关人员发送考核项目!请手动发起!", c)
|
|
|
|
|
|
// return
|
|
|
|
|
|
} |
|
|
|
|
|
targettitle, detailedRulesTitle, detailedRulesInfo, unitStr, flowContent, _ := commonus.GetDutyAssociatedItems(scoreFlowKey) |
|
|
|
|
|
title := flowContent.Reason |
|
|
|
|
|
if title == "" { |
|
|
|
|
|
if detailedRulesInfo != "" { |
|
|
|
|
|
title = detailedRulesInfo |
|
|
|
|
|
} else if detailedRulesTitle != "" { |
|
|
|
|
|
title = detailedRulesInfo |
|
|
|
|
|
} else { |
|
|
|
|
|
title = targettitle |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
var desc string |
|
|
|
|
|
if flowContent.PlusReduceScore == 1 { |
|
|
|
|
|
desc = fmt.Sprintf("增加:%v%v", flowContent.Score, unitStr) |
|
|
|
|
|
} else { |
|
|
|
|
|
desc = fmt.Sprintf("扣除:%v%v", flowContent.Score, unitStr) |
|
|
|
|
|
} |
|
|
|
|
|
quoteAreaTitle := "责任划分" |
|
|
|
|
|
var divisionResponsibilities []assessmentmodel.DivisionResponsibilities |
|
|
|
|
|
dRBerr := global.GVA_DB_Performanceappraisal.Where("df_sf_id = ?", scoreFlowKey).Find(&divisionResponsibilities).Error |
|
|
|
|
|
var quoteAreaContent string |
|
|
|
|
|
if dRBerr == nil { |
|
|
|
|
|
for _, drb_val := range divisionResponsibilities { |
|
|
|
|
|
var zeren string |
|
|
|
|
|
switch drb_val.Type { |
|
|
|
|
|
case 1: |
|
|
|
|
|
zeren = "主要责任人" |
|
|
|
|
|
case 2: |
|
|
|
|
|
zeren = "互保责任人" |
|
|
|
|
|
case 3: |
|
|
|
|
|
zeren = "责任班组" |
|
|
|
|
|
case 4: |
|
|
|
|
|
zeren = "责任班组长" |
|
|
|
|
|
case 5: |
|
|
|
|
|
zeren = "主管" |
|
|
|
|
|
case 6: |
|
|
|
|
|
zeren = "三大员" |
|
|
|
|
|
case 7: |
|
|
|
|
|
zeren = "厂长、主任" |
|
|
|
|
|
default: |
|
|
|
|
|
zeren = "主要责任人" |
|
|
|
|
|
} |
|
|
|
|
|
quoteAreaContent = quoteAreaContent + fmt.Sprintf("%v:%v 责任占比:%v\n", zeren, drb_val.UserName, drb_val.Weight) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
twoLevelTitle := "考核上报部门" |
|
|
|
|
|
var twoLevelKeyName, twoLevelKeyValue string |
|
|
|
|
|
userWechatErr, userWechat := commonus.GetUesrContForWechatID(t.FromUsername) |
|
|
|
|
|
if userWechatErr == true { |
|
|
|
|
|
twoLevelKeyName = userWechat.DepartmentName |
|
|
|
|
|
twoLevelKeyValue = userWechat.Name |
|
|
|
|
|
} |
|
|
|
|
|
twoLevelUserId := t.FromUsername |
|
|
|
|
|
jumpUrl := fmt.Sprintf("http://www.hxgk.group?orderid=%v", scoreFlowKey) |
|
|
|
|
|
jumpUrlTitle := "请前往处理被驳回的任务" |
|
|
|
|
|
sourceDesc := "驳回" |
|
|
|
|
|
var sendTextMsg sendmessage.TextNoticeTemplateMedium |
|
|
|
|
|
callbakcMsg, isTrueCall, callBackCont := sendTextMsg.SendNewsMsgText(sendUserList, strconv.FormatInt(taskId, 10), title, desc, quoteAreaTitle, quoteAreaContent, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, jumpUrl, jumpUrlTitle, sourceDesc) |
|
|
|
|
|
fmt.Printf("更新发送信息返回:%v-----------%v----------->%v-----\n", string(callbakcMsg), isTrueCall, callBackCont) |
|
|
|
|
|
} else { |
|
|
|
|
|
if buttonClickAry[3] == "0" { |
|
|
|
|
|
evals.UpEvaluationProcessReject(scoreFlowInfo.Key, 0, taskId, 1) |
|
|
|
|
|
//发送消息
|
|
|
|
|
|
sendUserIsTrue, sendUserList := commonus.GetSendMsgUser(16118387069540343, scoreFlowInfo.DutyDepartment) //获取对应部门内勤
|
|
|
|
|
|
if sendUserIsTrue != true { |
|
|
|
|
|
// response.Result(0, sendUserList, "未指定相关部门处理人!未能向相关人员发送考核项目!请手动发起!", c)
|
|
|
|
|
|
// return
|
|
|
|
|
|
} |
|
|
|
|
|
targettitle, detailedRulesTitle, detailedRulesInfo, unitStr, flowContent, _ := commonus.GetDutyAssociatedItems(scoreFlowKey) |
|
|
|
|
|
title := flowContent.Reason |
|
|
|
|
|
if title == "" { |
|
|
|
|
|
if detailedRulesInfo != "" { |
|
|
|
|
|
title = detailedRulesInfo |
|
|
|
|
|
} else if detailedRulesTitle != "" { |
|
|
|
|
|
title = detailedRulesInfo |
|
|
|
|
|
} else { |
|
|
|
|
|
title = targettitle |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
var desc string |
|
|
|
|
|
if flowContent.PlusReduceScore == 1 { |
|
|
|
|
|
desc = fmt.Sprintf("增加:%v%v", flowContent.Score, unitStr) |
|
|
|
|
|
} else { |
|
|
|
|
|
desc = fmt.Sprintf("扣除:%v%v", flowContent.Score, unitStr) |
|
|
|
|
|
} |
|
|
|
|
|
quoteAreaTitle := "责任划分" |
|
|
|
|
|
var divisionResponsibilities []assessmentmodel.DivisionResponsibilities |
|
|
|
|
|
dRBerr := global.GVA_DB_Performanceappraisal.Where("df_sf_id = ?", scoreFlowKey).Find(&divisionResponsibilities).Error |
|
|
|
|
|
var quoteAreaContent string |
|
|
|
|
|
if dRBerr == nil { |
|
|
|
|
|
for _, drb_val := range divisionResponsibilities { |
|
|
|
|
|
var zeren string |
|
|
|
|
|
switch drb_val.Type { |
|
|
|
|
|
case 1: |
|
|
|
|
|
zeren = "主要责任人" |
|
|
|
|
|
case 2: |
|
|
|
|
|
zeren = "互保责任人" |
|
|
|
|
|
case 3: |
|
|
|
|
|
zeren = "责任班组" |
|
|
|
|
|
case 4: |
|
|
|
|
|
zeren = "责任班组长" |
|
|
|
|
|
case 5: |
|
|
|
|
|
zeren = "主管" |
|
|
|
|
|
case 6: |
|
|
|
|
|
zeren = "三大员" |
|
|
|
|
|
case 7: |
|
|
|
|
|
zeren = "厂长、主任" |
|
|
|
|
|
default: |
|
|
|
|
|
zeren = "主要责任人" |
|
|
|
|
|
} |
|
|
|
|
|
quoteAreaContent = quoteAreaContent + fmt.Sprintf("%v:%v 责任占比:%v\n", zeren, drb_val.UserName, drb_val.Weight) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
twoLevelTitle := "考核上报部门" |
|
|
|
|
|
var twoLevelKeyName, twoLevelKeyValue string |
|
|
|
|
|
userWechatErr, userWechat := commonus.GetUesrContForWechatID(t.FromUsername) |
|
|
|
|
|
if userWechatErr == true { |
|
|
|
|
|
twoLevelKeyName = userWechat.DepartmentName |
|
|
|
|
|
twoLevelKeyValue = userWechat.Name |
|
|
|
|
|
} |
|
|
|
|
|
twoLevelUserId := t.FromUsername |
|
|
|
|
|
jumpUrl := fmt.Sprintf("http://www.hxgk.group?orderid=%v", scoreFlowKey) |
|
|
|
|
|
jumpUrlTitle := "请前往处理被驳回的任务" |
|
|
|
|
|
sourceDesc := "驳回" |
|
|
|
|
|
var sendTextMsg sendmessage.TextNoticeTemplateMedium |
|
|
|
|
|
callbakcMsg, isTrueCall, callBackCont := sendTextMsg.SendNewsMsgText(sendUserList, strconv.FormatInt(taskId, 10), title, desc, quoteAreaTitle, quoteAreaContent, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, jumpUrl, jumpUrlTitle, sourceDesc) |
|
|
|
|
|
fmt.Printf("更新发送信息返回:%v-----------%v----------->%v-----\n", string(callbakcMsg), isTrueCall, callBackCont) |
|
|
|
|
|
} else { |
|
|
|
|
|
var recMeasCont assessmentmodel.RectificationMeasures |
|
|
|
|
|
judgeRecMeas := global.GVA_DB_Performanceappraisal.Where("`rm_id` = ?", buttonClickAry[3]).First(&recMeasCont).Error |
|
|
|
|
|
if judgeRecMeas != nil { |
|
|
|
|
|
fmt.Printf("未知整改措施--->:%v\n", t.EventKey) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
evals.UpEvaluationProcessReject(scoreFlowInfo.Key, 0, taskId, 3) |
|
|
|
|
|
//获取接收人是谁 第一责任人
|
|
|
|
|
|
var weChatStr []string |
|
|
|
|
|
var divisResponInfo []assessmentmodel.DivisionResponsibilities |
|
|
|
|
|
judegdivisErr := global.GVA_DB_Performanceappraisal.Where("`df_type` = 1 AND `df_sf_id` = ?", scoreFlowKey).Find(&divisResponInfo).Error |
|
|
|
|
|
if judegdivisErr == nil { |
|
|
|
|
|
//获取操作人
|
|
|
|
|
|
userFileStr := "wm_number,qywx_key,wx_key" |
|
|
|
|
|
for _, dri_v := range divisResponInfo { |
|
|
|
|
|
//操作人条件
|
|
|
|
|
|
userWherAry := commonus.MapOut() |
|
|
|
|
|
// userWherAry["wm_key"] = "WoBenShanLiang_3" //"WoBenShanLiang_3"
|
|
|
|
|
|
userWherAry["wm_key"] = dri_v.UserKey |
|
|
|
|
|
userConting, userIsTrue := commonus.GetUserInfoPublic(userFileStr, userWherAry) |
|
|
|
|
|
if userIsTrue == true { |
|
|
|
|
|
if userConting.WechatId != "" && userConting.WorkWechatId != "" { |
|
|
|
|
|
weChatStr = append(weChatStr, userConting.WorkWechatId) |
|
|
|
|
|
} else if userConting.WechatId != "" && userConting.WorkWechatId == "" { |
|
|
|
|
|
weChatStr = append(weChatStr, userConting.WechatId) |
|
|
|
|
|
} else if userConting.WechatId == "" && userConting.WorkWechatId != "" { |
|
|
|
|
|
weChatStr = append(weChatStr, userConting.WorkWechatId) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
targettitle, detailedRulesTitle, detailedRulesInfo, unitStr, flowContent, _ := commonus.GetDutyAssociatedItems(scoreFlowKey) |
|
|
|
|
|
title := flowContent.Reason |
|
|
|
|
|
if title == "" { |
|
|
|
|
|
if detailedRulesInfo != "" { |
|
|
|
|
|
title = detailedRulesInfo |
|
|
|
|
|
} else if detailedRulesTitle != "" { |
|
|
|
|
|
title = detailedRulesInfo |
|
|
|
|
|
} else { |
|
|
|
|
|
title = targettitle |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
var desc string |
|
|
|
|
|
if flowContent.PlusReduceScore == 1 { |
|
|
|
|
|
desc = fmt.Sprintf("增加:%v%v", flowContent.Score, unitStr) |
|
|
|
|
|
} else { |
|
|
|
|
|
desc = fmt.Sprintf("扣除:%v%v", flowContent.Score, unitStr) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sendUserList := strings.Join(weChatStr, "|") |
|
|
|
|
|
var sendTextMsg sendmessage.TextNoticeTemplateMedium |
|
|
|
|
|
|
|
|
|
|
|
quoteAreaTitle := "整改方案" |
|
|
|
|
|
quoteAreaContent := recMeasCont.Content |
|
|
|
|
|
|
|
|
|
|
|
twoLevelTitle := "考核上报部门" |
|
|
|
|
|
var twoLevelKeyName, twoLevelKeyValue string |
|
|
|
|
|
userWechatErr, userWechat := commonus.GetUesrContForWechatID(t.FromUsername) |
|
|
|
|
|
if userWechatErr == true { |
|
|
|
|
|
twoLevelKeyName = userWechat.DepartmentName |
|
|
|
|
|
twoLevelKeyValue = userWechat.Name |
|
|
|
|
|
} |
|
|
|
|
|
twoLevelUserId := t.FromUsername |
|
|
|
|
|
|
|
|
|
|
|
jumpUrl := fmt.Sprintf("http://www.hxgk.group?orderid=%v", scoreFlowKey) |
|
|
|
|
|
jumpUrlTitle := "请前往处理被驳回的任务" |
|
|
|
|
|
sourceDesc := "驳回" |
|
|
|
|
|
callbakcMsg, isTrueCall, callBackCont := sendTextMsg.SendNewsMsgText(sendUserList, strconv.FormatInt(taskId, 10), title, desc, quoteAreaTitle, quoteAreaContent, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, jumpUrl, jumpUrlTitle, sourceDesc) |
|
|
|
|
|
fmt.Printf("更新发送信息返回:%v-----------%v----------->%v-----\n", string(callbakcMsg), isTrueCall, callBackCont) |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
fmt.Printf("未找到责任人:%v-----------%v-----\n", judegdivisErr, divisResponInfo) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
@ -187,15 +712,39 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandle(scoreFlowKey, clickEnter |
|
|
// performSteps := 1
|
|
|
// performSteps := 1
|
|
|
// fmt.Printf("3@@@@%v\n", flowLog[len(flowLog)-1].Step)
|
|
|
// fmt.Printf("3@@@@%v\n", flowLog[len(flowLog)-1].Step)
|
|
|
|
|
|
|
|
|
// fmt.Printf("2@@@@%v--->%v\n", sendUserList, scoreFlowInfo.DutyDepartment)
|
|
|
fmt.Printf("2@@@@%v--->%v\n", sendUserList, scoreFlowInfo.DutyDepartment) |
|
|
|
|
|
|
|
|
userAry := strings.Split(sendUserList, "|") |
|
|
// userAry := strings.Split(sendUserList, "|")
|
|
|
|
|
|
// for _, v := range userAry {
|
|
|
|
|
|
// if v != t.FromUsername {
|
|
|
|
|
|
// userInfoErr, userInfo := commonus.GetUesrContForWechatID(v)
|
|
|
|
|
|
// if userInfoErr == true {
|
|
|
|
|
|
// buttonClickNAmeOtherEs := fmt.Sprintf("%v%v", userInfo.Name, buttonClickNAmeOther)
|
|
|
|
|
|
// t.UpdateButton(v, buttonClickNAmeOtherEs)
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// t.UpdateButton(v, buttonClickNAmeOther)
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
// fmt.Printf("click---------------------->%v--->%v\n", sendUserList, scoreFlowInfo.DutyDepartment)
|
|
|
|
|
|
// }
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//其他按钮处理
|
|
|
|
|
|
func (t *TemplateCardPush) OtherClickButton(userAry []string, buttonClickNAmeOther string) { |
|
|
|
|
|
userInfoErr, userInfo := commonus.GetUesrContForWechatID(t.FromUsername) |
|
|
|
|
|
if len(userAry) > 0 { |
|
|
for _, v := range userAry { |
|
|
for _, v := range userAry { |
|
|
if v == t.FromUsername { |
|
|
if v != t.FromUsername { |
|
|
t.UpdateButton(v, buttonClickNAme) |
|
|
if userInfoErr == true { |
|
|
|
|
|
buttonClickNAmeOtherEs := fmt.Sprintf("%v%v", userInfo.Name, buttonClickNAmeOther) |
|
|
|
|
|
t.UpdateButton(v, buttonClickNAmeOtherEs) |
|
|
} else { |
|
|
} else { |
|
|
t.UpdateButton(v, buttonClickNAmeOther) |
|
|
t.UpdateButton(v, buttonClickNAmeOther) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -207,8 +756,8 @@ func (t *TemplateCardPush) UpdateButton(userOpenId, buttonName string) { |
|
|
updateButtonNotClickable.Agentid = t.Agentid |
|
|
updateButtonNotClickable.Agentid = t.Agentid |
|
|
updateButtonNotClickable.ResponseCode = t.ResponseCode |
|
|
updateButtonNotClickable.ResponseCode = t.ResponseCode |
|
|
updateButtonNotClickable.Button.ReplaceName = buttonName |
|
|
updateButtonNotClickable.Button.ReplaceName = buttonName |
|
|
// callbakcMsg, isTrueCall, callBackCont := updateButtonNotClickable.UpdateSendButtonMessage()
|
|
|
callbakcMsg, isTrueCall, callBackCont := updateButtonNotClickable.UpdateSendButtonMessage() |
|
|
// fmt.Printf("更新销售发送信息返回:%v-----------%v----------->%v------》%v\n", string(callbakcMsg), isTrueCall, callBackCont, updateButtonNotClickable)
|
|
|
fmt.Printf("更新发送信息返回:%v-----------%v----------->%v------》%v\n", string(callbakcMsg), isTrueCall, callBackCont, updateButtonNotClickable) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//获取操作人
|
|
|
//获取操作人
|
|
|
@ -261,7 +810,7 @@ func GetCaoZuoRen(stepVal int, s assessmentmodel.ScoreFlow) (sendUserList string |
|
|
@userKey 执行考核人 |
|
|
@userKey 执行考核人 |
|
|
@Score 考核分值 |
|
|
@Score 考核分值 |
|
|
*/ |
|
|
*/ |
|
|
func SendRectifyMsg(sendUserList, reason string, planIdInt, floeKey, departmentId, userKey, Score int64, typeSet int) (callbakcMsg []byte, isTrueCall bool, callBackCont string, sendTextMsg sendmessage.TextNoticeTemplateMedium) { |
|
|
func SendRectifyMsg(sendUserList, reason string, planIdInt, floeKey, departmentId, userKey, Score, keyNumber int64, typeSet int) (callbakcMsg []byte, isTrueCall bool, callBackCont string, sendTextMsg sendmessage.TextNoticeTemplateMedium) { |
|
|
var mainTitle string = "" |
|
|
var mainTitle string = "" |
|
|
var mainTitleDesc string = "" |
|
|
var mainTitleDesc string = "" |
|
|
var programme assessmentmodel.QualitativeEvaluation |
|
|
var programme assessmentmodel.QualitativeEvaluation |
|
|
@ -298,7 +847,7 @@ func SendRectifyMsg(sendUserList, reason string, planIdInt, floeKey, departmentI |
|
|
} |
|
|
} |
|
|
scoreReason := "" |
|
|
scoreReason := "" |
|
|
subTitleText := "部门" |
|
|
subTitleText := "部门" |
|
|
keyNumber := commonus.GetFileNumberEs() |
|
|
// keyNumber := commonus.GetFileNumberEs()
|
|
|
//发送整改通知
|
|
|
//发送整改通知
|
|
|
handleUrl := fmt.Sprintf("http://www.hxgk.group?orderid=%v", floeKey) |
|
|
handleUrl := fmt.Sprintf("http://www.hxgk.group?orderid=%v", floeKey) |
|
|
callbakcMsg, isTrueCall, callBackCont, sendTextMsg = sendmessage.SendMsgTxtPublic(sendUserList, mainTitle, mainTitleDesc, programme.Unit, reason, handleUrl, scoreReason, subTitleText, typeSet, departmentId, userKey, Score, keyNumber, "请上报整改结果!") |
|
|
callbakcMsg, isTrueCall, callBackCont, sendTextMsg = sendmessage.SendMsgTxtPublic(sendUserList, mainTitle, mainTitleDesc, programme.Unit, reason, handleUrl, scoreReason, subTitleText, typeSet, departmentId, userKey, Score, keyNumber, "请上报整改结果!") |
|
|
|