Commit 657d9997aa1e6b547786939c56ecf056db6cd1e4

Authored by jiangjiazhi
1 parent 927d0ac38a

增加设置parentid

Showing 5 changed files with 74 additions and 38 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/ReferralApplyOrderModel.java View file @ 657d999
... ... @@ -28,8 +28,8 @@
28 28 private String phone;
29 29 //生日
30 30 private Date birth;
31   - //申请孕周、申请月龄
32   - private String dueWeek;
  31 + //申请孕周、申请月龄(多少天)
  32 + private Integer dueWeek;
33 33  
34 34 //身份证号
35 35 private String cardNo;
36 36  
... ... @@ -106,11 +106,11 @@
106 106 this.expVip = expVip;
107 107 }
108 108  
109   - public String getDueWeek() {
  109 + public Integer getDueWeek() {
110 110 return dueWeek;
111 111 }
112 112  
113   - public void setDueWeek(String dueWeek) {
  113 + public void setDueWeek(Integer dueWeek) {
114 114 this.dueWeek = dueWeek;
115 115 }
116 116  
platform-dal/src/main/java/com/lyms/platform/query/ReferralApplyOrderQuery.java View file @ 657d999
... ... @@ -41,9 +41,9 @@
41 41 //年龄
42 42 private String age;
43 43 //孕周
44   - private String dueDateStart;
  44 + private Integer dueDateStart;
45 45 //孕周
46   - private Date dueDateEnd;
  46 + private Integer dueDateEnd;
47 47 //风险等级
48 48 private String rLevel;
49 49 private Integer scoreStart;
... ... @@ -79,9 +79,6 @@
79 79 */
80 80 private Date lastMensesEnd;
81 81  
82   - public void setDueDateStart(String dueDateStart) {
83   - this.dueDateStart = dueDateStart;
84   - }
85 82  
86 83 public Integer getScoreEnd() {
87 84 return scoreEnd;
88 85  
89 86  
90 87  
... ... @@ -211,15 +208,22 @@
211 208 this.id = id;
212 209 }
213 210  
214   - public Date getDueDateEnd() {
  211 + public Integer getDueDateEnd() {
215 212 return dueDateEnd;
216 213 }
217 214  
218   - public void setDueDateEnd(Date dueDateEnd) {
  215 + public void setDueDateEnd(Integer dueDateEnd) {
219 216 this.dueDateEnd = dueDateEnd;
220 217 }
221 218  
  219 + public Integer getDueDateStart() {
  220 + return dueDateStart;
  221 + }
222 222  
  223 + public void setDueDateStart(Integer dueDateStart) {
  224 + this.dueDateStart = dueDateStart;
  225 + }
  226 +
223 227 @Override
224 228 public MongoQuery convertToQuery() {
225 229 MongoCondition condition = MongoCondition.newInstance();
... ... @@ -304,6 +308,23 @@
304 308 }
305 309 MongoCondition mongoCondition1=MongoCondition.newInstance("transferredHospital", list, MongoOper.IN);
306 310 condition=condition.andCondition(mongoCondition1);
  311 + }
  312 + if (isAddStart) {
  313 + return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery();
  314 + }
  315 +
  316 +
  317 + if (null != dueDateStart) {
  318 + c = Criteria.where("dueWeek").gte(dueDateStart);
  319 + isAddStart = Boolean.TRUE;
  320 + }
  321 + if (null != dueDateEnd) {
  322 + if (isAddStart) {
  323 + c = c.lte(dueDateEnd);
  324 + } else {
  325 + c = Criteria.where("dueWeek").lte(dueDateEnd);
  326 + }
  327 + isAddStart = Boolean.TRUE;
307 328 }
308 329 if (isAddStart) {
309 330 return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery();
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java View file @ 657d999
... ... @@ -118,7 +118,7 @@
118 118 referralApplyOrderModel.setScore(highScoreResult.getScore());
119 119 referralApplyOrderModel.setrLevel(highScoreResult.getLevelId());
120 120 referralApplyOrderModel.setPid(patients.getPid());
121   - referralApplyOrderModel.setDueWeek(com.lyms.platform.common.utils.StringUtils.dueWeek(days));
  121 + referralApplyOrderModel.setDueWeek(days);
122 122 if (StringUtils.isNotEmpty(referralApplyOrderModel.getTransferredHospital()) && NumberUtils.isNumber(referralApplyOrderModel.getTransferredHospital())) {
123 123  
124 124 PatientsQuery patientsQuery1 = new PatientsQuery();
125 125  
... ... @@ -141,8 +141,8 @@
141 141 if (null != babyModel) {
142 142 if (null != babyModel.getBirth()) {
143 143 referralApplyOrderModel.setAge(DateUtil.getAge(babyModel.getBirth()));
  144 + referralApplyOrderModel.setDueWeek(DateUtil.getDays(babyModel.getBirth(), new Date()));
144 145 }
145   - referralApplyOrderModel.setDueWeek(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getBabyMonthAge(babyModel.getBirth(), new Date())));
146 146 Patients patients = patientsService.findOnePatientById(babyModel.getParentId());
147 147 referralApplyOrderModel.setParentId(babyModel.getId());
148 148 referralApplyOrderModel.setMname(patients.getUsername());
... ... @@ -345,6 +345,17 @@
345 345 referralApplyOrderQuery.setExpVip(1);
346 346 }
347 347  
  348 +
  349 + /* if(null!=applyOrderQueryRequest.getStartScore()){
  350 + referralApplyOrderQuery.setScoreStart(applyOrderQueryRequest.getStartScore());
  351 + }
  352 +
  353 + if(null!=applyOrderQueryRequest.getEndScore()){
  354 + referralApplyOrderQuery.setScoreEnd(applyOrderQueryRequest.getEndScore());
  355 + }*/
  356 +
  357 +
  358 +
348 359 List<ReferralApplyOrderModel> orderModels = applyOrderService.queryReferralApplyOrderWithQuery(referralApplyOrderQuery);
349 360 if (CollectionUtils.isNotEmpty(orderModels)) {
350 361 String zhuanCName = "";
351 362  
... ... @@ -405,11 +416,13 @@
405 416 referralApplyOrderQuery.setBirthEnd(date);
406 417 }
407 418 //根据孕周
408   - if(null!=applyOrderQueryRequest.getEndDueWeek()){
409   -
  419 + if(null!=applyOrderQueryRequest.getEndDueWeek() &&NumberUtils.isNumber(applyOrderQueryRequest.getEndDueWeek())){
  420 + int i = NumberUtils.toInt(applyOrderQueryRequest.getEndDueWeek())*7;
  421 + referralApplyOrderQuery.setDueDateEnd(i);
410 422 }
411 423 if(null!=applyOrderQueryRequest.getStartDueWeek()){
412   -
  424 + int i = NumberUtils.toInt(applyOrderQueryRequest.getStartDueWeek())*7;
  425 + referralApplyOrderQuery.setDueDateStart(i);
413 426 }
414 427  
415 428 if(null!=applyOrderQueryRequest.getStartScore()){
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ApplyOrderOutResult.java View file @ 657d999
... ... @@ -310,7 +310,9 @@
310 310 this.cDueWeek= StringUtils.dueWeek(days);
311 311 }
312 312 setPid(destModel.getPid());
313   - setDueWeek(destModel.getDueWeek());
  313 + if(null!=destModel.getDueWeek()){
  314 + setDueWeek(com.lyms.platform.common.utils.StringUtils.dueWeek(destModel.getDueWeek()));
  315 + }
314 316 setDueDate(DateUtil.getyyyy_MM_dd(destModel.getDueDate()));
315 317 setApplyDoctor(destModel.getApplyDoctor());
316 318 setCreated(DateUtil.getyyyy_MM_dd(destModel.getCreated()));
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/BabyApplyOrderResult.java View file @ 657d999
... ... @@ -14,7 +14,7 @@
14 14 * Created by Administrator on 2016/7/14 0014.
15 15 */
16 16 public class BabyApplyOrderResult {
17   - public static final String SPIT="-";
  17 + public static final String SPIT = "-";
18 18 private String id;
19 19 private String pid;
20 20 //名字
... ... @@ -103,7 +103,7 @@
103 103 this.babyId = babyId;
104 104 }
105 105  
106   - public BabyApplyOrderResult convert(ReferralApplyOrderModel referralApplyOrderModel, String zhuanCName,String zhuanRname) {
  106 + public BabyApplyOrderResult convert(ReferralApplyOrderModel referralApplyOrderModel, String zhuanCName, String zhuanRname) {
107 107 setPid(referralApplyOrderModel.getPid());
108 108 setZhuanRname(zhuanRname);
109 109 setZhuanCName(zhuanCName);
110 110  
... ... @@ -117,11 +117,13 @@
117 117 if (null != referralApplyOrderModel.getReceived()) {
118 118 setReceived(DateUtil.getyyyy_MM_dd(referralApplyOrderModel.getReceived()));
119 119 }
120   - if(null!=referralApplyOrderModel.getBirth()){
  120 + if (null != referralApplyOrderModel.getBirth()) {
121 121 setBirth(DateUtil.getyyyy_MM_dd(referralApplyOrderModel.getBirth()));
122 122 setCyl(StringUtils.emptyDeal(DateUtil.getBabyMonthAge(referralApplyOrderModel.getBirth(), new Date())));
123 123 }
124   - setYl(referralApplyOrderModel.getDueWeek());
  124 + if (null != referralApplyOrderModel.getBirth()) {
  125 + setYl(com.lyms.platform.common.utils.StringUtils.emptyDeal(DateUtil.getBabyMonthAge(referralApplyOrderModel.getBirth(), referralApplyOrderModel.getCreated())));
  126 + }
125 127 if (null != referralApplyOrderModel.getCreated()) {
126 128 setCreated(DateUtil.getyyyy_MM_dd(referralApplyOrderModel.getCreated()));
127 129 }
... ... @@ -134,7 +136,7 @@
134 136  
135 137 public String getApplyDoctor() {
136 138  
137   - if(null==applyDoctor){
  139 + if (null == applyDoctor) {
138 140 return SPIT;
139 141 }
140 142 return applyDoctor;
... ... @@ -145,7 +147,7 @@
145 147 }
146 148  
147 149 public String getBirth() {
148   - if(null==birth){
  150 + if (null == birth) {
149 151 return SPIT;
150 152 }
151 153  
... ... @@ -158,7 +160,7 @@
158 160  
159 161 public String getCreated() {
160 162  
161   - if(null==created){
  163 + if (null == created) {
162 164 return SPIT;
163 165 }
164 166 return created;
... ... @@ -169,7 +171,7 @@
169 171 }
170 172  
171 173 public String gethRisk() {
172   - if(null==hRisk){
  174 + if (null == hRisk) {
173 175 return SPIT;
174 176 }
175 177  
... ... @@ -190,7 +192,7 @@
190 192  
191 193 public String getmName() {
192 194  
193   - if(null==mName){
  195 + if (null == mName) {
194 196 return SPIT;
195 197 }
196 198 return mName;
... ... @@ -201,7 +203,7 @@
201 203 }
202 204  
203 205 public String getName() {
204   - if(null==name){
  206 + if (null == name) {
205 207 return SPIT;
206 208 }
207 209  
... ... @@ -214,7 +216,7 @@
214 216  
215 217 public String getPhone() {
216 218  
217   - if(null==phone){
  219 + if (null == phone) {
218 220 return SPIT;
219 221 }
220 222 return phone;
... ... @@ -225,7 +227,7 @@
225 227 }
226 228  
227 229 public String getPotentialRisk() {
228   - if(null==potentialRisk){
  230 + if (null == potentialRisk) {
229 231 return SPIT;
230 232 }
231 233  
... ... @@ -238,7 +240,7 @@
238 240  
239 241 public String getReceived() {
240 242  
241   - if(null==received){
  243 + if (null == received) {
242 244 return SPIT;
243 245 }
244 246 return received;
... ... @@ -250,7 +252,7 @@
250 252  
251 253 public String getSex() {
252 254  
253   - if(null==sex){
  255 + if (null == sex) {
254 256 return SPIT;
255 257 }
256 258 return sex;
... ... @@ -261,7 +263,7 @@
261 263 }
262 264  
263 265 public String getTransferredDisease() {
264   - if(null==transferredDisease){
  266 + if (null == transferredDisease) {
265 267 return SPIT;
266 268 }
267 269  
... ... @@ -272,9 +274,8 @@
272 274 this.transferredDisease = transferredDisease;
273 275 }
274 276  
275   - public String getTransferredHospital()
276   - {
277   - if(null==transferredHospital){
  277 + public String getTransferredHospital() {
  278 + if (null == transferredHospital) {
278 279 return SPIT;
279 280 }
280 281 return transferredHospital;
... ... @@ -284,9 +285,8 @@
284 285 this.transferredHospital = transferredHospital;
285 286 }
286 287  
287   - public String getYl()
288   - {
289   - if(null==yl){
  288 + public String getYl() {
  289 + if (null == yl) {
290 290 return SPIT;
291 291 }
292 292 return yl;