Commit 4931272b7a736c580903817030a2d540c225e45a
1 parent
dc86cf4182
Exists in
master
and in
6 other branches
update code
Showing 4 changed files with 686 additions and 432 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/CouponMapper.java
- platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/CouponMapper.java
View file @
4931272
platform-biz-service/src/main/resources/mainOrm/master/CouponMapper.xml
View file @
4931272
... | ... | @@ -58,6 +58,25 @@ |
58 | 58 | order by create_date desc limit 0,1 |
59 | 59 | </select> |
60 | 60 | |
61 | + | |
62 | + <select id="findCouponList" parameterType="map" resultType="map"> | |
63 | + select b.actual_start, b.actual_end, b.unit_type, a.create_hospital_id, c.type, c.area_type,a.status | |
64 | + from coupon_info a, coupon_template b, coupon_type c | |
65 | + where a.coupon_template_id = b.id and b.type_id = c.id | |
66 | + <if test="userId != null"> | |
67 | + and a.user_id = #{userId} | |
68 | + </if> | |
69 | + <if test="code != null"> | |
70 | + and a.sequence_id = #{code} | |
71 | + </if> | |
72 | + <if test="type != null"> | |
73 | + and c.type = #{type} | |
74 | + </if> | |
75 | + <if test="status != null"> | |
76 | + and a.status = #{status} | |
77 | + </if> | |
78 | + </select> | |
79 | + | |
61 | 80 | <insert id="save" parameterType="com.lyms.platform.permission.model.CouponInfo"> |
62 | 81 | insert into coupon_info(id, <include refid="columnList" />) values(#{id},#{sequenceId},#{createDate},#{useDate},#{operatorUseId},#{userId},#{createUserId},#{couponTemplateId},#{createHospitalId},#{usedId},#{usedHospitalId},#{status}, #{tempHospitalId},0) |
63 | 82 | </insert> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
4931272
Diff suppressed. Click to show
... | ... | @@ -29,10 +29,8 @@ |
29 | 29 | import com.lyms.platform.operate.web.result.MaternalDeliverResult; |
30 | 30 | import com.lyms.platform.operate.web.service.IBloodPressureService; |
31 | 31 | import com.lyms.platform.operate.web.service.SyncDataTaskService; |
32 | -import com.lyms.platform.operate.web.worker.AntexOtherHighRiskWorker; | |
33 | -import com.lyms.platform.operate.web.worker.AntexcOtherHighRiskWorker; | |
34 | -import com.lyms.platform.operate.web.worker.BabyBuildSerToPatientSerWorker; | |
35 | -import com.lyms.platform.operate.web.worker.BuildSerToPatientSerWorker; | |
32 | +import com.lyms.platform.operate.web.utils.CommonsHelper; | |
33 | +import com.lyms.platform.operate.web.worker.*; | |
36 | 34 | import com.lyms.platform.permission.dao.master.CouponMapper; |
37 | 35 | import com.lyms.platform.permission.model.*; |
38 | 36 | import com.lyms.platform.permission.service.CouponService; |
... | ... | @@ -63,6 +61,8 @@ |
63 | 61 | import java.net.URLDecoder; |
64 | 62 | import java.net.URLEncoder; |
65 | 63 | import java.util.*; |
64 | +import java.util.concurrent.Callable; | |
65 | +import java.util.concurrent.Future; | |
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Created by Zhang.Rui on 2016/4/8. |
69 | 69 | |
70 | 70 | |
71 | 71 | |
72 | 72 | |
73 | 73 | |
... | ... | @@ -2356,431 +2356,408 @@ |
2356 | 2356 | return map; |
2357 | 2357 | } |
2358 | 2358 | |
2359 | - | |
2360 | - /** | |
2361 | - * 查询冠新ID | |
2362 | - * | |
2363 | - * @param name | |
2364 | - * @param idCard | |
2365 | - * @return | |
2366 | - */ | |
2367 | - @RequestMapping(value = "/cd/id") | |
2368 | - @ResponseBody | |
2369 | - public String getId(@RequestParam("name") String name, @RequestParam("idCard") String idCard) { | |
2370 | - try { | |
2371 | - String skiName = new String(name.getBytes("ISO-8859-1"), "UTF-8"); | |
2372 | - String str = "{\"name\":\"" + skiName + "\",\"idNo\":\"" + idCard + "\",\"parentIdNo\":\"\"}"; | |
2373 | - return cdGwInterface.findPersonInfoId(str); | |
2374 | - } catch (Exception e) { | |
2375 | - e.printStackTrace(); | |
2376 | - } | |
2377 | - | |
2378 | - return null; | |
2379 | - } | |
2380 | - | |
2381 | - @RequestMapping(value = "/bp/report") | |
2382 | - @ResponseBody | |
2383 | - public String bpReportTrigger(@RequestHeader("Authorization") String header) { | |
2384 | - if ("lyms".equals(header)) { | |
2385 | - bloodPressureService.generateBpReport(); | |
2386 | - return "ss"; | |
2387 | - } | |
2388 | - return "error"; | |
2389 | - } | |
2390 | - | |
2359 | +// | |
2360 | +// /** | |
2361 | +// * 查询冠新ID | |
2362 | +// * | |
2363 | +// * @param name | |
2364 | +// * @param idCard | |
2365 | +// * @return | |
2366 | +// */ | |
2367 | +// @RequestMapping(value = "/cd/id") | |
2368 | +// @ResponseBody | |
2369 | +// public String getId(@RequestParam("name") String name, @RequestParam("idCard") String idCard) { | |
2370 | +// try { | |
2371 | +// String skiName = new String(name.getBytes("ISO-8859-1"), "UTF-8"); | |
2372 | +// String str = "{\"name\":\"" + skiName + "\",\"idNo\":\"" + idCard + "\",\"parentIdNo\":\"\"}"; | |
2373 | +// return cdGwInterface.findPersonInfoId(str); | |
2374 | +// } catch (Exception e) { | |
2375 | +// e.printStackTrace(); | |
2376 | +// } | |
2377 | +// | |
2378 | +// return null; | |
2379 | +// } | |
2380 | +// | |
2381 | +// @RequestMapping(value = "/bp/report") | |
2382 | +// @ResponseBody | |
2383 | +// public String bpReportTrigger(@RequestHeader("Authorization") String header) { | |
2384 | +// if ("lyms".equals(header)) { | |
2385 | +// bloodPressureService.generateBpReport(); | |
2386 | +// return "ss"; | |
2387 | +// } | |
2388 | +// return "error"; | |
2389 | +// } | |
2390 | +// | |
2391 | 2391 | @Autowired |
2392 | 2392 | private PatientServiceService patientServiceService; |
2393 | +// | |
2394 | +// @RequestMapping(value = "/rcPatientInfo", method = RequestMethod.GET) | |
2395 | +// @ResponseBody | |
2396 | +// public void rcPatientInfo(@RequestParam(required = false) String hospitalId) { | |
2397 | +// | |
2398 | +// OrganizationQuery organizationQuery = new OrganizationQuery(); | |
2399 | +// organizationQuery.setYn(YnEnums.YES.getId()); | |
2400 | +// if (StringUtils.isNotEmpty(hospitalId)) { | |
2401 | +// organizationQuery.setId(Integer.parseInt(hospitalId)); | |
2402 | +// } | |
2403 | +// List<Organization> organizationList = organizationService.queryOrganization(organizationQuery); | |
2404 | +// | |
2405 | +// PatientsQuery patientsQuery1 = new PatientsQuery(); | |
2406 | +// patientsQuery1.setYn(YnEnums.YES.getId()); | |
2407 | +// if (CollectionUtils.isNotEmpty(organizationList)) { | |
2408 | +// List<String> hids = new ArrayList<>(); | |
2409 | +// for (Organization org :organizationList) | |
2410 | +// { | |
2411 | +// hids.add(org.getId()+""); | |
2412 | +// } | |
2413 | +// patientsQuery1.setHospitalList(hids); | |
2414 | +// } | |
2415 | +// else | |
2416 | +// { | |
2417 | +// patientsQuery1.setHospitalList(rcGlxtService.getHids()); | |
2418 | +// } | |
2419 | +// List<Patients> patientses = patientsService.queryPatient(patientsQuery1); | |
2420 | +// if (CollectionUtils.isNotEmpty(patientses)) | |
2421 | +// { | |
2422 | +// for (Patients pat : patientses) | |
2423 | +// { | |
2424 | +// rcGlxtService.saveRcPatientInfo(pat); | |
2425 | +// } | |
2426 | +// } | |
2427 | +// } | |
2428 | +// | |
2429 | +// @RequestMapping(value = "/rcFmInfo", method = RequestMethod.GET) | |
2430 | +// @ResponseBody | |
2431 | +// public void rcFmInfo(@RequestParam(required = false) String hospitalId) { | |
2432 | +// | |
2433 | +// OrganizationQuery organizationQuery = new OrganizationQuery(); | |
2434 | +// organizationQuery.setYn(YnEnums.YES.getId()); | |
2435 | +// if (StringUtils.isNotEmpty(hospitalId)) { | |
2436 | +// organizationQuery.setId(Integer.parseInt(hospitalId)); | |
2437 | +// } | |
2438 | +// List<Organization> organizationList = organizationService.queryOrganization(organizationQuery); | |
2439 | +// | |
2440 | +// MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
2441 | +// matDeliverQuery.setYn(YnEnums.YES.getId()); | |
2442 | +// if (CollectionUtils.isNotEmpty(organizationList)) { | |
2443 | +// List<String> hids = new ArrayList<>(); | |
2444 | +// for (Organization org :organizationList) | |
2445 | +// { | |
2446 | +// hids.add(org.getId()+""); | |
2447 | +// } | |
2448 | +// matDeliverQuery.setFmHospitalList(hids); | |
2449 | +// } | |
2450 | +// else | |
2451 | +// { | |
2452 | +// matDeliverQuery.setFmHospitalList(rcGlxtService.getHids()); | |
2453 | +// } | |
2454 | +// List<MaternalDeliverModel> list2 = matDeliverService.query(matDeliverQuery); | |
2455 | +// | |
2456 | +// if (CollectionUtils.isNotEmpty(list2)) | |
2457 | +// { | |
2458 | +// for (MaternalDeliverModel maternalDeliverModel : list2) | |
2459 | +// { | |
2460 | +// rcGlxtService.saveRcFmInfo(maternalDeliverModel); | |
2461 | +// } | |
2462 | +// } | |
2463 | +// } | |
2464 | +// | |
2465 | +// | |
2466 | +// @RequestMapping(value = "/rcNewBabyInfo", method = RequestMethod.GET) | |
2467 | +// @ResponseBody | |
2468 | +// public void rcNewBabyInfo(@RequestParam(required = false) String hospitalId) { | |
2469 | +// | |
2470 | +// OrganizationQuery organizationQuery = new OrganizationQuery(); | |
2471 | +// organizationQuery.setYn(YnEnums.YES.getId()); | |
2472 | +// if (StringUtils.isNotEmpty(hospitalId)) { | |
2473 | +// organizationQuery.setId(Integer.parseInt(hospitalId)); | |
2474 | +// } | |
2475 | +// List<Organization> organizationList = organizationService.queryOrganization(organizationQuery); | |
2476 | +// | |
2477 | +// MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
2478 | +// matDeliverQuery.setYn(YnEnums.YES.getId()); | |
2479 | +// if (CollectionUtils.isNotEmpty(organizationList)) { | |
2480 | +// List<String> hids = new ArrayList<>(); | |
2481 | +// for (Organization org :organizationList) | |
2482 | +// { | |
2483 | +// hids.add(org.getId()+""); | |
2484 | +// } | |
2485 | +// matDeliverQuery.setFmHospitalList(hids); | |
2486 | +// } | |
2487 | +// else | |
2488 | +// { | |
2489 | +// matDeliverQuery.setFmHospitalList(rcGlxtService.getHids()); | |
2490 | +// } | |
2491 | +// List<MaternalDeliverModel> list2 = matDeliverService.query(matDeliverQuery); | |
2492 | +// | |
2493 | +// if (CollectionUtils.isNotEmpty(list2)) | |
2494 | +// { | |
2495 | +// for (MaternalDeliverModel maternalDeliverModel : list2) | |
2496 | +// { | |
2497 | +// rcGlxtService.saveRcNewBabyInfo(maternalDeliverModel); | |
2498 | +// } | |
2499 | +// } | |
2500 | +// } | |
2501 | +// | |
2502 | +// | |
2503 | +// /** | |
2504 | +// *产后访视 | |
2505 | +// * @param hospitalId | |
2506 | +// */ | |
2507 | +// @RequestMapping(value = "/rcFmFollowInfo", method = RequestMethod.GET) | |
2508 | +// @ResponseBody | |
2509 | +// public void rcFmFollowInfo(@RequestParam(required = false) String hospitalId) { | |
2510 | +// | |
2511 | +// MatDeliverFollowQuery matDeliverFollowQuery = new MatDeliverFollowQuery(); | |
2512 | +// List<MatdeliverFollowModel> matdeliverFollowModels = matDeliverFollowService.query(matDeliverFollowQuery); | |
2513 | +// matDeliverFollowQuery.setVisitStatus(2); | |
2514 | +// if (CollectionUtils.isNotEmpty(matdeliverFollowModels)) | |
2515 | +// { | |
2516 | +// for (MatdeliverFollowModel matdeliverFollowModel : matdeliverFollowModels) | |
2517 | +// { | |
2518 | +// rcGlxtService.saveRcMatdeliverFollowInfo(matdeliverFollowModel, rcGlxtService.getHids()); | |
2519 | +// } | |
2520 | +// } | |
2521 | +// } | |
2522 | +// @Autowired | |
2523 | +// private PremaritalCheckupService premaritalCheckupService; | |
2524 | +// | |
2525 | +// /** | |
2526 | +// * 婚前检查 | |
2527 | +// * @param hospitalId | |
2528 | +// */ | |
2529 | +// @RequestMapping(value = "/rcPremaritalCheckup", method = RequestMethod.GET) | |
2530 | +// @ResponseBody | |
2531 | +// public void rcPremaritalCheckup(@RequestParam(required = false) String hospitalId) { | |
2532 | +// | |
2533 | +// PremaritalCheckupQuery query = new PremaritalCheckupQuery(); | |
2534 | +// query.setYn(YnEnums.YES.getId()); | |
2535 | +// query.setHospitalId(hospitalId); | |
2536 | +// query.setSexType(1); | |
2537 | +// List<PremaritalCheckup> checkupList = premaritalCheckupService.queryPremaritalCheckup(query); | |
2538 | +// | |
2539 | +// if (CollectionUtils.isNotEmpty(checkupList)) | |
2540 | +// { | |
2541 | +// for (PremaritalCheckup premaritalCheckup : checkupList) | |
2542 | +// { | |
2543 | +// rcGlxtService.saveRcPremaritalCheckupInfo(premaritalCheckup); | |
2544 | +// } | |
2545 | +// } | |
2546 | +// } | |
2547 | +// | |
2548 | +// | |
2549 | +// /** | |
2550 | +// * 叶酸发放 | |
2551 | +// * @param hospitalId | |
2552 | +// */ | |
2553 | +// @RequestMapping(value = "/rcFolicAcidInfo", method = RequestMethod.GET) | |
2554 | +// @ResponseBody | |
2555 | +// public void rcFolicAcidInfo(@RequestParam(required = false) String hospitalId) { | |
2556 | +// | |
2557 | +// FolicAcidQuery folicAcidQuery = new FolicAcidQuery(); | |
2558 | +// folicAcidQuery.setYn(YnEnums.YES.getId()); | |
2559 | +// | |
2560 | +// List<FolicAcid> folicAcidList = folicAcidService.queryFolicAcidWithSort(folicAcidQuery, "drawTime", Sort.Direction.ASC); | |
2561 | +// | |
2562 | +// if (CollectionUtils.isNotEmpty(folicAcidList)) | |
2563 | +// { | |
2564 | +// for (FolicAcid folicAcid : folicAcidList) | |
2565 | +// { | |
2566 | +// rcGlxtService.saveRcFolicAcidInfo(folicAcid); | |
2567 | +// } | |
2568 | +// } | |
2569 | +// } | |
2570 | +// | |
2571 | +// /** | |
2572 | +// * 孕期筛查表 | |
2573 | +// * @param hospitalId | |
2574 | +// */ | |
2575 | +// @RequestMapping(value = "/rcSieveInfo", method = RequestMethod.GET) | |
2576 | +// @ResponseBody | |
2577 | +// public void rcSieveInfo(@RequestParam(required = false) String hospitalId) { | |
2578 | +// SieveResultQuery sieveResultQuery = new SieveResultQuery(); | |
2579 | +// sieveResultQuery.setYn(YnEnums.YES.getId()); | |
2580 | +// List<SieveResultModel> list = sieveService.queryListSieveResult(sieveResultQuery); | |
2581 | +// if (CollectionUtils.isNotEmpty(list)) | |
2582 | +// { | |
2583 | +// for (SieveResultModel sieveResultModel : list) | |
2584 | +// { | |
2585 | +// rcGlxtService.saveRcSieveInfo(sieveResultModel, rcGlxtService.getHids()); | |
2586 | +// } | |
2587 | +// } | |
2588 | +// } | |
2589 | +// | |
2590 | +// | |
2591 | +// /** | |
2592 | +// * 风险妊娠 | |
2593 | +// * @param hospitalId | |
2594 | +// */ | |
2595 | +// @RequestMapping(value = "/rcPatientRiskRecord", method = RequestMethod.GET) | |
2596 | +// @ResponseBody | |
2597 | +// public void rcPatientRiskRecord(@RequestParam(required = false) String hospitalId) { | |
2598 | +// | |
2599 | +// rcGlxtService.riskAndScreen(); | |
2600 | +// AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); | |
2601 | +// antExRecordQuery.setHospitalList(rcGlxtService.getHids()); | |
2602 | +// List<AntExRecordModel> recordModels = recordService.queryAntExRecords(antExRecordQuery); | |
2603 | +// if (CollectionUtils.isNotEmpty(recordModels)) | |
2604 | +// { | |
2605 | +// for (AntExRecordModel antExRecordModel : recordModels) | |
2606 | +// { | |
2607 | +// rcGlxtService.saveRcPatientRiskRecord(antExRecordModel); | |
2608 | +// } | |
2609 | +// } | |
2610 | +// } | |
2611 | +// | |
2612 | +// | |
2613 | +// /** | |
2614 | +// * 母婴阻断 | |
2615 | +// * @param hospitalId | |
2616 | +// */ | |
2617 | +// @RequestMapping(value = "/rcZdInfo", method = RequestMethod.GET) | |
2618 | +// @ResponseBody | |
2619 | +// public void rcZdInfo(@RequestParam(required = false) String hospitalId) { | |
2620 | +// | |
2621 | +// AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
2622 | +// antExChuQuery.setYn(YnEnums.YES.getId()); | |
2623 | +// antExChuQuery.setHospitalList(rcGlxtService.getHids()); | |
2624 | +// antExChuQuery.setCreatedTimeStart(DateUtil.addMonth(new Date(), -5)); | |
2625 | +// antExChuQuery.setCreatedTimeEnd(new Date()); | |
2626 | +// List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
2627 | +// if (CollectionUtils.isNotEmpty(antExChuModels)) | |
2628 | +// { | |
2629 | +// for (AntExChuModel chuModel : antExChuModels) | |
2630 | +// { | |
2631 | +// rcGlxtService.saveRcZdInfo(chuModel); | |
2632 | +// } | |
2633 | +// } | |
2634 | +// } | |
2635 | +// | |
2636 | +// | |
2637 | +// /** | |
2638 | +// * 孕产妇早孕诊断信息表 | |
2639 | +// */ | |
2640 | +// @RequestMapping(value = "/rcDiagnosisInfo", method = RequestMethod.GET) | |
2641 | +// @ResponseBody | |
2642 | +// public void rcDiagnosisInfo() { | |
2643 | +// | |
2644 | +// AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
2645 | +// antExChuQuery.setYn(YnEnums.YES.getId()); | |
2646 | +// antExChuQuery.setHospitalList(rcGlxtService.getHids()); | |
2647 | +// antExChuQuery.setCreatedTimeStart(DateUtil.addMonth(new Date(), -5)); | |
2648 | +// antExChuQuery.setCreatedTimeEnd(new Date()); | |
2649 | +// List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
2650 | +// if (com.lyms.platform.operate.web.utils.CollectionUtils.isNotEmpty(antExChuModels)) { | |
2651 | +// for (AntExChuModel chuModel : antExChuModels) { | |
2652 | +// | |
2653 | +// rcGlxtService.saveCheckChu(chuModel); | |
2654 | +// } | |
2655 | +// } | |
2656 | +// | |
2657 | +// AntExQuery antExQuery = new AntExQuery(); | |
2658 | +// antExQuery.setYn(YnEnums.YES.getId()); | |
2659 | +// antExQuery.setHospitalIds(rcGlxtService.getHids()); | |
2660 | +// antExQuery.setModifiedStart(DateUtil.addMonth(new Date(), -5)); | |
2661 | +// antExQuery.setModifiedEnd(new Date()); | |
2662 | +// List<AntenatalExaminationModel> antEx = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
2663 | +// if (com.lyms.platform.operate.web.utils.CollectionUtils.isNotEmpty(antEx)) | |
2664 | +// { | |
2665 | +// for (AntenatalExaminationModel f : antEx) | |
2666 | +// { | |
2667 | +// rcGlxtService.saveCheckFu(f); | |
2668 | +// } | |
2669 | +// } | |
2670 | +// | |
2671 | +// } | |
2672 | +// | |
2673 | +// | |
2674 | +// /** | |
2675 | +// * 自定义查询 | |
2676 | +// * | |
2677 | +// * @param start | |
2678 | +// * @param end | |
2679 | +// * @return | |
2680 | +// */ | |
2681 | +// @RequestMapping(value = "/cd/zdy") | |
2682 | +// @ResponseBody | |
2683 | +// public String getZdy(@RequestParam("start") String start, @RequestParam("end") String end) { | |
2684 | +// | |
2685 | +// cdGwInterface.test(start, end); | |
2686 | +// return "1"; | |
2687 | +// } | |
2688 | +// | |
2689 | +// /** | |
2690 | +// * 承德新筛接口 | |
2691 | +// * @param date | |
2692 | +// * @return | |
2693 | +// */ | |
2694 | +// @RequestMapping(value = "/dr") | |
2695 | +// @ResponseBody | |
2696 | +// public String drCeshi(String date){ | |
2697 | +// babySieveFacede.newSieveLab(date); | |
2698 | +// return null; | |
2699 | +// } | |
2700 | +// | |
2701 | +// @RequestMapping(value = "/updateBabyStatus", method = RequestMethod.GET) | |
2702 | +// @ResponseBody | |
2703 | +// public String updateBabyStatus(@RequestParam(required = true) String hid,@RequestParam(required = false) String babyId) { | |
2704 | +// | |
2705 | +// BabyModelQuery babyModelQuery = new BabyModelQuery(); | |
2706 | +// babyModelQuery.setYn(YnEnums.YES.getId()); | |
2707 | +// babyModelQuery.setHospitalId(hid); | |
2708 | +// if (StringUtils.isNotEmpty(babyId)) | |
2709 | +// { | |
2710 | +// babyModelQuery.setId(babyId); | |
2711 | +// } | |
2712 | +// | |
2713 | +// List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyModelQuery); | |
2714 | +// if (CollectionUtils.isNotEmpty(models)) | |
2715 | +// { | |
2716 | +// for (BabyModel babyModel : models) | |
2717 | +// { | |
2718 | +// boolean isUpdate = false; | |
2719 | +// String babyWeight = babyModel.getBabyWeight(); | |
2720 | +// if (StringUtils.isNotEmpty(babyWeight)) | |
2721 | +// { | |
2722 | +// Double weight = Double.parseDouble(babyWeight) * 1000; | |
2723 | +// if (weight != 0 && weight < 2500) | |
2724 | +// { | |
2725 | +// List<String> weak = new ArrayList<>(); | |
2726 | +// weak.add("5b18f428422b03d4ad2bf900"); | |
2727 | +// babyModel.setWeakSonInfo(weak); | |
2728 | +// babyModel.setWeakSon(1); | |
2729 | +// isUpdate = true; | |
2730 | +// } | |
2731 | +// } | |
2732 | +// Integer dueWeek = babyModel.getDueWeek(); | |
2733 | +// if (dueWeek != null && dueWeek < 37) | |
2734 | +// { | |
2735 | +// | |
2736 | +// List<String> hiskInfo = new ArrayList<>(); | |
2737 | +// hiskInfo.add("5b18f99b422b03d4ad2bf917"); | |
2738 | +// babyModel.setHighRiskInfo(hiskInfo); | |
2739 | +// babyModel.setHighRisk(1); | |
2740 | +// isUpdate = true; | |
2741 | +// } | |
2742 | +// if (isUpdate) | |
2743 | +// { | |
2744 | +// babyBookbuildingService.updateBabyBuild(babyModel,babyModel.getId()); | |
2745 | +// } | |
2746 | +// } | |
2747 | +// } | |
2748 | +// return "finishing。。。。。。"; | |
2749 | +// } | |
2393 | 2750 | |
2394 | - @RequestMapping(value = "/rcPatientInfo", method = RequestMethod.GET) | |
2395 | - @ResponseBody | |
2396 | - public void rcPatientInfo(@RequestParam(required = false) String hospitalId) { | |
2397 | - | |
2398 | - OrganizationQuery organizationQuery = new OrganizationQuery(); | |
2399 | - organizationQuery.setYn(YnEnums.YES.getId()); | |
2400 | - if (StringUtils.isNotEmpty(hospitalId)) { | |
2401 | - organizationQuery.setId(Integer.parseInt(hospitalId)); | |
2402 | - } | |
2403 | - List<Organization> organizationList = organizationService.queryOrganization(organizationQuery); | |
2404 | - | |
2405 | - PatientsQuery patientsQuery1 = new PatientsQuery(); | |
2406 | - patientsQuery1.setYn(YnEnums.YES.getId()); | |
2407 | - if (CollectionUtils.isNotEmpty(organizationList)) { | |
2408 | - List<String> hids = new ArrayList<>(); | |
2409 | - for (Organization org :organizationList) | |
2410 | - { | |
2411 | - hids.add(org.getId()+""); | |
2412 | - } | |
2413 | - patientsQuery1.setHospitalList(hids); | |
2414 | - } | |
2415 | - else | |
2416 | - { | |
2417 | - patientsQuery1.setHospitalList(rcGlxtService.getHids()); | |
2418 | - } | |
2419 | - List<Patients> patientses = patientsService.queryPatient(patientsQuery1); | |
2420 | - if (CollectionUtils.isNotEmpty(patientses)) | |
2421 | - { | |
2422 | - for (Patients pat : patientses) | |
2423 | - { | |
2424 | - rcGlxtService.saveRcPatientInfo(pat); | |
2425 | - } | |
2426 | - } | |
2427 | - } | |
2428 | - | |
2429 | - @RequestMapping(value = "/rcFmInfo", method = RequestMethod.GET) | |
2430 | - @ResponseBody | |
2431 | - public void rcFmInfo(@RequestParam(required = false) String hospitalId) { | |
2432 | - | |
2433 | - OrganizationQuery organizationQuery = new OrganizationQuery(); | |
2434 | - organizationQuery.setYn(YnEnums.YES.getId()); | |
2435 | - if (StringUtils.isNotEmpty(hospitalId)) { | |
2436 | - organizationQuery.setId(Integer.parseInt(hospitalId)); | |
2437 | - } | |
2438 | - List<Organization> organizationList = organizationService.queryOrganization(organizationQuery); | |
2439 | - | |
2440 | - MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
2441 | - matDeliverQuery.setYn(YnEnums.YES.getId()); | |
2442 | - if (CollectionUtils.isNotEmpty(organizationList)) { | |
2443 | - List<String> hids = new ArrayList<>(); | |
2444 | - for (Organization org :organizationList) | |
2445 | - { | |
2446 | - hids.add(org.getId()+""); | |
2447 | - } | |
2448 | - matDeliverQuery.setFmHospitalList(hids); | |
2449 | - } | |
2450 | - else | |
2451 | - { | |
2452 | - matDeliverQuery.setFmHospitalList(rcGlxtService.getHids()); | |
2453 | - } | |
2454 | - List<MaternalDeliverModel> list2 = matDeliverService.query(matDeliverQuery); | |
2455 | - | |
2456 | - if (CollectionUtils.isNotEmpty(list2)) | |
2457 | - { | |
2458 | - for (MaternalDeliverModel maternalDeliverModel : list2) | |
2459 | - { | |
2460 | - rcGlxtService.saveRcFmInfo(maternalDeliverModel); | |
2461 | - } | |
2462 | - } | |
2463 | - } | |
2464 | - | |
2465 | - | |
2466 | - @RequestMapping(value = "/rcNewBabyInfo", method = RequestMethod.GET) | |
2467 | - @ResponseBody | |
2468 | - public void rcNewBabyInfo(@RequestParam(required = false) String hospitalId) { | |
2469 | - | |
2470 | - OrganizationQuery organizationQuery = new OrganizationQuery(); | |
2471 | - organizationQuery.setYn(YnEnums.YES.getId()); | |
2472 | - if (StringUtils.isNotEmpty(hospitalId)) { | |
2473 | - organizationQuery.setId(Integer.parseInt(hospitalId)); | |
2474 | - } | |
2475 | - List<Organization> organizationList = organizationService.queryOrganization(organizationQuery); | |
2476 | - | |
2477 | - MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
2478 | - matDeliverQuery.setYn(YnEnums.YES.getId()); | |
2479 | - if (CollectionUtils.isNotEmpty(organizationList)) { | |
2480 | - List<String> hids = new ArrayList<>(); | |
2481 | - for (Organization org :organizationList) | |
2482 | - { | |
2483 | - hids.add(org.getId()+""); | |
2484 | - } | |
2485 | - matDeliverQuery.setFmHospitalList(hids); | |
2486 | - } | |
2487 | - else | |
2488 | - { | |
2489 | - matDeliverQuery.setFmHospitalList(rcGlxtService.getHids()); | |
2490 | - } | |
2491 | - List<MaternalDeliverModel> list2 = matDeliverService.query(matDeliverQuery); | |
2492 | - | |
2493 | - if (CollectionUtils.isNotEmpty(list2)) | |
2494 | - { | |
2495 | - for (MaternalDeliverModel maternalDeliverModel : list2) | |
2496 | - { | |
2497 | - rcGlxtService.saveRcNewBabyInfo(maternalDeliverModel); | |
2498 | - } | |
2499 | - } | |
2500 | - } | |
2501 | - | |
2502 | - | |
2503 | - /** | |
2504 | - *产后访视 | |
2505 | - * @param hospitalId | |
2506 | - */ | |
2507 | - @RequestMapping(value = "/rcFmFollowInfo", method = RequestMethod.GET) | |
2508 | - @ResponseBody | |
2509 | - public void rcFmFollowInfo(@RequestParam(required = false) String hospitalId) { | |
2510 | - | |
2511 | - MatDeliverFollowQuery matDeliverFollowQuery = new MatDeliverFollowQuery(); | |
2512 | - List<MatdeliverFollowModel> matdeliverFollowModels = matDeliverFollowService.query(matDeliverFollowQuery); | |
2513 | - matDeliverFollowQuery.setVisitStatus(2); | |
2514 | - if (CollectionUtils.isNotEmpty(matdeliverFollowModels)) | |
2515 | - { | |
2516 | - for (MatdeliverFollowModel matdeliverFollowModel : matdeliverFollowModels) | |
2517 | - { | |
2518 | - rcGlxtService.saveRcMatdeliverFollowInfo(matdeliverFollowModel, rcGlxtService.getHids()); | |
2519 | - } | |
2520 | - } | |
2521 | - } | |
2522 | 2751 | @Autowired |
2523 | - private PremaritalCheckupService premaritalCheckupService; | |
2524 | - | |
2525 | - /** | |
2526 | - * 婚前检查 | |
2527 | - * @param hospitalId | |
2528 | - */ | |
2529 | - @RequestMapping(value = "/rcPremaritalCheckup", method = RequestMethod.GET) | |
2530 | - @ResponseBody | |
2531 | - public void rcPremaritalCheckup(@RequestParam(required = false) String hospitalId) { | |
2532 | - | |
2533 | - PremaritalCheckupQuery query = new PremaritalCheckupQuery(); | |
2534 | - query.setYn(YnEnums.YES.getId()); | |
2535 | - query.setHospitalId(hospitalId); | |
2536 | - query.setSexType(1); | |
2537 | - List<PremaritalCheckup> checkupList = premaritalCheckupService.queryPremaritalCheckup(query); | |
2538 | - | |
2539 | - if (CollectionUtils.isNotEmpty(checkupList)) | |
2540 | - { | |
2541 | - for (PremaritalCheckup premaritalCheckup : checkupList) | |
2542 | - { | |
2543 | - rcGlxtService.saveRcPremaritalCheckupInfo(premaritalCheckup); | |
2544 | - } | |
2545 | - } | |
2546 | - } | |
2547 | - | |
2548 | - | |
2549 | - /** | |
2550 | - * 叶酸发放 | |
2551 | - * @param hospitalId | |
2552 | - */ | |
2553 | - @RequestMapping(value = "/rcFolicAcidInfo", method = RequestMethod.GET) | |
2554 | - @ResponseBody | |
2555 | - public void rcFolicAcidInfo(@RequestParam(required = false) String hospitalId) { | |
2556 | - | |
2557 | - FolicAcidQuery folicAcidQuery = new FolicAcidQuery(); | |
2558 | - folicAcidQuery.setYn(YnEnums.YES.getId()); | |
2559 | - | |
2560 | - List<FolicAcid> folicAcidList = folicAcidService.queryFolicAcidWithSort(folicAcidQuery, "drawTime", Sort.Direction.ASC); | |
2561 | - | |
2562 | - if (CollectionUtils.isNotEmpty(folicAcidList)) | |
2563 | - { | |
2564 | - for (FolicAcid folicAcid : folicAcidList) | |
2565 | - { | |
2566 | - rcGlxtService.saveRcFolicAcidInfo(folicAcid); | |
2567 | - } | |
2568 | - } | |
2569 | - } | |
2570 | - | |
2571 | - /** | |
2572 | - * 孕期筛查表 | |
2573 | - * @param hospitalId | |
2574 | - */ | |
2575 | - @RequestMapping(value = "/rcSieveInfo", method = RequestMethod.GET) | |
2576 | - @ResponseBody | |
2577 | - public void rcSieveInfo(@RequestParam(required = false) String hospitalId) { | |
2578 | - SieveResultQuery sieveResultQuery = new SieveResultQuery(); | |
2579 | - sieveResultQuery.setYn(YnEnums.YES.getId()); | |
2580 | - List<SieveResultModel> list = sieveService.queryListSieveResult(sieveResultQuery); | |
2581 | - if (CollectionUtils.isNotEmpty(list)) | |
2582 | - { | |
2583 | - for (SieveResultModel sieveResultModel : list) | |
2584 | - { | |
2585 | - rcGlxtService.saveRcSieveInfo(sieveResultModel, rcGlxtService.getHids()); | |
2586 | - } | |
2587 | - } | |
2588 | - } | |
2589 | - | |
2590 | - | |
2591 | - /** | |
2592 | - * 风险妊娠 | |
2593 | - * @param hospitalId | |
2594 | - */ | |
2595 | - @RequestMapping(value = "/rcPatientRiskRecord", method = RequestMethod.GET) | |
2596 | - @ResponseBody | |
2597 | - public void rcPatientRiskRecord(@RequestParam(required = false) String hospitalId) { | |
2598 | - | |
2599 | - rcGlxtService.riskAndScreen(); | |
2600 | - AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); | |
2601 | - antExRecordQuery.setHospitalList(rcGlxtService.getHids()); | |
2602 | - List<AntExRecordModel> recordModels = recordService.queryAntExRecords(antExRecordQuery); | |
2603 | - if (CollectionUtils.isNotEmpty(recordModels)) | |
2604 | - { | |
2605 | - for (AntExRecordModel antExRecordModel : recordModels) | |
2606 | - { | |
2607 | - rcGlxtService.saveRcPatientRiskRecord(antExRecordModel); | |
2608 | - } | |
2609 | - } | |
2610 | - } | |
2611 | - | |
2612 | - | |
2613 | - /** | |
2614 | - * 母婴阻断 | |
2615 | - * @param hospitalId | |
2616 | - */ | |
2617 | - @RequestMapping(value = "/rcZdInfo", method = RequestMethod.GET) | |
2618 | - @ResponseBody | |
2619 | - public void rcZdInfo(@RequestParam(required = false) String hospitalId) { | |
2620 | - | |
2621 | - AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
2622 | - antExChuQuery.setYn(YnEnums.YES.getId()); | |
2623 | - antExChuQuery.setHospitalList(rcGlxtService.getHids()); | |
2624 | - antExChuQuery.setCreatedTimeStart(DateUtil.addMonth(new Date(), -5)); | |
2625 | - antExChuQuery.setCreatedTimeEnd(new Date()); | |
2626 | - List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
2627 | - if (CollectionUtils.isNotEmpty(antExChuModels)) | |
2628 | - { | |
2629 | - for (AntExChuModel chuModel : antExChuModels) | |
2630 | - { | |
2631 | - rcGlxtService.saveRcZdInfo(chuModel); | |
2632 | - } | |
2633 | - } | |
2634 | - } | |
2635 | - | |
2636 | - | |
2637 | - /** | |
2638 | - * 孕产妇早孕诊断信息表 | |
2639 | - */ | |
2640 | - @RequestMapping(value = "/rcDiagnosisInfo", method = RequestMethod.GET) | |
2641 | - @ResponseBody | |
2642 | - public void rcDiagnosisInfo() { | |
2643 | - | |
2644 | - AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
2645 | - antExChuQuery.setYn(YnEnums.YES.getId()); | |
2646 | - antExChuQuery.setHospitalList(rcGlxtService.getHids()); | |
2647 | - antExChuQuery.setCreatedTimeStart(DateUtil.addMonth(new Date(), -5)); | |
2648 | - antExChuQuery.setCreatedTimeEnd(new Date()); | |
2649 | - List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
2650 | - if (com.lyms.platform.operate.web.utils.CollectionUtils.isNotEmpty(antExChuModels)) { | |
2651 | - for (AntExChuModel chuModel : antExChuModels) { | |
2652 | - | |
2653 | - rcGlxtService.saveCheckChu(chuModel); | |
2654 | - } | |
2655 | - } | |
2656 | - | |
2657 | - AntExQuery antExQuery = new AntExQuery(); | |
2658 | - antExQuery.setYn(YnEnums.YES.getId()); | |
2659 | - antExQuery.setHospitalIds(rcGlxtService.getHids()); | |
2660 | - antExQuery.setModifiedStart(DateUtil.addMonth(new Date(), -5)); | |
2661 | - antExQuery.setModifiedEnd(new Date()); | |
2662 | - List<AntenatalExaminationModel> antEx = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
2663 | - if (com.lyms.platform.operate.web.utils.CollectionUtils.isNotEmpty(antEx)) | |
2664 | - { | |
2665 | - for (AntenatalExaminationModel f : antEx) | |
2666 | - { | |
2667 | - rcGlxtService.saveCheckFu(f); | |
2668 | - } | |
2669 | - } | |
2670 | - | |
2671 | - } | |
2672 | - | |
2673 | - | |
2674 | - /** | |
2675 | - * 自定义查询 | |
2676 | - * | |
2677 | - * @param start | |
2678 | - * @param end | |
2679 | - * @return | |
2680 | - */ | |
2681 | - @RequestMapping(value = "/cd/zdy") | |
2682 | - @ResponseBody | |
2683 | - public String getZdy(@RequestParam("start") String start, @RequestParam("end") String end) { | |
2684 | - | |
2685 | - cdGwInterface.test(start, end); | |
2686 | - return "1"; | |
2687 | - } | |
2688 | - | |
2689 | - /** | |
2690 | - * 承德新筛接口 | |
2691 | - * @param date | |
2692 | - * @return | |
2693 | - */ | |
2694 | - @RequestMapping(value = "/dr") | |
2695 | - @ResponseBody | |
2696 | - public String drCeshi(String date){ | |
2697 | - babySieveFacede.newSieveLab(date); | |
2698 | - return null; | |
2699 | - } | |
2700 | - | |
2701 | - @RequestMapping(value = "/updateBabyStatus", method = RequestMethod.GET) | |
2702 | - @ResponseBody | |
2703 | - public String updateBabyStatus(@RequestParam(required = true) String hid,@RequestParam(required = false) String babyId) { | |
2704 | - | |
2705 | - BabyModelQuery babyModelQuery = new BabyModelQuery(); | |
2706 | - babyModelQuery.setYn(YnEnums.YES.getId()); | |
2707 | - babyModelQuery.setHospitalId(hid); | |
2708 | - if (StringUtils.isNotEmpty(babyId)) | |
2709 | - { | |
2710 | - babyModelQuery.setId(babyId); | |
2711 | - } | |
2712 | - | |
2713 | - List<BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyModelQuery); | |
2714 | - if (CollectionUtils.isNotEmpty(models)) | |
2715 | - { | |
2716 | - for (BabyModel babyModel : models) | |
2717 | - { | |
2718 | - boolean isUpdate = false; | |
2719 | - String babyWeight = babyModel.getBabyWeight(); | |
2720 | - if (StringUtils.isNotEmpty(babyWeight)) | |
2721 | - { | |
2722 | - Double weight = Double.parseDouble(babyWeight) * 1000; | |
2723 | - if (weight != 0 && weight < 2500) | |
2724 | - { | |
2725 | - List<String> weak = new ArrayList<>(); | |
2726 | - weak.add("5b18f428422b03d4ad2bf900"); | |
2727 | - babyModel.setWeakSonInfo(weak); | |
2728 | - babyModel.setWeakSon(1); | |
2729 | - isUpdate = true; | |
2730 | - } | |
2731 | - } | |
2732 | - Integer dueWeek = babyModel.getDueWeek(); | |
2733 | - if (dueWeek != null && dueWeek < 37) | |
2734 | - { | |
2735 | - | |
2736 | - List<String> hiskInfo = new ArrayList<>(); | |
2737 | - hiskInfo.add("5b18f99b422b03d4ad2bf917"); | |
2738 | - babyModel.setHighRiskInfo(hiskInfo); | |
2739 | - babyModel.setHighRisk(1); | |
2740 | - isUpdate = true; | |
2741 | - } | |
2742 | - if (isUpdate) | |
2743 | - { | |
2744 | - babyBookbuildingService.updateBabyBuild(babyModel,babyModel.getId()); | |
2745 | - } | |
2746 | - } | |
2747 | - } | |
2748 | - return "finishing。。。。。。"; | |
2749 | - } | |
2750 | - @Autowired | |
2751 | - private CouponService couponService; | |
2752 | - @Autowired | |
2753 | 2752 | private CouponMapper couponMapper; |
2754 | 2753 | |
2755 | 2754 | |
2756 | - @RequestMapping(value = "/handleQhdCoupon1", method = RequestMethod.GET) | |
2757 | - @ResponseBody | |
2758 | - public void handleQhdCoupon1(@RequestParam(required = true) String hid,@RequestParam(required = false) String patientId) { | |
2759 | - List<Patients> patients = mongoTemplate.find(Query.query(Criteria.where("isSendCoupon").is(true).and("yn").is(1)).with(new Sort(Sort.Direction.DESC, "created")), Patients.class); | |
2760 | - List<String> ids = new ArrayList<>(); | |
2761 | - if (CollectionUtils.isNotEmpty(patients)) | |
2762 | - { | |
2763 | - for(Patients pat : patients) | |
2764 | - { | |
2765 | - AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
2766 | - antExChuQuery.setYn(YnEnums.YES.getId()); | |
2767 | - antExChuQuery.setParentId(pat.getId()); | |
2768 | - antExChuQuery.setHospitalId(hid); | |
2769 | - List<AntExChuModel> chus = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
2770 | - if (CollectionUtils.isNotEmpty(chus)) | |
2771 | - { | |
2772 | - AntExChuModel chu = chus.get(0); | |
2773 | - } | |
2774 | - } | |
2775 | - } | |
2776 | - } | |
2777 | - | |
2778 | 2755 | @RequestMapping(value = "/handleQhdCoupon", method = RequestMethod.GET) |
2779 | 2756 | @ResponseBody |
2780 | 2757 | public void handleQhdCoupon(@RequestParam(required = true) String hid,@RequestParam(required = false) String patientId) { |
2781 | 2758 | AntExChuQuery antExChuQuery = new AntExChuQuery(); |
2782 | 2759 | antExChuQuery.setEnd(new Date()); |
2783 | - antExChuQuery.setStart(DateUtil.addMonth(new Date(), -5)); | |
2760 | + antExChuQuery.setStart(DateUtil.addMonth(new Date(), -8)); | |
2784 | 2761 | antExChuQuery.setYn(YnEnums.YES.getId()); |
2785 | 2762 | antExChuQuery.setHospitalId(hid); |
2786 | 2763 | List<AntExChuModel> chus = antenatalExaminationService.queryAntExChu(antExChuQuery); |
2787 | 2764 | |
2788 | 2765 | |
2789 | 2766 | |
2790 | 2767 | |
2791 | 2768 | |
2792 | 2769 | |
2793 | 2770 | |
2794 | 2771 | |
2795 | 2772 | |
... | ... | @@ -2796,37 +2773,59 @@ |
2796 | 2773 | Map<String, Object> param1 = new HashMap<>(); |
2797 | 2774 | param1.put("code", couponInfo.getSequenceId()); |
2798 | 2775 | param1.put("type", 2); |
2799 | - Map<String, Object> data = couponMapper.findValidateParam(param1); | |
2776 | + Map<String, Object> data = null; | |
2800 | 2777 | |
2778 | + try { | |
2779 | + data = couponMapper.findValidateParam(param1); | |
2780 | + } | |
2781 | + catch (Exception e) | |
2782 | + { | |
2783 | + continue; | |
2784 | + } | |
2801 | 2785 | if (data == null) |
2802 | 2786 | { |
2803 | - continue; | |
2787 | + continue; | |
2804 | 2788 | } |
2789 | + | |
2790 | + Patients patient = patientsService.findOnePatientById(chu.getParentId()); | |
2791 | + if (patient == null || patient.getLastMenses() == null) | |
2792 | + { | |
2793 | + continue; | |
2794 | + } | |
2795 | + System.out.println("chu=" + patient.getId()); | |
2805 | 2796 | Integer start = Integer.parseInt(data.get("actual_start").toString()); |
2806 | 2797 | Integer end = Integer.parseInt(data.get("actual_end").toString()); |
2807 | 2798 | |
2808 | - Date startDate = DateUtils.addDays(chu.getLastMenses(), start * 7); | |
2809 | - Date endDate = DateUtils.addDays(chu.getLastMenses(), end * 7 + 6); | |
2799 | + Date startDate = DateUtils.addDays(patient.getLastMenses(), start * 7); | |
2800 | + Date endDate = DateUtils.addDays(patient.getLastMenses(), end * 7 + 6); | |
2810 | 2801 | |
2811 | 2802 | if (DateUtil.isBetween(chu.getCheckTime(), startDate, DateUtils.addDays(endDate, 1)) && couponInfo.getStatus() == 1) { |
2812 | 2803 | ids.add(chu.getParentId()); |
2813 | - break; | |
2814 | 2804 | } |
2805 | + else if(DateUtil.isBetween(chu.getCheckTime(), startDate, DateUtils.addDays(endDate, 1)) && couponInfo.getStatus() == 2) | |
2806 | + { | |
2807 | + ids.remove(chu.getParentId()); | |
2808 | + } | |
2815 | 2809 | } |
2816 | 2810 | |
2817 | 2811 | } |
2818 | 2812 | } |
2819 | 2813 | } |
2814 | + chus.clear(); | |
2820 | 2815 | } |
2821 | 2816 | |
2822 | 2817 | AntExQuery antExQuery = new AntExQuery(); |
2823 | 2818 | antExQuery.setYn(YnEnums.YES.getId()); |
2824 | 2819 | antExQuery.setHospitalId(hid); |
2825 | - antExQuery.setCreatedTimeEnd(new Date()); | |
2826 | - antExQuery.setCreatedTimeStart(DateUtil.addMonth(new Date(),-2)); | |
2820 | + antExQuery.setEnd(new Date()); | |
2821 | + antExQuery.setStart(DateUtil.addMonth(new Date(), -8)); | |
2827 | 2822 | List<AntenatalExaminationModel> fus = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); |
2828 | 2823 | if (CollectionUtils.isNotEmpty(fus)) { |
2829 | 2824 | for (AntenatalExaminationModel fu : fus) { |
2825 | + if (ids.contains(fu.getParentId())) | |
2826 | + { | |
2827 | + continue; | |
2828 | + } | |
2830 | 2829 | if (StringUtils.isNotEmpty(fu.getPid())) { |
2831 | 2830 | Map<String, Object> param = new HashMap<>(); |
2832 | 2831 | param.put("userId", fu.getPid()); |
2833 | 2832 | |
2834 | 2833 | |
2835 | 2834 | |
2836 | 2835 | |
2837 | 2836 | |
2838 | 2837 | |
2839 | 2838 | |
... | ... | @@ -2836,29 +2835,253 @@ |
2836 | 2835 | Map<String, Object> param1 = new HashMap<>(); |
2837 | 2836 | param1.put("code", couponInfo.getSequenceId()); |
2838 | 2837 | param1.put("type", 2); |
2839 | - Map<String, Object> data = couponMapper.findValidateParam(param1); | |
2838 | + Map<String, Object> data = null; | |
2839 | + | |
2840 | + try { | |
2841 | + data = couponMapper.findValidateParam(param1); | |
2842 | + } | |
2843 | + catch (Exception e) | |
2844 | + { | |
2845 | + continue; | |
2846 | + } | |
2840 | 2847 | if (data == null) |
2841 | 2848 | { |
2842 | 2849 | continue; |
2843 | 2850 | } |
2851 | + | |
2852 | + Patients patient = patientsService.findOnePatientById(fu.getParentId()); | |
2853 | + if (patient == null || patient.getLastMenses() == null) | |
2854 | + { | |
2855 | + continue; | |
2856 | + } | |
2857 | + System.out.println("fu=" + patient.getId()); | |
2858 | + | |
2844 | 2859 | Integer start = Integer.parseInt(data.get("actual_start").toString()); |
2845 | 2860 | Integer end = Integer.parseInt(data.get("actual_end").toString()); |
2846 | 2861 | |
2847 | - Date startDate = DateUtils.addDays(fu.getLastMenses(), start * 7); | |
2848 | - Date endDate = DateUtils.addDays(fu.getLastMenses(), end * 7 + 6); | |
2862 | + Date startDate = DateUtils.addDays(patient.getLastMenses(), start * 7); | |
2863 | + Date endDate = DateUtils.addDays(patient.getLastMenses(), end * 7 + 6); | |
2849 | 2864 | |
2850 | 2865 | if (DateUtil.isBetween(fu.getCheckDate(), startDate, DateUtils.addDays(endDate, 1)) && couponInfo.getStatus() == 1) { |
2851 | 2866 | if (!ids.contains(fu.getParentId())) |
2852 | 2867 | { |
2853 | - break; | |
2868 | + ids.add(fu.getParentId()); | |
2854 | 2869 | } |
2855 | 2870 | } |
2871 | + else if(DateUtil.isBetween(fu.getCheckDate(), startDate, DateUtils.addDays(endDate, 1)) && couponInfo.getStatus() == 2) | |
2872 | + { | |
2873 | + ids.remove(fu.getParentId()); | |
2874 | + } | |
2856 | 2875 | } |
2857 | 2876 | } |
2858 | 2877 | } |
2859 | 2878 | } |
2879 | + fus.clear(); | |
2860 | 2880 | } |
2881 | + | |
2882 | + | |
2883 | + List<String> contents = new ArrayList<>(); | |
2884 | + if (CollectionUtils.isNotEmpty(ids)) | |
2885 | + { | |
2886 | + PatientsQuery patientsQuery1 = new PatientsQuery(); | |
2887 | + patientsQuery1.setYn(YnEnums.YES.getId()); | |
2888 | + patientsQuery1.setIds(ids); | |
2889 | + List<Patients> patientses = patientsService.queryPatient(patientsQuery1); | |
2890 | + if (CollectionUtils.isNotEmpty(patientses)) | |
2891 | + { | |
2892 | + for (Patients pat : patientses) | |
2893 | + { | |
2894 | + //户籍地址 | |
2895 | + String addressRegister = CommonsHelper.getResidence(pat.getProvinceRegisterId(), pat.getCityRegisterId(), | |
2896 | + pat.getAreaRegisterId(), pat.getStreetRegisterId(), pat.getAddressRegister(), basicConfigService); | |
2897 | + contents.add(pat.getUsername() +" " +pat.getCardNo()+ " " + pat.getPhone() +" "+addressRegister+ "\r\n"); | |
2898 | + } | |
2899 | + patientses.clear(); | |
2900 | + } | |
2901 | + | |
2902 | + } | |
2903 | + | |
2904 | + try { | |
2905 | + File file = new File("D:\\coupon.txt"); | |
2906 | + FileUtils.writeLines(file, contents); | |
2907 | + } catch (IOException e) { | |
2908 | + e.printStackTrace(); | |
2909 | + } | |
2861 | 2910 | System.out.println(ids.size()); |
2911 | + } | |
2912 | + | |
2913 | + | |
2914 | + @RequestMapping(value = "/matDeliverQhd", method = RequestMethod.GET) | |
2915 | + @ResponseBody | |
2916 | + public void matDeliverQhd(@RequestParam(required = true) final String hid,@RequestParam(required = true) final Integer type,@RequestParam(required = true) final Integer num) { | |
2917 | + MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); | |
2918 | + matDeliverQuery.setCreatedStart(DateUtil.parseYMD("2018-01-01")); | |
2919 | + matDeliverQuery.setFmHospital(hid); | |
2920 | + matDeliverQuery.setYn(YnEnums.YES.getId()); | |
2921 | + | |
2922 | + List<MaternalDeliverModel> result = new ArrayList<>(); | |
2923 | + | |
2924 | + List<MaternalDeliverModel> deliverModels = matDeliverService.query(matDeliverQuery); | |
2925 | + System.out.println("deliverModels size="+deliverModels.size()); | |
2926 | + int batchSize = 200; | |
2927 | + int end = 0; | |
2928 | + List<Future> futures = new ArrayList<>(); | |
2929 | + for (int i = 0; i < deliverModels.size(); i += batchSize) { | |
2930 | + end = (end + batchSize); | |
2931 | + if (end > deliverModels.size()) { | |
2932 | + end = deliverModels.size(); | |
2933 | + } | |
2934 | + final List<MaternalDeliverModel> models = deliverModels.subList(i, end); | |
2935 | + Future f = commonThreadPool.submit(new Callable() { | |
2936 | + @Override | |
2937 | + public List<MaternalDeliverModel> call() throws Exception { | |
2938 | + List<MaternalDeliverModel> items = new ArrayList<>(); | |
2939 | + if (CollectionUtils.isNotEmpty(models)) | |
2940 | + { | |
2941 | + for (MaternalDeliverModel deliverModel : models) | |
2942 | + { | |
2943 | + if (StringUtils.isEmpty(deliverModel.getPid())) | |
2944 | + { | |
2945 | + System.out.println(" pid is null " + deliverModel.getId()); | |
2946 | + continue; | |
2947 | + } | |
2948 | + | |
2949 | + PatientsQuery patientQuery = new PatientsQuery(); | |
2950 | + patientQuery.setYn(YnEnums.YES.getId()); | |
2951 | + patientQuery.setType(3); | |
2952 | + patientQuery.setPid(deliverModel.getPid()); | |
2953 | + | |
2954 | + boolean isTrue = false; | |
2955 | + List<Patients> patientses = patientsService.queryPatient(patientQuery); | |
2956 | + if (CollectionUtils.isNotEmpty(patientses)) | |
2957 | + { | |
2958 | + for (Patients pat : patientses) | |
2959 | + { | |
2960 | + if (pat != null && pat.isSendCoupon() != null && pat.isSendCoupon()) | |
2961 | + { | |
2962 | + isTrue = true; | |
2963 | + break; | |
2964 | + } | |
2965 | + | |
2966 | + } | |
2967 | + if (!isTrue) | |
2968 | + { | |
2969 | + Patients pat = patientses.get(0); | |
2970 | + //户籍地址 | |
2971 | + String addressRegister = CommonsHelper.getResidence(pat.getProvinceRegisterId(), pat.getCityRegisterId(), | |
2972 | + pat.getAreaRegisterId(), pat.getStreetRegisterId(), pat.getAddressRegister(), basicConfigService); | |
2973 | + String str = pat.getUsername() + " "+DateUtil.getWeekDesc(pat.getLastMenses(), pat.getBookbuildingDate())+" " +pat.getCardNo()+ " " + pat.getPhone()+" "+deliverModel.getDueWeek() +" "+addressRegister ; | |
2974 | + ExceptionUtils.catchException("========="+str); | |
2975 | + } | |
2976 | + } | |
2977 | + | |
2978 | + if (!isTrue) | |
2979 | + { | |
2980 | + continue; | |
2981 | + } | |
2982 | + | |
2983 | + | |
2984 | + if (type == 1) | |
2985 | + { | |
2986 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
2987 | + antExChuQuery.setYn(YnEnums.YES.getId()); | |
2988 | + antExChuQuery.setHospitalId(hid); | |
2989 | + antExChuQuery.setPid(deliverModel.getPid()); | |
2990 | + List<AntExChuModel> chus = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
2991 | + | |
2992 | + AntExQuery antExQuery = new AntExQuery(); | |
2993 | + antExQuery.setYn(YnEnums.YES.getId()); | |
2994 | + antExQuery.setHospitalId(hid); | |
2995 | + antExQuery.setPid(deliverModel.getPid()); | |
2996 | + List<AntenatalExaminationModel> fus = antenatalExaminationService.queryAntenatalExamination(antExQuery.convertToQuery()); | |
2997 | + if (CollectionUtils.isNotEmpty(chus) || CollectionUtils.isNotEmpty(fus)) { | |
2998 | + Map<String, Object> param = new HashMap<>(); | |
2999 | + param.put("userId", deliverModel.getPid()); | |
3000 | + param.put("status",2); | |
3001 | + param.put("type",2); | |
3002 | + List<Map<String,Object>> list = couponMapper.findCouponList(param); | |
3003 | + if (num == 5) | |
3004 | + { | |
3005 | + if (CollectionUtils.isNotEmpty(list) && list.size() == 5) { | |
3006 | + System.out.println("pid=" + deliverModel.getPid()); | |
3007 | + items.add(deliverModel); | |
3008 | + } | |
3009 | + } | |
3010 | + else | |
3011 | + { | |
3012 | + if (CollectionUtils.isNotEmpty(list) && list.size() != 5) { | |
3013 | + System.out.println("pid=" + deliverModel.getPid()); | |
3014 | + items.add(deliverModel); | |
3015 | + } | |
3016 | + } | |
3017 | + | |
3018 | + } | |
3019 | + } | |
3020 | + else | |
3021 | + { | |
3022 | + Map<String, Object> param = new HashMap<>(); | |
3023 | + param.put("userId", deliverModel.getPid()); | |
3024 | + param.put("status", 2); | |
3025 | + param.put("type", 2); | |
3026 | + List<Map<String,Object>> list = couponMapper.findCouponList(param); | |
3027 | + if (num == 5) | |
3028 | + { | |
3029 | + if (CollectionUtils.isNotEmpty(list) && list.size() == 5) { | |
3030 | + System.out.println("pid=" + deliverModel.getPid()); | |
3031 | + items.add(deliverModel); | |
3032 | + } | |
3033 | + } | |
3034 | + else | |
3035 | + { | |
3036 | + if (CollectionUtils.isNotEmpty(list) && list.size() != 5) { | |
3037 | + System.out.println("pid=" + deliverModel.getPid()); | |
3038 | + items.add(deliverModel); | |
3039 | + } | |
3040 | + } | |
3041 | + } | |
3042 | + } | |
3043 | + } | |
3044 | + return items; | |
3045 | + } | |
3046 | + }); | |
3047 | + futures.add(f); | |
3048 | + } | |
3049 | + | |
3050 | + if (CollectionUtils.isNotEmpty(futures)) | |
3051 | + { | |
3052 | + for (Future f : futures) | |
3053 | + { | |
3054 | + try { | |
3055 | + result.addAll((List<MaternalDeliverModel>) f.get()); | |
3056 | + } catch (Exception e) { | |
3057 | + ExceptionUtils.catchException(e, "MaternalDeliverModel list error."); | |
3058 | + } | |
3059 | + } | |
3060 | + } | |
3061 | + | |
3062 | + System.out.println("result="+result.size()); | |
3063 | + List<String> contents = new ArrayList<>(); | |
3064 | + if (CollectionUtils.isNotEmpty(result)) | |
3065 | + { | |
3066 | + for (MaternalDeliverModel deliverModel : result) | |
3067 | + { | |
3068 | + System.out.println("parentId=" + deliverModel.getParentId()); | |
3069 | + Patients pat = patientsService.findOnePatientById(deliverModel.getParentId()); | |
3070 | + //户籍地址 | |
3071 | + String addressRegister = CommonsHelper.getResidence(pat.getProvinceRegisterId(), pat.getCityRegisterId(), | |
3072 | + pat.getAreaRegisterId(), pat.getStreetRegisterId(), pat.getAddressRegister(), basicConfigService); | |
3073 | + contents.add(pat.getUsername() + " "+DateUtil.getWeekDesc(pat.getLastMenses(), pat.getBookbuildingDate())+" " +pat.getCardNo()+ " " + pat.getPhone()+" "+deliverModel.getDueWeek() +" "+addressRegister+ "\r\n" ); | |
3074 | + System.out.println(); | |
3075 | + | |
3076 | + } | |
3077 | + } | |
3078 | + try { | |
3079 | + File file = new File("D:\\coupon.txt"); | |
3080 | + FileUtils.writeLines(file, contents); | |
3081 | + } catch (IOException e) { | |
3082 | + e.printStackTrace(); | |
3083 | + } | |
3084 | + System.out.println(contents.size()); | |
2862 | 3085 | } |
2863 | 3086 | |
2864 | 3087 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
4931272
... | ... | @@ -452,7 +452,7 @@ |
452 | 452 | Double.parseDouble(patientWeight.getNowWeight()), week, bmi, patientWeight.getBregmatic()); |
453 | 453 | |
454 | 454 | if (1 == type) { |
455 | - setGuide(week, map); // 设置指南 | |
455 | + setGuide(week, map,patientWeight.getHospitalId()); // 设置指南 | |
456 | 456 | } else { |
457 | 457 | WeightConfigModel configModel = getWeightConfigBykcal(kmap, ReportConfig.getNSArea(basicConfig.getName()), null); |
458 | 458 | if (configModel != null) { |
... | ... | @@ -547,6 +547,7 @@ |
547 | 547 | map.put("yunqi", yunqi); |
548 | 548 | } |
549 | 549 | map.put("week",week); |
550 | + map.put("bregmatic", StringUtils.isNotEmpty(patientWeight.getBregmatic()) ? "1" : patientWeight.getBregmatic()); | |
550 | 551 | map.put("height", patientWeight.getBeforeHeight() == null ? "" : MathUtil.doubleFormat(Double.parseDouble(patientWeight.getBeforeHeight()) / 100) + " 米"); |
551 | 552 | map.put("beforeWeight", patientWeight.getBeforeWeight() == null ? "" : patientWeight.getBeforeWeight() + " 公斤"); |
552 | 553 | map.put("bmi", patientWeight.getBmi()); |
... | ... | @@ -578,7 +579,7 @@ |
578 | 579 | return null; |
579 | 580 | } |
580 | 581 | |
581 | - setGuide(week, map); // 设置指南 | |
582 | + setGuide(week, map,hospitalId); // 设置指南 | |
582 | 583 | String nsArea=ReportConfig.getNSArea(basicConfig.getName()); |
583 | 584 | |
584 | 585 | WeightConfigModel configModel = getWeightConfigBykcal(kmap, nsArea, rid); |
585 | 586 | |
... | ... | @@ -851,9 +852,19 @@ |
851 | 852 | return RespBuilder.buildSuccess(id); |
852 | 853 | } |
853 | 854 | |
854 | - private void setGuide(Integer week, Map<String, Object> map) { | |
855 | + private void setGuide(Integer week, Map<String, Object> map,String hospitalId) { | |
856 | + Map<String, Object> map1 = null; | |
857 | + //威海市妇幼 | |
858 | + if ("2100001635".equals(hospitalId)) | |
859 | + { | |
860 | + map1 = setData2("各种营养素的均衡摄入", "每日保证碳水化合物、脂肪、蛋白质、维生素、水、无机盐六大营养素的均衡摄入,可根据季节变化以及个人的喜好,选择时令新鲜的食材,每种营养素所对应的食物选择2种。保证规律的饮食,不得挑食、偏食;避免过食,从而引起体重增长过快。"); | |
861 | + } | |
862 | + else | |
863 | + { | |
864 | + map1 = setData2("各种营养素的均衡摄入", "每日保证糖类、脂肪、蛋白质、维生素、水、无机盐六大营养素的均衡摄入,可根据季节变化以及个人的喜好,选择时令新鲜的食材,每种营养素所对应的食物选择2种。保证规律的饮食,不得挑食、偏食;避免过食,从而引起体重增长过快。"); | |
865 | + } | |
855 | 866 | |
856 | - Map<String, Object> map1 = setData2("各种营养素的均衡摄入", "每日保证糖类、脂肪、蛋白质、维生素、水、无机盐六大营养素的均衡摄入,可根据季节变化以及个人的喜好,选择时令新鲜的食材,每种营养素所对应的食物选择2种。保证规律的饮食,不得挑食、偏食;避免过食,从而引起体重增长过快。"); | |
867 | + | |
857 | 868 | Map<String, Object> map2 = setData2("每日摄入3次奶及奶制品", "每日保证摄入3杯牛奶,约500ml;经常摄入酸奶、芝士、排骨、鱼虾类以达到钙质的补充。"); |
858 | 869 | Map<String, Object> map3 = setData2("肉类、鱼虾类、蔬菜、水果均衡摄入", "每日保证至少300g蔬菜和200g水果的摄入,可根据自己的喜好选择2-3种时令水果和蔬菜;随着孕期的变化每日100-300g肉类和1-3个鸡蛋的摄入;每周2-3次豆类的摄入(每次20-30g)和2-3次鱼虾类的摄入(每次100-200g),以及1次动物内脏的摄入(每次50-100g)。"); |
859 | 870 | Map<String, Object> map4 = setData2("增加用餐次数", "应采取少食多餐的原则,每日进餐次数由孕前的3次增加至5-6次,每日可在3次正餐中间加2-3次的加餐,每餐时间间隔约2小时左右,每餐8-9分饱即可。"); |