Browse Source

修改数据穿透

v1_dev_2
超级管理员 3 years ago
parent
commit
61e4846d0e
  1. 32
      api/base/loginVerify/login.go
  2. 15
      api/base/loginVerify/type.go
  3. 119
      api/shiyan/maptostruct/department.go
  4. 29
      api/shiyan/maptostruct/sendwechat.go
  5. 31
      api/version1/departmentseting/departmentpc/ding_xing.go
  6. 5
      api/version1/departmentseting/departmentpc/dingliang.go
  7. 6
      api/version1/flowchart/myworkflow.go
  8. 47
      api/workflow/currency_recipe/general_method.go
  9. 1
      api/workflow/currency_recipe/type.go
  10. 1
      api/workflow/workflowengine/workflowapi.go
  11. 18
      api/workwechat/message.go
  12. 3
      apirouter/apishiyan/maptostruct.go
  13. 20
      config/configDatabase/database.yaml
  14. 2
      identification/interceptor/identity.go
  15. 2
      overall/publicmethod/formatOutput.go

32
api/base/loginVerify/login.go

@ -1,6 +1,7 @@
package loginVerify package loginVerify
import ( import (
"encoding/json"
"fmt" "fmt"
"key_performance_indicators/middleware/grocerystore" "key_performance_indicators/middleware/grocerystore"
"key_performance_indicators/models/modelshr" "key_performance_indicators/models/modelshr"
@ -105,6 +106,17 @@ func (a *ApiMethod) ScanCodeLogin(c *gin.Context) {
redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5)
redisClient.SetRedisTime(10800) redisClient.SetRedisTime(10800)
redisClient.HashMsetAdd(redisFileKey, writeRedisData) redisClient.HashMsetAdd(redisFileKey, writeRedisData)
groupId, companyId, departmentId, sunDepartId, workShopId := publicmethod.GetOrgStructurees(userCont.AdminOrg)
fmt.Printf("groupId----->%v\ncompanyId----->%v\ndepartmentId----->%v\nsunDepartId----->%v\nworkShopId----->%v\n", groupId, companyId, departmentId, sunDepartId, workShopId)
var sunmaindeparment int64
if companyId != sunDepartId {
sunmaindeparment = sunDepartId
}
//缓存写入个人信息 //缓存写入个人信息
redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userCont.Number) redisMyContKey := fmt.Sprintf("ScanCode:Authentication:UserCont_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, userCont.Number)
myCont := publicmethod.MapOut[string]() myCont := publicmethod.MapOut[string]()
@ -115,8 +127,11 @@ func (a *ApiMethod) ScanCodeLogin(c *gin.Context) {
myCont["hireclass"] = userCont.HireClass //雇佣类型(1:雇佣入职;2:再入职;) myCont["hireclass"] = userCont.HireClass //雇佣类型(1:雇佣入职;2:再入职;)
myCont["emptype"] = userCont.EmpType //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职) myCont["emptype"] = userCont.EmpType //用工关系(1:临时工 , 2:编外人员 ;3:实习&实习生;4:试用员工;5:待分配;6:待岗;7:临时调入;8:正式员工;9:长期病假;10:停薪留职;11:退休;12:辞职;13:辞退;14:离职)
myCont["company"] = userCont.Company //入职公司 myCont["company"] = userCont.Company //入职公司
myCont["maindeparment"] = userCont.MainDeparment //主部门 // myCont["maindeparment"] = userCont.MainDeparment //主部门
myCont["sunmaindeparment"] = userCont.SunMainDeparment //二级主部门 // myCont["sunmaindeparment"] = userCont.SunMainDeparment //二级主部门
myCont["maindeparment"] = companyId //主部门
myCont["sunmaindeparment"] = sunmaindeparment //二级主部门
myCont["deparment"] = userCont.Deparment //部门 myCont["deparment"] = userCont.Deparment //部门
myCont["adminorg"] = userCont.AdminOrg //所属行政组织 myCont["adminorg"] = userCont.AdminOrg //所属行政组织
myCont["teamid"] = userCont.TeamId //班组 myCont["teamid"] = userCont.TeamId //班组
@ -170,7 +185,18 @@ func (a *ApiMethod) ScanCodeLogin(c *gin.Context) {
redisClient.HashMsetAdd(redisMyContKey, myCont) redisClient.HashMsetAdd(redisMyContKey, myCont)
saveData["usercont"] = myCont saveData["usercont"] = myCont
// fmt.Printf("redisMyContKey------Login----->%v\n", redisMyContKey)
var sendKpiCont WriteIderCont
sendKpiCont.Openid = requestData.OpenId
sendKpiCont.Key = userKeyCode
sendKpiCont.Token = sha1Token
sendKpiCont.UserInfo.Key = strconv.FormatInt(userCont.Key, 10)
sendKpiCont.UserInfo.Number = userCont.Number
sendKpiCont.UserInfo.Password = userCont.Password
sendDate, _ := json.Marshal(sendKpiCont)
sdff := publicmethod.CurlPostJosn("http://120.224.6.6:39168/shiyan/write_token", sendDate)
fmt.Printf("redisMyContKey------Login----->%v\n", sdff)
publicmethod.Result(0, saveData, c) publicmethod.Result(0, saveData, c)
} }

15
api/base/loginVerify/type.go

@ -47,3 +47,18 @@ type ExamConfig struct {
Url string `json:"url"` Url string `json:"url"`
State int `json:"state"` State int `json:"state"`
} }
// 写入身份认证
type WriteIderCont struct {
Openid string `json:"openid"`
Key string `json:"key"`
Token string `json:"token"`
UserInfo UserInfoCont `json:"userinfo"`
}
// 人员信息
type UserInfoCont struct {
Number string `json:"number"`
Password string `json:"password"`
Key string `json:"key"`
}

119
api/shiyan/maptostruct/department.go

@ -231,8 +231,8 @@ func (a *ApiMethod) VerifDepartDetasil(c *gin.Context) {
} }
for _, v := range detasilCont { for _, v := range detasilCont {
if v.Paretment != "" { //判断是否有关联部门 if v.Paretment != "" { //判断是否有关联部门
orgIdStr := strings.Split(v.Paretment, ",") //转换程切片 orgIdStr := strings.Split(v.Paretment, ",") //转换程切片部门
reportList := strings.Split(v.Reportary, ",") //转换程切片 reportList := strings.Split(v.Reportary, ",") //转换程切片
if len(orgIdStr) > 0 { if len(orgIdStr) > 0 {
var tarCont modelskpi.EvaluationTarget var tarCont modelskpi.EvaluationTarget
tarCont.GetCont(map[string]interface{}{"`et_id`": v.ParentId}, "`et_dimension`", "`et_type`") tarCont.GetCont(map[string]interface{}{"`et_id`": v.ParentId}, "`et_dimension`", "`et_type`")
@ -266,9 +266,11 @@ func (a *ApiMethod) VerifDepartDetasil(c *gin.Context) {
*/ */
func ChuLiTiBaoRenGuoDu(dimensionId, targetId, targetSunId, targetBylaws, postId int64, typeInt, class, level int, orgId string, manKey []string) { func ChuLiTiBaoRenGuoDu(dimensionId, targetId, targetSunId, targetBylaws, postId int64, typeInt, class, level int, orgId string, manKey []string) {
defer syncSeting.Done() defer syncSeting.Done()
if len(manKey) > 0 {
for _, v := range manKey { for _, v := range manKey {
handTarReport(dimensionId, targetId, targetSunId, targetBylaws, postId, typeInt, class, level, orgId, v) handTarReport(dimensionId, targetId, targetSunId, targetBylaws, postId, typeInt, class, level, orgId, v)
} }
}
} }
@ -389,3 +391,116 @@ func (a *ApiMethod) TestAndVerifyWorkflow(c *gin.Context) {
} }
} }
/*
*
@ 作者: 秦东
@ 时间: 2023-05-10 15:09:21
@ 功能: 校正指标细则关联关系
@ 参数
#
@ 返回值
#
@ 方法原型
#
*/
func (a *ApiMethod) XiaoZhengBumenBylaws(c *gin.Context) {
var detasilCont []modelskpi.DetailedTarget
// err := overall.CONSTANT_DB_KPI.Where("`dt_id` = 806").Find(&detasilCont).Error
err := overall.CONSTANT_DB_KPI.Find(&detasilCont).Error
if err != nil || len(detasilCont) < 1 {
publicmethod.Result(1, err, c, "没有数据")
return
}
var fenZhu []modelskpi.DetailedTarget
jbq := 0
for i, v := range detasilCont {
if (i+1)%100 == 0 {
jbq++
fenZhu = append(fenZhu, v)
fmt.Printf("满100分组---->%v---->%v---->%v---->%v\n", i, jbq, len(fenZhu), (i+1)%100)
syncSetings.Add(1)
go XiaoZhengCont(fenZhu)
var newFenzu []modelskpi.DetailedTarget
fenZhu = newFenzu
} else {
fenZhu = append(fenZhu, v)
}
}
if len(fenZhu) > 0 {
syncSetings.Add(1)
go XiaoZhengCont(fenZhu)
jbq++
fmt.Printf("还有剩余得---->%v---->%v\n", jbq, len(fenZhu))
}
syncSetings.Wait()
publicmethod.Result(0, fenZhu, c)
}
/*
*
@ 作者: 秦东
@ 时间: 2023-05-10 15:15:38
@ 功能: 部门细则校正操作
@ 参数
#
@ 返回值
#
@ 方法原型
#
*/
func XiaoZhengCont(bylawsList []modelskpi.DetailedTarget) {
defer syncSetings.Done()
if len(bylawsList) > 0 {
for _, v := range bylawsList {
//获取指标内容
var tarCont modelskpi.EvaluationTarget
tarCont.GetCont(map[string]interface{}{"`et_id`": v.ParentId}, "`et_dimension`", "`et_type`", "`et_relevant_departments`", "`et_report`")
orgIdStr := strings.Split(v.Paretment, ",") //关联部门
reportList := strings.Split(v.Reportary, ",") //关联提报人
if v.Paretment != "" && v.Reportary != "" {
fmt.Printf("人员信息----1----》%v----》%v----》%v\n", reportList, v.Reportary, len(reportList))
for _, ov := range orgIdStr { //循环处理栏目对照关系
handDepartmentTarget(tarCont.Dimension, v.ParentId, v.ParentIdSun, v.Id, 0, 3, 1, tarCont.Type, ov)
if len(reportList) > 0 {
syncSeting.Add(1)
go ChuLiTiBaoRenGuoDu(tarCont.Dimension, v.ParentId, v.ParentIdSun, v.Id, 0, 1, tarCont.Type, 3, ov, reportList)
}
}
}
if v.Paretment != "" && v.Reportary == "" && tarCont.Report != "" {
reportDepartList := strings.Split(tarCont.Report, ",") //关联提报人
fmt.Printf("人员信息----2----》%v\n", reportDepartList)
for _, ov := range orgIdStr { //循环处理栏目对照关系
handDepartmentTarget(tarCont.Dimension, v.ParentId, v.ParentIdSun, v.Id, 0, 3, 1, tarCont.Type, ov)
syncSeting.Add(1)
go ChuLiTiBaoRenGuoDu(tarCont.Dimension, v.ParentId, v.ParentIdSun, v.Id, 0, 1, tarCont.Type, 3, ov, reportDepartList)
}
}
if v.Paretment == "" && v.Reportary != "" && tarCont.RelevantDepartments != "" {
orgDepartIdStr := strings.Split(tarCont.RelevantDepartments, ",") //关联部门
fmt.Printf("人员信息----3----》%v\n", reportList)
for _, ov := range orgDepartIdStr { //循环处理栏目对照关系
handDepartmentTarget(tarCont.Dimension, v.ParentId, v.ParentIdSun, v.Id, 0, 3, 1, tarCont.Type, ov)
if len(reportList) > 0 {
syncSeting.Add(1)
go ChuLiTiBaoRenGuoDu(tarCont.Dimension, v.ParentId, v.ParentIdSun, v.Id, 0, 1, tarCont.Type, 3, ov, reportList)
}
}
}
}
syncSeting.Wait()
}
}

29
api/shiyan/maptostruct/sendwechat.go

@ -4,6 +4,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"key_performance_indicators/api/workwechat" "key_performance_indicators/api/workwechat"
"key_performance_indicators/middleware/grocerystore"
"key_performance_indicators/models/modelshr" "key_performance_indicators/models/modelshr"
"key_performance_indicators/models/modelskpi" "key_performance_indicators/models/modelskpi"
"key_performance_indicators/overall" "key_performance_indicators/overall"
@ -402,3 +403,31 @@ func (a *ApiMethod) UpdateMiniCard(c *gin.Context) {
publicmethod.Result(0, outPut, c) publicmethod.Result(0, outPut, c)
} }
/*
*
@ 作者: 秦东
@ 时间: 2023-05-09 08:44:15
@ 功能: 实验读取哈希
@ 参数
#
@ 返回值
#
@ 方法原型
#
*/
func (a *ApiMethod) GetHashGet(c *gin.Context) {
redisFileKey := fmt.Sprintf("ScanCode:Authentication:LoginApi_%v_%v", overall.CONSTANT_CONFIG.RedisPrefixStr.Alias, "e3bfa398fe9d0e1ab78a00ff59eff788")
redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5)
userRedisToken, _ := redisClient.HashGetAll(redisFileKey)
_, userRedisTokens := redisClient.HashGet(redisFileKey, "usertoken")
outPut := publicmethod.MapOut[string]()
outPut["userRedisToken"] = userRedisToken
outPut["userRedisTokens"] = userRedisTokens
publicmethod.Result(0, outPut, c)
}

31
api/version1/departmentseting/departmentpc/ding_xing.go

@ -164,7 +164,7 @@ func (a *ApiMethod) GetQualityBylawsTasks(c *gin.Context) {
myLoginCont, _ := publicmethod.LoginMyCont(c) myLoginCont, _ := publicmethod.LoginMyCont(c)
var qualEvaCont modelskpi.QualitativeEvaluationView var qualEvaCont modelskpi.QualitativeEvaluationView
gormDb := overall.CONSTANT_DB_KPI.Table(fmt.Sprintf("%s qe", qualEvaCont.TableName())).Select("qe.qe_id,qe.qe_target_sun,qe.qe_detailed_target,qe.qe_content,qe.qe_censor_cont,qe.qe_min_score,qe.qe_max_score,qe.qe_unit").Where("qe.`qe_type` = 1 AND qe.`qe_state` = 1 AND qe.`qe_accept_evaluation` = ? AND qe.`qe_target` = ?", receivedValue.OrgId, receivedValue.TargetId) gormDb := overall.CONSTANT_DB_KPI.Table(fmt.Sprintf("%s qe", qualEvaCont.TableName())).Select("qe.qe_id,qe.qe_target_sun,qe.qe_detailed_target,qe.qe_content,qe.qe_censor_cont,qe.qe_min_score,qe.qe_max_score,qe.qe_unit").Where("qe.`qe_type` = 1 AND qe.`qe_state` = 1 AND qe.`qe_accept_evaluation` = ? AND qe.`qe_target` = ?", receivedValue.OrgId, receivedValue.TargetId)
gormDb = gormDb.Joins("JOIN target_report td ON qe.qe_target = td.target_id AND qe.qe_accept_evaluation = td.`department_id` AND td.target_bylaws = qe.`qe_detailed_target` AND td.`type` = 1 AND td.`post_id` = 0 AND td.state = 1 AND td.type_level = 3 AND td.`man_key` = ?", myLoginCont.Key) gormDb = gormDb.Joins("JOIN target_report td ON qe.qe_target = td.target_id AND qe.qe_accept_evaluation = td.`department_id` AND td.target_bylaws = qe.`qe_detailed_target` AND td.`type` = 1 AND td.`post_id` = 0 AND td.state = 1 AND td.`man_key` = ?", myLoginCont.Key)
if receivedValue.OrgId != "" { if receivedValue.OrgId != "" {
gormDb = gormDb.Where("`qe_accept_evaluation` = ?", receivedValue.OrgId) gormDb = gormDb.Where("`qe_accept_evaluation` = ?", receivedValue.OrgId)
} }
@ -461,6 +461,7 @@ func (a *ApiMethod) SubmitQualityAssess(c *gin.Context) {
var workwechatErr error var workwechatErr error
if scoreFlowErr == nil && evalProFlowErr == nil && flowLogContErr == nil { if scoreFlowErr == nil && evalProFlowErr == nil && flowLogContErr == nil {
addErr := gormDb.Commit().Error addErr := gormDb.Commit().Error
fmt.Printf("addErr--->%v\n", addErr)
if addErr == nil { if addErr == nil {
if len(receivedValue.UploadFiles) > 0 { if len(receivedValue.UploadFiles) > 0 {
EditFileHandel(uuid, "score_flow", receivedValue.UploadFiles) EditFileHandel(uuid, "score_flow", receivedValue.UploadFiles)
@ -468,6 +469,7 @@ func (a *ApiMethod) SubmitQualityAssess(c *gin.Context) {
//下一个节点内容 //下一个节点内容
nextNodeStr := string(nextNodeJson) nextNodeStr := string(nextNodeJson)
if nextNodeStr != "" { //判断下个节点是否为空 if nextNodeStr != "" { //判断下个节点是否为空
fmt.Printf("nextNodeStr--->%v\n", nextNodeStr)
if len(haveWorkflow.NextNodeCont.UserList) > 0 { //判断下个节点是够有审批人 if len(haveWorkflow.NextNodeCont.UserList) > 0 { //判断下个节点是够有审批人
var recipient []string var recipient []string
var sendWechatUserKey []string var sendWechatUserKey []string
@ -504,6 +506,11 @@ func (a *ApiMethod) SubmitQualityAssess(c *gin.Context) {
templateCard.Source.Desc = fmt.Sprintf("%v-%v", haveWorkflow.NextNodeCont.NodeName, nodeType) templateCard.Source.Desc = fmt.Sprintf("%v-%v", haveWorkflow.NextNodeCont.NodeName, nodeType)
//任务id,同一个应用任务id不能重复,只能由数字、字母和“_-@”组成 //任务id,同一个应用任务id不能重复,只能由数字、字母和“_-@”组成
templateCard.TaskId = fmt.Sprintf("kpi_ratify_%v", uuid) templateCard.TaskId = fmt.Sprintf("kpi_ratify_%v", uuid)
templateCard.ActionMenu.Desc = "恒信高科"
var rightHand workwechat.ActionListCont
rightHand.Text = "恒信高科"
rightHand.Key = fmt.Sprintf("kpi_head_%v", publicmethod.GetUUid(7))
templateCard.ActionMenu.ActionList = append(templateCard.ActionMenu.ActionList, rightHand)
//主内容框 //主内容框
var dimeCont modelskpi.DutyClass var dimeCont modelskpi.DutyClass
dimeCont.GetCont(map[string]interface{}{"`id`": qualEvalCont.Dimension}, "`title`") dimeCont.GetCont(map[string]interface{}{"`id`": qualEvalCont.Dimension}, "`title`")
@ -567,29 +574,9 @@ func (a *ApiMethod) SubmitQualityAssess(c *gin.Context) {
templateCard.CardAction.Url = jumpUrl templateCard.CardAction.Url = jumpUrl
sendMsg.TemplateCard = templateCard sendMsg.TemplateCard = templateCard
callbackMsg, err = sendMsg.InitMes().SendMessage() callbackMsg, err = sendMsg.InitMes().SendMessage()
fmt.Printf("callbackMsg--->%v\n", string(callbackMsg))
workwechatErr = workwechat.WriteUpdateWechatTempmsg(callbackMsg, sendMsg, 1, uuid, sendWechatUserKey) workwechatErr = workwechat.WriteUpdateWechatTempmsg(callbackMsg, sendMsg, 1, uuid, sendWechatUserKey)
/*
*
@ 作者: 秦东
@ 时间: 2023-04-24 08:22:22
@ 功能: 写入企业微信模版信息发送回调
@ 参数
#wechatCallBack 文本发送回调
#sendMsg 发送文本信息
#typeClass 类型1文本通知型2图文展示型3按钮交互型4投票选择型5多项选择型
#ordeeId 审批记录Id
#enforcer 接收人
@ 返回值
#err
@ 方法原型
#func WriteUpdateWechatTempmsg(wechatCallBack []byte, sendMsg SentMiniMessage, typeClass int, ordeeId int64, enforcer []string) (err error)
*/
} }
} }
} }

5
api/version1/departmentseting/departmentpc/dingliang.go

@ -769,6 +769,11 @@ func (a *ApiMethod) SubmitQuantifyTarget(c *gin.Context) {
templateCard.Source.Desc = fmt.Sprintf("%v-%v", haveWorkflow.NextNodeCont.NodeName, nodeType) templateCard.Source.Desc = fmt.Sprintf("%v-%v", haveWorkflow.NextNodeCont.NodeName, nodeType)
//任务id,同一个应用任务id不能重复,只能由数字、字母和“_-@”组成 //任务id,同一个应用任务id不能重复,只能由数字、字母和“_-@”组成
templateCard.TaskId = fmt.Sprintf("kpi_ratify_%v", uuid) templateCard.TaskId = fmt.Sprintf("kpi_ratify_%v", uuid)
templateCard.ActionMenu.Desc = "恒信高科"
var rightHand workwechat.ActionListCont
rightHand.Text = "恒信高科"
rightHand.Key = fmt.Sprintf("kpi_head_%v", publicmethod.GetUUid(7))
templateCard.ActionMenu.ActionList = append(templateCard.ActionMenu.ActionList, rightHand)
//主内容框 //主内容框
templateCard.MainTitle.Title = fmt.Sprintf("考核周期:%v", publicmethod.UnixTimeToDay(occurrenceTime, 15)) templateCard.MainTitle.Title = fmt.Sprintf("考核周期:%v", publicmethod.UnixTimeToDay(occurrenceTime, 15))
//引用文献样式 //引用文献样式

6
api/version1/flowchart/myworkflow.go

@ -62,6 +62,7 @@ func (a *ApiMethod) GetApprovalRecord(c *gin.Context) {
gormDb = gormDb.Where("target_title LIKE ? OR bylaws_title LIKE ?", "%"+receivedValue.Title+"%", "%"+receivedValue.Title+"%") gormDb = gormDb.Where("target_title LIKE ? OR bylaws_title LIKE ?", "%"+receivedValue.Title+"%", "%"+receivedValue.Title+"%")
} }
userIdentity := publicmethod.DetermineUserIdentity(myLoginCont.Key) userIdentity := publicmethod.DetermineUserIdentity(myLoginCont.Key)
if myLoginCont.Role != "1" {
switch userIdentity.Level { switch userIdentity.Level {
case 1: case 1:
gormDb = gormDb.Where("FIND_IN_SET(?,`ep_participants`)", myLoginCont.Key) gormDb = gormDb.Where("FIND_IN_SET(?,`ep_participants`)", myLoginCont.Key)
@ -73,6 +74,7 @@ func (a *ApiMethod) GetApprovalRecord(c *gin.Context) {
gormDb = gormDb.Where("`ep_setup_department` IN ? OR `ep_accept_department` IN ?", userIdentity.OrgList, userIdentity.OrgList) gormDb = gormDb.Where("`ep_setup_department` IN ? OR `ep_accept_department` IN ?", userIdentity.OrgList, userIdentity.OrgList)
default: default:
} }
}
if receivedValue.OrgId != "" { if receivedValue.OrgId != "" {
gormDb = gormDb.Where("ep_accept_department = ? OR ep_setup_department = ?", receivedValue.OrgId, receivedValue.OrgId) gormDb = gormDb.Where("ep_accept_department = ? OR ep_setup_department = ?", receivedValue.OrgId, receivedValue.OrgId)
@ -92,8 +94,8 @@ func (a *ApiMethod) GetApprovalRecord(c *gin.Context) {
gormDb = gormDb.Where("ep_happen_time BETWEEN ? AND ?", startTime, endTime) gormDb = gormDb.Where("ep_happen_time BETWEEN ? AND ?", startTime, endTime)
} }
} }
jsonStr, _ := json.Marshal(userIdentity)
fmt.Printf("userIdentity------------>%v\n", userIdentity) fmt.Printf("userIdentity------------>%v\n", string(jsonStr))
var total int64 var total int64
totalErr := gormDb.Count(&total).Error totalErr := gormDb.Count(&total).Error
if totalErr != nil { if totalErr != nil {

47
api/workflow/currency_recipe/general_method.go

@ -2,6 +2,7 @@ package currency_recipe
import ( import (
"encoding/json" "encoding/json"
"fmt"
"key_performance_indicators/models/modelshr" "key_performance_indicators/models/modelshr"
"key_performance_indicators/models/modelskpi" "key_performance_indicators/models/modelskpi"
"key_performance_indicators/overall" "key_performance_indicators/overall"
@ -430,12 +431,12 @@ func BaseOrgGainOperator(orgId int64, performAction []NodeUserListCont) (userLis
if len(performAction) > 0 { if len(performAction) > 0 {
//获取行政组织所有行政组织上级和下级 //获取行政组织所有行政组织上级和下级
allOrg := publicmethod.HaveAllOrgRelation(orgId) allOrg := publicmethod.HaveAllOrgRelation(orgId)
// fmt.Printf("获取行政组织所有行政组织上级和下级--->%v--->%v\n", allOrg, orgId) fmt.Printf("获取行政组织所有行政组织上级和下级--->%v--->%v--->%v\n", allOrg, orgId, performAction)
// postOftoOrg := make(map[string][]int64, 0) // postOftoOrg := make(map[string][]int64, 0)
var gainDirector GainLeveDirector var gainDirector GainLeveDirector
for _, v := range performAction { for _, v := range performAction {
if v.Type == "position" { if v.Type == "position" {
gainDirector.GetPostBaseOrg(v.TargetID, allOrg) gainDirector.GetPostBaseOrg(v.TargetID, allOrg, orgId)
// postOftoOrg[v.TargetID] = GetPostBaseOrg(v.TargetID) // postOftoOrg[v.TargetID] = GetPostBaseOrg(v.TargetID)
} }
} }
@ -449,14 +450,15 @@ func BaseOrgGainOperator(orgId int64, performAction []NodeUserListCont) (userLis
/* /*
#unifyPosId 统一职务名称ID #unifyPosId 统一职务名称ID
#orgList 行政组织ID列表 #orgList 行政组织ID列表
#myOrgId 任务行政组织
*/ */
func (g *GainLeveDirector) GetPostBaseOrg(unifyPosId string, orgList []int64) { func (g *GainLeveDirector) GetPostBaseOrg(unifyPosId string, orgList []int64, myOrgId int64) {
var positionInfo modelshr.PositionUnify var positionInfo modelshr.PositionUnify
err := positionInfo.GetCont(map[string]interface{}{"`id`": unifyPosId}, "`content`") err := positionInfo.GetCont(map[string]interface{}{"`id`": unifyPosId}, "`content`")
if err != nil { if err != nil {
return return
} }
// fmt.Printf("获取职务关联得行政组织-2-->%v\n", positionInfo) fmt.Printf("获取职务关联得行政组织-2-->%v-->%v-->%v\n", unifyPosId, positionInfo, myOrgId)
var posIdStr []int64 var posIdStr []int64
err = json.Unmarshal([]byte(positionInfo.Content), &posIdStr) err = json.Unmarshal([]byte(positionInfo.Content), &posIdStr)
if err != nil { if err != nil {
@ -465,12 +467,15 @@ func (g *GainLeveDirector) GetPostBaseOrg(unifyPosId string, orgList []int64) {
//获取相关职务数据 //获取相关职务数据
var posCont []modelshr.PostDutiesJob var posCont []modelshr.PostDutiesJob
err = overall.CONSTANT_DB_HR.Model(&modelshr.PostDutiesJob{}).Select("`id`,`name`,`adm_org`,`weight`").Where("`id` IN ?", posIdStr).Find(&posCont).Error err = overall.CONSTANT_DB_HR.Model(&modelshr.PostDutiesJob{}).Select("`id`,`name`,`adm_org`,`weight`").Where("`id` IN ?", posIdStr).Find(&posCont).Error
// fmt.Printf("获取职务关联得行政组织-1-->%v\n", orgIdList) fmt.Printf("获取职务关联得行政组织-1-->%v\n", posCont)
if err != nil || len(posCont) < 1 { if err != nil || len(posCont) < 1 {
fmt.Printf("获取职务关联得行政组织-1-11111->%v\n", err)
return return
} }
var orgIdList []int64 var orgIdList []int64
var orgPosId []JudgeOrgOfPosition var orgPosId []JudgeOrgOfPosition
fmt.Printf("获取职务关联得行政组织-1-11112333111->%v\n", err)
for _, v := range posCont { //组织岗位与行政组织关系 for _, v := range posCont { //组织岗位与行政组织关系
if !publicmethod.IsInTrue[int64](v.AdministrativeOrganization, orgIdList) { if !publicmethod.IsInTrue[int64](v.AdministrativeOrganization, orgIdList) {
orgIdList = append(orgIdList, v.AdministrativeOrganization) orgIdList = append(orgIdList, v.AdministrativeOrganization)
@ -484,9 +489,12 @@ func (g *GainLeveDirector) GetPostBaseOrg(unifyPosId string, orgList []int64) {
} }
jieguo := publicmethod.Intersect[int64](orgList, orgIdList) //获取交集,判断是否有相关职位 jieguo := publicmethod.Intersect[int64](orgList, orgIdList) //获取交集,判断是否有相关职位
// fmt.Printf("获取交集,判断是否有相关职位-1-->%v-->%v-->%v-->%v\n", jieguo, orgList, orgIdList, orgPosId) fmt.Printf("获取交集,判断是否有相关职位-1-->%v-->%v-->%v-->%v\n", jieguo, orgList, orgIdList, orgPosId)
//获取相关岗位人员 //获取相关岗位人员
var myIdList []int64
if len(jieguo) > 0 { if len(jieguo) > 0 {
for _, ovp := range orgPosId { for _, ovp := range orgPosId {
if publicmethod.IsInTrue[int64](ovp.OrgId, jieguo) { if publicmethod.IsInTrue[int64](ovp.OrgId, jieguo) {
var userInfoList []modelshr.PersonArchives var userInfoList []modelshr.PersonArchives
@ -497,12 +505,39 @@ func (g *GainLeveDirector) GetPostBaseOrg(unifyPosId string, orgList []int64) {
err = gormDb.Find(&userInfoList).Error err = gormDb.Find(&userInfoList).Error
if err == nil && len(userInfoList) > 0 { if err == nil && len(userInfoList) > 0 {
for _, usev := range userInfoList { for _, usev := range userInfoList {
if !publicmethod.IsInTrue[int64](usev.Id, g.UserId) {
g.UserId = append(g.UserId, usev.Id)
myIdList = append(myIdList, usev.Id)
}
g.UserList = append(g.UserList, usev) g.UserList = append(g.UserList, usev)
} }
} }
jsonCont, _ := json.Marshal(userInfoList)
fmt.Printf("负责人列表--sssss->%v--->%v\n", g.UserId, string(jsonCont))
}
}
}
//获取指定的负责范围
// for _, ovpnew := range orgPosId {
// if publicmethod.IsInTrue[int64](ovpnew.OrgId, jieguo) {
var userInfoListEs []modelshr.PersonArchives
gormDb := overall.CONSTANT_DB_HR.Where("`position` IN ? AND `person_in_charge` = 1 AND FIND_IN_SET(?,`responsible_department`) AND `emp_type` BETWEEN ? AND ?", posIdStr, myOrgId, 1, 10)
err = gormDb.Find(&userInfoListEs).Error
if err == nil && len(userInfoListEs) > 0 {
for _, usev := range userInfoListEs {
fmt.Printf("负责人列表-1111-->%v--->%v--->%v\n", g.UserId, !publicmethod.IsInTrue[int64](usev.Id, g.UserId), myIdList)
if !publicmethod.IsInTrue[int64](usev.Id, g.UserId) {
fmt.Printf("负责人列表-1222--%v\n", usev.Id)
g.UserList = append(g.UserList, usev)
} }
} }
} }
jsonCont, _ := json.Marshal(userInfoListEs)
fmt.Printf("负责人列表--->%v--->%v\n", g.UserId, string(jsonCont))
// }
// }
} }

1
api/workflow/currency_recipe/type.go

@ -210,6 +210,7 @@ type GainLeveDirector struct {
Step int `json:"step"` // Step int `json:"step"` //
Leve int `json:"leve"` Leve int `json:"leve"`
UserList []modelshr.PersonArchives UserList []modelshr.PersonArchives
UserId []int64
} }
// 判断事那个行政组织得相关岗位 // 判断事那个行政组织得相关岗位

1
api/workflow/workflowengine/workflowapi.go

@ -67,6 +67,7 @@ func (a *ApiMethod) GetWorkFlowFullView(c *gin.Context) {
jieguo := workflowInfo.InitWorkflow(receivedValue.FlowWorkId, "", myKey, receivedValue.OrgId).SendData() jieguo := workflowInfo.InitWorkflow(receivedValue.FlowWorkId, "", myKey, receivedValue.OrgId).SendData()
// sjkdjk, _ := json.Marshal(receivedValue) // sjkdjk, _ := json.Marshal(receivedValue)
// fmt.Printf("初始化条件---》%v/n", string(sjkdjk)) // fmt.Printf("初始化条件---》%v/n", string(sjkdjk))
// return
if !jieguo.IsTrue { if !jieguo.IsTrue {
publicmethod.Result(1, jieguo, c, "未能获取到流程!") publicmethod.Result(1, jieguo, c, "未能获取到流程!")
} else { } else {

18
api/workwechat/message.go

@ -194,15 +194,15 @@ func UpdateWechatMsgCont(typeClass, attribute int, orderkey int64, enforcer stri
if orderkey == 0 || enforcer == "" { if orderkey == 0 || enforcer == "" {
return return
} }
var updateWechatCont modelskpi.UpdateWechatTempmsg var updateWechatCont []modelskpi.UpdateWechatTempmsg
err = overall.CONSTANT_DB_KPI.Where("`type` = ? AND `orderkey` = ? AND FIND_IN_SET(?,`enforcer`)", typeClass, orderkey, enforcer).Find(&updateWechatCont).Error err = overall.CONSTANT_DB_KPI.Where("`sate` = 2 AND `type` = ? AND `orderkey` = ? AND FIND_IN_SET(?,`enforcer`)", typeClass, orderkey, enforcer).Find(&updateWechatCont).Error
if err != nil || updateWechatCont.Sendmsgcont == "" || updateWechatCont.ResponseCode == "" || updateWechatCont.State == 1 { if err != nil || len(updateWechatCont) < 1 {
return return
} }
for _, uv := range updateWechatCont {
sendUpdateMsg := publicmethod.MapOut[string]() sendUpdateMsg := publicmethod.MapOut[string]()
var weChatMsgCont SentMiniMessage var weChatMsgCont SentMiniMessage
json.Unmarshal([]byte(updateWechatCont.Sendmsgcont), &weChatMsgCont) json.Unmarshal([]byte(uv.Sendmsgcont), &weChatMsgCont)
templateCardCont := publicmethod.MapOut[string]() templateCardCont := publicmethod.MapOut[string]()
templateCardCont["card_type"] = weChatMsgCont.TemplateCard.CardType templateCardCont["card_type"] = weChatMsgCont.TemplateCard.CardType
@ -233,7 +233,7 @@ func UpdateWechatMsgCont(typeClass, attribute int, orderkey int64, enforcer stri
} }
templateCardCont["jump_list"] = weChatMsgCont.TemplateCard.JumpList templateCardCont["jump_list"] = weChatMsgCont.TemplateCard.JumpList
receiveMsgMan := strings.Split(updateWechatCont.Enforcer, ",") receiveMsgMan := strings.Split(uv.Enforcer, ",")
if len(receiveMsgMan) < 1 { if len(receiveMsgMan) < 1 {
return return
@ -260,7 +260,7 @@ func UpdateWechatMsgCont(typeClass, attribute int, orderkey int64, enforcer stri
} }
sendUpdateMsg["userids"] = weCahtOpenId sendUpdateMsg["userids"] = weCahtOpenId
sendUpdateMsg["agentid"] = weChatMsgCont.AgentId sendUpdateMsg["agentid"] = weChatMsgCont.AgentId
sendUpdateMsg["response_code"] = updateWechatCont.ResponseCode sendUpdateMsg["response_code"] = uv.ResponseCode
sendUpdateMsg["enable_id_trans"] = 1 sendUpdateMsg["enable_id_trans"] = 1
sendUpdateMsg["template_card"] = templateCardCont sendUpdateMsg["template_card"] = templateCardCont
@ -272,6 +272,8 @@ func UpdateWechatMsgCont(typeClass, attribute int, orderkey int64, enforcer stri
editCont := publicmethod.MapOut[string]() editCont := publicmethod.MapOut[string]()
editCont["`sate`"] = 1 editCont["`sate`"] = 1
editCont["`time`"] = time.Now().Unix() editCont["`time`"] = time.Now().Unix()
err = editUpdateWechatCont.EiteCont(map[string]interface{}{"`id`": updateWechatCont.Id}, editCont) err = editUpdateWechatCont.EiteCont(map[string]interface{}{"`id`": uv.Id}, editCont)
}
return return
} }

3
apirouter/apishiyan/maptostruct.go

@ -29,6 +29,7 @@ func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) {
apiRouter.POST("correcting_depart_man", methodBinding.CorrectingDepartAndMan) //验证指标关联部门与指标关联提报人数据 apiRouter.POST("correcting_depart_man", methodBinding.CorrectingDepartAndMan) //验证指标关联部门与指标关联提报人数据
apiRouter.POST("verif_depart_sontarget", methodBinding.VerifDepartSonTarget) //验证部门子栏目关联对照 apiRouter.POST("verif_depart_sontarget", methodBinding.VerifDepartSonTarget) //验证部门子栏目关联对照
apiRouter.POST("verif_depart_detasil", methodBinding.VerifDepartDetasil) //验证部门指标细则关系对照 apiRouter.POST("verif_depart_detasil", methodBinding.VerifDepartDetasil) //验证部门指标细则关系对照
apiRouter.POST("new_verif_depart_detasil", methodBinding.XiaoZhengBumenBylaws) //验证部门指标细则关系对照
apiRouter.POST("xzbkhbm", methodBinding.XiangzhengBeikaoBumen) //验证部门指标细则关系对照 apiRouter.POST("xzbkhbm", methodBinding.XiangzhengBeikaoBumen) //验证部门指标细则关系对照
@ -42,5 +43,7 @@ func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) {
apiRouter.POST("send_message_mini", methodBinding.SendMessageMini) //发送文本信息迷你消息 apiRouter.POST("send_message_mini", methodBinding.SendMessageMini) //发送文本信息迷你消息
apiRouter.POST("update_mini_card", methodBinding.UpdateMiniCard) //更新文本信息迷你消息 apiRouter.POST("update_mini_card", methodBinding.UpdateMiniCard) //更新文本信息迷你消息
apiRouter.POST("get_hash_get", methodBinding.GetHashGet) //实验读取哈希
} }
} }

20
config/configDatabase/database.yaml

@ -28,17 +28,17 @@ wechat:
gorm_log: false #是否开启gorm日志 gorm_log: false #是否开启gorm日志
#HR数据库 #HR数据库
hrdatabase: hrdatabase:
# url_path: '127.0.0.1' #数据库地址 url_path: '127.0.0.1' #数据库地址
# port: 3306 #数据库端口 port: 3306 #数据库端口
# name: 'hr_new' #数据库名称
# username: 'root' #数据库用户民
# password: 'root' #数据库密码
url_path: '120.224.6.6' #数据库地址
port: 6666 #数据库端口
name: 'hr_new' #数据库名称 name: 'hr_new' #数据库名称
username: 'hr_new' #数据库用户民 username: 'root' #数据库用户民
password: 'AnknKiXiXaxNrw78' #数据库密码 password: 'root' #数据库密码
# url_path: '120.224.6.6' #数据库地址
# port: 6666 #数据库端口
# name: 'hr_new' #数据库名称
# username: 'hr_new' #数据库用户民
# password: 'AnknKiXiXaxNrw78' #数据库密码
charset: 'utf8mb4' #数据库编码方式 charset: 'utf8mb4' #数据库编码方式
parseTime: 'True' #是否自动转换时间 parseTime: 'True' #是否自动转换时间

2
identification/interceptor/identity.go

@ -28,7 +28,7 @@ func AuthenticateUser() gin.HandlerFunc {
redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5) redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS5)
userRedisToken, isTrue := redisClient.HashGetAll(redisFileKey) userRedisToken, isTrue := redisClient.HashGetAll(redisFileKey)
if isTrue == false { if isTrue == false {
response.FailWithDetailed(gin.H{"reload": false, "code": 301}, "未登录或非法访问", c) response.FailWithDetailed(gin.H{"reload": false, "code": 301}, redisFileKey, c)
c.Abort() c.Abort()
return return
} }

2
overall/publicmethod/formatOutput.go

@ -182,7 +182,7 @@ func DetermineUserIdentity(userKey int64) (identity outShenFen) {
overall.CONSTANT_DB_System_Permission.Where("`state` = 1 AND `system` = ? AND `id` IN ? ", "kpi", roleList).Find(&roleVerify) overall.CONSTANT_DB_System_Permission.Where("`state` = 1 AND `system` = ? AND `id` IN ? ", "kpi", roleList).Find(&roleVerify)
//岗位权限范围判定 //岗位权限范围判定
var postVerify modelssystempermission.Empower var postVerify modelssystempermission.Empower
postVerify.GetCont(map[string]interface{}{"`id`": userCont.Position, "`state`": 1, "`system`": "kpi"}) postVerify.GetCont(map[string]interface{}{"`post_id`": userCont.Position, "`state`": 1, "`system`": "kpi"})
if roleVerify.Level >= postVerify.Level { if roleVerify.Level >= postVerify.Level {
identity.Level = roleVerify.Level identity.Level = roleVerify.Level
} else { } else {

Loading…
Cancel
Save