Commit 10d125ce356c488795cfda346795b33a8558d10c

Authored by jiangjiazhi
1 parent 3863658f2d

1

Showing 3 changed files with 74 additions and 3 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/PatientsService.java View file @ 10d125c
... ... @@ -147,10 +147,22 @@
147 147 }
148 148  
149 149 /**
150   - * 删除过期产筛的数据
  150 + * 删除过期产筛的数据,删掉自动到期的部分
  151 + *
151 152 */
152   - private void delSieve(){
153   -
  153 + public void delSieve(){
  154 + SieveQuery sieveQuery = new SieveQuery();
  155 + sieveQuery.setYn(YnEnums.YES.getId());
  156 + sieveQuery.setFrom("0");
  157 + Date endDate = DateUtil.addDay(new Date(), -146);
  158 + sieveQuery.setLastMensesStart(endDate);
  159 + List<SieveModel> list = sieveDao.queryList(sieveQuery.convertToQuery());
  160 + if(CollectionUtils.isNotEmpty(list)){
  161 + for(SieveModel sieveModel:list) {
  162 + sieveModel.setYn(YnEnums.NO.getId());
  163 + sieveDao.updateChanQianSieve(sieveModel);
  164 + }
  165 + }
154 166 }
155 167  
156 168 /**
platform-dal/src/main/java/com/lyms/platform/query/SieveQuery.java View file @ 10d125c
... ... @@ -5,6 +5,7 @@
5 5 import com.lyms.platform.common.dao.operator.MongoCondition;
6 6 import com.lyms.platform.common.dao.operator.MongoOper;
7 7 import com.lyms.platform.common.dao.operator.MongoQuery;
  8 +import org.springframework.data.mongodb.core.query.Criteria;
8 9  
9 10 import java.util.Date;
10 11  
11 12  
... ... @@ -47,9 +48,31 @@
47 48 //孕周结束
48 49 private Date dueWeekEnd;
49 50  
  51 + /**
  52 + * 末次月经
  53 + */
  54 + private Date lastMensesStart;
  55 +
  56 + /**
  57 + * 末次月经
  58 + */
  59 + private Date lastMensesEnd;
  60 +
  61 + public String getFrom() {
  62 + return from;
  63 + }
  64 +
  65 + public void setFrom(String from) {
  66 + this.from = from;
  67 + }
  68 +
50 69 //是否通知
51 70 private Integer isNotify;
52 71  
  72 + public Integer getRenShenResult() {
  73 + return renShenResult;
  74 + }
  75 +
53 76 public String getHospitalId() {
54 77 return hospitalId;
55 78 }
... ... @@ -98,6 +121,22 @@
98 121 this.status = status;
99 122 }
100 123  
  124 + public Date getLastMensesEnd() {
  125 + return lastMensesEnd;
  126 + }
  127 +
  128 + public void setLastMensesEnd(Date lastMensesEnd) {
  129 + this.lastMensesEnd = lastMensesEnd;
  130 + }
  131 +
  132 + public Date getLastMensesStart() {
  133 + return lastMensesStart;
  134 + }
  135 +
  136 + public void setLastMensesStart(Date lastMensesStart) {
  137 + this.lastMensesStart = lastMensesStart;
  138 + }
  139 +
101 140 @Override
102 141 public MongoQuery convertToQuery() {
103 142 MongoCondition condition = MongoCondition.newInstance();
... ... @@ -137,6 +176,23 @@
137 176 }
138 177 if (null != renShenResult) {
139 178 condition = condition.and("renShenResult", renShenResult, MongoOper.IS);
  179 + }
  180 + boolean isAddStart = Boolean.FALSE;
  181 + Criteria c = null;
  182 + if (null != lastMensesStart) {
  183 + c = Criteria.where("lastMenses").gte(lastMensesStart);
  184 + isAddStart = Boolean.TRUE;
  185 + }
  186 + if (null != lastMensesEnd) {
  187 + if (isAddStart) {
  188 + c = c.lte(lastMensesEnd);
  189 + } else {
  190 + c = Criteria.where("lastMenses").lte(lastMensesEnd);
  191 + }
  192 + isAddStart = Boolean.TRUE;
  193 + }
  194 + if (isAddStart) {
  195 + return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery();
140 196 }
141 197 return condition.toMongoQuery();
142 198 }
platform-data-api/src/main/java/com/lyms/platform/data/controller/TaskController.java View file @ 10d125c
... ... @@ -113,6 +113,9 @@
113 113 }else if("autoMatDeliver".equals(sid)){
114 114 patientsService.autoMatDeliver();
115 115 writeString(response, "success");
  116 + }else if("delSieve".equals(sid)){
  117 + patientsService.delSieve();
  118 + writeString(response, "success");
116 119 }
117 120  
118 121 else {