Commit af84b11004953e0274461cb16b75d060eec089bf
1 parent
15e6454e43
Exists in
master
and in
8 other branches
platform permission
add return pageinfo
Showing 9 changed files with 174 additions and 184 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/param/AssayConfigQuery.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/param/ReferConfigQuery.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AssayConfigService.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CommunityConfigService.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/ReferConfigService.java
- platform-dal/src/main/java/com/lyms/platform/params/AssayConfigParam.java
- platform-dal/src/main/java/com/lyms/platform/query/ReferConfigQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AssayConfigController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReferConfigController.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/param/AssayConfigQuery.java
View file @
af84b11
| 1 | +package com.lyms.platform.biz.param; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.core.annotation.form.Form; | |
| 4 | +import com.lyms.platform.common.dao.BaseQuery; | |
| 5 | + | |
| 6 | +@Form | |
| 7 | +public class AssayConfigQuery extends BaseQuery { | |
| 8 | + | |
| 9 | + private String hospitalId; | |
| 10 | + //1.按项目名称查询 2.项目代码 3.标准代码 | |
| 11 | + private int type; | |
| 12 | + private String keywords; | |
| 13 | + | |
| 14 | + | |
| 15 | + public String getHospitalId() { | |
| 16 | + return hospitalId; | |
| 17 | + } | |
| 18 | + | |
| 19 | + public void setHospitalId(String hospitalId) { | |
| 20 | + this.hospitalId = hospitalId; | |
| 21 | + } | |
| 22 | + | |
| 23 | + public int getType() { | |
| 24 | + return type; | |
| 25 | + } | |
| 26 | + | |
| 27 | + public void setType(int type) { | |
| 28 | + this.type = type; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public String getKeywords() { | |
| 32 | + return keywords; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public void setKeywords(String keywords) { | |
| 36 | + this.keywords = keywords; | |
| 37 | + } | |
| 38 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/param/ReferConfigQuery.java
View file @
af84b11
| 1 | +package com.lyms.platform.biz.param; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.dao.BaseQuery; | |
| 4 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
| 5 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
| 6 | +import com.lyms.platform.common.dao.operator.MongoQuery; | |
| 7 | + | |
| 8 | +import javax.validation.constraints.NotNull; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * Created by Zhang.Rui on 2016/3/17. | |
| 12 | + * 参考值查询对象 | |
| 13 | + */ | |
| 14 | +public class ReferConfigQuery extends BaseQuery { | |
| 15 | + @NotNull(message = "医院ID不能为空") | |
| 16 | + private Integer hospitalId; | |
| 17 | + private String id; | |
| 18 | + private Integer codeType;//1:项目代码2:标准代码 3:项目名称 | |
| 19 | + private String keyword; | |
| 20 | + private Integer referVal;//1已设置2未设置3全部 | |
| 21 | + private Integer emergencyVal;//1已设置2未设置3全部 | |
| 22 | + private Integer yn; | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + public MongoQuery convertToQuery() { | |
| 27 | + MongoCondition condition = MongoCondition.newInstance(); | |
| 28 | + | |
| 29 | + if (null != hospitalId) { | |
| 30 | + condition.and("hospitalId", hospitalId, MongoOper.IS); | |
| 31 | + } | |
| 32 | + if (null != codeType && null != keyword) { | |
| 33 | + if(1 == codeType) { | |
| 34 | + condition.and("code", keyword, MongoOper.LIKE); | |
| 35 | + } else if(2 == codeType) { | |
| 36 | + condition.and("standardCode", keyword, MongoOper.LIKE); | |
| 37 | + } else if(3 == codeType) { | |
| 38 | + condition.and("name", keyword, MongoOper.LIKE); | |
| 39 | + } | |
| 40 | + } | |
| 41 | + if (null != referVal) { | |
| 42 | + if(1 == referVal) { | |
| 43 | + condition.and("charRefer", null, MongoOper.NE); | |
| 44 | + } else if(2 == referVal) { | |
| 45 | + condition.and("charRefer", null, MongoOper.IS); | |
| 46 | + } | |
| 47 | + } | |
| 48 | + if (null != emergencyVal) { | |
| 49 | + if(1 == emergencyVal) { | |
| 50 | + condition.and("emergencyChar", null, MongoOper.NE); | |
| 51 | + } else if(2 == emergencyVal) { | |
| 52 | + condition.and("emergencyChar", null, MongoOper.IS); | |
| 53 | + } | |
| 54 | + } | |
| 55 | + | |
| 56 | + if(null != yn) { | |
| 57 | + condition.and("yn", yn, MongoOper.IS); | |
| 58 | + } | |
| 59 | + if(null != id) { | |
| 60 | + condition.and("id", id, MongoOper.IS); | |
| 61 | + } | |
| 62 | + | |
| 63 | + return condition.toMongoQuery(); | |
| 64 | + } | |
| 65 | + | |
| 66 | + public String getId() { | |
| 67 | + return id; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public void setId(String id) { | |
| 71 | + this.id = id; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public Integer getYn() { | |
| 75 | + return yn; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public void setYn(Integer yn) { | |
| 79 | + this.yn = yn; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public Integer getHospitalId() { | |
| 83 | + return hospitalId; | |
| 84 | + } | |
| 85 | + | |
| 86 | + public void setHospitalId(Integer hospitalId) { | |
| 87 | + this.hospitalId = hospitalId; | |
| 88 | + } | |
| 89 | + | |
| 90 | + public Integer getCodeType() { | |
| 91 | + return codeType; | |
| 92 | + } | |
| 93 | + | |
| 94 | + public void setCodeType(Integer codeType) { | |
| 95 | + this.codeType = codeType; | |
| 96 | + } | |
| 97 | + | |
| 98 | + public String getKeyword() { | |
| 99 | + return keyword; | |
| 100 | + } | |
| 101 | + | |
| 102 | + public void setKeyword(String keyword) { | |
| 103 | + this.keyword = keyword; | |
| 104 | + } | |
| 105 | + | |
| 106 | + public Integer getReferVal() { | |
| 107 | + return referVal; | |
| 108 | + } | |
| 109 | + | |
| 110 | + public void setReferVal(Integer referVal) { | |
| 111 | + this.referVal = referVal; | |
| 112 | + } | |
| 113 | + | |
| 114 | + public Integer getEmergencyVal() { | |
| 115 | + return emergencyVal; | |
| 116 | + } | |
| 117 | + | |
| 118 | + public void setEmergencyVal(Integer emergencyVal) { | |
| 119 | + this.emergencyVal = emergencyVal; | |
| 120 | + } | |
| 121 | +} |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AssayConfigService.java
View file @
af84b11
| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | |
| 4 | 4 | import java.util.List; |
| 5 | 5 | |
| 6 | +import com.lyms.platform.biz.param.AssayConfigQuery; | |
| 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | 8 | import org.springframework.stereotype.Service; |
| 8 | 9 | |
| ... | ... | @@ -10,7 +11,6 @@ |
| 10 | 11 | import com.lyms.platform.common.dao.operator.MongoCondition; |
| 11 | 12 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 12 | 13 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 13 | -import com.lyms.platform.params.AssayConfigParam; | |
| 14 | 14 | import com.lyms.platform.pojo.AssayConfig; |
| 15 | 15 | |
| 16 | 16 | //化验项配置 |
| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | @Autowired |
| 20 | 20 | AssayConfigDao assayConfigDao; |
| 21 | 21 | |
| 22 | - public List<AssayConfig> query(AssayConfigParam assayConfigRequest) { | |
| 22 | + public List<AssayConfig> query(AssayConfigQuery assayConfigRequest) { | |
| 23 | 23 | MongoCondition mongoCondition = MongoCondition.newInstance(); |
| 24 | 24 | |
| 25 | 25 | if(1 == assayConfigRequest.getType()) { |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/CommunityConfigService.java
View file @
af84b11
| ... | ... | @@ -56,11 +56,10 @@ |
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | MongoQuery mongoQuery = mongoCondition.toMongoQuery(); |
| 59 | - BaseQuery baseQuery = new BaseQuery(); | |
| 60 | 59 | |
| 61 | 60 | if(null != communityQuery.getLimit()) { |
| 62 | - baseQuery.mysqlBuild((int) communityConfigDao.queryCount(mongoQuery)); | |
| 63 | - mongoQuery.start(baseQuery.getOffset()).end(baseQuery.getLimit()); | |
| 61 | + communityQuery.mysqlBuild((int) communityConfigDao.queryCount(mongoQuery)); | |
| 62 | + mongoQuery.start(communityQuery.getOffset()).end(communityQuery.getLimit()); | |
| 64 | 63 | } |
| 65 | 64 | |
| 66 | 65 | return communityConfigDao.queryArea(mongoQuery); |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/ReferConfigService.java
View file @
af84b11
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import java.util.List; |
| 4 | 4 | |
| 5 | +import com.lyms.platform.biz.param.ReferConfigQuery; | |
| 5 | 6 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | 8 | import org.springframework.stereotype.Service; |
| ... | ... | @@ -11,7 +12,6 @@ |
| 11 | 12 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 12 | 13 | import com.lyms.platform.common.enums.YnEnums; |
| 13 | 14 | import com.lyms.platform.pojo.ReferValue; |
| 14 | -import com.lyms.platform.query.ReferConfigQuery; | |
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Created by Zhang.Rui on 2016/3/17. |
platform-dal/src/main/java/com/lyms/platform/params/AssayConfigParam.java
View file @
af84b11
| 1 | -package com.lyms.platform.params; | |
| 2 | - | |
| 3 | -import com.lyms.platform.common.core.annotation.form.Form; | |
| 4 | -import com.lyms.platform.common.dao.BaseQuery; | |
| 5 | -import org.hibernate.validator.constraints.NotEmpty; | |
| 6 | - | |
| 7 | -@Form | |
| 8 | -public class AssayConfigParam extends BaseQuery { | |
| 9 | - | |
| 10 | - private String hospitalId; | |
| 11 | - //1.按项目名称查询 2.项目代码 3.标准代码 | |
| 12 | - private int type; | |
| 13 | - private String keywords; | |
| 14 | - | |
| 15 | - | |
| 16 | - public String getHospitalId() { | |
| 17 | - return hospitalId; | |
| 18 | - } | |
| 19 | - | |
| 20 | - public void setHospitalId(String hospitalId) { | |
| 21 | - this.hospitalId = hospitalId; | |
| 22 | - } | |
| 23 | - | |
| 24 | - public int getType() { | |
| 25 | - return type; | |
| 26 | - } | |
| 27 | - | |
| 28 | - public void setType(int type) { | |
| 29 | - this.type = type; | |
| 30 | - } | |
| 31 | - | |
| 32 | - public String getKeywords() { | |
| 33 | - return keywords; | |
| 34 | - } | |
| 35 | - | |
| 36 | - public void setKeywords(String keywords) { | |
| 37 | - this.keywords = keywords; | |
| 38 | - } | |
| 39 | -} |
platform-dal/src/main/java/com/lyms/platform/query/ReferConfigQuery.java
View file @
af84b11
| 1 | -package com.lyms.platform.query; | |
| 2 | - | |
| 3 | -import com.lyms.platform.common.dao.BaseQuery; | |
| 4 | -import com.lyms.platform.common.dao.operator.MongoCondition; | |
| 5 | -import com.lyms.platform.common.dao.operator.MongoOper; | |
| 6 | -import com.lyms.platform.common.dao.operator.MongoQuery; | |
| 7 | -import org.hibernate.validator.constraints.NotEmpty; | |
| 8 | - | |
| 9 | -import javax.validation.constraints.NotNull; | |
| 10 | - | |
| 11 | -/** | |
| 12 | - * Created by Zhang.Rui on 2016/3/17. | |
| 13 | - * 参考值查询对象 | |
| 14 | - */ | |
| 15 | -public class ReferConfigQuery extends BaseQuery { | |
| 16 | - @NotNull(message = "医院ID不能为空") | |
| 17 | - private Integer hospitalId; | |
| 18 | - private String id; | |
| 19 | - private Integer codeType;//1:项目代码2:标准代码 3:项目名称 | |
| 20 | - private String keyword; | |
| 21 | - private Integer referVal;//1已设置2未设置3全部 | |
| 22 | - private Integer emergencyVal;//1已设置2未设置3全部 | |
| 23 | - private Integer yn; | |
| 24 | - | |
| 25 | - | |
| 26 | - | |
| 27 | - public MongoQuery convertToQuery() { | |
| 28 | - MongoCondition condition = MongoCondition.newInstance(); | |
| 29 | - | |
| 30 | - if (null != hospitalId) { | |
| 31 | - condition.and("hospitalId", hospitalId, MongoOper.IS); | |
| 32 | - } | |
| 33 | - if (null != codeType && null != keyword) { | |
| 34 | - if(1 == codeType) { | |
| 35 | - condition.and("code", keyword, MongoOper.LIKE); | |
| 36 | - } else if(2 == codeType) { | |
| 37 | - condition.and("standardCode", keyword, MongoOper.LIKE); | |
| 38 | - } else if(3 == codeType) { | |
| 39 | - condition.and("name", keyword, MongoOper.LIKE); | |
| 40 | - } | |
| 41 | - } | |
| 42 | - if (null != referVal) { | |
| 43 | - if(1 == referVal) { | |
| 44 | - condition.and("charRefer", null, MongoOper.NE); | |
| 45 | - } else if(2 == referVal) { | |
| 46 | - condition.and("charRefer", null, MongoOper.IS); | |
| 47 | - } | |
| 48 | - } | |
| 49 | - if (null != emergencyVal) { | |
| 50 | - if(1 == emergencyVal) { | |
| 51 | - condition.and("emergencyChar", null, MongoOper.NE); | |
| 52 | - } else if(2 == emergencyVal) { | |
| 53 | - condition.and("emergencyChar", null, MongoOper.IS); | |
| 54 | - } | |
| 55 | - } | |
| 56 | - | |
| 57 | - if(null != yn) { | |
| 58 | - condition.and("yn", yn, MongoOper.IS); | |
| 59 | - } | |
| 60 | - if(null != id) { | |
| 61 | - condition.and("id", id, MongoOper.IS); | |
| 62 | - } | |
| 63 | - | |
| 64 | - return condition.toMongoQuery(); | |
| 65 | - } | |
| 66 | - | |
| 67 | - public String getId() { | |
| 68 | - return id; | |
| 69 | - } | |
| 70 | - | |
| 71 | - public void setId(String id) { | |
| 72 | - this.id = id; | |
| 73 | - } | |
| 74 | - | |
| 75 | - public Integer getYn() { | |
| 76 | - return yn; | |
| 77 | - } | |
| 78 | - | |
| 79 | - public void setYn(Integer yn) { | |
| 80 | - this.yn = yn; | |
| 81 | - } | |
| 82 | - | |
| 83 | - public Integer getHospitalId() { | |
| 84 | - return hospitalId; | |
| 85 | - } | |
| 86 | - | |
| 87 | - public void setHospitalId(Integer hospitalId) { | |
| 88 | - this.hospitalId = hospitalId; | |
| 89 | - } | |
| 90 | - | |
| 91 | - public Integer getCodeType() { | |
| 92 | - return codeType; | |
| 93 | - } | |
| 94 | - | |
| 95 | - public void setCodeType(Integer codeType) { | |
| 96 | - this.codeType = codeType; | |
| 97 | - } | |
| 98 | - | |
| 99 | - public String getKeyword() { | |
| 100 | - return keyword; | |
| 101 | - } | |
| 102 | - | |
| 103 | - public void setKeyword(String keyword) { | |
| 104 | - this.keyword = keyword; | |
| 105 | - } | |
| 106 | - | |
| 107 | - public Integer getReferVal() { | |
| 108 | - return referVal; | |
| 109 | - } | |
| 110 | - | |
| 111 | - public void setReferVal(Integer referVal) { | |
| 112 | - this.referVal = referVal; | |
| 113 | - } | |
| 114 | - | |
| 115 | - public Integer getEmergencyVal() { | |
| 116 | - return emergencyVal; | |
| 117 | - } | |
| 118 | - | |
| 119 | - public void setEmergencyVal(Integer emergencyVal) { | |
| 120 | - this.emergencyVal = emergencyVal; | |
| 121 | - } | |
| 122 | -} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AssayConfigController.java
View file @
af84b11
| 1 | 1 | package com.lyms.platform.operate.web.controller; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | +import com.lyms.platform.biz.param.AssayConfigQuery; | |
| 4 | 5 | import com.lyms.platform.biz.service.AssayConfigService; |
| 5 | 6 | import com.lyms.platform.common.annotation.TokenRequired; |
| 6 | 7 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 7 | 8 | import com.lyms.platform.common.enums.YnEnums; |
| 8 | 9 | import com.lyms.platform.common.result.BaseListResponse; |
| 9 | 10 | import com.lyms.platform.common.utils.ResultUtils; |
| 10 | -import com.lyms.platform.params.AssayConfigParam; | |
| 11 | +import com.lyms.platform.operate.web.result.FrontEndResult; | |
| 11 | 12 | import com.lyms.platform.pojo.AssayConfig; |
| 12 | -import org.jboss.netty.handler.codec.http.HttpResponse; | |
| 13 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | 14 | import org.springframework.stereotype.Controller; |
| 15 | 15 | import org.springframework.web.bind.annotation.*; |
| 16 | 16 | |
| 17 | -import javax.servlet.http.HttpServletRequest; | |
| 18 | 17 | import javax.servlet.http.HttpServletResponse; |
| 19 | 18 | import java.util.List; |
| 20 | 19 | |
| 21 | 20 | |
| ... | ... | @@ -28,13 +27,9 @@ |
| 28 | 27 | @RequestMapping(method = RequestMethod.GET, value = "/assayconfig") |
| 29 | 28 | @ResponseBody |
| 30 | 29 | @TokenRequired |
| 31 | - public BaseListResponse assayConfig(AssayConfigParam assayConfigParam) { | |
| 30 | + public FrontEndResult assayConfig(AssayConfigQuery assayConfigParam) { | |
| 32 | 31 | List<AssayConfig> data = assayConfigService.query(assayConfigParam); |
| 33 | - BaseListResponse baseListResponse = new BaseListResponse(); | |
| 34 | - baseListResponse.setData(data); | |
| 35 | - baseListResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 36 | - baseListResponse.setErrormsg("成功"); | |
| 37 | - return baseListResponse; | |
| 32 | + return FrontEndResult.ini().setData(data).setPageInfo(assayConfigParam.getPageInfo()).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 38 | 33 | } |
| 39 | 34 | |
| 40 | 35 | @RequestMapping(method = RequestMethod.PUT, value = "/assayconfig") |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReferConfigController.java
View file @
af84b11
| ... | ... | @@ -4,9 +4,10 @@ |
| 4 | 4 | |
| 5 | 5 | import javax.validation.Valid; |
| 6 | 6 | |
| 7 | +import com.lyms.platform.biz.param.ReferConfigQuery; | |
| 7 | 8 | import com.lyms.platform.common.annotation.TokenRequired; |
| 8 | 9 | import com.lyms.platform.common.enums.YnEnums; |
| 9 | -import com.lyms.platform.pojo.AssayConfig; | |
| 10 | +import com.lyms.platform.operate.web.result.FrontEndResult; | |
| 10 | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | 12 | import org.springframework.stereotype.Controller; |
| 12 | 13 | import org.springframework.web.bind.annotation.PathVariable; |
| ... | ... | @@ -21,7 +22,6 @@ |
| 21 | 22 | import com.lyms.platform.common.result.BaseListResponse; |
| 22 | 23 | import com.lyms.platform.common.result.BaseResponse; |
| 23 | 24 | import com.lyms.platform.pojo.ReferValue; |
| 24 | -import com.lyms.platform.query.ReferConfigQuery; | |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Created by Zhang.Rui on 2016/3/17. |
| 28 | 28 | |
| ... | ... | @@ -40,12 +40,10 @@ |
| 40 | 40 | @ResponseBody |
| 41 | 41 | @TokenRequired |
| 42 | 42 | @RequestMapping(value = "/referConfig",method = RequestMethod.GET) |
| 43 | - public BaseListResponse queryRefer( @Valid ReferConfigQuery referConfigQuery) { | |
| 43 | + public FrontEndResult queryRefer( @Valid ReferConfigQuery referConfigQuery) { | |
| 44 | 44 | referConfigQuery.setYn(YnEnums.YES.getId()); |
| 45 | 45 | List<ReferValue> referValueList = referConfigService.queryRefer(referConfigQuery); |
| 46 | - BaseListResponse baseListResponse = new BaseListResponse(); | |
| 47 | - baseListResponse.setData(referValueList).setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 48 | - return baseListResponse; | |
| 46 | + return FrontEndResult.ini().setData(referValueList).setPageInfo(referConfigQuery.getPageInfo()).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 49 | 47 | } |
| 50 | 48 | |
| 51 | 49 | @RequestMapping(value = "/referConfig",method = RequestMethod.POST) |