Browse Source

修个指标关联部门部同步更新到子栏目问题

qin_1
超级管理员 4 years ago
parent
commit
8b8ae7b6c9
  1. 12
      gin_server_admin/api/admin/dutyassess/assess.go
  2. 2
      gin_server_admin/api/admin/dutyassess/dutyhandle.go
  3. 108
      gin_server_admin/api/index/evaluation/evaluation.go
  4. 15
      gin_server_admin/api/index/evaluation/flowsend.go
  5. 1
      gin_server_admin/api/index/evaluation/type.go
  6. 17
      gin_server_admin/api/wechatapp/callback/apphandle.go
  7. 4
      gin_server_admin/api/wechatapp/callback/updatehandle.go
  8. 43
      gin_server_admin/commonus/publichaneld.go

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

@ -644,6 +644,10 @@ func (d *DutyAssessApi) EiteDepartForDuty(c *gin.Context) {
response.Result(105, err, "请指定所属部门!", c)
return
}
//获取所有子栏目
var sunTargetId []int64
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.Assesstarget{}).Where("`group` = ? AND `dimension` = ? AND `targetid` = ?", requestData.Group, requestData.Dimension, requestData.TargetId).Find(&sunTargetId)
saveData := commonus.MapOut()
saveData["departmentmap"] = strings.Join(requestData.DepartAry, ",")
saveData["time"] = time.Now().Unix()
@ -652,5 +656,13 @@ func (d *DutyAssessApi) EiteDepartForDuty(c *gin.Context) {
response.Result(106, delErr, "编辑失败!", c)
return
}
//修改相关子类
if len(sunTargetId) > 0 {
saveDataSun := commonus.MapOut()
saveDataSun["q_depart"] = strings.Join(requestData.DepartAry, ",")
saveDataSun["q_time"] = time.Now().Unix()
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeTarget{}).Where("`q_id` IN ?", sunTargetId).Updates(saveDataSun)
}
response.Result(0, delErr, "编辑成功!", c)
}

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

