Commit dc68ec504070fdfb373be1f74a1604c871bd41a2
1 parent
29b2da34c6
Exists in
master
and in
1 other branch
产检报表修改
Showing 4 changed files with 52 additions and 21 deletions
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/Test.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/CjStatisticsResult.java
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
dc68ec5
... | ... | @@ -726,15 +726,8 @@ |
726 | 726 | if (buildTypeEq != null) { |
727 | 727 | condition = condition.and("buildType", buildTypeEq, MongoOper.IS); |
728 | 728 | } |
729 | - Criteria c1 = null; | |
730 | - if (lastCheckEmployeeId != null) { | |
731 | - condition = condition.and("lastCheckEmployeeId", lastCheckEmployeeId, MongoOper.IS); | |
732 | - } | |
733 | - else if(lastCheckEId){ | |
734 | - // condition = condition.and("lastCheckEmployeeId", "", MongoOper.NE); | |
735 | - // condition = condition.andCondition(MongoCondition.newInstance("lastCheckEmployeeId", null, MongoOper.NE)); | |
736 | - c1 = Criteria.where("lastCheckEmployeeId").ne("").ne(null); | |
737 | - } | |
729 | + | |
730 | + | |
738 | 731 | if (bookbuildingDoctor != null) { |
739 | 732 | condition = condition.and("bookbuildingDoctor", bookbuildingDoctor, MongoOper.IS); |
740 | 733 | } |
741 | 734 | |
... | ... | @@ -814,12 +807,23 @@ |
814 | 807 | if (null != pid) { |
815 | 808 | condition = condition.and("pid", pid, MongoOper.IS); |
816 | 809 | } |
810 | + Criteria c1 = null; | |
811 | + | |
817 | 812 | if (null != queryNo) { |
818 | 813 | MongoCondition c = MongoCondition.newInstance(); |
819 | 814 | MongoCondition con1 = MongoCondition.newInstance("phone", queryNo, MongoOper.IS); |
820 | 815 | MongoCondition con2 = MongoCondition.newInstance("username", queryNo, MongoOper.IS); |
821 | 816 | MongoCondition con3 = MongoCondition.newInstance("cardNo", queryNo, MongoOper.IS); |
822 | 817 | c1= c.orCondition(new MongoCondition[]{con1, con2, con3}).getCriteria(); |
818 | + } | |
819 | + | |
820 | + if (lastCheckEmployeeId != null) { | |
821 | + condition = condition.and("lastCheckEmployeeId", lastCheckEmployeeId, MongoOper.IS); | |
822 | + } | |
823 | + else if(lastCheckEId){ | |
824 | + condition = condition.and("lastCheckEmployeeId", "", MongoOper.NE); | |
825 | + MongoCondition c = MongoCondition.newInstance(); | |
826 | + c1= c.andCondition(MongoCondition.newInstance("lastCheckEmployeeId", null, MongoOper.NE)).getCriteria(); | |
823 | 827 | } |
824 | 828 | |
825 | 829 | if (fmDateStart != null && fmDateEnd != null) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/Test.java
View file @
dc68ec5
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | public class Test { |
27 | 27 | |
28 | 28 | public static void main(String[] args) { |
29 | -// PatientsQuery patientsQuery1 = new PatientsQuery(); | |
29 | + PatientsQuery patientsQuery1 = new PatientsQuery(); | |
30 | 30 | // patientsQuery1.setHospitalId("221"); |
31 | 31 | // patientsQuery1.setYn(YnEnums.YES.getId()); |
32 | 32 | // patientsQuery1.setType(1); |
33 | 33 | |
34 | 34 | |
... | ... | @@ -44,18 +44,30 @@ |
44 | 44 | // patientsQuery1.setBookbuildingDateEnd(DateUtil.parseYMD("2016-12-08")); |
45 | 45 | |
46 | 46 | |
47 | +// Date yuYueDate = DateUtil.addDay(new Date(), 2); | |
48 | +// if (yuYueDate != null) { | |
49 | +// //把时间格式化成 yyyy_MM_dd 的日期 | |
50 | +// yuYueDate = DateUtil.formatDate(yuYueDate); | |
51 | +// } | |
52 | +// AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
53 | +// antExChuQuery.setYn(YnEnums.YES.getId()); | |
54 | +// antExChuQuery.setNextCheckTimeStart(yuYueDate); | |
55 | +// antExChuQuery.setNextCheckTimeEnd(yuYueDate); | |
56 | +// antExChuQuery.setHospitalId("242"); | |
57 | + | |
58 | + patientsQuery1.setLastCheckEId(true); | |
59 | + patientsQuery1.setHospitalId("242"); | |
60 | + patientsQuery1.setType(1); | |
61 | + | |
47 | 62 | Date yuYueDate = DateUtil.addDay(new Date(), 2); |
48 | 63 | if (yuYueDate != null) { |
49 | 64 | //把时间格式化成 yyyy_MM_dd 的日期 |
50 | 65 | yuYueDate = DateUtil.formatDate(yuYueDate); |
51 | 66 | } |
52 | - AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
53 | - antExChuQuery.setYn(YnEnums.YES.getId()); | |
54 | - antExChuQuery.setNextCheckTimeStart(yuYueDate); | |
55 | - antExChuQuery.setNextCheckTimeEnd(yuYueDate); | |
56 | - antExChuQuery.setHospitalId("242"); | |
67 | + patientsQuery1.setDueDateStart(yuYueDate); | |
68 | + patientsQuery1.setDueDateEnd(yuYueDate); | |
57 | 69 | |
58 | - System.out.println(antExChuQuery.convertToQuery().convertToMongoQuery()); | |
70 | + System.out.println(patientsQuery1.convertToQuery().convertToMongoQuery()); | |
59 | 71 | |
60 | 72 | |
61 | 73 | /* |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntExRecordFacade.java
View file @
dc68ec5
... | ... | @@ -28,10 +28,7 @@ |
28 | 28 | import org.springframework.beans.factory.annotation.Autowired; |
29 | 29 | import org.springframework.stereotype.Component; |
30 | 30 | |
31 | -import java.util.ArrayList; | |
32 | -import java.util.HashMap; | |
33 | -import java.util.List; | |
34 | -import java.util.Map; | |
31 | +import java.util.*; | |
35 | 32 | |
36 | 33 | /** |
37 | 34 | * 产检管理 |
... | ... | @@ -187,6 +184,7 @@ |
187 | 184 | } |
188 | 185 | data.add(cjStatisticsResult); |
189 | 186 | } |
187 | + Collections.sort(data,new CjStatisticsResult()); | |
190 | 188 | } |
191 | 189 | return baseListResponse.setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data).setPageInfo(patientsQuery1.getPageInfo()); |
192 | 190 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/CjStatisticsResult.java
View file @
dc68ec5
1 | 1 | package com.lyms.platform.operate.web.result; |
2 | 2 | |
3 | +import com.lyms.platform.common.utils.StringUtils; | |
4 | + | |
5 | +import java.util.Comparator; | |
6 | + | |
3 | 7 | /** |
4 | 8 | * |
5 | 9 | * 产检统计 |
6 | 10 | * Created by Administrator on 2016/11/28 0028. |
7 | 11 | */ |
8 | -public class CjStatisticsResult { | |
12 | +public class CjStatisticsResult implements Comparator<CjStatisticsResult> { | |
9 | 13 | private String dId; |
10 | 14 | private String dName; |
11 | 15 | private String count; |
... | ... | @@ -37,5 +41,18 @@ |
37 | 41 | public void setCount(String count) { |
38 | 42 | this.count = count; |
39 | 43 | } |
44 | + | |
45 | + @Override | |
46 | + public int compare(CjStatisticsResult o1, CjStatisticsResult o2) { | |
47 | + if (o1 != null && o2 != null) | |
48 | + { | |
49 | + if (StringUtils.isNotEmpty(o2.getCount()) && StringUtils.isNotEmpty(o1.getCount())) | |
50 | + { | |
51 | + return Integer.parseInt(o2.getCount()) - Integer.parseInt(o1.getCount()); | |
52 | + } | |
53 | + } | |
54 | + return 0; | |
55 | + } | |
56 | + | |
40 | 57 | } |