Commit a281a3994de323575f2150296ea641d122a4af2e
1 parent
ef76049bca
Exists in
master
and in
6 other branches
配置查询
Showing 2 changed files with 22 additions and 14 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ModularFunctionConfigController.java
View file @
a281a39
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | import org.springframework.web.bind.annotation.*; |
13 | 13 | |
14 | 14 | import javax.servlet.http.HttpServletRequest; |
15 | +import java.util.Map; | |
15 | 16 | |
16 | 17 | |
17 | 18 | /** |
... | ... | @@ -74,7 +75,7 @@ |
74 | 75 | */ |
75 | 76 | @RequestMapping(method = RequestMethod.GET, value = "/queryHospitalSmsSendConfig") |
76 | 77 | @ResponseBody |
77 | - public BaseResponse queryHospitalSmsSendConfig(@RequestParam(required = false) String hospitalId) { | |
78 | + public Map<String,String> queryHospitalSmsSendConfig(@RequestParam(required = false) String hospitalId) { | |
78 | 79 | return modularFunctionConfigFacde.queryHospitalSmsSendConfig(hospitalId); |
79 | 80 | } |
80 | 81 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ModularFunctionConfigFacde.java
View file @
a281a39
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 | import com.lyms.platform.common.enums.YnEnums; |
8 | 8 | import com.lyms.platform.common.result.BaseObjectResponse; |
9 | 9 | import com.lyms.platform.common.result.BaseResponse; |
10 | +import com.lyms.platform.common.utils.ExceptionUtils; | |
10 | 11 | import com.lyms.platform.common.utils.StringUtils; |
11 | 12 | import com.lyms.platform.operate.web.request.ModularFunctionConfigRequest; |
12 | 13 | import com.lyms.platform.operate.web.result.ModularFunctionConfigResult; |
... | ... | @@ -121,7 +122,7 @@ |
121 | 122 | return new BaseResponse().setErrorcode(ErrorCodeConstants.NO_DATA).setErrormsg("没有数据"); |
122 | 123 | } |
123 | 124 | |
124 | - public BaseResponse queryHospitalSmsSendConfig(String hospitalId) { | |
125 | + public Map<String,String> queryHospitalSmsSendConfig(String hospitalId) { | |
125 | 126 | Map<String,String> map = new HashMap<>(); |
126 | 127 | ModularFunctionConfigQuery diagnoseConfigQuery = new ModularFunctionConfigQuery(); |
127 | 128 | if(StringUtils.isNotEmpty(hospitalId)) |
128 | 129 | |
129 | 130 | |
130 | 131 | |
131 | 132 | |
132 | 133 | |
... | ... | @@ -129,27 +130,33 @@ |
129 | 130 | diagnoseConfigQuery.setHospitalId(hospitalId); |
130 | 131 | } |
131 | 132 | |
132 | - List<ModularFunctionConfigModel> configModels = modularFunctionConfigServcie.queryDiagnoseConfigs(diagnoseConfigQuery); | |
133 | - if (CollectionUtils.isNotEmpty(configModels)) | |
134 | - { | |
135 | - for (ModularFunctionConfigModel model : configModels) | |
133 | + try { | |
134 | + List<ModularFunctionConfigModel> configModels = modularFunctionConfigServcie.queryDiagnoseConfigs(diagnoseConfigQuery); | |
135 | + if (CollectionUtils.isNotEmpty(configModels)) | |
136 | 136 | { |
137 | - List<Map<String, Object>> list = model.getConfigs(); | |
138 | - if (CollectionUtils.isNotEmpty(list)) | |
137 | + for (ModularFunctionConfigModel model : configModels) | |
139 | 138 | { |
140 | - for (Map<String, Object> config : list) | |
139 | + List<Map<String, Object>> list = model.getConfigs(); | |
140 | + if (CollectionUtils.isNotEmpty(list)) | |
141 | 141 | { |
142 | - //是否推送发送失败后补发短信 | |
143 | - if ("10".equals(String.valueOf(config.get("type")))) | |
142 | + for (Map<String, Object> config : list) | |
144 | 143 | { |
145 | - String isOpen = "1".equals(String.valueOf(config.get("value"))) ? "ture" : "false"; | |
146 | - map.put(model.getHospitalId(),isOpen); | |
144 | + //是否推送发送失败后补发短信 | |
145 | + if ("10".equals(String.valueOf(config.get("type")))) | |
146 | + { | |
147 | + String isOpen = "1".equals(String.valueOf(config.get("value"))) ? "ture" : "false"; | |
148 | + map.put(model.getHospitalId(),isOpen); | |
149 | + } | |
147 | 150 | } |
148 | 151 | } |
149 | 152 | } |
150 | 153 | } |
151 | 154 | } |
152 | - return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION).setData(map); | |
155 | + catch (Exception e) | |
156 | + { | |
157 | + ExceptionUtils.catchException(e,"queryHospitalSmsSendConfig error."); | |
158 | + } | |
159 | + return map; | |
153 | 160 | } |
154 | 161 | } |