Commit 10878f1e10ed6e9c0f66ecacd28c7b57a493609f
1 parent
48c0b30b37
Exists in
master
and in
6 other branches
血压
Showing 11 changed files with 190 additions and 10 deletions
- platform-common/src/main/java/com/lyms/platform/common/enums/SmsServiceEnums.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BloodPressureController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BloodSugarController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyManageRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IBloodPressureService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IBloodSugarService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodPressureServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
platform-common/src/main/java/com/lyms/platform/common/enums/SmsServiceEnums.java
View file @
10878f1
... | ... | @@ -51,7 +51,9 @@ |
51 | 51 | JSGWZD(37,"及时高危指导",1,""), |
52 | 52 | CSJGTZ(38,"产筛结果通知",21,"1"), |
53 | 53 | YFXXJSTX(39,"孕妇学校课程结束提醒",21,"1,3"), |
54 | - TZTX(40,"体重测量提醒",21,"1"); | |
54 | + TZTX(40,"体重测量提醒",21,"1"), | |
55 | + XTTX(41,"血糖测量提醒",21,"1"), | |
56 | + XYTX(42,"血压测量提醒",21,"1"); | |
55 | 57 | |
56 | 58 | private SmsServiceEnums(int id,String name,int pid,String serviceObj){ |
57 | 59 | this.id = id; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
View file @
10878f1
... | ... | @@ -216,6 +216,7 @@ |
216 | 216 | @RequestParam(value = "hospitalCityId",required = false) String hospitalCityId, |
217 | 217 | @RequestParam(value = "hospitalAreaId",required = false) String hospitalAreaId, |
218 | 218 | @RequestParam(value = "hospitalId",required = false) String hospitalId, |
219 | + @RequestParam(value = "vcCardNo",required = false) String vcCardNo, | |
219 | 220 | @RequestParam(value = "isArea",required = false) String isArea) { |
220 | 221 | |
221 | 222 | if (CollectionUtils.isNotEmpty(highRiskInfos)){ |
... | ... | @@ -227,6 +228,7 @@ |
227 | 228 | } |
228 | 229 | LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); |
229 | 230 | BabyManageRequest request = new BabyManageRequest(); |
231 | + request.setVcCardNo(vcCardNo); | |
230 | 232 | request.setWeakSonInfos(weakSonInfos); |
231 | 233 | request.setHighRiskInfos(highRiskInfos); |
232 | 234 | request.setShowDetail(showDetail); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BloodPressureController.java
View file @
10878f1
... | ... | @@ -126,6 +126,20 @@ |
126 | 126 | return bpReportFacade.checkUnReadReport(pid); |
127 | 127 | } |
128 | 128 | |
129 | + | |
130 | + @ResponseBody | |
131 | + @RequestMapping(value = "/notify/{type}",method = RequestMethod.POST) | |
132 | + public BaseResponse notify(@RequestBody List<String> patientIds,@PathVariable Integer type, HttpServletRequest request) { | |
133 | + return bloodPressureService.notify(patientIds, type); | |
134 | + } | |
135 | + | |
136 | + @ResponseBody | |
137 | + @RequestMapping(value = "/getBloodSugars/{doctorId}/{type}/{status}", method = RequestMethod.GET) | |
138 | + public BaseResponse getBloodSugars(@PathVariable String doctorId,@PathVariable Integer type,@PathVariable Integer status,@RequestParam(required = false) String keyword) { | |
139 | + return bloodPressureService.getBloodSugars(doctorId, type, status, keyword); | |
140 | + } | |
141 | + | |
142 | + | |
129 | 143 | @Autowired |
130 | 144 | private BpReportFacade bpReportFacade; |
131 | 145 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BloodSugarController.java
View file @
10878f1
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | |
13 | 13 | import javax.servlet.http.HttpServletRequest; |
14 | 14 | import java.util.Date; |
15 | +import java.util.List; | |
15 | 16 | |
16 | 17 | /** |
17 | 18 | * 血糖 |
... | ... | @@ -122,6 +123,12 @@ |
122 | 123 | ,HttpServletRequest httpServletRequest) { |
123 | 124 | LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); |
124 | 125 | return bloodSugarService.getSysBloodSugarReport(patientId, loginState.getId()); |
126 | + } | |
127 | + | |
128 | + @ResponseBody | |
129 | + @RequestMapping(value = "/notify/{type}",method = RequestMethod.POST) | |
130 | + public BaseResponse notify(@RequestBody List<String> patientIds,@PathVariable Integer type, HttpServletRequest request) { | |
131 | + return bloodSugarService.notify(patientIds, type); | |
125 | 132 | } |
126 | 133 | |
127 | 134 | @ResponseBody |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
10878f1
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyManageRequest.java
View file @
10878f1
... | ... | @@ -81,6 +81,15 @@ |
81 | 81 | //1-需要隐藏姓名、电话、地址 |
82 | 82 | private int showDetail; |
83 | 83 | |
84 | + private String vcCardNo; | |
85 | + | |
86 | + public String getVcCardNo() { | |
87 | + return vcCardNo; | |
88 | + } | |
89 | + | |
90 | + public void setVcCardNo(String vcCardNo) { | |
91 | + this.vcCardNo = vcCardNo; | |
92 | + } | |
84 | 93 | |
85 | 94 | public String getbTime() { |
86 | 95 | return bTime; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IBloodPressureService.java
View file @
10878f1
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IBloodSugarService.java
View file @
10878f1
... | ... | @@ -4,6 +4,7 @@ |
4 | 4 | import com.lyms.platform.pojo.BloodSugar; |
5 | 5 | |
6 | 6 | import java.util.Date; |
7 | +import java.util.List; | |
7 | 8 | import java.util.Map; |
8 | 9 | |
9 | 10 | public interface IBloodSugarService extends IBaseService { |
... | ... | @@ -33,5 +34,7 @@ |
33 | 34 | BaseResponse getSysBloodSugarReport(String patientId,Integer userId); |
34 | 35 | |
35 | 36 | BaseResponse getBloodSugars(String doctorId, Integer type, Integer status, String keyword); |
37 | + | |
38 | + public BaseResponse notify( List<String> patientIds, Integer type); | |
36 | 39 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodPressureServiceImpl.java
View file @
10878f1
... | ... | @@ -419,5 +419,31 @@ |
419 | 419 | } |
420 | 420 | |
421 | 421 | |
422 | + | |
423 | + private int getPressureStatus(String ssy, String szy) { | |
424 | + int status = 0; | |
425 | + if (StringUtils.isNotEmpty(ssy)) { | |
426 | + if (Double.parseDouble(ssy) >= 140 || Double.parseDouble(szy) >= 90) { | |
427 | + status = 1; | |
428 | + } else if (Double.parseDouble(ssy) < 90 || Double.parseDouble(szy) < 60) { | |
429 | + status = -1; | |
430 | + } | |
431 | + } | |
432 | + return status; | |
433 | + } | |
434 | + | |
435 | + | |
436 | + | |
437 | + @Override | |
438 | + public BaseResponse notify(List<String> patientIds, Integer type) { | |
439 | + return null; | |
440 | + } | |
441 | + | |
442 | + @Override | |
443 | + public BaseResponse getBloodSugars(String doctorId, Integer type, Integer status, String keyword) { | |
444 | + return null; | |
445 | + } | |
446 | + | |
447 | + | |
422 | 448 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java
View file @
10878f1
... | ... | @@ -2,20 +2,15 @@ |
2 | 2 | |
3 | 3 | import com.alibaba.fastjson.JSONArray; |
4 | 4 | import com.alibaba.fastjson.JSONObject; |
5 | +import com.lyms.platform.beans.MsgRequest; | |
5 | 6 | import com.lyms.platform.biz.service.*; |
6 | 7 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
7 | -import com.lyms.platform.common.enums.BloodSugarEnums; | |
8 | -import com.lyms.platform.common.enums.BloodSugarEnums2; | |
9 | -import com.lyms.platform.common.enums.PatientSerEnums; | |
10 | -import com.lyms.platform.common.enums.YnEnums; | |
8 | +import com.lyms.platform.common.enums.*; | |
11 | 9 | import com.lyms.platform.common.result.*; |
12 | 10 | import com.lyms.platform.common.utils.DateUtil; |
13 | 11 | import com.lyms.platform.common.utils.EnumUtil; |
14 | 12 | import com.lyms.platform.common.utils.StringUtils; |
15 | -import com.lyms.platform.operate.web.facade.AccessPermissionFacade; | |
16 | -import com.lyms.platform.operate.web.facade.AntExRecordFacade; | |
17 | -import com.lyms.platform.operate.web.facade.AutoMatchFacade; | |
18 | -import com.lyms.platform.operate.web.facade.OrganizationGroupsFacade; | |
13 | +import com.lyms.platform.operate.web.facade.*; | |
19 | 14 | import com.lyms.platform.operate.web.service.IBloodSugarService; |
20 | 15 | import com.lyms.platform.operate.web.service.PatientWeightService; |
21 | 16 | import com.lyms.platform.operate.web.utils.CollectionUtils; |
22 | 17 | |
... | ... | @@ -25,8 +20,10 @@ |
25 | 20 | import com.lyms.platform.permission.model.Organization; |
26 | 21 | import com.lyms.platform.permission.model.PatientService; |
27 | 22 | import com.lyms.platform.permission.model.PatientServiceQuery; |
23 | +import com.lyms.platform.permission.model.Users; | |
28 | 24 | import com.lyms.platform.permission.service.OrganizationService; |
29 | 25 | import com.lyms.platform.permission.service.PatientServiceService; |
26 | +import com.lyms.platform.permission.service.UsersService; | |
30 | 27 | import com.lyms.platform.pojo.*; |
31 | 28 | import com.lyms.platform.query.AntExChuQuery; |
32 | 29 | import com.lyms.platform.query.AntExRecordQuery; |
... | ... | @@ -77,6 +74,13 @@ |
77 | 74 | private PatientsService patientsService; |
78 | 75 | |
79 | 76 | @Autowired |
77 | + private SmsConfigFacade smsConfigFacade; | |
78 | + | |
79 | + | |
80 | + @Autowired | |
81 | + private PatientWeightService2 patientWeightService2; | |
82 | + | |
83 | + @Autowired | |
80 | 84 | private AntenatalExaminationService antenatalExaminationService; |
81 | 85 | |
82 | 86 | @Autowired |
... | ... | @@ -88,6 +92,9 @@ |
88 | 92 | @Autowired |
89 | 93 | private PatientWeightService patientWeightService; |
90 | 94 | |
95 | + @Autowired | |
96 | + private UsersService usersService; | |
97 | + | |
91 | 98 | public BaseResponse add(Integer userId, BloodSugar bloodSugar) { |
92 | 99 | // BloodSugar one = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(bloodSugar.getParentId()).and("created").gt(DateUtil.getYMDTime()).and("bloodSugarType").is(bloodSugar.getBloodSugarType())), BloodSugar.class); |
93 | 100 | BloodSugar one = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(mongoUtil.getPid(bloodSugar.getParentId())).and("created").gt(DateUtil.getYMDTime()).and("bloodSugarType").is(bloodSugar.getBloodSugarType())), BloodSugar.class); |
... | ... | @@ -1201,6 +1208,112 @@ |
1201 | 1208 | private void setData(Map<String, Object> map, String key, String value) { |
1202 | 1209 | map.put("id", key); |
1203 | 1210 | map.put("name", value); |
1211 | + } | |
1212 | + | |
1213 | + | |
1214 | + @Override | |
1215 | + public BaseResponse notify(final List<String> patientIds,final Integer type) { | |
1216 | + | |
1217 | + new Thread(new Runnable() { | |
1218 | + @Override | |
1219 | + public void run() { | |
1220 | + if (CollectionUtils.isNotEmpty(patientIds)) | |
1221 | + { | |
1222 | + for (String patientId : patientIds) | |
1223 | + { | |
1224 | + Patients patient = patientsService.findOnePatientById(patientId); | |
1225 | + if (patient != null) | |
1226 | + { | |
1227 | + SmsConfigModel configModel = new SmsConfigModel(); | |
1228 | + // 1 推送服务, 2 推送和短信服务 3短信服务, | |
1229 | + int startType = smsConfigFacade.hospitalIsStart(patient.getHospitalId(), configModel, SmsServiceEnums.XTTX.getId()); | |
1230 | + | |
1231 | + if (startType == 0) { | |
1232 | + return; | |
1233 | + } | |
1234 | + | |
1235 | + //短信前缀 | |
1236 | + String messagePrefix = smsConfigFacade.getMsgPrefix(configModel, patient.getBookbuildingDoctor(), ServiceObjEnums.YUNOBJ.getId()); | |
1237 | + | |
1238 | + List<MsgRequest> messages = new ArrayList<>(); | |
1239 | + MsgRequest mr = new MsgRequest(); | |
1240 | + String content = ""; | |
1241 | + | |
1242 | + BloodSugarQuery bloodSugarQuery = new BloodSugarQuery(); | |
1243 | + bloodSugarQuery.setParentId(patientId); | |
1244 | + List<BloodSugar> bloodSugars = bloodSugarService.queryBloodSugarList(bloodSugarQuery,Sort.Direction.DESC, "created"); | |
1245 | + if (type == 2) | |
1246 | + { | |
1247 | + content = "亲爱的准妈妈您好,我是您的私人血糖管理医生,您目前已经很久没有记录您的血糖值了,为了您和您孩子的健康,请您务必每天记录一下自己的血糖,好让我们能随时关注到您和宝宝的健康状况,谢谢!"; | |
1248 | + if (CollectionUtils.isNotEmpty(bloodSugars)) | |
1249 | + { | |
1250 | + for (BloodSugar bloodSugar : bloodSugars) | |
1251 | + { | |
1252 | + bloodSugar.setSevenSend(1); | |
1253 | + bloodSugarService.update(bloodSugar); | |
1254 | + } | |
1255 | + } | |
1256 | + } | |
1257 | + else if (type == 3) | |
1258 | + { | |
1259 | + content = "亲爱的准妈妈您好,我是您的私人血糖管理医生,您目前的血糖数据十分不理想,请您迅速与我联系或来院进行复查身体情况。"; | |
1260 | + if (CollectionUtils.isNotEmpty(bloodSugars)) | |
1261 | + { | |
1262 | + for (BloodSugar bloodSugar : bloodSugars) | |
1263 | + { | |
1264 | + bloodSugar.setExceptionSend(1); | |
1265 | + bloodSugarService.update(bloodSugar); | |
1266 | + } | |
1267 | + } | |
1268 | + } | |
1269 | + | |
1270 | + mr.setFirst("【" + messagePrefix + "】" + content); | |
1271 | + mr.setObjType(ServiceObjEnums.YUNOBJ.getId()); | |
1272 | + mr.setPhone(patient.getPhone()); | |
1273 | + mr.setTimeType(SmsTimeTypeEnums.ONTIME.getId()); | |
1274 | + mr.setTypeId(ProjectTypeEnums.YNXT.getId()); | |
1275 | + mr.setPlanTime(DateUtil.getyyyy_MM_dd_hms(new Date())); | |
1276 | + mr.setSubTypeId(SmsServiceEnums.XTTX.getId()); | |
1277 | + mr.setStatus(SmsStatusEnums.WFS.getId()); | |
1278 | + mr.setHospitalId(patient.getHospitalId()); | |
1279 | + mr.setTempId(""); | |
1280 | + mr.setPatientId(patient.getId()); | |
1281 | + mr.setSmsStatus(SmsStatusEnums.WFS.getId()); | |
1282 | + mr.setServiceType(startType); //判断发送类型 | |
1283 | + | |
1284 | + PatientServiceQuery patientQuery = new PatientServiceQuery(); | |
1285 | + patientQuery.setHospitalId(patient.getHospitalId()); | |
1286 | + patientQuery.setParentid(patientId); | |
1287 | + patientQuery.setSerType(PatientSerEnums.SerTypeEnums.tz.getId()); | |
1288 | + | |
1289 | + List<PatientService> patientServices = patientServiceService.queryPatientService(patientQuery); | |
1290 | + | |
1291 | + if (CollectionUtils.isNotEmpty(patientServices) && org.apache.commons.lang.StringUtils.isNotEmpty(patientServices.get(0).getSerDoct())) { | |
1292 | + try { | |
1293 | + Users users = usersService.getUsers(Integer.parseInt(patientServices.get(0).getSerDoct())); | |
1294 | + if (users != null) { | |
1295 | + mr.setKeyword1(users.getName()); | |
1296 | + } | |
1297 | + } catch (Exception e) { | |
1298 | + mr.setKeyword1("产检医生"); | |
1299 | + } | |
1300 | + } | |
1301 | + | |
1302 | + mr.setKeyword2(DateUtil.getyyyy_MM_dd(new Date())); | |
1303 | + mr.setRemark(""); | |
1304 | + mr.setCreated(DateUtil.getyyyy_MM_dd_hms(new Date())); | |
1305 | + mr.setWxTempId(WxTempleteIdEnums.YI_SHENG_ZHI_DAO.getId()); | |
1306 | + messages.add(mr); | |
1307 | + if (CollectionUtils.isNotEmpty(messages)) { | |
1308 | + smsConfigFacade.saveMsg(messages, patient.getHospitalId()); | |
1309 | + } | |
1310 | + | |
1311 | + } | |
1312 | + } | |
1313 | + } | |
1314 | + } | |
1315 | + }).start(); | |
1316 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
1204 | 1317 | } |
1205 | 1318 | |
1206 | 1319 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
10878f1
... | ... | @@ -1871,7 +1871,6 @@ |
1871 | 1871 | mr.setRemark(""); |
1872 | 1872 | mr.setCreated(DateUtil.getyyyy_MM_dd_hms(new Date())); |
1873 | 1873 | mr.setWxTempId(WxTempleteIdEnums.YI_SHENG_ZHI_DAO.getId()); |
1874 | - System.out.println(mr); | |
1875 | 1874 | messages.add(mr); |
1876 | 1875 | if (CollectionUtils.isNotEmpty(messages)) { |
1877 | 1876 | smsConfigFacade.saveMsg(messages, patient.getHospitalId()); |