Commit 22ff68919bb032852680aabcc3afb4c94fddbe51

Authored by yangfei

Merge remote-tracking branch 'origin/master'

Showing 8 changed files

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java View file @ 22ff689
... ... @@ -285,11 +285,11 @@
285 285 * @return
286 286 */
287 287 @ResponseBody
288   -// @TokenRequired
  288 + @TokenRequired
289 289 @RequestMapping(value = "/patient", method = RequestMethod.GET)
290 290 public BaseObjectResponse patient(HttpServletRequest request, String year, String provinceId, String cityId, String areaId) {
291   -// return reportService.patient(getUserId(request), year);
292   - return reportService.patient(2144, year, provinceId, cityId, areaId);
  291 + return reportService.patient(getUserId(request), year, provinceId, cityId, areaId);
  292 +// return reportService.patient(2144, year, provinceId, cityId, areaId);
293 293 }
294 294  
295 295 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 22ff689
... ... @@ -2219,31 +2219,34 @@
2219 2219 }
2220 2220 }
2221 2221 }
2222   - AntExChuQuery antExChuQuery =new AntExChuQuery();
2223   - antExChuQuery.setHospitalId(hospitalId);
2224   - antExChuQuery.setParentId(parentId);
2225   - antExChuQuery.setYn(YnEnums.YES.getId());
2226   - List<AntExChuModel> chuModelList= antenatalExaminationService.queryAntExChu(antExChuQuery);
2227   - if(CollectionUtils.isNotEmpty(chuModelList)){
2228   - for(AntExChuModel chu:chuModelList){
2229   - String zybd=chu.getZyqbd();
2230   - String ntjc= chu.getNtjc();
2231   - String cqsc= chu.getCjsc();
2232   - String text= chu.getTextpjbc();
2233   - String s75gdgtt= chu.getS75gdgtt();
2234   - String jzxgn= chu.getJzxgn();
2235   - if(StringUtils.isNotEmpty(zybd)||StringUtils.isNotEmpty(ntjc)||StringUtils.isNotEmpty(cqsc)||
2236   - StringUtils.isNotEmpty(text)||StringUtils.isNotEmpty(s75gdgtt)||StringUtils.isNotEmpty(jzxgn)){
2237   - m.put("zybd",zybd);
2238   - m.put("ntjc",ntjc);
2239   - m.put("cjsc",cqsc);
2240   - m.put("textpjbc",text);
2241   - m.put("s75gdgtt",s75gdgtt);
2242   - m.put("jzxgn",jzxgn);
2243   - break;
  2222 + if(CollectionUtils.isEmpty(examinationModelList)){
  2223 + AntExChuQuery antExChuQuery =new AntExChuQuery();
  2224 + antExChuQuery.setHospitalId(hospitalId);
  2225 + antExChuQuery.setParentId(parentId);
  2226 + antExChuQuery.setYn(YnEnums.YES.getId());
  2227 + List<AntExChuModel> chuModelList= antenatalExaminationService.queryAntExChu(antExChuQuery);
  2228 + if(CollectionUtils.isNotEmpty(chuModelList)){
  2229 + for(AntExChuModel chu:chuModelList){
  2230 + String zybd=chu.getZyqbd();
  2231 + String ntjc= chu.getNtjc();
  2232 + String cqsc= chu.getCjsc();
  2233 + String text= chu.getTextpjbc();
  2234 + String s75gdgtt= chu.getS75gdgtt();
  2235 + String jzxgn= chu.getJzxgn();
  2236 + if(StringUtils.isNotEmpty(zybd)||StringUtils.isNotEmpty(ntjc)||StringUtils.isNotEmpty(cqsc)||
  2237 + StringUtils.isNotEmpty(text)||StringUtils.isNotEmpty(s75gdgtt)||StringUtils.isNotEmpty(jzxgn)){
  2238 + m.put("zybd",zybd);
  2239 + m.put("ntjc",ntjc);
  2240 + m.put("cjsc",cqsc);
  2241 + m.put("textpjbc",text);
  2242 + m.put("s75gdgtt",s75gdgtt);
  2243 + m.put("jzxgn",jzxgn);
  2244 + break;
  2245 + }
2244 2246 }
2245 2247 }
2246 2248 }
  2249 +
2247 2250 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("").setData(m);
2248 2251 }
2249 2252  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ 22ff689
... ... @@ -827,6 +827,8 @@
827 827 patientsQuery.setProvinceId(StringUtils.isEmpty(patientManagerRequest.getProvinceRegisterId()) ? null : patientManagerRequest.getProvinceRegisterId());
828 828 patientsQuery.setCityId(StringUtils.isEmpty(patientManagerRequest.getCityRegisterId()) ? null : patientManagerRequest.getCityRegisterId());
829 829 patientsQuery.setAreaId(StringUtils.isEmpty(patientManagerRequest.getAreaRegisterId()) ? null : patientManagerRequest.getAreaRegisterId());
  830 + patientsQuery.setStreetId(StringUtils.isEmpty(patientManagerRequest.getStreetRegisterId()) ? null : patientManagerRequest.getStreetRegisterId());
  831 + patientsQuery.setStreetRegisterId(StringUtils.isEmpty(patientManagerRequest.getStreetId()) ? null : patientManagerRequest.getStreetId());
830 832 // UsersQuery usersQuery = new UsersQuery();
831 833 // usersQuery.setName(patientManagerRequest.getBookbuildingDoctor());
832 834 // usersQuery.setYn(YnEnums.YES.getId());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java View file @ 22ff689
... ... @@ -413,13 +413,6 @@
413 413 query.setYn(YnEnums.YES.getId());
414 414 query.setEnable(1);
415 415 query.setId(id);
416   - List<Integer> lis =new ArrayList<>();
417   - lis.add(1);
418   - lis.add(2);
419   - lis.add(3);
420   - lis.add(4);
421   - lis.add(5);
422   - query.setZhichenIds(lis);
423 416 List<Users> dbusers = usersService.queryUsers(query);
424 417  
425 418 if (CollectionUtils.isNotEmpty(dbusers)) {
... ... @@ -428,6 +421,12 @@
428 421 usersQuery.setYn(YnEnums.YES.getId());
429 422 usersQuery.setOrgId(dbuser.getOrgId());
430 423 usersQuery.setEnable(1);
  424 + List<Integer> lis =new ArrayList<>();
  425 + lis.add(1);
  426 + lis.add(2);
  427 + lis.add(3);
  428 + lis.add(4);
  429 + lis.add(5);
431 430 usersQuery.setZhichenIds(lis);
432 431 List<Users> users = usersService.queryUsers(usersQuery);
433 432  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ 22ff689
... ... @@ -944,12 +944,12 @@
944 944 /* 初诊信息 */
945 945  
946 946  
947   - map.put("zyqbdjc", Boolean.valueOf(data.getZyqbd())?"已检测":"未检测");
948   - map.put("ntjc", Boolean.valueOf(data.getNtjc())?"已检测":"未检测");
949   - map.put("cjsc", Boolean.valueOf(data.getCjsc())?"已检测":"未检测");
950   - map.put("textpjbc", Boolean.valueOf(data.getTextpjbc())?"已检测":"未检测");
951   - map.put("s75gdgtt",Boolean.valueOf( data.getS75gdgtt())?"已检测":"未检测");
952   - map.put("jzxgn", Boolean.valueOf(data.getJzxgn())?"已检测":"未检测");
  947 + map.put("zyqbdjc", Boolean.valueOf(data.getZyqbd())?"已检查":"未检查");
  948 + map.put("ntjc", Boolean.valueOf(data.getNtjc())?"已检查":"未检查");
  949 + map.put("cjsc", Boolean.valueOf(data.getCjsc())?"已检查":"未检查");
  950 + map.put("textpjbc", Boolean.valueOf(data.getTextpjbc())?"已检查":"未检查");
  951 + map.put("s75gdgtt",Boolean.valueOf( data.getS75gdgtt())?"已检查":"未检查");
  952 + map.put("jzxgn", Boolean.valueOf(data.getJzxgn())?"已检查":"未检查");
953 953 //既往史
954 954 String pastHistory = "";
955 955 if (org.apache.commons.lang.StringUtils.isNotEmpty(data.getPastHistory())) {
... ... @@ -1399,12 +1399,12 @@
1399 1399 map.put("checkDate", DateUtil.getyyyy_MM_dd(data.getCheckDate()));
1400 1400 map.put("currentDueDate", ResolveUtils.getPregnancyWeek(patients.getLastMenses(), data.getCheckDate()));
1401 1401  
1402   - map.put("zyqbdjc", Boolean.valueOf(data.getZyqbd())?"已检测":"未检测");
1403   - map.put("ntjc", Boolean.valueOf(data.getNtjc())?"已检测":"未检测");
1404   - map.put("cjsc", Boolean.valueOf(data.getCjsc())?"已检测":"未检测");
1405   - map.put("textpjbc", Boolean.valueOf(data.getTextpjbc())?"已检测":"未检测");
1406   - map.put("s75gdgtt",Boolean.valueOf( data.getS75gdgtt())?"已检测":"未检测");
1407   - map.put("jzxgn", Boolean.valueOf(data.getJzxgn())?"已检测":"未检测");
  1402 + map.put("zyqbdjc", Boolean.valueOf(data.getZyqbd())?"已检查":"未检查");
  1403 + map.put("ntjc", Boolean.valueOf(data.getNtjc())?"已检查":"未检查");
  1404 + map.put("cjsc", Boolean.valueOf(data.getCjsc())?"已检查":"未检查");
  1405 + map.put("textpjbc", Boolean.valueOf(data.getTextpjbc())?"已检查":"未检查");
  1406 + map.put("s75gdgtt",Boolean.valueOf( data.getS75gdgtt())?"已检查":"未检查");
  1407 + map.put("jzxgn", Boolean.valueOf(data.getJzxgn())?"已检查":"未检查");
1408 1408  
1409 1409 //早孕期病毒检测
1410 1410 // private String zyqbdjc;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PatientManagerRequest.java View file @ 22ff689
... ... @@ -29,12 +29,22 @@
29 29 * @discription 户口所在地区县id
30 30 */
31 31 private String areaRegisterId;
  32 + private String streetRegisterId;
32 33  
33 34 // 居住地
34 35 private String provinceId;
35 36 private String cityId;
36 37 private String areaId;
  38 + private String streetId;
37 39  
  40 + public String getStreetId() {
  41 + return streetId;
  42 + }
  43 +
  44 + public void setStreetId(String streetId) {
  45 + this.streetId = streetId;
  46 + }
  47 +
38 48 /**
39 49 * @auther HuJiaqi
40 50 * @createTime 2016年12月22日 11时12分
... ... @@ -57,6 +67,14 @@
57 67 private String queryNo;
58 68  
59 69 private boolean isExcel;
  70 +
  71 + public String getStreetRegisterId() {
  72 + return streetRegisterId;
  73 + }
  74 +
  75 + public void setStreetRegisterId(String streetRegisterId) {
  76 + this.streetRegisterId = streetRegisterId;
  77 + }
60 78  
61 79 public boolean isExcel() {
62 80 return isExcel;
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ 22ff689
... ... @@ -20,9 +20,6 @@
20 20 import org.springframework.beans.factory.annotation.Autowired;
21 21 import org.springframework.data.domain.Sort;
22 22 import org.springframework.data.mongodb.core.MongoTemplate;
23   -import org.springframework.data.mongodb.core.aggregation.Aggregation;
24   -import org.springframework.data.mongodb.core.aggregation.AggregationOperation;
25   -import org.springframework.data.mongodb.core.aggregation.AggregationResults;
26 23 import org.springframework.data.mongodb.core.query.Criteria;
27 24 import org.springframework.data.mongodb.core.query.Query;
28 25 import org.springframework.stereotype.Service;
... ... @@ -99,10 +96,17 @@
99 96 /** 孕妇 */
100 97 couponReportMap.put("1_1", "孕期建档券使用人次");
101 98 couponReportMap.put("2_1", "首次产检券使用人次");
102   - couponReportMap.put("2_2", "孕中期一券使用人次");
103   - couponReportMap.put("2_3", "孕中期二券使用人次");
104   - couponReportMap.put("2_4", "孕晚期一券使用人次");
105   - couponReportMap.put("2_5", "孕晚期二券使用人次");
  99 + couponReportMap.put("2_2", "产检券(二)券使用人次");
  100 + couponReportMap.put("2_3", "产检券(三)券使用人次");
  101 + couponReportMap.put("2_4", "产检券(四)券使用人次");
  102 + couponReportMap.put("2_5", "产检券(五)券使用人次");
  103 + couponReportMap.put("2_6", "产检券(六)券使用人次");
  104 + couponReportMap.put("2_7", "产检券(七)券使用人次");
  105 + couponReportMap.put("2_8", "产检券(八)券使用人次");
  106 + couponReportMap.put("2_9", "产检券(九)券使用人次");
  107 + couponReportMap.put("2_10", "产检券(十)券使用人次");
  108 + couponReportMap.put("2_11", "产检券(十一)券使用人次");
  109 + couponReportMap.put("2_12", "产检券(十二)券使用人次");
106 110 /** 儿童 */
107 111 couponReportMap.put("7_1", "儿童建档券使用人次");
108 112 couponReportMap.put("8_1", "新生儿保健券使用人次");
109 113  
110 114  
... ... @@ -1068,10 +1072,12 @@
1068 1072  
1069 1073 Set<String> patientIds = new HashSet<>();
1070 1074  
1071   - Criteria criteria = Criteria.where("created").gte(DateUtil.getYearDate(year))
  1075 + /*Criteria criteria = Criteria.where("created").gte(DateUtil.getYearDate(year))
1072 1076 .lt(DateUtil.getNextYearDate(year))
1073   - .and("hospitalId").is(hospitalId);
  1077 + .and("hospitalId").is(hospitalId);*/
1074 1078  
  1079 + Criteria criteria = Criteria.where("hospitalId").is(hospitalId);
  1080 +
1075 1081 /** 产前检查: lyms_antexc(初诊),lyms_antex(复诊)设置pid */
1076 1082 List<AntenatalExaminationModel> antenatalExaminationModels = mongoUtil.findField(AntenatalExaminationModel.class, criteria, "parentId");
1077 1083 for (AntenatalExaminationModel antenatalExaminationModel : antenatalExaminationModels) {
... ... @@ -1108,6 +1114,10 @@
1108 1114 patientIds.add(sieveModel.getParentId());
1109 1115 }
1110 1116  
  1117 + /** 增加年份条件限制 */
  1118 + criteria = Criteria.where("created").gte(DateUtil.getYearDate(year))
  1119 + .lt(DateUtil.getNextYearDate(year))
  1120 + .and("hospitalId").is(hospitalId);
1111 1121 if(StringUtils.isNotEmpty(provinceId)) {
1112 1122 criteria.and("provinceId").in(CollectionUtils.asList(provinceId));
1113 1123 }
... ... @@ -1148,7 +1158,8 @@
1148 1158 qhdSeries.setType("bar");
1149 1159 qhdSeries.setStack("总计");
1150 1160  
1151   - String provinceId = mongoUtil.findId("河北省");
  1161 +// String provinceId = mongoUtil.findId("河北省");
  1162 + String provinceId = mongoUtil.findId("秦皇岛市");
1152 1163 if(StringUtils.isNotEmpty(provinceId)) {
1153 1164 Map<Integer, Integer> qhdTemp = new HashMap<>();/** key = month . value = count*/
1154 1165 for (int i = 1; i < 13; i++) {
... ... @@ -1159,7 +1170,8 @@
1159 1170 otherTemp.put(i, 0);
1160 1171 }
1161 1172 for (Map<String, Object> data : datas) {
1162   - if(provinceId.equals(data.get("province_id"))) {
  1173 +// if(provinceId.equals(data.get("province_id"))) {
  1174 + if(provinceId.equals(data.get("city_id"))) {
1163 1175 for(int i = 1; i < 13; i++) {
1164 1176 qhdTemp.put(i, qhdTemp.get(i) + Integer.parseInt(data.get(i + "") + ""));
1165 1177 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MongoUtil.java View file @ 22ff689
... ... @@ -150,99 +150,7 @@
150 150 }
151 151 tempMap.put("count", count);
152 152 rest.add(tempMap);
153   - /* List<Map<String, Map<Integer, Integer>>> datas = new ArrayList<>();
154   - Set<Map.Entry<String, Integer>> entries = codeMap.entrySet();
155   - for (Map.Entry<String, Integer> entry : entries) {
156   - String key = entry.getKey();
157   - String id = key.split("_")[0];
158   - Integer month = Integer.parseInt(key.split("_")[1]);
159   - Integer count = entry.getValue();
160 153  
161   - boolean flag = true;
162   - for (Map<String, Map<Integer, Integer>> data : datas) {
163   - if(data.containsKey(id)) {
164   - Map<Integer, Integer> map = data.get(id);
165   - if(map.containsKey(month)) {
166   - map.put(month, map.get(month) + count);
167   - } else {
168   - map.put(month, count);
169   - }
170   - flag = false;
171   - }
172   - }
173   -
174   - if(flag) {
175   - Map<String, Map<Integer, Integer>> tempMap = new HashMap<>();
176   - Map<Integer, Integer> map = new HashMap<>();
177   - map.put(month, count);
178   - tempMap.put(id, map);
179   - datas.add(tempMap);
180   - }
181   - }*/
182   -
183   - /* System.out.println("===================================== codemap =================================");
184   - Set<Map.Entry<String, Integer>> codeMapEntries = codeMap.entrySet();
185   - for (Map.Entry<String, Integer> codeMapEntry : codeMapEntries) {
186   - System.out.println(codeMapEntry.getKey() + " : " + codeMapEntry.getValue());
187   - }
188   - System.out.println("===================================== datas =================================");
189   - for (Map<String, Map<Integer, Integer>> data : datas) {
190   - Set<Map.Entry<String, Map<Integer, Integer>>> set = data.entrySet();
191   - for (Map.Entry<String, Map<Integer, Integer>> mapEntry : set) {
192   - System.out.println(mapEntry.getKey() + " : " + mapEntry.getValue());
193   - }
194   - }*/
195   -
196   - /*List<Map<String, Object>> restMap = new ArrayList<>();
197   -
198   - *//** 设置没数据的月份为0 *//*
199   - for (Map<String, Map<Integer, Integer>> data : datas) {
200   - Integer count = 0;
201   - Set<Map.Entry<String, Map<Integer, Integer>>> set = data.entrySet();
202   - for (Map.Entry<String, Map<Integer, Integer>> entry : set) {
203   - Map<Integer, Integer> map = entry.getValue();
204   - Map<String, Object> tempMap = new HashMap<>();
205   - for (int i = 1; i <= 12; i++) {
206   - if(!map.containsKey(i)) {
207   - map.put(i, 0);
208   - tempMap.put(i + "", 0);
209   - } else {
210   - count += map.get(i);
211   - tempMap.put(i + "", map.get(i));
212   - }
213   - }
214   - map.put(0, count);
215   - tempMap.put("count", count);
216   - tempMap.put("id", entry.getKey());
217   - tempMap.put("parentId", findParentId(entry.getKey()));
218   - tempMap.put("name", findName(entry.getKey()));
219   - restMap.add(tempMap);
220   - }
221   - }
222   -*/
223   -
224   - /** 处理 其他 数据 */
225   - /* Map<String, Object> tempMap = new HashMap<>();
226   - otherMonthMap.put("count", otherCount);
227   - tempMap.put("name", "其他");
228   - tempMap.put("id", null);
229   - tempMap.put("parentId", -1);
230   - for (int i = 1; i <= 12; i++) {
231   - if(otherMonthMap.containsKey(i + "")) {
232   - tempMap.put(i + "", otherMonthMap.get(i + ""));
233   - } else {
234   - tempMap.put(i + "", 0);
235   - }
236   - }
237   - restMap.add(tempMap);*/
238   -
239   - /* for (Map<String, Map<Integer, Integer>> data : datas) {
240   - System.out.println("data>>> " + data);
241   - }
242   - System.out.println("========================");
243   - for (Map<String, Object> map : restMap) {
244   - System.out.println("rest>> " + map);
245   - }*/
246 154 return rest;
247 155 }
248 156