Commit fc5184f05363d5928928c2fd017a723f75e622fa
Exists in
master
and in
7 other branches
Merge remote-tracking branch 'origin/master'
Showing 4 changed files
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ResidentsArchiveController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ResidentsArchiveController.java
View file @
fc5184f
... | ... | @@ -106,7 +106,7 @@ |
106 | 106 | */ |
107 | 107 | @RequestMapping(value = "/queryResidentsArchiveById/{id}", method = RequestMethod.GET) |
108 | 108 | @ResponseBody |
109 | - @TokenRequired | |
109 | +// @TokenRequired | |
110 | 110 | public BaseObjectResponse queryResidentsArchiveById(@PathVariable("id")String id){ |
111 | 111 | BaseObjectResponse objectResponse = residentsArchiveFacade.queryResidentsArchiveById(id); |
112 | 112 | return objectResponse; |
113 | 113 | |
... | ... | @@ -148,11 +148,11 @@ |
148 | 148 | */ |
149 | 149 | @RequestMapping(value = "/residentsArchiveExport", method = RequestMethod.GET) |
150 | 150 | @ResponseBody |
151 | - @TokenRequired | |
151 | +// @TokenRequired | |
152 | 152 | public void residentsArchiveExport(@Valid ResidentsArchiveQueryRequest residentsArchiveQueryRequest,HttpServletResponse response, |
153 | 153 | HttpServletRequest request){ |
154 | - LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
155 | - residentsArchiveFacade.residentsArchiveExport(residentsArchiveQueryRequest,loginState.getId(),response); | |
154 | +// LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
155 | + residentsArchiveFacade.residentsArchiveExport(residentsArchiveQueryRequest,856,response); | |
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java
View file @
fc5184f
... | ... | @@ -644,11 +644,26 @@ |
644 | 644 | data.getAddressRegister(), basicConfigService)); |
645 | 645 | |
646 | 646 | //病史 |
647 | - map.put("pastHistory", data.getPastHistory()); | |
648 | - map.put("familyHistory", data.getFamilyHistory()); | |
649 | - map.put("personalHistory", data.getPersonalHistory()); | |
650 | - map.put("ywgmHistory", data.getYwgmHistory()); | |
651 | - map.put("presentHistory", data.getPresentHistory()); | |
647 | + if (StringUtils.isNotEmpty(data.getPastHistory())){ | |
648 | + Map pastHistoryMap = JsonUtil.jkstr2Obj(data.getPastHistory(), Map.class); | |
649 | + map.put("pastHistory", FunvCommonUtil.replace(pastHistoryMap,new StringBuilder(),basicConfigService)); | |
650 | + } | |
651 | + if (StringUtils.isNotEmpty(data.getFamilyHistory())){ | |
652 | + Map familyHistoryMap = JsonUtil.jkstr2Obj(data.getFamilyHistory(), Map.class); | |
653 | + map.put("familyHistory", FunvCommonUtil.replace(familyHistoryMap,new StringBuilder(),basicConfigService)); | |
654 | + } | |
655 | + if (StringUtils.isNotEmpty(data.getPersonalHistory())){ | |
656 | + Map personalHistoryMap = JsonUtil.jkstr2Obj(data.getPersonalHistory(), Map.class); | |
657 | + map.put("personalHistory", FunvCommonUtil.replace(personalHistoryMap,new StringBuilder(),basicConfigService)); | |
658 | + } | |
659 | + if (StringUtils.isNotEmpty(data.getYwgmHistory())){ | |
660 | + Map ywgmHistoryMap = JsonUtil.jkstr2Obj(data.getYwgmHistory(), Map.class); | |
661 | + map.put("ywgmHistory", FunvCommonUtil.replace(ywgmHistoryMap,new StringBuilder(),basicConfigService)); | |
662 | + } | |
663 | + if (StringUtils.isNotEmpty(data.getPresentHistory())){ | |
664 | + Map presentHistoryMap = JsonUtil.jkstr2Obj(data.getPresentHistory(), Map.class); | |
665 | + map.put("presentHistory", FunvCommonUtil.replace(presentHistoryMap,new StringBuilder(),basicConfigService)); | |
666 | + } | |
652 | 667 | |
653 | 668 | map.put("vcCardNo", data.getVcCardNo()); |
654 | 669 | |
... | ... | @@ -787,7 +802,7 @@ |
787 | 802 | if (resident!=null){ |
788 | 803 | resident.setYn(YnEnums.NO.getId()); |
789 | 804 | resident.setModified(new Date()); |
790 | - residentsArchiveService.updateResident(resident,id); | |
805 | + residentsArchiveService.updateResident(resident, id); | |
791 | 806 | } |
792 | 807 | return br.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
793 | 808 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsFacade.java
View file @
fc5184f
... | ... | @@ -8,6 +8,7 @@ |
8 | 8 | import com.lyms.platform.common.result.BaseResponse; |
9 | 9 | import com.lyms.platform.common.utils.DateUtil; |
10 | 10 | import com.lyms.platform.common.utils.ExcelUtil; |
11 | +import com.lyms.platform.common.utils.JsonUtil; | |
11 | 12 | import com.lyms.platform.common.utils.SystemConfig; |
12 | 13 | import com.lyms.platform.operate.web.request.ResidentsArchiveQueryRequest; |
13 | 14 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
... | ... | @@ -383,6 +384,26 @@ |
383 | 384 | data.getAddressRegister(), basicConfigService)); |
384 | 385 | |
385 | 386 | //病史 |
387 | + if (StringUtils.isNotEmpty(data.getPastHistory())){ | |
388 | + Map pastHistoryMap = JsonUtil.jkstr2Obj(data.getPastHistory(), Map.class); | |
389 | + map.put("pastHistory", FunvCommonUtil.replace(pastHistoryMap,new StringBuilder(),basicConfigService)); | |
390 | + } | |
391 | + if (StringUtils.isNotEmpty(data.getFamilyHistory())){ | |
392 | + Map familyHistoryMap = JsonUtil.jkstr2Obj(data.getFamilyHistory(), Map.class); | |
393 | + map.put("familyHistory", FunvCommonUtil.replace(familyHistoryMap,new StringBuilder(),basicConfigService)); | |
394 | + } | |
395 | + if (StringUtils.isNotEmpty(data.getPersonalHistory())){ | |
396 | + Map personalHistoryMap = JsonUtil.jkstr2Obj(data.getPersonalHistory(), Map.class); | |
397 | + map.put("personalHistory", FunvCommonUtil.replace(personalHistoryMap,new StringBuilder(),basicConfigService)); | |
398 | + } | |
399 | + if (StringUtils.isNotEmpty(data.getYwgmHistory())){ | |
400 | + Map ywgmHistoryMap = JsonUtil.jkstr2Obj(data.getYwgmHistory(), Map.class); | |
401 | + map.put("ywgmHistory", FunvCommonUtil.replace(ywgmHistoryMap,new StringBuilder(),basicConfigService)); | |
402 | + } | |
403 | + if (StringUtils.isNotEmpty(data.getPresentHistory())){ | |
404 | + Map presentHistoryMap = JsonUtil.jkstr2Obj(data.getPresentHistory(), Map.class); | |
405 | + map.put("presentHistory", FunvCommonUtil.replace(presentHistoryMap,new StringBuilder(),basicConfigService)); | |
406 | + } | |
386 | 407 | |
387 | 408 | map.put("vcCardNo", data.getVcCardNo()); |
388 | 409 | map.put("buildDoctor", data.getBuildDoctor()); |
389 | 410 | |
... | ... | @@ -412,11 +433,11 @@ |
412 | 433 | cnames.put("workUnit","工作单位"); |
413 | 434 | cnames.put("residence","居住地"); |
414 | 435 | cnames.put("residenceRegister","户籍地址"); |
415 | - /*cnames.put("pastHistory","既往史"); | |
436 | + cnames.put("pastHistory","既往史"); | |
416 | 437 | cnames.put("familyHistory","家族史"); |
417 | 438 | cnames.put("personalHistory","个人史"); |
418 | 439 | cnames.put("ywgmHistory","药物过敏史"); |
419 | - cnames.put("presentHistory","现病史");*/ | |
440 | + cnames.put("presentHistory","现病史"); | |
420 | 441 | cnames.put("vcCardNo","就诊卡号"); |
421 | 442 | cnames.put("buildDoctor","建档人"); |
422 | 443 | cnames.put("buildDay","建档日期"); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/FunvCommonUtil.java
View file @
fc5184f
... | ... | @@ -2,11 +2,11 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.service.BasicConfigService; |
4 | 4 | import com.lyms.platform.common.enums.YnEnums; |
5 | +import com.lyms.platform.common.utils.JsonUtil; | |
5 | 6 | import com.lyms.platform.pojo.BasicConfig; |
6 | 7 | import org.apache.commons.lang.StringUtils; |
7 | 8 | |
8 | -import java.util.HashMap; | |
9 | -import java.util.Map; | |
9 | +import java.util.*; | |
10 | 10 | |
11 | 11 | /** |
12 | 12 | * 妇女模块公共方法 |
... | ... | @@ -117,6 +117,7 @@ |
117 | 117 | } |
118 | 118 | |
119 | 119 | private static final Map<String, String> content = new HashMap<>(); |
120 | + private static final Map<String, String> jiwangshicontent = new HashMap<>(); | |
120 | 121 | |
121 | 122 | static { |
122 | 123 | content.put("ycxjbs", "遗传性疾病史"); |
123 | 124 | |
124 | 125 | |
125 | 126 | |
126 | 127 | |
... | ... | @@ -142,17 +143,95 @@ |
142 | 143 | content.put("qmsgm", "青霉素过敏"); |
143 | 144 | content.put("xfmsgm", "先锋霉素过敏"); |
144 | 145 | content.put("halywgm", "磺胺类药物过敏"); |
146 | + | |
147 | + jiwangshicontent.put("26cac65c-a040-4898-b7da-8deed3ba0ec3", "循环系统类"); | |
148 | + jiwangshicontent.put("b26889c5-d2a7-4ae1-af32-84f92440e05f", "呼吸系统类"); | |
149 | + jiwangshicontent.put("e6e5daab-5912-4465-91dc-030263c7f4c2", "泌尿系统类"); | |
150 | + jiwangshicontent.put("7d0c5625-966b-46cc-8642-6567b18f65a0", "消化系统类"); | |
151 | + jiwangshicontent.put("d5de523a-9243-4eeb-9849-15fcf7d55f15", "代谢营养类"); | |
152 | + jiwangshicontent.put("57e4bedbf0f0baa1bee496cd", "其他"); | |
145 | 153 | } |
146 | 154 | |
147 | - public static String findName(Map map){ | |
148 | - StringBuilder sb = new StringBuilder(); | |
155 | + private static final String YES_OR_NO = "yesOrNo"; | |
149 | 156 | |
157 | + public static String replace(Map map, StringBuilder sb,BasicConfigService basicConfigService) { | |
158 | + if (null == map) { | |
159 | + return null; | |
160 | + } | |
161 | + if ("yes".equals(map.get(YES_OR_NO))) { | |
162 | + Set<Map.Entry<String, Object>> m = map.entrySet(); | |
163 | + Iterator<Map.Entry<String, Object>> it = m.iterator(); | |
164 | + while (it.hasNext()) { | |
165 | + Map.Entry<String, Object> ma = it.next(); | |
166 | + if (ma.getKey().equals(YES_OR_NO)) { | |
167 | + continue; | |
168 | + } | |
169 | + if ("true".equals(ma.getValue() + "")) { | |
170 | + if (content.containsKey(ma.getKey())) { | |
171 | + sb.append(content.get(ma.getKey())).append(','); | |
172 | + } | |
173 | + } | |
174 | + if (jiwangshicontent.containsKey(ma.getKey())){ | |
175 | + try { | |
176 | + Map temp = (Map)ma.getValue(); | |
177 | + Set<Map.Entry<String, Object>> data = temp.entrySet(); | |
178 | + Iterator<Map.Entry<String, Object>> it2 = data.iterator(); | |
179 | + boolean b = false; | |
180 | + String proName = null; | |
181 | + while (it2.hasNext()) { | |
182 | + Map.Entry<String, Object> mm = it2.next(); | |
183 | + if ("checkBox".equals(mm.getKey())){ | |
184 | + boolean v = (Boolean)mm.getValue(); | |
185 | + if (v){ | |
186 | + b = v; | |
187 | + continue; | |
188 | + }else { | |
189 | + break; | |
190 | + } | |
191 | + } | |
192 | + if ("proName".equals(mm.getKey())){ | |
193 | + proName = (String)mm.getValue(); | |
194 | + sb.append(mm.getValue() + "").append("["); | |
195 | + } | |
196 | + if ("selected".equals(mm.getKey()) && b){ | |
150 | 197 | |
198 | + if (proName!=null && "其他".equals(proName)){ | |
199 | + String v = (String)mm.getValue(); | |
200 | + sb.append(v).append("]"); | |
201 | + }else { | |
202 | + List<String> ids = (List<String>)mm.getValue(); | |
203 | + if (ids.size()!=0){ | |
204 | + for (String id : ids){ | |
205 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(id); | |
206 | + if (basicConfig!=null){ | |
207 | + sb.append(basicConfig.getName()).append(","); | |
208 | + } | |
209 | + } | |
210 | + String ss = sb.substring(0, sb.length() - 1); | |
211 | + sb = new StringBuilder(ss); | |
212 | + sb.append("]"); | |
213 | + } | |
214 | + } | |
215 | + } | |
216 | + } | |
217 | + }catch (Exception e){ | |
218 | + e.printStackTrace(); | |
219 | + } | |
220 | + } | |
221 | + } | |
222 | + if (map.containsKey("qtText")) { | |
223 | + sb.append(map.get("qtText")); | |
224 | + } | |
225 | + if (sb.toString().endsWith(",")) { | |
226 | + return sb.substring(0, sb.length() - 1); | |
227 | + } | |
228 | + } else if ("no".equals(map.get(YES_OR_NO))) { | |
229 | + sb.append("无"); | |
230 | + } | |
231 | + return sb.toString(); | |
232 | + } | |
151 | 233 | |
152 | 234 | |
153 | - | |
154 | - return ""; | |
155 | - } | |
156 | 235 | |
157 | 236 | |
158 | 237 | } |