作者 tangxvhui

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

@@ -120,7 +120,7 @@ type ChanceSelfCheckData struct { @@ -120,7 +120,7 @@ type ChanceSelfCheckData struct {
120 120
121 func (m *Chance) GetSelfCheckData() []ChanceSelfCheckData { 121 func (m *Chance) GetSelfCheckData() []ChanceSelfCheckData {
122 var data []ChanceSelfCheckData 122 var data []ChanceSelfCheckData
123 - if m.CheckResultStatus == CheckResultStatusPass { 123 + if m.CheckResultStatus > CheckResultStatusWait {
124 json.Unmarshal([]byte(m.CheckResult), &data) 124 json.Unmarshal([]byte(m.CheckResult), &data)
125 } else { 125 } else {
126 json.Unmarshal([]byte(m.SelfChecks), &data) 126 json.Unmarshal([]byte(m.SelfChecks), &data)
1 package audit 1 package audit
2 2
3 import ( 3 import (
4 - "encoding/json"  
5 "fmt" 4 "fmt"
6 "oppmg/common/log" 5 "oppmg/common/log"
7 "oppmg/models" 6 "oppmg/models"
@@ -244,15 +243,7 @@ func ChanceCheckResultPass(chanceId int64, companyId int64) error { @@ -244,15 +243,7 @@ func ChanceCheckResultPass(chanceId int64, companyId int64) error {
244 return protocol.NewErrWithMessage("1") 243 return protocol.NewErrWithMessage("1")
245 } 244 }
246 chanceData.CheckResultStatus = models.CheckResultStatusPass 245 chanceData.CheckResultStatus = models.CheckResultStatusPass
247 - checkResultData, err := models.GetChanceCheckResultByChancce(chanceId)  
248 - if err != nil {  
249 - log.Error("未找到相应的筛选结果")  
250 - }  
251 - collectCheckData := collectChanceCheckResultData(checkResultData)  
252 - if jsonBt, err := json.Marshal(collectCheckData); err == nil {  
253 - chanceData.CheckResult = string(jsonBt)  
254 - }  
255 - err = models.UpdateChanceById(chanceData, []string{"CheckResultStatus", "CheckResult"}) 246 + err = models.UpdateChanceById(chanceData, []string{"CheckResultStatus"})
256 if err != nil { 247 if err != nil {
257 log.Error("更新chance数据失败,err;%s", err) 248 log.Error("更新chance数据失败,err;%s", err)
258 } 249 }
@@ -274,15 +265,7 @@ func ChanceCheckResultNoPass(chanceId int64, companyId int64) error { @@ -274,15 +265,7 @@ func ChanceCheckResultNoPass(chanceId int64, companyId int64) error {
274 return protocol.NewErrWithMessage("1") 265 return protocol.NewErrWithMessage("1")
275 } 266 }
276 chanceData.CheckResultStatus = models.CheckResultStatusNOPass 267 chanceData.CheckResultStatus = models.CheckResultStatusNOPass
277 - checkResultData, err := models.GetChanceCheckResultByChancce(chanceId)  
278 - if err != nil {  
279 - log.Error("未找到相应的筛选结果")  
280 - }  
281 - collectCheckData := collectChanceCheckResultData(checkResultData)  
282 - if jsonBt, err := json.Marshal(collectCheckData); err == nil {  
283 - chanceData.CheckResult = string(jsonBt)  
284 - }  
285 - err = models.UpdateChanceById(chanceData, []string{"CheckResultStatus", "CheckResult"}) 268 + err = models.UpdateChanceById(chanceData, []string{"CheckResultStatus"})
286 if err != nil { 269 if err != nil {
287 log.Error("更新chance数据失败,err;%s", err) 270 log.Error("更新chance数据失败,err;%s", err)
288 } 271 }
@@ -21,6 +21,7 @@ const ( @@ -21,6 +21,7 @@ const (
21 M_SYSTEM_ANNOUNCEMENT string = "SYSTEM_ANNOUNCEMENT" //公告管理 21 M_SYSTEM_ANNOUNCEMENT string = "SYSTEM_ANNOUNCEMENT" //公告管理
22 M_SYSTEM_ACHIEVEMENT string = "SYSTEM_ACHIEVEMENT" //成果管理 22 M_SYSTEM_ACHIEVEMENT string = "SYSTEM_ACHIEVEMENT" //成果管理
23 M_SYSTEM_RANK string = "SYSTEM_RANK" //排行榜配置管理 23 M_SYSTEM_RANK string = "SYSTEM_RANK" //排行榜配置管理
  24 + M_SYSTEM_CHECK_RESULT string = "SYSTEM_CHECK_RESULT" //机会筛选结果
24 ) 25 )
25 26
26 type PermissionOptionObject interface { 27 type PermissionOptionObject interface {
@@ -112,6 +113,9 @@ var RouterPermission = map[string]PermissionBase{ @@ -112,6 +113,9 @@ var RouterPermission = map[string]PermissionBase{
112 "/v1/achievement/delete": PermissionBase{CodeName: M_SYSTEM_ACHIEVEMENT, ActionName: "default"}, 113 "/v1/achievement/delete": PermissionBase{CodeName: M_SYSTEM_ACHIEVEMENT, ActionName: "default"},
113 "/v1/achievement/forbid_allow": PermissionBase{CodeName: M_SYSTEM_ACHIEVEMENT, ActionName: "default"}, 114 "/v1/achievement/forbid_allow": PermissionBase{CodeName: M_SYSTEM_ACHIEVEMENT, ActionName: "default"},
114 "/v1/achievement/remain/score": PermissionBase{CodeName: M_SYSTEM_ACHIEVEMENT, ActionName: "default"}, 115 "/v1/achievement/remain/score": PermissionBase{CodeName: M_SYSTEM_ACHIEVEMENT, ActionName: "default"},
  116 + "/v1/audit/check_result/list": PermissionBase{CodeName: M_SYSTEM_CHECK_RESULT, ActionName: "default"},
  117 + "/v1/audit/check_result/info": PermissionBase{CodeName: M_SYSTEM_CHECK_RESULT, ActionName: "default"},
  118 + "/v1/audit/check_result/pass_or_no": PermissionBase{CodeName: M_SYSTEM_CHECK_RESULT, ActionName: "default"},
115 } 119 }
116 120
117 type CodeToObject func() PermissionOptionObject 121 type CodeToObject func() PermissionOptionObject
@@ -139,12 +139,7 @@ func (p *OptionOpportunity) GetValidFunc(k string) bool { @@ -139,12 +139,7 @@ func (p *OptionOpportunity) GetValidFunc(k string) bool {
139 "close_chance": p.ValidCloseChance, 139 "close_chance": p.ValidCloseChance,
140 "edit_public_status": p.ValidEditPublicStatus, 140 "edit_public_status": p.ValidEditPublicStatus,
141 } 141 }
142 - /*  
143 - EditSorce int `json:"edit_sorce"`  
144 - EditPublicStatus int `json:"edit_public_status"`  
145 - CloseChance int `json:"close_chance"`  
146 - EditChance int `json:"edit_chance"`  
147 - */ 142 +
148 if fn, ok := m[k]; ok { 143 if fn, ok := m[k]; ok {
149 b := fn() 144 b := fn()
150 return b 145 return b