|
|
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
|
...
|
...
|
|