Commit 1ac0a3328ff26caf019c0ae4ecd87fd49a7bdbcf
1 parent
a0c35e1b2d
Exists in
master
and in
6 other branches
update
Showing 6 changed files with 177 additions and 7 deletions
- platform-dal/src/main/java/com/lyms/platform/pojo/BabySpecialDiseaseClinicModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEyeCheckController.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/result/BabySpecialDiseaseClinicResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/BabyEyeCheckService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java
platform-dal/src/main/java/com/lyms/platform/pojo/BabySpecialDiseaseClinicModel.java
View file @
1ac0a33
... | ... | @@ -48,7 +48,7 @@ |
48 | 48 | //儿童生日 |
49 | 49 | private Date birthday; |
50 | 50 | //儿童月龄 |
51 | - private Integer month; | |
51 | + private String month; | |
52 | 52 | |
53 | 53 | /*新增页面内容*/ |
54 | 54 | //专病项目 ①上呼②肺炎③腹泻④矮小⑤早熟⑥黄疸⑦多动⑧抽动⑨智力低下⑩自闭 |
55 | 55 | |
... | ... | @@ -208,11 +208,11 @@ |
208 | 208 | this.birthday = birthday; |
209 | 209 | } |
210 | 210 | |
211 | - public Integer getMonth() { | |
211 | + public String getMonth() { | |
212 | 212 | return month; |
213 | 213 | } |
214 | 214 | |
215 | - public void setMonth(Integer month) { | |
215 | + public void setMonth(String month) { | |
216 | 216 | this.month = month; |
217 | 217 | } |
218 | 218 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEyeCheckController.java
View file @
1ac0a33
... | ... | @@ -156,6 +156,22 @@ |
156 | 156 | currentMonthStart, currentMonthEnd, chechMonth, positive, positiveIds, page, limit, |
157 | 157 | bookStartDate, bookEndDate, apparatusPositive, doctorPositive, yin,noPassIds); |
158 | 158 | } |
159 | + | |
160 | + /** | |
161 | + * 眼保健管理,按照人次展示 | |
162 | + * | |
163 | + * @Author: 武涛涛 | |
164 | + * @Date: 2020/8/3 14:09 | |
165 | + */ | |
166 | + @ResponseBody | |
167 | + @TokenRequired | |
168 | + @RequestMapping(value = "/childrenFilingList", method = RequestMethod.GET) | |
169 | + public BaseResponse childrenFilingList(Date startDate, Date endDate, String doctor, String key, Integer currentMonthStart, Integer currentMonthEnd, String chechMonth, boolean positive, String positiveIds, Integer page, Integer limit, HttpServletRequest request, | |
170 | + Date bookStartDate, Date bookEndDate, String apparatusPositive, String doctorPositive, String yin,String noPassIds) { | |
171 | + return babyEyeCheckService.childrenFilingList(getUserId(request), startDate, endDate, doctor, key, | |
172 | + currentMonthStart, currentMonthEnd, chechMonth, positive, positiveIds, page, limit, | |
173 | + bookStartDate, bookEndDate, apparatusPositive, doctorPositive, yin,noPassIds); | |
174 | + } | |
159 | 175 | @ResponseBody |
160 | 176 | @TokenRequired |
161 | 177 | @RequestMapping(value = "/export", method = RequestMethod.GET) |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabySpecialDiseaseClinicFacade.java
View file @
1ac0a33
... | ... | @@ -88,7 +88,7 @@ |
88 | 88 | model.setsINCard(babyModel.getsINCard()); |
89 | 89 | model.setBirthday(babyModel.getBirth()); |
90 | 90 | if(babyModel.getBirth() !=null){ |
91 | - model.setMonth(DateUtil.getBabyAgeMonth(babyModel.getBirth(), new Date())); | |
91 | + model.setMonth(DateUtil.getBabyMonthAge(babyModel.getBirth(), new Date())); | |
92 | 92 | } |
93 | 93 | model.setModifyDate(new Date()); |
94 | 94 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabySpecialDiseaseClinicResult.java
View file @
1ac0a33
... | ... | @@ -45,7 +45,7 @@ |
45 | 45 | //儿童生日 |
46 | 46 | private String birthday; |
47 | 47 | //儿童月龄 |
48 | - private Integer month; | |
48 | + private String month; | |
49 | 49 | |
50 | 50 | /*新增页面内容*/ |
51 | 51 | //专病项目 ①上呼②肺炎③腹泻④矮小⑤早熟⑥黄疸⑦多动⑧抽动⑨智力低下⑩自闭 |
52 | 52 | |
... | ... | @@ -230,11 +230,11 @@ |
230 | 230 | this.birthday = birthday; |
231 | 231 | } |
232 | 232 | |
233 | - public Integer getMonth() { | |
233 | + public String getMonth() { | |
234 | 234 | return month; |
235 | 235 | } |
236 | 236 | |
237 | - public void setMonth(Integer month) { | |
237 | + public void setMonth(String month) { | |
238 | 238 | this.month = month; |
239 | 239 | } |
240 | 240 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/BabyEyeCheckService.java
View file @
1ac0a33
... | ... | @@ -29,6 +29,11 @@ |
29 | 29 | String positiveIds, Integer page, Integer limit, Date bookStartDate, Date bookEndDate, String apparatusPositive, |
30 | 30 | String doctorPositive, String yin,String noPassIds); |
31 | 31 | |
32 | + BaseResponse childrenFilingList(Integer userId, Date startDate, Date endDate, String doctor, String key, | |
33 | + Integer currentMonthStart, Integer currentMonthEnd, String chechMonth, boolean positive, | |
34 | + String positiveIds, Integer page, Integer limit, Date bookStartDate, Date bookEndDate, String apparatusPositive, | |
35 | + String doctorPositive, String yin,String noPassIds); | |
36 | + | |
32 | 37 | BaseResponse query(Integer userId, String babyId); |
33 | 38 | BaseResponse queryQhd(Integer userId, String babyId); |
34 | 39 | BaseResponse queryShowQhd( String babyId); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BabyEyeCheckServiceImpl.java
View file @
1ac0a33
... | ... | @@ -837,6 +837,155 @@ |
837 | 837 | return RespBuilder.buildSuccess(pageResult); |
838 | 838 | } |
839 | 839 | |
840 | + | |
841 | + | |
842 | + /** | |
843 | + * 眼保健管理,按照人次展示 | |
844 | + * | |
845 | + * @Author: 武涛涛 | |
846 | + * @Date: 2020/8/3 17:43 | |
847 | + */ | |
848 | + @Override | |
849 | + public BaseResponse childrenFilingList(Integer userId, Date startDate, Date endDate, String doctor, String key, Integer currentMonthStart, | |
850 | + Integer currentMonthEnd, String chechMonth, boolean positive, String positiveIds, | |
851 | + Integer page, Integer limit, Date bookStartDate, Date bookEndDate, | |
852 | + String apparatusPositive, String doctorPositive, String yin, String noPassIds) { | |
853 | + /* | |
854 | + 1 获取所有儿童建档数据,筛查做过眼保健检查的档案。 | |
855 | + 2 眼保健建档新增一个字段标示可以展示到眼保健管理。其它建档可以不管。 | |
856 | + 3 其它建档在做眼保健检查。给该档案也标记成可以展示到眼保健管理状态。 | |
857 | + 4 列表展示儿童档案,第一有眼保健检查数据。第二档案有标记状态可以展示。 | |
858 | + 如何避免重复叠加, | |
859 | + 1 以前建档的永远不标记可以展示状态。 | |
860 | + 2 以前其它建档没有眼保健检查的可以标记展示状态。 | |
861 | + 3 先查建档关联的有检查结果数据档案。在查有标记状态的档案。合并。在去除重复避免重叠 | |
862 | + | |
863 | + 5 新增的档案,只是标记状态不冗余其它字段 | |
864 | + */ | |
865 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
866 | + Criteria c = new Criteria(); | |
867 | + c.orOperator(Criteria.where("hospitalId").is(hospitalId),Criteria.where("mcertNo").is(key)).and("yn").ne(0); | |
868 | + List<BabyModel> babyModels = mongoUtil.findField(BabyModel.class, c, "id"); | |
869 | + List<String> babyIds = CollectionUtils.getId(babyModels, "id", String.class); | |
870 | + | |
871 | + | |
872 | + | |
873 | + | |
874 | + boolean b = true; | |
875 | + | |
876 | + Criteria criteria = Criteria.where("yn").ne("0").and("hospitalId").is(hospitalId); | |
877 | + if (startDate != null && endDate != null) { | |
878 | + criteria.and("checkTime").gte(startDate).lt(DateUtil.addDay(endDate, 1)); | |
879 | + } | |
880 | + if (bookStartDate != null && bookEndDate != null) { | |
881 | + criteria.and("nextCheckTime").gte(bookStartDate).lt(DateUtil.addDay(bookEndDate, 1)); | |
882 | + } | |
883 | + if (org.apache.commons.lang.StringUtils.isNotBlank(doctor)) { | |
884 | + criteria.and("doctor").is(doctor); | |
885 | + } | |
886 | + List<String> chechMonths = new ArrayList<>(); | |
887 | + if (b && StringUtils.isNotEmpty(chechMonth)) { | |
888 | + if ("1".equals(chechMonth)) { | |
889 | + chechMonths.add("0"); | |
890 | + } else if ("12".equals(chechMonth)) { | |
891 | + chechMonths.add("9"); | |
892 | + } else if ("24".equals(chechMonth)) { | |
893 | + chechMonths.add("18"); | |
894 | + } | |
895 | + | |
896 | + chechMonths.add(chechMonth); | |
897 | + } | |
898 | + if (StringUtils.isNotEmpty(chechMonth)) { | |
899 | + criteria.and("checkMonthId").in(chechMonths); | |
900 | + } | |
901 | + | |
902 | + if (currentMonthStart != null && currentMonthEnd != null) { | |
903 | + Date start = DateUtil.getBirthStart(currentMonthEnd); | |
904 | + Date end = DateUtil.getBirthEnd(currentMonthStart); | |
905 | + criteria.and("birth").gte(start).lt(end); | |
906 | + } | |
907 | + if (StringUtils.isNotEmpty(apparatusPositive)) { | |
908 | + criteria.and("apparatus").is(apparatusPositive); | |
909 | + } | |
910 | + if (StringUtils.isNotEmpty(doctorPositive)) { | |
911 | + criteria.and("doctorJudgement").is(doctorPositive); | |
912 | + } | |
913 | + if (StringUtils.isNotEmpty(yin)) { | |
914 | + criteria.and("apparatus").nin("2").and("doctorJudgement").nin("2"); | |
915 | + } | |
916 | + if (org.apache.commons.lang.StringUtils.isNotBlank(key)) { | |
917 | + /*Criteria c = new Criteria(); | |
918 | + c.orOperator(Criteria.where("mphone").is(key), Criteria.where("name").regex(key), Criteria.where("mcertNo").is(key)).and("yn").ne(0); | |
919 | + List<BabyModel> babyModels = mongoUtil.findField(BabyModel.class, c, "id"); | |
920 | + List<String> babyIds = CollectionUtils.getId(babyModels, "id", String.class); | |
921 | + criteria.and("babyId").in(babyIds);*/ | |
922 | + } | |
923 | + | |
924 | + /** | |
925 | + * 新加的 不通过查询条件 | |
926 | + * @Author: 武涛涛 | |
927 | + * @Date: 2020/7/21 21:56 | |
928 | + */ | |
929 | + if (StringUtils.isNotEmpty(noPassIds)) { | |
930 | + List<String> ids = CollectionUtils.asList(noPassIds, String.class); | |
931 | + for (String id : ids) { | |
932 | + if ("eyeAppearance".equals(id)) { | |
933 | + criteria.and("eyeAppearance").is("2"); | |
934 | + } else if ("redReflexQhd".equals(id)) { | |
935 | + criteria.and("redReflexQhd").is("2"); | |
936 | + } else if ("blinkReflex".equals(id)) { | |
937 | + criteria.and("blinkReflex").is("2"); | |
938 | + } else if ("redBallTest".equals(id)) { | |
939 | + criteria.and("redBallTest").is("2"); | |
940 | + } else if ("behaviorObservation".equals(id)) { | |
941 | + criteria.and("behaviorObservation").is("2"); | |
942 | + } else if ("refractiveScreening".equals(id)) { | |
943 | + criteria.and("refractiveScreening").is("2"); | |
944 | + } else if ("eyePositionExamination".equals(id)) { | |
945 | + criteria.and("eyePositionExamination").is("2"); | |
946 | + } else if ("eyeMovement".equals(id)) { | |
947 | + criteria.and("eyeMovement").is("2"); | |
948 | + } | |
949 | + } | |
950 | + } | |
951 | + | |
952 | + /*end */ | |
953 | + if (positive) { | |
954 | + | |
955 | + Query query = new Query(criteria); | |
956 | + query.with(new Sort(Sort.Direction.DESC, "created")); | |
957 | + query.addCriteria(new Criteria().orOperator(Criteria.where("apparatus").is("2"), Criteria.where("doctorJudgement").is("2"))); | |
958 | + System.out.println(query.toString()); | |
959 | + | |
960 | + int count = (int) mongoTemplate.count(query, BabyEyeCheck.class); | |
961 | + | |
962 | + BaseQuery param = new BaseQuery(); | |
963 | + param.setPage(page); | |
964 | + param.setLimit(limit); | |
965 | + param.mysqlBuild(count); | |
966 | + query.skip(param.getOffset()).limit(param.getLimit()); | |
967 | + | |
968 | + List<BabyEyeCheck> babyEyeChecks = mongoTemplate.find(query, BabyEyeCheck.class); | |
969 | + // doFilter(babyEyeChecks); | |
970 | + | |
971 | + if (StringUtils.isNotEmpty(positiveIds)) { | |
972 | + List<String> ids = CollectionUtils.asList(positiveIds, String.class); | |
973 | + if (CollectionUtils.isNotEmpty(ids)) { | |
974 | + doFilter(babyEyeChecks, ids); | |
975 | + } | |
976 | + } | |
977 | + //Integer count = babyEyeChecks.size(); | |
978 | + | |
979 | + // List<BabyEyeCheck> datas = CollectionUtils.getPageIds(babyEyeChecks, page, limit); | |
980 | + List<Map<String, Object>> maps = setDatas(babyEyeChecks); | |
981 | + return RespBuilder.buildSuccess(new PageResult(count, page, limit, maps)); | |
982 | + } | |
983 | + PageResult pageResult = findMongoPage(BabyEyeCheck.class, new Query(criteria).with(new Sort(Sort.Direction.DESC, "created")), page, limit); | |
984 | + List<BabyEyeCheck> babyEyeChecks = (List<BabyEyeCheck>) pageResult.getGrid(); | |
985 | + pageResult.setGrid(setDatas(babyEyeChecks)); | |
986 | + return RespBuilder.buildSuccess(pageResult); | |
987 | + } | |
988 | + | |
840 | 989 | private void doFilter(List<BabyEyeCheck> babyEyeChecks, List<String> ids) { |
841 | 990 | List<BabyEyeCheck> deleteList = new ArrayList<>(); |
842 | 991 | for (BabyEyeCheck babyEyeCheck : babyEyeChecks) { |