|
|
|
@ -1,6 +1,7 @@ |
|
|
|
package jurisdictionpc |
|
|
|
|
|
|
|
import ( |
|
|
|
"key_performance_indicators/models/modelsschool" |
|
|
|
"key_performance_indicators/models/modelssystempermission" |
|
|
|
"key_performance_indicators/overall" |
|
|
|
"key_performance_indicators/overall/publicmethod" |
|
|
|
@ -89,3 +90,53 @@ func (a *ApiMethod) EditPower(c *gin.Context) { |
|
|
|
// overall.CONSTANT_DB_System_Permission.Model(&modelssystempermission.Empower{}).Where("`state` = 1 AND `post_id` = ? AND `system` = ?", receivedValue.PostId, receivedValue.SystemName).Not(map[string]interface{}{"point_id": receivedValue.PointId}).Updates(&otherSaveData)
|
|
|
|
// publicmethod.Result(0, saveData, c)
|
|
|
|
} |
|
|
|
|
|
|
|
// 相关系统菜单
|
|
|
|
func (a *ApiMethod) SystemAboutMenu(c *gin.Context) { |
|
|
|
var receivedValue publicmethod.PublicName |
|
|
|
err := c.ShouldBindJSON(&receivedValue) |
|
|
|
if err != nil { |
|
|
|
publicmethod.Result(100, err, c) |
|
|
|
return |
|
|
|
} |
|
|
|
if receivedValue.Name == "" { |
|
|
|
publicmethod.Result(101, err, c) |
|
|
|
return |
|
|
|
} |
|
|
|
var systemPower modelssystempermission.Appsystem |
|
|
|
err = systemPower.GetCont(map[string]interface{}{"`system`": receivedValue.Name}) |
|
|
|
if err != nil { |
|
|
|
publicmethod.Result(105, err, c) |
|
|
|
return |
|
|
|
} |
|
|
|
if systemPower.State == 2 { |
|
|
|
publicmethod.Result(1, err, c, "该系统授权已经禁用!") |
|
|
|
return |
|
|
|
} |
|
|
|
if systemPower.State == 3 { |
|
|
|
publicmethod.Result(1, err, c, "该系统授权已经取消合作!") |
|
|
|
return |
|
|
|
} |
|
|
|
var menuThree []powerThree |
|
|
|
if systemPower.ApiUrl != "" { |
|
|
|
//api入口不为空的情况下采用get访问方式接收数据
|
|
|
|
} else { |
|
|
|
//api入口为空,采用系统内置获取授权菜单
|
|
|
|
switch systemPower.Coder { |
|
|
|
default: |
|
|
|
//获取绩效考核菜单树
|
|
|
|
menuThree = kpiMenuThree() |
|
|
|
} |
|
|
|
} |
|
|
|
publicmethod.Result(0, menuThree, c) |
|
|
|
} |
|
|
|
|
|
|
|
// kpi菜单树
|
|
|
|
func kpiMenuThree() (menuThree []powerThree) { |
|
|
|
var menuList []modelsschool.SystemMenu |
|
|
|
err := overall.CONSTANT_DB_Master.Where("`m_steat` = 1").Find(&menuList).Error |
|
|
|
if err != nil { |
|
|
|
return |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
|