Commit 63b194a942d45215598cf0461c9872fe4cc7d743
1 parent
9d70fdf6ad
Exists in
master
and in
6 other branches
两癌
Showing 3 changed files with 261 additions and 3 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CancerScreeningController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CancerScreeningFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/CancerExamineRequest.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CancerScreeningController.java
View file @
63b194a
| ... | ... | @@ -7,10 +7,9 @@ |
| 7 | 7 | import com.lyms.platform.common.utils.StringUtils; |
| 8 | 8 | import com.lyms.platform.operate.web.facade.CancerScreeningFacade; |
| 9 | 9 | import com.lyms.platform.operate.web.request.BreastAfterVisitRequest; |
| 10 | +import com.lyms.platform.operate.web.request.CancerExamineRequest; | |
| 10 | 11 | import com.lyms.platform.operate.web.request.CancerScreeningRequest; |
| 11 | -import com.lyms.platform.pojo.BreastAfterVisitRecordModel; | |
| 12 | -import com.lyms.platform.pojo.CancerScreeningModel; | |
| 13 | -import com.lyms.platform.pojo.CancersConfig; | |
| 12 | +import com.lyms.platform.pojo.*; | |
| 14 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 15 | 14 | import org.springframework.stereotype.Controller; |
| 16 | 15 | import org.springframework.web.bind.annotation.*; |
| ... | ... | @@ -216,6 +215,41 @@ |
| 216 | 215 | public BaseResponse delCancersConfig(@PathVariable String id, HttpServletRequest request) { |
| 217 | 216 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 218 | 217 | return cancerScreenService.delCancersConfig(id, loginState.getId()); |
| 218 | + } | |
| 219 | + | |
| 220 | + | |
| 221 | + @ResponseBody | |
| 222 | + @RequestMapping(method = RequestMethod.POST,value = "/addCancerExamine") | |
| 223 | + @TokenRequired | |
| 224 | + public BaseResponse addCancerExamine(@RequestBody CancerExamineModel config, HttpServletRequest request) { | |
| 225 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 226 | + return cancerScreenService.addCancerExamine(config, loginState.getId()); | |
| 227 | + } | |
| 228 | + | |
| 229 | + | |
| 230 | + @ResponseBody | |
| 231 | + @RequestMapping(method = RequestMethod.GET,value = "/queryCancerExamines") | |
| 232 | + @TokenRequired | |
| 233 | + public BaseResponse queryCancerExamines(CancerExamineRequest cancerExamineRequest, HttpServletRequest request) { | |
| 234 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 235 | + return cancerScreenService.queryCancerExamines(cancerExamineRequest, loginState.getId()); | |
| 236 | + } | |
| 237 | + | |
| 238 | + | |
| 239 | + @ResponseBody | |
| 240 | + @RequestMapping(method = RequestMethod.POST,value = "/addCancerExamineRecord") | |
| 241 | + @TokenRequired | |
| 242 | + public BaseResponse addCancerExamineRecord(@RequestBody CancerExamineRecordModel config, HttpServletRequest request) { | |
| 243 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 244 | + return cancerScreenService.addCancerExamineRecord(config, loginState.getId()); | |
| 245 | + } | |
| 246 | + | |
| 247 | + @ResponseBody | |
| 248 | + @RequestMapping(method = RequestMethod.GET,value = "/queryCancerExamineRecord/{parentId}") | |
| 249 | + @TokenRequired | |
| 250 | + public BaseResponse queryCancerExamineRecord(@PathVariable String parentId, HttpServletRequest request) { | |
| 251 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 252 | + return cancerScreenService.queryCancerExamineRecord(parentId, loginState.getId()); | |
| 219 | 253 | } |
| 220 | 254 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CancerScreeningFacade.java
View file @
63b194a
| ... | ... | @@ -12,6 +12,7 @@ |
| 12 | 12 | import com.lyms.platform.common.result.RespBuilder; |
| 13 | 13 | import com.lyms.platform.common.utils.*; |
| 14 | 14 | import com.lyms.platform.operate.web.request.BreastAfterVisitRequest; |
| 15 | +import com.lyms.platform.operate.web.request.CancerExamineRequest; | |
| 15 | 16 | import com.lyms.platform.operate.web.request.CancerScreeningRequest; |
| 16 | 17 | import com.lyms.platform.operate.web.result.CancerScreeningResult; |
| 17 | 18 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
| ... | ... | @@ -1033,6 +1034,105 @@ |
| 1033 | 1034 | } |
| 1034 | 1035 | } |
| 1035 | 1036 | |
| 1037 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(datas); | |
| 1038 | + } | |
| 1039 | + | |
| 1040 | + public BaseResponse addCancerExamine(CancerExamineModel cancerExamineModel, Integer userId) { | |
| 1041 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 1042 | + Organization organization = organizationService.getOrganization(Integer.parseInt(hospitalId)); | |
| 1043 | + cancerExamineModel.setHospitalId(hospitalId); | |
| 1044 | + cancerExamineModel.setProvinceId(organization.getProvinceId()); | |
| 1045 | + cancerExamineModel.setCityId(organization.getCityId()); | |
| 1046 | + cancerExamineModel.setAreaId(organization.getAreaId()); | |
| 1047 | + cancerExamineModel.setPosition(1); | |
| 1048 | + cancerExamineModel.setStatus(0); | |
| 1049 | + mongoTemplate.save(cancerExamineModel); | |
| 1050 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 1051 | + } | |
| 1052 | + | |
| 1053 | + public BaseResponse queryCancerExamines(CancerExamineRequest request, Integer userId) { | |
| 1054 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 1055 | + Organization organization = organizationService.getOrganization(Integer.parseInt(hospitalId)); | |
| 1056 | + Query query = new Query(); | |
| 1057 | + if (request.getPosition() == 1) | |
| 1058 | + { | |
| 1059 | + Criteria c = Criteria.where("hospitalId").is(hospitalId); | |
| 1060 | + query.addCriteria(c); | |
| 1061 | + } | |
| 1062 | + else if (request.getPosition() == 2) | |
| 1063 | + { | |
| 1064 | + Criteria c = Criteria.where("areaId").is(organization.getAreaId()); | |
| 1065 | + query.addCriteria(c); | |
| 1066 | + } | |
| 1067 | + else if (request.getPosition() == 3) | |
| 1068 | + { | |
| 1069 | + Criteria c = Criteria.where("cityId").is(organization.getCityId()); | |
| 1070 | + query.addCriteria(c); | |
| 1071 | + } | |
| 1072 | + Criteria c = Criteria.where("type").is(request.getType()); | |
| 1073 | + query.addCriteria(c); | |
| 1074 | + List<CancerExamineModel> list = mongoTemplate.find(query, CancerExamineModel.class); | |
| 1075 | + List<Map> datas = new ArrayList<>(); | |
| 1076 | + if (CollectionUtils.isNotEmpty(list)) | |
| 1077 | + { | |
| 1078 | + for (CancerExamineModel cancer : list) | |
| 1079 | + { | |
| 1080 | + Map data = new LinkedHashMap(); | |
| 1081 | + data.put("id",cancer.getId()); | |
| 1082 | + data.put("year",cancer.getYear()); | |
| 1083 | + data.put("quarter",cancer.getQuarter()); | |
| 1084 | + data.put("address",CommonsHelper.getResidence(cancer.getProvinceId(),cancer.getCityId(),cancer.getAreaId(),null,"",basicConfigService)); | |
| 1085 | + data.put("optHospital",cancer.getOptHospital()); | |
| 1086 | + data.put("optUser",cancer.getOptUser()); | |
| 1087 | + data.put("optDate",DateUtil.getyyyy_MM_dd(cancer.getOptDate())); | |
| 1088 | + data.put("examineDate",DateUtil.getyyyy_MM_dd(cancer.getExamineDate())); | |
| 1089 | + data.put("positionStr",cancer.getPosition() == 1 ? "机构" : (cancer.getPosition() == 2 ? "县级" : "市级")); | |
| 1090 | + | |
| 1091 | + data.put("position",cancer.getPosition()); | |
| 1092 | + data.put("status",cancer.getStatus()); | |
| 1093 | + datas.add(data); | |
| 1094 | + } | |
| 1095 | + } | |
| 1096 | + | |
| 1097 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(datas); | |
| 1098 | + } | |
| 1099 | + | |
| 1100 | + public BaseResponse addCancerExamineRecord(CancerExamineRecordModel recordModel, Integer userId) { | |
| 1101 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 1102 | + recordModel.setHospitalId(hospitalId); | |
| 1103 | + mongoTemplate.save(recordModel); | |
| 1104 | + | |
| 1105 | + CancerExamineModel cancerExamineModel = mongoTemplate.findOne(Query.query(Criteria.where("id").is(recordModel.getParentId())), CancerExamineModel.class); | |
| 1106 | + cancerExamineModel.setExamineDate(recordModel.getExamineDate()); | |
| 1107 | + cancerExamineModel.setStatus(recordModel.getReasult()); | |
| 1108 | + cancerExamineModel.setPosition(recordModel.getExamineLevel()); | |
| 1109 | + Update update=MongoConvertHelper | |
| 1110 | + .convertToNativeUpdate(ReflectionUtils.getUpdateField(cancerExamineModel)); | |
| 1111 | + mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(cancerExamineModel.getId())), update, CancerExamineModel.class); | |
| 1112 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 1113 | + | |
| 1114 | + } | |
| 1115 | + | |
| 1116 | + public BaseResponse queryCancerExamineRecord(String parentId, Integer userId) { | |
| 1117 | + List<Map> datas = new ArrayList<>(); | |
| 1118 | + Query query = new Query(); | |
| 1119 | + Criteria c = Criteria.where("parentId").is(parentId); | |
| 1120 | + query.addCriteria(c); | |
| 1121 | + List<CancerExamineRecordModel> list = mongoTemplate.find(query, CancerExamineRecordModel.class); | |
| 1122 | + if (CollectionUtils.isNotEmpty(list)) | |
| 1123 | + { | |
| 1124 | + for (CancerExamineRecordModel model : list) | |
| 1125 | + { | |
| 1126 | + Map data = new LinkedHashMap(); | |
| 1127 | + data.put("examineLevel",model.getExamineLevel() == 2 ? "县" : "市"); | |
| 1128 | + data.put("result",model.getReasult() == 2 ? "通过" : "驳回"); | |
| 1129 | + data.put("backReason",model.getBackReason() == null ? "" : model.getBackReason()); | |
| 1130 | + data.put("examineDate",DateUtil.getyyyy_MM_dd(model.getExamineDate())); | |
| 1131 | + data.put("id",model.getId()); | |
| 1132 | + data.put("parentId",model.getParentId()); | |
| 1133 | + datas.add(data); | |
| 1134 | + } | |
| 1135 | + } | |
| 1036 | 1136 | return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功").setData(datas); |
| 1037 | 1137 | } |
| 1038 | 1138 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/CancerExamineRequest.java
View file @
63b194a
| 1 | +package com.lyms.platform.operate.web.request; | |
| 2 | + | |
| 3 | + | |
| 4 | +public class CancerExamineRequest { | |
| 5 | + private String hospitalId; | |
| 6 | + private String provinceId; | |
| 7 | + private String cityId; | |
| 8 | + private String areaId; | |
| 9 | + | |
| 10 | + private Integer year; //上报年份 | |
| 11 | + private Integer quarter; //季度 | |
| 12 | + private String optUser; //录入用户 | |
| 13 | + private String optHospital; //录入单位 | |
| 14 | + private String optDate; //录入时间 | |
| 15 | + private Integer type;//1 宫颈癌 2 乳腺癌 | |
| 16 | + | |
| 17 | + private String examineDate;//审核时间/驳回时间 | |
| 18 | + private Integer position;//1 机构 2 县 3 市 | |
| 19 | + private Integer status; // 0 录入 1 审核中 2 审核通过 3 驳回 | |
| 20 | + | |
| 21 | + public String getHospitalId() { | |
| 22 | + return hospitalId; | |
| 23 | + } | |
| 24 | + | |
| 25 | + public void setHospitalId(String hospitalId) { | |
| 26 | + this.hospitalId = hospitalId; | |
| 27 | + } | |
| 28 | + | |
| 29 | + public String getProvinceId() { | |
| 30 | + return provinceId; | |
| 31 | + } | |
| 32 | + | |
| 33 | + public void setProvinceId(String provinceId) { | |
| 34 | + this.provinceId = provinceId; | |
| 35 | + } | |
| 36 | + | |
| 37 | + public String getCityId() { | |
| 38 | + return cityId; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public void setCityId(String cityId) { | |
| 42 | + this.cityId = cityId; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public String getAreaId() { | |
| 46 | + return areaId; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public void setAreaId(String areaId) { | |
| 50 | + this.areaId = areaId; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public Integer getYear() { | |
| 54 | + return year; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public void setYear(Integer year) { | |
| 58 | + this.year = year; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public Integer getQuarter() { | |
| 62 | + return quarter; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public void setQuarter(Integer quarter) { | |
| 66 | + this.quarter = quarter; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public String getOptUser() { | |
| 70 | + return optUser; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public void setOptUser(String optUser) { | |
| 74 | + this.optUser = optUser; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public String getOptHospital() { | |
| 78 | + return optHospital; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public void setOptHospital(String optHospital) { | |
| 82 | + this.optHospital = optHospital; | |
| 83 | + } | |
| 84 | + | |
| 85 | + public String getOptDate() { | |
| 86 | + return optDate; | |
| 87 | + } | |
| 88 | + | |
| 89 | + public void setOptDate(String optDate) { | |
| 90 | + this.optDate = optDate; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public Integer getType() { | |
| 94 | + return type; | |
| 95 | + } | |
| 96 | + | |
| 97 | + public void setType(Integer type) { | |
| 98 | + this.type = type; | |
| 99 | + } | |
| 100 | + | |
| 101 | + public String getExamineDate() { | |
| 102 | + return examineDate; | |
| 103 | + } | |
| 104 | + | |
| 105 | + public void setExamineDate(String examineDate) { | |
| 106 | + this.examineDate = examineDate; | |
| 107 | + } | |
| 108 | + | |
| 109 | + public Integer getPosition() { | |
| 110 | + return position; | |
| 111 | + } | |
| 112 | + | |
| 113 | + public void setPosition(Integer position) { | |
| 114 | + this.position = position; | |
| 115 | + } | |
| 116 | + | |
| 117 | + public Integer getStatus() { | |
| 118 | + return status; | |
| 119 | + } | |
| 120 | + | |
| 121 | + public void setStatus(Integer status) { | |
| 122 | + this.status = status; | |
| 123 | + } | |
| 124 | +} |