Commit 9dbcbe99418745e1aca36564da9f9645a6c13328
Exists in
master
and in
7 other branches
Merge remote-tracking branch 'origin/master'
Showing 2 changed files
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
9dbcbe9
| ... | ... | @@ -15,7 +15,6 @@ | 
| 15 | 15 | import com.lyms.platform.operate.web.result.*; | 
| 16 | 16 | import com.lyms.platform.operate.web.utils.BabyListTask; | 
| 17 | 17 | import com.lyms.platform.operate.web.utils.GrowthCountTask; | 
| 18 | -import com.lyms.platform.operate.web.utils.HiskCountTask; | |
| 19 | 18 | import com.lyms.platform.operate.web.utils.MessageCenterService; | 
| 20 | 19 | import com.lyms.platform.permission.model.Organization; | 
| 21 | 20 | import com.lyms.platform.permission.model.OrganizationQuery; | 
| ... | ... | @@ -32,7 +31,6 @@ | 
| 32 | 31 | import javax.servlet.http.HttpServletResponse; | 
| 33 | 32 | import java.io.IOException; | 
| 34 | 33 | import java.io.OutputStream; | 
| 35 | -import java.text.DecimalFormat; | |
| 36 | 34 | import java.util.*; | 
| 37 | 35 | import java.util.concurrent.*; | 
| 38 | 36 | |
| ... | ... | @@ -201,7 +199,7 @@ | 
| 201 | 199 | * @return | 
| 202 | 200 | */ | 
| 203 | 201 | public BaseResponse updateBabyBookbuilding(BabyBookbuildingAddRequest request, Integer userId) { | 
| 204 | - BabyModel model = getBabyModel(request); | |
| 202 | + BabyModel model = getBabyModel(request,false); | |
| 205 | 203 | model.setModified(new Date()); | 
| 206 | 204 | model.setOperator(userId); | 
| 207 | 205 | if (StringUtils.isNotEmpty(request.getMommyCertificateNum())) { | 
| ... | ... | @@ -486,7 +484,7 @@ | 
| 486 | 484 | return br; | 
| 487 | 485 | } | 
| 488 | 486 | |
| 489 | - BabyModel model = getBabyModel(request); | |
| 487 | + BabyModel model = getBabyModel(request,true); | |
| 490 | 488 | model.setPid(babyPersonId); | 
| 491 | 489 | model.setOperator(userId); | 
| 492 | 490 | if (StringUtils.isNotEmpty(request.getMommyCertificateNum())) { | 
| ... | ... | @@ -722,7 +720,8 @@ | 
| 722 | 720 | * @param b | 
| 723 | 721 | * @return | 
| 724 | 722 | */ | 
| 725 | - private BabyModel getBabyModel(BabyBookbuildingAddRequest b) { | |
| 723 | + private BabyModel getBabyModel(BabyBookbuildingAddRequest b,boolean isAdd) { | |
| 724 | + // hujiaqi添加了一个字段,判断是插入还是更新,如果是更新,就不更新birth字段 | |
| 726 | 725 | BabyModel bm = new BabyModel(); | 
| 727 | 726 | bm.setYn(YnEnums.YES.getId()); | 
| 728 | 727 | |
| ... | ... | @@ -743,7 +742,9 @@ | 
| 743 | 742 | bm.setName(b.getBabyName()); | 
| 744 | 743 | bm.setSex(b.getSex()); | 
| 745 | 744 | bm.setCardNo(b.getBabyCardNo()); | 
| 746 | - bm.setBirth(DateUtil.parseYMD(b.getBabyBirthday())); | |
| 745 | + if(isAdd) { | |
| 746 | + bm.setBirth(DateUtil.parseYMD(b.getBabyBirthday())); | |
| 747 | + } | |
| 747 | 748 | bm.setAddress(b.getHomeAddress()); | 
| 748 | 749 | bm.setProvinceId(b.getHomeProvinceId()); | 
| 749 | 750 | bm.setCityId(b.getHomeCityId()); | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/FolicAcidFacade.java
View file @
9dbcbe9
| ... | ... | @@ -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 |