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
|