Commit 34c945fdbbc4cc8073adf28ecca1ba5dbc84c8c6
1 parent
366a4e7af3
Exists in
master
and in
6 other branches
逗号改括号
Showing 5 changed files with 56 additions and 3 deletions
- platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
- platform-dal/src/main/java/com/lyms/platform/pojo/PatientWeight.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/ResolveUtils.java
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
34c945f
... | ... | @@ -1366,6 +1366,20 @@ |
1366 | 1366 | return result; |
1367 | 1367 | } |
1368 | 1368 | |
1369 | + /** | |
1370 | + * 获取近xx天的时间 | |
1371 | + */ | |
1372 | + public static List<String> getBetweenDay(int size) { | |
1373 | + List<String> restList = new ArrayList<>(); | |
1374 | + Calendar calendar = Calendar.getInstance(); | |
1375 | + restList.add(getyyyy_MM_dd(calendar.getTime())); | |
1376 | + for (int i = 1; i < size; i++) { | |
1377 | + calendar.add(Calendar.DAY_OF_MONTH, -1); | |
1378 | + restList.add(getyyyy_MM_dd(calendar.getTime())); | |
1379 | + } | |
1380 | + return restList; | |
1381 | + } | |
1382 | + | |
1369 | 1383 | public static void main(String[] args) { |
1370 | 1384 | /* List<Map<String, Date>> monthBetween = getRange(parseYMD("2017-1-11"), parseYMD("2017-3-11")); |
1371 | 1385 | for (Map<String, Date> map : monthBetween) { |
... | ... | @@ -1391,6 +1405,7 @@ |
1391 | 1405 | System.out.println("当前年的最后一天: " + getYear(date, 0, 0).toLocaleString()); |
1392 | 1406 | System.out.println("上一年的第一天: " + getYear(date, -1, 1).toLocaleString()); |
1393 | 1407 | System.out.println("上一年的最后一天: " + getYear(date, -1, 0).toLocaleString()); |
1408 | + System.out.println(getBetweenDay(7)); | |
1394 | 1409 | } |
1395 | 1410 | |
1396 | 1411 | } |
platform-dal/src/main/java/com/lyms/platform/pojo/PatientWeight.java
View file @
34c945f
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | import com.lyms.platform.beans.SerialIdEnum; |
4 | 4 | import com.lyms.platform.common.result.BaseModel; |
5 | +import org.springframework.data.annotation.Transient; | |
5 | 6 | import org.springframework.data.mongodb.core.mapping.Document; |
6 | 7 | |
7 | 8 | import java.util.*; |
... | ... | @@ -11,6 +12,17 @@ |
11 | 12 | */ |
12 | 13 | @Document(collection="lyms_patient_weight") |
13 | 14 | public class PatientWeight extends BaseModel { |
15 | + | |
16 | + @Transient | |
17 | + private List<Map<String, Object>> weightInfo; | |
18 | + | |
19 | + public List<Map<String, Object>> getWeightInfo() { | |
20 | + return weightInfo; | |
21 | + } | |
22 | + | |
23 | + public void setWeightInfo(List<Map<String, Object>> weightInfo) { | |
24 | + this.weightInfo = weightInfo; | |
25 | + } | |
14 | 26 | |
15 | 27 | private String hospitalName; |
16 | 28 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
34c945f
... | ... | @@ -235,7 +235,7 @@ |
235 | 235 | map.put("serviceStatus", ServiceStatusEnums.getNameById(data.getServiceStatus())); |
236 | 236 | |
237 | 237 | //建档孕周 |
238 | - map.put("buildDueWeek", ResolveUtils.getPregnancyWeek(data, data.getBookbuildingDate())); | |
238 | + map.put("buildDueWeek", ResolveUtils.getPregnancyWeek3(data, data.getBookbuildingDate())); | |
239 | 239 | |
240 | 240 | map.put("fuckLastMensWeek", ResolveUtils.getPregnancyWeek2(data, data.getBookbuildingDate())); |
241 | 241 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java
View file @
34c945f
... | ... | @@ -296,6 +296,14 @@ |
296 | 296 | public BaseResponse edit(String id) { |
297 | 297 | PatientWeight patientWeight = mongoTemplate.findById(id, PatientWeight.class); |
298 | 298 | patientWeight.setHospitalName(couponMapper.getHospitalName(patientWeight.getHospitalId())); |
299 | + List<Map<String, Object>> weightInfo = new ArrayList<>(); | |
300 | + List<String> betweenDay = DateUtil.getBetweenDay(7); | |
301 | + for (String day : betweenDay) { | |
302 | + | |
303 | + } | |
304 | + for (Map<String, Object> map : patientWeight.getDayWeights2()) { | |
305 | + | |
306 | + } | |
299 | 307 | return RespBuilder.buildSuccess(patientWeight); |
300 | 308 | } |
301 | 309 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/ResolveUtils.java
View file @
34c945f
... | ... | @@ -383,13 +383,31 @@ |
383 | 383 | return dueWeek; |
384 | 384 | } |
385 | 385 | |
386 | + public static String getPregnancyWeek3(Patients patients,Date date){ | |
387 | + String dueWeek=""; | |
388 | + if (null != patients.getDueStatus() && patients.getDueStatus() != null && 1 == patients.getDueStatus()) { | |
389 | + dueWeek = "终止妊娠"; | |
390 | + } else { | |
391 | + if (null != patients.getLastMenses()) { | |
392 | + int days = 0; | |
393 | + if(patients.getFuckLastMens() != null) { | |
394 | + days = DateUtil.daysBetween(patients.getFuckLastMens(), date); | |
395 | + } else { | |
396 | + days = DateUtil.daysBetween(patients.getLastMenses(), date); | |
397 | + } | |
398 | + dueWeek = com.lyms.platform.common.utils.StringUtils.dueWeek(days); | |
399 | + } | |
400 | + } | |
401 | + return dueWeek; | |
402 | + } | |
403 | + | |
386 | 404 | public static String getPregnancyWeek2(Patients patients,Date date){ |
387 | 405 | String dueWeek=""; |
388 | 406 | if (null != patients.getDueStatus() && patients.getDueStatus() != null && 1 == patients.getDueStatus()) { |
389 | 407 | dueWeek = "终止妊娠"; |
390 | - } else if (patients.getType() != null && 3 == patients.getType()) { | |
408 | + }/* else if (patients.getType() != null && 3 == patients.getType()) { | |
391 | 409 | dueWeek = "已分娩"; |
392 | - } else { | |
410 | + }*/ else { | |
393 | 411 | if (null != patients.getLastMenses()) { |
394 | 412 | if(patients.getFuckLastMens() == null) { |
395 | 413 | return ""; |