Commit f9ed1b4849cead9af5bf13ab644f324d5d9065e4
1 parent
aefa23cd29
Exists in
master
and in
6 other branches
update
Showing 10 changed files with 178 additions and 64 deletions
- platform-dal/src/main/java/com/lyms/platform/query/BabyHighRiskBabyModelQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/BabyNutritionSpecialtyModelQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/BabyPsychologistModelQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/BabySpecialDiseaseClinicModelQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/BabyStuntingQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyHighRiskBabyFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionSpecialtyFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyPsychologistFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabySpecialDiseaseClinicFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStuntingFacade.java
platform-dal/src/main/java/com/lyms/platform/query/BabyHighRiskBabyModelQuery.java
View file @
f9ed1b4
| ... | ... | @@ -5,7 +5,6 @@ |
| 5 | 5 | import com.lyms.platform.common.dao.operator.MongoCondition; |
| 6 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 7 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 8 | -import com.lyms.platform.common.utils.DateUtil; | |
| 9 | 8 | import com.lyms.platform.common.utils.StringUtils; |
| 10 | 9 | import org.apache.commons.collections.CollectionUtils; |
| 11 | 10 | import org.springframework.data.mongodb.core.query.Criteria; |
| ... | ... | @@ -331,7 +330,7 @@ |
| 331 | 330 | } else { |
| 332 | 331 | c = Criteria.where("month").lte(monthEnd); |
| 333 | 332 | } |
| 334 | - }*/ | |
| 333 | + } | |
| 335 | 334 | if (null != monthStart && null != monthEnd) { |
| 336 | 335 | Date currentDate = DateUtil.formatDate(new Date()); |
| 337 | 336 | Date start = DateUtil.addMonth(currentDate, -monthStart); |
| ... | ... | @@ -339,7 +338,7 @@ |
| 339 | 338 | |
| 340 | 339 | Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -monthEnd - 1), 1); |
| 341 | 340 | setBirthStart(end); |
| 342 | - } | |
| 341 | + }*/ | |
| 343 | 342 | |
| 344 | 343 | |
| 345 | 344 | // 预约检查时间 |
platform-dal/src/main/java/com/lyms/platform/query/BabyNutritionSpecialtyModelQuery.java
View file @
f9ed1b4
| ... | ... | @@ -5,7 +5,6 @@ |
| 5 | 5 | import com.lyms.platform.common.dao.operator.MongoCondition; |
| 6 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 7 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 8 | -import com.lyms.platform.common.utils.DateUtil; | |
| 9 | 8 | import com.lyms.platform.common.utils.StringUtils; |
| 10 | 9 | import org.springframework.data.mongodb.core.query.Criteria; |
| 11 | 10 | |
| ... | ... | @@ -274,7 +273,7 @@ |
| 274 | 273 | } else { |
| 275 | 274 | c = Criteria.where("month").lte(monthEnd); |
| 276 | 275 | } |
| 277 | - }*/ | |
| 276 | + } | |
| 278 | 277 | if (null != monthStart && null != monthEnd) { |
| 279 | 278 | Date currentDate = DateUtil.formatDate(new Date()); |
| 280 | 279 | Date start = DateUtil.addMonth(currentDate, -monthStart); |
| ... | ... | @@ -282,7 +281,7 @@ |
| 282 | 281 | |
| 283 | 282 | Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -monthEnd - 1), 1); |
| 284 | 283 | setBirthStart(end); |
| 285 | - } | |
| 284 | + }*/ | |
| 286 | 285 | |
| 287 | 286 | |
| 288 | 287 | // 预约检查时间 |
platform-dal/src/main/java/com/lyms/platform/query/BabyPsychologistModelQuery.java
View file @
f9ed1b4
| ... | ... | @@ -5,7 +5,6 @@ |
| 5 | 5 | import com.lyms.platform.common.dao.operator.MongoCondition; |
| 6 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 7 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 8 | -import com.lyms.platform.common.utils.DateUtil; | |
| 9 | 8 | import com.lyms.platform.common.utils.StringUtils; |
| 10 | 9 | import org.springframework.data.mongodb.core.query.Criteria; |
| 11 | 10 | |
| ... | ... | @@ -238,7 +237,7 @@ |
| 238 | 237 | } else { |
| 239 | 238 | c = Criteria.where("month").lte(monthEnd); |
| 240 | 239 | } |
| 241 | - }*/ | |
| 240 | + } | |
| 242 | 241 | if (null != monthStart && null != monthEnd) { |
| 243 | 242 | Date currentDate = DateUtil.formatDate(new Date()); |
| 244 | 243 | Date start = DateUtil.addMonth(currentDate, -monthStart); |
| ... | ... | @@ -247,7 +246,7 @@ |
| 247 | 246 | Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -monthEnd - 1), 1); |
| 248 | 247 | setBirthStart(end); |
| 249 | 248 | } |
| 250 | - | |
| 249 | +*/ | |
| 251 | 250 | |
| 252 | 251 | // 预约检查时间 |
| 253 | 252 | if (null != nextDateStart) { |
platform-dal/src/main/java/com/lyms/platform/query/BabySpecialDiseaseClinicModelQuery.java
View file @
f9ed1b4
| ... | ... | @@ -5,7 +5,6 @@ |
| 5 | 5 | import com.lyms.platform.common.dao.operator.MongoCondition; |
| 6 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 7 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 8 | -import com.lyms.platform.common.utils.DateUtil; | |
| 9 | 8 | import com.lyms.platform.common.utils.StringUtils; |
| 10 | 9 | import org.springframework.data.mongodb.core.query.Criteria; |
| 11 | 10 | |
| ... | ... | @@ -262,7 +261,7 @@ |
| 262 | 261 | } else { |
| 263 | 262 | c = Criteria.where("month").lte(monthEnd); |
| 264 | 263 | } |
| 265 | - }*/ | |
| 264 | + } | |
| 266 | 265 | if (null != monthStart && null != monthEnd) { |
| 267 | 266 | Date currentDate = DateUtil.formatDate(new Date()); |
| 268 | 267 | Date start = DateUtil.addMonth(currentDate, -monthStart); |
| ... | ... | @@ -270,7 +269,7 @@ |
| 270 | 269 | |
| 271 | 270 | Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -monthEnd - 1), 1); |
| 272 | 271 | setBirthStart(end); |
| 273 | - } | |
| 272 | + }*/ | |
| 274 | 273 | |
| 275 | 274 | |
| 276 | 275 | // 预约检查时间 |
platform-dal/src/main/java/com/lyms/platform/query/BabyStuntingQuery.java
View file @
f9ed1b4
| ... | ... | @@ -5,7 +5,6 @@ |
| 5 | 5 | import com.lyms.platform.common.dao.operator.MongoCondition; |
| 6 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 7 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 8 | -import com.lyms.platform.common.utils.DateUtil; | |
| 9 | 8 | import com.lyms.platform.common.utils.StringUtils; |
| 10 | 9 | import org.springframework.data.mongodb.core.query.Criteria; |
| 11 | 10 | |
| ... | ... | @@ -238,7 +237,7 @@ |
| 238 | 237 | } else { |
| 239 | 238 | c = Criteria.where("month").lte(monthEnd); |
| 240 | 239 | } |
| 241 | - }*/ | |
| 240 | + } | |
| 242 | 241 | if (null != monthStart && null != monthEnd) { |
| 243 | 242 | Date currentDate = DateUtil.formatDate(new Date()); |
| 244 | 243 | Date start = DateUtil.addMonth(currentDate, -monthStart); |
| ... | ... | @@ -246,7 +245,7 @@ |
| 246 | 245 | |
| 247 | 246 | Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -monthEnd - 1), 1); |
| 248 | 247 | setBirthStart(end); |
| 249 | - } | |
| 248 | + }*/ | |
| 250 | 249 | |
| 251 | 250 | |
| 252 | 251 | // 预约检查时间 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyHighRiskBabyFacade.java
View file @
f9ed1b4
| ... | ... | @@ -362,11 +362,36 @@ |
| 362 | 362 | if (babyQuery.getNextDateEnd() != null) { |
| 363 | 363 | babyQuery.setNextDateEnd(DateUtil.getDayLastSecond(babyQuery.getNextDateEnd())); |
| 364 | 364 | } |
| 365 | - if (babyQuery.getBirthEnd() != null) { | |
| 366 | - babyQuery.setBirthEnd(DateUtil.getDayLastSecond(babyQuery.getBirthEnd())); | |
| 367 | - } | |
| 365 | + | |
| 368 | 366 | if (babyQuery.getcCDateEnd() != null) { |
| 369 | 367 | babyQuery.setcCDateEnd(DateUtil.getDayLastSecond(babyQuery.getcCDateEnd())); |
| 368 | + } | |
| 369 | + | |
| 370 | + Date currentDate = DateUtil.formatDate(new Date()); | |
| 371 | + //月龄和生日都有 | |
| 372 | + if ((babyQuery.getBirthStart() != null && babyQuery.getBirthEnd() != null) && (null != babyQuery.getMonthStart() && null != babyQuery.getMonthEnd())) { | |
| 373 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -babyQuery.getMonthEnd() - 1), 1); | |
| 374 | + if (babyQuery.getBirthStart().getTime() < end.getTime()) { | |
| 375 | + babyQuery.setBirthStart(end); | |
| 376 | + } else { | |
| 377 | + babyQuery.setBirthStart(babyQuery.getBirthStart()); | |
| 378 | + } | |
| 379 | + | |
| 380 | + Date start = DateUtil.addMonth(currentDate, -babyQuery.getMonthStart()); | |
| 381 | + if (babyQuery.getBirthEnd().getTime() < start.getTime()) { | |
| 382 | + babyQuery.setBirthEnd(babyQuery.getBirthEnd()); | |
| 383 | + } else { | |
| 384 | + babyQuery.setBirthEnd(start); | |
| 385 | + } | |
| 386 | + | |
| 387 | + } else if (null != babyQuery.getMonthStart() && null != babyQuery.getMonthEnd()) { | |
| 388 | + Date start = DateUtil.addMonth(currentDate, -babyQuery.getMonthStart()); | |
| 389 | + babyQuery.setBirthEnd(start); | |
| 390 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -babyQuery.getMonthEnd() - 1), 1); | |
| 391 | + babyQuery.setBirthStart(end); | |
| 392 | + } | |
| 393 | + if (babyQuery.getBirthEnd() != null) { | |
| 394 | + babyQuery.setBirthEnd(DateUtil.getDayLastSecond(babyQuery.getBirthEnd())); | |
| 370 | 395 | } |
| 371 | 396 | |
| 372 | 397 | babyHighRiskBabyModelList = babyHighRiskBabyService.queryAll(babyQuery); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionSpecialtyFacade.java
View file @
f9ed1b4
| ... | ... | @@ -388,12 +388,38 @@ |
| 388 | 388 | if (babyQuery.getNextDateEnd() != null) { |
| 389 | 389 | babyQuery.setNextDateEnd(DateUtil.getDayLastSecond(babyQuery.getNextDateEnd())); |
| 390 | 390 | } |
| 391 | - if (babyQuery.getBirthEnd() != null) { | |
| 392 | - babyQuery.setBirthEnd(DateUtil.getDayLastSecond(babyQuery.getBirthEnd())); | |
| 393 | - } | |
| 391 | + | |
| 394 | 392 | if (babyQuery.getcCDateEnd() != null) { |
| 395 | 393 | babyQuery.setcCDateEnd(DateUtil.getDayLastSecond(babyQuery.getcCDateEnd())); |
| 396 | 394 | } |
| 395 | + | |
| 396 | + Date currentDate = DateUtil.formatDate(new Date()); | |
| 397 | + //月龄和生日都有 | |
| 398 | + if ((babyQuery.getBirthStart() != null && babyQuery.getBirthEnd() != null) && (null != babyQuery.getMonthStart() && null != babyQuery.getMonthEnd())) { | |
| 399 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -babyQuery.getMonthEnd() - 1), 1); | |
| 400 | + if (babyQuery.getBirthStart().getTime() < end.getTime()) { | |
| 401 | + babyQuery.setBirthStart(end); | |
| 402 | + } else { | |
| 403 | + babyQuery.setBirthStart(babyQuery.getBirthStart()); | |
| 404 | + } | |
| 405 | + | |
| 406 | + Date start = DateUtil.addMonth(currentDate, -babyQuery.getMonthStart()); | |
| 407 | + if (babyQuery.getBirthEnd().getTime() < start.getTime()) { | |
| 408 | + babyQuery.setBirthEnd(babyQuery.getBirthEnd()); | |
| 409 | + } else { | |
| 410 | + babyQuery.setBirthEnd(start); | |
| 411 | + } | |
| 412 | + | |
| 413 | + } else if (null != babyQuery.getMonthStart() && null != babyQuery.getMonthEnd()) { | |
| 414 | + Date start = DateUtil.addMonth(currentDate, -babyQuery.getMonthStart()); | |
| 415 | + babyQuery.setBirthEnd(start); | |
| 416 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -babyQuery.getMonthEnd() - 1), 1); | |
| 417 | + babyQuery.setBirthStart(end); | |
| 418 | + } | |
| 419 | + if (babyQuery.getBirthEnd() != null) { | |
| 420 | + babyQuery.setBirthEnd(DateUtil.getDayLastSecond(babyQuery.getBirthEnd())); | |
| 421 | + } | |
| 422 | + | |
| 397 | 423 | |
| 398 | 424 | babyNutritionSpecialtyModelList = babyBabyNSService.queryAll(babyQuery); |
| 399 | 425 | System.out.println(babyQuery.convertToQuery().convertToMongoQuery()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyPsychologistFacade.java
View file @
f9ed1b4
| ... | ... | @@ -152,20 +152,18 @@ |
| 152 | 152 | model.setHandlingOpinions(request.getHandlingOpinions()); |
| 153 | 153 | |
| 154 | 154 | |
| 155 | - | |
| 156 | - | |
| 157 | 155 | return model; |
| 158 | 156 | |
| 159 | 157 | } |
| 160 | 158 | |
| 161 | - /** | |
| 162 | - * 新增 心理专科检查 | |
| 163 | - * | |
| 164 | - * @param request | |
| 165 | - * @param userId | |
| 166 | - * @Author: 武涛涛 | |
| 167 | - * @Date: 2020/8/12 17:15 | |
| 168 | - */ | |
| 159 | + /** | |
| 160 | + * 新增 心理专科检查 | |
| 161 | + * | |
| 162 | + * @param request | |
| 163 | + * @param userId | |
| 164 | + * @Author: 武涛涛 | |
| 165 | + * @Date: 2020/8/12 17:15 | |
| 166 | + */ | |
| 169 | 167 | public BaseResponse addBabyPsychologist(BabyPsychologistRequest request, Integer userId) { |
| 170 | 168 | |
| 171 | 169 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 172 | 170 | |
| ... | ... | @@ -181,11 +179,11 @@ |
| 181 | 179 | model.setCreateDate(new Date()); |
| 182 | 180 | model.setHospitalId(hospitalId); |
| 183 | 181 | model = babyPsychologistService.addBabyPsychologist(model); |
| 184 | - if (model!=null && model.getId()!=null) { | |
| 182 | + if (model != null && model.getId() != null) { | |
| 185 | 183 | operateLogFacade.addModifyOptLog(userId, Integer.valueOf(hospitalId), model, model, OptActionEnums.ADD.getId(), "新增心理专科检查"); |
| 186 | 184 | try { |
| 187 | 185 | //添加检查后更新转诊接受状态 |
| 188 | - babyDepartmentReferralFacade.setAcceptStatus(model.getBuildId(),hospitalId,"xlzk"); | |
| 186 | + babyDepartmentReferralFacade.setAcceptStatus(model.getBuildId(), hospitalId, "xlzk"); | |
| 189 | 187 | } catch (Exception e) { |
| 190 | 188 | e.printStackTrace(); |
| 191 | 189 | } |
| 192 | 190 | |
| ... | ... | @@ -205,13 +203,13 @@ |
| 205 | 203 | * @Author: 武涛涛 |
| 206 | 204 | * @Date: 2020/7/31 11:02 |
| 207 | 205 | */ |
| 208 | - public BaseResponse updateBabyPsychologist (BabyPsychologistRequest request, Integer userId) { | |
| 206 | + public BaseResponse updateBabyPsychologist(BabyPsychologistRequest request, Integer userId) { | |
| 209 | 207 | //当前登录人医院Id |
| 210 | 208 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 211 | 209 | BabyPsychologistModel model = getBabyPsychologistModel(request); |
| 212 | 210 | BabyPsychologistModel models = babyPsychologistService.queryBabyPsychologistById(request.getId()); |
| 213 | 211 | |
| 214 | - if (models !=null && models.getId()!=null) { | |
| 212 | + if (models != null && models.getId() != null) { | |
| 215 | 213 | babyPsychologistService.updateBabyPsychologist(model, request.getId()); |
| 216 | 214 | operateLogFacade.addModifyOptLog(userId, Integer.valueOf(hospitalId), models, model, OptActionEnums.UPDATE.getId(), "修改心理专科检查"); |
| 217 | 215 | } |
| ... | ... | @@ -229,8 +227,8 @@ |
| 229 | 227 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 230 | 228 | |
| 231 | 229 | //查询儿童的检查记录 |
| 232 | - BabyPsychologistModel checkModel = babyPsychologistService.queryBabyPsychologistById(id); | |
| 233 | - if(checkModel !=null && checkModel.getId()!= null){ | |
| 230 | + BabyPsychologistModel checkModel = babyPsychologistService.queryBabyPsychologistById(id); | |
| 231 | + if (checkModel != null && checkModel.getId() != null) { | |
| 234 | 232 | babyPsychologistService.deleteBabySpecialDiseaseClinicById(id); |
| 235 | 233 | operateLogFacade.addDeleteOptLog(userId, Integer.valueOf(hospitalId), checkModel, OptActionEnums.DELETE.getId(), "删除心理专科检查"); |
| 236 | 234 | |
| 237 | 235 | |
| 238 | 236 | |
| 239 | 237 | |
| 240 | 238 | |
| ... | ... | @@ -247,20 +245,20 @@ |
| 247 | 245 | public BaseObjectResponse queryBabyPsychologistShow(String id) { |
| 248 | 246 | |
| 249 | 247 | BaseObjectResponse br = new BaseObjectResponse(); |
| 250 | - if(StringUtils.isNotEmpty(id)){ | |
| 248 | + if (StringUtils.isNotEmpty(id)) { | |
| 251 | 249 | BabyPsychologistModel babyPsychologistModel = babyPsychologistService.queryBabyPsychologistById(id); |
| 252 | 250 | BabyPsychologistResult babyPsychologistResult = new BabyPsychologistResult(); |
| 253 | 251 | babyPsychologistResult.convertToResult(babyPsychologistModel); |
| 254 | - if(CollectionUtils.isNotEmpty(babyPsychologistModel.getmHighRiskReason())){ | |
| 252 | + if (CollectionUtils.isNotEmpty(babyPsychologistModel.getmHighRiskReason())) { | |
| 255 | 253 | babyPsychologistResult.setmHighRiskReason(mongoUtil.findColor(babyPsychologistModel.getmHighRiskReason())); |
| 256 | 254 | } |
| 257 | - if(StringUtils.isNotEmpty(babyPsychologistModel.getCheckDoctor())){ | |
| 255 | + if (StringUtils.isNotEmpty(babyPsychologistModel.getCheckDoctor())) { | |
| 258 | 256 | Users users = usersService.getUsers(NumberUtils.toInt(babyPsychologistModel.getCheckDoctor())); |
| 259 | - if(users!=null && StringUtils.isNotEmpty(users.getName())){ | |
| 257 | + if (users != null && StringUtils.isNotEmpty(users.getName())) { | |
| 260 | 258 | babyPsychologistResult.setCheckDoctor(users.getName()); |
| 261 | 259 | } |
| 262 | 260 | } |
| 263 | - if(StringUtils.isNotEmpty(babyPsychologistModel.getHospitalId())){ | |
| 261 | + if (StringUtils.isNotEmpty(babyPsychologistModel.getHospitalId())) { | |
| 264 | 262 | babyPsychologistResult.setHospitalName(CommonsHelper.getHospitalName(babyPsychologistModel.getHospitalId(), organizationService)); |
| 265 | 263 | } |
| 266 | 264 | br.setData(babyPsychologistResult); |
| ... | ... | @@ -279,7 +277,7 @@ |
| 279 | 277 | public BaseObjectResponse queryBabyPsychologistEdit(String id) { |
| 280 | 278 | |
| 281 | 279 | BaseObjectResponse br = new BaseObjectResponse(); |
| 282 | - if(StringUtils.isNotEmpty(id)){ | |
| 280 | + if (StringUtils.isNotEmpty(id)) { | |
| 283 | 281 | BabyPsychologistModel babyPsychologistModel = babyPsychologistService.queryBabyPsychologistById(id); |
| 284 | 282 | BabyPsychologistResult babyPsychologistResult = new BabyPsychologistResult(); |
| 285 | 283 | babyPsychologistResult.convertToResult(babyPsychologistModel); |
| 286 | 284 | |
| ... | ... | @@ -303,10 +301,10 @@ |
| 303 | 301 | |
| 304 | 302 | BaseObjectResponse br = new BaseObjectResponse(); |
| 305 | 303 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 306 | - List<BabyPsychologistResult> babyPsychologistResultList = new ArrayList<>(); | |
| 304 | + List <BabyPsychologistResult> babyPsychologistResultList = new ArrayList <>(); | |
| 307 | 305 | //单人多条专病记录 |
| 308 | - List<BabyPsychologistModel> babyPsychologistModels = new ArrayList<>(); | |
| 309 | - if( StringUtils.isNotEmpty(babyQuery.getBuildId()) ){ | |
| 306 | + List <BabyPsychologistModel> babyPsychologistModels = new ArrayList <>(); | |
| 307 | + if (StringUtils.isNotEmpty(babyQuery.getBuildId())) { | |
| 310 | 308 | babyQuery.setYn(YnEnums.YES.getId()); |
| 311 | 309 | babyQuery.setHospitalId(hospitalId); |
| 312 | 310 | babyQuery.setSort("ASC"); |
| 313 | 311 | |
| ... | ... | @@ -316,9 +314,9 @@ |
| 316 | 314 | for (int i = 0; i < babyPsychologistModels.size(); i++) { |
| 317 | 315 | BabyPsychologistModel babyPsychologistModel = babyPsychologistModels.get(i); |
| 318 | 316 | BabyPsychologistResult babyPsychologistResult = new BabyPsychologistResult(); |
| 319 | - if(babyPsychologistModel !=null ){ | |
| 317 | + if (babyPsychologistModel != null) { | |
| 320 | 318 | babyPsychologistResult.convertToResult(babyPsychologistModel); |
| 321 | - if(StringUtils.isNotEmpty(babyPsychologistModel.getHospitalId())){ | |
| 319 | + if (StringUtils.isNotEmpty(babyPsychologistModel.getHospitalId())) { | |
| 322 | 320 | babyPsychologistResult.setHospitalName(CommonsHelper.getHospitalName(babyPsychologistModel.getHospitalId(), organizationService)); |
| 323 | 321 | } |
| 324 | 322 | babyPsychologistResultList.add(babyPsychologistResult); |
| 325 | 323 | |
| 326 | 324 | |
| 327 | 325 | |
| 328 | 326 | |
| 329 | 327 | |
| 330 | 328 | |
| ... | ... | @@ -343,31 +341,57 @@ |
| 343 | 341 | |
| 344 | 342 | BaseObjectResponse br = new BaseObjectResponse(); |
| 345 | 343 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
| 346 | - List<BabyPsychologistResult> babyPsychologistResultList = new ArrayList<>(); | |
| 344 | + List <BabyPsychologistResult> babyPsychologistResultList = new ArrayList <>(); | |
| 347 | 345 | //单人多条专病记录 |
| 348 | - List<BabyPsychologistModel> babyPsychologistModelList = new ArrayList<>(); | |
| 349 | - if(StringUtils.isEmpty(babyQuery.getBuildId()) ){ | |
| 346 | + List <BabyPsychologistModel> babyPsychologistModelList = new ArrayList <>(); | |
| 347 | + if (StringUtils.isEmpty(babyQuery.getBuildId())) { | |
| 350 | 348 | babyQuery.setNeed("true"); |
| 351 | 349 | babyQuery.setYn(YnEnums.YES.getId()); |
| 352 | 350 | babyQuery.setHospitalId(hospitalId); |
| 353 | 351 | babyQuery.setSort(null); |
| 354 | 352 | |
| 355 | - if(babyQuery.getCheckDateEnd()!=null){ | |
| 353 | + if (babyQuery.getCheckDateEnd() != null) { | |
| 356 | 354 | babyQuery.setCheckDateEnd(DateUtil.getDayLastSecond(babyQuery.getCheckDateEnd())); |
| 357 | 355 | } |
| 358 | - if(babyQuery.getNextDateEnd()!=null){ | |
| 356 | + if (babyQuery.getNextDateEnd() != null) { | |
| 359 | 357 | babyQuery.setNextDateEnd(DateUtil.getDayLastSecond(babyQuery.getNextDateEnd())); |
| 360 | 358 | } |
| 361 | - if(babyQuery.getBirthEnd()!=null){ | |
| 359 | + | |
| 360 | + Date currentDate = DateUtil.formatDate(new Date()); | |
| 361 | + //月龄和生日都有 | |
| 362 | + if ((babyQuery.getBirthStart() != null && babyQuery.getBirthEnd() != null) && (null != babyQuery.getMonthStart() && null != babyQuery.getMonthEnd())) { | |
| 363 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -babyQuery.getMonthEnd() - 1), 1); | |
| 364 | + if (babyQuery.getBirthStart().getTime() < end.getTime()) { | |
| 365 | + babyQuery.setBirthStart(end); | |
| 366 | + } else { | |
| 367 | + babyQuery.setBirthStart(babyQuery.getBirthStart()); | |
| 368 | + } | |
| 369 | + | |
| 370 | + Date start = DateUtil.addMonth(currentDate, -babyQuery.getMonthStart()); | |
| 371 | + if (babyQuery.getBirthEnd().getTime() < start.getTime()) { | |
| 372 | + babyQuery.setBirthEnd(babyQuery.getBirthEnd()); | |
| 373 | + } else { | |
| 374 | + babyQuery.setBirthEnd(start); | |
| 375 | + } | |
| 376 | + | |
| 377 | + } else if (null != babyQuery.getMonthStart() && null != babyQuery.getMonthEnd()) { | |
| 378 | + Date start = DateUtil.addMonth(currentDate, -babyQuery.getMonthStart()); | |
| 379 | + babyQuery.setBirthEnd(start); | |
| 380 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -babyQuery.getMonthEnd() - 1), 1); | |
| 381 | + babyQuery.setBirthStart(end); | |
| 382 | + } | |
| 383 | + if (babyQuery.getBirthEnd() != null) { | |
| 362 | 384 | babyQuery.setBirthEnd(DateUtil.getDayLastSecond(babyQuery.getBirthEnd())); |
| 363 | 385 | } |
| 364 | - babyPsychologistModelList = babyPsychologistService.queryBabyPsychologistListAll(babyQuery); | |
| 386 | + | |
| 387 | + | |
| 388 | + babyPsychologistModelList = babyPsychologistService.queryBabyPsychologistListAll(babyQuery); | |
| 365 | 389 | System.out.println(babyQuery.convertToQuery().convertToMongoQuery()); |
| 366 | 390 | } |
| 367 | 391 | for (int i = 0; i < babyPsychologistModelList.size(); i++) { |
| 368 | 392 | BabyPsychologistModel babyPsychologistModel = babyPsychologistModelList.get(i); |
| 369 | 393 | BabyPsychologistResult babyPsychologistResult = new BabyPsychologistResult(); |
| 370 | - if(babyPsychologistModel !=null ){ | |
| 394 | + if (babyPsychologistModel != null) { | |
| 371 | 395 | babyPsychologistResult.convertToResult(babyPsychologistModel); |
| 372 | 396 | babyPsychologistResult.setHospitalId(CommonsHelper.getHospitalName(babyPsychologistModel.getHospitalId(), organizationService)); |
| 373 | 397 | babyPsychologistResultList.add(babyPsychologistResult); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabySpecialDiseaseClinicFacade.java
View file @
f9ed1b4
| ... | ... | @@ -278,9 +278,35 @@ |
| 278 | 278 | if(babyQuery.getNextDateEnd()!=null){ |
| 279 | 279 | babyQuery.setNextDateEnd(DateUtil.getDayLastSecond(babyQuery.getNextDateEnd())); |
| 280 | 280 | } |
| 281 | - if(babyQuery.getBirthEnd()!=null){ | |
| 281 | + | |
| 282 | + Date currentDate = DateUtil.formatDate(new Date()); | |
| 283 | + //月龄和生日都有 | |
| 284 | + if ((babyQuery.getBirthStart() != null && babyQuery.getBirthEnd() != null) && (null != babyQuery.getMonthStart() && null != babyQuery.getMonthEnd())) { | |
| 285 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -babyQuery.getMonthEnd() - 1), 1); | |
| 286 | + if (babyQuery.getBirthStart().getTime() < end.getTime()) { | |
| 287 | + babyQuery.setBirthStart(end); | |
| 288 | + } else { | |
| 289 | + babyQuery.setBirthStart(babyQuery.getBirthStart()); | |
| 290 | + } | |
| 291 | + | |
| 292 | + Date start = DateUtil.addMonth(currentDate, -babyQuery.getMonthStart()); | |
| 293 | + if (babyQuery.getBirthEnd().getTime() < start.getTime()) { | |
| 294 | + babyQuery.setBirthEnd(babyQuery.getBirthEnd()); | |
| 295 | + } else { | |
| 296 | + babyQuery.setBirthEnd(start); | |
| 297 | + } | |
| 298 | + | |
| 299 | + } else if (null != babyQuery.getMonthStart() && null != babyQuery.getMonthEnd()) { | |
| 300 | + Date start = DateUtil.addMonth(currentDate, -babyQuery.getMonthStart()); | |
| 301 | + babyQuery.setBirthEnd(start); | |
| 302 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -babyQuery.getMonthEnd() - 1), 1); | |
| 303 | + babyQuery.setBirthStart(end); | |
| 304 | + } | |
| 305 | + if (babyQuery.getBirthEnd() != null) { | |
| 282 | 306 | babyQuery.setBirthEnd(DateUtil.getDayLastSecond(babyQuery.getBirthEnd())); |
| 283 | 307 | } |
| 308 | + | |
| 309 | + | |
| 284 | 310 | babySpecialDiseaseClinicModels = babySDCService.queryBabySpecialDiseaseClinicRecord(babyQuery); |
| 285 | 311 | System.out.println(babyQuery.convertToQuery().convertToMongoQuery()); |
| 286 | 312 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStuntingFacade.java
View file @
f9ed1b4
| ... | ... | @@ -92,12 +92,7 @@ |
| 92 | 92 | model.setNextDate(DateUtil.parseYMD(request.getNextDate())); |
| 93 | 93 | model.setCzOrfzProject(request.getCzOrfzProject()); |
| 94 | 94 | |
| 95 | - if (StringUtils.isNotEmpty(request.getCzOrfzProject())) { | |
| 96 | - if ("cz".equals(request.getCzOrfzProject())) { | |
| 97 | - model.setBlbh(request.getBlbh()); | |
| 98 | - } | |
| 99 | - } | |
| 100 | - | |
| 95 | + model.setBlbh(request.getBlbh()); | |
| 101 | 96 | model.setCzDate(DateUtil.parseYMD(request.getCzDate())); |
| 102 | 97 | |
| 103 | 98 | model.setAddr(request.getAddr()); |
| ... | ... | @@ -319,7 +314,7 @@ |
| 319 | 314 | BabyStuntingModel babyNutritionSpecialtyModel = babyStuntingModelList.get(i); |
| 320 | 315 | BabyStuntingResult babyStuntingResult = new BabyStuntingResult(); |
| 321 | 316 | if (babyNutritionSpecialtyModel != null) { |
| 322 | - if (StringUtils.isNotEmpty(babyNutritionSpecialtyModel.getBlbh())) { | |
| 317 | + if (StringUtils.isNotEmpty(babyNutritionSpecialtyModel.getBlbh()) && "cz".equals(babyNutritionSpecialtyModel.getCzOrfzProject())) { | |
| 323 | 318 | blbh = babyNutritionSpecialtyModel.getBlbh(); |
| 324 | 319 | } |
| 325 | 320 | if(babyQuery!=null && babyQuery.isType() && "cz".equals(babyNutritionSpecialtyModel.getCzOrfzProject())){ |
| ... | ... | @@ -370,6 +365,29 @@ |
| 370 | 365 | } |
| 371 | 366 | if (babyQuery.getNextDateEnd() != null) { |
| 372 | 367 | babyQuery.setNextDateEnd(DateUtil.getDayLastSecond(babyQuery.getNextDateEnd())); |
| 368 | + } | |
| 369 | + Date currentDate = DateUtil.formatDate(new Date()); | |
| 370 | + //月龄和生日都有 | |
| 371 | + if ((babyQuery.getBirthStart() != null && babyQuery.getBirthEnd() != null) && (null != babyQuery.getMonthStart() && null != babyQuery.getMonthEnd())) { | |
| 372 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -babyQuery.getMonthEnd() - 1), 1); | |
| 373 | + if (babyQuery.getBirthStart().getTime() < end.getTime()) { | |
| 374 | + babyQuery.setBirthStart(end); | |
| 375 | + } else { | |
| 376 | + babyQuery.setBirthStart(babyQuery.getBirthStart()); | |
| 377 | + } | |
| 378 | + | |
| 379 | + Date start = DateUtil.addMonth(currentDate, -babyQuery.getMonthStart()); | |
| 380 | + if (babyQuery.getBirthEnd().getTime() < start.getTime()) { | |
| 381 | + babyQuery.setBirthEnd(babyQuery.getBirthEnd()); | |
| 382 | + } else { | |
| 383 | + babyQuery.setBirthEnd(start); | |
| 384 | + } | |
| 385 | + | |
| 386 | + } else if (null != babyQuery.getMonthStart() && null != babyQuery.getMonthEnd()) { | |
| 387 | + Date start = DateUtil.addMonth(currentDate, -babyQuery.getMonthStart()); | |
| 388 | + babyQuery.setBirthEnd(start); | |
| 389 | + Date end = DateUtil.addDay(DateUtil.addMonth(currentDate, -babyQuery.getMonthEnd() - 1), 1); | |
| 390 | + babyQuery.setBirthStart(end); | |
| 373 | 391 | } |
| 374 | 392 | if (babyQuery.getBirthEnd() != null) { |
| 375 | 393 | babyQuery.setBirthEnd(DateUtil.getDayLastSecond(babyQuery.getBirthEnd())); |