作者 tangxvhui

完善“筛选结果”的功能 权限,以及bug 修复

... ... @@ -120,7 +120,7 @@ type ChanceSelfCheckData struct {
func (m *Chance) GetSelfCheckData() []ChanceSelfCheckData {
var data []ChanceSelfCheckData
if m.CheckResultStatus == CheckResultStatusPass {
if m.CheckResultStatus > CheckResultStatusWait {
json.Unmarshal([]byte(m.CheckResult), &data)
} else {
json.Unmarshal([]byte(m.SelfChecks), &data)
... ...
package audit
import (
"encoding/json"
"fmt"
"oppmg/common/log"
"oppmg/models"
... ... @@ -244,15 +243,7 @@ func ChanceCheckResultPass(chanceId int64, companyId int64) error {
return protocol.NewErrWithMessage("1")
}
chanceData.CheckResultStatus = models.CheckResultStatusPass
checkResultData, err := models.GetChanceCheckResultByChancce(chanceId)
if err != nil {
log.Error("未找到相应的筛选结果")
}
collectCheckData := collectChanceCheckResultData(checkResultData)
if jsonBt, err := json.Marshal(collectCheckData); err == nil {
chanceData.CheckResult = string(jsonBt)
}
err = models.UpdateChanceById(chanceData, []string{"CheckResultStatus", "CheckResult"})
err = models.UpdateChanceById(chanceData, []string{"CheckResultStatus"})
if err != nil {
log.Error("更新chance数据失败,err;%s", err)
}
... ... @@ -274,15 +265,7 @@ func ChanceCheckResultNoPass(chanceId int64, companyId int64) error {
return protocol.NewErrWithMessage("1")
}
chanceData.CheckResultStatus = models.CheckResultStatusNOPass
checkResultData, err := models.GetChanceCheckResultByChancce(chanceId)
if err != nil {
log.Error("未找到相应的筛选结果")
}
collectCheckData := collectChanceCheckResultData(checkResultData)
if jsonBt, err := json.Marshal(collectCheckData); err == nil {
chanceData.CheckResult = string(jsonBt)
}
err = models.UpdateChanceById(chanceData, []string{"CheckResultStatus", "CheckResult"})
err = models.UpdateChanceById(chanceData, []string{"CheckResultStatus"})
if err != nil {
log.Error("更新chance数据失败,err;%s", err)
}
... ...
... ... @@ -21,6 +21,7 @@ const (
M_SYSTEM_ANNOUNCEMENT string = "SYSTEM_ANNOUNCEMENT" //公告管理
M_SYSTEM_ACHIEVEMENT string = "SYSTEM_ACHIEVEMENT" //成果管理
M_SYSTEM_RANK string = "SYSTEM_RANK" //排行榜配置管理
M_SYSTEM_CHECK_RESULT string = "SYSTEM_CHECK_RESULT" //机会筛选结果
)
type PermissionOptionObject interface {
... ... @@ -112,6 +113,9 @@ var RouterPermission = map[string]PermissionBase{
"/v1/achievement/delete": PermissionBase{CodeName: M_SYSTEM_ACHIEVEMENT, ActionName: "default"},
"/v1/achievement/forbid_allow": PermissionBase{CodeName: M_SYSTEM_ACHIEVEMENT, ActionName: "default"},
"/v1/achievement/remain/score": PermissionBase{CodeName: M_SYSTEM_ACHIEVEMENT, ActionName: "default"},
"/v1/audit/check_result/list": PermissionBase{CodeName: M_SYSTEM_CHECK_RESULT, ActionName: "default"},
"/v1/audit/check_result/info": PermissionBase{CodeName: M_SYSTEM_CHECK_RESULT, ActionName: "default"},
"/v1/audit/check_result/pass_or_no": PermissionBase{CodeName: M_SYSTEM_CHECK_RESULT, ActionName: "default"},
}
type CodeToObject func() PermissionOptionObject
... ...
... ... @@ -139,12 +139,7 @@ func (p *OptionOpportunity) GetValidFunc(k string) bool {
"close_chance": p.ValidCloseChance,
"edit_public_status": p.ValidEditPublicStatus,
}
/*
EditSorce int `json:"edit_sorce"`
EditPublicStatus int `json:"edit_public_status"`
CloseChance int `json:"close_chance"`
EditChance int `json:"edit_chance"`
*/
if fn, ok := m[k]; ok {
b := fn()
return b
... ...