Commit 33e09a525274911595b643db35c5c44c5cf1ea56

Authored by rui.zhang

Merge remote-tracking branch 'origin/master'

Showing 11 changed files

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IVisitDao.java View file @ 33e09a5
... ... @@ -16,7 +16,7 @@
16 16  
17 17 public VisitModel getVisit(String id);
18 18  
19   - public int queryPuerperaCount(MongoQuery query);
  19 + public int queryVisitCount(MongoQuery query);
20 20  
21 21 public List<VisitModel> queryVisit(MongoQuery query);
22 22  
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/VisitDaoImpl.java View file @ 33e09a5
... ... @@ -35,7 +35,7 @@
35 35 }
36 36  
37 37 @Override
38   - public int queryPuerperaCount(MongoQuery query) {
  38 + public int queryVisitCount(MongoQuery query) {
39 39 return (int) count(query.convertToMongoQuery());
40 40 }
41 41  
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/VisitService.java View file @ 33e09a5
... ... @@ -30,7 +30,7 @@
30 30 public List<VisitModel> queryVisit(VisitQuery visitQuery) {
31 31 MongoQuery query = visitQuery.convertToQuery();
32 32 if (StringUtils.isNotEmpty(visitQuery.getNeed())) {
33   - visitQuery.mysqlBuild(iVisitDao.queryPuerperaCount(visitQuery.convertToQuery()));
  33 + visitQuery.mysqlBuild(iVisitDao.queryVisitCount(visitQuery.convertToQuery()));
34 34 query.start(visitQuery.getOffset()).end(visitQuery.getLimit());
35 35 }
36 36  
... ... @@ -40,6 +40,9 @@
40 40  
41 41 public Page<VisitModel> queryVisitsAndPage(int start, int end) {
42 42 return iVisitDao.findPage(MongoCondition.newInstance().toMongoQuery().start(start).end(end).addOrder(Direction.ASC, "id"));
  43 + }
  44 + public int queryVisitCount(VisitQuery visitQuery){
  45 + return iVisitDao.queryVisitCount(visitQuery.convertToQuery());
43 46 }
44 47 }
platform-common/src/main/java/com/lyms/platform/common/constants/ConstantInterface.java View file @ 33e09a5
... ... @@ -6,6 +6,8 @@
6 6 public interface ConstantInterface {
7 7  
8 8 String SHORT_MESSAGE_PRE="【龙源美生】";
  9 +
  10 + String UN_VISIT="未访视";
9 11 //成功
10 12 int SUCCESS = 0;
11 13 //发送验证码失败
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyManagerFacade.java View file @ 33e09a5
... ... @@ -5,8 +5,7 @@
5 5 import java.util.List;
6 6 import java.util.Map;
7 7  
8   -import com.lyms.platform.biz.service.CommunityConfigService;
9   -import com.lyms.platform.biz.service.PatientsService;
  8 +import com.lyms.platform.biz.service.*;
10 9 import com.lyms.platform.common.utils.DateUtil;
11 10 import com.lyms.platform.common.utils.JsonUtil;
12 11 import com.lyms.platform.pojo.CommunityConfig;
... ... @@ -17,8 +16,6 @@
17 16 import org.springframework.beans.factory.annotation.Autowired;
18 17 import org.springframework.stereotype.Component;
19 18  
20   -import com.lyms.platform.biz.service.BabyService;
21   -import com.lyms.platform.biz.service.PuerperaService;
22 19 import com.lyms.platform.common.constants.ErrorCodeConstants;
23 20 import com.lyms.platform.common.enums.YnEnums;
24 21 import com.lyms.platform.common.result.BaseListResponse;
... ... @@ -43,6 +40,8 @@
43 40  
44 41 @Autowired
45 42 private BabyService babyService;
  43 + @Autowired
  44 + private VisitFacade visitFacade;
46 45  
47 46 /**
48 47 * 根据条件查询符合条件的新生儿
... ... @@ -55,8 +54,8 @@
55 54 PatientsQuery patientsQuery = new PatientsQuery();
56 55 patientsQuery.setType(2);
57 56 patientsQuery.setYn(YnEnums.YES.getId());
58   - patientsQuery.setBirthEnd(babyManagerRequest.getdEnd());
59   - patientsQuery.setBirthStart(babyManagerRequest.getdStart());
  57 + patientsQuery.setBirthEnd(DateUtil.parseYMD(babyManagerRequest.getdEnd()));
  58 + patientsQuery.setBirthStart(DateUtil.parseYMD(babyManagerRequest.getdStart()));
60 59 patientsQuery.setVisitstatus(babyManagerRequest.getVisitstatus());
61 60 patientsQuery.setPage(babyManagerRequest.getPage());
62 61 patientsQuery.setLimit(babyManagerRequest.getLimit());
... ... @@ -224,7 +223,8 @@
224 223 babyResult.setMotherName("母亲名字");
225 224 babyResult.setMotherPhone(patients.getPhone());
226 225 babyResult.setId(patients.getId());
227   - babyResult.setVisit(patients.getIsVisit() == 0 ? "未访视" : "已访视");
  226 + String tips= visitFacade.getFindTips(patients.getId());
  227 + babyResult.setVisit(tips);
228 228 babyResult.setVisitStatus(patients.getIsVisit());
229 229 return babyResult;
230 230 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ 33e09a5
... ... @@ -7,6 +7,7 @@
7 7 import com.lyms.platform.common.result.BaseListResponse;
8 8 import com.lyms.platform.common.result.BaseResponse;
9 9 import com.lyms.platform.common.utils.Assert;
  10 +import com.lyms.platform.common.utils.DateUtil;
10 11 import com.lyms.platform.operate.web.request.PuerperaManagerQueryRequest;
11 12 import com.lyms.platform.operate.web.request.PuerperaManagerUpdateRequest;
12 13 import com.lyms.platform.operate.web.request.PuerperaMatcherCommunityRequest;
... ... @@ -34,6 +35,8 @@
34 35 private PatientsService patientsService;
35 36 @Autowired
36 37 private CommunityConfigService communityConfigService;
  38 + @Autowired
  39 + private VisitFacade visitFacade;
37 40  
38 41  
39 42 /**
... ... @@ -75,8 +78,8 @@
75 78 PatientsQuery puerperaQuery = new PatientsQuery();
76 79 puerperaQuery.setLimit(managerRequest.getLimit());
77 80 puerperaQuery.setPage(managerRequest.getPage());
78   - puerperaQuery.setDueDateEnd(managerRequest.getDueDateEnd());
79   - puerperaQuery.setDueDateStart(managerRequest.getDueDateStart());
  81 + puerperaQuery.setDueDateEnd(DateUtil.parseYMD(managerRequest.getDueDateEnd()));
  82 + puerperaQuery.setDueDateStart(DateUtil.parseYMD(managerRequest.getDueDateStart()));
80 83 puerperaQuery.setKeyword(managerRequest.getKeyword());
81 84 puerperaQuery.setCommunityId(managerRequest.getCommunityId());
82 85 puerperaQuery.setVisitstatus(managerRequest.getVisitstatus());
... ... @@ -98,8 +101,8 @@
98 101 comm= communityConfig.getName();
99 102 }
100 103 }
101   -
102   - data.add(result.convertToResult(model,comm));
  104 + String tips= visitFacade.getFindTips(model.getId());
  105 + data.add(result.convertToResult(model,comm,tips));
103 106 }
104 107 }
105 108  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PuerperaManagerFacade.java View file @ 33e09a5
... ... @@ -7,6 +7,7 @@
7 7 import com.lyms.platform.common.result.BaseListResponse;
8 8 import com.lyms.platform.common.result.BaseResponse;
9 9 import com.lyms.platform.common.utils.Assert;
  10 +import com.lyms.platform.common.utils.DateUtil;
10 11 import com.lyms.platform.operate.web.request.PuerperaManagerQueryRequest;
11 12 import com.lyms.platform.operate.web.request.PuerperaManagerUpdateRequest;
12 13 import com.lyms.platform.operate.web.request.PuerperaMatcherCommunityRequest;
... ... @@ -71,8 +72,8 @@
71 72 PuerperaModelQuery puerperaQuery = new PuerperaModelQuery();
72 73 puerperaQuery.setLimit(managerRequest.getLimit());
73 74 puerperaQuery.setPage(managerRequest.getPage());
74   - puerperaQuery.setDueDateEnd(managerRequest.getDueDateEnd());
75   - puerperaQuery.setDueDateStart(managerRequest.getDueDateStart());
  75 + puerperaQuery.setDueDateEnd(DateUtil.parseYMD(managerRequest.getDueDateEnd()));
  76 + puerperaQuery.setDueDateStart(DateUtil.parseYMD(managerRequest.getDueDateStart()));
76 77 puerperaQuery.setKeyword(managerRequest.getKeyword());
77 78 puerperaQuery.setCommunityId(managerRequest.getCommunityId());
78 79 puerperaQuery.setVisitstatus(managerRequest.getVisitstatus());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java View file @ 33e09a5
1 1 package com.lyms.platform.operate.web.facade;
2 2  
3   -import java.util.ArrayList;
4   -import java.util.List;
5   -
6 3 import com.lyms.platform.biz.service.*;
7   -import com.lyms.platform.pojo.*;
8   -import com.lyms.platform.query.PatientsQuery;
9   -import org.apache.commons.collections.CollectionUtils;
10   -import org.apache.commons.lang.StringUtils;
11   -import org.springframework.beans.factory.annotation.Autowired;
12   -import org.springframework.stereotype.Component;
13   -
14 4 import com.lyms.platform.common.constants.ErrorCodeConstants;
15 5 import com.lyms.platform.common.enums.YnEnums;
16 6 import com.lyms.platform.common.result.BaseObjectResponse;
17 7  
18 8  
19 9  
20 10  
... ... @@ -22,13 +12,24 @@
22 12 import com.lyms.platform.operate.web.result.BabyVisitResult.BabyVisit;
23 13 import com.lyms.platform.operate.web.result.SimpleVisit;
24 14 import com.lyms.platform.operate.web.result.VisitResult;
  15 +import com.lyms.platform.pojo.BabyModel;
  16 +import com.lyms.platform.pojo.BabyVisitModel;
  17 +import com.lyms.platform.pojo.Patients;
  18 +import com.lyms.platform.pojo.VisitModel;
25 19 import com.lyms.platform.query.BabyModelQuery;
26   -import com.lyms.platform.query.PuerperaModelQuery;
  20 +import com.lyms.platform.query.PatientsQuery;
27 21 import com.lyms.platform.query.VisitQuery;
  22 +import org.apache.commons.collections.CollectionUtils;
  23 +import org.apache.commons.lang.StringUtils;
  24 +import org.springframework.beans.factory.annotation.Autowired;
  25 +import org.springframework.stereotype.Component;
28 26  
  27 +import java.util.ArrayList;
  28 +import java.util.List;
  29 +
29 30 /**
30 31 * 产后访视门面
31   - *
  32 + *
32 33 * @author Administrator
33 34 */
34 35 @Component
... ... @@ -50,7 +51,7 @@
50 51  
51 52 /**
52 53 * 根据产妇id获取产妇的访视信息
53   - *
  54 + *
54 55 * @param id
55 56 * @return
56 57 */
57 58  
... ... @@ -60,13 +61,12 @@
60 61  
61 62 /**
62 63 * 根据产妇身份证号获取产妇访视记录
63   - *
64   - * @param cardNo
65   - * 身份证号
  64 + *
  65 + * @param cardNo 身份证号
66 66 * @return
67 67 */
68 68 public BaseObjectResponse findOneByCardNo(String cardNo) {
69   - Patients puerperaModel= findOnePuerperaByCardNo(cardNo);
  69 + Patients puerperaModel = findOnePuerperaByCardNo(cardNo);
70 70 if (null == puerperaModel) {
71 71 return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.DEPT_NOT_EXISTS).setErrormsg("产妇信息不存在");
72 72 }
... ... @@ -75,7 +75,7 @@
75 75  
76 76 /**
77 77 * 构建产妇的访视记录信息
78   - *
  78 + *
79 79 * @param puerperaModel
80 80 * @return
81 81 */
... ... @@ -101,9 +101,8 @@
101 101  
102 102 /**
103 103 * 根据身份证号码获取产妇信息
104   - *
105   - * @param cardNo
106   - * 身份证号码
  104 + *
  105 + * @param cardNo 身份证号码
107 106 * @return 产妇信息
108 107 */
109 108 private Patients findOnePuerperaByCardNo(String cardNo) {
... ... @@ -118,9 +117,8 @@
118 117  
119 118 /**
120 119 * 增加产妇访视记录
121   - *
122   - * @param visitRequest
123   - * 产妇访视记录请求
  120 + *
  121 + * @param visitRequest 产妇访视记录请求
124 122 * @return 返回结果
125 123 */
126 124 public BaseResponse addOneVisit(VisitAddRequest visitRequest) {
... ... @@ -148,7 +146,7 @@
148 146 } else {
149 147 // 表示是新的产妇直接新增
150 148 // parentId = puerperaService.addPuerpera(visitRequest.getPuerpera().build()).getId();
151   - parentId =patientsService.addPatient(visitRequest.getPatients()).getId();
  149 + parentId = patientsService.addPatient(visitRequest.getPatients()).getId();
152 150 }
153 151  
154 152 // 如果为空表示新增
... ... @@ -165,7 +163,7 @@
165 163  
166 164 /**
167 165 * 增加一条小孩的访视记录
168   - *
  166 + *
169 167 * @param babyVisitAddRequest
170 168 * @return
171 169 */
172 170  
... ... @@ -187,11 +185,19 @@
187 185 return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
188 186 }
189 187  
  188 + public String getFindTips(String parentId) {
  189 + VisitQuery visitQuery = new VisitQuery();
  190 + visitQuery.setParentId(parentId);
  191 +
  192 + int count = visitService.queryVisitCount(visitQuery);
  193 +
  194 + return count <= 0 ? "未访视" : "访视" + count + "次";
  195 + }
  196 +
190 197 /**
191 198 * 根据产妇的身份证号码获取小孩的访视记录
192   - *
193   - * @param cardNo
194   - * 产妇身份证号码
  199 + *
  200 + * @param cardNo 产妇身份证号码
195 201 */
196 202 public BaseObjectResponse findBabyVisitByMotherCardNo(String cardNo) {
197 203 // 根据身份证号获取到产妇信息
198 204  
199 205  
200 206  
... ... @@ -203,18 +209,18 @@
203 209 }
204 210  
205 211 private BaseObjectResponse findBabyVisit(Patients puerperaModel) {
206   - BabyModelQuery babyQuery = new BabyModelQuery();
  212 + BabyModelQuery babyQuery = new BabyModelQuery();
207 213 babyQuery.setParentId(puerperaModel.getId());
208 214 babyQuery.setYn(YnEnums.YES.getId());
209   - List<BabyModel> babies= babyService.queryBabyWithQuery(babyQuery);
  215 + List<BabyModel> babies = babyService.queryBabyWithQuery(babyQuery);
210 216 BabyVisitResult babyVisitResult = new BabyVisitResult();
211 217 List<BabyVisitResult.BabyVisit> data = new ArrayList<BabyVisitResult.BabyVisit>();
212   - for(BabyModel bModel:babies){
213   - // 根据产妇id查询该产妇下的小孩访视
  218 + for (BabyModel bModel : babies) {
  219 + // 根据产妇id查询该产妇下的小孩访视
214 220 List<BabyVisitModel> babyVisits = babyVisitService.findAllVisitByParentId(bModel.getId());
215 221  
216 222 // 数据转换
217   -
  223 +
218 224 for (BabyVisitModel visit : babyVisits) {
219 225 BabyVisit babyVisit = babyVisitResult.new BabyVisit();
220 226 // 转换小孩的访视数据
... ... @@ -231,7 +237,7 @@
231 237  
232 238 /**
233 239 * 根据小孩id查询
234   - *
  240 + *
235 241 * @param babyId
236 242 * @return
237 243 */
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/BabyManagerQueryRequest.java View file @ 33e09a5
... ... @@ -21,7 +21,7 @@
21 21 /**
22 22 * 关键字查询
23 23 */
24   - @FormParam
  24 + @FormParam("keywords")
25 25 private String keyword;
26 26  
27 27 /**
28 28  
... ... @@ -34,13 +34,13 @@
34 34 * 生日开始
35 35 */
36 36 @FormParam("dstart")
37   - private Date dStart;
  37 + private String dStart;
38 38  
39 39 /**
40 40 * 生日结束
41 41 */
42 42 @FormParam("dend")
43   - private Date dEnd;
  43 + private String dEnd;
44 44  
45 45 public String getKeyword() {
46 46 return keyword;
47 47  
48 48  
49 49  
... ... @@ -58,20 +58,20 @@
58 58 this.visitstatus = visitstatus;
59 59 }
60 60  
61   - public Date getdStart() {
  61 + public String getdStart() {
62 62 return dStart;
63 63 }
64 64  
65   - public void setdStart(long dStart) {
66   - this.dStart = new Date(dStart * 1000);
  65 + public void setdStart(String dStart) {
  66 + this.dStart = dStart;
67 67 }
68 68  
69   - public Date getdEnd() {
  69 + public String getdEnd() {
70 70 return dEnd;
71 71 }
72 72  
73   - public void setdEnd(long dEnd) {
74   - this.dEnd = new Date(dEnd * 1000);
  73 + public void setdEnd(String dEnd) {
  74 + this.dEnd = dEnd;
75 75 }
76 76  
77 77 public void setPage(int page) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/PuerperaManagerQueryRequest.java View file @ 33e09a5
... ... @@ -21,7 +21,7 @@
21 21 /**
22 22 * 关键字查询
23 23 */
24   - @FormParam
  24 + @FormParam("keywords")
25 25 private String keyword;
26 26  
27 27 /**
28 28  
... ... @@ -40,13 +40,13 @@
40 40 * 分娩日期开始
41 41 */
42 42 @FormParam("duedatestart")
43   - private Date dueDateStart;
  43 + private String dueDateStart;
44 44  
45 45 /**
46 46 * 分娩日期结束
47 47 */
48 48 @FormParam("duedateend")
49   - private Date dueDateEnd;
  49 + private String dueDateEnd;
50 50  
51 51 public String getCommunityId() {
52 52 return communityId;
53 53  
54 54  
55 55  
... ... @@ -72,20 +72,20 @@
72 72 this.visitstatus = visitstatus;
73 73 }
74 74  
75   - public Date getDueDateStart() {
  75 + public String getDueDateStart() {
76 76 return dueDateStart;
77 77 }
78 78  
79   - public void setDueDateStart(long dueDateStart) {
80   - this.dueDateStart = new Date(dueDateStart * 1000);
  79 + public void setDueDateStart(String dueDateStart) {
  80 + this.dueDateStart =dueDateStart;
81 81 }
82 82  
83   - public Date getDueDateEnd() {
  83 + public String getDueDateEnd() {
84 84 return dueDateEnd;
85 85 }
86 86  
87   - public void setDueDateEnd(long dueDateEnd) {
88   - this.dueDateEnd = new Date(dueDateEnd * 1000);
  87 + public void setDueDateEnd(String dueDateEnd) {
  88 + this.dueDateEnd = dueDateEnd;
89 89 }
90 90 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PuerperaResult.java View file @ 33e09a5
... ... @@ -127,7 +127,7 @@
127 127 return this;
128 128 }
129 129  
130   - public PuerperaResult convertToResult(Patients model,String comm) {
  130 + public PuerperaResult convertToResult(Patients model,String comm,String tips) {
131 131 String addr = "";
132 132 if (StringUtils.isNotEmpty(model.getAddress())) {
133 133 try {
... ... @@ -140,7 +140,7 @@
140 140 setAddress(addr);
141 141 setId(model.getId());
142 142 setDueDate(DateUtil.getyyyy_MM_dd(model.getDueDate()));
143   - setVisit(model.getIsVisit() == 0 ? "未访视" : "已访视");
  143 + setVisit(tips);
144 144 setCommunityId(StringUtils.isEmpty(model.getCommunityId()) ? "" : model.getCommunityId());
145 145 setCommunity(comm);
146 146 setPhone(model.getPhone());