Commit 718af3c7ef67475bef9115b413cdc1eff3af61b6
1 parent
6d18c6da3e
Exists in
master
and in
1 other branch
1
Showing 11 changed files with 754 additions and 115 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IReferralApplyOrderDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/ReferralApplyOrderDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/ApplyOrderService.java
- platform-common/src/main/java/com/lyms/platform/common/enums/ApplyOrderStatusEnums.java
- platform-dal/src/main/java/com/lyms/platform/pojo/ReferralApplyOrderModel.java
- platform-dal/src/main/java/com/lyms/platform/query/ReferralApplyOrderQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ApplyOrderController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ApplyOrderQueryRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ApplyOrderInResult.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IReferralApplyOrderDao.java
View file @
718af3c
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 4 | 4 | import com.lyms.platform.pojo.ReferralApplyOrderModel; |
| 5 | +import com.lyms.platform.query.ReferralApplyOrderQuery; | |
| 5 | 6 | |
| 6 | 7 | import java.util.List; |
| 7 | 8 | |
| ... | ... | @@ -26,5 +27,9 @@ |
| 26 | 27 | * @return |
| 27 | 28 | */ |
| 28 | 29 | List<ReferralApplyOrderModel> queryList(MongoQuery mongoQuery); |
| 30 | + | |
| 31 | + Integer count(MongoQuery mongoQuery); | |
| 32 | + | |
| 33 | + void findAndModify(MongoQuery referralApplyOrderQuery,ReferralApplyOrderModel applyOrderModel); | |
| 29 | 34 | } |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/ReferralApplyOrderDaoImpl.java
View file @
718af3c
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | import com.lyms.platform.common.dao.BaseMongoDAOImpl; |
| 5 | 5 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 6 | 6 | import com.lyms.platform.pojo.ReferralApplyOrderModel; |
| 7 | +import com.lyms.platform.query.ReferralApplyOrderQuery; | |
| 7 | 8 | import org.springframework.stereotype.Repository; |
| 8 | 9 | |
| 9 | 10 | import java.util.List; |
| ... | ... | @@ -24,6 +25,12 @@ |
| 24 | 25 | @Override |
| 25 | 26 | public List<ReferralApplyOrderModel> queryList(MongoQuery mongoQuery) { |
| 26 | 27 | return find(mongoQuery.convertToMongoQuery()); |
| 28 | + } | |
| 29 | + public Integer count(MongoQuery mongoQuery){ | |
| 30 | + return (int) count(mongoQuery.convertToMongoQuery()); | |
| 31 | + } | |
| 32 | + public void findAndModify(MongoQuery referralApplyOrderQuery,ReferralApplyOrderModel orderModel){ | |
| 33 | + findAndModify(referralApplyOrderQuery.convertToMongoQuery(),orderModel); | |
| 27 | 34 | } |
| 28 | 35 | } |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/ApplyOrderService.java
View file @
718af3c
| ... | ... | @@ -37,20 +37,23 @@ |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public List<ReferralApplyOrderModel> queryReferralApplyOrderWithQuery(ReferralApplyOrderQuery babyQuery){ |
| 40 | - /*MongoQuery query = babyQuery.convertToQuery(); | |
| 41 | - if (StringUtils.isNotEmpty(babyQuery.getNeed())) { | |
| 42 | - babyQuery.mysqlBuild(iBabyDao.queryBabyCount(babyQuery.convertToQuery())); | |
| 40 | + MongoQuery query = babyQuery.convertToQuery(); | |
| 41 | + if (StringUtils.isNotEmpty(babyQuery.getNeed())) { | |
| 42 | + babyQuery.mysqlBuild(iReferralApplyOrderDao.count(babyQuery.convertToQuery())); | |
| 43 | 43 | query.start(babyQuery.getOffset()).end(babyQuery.getLimit()); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - return iReferralApplyOrderDao.queryList(query.addOrder(Sort.Direction.DESC, "id"));*/ | |
| 47 | - return iReferralApplyOrderDao.queryList(babyQuery.convertToQuery()); | |
| 46 | + return iReferralApplyOrderDao.queryList(query.addOrder(Sort.Direction.DESC, "id")); | |
| 47 | +// return iReferralApplyOrderDao.queryList(babyQuery.convertToQuery()); | |
| 48 | 48 | } |
| 49 | 49 | public SieveApplyOrderModel addOneSieveApplyOrder(SieveApplyOrderModel obj){ |
| 50 | 50 | return iSieveApplyOrderDao.addApplyOrder(obj); |
| 51 | 51 | } |
| 52 | 52 | public List<SieveApplyOrderModel> querySieveApplyOrderWithQuery(SieveApplyOrderQuery sieveApplyOrderQuery){ |
| 53 | 53 | return iSieveApplyOrderDao.queryList(sieveApplyOrderQuery.convertToQuery()); |
| 54 | + } | |
| 55 | + public void updateByParentId(ReferralApplyOrderQuery referralApplyOrderQuery,ReferralApplyOrderModel orderModel){ | |
| 56 | + iReferralApplyOrderDao.findAndModify(referralApplyOrderQuery.convertToQuery(),orderModel); | |
| 54 | 57 | } |
| 55 | 58 | } |
platform-common/src/main/java/com/lyms/platform/common/enums/ApplyOrderStatusEnums.java
View file @
718af3c
| 1 | +package com.lyms.platform.common.enums; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Created by Administrator on 2016/6/27 0027. | |
| 5 | + */ | |
| 6 | +public enum ApplyOrderStatusEnums { | |
| 7 | + CREATED("ๅทฒ่ฝฌๅบ","1"), | |
| 8 | + O("ๅทฒๆฅๆถ","2"), | |
| 9 | + O1("ๅปบ่ฎฎ่ฝฌ่ฏ","3"); | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + private ApplyOrderStatusEnums(String name,String id){ | |
| 14 | + this.name=name; | |
| 15 | + this.id=id; | |
| 16 | + } | |
| 17 | + | |
| 18 | + public static String getTitle(Integer id){ | |
| 19 | + for(ApplyOrderStatusEnums enums:values()){ | |
| 20 | + if(enums.getId().equals(id+"")){ | |
| 21 | + return enums.getName(); | |
| 22 | + } | |
| 23 | + } | |
| 24 | + return null; | |
| 25 | + } | |
| 26 | + private String name; | |
| 27 | + private String id; | |
| 28 | + | |
| 29 | + public String getId() { | |
| 30 | + return id; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public void setId(String id) { | |
| 34 | + this.id = id; | |
| 35 | + } | |
| 36 | + | |
| 37 | + public String getName() { | |
| 38 | + return name; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public void setName(String name) { | |
| 42 | + this.name = name; | |
| 43 | + } | |
| 44 | +} |
platform-dal/src/main/java/com/lyms/platform/pojo/ReferralApplyOrderModel.java
View file @
718af3c
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | import org.springframework.data.mongodb.core.mapping.Document; |
| 4 | 4 | |
| 5 | 5 | import java.util.Date; |
| 6 | +import java.util.List; | |
| 6 | 7 | |
| 7 | 8 | /** |
| 8 | 9 | * ่ฝฌ่ฏ็ณ่ฏทๅ |
| ... | ... | @@ -15,6 +16,22 @@ |
| 15 | 16 | private String id; |
| 16 | 17 | //ๆฃ่ id |
| 17 | 18 | private String parentId; |
| 19 | + //ๆฃ่ ๅๅญ | |
| 20 | + private String name; | |
| 21 | + //ๆฃ่ ๅนด้พ | |
| 22 | + private Integer age; | |
| 23 | + //ๅญๅจ | |
| 24 | + private String dueWeek; | |
| 25 | + //่บซไปฝ่ฏๅท | |
| 26 | + private String cardNo; | |
| 27 | + //้ขไบงๆ | |
| 28 | + private Date dueDate; | |
| 29 | + //้ซๅฑๅ็บง | |
| 30 | + private String rLevel; | |
| 31 | + //้ซๅฑ้ฃ้ฉๅ ็ด | |
| 32 | + private List<String> rRisk; | |
| 33 | + //้ซๅฑ่ฏๅ | |
| 34 | + private Integer score; | |
| 18 | 35 | //่ฝฌๅ ฅๅป้ข |
| 19 | 36 | private String transferredHospital; |
| 20 | 37 | //่ฝฌๅ ฅ็งๅฎค |
| 21 | 38 | |
| ... | ... | @@ -29,10 +46,85 @@ |
| 29 | 46 | private String transferMode; |
| 30 | 47 | //็ณ่ฏทๅป็ |
| 31 | 48 | private String applyDoctor; |
| 49 | + //ๆฅๆถๆฅๆ | |
| 50 | + private Date received; | |
| 32 | 51 | //ๅๅปบๆถ้ด |
| 33 | 52 | private Date created; |
| 34 | 53 | //็ณ่ฏทๅ็ถๆ 0 ๅทฒๆฅๆถ 1 ๅทฒ่ฝฌๅบ 2 ๅปบ่ฎฎ่ฝฌ่ฏ |
| 35 | 54 | private Integer status; |
| 55 | + | |
| 56 | + | |
| 57 | + public Integer getAge() { | |
| 58 | + return age; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public String getCardNo() { | |
| 62 | + return cardNo; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public void setCardNo(String cardNo) { | |
| 66 | + this.cardNo = cardNo; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public void setAge(Integer age) { | |
| 70 | + this.age = age; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public Date getDueDate() { | |
| 74 | + return dueDate; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public void setDueDate(Date dueDate) { | |
| 78 | + this.dueDate = dueDate; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public String getDueWeek() { | |
| 82 | + return dueWeek; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public void setDueWeek(String dueWeek) { | |
| 86 | + this.dueWeek = dueWeek; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public String getName() { | |
| 90 | + return name; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public void setName(String name) { | |
| 94 | + this.name = name; | |
| 95 | + } | |
| 96 | + | |
| 97 | + public Date getReceived() { | |
| 98 | + return received; | |
| 99 | + } | |
| 100 | + | |
| 101 | + public void setReceived(Date received) { | |
| 102 | + this.received = received; | |
| 103 | + } | |
| 104 | + | |
| 105 | + public String getrLevel() { | |
| 106 | + return rLevel; | |
| 107 | + } | |
| 108 | + | |
| 109 | + public void setrLevel(String rLevel) { | |
| 110 | + this.rLevel = rLevel; | |
| 111 | + } | |
| 112 | + | |
| 113 | + public List<String> getrRisk() { | |
| 114 | + return rRisk; | |
| 115 | + } | |
| 116 | + | |
| 117 | + public void setrRisk(List<String> rRisk) { | |
| 118 | + this.rRisk = rRisk; | |
| 119 | + } | |
| 120 | + | |
| 121 | + public Integer getScore() { | |
| 122 | + return score; | |
| 123 | + } | |
| 124 | + | |
| 125 | + public void setScore(Integer score) { | |
| 126 | + this.score = score; | |
| 127 | + } | |
| 36 | 128 | |
| 37 | 129 | public Integer getStatus() { |
| 38 | 130 | return status; |
platform-dal/src/main/java/com/lyms/platform/query/ReferralApplyOrderQuery.java
View file @
718af3c
| 1 | 1 | package com.lyms.platform.query; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.base.IConvertToNativeQuery; |
| 4 | +import com.lyms.platform.common.core.annotation.form.FormParam; | |
| 4 | 5 | import com.lyms.platform.common.dao.BaseQuery; |
| 5 | 6 | import com.lyms.platform.common.dao.operator.MongoCondition; |
| 6 | 7 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 7 | 8 | |
| 8 | 9 | |
| ... | ... | @@ -13,10 +14,124 @@ |
| 13 | 14 | |
| 14 | 15 | private String parentId; |
| 15 | 16 | |
| 17 | + /** | |
| 18 | + *ๅญๅฆๅๅญ | |
| 19 | + */ | |
| 20 | + private String name; | |
| 21 | + /** | |
| 22 | + * ๅญๅฆ่บซไปฝ่ฏๅท | |
| 23 | + */ | |
| 24 | + private String cardNo; | |
| 25 | + /** | |
| 26 | + * ๆๅก็ถๆ | |
| 27 | + */ | |
| 28 | + private String serviceStatus; | |
| 29 | + //ๅนด้พ | |
| 30 | + private String age; | |
| 31 | + //ๅญๅจ | |
| 32 | + private String dueWeek; | |
| 33 | + //้ฃ้ฉ็ญ็บง | |
| 34 | + private String rLevel; | |
| 35 | + private Integer score; | |
| 36 | + private String riskFactor; | |
| 37 | + | |
| 38 | + | |
| 16 | 39 | @Override |
| 17 | 40 | public MongoQuery convertToQuery() { |
| 18 | - MongoCondition condition = MongoCondition.newInstance("parentId",parentId, MongoOper.IS); | |
| 41 | + MongoCondition condition = MongoCondition.newInstance(); | |
| 42 | + if(null!=parentId){ | |
| 43 | + condition=condition.and("parentId",parentId, MongoOper.IS); | |
| 44 | + } | |
| 45 | + if(null!=name){ | |
| 46 | + condition=condition.and("name",name, MongoOper.IS); | |
| 47 | + } | |
| 48 | + if(null!=serviceStatus){ | |
| 49 | + condition=condition.and("serviceStatus",serviceStatus, MongoOper.IS); | |
| 50 | + } | |
| 51 | + if(null!=age){ | |
| 52 | + condition=condition.and("age",age, MongoOper.IS); | |
| 53 | + } | |
| 54 | + if(null!=dueWeek){ | |
| 55 | + condition=condition.and("dueWeek",dueWeek, MongoOper.IS); | |
| 56 | + } | |
| 57 | + if(null!=rLevel){ | |
| 58 | + condition=condition.and("rLevel",rLevel, MongoOper.IS); | |
| 59 | + } | |
| 60 | + if(null!=score){ | |
| 61 | + condition=condition.and("score",score, MongoOper.IS); | |
| 62 | + } | |
| 63 | + if(null!=riskFactor){ | |
| 64 | + condition=condition.and("riskFactor",riskFactor, MongoOper.IS); | |
| 65 | + } | |
| 66 | + if(null!=cardNo){ | |
| 67 | + condition=condition.and("cardNo",cardNo, MongoOper.IS); | |
| 68 | + } | |
| 19 | 69 | return condition.toMongoQuery(); |
| 70 | + } | |
| 71 | + | |
| 72 | + | |
| 73 | + public String getAge() { | |
| 74 | + return age; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public void setAge(String age) { | |
| 78 | + this.age = age; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public String getCardNo() { | |
| 82 | + return cardNo; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public void setCardNo(String cardNo) { | |
| 86 | + this.cardNo = cardNo; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public String getDueWeek() { | |
| 90 | + return dueWeek; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public void setDueWeek(String dueWeek) { | |
| 94 | + this.dueWeek = dueWeek; | |
| 95 | + } | |
| 96 | + | |
| 97 | + public String getName() { | |
| 98 | + return name; | |
| 99 | + } | |
| 100 | + | |
| 101 | + public void setName(String name) { | |
| 102 | + this.name = name; | |
| 103 | + } | |
| 104 | + | |
| 105 | + public String getRiskFactor() { | |
| 106 | + return riskFactor; | |
| 107 | + } | |
| 108 | + | |
| 109 | + public void setRiskFactor(String riskFactor) { | |
| 110 | + this.riskFactor = riskFactor; | |
| 111 | + } | |
| 112 | + | |
| 113 | + public String getrLevel() { | |
| 114 | + return rLevel; | |
| 115 | + } | |
| 116 | + | |
| 117 | + public void setrLevel(String rLevel) { | |
| 118 | + this.rLevel = rLevel; | |
| 119 | + } | |
| 120 | + | |
| 121 | + public Integer getScore() { | |
| 122 | + return score; | |
| 123 | + } | |
| 124 | + | |
| 125 | + public void setScore(Integer score) { | |
| 126 | + this.score = score; | |
| 127 | + } | |
| 128 | + | |
| 129 | + public String getServiceStatus() { | |
| 130 | + return serviceStatus; | |
| 131 | + } | |
| 132 | + | |
| 133 | + public void setServiceStatus(String serviceStatus) { | |
| 134 | + this.serviceStatus = serviceStatus; | |
| 20 | 135 | } |
| 21 | 136 | |
| 22 | 137 | public String getParentId() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ApplyOrderController.java
View file @
718af3c
| ... | ... | @@ -5,6 +5,7 @@ |
| 5 | 5 | import com.lyms.platform.common.result.BaseListResponse; |
| 6 | 6 | import com.lyms.platform.common.result.BaseResponse; |
| 7 | 7 | import com.lyms.platform.operate.web.facade.ApplyOrderFacade; |
| 8 | +import com.lyms.platform.operate.web.request.ApplyOrderQueryRequest; | |
| 8 | 9 | import com.lyms.platform.operate.web.request.ReferralApplyOrderAddRequest; |
| 9 | 10 | import com.lyms.platform.operate.web.request.SieveApplyOrderAddRequest; |
| 10 | 11 | import org.apache.commons.lang.StringUtils; |
| ... | ... | @@ -59,6 +60,18 @@ |
| 59 | 60 | return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("idไธ่ฝไธบ็ฉบ."); |
| 60 | 61 | } |
| 61 | 62 | return applyOrderFacade.querySieveApplyOrder(id); |
| 63 | + } | |
| 64 | + | |
| 65 | + /** | |
| 66 | + * ้ซๅฑ่ฝฌ่ฏ | |
| 67 | + * | |
| 68 | + * @param orderQueryRequest | |
| 69 | + * @return | |
| 70 | + */ | |
| 71 | + @RequestMapping(method = RequestMethod.GET,value = "/applyorder") | |
| 72 | + @ResponseBody | |
| 73 | + public BaseResponse queryApplyOrder(ApplyOrderQueryRequest orderQueryRequest){ | |
| 74 | + return applyOrderFacade.queryApplyOrder(orderQueryRequest); | |
| 62 | 75 | } |
| 63 | 76 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
718af3c
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.biz.service.AntenatalExaminationService; |
| 4 | +import com.lyms.platform.biz.service.ApplyOrderService; | |
| 4 | 5 | import com.lyms.platform.biz.service.BasicConfigService; |
| 5 | 6 | import com.lyms.platform.biz.service.PatientsService; |
| 6 | 7 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 7 | 8 | |
| 8 | 9 | |
| 9 | 10 | |
| ... | ... | @@ -17,19 +18,15 @@ |
| 17 | 18 | import com.lyms.platform.operate.web.result.AntenatalExaminationResult; |
| 18 | 19 | import com.lyms.platform.operate.web.result.AntexChuResult; |
| 19 | 20 | import com.lyms.platform.operate.web.result.AntexListResult; |
| 20 | -import com.lyms.platform.pojo.AntExChuModel; | |
| 21 | -import com.lyms.platform.pojo.AntenatalExaminationModel; | |
| 22 | -import com.lyms.platform.pojo.BasicConfig; | |
| 23 | -import com.lyms.platform.pojo.Patients; | |
| 21 | +import com.lyms.platform.pojo.*; | |
| 24 | 22 | import com.lyms.platform.query.AntExChuQuery; |
| 25 | 23 | import com.lyms.platform.query.PatientsQuery; |
| 24 | +import com.lyms.platform.query.ReferralApplyOrderQuery; | |
| 26 | 25 | import org.apache.commons.collections.CollectionUtils; |
| 27 | 26 | import org.apache.commons.lang.StringUtils; |
| 27 | +import org.apache.commons.lang.math.NumberUtils; | |
| 28 | 28 | import org.springframework.beans.factory.annotation.Autowired; |
| 29 | 29 | import org.springframework.stereotype.Component; |
| 30 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 31 | -import org.springframework.web.bind.annotation.RequestMethod; | |
| 32 | -import org.springframework.web.bind.annotation.ResponseBody; | |
| 33 | 30 | |
| 34 | 31 | import java.util.ArrayList; |
| 35 | 32 | import java.util.HashMap; |
| ... | ... | @@ -51,6 +48,8 @@ |
| 51 | 48 | private BasicConfigFacade basicConfigFacade; |
| 52 | 49 | @Autowired |
| 53 | 50 | private BasicConfigService basicConfigService; |
| 51 | + @Autowired | |
| 52 | + private ApplyOrderService applyOrderService; | |
| 54 | 53 | |
| 55 | 54 | /** |
| 56 | 55 | * ๅขๅ ไธๆกไบงๅๆฃๆฅ |
| 57 | 56 | |
| 58 | 57 | |
| 59 | 58 | |
| 60 | 59 | |
| 61 | 60 | |
| 62 | 61 | |
| 63 | 62 | |
| 64 | 63 | |
| 65 | 64 | |
| 66 | 65 | |
| 67 | 66 | |
| 68 | 67 | |
| 69 | 68 | |
| ... | ... | @@ -59,53 +58,66 @@ |
| 59 | 58 | * @return |
| 60 | 59 | */ |
| 61 | 60 | public BaseResponse addOneAntEx(AntExAddRequest antExAddRequest) { |
| 62 | - if(StringUtils.isNotEmpty(antExAddRequest.getId())){ | |
| 63 | - AntenatalExaminationModel antenatalExamination= antExAddRequest.convertToDataModel(); | |
| 61 | + if (StringUtils.isNotEmpty(antExAddRequest.getId())) { | |
| 62 | + AntenatalExaminationModel antenatalExamination = antExAddRequest.convertToDataModel(); | |
| 64 | 63 | antenatalExaminationService.updateOneAnt(antenatalExamination, antExAddRequest.getId()); |
| 65 | - }else { | |
| 66 | - AntenatalExaminationModel model= antExAddRequest.convertToDataModel(); | |
| 64 | + updateApplyOrder(antenatalExamination,antExAddRequest.getParentId()); | |
| 65 | + } else { | |
| 66 | + AntenatalExaminationModel model = antExAddRequest.convertToDataModel(); | |
| 67 | 67 | model.setYn(YnEnums.YES.getId()); |
| 68 | 68 | antenatalExaminationService.addOneBabyAnt(model); |
| 69 | + updateApplyOrder(model, antExAddRequest.getParentId()); | |
| 69 | 70 | } |
| 70 | 71 | |
| 71 | - return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("ๆๅ"); | |
| 72 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("ๆๅ"); | |
| 72 | 73 | } |
| 73 | 74 | |
| 75 | + | |
| 76 | + public void updateApplyOrder(AntenatalExaminationModel antenatalExamination ,String parentId){ | |
| 77 | + ReferralApplyOrderQuery referralApplyOrderQuery = new ReferralApplyOrderQuery(); | |
| 78 | + referralApplyOrderQuery.setParentId(parentId); | |
| 79 | + | |
| 80 | + ReferralApplyOrderModel referralApplyOrderModel = new ReferralApplyOrderModel(); | |
| 81 | + referralApplyOrderModel.setScore(NumberUtils.toInt(antenatalExamination.getRiskScore())); | |
| 82 | + try { | |
| 83 | + List l = JsonUtil.toList(antenatalExamination.getRiskFactor(), List.class); | |
| 84 | + referralApplyOrderModel.setrRisk(queryRiskName(l)); | |
| 85 | + } catch (Exception e) { | |
| 86 | + } | |
| 87 | + referralApplyOrderModel.setrLevel("้ป"); | |
| 88 | + applyOrderService.updateByParentId(referralApplyOrderQuery, referralApplyOrderModel); | |
| 89 | + } | |
| 74 | 90 | /** |
| 75 | - * | |
| 76 | 91 | * ๅขๅ ๆไฟฎๆนไบงๅๆฃๆฅ่ฎฐๅฝ(ๅ่ฏ) |
| 77 | 92 | * |
| 78 | 93 | * @param excAddRequest |
| 79 | - * | |
| 80 | 94 | * @return |
| 81 | 95 | */ |
| 82 | - public BaseResponse addOneAnetExChu(AntExcAddRequest excAddRequest){ | |
| 83 | - AntExChuModel antExChuModel = excAddRequest.convertToDataModel(); | |
| 84 | - if(StringUtils.isNotEmpty(antExChuModel.getId()) &&StringUtils.isNotEmpty(antExChuModel.getParentId())){ | |
| 96 | + public BaseResponse addOneAnetExChu(AntExcAddRequest excAddRequest) { | |
| 97 | + AntExChuModel antExChuModel = excAddRequest.convertToDataModel(); | |
| 98 | + if (StringUtils.isNotEmpty(antExChuModel.getId()) && StringUtils.isNotEmpty(antExChuModel.getParentId())) { | |
| 85 | 99 | antenatalExaminationService.updateAntExChu(antExChuModel, antExChuModel.getId()); |
| 86 | - }else{ | |
| 100 | + } else { | |
| 87 | 101 | antExChuModel.setYn(YnEnums.YES.getId()); |
| 88 | 102 | antenatalExaminationService.addOneAntEx(antExChuModel); |
| 89 | 103 | } |
| 90 | - return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("ๆๅ"); | |
| 104 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("ๆๅ"); | |
| 91 | 105 | } |
| 92 | 106 | |
| 93 | 107 | |
| 94 | - | |
| 95 | 108 | /** |
| 96 | - * | |
| 97 | 109 | * ๅ ้คไธๆกไบงๅๆฃๆฅ |
| 98 | 110 | * |
| 99 | 111 | * @param antExQueryRequest |
| 100 | 112 | * @return |
| 101 | 113 | */ |
| 102 | - public BaseResponse delOneAntEx(AntExQueryRequest antExQueryRequest){ | |
| 103 | - if("1".equals(antExQueryRequest.getType())){ | |
| 104 | - AntenatalExaminationModel antEx=new AntenatalExaminationModel(); | |
| 114 | + public BaseResponse delOneAntEx(AntExQueryRequest antExQueryRequest) { | |
| 115 | + if ("1".equals(antExQueryRequest.getType())) { | |
| 116 | + AntenatalExaminationModel antEx = new AntenatalExaminationModel(); | |
| 105 | 117 | antEx.setYn(YnEnums.NO.getId()); |
| 106 | 118 | antEx.setId(antExQueryRequest.getId()); |
| 107 | 119 | antenatalExaminationService.updateOneAnt(antEx, antExQueryRequest.getId()); |
| 108 | - }else{ | |
| 120 | + } else { | |
| 109 | 121 | AntExChuModel antExChuModel = new AntExChuModel(); |
| 110 | 122 | antExChuModel.setYn(YnEnums.NO.getId()); |
| 111 | 123 | antExChuModel.setId(antExQueryRequest.getId()); |
| 112 | 124 | |
| 113 | 125 | |
| 114 | 126 | |
| ... | ... | @@ -116,18 +128,17 @@ |
| 116 | 128 | } |
| 117 | 129 | |
| 118 | 130 | /** |
| 119 | - * | |
| 120 | 131 | * ๆ นๆฎ่บซไปฝ่ฏๅทๆ่ ๅฐฑ่ฏๅกๅทๆฅ่ฏขไบงๅฆ |
| 121 | 132 | * |
| 122 | 133 | * @param cardNo |
| 123 | 134 | * @param vcCardNo |
| 124 | 135 | * @return |
| 125 | 136 | */ |
| 126 | - public Patients findOnePatient(String cardNo,String vcCardNo) { | |
| 137 | + public Patients findOnePatient(String cardNo, String vcCardNo) { | |
| 127 | 138 | PatientsQuery patientsQuery = new PatientsQuery(); |
| 128 | - if(StringUtils.isNotEmpty(cardNo)){ | |
| 139 | + if (StringUtils.isNotEmpty(cardNo)) { | |
| 129 | 140 | patientsQuery.setCardNo(cardNo); |
| 130 | - }else if(StringUtils.isNotEmpty(vcCardNo)){ | |
| 141 | + } else if (StringUtils.isNotEmpty(vcCardNo)) { | |
| 131 | 142 | patientsQuery.setVcCardNo(vcCardNo); |
| 132 | 143 | } |
| 133 | 144 | |
| 134 | 145 | |
| 135 | 146 | |
| 136 | 147 | |
| 137 | 148 | |
| 138 | 149 | |
| 139 | 150 | |
| 140 | 151 | |
| 141 | 152 | |
| 142 | 153 | |
| 143 | 154 | |
| 144 | 155 | |
| ... | ... | @@ -145,64 +156,64 @@ |
| 145 | 156 | * ๆฅ่ฏขไบงๅๆฃๆฅ |
| 146 | 157 | * |
| 147 | 158 | * @param queryRequest |
| 148 | - * | |
| 149 | 159 | * @return |
| 150 | 160 | */ |
| 151 | - public BaseResponse queryAntenatalExamination(AntenatalExaminationQueryRequest queryRequest){ | |
| 161 | + public BaseResponse queryAntenatalExamination(AntenatalExaminationQueryRequest queryRequest) { | |
| 152 | 162 | |
| 153 | 163 | Patients patients = null; |
| 154 | - if (!StringUtils.isEmpty(queryRequest.getPatientId())) | |
| 155 | - { | |
| 164 | + if (!StringUtils.isEmpty(queryRequest.getPatientId())) { | |
| 156 | 165 | PatientsQuery patientsQuery = new PatientsQuery(); |
| 157 | 166 | patientsQuery.setId(queryRequest.getPatientId()); |
| 158 | 167 | patientsQuery.setYn(YnEnums.YES.getId()); |
| 159 | 168 | |
| 160 | 169 | List<Patients> list = patientsService.queryPatient(patientsQuery); |
| 161 | - if (CollectionUtils.isNotEmpty(list)) | |
| 162 | - { | |
| 170 | + if (CollectionUtils.isNotEmpty(list)) { | |
| 163 | 171 | patients = list.get(0); |
| 164 | 172 | } |
| 173 | + } else { | |
| 174 | + //ๆฅ่ฏขไบงๅฆๆฐๆฎ | |
| 175 | + patients = findOnePatient(queryRequest.getCardNo(), queryRequest.getVcCardNo()); | |
| 165 | 176 | } |
| 166 | - else | |
| 167 | - { | |
| 168 | - //ๆฅ่ฏขไบงๅฆๆฐๆฎ | |
| 169 | - patients = findOnePatient(queryRequest.getCardNo(),queryRequest.getVcCardNo()); | |
| 170 | - } | |
| 171 | 177 | |
| 172 | - if(null==patients){ | |
| 178 | + if (null == patients) { | |
| 173 | 179 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("ๆฒกๆไบงๅฆไฟกๆฏ"); |
| 174 | 180 | } |
| 175 | 181 | |
| 176 | 182 | AntexListResult antexListResult = new AntexListResult(); |
| 177 | - AntExChuQuery antExChuQuery=new AntExChuQuery(); | |
| 183 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 178 | 184 | antExChuQuery.setParentId(patients.getId()); |
| 179 | 185 | antExChuQuery.setYn(YnEnums.YES.getId()); |
| 180 | 186 | //่ทๅๅ่ฏ่ฎฐๅฝ |
| 181 | - List<AntExChuModel> antExChulist = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 182 | - AntExChuModel antExChuModel=null; | |
| 183 | - if(CollectionUtils.isNotEmpty(antExChulist)){ | |
| 184 | - antExChuModel= antExChulist.get(0); | |
| 187 | + List<AntExChuModel> antExChulist = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 188 | + AntExChuModel antExChuModel = null; | |
| 189 | + if (CollectionUtils.isNotEmpty(antExChulist)) { | |
| 190 | + antExChuModel = antExChulist.get(0); | |
| 185 | 191 | } |
| 186 | 192 | //ๆฅ่ฏขไบงๅๆฃๆฅ่ฎฐๅฝ |
| 187 | 193 | List list = antenatalExaminationService.findAllByParentId(patients.getId()); |
| 188 | 194 | List data = new ArrayList(); |
| 189 | - if(null!=antExChuModel&&StringUtils.isNotEmpty(antExChuModel.getHighrisk())){ | |
| 190 | - List l = JsonUtil.toList(antExChuModel.getHighrisk(),List.class); | |
| 191 | - for(int i=0;i<l.size();i++){ | |
| 192 | - String key = (String)l.get(i); | |
| 193 | - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(key); | |
| 194 | - if(null!=basicConfig){ | |
| 195 | - data.add(basicConfig.getName()); | |
| 196 | - } | |
| 197 | - } | |
| 195 | + if (null != antExChuModel && StringUtils.isNotEmpty(antExChuModel.getHighrisk())) { | |
| 196 | + List l = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); | |
| 197 | + data = queryRiskName(l); | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - antexListResult.convertToResult(list,patients,antExChuModel); | |
| 200 | + antexListResult.convertToResult(list, patients, antExChuModel); | |
| 201 | 201 | |
| 202 | 202 | antexListResult.setRiskFactor(data); |
| 203 | 203 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("ๆๅ").setData(antexListResult); |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | + private List queryRiskName(List l) { | |
| 207 | + List data = new ArrayList(); | |
| 208 | + for (int i = 0; i < l.size(); i++) { | |
| 209 | + String key = (String) l.get(i); | |
| 210 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(key); | |
| 211 | + if (null != basicConfig) { | |
| 212 | + data.add(basicConfig.getName()); | |
| 213 | + } | |
| 214 | + } | |
| 215 | + return data; | |
| 216 | + } | |
| 206 | 217 | |
| 207 | 218 | /** |
| 208 | 219 | * ๆ นๆฎไบงๅๆฃๆฅidๆฅ่ฏข |
| 209 | 220 | |
| 210 | 221 | |
| 211 | 222 | |
| 212 | 223 | |
| 213 | 224 | |
| 214 | 225 | |
| 215 | 226 | |
| 216 | 227 | |
| 217 | 228 | |
| 218 | 229 | |
| 219 | 230 | |
| 220 | 231 | |
| 221 | 232 | |
| 222 | 233 | |
| 223 | 234 | |
| 224 | 235 | |
| 225 | 236 | |
| 226 | 237 | |
| 227 | 238 | |
| 228 | 239 | |
| 229 | 240 | |
| 230 | 241 | |
| ... | ... | @@ -211,102 +222,107 @@ |
| 211 | 222 | * @return |
| 212 | 223 | */ |
| 213 | 224 | public BaseResponse findOneAntExById(AntExQueryRequest antExQueryRequest) { |
| 214 | - Object object=null; | |
| 225 | + Object object = null; | |
| 215 | 226 | //ๅค่ฏ |
| 216 | - if("1".equals(antExQueryRequest.getType())){ | |
| 227 | + if ("1".equals(antExQueryRequest.getType())) { | |
| 217 | 228 | AntenatalExaminationModel examinationModel = antenatalExaminationService.findOneById(antExQueryRequest.getId()); |
| 218 | 229 | Assert.notNull(examinationModel, "idไธๅญๅจ."); |
| 219 | 230 | AntenatalExaminationResult antenatalExaminationResult = new AntenatalExaminationResult(); |
| 220 | 231 | antenatalExaminationResult.convertToResult(examinationModel); |
| 221 | - try{ | |
| 222 | - List list1= JsonUtil.toList(examinationModel.getRiskFactor(), List.class); | |
| 232 | + try { | |
| 233 | + List list1 = JsonUtil.toList(examinationModel.getRiskFactor(), List.class); | |
| 223 | 234 | antenatalExaminationResult.setRiskFactor(list1); |
| 224 | - }catch (Exception e){ | |
| 235 | + } catch (Exception e) { | |
| 225 | 236 | } |
| 226 | - object=antenatalExaminationResult; | |
| 227 | - }else{ | |
| 237 | + object = antenatalExaminationResult; | |
| 238 | + } else { | |
| 228 | 239 | //ๆฅ่ฏขๅ่ฏๆฐๆฎ |
| 229 | - AntexChuResult antexChuResult= new AntexChuResult(); | |
| 230 | - AntExChuQuery antExChuQuery=new AntExChuQuery(); | |
| 240 | + AntexChuResult antexChuResult = new AntexChuResult(); | |
| 241 | + AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
| 231 | 242 | antExChuQuery.setYn(YnEnums.YES.getId()); |
| 232 | 243 | antExChuQuery.setId(antExQueryRequest.getId()); |
| 233 | - List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 234 | - AntExChuModel antExChuModel=null; | |
| 235 | - if(CollectionUtils.isNotEmpty(antExChuModels)){ | |
| 236 | - antExChuModel=antExChuModels.get(0); | |
| 244 | + List<AntExChuModel> antExChuModels = antenatalExaminationService.queryAntExChu(antExChuQuery); | |
| 245 | + AntExChuModel antExChuModel = null; | |
| 246 | + if (CollectionUtils.isNotEmpty(antExChuModels)) { | |
| 247 | + antExChuModel = antExChuModels.get(0); | |
| 237 | 248 | } |
| 238 | 249 | antexChuResult.convertToResult(antExChuModel); |
| 239 | - object=antexChuResult; | |
| 250 | + object = antexChuResult; | |
| 240 | 251 | } |
| 241 | 252 | |
| 242 | 253 | return new BaseObjectResponse().setData(object).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("ๆๅ"); |
| 243 | 254 | } |
| 244 | - public BaseResponse getEnums(){ | |
| 245 | - Map<String,Object> map =new HashMap<>(); | |
| 246 | - map.put("getFetPosition",getFetPosition()); | |
| 247 | - map.put("getFetal",getFetal()); | |
| 248 | - map.put("getJoin",getJoin()); | |
| 249 | - map.put("getTaiPan",getTaiPan()); | |
| 250 | - map.put("fuzhong",getFuZhong()); | |
| 251 | - map.put("getHighRisk",basicConfigFacade.getHighRisk()); | |
| 252 | - map.put("jws",basicConfigFacade.getBaseicConfigByParentId(SystemConfig.JIWANGSHI_ID)); | |
| 253 | - map.put("xx",basicConfigFacade.getBaseicConfigByParentId(SystemConfig.XUEXING)); | |
| 254 | - map.put("ydqjd",basicConfigFacade.getBaseicConfigByParentId(SystemConfig.YDQJD)); | |
| 255 | - map.put("fxys",basicConfigFacade.getBaseicConfigByParentId(SystemConfig.FXYS)); | |
| 256 | - map.put("gwfz",basicConfigFacade.getBaseicConfigByParentId(SystemConfig.GWFZ)); | |
| 255 | + | |
| 256 | + public BaseResponse getEnums() { | |
| 257 | + Map<String, Object> map = new HashMap<>(); | |
| 258 | + map.put("getFetPosition", getFetPosition()); | |
| 259 | + map.put("getFetal", getFetal()); | |
| 260 | + map.put("getJoin", getJoin()); | |
| 261 | + map.put("getTaiPan", getTaiPan()); | |
| 262 | + map.put("fuzhong", getFuZhong()); | |
| 263 | + map.put("getHighRisk", basicConfigFacade.getHighRisk()); | |
| 264 | + map.put("jws", basicConfigFacade.getBaseicConfigByParentId(SystemConfig.JIWANGSHI_ID)); | |
| 265 | + map.put("xx", basicConfigFacade.getBaseicConfigByParentId(SystemConfig.XUEXING)); | |
| 266 | + map.put("ydqjd", basicConfigFacade.getBaseicConfigByParentId(SystemConfig.YDQJD)); | |
| 267 | + map.put("fxys", basicConfigFacade.getBaseicConfigByParentId(SystemConfig.FXYS)); | |
| 268 | + map.put("gwfz", basicConfigFacade.getBaseicConfigByParentId(SystemConfig.GWFZ)); | |
| 257 | 269 | return new BaseObjectResponse().setData(map).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("ๆๅ"); |
| 258 | 270 | } |
| 259 | 271 | |
| 260 | - public List<Object> getFuZhong(){ | |
| 272 | + public List<Object> getFuZhong() { | |
| 261 | 273 | List<Object> list = new ArrayList<>(); |
| 262 | - for(FuZhongEnums enums:FuZhongEnums.values()){ | |
| 263 | - Map<String,Object> resultMap = new HashMap<>(); | |
| 264 | - resultMap.put("id",enums.getId()); | |
| 265 | - resultMap.put("name",enums.getName()); | |
| 274 | + for (FuZhongEnums enums : FuZhongEnums.values()) { | |
| 275 | + Map<String, Object> resultMap = new HashMap<>(); | |
| 276 | + resultMap.put("id", enums.getId()); | |
| 277 | + resultMap.put("name", enums.getName()); | |
| 266 | 278 | list.add(resultMap); |
| 267 | 279 | } |
| 268 | 280 | return list; |
| 269 | 281 | } |
| 282 | + | |
| 270 | 283 | //่ๆนไฝ |
| 271 | - public List<Object> getFetPosition(){ | |
| 284 | + public List<Object> getFetPosition() { | |
| 272 | 285 | List<Object> list = new ArrayList<>(); |
| 273 | - for(FetalPositionEnums enums:FetalPositionEnums.values()){ | |
| 274 | - Map<String,Object> resultMap = new HashMap<>(); | |
| 275 | - resultMap.put("id",enums.getId()); | |
| 276 | - resultMap.put("name",enums.getName()); | |
| 286 | + for (FetalPositionEnums enums : FetalPositionEnums.values()) { | |
| 287 | + Map<String, Object> resultMap = new HashMap<>(); | |
| 288 | + resultMap.put("id", enums.getId()); | |
| 289 | + resultMap.put("name", enums.getName()); | |
| 277 | 290 | list.add(resultMap); |
| 278 | 291 | } |
| 279 | 292 | return list; |
| 280 | 293 | } |
| 294 | + | |
| 281 | 295 | //่ๅ ้ฒ |
| 282 | - public List getFetal(){ | |
| 296 | + public List getFetal() { | |
| 283 | 297 | List<Object> list = new ArrayList<>(); |
| 284 | - for(FetalEnums enums:FetalEnums.values()){ | |
| 285 | - Map<String,Object> resultMap = new HashMap<>(); | |
| 286 | - resultMap.put("id",enums.getId()); | |
| 287 | - resultMap.put("name",enums.getName()); | |
| 298 | + for (FetalEnums enums : FetalEnums.values()) { | |
| 299 | + Map<String, Object> resultMap = new HashMap<>(); | |
| 300 | + resultMap.put("id", enums.getId()); | |
| 301 | + resultMap.put("name", enums.getName()); | |
| 288 | 302 | list.add(resultMap); |
| 289 | 303 | } |
| 290 | 304 | return list; |
| 291 | 305 | } |
| 306 | + | |
| 292 | 307 | //่กๆฅ |
| 293 | - public List getJoin(){ | |
| 308 | + public List getJoin() { | |
| 294 | 309 | List<Object> list = new ArrayList<>(); |
| 295 | - for(JoinEnums enums:JoinEnums.values()){ | |
| 296 | - Map<String,Object> resultMap = new HashMap<>(); | |
| 297 | - resultMap.put("id",enums.getId()); | |
| 298 | - resultMap.put("name",enums.getName()); | |
| 310 | + for (JoinEnums enums : JoinEnums.values()) { | |
| 311 | + Map<String, Object> resultMap = new HashMap<>(); | |
| 312 | + resultMap.put("id", enums.getId()); | |
| 313 | + resultMap.put("name", enums.getName()); | |
| 299 | 314 | list.add(resultMap); |
| 300 | 315 | } |
| 301 | 316 | return list; |
| 302 | 317 | } |
| 318 | + | |
| 303 | 319 | //่็ |
| 304 | - public List getTaiPan(){ | |
| 320 | + public List getTaiPan() { | |
| 305 | 321 | List<Object> list = new ArrayList<>(); |
| 306 | - for(TaiPanEnums enums:TaiPanEnums.values()){ | |
| 307 | - Map<String,Object> resultMap = new HashMap<>(); | |
| 308 | - resultMap.put("id",enums.getId()); | |
| 309 | - resultMap.put("name",enums.getName()); | |
| 322 | + for (TaiPanEnums enums : TaiPanEnums.values()) { | |
| 323 | + Map<String, Object> resultMap = new HashMap<>(); | |
| 324 | + resultMap.put("id", enums.getId()); | |
| 325 | + resultMap.put("name", enums.getName()); | |
| 310 | 326 | list.add(resultMap); |
| 311 | 327 | } |
| 312 | 328 | return list; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ApplyOrderFacade.java
View file @
718af3c
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.biz.service.ApplyOrderService; |
| 4 | +import com.lyms.platform.biz.service.PatientsService; | |
| 4 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 6 | +import com.lyms.platform.common.enums.YnEnums; | |
| 5 | 7 | import com.lyms.platform.common.result.BaseListResponse; |
| 6 | 8 | import com.lyms.platform.common.result.BaseResponse; |
| 9 | +import com.lyms.platform.operate.web.request.ApplyOrderQueryRequest; | |
| 7 | 10 | import com.lyms.platform.operate.web.request.ReferralApplyOrderAddRequest; |
| 8 | 11 | import com.lyms.platform.operate.web.request.SieveApplyOrderAddRequest; |
| 12 | +import com.lyms.platform.operate.web.result.ApplyOrderOutResult; | |
| 13 | +import com.lyms.platform.pojo.Patients; | |
| 9 | 14 | import com.lyms.platform.pojo.ReferralApplyOrderModel; |
| 10 | 15 | import com.lyms.platform.pojo.SieveApplyOrderModel; |
| 16 | +import com.lyms.platform.query.PatientsQuery; | |
| 11 | 17 | import com.lyms.platform.query.ReferralApplyOrderQuery; |
| 12 | 18 | import com.lyms.platform.query.SieveApplyOrderQuery; |
| 19 | +import org.apache.commons.collections.CollectionUtils; | |
| 13 | 20 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | 21 | import org.springframework.stereotype.Component; |
| 15 | 22 | |
| 23 | +import java.util.ArrayList; | |
| 16 | 24 | import java.util.Date; |
| 17 | 25 | import java.util.List; |
| 18 | 26 | |
| ... | ... | @@ -23,6 +31,8 @@ |
| 23 | 31 | public class ApplyOrderFacade { |
| 24 | 32 | @Autowired |
| 25 | 33 | private ApplyOrderService applyOrderService; |
| 34 | + @Autowired | |
| 35 | + private PatientsService patientsService; | |
| 26 | 36 | |
| 27 | 37 | /** |
| 28 | 38 | * ๅขๅ ่ฝฌ่ฏ็ณ่ฏท |
| ... | ... | @@ -34,6 +44,19 @@ |
| 34 | 44 | ReferralApplyOrderModel referralApplyOrderModel = referralApplyOrderAddRequest.convertToDataModel(); |
| 35 | 45 | referralApplyOrderModel.setCreated(new Date()); |
| 36 | 46 | referralApplyOrderModel.setStatus(0); |
| 47 | + PatientsQuery patientsQuery=new PatientsQuery(); | |
| 48 | + patientsQuery.setId(referralApplyOrderModel.getParentId()); | |
| 49 | + //ๆฅ่ฏขไบงๅฆไฟกๆฏ | |
| 50 | + List<Patients> patientses= patientsService.queryPatient(patientsQuery); | |
| 51 | + Patients patients=null; | |
| 52 | + if(CollectionUtils.isNotEmpty(patientses)){ | |
| 53 | + patients= patientses.get(0); | |
| 54 | + } | |
| 55 | + referralApplyOrderModel.setCardNo(patients.getCardNo()); | |
| 56 | + referralApplyOrderModel.setAge(patients.getAge()); | |
| 57 | + referralApplyOrderModel.setDueDate(patients.getDueDate()); | |
| 58 | + referralApplyOrderModel.setName(patients.getUsername()); | |
| 59 | + | |
| 37 | 60 | applyOrderService.addOneReferralApplyOrder(referralApplyOrderModel); |
| 38 | 61 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("ๆๅ"); |
| 39 | 62 | } |
| ... | ... | @@ -75,6 +98,37 @@ |
| 75 | 98 | SieveApplyOrderQuery sieveApplyOrderQuery =new SieveApplyOrderQuery(); |
| 76 | 99 | List<SieveApplyOrderModel> list = applyOrderService.querySieveApplyOrderWithQuery(sieveApplyOrderQuery); |
| 77 | 100 | return new BaseListResponse().setData(list).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("ๆๅ"); |
| 101 | + } | |
| 102 | + | |
| 103 | + /** | |
| 104 | + * ้ซๅฑ่ฝฌ่ฏๅ่กจ | |
| 105 | + * | |
| 106 | + * @param applyOrderQueryRequest | |
| 107 | + * @return | |
| 108 | + */ | |
| 109 | + public BaseListResponse queryApplyOrder(ApplyOrderQueryRequest applyOrderQueryRequest){ | |
| 110 | + ReferralApplyOrderQuery referralApplyOrderQuery=new ReferralApplyOrderQuery(); | |
| 111 | + referralApplyOrderQuery.setName(applyOrderQueryRequest.getName()); | |
| 112 | + referralApplyOrderQuery.setAge(applyOrderQueryRequest.getAge()); | |
| 113 | + referralApplyOrderQuery.setDueWeek(applyOrderQueryRequest.getDueWeek()); | |
| 114 | + referralApplyOrderQuery.setRiskFactor(applyOrderQueryRequest.getRiskFactor()); | |
| 115 | + referralApplyOrderQuery.setrLevel(applyOrderQueryRequest.getrLevel()); | |
| 116 | + referralApplyOrderQuery.setScore(applyOrderQueryRequest.getScore()); | |
| 117 | + referralApplyOrderQuery.setCardNo(applyOrderQueryRequest.getCardNo()); | |
| 118 | + referralApplyOrderQuery.setPage(applyOrderQueryRequest.getPage()); | |
| 119 | + referralApplyOrderQuery.setLimit(applyOrderQueryRequest.getLimit()); | |
| 120 | + | |
| 121 | + List<ReferralApplyOrderModel> orderModels = applyOrderService.queryReferralApplyOrderWithQuery(referralApplyOrderQuery); | |
| 122 | + | |
| 123 | + List data = new ArrayList(); | |
| 124 | + if(CollectionUtils.isNotEmpty(orderModels)){ | |
| 125 | + for(ReferralApplyOrderModel orderModel:orderModels){ | |
| 126 | + ApplyOrderOutResult applyOrderResult=new ApplyOrderOutResult(); | |
| 127 | + applyOrderResult.convertToResult(orderModel); | |
| 128 | + data.add(applyOrderResult); | |
| 129 | + } | |
| 130 | + } | |
| 131 | + return new BaseListResponse().setData(data).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("ๆๅ"); | |
| 78 | 132 | } |
| 79 | 133 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/ApplyOrderQueryRequest.java
View file @
718af3c
| 1 | +package com.lyms.platform.operate.web.request; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.core.annotation.form.FormParam; | |
| 4 | +import com.lyms.platform.common.core.annotation.form.Form; | |
| 5 | +/** | |
| 6 | + * | |
| 7 | + * ้ซๅฑ่ฝฌ่ฏ็ฎก็ๆฅ่ฏข่ฏทๆฑ | |
| 8 | + * | |
| 9 | + * Created by Administrator on 2016/6/27 0027. | |
| 10 | + */ | |
| 11 | +@Form | |
| 12 | +public class ApplyOrderQueryRequest extends BasePageQueryRequest { | |
| 13 | + /** | |
| 14 | + *ๅญๅฆๅๅญ | |
| 15 | + */ | |
| 16 | + @FormParam | |
| 17 | + private String name; | |
| 18 | + /** | |
| 19 | + * ๅญๅฆ่บซไปฝ่ฏๅท | |
| 20 | + */ | |
| 21 | + @FormParam | |
| 22 | + private String cardNo; | |
| 23 | + /** | |
| 24 | + * ๆๅก็ถๆ | |
| 25 | + */ | |
| 26 | + @FormParam | |
| 27 | + private String serviceStatus; | |
| 28 | + //ๅนด้พ | |
| 29 | + private String age; | |
| 30 | + //ๅญๅจ | |
| 31 | + private String dueWeek; | |
| 32 | + //้ฃ้ฉ็ญ็บง | |
| 33 | + private String rLevel; | |
| 34 | + private Integer score; | |
| 35 | + private String riskFactor; | |
| 36 | + | |
| 37 | + public String getAge() { | |
| 38 | + return age; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public void setAge(String age) { | |
| 42 | + this.age = age; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public String getDueWeek() { | |
| 46 | + return dueWeek; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public void setDueWeek(String dueWeek) { | |
| 50 | + this.dueWeek = dueWeek; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public String getRiskFactor() { | |
| 54 | + return riskFactor; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public void setRiskFactor(String riskFactor) { | |
| 58 | + this.riskFactor = riskFactor; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public String getrLevel() { | |
| 62 | + return rLevel; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public void setrLevel(String rLevel) { | |
| 66 | + this.rLevel = rLevel; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public Integer getScore() { | |
| 70 | + return score; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public void setScore(Integer score) { | |
| 74 | + this.score = score; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public String getCardNo() { | |
| 78 | + return cardNo; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public void setCardNo(String cardNo) { | |
| 82 | + this.cardNo = cardNo; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public String getName() { | |
| 86 | + return name; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public void setName(String name) { | |
| 90 | + this.name = name; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public String getServiceStatus() { | |
| 94 | + return serviceStatus; | |
| 95 | + } | |
| 96 | + | |
| 97 | + public void setServiceStatus(String serviceStatus) { | |
| 98 | + this.serviceStatus = serviceStatus; | |
| 99 | + } | |
| 100 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/ApplyOrderInResult.java
View file @
718af3c
| 1 | +package com.lyms.platform.operate.web.result; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.base.IBasicResultConvert; | |
| 4 | +import com.lyms.platform.common.enums.ApplyOrderStatusEnums; | |
| 5 | +import com.lyms.platform.common.utils.DateUtil; | |
| 6 | +import com.lyms.platform.pojo.ReferralApplyOrderModel; | |
| 7 | + | |
| 8 | +import java.util.List; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * ้ซๅฑ่ฝฌ่ฏ(่ฝฌๅ ฅ) | |
| 12 | + * Created by Administrator on 2016/6/27 0027. | |
| 13 | + */ | |
| 14 | +public class ApplyOrderInResult implements IBasicResultConvert<ApplyOrderInResult,ReferralApplyOrderModel> { | |
| 15 | + private String id; | |
| 16 | + //ๅๅญ | |
| 17 | + private String name; | |
| 18 | + //ๅญๅจ | |
| 19 | + private String dueWeek; | |
| 20 | + private String age; | |
| 21 | + //้ขไบงๆ | |
| 22 | + private String dueDate; | |
| 23 | + //้ซๅฑ็ญ็บง | |
| 24 | + private String rLevel; | |
| 25 | + //้ฃ้ฉๅ ็ด | |
| 26 | + private List<String> rRisk; | |
| 27 | + private Integer score; | |
| 28 | + //็ ๆ ๆ่ฟฐ | |
| 29 | + private String diseaseDesc; | |
| 30 | + //่ฝฌ้ขๅฟ ่ฆๆง | |
| 31 | + private String transferredDisease; | |
| 32 | + //ๆฝๅจ้ฃ้ฉ | |
| 33 | + private String potentialRisk; | |
| 34 | + //่ฝฌ้ขๆนๅผ | |
| 35 | + private String transferMode; | |
| 36 | + //็ณ่ฏทๅป็ | |
| 37 | + private String applyDoctor; | |
| 38 | + //ๆฅๆถๆฅๆ | |
| 39 | + private String received; | |
| 40 | + //ๅๅปบๆถ้ด | |
| 41 | + private String created; | |
| 42 | + private String status; | |
| 43 | + | |
| 44 | + public String getAge() { | |
| 45 | + return age; | |
| 46 | + } | |
| 47 | + | |
| 48 | + public void setAge(String age) { | |
| 49 | + this.age = age; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public String getStatus() { | |
| 53 | + return status; | |
| 54 | + } | |
| 55 | + | |
| 56 | + public void setStatus(String status) { | |
| 57 | + this.status = status; | |
| 58 | + } | |
| 59 | + | |
| 60 | + public String getApplyDoctor() { | |
| 61 | + return applyDoctor; | |
| 62 | + } | |
| 63 | + | |
| 64 | + public void setApplyDoctor(String applyDoctor) { | |
| 65 | + this.applyDoctor = applyDoctor; | |
| 66 | + } | |
| 67 | + | |
| 68 | + public String getCreated() { | |
| 69 | + return created; | |
| 70 | + } | |
| 71 | + | |
| 72 | + public void setCreated(String created) { | |
| 73 | + this.created = created; | |
| 74 | + } | |
| 75 | + | |
| 76 | + public String getDiseaseDesc() { | |
| 77 | + return diseaseDesc; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public void setDiseaseDesc(String diseaseDesc) { | |
| 81 | + this.diseaseDesc = diseaseDesc; | |
| 82 | + } | |
| 83 | + | |
| 84 | + public String getDueDate() { | |
| 85 | + return dueDate; | |
| 86 | + } | |
| 87 | + | |
| 88 | + public void setDueDate(String dueDate) { | |
| 89 | + this.dueDate = dueDate; | |
| 90 | + } | |
| 91 | + | |
| 92 | + public String getDueWeek() { | |
| 93 | + return dueWeek; | |
| 94 | + } | |
| 95 | + | |
| 96 | + public void setDueWeek(String dueWeek) { | |
| 97 | + this.dueWeek = dueWeek; | |
| 98 | + } | |
| 99 | + | |
| 100 | + public String getId() { | |
| 101 | + return id; | |
| 102 | + } | |
| 103 | + | |
| 104 | + public void setId(String id) { | |
| 105 | + this.id = id; | |
| 106 | + } | |
| 107 | + | |
| 108 | + public String getName() { | |
| 109 | + return name; | |
| 110 | + } | |
| 111 | + | |
| 112 | + public void setName(String name) { | |
| 113 | + this.name = name; | |
| 114 | + } | |
| 115 | + | |
| 116 | + public String getPotentialRisk() { | |
| 117 | + return potentialRisk; | |
| 118 | + } | |
| 119 | + | |
| 120 | + public void setPotentialRisk(String potentialRisk) { | |
| 121 | + this.potentialRisk = potentialRisk; | |
| 122 | + } | |
| 123 | + | |
| 124 | + public String getReceived() { | |
| 125 | + return received; | |
| 126 | + } | |
| 127 | + | |
| 128 | + public void setReceived(String received) { | |
| 129 | + this.received = received; | |
| 130 | + } | |
| 131 | + | |
| 132 | + public String getrLevel() { | |
| 133 | + return rLevel; | |
| 134 | + } | |
| 135 | + | |
| 136 | + public void setrLevel(String rLevel) { | |
| 137 | + this.rLevel = rLevel; | |
| 138 | + } | |
| 139 | + | |
| 140 | + public List<String> getrRisk() { | |
| 141 | + return rRisk; | |
| 142 | + } | |
| 143 | + | |
| 144 | + public void setrRisk(List<String> rRisk) { | |
| 145 | + this.rRisk = rRisk; | |
| 146 | + } | |
| 147 | + | |
| 148 | + public Integer getScore() { | |
| 149 | + return score; | |
| 150 | + } | |
| 151 | + | |
| 152 | + public void setScore(Integer score) { | |
| 153 | + this.score = score; | |
| 154 | + } | |
| 155 | + | |
| 156 | + public String getTransferMode() { | |
| 157 | + return transferMode; | |
| 158 | + } | |
| 159 | + | |
| 160 | + public void setTransferMode(String transferMode) { | |
| 161 | + this.transferMode = transferMode; | |
| 162 | + } | |
| 163 | + | |
| 164 | + public String getTransferredDisease() { | |
| 165 | + return transferredDisease; | |
| 166 | + } | |
| 167 | + | |
| 168 | + public void setTransferredDisease(String transferredDisease) { | |
| 169 | + this.transferredDisease = transferredDisease; | |
| 170 | + } | |
| 171 | + | |
| 172 | + @Override | |
| 173 | + public ApplyOrderInResult convertToResult(ReferralApplyOrderModel destModel) { | |
| 174 | + setId(destModel.getId()); | |
| 175 | + setName(destModel.getName()); | |
| 176 | + setScore(destModel.getScore()); | |
| 177 | + setrLevel(destModel.getrLevel()); | |
| 178 | + setDueWeek(destModel.getDueWeek()); | |
| 179 | + setrRisk(destModel.getrRisk()); | |
| 180 | + setDueDate(DateUtil.getYmd(destModel.getDueDate())); | |
| 181 | + setApplyDoctor(destModel.getApplyDoctor()); | |
| 182 | + setCreated(DateUtil.getYmd(destModel.getCreated())); | |
| 183 | + setDiseaseDesc(destModel.getDiseaseDesc()); | |
| 184 | + setTransferMode(destModel.getTransferMode()); | |
| 185 | + setTransferredDisease(destModel.getTransferredDisease()); | |
| 186 | + setPotentialRisk(destModel.getPotentialRisk()); | |
| 187 | + setStatus(ApplyOrderStatusEnums.getTitle(destModel.getStatus())); | |
| 188 | + return this; | |
| 189 | + } | |
| 190 | +} |