Commit 16a10c85d66913cd5e1a770b2e69db95a2bce8ec
1 parent
605e92a9e2
Exists in
master
and in
6 other branches
update
Showing 3 changed files with 31 additions and 11 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java
View file @
16a10c8
| ... | ... | @@ -339,8 +339,7 @@ |
| 339 | 339 | } |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | - public static Date yyyyMMParse(String time) | |
| 343 | - { | |
| 342 | + public static Date yyyyMMParse(String time) { | |
| 344 | 343 | Date date = null; |
| 345 | 344 | try { |
| 346 | 345 | date = yyyy_mm.parse(time); |
| ... | ... | @@ -429,8 +428,8 @@ |
| 429 | 428 | } |
| 430 | 429 | } |
| 431 | 430 | |
| 432 | - public static Date paseYMDH(String s){ | |
| 433 | - if(s == null){ | |
| 431 | + public static Date paseYMDH(String s) { | |
| 432 | + if (s == null) { | |
| 434 | 433 | return null; |
| 435 | 434 | } |
| 436 | 435 | lock.lock(); |
| ... | ... | @@ -444,8 +443,8 @@ |
| 444 | 443 | } |
| 445 | 444 | } |
| 446 | 445 | |
| 447 | - public static String getYMDH(Date d){ | |
| 448 | - if(d == null){ | |
| 446 | + public static String getYMDH(Date d) { | |
| 447 | + if (d == null) { | |
| 449 | 448 | return null; |
| 450 | 449 | } |
| 451 | 450 | lock.lock(); |
| 452 | 451 | |
| ... | ... | @@ -966,9 +965,9 @@ |
| 966 | 965 | months = months - 1; |
| 967 | 966 | } |
| 968 | 967 | } |
| 969 | - }catch (Exception e){ | |
| 968 | + } catch (Exception e) { | |
| 970 | 969 | e.printStackTrace(); |
| 971 | - }finally { | |
| 970 | + } finally { | |
| 972 | 971 | lock.unlock(); |
| 973 | 972 | } |
| 974 | 973 | return months; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TemporaryUserController.java
View file @
16a10c8
| ... | ... | @@ -8,10 +8,12 @@ |
| 8 | 8 | import com.lyms.platform.pojo.TemporaryUserModel; |
| 9 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | 10 | import org.springframework.stereotype.Controller; |
| 11 | -import org.springframework.web.bind.annotation.*; | |
| 11 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 12 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 13 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 14 | +import org.springframework.web.bind.annotation.ResponseBody; | |
| 12 | 15 | |
| 13 | 16 | import javax.servlet.http.HttpServletRequest; |
| 14 | -import javax.validation.Valid; | |
| 15 | 17 | |
| 16 | 18 | @Controller |
| 17 | 19 | @RequestMapping(value = "/temporary") |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TemporaryUserServiceImpl.java
View file @
16a10c8
| ... | ... | @@ -112,8 +112,27 @@ |
| 112 | 112 | } |
| 113 | 113 | PageResult pageResult = findMongoPage(TemporaryUserModel.class, new Query(criteria).with(new Sort(Sort.Direction.DESC, "modified")), page, limit); |
| 114 | 114 | List<TemporaryUserModel> bloodSugars = (List<TemporaryUserModel>) pageResult.getGrid(); |
| 115 | + List<Map> list = new ArrayList(); | |
| 116 | + for (TemporaryUserModel temporaryUser : bloodSugars) { | |
| 117 | + Map<String, Object> map = new HashMap<>(); | |
| 118 | + map.put("userName", temporaryUser.getUserName()); | |
| 119 | + map.put("birth", DateUtil.getAge(temporaryUser.getBirth(), new Date())); | |
| 120 | + map.put("phone", temporaryUser.getPhone()); | |
| 121 | + map.put("lastMenses", DateUtil.getWeekDesc(temporaryUser.getLastMenses(), new Date())); | |
| 122 | + map.put("beforeWeight", temporaryUser.getBeforeWeight()); | |
| 123 | + map.put("beforeHeight", temporaryUser.getBeforeHeight()); | |
| 124 | + map.put("nowWeight", temporaryUser.getNowWeight()); | |
| 125 | + map.put("cardID", temporaryUser.getCardID()); | |
| 126 | + map.put("riskFactorId", temporaryUser.getRiskFactorId()); | |
| 127 | + map.put("bregmatic", temporaryUser.getBirth()); | |
| 128 | + map.put("id", temporaryUser.getId()); | |
| 129 | + map.put("created", temporaryUser.getCreated()); | |
| 130 | + map.put("putOnRecordWeek", DateUtil.getWeek(temporaryUser.getLastMenses(), temporaryUser.getCreated())); | |
| 115 | 131 | |
| 116 | - pageResult.setGrid(bloodSugars); | |
| 132 | + list.add(map); | |
| 133 | + } | |
| 134 | + | |
| 135 | + pageResult.setGrid(list); | |
| 117 | 136 | return RespBuilder.buildSuccess(pageResult); |
| 118 | 137 | } |
| 119 | 138 |