Commit e3ea6c26fa24a90255ec682f2792af2ce56f9501
1 parent
5542789d5c
Exists in
luanping
and in
1 other branch
#新增承德医院儿保高危提示
Showing 5 changed files with 124 additions and 7 deletions
- platform-common/src/main/java/com/lyms/platform/common/enums/ProjectWeekEnums.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyAutoDiagnoseRiskController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FactorProjectController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyAutoDiagnoseRiskFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
platform-common/src/main/java/com/lyms/platform/common/enums/ProjectWeekEnums.java
View file @
e3ea6c2
1 | +package com.lyms.platform.common.enums; | |
2 | + | |
3 | +import com.lyms.platform.common.utils.StringUtils; | |
4 | + | |
5 | +import java.util.ArrayList; | |
6 | +import java.util.HashMap; | |
7 | +import java.util.List; | |
8 | +import java.util.Map; | |
9 | + | |
10 | +public enum ProjectWeekEnums { | |
11 | + EIGHT_WEEK(1,"孕5-8周","5,6,7,8"),TWELVE_WEEK(2,"孕12周","12") | |
12 | + ,SIXTEEN_WEEK(3,"孕16周","16"),TWENTY_WEEK(4,"孕20周","20"),TWENTY_TWO_WEEK(5,"孕22-24周","22,23") | |
13 | + ,TWENTY_FOUR_WEEK(6,"孕24-28周","24,25,26,27"),TWENTY_EIGHT_WEEK(7,"孕28周","28"),THIRTY_TWO_WEEK(8,"孕32周","32") | |
14 | + ,THIRTY_FIVE_WEEK(9,"孕35-36周","35,36"),THIRTY_SEVEN_WEEK(10,"孕37周","37"),THIRTY_EIGHT_WEEK(11,"孕38周","38") | |
15 | + ,THIRTY_NINE_WEEK(12,"孕39周","39"),FORTY_WEEK(13,"孕40周","40"); | |
16 | + | |
17 | + public static List<Map> getWeekEnums() { | |
18 | + List<Map> list = new ArrayList<>(); | |
19 | + for (ProjectWeekEnums e : ProjectWeekEnums.values()) { | |
20 | + Map rootMap = new HashMap(); | |
21 | + rootMap.put("id", e.getId()); | |
22 | + rootMap.put("name", e.getName()); | |
23 | + list.add(rootMap); | |
24 | + } | |
25 | + return list; | |
26 | + } | |
27 | + | |
28 | + public static String getWeekName(String week){ | |
29 | + if (StringUtils.isEmpty(week)){ | |
30 | + return ""; | |
31 | + } | |
32 | + for (ProjectWeekEnums cfEnums:ProjectWeekEnums.values()){ | |
33 | + if (cfEnums.getWeek().contains(week)){ | |
34 | + return cfEnums.getName(); | |
35 | + } | |
36 | + } | |
37 | + return ""; | |
38 | + } | |
39 | + | |
40 | + private ProjectWeekEnums(Integer id,String name,String week){ | |
41 | + this.id=id; | |
42 | + this.name=name; | |
43 | + this.week=week; | |
44 | + } | |
45 | + | |
46 | + private Integer id; | |
47 | + private String name; | |
48 | + private String week; | |
49 | + | |
50 | + public Integer getId() { | |
51 | + return id; | |
52 | + } | |
53 | + | |
54 | + public void setId(Integer id) { | |
55 | + this.id = id; | |
56 | + } | |
57 | + | |
58 | + public String getName() { | |
59 | + return name; | |
60 | + } | |
61 | + | |
62 | + public void setName(String name) { | |
63 | + this.name = name; | |
64 | + } | |
65 | + | |
66 | + public String getWeek() { | |
67 | + return week; | |
68 | + } | |
69 | + | |
70 | + public void setWeek(String week) { | |
71 | + this.week = week; | |
72 | + } | |
73 | + | |
74 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyAutoDiagnoseRiskController.java
View file @
e3ea6c2
... | ... | @@ -51,6 +51,21 @@ |
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
54 | + * 自动诊断的数量 | |
55 | + * @param request | |
56 | + * @return | |
57 | + */ | |
58 | + @RequestMapping(method = RequestMethod.GET, value = "/getAutoRiskCount") | |
59 | + @ResponseBody | |
60 | + @TokenRequired | |
61 | + public BaseResponse getAutoRiskCount( HttpServletRequest request) { | |
62 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
63 | + BaseResponse baseResponse = autoDiagnoseRiskFacade.getAutoRiskCount(loginState.getId()); | |
64 | + return baseResponse; | |
65 | + } | |
66 | + | |
67 | + | |
68 | + /** | |
54 | 69 | * 修改成确认状态 |
55 | 70 | * |
56 | 71 | * @param autoBabyRiskRecord |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FactorProjectController.java
View file @
e3ea6c2
... | ... | @@ -3,6 +3,7 @@ |
3 | 3 | import com.lyms.platform.common.annotation.TokenRequired; |
4 | 4 | import com.lyms.platform.common.base.BaseController; |
5 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
6 | +import com.lyms.platform.common.enums.ProjectWeekEnums; | |
6 | 7 | import com.lyms.platform.common.utils.ResultUtils; |
7 | 8 | import com.lyms.platform.common.utils.StringUtils; |
8 | 9 | import com.lyms.platform.operate.web.facade.BookbuildingFacade; |
... | ... | @@ -95,6 +96,13 @@ |
95 | 96 | ResultUtils.buildSuccessResultAndWrite(response); |
96 | 97 | } |
97 | 98 | |
99 | + @RequestMapping(value = "/getWeekList", method = RequestMethod.GET) | |
100 | + @TokenRequired | |
101 | + public void getWeekList(HttpServletResponse response){ | |
102 | + ResultUtils.buildSuccessResultAndWrite(response, ProjectWeekEnums.getWeekEnums()); | |
103 | + } | |
104 | + | |
105 | + | |
98 | 106 | @Autowired |
99 | 107 | private BookbuildingFacade bookbuildingFacade; |
100 | 108 | |
... | ... | @@ -135,6 +143,9 @@ |
135 | 143 | FactorProjectEntity factorProject= factorProjectService.selectByWeek(hospitalId,week); |
136 | 144 | ResultUtils.buildSuccessResultAndWrite(response,factorProject); |
137 | 145 | } |
146 | + | |
147 | + | |
148 | + | |
138 | 149 | |
139 | 150 | @RequestMapping(value = "/test", method = RequestMethod.GET) |
140 | 151 | public void test(HttpServletResponse response){ |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyAutoDiagnoseRiskFacade.java
View file @
e3ea6c2
... | ... | @@ -8,6 +8,7 @@ |
8 | 8 | import com.lyms.platform.common.enums.BabyAutoDiagnoseEnums; |
9 | 9 | import com.lyms.platform.common.enums.YnEnums; |
10 | 10 | import com.lyms.platform.common.result.BaseListResponse; |
11 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
11 | 12 | import com.lyms.platform.common.result.BaseResponse; |
12 | 13 | import com.lyms.platform.common.utils.DateUtil; |
13 | 14 | import com.lyms.platform.common.utils.ExceptionUtils; |
... | ... | @@ -119,6 +120,16 @@ |
119 | 120 | return new BaseListResponse().setData(riskList).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
120 | 121 | |
121 | 122 | } |
123 | + | |
124 | + public BaseResponse getAutoRiskCount(Integer userId) { | |
125 | + Query query = new Query(); | |
126 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
127 | + query.addCriteria(Criteria.where("hospitalId").is(hospitalId)); | |
128 | + query.addCriteria(Criteria.where("status").is(0)); | |
129 | + long count = mongoTemplate.count(query.with(new Sort(Sort.Direction.DESC, "created")), AutoBabyRiskRecord.class); | |
130 | + return new BaseObjectResponse().setData(count).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
131 | + } | |
132 | + | |
122 | 133 | |
123 | 134 | /** |
124 | 135 | * 儿童,自动判定高危因素 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
e3ea6c2
... | ... | @@ -795,6 +795,9 @@ |
795 | 795 | // createBuildSms(p); |
796 | 796 | |
797 | 797 | createBuildMsg(p); |
798 | + //发送产检录入 秦皇岛二院 | |
799 | + sendbuildingMsg(patient, SmsServiceEnums.FWKT.getId(), "【产检录入提醒】", "亲爱的孕妈妈,请点击小程序录入产检信息", ""); | |
800 | + | |
798 | 801 | } |
799 | 802 | |
800 | 803 | |
801 | 804 | |
... | ... | @@ -1144,13 +1147,12 @@ |
1144 | 1147 | } |
1145 | 1148 | } |
1146 | 1149 | } |
1147 | - //发送产检录入 秦皇岛二院 | |
1148 | - sendbuildingMsg(patient, SmsServiceEnums.FWKT.getId(), "【产检录入提醒】", "亲爱的孕妈妈,请点击小程序录入产检信息", ""); | |
1149 | 1150 | |
1150 | 1151 | } |
1151 | 1152 | |
1152 | 1153 | private void sendbuildingMsg(Patients patient, Integer subTypeId, String first, String keyWord1, String remark) { |
1153 | 1154 | if ("1000000016".equals(patient.getHospitalId())) { |
1155 | + logger.info("sendbuildingMsg startup"); | |
1154 | 1156 | List<MsgRequest> messages = new ArrayList<>(); |
1155 | 1157 | MsgRequest mr = new MsgRequest(); |
1156 | 1158 | mr.setPhone(patient.getPhone()); |
... | ... | @@ -1175,6 +1177,7 @@ |
1175 | 1177 | mr.setWxTempId(WxTempleteIdEnums.CHAN_JIAN_TI_XING.getId()); |
1176 | 1178 | messages.add(mr); |
1177 | 1179 | smsConfigFacade.saveMsg(messages, patient.getHospitalId()); |
1180 | + logger.info("sendbuildingMsg end"); | |
1178 | 1181 | } |
1179 | 1182 | } |
1180 | 1183 | |
... | ... | @@ -1184,6 +1187,7 @@ |
1184 | 1187 | * @param |
1185 | 1188 | */ |
1186 | 1189 | public void bookbuildingSync() { |
1190 | + logger.info("bookbuildingSync startup"); | |
1187 | 1191 | PatientsQuery patientsQuery = new PatientsQuery(); |
1188 | 1192 | patientsQuery.setHospitalId("1000000016"); |
1189 | 1193 | patientsQuery.setExtEnable(false); |
... | ... | @@ -1202,6 +1206,7 @@ |
1202 | 1206 | } |
1203 | 1207 | } |
1204 | 1208 | }).start(); |
1209 | + logger.info("bookbuildingSync end"); | |
1205 | 1210 | } |
1206 | 1211 | } |
1207 | 1212 | |
1208 | 1213 | |
1209 | 1214 | |
... | ... | @@ -1268,15 +1273,16 @@ |
1268 | 1273 | // 徐倩说改的 |
1269 | 1274 | if (patients.getBookbuildingDate().getTime() - patients.getDueDate().getTime() > 0 && patients.getBuildType() == 2) { |
1270 | 1275 | // if (patients.getBookbuildingDate().getTime() - patients.getFmDate().getTime() > 0 && patients.getBuildType() == 2) { |
1271 | - dueWeek = "已分娩"; | |
1276 | + dueWeek = ""; | |
1272 | 1277 | } else { |
1273 | 1278 | int days = DateUtil.daysBetween(patients.getLastMenses(), patients.getBookbuildingDate()); |
1274 | 1279 | if (days > 7 * 42 - 1) { |
1275 | - dueWeek = "已分娩"; | |
1280 | + dueWeek = ""; | |
1276 | 1281 | } else { |
1277 | - String week = (days / 7) + ""; | |
1278 | - int day = (days % 7); | |
1279 | - dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : ""); | |
1282 | + String week= days / 7+""; | |
1283 | + dueWeek = ProjectWeekEnums.getWeekName(week); | |
1284 | + /*int day = (days % 7); | |
1285 | + dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : "");*/ | |
1280 | 1286 | } |
1281 | 1287 | } |
1282 | 1288 | } catch (Exception e) { |