Commit 29583e0f9f6f092002a7e87a1334c16d8feb31a0

Authored by rui.zhang
1 parent fd7ab88fe4

bug fix

Showing 2 changed files with 26 additions and 4 deletions

platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java View file @ 29583e0
... ... @@ -26,6 +26,7 @@
26 26  
27 27 private String mphone;
28 28 private String mname;
  29 + private String communityId;
29 30  
30 31 public String getMname() {
31 32 return mname;
... ... @@ -35,6 +36,14 @@
35 36 this.mname = mname;
36 37 }
37 38  
  39 + public String getCommunityId() {
  40 + return communityId;
  41 + }
  42 +
  43 + public void setCommunityId(String communityId) {
  44 + this.communityId = communityId;
  45 + }
  46 +
38 47 public String getMphone() {
39 48 return mphone;
40 49 }
... ... @@ -53,6 +62,7 @@
53 62 this.areaId = areaId;
54 63 }
55 64  
  65 +
56 66 /**
57 67 * 母亲的id
58 68 */
... ... @@ -161,7 +171,9 @@
161 171 if (null != areaId) {
162 172 condition = condition.and("areaId", areaId, MongoOper.IS);
163 173 }
164   -
  174 + if(null!=communityId){
  175 + condition=condition.and("communityId",communityId,MongoOper.IS);
  176 + }
165 177 if (null != keyword) {
166 178 if (null != keyword) {
167 179 MongoCondition con1 = MongoCondition.newInstance("mphone", "^"+keyword, MongoOper.LIKE);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CommunityConfigController.java View file @ 29583e0
1 1 package com.lyms.platform.operate.web.controller;
2 2  
3 3 import com.lyms.platform.biz.param.CommunityQuery;
4   -import com.lyms.platform.biz.service.BasicConfigService;
5   -import com.lyms.platform.biz.service.CommunityConfigService;
6   -import com.lyms.platform.biz.service.PatientsService;
  4 +import com.lyms.platform.biz.service.*;
7 5 import com.lyms.platform.common.annotation.TokenRequired;
8 6 import com.lyms.platform.common.base.BaseController;
9 7 import com.lyms.platform.common.base.LoginContext;
10 8  
... ... @@ -17,7 +15,9 @@
17 15 import com.lyms.platform.pojo.BasicConfig;
18 16 import com.lyms.platform.pojo.CommunityConfig;
19 17 import com.lyms.platform.pojo.Patients;
  18 +import com.lyms.platform.query.BabyModelQuery;
20 19 import com.lyms.platform.query.PatientsQuery;
  20 +import com.lyms.platform.query.VisitQuery;
21 21 import org.springframework.beans.factory.annotation.Autowired;
22 22 import org.springframework.stereotype.Controller;
23 23 import org.springframework.web.bind.annotation.*;
... ... @@ -42,6 +42,8 @@
42 42 private BasicConfigService basicConfigService;
43 43 @Autowired
44 44 private AutoMatchFacade autoMatchFacade;
  45 + @Autowired
  46 + private BabyService babyService;
45 47  
46 48  
47 49 //添加管辖区域
... ... @@ -171,6 +173,14 @@
171 173 List<Patients> q = patientsService.queryPatient(patientsQuery);
172 174 if (0 < q.size()) {
173 175 return new BaseResponse().setErrorcode(ErrorCodeConstants.DONT_DELETE).setErrormsg("该社区下有产妇数据不能删除!");
  176 + }
  177 +
  178 + BabyModelQuery babyModelQuery = new BabyModelQuery();
  179 + babyModelQuery.setYn(YnEnums.YES.getId());
  180 + babyModelQuery.setCommunityId(id);
  181 + Integer count = babyService.queryBabyCount(babyModelQuery);
  182 + if (0 < count) {
  183 + return new BaseResponse().setErrorcode(ErrorCodeConstants.DONT_DELETE).setErrormsg("该社区下有婴儿数据不能删除!");
174 184 }
175 185  
176 186 CommunityConfig communityConfig = new CommunityConfig();