Commit 4bfb221b62da7f50d6832c21d2cc6aa8981e22e1
1 parent
c25ad6b916
Exists in
master
and in
1 other branch
update
Showing 9 changed files with 513 additions and 11 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BasicConfigService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MasterMysqlAntexcMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/ReportAntex.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/MysqlAntexcService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/MysqlAntexcServiceImpl.java
- platform-biz-service/src/main/resources/mainOrm/master/MasterMysqlAntexc.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientSyncMysqlFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java
- platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BasicConfigService.java
View file @
4bfb221
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MasterMysqlAntexcMapper.java
View file @
4bfb221
... | ... | @@ -3,6 +3,7 @@ |
3 | 3 | import com.lyms.platform.permission.model.*; |
4 | 4 | |
5 | 5 | import java.util.List; |
6 | +import java.util.Map; | |
6 | 7 | |
7 | 8 | /** |
8 | 9 | * Created by Administrator on 2020-12-07. |
... | ... | @@ -72,5 +73,14 @@ |
72 | 73 | void deleteRiskLevelToMysql(ReportRiskLevel reportRiskLevel); |
73 | 74 | |
74 | 75 | void saveRiskLevelToMysql(ReportRiskLevel reportRiskLevel); |
76 | + | |
77 | + List<Map<String,String>> getBuildCount(Map param); | |
78 | + | |
79 | + List<Map<String,String>> getBulidCheckCount(Map param); | |
80 | + | |
81 | + List<Map<String,String>> getBulidCheckNumCount(Map param); | |
82 | + List<Map<String,String>> getCheckPersonCount(Map param); | |
83 | + List<Map<String,String>> getMatDeliverCount(Map param); | |
84 | + List<Map<String,String>> getLiveCount(Map param); | |
75 | 85 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/ReportAntex.java
View file @
4bfb221
... | ... | @@ -10,11 +10,20 @@ |
10 | 10 | private String fid; |
11 | 11 | private String parentId; |
12 | 12 | private String sourceId; |
13 | + private String hospitalId; | |
13 | 14 | private String pid; |
14 | 15 | private Date checkDate; |
15 | 16 | private Date nextCheckTime; |
16 | 17 | private String yn; |
17 | 18 | private Date created; |
19 | + | |
20 | + public String getHospitalId() { | |
21 | + return hospitalId; | |
22 | + } | |
23 | + | |
24 | + public void setHospitalId(String hospitalId) { | |
25 | + this.hospitalId = hospitalId; | |
26 | + } | |
18 | 27 | |
19 | 28 | public String getSourceId() { |
20 | 29 | return sourceId; |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/MysqlAntexcService.java
View file @
4bfb221
... | ... | @@ -4,6 +4,7 @@ |
4 | 4 | import com.lyms.platform.permission.model.*; |
5 | 5 | |
6 | 6 | import java.util.List; |
7 | +import java.util.Map; | |
7 | 8 | |
8 | 9 | public interface MysqlAntexcService { |
9 | 10 | |
... | ... | @@ -69,5 +70,14 @@ |
69 | 70 | void deleteRiskLevelToMysql(ReportRiskLevel reportRiskLevel); |
70 | 71 | |
71 | 72 | void saveRiskLevelToMysql(ReportRiskLevel reportRiskLevel); |
73 | + | |
74 | + List<Map<String,String>> getBuildCount(Map param); | |
75 | + | |
76 | + List<Map<String,String>> getBulidCheckCount(Map param); | |
77 | + | |
78 | + List<Map<String,String>> getBulidCheckNumCount(Map param); | |
79 | + List<Map<String,String>> getCheckPersonCount(Map param); | |
80 | + List<Map<String,String>> getMatDeliverCount(Map param); | |
81 | + List<Map<String,String>> getLiveCount(Map param); | |
72 | 82 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/MysqlAntexcServiceImpl.java
View file @
4bfb221
... | ... | @@ -7,6 +7,8 @@ |
7 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
8 | 8 | import org.springframework.stereotype.Service; |
9 | 9 | |
10 | +import java.util.List; | |
11 | +import java.util.Map; | |
10 | 12 | |
11 | 13 | |
12 | 14 | @Service("mysqlAntexcService") |
... | ... | @@ -160,6 +162,31 @@ |
160 | 162 | public void saveRiskLevelToMysql(ReportRiskLevel reportRiskLevel) |
161 | 163 | { |
162 | 164 | masterMysqlAntexcMapper.saveRiskLevelToMysql(reportRiskLevel); |
165 | + } | |
166 | + | |
167 | + @Override | |
168 | + public List<Map<String, String>> getBuildCount(Map param) { | |
169 | + return masterMysqlAntexcMapper.getBuildCount(param); | |
170 | + } | |
171 | + @Override | |
172 | + public List<Map<String, String>> getBulidCheckCount(Map param) { | |
173 | + return masterMysqlAntexcMapper.getBulidCheckCount(param); | |
174 | + } | |
175 | + @Override | |
176 | + public List<Map<String, String>> getBulidCheckNumCount(Map param) { | |
177 | + return masterMysqlAntexcMapper.getBulidCheckNumCount(param); | |
178 | + } | |
179 | + @Override | |
180 | + public List<Map<String, String>> getCheckPersonCount(Map param) { | |
181 | + return masterMysqlAntexcMapper.getCheckPersonCount(param); | |
182 | + } | |
183 | + @Override | |
184 | + public List<Map<String, String>> getMatDeliverCount(Map param) { | |
185 | + return masterMysqlAntexcMapper.getMatDeliverCount(param); | |
186 | + } | |
187 | + @Override | |
188 | + public List<Map<String, String>> getLiveCount(Map param) { | |
189 | + return masterMysqlAntexcMapper.getLiveCount(param); | |
163 | 190 | } |
164 | 191 | |
165 | 192 | @Override |
platform-biz-service/src/main/resources/mainOrm/master/MasterMysqlAntexc.xml
View file @
4bfb221
... | ... | @@ -1212,7 +1212,8 @@ |
1212 | 1212 | nextCheckTime, |
1213 | 1213 | yn, |
1214 | 1214 | created, |
1215 | - sourceId | |
1215 | + sourceId, | |
1216 | + hospitalId | |
1216 | 1217 | ) VALUES ( |
1217 | 1218 | #{fid}, |
1218 | 1219 | #{parentId}, |
... | ... | @@ -1221,7 +1222,8 @@ |
1221 | 1222 | #{nextCheckTime}, |
1222 | 1223 | #{yn}, |
1223 | 1224 | #{created}, |
1224 | - #{sourceId} | |
1225 | + #{sourceId}, | |
1226 | + #{hospitalId} | |
1225 | 1227 | ) |
1226 | 1228 | |
1227 | 1229 | </insert> |
... | ... | @@ -1280,5 +1282,193 @@ |
1280 | 1282 | <delete id="deleteRiskLevelToMysql" parameterType="com.lyms.platform.permission.model.ReportRiskLevel"> |
1281 | 1283 | DELETE from report_risk_level WHERE foreignId = #{foreignId} |
1282 | 1284 | </delete> |
1285 | + | |
1286 | + | |
1287 | + <select id="getBuildCount" resultType="java.util.Map" parameterType="java.util.Map"> | |
1288 | + select count(p.patientId) as buildCount,o.id as hospitalId,o.name as hospitalName,o.province_id as provinceId,o.area_id as areaId,o.city_id as cityId from report_patients p | |
1289 | + INNER JOIN organization o on p.hospitalId=o.id | |
1290 | + where p.type=1 and p.enable is NULL | |
1291 | + <if test="startDate != null"> | |
1292 | + and p.bookbuildingDate >= #{startDate} | |
1293 | + </if> | |
1294 | + <if test="endDate != null"> | |
1295 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
1296 | + </if> | |
1297 | + <if test="hospitalId != null and hospitalId != ''"> | |
1298 | + and p.hospitalId = #{hospitalId,jdbcType=VARCHAR} | |
1299 | + </if> | |
1300 | + <if test="provinceId != null and provinceId != ''"> | |
1301 | + and o.province_id = #{provinceId,jdbcType=VARCHAR} | |
1302 | + </if> | |
1303 | + | |
1304 | + <if test="cityId != null and cityId != ''"> | |
1305 | + and o.city_id = #{cityId,jdbcType=VARCHAR} | |
1306 | + </if> | |
1307 | + <if test="areaId != null and areaId != ''"> | |
1308 | + and o.area_id = #{areaId,jdbcType=VARCHAR} | |
1309 | + </if> | |
1310 | + GROUP BY o.name | |
1311 | + </select> | |
1312 | + | |
1313 | + | |
1314 | + <select id="getBulidCheckCount" resultType="java.util.Map" parameterType="java.util.Map"> | |
1315 | + select count(tp.patientId) as checkPersonCount,tp.id as hospitalId,tp.name as hospitalName | |
1316 | + from (select p.patientId,o.id,o.name from report_patients p | |
1317 | + INNER JOIN organization o on p.hospitalId=o.id | |
1318 | + where p.type=1 and p.enable is NULL | |
1319 | + <if test="startDate != null"> | |
1320 | + and p.bookbuildingDate >= #{startDate} | |
1321 | + </if> | |
1322 | + <if test="endDate != null"> | |
1323 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
1324 | + </if> | |
1325 | + <if test="hospitalId != null and hospitalId != ''"> | |
1326 | + and p.hospitalId = #{hospitalId,jdbcType=VARCHAR} | |
1327 | + </if> | |
1328 | + <if test="provinceId != null and provinceId != ''"> | |
1329 | + and o.province_id = #{provinceId,jdbcType=VARCHAR} | |
1330 | + </if> | |
1331 | + | |
1332 | + <if test="cityId != null and cityId != ''"> | |
1333 | + and o.city_id = #{cityId,jdbcType=VARCHAR} | |
1334 | + </if> | |
1335 | + <if test="areaId != null and areaId != ''"> | |
1336 | + and o.area_id = #{areaId,jdbcType=VARCHAR} | |
1337 | + </if> | |
1338 | + ) tp | |
1339 | + INNER JOIN | |
1340 | + (SELECT c.cid as cid,c.parentId, c.checkTime as checkDate,c.sourceId from report_antexchu c) cj on | |
1341 | + tp.patientId= cj.sourceId GROUP BY tp.name | |
1342 | + </select> | |
1343 | + | |
1344 | + <select id="getBulidCheckNumCount" resultType="java.util.Map" parameterType="java.util.Map"> | |
1345 | + select count(cj.cid) as bulidCheckNumCount,tp.name as hospitalName,tp.hospitalId from ( | |
1346 | + select p.hospitalId, p.patientId,o.id,o.name,o.province_id,o.area_id,o.city_id from report_patients p | |
1347 | + INNER JOIN organization o on p.hospitalId=o.id | |
1348 | + where p.type=1 and p.enable is NULL | |
1349 | + <if test="startDate != null"> | |
1350 | + and p.bookbuildingDate >= #{startDate} | |
1351 | + </if> | |
1352 | + <if test="endDate != null"> | |
1353 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
1354 | + </if> | |
1355 | + <if test="hospitalId != null and hospitalId != ''"> | |
1356 | + and p.hospitalId = #{hospitalId,jdbcType=VARCHAR} | |
1357 | + </if> | |
1358 | + <if test="provinceId != null and provinceId != ''"> | |
1359 | + and o.province_id = #{provinceId,jdbcType=VARCHAR} | |
1360 | + </if> | |
1361 | + | |
1362 | + <if test="cityId != null and cityId != ''"> | |
1363 | + and o.city_id = #{cityId,jdbcType=VARCHAR} | |
1364 | + </if> | |
1365 | + <if test="areaId != null and areaId != ''"> | |
1366 | + and o.area_id = #{areaId,jdbcType=VARCHAR} | |
1367 | + </if> | |
1368 | + ) tp | |
1369 | + INNER JOIN | |
1370 | + (SELECT r.fid as cid,r.parentId, r.checkDate,r.sourceId from report_antex r | |
1371 | + union ALL | |
1372 | + SELECT c.cid as cid,c.parentId, c.checkTime as checkDate,c.sourceId from report_antexchu c) cj on tp.patientId= cj.sourceId GROUP BY tp.name | |
1373 | + </select> | |
1374 | + <select id="getCheckPersonCount" resultType="java.util.Map" parameterType="java.util.Map"> | |
1375 | + select count(cj.sourceId) as checkPersonCount,tp.name as hospitalName,tp.id as hospitalId | |
1376 | + from (select p.patientId,o.id,o.name from report_patients p | |
1377 | + INNER JOIN organization o on p.hospitalId=o.id | |
1378 | + where p.type=1 and p.enable is NULL | |
1379 | + <if test="hospitalId != null and hospitalId != ''"> | |
1380 | + and p.hospitalId = #{hospitalId,jdbcType=VARCHAR} | |
1381 | + </if> | |
1382 | + <if test="provinceId != null and provinceId != ''"> | |
1383 | + and o.province_id = #{provinceId,jdbcType=VARCHAR} | |
1384 | + </if> | |
1385 | + | |
1386 | + <if test="cityId != null and cityId != ''"> | |
1387 | + and o.city_id = #{cityId,jdbcType=VARCHAR} | |
1388 | + </if> | |
1389 | + <if test="areaId != null and areaId != ''"> | |
1390 | + and o.area_id = #{areaId,jdbcType=VARCHAR} | |
1391 | + </if> | |
1392 | + ) tp | |
1393 | + INNER JOIN | |
1394 | + (select t.sourceId | |
1395 | + from | |
1396 | + (SELECT r.fid as cid,r.pid, r.checkDate,r.sourceId from report_antex r where 1 = 1 | |
1397 | + | |
1398 | + <if test="startDate != null"> | |
1399 | + and r.checkDate >= #{startDate} | |
1400 | + </if> | |
1401 | + <if test="endDate != null"> | |
1402 | + and r.checkDate <![CDATA[ <= ]]> #{endDate} | |
1403 | + </if> | |
1404 | + union ALL | |
1405 | + SELECT c.cid as cid,c.pid, c.checkTime as checkDate,c.sourceId from report_antexchu c where 1 = 1 | |
1406 | + | |
1407 | + <if test="startDate != null"> | |
1408 | + and c.checkTime >= #{startDate} | |
1409 | + </if> | |
1410 | + <if test="endDate != null"> | |
1411 | + and c.checkTime <![CDATA[ <= ]]> #{endDate} | |
1412 | + </if> | |
1413 | + )t GROUP BY t.pid) cj on tp.patientId= cj.sourceId | |
1414 | + GROUP BY tp.name | |
1415 | + | |
1416 | + </select> | |
1417 | + | |
1418 | + <select id="getMatDeliverCount" resultType="java.util.Map" parameterType="java.util.Map"> | |
1419 | + select count(fm.patientId) as matDeliverCount,fm.name as hospitalName,fm.id as hospitalId | |
1420 | + from ( select p.patientId,o.id,o.name from report_matdeliver m | |
1421 | + INNER JOIN organization o on m.fmHospital=o.id | |
1422 | + INNER JOIN report_patients p on m.sourceId=p.patientId | |
1423 | + where p.type = 3 | |
1424 | + <if test="hospitalId != null and hospitalId != ''"> | |
1425 | + and o.id = #{hospitalId,jdbcType=VARCHAR} | |
1426 | + </if> | |
1427 | + <if test="provinceId != null and provinceId != ''"> | |
1428 | + and o.province_id = #{provinceId,jdbcType=VARCHAR} | |
1429 | + </if> | |
1430 | + | |
1431 | + <if test="cityId != null and cityId != ''"> | |
1432 | + and o.city_id = #{cityId,jdbcType=VARCHAR} | |
1433 | + </if> | |
1434 | + <if test="areaId != null and areaId != ''"> | |
1435 | + and o.area_id = #{areaId,jdbcType=VARCHAR} | |
1436 | + </if> | |
1437 | + <if test="startDate != null"> | |
1438 | + and p.bookbuildingDate >= #{startDate} | |
1439 | + </if> | |
1440 | + <if test="endDate != null"> | |
1441 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
1442 | + </if> | |
1443 | + ) fm GROUP BY fm.name; | |
1444 | + | |
1445 | + </select> | |
1446 | + | |
1447 | + <select id="getLiveCount" resultType="java.util.Map" parameterType="java.util.Map"> | |
1448 | + select count(p.patientId) as liveCount,o.name as hospitalName,o.id as hospitalId from report_patients p | |
1449 | + INNER JOIN organization o on p.hospitalId=o.id | |
1450 | + where p.pliveTypeId='57624c5e0cf23d4631523ea2' | |
1451 | + <if test="hospitalId != null and hospitalId != ''"> | |
1452 | + and o.id = #{hospitalId,jdbcType=VARCHAR} | |
1453 | + </if> | |
1454 | + <if test="provinceId != null and provinceId != ''"> | |
1455 | + and o.province_id = #{provinceId,jdbcType=VARCHAR} | |
1456 | + </if> | |
1457 | + | |
1458 | + <if test="cityId != null and cityId != ''"> | |
1459 | + and o.city_id = #{cityId,jdbcType=VARCHAR} | |
1460 | + </if> | |
1461 | + <if test="areaId != null and areaId != ''"> | |
1462 | + and o.area_id = #{areaId,jdbcType=VARCHAR} | |
1463 | + </if> | |
1464 | + <if test="startDate != null"> | |
1465 | + and p.bookbuildingDate >= #{startDate} | |
1466 | + </if> | |
1467 | + <if test="endDate != null"> | |
1468 | + and p.bookbuildingDate <![CDATA[ <= ]]> #{endDate} | |
1469 | + </if> | |
1470 | + GROUP BY o.name | |
1471 | + | |
1472 | + </select> | |
1283 | 1473 | </mapper> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientSyncMysqlFacade.java
View file @
4bfb221
1 | 1 | package com.lyms.platform.operate.web.facade; |
2 | 2 | |
3 | 3 | import com.lyms.platform.biz.service.*; |
4 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
4 | 5 | import com.lyms.platform.common.enums.*; |
5 | 6 | import com.lyms.platform.common.result.BaseObjectResponse; |
6 | 7 | import com.lyms.platform.common.utils.DateUtil; |
... | ... | @@ -31,10 +32,7 @@ |
31 | 32 | import org.springframework.web.bind.annotation.ResponseBody; |
32 | 33 | |
33 | 34 | import java.lang.reflect.InvocationTargetException; |
34 | -import java.util.Date; | |
35 | -import java.util.HashMap; | |
36 | -import java.util.List; | |
37 | -import java.util.Map; | |
35 | +import java.util.*; | |
38 | 36 | |
39 | 37 | /** |
40 | 38 | * Created by Administrator on 2020-11-30. |
41 | 39 | |
... | ... | @@ -46,8 +44,9 @@ |
46 | 44 | private PatientsService patientsService; |
47 | 45 | @Autowired |
48 | 46 | private ViewFacade viewFacade; |
49 | - | |
50 | 47 | @Autowired |
48 | + private BasicConfigService basicConfigService; | |
49 | + @Autowired | |
51 | 50 | private MysqlPatientsService mysqlPatientsService; |
52 | 51 | @Autowired |
53 | 52 | private MysqlAntexcService mysqlAntexcService; |
54 | 53 | |
... | ... | @@ -1312,9 +1311,8 @@ |
1312 | 1311 | page++; |
1313 | 1312 | } |
1314 | 1313 | } |
1315 | - @Autowired | |
1316 | - private BasicConfigService basicConfigService; | |
1317 | 1314 | |
1315 | + | |
1318 | 1316 | public void syncAntexchuToMysql(Date start,Date end) |
1319 | 1317 | { |
1320 | 1318 | AntExChuQuery antExChuQuery = new AntExChuQuery(); |
1321 | 1319 | |
... | ... | @@ -1525,7 +1523,245 @@ |
1525 | 1523 | public BaseObjectResponse getAreaCheckCount(String time, String hospitalId, String provinceId, String cityId, String areaId, Integer userId) |
1526 | 1524 | { |
1527 | 1525 | |
1528 | - return null; | |
1526 | + Date startDate = null; | |
1527 | + Date endDate = null; | |
1528 | + if (StringUtils.isNotEmpty(time)) | |
1529 | + { | |
1530 | + String[] arrs = time.split(" - "); | |
1531 | + startDate = DateUtil.parseYMD(arrs[0]); | |
1532 | + endDate = DateUtil.parseYMD(arrs[1]); | |
1533 | + } | |
1534 | + | |
1535 | + Map param = new HashMap(); | |
1536 | + param.put("startDate",startDate); | |
1537 | + param.put("endDate",endDate); | |
1538 | + param.put("hospitalId",hospitalId); | |
1539 | + param.put("provinceId",provinceId); | |
1540 | + param.put("cityId",cityId); | |
1541 | + param.put("areaId", areaId); | |
1542 | + List<Map<String,String>> bulidsCount = mysqlAntexcService.getBuildCount(param); | |
1543 | + List<Map<String,String>> bulidCheckCount = mysqlAntexcService.getBulidCheckCount(param); | |
1544 | + List<Map<String,String>> bulidCheckNumCounts = mysqlAntexcService.getBulidCheckNumCount(param); | |
1545 | + List<Map<String,String>> checkPersonCounts = mysqlAntexcService.getCheckPersonCount(param); | |
1546 | + List<Map<String,String>> matDeliverCounts = mysqlAntexcService.getMatDeliverCount(param); | |
1547 | + List<Map<String,String>> liveCounts = mysqlAntexcService.getLiveCount(param); | |
1548 | + if (CollectionUtils.isNotEmpty(bulidsCount)) | |
1549 | + { | |
1550 | + | |
1551 | + for (Map<String,String> map : bulidsCount) | |
1552 | + { | |
1553 | + String hospitalName = map.get("hospitalName"); | |
1554 | + String provId = map.get("provinceId"); | |
1555 | + String cId = map.get("cityId"); | |
1556 | + String aId = map.get("areaId"); | |
1557 | + String provinceName = getAddressName(provId); | |
1558 | + String cityName = getAddressName(cId); | |
1559 | + String areaName = getAddressName(aId); | |
1560 | + | |
1561 | + map.put("provinceName",provinceName); | |
1562 | + map.put("cityName",cityName); | |
1563 | + map.put("areaName",areaName); | |
1564 | + | |
1565 | + String bulidCheckPersonCount ="0"; | |
1566 | + if (CollectionUtils.isNotEmpty(bulidCheckCount)) { | |
1567 | + for (Map<String, String> checkData : bulidCheckCount) { | |
1568 | + if (hospitalName.equals(checkData.get("hospitalName"))) | |
1569 | + { | |
1570 | + bulidCheckPersonCount = String.valueOf(checkData.get("checkPersonCount")); | |
1571 | + break; | |
1572 | + } | |
1573 | + } | |
1574 | + } | |
1575 | + map.put("bulidCheckPersonCount",bulidCheckPersonCount); | |
1576 | + | |
1577 | + String bulidCheckNumCount ="0"; | |
1578 | + if (CollectionUtils.isNotEmpty(bulidCheckNumCounts)) { | |
1579 | + for (Map<String, String> checkData : bulidCheckNumCounts) { | |
1580 | + if (hospitalName.equals(checkData.get("hospitalName"))) | |
1581 | + { | |
1582 | + bulidCheckNumCount = String.valueOf(checkData.get("bulidCheckNumCount")); | |
1583 | + break; | |
1584 | + } | |
1585 | + } | |
1586 | + } | |
1587 | + map.put("bulidCheckNumCount",bulidCheckNumCount); | |
1588 | + | |
1589 | + String checkPersonCount ="0"; | |
1590 | + if (CollectionUtils.isNotEmpty(checkPersonCounts)) { | |
1591 | + for (Map<String, String> checkData : checkPersonCounts) { | |
1592 | + if (hospitalName.equals(checkData.get("hospitalName"))) | |
1593 | + { | |
1594 | + checkPersonCount = String.valueOf(checkData.get("checkPersonCount")); | |
1595 | + break; | |
1596 | + } | |
1597 | + } | |
1598 | + } | |
1599 | + map.put("checkPersonCount",checkPersonCount); | |
1600 | + | |
1601 | + String matDeliverCount ="0"; | |
1602 | + if (CollectionUtils.isNotEmpty(matDeliverCounts)) { | |
1603 | + for (Map<String, String> checkData : matDeliverCounts) { | |
1604 | + if (hospitalName.equals(checkData.get("hospitalName"))) | |
1605 | + { | |
1606 | + matDeliverCount = String.valueOf(checkData.get("matDeliverCount")); | |
1607 | + break; | |
1608 | + } | |
1609 | + } | |
1610 | + } | |
1611 | + map.put("matDeliverCount",matDeliverCount); | |
1612 | + | |
1613 | + | |
1614 | + String liveCount ="0"; | |
1615 | + if (CollectionUtils.isNotEmpty(liveCounts)) { | |
1616 | + for (Map<String, String> checkData : liveCounts) { | |
1617 | + if (hospitalName.equals(checkData.get("hospitalName"))) | |
1618 | + { | |
1619 | + liveCount = String.valueOf(checkData.get("liveCount")); | |
1620 | + break; | |
1621 | + } | |
1622 | + } | |
1623 | + } | |
1624 | + map.put("liveCount",liveCount); | |
1625 | + } | |
1626 | + } | |
1627 | + List<String> chartData = new ArrayList<>(); | |
1628 | + List<Integer> jdNum = new ArrayList<>(); | |
1629 | + List<Integer> cjNum = new ArrayList<>(); | |
1630 | + List<Integer> cjrcNum = new ArrayList<>(); | |
1631 | + List<Integer> checkNum = new ArrayList<>(); | |
1632 | + List<Integer> fmNum = new ArrayList<>(); | |
1633 | + List<Integer> ldNum = new ArrayList<>(); | |
1634 | + | |
1635 | + if (StringUtils.isNotEmpty(hospitalId) || StringUtils.isNotEmpty(areaId)) { | |
1636 | + for (Map<String, String> map : bulidsCount) { | |
1637 | + chartData.add(map.get("hospitalName").toString()); | |
1638 | + jdNum.add(getInteger(map.get("buildCount"))); | |
1639 | + cjNum.add(getInteger(map.get("bulidCheckPersonCount"))); | |
1640 | + cjrcNum.add(getInteger(map.get("bulidCheckNumCount"))); | |
1641 | + checkNum.add(getInteger(map.get("checkPersonCount"))); | |
1642 | + fmNum.add(getInteger(map.get("matDeliverCount"))); | |
1643 | + ldNum.add(getInteger(map.get("liveCount"))); | |
1644 | + | |
1645 | + } | |
1646 | + } else if (StringUtils.isNotEmpty(cityId)) { | |
1647 | + getData(bulidsCount, jdNum, cjNum, cjrcNum, checkNum, fmNum, ldNum, chartData, "areaId", "areaName"); | |
1648 | + } else if (StringUtils.isNotEmpty(provinceId)) { | |
1649 | + getData(bulidsCount, jdNum, cjNum, cjrcNum, checkNum, fmNum, ldNum, chartData, "cityId", "cityName"); | |
1650 | + } else { | |
1651 | + getData(bulidsCount, jdNum, cjNum, cjrcNum, checkNum, fmNum, ldNum, chartData, "provinceId", "provinceName"); | |
1652 | + } | |
1653 | + | |
1654 | + Map<String, Object> data = new HashMap<>(); | |
1655 | + data.put("list", bulidsCount); | |
1656 | + data.put("chartData", chartData); | |
1657 | + data.put("buildCount", jdNum); | |
1658 | + data.put("bulidCheckPersonCount", cjNum); | |
1659 | + data.put("bulidCheckNumCount", cjrcNum); | |
1660 | + data.put("checkPersonCount", checkNum); | |
1661 | + data.put("matDeliverCount", fmNum); | |
1662 | + data.put("liveCount", ldNum); | |
1663 | + | |
1664 | + return new BaseObjectResponse().setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(data); | |
1529 | 1665 | } |
1666 | + | |
1667 | + private String getAddressName(String id) | |
1668 | + { | |
1669 | + BasicConfig address = basicConfigService.getOneBasicConfigById(id); | |
1670 | + if (address != null) | |
1671 | + { | |
1672 | + return address.getName(); | |
1673 | + } | |
1674 | + return ""; | |
1675 | + } | |
1676 | + | |
1677 | + | |
1678 | + private void getData(List<Map<String, String>> bulidsCount, | |
1679 | + List<Integer> jdNum, List<Integer> cjNum, List<Integer> cjrcNum, | |
1680 | + List<Integer> checkNum, List<Integer> fmNum, List<Integer> ldNum, | |
1681 | + List<String> chartData, | |
1682 | + String idKey, String nameKey | |
1683 | + ) { | |
1684 | + Map<String, Integer> result = new LinkedHashMap<>(); | |
1685 | + for (Map<String, String> map : bulidsCount) { | |
1686 | + | |
1687 | + String key = "buildCount:" + map.get(idKey).toString() + ":" + map.get(nameKey).toString(); | |
1688 | + if (result.get(key) != null) { | |
1689 | + Integer value = result.get(key); | |
1690 | + result.put(key, value + getInteger(map.get("buildCount"))); | |
1691 | + } else { | |
1692 | + result.put(key, getInteger(map.get("buildCount"))); | |
1693 | + } | |
1694 | + | |
1695 | + String key15 = "bulidCheckPersonCount:" + map.get(idKey).toString() + ":" + map.get(nameKey).toString(); | |
1696 | + if (result.get(key15) != null) { | |
1697 | + Integer value = result.get(key15); | |
1698 | + result.put(key15, value + getInteger(map.get("bulidCheckPersonCount"))); | |
1699 | + } else { | |
1700 | + result.put(key15, getInteger(map.get("bulidCheckPersonCount"))); | |
1701 | + } | |
1702 | + | |
1703 | + String key1 = "bulidCheckNumCount:" + map.get(idKey).toString() + ":" + map.get(nameKey).toString(); | |
1704 | + if (result.get(key1) != null) { | |
1705 | + Integer value = result.get(key1); | |
1706 | + result.put(key1, value + getInteger(map.get("bulidCheckNumCount"))); | |
1707 | + } else { | |
1708 | + result.put(key1, getInteger(map.get("bulidCheckNumCount"))); | |
1709 | + } | |
1710 | + | |
1711 | + String key2 = "checkPersonCount:" + map.get(idKey).toString() + ":" + map.get(nameKey).toString(); | |
1712 | + if (result.get(key2) != null) { | |
1713 | + Integer value = result.get(key2); | |
1714 | + result.put(key2, value + getInteger(map.get("checkPersonCount"))); | |
1715 | + } else { | |
1716 | + result.put(key2, getInteger(map.get("checkPersonCount"))); | |
1717 | + } | |
1718 | + | |
1719 | + | |
1720 | + String key27 = "matDeliverCount:" + map.get(idKey).toString() + ":" + map.get(nameKey).toString(); | |
1721 | + if (result.get(key27) != null) { | |
1722 | + Integer value = result.get(key27); | |
1723 | + result.put(key27, value + getInteger(map.get("matDeliverCount"))); | |
1724 | + } else { | |
1725 | + result.put(key27, getInteger(map.get("matDeliverCount"))); | |
1726 | + } | |
1727 | + | |
1728 | + String key3 = "liveCount:" + map.get(idKey).toString() + ":" + map.get(nameKey).toString(); | |
1729 | + if (result.get(key3) != null) { | |
1730 | + Integer value = result.get(key3); | |
1731 | + result.put(key3, value + getInteger(map.get("liveCount"))); | |
1732 | + } else { | |
1733 | + result.put(key3, getInteger(map.get("liveCount"))); | |
1734 | + } | |
1735 | + } | |
1736 | + | |
1737 | + for (String key : result.keySet()) { | |
1738 | + String name = key.split(":")[2]; | |
1739 | + if (!chartData.contains(name)) { | |
1740 | + chartData.add(name); | |
1741 | + } | |
1742 | + if (key.contains("buildCount")) { | |
1743 | + jdNum.add(result.get(key)); | |
1744 | + } else if (key.contains("bulidCheckPersonCount")) { | |
1745 | + cjNum.add(result.get(key)); | |
1746 | + } else if (key.contains("bulidCheckNumCount")) { | |
1747 | + cjrcNum.add(result.get(key)); | |
1748 | + } else if (key.contains("checkPersonCount")) { | |
1749 | + checkNum.add(result.get(key)); | |
1750 | + } else if (key.contains("matDeliverCount")) { | |
1751 | + fmNum.add(result.get(key)); | |
1752 | + } else if (key.contains("liveCount")) { | |
1753 | + ldNum.add(result.get(key)); | |
1754 | + } | |
1755 | + } | |
1756 | + } | |
1757 | + | |
1758 | + | |
1759 | + private Integer getInteger(Object obj) { | |
1760 | + if (obj != null) { | |
1761 | + return Integer.parseInt(obj.toString()); | |
1762 | + } | |
1763 | + return 0; | |
1764 | + } | |
1765 | + | |
1530 | 1766 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/StopPregnancyFacade.java
View file @
4bfb221
... | ... | @@ -704,6 +704,7 @@ |
704 | 704 | usersQuery.setYn(YnEnums.YES.getId()); |
705 | 705 | usersQuery.setOrgId(orgId); |
706 | 706 | usersQuery.setEnable(1); |
707 | + usersQuery.setSort(" created asc "); | |
707 | 708 | List<Users> users = usersService.queryUsers(usersQuery); |
708 | 709 | if (CollectionUtils.isNotEmpty(users)) { |
709 | 710 | for (Users user : users) { |
platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml
View file @
4bfb221
... | ... | @@ -572,6 +572,25 @@ |
572 | 572 | |
573 | 573 | |
574 | 574 | |
575 | + <!-- 秦皇岛区域给30周的孕妇发送一条短信提醒还有多少优惠劵没有使用,发送一条短信--> | |
576 | + <bean id="patientCouponWork" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> | |
577 | + <!-- 要调用的bean --> | |
578 | + <property name="targetObject" ref="patientFacade"></property> | |
579 | + <!-- 要调用的Method --> | |
580 | + <property name="targetMethod" value="noticeCouponUser"></property> | |
581 | + <!-- 是否并发,false表示 如果发生错误也不影响下一次的调用 --> | |
582 | + <property name="concurrent" value="false"></property> | |
583 | + </bean> | |
584 | + | |
585 | + <!-- 配置一个触发器 0 0 0/1 * * ?--> | |
586 | + <bean id="patientCouponTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> | |
587 | + <property name="jobDetail" ref="patientCouponWork"></property> | |
588 | + <property name="cronExpression" value="0 0 2 * * ?"></property> | |
589 | + <!--<property name="cronExpression" value="0/5 * * * * ? "></property>--> | |
590 | + </bean> | |
591 | + | |
592 | + | |
593 | + | |
575 | 594 | |
576 | 595 | <!-- 总调度,用于启动定时器 --> |
577 | 596 | <bean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> |