作者 tangxuhui

调整搜索条件

1 -{"D:\\workspaceGo\\src\\allied-creation-basic\\pkg\\port\\beego":1629701389888857200}  
  1 +{"D:\\workspaceGo\\src\\allied-creation-basic\\pkg\\port\\beego":1630467905783651600}
1 package service 1 package service
2 2
3 import ( 3 import (
  4 + "fmt"
  5 +
4 "github.com/linmadan/egglib-go/core/application" 6 "github.com/linmadan/egglib-go/core/application"
5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/factory" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/factory"
6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/systemSetting/command" 8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/systemSetting/command"
@@ -87,9 +89,6 @@ func (systemSettingService *SystemSettingService) ListSystemSetting(listSystemSe @@ -87,9 +89,6 @@ func (systemSettingService *SystemSettingService) ListSystemSetting(listSystemSe
87 queryOption := map[string]interface{}{ 89 queryOption := map[string]interface{}{
88 "companyId": listSystemSettingQuery.CompanyId, 90 "companyId": listSystemSettingQuery.CompanyId,
89 } 91 }
90 - if len(listSystemSettingQuery.SettingCode) > 0 {  
91 - queryOption["settingCode"] = listSystemSettingQuery.SettingCode  
92 - }  
93 _, systemSettings, err := systemSettingRepository.Find(queryOption) 92 _, systemSettings, err := systemSettingRepository.Find(queryOption)
94 if err != nil { 93 if err != nil {
95 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 94 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -102,7 +101,8 @@ func (systemSettingService *SystemSettingService) ListSystemSetting(listSystemSe @@ -102,7 +101,8 @@ func (systemSettingService *SystemSettingService) ListSystemSetting(listSystemSe
102 code := systemSettings[i].SettingCode 101 code := systemSettings[i].SettingCode
103 settingMap[code] = systemSettings[i] 102 settingMap[code] = systemSettings[i]
104 } 103 }
105 - defaultSettings := new(domain.SystemSetting).GetDefaultSetting("", listSystemSettingQuery.SettingName) 104 + fmt.Println(listSystemSettingQuery.SettingCode, listSystemSettingQuery.SettingName)
  105 + defaultSettings := new(domain.SystemSetting).GetDefaultSetting(listSystemSettingQuery.SettingCode, listSystemSettingQuery.SettingName)
106 for i := range defaultSettings { 106 for i := range defaultSettings {
107 if v, ok := settingMap[defaultSettings[i].SettingCode]; ok { 107 if v, ok := settingMap[defaultSettings[i].SettingCode]; ok {
108 defaultSettings[i].Value = v.Value 108 defaultSettings[i].Value = v.Value
@@ -76,7 +76,7 @@ var defaultsysSettingList = []SystemSetting{ @@ -76,7 +76,7 @@ var defaultsysSettingList = []SystemSetting{
76 } 76 }
77 77
78 func (systemSetting *SystemSetting) GetDefaultSetting(settingCode string, settingName string) []SystemSetting { 78 func (systemSetting *SystemSetting) GetDefaultSetting(settingCode string, settingName string) []SystemSetting {
79 - var list []SystemSetting 79 + list := []SystemSetting{}
80 for i := range defaultsysSettingList { 80 for i := range defaultsysSettingList {
81 settingCodeOk := true 81 settingCodeOk := true
82 settingNameOk := true 82 settingNameOk := true
@@ -38,6 +38,10 @@ func (controller *SystemSettingController) GetSystemSetting() { @@ -38,6 +38,10 @@ func (controller *SystemSettingController) GetSystemSetting() {
38 func (controller *SystemSettingController) ListSystemSetting() { 38 func (controller *SystemSettingController) ListSystemSetting() {
39 systemSettingService := service.NewSystemSettingService(nil) 39 systemSettingService := service.NewSystemSettingService(nil)
40 listSystemSettingQuery := &query.ListSystemSettingQuery{} 40 listSystemSettingQuery := &query.ListSystemSettingQuery{}
  41 + err := controller.Unmarshal(listSystemSettingQuery)
  42 + if err != nil {
  43 + log.Logger.Debug(err.Error())
  44 + }
41 listSystemSettingQuery.CompanyId = controller.GetCompanyId() 45 listSystemSettingQuery.CompanyId = controller.GetCompanyId()
42 data, err := systemSettingService.ListSystemSetting(listSystemSettingQuery) 46 data, err := systemSettingService.ListSystemSetting(listSystemSettingQuery)
43 controller.Response(data, err) 47 controller.Response(data, err)