Commit 23e7560007a8df02ebd0b3ae07554c7666393020

Authored by jiangjiazhi
1 parent a4e2b4c2b9

增加设置parentid

Showing 5 changed files with 62 additions and 23 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/ISieveDao.java View file @ 23e7560
... ... @@ -20,6 +20,13 @@
20 20 SieveResultModel addSieveResult(SieveResultModel sieveResultModel);
21 21  
22 22 /**
  23 + * 根据id删除数据
  24 + *
  25 + * @param mongoQuery
  26 + */
  27 + void deleteById(MongoQuery mongoQuery);
  28 +
  29 + /**
23 30 * 根据id查询产筛结果
24 31 *
25 32 * @param id
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/SieveDaoImpl.java View file @ 23e7560
... ... @@ -28,6 +28,15 @@
28 28 }
29 29  
30 30 /**
  31 + * 根据id删除数据
  32 + *
  33 + * @param mongoQuery
  34 + */
  35 + public void deleteById(MongoQuery mongoQuery) {
  36 + super.delete(mongoQuery.convertToMongoQuery());
  37 + }
  38 +
  39 + /**
31 40 * 根据id查询产筛结果
32 41 *
33 42 * @param id
34 43  
... ... @@ -64,13 +73,14 @@
64 73 Assert.notNull(sieveQuery, "execute find method query must not null.");
65 74 return mongoTemplate.find(sieveQuery.convertToMongoQuery(), SieveModel.class);
66 75 }
  76 +
67 77 /**
68 78 * 查询产筛列表
69 79 *
70 80 * @param sieveQuery
71 81 * @return
72 82 */
73   - public List<SieveResultModel> queryListSieveResult(MongoQuery sieveQuery){
  83 + public List<SieveResultModel> queryListSieveResult(MongoQuery sieveQuery) {
74 84 return find(sieveQuery.convertToMongoQuery());
75 85 }
76 86 }
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java View file @ 23e7560
... ... @@ -190,13 +190,14 @@
190 190 }
191 191 }
192 192 /**
193   - * 孕妇建档时调用的方法
  193 + * 孕妇建档时调用的方法或者修改末次月经后调用
194 194 *
195 195 * @param patients
196 196 */
197 197 public void validata(Patients patients) {
198 198 if (null != patients && null != patients.getLastMenses()) {
199 199 int days = DateUtil.daysBetween(patients.getLastMenses(), new Date());
  200 + //判断是否在区间
200 201 if (days >= 108 && days <= 146) {
201 202 SieveQuery sieveQuery = new SieveQuery();
202 203 sieveQuery.setYn(YnEnums.YES.getId());
203 204  
... ... @@ -206,7 +207,22 @@
206 207 SieveModel sieveModel = convertToModel(patients);
207 208 sieveModel.setFrom("1");
208 209 sieveDao.addChanQianSieve(sieveModel);
  210 + }else{
  211 + //修改孕妇基本信息
  212 + for(SieveModel sieveModel:list){
  213 + sieveModel.setPhone(patients.getPhone());
  214 + sieveModel.setName(patients.getUsername());
  215 + sieveModel.setLastMenses(patients.getLastMenses());
  216 + sieveModel.setDueWeek(com.lyms.platform.common.utils.StringUtils.dueWeek(days));
  217 + sieveDao.updateChanQianSieve(sieveModel);
  218 + }
209 219 }
  220 + }else{
  221 + //修改孕妇末次月经不满足条件删除产筛数据
  222 + SieveQuery sieveQuery = new SieveQuery();
  223 + sieveQuery.setYn(YnEnums.YES.getId());
  224 + sieveQuery.setParentId(patients.getId());
  225 + sieveDao.deleteById(sieveQuery.convertToQuery());
210 226 }
211 227 }
212 228 }
... ... @@ -215,11 +231,7 @@
215 231 SieveModel sieveModel = new SieveModel();
216 232 sieveModel.setParentId(patients.getId());
217 233 sieveModel.setLastMenses(patients.getLastMenses());
218   - /* int days = DateUtil.daysBetween(patients.getLastMenses(), new Date());
219   - String week = (days / 7) + "";
220   - int day = (days % 7);
221   - String dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : "");*/
222   -// sieveModel.setDueWeek(dueWeek);
  234 +
223 235 AntExQuery antExQuery = new AntExQuery();
224 236 antExQuery.setYn(YnEnums.YES.getId());
225 237 antExQuery.setNeed("1");
platform-dal/src/main/java/com/lyms/platform/query/ReferralApplyOrderQuery.java View file @ 23e7560
... ... @@ -44,6 +44,7 @@
44 44 private String rLevel;
45 45 private Integer score;
46 46 private String riskFactor;
  47 + private String hospitalName;