@ -434,6 +434,8 @@ func (d *DutyAssessApi) EiteSunTargetName(c *gin.Context) {
eiteCont["q_title"] = requestData.Name
if len(requestData.DepartmentMap) > 0 {
eiteCont["q_depart"] = strings.Join(requestData.DepartmentMap, ",")
} else {
eiteCont["q_depart"] = ""
}
errEiteCont := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.QualitativeTarget{}).Where("`q_id` = ?", requestData.Id).Updates(&eiteCont).Error
if errEiteCont != nil {

108
gin_server_admin/api/index/evaluation/evaluation.go

@ -219,7 +219,7 @@ func (e *EvaluationInterface) AdditionAndSubtractionScore(c *gin.Context) {
// flowSteping.AddTime = time.Now().Unix()
// flowStepAryMaps = append(flowStepAryMaps, flowSteping)
// fmt.Printf("%v------------------>%v\n", flowSteping, flowStepAryMaps)
// //fmt.Printf("%v------------------>%v\n", flowSteping, flowStepAryMaps)
// evalProCont.OrderKey = keyNumber
// evalProCont.Step = 1
@ -230,7 +230,7 @@ func (e *EvaluationInterface) AdditionAndSubtractionScore(c *gin.Context) {
// if flowStepErr == nil {
// evalProCont.Content = string(flowStepJson)
// }
// // fmt.Printf("------------------>%v\n", evalProCont)
// // //fmt.Printf("------------------>%v\n", evalProCont)
// global.GVA_DB_Performanceappraisal.Create(&evalProCont)
// } else {
// var flowStepAry []FlowStep
@ -260,7 +260,7 @@ func (e *EvaluationInterface) AdditionAndSubtractionScore(c *gin.Context) {
// saveData["ep_cont"] = string(flowStepJson)
// }
// EiteDutiesInfoes(evalProCont.Id, saveData)
// fmt.Printf("----------3-------->%v\n", evalProCont)
// //fmt.Printf("----------3-------->%v\n", evalProCont)
// }
//给相关部门内勤发送消息。确定相关责任人
sendUserIsTrue, sendUserList := commonus.GetSendMsgUser(16118387069540343, programme.AcceptEvaluation) //获取对应部门内勤
@ -447,7 +447,7 @@ func (e *EvaluationInterface) AddDivisionResponsibility(c *gin.Context) {
keyNumber := commonus.GetFileNumberEs()
var evalProCont assessmentmodel.EvaluationProcess
judgeErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", orderId).First(&evalProCont).Error
// fmt.Printf("VVVVVVVVVVVVVVVVVVVVVVVVV%v\n", judgeErr)
// //fmt.Printf("VVVVVVVVVVVVVVVVVVVVVVVVV%v\n", judgeErr)
if judgeErr != nil {
var flowStepAry []FlowStep
var flowStep FlowStep
@ -470,7 +470,7 @@ func (e *EvaluationInterface) AddDivisionResponsibility(c *gin.Context) {
evalProCont.Content = string(flowStepJson)
}
global.GVA_DB_Performanceappraisal.Create(&evalProCont)
// fmt.Printf("VVVVV--->%v\n", jsh)
// //fmt.Printf("VVVVV--->%v\n", jsh)
} else {
var flowStepAry []FlowStep
var flowStepArys []FlowStep
@ -965,8 +965,9 @@ func (e *EvaluationInterface) AddFlowRationLog(c *gin.Context) {
var flowDataLogAry []assessmentmodel.FlowLogData
var reason string
var evaluationPlan []string //方案ID
jsonMapStr, _ := json.Marshal(requestData.List)
fmt.Printf("OutJsonMap-----1------>%\n", string(jsonMapStr))
// jsonMapStr, _ := json.Marshal(requestData.List)
json.Marshal(requestData.List)
//fmt.Printf("OutJsonMap-----1------>%\n", string(jsonMapStr))
for i, v := range requestData.List {
var flowDataLog assessmentmodel.FlowLogData
evaluationPlan = append(evaluationPlan, v.Id)
@ -1009,7 +1010,7 @@ func (e *EvaluationInterface) AddFlowRationLog(c *gin.Context) {
addFlowLogErr := gromDb.Create(&flowLog).Error
addFlowLogDataErr := gromDb.Create(&flowDataLogAry).Error
fmt.Printf("%v---------------------->%v\n", addFlowLogErr, addFlowLogDataErr)
//fmt.Printf("%v---------------------->%v\n", addFlowLogErr, addFlowLogDataErr)
if addFlowLogErr == nil && addFlowLogDataErr == nil {
affairDbErr := gromDb.Commit().Error
if affairDbErr == nil {
@ -1044,9 +1045,10 @@ func (e *EvaluationInterface) AddFlowRationLog(c *gin.Context) {
buttonCont.Key = fmt.Sprintf("ration_%v_2", keyNumber)
buttonMap = append(buttonMap, buttonCont)
callbakcMsg, isTrueCall, callBackCont, sendText := sendmessage.SendButtonPublicRation(sendUserList, mainTitle, mainTitleDesc, subtitle, reason, departmentId, userKey, keyNumber, keyNumber, buttonMap)
// callbakcMsg, isTrueCall, callBackCont, sendText := sendmessage.SendButtonPublicRation(sendUserList, mainTitle, mainTitleDesc, subtitle, reason, departmentId, userKey, keyNumber, keyNumber, buttonMap)
sendmessage.SendButtonPublicRation(sendUserList, mainTitle, mainTitleDesc, subtitle, reason, departmentId, userKey, keyNumber, keyNumber, buttonMap)
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)
} else {
@ -1082,27 +1084,27 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
}
}
var titleVal string = ""
fmt.Printf("1-------------------->\n")
//fmt.Printf("1-------------------->\n")
var addScore assessmentmodel.ScoreFlow
gerErr := global.GVA_DB_Performanceappraisal.Where("`sf_key` = ?", requestData.Id).Find(&addScore).Error
fmt.Printf("2-------------------->%v\n", gerErr)
//fmt.Printf("2-------------------->%v\n", gerErr)
if gerErr != nil {
response.Result(103, gerErr, "没有此审批单!", c)
return
}
fmt.Printf("3-------------------->%v\n", gerErr)
//fmt.Printf("3-------------------->%v\n", gerErr)
// return
//获取方案
qualEvalCont, qualEvalErr := commonus.GetQualitativeEvaluation(strconv.FormatInt(addScore.EvaluationPlan, 10))
fmt.Printf("4-------------------->%v\n", addScore.EvaluationPlan)
//fmt.Printf("4-------------------->%v\n", addScore.EvaluationPlan)
if qualEvalErr != true {
response.Result(103, qualEvalErr, "没有此方案!", c)
return
}
fmt.Printf("5-------------------->%v\n", qualEvalErr)
//fmt.Printf("5-------------------->%v\n", qualEvalErr)
var dutyCecorFlowInfo DutyCecorFlow
dutyCecorFlowInfo.OrderId = strconv.FormatInt(requestData.Id, 10)
fmt.Printf("6-------------------->%v\n", requestData.Id)
//fmt.Printf("6-------------------->%v\n", requestData.Id)
if qualEvalCont.Dimension != 0 {
dimInfo, dimInfoErr := commonus.GetDutyClassInfo(qualEvalCont.Dimension)
if dimInfoErr == true {
@ -1125,23 +1127,46 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
// titleVal = tarsun.Title
}
}
//单位划分
var danWeStr string
if qualEvalCont.DetailedTarget != 0 {
detaTar, detaTarErr := commonus.GetDetailedTargetInfo(qualEvalCont.DetailedTarget)
if detaTarErr == true {
var danWeStrAry []string
danWeStrAry = strings.Split(detaTar.Company, "/")
if len(danWeStrAry) > 0 {
danWeStr = danWeStrAry[0]
}
dutyCecorFlowInfo.DetailedTarget = detaTar.Title
dutyCecorFlowInfo.Content = detaTar.Content
// titleVal = detaTar.Title
if detaTar.MaxScore != 0 && detaTar.MinScore != 0 {
dutyCecorFlowInfo.Content = fmt.Sprintf("%v-%v%v", float64(detaTar.MinScore)/100, float64(detaTar.MaxScore)/100, detaTar.Company)
} else if detaTar.MaxScore != 0 && detaTar.MinScore == 0 {
dutyCecorFlowInfo.Content = fmt.Sprintf("%v%v", float64(detaTar.MaxScore)/100, detaTar.Company)
} else if detaTar.MaxScore == 0 && detaTar.MinScore != 0 {
dutyCecorFlowInfo.Content = fmt.Sprintf("%v%v", float64(detaTar.MinScore)/100, detaTar.Company)
} else {
dutyCecorFlowInfo.Content = "未设置标准。"
}
}
}
fmt.Printf("7-------------------->%v\n", requestData.Id)
fmt.Printf("7-------------------->%v\n", danWeStr)
dutyCecorFlowInfo.Reason = addScore.Reason
//分数
sendScore := addScore.Score * int64(addScore.Count)
if addScore.PlusReduceScore == 1 {
dutyCecorFlowInfo.ReasonInfo = fmt.Sprintf("考核加分:%v\n", float64(sendScore)/100)
dutyCecorFlowInfo.LanMuName = "考核加分"
// dutyCecorFlowInfo.ReasonInfo = fmt.Sprintf("%v%v\n", float64(sendScore)/100, danWeStr)
dutyCecorFlowInfo.ReasonInfo = fmt.Sprintf("%v\n", float64(sendScore)/100)
} else {
dutyCecorFlowInfo.ReasonInfo = fmt.Sprintf("考核减分:%v\n", float64(sendScore)/100)
dutyCecorFlowInfo.LanMuName = "考核减分"
// dutyCecorFlowInfo.ReasonInfo = fmt.Sprintf("考核减%v%v\n", float64(sendScore)/100, danWeStr)
dutyCecorFlowInfo.ReasonInfo = fmt.Sprintf("%v\n", float64(sendScore)/100)
}
// if addScore.PlusReduceScore == 1 {
@ -1149,15 +1174,15 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
// } else {
// dutyCecorFlowInfo.ReasonInfo = "扣除:" + strconv.FormatInt(addScore.Score, 10) + qualEvalCont.Unit
// }
fmt.Printf("8-------------------->%v\n", requestData.Id)
//fmt.Printf("8-------------------->%v\n", requestData.Id)
if addScore.Rectification == 1 {
var divisionResponsibilities []assessmentmodel.DivisionResponsibilities
dRBerr := global.GVA_DB_Performanceappraisal.Where("df_sf_id = ?", requestData.Id).Find(&divisionResponsibilities).Error
fmt.Printf("8-------1------------->%v\n", divisionResponsibilities)
//fmt.Printf("8-------1------------->%v\n", divisionResponsibilities)
if dRBerr == nil {
for _, d_v := range divisionResponsibilities {
fmt.Printf("8-------2------------->%v\n", d_v.UserKey)
//fmt.Printf("8-------2------------->%v\n", d_v.UserKey)
var divBilInfo DivisiosibilityType
switch d_v.Type {
case 1:
@ -1181,8 +1206,9 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
if userInfoGetErr == true {
divBilInfo.UserName = userInfoGet.Name
}
fmt.Printf("8-------1-3------------>%v\n", userInfoGet)
divBilInfo.Weight = int64(d_v.Weight)
//fmt.Printf("8-------1-3------------>%v\n", userInfoGet)
// divBilInfo.Weight = int64(d_v.Weight)
divBilInfo.Weight = d_v.Weight / 100
dutyCecorFlowInfo.DivisionResponsibility = append(dutyCecorFlowInfo.DivisionResponsibility, divBilInfo)
}
}
@ -1204,36 +1230,36 @@ func (e *EvaluationInterface) LookDutkScoreFlow(c *gin.Context) {
}
}
}
fmt.Printf("9-------------------->%v\n", requestData.Id)
//fmt.Printf("9-------------------->%v\n", requestData.Id)
var evalProInfo assessmentmodel.EvaluationProcess
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 {
var flowStepAryMaps []FlowStep
jsonFlowErr := json.Unmarshal([]byte(evalProInfo.Content), &flowStepAryMaps)
fmt.Printf("9-----------2--------->%v\n", flowStepAryMaps)
//fmt.Printf("9-----------2--------->%v\n", flowStepAryMaps)
if jsonFlowErr == nil {
fmt.Printf("9-----------3--------->%v\n", flowStepAryMaps)
//fmt.Printf("9-----------3--------->%v\n", flowStepAryMaps)
if len(flowStepAryMaps) > 0 {
for _, fw_v := range flowStepAryMaps {
var flowLog TechnologicalProcessType
flowLog.Step = fw_v.Step
flowLog.State = fw_v.State
workUser, workUserErr := commonus.GetWorkUser(fw_v.ClickName)
fmt.Printf("9-----------4-----2---->%v\n", fw_v)
//fmt.Printf("9-----------4-----2---->%v\n", fw_v)
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)
fmt.Printf("9-----------4-----3---->%v\n", bfErr)
//fmt.Printf("9-----------4-----3---->%v\n", bfErr)
if bfErr == true {
getGroupRoleInfoErr, getGroupRoleInfo, roleGroupInfo := commonus.GetOfficeWork(fw_v.RoleGroup, int64(bf.WechatId))
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 {
flowLog.GroupName = roleGroupInfo.Title
for _, rg_v := range getGroupRoleInfo {
clickUserInfoErr, clickUserInfo := commonus.GetUesrContForWechatID(rg_v.Id)
fmt.Printf("9-----------4--------->%v\n", clickUserInfoErr)
//fmt.Printf("9-----------4--------->%v\n", clickUserInfoErr)
var caoZuoRenInfnfo caoZuoRen
if clickUserInfoErr == true {
if strconv.FormatInt(clickUserInfo.Key, 10) == fw_v.ClickName {
@ -1329,34 +1355,34 @@ func (d *EvaluationInterface) LookRationkScoreFlow(c *gin.Context) {
var flowLogList []TechnologicalProcessType
var evalProInfo assessmentmodel.EvaluationProcess
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 {
var flowStepAryMaps []FlowStep
jsonFlowErr := json.Unmarshal([]byte(evalProInfo.Content), &flowStepAryMaps)
fmt.Printf("9-----------2--------->%v\n", jsonFlowErr)
//fmt.Printf("9-----------2--------->%v\n", jsonFlowErr)
if jsonFlowErr == nil {
// fmt.Printf("9-----------3--------->%v\n", flowStepAryMaps)
// //fmt.Printf("9-----------3--------->%v\n", flowStepAryMaps)
if len(flowStepAryMaps) > 0 {
for _, fw_v := range flowStepAryMaps {
var flowLog TechnologicalProcessType
flowLog.Step = fw_v.Step
flowLog.State = fw_v.State
workUser, workUserErr := commonus.GetWorkUser(fw_v.ClickName)
// fmt.Printf("9-----------4-----2---->%v\n", fw_v)
// //fmt.Printf("9-----------4-----2---->%v\n", fw_v)
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)
// fmt.Printf("9-----------4-----3---->%v\n", bfErr)
// //fmt.Printf("9-----------4-----3---->%v\n", bfErr)
if bfErr == true {
getGroupRoleInfoErr, getGroupRoleInfo, roleGroupInfo := commonus.GetOfficeWork(fw_v.RoleGroup, int64(bf.WechatId))
// 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 {
flowLog.GroupName = roleGroupInfo.Title
for _, rg_v := range getGroupRoleInfo {
clickUserInfoErr, clickUserInfo := commonus.GetUesrContForWechatID(rg_v.Id)
// jjsk, _ := json.Marshal(clickUserInfo)
// fmt.Printf("9-----------4--------->%v-->%v\n", string(jjsk), clickUserInfo.Key)
// //fmt.Printf("9-----------4--------->%v-->%v\n", string(jjsk), clickUserInfo.Key)
var caoZuoRenInfnfo caoZuoRen
if clickUserInfoErr == true {
if strconv.FormatInt(clickUserInfo.Key, 10) == fw_v.ClickName {

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

@ -297,6 +297,7 @@ func (e *EvaluationInterface) PersonInCharge(c *gin.Context) {
}
//写入审批流程
commonus.StepAddData(orderId, 0, 4, 3, 1, 2, 3, userCont.Key)
var scoreFlowInfo assessmentmodel.ScoreFlow
judegFlowErr := global.GVA_DB_Performanceappraisal.Where("`sf_key` = ?", orderId).First(&scoreFlowInfo).Error
if judegFlowErr != nil {
@ -693,4 +694,16 @@ func (e *EvaluationInterface) RectificationMeasures(c *gin.Context) {
}
//
//写入责任节点
func WritePersonLiable(flowKey, userKey int64) {
//获取流程内容
var flowCont string
err := global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationProcess{}).Select("`ep_next_cont`").Where("`ep_order_key` = ?", flowKey).First(&flowCont)
if err == nil {
var twoFlowInfo commonus.FlowAllMap
jsonErr := json.Unmarshal([]byte(flowCont), &twoFlowInfo)
if jsonErr == nil {
}
}
}

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

@ -141,6 +141,7 @@ type DutyCecorFlow struct {
RectifMeasures []RectifMeasures `json:"rectifmeasures"` //整改措施
TechnologicalProcess []TechnologicalProcessType `json:"technologicalprocess"` //流程
FlowMapAll []commonus.FlowAllMap `json:"flowmapall"` //流程全貌
LanMuName string `json:"lanmuname"` //前端栏目显示名称
}
//审批流

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

@ -139,6 +139,7 @@ func (c *CallBackData) DecryptMessage(cs *gin.Context) (echoMsg string) {
default:
}
// fmt.Printf("yyyyyyyy------------->%v\n", 123456)
go func() {
var callbackLog wechatcallback.CallbackLog
//
callbackLog.MsgSignature = c.MsgSignature
@ -179,9 +180,8 @@ func (c *CallBackData) DecryptMessage(cs *gin.Context) (echoMsg string) {
WechatCallBackDataWruteRedis(redisPrefix, string(jsonStr), "lpush")
}
// fmt.Printf("yyyyyyyy------------->%v\n", string(jsonStr))
if msgContent.Event != "LOCATION" {
global.GVA_DB_WechatCallBack.Create(&callbackLog)
}
}()
return
}
@ -216,6 +216,10 @@ func EventProcessing(event string, decryptMsg []byte, v *CallBackData, cs *gin.C
case "share_chain_change": //上下游共享应用事件回调
case "template_card_event": //模板卡片事件推送
// synergeticProcess.Add(1)
go templateEventPush(decryptMsg)
// defer synergeticProcess.Wait()
// go func() {
var msgContent TemplateCardPush
err := xml.Unmarshal(decryptMsg, &msgContent)
if nil != err {
@ -238,12 +242,9 @@ func EventProcessing(event string, decryptMsg []byte, v *CallBackData, cs *gin.C
} else {
msg = "25000"
}
// synergeticProcess.Add(1)
go templateEventPush(decryptMsg)
// defer synergeticProcess.Wait()
go func() {
fmt.Printf("*msg**********%v\n", msg)
cs.String(200, msg)
}()
// }()
case "template_card_menu_event": //通用模板卡片右上角菜单事件推送
default:

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

@ -491,6 +491,9 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
}
}
commonus.StepAddData(scoreFlowInfo.Id, 0, 0, 1, 1, 2, 7, strconv.FormatInt(userContInfo.Key, 10))
//步骤内容写入
sendMsgToUserList := strings.Join(sendUserAry, "|")
taskId := strconv.FormatInt(commonus.GetFileNumberEs(), 10)
@ -557,6 +560,7 @@ func (t *TemplateCardPush) ButtonTemplateCallBackHandleBackups(orderId, clickEnt
//发起人部门负责人
orderIdInt, _ := strconv.ParseInt(orderId, 10, 64) //流程Key
commonus.StepAddData(orderIdInt, 16182159043990656, 1, 2, 1, 3, 2, strconv.FormatInt(userContInfo.Key, 10))
sendButtonIsTrue, sendButtonList := commonus.GetSendMsgUserAry(16182159043990656, userContInfo.DepartmentId) //获取发起人部门负责人
if sendButtonIsTrue == true {
buttonClickNAmeOtherEs := fmt.Sprintf("%v%v", userContInfo.Name, "已驳回")

43
gin_server_admin/commonus/publichaneld.go

@ -1527,7 +1527,7 @@ func InsetFlowLog(state, stepInt int, userKey, flowMapStr string) (flowAllMap st
if v.Step < stepInt {
eiteFlowInfo.State = 2
} else if v.Step == stepInt {
eiteFlowInfo.State = v.State
eiteFlowInfo.State = state
} else {
eiteFlowInfo.State = 1
}
@ -1584,20 +1584,26 @@ func InsetFlowLog(state, stepInt int, userKey, flowMapStr string) (flowAllMap st
//写入责任分配节点人员信息
func WriteFlowMainSet(orderId int64, userKey []int64) {
fmt.Printf("Zeren--1-->%v\n", userKey)
if len(userKey) < 1 {
return
}
var evalProCont assessmentmodel.EvaluationProcess
judgeErr := global.GVA_DB_Performanceappraisal.Where("`ep_order_key` = ?", orderId).First(&evalProCont).Error
if judgeErr != nil {
fmt.Printf("Zeren--1-1->%v\n", userKey)
return
}
flowAllMapOldStr := evalProCont.NextContent
fmt.Printf("Zeren--2-->%v\n", flowAllMapOldStr)
var flowMap []FlowAllMap
jsonErr := json.Unmarshal([]byte(evalProCont.NextContent), flowMap)
jsonErr := json.Unmarshal([]byte(evalProCont.NextContent), &flowMap)
if jsonErr != nil {
fmt.Printf("Zeren--2-1->%v\n", jsonErr)
return
}
fmt.Printf("Zeren--3-->%v\n", flowMap)
var eiteFlowMap []FlowAllMap
for _, v := range flowMap {
var eiteFlowInfo FlowAllMap
@ -1608,7 +1614,16 @@ func WriteFlowMainSet(orderId int64, userKey []int64) {
if v.Step == 5 {
var userClickAry []UserListFlowAll
for _, u_v := range userKey {
_, userCont := GetUesrContForWechatID(strconv.FormatInt(u_v, 10))
userConting, _ := GetWorkUser(strconv.FormatInt(u_v, 10))
var wechatIdStr string
if userConting.WechatId != "" {
wechatIdStr = userConting.WechatId
}
if userConting.WorkWechatId != "" {
wechatIdStr = userConting.WorkWechatId
}
_, userCont := GetUesrContForWechatID(wechatIdStr)
var returnUser UserListFlowAll
returnUser.Id = strconv.FormatInt(userCont.Key, 10)
returnUser.Name = userCont.Name
@ -1630,6 +1645,7 @@ func WriteFlowMainSet(orderId int64, userKey []int64) {
userClickAry = append(userClickAry, returnUser)
}
eiteFlowInfo.UserList = userClickAry
fmt.Printf("Zeren--4-->%v\n", userClickAry)
} else {
eiteFlowInfo.UserList = v.UserList
}
@ -1643,6 +1659,7 @@ func WriteFlowMainSet(orderId int64, userKey []int64) {
saveEiteData := MapOut()
saveEiteData["ep_time"] = time.Now().Unix()
saveEiteData["ep_next_cont"] = flowAllMapOldStr
fmt.Printf("Zeren--5-->%v\n", saveEiteData)
EiteDutiesInfoes(evalProCont.Id, saveEiteData)
}
@ -1658,7 +1675,7 @@ func IntegrationFlowAll(flowID int64, class int) (flowAllMap string) {
oneFlowInfo.NodeName = GetSetpName(1)
oneFlowInfo.State = 2
oneFlowInfo.Class = 1
oneFlowInfo.UserList = GetFlowNodeMan(flowID, class, 1)
oneFlowInfo.UserList = GetFlowNodeMan(flowID, class, 1, 1)
flowMap = append(flowMap, oneFlowInfo)
@ -1675,7 +1692,7 @@ func IntegrationFlowAll(flowID int64, class int) (flowAllMap string) {
twoFlowInfo.NodeName = GetSetpName(2)
twoFlowInfo.State = 1
twoFlowInfo.Class = 1
twoFlowInfo.UserList = GetFlowNodeMan(flowID, class, 3)
twoFlowInfo.UserList = GetFlowNodeMan(flowID, class, 3, 2)
flowMap = append(flowMap, twoFlowInfo)
//3、被考核部门内勤进行责任划分
var threeFlowInfo FlowAllMap
@ -1683,7 +1700,7 @@ func IntegrationFlowAll(flowID int64, class int) (flowAllMap string) {
threeFlowInfo.NodeName = GetSetpName(3)
threeFlowInfo.State = 1
threeFlowInfo.Class = 1
threeFlowInfo.UserList = GetFlowNodeMan(flowID, class, 4)
threeFlowInfo.UserList = GetFlowNodeMan(flowID, class, 4, 2)
flowMap = append(flowMap, threeFlowInfo)
//4、被考核部门负责人对责任划分确认
var fourFlowInfo FlowAllMap
@ -1691,7 +1708,7 @@ func IntegrationFlowAll(flowID int64, class int) (flowAllMap string) {
fourFlowInfo.NodeName = GetSetpName(7)
fourFlowInfo.State = 1
fourFlowInfo.Class = 1
fourFlowInfo.UserList = GetFlowNodeMan(flowID, class, 5)
fourFlowInfo.UserList = GetFlowNodeMan(flowID, class, 5, 2)
flowMap = append(flowMap, fourFlowInfo)
if scoreFlowCont.Rectification == 1 {
//5、整改人节点。由内勤指定
@ -1708,7 +1725,7 @@ func IntegrationFlowAll(flowID int64, class int) (flowAllMap string) {
sixFlowInfo.NodeName = GetSetpName(7)
sixFlowInfo.State = 1
sixFlowInfo.Class = 1
sixFlowInfo.UserList = GetFlowNodeMan(flowID, class, 5)
sixFlowInfo.UserList = GetFlowNodeMan(flowID, class, 5, 2)
flowMap = append(flowMap, sixFlowInfo)
//7、发起人验收
var serverFlowInfo FlowAllMap
@ -1716,7 +1733,7 @@ func IntegrationFlowAll(flowID int64, class int) (flowAllMap string) {
serverFlowInfo.NodeName = GetSetpName(5)
serverFlowInfo.State = 1
serverFlowInfo.Class = 1
serverFlowInfo.UserList = GetFlowNodeMan(flowID, class, 1)
serverFlowInfo.UserList = GetFlowNodeMan(flowID, class, 1, 2)
flowMap = append(flowMap, serverFlowInfo)
} else {
//5、发起人验收
@ -1725,7 +1742,7 @@ func IntegrationFlowAll(flowID int64, class int) (flowAllMap string) {
serverEsFlowInfo.NodeName = GetSetpName(5)
serverEsFlowInfo.State = 1
serverEsFlowInfo.Class = 1
serverEsFlowInfo.UserList = GetFlowNodeMan(flowID, class, 1)
serverEsFlowInfo.UserList = GetFlowNodeMan(flowID, class, 1, 2)
flowMap = append(flowMap, serverEsFlowInfo)
}
@ -1739,7 +1756,7 @@ func IntegrationFlowAll(flowID int64, class int) (flowAllMap string) {
twoFlowInfo.NodeName = GetSetpName(7)
twoFlowInfo.State = 1
twoFlowInfo.Class = 1
twoFlowInfo.UserList = GetFlowNodeMan(flowID, class, 5)
twoFlowInfo.UserList = GetFlowNodeMan(flowID, class, 5, 2)
flowMap = append(flowMap, twoFlowInfo)
}
flowAllMapByte, eer := json.Marshal(flowMap)
@ -1755,7 +1772,7 @@ func IntegrationFlowAll(flowID int64, class int) (flowAllMap string) {
@class 1定性2定量
@style 1测评人2测评人部门内勤3测评人部门负责人4被测评部门内勤5被测评部门负责人
*/
func GetFlowNodeMan(flowID int64, class, style int) (manInfo []UserListFlowAll) {
func GetFlowNodeMan(flowID int64, class, style, writeLog int) (manInfo []UserListFlowAll) {
var goDu FlowNodePeopleInfo
if class == 1 {
var scoreFlowCont assessmentmodel.ScoreFlow
@ -1901,11 +1918,13 @@ func GetFlowNodeMan(flowID int64, class, style int) (manInfo []UserListFlowAll)
returnUser.TemaName = temCont.Name
returnUser.Wechat = userCont.WechatId
if writeLog == 1 {
// oneFlowInfo?
var logListMap LogList
logListMap.State = 2
logListMap.TimeVal = GetToDayAll()
returnUser.LogList = append(returnUser.LogList, logListMap)
}
manInfo = append(manInfo, returnUser)
}

Loading…
Cancel
Save