Commit 976dc6eb8f83263081017e2dab10fb07e6f161ff

Authored by jiangjiazhi
1 parent 755c1291e8

去掉不用的代码

Showing 1 changed file with 10 additions and 80 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyManagerFacade.java View file @ 976dc6e
... ... @@ -29,12 +29,9 @@
29 29 public class BabyManagerFacade {
30 30  
31 31 @Autowired
32   - private PuerperaService puerperaService;
33   - @Autowired
34 32 private PatientsService patientsService;
35 33 @Autowired
36 34 private CommunityConfigService communityConfigService;
37   -
38 35 @Autowired
39 36 private BabyService babyService;
40 37 @Autowired
41 38  
42 39  
... ... @@ -52,40 +49,12 @@
52 49 */
53 50 public BaseListResponse findBabyList(BabyManagerQueryRequest babyManagerRequest,int userId) {
54 51  
55   - /*PatientsQuery patientsQuery = new PatientsQuery();
56   - patientsQuery.setType(2);
57   - patientsQuery.setYn(YnEnums.YES.getId());
58 52 Date date = DateUtil.parseYMD(babyManagerRequest.getdEnd());
59 53 if (null != date) {
60 54 long d = date.getTime() + 86398000;
61 55 date = new Date(d);
62 56 }
63   - patientsQuery.setBirthEnd(date);
64   - patientsQuery.setBirthStart(DateUtil.parseYMD(babyManagerRequest.getdStart()));
65   - patientsQuery.setPhone(babyManagerRequest.getPhone());
66   - patientsQuery.setName(babyManagerRequest.getName());
67   - patientsQuery.setVisitstatus(babyManagerRequest.getVisitstatus());
68   - patientsQuery.setPage(babyManagerRequest.getPage());
69   - patientsQuery.setLimit(babyManagerRequest.getLimit());
70   - patientsQuery.setNeed("1");
71   - if (StringUtils.isNotEmpty(babyManagerRequest.getKeyword())) {
72   - patientsQuery.setKeyword(babyManagerRequest.getKeyword());
73   - }
74   - List<Patients> patientsList = patientsService.queryPatient(patientsQuery);
75 57  
76   - List<BabyResult> data =new ArrayList<BabyResult>();
77   -
78   - if(CollectionUtils.isNotEmpty(patientsList)){
79   - for(Patients patients:patientsList){
80   - data.add(buildResult(patients));
81   - }
82   - }*/
83   - Date date = DateUtil.parseYMD(babyManagerRequest.getdEnd());
84   - if (null != date) {
85   - long d = date.getTime() + 86398000;
86   - date = new Date(d);
87   - }
88   -
89 58 BabyModelQuery babyQuery = new BabyModelQuery();
90 59 babyQuery.setBirthEnd(date);
91 60 babyQuery.setBirthStart(DateUtil.parseYMD(babyManagerRequest.getdStart()));
92 61  
... ... @@ -96,7 +65,9 @@
96 65 babyQuery.setMname(babyManagerRequest.getName());
97 66 babyQuery.setLimit(babyManagerRequest.getLimit());
98 67 babyQuery.setYn(YnEnums.YES.getId());
  68 +
99 69 String areaid= autoMatchFacade.match(userId);
  70 +
100 71 if(StringUtils.isNotEmpty(areaid)){
101 72 babyQuery.setAreaId(areaid);
102 73 }
103 74  
104 75  
105 76  
106 77  
... ... @@ -141,60 +112,19 @@
141 112 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
142 113 }
143 114  
  115 +
144 116 /**
145   - * 构建回的数据
  117 + * 构建回的数据
146 118 *
147   - * @param baby
148   - * @param puerModel
149   - * @return
  119 + * @param patients
  120 + *
  121 + * @param communityId 社区id
  122 + *
  123 + * @return 新生儿访视
150 124 */
151   - public BabyResult buildResult(BabyModel baby, PuerperaModel puerModel) {
152   - BabyResult babyResult = new BabyResult();
153   -
154   - // 填充小孩信息
155   - babyResult.convertToResult(baby);
156   - babyResult.setMotherName(puerModel.getName());
157   - babyResult.setMotherPhone(puerModel.getPhone());
158   - // HashMap map = (HashMap)JsonUtil.str2Obj(puerModel.getAddress(), HashMap.class);
159   - // 需要将数据库中的json结构地址解析出来
160   - HashMap<String, String> map = new HashMap<>();
161   - map.put("address", "测试地址");
162   - babyResult.setAddress(map.get("address").toString());
163   - babyResult.setParentId(puerModel.getId());
164   - // TODO 需要根据产妇模型上的社区id获取社区信息
165   - babyResult.setCommunity(StringUtils.isEmpty(puerModel.getCommunityId()) ? "" : puerModel.getCommunityId());
166   - return babyResult;
167   - }
168   -
169   - public BabyResult buildResult(BabyModel baby, Patients puerModel) {
170   - BabyResult babyResult = new BabyResult();
171   -
172   - // 填充小孩信息
173   - babyResult.convertToResult(baby);
174   - babyResult.setMotherName(puerModel.getUsername());
175   - babyResult.setMotherPhone(puerModel.getPhone());
176   - // HashMap map = (HashMap)JsonUtil.str2Obj(puerModel.getAddress(), HashMap.class);
177   - // 需要将数据库中的json结构地址解析出来
178   - HashMap<String, String> map = new HashMap<>();
179   - map.put("address", "测试地址");
180   - babyResult.setAddress(map.get("address").toString());
181   - babyResult.setParentId(puerModel.getId());
182   - // TODO 需要根据产妇模型上的社区id获取社区信息
183   - babyResult.setCommunity(StringUtils.isEmpty(puerModel.getCommunityId()) ? "" : puerModel.getCommunityId());
184   - return babyResult;
185   - }
186   -
187 125 public BabyResult buildResult(BabyModel patients, String communityId) {
188 126 BabyResult babyResult = new BabyResult();
189   - /* String addr = "";
190   - if (StringUtils.isNotEmpty(patients.getAddress())) {
191   - try {
192   - Map map = JsonUtil.str2Obj(patients.getAddress(), Map.class);
193   - addr = map.get("d").toString();
194   - } catch (Exception e) {
195   - addr = "";
196   - }
197   - }*/
  127 +
198 128 babyResult.setAddress(patients.getAddress());
199 129 babyResult.setFullAddr(CommonsHelper.getFullAddress(patients.getProvinceId(), patients.getCityId(), patients.getAreaId(), patients.getAddress(),basicConfigService));
200 130 babyResult.setCommunityId(StringUtils.isEmpty(communityId) ? "" : communityId);