17 changed files with 828 additions and 32 deletions
@ -0,0 +1,173 @@ |
|||||
|
package quan |
||||
|
|
||||
|
import ( |
||||
|
"fmt" |
||||
|
"strconv" |
||||
|
"strings" |
||||
|
"time" |
||||
|
|
||||
|
"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/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 (a *ApiGroup) Sanction(c *gin.Context) { |
||||
|
isTrue, userCont := commonus.ClientIdentity() |
||||
|
if isTrue != true { |
||||
|
response.Result(1001, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c) |
||||
|
return |
||||
|
} |
||||
|
founderDepartId, _ := strconv.ParseInt(userCont.Deparment, 10, 64) |
||||
|
founderUserKey, _ := strconv.ParseInt(userCont.Key, 10, 64) |
||||
|
|
||||
|
var requestData ApprovalParameters |
||||
|
err := c.ShouldBindJSON(&requestData) |
||||
|
if err != nil { |
||||
|
response.Result(101, err, "参数错误!请重新提交!", c) |
||||
|
return |
||||
|
} |
||||
|
if requestData.OrderId == "" { |
||||
|
response.Result(102, err, "参数错误!请重新提交!", c) |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
var evalProcessInfo assessmentmodel.EvaluationProcess |
||||
|
evalErr := global.GVA_DB_Performanceappraisal.Where("ep_order_key = ?", requestData.OrderId).First(&evalProcessInfo).Error |
||||
|
if evalErr != nil { |
||||
|
response.Result(103, err, "审批流不存在!请检查您的数据!", c) |
||||
|
return |
||||
|
} |
||||
|
if evalProcessInfo.State == 3 || evalProcessInfo.NextStep <= 0 { |
||||
|
response.Result(104, err, "该流程已结束!不可进行操作!", c) |
||||
|
return |
||||
|
} |
||||
|
if evalProcessInfo.NextContent == "" { |
||||
|
response.Result(105, err, "对不起!您没有权限对此流程进行操作!", c) |
||||
|
return |
||||
|
} |
||||
|
nextReplyUserMap := strings.Split(evalProcessInfo.NextExecutor, ",") |
||||
|
// fmt.Printf("userCont.Key:%v\n", userCont.Key)
|
||||
|
if commonus.IsItTrueString(userCont.Key, nextReplyUserMap) == false { |
||||
|
response.Result(106, nextReplyUserMap, "对不起!您没有权限对此流程进行操作!", c) |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
orderIdInt, _ := strconv.ParseInt(requestData.OrderId, 10, 64) //流程Key
|
||||
|
|
||||
|
var flowlogMap assessmentmodel.FlowLog |
||||
|
flmErr := global.GVA_DB_Performanceappraisal.Where("fl_key = ?", orderIdInt).First(&flowlogMap).Error |
||||
|
if flmErr != nil { |
||||
|
response.Result(103, err, "审批流不存在!请检查您的数据!", c) |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
if requestData.YesOrNo != 1 { |
||||
|
//驳回
|
||||
|
opinionCont := "驳回" |
||||
|
if requestData.Content != "" { |
||||
|
opinionCont = requestData.Content |
||||
|
} |
||||
|
commonus.StepAddData(orderIdInt, 16182159043990656, 0, 2, 2, 2, 2, userCont.Key) //审批步骤处理
|
||||
|
commonus.WriteReplyLog(orderIdInt, flowlogMap.DutyDepartment, founderDepartId, founderUserKey, 3, commonus.GetSetpName(2), opinionCont) //写入审批流
|
||||
|
//修改定性审批流状态
|
||||
|
eiteScoreFlow := commonus.MapOut() |
||||
|
eiteScoreFlow["fl_eite_time"] = time.Now().Unix() |
||||
|
eiteScoreFlow["fl_reply"] = 4 |
||||
|
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.FlowLog{}).Where("`fl_key` = ?", requestData.OrderId).Updates(&eiteScoreFlow) |
||||
|
|
||||
|
evalProcSaveData := commonus.MapOut() |
||||
|
evalProcSaveData["ep_state"] = 4 |
||||
|
evalProcSaveData["ep_time"] = time.Now().Unix() |
||||
|
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationProcess{}).Where("`ep_order_key` = ?", orderIdInt).Updates(&evalProcSaveData) |
||||
|
|
||||
|
//2.3、获取发起人信息
|
||||
|
var sendUser string = "" |
||||
|
// faQiRen, _ := commonus.GetWorkUser(strconv.FormatInt(scoreFlowInfo.EvaluationUser, 10))
|
||||
|
faQiRen, _ := commonus.GetNewHrPeopleInfo(map[string]interface{}{"`key`": flowlogMap.EvaluationUser}, "`wechat`", "`work_wechat`") |
||||
|
if faQiRen.Wechat != "" { |
||||
|
sendUser = faQiRen.Wechat |
||||
|
} |
||||
|
if faQiRen.WorkWechat != "" { |
||||
|
sendUser = faQiRen.WorkWechat |
||||
|
} |
||||
|
|
||||
|
registerNumber := commonus.GetFileNumberEs() |
||||
|
|
||||
|
title := fmt.Sprintf("%v-%v数据表", flowlogMap.Year, flowlogMap.Month) |
||||
|
desc := "" |
||||
|
mainTitleDesc := "数据详情:" |
||||
|
reason := "" |
||||
|
evalPlanIdAry := strings.Split(flowlogMap.EvaluationPlan, ",") |
||||
|
if len(evalPlanIdAry) > 0 { |
||||
|
var qeInfo []assessmentmodel.QualitativeEvaluation |
||||
|
judgeErr := global.GVA_DB_Performanceappraisal.Where("`qe_id` IN ?", evalPlanIdAry).First(&qeInfo).Error |
||||
|
if judgeErr == nil { |
||||
|
for _, qev := range qeInfo { |
||||
|
tarInfo, _ := commonus.GetTargetInfo(qev.Target) |
||||
|
reason = fmt.Sprintf("%\n%v :%v%v", reason, tarInfo.Title, flowlogMap.Score, qev.Unit) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//审批卡片跳转链接
|
||||
|
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v&num=%v", orderIdInt, strconv.FormatInt(registerNumber, 10)) |
||||
|
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/approvalList?id=%v&num=%v", orderIdInt, strconv.FormatInt(registerNumber, 10)) |
||||
|
|
||||
|
jumpUrlTitle := "请前往处理" |
||||
|
sourceDesc := "驳回" |
||||
|
twoLevelTitle := "审批信息:" |
||||
|
|
||||
|
twoLevelKeyName := "" |
||||
|
departmentId, _ := strconv.ParseInt(userCont.Deparment, 10, 64) |
||||
|
execDerpat, execDerpatErr := commonus.GetNewOrgCont(departmentId) |
||||
|
if execDerpatErr == nil { |
||||
|
twoLevelKeyName = execDerpat.Name |
||||
|
} |
||||
|
var twoLevelKeyValue string = "" |
||||
|
var twoLevelUserId string = "" |
||||
|
//获取操作人
|
||||
|
if userCont.Wechat != "" { |
||||
|
userWechatErr, userWechat := commonus.GetUesrContForWechatID(userCont.Wechat) |
||||
|
if userWechatErr == true { |
||||
|
twoLevelKeyValue = userWechat.Name |
||||
|
twoLevelUserId = userCont.Wechat |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
var sendTextMsg sendmessage.TextNoticeTemplateMedium |
||||
|
callbakcMsg, isTrueCall, callBackCont := sendTextMsg.SendMsgTextShare(sendUser, strconv.FormatInt(registerNumber, 10), title, desc, mainTitleDesc, reason, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, cardJumpUrl, jumpUrl, jumpUrlTitle, sourceDesc) |
||||
|
|
||||
|
outMap := commonus.MapOut() |
||||
|
outMap["callbakcMsg"] = string(callbakcMsg) |
||||
|
outMap["isTrueCall"] = isTrueCall |
||||
|
outMap["callBackCont"] = callBackCont |
||||
|
outMap["setval"] = 1 |
||||
|
outMap["sendUser"] = sendUser |
||||
|
|
||||
|
response.Result(0, outMap, "数据提交成功!", c) |
||||
|
|
||||
|
} else { |
||||
|
//同意
|
||||
|
opinionCont := "同意" |
||||
|
if requestData.Content != "" { |
||||
|
opinionCont = requestData.Content |
||||
|
} |
||||
|
commonus.StepAddData(orderIdInt, 16182159043990656, 0, 2, 2, 2, 2, userCont.Key) //审批步骤处理
|
||||
|
commonus.WriteReplyLog(orderIdInt, flowlogMap.DutyDepartment, founderDepartId, founderUserKey, 2, commonus.GetSetpName(2), opinionCont) //写入审批流
|
||||
|
//修改定性审批流状态
|
||||
|
eiteScoreFlow := commonus.MapOut() |
||||
|
eiteScoreFlow["fl_eite_time"] = time.Now().Unix() |
||||
|
eiteScoreFlow["fl_reply"] = 3 |
||||
|
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.FlowLog{}).Where("`fl_key` = ?", requestData.OrderId).Updates(&eiteScoreFlow) |
||||
|
response.Result(0, opinionCont, "数据提交成功!", c) |
||||
|
evalProcSaveData := commonus.MapOut() |
||||
|
evalProcSaveData["ep_state"] = 3 |
||||
|
evalProcSaveData["ep_time"] = time.Now().Unix() |
||||
|
global.GVA_DB_Performanceappraisal.Model(&assessmentmodel.EvaluationProcess{}).Where("`ep_order_key` = ?", orderIdInt).Updates(&evalProcSaveData) |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,332 @@ |
|||||
|
package quan |
||||
|
|
||||
|
import ( |
||||
|
"encoding/json" |
||||
|
"fmt" |
||||
|
"strconv" |
||||
|
"strings" |
||||
|
"time" |
||||
|
|
||||
|
"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/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 (a *ApiGroup) SendRationFlow(c *gin.Context) { |
||||
|
isTrue, userCont := commonus.ClientIdentity() |
||||
|
if isTrue != true { |
||||
|
response.Result(1001, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c) |
||||
|
return |
||||
|
} |
||||
|
userKey, userKeyErr := strconv.ParseInt(userCont.Key, 10, 64) |
||||
|
if userKeyErr != nil { |
||||
|
response.Result(102, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c) |
||||
|
return |
||||
|
} |
||||
|
departmentId, departmentIdErr := strconv.ParseInt(userCont.Deparment, 10, 64) |
||||
|
if departmentIdErr != nil { |
||||
|
response.Result(103, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c) |
||||
|
return |
||||
|
} |
||||
|
userGroup, userGroupErr := strconv.ParseInt(userCont.Company, 10, 64) |
||||
|
if userGroupErr != nil { |
||||
|
response.Result(104, isTrue, "您的身份令牌已经失效!请重新登录获取身份令牌!", c) |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
todaying := commonus.ComputingTime(time.Now().Unix(), 5) |
||||
|
|
||||
|
if todaying > 10 { |
||||
|
// response.Result(1051, todaying, "不在可提交数据提时间期限内!不可提交数据。请每月10号前提交数据!。", c)
|
||||
|
// return
|
||||
|
} |
||||
|
|
||||
|
var requestData AddRationFlowLog |
||||
|
err := c.ShouldBindJSON(&requestData) |
||||
|
if err != nil { |
||||
|
response.Result(105, err, "数据获取失败!", c) |
||||
|
return |
||||
|
} |
||||
|
if requestData.GroupId == "" { |
||||
|
response.Result(106, err, "数据异常!", c) |
||||
|
return |
||||
|
} |
||||
|
if requestData.DepartmentID == "" { |
||||
|
response.Result(107, err, "数据异常!", c) |
||||
|
return |
||||
|
} |
||||
|
if len(requestData.List) < 1 { |
||||
|
response.Result(108, err, "没有要考核的项目", c) |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
//判断是否已经添加的条件
|
||||
|
existenceProess := commonus.MapOut() |
||||
|
existenceProess["fl_planversion"] = requestData.PlanVersionNumber |
||||
|
|
||||
|
operationTime := time.Now().Unix() |
||||
|
keyNumber := commonus.GetFileNumberEs() |
||||
|
var flowLog assessmentmodel.FlowLog |
||||
|
|
||||
|
flowLog.Key = keyNumber |
||||
|
flowLog.Time = time.Now().Unix() |
||||
|
flowLog.EiteTime = time.Now().Unix() |
||||
|
flowLog.PlanVersion = requestData.PlanVersionNumber |
||||
|
if requestData.Addtime != "" { |
||||
|
timeOccurrence := commonus.DateToTimeStamp(requestData.Addtime) //发生时间
|
||||
|
flowLog.Year = commonus.ComputingTime(timeOccurrence, 1) |
||||
|
flowLog.Quarter = commonus.ComputingTime(timeOccurrence, 2) |
||||
|
flowLog.Month = commonus.ComputingTime(timeOccurrence, 3) |
||||
|
flowLog.Week = commonus.ComputingTime(timeOccurrence, 4) |
||||
|
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 { |
||||
|
lastMonth, _, _ := commonus.GetLastMonth() |
||||
|
|
||||
|
lastMonthInt, lastMonthErr := commonus.DateToTimeStampEs(fmt.Sprintf("%v-10 12:00:00", lastMonth)) |
||||
|
if lastMonthErr == true { |
||||
|
operationTime = lastMonthInt |
||||
|
} |
||||
|
flowLog.Year = commonus.ComputingTime(operationTime, 1) |
||||
|
flowLog.Quarter = commonus.ComputingTime(operationTime, 2) |
||||
|
flowLog.Month = commonus.ComputingTime(operationTime, 3) |
||||
|
flowLog.Week = commonus.ComputingTime(operationTime, 4) |
||||
|
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.EvaluationUser = userKey |
||||
|
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) |
||||
|
if dutyGroupErr == nil { |
||||
|
flowLog.DutyGroup = dutyGroup |
||||
|
existenceProess["fl_duty_group"] = dutyGroup |
||||
|
} |
||||
|
departIdInt, departIdIntErr := strconv.ParseInt(requestData.DepartmentID, 10, 64) |
||||
|
if departIdIntErr == nil { |
||||
|
flowLog.DutyDepartment = departIdInt |
||||
|
existenceProess["fl_duty_department"] = departIdInt |
||||
|
} |
||||
|
flowLog.Reply = 2 |
||||
|
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 reason string |
||||
|
var evaluationPlan []string //方案ID
|
||||
|
var yiTianJianMingc []string |
||||
|
// jsonMapStr, _ := json.Marshal(requestData.List)
|
||||
|
json.Marshal(requestData.List) |
||||
|
//fmt.Printf("OutJsonMap-----1------>%\n", string(jsonMapStr))
|
||||
|
for i, v := range requestData.List { |
||||
|
|
||||
|
if len(evaluationIdStrAry) > 0 { |
||||
|
if commonus.IsItTrueString(v.Id, evaluationIdStrAry) == false { |
||||
|
var flowDataLog assessmentmodel.FlowLogData |
||||
|
evaluationPlan = append(evaluationPlan, v.Id) |
||||
|
evaluationPlanid, evaluationPlanidErr := strconv.ParseInt(v.Id, 10, 64) |
||||
|
if evaluationPlanidErr == nil { |
||||
|
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 = 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 { |
||||
|
var flowDataLog assessmentmodel.FlowLogData |
||||
|
evaluationPlan = append(evaluationPlan, v.Id) |
||||
|
evaluationPlanid, evaluationPlanidErr := strconv.ParseInt(v.Id, 10, 64) |
||||
|
if evaluationPlanidErr == nil { |
||||
|
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) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
gromDb := global.GVA_DB_Performanceappraisal.Begin() |
||||
|
|
||||
|
flowLog.EvaluationPlan = strings.Join(evaluationPlan, ",") |
||||
|
if len(flowDataLogAry) <= 0 { |
||||
|
response.Result(0, yiTianJianMingc, "您的数据已经提交!请不要重复提交!", c) |
||||
|
return |
||||
|
} |
||||
|
addFlowLogErr := gromDb.Create(&flowLog).Error |
||||
|
addFlowLogDataErr := gromDb.Create(&flowDataLogAry).Error |
||||
|
if addFlowLogErr == nil && addFlowLogDataErr == nil { |
||||
|
affairDbErr := gromDb.Commit().Error |
||||
|
if affairDbErr == nil { |
||||
|
commonus.StepAddData(keyNumber, 16182159043990656, 2, 7, 2, 2, 1, userCont.Key) |
||||
|
commonus.WriteReplyLog(keyNumber, departIdInt, departmentId, userKey, 1, commonus.GetSetpName(1), "提交申请") |
||||
|
sendUserIsTrue, sendUserList := commonus.GetSendMsgUser(16182159043990656, departIdInt) //获取对应部门负责人
|
||||
|
if sendUserIsTrue != true { |
||||
|
response.Result(0, sendUserList, "未指定相关部门处理人!未能向相关人员发送考核项目!请手动发起!", c) |
||||
|
return |
||||
|
} |
||||
|
|
||||
|
title := fmt.Sprintf("%v数据表", commonus.TimeStampToDate(operationTime, 10)) |
||||
|
desc := "" |
||||
|
mainTitleDesc := "数据详情:" |
||||
|
//将步骤写入 判断该步骤是否已经操作
|
||||
|
registerNumber := commonus.GetFileNumberEs() |
||||
|
var registerContIng assessmentmodel.Register |
||||
|
registerContIng.Number = registerNumber |
||||
|
registerContIng.State = 1 |
||||
|
registerContIng.Time = time.Now().Unix() |
||||
|
registerContIng.AddCont() |
||||
|
//审批卡片跳转链接
|
||||
|
cardJumpUrl := fmt.Sprintf("http://new.hxgk.group/#/quantitativeList?id=%v&num=%v", keyNumber, strconv.FormatInt(registerNumber, 10)) |
||||
|
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/quantitativeList?id=%v&num=%v", keyNumber, strconv.FormatInt(registerNumber, 10)) |
||||
|
|
||||
|
jumpUrlTitle := "请前往处理" |
||||
|
sourceDesc := "审批" |
||||
|
twoLevelTitle := "审批信息:" |
||||
|
|
||||
|
twoLevelKeyName := "" |
||||
|
execDerpat, execDerpatErr := commonus.GetNewOrgCont(departmentId) |
||||
|
if execDerpatErr == nil { |
||||
|
twoLevelKeyName = execDerpat.Name |
||||
|
} |
||||
|
var twoLevelKeyValue string = "" |
||||
|
var twoLevelUserId string = "" |
||||
|
//获取操作人
|
||||
|
if userCont.Wechat != "" { |
||||
|
userWechatErr, userWechat := commonus.GetUesrContForWechatID(userCont.Wechat) |
||||
|
if userWechatErr == true { |
||||
|
twoLevelKeyValue = userWechat.Name |
||||
|
twoLevelUserId = userCont.Wechat |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
var sendTextMsg sendmessage.TextNoticeTemplateMedium |
||||
|
callbakcMsg, isTrueCall, callBackCont := sendTextMsg.SendMsgTextShare(sendUserList, strconv.FormatInt(registerNumber, 10), title, desc, mainTitleDesc, reason, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, cardJumpUrl, jumpUrl, jumpUrlTitle, sourceDesc) |
||||
|
|
||||
|
//发送文本信息通用
|
||||
|
/*SendMsgTextShare(sendUserList, taskId, title, desc, quoteAreaTitle, quoteAreaContent, twoLevelTitle, twoLevelKeyName, twoLevelKeyValue, twoLevelUserId, cardJumpUrl, jumpUrl, jumpUrlTitle, sourceDesc string) (callbakcMsg []byte, isTrueCall bool, callBackCont string) |
||||
|
@sendUserList 信息接收人 |
||||
|
@taskId 任务id,同一个应用任务id不能重复,只能由数字、字母和“_-@”组成,最长128字节,填了action_menu字段的话本字段必填 |
||||
|
@Title 一级标题,建议不超过36个字, |
||||
|
@Desc 标题辅助信息,建议不超过44个字 |
||||
|
@quoteAreaTitle 引用文献标题 |
||||
|
@quoteAreaContent 引用文献内容 |
||||
|
@twoLevelTitle 二级文本标题 |
||||
|
@twoLevelKeyName 二级标题,建议不超过5个字 |
||||
|
@twoLevelValue 二级文本,如果horizontal_content_list.type是2,该字段代表文件名称(要包含文件类型),建议不超过30个字, |
||||
|
@twoLevelUserId 成员详情的userid,horizontal_content_list.type是3时必填 |
||||
|
@cardJumpUrl 整体卡片跳转链接 |
||||
|
@jumpUrl 底部标题跳转链接 |
||||
|
@jumpUrlTitle 跳转链接文案 |
||||
|
@sourceDesc 左上角标题 |
||||
|
*/ |
||||
|
|
||||
|
outMap := commonus.MapOut() |
||||
|
outMap["callbakcMsg"] = string(callbakcMsg) |
||||
|
outMap["isTrueCall"] = isTrueCall |
||||
|
outMap["callBackCont"] = callBackCont |
||||
|
outMap["setval"] = 1 |
||||
|
|
||||
|
response.Result(0, outMap, "数据提交成功!", c) |
||||
|
} else { |
||||
|
gromDb.Rollback() |
||||
|
response.Result(118, yiTianJianMingc, "数据提交失败!", c) |
||||
|
} |
||||
|
} else { |
||||
|
affairDbErr := gromDb.Rollback().Error |
||||
|
if affairDbErr == nil { |
||||
|
response.Result(119, yiTianJianMingc, "数据提交失败!", c) |
||||
|
} else { |
||||
|
response.Result(120, yiTianJianMingc, "数据提交失败!", c) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue