Browse Source

手机端V1.0开发完成

v1_dev_2
超级管理员 3 years ago
parent
commit
b1b9d35cd9
  1. 4
      api/version1/entry.go
  2. 602
      api/version1/postseting/postweb/appflowlog.go
  3. 5
      api/version1/postseting/postweb/postration.go
  4. 22
      api/version1/postseting/postweb/posttarget.go
  5. 87
      api/version1/postseting/postweb/type.go
  6. 29
      api/version1/systemapproval/entry.go
  7. 1022
      api/version1/systemapproval/post_nature.go
  8. 2
      apirouter/entry.go
  9. 20
      apirouter/v1/approvalsystem/approval_route.go
  10. 4
      apirouter/v1/approvalsystem/type.go
  11. 5
      apirouter/v1/postseting/web.go
  12. 1
      config/configApp/server.go
  13. 3
      initialization/route/initRoute.go
  14. 52
      middleware/wechatapp/wechatcallback/event_processing.go
  15. 2
      middleware/wechatapp/wechatcallback/type.go
  16. 2
      middleware/wechatapp/wechatsendmsg/type.go
  17. 17
      models/modelskpi/open_approval_change_log.go
  18. 1
      overall/publicmethod/type.go

4
api/version1/entry.go

@ -10,6 +10,7 @@ import (
"key_performance_indicators/api/version1/jurisdiction/jurisdictionpc" "key_performance_indicators/api/version1/jurisdiction/jurisdictionpc"
"key_performance_indicators/api/version1/postseting/postpc" "key_performance_indicators/api/version1/postseting/postpc"
"key_performance_indicators/api/version1/postseting/postweb" "key_performance_indicators/api/version1/postseting/postweb"
"key_performance_indicators/api/version1/systemapproval"
) )
type ApiEntry struct { type ApiEntry struct {
@ -21,7 +22,8 @@ type ApiEntry struct {
BookImg bookimg.ApiMethod //图文信息管理 BookImg bookimg.ApiMethod //图文信息管理
JurisdictionpcApi jurisdictionpc.ApiMethod //权限模块PC端 JurisdictionpcApi jurisdictionpc.ApiMethod //权限模块PC端
EmpowerApi empower.ApiMethod //系统授权 EmpowerApi empower.ApiMethod //系统授权
WorkFlowChat flowchart.ApiMethod WorkFlowChat flowchart.ApiMethod //工作流
SystemAppExamine systemapproval.ApiMethod //系统审批处理
} }
var AppApiEntry = new(ApiEntry) var AppApiEntry = new(ApiEntry)

602
api/version1/postseting/postweb/appflowlog.go

@ -1,7 +1,10 @@
package postweb package postweb
import ( import (
"encoding/json"
"fmt"
"key_performance_indicators/middleware/wechatapp/wechatcallback" "key_performance_indicators/middleware/wechatapp/wechatcallback"
"key_performance_indicators/models/modelshr"
"key_performance_indicators/models/modelskpi" "key_performance_indicators/models/modelskpi"
"key_performance_indicators/overall" "key_performance_indicators/overall"
"key_performance_indicators/overall/publicmethod" "key_performance_indicators/overall/publicmethod"
@ -39,10 +42,10 @@ func (a *ApiMethod) GetPostFlowLog(c *gin.Context) {
if receivedValue.Title != "" { if receivedValue.Title != "" {
gormDb = gormDb.Where("`pt_title` LIKE ? OR `pst_title` LIKE ? OR `ptd_title` LIKE ?", "%"+receivedValue.Title+"%", "%"+receivedValue.Title+"%", "%"+receivedValue.Title+"%") gormDb = gormDb.Where("`pt_title` LIKE ? OR `pst_title` LIKE ? OR `ptd_title` LIKE ?", "%"+receivedValue.Title+"%", "%"+receivedValue.Title+"%", "%"+receivedValue.Title+"%")
} }
if receivedValue.OrgId != "" { if receivedValue.OrgId != 0 {
gormDb = gormDb.Where("`org_id` = ?", receivedValue.OrgId) gormDb = gormDb.Where("`org_id` = ?", receivedValue.OrgId)
} }
if receivedValue.PostId != "" { if receivedValue.PostId != 0 {
gormDb = gormDb.Where("`post_id` = ?", receivedValue.PostId) gormDb = gormDb.Where("`post_id` = ?", receivedValue.PostId)
} }
if receivedValue.DayTime != "" { if receivedValue.DayTime != "" {
@ -60,8 +63,8 @@ func (a *ApiMethod) GetPostFlowLog(c *gin.Context) {
if receivedValue.ApprovalState == 2 { if receivedValue.ApprovalState == 2 {
gormDb = gormDb.Where("FIND_IN_SET(?,`next_executor`)", context.Key) gormDb = gormDb.Where("FIND_IN_SET(?,`next_executor`)", context.Key)
} }
gormDb = publicmethod.PageTurningSettings(gormDb, receivedValue.Page, receivedValue.PageSize)
err := gormDb.Order("`id` DESC").Find(&flowLogList).Error err := gormDb.Order("`state` ASC").Order("`id` DESC").Find(&flowLogList).Error
var total int64 var total int64
totalErr := gormDb.Count(&total).Error totalErr := gormDb.Count(&total).Error
if totalErr != nil { if totalErr != nil {
@ -88,20 +91,20 @@ func (a *ApiMethod) GetPostFlowLog(c *gin.Context) {
sendCont.Result = "起草" //审批结果 sendCont.Result = "起草" //审批结果
sendCont.Statetype = 1 //审批状态 sendCont.Statetype = 1 //审批状态
case 2: case 2:
sendCont.Result = "驳回"
sendCont.Statetype = 4
case 3:
sendCont.Result = "审批中" sendCont.Result = "审批中"
sendCont.Statetype = 0 sendCont.Statetype = 0
case 3:
sendCont.Result = "驳回"
sendCont.Statetype = 4
case 4: case 4:
sendCont.Result = "归档" sendCont.Result = "归档"
sendCont.Statetype = 1 sendCont.Statetype = 3
case 5: case 5:
sendCont.Result = "废弃" sendCont.Result = "废弃"
sendCont.Statetype = 1 sendCont.Statetype = 3
case 6: case 6:
sendCont.Result = "删除" sendCont.Result = "删除"
sendCont.Statetype = 1 sendCont.Statetype = 3
default: default:
sendCont.Result = "审批中" sendCont.Result = "审批中"
sendCont.Statetype = 0 sendCont.Statetype = 0
@ -128,9 +131,586 @@ func (a *ApiMethod) GetPostFlowLog(c *gin.Context) {
_, flowCont, _ := wechatcallback.GetOneNodeCont(v.WorkFlow, v.Step) _, flowCont, _ := wechatcallback.GetOneNodeCont(v.WorkFlow, v.Step)
sendCont.Node = flowCont.NodeName //当前节点 sendCont.Node = flowCont.NodeName //当前节点
} }
sendCont.Class = v.Class
sendCont.MonthDays = publicmethod.UnixTimeToDay(v.StartTime, 22) //提报日期 sendCont.MonthDays = publicmethod.UnixTimeToDay(v.StartTime, 22) //提报日期
sendData = append(sendData, sendCont) sendData = append(sendData, sendCont)
} }
publicmethod.ResultList(0, receivedValue.Page, receivedValue.PageSize, total, int64(len(sendData)), sendData, c) publicmethod.ResultList(0, receivedValue.Page, receivedValue.PageSize, total, int64(len(sendData)), sendData, c)
} }
/*
*
@ 作者: 秦东
@ 时间: 2022-10-27 16:43:56
@ 功能:获取审批流详情
@ 参数
#
@ 返回值
#
*/
func (a *ApiMethod) LookFlowMap(c *gin.Context) {
var receivedValue LookFlowInfo
err := c.ShouldBindJSON(&receivedValue)
if err != nil {
publicmethod.Result(100, err, c)
return
}
if receivedValue.Id == "" {
publicmethod.Result(101, receivedValue, c)
return
}
if receivedValue.Class == 0 {
receivedValue.Class = 1
}
//获取登录人信息
context, _ := publicmethod.LoginMyCont(c)
//获取审批流相关内容
var getFlowCont GetFlowLogCont
syncSeting.Add(1)
go getFlowCont.ReadMainFlowLog(receivedValue.Id) //获取审批主表
if receivedValue.Class == 1 {
//定性
syncSeting.Add(1)
go getFlowCont.ReadNatureFlowLog(receivedValue.Id) //获取审批主表
syncSeting.Wait()
mainFlowLog, natureFlowList, _ := getFlowCont.readDataLock() //读取线程通道数据
var sendDataCont SendPostDingXing
sendDataCont.OrderId = strconv.FormatInt(mainFlowLog.OrderId, 10)
sendDataCont.Title = GetNatureFlowTitle(mainFlowLog.Executor, mainFlowLog.DepartmentId, mainFlowLog.PostId, mainFlowLog.PersonLiable, mainFlowLog.Target, mainFlowLog.HappenTime, 1)
sendDataCont.FlowMapAll, _, _ = wechatcallback.GetOneNodeCont(mainFlowLog.WorkFlow, mainFlowLog.Step)
for _, v := range natureFlowList {
sendDataCont.List = append(sendDataCont.List, AnalysisDingXing(v))
}
sendDataCont.Isset = 1
var zhiXingRen []string
//判断当前人是否要审批
if mainFlowLog.NextStep > 1 {
if mainFlowLog.NextExecutor != "" {
err = json.Unmarshal([]byte(mainFlowLog.NextExecutor), &zhiXingRen)
if err == nil {
dangQianRen := strconv.FormatInt(context.Key, 10)
if publicmethod.IsInTrue[string](dangQianRen, zhiXingRen) == true {
sendDataCont.Isset = 2
}
}
}
}
//获取步进值
var oacl modelskpi.OpenApprovalChangeLog
clickStep, stepErr := oacl.GetMAx(mainFlowLog.OrderId, zhiXingRen)
if stepErr != nil {
sendDataCont.Stepper = 1
} else {
sendDataCont.Stepper = clickStep + 1
}
if mainFlowLog.EnclosureFormat != "" {
json.Unmarshal([]byte(mainFlowLog.EnclosureFormat), &sendDataCont.Enclosure)
}
publicmethod.Result(0, sendDataCont, c) //输出
} else {
//定量
syncSeting.Add(1)
go getFlowCont.ReadMeterMainFlowLog(receivedValue.Id) //获取审批主表
syncSeting.Wait()
mainFlowLog, _, meterFlowList := getFlowCont.readDataLock() //读取线程通道数据
var sendDataCont SendPostDingLiang
sendDataCont.OrderId = strconv.FormatInt(mainFlowLog.OrderId, 10)
sendDataCont.Title = GetNatureFlowTitle(mainFlowLog.Executor, mainFlowLog.DepartmentId, mainFlowLog.PostId, mainFlowLog.PersonLiable, mainFlowLog.Target, mainFlowLog.HappenTime, 2)
sendDataCont.FlowMapAll, _, _ = wechatcallback.GetOneNodeCont(mainFlowLog.WorkFlow, mainFlowLog.Step)
sendDataCont.Isset = 1
//判断当前人是否要审批
var zhiXingRen []string
if mainFlowLog.NextStep > 1 {
if mainFlowLog.NextExecutor != "" {
err = json.Unmarshal([]byte(mainFlowLog.NextExecutor), &zhiXingRen)
if err == nil {
dangQianRen := strconv.FormatInt(context.Key, 10)
if publicmethod.IsInTrue[string](dangQianRen, zhiXingRen) == true {
sendDataCont.Isset = 2
}
}
}
}
//获取步进值
var oacl modelskpi.OpenApprovalChangeLog
clickStep, stepErr := oacl.GetMAx(mainFlowLog.OrderId, zhiXingRen)
if stepErr != nil {
sendDataCont.Stepper = 1
} else {
sendDataCont.Stepper = clickStep + 1
}
if mainFlowLog.EnclosureFormat != "" {
json.Unmarshal([]byte(mainFlowLog.EnclosureFormat), &sendDataCont.Enclosure)
}
for _, v := range meterFlowList {
sendDataCont.List = append(sendDataCont.List, AnalysisDingLiang(v))
}
publicmethod.Result(0, sendDataCont, c) //输出
}
}
/*
*
@ 作者: 秦东
@ 时间: 2022-10-28 14:37:27
@ 功能: 解析定量输出结构体
@ 参数
#
@ 返回值
#
*/
func AnalysisDingLiang(natureCont modelskpi.PostMeteringFlow) (sendData DingLiangList) {
//获取指标
var targetCont modelskpi.PostTarget
targetCont.GetCont(map[string]interface{}{"`id`": natureCont.Target}, "`title`")
sendData.Title = targetCont.Title
sendData.Target = targetCont.Title
sendData.Content = natureCont.Reason
//解析考核基准线
var jinZhunXian baseLineType
err := json.Unmarshal([]byte(natureCont.Baseline), &jinZhunXian)
if err == nil {
sendData.ZeroPrize = publicmethod.DecimalEs(jinZhunXian.Zeroprize, 2) //零奖值
sendData.AllPrize = publicmethod.DecimalEs(jinZhunXian.Allprize, 2) //全奖值
sendData.CappingVal = jinZhunXian.Capping //封顶值
}
var shemeCont modelskpi.QualitativeEvaluationScheme
err = shemeCont.GetCont(map[string]interface{}{"`id`": natureCont.ShemeId})
//获取指标分
var departDimPostWeight modelskpi.DepartDimePostWeight
where := publicmethod.MapOut[string]()
where["`orgid`"] = shemeCont.OrgId
where["`postid`"] = shemeCont.PostId
where["`dimension`"] = shemeCont.DimensionId
where["`hierarchy`"] = 1
where["`is_quote`"] = shemeCont.Source
where["`target`"] = shemeCont.TargetId
departDimPostWeight.GetCont(where, "`weight`")
sendData.Weight = departDimPostWeight.Weight / 100
sendData.Score = natureCont.Score
sendData.Achievement, sendData.Actual = GetAchieAndActual(natureCont.Score, departDimPostWeight.Weight, sendData.ZeroPrize, sendData.AllPrize, sendData.CappingVal)
fmt.Printf("jinZhunXian----->%v\n", jinZhunXian)
return
}
/*
*
@ 作者: 秦东
@ 时间: 2022-10-28 15:09:33
@ 功能: 计算达成率及得分
@ 参数
#score 实际分
#weight 指标权重
#zeroprize 零奖值
#allprize 全奖值
#cappingval 封顶值
@ 返回值
#achievement 达成率
#actual 得分
*/
func GetAchieAndActual(score, weight, zeroprize, allprize, cappingval float64) (achievement, actual float64) {
if zeroprize == 0 && allprize == 0 { //当全奖值与零奖值都为空时
if score != 0 { //判断实际值是否不为0
actual = weight
achievement = 100
}
} else {
if allprize > zeroprize { //当全奖值大于零奖值时 正向计算
if score <= zeroprize { //实际数值小于零奖值时达成率与得分都为零
actual = 0
achievement = 0
} else {
chuShu := score - zeroprize
beiChushu := allprize - zeroprize
if beiChushu != 0 { //判断除数不能为零
daChengLv := chuShu / beiChushu
achievement = publicmethod.DecimalEs(daChengLv, 3)
if daChengLv*100 >= cappingval { //达成率大于等于封顶值
if cappingval > 0 {
deFen := (weight / 100) * (cappingval / 100)
actual = publicmethod.DecimalEs(deFen, 2)
} else {
actual = weight
}
} else {
deFen := (weight / 100) * (daChengLv / 100)
actual = publicmethod.DecimalEs(deFen, 2)
}
} else {
actual = 0
achievement = 0
}
}
} else { //如果全奖值小于零奖值 执行一下操作
if score >= zeroprize { //实际结算值大于零奖值 那么达成率和实际得分都是0
actual = 0
achievement = 0
} else {
chuShu := score - zeroprize
beiChushu := allprize - zeroprize
if beiChushu != 0 { //判断除数不能为零
daChengLv := chuShu / beiChushu
achievement = publicmethod.DecimalEs(daChengLv, 3)
if daChengLv < 0 {
actual = 0
achievement = 0
} else {
if daChengLv*100 >= cappingval { //达成率大于等于封顶值
if cappingval > 0 {
deFen := (weight / 100) * (cappingval / 100)
actual = publicmethod.DecimalEs(deFen, 2)
} else {
actual = weight
}
} else {
deFen := (weight / 100) * (daChengLv / 100)
actual = publicmethod.DecimalEs(deFen, 2)
}
}
} else {
actual = 0
achievement = 0
}
}
}
}
return
}
/*
*
@ 作者: 秦东
@ 时间: 2022-10-28 11:06:45
@ 功能: 解析定性输出结构体
@ 参数
#natureCont 定性考核数据
@ 返回值
#sendData 展示数据
*/
func AnalysisDingXing(natureCont modelskpi.PostNatureFlow) (sendData DingXingList) {
var dimCont modelskpi.DutyClass
dimCont.GetCont(map[string]interface{}{"`id`": natureCont.Dimension}, "`title`")
//获取指标
var targetCont modelskpi.PostTarget
targetCont.GetCont(map[string]interface{}{"`id`": natureCont.Target}, "`title`")
//获取指标子栏目
var sunTargetCont modelskpi.PostSonTarget
sunTargetCont.GetCont(map[string]interface{}{"`id`": natureCont.SonTarget}, "`title`")
var detailsCont modelskpi.PostTargetDetails
detailsCont.GetCont(map[string]interface{}{"`id`": natureCont.Detailed}, "`title`", "`min_score`", "`max_score`", "`maxmoney`", "`minmoney`", "`punishmode`", "`company`")
sendData.Dimension = dimCont.Title //维度
sendData.Target = targetCont.Title //考核指标
sendData.Targetsun = sunTargetCont.Title //考核项目
sendData.Detailedtargent = detailsCont.Title //考核内容
var scoreStr string
if detailsCont.MinScore != 0 {
if detailsCont.MaxScore != 0 {
scoreStr = fmt.Sprintf("%v-%v%v", publicmethod.DecimalEs(float64(detailsCont.MinScore)/100, 2), publicmethod.DecimalEs(float64(detailsCont.MaxScore/100), 2), detailsCont.Company)
} else {
scoreStr = fmt.Sprintf("%v%v", publicmethod.DecimalEs(float64(detailsCont.MinScore/100), 2), detailsCont.Company)
}
} else {
if detailsCont.MaxScore != 0 {
scoreStr = fmt.Sprintf("%v%v", publicmethod.DecimalEs(float64(detailsCont.MaxScore/100), 2), detailsCont.Company)
}
}
sendData.Standard = scoreStr //考核标准(分)
var moneyStr string
if detailsCont.Minmoney != 0 {
if detailsCont.Maxmoney != 0 {
moneyStr = fmt.Sprintf("%v-%v元", publicmethod.DecimalEs(float64(detailsCont.Minmoney/100), 2), publicmethod.DecimalEs(float64(detailsCont.Maxmoney/100), 2))
} else {
moneyStr = fmt.Sprintf("%v元", publicmethod.DecimalEs(float64(detailsCont.Minmoney/100), 2))
}
} else {
if detailsCont.Maxmoney != 0 {
moneyStr = fmt.Sprintf("%v元", publicmethod.DecimalEs(float64(detailsCont.Maxmoney/100), 2))
}
}
sendData.StandardMoney = moneyStr //考核标准(钱)
addOrDec := "扣除"
if natureCont.AddOrDecrease == 1 {
addOrDec = "奖励"
}
sendData.Lanmuname = addOrDec //奖励OR扣除
sendData.ScoreVal = publicmethod.DecimalEs(natureCont.Score/100, 2) * float64(natureCont.HappenCount) //奖励或扣除的分数
sendData.MoneyVal = publicmethod.DecimalEs(natureCont.Money/100, 2) * float64(natureCont.HappenCountMoney) //奖励或扣除的钱
sendData.Reason = natureCont.Reason //考核原因
sendData.Unit = detailsCont.Company
return
}
/*
*
@ 作者: 秦东
@ 时间: 2022-10-28 10:44:57
@ 功能: 获取定性审批标题
@ 参数
#executor 执行人
#orgId 被执行人行政组织
#postId 被执行人岗位
#personLiable 被执行人KEY
#target 指标
#class 1定性,2:定量
@ 返回值
#
*/
func GetNatureFlowTitle(executor, orgId, postId, personLiable, target, happenTime int64, class int) (title string) {
//获取执行人
var exeUser modelshr.PersonArchives
exeUser.GetCont(map[string]interface{}{"`key`": executor}, "`name`")
//获取被执行人信息
var perUserCont modelshr.PersonArchives
perUserCont.GetCont(map[string]interface{}{"`key`": personLiable}, "`name`")
var orgCont modelshr.AdministrativeOrganization
orgCont.GetCont(map[string]interface{}{"`id`": orgId}, "`name`")
var postCont modelshr.Position
postCont.GetCont(map[string]interface{}{"`id`": postId}, "`name`")
//获取指标
var targetCont modelskpi.PostTarget
targetCont.GetCont(map[string]interface{}{"`id`": target}, "`title`")
timeStr := publicmethod.UnixTimeToDay(happenTime, 14)
if class != 1 {
timeStr = publicmethod.UnixTimeToDay(happenTime, 15)
}
title = fmt.Sprintf("%v提交\n%v%v%v\n%v考核数据", exeUser.Name, orgCont.Name, postCont.Name, perUserCont.Name, timeStr)
return
}
/*
*
@ 作者: 秦东
@ 时间: 2022-10-27 17:03:13
@ 功能: 读取审批流主表
@ 参数
#orderId 订单ID
@ 返回值
#
*/
func (g *GetFlowLogCont) ReadMainFlowLog(orderId string) {
g.mutext.Lock()
defer g.mutext.Unlock()
var flowLogCont modelskpi.PostWorkflowOrders
err := flowLogCont.GetCont(map[string]interface{}{`order_id`: orderId})
if err == nil {
g.FlowCont = flowLogCont
}
syncSeting.Done()
}
/*
*
@ 作者: 秦东
@ 时间: 2022-10-28 08:10:31
@ 功能: 定性考核数据
@ 参数
#orderId 订单ID
@ 返回值
#
*/
func (g *GetFlowLogCont) ReadNatureFlowLog(orderId string) {
g.mutext.Lock()
defer g.mutext.Unlock()
var flowLogCont []modelskpi.PostNatureFlow
err := overall.CONSTANT_DB_KPI.Model(&modelskpi.PostNatureFlow{}).Where("`order_id` = ?", orderId).Find(&flowLogCont).Error
if err == nil {
g.NatureFlow = flowLogCont
}
syncSeting.Done()
}
/*
*
@ 作者: 秦东
@ 时间: 2022-10-28 08:10:31
@ 功能: 定量考核数据
@ 参数
#orderId 订单ID
@ 返回值
#
*/
func (g *GetFlowLogCont) ReadMeterMainFlowLog(orderId string) {
g.mutext.Lock()
defer g.mutext.Unlock()
var flowLogCont []modelskpi.PostMeteringFlow
err := overall.CONSTANT_DB_KPI.Model(&modelskpi.PostMeteringFlow{}).Where("`order_id` = ?", orderId).Find(&flowLogCont).Error
if err == nil {
g.MeterFlow = flowLogCont
}
syncSeting.Done()
}
/*
*
@ 作者: 秦东
@ 时间: 2022-10-27 16:43:56
@ 功能:获取审批流详情-->整改措施专用岗位
@ 参数
#
@ 返回值
#
*/
func (a *ApiMethod) LookFlowMapCorra(c *gin.Context) {
var receivedValue LookFlowInfoCorra
err := c.ShouldBindJSON(&receivedValue)
if err != nil {
publicmethod.Result(100, err, c)
return
}
if receivedValue.Id == "" {
publicmethod.Result(101, receivedValue, c)
return
}
if receivedValue.Class == 0 {
receivedValue.Class = 1
}
//获取登录人信息
context, _ := publicmethod.LoginMyCont(c)
//获取审批流相关内容
var getFlowCont GetFlowLogCont
syncSeting.Add(1)
go getFlowCont.ReadMainFlowLog(receivedValue.Id) //获取审批主表
if receivedValue.Class == 1 {
//定性
syncSeting.Add(1)
go getFlowCont.ReadNatureFlowLog(receivedValue.Id) //获取审批主表
syncSeting.Wait()
mainFlowLog, natureFlowList, _ := getFlowCont.readDataLock() //读取线程通道数据
var sendDataCont SendPostDingXing
sendDataCont.OrderId = strconv.FormatInt(mainFlowLog.OrderId, 10)
sendDataCont.Title = GetNatureFlowTitle(mainFlowLog.Executor, mainFlowLog.DepartmentId, mainFlowLog.PostId, mainFlowLog.PersonLiable, mainFlowLog.Target, mainFlowLog.HappenTime, 1)
sendDataCont.FlowMapAll, _, _ = wechatcallback.GetOneNodeCont(mainFlowLog.WorkFlow, mainFlowLog.Step)
for _, v := range natureFlowList {
sendDataCont.List = append(sendDataCont.List, AnalysisDingXing(v))
}
sendDataCont.Isset = 1
var zhiXingRen []string
//判断当前人是否要审批
if mainFlowLog.NextStep > 1 {
if mainFlowLog.NextExecutor != "" {
err = json.Unmarshal([]byte(mainFlowLog.NextExecutor), &zhiXingRen)
if err == nil {
dangQianRen := strconv.FormatInt(context.Key, 10)
if publicmethod.IsInTrue[string](dangQianRen, zhiXingRen) == true {
// sendDataCont.Isset = 2
}
}
}
}
//获取挂号信息
//判断此号码是否可以使用
var setUpRegister modelskpi.Register
err := setUpRegister.GetCont(map[string]interface{}{"`number`": receivedValue.Num}, "`state`", "`id`")
if err != nil {
sendDataCont.Isset = 2
}
if setUpRegister.State != 1 {
sendDataCont.Isset = 2
}
//获取步进值
var oacl modelskpi.OpenApprovalChangeLog
clickStep, stepErr := oacl.GetMAx(mainFlowLog.OrderId, zhiXingRen)
if stepErr != nil {
sendDataCont.Stepper = 1
} else {
sendDataCont.Stepper = clickStep + 1
}
if mainFlowLog.EnclosureFormat != "" {
json.Unmarshal([]byte(mainFlowLog.EnclosureFormat), &sendDataCont.Enclosure)
}
publicmethod.Result(0, sendDataCont, c) //输出
} else {
//定量
syncSeting.Add(1)
go getFlowCont.ReadMeterMainFlowLog(receivedValue.Id) //获取审批主表
syncSeting.Wait()
mainFlowLog, _, meterFlowList := getFlowCont.readDataLock() //读取线程通道数据
var sendDataCont SendPostDingLiang
sendDataCont.OrderId = strconv.FormatInt(mainFlowLog.OrderId, 10)
sendDataCont.Title = GetNatureFlowTitle(mainFlowLog.Executor, mainFlowLog.DepartmentId, mainFlowLog.PostId, mainFlowLog.PersonLiable, mainFlowLog.Target, mainFlowLog.HappenTime, 2)
sendDataCont.FlowMapAll, _, _ = wechatcallback.GetOneNodeCont(mainFlowLog.WorkFlow, mainFlowLog.Step)
sendDataCont.Isset = 1
//判断当前人是否要审批
var zhiXingRen []string
if mainFlowLog.NextStep > 1 {
if mainFlowLog.NextExecutor != "" {
err = json.Unmarshal([]byte(mainFlowLog.NextExecutor), &zhiXingRen)
if err == nil {
dangQianRen := strconv.FormatInt(context.Key, 10)
if publicmethod.IsInTrue[string](dangQianRen, zhiXingRen) == true {
// sendDataCont.Isset = 2
}
}
}
}
//获取挂号信息
//判断此号码是否可以使用
var setUpRegister modelskpi.Register
err := setUpRegister.GetCont(map[string]interface{}{"`number`": receivedValue.Num}, "`state`", "`id`")
if err != nil {
sendDataCont.Isset = 2
}
if setUpRegister.State != 1 {
sendDataCont.Isset = 2
}
//获取步进值
var oacl modelskpi.OpenApprovalChangeLog
clickStep, stepErr := oacl.GetMAx(mainFlowLog.OrderId, zhiXingRen)
if stepErr != nil {
sendDataCont.Stepper = 1
} else {
sendDataCont.Stepper = clickStep + 1
}
if mainFlowLog.EnclosureFormat != "" {
json.Unmarshal([]byte(mainFlowLog.EnclosureFormat), &sendDataCont.Enclosure)
}
for _, v := range meterFlowList {
sendDataCont.List = append(sendDataCont.List, AnalysisDingLiang(v))
}
publicmethod.Result(0, sendDataCont, c) //输出
}
}

5
api/version1/postseting/postweb/postration.go

@ -419,7 +419,10 @@ func (a *ApiMethod) SubmitRationPostCont(c *gin.Context) {
//卡片跳转地址 //卡片跳转地址
var cardActionContStr wechatsendmsg.CardActionCont var cardActionContStr wechatsendmsg.CardActionCont
cardActionContStr.Type = 1 cardActionContStr.Type = 1
cardActionContStr.Url = fmt.Sprintf("http://new.hxgk.group/#/quantitativeList?id=%v", uuId)
jumpUrl := fmt.Sprintf("%v/#/pages/approval/postdingliang?orderid=%v&class=%v", overall.CONSTANT_CONFIG.Appsetup.WebUrl, uuId, 2)
cardActionContStr.Url = jumpUrl
// cardActionContStr.Url = fmt.Sprintf("http://new.hxgk.group/#/quantitativeList?id=%v", uuId)
var sendButtionMsg wechatsendmsg.SendButtonInteractionSimplify var sendButtionMsg wechatsendmsg.SendButtonInteractionSimplify
sendButtionMsg.Touser = strings.Join(sendUserList, "|") sendButtionMsg.Touser = strings.Join(sendUserList, "|")

22
api/version1/postseting/postweb/posttarget.go

@ -865,7 +865,10 @@ func (a *ApiMethod) SendUsNatureEvaluation(c *gin.Context) {
//卡片跳转地址 //卡片跳转地址
var cardActionContStr wechatsendmsg.CardActionCont var cardActionContStr wechatsendmsg.CardActionCont
cardActionContStr.Type = 1 cardActionContStr.Type = 1
cardActionContStr.Url = fmt.Sprintf("http://new.hxgk.group/#/quantitativeList?id=%v", uuId)
jumpUrl := fmt.Sprintf("%v/#/pages/approval/postdingliang?orderid=%v&class=%v", overall.CONSTANT_CONFIG.Appsetup.WebUrl, uuId, 1)
cardActionContStr.Url = jumpUrl
// cardActionContStr.Url = fmt.Sprintf("http://new.hxgk.group/#/quantitativeList?id=%v", uuId)
var sendButtionMsg wechatsendmsg.SendButtonInteractionSimplify var sendButtionMsg wechatsendmsg.SendButtonInteractionSimplify
sendButtionMsg.Touser = strings.Join(sendUserList, "|") sendButtionMsg.Touser = strings.Join(sendUserList, "|")
@ -1291,7 +1294,8 @@ func ApproveFlow(systemApp string, flowMap []publicmethod.FlowChartList, flowOne
zeRenRenCont.GetCont(map[string]interface{}{"`key`": postNatuerFlowCont.Executor}, "`name`", "`number`") zeRenRenCont.GetCont(map[string]interface{}{"`key`": postNatuerFlowCont.Executor}, "`name`", "`number`")
markDowmStr = fmt.Sprintf("%v\n> \n><font color=\"warning\">提报人: %v(%v)</font>", markDowmStr, zeRenRenCont.Name, zeRenRenCont.Number) markDowmStr = fmt.Sprintf("%v\n> \n><font color=\"warning\">提报人: %v(%v)</font>", markDowmStr, zeRenRenCont.Name, zeRenRenCont.Number)
markDowmStr = fmt.Sprintf("%v\n>\n>[填写整改措施](http://new.hxgk.group/#/rectification?id=%v&num=%v)", markDowmStr, pwoContOld.OrderId, registerNum) // markDowmStr = fmt.Sprintf("%v\n>\n>[填写整改措施](http://new.hxgk.group/#/rectification?id=%v&num=%v)", markDowmStr, pwoContOld.OrderId, registerNum)
markDowmStr = fmt.Sprintf("%v\n>\n>[填写整改措施](%v/#/pages/approval/corraction?id=%v&num=%v)", markDowmStr, overall.CONSTANT_CONFIG.Appsetup.WebUrl, pwoContOld.OrderId, registerNum)
//发送同通信息 //发送同通信息
wechatcallback.SendNoticeMsg(sendToUserList, markDowmStr, systemApp) wechatcallback.SendNoticeMsg(sendToUserList, markDowmStr, systemApp)
} else { //无需填写信息。继续发送 } else { //无需填写信息。继续发送
@ -1409,7 +1413,7 @@ func ApproveFlow(systemApp string, flowMap []publicmethod.FlowChartList, flowOne
twoTitleTextList = append(twoTitleTextList, twoTitleTextCont) twoTitleTextList = append(twoTitleTextList, twoTitleTextCont)
} }
wechatcallback.SendButtonCard(systemApp, postTarDeta.Title, postTarDetailsDeta.Title, sunTextCont, fv.NodeName, pwoContOld.OrderId, sendNextStep, sendToUserList, quoteAreaInfo, twoTitleTextList) wechatcallback.SendButtonCard(systemApp, postTarDeta.Title, postTarDetailsDeta.Title, sunTextCont, fv.NodeName, pwoContOld.OrderId, sendNextStep, pwoContOld.Class, sendToUserList, quoteAreaInfo, twoTitleTextList)
} }
} else { //定量操作 } else { //定量操作
//定量操作 //定量操作
@ -1458,9 +1462,13 @@ func ApproveFlow(systemApp string, flowMap []publicmethod.FlowChartList, flowOne
twoTitleTextList = append(twoTitleTextList, twoTitleTextCont) twoTitleTextList = append(twoTitleTextList, twoTitleTextCont)
} }
wechatcallback.SendButtonCard(systemApp, postShemeCont.Title, postShemeCont.Content, "", fv.NodeName, pwoContOld.OrderId, sendNextStep, sendToUserList, quoteAreaInfo, twoTitleTextList) wechatcallback.SendButtonCard(systemApp, postShemeCont.Title, postShemeCont.Content, "", fv.NodeName, pwoContOld.OrderId, sendNextStep, pwoContOld.Class, sendToUserList, quoteAreaInfo, twoTitleTextList)
} }
} else { } else {
jumpUrl := fmt.Sprintf("%v/#/pages/approval/postdingxin?orderid=%v&class=%v", overall.CONSTANT_CONFIG.Appsetup.WebUrl, pwoContOld.OrderId, pwoContOld.Class)
if pwoContOld.Class != 1 {
jumpUrl = fmt.Sprintf("%v/#/pages/approval/postdingliang?orderid=%v&class=%v", overall.CONSTANT_CONFIG.Appsetup.WebUrl, pwoContOld.OrderId, pwoContOld.Class)
}
//抄送信息 //抄送信息
markDowmStr := "审批通过-抄送" markDowmStr := "审批通过-抄送"
markDowmStr = fmt.Sprintf("%v\n>**事项详情** ", markDowmStr) markDowmStr = fmt.Sprintf("%v\n>**事项详情** ", markDowmStr)
@ -1524,7 +1532,8 @@ func ApproveFlow(systemApp string, flowMap []publicmethod.FlowChartList, flowOne
zeRenRenCont.GetCont(map[string]interface{}{"`key`": postNatuerFlowCont.PersonLiable}, "`name`", "`number`") zeRenRenCont.GetCont(map[string]interface{}{"`key`": postNatuerFlowCont.PersonLiable}, "`name`", "`number`")
markDowmStr = fmt.Sprintf("%v\n> \n><font color=\"warning\">被考核人: %v(%v)</font>", markDowmStr, zeRenRenCont.Name, zeRenRenCont.Number) markDowmStr = fmt.Sprintf("%v\n> \n><font color=\"warning\">被考核人: %v(%v)</font>", markDowmStr, zeRenRenCont.Name, zeRenRenCont.Number)
markDowmStr = fmt.Sprintf("%v\n><font color=\"info\">发生时间: %v</font> ", markDowmStr, publicmethod.UnixTimeToDay(postNatuerFlowCont.HappenTime, 1)) markDowmStr = fmt.Sprintf("%v\n><font color=\"info\">发生时间: %v</font> ", markDowmStr, publicmethod.UnixTimeToDay(postNatuerFlowCont.HappenTime, 1))
markDowmStr = fmt.Sprintf("%v\n>\n>[查看审批详情](http://new.hxgk.group/#/quantitativeList?id=%v)", markDowmStr, pwoContOld.OrderId) // markDowmStr = fmt.Sprintf("%v\n>\n>[查看审批详情](http://new.hxgk.group/#/quantitativeList?id=%v)", markDowmStr, pwoContOld.OrderId)
markDowmStr = fmt.Sprintf("%v\n>\n>[查看审批详情](%v)", markDowmStr, jumpUrl)
} else { } else {
//定量操作 //定量操作
var postMeterFlowCont modelskpi.PostMeteringFlow var postMeterFlowCont modelskpi.PostMeteringFlow
@ -1543,7 +1552,8 @@ func ApproveFlow(systemApp string, flowMap []publicmethod.FlowChartList, flowOne
zeRenRenCont.GetCont(map[string]interface{}{"`key`": postMeterFlowCont.PersonLiable}, "`name`", "`number`") zeRenRenCont.GetCont(map[string]interface{}{"`key`": postMeterFlowCont.PersonLiable}, "`name`", "`number`")
markDowmStr = fmt.Sprintf("%v\n> \n><font color=\"warning\">被考核人: %v(%v)</font>", markDowmStr, zeRenRenCont.Name, zeRenRenCont.Number) markDowmStr = fmt.Sprintf("%v\n> \n><font color=\"warning\">被考核人: %v(%v)</font>", markDowmStr, zeRenRenCont.Name, zeRenRenCont.Number)
markDowmStr = fmt.Sprintf("%v\n>\n>[查看审批详情](http://new.hxgk.group/#/quantitativeList?id=%v)", markDowmStr, pwoContOld.OrderId) // markDowmStr = fmt.Sprintf("%v\n>\n>[查看审批详情](http://new.hxgk.group/#/quantitativeList?id=%v)", markDowmStr, pwoContOld.OrderId)
markDowmStr = fmt.Sprintf("%v\n>\n>[查看审批详情](%v)", markDowmStr, jumpUrl)
} }
//发送抄送信息 //发送抄送信息
wechatcallback.SendNoticeMsg(sendToUserList, markDowmStr, systemApp) wechatcallback.SendNoticeMsg(sendToUserList, markDowmStr, systemApp)

87
api/version1/postseting/postweb/type.go

@ -12,6 +12,21 @@ type ApiMethod struct{}
var syncSeting = sync.WaitGroup{} var syncSeting = sync.WaitGroup{}
// 获取审批详情
type GetFlowLogCont struct {
FlowCont modelskpi.PostWorkflowOrders //审批工作流
NatureFlow []modelskpi.PostNatureFlow //岗位定性考核流水
MeterFlow []modelskpi.PostMeteringFlow //岗位定量考核流水
mutext sync.RWMutex
}
// 读审批记录详情文件锁数据
func (g *GetFlowLogCont) readDataLock() (modelskpi.PostWorkflowOrders, []modelskpi.PostNatureFlow, []modelskpi.PostMeteringFlow) {
g.mutext.RLock()
defer g.mutext.RUnlock()
return g.FlowCont, g.NatureFlow, g.MeterFlow
}
// 岗位考核WEB端入口 // 岗位考核WEB端入口
func (a *ApiMethod) Index(c *gin.Context) { func (a *ApiMethod) Index(c *gin.Context) {
outputCont := publicmethod.MapOut[string]() outputCont := publicmethod.MapOut[string]()
@ -214,7 +229,7 @@ type sendPostQuanCont struct {
CompletionRate string `json:"completionRate"` //达成率 CompletionRate string `json:"completionRate"` //达成率
ZeroPrize float64 `json:"zeroprize"` //零奖值 ZeroPrize float64 `json:"zeroprize"` //零奖值
AllPrize float64 `json:"allprize"` //全奖值 AllPrize float64 `json:"allprize"` //全奖值
CappingPrize float64 `json:"cappingprize"` //达成率 CappingPrize float64 `json:"cappingprize"` //封顶值
Weight float64 `json:"weight"` //指标权重 Weight float64 `json:"weight"` //指标权重
ScoringMethod int `json:"scoringmethod"` //计分方式(1:自动;2:手动) ScoringMethod int `json:"scoringmethod"` //计分方式(1:自动;2:手动)
} }
@ -223,8 +238,8 @@ type sendPostQuanCont struct {
type postFlowLog struct { type postFlowLog struct {
publicmethod.PagesTurn publicmethod.PagesTurn
Title string `json:"title"` //指标名 Title string `json:"title"` //指标名
OrgId string `json:"orgid"` //行政组织 OrgId int64 `json:"orgid"` //行政组织
PostId string `json:"postid"` //岗位 PostId int64 `json:"postid"` //岗位
DayTime string `json:"daytime"` //时间 DayTime string `json:"daytime"` //时间
State int `json:"state"` //状态:0:全部;1:起草;2:审批中;3:通过;4:驳回 State int `json:"state"` //状态:0:全部;1:起草;2:审批中;3:通过;4:驳回
ApprovalState int `json:"approvalstate" ` //审批:0:全部;1:已处理;2:未处理 ApprovalState int `json:"approvalstate" ` //审批:0:全部;1:已处理;2:未处理
@ -245,4 +260,70 @@ type SendPostFlowLog struct {
Days int64 `json:"days"` //天 Days int64 `json:"days"` //天
Node string `json:"node"` //当前节点 Node string `json:"node"` //当前节点
MonthDays string `json:"monthdays"` //提报日期 MonthDays string `json:"monthdays"` //提报日期
Class int `json:"class"` //1、定性;2、定量
}
// 查看审批流详情
type LookFlowInfo struct {
publicmethod.PublicId
Class int `json:"class"` //属性1、定性;2、定量
}
// 输出岗位定性
type SendPostDingXing struct {
OrderId string `json:"orderid"` //订单编号
Title string `json:"title"` //标题
List []DingXingList `json:"list"`
FlowMapAll []publicmethod.FlowChartList `json:"flowmapall"` //流程图
Isset int `json:"isset"` //本人是否需要审批
Enclosure []publicmethod.EnclosureFormat `json:"enclosure"` //附件
Stepper int `json:"stepper"` //步进器
}
// 定性考核
type DingXingList struct {
Dimension string `json:"dimension"` //维度
Target string `json:"target"` //考核指标
Targetsun string `json:"targetsun"` //考核项目
Detailedtargent string `json:"detailedtargent"` //考核内容
Standard string `json:"standard"` //考核标准(分)
StandardMoney string `json:"standardmoney"` //考核标准(钱)
Lanmuname string `json:"lanmuname"` //奖励OR扣除
ScoreVal float64 `json:"scoreval"` //奖励或扣除的分数
MoneyVal float64 `json:"moneyval"` //奖励或扣除的钱
Reason string `json:"reason"` //考核原因
Unit string `json:"unit"` //单位
}
// 输出岗位定量
type SendPostDingLiang struct {
OrderId string `json:"orderid"` //订单编号
Title string `json:"title"` //标题
List []DingLiangList `json:"list"`
FlowMapAll []publicmethod.FlowChartList `json:"flowmapall"` //流程图
Isset int `json:"isset"` //本人是否需要审批
Enclosure []publicmethod.EnclosureFormat `json:"enclosure"` //附件
Stepper int `json:"stepper"` //步进器
}
// 岗位定量考核
type DingLiangList struct {
Title string `json:"title"` //指标
Target string `json:"target"` //考核指标
ZeroPrize float64 `json:"zeroprize"` //零奖值
AllPrize float64 `json:"allprize"` //全奖值
CappingVal float64 `json:"cappingval"` //封顶值
Weight float64 `json:"weight"` //权重分
Score float64 `json:"score"` //实际值
Achievement float64 `json:"achievement"` //达成率
Actual float64 `json:"actual"` //指标得分
Content string `json:"content"` //说明
Unit string `json:"unit"` //说明
}
// 查看审批流详情 岗位整改措施专用
type LookFlowInfoCorra struct {
publicmethod.PublicId
Class int `json:"class"` //属性1、定性;2、定量
Num string `jsonL:"num"` //整改识别
} }

29
api/version1/systemapproval/entry.go

@ -0,0 +1,29 @@
package systemapproval
import (
"key_performance_indicators/overall/publicmethod"
"sync"
"github.com/gin-gonic/gin"
)
// 系统内部审批处理
type ApiMethod struct{}
// 协程设置
var syncSeting = sync.WaitGroup{}
// 系统内部审批处理
func (a *ApiMethod) Index(c *gin.Context) {
outputCont := publicmethod.MapOut[string]()
outputCont["index"] = "系统内部审批处理入口"
publicmethod.Result(0, outputCont, c)
}
// 审批参数
type AppFlowData struct {
OrderId string `json:"orderid"` //订单ID
YesOrNo int `json:"yesorno"` //1:批准;2:驳回
Content string `json:"content"` //审批意见
Stepper int `json:"stepper"` //步进器
}

1022
api/version1/systemapproval/post_nature.go

File diff suppressed because it is too large

2
apirouter/entry.go

@ -3,6 +3,7 @@ package apirouter
import ( import (
"key_performance_indicators/apirouter/apishiyan" "key_performance_indicators/apirouter/apishiyan"
"key_performance_indicators/apirouter/empower" "key_performance_indicators/apirouter/empower"
"key_performance_indicators/apirouter/v1/approvalsystem"
"key_performance_indicators/apirouter/v1/bookimg" "key_performance_indicators/apirouter/v1/bookimg"
"key_performance_indicators/apirouter/v1/departmentseting" "key_performance_indicators/apirouter/v1/departmentseting"
"key_performance_indicators/apirouter/v1/empowerrouter" "key_performance_indicators/apirouter/v1/empowerrouter"
@ -28,6 +29,7 @@ type RouterGroup struct {
Empowerouter empowerrouter.ApiRouter Empowerouter empowerrouter.ApiRouter
WechatRouter wechaturl.ApiRouter WechatRouter wechaturl.ApiRouter
WorkFlowRouter workflowchart.ApiRouter WorkFlowRouter workflowchart.ApiRouter
ExamineSystemApp approvalsystem.ApiRouter
} }
var RouterGroupEntry = new(RouterGroup) var RouterGroupEntry = new(RouterGroup)

20
apirouter/v1/approvalsystem/approval_route.go

@ -0,0 +1,20 @@
package approvalsystem
import (
"key_performance_indicators/api/version1"
"github.com/gin-gonic/gin"
)
// 岗位考核审批路由
func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) {
apiRouter := router.Group("examine")
var apiFunc = version1.AppApiEntry.SystemAppExamine
{
apiRouter.GET("", apiFunc.Index) //入口
apiRouter.POST("", apiFunc.Index) //入口
apiRouter.POST("postnatureappflow", apiFunc.PostNatureAppFlow) //岗位定性审批
}
}

4
apirouter/v1/approvalsystem/type.go

@ -0,0 +1,4 @@
package approvalsystem
//系统审批路由
type ApiRouter struct{}

5
apirouter/v1/postseting/web.go

@ -29,7 +29,8 @@ func (a *ApiRouter) RouterGroupWeb(router *gin.RouterGroup) {
apiRouter.POST("getflowmap", methodBinding.GetFlowMap) //获取流程图 apiRouter.POST("getflowmap", methodBinding.GetFlowMap) //获取流程图
apiRouter.POST("get_quantification_cont", methodBinding.GetQuantificationCont) //获取定量指标相关内容 apiRouter.POST("get_quantification_cont", methodBinding.GetQuantificationCont) //获取定量指标相关内容
apiRouter.POST("getpostflowlog", methodBinding.GetPostFlowLog) //岗位审批记录 apiRouter.POST("getpostflowlog", methodBinding.GetPostFlowLog) //岗位审批记录
apiRouter.POST("lookflowmap", methodBinding.LookFlowMap) //获取审批流详情
apiRouter.POST("lookflowmapcorra", methodBinding.LookFlowMapCorra) //获取审批流详情-->整改措施专用(岗位)
} }
} }

1
config/configApp/server.go

@ -19,6 +19,7 @@ type appsetup struct {
AppKey string `mapstructure:"appkey" json:"appkey" yaml:"appkey"` AppKey string `mapstructure:"appkey" json:"appkey" yaml:"appkey"`
DefaultPassword string `mapstructure:"password" json:"password" yaml:"password"` DefaultPassword string `mapstructure:"password" json:"password" yaml:"password"`
PreFix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` PreFix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
WebUrl string `mapstructure:"weburl" json:"weburl" yaml:"weburl"`
} }
//日志配置 //日志配置

3
initialization/route/initRoute.go

@ -97,6 +97,9 @@ func InitialRouter() *gin.Engine {
//工作流 //工作流
workFlowApiRouter := apirouter.RouterGroupEntry.WorkFlowRouter workFlowApiRouter := apirouter.RouterGroupEntry.WorkFlowRouter
workFlowApiRouter.RouterGroup(VerifyIdentityWeb) //工作流 workFlowApiRouter.RouterGroup(VerifyIdentityWeb) //工作流
systemApproval := apirouter.RouterGroupEntry.ExamineSystemApp
systemApproval.RouterGroup(VerifyIdentityWeb) //系统内审批
} }
//Token身份验证 //Token身份验证
VerifyIdentityToken := router.Group("") VerifyIdentityToken := router.Group("")

52
middleware/wechatapp/wechatcallback/event_processing.go

@ -143,6 +143,12 @@ func (b *ButtonEventQuestion) PostTemolateCallBack(orderId, clickEnter, systemAp
//1、判断当前流程状态 //1、判断当前流程状态
var flowCont modelskpi.PostWorkflowOrders var flowCont modelskpi.PostWorkflowOrders
err := flowCont.GetCont(map[string]interface{}{"`order_id`": orderId}) err := flowCont.GetCont(map[string]interface{}{"`order_id`": orderId})
jumpUrl := fmt.Sprintf("%v/#/pages/approval/postdingxin?orderid=%v&class=%v", overall.CONSTANT_CONFIG.Appsetup.WebUrl, orderId, flowCont.Class)
if flowCont.Class != 1 {
jumpUrl = fmt.Sprintf("%v/#/pages/approval/postdingliang?orderid=%v&class=%v", overall.CONSTANT_CONFIG.Appsetup.WebUrl, orderId, flowCont.Class)
}
if err != nil { if err != nil {
var sendMsgText wechatsendmsg.SendTextCard var sendMsgText wechatsendmsg.SendTextCard
sendMsgText.Touser = b.FromUsername sendMsgText.Touser = b.FromUsername
@ -154,7 +160,7 @@ func (b *ButtonEventQuestion) PostTemolateCallBack(orderId, clickEnter, systemAp
sendMsgText.EnableIdTrans = 0 sendMsgText.EnableIdTrans = 0
sendMsgText.MsgBody.Title = "流程关闭" sendMsgText.MsgBody.Title = "流程关闭"
sendMsgText.MsgBody.Description = "此审批流程已经关闭!请联系发起人!" sendMsgText.MsgBody.Description = "此审批流程已经关闭!请联系发起人!"
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v", orderId) // jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v", orderId)
sendMsgText.MsgBody.URL = jumpUrl sendMsgText.MsgBody.URL = jumpUrl
sendMsgText.MsgBody.BtnTxt = "" sendMsgText.MsgBody.BtnTxt = ""
sendMsgText.SendMsg(systemApp) sendMsgText.SendMsg(systemApp)
@ -169,7 +175,7 @@ func (b *ButtonEventQuestion) PostTemolateCallBack(orderId, clickEnter, systemAp
sendMsgText.DuplicateCheckInterval = 1800 sendMsgText.DuplicateCheckInterval = 1800
sendMsgText.EnableIdTrans = 0 sendMsgText.EnableIdTrans = 0
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v", orderId) // jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v", orderId)
sendMsgText.MsgBody.URL = jumpUrl sendMsgText.MsgBody.URL = jumpUrl
sendMsgText.MsgBody.BtnTxt = "查看详情" sendMsgText.MsgBody.BtnTxt = "查看详情"
switch flowCont.State { switch flowCont.State {
@ -244,7 +250,7 @@ func (b *ButtonEventQuestion) PostTemolateCallBack(orderId, clickEnter, systemAp
sendMsgText.EnableIdTrans = 0 sendMsgText.EnableIdTrans = 0
sendMsgText.MsgBody.Title = "已审批" sendMsgText.MsgBody.Title = "已审批"
sendMsgText.MsgBody.Description = fmt.Sprintf("此审批流程已被%v审批!请不要重复操作!", carryPeopleOld.Name) sendMsgText.MsgBody.Description = fmt.Sprintf("此审批流程已被%v审批!请不要重复操作!", carryPeopleOld.Name)
jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v", orderId) // jumpUrl := fmt.Sprintf("http://new.hxgk.group/#/responsible?id=%v", orderId)
sendMsgText.MsgBody.URL = jumpUrl sendMsgText.MsgBody.URL = jumpUrl
sendMsgText.MsgBody.BtnTxt = "" sendMsgText.MsgBody.BtnTxt = ""
sendMsgText.SendMsg(systemApp) sendMsgText.SendMsg(systemApp)
@ -326,9 +332,13 @@ func (U *updateButtonSync) RejectFlow(systemApp string, flowMap []publicmethod.F
setUpRegister.Time = time.Now().Unix() setUpRegister.Time = time.Now().Unix()
setUpRegister.AddCont() setUpRegister.AddCont()
markDowmStr = fmt.Sprintf("您的整改措施被%v", markDowmStr) markDowmStr = fmt.Sprintf("您的整改措施被%v", markDowmStr)
clickUrlPath = fmt.Sprintf("%v\n>\n>[重新填写整改措施](http://new.hxgk.group/#/rectification?id=%v&num=%v)", markDowmStr, pwoContOld.OrderId, registerNum) clickUrlPath = fmt.Sprintf("%v\n>\n>[重新填写整改措施](%v/#/pages/approval/corraction?id=%v&num=%v)", markDowmStr, overall.CONSTANT_CONFIG.Appsetup.WebUrl, pwoContOld.OrderId, registerNum)
default: //发送驳回信息 default: //发送驳回信息
clickUrlPath = fmt.Sprintf("%v\n>\n>[查看审批详情](http://new.hxgk.group/#/quantitativeList?id=%v)", markDowmStr, pwoContOld.OrderId) jumpUrl := fmt.Sprintf("%v/#/pages/approval/postdingxin?orderid=%v&class=%v", overall.CONSTANT_CONFIG.Appsetup.WebUrl, pwoContOld.OrderId, pwoContOld.Class)
if pwoContOld.Class != 1 {
jumpUrl = fmt.Sprintf("%v/#/pages/approval/postdingliang?orderid=%v&class=%v", overall.CONSTANT_CONFIG.Appsetup.WebUrl, pwoContOld.OrderId, pwoContOld.Class)
}
clickUrlPath = fmt.Sprintf("%v\n>\n>[查看审批详情](%v)", markDowmStr, jumpUrl)
} }
var postTarDeta modelskpi.PostTarget var postTarDeta modelskpi.PostTarget
postTarDeta.GetCont(map[string]interface{}{"`id`": pwoContOld.Target}, "`title`") postTarDeta.GetCont(map[string]interface{}{"`id`": pwoContOld.Target}, "`title`")
@ -604,7 +614,8 @@ func (U *updateButtonSync) ApproveFlow(systemApp string, flowMap []publicmethod.
zeRenRenCont.GetCont(map[string]interface{}{"`key`": postNatuerFlowCont.Executor}, "`name`", "`number`") zeRenRenCont.GetCont(map[string]interface{}{"`key`": postNatuerFlowCont.Executor}, "`name`", "`number`")
markDowmStr = fmt.Sprintf("%v\n> \n><font color=\"warning\">提报人: %v(%v)</font>", markDowmStr, zeRenRenCont.Name, zeRenRenCont.Number) markDowmStr = fmt.Sprintf("%v\n> \n><font color=\"warning\">提报人: %v(%v)</font>", markDowmStr, zeRenRenCont.Name, zeRenRenCont.Number)
markDowmStr = fmt.Sprintf("%v\n>\n>[填写整改措施](http://new.hxgk.group/#/rectification?id=%v&num=%v)", markDowmStr, pwoContOld.OrderId, registerNum) // markDowmStr = fmt.Sprintf("%v\n>\n>[填写整改措施](http://new.hxgk.group/#/rectification?id=%v&num=%v)", markDowmStr, pwoContOld.OrderId, registerNum)
markDowmStr = fmt.Sprintf("%v\n>\n>[填写整改措施](%v/#/pages/approval/corraction?id=%v&num=%v)", markDowmStr, overall.CONSTANT_CONFIG.Appsetup.WebUrl, pwoContOld.OrderId, registerNum)
//发送同通信息 //发送同通信息
SendNoticeMsg(sendToUserList, markDowmStr, systemApp) SendNoticeMsg(sendToUserList, markDowmStr, systemApp)
} else { //无需填写信息。继续发送 } else { //无需填写信息。继续发送
@ -722,7 +733,7 @@ func (U *updateButtonSync) ApproveFlow(systemApp string, flowMap []publicmethod.
twoTitleTextList = append(twoTitleTextList, twoTitleTextCont) twoTitleTextList = append(twoTitleTextList, twoTitleTextCont)
} }
SendButtonCard(systemApp, postTarDeta.Title, postTarDetailsDeta.Title, sunTextCont, fv.NodeName, pwoContOld.OrderId, sendNextStep, sendToUserList, quoteAreaInfo, twoTitleTextList) SendButtonCard(systemApp, postTarDeta.Title, postTarDetailsDeta.Title, sunTextCont, fv.NodeName, pwoContOld.OrderId, sendNextStep, pwoContOld.Class, sendToUserList, quoteAreaInfo, twoTitleTextList)
} }
} else { //定量操作 } else { //定量操作
//定量操作 //定量操作
@ -771,10 +782,15 @@ func (U *updateButtonSync) ApproveFlow(systemApp string, flowMap []publicmethod.
twoTitleTextList = append(twoTitleTextList, twoTitleTextCont) twoTitleTextList = append(twoTitleTextList, twoTitleTextCont)
} }
SendButtonCard(systemApp, postShemeCont.Title, postShemeCont.Content, "", fv.NodeName, pwoContOld.OrderId, sendNextStep, sendToUserList, quoteAreaInfo, twoTitleTextList) SendButtonCard(systemApp, postShemeCont.Title, postShemeCont.Content, "", fv.NodeName, pwoContOld.OrderId, sendNextStep, pwoContOld.Class, sendToUserList, quoteAreaInfo, twoTitleTextList)
} }
} else { } else {
//抄送信息 //抄送信息
jumpUrl := fmt.Sprintf("%v/#/pages/approval/postdingxin?orderid=%v&class=%v", overall.CONSTANT_CONFIG.Appsetup.WebUrl, pwoContOld.OrderId, pwoContOld.Class)
if pwoContOld.Class != 1 {
jumpUrl = fmt.Sprintf("%v/#/pages/approval/postdingliang?orderid=%v&class=%v", overall.CONSTANT_CONFIG.Appsetup.WebUrl, pwoContOld.OrderId, pwoContOld.Class)
}
markDowmStr := "审批通过-抄送" markDowmStr := "审批通过-抄送"
markDowmStr = fmt.Sprintf("%v\n>**事项详情** ", markDowmStr) markDowmStr = fmt.Sprintf("%v\n>**事项详情** ", markDowmStr)
@ -837,7 +853,11 @@ func (U *updateButtonSync) ApproveFlow(systemApp string, flowMap []publicmethod.
zeRenRenCont.GetCont(map[string]interface{}{"`key`": postNatuerFlowCont.PersonLiable}, "`name`", "`number`") zeRenRenCont.GetCont(map[string]interface{}{"`key`": postNatuerFlowCont.PersonLiable}, "`name`", "`number`")
markDowmStr = fmt.Sprintf("%v\n> \n><font color=\"warning\">被考核人: %v(%v)</font>", markDowmStr, zeRenRenCont.Name, zeRenRenCont.Number) markDowmStr = fmt.Sprintf("%v\n> \n><font color=\"warning\">被考核人: %v(%v)</font>", markDowmStr, zeRenRenCont.Name, zeRenRenCont.Number)
markDowmStr = fmt.Sprintf("%v\n><font color=\"info\">发生时间: %v</font> ", markDowmStr, publicmethod.UnixTimeToDay(postNatuerFlowCont.HappenTime, 1)) markDowmStr = fmt.Sprintf("%v\n><font color=\"info\">发生时间: %v</font> ", markDowmStr, publicmethod.UnixTimeToDay(postNatuerFlowCont.HappenTime, 1))
markDowmStr = fmt.Sprintf("%v\n>\n>[查看审批详情](http://new.hxgk.group/#/quantitativeList?id=%v)", markDowmStr, pwoContOld.OrderId)
// markDowmStr = fmt.Sprintf("%v\n>\n>[查看审批详情](http://new.hxgk.group/#/quantitativeList?id=%v)", markDowmStr, pwoContOld.OrderId)
markDowmStr = fmt.Sprintf("%v\n>\n>[查看审批详情](%v)", markDowmStr, jumpUrl)
} else { } else {
//定量操作 //定量操作
var postMeterFlowCont modelskpi.PostMeteringFlow var postMeterFlowCont modelskpi.PostMeteringFlow
@ -856,7 +876,8 @@ func (U *updateButtonSync) ApproveFlow(systemApp string, flowMap []publicmethod.
zeRenRenCont.GetCont(map[string]interface{}{"`key`": postMeterFlowCont.PersonLiable}, "`name`", "`number`") zeRenRenCont.GetCont(map[string]interface{}{"`key`": postMeterFlowCont.PersonLiable}, "`name`", "`number`")
markDowmStr = fmt.Sprintf("%v\n> \n><font color=\"warning\">被考核人: %v(%v)</font>", markDowmStr, zeRenRenCont.Name, zeRenRenCont.Number) markDowmStr = fmt.Sprintf("%v\n> \n><font color=\"warning\">被考核人: %v(%v)</font>", markDowmStr, zeRenRenCont.Name, zeRenRenCont.Number)
markDowmStr = fmt.Sprintf("%v\n>\n>[查看审批详情](http://new.hxgk.group/#/quantitativeList?id=%v)", markDowmStr, pwoContOld.OrderId) // markDowmStr = fmt.Sprintf("%v\n>\n>[查看审批详情](http://new.hxgk.group/#/quantitativeList?id=%v)", markDowmStr, pwoContOld.OrderId)
markDowmStr = fmt.Sprintf("%v\n>\n>[查看审批详情](%v)", markDowmStr, jumpUrl)
} }
//发送抄送信息 //发送抄送信息
SendNoticeMsg(sendToUserList, markDowmStr, systemApp) SendNoticeMsg(sendToUserList, markDowmStr, systemApp)
@ -884,13 +905,14 @@ func (U *updateButtonSync) ApproveFlow(systemApp string, flowMap []publicmethod.
#sendUserList 接收人 #sendUserList 接收人
#quoteAreaInfo 引用文献 #quoteAreaInfo 引用文献
#twoTitleTextList 二级标题+文本列表 #twoTitleTextList 二级标题+文本列表
#class 1定性2 定量
func SendButtonCard(systemApp, mainTitle, descInfo, sunTextCont, sendTitle string, uuId int64, step int, sendUserList []string, quoteAreaInfo wechatsendmsg.QuoteAreaCont, twoTitleTextList []wechatsendmsg.HorizontalContentListInfo) func SendButtonCard(systemApp, mainTitle, descInfo, sunTextCont, sendTitle string, uuId int64, step int, sendUserList []string, quoteAreaInfo wechatsendmsg.QuoteAreaCont, twoTitleTextList []wechatsendmsg.HorizontalContentListInfo)
@ 返回值 @ 返回值
# #
*/ */
func SendButtonCard(systemApp, mainTitle, descInfo, sunTextCont, sendTitle string, uuId int64, step int, sendUserList []string, quoteAreaInfo wechatsendmsg.QuoteAreaCont, twoTitleTextList []wechatsendmsg.HorizontalContentListInfo) { func SendButtonCard(systemApp, mainTitle, descInfo, sunTextCont, sendTitle string, uuId int64, step, class int, sendUserList []string, quoteAreaInfo wechatsendmsg.QuoteAreaCont, twoTitleTextList []wechatsendmsg.HorizontalContentListInfo) {
//头部信息 //头部信息
var sourceText wechatsendmsg.SourceText var sourceText wechatsendmsg.SourceText
@ -912,7 +934,13 @@ func SendButtonCard(systemApp, mainTitle, descInfo, sunTextCont, sendTitle strin
//卡片跳转地址 //卡片跳转地址
var cardActionContStr wechatsendmsg.CardActionCont var cardActionContStr wechatsendmsg.CardActionCont
cardActionContStr.Type = 1 cardActionContStr.Type = 1
cardActionContStr.Url = fmt.Sprintf("http://new.hxgk.group/#/quantitativeList?id=%v", uuId)
jumpUrl := fmt.Sprintf("%v/#/pages/approval/postdingxin?orderid=%v&class=%v", overall.CONSTANT_CONFIG.Appsetup.WebUrl, uuId, class)
if class != 1 {
jumpUrl = fmt.Sprintf("%v/#/pages/approval/postdingliang?orderid=%v&class=%v", overall.CONSTANT_CONFIG.Appsetup.WebUrl, uuId, class)
}
cardActionContStr.Url = jumpUrl
// cardActionContStr.Url = fmt.Sprintf("http://new.hxgk.group/#/quantitativeList?id=%v", uuId)
var sendButtionMsg wechatsendmsg.SendButtonInteractionSimplify var sendButtionMsg wechatsendmsg.SendButtonInteractionSimplify
// sendButtionMsg.Touser = strings.Join(sendUserList, "|") // sendButtionMsg.Touser = strings.Join(sendUserList, "|")

2
middleware/wechatapp/wechatcallback/type.go

@ -127,7 +127,7 @@ type ButtonEvent struct {
TaskId string `xml:"TaskId" json:"TaskId"` TaskId string `xml:"TaskId" json:"TaskId"`
CardType string `xml:"CardType" json:"CardType"` CardType string `xml:"CardType" json:"CardType"`
ResponseCode string `xml:"ResponseCode" json:"ResponseCode"` ResponseCode string `xml:"ResponseCode" json:"ResponseCode"`
Agentid uint32 `xml:"AgentID" json:"AgentID"` Agentid uint64 `xml:"AgentID" json:"AgentID"`
} }
//模板卡片事件推送 问题列表 //模板卡片事件推送 问题列表

2
middleware/wechatapp/wechatsendmsg/type.go

@ -124,7 +124,7 @@ type UpdateTemplateCardCurrency struct {
Partyids []int `json:"partyids"` //企业的部门ID列表(最多支持100个) Partyids []int `json:"partyids"` //企业的部门ID列表(最多支持100个)
Tagids []int `json:"tagids"` //企业的标签ID列表(最多支持100个) Tagids []int `json:"tagids"` //企业的标签ID列表(最多支持100个)
Atall int `json:"atall"` //更新整个任务接收人员 Atall int `json:"atall"` //更新整个任务接收人员
Agentid uint32 `json:"agentid"` //应用的agentid Agentid uint64 `json:"agentid"` //应用的agentid
ResponseCode string `json:"response_code"` ResponseCode string `json:"response_code"`
} }

17
models/modelskpi/open_approval_change_log.go

@ -73,3 +73,20 @@ func (cont *OpenApprovalChangeLog) AddCont() (err error) {
err = overall.CONSTANT_DB_KPI.Create(&cont).Error err = overall.CONSTANT_DB_KPI.Create(&cont).Error
return return
} }
// 获取最大数
func (cont *OpenApprovalChangeLog) GetMAx(orderId int64, userKey []string) (maxData int, err error) {
if len(userKey) > 0 {
err = overall.CONSTANT_DB_KPI.Model(&OpenApprovalChangeLog{}).Select("`stepper`,`operatortype`,`change_is_true`").Where("`orderid` = ? AND `operator` IN ?", orderId, userKey).First(&cont).Error
if cont.ChangeIsTrue == 1 {
maxData = cont.Stepper
return
} else {
err = overall.CONSTANT_DB_KPI.Model(&OpenApprovalChangeLog{}).Select("MAX(`stepper`) AS maxstep").Where("`orderid` = ?", orderId).First(&maxData).Error
}
} else {
err = overall.CONSTANT_DB_KPI.Model(&OpenApprovalChangeLog{}).Select("MAX(`stepper`) AS maxstep").Where("`orderid` = ?", orderId).First(&maxData).Error
}
return
}

1
overall/publicmethod/type.go

@ -189,6 +189,7 @@ type UserListFlowAll struct {
type LogList struct { type LogList struct {
State int `json:"state"` //状态 1、未操作;2、通过;3、驳回 State int `json:"state"` //状态 1、未操作;2、通过;3、驳回
TimeVal string `json:"time"` TimeVal string `json:"time"`
Content string `json:"content"` //审批意见
Enclosure []EnclosureFormat `json:"enclosure"` //附件 Enclosure []EnclosureFormat `json:"enclosure"` //附件
} }

Loading…
Cancel
Save