Commit 887e89e1cd997f661ed51ce0d76d9114c61fae5d
1 parent
fb1161a03b
Exists in
master
and in
8 other branches
platform permission
fix bug
Showing 3 changed files with 98 additions and 5 deletions
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/AssayConfigService.java
View file @
887e89e
| ... | ... | @@ -21,14 +21,21 @@ |
| 21 | 21 | |
| 22 | 22 | public List<AssayConfig> query(AssayConfigParam assayConfigRequest) { |
| 23 | 23 | MongoCondition mongoCondition = MongoCondition.newInstance(); |
| 24 | - if(0 != assayConfigRequest.getType()) { | |
| 25 | - mongoCondition.andCondition(new MongoCondition("type", assayConfigRequest.getType(), MongoOper.IS)); | |
| 24 | + | |
| 25 | + if(1 == assayConfigRequest.getType()) { | |
| 26 | + mongoCondition=MongoCondition.newInstance("projectName", assayConfigRequest.getKeywords(), MongoOper.LIKE); | |
| 26 | 27 | } |
| 27 | - if(null != assayConfigRequest.getKeywords()) { | |
| 28 | - mongoCondition.andCondition(new MongoCondition("keywords", assayConfigRequest.getKeywords(), MongoOper.LIKE)); | |
| 28 | + if(2 == assayConfigRequest.getType()) { | |
| 29 | + mongoCondition=MongoCondition.newInstance("projectCode", assayConfigRequest.getKeywords(), MongoOper.IS); | |
| 29 | 30 | } |
| 31 | + if(3 == assayConfigRequest.getType()) { | |
| 32 | + mongoCondition=MongoCondition.newInstance("standardCode", assayConfigRequest.getKeywords(), MongoOper.IS); | |
| 33 | + } | |
| 34 | +// if(null != assayConfigRequest.getKeywords()) { | |
| 35 | +// mongoCondition= mongoCondition.and("projectName", assayConfigRequest.getKeywords(), MongoOper.LIKE); | |
| 36 | +// } | |
| 30 | 37 | if(null != assayConfigRequest.getHospitalId()) { |
| 31 | - mongoCondition.andCondition(new MongoCondition("hospitalId", assayConfigRequest.getHospitalId(), MongoOper.IS)); | |
| 38 | + mongoCondition= mongoCondition.and("hospitalId", assayConfigRequest.getHospitalId(), MongoOper.IS); | |
| 32 | 39 | } |
| 33 | 40 | |
| 34 | 41 | return assayConfigDao.query(mongoCondition.toMongoQuery().start(0).end(100)); |
platform-dal/src/main/java/com/lyms/platform/pojo/AssayConfig.java
View file @
887e89e
| ... | ... | @@ -14,6 +14,66 @@ |
| 14 | 14 | |
| 15 | 15 | private String print; |
| 16 | 16 | |
| 17 | + private String hospitalId; | |
| 18 | + private String projectCode; | |
| 19 | + private String standardCode; | |
| 20 | + private String projectName; | |
| 21 | + private String classify; //检验分类 | |
| 22 | + private String resultType; //结果类型 | |
| 23 | + | |
| 24 | + | |
| 25 | + public static long getSerialVersionUID() { | |
| 26 | + return serialVersionUID; | |
| 27 | + } | |
| 28 | + | |
| 29 | + public String getHospitalId() { | |
| 30 | + return hospitalId; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public void setHospitalId(String hospitalId) { | |
| 34 | + this.hospitalId = hospitalId; | |
| 35 | + } | |
| 36 | + | |
| 37 | + public String getProjectCode() { | |
| 38 | + return projectCode; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public void setProjectCode(String projectCode) { | |
| 42 | + this.projectCode = projectCode; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public String getStandardCode() { | |
| 46 | + return standardCode; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public void setStandardCode(String standardCode) { | |
| 50 | + this.standardCode = standardCode; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public String getProjectName() { | |
| 54 | + return projectName; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public void setProjectName(String projectName) { | |
| 58 | + this.projectName = projectName; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public String getClassify() { | |
| 62 | + return classify; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public void setClassify(String classify) { | |
| 66 | + this.classify = classify; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public String getResultType() { | |
| 70 | + return resultType; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public void setResultType(String resultType) { | |
| 74 | + this.resultType = resultType; | |
| 75 | + } | |
| 76 | + | |
| 17 | 77 | public String getPrint() { |
| 18 | 78 | return print; |
| 19 | 79 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AssayConfigController.java
View file @
887e89e
| ... | ... | @@ -2,14 +2,20 @@ |
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | import com.lyms.platform.biz.service.AssayConfigService; |
| 5 | +import com.lyms.platform.common.annotation.TokenRequired; | |
| 5 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 7 | +import com.lyms.platform.common.enums.YnEnums; | |
| 6 | 8 | import com.lyms.platform.common.result.BaseListResponse; |
| 9 | +import com.lyms.platform.common.utils.ResultUtils; | |
| 7 | 10 | import com.lyms.platform.params.AssayConfigParam; |
| 8 | 11 | import com.lyms.platform.pojo.AssayConfig; |
| 12 | +import org.jboss.netty.handler.codec.http.HttpResponse; | |
| 9 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | 14 | import org.springframework.stereotype.Controller; |
| 11 | 15 | import org.springframework.web.bind.annotation.*; |
| 12 | 16 | |
| 17 | +import javax.servlet.http.HttpServletRequest; | |
| 18 | +import javax.servlet.http.HttpServletResponse; | |
| 13 | 19 | import java.util.List; |
| 14 | 20 | |
| 15 | 21 | //化验项配置 |
| ... | ... | @@ -21,6 +27,7 @@ |
| 21 | 27 | |
| 22 | 28 | @RequestMapping(method = RequestMethod.GET, value = "/assayconfig") |
| 23 | 29 | @ResponseBody |
| 30 | + @TokenRequired | |
| 24 | 31 | public BaseListResponse assayConfig(AssayConfigParam assayConfigParam) { |
| 25 | 32 | List<AssayConfig> data = assayConfigService.query(assayConfigParam); |
| 26 | 33 | BaseListResponse baseListResponse = new BaseListResponse(); |
| 27 | 34 | |
| ... | ... | @@ -32,12 +39,31 @@ |
| 32 | 39 | |
| 33 | 40 | @RequestMapping(method = RequestMethod.PUT, value = "/assayconfig") |
| 34 | 41 | @ResponseBody |
| 42 | + @TokenRequired | |
| 35 | 43 | public BaseListResponse assayConfig(@RequestBody List<AssayConfig> assayConfigs) { |
| 36 | 44 | assayConfigService.updateForList(assayConfigs); |
| 37 | 45 | BaseListResponse baseListResponse = new BaseListResponse(); |
| 38 | 46 | baseListResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 39 | 47 | baseListResponse.setErrormsg("成功"); |
| 40 | 48 | return baseListResponse; |
| 49 | + } | |
| 50 | + | |
| 51 | + @RequestMapping(method = RequestMethod.GET, value = "/assayconfig/test") | |
| 52 | + public void testData(HttpServletResponse response) { | |
| 53 | + for(int i=0;i<10;i++) { | |
| 54 | + AssayConfig assayConfig = new AssayConfig(); | |
| 55 | + assayConfig.setHospitalId("2"); | |
| 56 | + assayConfig.setYn(String.valueOf(YnEnums.YES.getId())); | |
| 57 | + assayConfig.setClassify("classify" + i); | |
| 58 | + assayConfig.setPrint("1"); | |
| 59 | + assayConfig.setProjectCode("projectCode" + i); | |
| 60 | + assayConfig.setResultType("resulttype" + i); | |
| 61 | + assayConfig.setStandardCode("standardCode" + i); | |
| 62 | + | |
| 63 | + assayConfig.setProjectName("projectName" + i); | |
| 64 | + assayConfigService.save(assayConfig); | |
| 65 | + } | |
| 66 | + ResultUtils.buildSuccessResultAndWrite(response, "ok"); | |
| 41 | 67 | } |
| 42 | 68 | |
| 43 | 69 |