作者 tangxuhui

调整搜索条件

{"D:\\workspaceGo\\src\\allied-creation-basic\\pkg\\port\\beego":1629701389888857200}
\ No newline at end of file
{"D:\\workspaceGo\\src\\allied-creation-basic\\pkg\\port\\beego":1630467905783651600}
\ No newline at end of file
... ...
package service
import (
"fmt"
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/factory"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/systemSetting/command"
... ... @@ -87,9 +89,6 @@ func (systemSettingService *SystemSettingService) ListSystemSetting(listSystemSe
queryOption := map[string]interface{}{
"companyId": listSystemSettingQuery.CompanyId,
}
if len(listSystemSettingQuery.SettingCode) > 0 {
queryOption["settingCode"] = listSystemSettingQuery.SettingCode
}
_, systemSettings, err := systemSettingRepository.Find(queryOption)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
... ... @@ -102,7 +101,8 @@ func (systemSettingService *SystemSettingService) ListSystemSetting(listSystemSe
code := systemSettings[i].SettingCode
settingMap[code] = systemSettings[i]
}
defaultSettings := new(domain.SystemSetting).GetDefaultSetting("", listSystemSettingQuery.SettingName)
fmt.Println(listSystemSettingQuery.SettingCode, listSystemSettingQuery.SettingName)
defaultSettings := new(domain.SystemSetting).GetDefaultSetting(listSystemSettingQuery.SettingCode, listSystemSettingQuery.SettingName)
for i := range defaultSettings {
if v, ok := settingMap[defaultSettings[i].SettingCode]; ok {
defaultSettings[i].Value = v.Value
... ...
... ... @@ -76,7 +76,7 @@ var defaultsysSettingList = []SystemSetting{
}
func (systemSetting *SystemSetting) GetDefaultSetting(settingCode string, settingName string) []SystemSetting {
var list []SystemSetting
list := []SystemSetting{}
for i := range defaultsysSettingList {
settingCodeOk := true
settingNameOk := true
... ...
... ... @@ -38,6 +38,10 @@ func (controller *SystemSettingController) GetSystemSetting() {
func (controller *SystemSettingController) ListSystemSetting() {
systemSettingService := service.NewSystemSettingService(nil)
listSystemSettingQuery := &query.ListSystemSettingQuery{}
err := controller.Unmarshal(listSystemSettingQuery)
if err != nil {
log.Logger.Debug(err.Error())
}
listSystemSettingQuery.CompanyId = controller.GetCompanyId()
data, err := systemSettingService.ListSystemSetting(listSystemSettingQuery)
controller.Response(data, err)
... ...