47 48 //转入医院
48 49 private String transferredHospital;
49 50 private String outHospitalId;
50 51  
... ... @@ -52,7 +53,14 @@
52 53 //体验会员 0非会员 1会员
53 54 private Integer expVip;
54 55  
  56 + public String getHospitalName() {
  57 + return hospitalName;
  58 + }
55 59  
  60 + public void setHospitalName(String hospitalName) {
  61 + this.hospitalName = hospitalName;
  62 + }
  63 +
56 64 public Integer getExpVip() {
57 65 return expVip;
58 66 }
59 67  
... ... @@ -154,15 +162,11 @@
154 162 if(null!=expVip){
155 163 condition=condition.and("expVip",expVip, MongoOper.IS);
156 164 }
157   - if(null!=transferredHospital){
158   - condition=condition.and("transferredHospital",transferredHospital, MongoOper.IS);
159   - }
  165 +
160 166 if(null!=phone){
161 167 condition=condition.and("phone",phone, MongoOper.IS);
162 168 }
163   - if(null!=outHospitalId){
164   - condition=condition.and("outHospitalId",outHospitalId, MongoOper.IS);
165   - }
  169 +
166 170 //需要修改
167 171 if(null!=dueDateEnd){
168 172 condition=condition.and("dueWeek",dueDateEnd, MongoOper.IS);
... ... @@ -181,6 +185,18 @@
181 185 }
182 186 if(null!=type){
183 187 condition=condition.and("type",type, MongoOper.IS);
  188 + }
  189 +
  190 + if(null!=transferredHospital){
  191 + if(null!=hospitalName){
  192 + MongoCondition mongoCondition= MongoCondition.newInstance("hospitalName",hospitalName,MongoOper.IS);
  193 + MongoCondition mongoCondition1= MongoCondition.newInstance("transferredHospital",transferredHospital, MongoOper.IS);
  194 + condition=condition.andCondition(mongoCondition.orCondition(mongoCondition1));
  195 + }
  196 + }
  197 + if(null!=outHospitalId){
  198 +
  199 + condition=condition.and("outHospitalId",outHospitalId, MongoOper.IS);
184 200 }
185 201 return condition.toMongoQuery();
186 202 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java View file @ 23e7560
... ... @@ -257,18 +257,13 @@
257 257 referralApplyOrderQuery.setName(applyOrderQueryRequest.getName());
258 258 referralApplyOrderQuery.setCardNo(applyOrderQueryRequest.getCardNo());
259 259 referralApplyOrderQuery.setPhone(applyOrderQueryRequest.getPhone());
260   -
  260 + String hospital=autoMatchFacade.getHospitalId(userId);
  261 + referralApplyOrderQuery.setHospitalName(organizationService.getOrganization(Integer.valueOf(hospital)).getName());
261 262 //1 转入 0转出
262 263 if ("1".equals(applyOrderQueryRequest.getAction())) {
263   - List data = autoMatchFacade.matchOrgId(userId);
264   - if (CollectionUtils.isNotEmpty(data)) {
265   - referralApplyOrderQuery.setTransferredHospital(data.get(0) + "");
266   - }
  264 + referralApplyOrderQuery.setTransferredHospital(hospital);
267 265 } else if ("0".equals(applyOrderQueryRequest.getAction())) {
268   - List data = autoMatchFacade.matchOrgId(userId);
269   - if (CollectionUtils.isNotEmpty(data)) {
270   - referralApplyOrderQuery.setOutHospitalId(data.get(0) + "");
271   - }
  266 + referralApplyOrderQuery.setOutHospitalId(hospital);
272 267 }
273 268 if(null!=applyOrderQueryRequest.getTyVip() &&Boolean.TRUE.equals(applyOrderQueryRequest.getTyVip())){
274 269 referralApplyOrderQuery.setExpVip(1);
... ... @@ -278,7 +273,6 @@
278 273 if (CollectionUtils.isNotEmpty(orderModels)) {
279 274 for (ReferralApplyOrderModel applyOrderModel : orderModels) {
280 275 BabyApplyOrderResult babyApplyOrderResult = new BabyApplyOrderResult();
281   -
282 276 String zhuanchu = applyOrderModel.getOutHospitalId();
283 277 Organization zhuanc = organizationService.getOrganization(Integer.valueOf(zhuanchu));
284 278 String zhuanCName = "";