Commit 95723b01c0ec76d85a712872faad178db5ffc633

Authored by landong2015
1 parent 7d4e0106f1

update bug

Showing 1 changed file with 28 additions and 2 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/FolicAcidFacade.java View file @ 95723b0
... ... @@ -31,6 +31,7 @@
31 31 import org.apache.commons.collections.CollectionUtils;
32 32 import org.apache.commons.lang.StringUtils;
33 33 import org.springframework.beans.factory.annotation.Autowired;
  34 +import org.springframework.data.domain.Sort;
34 35 import org.springframework.stereotype.Component;
35 36  
36 37 import javax.jws.Oneway;
37 38  
... ... @@ -252,8 +253,12 @@
252 253 }
253 254 folicAcidQuery.setHospitalList(hospitalList);
254 255 }
255   - List<FolicAcid> folicAcidList = folicAcidService.queryFolicAcid(folicAcidQuery);
  256 + List<FolicAcid> folicAcidList = folicAcidService.queryFolicAcidWithSort(folicAcidQuery, "drawTime", Sort.Direction.DESC);
256 257 if (CollectionUtils.isNotEmpty(folicAcidList)){
  258 +
  259 + //返回第一条数据
  260 + folicAcid = folicAcidList.get(0);
  261 +
257 262 for (FolicAcid data: folicAcidList){
258 263 Map<String,Object> acidMap = new HashMap<>();
259 264 if (data.getPregnancyType()!=null){
... ... @@ -276,7 +281,7 @@
276 281 }
277 282 }
278 283 }
279   - resultMap.put("folicAcidResult",folicAcid);
  284 + resultMap.put("folicAcidResult",getFolic(folicAcid));
280 285 resultMap.put("archiveResult",archiveMap);
281 286 resultMap.put("folicAcidHistory",list);
282 287 BaseObjectResponse response = new BaseObjectResponse();
... ... @@ -285,6 +290,27 @@
285 290 response.setErrormsg("成功");
286 291 return response;
287 292 }
  293 +
  294 + public Map<String,Object> getFolic(FolicAcid folicAcid){
  295 + if (folicAcid==null){
  296 + return null;
  297 + }
  298 + Map<String,Object> map= new HashMap<>();
  299 + map.put("id",folicAcid.getId());
  300 + map.put("created",DateUtil.getyyyy_MM_dd(folicAcid.getCreated()));
  301 + map.put("drawTime",DateUtil.getyyyy_MM_dd(folicAcid.getDrawTime()));
  302 + map.put("drawCount",folicAcid.getDrawCount());
  303 + map.put("highRisk",folicAcid.getHighRisk());
  304 + map.put("hospitalId",folicAcid.getHospitalId());
  305 + map.put("hospitalName",folicAcid.getHospitalName());
  306 + map.put("operator",folicAcid.getOperator());
  307 + map.put("operatorId",folicAcid.getOperatorId());
  308 + map.put("parentId",folicAcid.getParentId());
  309 + map.put("pregnancyType",folicAcid.getPregnancyType());
  310 + map.put("pregnancyWeeks",folicAcid.getPregnancyWeeks());
  311 + return map;
  312 + }
  313 +
288 314  
289 315 public BaseListResponse queryFolicAcid(FolicAcidQueryRequest queryRequest,Integer userId){
290 316