Commit 851bf663fed12f93df47142c69c33ffb5b891d79
1 parent
0d6658a3f2
Exists in
master
and in
1 other branch
修改controller名称
Showing 4 changed files with 779 additions and 779 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBookbuildingController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBookbuildingController.java
View file @
851bf66
| 1 | -package com.lyms.platform.operate.web.controller; | |
| 2 | - | |
| 3 | - | |
| 4 | -import com.lyms.platform.common.annotation.TokenRequired; | |
| 5 | -import com.lyms.platform.common.base.BaseController; | |
| 6 | -import com.lyms.platform.common.base.LoginContext; | |
| 7 | -import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 8 | -import com.lyms.platform.common.result.BaseListResponse; | |
| 9 | -import com.lyms.platform.common.result.BaseObjectResponse; | |
| 10 | -import com.lyms.platform.common.result.BaseResponse; | |
| 11 | -import com.lyms.platform.common.utils.StringUtils; | |
| 12 | -import com.lyms.platform.operate.web.facade.BabyBookbuildingFacade; | |
| 13 | -import com.lyms.platform.operate.web.request.*; | |
| 14 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 15 | -import org.springframework.stereotype.Controller; | |
| 16 | -import org.springframework.web.bind.annotation.*; | |
| 17 | - | |
| 18 | -import javax.servlet.http.HttpServletRequest; | |
| 19 | -import javax.servlet.http.HttpServletResponse; | |
| 20 | -import javax.validation.Valid; | |
| 21 | -import java.io.UnsupportedEncodingException; | |
| 22 | - | |
| 23 | - | |
| 24 | -/* | |
| 25 | - *儿童建档 | |
| 26 | - * lqy | |
| 27 | - * 2016-06-16 | |
| 28 | - */ | |
| 29 | -@Controller | |
| 30 | -public class BabyBookbuildingController extends BaseController { | |
| 31 | - | |
| 32 | - | |
| 33 | - @Autowired | |
| 34 | - private BabyBookbuildingFacade babyBookbuildingFacade; | |
| 35 | - | |
| 36 | - | |
| 37 | - /** | |
| 38 | - * 添加或者修改儿童建档 | |
| 39 | - * | |
| 40 | - * @param request | |
| 41 | - * @return | |
| 42 | - */ | |
| 43 | - @RequestMapping(method = RequestMethod.POST, value = "/addOrUpBabyBuild") | |
| 44 | - @ResponseBody | |
| 45 | - @TokenRequired | |
| 46 | - public BaseResponse addOrUpBabyBuild(@Valid @RequestBody BabyBookbuildingAddRequest request,HttpServletRequest httpServletRequest) { | |
| 47 | - LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
| 48 | - if (request != null && !StringUtils.isEmpty(request.getId())) { | |
| 49 | - return babyBookbuildingFacade.updateBabyBookbuilding(request,loginState.getId()); | |
| 50 | - } | |
| 51 | - return babyBookbuildingFacade.addBabyBookbuilding(request,loginState.getId()); | |
| 52 | - } | |
| 53 | - | |
| 54 | - | |
| 55 | - /** | |
| 56 | - * 删除儿童建档 | |
| 57 | - * | |
| 58 | - * @param id | |
| 59 | - * @return | |
| 60 | - */ | |
| 61 | - @RequestMapping(value = "/deleteBabyBuildById/{id}", method = RequestMethod.DELETE) | |
| 62 | - @ResponseBody | |
| 63 | - public BaseResponse deleteBabyBuildById(@PathVariable("id") String id) { | |
| 64 | - return babyBookbuildingFacade.deleteBabyBuildById(id); | |
| 65 | - | |
| 66 | - } | |
| 67 | - | |
| 68 | - | |
| 69 | - /** | |
| 70 | - * 查询儿童建档信息根据id查询 | |
| 71 | - * @param id | |
| 72 | - * @return | |
| 73 | - */ | |
| 74 | - @RequestMapping(value = "/queryBabyBuildById/{id}", method = RequestMethod.GET) | |
| 75 | - @ResponseBody | |
| 76 | - public BaseObjectResponse queryBabyBuildById(@PathVariable("id")String id){ | |
| 77 | - return babyBookbuildingFacade.queryBabyBuildById(id); | |
| 78 | - } | |
| 79 | - | |
| 80 | - | |
| 81 | - /** | |
| 82 | - * 查询儿童建档就诊卡号,母亲身份证 | |
| 83 | - * @param cardNo | |
| 84 | - * @param vcCardNo | |
| 85 | - * @return | |
| 86 | - */ | |
| 87 | - @RequestMapping(value = "/queryBabyBuild", method = RequestMethod.GET) | |
| 88 | - @ResponseBody | |
| 89 | - public BaseObjectResponse queryBabyBuild(@RequestParam(required = false)String cardNo,@RequestParam(required = false)String vcCardNo){ | |
| 90 | - BookbuildingQueryRequest param = new BookbuildingQueryRequest(); | |
| 91 | - param.setCardNo(cardNo); | |
| 92 | - param.setVcCardNo(vcCardNo); | |
| 93 | - return babyBookbuildingFacade.queryBabyBuild(param); | |
| 94 | - } | |
| 95 | - | |
| 96 | - | |
| 97 | - | |
| 98 | - /** | |
| 99 | - * 查询儿童建档记录就诊卡号,母亲身份证 | |
| 100 | - * @param cardNo | |
| 101 | - * @param vcCardNo | |
| 102 | - * @return | |
| 103 | - */ | |
| 104 | - @RequestMapping(value = "/queryBabyBuildRecord", method = RequestMethod.GET) | |
| 105 | - @ResponseBody | |
| 106 | - @TokenRequired | |
| 107 | - public BaseObjectResponse queryBabyBuildRecord(HttpServletRequest request,@RequestParam(required = false)String cardNo,@RequestParam(required = false)String vcCardNo,@RequestParam(required = false)String hospitalId){ | |
| 108 | - BookbuildingQueryRequest param = new BookbuildingQueryRequest(); | |
| 109 | - param.setCardNo(cardNo); | |
| 110 | - param.setVcCardNo(vcCardNo); | |
| 111 | - param.setHospitalId(hospitalId); | |
| 112 | - LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 113 | - return babyBookbuildingFacade.queryBabyBuildRecord(param, loginState.getId()); | |
| 114 | - } | |
| 115 | - | |
| 116 | - | |
| 117 | - /** | |
| 118 | - * 查询儿童建档页面基础数据 | |
| 119 | - * | |
| 120 | - * @return | |
| 121 | - */ | |
| 122 | - @RequestMapping(value = "/getBabyBuildBaseConfig", method = RequestMethod.GET) | |
| 123 | - @ResponseBody | |
| 124 | - public BaseObjectResponse getBabyBuildBaseConfig() { | |
| 125 | - return babyBookbuildingFacade.getBabyBuildBaseConfig(); | |
| 126 | - } | |
| 127 | - | |
| 128 | - | |
| 129 | - /** | |
| 130 | - * 查询诊断 根据关键字 | |
| 131 | - * | |
| 132 | - * @return | |
| 133 | - */ | |
| 134 | - @RequestMapping(value = "/queryDiagnose", method = RequestMethod.GET) | |
| 135 | - @ResponseBody | |
| 136 | - public BaseObjectResponse queryDiagnose(@RequestParam(required = true)String keyword) throws UnsupportedEncodingException { | |
| 137 | - // keyword = new String(keyword.getBytes("ISO-8859-1"),"UTF-8"); | |
| 138 | - return babyBookbuildingFacade.queryDiagnose(keyword); | |
| 139 | - } | |
| 140 | - | |
| 141 | - /** | |
| 142 | - * 查询妈咪高危因素 | |
| 143 | - * @param cardNo | |
| 144 | - * @return | |
| 145 | - */ | |
| 146 | - | |
| 147 | - @RequestMapping(value = "/queryMommyRiskByCardNo", method = RequestMethod.GET) | |
| 148 | - @ResponseBody | |
| 149 | - public BaseObjectResponse queryMommyRiskByCardNo(@RequestParam(required = true)String cardNo){ | |
| 150 | - return babyBookbuildingFacade.queryMommyRiskByCardNo(cardNo); | |
| 151 | - } | |
| 152 | - | |
| 153 | - | |
| 154 | - /** | |
| 155 | - * 查询儿童管理页面 | |
| 156 | - * @param mcardNo 母亲身份证 | |
| 157 | - * @param page | |
| 158 | - * @param limit | |
| 159 | - * @param name 儿童姓名 | |
| 160 | - * @param highRiskType 0 非高危 1 高危 2/空 全部 | |
| 161 | - * @return | |
| 162 | - */ | |
| 163 | - @RequestMapping(value = "/queryBabyList", method = RequestMethod.GET) | |
| 164 | - @ResponseBody | |
| 165 | - @TokenRequired | |
| 166 | - public BaseListResponse queryBabyList(HttpServletRequest httpServletRequest, | |
| 167 | - @RequestParam(value = "mcardNo", required = false) String mcardNo, | |
| 168 | - @RequestParam(value = "bcardNo", required = false) String bcardNo, | |
| 169 | - @RequestParam(value = "mphone", required = false) String mphone, | |
| 170 | - @RequestParam(value = "startMonthAge", required = false) Integer startMonthAge, | |
| 171 | - @RequestParam(value = "endMonthAge", required = false) Integer endMonthAge, | |
| 172 | - @RequestParam(value = "birth", required = false) String birth, | |
| 173 | - @RequestParam(value = "nextDate", required = false) String nextDate, | |
| 174 | - @RequestParam(value = "expVip", required = false) Integer expVip, | |
| 175 | - @RequestParam(value = "serviceType", required = false) Integer serviceType, | |
| 176 | - @RequestParam(value = "serviceStatus", required = false) Integer serviceStatus, | |
| 177 | - @RequestParam(value = "name", required = false) String name, | |
| 178 | - @RequestParam(value = "highRiskType", required = false) Integer highRiskType, | |
| 179 | - @RequestParam(value = "diagnose", required = false) String diagnose, | |
| 180 | - @RequestParam(value = "dateRange", required = false) String dateRange, | |
| 181 | - @RequestParam("page") Integer page, | |
| 182 | - @RequestParam("limit") Integer limit){ | |
| 183 | - LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
| 184 | - BabyManageRequest request = new BabyManageRequest(); | |
| 185 | - request.setBcardNo(bcardNo); | |
| 186 | - request.setMcardNo(mcardNo); | |
| 187 | - request.setMphone(mphone); | |
| 188 | - request.setMonthAgeStart(startMonthAge); | |
| 189 | - request.setMonthAgeEnd(endMonthAge); | |
| 190 | - request.setBirth(birth); | |
| 191 | - request.setNextDate(nextDate); | |
| 192 | - request.setExpVip(expVip); | |
| 193 | - request.setHighRiskType(highRiskType); | |
| 194 | - request.setServiceType(serviceType); | |
| 195 | - request.setDiagnose(diagnose); | |
| 196 | - request.setName(name); | |
| 197 | - request.setLimit(limit); | |
| 198 | - request.setPage(page); | |
| 199 | - request.setServiceStatus(serviceStatus); | |
| 200 | - request.setDateRange(dateRange); | |
| 201 | - return babyBookbuildingFacade.queryBabyList(request,loginState.getId()); | |
| 202 | - } | |
| 203 | - | |
| 204 | - | |
| 205 | - @RequestMapping(value = "/exportChilds", method = RequestMethod.GET) | |
| 206 | - @TokenRequired | |
| 207 | - public void exportChilds(HttpServletRequest httpServletRequest,HttpServletResponse httpServletResponse, | |
| 208 | - @RequestParam(value = "mcardNo", required = false) String mcardNo, | |
| 209 | - @RequestParam(value = "bcardNo", required = false) String bcardNo, | |
| 210 | - @RequestParam(value = "mphone", required = false) String mphone, | |
| 211 | - @RequestParam(value = "startMonthAge", required = false) Integer startMonthAge, | |
| 212 | - @RequestParam(value = "endMonthAge", required = false) Integer endMonthAge, | |
| 213 | - @RequestParam(value = "birth", required = false) String birth, | |
| 214 | - @RequestParam(value = "nextDate", required = false) String nextDate, | |
| 215 | - @RequestParam(value = "expVip", required = false) Integer expVip, | |
| 216 | - @RequestParam(value = "serviceType", required = false) Integer serviceType, | |
| 217 | - @RequestParam(value = "name", required = false) String name, | |
| 218 | - @RequestParam(value = "highRiskType", required = false) Integer highRiskType, | |
| 219 | - @RequestParam(value = "diagnose", required = false) String diagnose, | |
| 220 | - @RequestParam(value = "dateRange", required = false) String dateRange, | |
| 221 | - @RequestParam("page") Integer page, | |
| 222 | - @RequestParam("limit") Integer limit){ | |
| 223 | - LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
| 224 | - BabyManageRequest request = new BabyManageRequest(); | |
| 225 | - request.setBcardNo(bcardNo); | |
| 226 | - request.setMcardNo(mcardNo); | |
| 227 | - request.setMphone(mphone); | |
| 228 | - request.setMonthAgeStart(startMonthAge); | |
| 229 | - request.setMonthAgeEnd(endMonthAge); | |
| 230 | - request.setBirth(birth); | |
| 231 | - request.setNextDate(nextDate); | |
| 232 | - request.setExpVip(expVip); | |
| 233 | - request.setHighRiskType(highRiskType); | |
| 234 | - request.setServiceType(serviceType); | |
| 235 | - request.setDiagnose(diagnose); | |
| 236 | - request.setName(name); | |
| 237 | - request.setLimit(limit); | |
| 238 | - request.setPage(page); | |
| 239 | - request.setDateRange(dateRange); | |
| 240 | - | |
| 241 | - babyBookbuildingFacade.exportChilds(request,loginState.getId(),httpServletResponse); | |
| 242 | - } | |
| 243 | - | |
| 244 | - | |
| 245 | - /** | |
| 246 | - * 儿童个性化指导 短信发送 | |
| 247 | - * | |
| 248 | - * @param request | |
| 249 | - * @return | |
| 250 | - */ | |
| 251 | - @RequestMapping(method = RequestMethod.POST, value = "/sendBabyGuildSms") | |
| 252 | - @ResponseBody | |
| 253 | - @TokenRequired | |
| 254 | - public BaseResponse babyGuildSms(@Valid @RequestBody BabyGuideSmsequest param,HttpServletRequest request) { | |
| 255 | - LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 256 | - return babyBookbuildingFacade.sendBabyGuideSms(param,loginState.getId()); | |
| 257 | - } | |
| 258 | - | |
| 259 | - | |
| 260 | - | |
| 261 | - /** | |
| 262 | - * 获取小孩电子病历 | |
| 263 | - * | |
| 264 | - * @param babyId | |
| 265 | - * @return | |
| 266 | - */ | |
| 267 | - @RequestMapping(method = RequestMethod.GET, value = "/bookBuildList") | |
| 268 | - @ResponseBody | |
| 269 | - public BaseResponse bookBuildList(@RequestParam("babyId") String babyId) { | |
| 270 | - if (org.apache.commons.lang.StringUtils.isEmpty(babyId)) { | |
| 271 | - | |
| 272 | - return new BaseResponse().setErrormsg("babyid不能为空").setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 273 | - } | |
| 274 | - return babyBookbuildingFacade.bookBuildList(babyId); | |
| 275 | - } | |
| 276 | - | |
| 277 | - /** | |
| 278 | - * 获取小孩基本信息 | |
| 279 | - * | |
| 280 | - * @param babyId | |
| 281 | - * @return | |
| 282 | - */ | |
| 283 | - @RequestMapping(method = RequestMethod.GET, value = "/baby") | |
| 284 | - @ResponseBody | |
| 285 | - public BaseResponse getBabyBase(@RequestParam("babyId") String babyId){ | |
| 286 | - | |
| 287 | - return babyBookbuildingFacade.getBabyBase(babyId); | |
| 288 | - } | |
| 289 | - | |
| 290 | - | |
| 291 | - /** | |
| 292 | - * 查询孕妇基本信息通过身份证号码 | |
| 293 | - * @param cardNo | |
| 294 | - * @return | |
| 295 | - */ | |
| 296 | - @RequestMapping(method = RequestMethod.GET, value = "/queryPatientBaseInfo") | |
| 297 | - @ResponseBody | |
| 298 | - public BaseResponse queryYunBaseInfo(@RequestParam(value = "cardNo", required = false) String cardNo,@RequestParam(value = "pid", required = false) String pid) { | |
| 299 | - return babyBookbuildingFacade.queryYunBaseInfo(cardNo,pid); | |
| 300 | - } | |
| 301 | -} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyBuildController.java
View file @
851bf66
| 1 | +package com.lyms.platform.operate.web.controller; | |
| 2 | + | |
| 3 | + | |
| 4 | +import com.lyms.platform.common.annotation.TokenRequired; | |
| 5 | +import com.lyms.platform.common.base.BaseController; | |
| 6 | +import com.lyms.platform.common.base.LoginContext; | |
| 7 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 8 | +import com.lyms.platform.common.result.BaseListResponse; | |
| 9 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 10 | +import com.lyms.platform.common.result.BaseResponse; | |
| 11 | +import com.lyms.platform.common.utils.StringUtils; | |
| 12 | +import com.lyms.platform.operate.web.facade.BabyBookbuildingFacade; | |
| 13 | +import com.lyms.platform.operate.web.request.*; | |
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 15 | +import org.springframework.stereotype.Controller; | |
| 16 | +import org.springframework.web.bind.annotation.*; | |
| 17 | + | |
| 18 | +import javax.servlet.http.HttpServletRequest; | |
| 19 | +import javax.servlet.http.HttpServletResponse; | |
| 20 | +import javax.validation.Valid; | |
| 21 | +import java.io.UnsupportedEncodingException; | |
| 22 | + | |
| 23 | + | |
| 24 | +/* | |
| 25 | + *儿童建档 | |
| 26 | + * lqy | |
| 27 | + * 2016-06-16 | |
| 28 | + */ | |
| 29 | +@Controller | |
| 30 | +public class BabyBuildController extends BaseController { | |
| 31 | + | |
| 32 | + | |
| 33 | + @Autowired | |
| 34 | + private BabyBookbuildingFacade babyBookbuildingFacade; | |
| 35 | + | |
| 36 | + | |
| 37 | + /** | |
| 38 | + * 添加或者修改儿童建档 | |
| 39 | + * | |
| 40 | + * @param request | |
| 41 | + * @return | |
| 42 | + */ | |
| 43 | + @RequestMapping(method = RequestMethod.POST, value = "/addOrUpBabyBuild") | |
| 44 | + @ResponseBody | |
| 45 | + @TokenRequired | |
| 46 | + public BaseResponse addOrUpBabyBuild(@Valid @RequestBody BabyBookbuildingAddRequest request,HttpServletRequest httpServletRequest) { | |
| 47 | + LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
| 48 | + if (request != null && !StringUtils.isEmpty(request.getId())) { | |
| 49 | + return babyBookbuildingFacade.updateBabyBookbuilding(request,loginState.getId()); | |
| 50 | + } | |
| 51 | + return babyBookbuildingFacade.addBabyBookbuilding(request,loginState.getId()); | |
| 52 | + } | |
| 53 | + | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * 删除儿童建档 | |
| 57 | + * | |
| 58 | + * @param id | |
| 59 | + * @return | |
| 60 | + */ | |
| 61 | + @RequestMapping(value = "/deleteBabyBuildById/{id}", method = RequestMethod.DELETE) | |
| 62 | + @ResponseBody | |
| 63 | + public BaseResponse deleteBabyBuildById(@PathVariable("id") String id) { | |
| 64 | + return babyBookbuildingFacade.deleteBabyBuildById(id); | |
| 65 | + | |
| 66 | + } | |
| 67 | + | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * 查询儿童建档信息根据id查询 | |
| 71 | + * @param id | |
| 72 | + * @return | |
| 73 | + */ | |
| 74 | + @RequestMapping(value = "/queryBabyBuildById/{id}", method = RequestMethod.GET) | |
| 75 | + @ResponseBody | |
| 76 | + public BaseObjectResponse queryBabyBuildById(@PathVariable("id")String id){ | |
| 77 | + return babyBookbuildingFacade.queryBabyBuildById(id); | |
| 78 | + } | |
| 79 | + | |
| 80 | + | |
| 81 | + /** | |
| 82 | + * 查询儿童建档就诊卡号,母亲身份证 | |
| 83 | + * @param cardNo | |
| 84 | + * @param vcCardNo | |
| 85 | + * @return | |
| 86 | + */ | |
| 87 | + @RequestMapping(value = "/queryBabyBuild", method = RequestMethod.GET) | |
| 88 | + @ResponseBody | |
| 89 | + public BaseObjectResponse queryBabyBuild(@RequestParam(required = false)String cardNo,@RequestParam(required = false)String vcCardNo){ | |
| 90 | + BookbuildingQueryRequest param = new BookbuildingQueryRequest(); | |
| 91 | + param.setCardNo(cardNo); | |
| 92 | + param.setVcCardNo(vcCardNo); | |
| 93 | + return babyBookbuildingFacade.queryBabyBuild(param); | |
| 94 | + } | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + /** | |
| 99 | + * 查询儿童建档记录就诊卡号,母亲身份证 | |
| 100 | + * @param cardNo | |
| 101 | + * @param vcCardNo | |
| 102 | + * @return | |
| 103 | + */ | |
| 104 | + @RequestMapping(value = "/queryBabyBuildRecord", method = RequestMethod.GET) | |
| 105 | + @ResponseBody | |
| 106 | + @TokenRequired | |
| 107 | + public BaseObjectResponse queryBabyBuildRecord(HttpServletRequest request,@RequestParam(required = false)String cardNo,@RequestParam(required = false)String vcCardNo,@RequestParam(required = false)String hospitalId){ | |
| 108 | + BookbuildingQueryRequest param = new BookbuildingQueryRequest(); | |
| 109 | + param.setCardNo(cardNo); | |
| 110 | + param.setVcCardNo(vcCardNo); | |
| 111 | + param.setHospitalId(hospitalId); | |
| 112 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 113 | + return babyBookbuildingFacade.queryBabyBuildRecord(param, loginState.getId()); | |
| 114 | + } | |
| 115 | + | |
| 116 | + | |
| 117 | + /** | |
| 118 | + * 查询儿童建档页面基础数据 | |
| 119 | + * | |
| 120 | + * @return | |
| 121 | + */ | |
| 122 | + @RequestMapping(value = "/getBabyBuildBaseConfig", method = RequestMethod.GET) | |
| 123 | + @ResponseBody | |
| 124 | + public BaseObjectResponse getBabyBuildBaseConfig() { | |
| 125 | + return babyBookbuildingFacade.getBabyBuildBaseConfig(); | |
| 126 | + } | |
| 127 | + | |
| 128 | + | |
| 129 | + /** | |
| 130 | + * 查询诊断 根据关键字 | |
| 131 | + * | |
| 132 | + * @return | |
| 133 | + */ | |
| 134 | + @RequestMapping(value = "/queryDiagnose", method = RequestMethod.GET) | |
| 135 | + @ResponseBody | |
| 136 | + public BaseObjectResponse queryDiagnose(@RequestParam(required = true)String keyword) throws UnsupportedEncodingException { | |
| 137 | + // keyword = new String(keyword.getBytes("ISO-8859-1"),"UTF-8"); | |
| 138 | + return babyBookbuildingFacade.queryDiagnose(keyword); | |
| 139 | + } | |
| 140 | + | |
| 141 | + /** | |
| 142 | + * 查询妈咪高危因素 | |
| 143 | + * @param cardNo | |
| 144 | + * @return | |
| 145 | + */ | |
| 146 | + | |
| 147 | + @RequestMapping(value = "/queryMommyRiskByCardNo", method = RequestMethod.GET) | |
| 148 | + @ResponseBody | |
| 149 | + public BaseObjectResponse queryMommyRiskByCardNo(@RequestParam(required = true)String cardNo){ | |
| 150 | + return babyBookbuildingFacade.queryMommyRiskByCardNo(cardNo); | |
| 151 | + } | |
| 152 | + | |
| 153 | + | |
| 154 | + /** | |
| 155 | + * 查询儿童管理页面 | |
| 156 | + * @param mcardNo 母亲身份证 | |
| 157 | + * @param page | |
| 158 | + * @param limit | |
| 159 | + * @param name 儿童姓名 | |
| 160 | + * @param highRiskType 0 非高危 1 高危 2/空 全部 | |
| 161 | + * @return | |
| 162 | + */ | |
| 163 | + @RequestMapping(value = "/queryBabyList", method = RequestMethod.GET) | |
| 164 | + @ResponseBody | |
| 165 | + @TokenRequired | |
| 166 | + public BaseListResponse queryBabyList(HttpServletRequest httpServletRequest, | |
| 167 | + @RequestParam(value = "mcardNo", required = false) String mcardNo, | |
| 168 | + @RequestParam(value = "bcardNo", required = false) String bcardNo, | |
| 169 | + @RequestParam(value = "mphone", required = false) String mphone, | |
| 170 | + @RequestParam(value = "startMonthAge", required = false) Integer startMonthAge, | |
| 171 | + @RequestParam(value = "endMonthAge", required = false) Integer endMonthAge, | |
| 172 | + @RequestParam(value = "birth", required = false) String birth, | |
| 173 | + @RequestParam(value = "nextDate", required = false) String nextDate, | |
| 174 | + @RequestParam(value = "expVip", required = false) Integer expVip, | |
| 175 | + @RequestParam(value = "serviceType", required = false) Integer serviceType, | |
| 176 | + @RequestParam(value = "serviceStatus", required = false) Integer serviceStatus, | |
| 177 | + @RequestParam(value = "name", required = false) String name, | |
| 178 | + @RequestParam(value = "highRiskType", required = false) Integer highRiskType, | |
| 179 | + @RequestParam(value = "diagnose", required = false) String diagnose, | |
| 180 | + @RequestParam(value = "dateRange", required = false) String dateRange, | |
| 181 | + @RequestParam("page") Integer page, | |
| 182 | + @RequestParam("limit") Integer limit){ | |
| 183 | + LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
| 184 | + BabyManageRequest request = new BabyManageRequest(); | |
| 185 | + request.setBcardNo(bcardNo); | |
| 186 | + request.setMcardNo(mcardNo); | |
| 187 | + request.setMphone(mphone); | |
| 188 | + request.setMonthAgeStart(startMonthAge); | |
| 189 | + request.setMonthAgeEnd(endMonthAge); | |
| 190 | + request.setBirth(birth); | |
| 191 | + request.setNextDate(nextDate); | |
| 192 | + request.setExpVip(expVip); | |
| 193 | + request.setHighRiskType(highRiskType); | |
| 194 | + request.setServiceType(serviceType); | |
| 195 | + request.setDiagnose(diagnose); | |
| 196 | + request.setName(name); | |
| 197 | + request.setLimit(limit); | |
| 198 | + request.setPage(page); | |
| 199 | + request.setServiceStatus(serviceStatus); | |
| 200 | + request.setDateRange(dateRange); | |
| 201 | + return babyBookbuildingFacade.queryBabyList(request,loginState.getId()); | |
| 202 | + } | |
| 203 | + | |
| 204 | + | |
| 205 | + @RequestMapping(value = "/exportChilds", method = RequestMethod.GET) | |
| 206 | + @TokenRequired | |
| 207 | + public void exportChilds(HttpServletRequest httpServletRequest,HttpServletResponse httpServletResponse, | |
| 208 | + @RequestParam(value = "mcardNo", required = false) String mcardNo, | |
| 209 | + @RequestParam(value = "bcardNo", required = false) String bcardNo, | |
| 210 | + @RequestParam(value = "mphone", required = false) String mphone, | |
| 211 | + @RequestParam(value = "startMonthAge", required = false) Integer startMonthAge, | |
| 212 | + @RequestParam(value = "endMonthAge", required = false) Integer endMonthAge, | |
| 213 | + @RequestParam(value = "birth", required = false) String birth, | |
| 214 | + @RequestParam(value = "nextDate", required = false) String nextDate, | |
| 215 | + @RequestParam(value = "expVip", required = false) Integer expVip, | |
| 216 | + @RequestParam(value = "serviceType", required = false) Integer serviceType, | |
| 217 | + @RequestParam(value = "name", required = false) String name, | |
| 218 | + @RequestParam(value = "highRiskType", required = false) Integer highRiskType, | |
| 219 | + @RequestParam(value = "diagnose", required = false) String diagnose, | |
| 220 | + @RequestParam(value = "dateRange", required = false) String dateRange, | |
| 221 | + @RequestParam("page") Integer page, | |
| 222 | + @RequestParam("limit") Integer limit){ | |
| 223 | + LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
| 224 | + BabyManageRequest request = new BabyManageRequest(); | |
| 225 | + request.setBcardNo(bcardNo); | |
| 226 | + request.setMcardNo(mcardNo); | |
| 227 | + request.setMphone(mphone); | |
| 228 | + request.setMonthAgeStart(startMonthAge); | |
| 229 | + request.setMonthAgeEnd(endMonthAge); | |
| 230 | + request.setBirth(birth); | |
| 231 | + request.setNextDate(nextDate); | |
| 232 | + request.setExpVip(expVip); | |
| 233 | + request.setHighRiskType(highRiskType); | |
| 234 | + request.setServiceType(serviceType); | |
| 235 | + request.setDiagnose(diagnose); | |
| 236 | + request.setName(name); | |
| 237 | + request.setLimit(limit); | |
| 238 | + request.setPage(page); | |
| 239 | + request.setDateRange(dateRange); | |
| 240 | + | |
| 241 | + babyBookbuildingFacade.exportChilds(request,loginState.getId(),httpServletResponse); | |
| 242 | + } | |
| 243 | + | |
| 244 | + | |
| 245 | + /** | |
| 246 | + * 儿童个性化指导 短信发送 | |
| 247 | + * | |
| 248 | + * @param request | |
| 249 | + * @return | |
| 250 | + */ | |
| 251 | + @RequestMapping(method = RequestMethod.POST, value = "/sendBabyGuildSms") | |
| 252 | + @ResponseBody | |
| 253 | + @TokenRequired | |
| 254 | + public BaseResponse babyGuildSms(@Valid @RequestBody BabyGuideSmsequest param,HttpServletRequest request) { | |
| 255 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 256 | + return babyBookbuildingFacade.sendBabyGuideSms(param,loginState.getId()); | |
| 257 | + } | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + /** | |
| 262 | + * 获取小孩电子病历 | |
| 263 | + * | |
| 264 | + * @param babyId | |
| 265 | + * @return | |
| 266 | + */ | |
| 267 | + @RequestMapping(method = RequestMethod.GET, value = "/bookBuildList") | |
| 268 | + @ResponseBody | |
| 269 | + public BaseResponse bookBuildList(@RequestParam("babyId") String babyId) { | |
| 270 | + if (org.apache.commons.lang.StringUtils.isEmpty(babyId)) { | |
| 271 | + | |
| 272 | + return new BaseResponse().setErrormsg("babyid不能为空").setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
| 273 | + } | |
| 274 | + return babyBookbuildingFacade.bookBuildList(babyId); | |
| 275 | + } | |
| 276 | + | |
| 277 | + /** | |
| 278 | + * 获取小孩基本信息 | |
| 279 | + * | |
| 280 | + * @param babyId | |
| 281 | + * @return | |
| 282 | + */ | |
| 283 | + @RequestMapping(method = RequestMethod.GET, value = "/baby") | |
| 284 | + @ResponseBody | |
| 285 | + public BaseResponse getBabyBase(@RequestParam("babyId") String babyId){ | |
| 286 | + | |
| 287 | + return babyBookbuildingFacade.getBabyBase(babyId); | |
| 288 | + } | |
| 289 | + | |
| 290 | + | |
| 291 | + /** | |
| 292 | + * 查询孕妇基本信息通过身份证号码 | |
| 293 | + * @param cardNo | |
| 294 | + * @return | |
| 295 | + */ | |
| 296 | + @RequestMapping(method = RequestMethod.GET, value = "/queryPatientBaseInfo") | |
| 297 | + @ResponseBody | |
| 298 | + public BaseResponse queryYunBaseInfo(@RequestParam(value = "cardNo", required = false) String cardNo,@RequestParam(value = "pid", required = false) String pid) { | |
| 299 | + return babyBookbuildingFacade.queryYunBaseInfo(cardNo,pid); | |
| 300 | + } | |
| 301 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java
View file @
851bf66
| 1 | -package com.lyms.platform.operate.web.controller; | |
| 2 | - | |
| 3 | - | |
| 4 | -import javax.servlet.http.HttpServletRequest; | |
| 5 | -import javax.servlet.http.HttpServletResponse; | |
| 6 | -import javax.validation.Valid; | |
| 7 | - | |
| 8 | -import com.lyms.platform.common.annotation.TokenRequired; | |
| 9 | -import com.lyms.platform.common.base.LoginContext; | |
| 10 | -import com.lyms.platform.common.utils.MessageUtil; | |
| 11 | -import com.lyms.platform.common.utils.PropertiesUtils; | |
| 12 | -import com.lyms.platform.common.utils.StringUtils; | |
| 13 | -import com.lyms.platform.operate.web.facade.AntenatalExaminationFacade; | |
| 14 | -import com.lyms.platform.operate.web.request.AntenatalExaminationQueryRequest; | |
| 15 | -import com.lyms.platform.operate.web.request.BabyManageRequest; | |
| 16 | -import org.apache.commons.httpclient.HttpClient; | |
| 17 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 18 | -import org.springframework.stereotype.Controller; | |
| 19 | -import org.springframework.web.bind.annotation.*; | |
| 20 | - | |
| 21 | -import com.lyms.platform.biz.service.YunBookbuildingService; | |
| 22 | -import com.lyms.platform.common.base.BaseController; | |
| 23 | -import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 24 | -import com.lyms.platform.common.result.BaseListResponse; | |
| 25 | -import com.lyms.platform.common.result.BaseObjectResponse; | |
| 26 | -import com.lyms.platform.common.result.BaseResponse; | |
| 27 | -import com.lyms.platform.operate.web.facade.BookbuildingFacade; | |
| 28 | -import com.lyms.platform.operate.web.request.BookbuildingQueryRequest; | |
| 29 | -import com.lyms.platform.operate.web.request.YunBookbuildingAddRequest; | |
| 30 | - | |
| 31 | -import java.io.IOException; | |
| 32 | -import java.io.UnsupportedEncodingException; | |
| 33 | -import java.net.URLEncoder; | |
| 34 | - | |
| 35 | - | |
| 36 | -/* | |
| 37 | - *孕妇建档 | |
| 38 | - * lqy | |
| 39 | - * 2016-06-15 | |
| 40 | - */ | |
| 41 | -@Controller | |
| 42 | -public class BookbuildingController extends BaseController{ | |
| 43 | - | |
| 44 | - @Autowired | |
| 45 | - private YunBookbuildingService yunBookbuildingService; | |
| 46 | - | |
| 47 | - @Autowired | |
| 48 | - private BookbuildingFacade bookbuildingFacade; | |
| 49 | - | |
| 50 | - @Autowired | |
| 51 | - private AntenatalExaminationFacade antenatalExaminationFacade; | |
| 52 | - | |
| 53 | - | |
| 54 | - /** | |
| 55 | - * 添加孕妇建档或者更新孕妇建档 | |
| 56 | - * @param yunBookbuildingAddRequest | |
| 57 | - * @return | |
| 58 | - */ | |
| 59 | - @RequestMapping(method = RequestMethod.POST, value = "/addOrUpdateYunBuild") | |
| 60 | - @ResponseBody | |
| 61 | - @TokenRequired | |
| 62 | - public BaseResponse addOrUpdateYunBuild(@RequestBody YunBookbuildingAddRequest yunBookbuildingAddRequest,HttpServletRequest request) { | |
| 63 | - LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 64 | - if (yunBookbuildingAddRequest != null && !StringUtils.isEmpty(yunBookbuildingAddRequest.getId()) ) | |
| 65 | - { | |
| 66 | - return bookbuildingFacade.updatePregnantById(yunBookbuildingAddRequest.getId(), yunBookbuildingAddRequest,loginState.getId()); | |
| 67 | - | |
| 68 | - } | |
| 69 | - BaseObjectResponse p = bookbuildingFacade.addPregnantBookbuilding(yunBookbuildingAddRequest,loginState.getId()); | |
| 70 | - return p; | |
| 71 | - } | |
| 72 | - | |
| 73 | - | |
| 74 | - | |
| 75 | - | |
| 76 | - /** | |
| 77 | - * 删除孕妇建档 | |
| 78 | - * @param id | |
| 79 | - * @return | |
| 80 | - */ | |
| 81 | - @RequestMapping(value = "/deletePregnant/{id}", method = RequestMethod.DELETE) | |
| 82 | - @ResponseBody | |
| 83 | - @TokenRequired | |
| 84 | - public BaseResponse deletePregnantById(@PathVariable("id")String id,HttpServletRequest httpServletRequest){ | |
| 85 | - LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
| 86 | - return bookbuildingFacade.deletePregnantById(id,loginState.getId()); | |
| 87 | - } | |
| 88 | - | |
| 89 | - | |
| 90 | - | |
| 91 | - /** | |
| 92 | - * 查询孕妇建档记录 | |
| 93 | - * @return | |
| 94 | - */ | |
| 95 | - @RequestMapping(value = "/queryPregnantBuildRecord", method = RequestMethod.GET) | |
| 96 | - @ResponseBody | |
| 97 | - @TokenRequired | |
| 98 | - public BaseListResponse queryPregnantBuildRecord(@RequestParam(required = false) String vcCardNo,@RequestParam(required = false) String cardNo,HttpServletRequest httpServletRequest){ | |
| 99 | - BookbuildingQueryRequest bookbuildingQueryRequest = new BookbuildingQueryRequest(); | |
| 100 | - bookbuildingQueryRequest.setVcCardNo(vcCardNo); | |
| 101 | - bookbuildingQueryRequest.setCardNo(cardNo); | |
| 102 | - LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
| 103 | - BaseListResponse listResponse = bookbuildingFacade.queryPregnantBuildRecord(bookbuildingQueryRequest, loginState.getId()); | |
| 104 | - return listResponse; | |
| 105 | - } | |
| 106 | - | |
| 107 | - /** | |
| 108 | - * 查询孕妇详细建档信息通过Id | |
| 109 | - * @param id | |
| 110 | - * @return | |
| 111 | - */ | |
| 112 | - @RequestMapping(value = "/queryPregnantBuildById/{id}", method = RequestMethod.GET) | |
| 113 | - @ResponseBody | |
| 114 | - public BaseObjectResponse queryPregnantBuildRecord(@PathVariable("id")String id){ | |
| 115 | - BaseObjectResponse objectResponse = bookbuildingFacade.queryPregnantBuildById(id); | |
| 116 | - return objectResponse; | |
| 117 | - } | |
| 118 | - | |
| 119 | - | |
| 120 | - /** | |
| 121 | - * 查询儿童对应孕妇的建档记录 | |
| 122 | - * @param id 孕妇ID | |
| 123 | - * @return | |
| 124 | - */ | |
| 125 | - @RequestMapping(value = "/queryThisBabyPatient/{id}", method = RequestMethod.GET) | |
| 126 | - @ResponseBody | |
| 127 | - @TokenRequired | |
| 128 | - public BaseResponse queryThisBabyPatient(@PathVariable("id")String id,HttpServletRequest request){ | |
| 129 | - AntenatalExaminationQueryRequest antenatalExaminationQueryRequest = new AntenatalExaminationQueryRequest(); | |
| 130 | - antenatalExaminationQueryRequest.setPatientId(id); | |
| 131 | - LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 132 | - return antenatalExaminationFacade.queryAntenatalExamination(antenatalExaminationQueryRequest,loginState.getId()); | |
| 133 | - } | |
| 134 | - | |
| 135 | - /** | |
| 136 | - * 获取本院最近 | |
| 137 | - * @return | |
| 138 | - */ | |
| 139 | - @RequestMapping(value = "/queryPregnant", method = RequestMethod.GET) | |
| 140 | - @ResponseBody | |
| 141 | - @TokenRequired | |
| 142 | - public BaseResponse queryLatePregnant(HttpServletRequest request,@RequestParam("parentId")String parentId){ | |
| 143 | - LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 144 | - return bookbuildingFacade.findPatientById(parentId,loginState.getId()); | |
| 145 | - } | |
| 146 | - | |
| 147 | - | |
| 148 | - | |
| 149 | - /** | |
| 150 | - * 建档页面基础数据 | |
| 151 | - * @return | |
| 152 | - */ | |
| 153 | - @RequestMapping(value = "/getYunBuildBaseConfig", method = RequestMethod.GET) | |
| 154 | - @ResponseBody | |
| 155 | - public BaseObjectResponse getBabyBuildBaseConfig(){ | |
| 156 | - return bookbuildingFacade.getYunBuildBaseConfig(); | |
| 157 | - } | |
| 158 | - | |
| 159 | - /** | |
| 160 | - *查询孕妇建档基本信息 | |
| 161 | - * @return | |
| 162 | - */ | |
| 163 | - @RequestMapping(value = "/queryYunBuildInfo", method = RequestMethod.GET) | |
| 164 | - @ResponseBody | |
| 165 | - @TokenRequired | |
| 166 | - public BaseObjectResponse queryYunBuildInfo(HttpServletRequest request,@RequestParam(required = false) String cardNo,@RequestParam(required = false) String vcCardNo){ | |
| 167 | - LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 168 | - BaseObjectResponse objectResponse = bookbuildingFacade.queryYunBuildInfo(cardNo,vcCardNo,loginState.getId()); | |
| 169 | - return objectResponse; | |
| 170 | - } | |
| 171 | - | |
| 172 | - | |
| 173 | - | |
| 174 | - @RequestMapping(value = "/queryHospitals", method = RequestMethod.GET) | |
| 175 | - @ResponseBody | |
| 176 | - public BaseObjectResponse queryHospitals(HttpServletRequest request, | |
| 177 | - @RequestParam(required = false) String keyWord, | |
| 178 | - @RequestParam(required = false) Integer page, | |
| 179 | - @RequestParam(required = false) Integer limit){ | |
| 180 | - BaseObjectResponse objectResponse = bookbuildingFacade.queryHospitals(keyWord, page, limit); | |
| 181 | - return objectResponse; | |
| 182 | - } | |
| 183 | - | |
| 184 | - | |
| 185 | - public static final String center_statistics_url= PropertiesUtils.getPropertyValue("center_statistics_url"); | |
| 186 | - | |
| 187 | - public String paramEncode(String param) { | |
| 188 | - try { | |
| 189 | - return URLEncoder.encode(param,"utf-8"); | |
| 190 | - } catch (UnsupportedEncodingException e) { | |
| 191 | - e.printStackTrace(); | |
| 192 | - return param; | |
| 193 | - } | |
| 194 | - } | |
| 195 | - | |
| 196 | - /** | |
| 197 | - * 产检报告 | |
| 198 | - * @param request | |
| 199 | - * @return | |
| 200 | - */ | |
| 201 | - @RequestMapping(value = "/queryChanJianReport", method = RequestMethod.GET) | |
| 202 | - @TokenRequired | |
| 203 | - public void queryChanJianReport(HttpServletRequest request,HttpServletResponse response, | |
| 204 | - @RequestParam(required = false) String exDateStart, | |
| 205 | - @RequestParam(required = false) String exDateEnd, | |
| 206 | - @RequestParam(required = false) String name, | |
| 207 | - @RequestParam(required = false) Integer weekStarts, | |
| 208 | - @RequestParam(required = false) Integer weekEnds, | |
| 209 | - @RequestParam(required = false) String hbsab, | |
| 210 | - @RequestParam(required = false) String hbeag, | |
| 211 | - @RequestParam(required = false) String hbeab, | |
| 212 | - @RequestParam(required = false) String hbcab, | |
| 213 | - @RequestParam(required = false) String syphilis, | |
| 214 | - @RequestParam(required = false) String hiv, | |
| 215 | - @RequestParam(required = false) String hcv, | |
| 216 | - @RequestParam(required = false) String doctorNo, | |
| 217 | - @RequestParam(required = false) Integer page, | |
| 218 | - @RequestParam(required = false) Integer limit | |
| 219 | - ){ | |
| 220 | - LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 221 | - StringBuffer params = new StringBuffer(); | |
| 222 | - params.append("userId="); | |
| 223 | - params.append(loginState.getId()); | |
| 224 | - if (org.apache.commons.lang.StringUtils.isNotBlank(exDateStart)) { | |
| 225 | - params.append("&exDateStart="); | |
| 226 | - params.append(paramEncode(exDateStart)); | |
| 227 | - } | |
| 228 | - if (org.apache.commons.lang.StringUtils.isNotBlank(exDateEnd)) { | |
| 229 | - params.append("&exDateEnd="); | |
| 230 | - params.append(paramEncode(exDateEnd)); | |
| 231 | - } | |
| 232 | - if (org.apache.commons.lang.StringUtils.isNotBlank(name)) { | |
| 233 | - params.append("&name="); | |
| 234 | - params.append(paramEncode(name)); | |
| 235 | - } | |
| 236 | - if (weekStarts != null) { | |
| 237 | - params.append("&weekStarts="); | |
| 238 | - params.append(weekStarts); | |
| 239 | - } | |
| 240 | - if (weekEnds != null) { | |
| 241 | - params.append("&weekEnds="); | |
| 242 | - params.append(weekEnds); | |
| 243 | - } | |
| 244 | - if (org.apache.commons.lang.StringUtils.isNotBlank(hbsab)) { | |
| 245 | - params.append("&hbsab="); | |
| 246 | - params.append(paramEncode(hbsab)); | |
| 247 | - } | |
| 248 | - if (org.apache.commons.lang.StringUtils.isNotBlank(hbeag)) { | |
| 249 | - params.append("&hbeag="); | |
| 250 | - params.append(paramEncode(hbeag)); | |
| 251 | - } | |
| 252 | - if (org.apache.commons.lang.StringUtils.isNotBlank(hbeab)) { | |
| 253 | - params.append("&hbeab="); | |
| 254 | - params.append(paramEncode(hbeab)); | |
| 255 | - } | |
| 256 | - if (org.apache.commons.lang.StringUtils.isNotBlank(hbcab)) { | |
| 257 | - params.append("&hbcab="); | |
| 258 | - params.append(paramEncode(hbcab)); | |
| 259 | - } | |
| 260 | - if (org.apache.commons.lang.StringUtils.isNotBlank(syphilis)) { | |
| 261 | - params.append("&syphilis="); | |
| 262 | - params.append(paramEncode(syphilis)); | |
| 263 | - } | |
| 264 | - if (org.apache.commons.lang.StringUtils.isNotBlank(hiv)) { | |
| 265 | - params.append("&hiv="); | |
| 266 | - params.append(paramEncode(hiv)); | |
| 267 | - } | |
| 268 | - if (org.apache.commons.lang.StringUtils.isNotBlank(hcv)) { | |
| 269 | - params.append("&hcv="); | |
| 270 | - params.append(paramEncode(hcv)); | |
| 271 | - } | |
| 272 | - if (org.apache.commons.lang.StringUtils.isNotBlank(doctorNo)) { | |
| 273 | - params.append("&doctorNo="); | |
| 274 | - params.append(paramEncode(doctorNo)); | |
| 275 | - } | |
| 276 | - if (page != null) { | |
| 277 | - params.append("&page="); | |
| 278 | - params.append(page); | |
| 279 | - } | |
| 280 | - if (limit != null) { | |
| 281 | - params.append("&limit="); | |
| 282 | - params.append(limit); | |
| 283 | - } | |
| 284 | - MessageUtil.UTF8GetMethod utf8GetMethod = new MessageUtil.UTF8GetMethod(center_statistics_url+"center/queryChanJianReport?" + params.toString()); | |
| 285 | - HttpClient client = new HttpClient(); | |
| 286 | - try { | |
| 287 | - client.executeMethod(utf8GetMethod); | |
| 288 | - int statusCode = utf8GetMethod.getStatusCode(); | |
| 289 | - if (200 == statusCode) { | |
| 290 | - String json = new String(utf8GetMethod.getResponseBodyAsString()); | |
| 291 | - writeJson(response, json); | |
| 292 | - } | |
| 293 | - } catch (IOException e) { | |
| 294 | - e.printStackTrace(); | |
| 295 | - } | |
| 296 | - } | |
| 297 | - | |
| 298 | - | |
| 299 | - @RequestMapping(value = "/exportChanReport", method = RequestMethod.GET) | |
| 300 | - @TokenRequired | |
| 301 | - public void exportChanReport(HttpServletRequest httpServletRequest,HttpServletResponse httpServletResponse, | |
| 302 | - @RequestParam(required = false) String exDateStart, | |
| 303 | - @RequestParam(required = false) String exDateEnd, | |
| 304 | - @RequestParam(required = false) String name, | |
| 305 | - @RequestParam(required = false) Integer weekStarts, | |
| 306 | - @RequestParam(required = false) Integer weekEnds, | |
| 307 | - @RequestParam(required = false) String hbsab, | |
| 308 | - @RequestParam(required = false) String hbeag, | |
| 309 | - @RequestParam(required = false) String hbeab, | |
| 310 | - @RequestParam(required = false) String hbcab, | |
| 311 | - @RequestParam(required = false) String syphilis, | |
| 312 | - @RequestParam(required = false) String hiv, | |
| 313 | - @RequestParam(required = false) String hcv, | |
| 314 | - @RequestParam(required = false) String doctorNo, | |
| 315 | - @RequestParam(required = false) Integer page, | |
| 316 | - @RequestParam(required = false) Integer limit){ | |
| 317 | - LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
| 318 | - StringBuffer params = new StringBuffer(); | |
| 319 | - params.append("userId="); | |
| 320 | - params.append(loginState.getId()); | |
| 321 | - if (org.apache.commons.lang.StringUtils.isNotBlank(exDateStart)) { | |
| 322 | - params.append("&exDateStart="); | |
| 323 | - params.append(paramEncode(exDateStart)); | |
| 324 | - } | |
| 325 | - if (org.apache.commons.lang.StringUtils.isNotBlank(exDateEnd)) { | |
| 326 | - params.append("&exDateEnd="); | |
| 327 | - params.append(paramEncode(exDateEnd)); | |
| 328 | - } | |
| 329 | - if (org.apache.commons.lang.StringUtils.isNotBlank(name)) { | |
| 330 | - params.append("&name="); | |
| 331 | - params.append(paramEncode(name)); | |
| 332 | - } | |
| 333 | - if (weekStarts != null) { | |
| 334 | - params.append("&weekStarts="); | |
| 335 | - params.append(weekStarts); | |
| 336 | - } | |
| 337 | - if (weekEnds != null) { | |
| 338 | - params.append("&weekEnds="); | |
| 339 | - params.append(weekEnds); | |
| 340 | - } | |
| 341 | - if (org.apache.commons.lang.StringUtils.isNotBlank(hbsab)) { | |
| 342 | - params.append("&hbsab="); | |
| 343 | - params.append(paramEncode(hbsab)); | |
| 344 | - } | |
| 345 | - if (org.apache.commons.lang.StringUtils.isNotBlank(hbeag)) { | |
| 346 | - params.append("&hbeag="); | |
| 347 | - params.append(paramEncode(hbeag)); | |
| 348 | - } | |
| 349 | - if (org.apache.commons.lang.StringUtils.isNotBlank(hbeab)) { | |
| 350 | - params.append("&hbeab="); | |
| 351 | - params.append(paramEncode(hbeab)); | |
| 352 | - } | |
| 353 | - if (org.apache.commons.lang.StringUtils.isNotBlank(hbcab)) { | |
| 354 | - params.append("&hbcab="); | |
| 355 | - params.append(paramEncode(hbcab)); | |
| 356 | - } | |
| 357 | - if (org.apache.commons.lang.StringUtils.isNotBlank(syphilis)) { | |
| 358 | - params.append("&syphilis="); | |
| 359 | - params.append(paramEncode(syphilis)); | |
| 360 | - } | |
| 361 | - if (org.apache.commons.lang.StringUtils.isNotBlank(hiv)) { | |
| 362 | - params.append("&hiv="); | |
| 363 | - params.append(paramEncode(hiv)); | |
| 364 | - } | |
| 365 | - if (org.apache.commons.lang.StringUtils.isNotBlank(hcv)) { | |
| 366 | - params.append("&hcv="); | |
| 367 | - params.append(paramEncode(hcv)); | |
| 368 | - } | |
| 369 | - if (org.apache.commons.lang.StringUtils.isNotBlank(doctorNo)) { | |
| 370 | - params.append("&doctorNo="); | |
| 371 | - params.append(paramEncode(doctorNo)); | |
| 372 | - } | |
| 373 | - if (page != null) { | |
| 374 | - params.append("&page="); | |
| 375 | - params.append(page); | |
| 376 | - } | |
| 377 | - if (limit != null) { | |
| 378 | - params.append("&limit="); | |
| 379 | - params.append(limit); | |
| 380 | - } | |
| 381 | - MessageUtil.UTF8GetMethod utf8GetMethod = new MessageUtil.UTF8GetMethod(center_statistics_url+"center/exportChanReport?" + params.toString()); | |
| 382 | - HttpClient client = new HttpClient(); | |
| 383 | - try { | |
| 384 | - client.executeMethod(utf8GetMethod); | |
| 385 | - int statusCode = utf8GetMethod.getStatusCode(); | |
| 386 | - if (200 == statusCode) { | |
| 387 | - httpServletResponse.setContentType("application/octet-stream"); | |
| 388 | - httpServletResponse.setCharacterEncoding("UTF-8"); | |
| 389 | - httpServletResponse.setHeader("Content-Disposition", "attachment;fileName=datas.xls"); | |
| 390 | - httpServletResponse.getOutputStream().write(utf8GetMethod.getResponseBody()); | |
| 391 | - } | |
| 392 | - } catch (IOException e) { | |
| 393 | - e.printStackTrace(); | |
| 394 | - } | |
| 395 | - } | |
| 396 | - | |
| 397 | - /** | |
| 398 | - * 产检报告 | |
| 399 | - * @param request | |
| 400 | - * @return | |
| 401 | - */ | |
| 402 | - | |
| 403 | - @RequestMapping(value = "/center/queryChanJianReport", method = RequestMethod.GET) | |
| 404 | - @ResponseBody | |
| 405 | - public BaseListResponse queryCenterChanJianReport(HttpServletRequest request, | |
| 406 | - @RequestParam(required = false) Integer userId, | |
| 407 | - @RequestParam(required = false) String exDateStart, | |
| 408 | - @RequestParam(required = false) String exDateEnd, | |
| 409 | - @RequestParam(required = false) String name, | |
| 410 | - @RequestParam(required = false) Integer weekStarts, | |
| 411 | - @RequestParam(required = false) Integer weekEnds, | |
| 412 | - @RequestParam(required = false) String hbsab, | |
| 413 | - @RequestParam(required = false) String hbeag, | |
| 414 | - @RequestParam(required = false) String hbeab, | |
| 415 | - @RequestParam(required = false) String hbcab, | |
| 416 | - @RequestParam(required = false) String syphilis, | |
| 417 | - @RequestParam(required = false) String hiv, | |
| 418 | - @RequestParam(required = false) String hcv, | |
| 419 | - @RequestParam(required = false) String doctorNo, | |
| 420 | - @RequestParam(required = false) Integer page, | |
| 421 | - @RequestParam(required = false) Integer limit){ | |
| 422 | - BaseListResponse objectResponse = bookbuildingFacade.queryChanJianReport(userId, | |
| 423 | - exDateStart, | |
| 424 | - exDateEnd, | |
| 425 | - name, | |
| 426 | - weekStarts, | |
| 427 | - weekEnds, | |
| 428 | - hbsab, | |
| 429 | - hbeag, | |
| 430 | - hbeab, | |
| 431 | - hbcab, | |
| 432 | - syphilis, | |
| 433 | - hiv, | |
| 434 | - hcv, | |
| 435 | - doctorNo, | |
| 436 | - page, | |
| 437 | - limit | |
| 438 | - | |
| 439 | - ); | |
| 440 | - return objectResponse; | |
| 441 | - } | |
| 442 | - | |
| 443 | - | |
| 444 | - @RequestMapping(value = "/center/exportChanReport", method = RequestMethod.GET) | |
| 445 | - public void exportCenterChanReport(HttpServletRequest httpServletRequest,HttpServletResponse httpServletResponse, | |
| 446 | - @RequestParam(required = false) Integer userId, | |
| 447 | - @RequestParam(required = false) String exDateStart, | |
| 448 | - @RequestParam(required = false) String exDateEnd, | |
| 449 | - @RequestParam(required = false) String name, | |
| 450 | - @RequestParam(required = false) Integer weekStarts, | |
| 451 | - @RequestParam(required = false) Integer weekEnds, | |
| 452 | - @RequestParam(required = false) String hbsab, | |
| 453 | - @RequestParam(required = false) String hbeag, | |
| 454 | - @RequestParam(required = false) String hbeab, | |
| 455 | - @RequestParam(required = false) String hbcab, | |
| 456 | - @RequestParam(required = false) String syphilis, | |
| 457 | - @RequestParam(required = false) String hiv, | |
| 458 | - @RequestParam(required = false) String hcv, | |
| 459 | - @RequestParam(required = false) String doctorNo, | |
| 460 | - @RequestParam(required = false) Integer page, | |
| 461 | - @RequestParam(required = false) Integer limit){ | |
| 462 | - bookbuildingFacade.exportChanReport(userId, httpServletResponse, | |
| 463 | - exDateStart, | |
| 464 | - exDateEnd, | |
| 465 | - name, | |
| 466 | - weekStarts, | |
| 467 | - weekEnds, | |
| 468 | - hbsab, | |
| 469 | - hbeag, | |
| 470 | - hbeab, | |
| 471 | - hbcab, | |
| 472 | - syphilis, | |
| 473 | - hiv, | |
| 474 | - hcv, | |
| 475 | - doctorNo); | |
| 476 | - } | |
| 477 | - | |
| 478 | -} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java
View file @
851bf66
| 1 | +package com.lyms.platform.operate.web.controller; | |
| 2 | + | |
| 3 | + | |
| 4 | +import javax.servlet.http.HttpServletRequest; | |
| 5 | +import javax.servlet.http.HttpServletResponse; | |
| 6 | +import javax.validation.Valid; | |
| 7 | + | |
| 8 | +import com.lyms.platform.common.annotation.TokenRequired; | |
| 9 | +import com.lyms.platform.common.base.LoginContext; | |
| 10 | +import com.lyms.platform.common.utils.MessageUtil; | |
| 11 | +import com.lyms.platform.common.utils.PropertiesUtils; | |
| 12 | +import com.lyms.platform.common.utils.StringUtils; | |
| 13 | +import com.lyms.platform.operate.web.facade.AntenatalExaminationFacade; | |
| 14 | +import com.lyms.platform.operate.web.request.AntenatalExaminationQueryRequest; | |
| 15 | +import com.lyms.platform.operate.web.request.BabyManageRequest; | |
| 16 | +import org.apache.commons.httpclient.HttpClient; | |
| 17 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 18 | +import org.springframework.stereotype.Controller; | |
| 19 | +import org.springframework.web.bind.annotation.*; | |
| 20 | + | |
| 21 | +import com.lyms.platform.biz.service.YunBookbuildingService; | |
| 22 | +import com.lyms.platform.common.base.BaseController; | |
| 23 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 24 | +import com.lyms.platform.common.result.BaseListResponse; | |
| 25 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 26 | +import com.lyms.platform.common.result.BaseResponse; | |
| 27 | +import com.lyms.platform.operate.web.facade.BookbuildingFacade; | |
| 28 | +import com.lyms.platform.operate.web.request.BookbuildingQueryRequest; | |
| 29 | +import com.lyms.platform.operate.web.request.YunBookbuildingAddRequest; | |
| 30 | + | |
| 31 | +import java.io.IOException; | |
| 32 | +import java.io.UnsupportedEncodingException; | |
| 33 | +import java.net.URLEncoder; | |
| 34 | + | |
| 35 | + | |
| 36 | +/* | |
| 37 | + *孕妇建档 | |
| 38 | + * lqy | |
| 39 | + * 2016-06-15 | |
| 40 | + */ | |
| 41 | +@Controller | |
| 42 | +public class PregnantBuildController extends BaseController{ | |
| 43 | + | |
| 44 | + @Autowired | |
| 45 | + private YunBookbuildingService yunBookbuildingService; | |
| 46 | + | |
| 47 | + @Autowired | |
| 48 | + private BookbuildingFacade bookbuildingFacade; | |
| 49 | + | |
| 50 | + @Autowired | |
| 51 | + private AntenatalExaminationFacade antenatalExaminationFacade; | |
| 52 | + | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 添加孕妇建档或者更新孕妇建档 | |
| 56 | + * @param yunBookbuildingAddRequest | |
| 57 | + * @return | |
| 58 | + */ | |
| 59 | + @RequestMapping(method = RequestMethod.POST, value = "/addOrUpdateYunBuild") | |
| 60 | + @ResponseBody | |
| 61 | + @TokenRequired | |
| 62 | + public BaseResponse addOrUpdateYunBuild(@RequestBody YunBookbuildingAddRequest yunBookbuildingAddRequest,HttpServletRequest request) { | |
| 63 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 64 | + if (yunBookbuildingAddRequest != null && !StringUtils.isEmpty(yunBookbuildingAddRequest.getId()) ) | |
| 65 | + { | |
| 66 | + return bookbuildingFacade.updatePregnantById(yunBookbuildingAddRequest.getId(), yunBookbuildingAddRequest,loginState.getId()); | |
| 67 | + | |
| 68 | + } | |
| 69 | + BaseObjectResponse p = bookbuildingFacade.addPregnantBookbuilding(yunBookbuildingAddRequest,loginState.getId()); | |
| 70 | + return p; | |
| 71 | + } | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + /** | |
| 77 | + * 删除孕妇建档 | |
| 78 | + * @param id | |
| 79 | + * @return | |
| 80 | + */ | |
| 81 | + @RequestMapping(value = "/deletePregnant/{id}", method = RequestMethod.DELETE) | |
| 82 | + @ResponseBody | |
| 83 | + @TokenRequired | |
| 84 | + public BaseResponse deletePregnantById(@PathVariable("id")String id,HttpServletRequest httpServletRequest){ | |
| 85 | + LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
| 86 | + return bookbuildingFacade.deletePregnantById(id,loginState.getId()); | |
| 87 | + } | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + /** | |
| 92 | + * 查询孕妇建档记录 | |
| 93 | + * @return | |
| 94 | + */ | |
| 95 | + @RequestMapping(value = "/queryPregnantBuildRecord", method = RequestMethod.GET) | |
| 96 | + @ResponseBody | |
| 97 | + @TokenRequired | |
| 98 | + public BaseListResponse queryPregnantBuildRecord(@RequestParam(required = false) String vcCardNo,@RequestParam(required = false) String cardNo,HttpServletRequest httpServletRequest){ | |
| 99 | + BookbuildingQueryRequest bookbuildingQueryRequest = new BookbuildingQueryRequest(); | |
| 100 | + bookbuildingQueryRequest.setVcCardNo(vcCardNo); | |
| 101 | + bookbuildingQueryRequest.setCardNo(cardNo); | |
| 102 | + LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
| 103 | + BaseListResponse listResponse = bookbuildingFacade.queryPregnantBuildRecord(bookbuildingQueryRequest, loginState.getId()); | |
| 104 | + return listResponse; | |
| 105 | + } | |
| 106 | + | |
| 107 | + /** | |
| 108 | + * 查询孕妇详细建档信息通过Id | |
| 109 | + * @param id | |
| 110 | + * @return | |
| 111 | + */ | |
| 112 | + @RequestMapping(value = "/queryPregnantBuildById/{id}", method = RequestMethod.GET) | |
| 113 | + @ResponseBody | |
| 114 | + public BaseObjectResponse queryPregnantBuildRecord(@PathVariable("id")String id){ | |
| 115 | + BaseObjectResponse objectResponse = bookbuildingFacade.queryPregnantBuildById(id); | |
| 116 | + return objectResponse; | |
| 117 | + } | |
| 118 | + | |
| 119 | + | |
| 120 | + /** | |
| 121 | + * 查询儿童对应孕妇的建档记录 | |
| 122 | + * @param id 孕妇ID | |
| 123 | + * @return | |
| 124 | + */ | |
| 125 | + @RequestMapping(value = "/queryThisBabyPatient/{id}", method = RequestMethod.GET) | |
| 126 | + @ResponseBody | |
| 127 | + @TokenRequired | |
| 128 | + public BaseResponse queryThisBabyPatient(@PathVariable("id")String id,HttpServletRequest request){ | |
| 129 | + AntenatalExaminationQueryRequest antenatalExaminationQueryRequest = new AntenatalExaminationQueryRequest(); | |
| 130 | + antenatalExaminationQueryRequest.setPatientId(id); | |
| 131 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 132 | + return antenatalExaminationFacade.queryAntenatalExamination(antenatalExaminationQueryRequest,loginState.getId()); | |
| 133 | + } | |
| 134 | + | |
| 135 | + /** | |
| 136 | + * 获取本院最近 | |
| 137 | + * @return | |
| 138 | + */ | |
| 139 | + @RequestMapping(value = "/queryPregnant", method = RequestMethod.GET) | |
| 140 | + @ResponseBody | |
| 141 | + @TokenRequired | |
| 142 | + public BaseResponse queryLatePregnant(HttpServletRequest request,@RequestParam("parentId")String parentId){ | |
| 143 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 144 | + return bookbuildingFacade.findPatientById(parentId,loginState.getId()); | |
| 145 | + } | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + /** | |
| 150 | + * 建档页面基础数据 | |
| 151 | + * @return | |
| 152 | + */ | |
| 153 | + @RequestMapping(value = "/getYunBuildBaseConfig", method = RequestMethod.GET) | |
| 154 | + @ResponseBody | |
| 155 | + public BaseObjectResponse getBabyBuildBaseConfig(){ | |
| 156 | + return bookbuildingFacade.getYunBuildBaseConfig(); | |
| 157 | + } | |
| 158 | + | |
| 159 | + /** | |
| 160 | + *查询孕妇建档基本信息 | |
| 161 | + * @return | |
| 162 | + */ | |
| 163 | + @RequestMapping(value = "/queryYunBuildInfo", method = RequestMethod.GET) | |
| 164 | + @ResponseBody | |
| 165 | + @TokenRequired | |
| 166 | + public BaseObjectResponse queryYunBuildInfo(HttpServletRequest request,@RequestParam(required = false) String cardNo,@RequestParam(required = false) String vcCardNo){ | |
| 167 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 168 | + BaseObjectResponse objectResponse = bookbuildingFacade.queryYunBuildInfo(cardNo,vcCardNo,loginState.getId()); | |
| 169 | + return objectResponse; | |
| 170 | + } | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + @RequestMapping(value = "/queryHospitals", method = RequestMethod.GET) | |
| 175 | + @ResponseBody | |
| 176 | + public BaseObjectResponse queryHospitals(HttpServletRequest request, | |
| 177 | + @RequestParam(required = false) String keyWord, | |
| 178 | + @RequestParam(required = false) Integer page, | |
| 179 | + @RequestParam(required = false) Integer limit){ | |
| 180 | + BaseObjectResponse objectResponse = bookbuildingFacade.queryHospitals(keyWord, page, limit); | |
| 181 | + return objectResponse; | |
| 182 | + } | |
| 183 | + | |
| 184 | + | |
| 185 | + public static final String center_statistics_url= PropertiesUtils.getPropertyValue("center_statistics_url"); | |
| 186 | + | |
| 187 | + public String paramEncode(String param) { | |
| 188 | + try { | |
| 189 | + return URLEncoder.encode(param,"utf-8"); | |
| 190 | + } catch (UnsupportedEncodingException e) { | |
| 191 | + e.printStackTrace(); | |
| 192 | + return param; | |
| 193 | + } | |
| 194 | + } | |
| 195 | + | |
| 196 | + /** | |
| 197 | + * 产检报告 | |
| 198 | + * @param request | |
| 199 | + * @return | |
| 200 | + */ | |
| 201 | + @RequestMapping(value = "/queryChanJianReport", method = RequestMethod.GET) | |
| 202 | + @TokenRequired | |
| 203 | + public void queryChanJianReport(HttpServletRequest request,HttpServletResponse response, | |
| 204 | + @RequestParam(required = false) String exDateStart, | |
| 205 | + @RequestParam(required = false) String exDateEnd, | |
| 206 | + @RequestParam(required = false) String name, | |
| 207 | + @RequestParam(required = false) Integer weekStarts, | |
| 208 | + @RequestParam(required = false) Integer weekEnds, | |
| 209 | + @RequestParam(required = false) String hbsab, | |
| 210 | + @RequestParam(required = false) String hbeag, | |
| 211 | + @RequestParam(required = false) String hbeab, | |
| 212 | + @RequestParam(required = false) String hbcab, | |
| 213 | + @RequestParam(required = false) String syphilis, | |
| 214 | + @RequestParam(required = false) String hiv, | |
| 215 | + @RequestParam(required = false) String hcv, | |
| 216 | + @RequestParam(required = false) String doctorNo, | |
| 217 | + @RequestParam(required = false) Integer page, | |
| 218 | + @RequestParam(required = false) Integer limit | |
| 219 | + ){ | |
| 220 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 221 | + StringBuffer params = new StringBuffer(); | |
| 222 | + params.append("userId="); | |
| 223 | + params.append(loginState.getId()); | |
| 224 | + if (org.apache.commons.lang.StringUtils.isNotBlank(exDateStart)) { | |
| 225 | + params.append("&exDateStart="); | |
| 226 | + params.append(paramEncode(exDateStart)); | |
| 227 | + } | |
| 228 | + if (org.apache.commons.lang.StringUtils.isNotBlank(exDateEnd)) { | |
| 229 | + params.append("&exDateEnd="); | |
| 230 | + params.append(paramEncode(exDateEnd)); | |
| 231 | + } | |
| 232 | + if (org.apache.commons.lang.StringUtils.isNotBlank(name)) { | |
| 233 | + params.append("&name="); | |
| 234 | + params.append(paramEncode(name)); | |
| 235 | + } | |
| 236 | + if (weekStarts != null) { | |
| 237 | + params.append("&weekStarts="); | |
| 238 | + params.append(weekStarts); | |
| 239 | + } | |
| 240 | + if (weekEnds != null) { | |
| 241 | + params.append("&weekEnds="); | |
| 242 | + params.append(weekEnds); | |
| 243 | + } | |
| 244 | + if (org.apache.commons.lang.StringUtils.isNotBlank(hbsab)) { | |
| 245 | + params.append("&hbsab="); | |
| 246 | + params.append(paramEncode(hbsab)); | |
| 247 | + } | |
| 248 | + if (org.apache.commons.lang.StringUtils.isNotBlank(hbeag)) { | |
| 249 | + params.append("&hbeag="); | |
| 250 | + params.append(paramEncode(hbeag)); | |
| 251 | + } | |
| 252 | + if (org.apache.commons.lang.StringUtils.isNotBlank(hbeab)) { | |
| 253 | + params.append("&hbeab="); | |
| 254 | + params.append(paramEncode(hbeab)); | |
| 255 | + } | |
| 256 | + if (org.apache.commons.lang.StringUtils.isNotBlank(hbcab)) { | |
| 257 | + params.append("&hbcab="); | |
| 258 | + params.append(paramEncode(hbcab)); | |
| 259 | + } | |
| 260 | + if (org.apache.commons.lang.StringUtils.isNotBlank(syphilis)) { | |
| 261 | + params.append("&syphilis="); | |
| 262 | + params.append(paramEncode(syphilis)); | |
| 263 | + } | |
| 264 | + if (org.apache.commons.lang.StringUtils.isNotBlank(hiv)) { | |
| 265 | + params.append("&hiv="); | |
| 266 | + params.append(paramEncode(hiv)); | |
| 267 | + } | |
| 268 | + if (org.apache.commons.lang.StringUtils.isNotBlank(hcv)) { | |
| 269 | + params.append("&hcv="); | |
| 270 | + params.append(paramEncode(hcv)); | |
| 271 | + } | |
| 272 | + if (org.apache.commons.lang.StringUtils.isNotBlank(doctorNo)) { | |
| 273 | + params.append("&doctorNo="); | |
| 274 | + params.append(paramEncode(doctorNo)); | |
| 275 | + } | |
| 276 | + if (page != null) { | |
| 277 | + params.append("&page="); | |
| 278 | + params.append(page); | |
| 279 | + } | |
| 280 | + if (limit != null) { | |
| 281 | + params.append("&limit="); | |
| 282 | + params.append(limit); | |
| 283 | + } | |
| 284 | + MessageUtil.UTF8GetMethod utf8GetMethod = new MessageUtil.UTF8GetMethod(center_statistics_url+"center/queryChanJianReport?" + params.toString()); | |
| 285 | + HttpClient client = new HttpClient(); | |
| 286 | + try { | |
| 287 | + client.executeMethod(utf8GetMethod); | |
| 288 | + int statusCode = utf8GetMethod.getStatusCode(); | |
| 289 | + if (200 == statusCode) { | |
| 290 | + String json = new String(utf8GetMethod.getResponseBodyAsString()); | |
| 291 | + writeJson(response, json); | |
| 292 | + } | |
| 293 | + } catch (IOException e) { | |
| 294 | + e.printStackTrace(); | |
| 295 | + } | |
| 296 | + } | |
| 297 | + | |
| 298 | + | |
| 299 | + @RequestMapping(value = "/exportChanReport", method = RequestMethod.GET) | |
| 300 | + @TokenRequired | |
| 301 | + public void exportChanReport(HttpServletRequest httpServletRequest,HttpServletResponse httpServletResponse, | |
| 302 | + @RequestParam(required = false) String exDateStart, | |
| 303 | + @RequestParam(required = false) String exDateEnd, | |
| 304 | + @RequestParam(required = false) String name, | |
| 305 | + @RequestParam(required = false) Integer weekStarts, | |
| 306 | + @RequestParam(required = false) Integer weekEnds, | |
| 307 | + @RequestParam(required = false) String hbsab, | |
| 308 | + @RequestParam(required = false) String hbeag, | |
| 309 | + @RequestParam(required = false) String hbeab, | |
| 310 | + @RequestParam(required = false) String hbcab, | |
| 311 | + @RequestParam(required = false) String syphilis, | |
| 312 | + @RequestParam(required = false) String hiv, | |
| 313 | + @RequestParam(required = false) String hcv, | |
| 314 | + @RequestParam(required = false) String doctorNo, | |
| 315 | + @RequestParam(required = false) Integer page, | |
| 316 | + @RequestParam(required = false) Integer limit){ | |
| 317 | + LoginContext loginState = (LoginContext) httpServletRequest.getAttribute("loginContext"); | |
| 318 | + StringBuffer params = new StringBuffer(); | |
| 319 | + params.append("userId="); | |
| 320 | + params.append(loginState.getId()); | |
| 321 | + if (org.apache.commons.lang.StringUtils.isNotBlank(exDateStart)) { | |
| 322 | + params.append("&exDateStart="); | |
| 323 | + params.append(paramEncode(exDateStart)); | |
| 324 | + } | |
| 325 | + if (org.apache.commons.lang.StringUtils.isNotBlank(exDateEnd)) { | |
| 326 | + params.append("&exDateEnd="); | |
| 327 | + params.append(paramEncode(exDateEnd)); | |
| 328 | + } | |
| 329 | + if (org.apache.commons.lang.StringUtils.isNotBlank(name)) { | |
| 330 | + params.append("&name="); | |
| 331 | + params.append(paramEncode(name)); | |
| 332 | + } | |
| 333 | + if (weekStarts != null) { | |
| 334 | + params.append("&weekStarts="); | |
| 335 | + params.append(weekStarts); | |
| 336 | + } | |
| 337 | + if (weekEnds != null) { | |
| 338 | + params.append("&weekEnds="); | |
| 339 | + params.append(weekEnds); | |
| 340 | + } | |
| 341 | + if (org.apache.commons.lang.StringUtils.isNotBlank(hbsab)) { | |
| 342 | + params.append("&hbsab="); | |
| 343 | + params.append(paramEncode(hbsab)); | |
| 344 | + } | |
| 345 | + if (org.apache.commons.lang.StringUtils.isNotBlank(hbeag)) { | |
| 346 | + params.append("&hbeag="); | |
| 347 | + params.append(paramEncode(hbeag)); | |
| 348 | + } | |
| 349 | + if (org.apache.commons.lang.StringUtils.isNotBlank(hbeab)) { | |
| 350 | + params.append("&hbeab="); | |
| 351 | + params.append(paramEncode(hbeab)); | |
| 352 | + } | |
| 353 | + if (org.apache.commons.lang.StringUtils.isNotBlank(hbcab)) { | |
| 354 | + params.append("&hbcab="); | |
| 355 | + params.append(paramEncode(hbcab)); | |
| 356 | + } | |
| 357 | + if (org.apache.commons.lang.StringUtils.isNotBlank(syphilis)) { | |
| 358 | + params.append("&syphilis="); | |
| 359 | + params.append(paramEncode(syphilis)); | |
| 360 | + } | |
| 361 | + if (org.apache.commons.lang.StringUtils.isNotBlank(hiv)) { | |
| 362 | + params.append("&hiv="); | |
| 363 | + params.append(paramEncode(hiv)); | |
| 364 | + } | |
| 365 | + if (org.apache.commons.lang.StringUtils.isNotBlank(hcv)) { | |
| 366 | + params.append("&hcv="); | |
| 367 | + params.append(paramEncode(hcv)); | |
| 368 | + } | |
| 369 | + if (org.apache.commons.lang.StringUtils.isNotBlank(doctorNo)) { | |
| 370 | + params.append("&doctorNo="); | |
| 371 | + params.append(paramEncode(doctorNo)); | |
| 372 | + } | |
| 373 | + if (page != null) { | |
| 374 | + params.append("&page="); | |
| 375 | + params.append(page); | |
| 376 | + } | |
| 377 | + if (limit != null) { | |
| 378 | + params.append("&limit="); | |
| 379 | + params.append(limit); | |
| 380 | + } | |
| 381 | + MessageUtil.UTF8GetMethod utf8GetMethod = new MessageUtil.UTF8GetMethod(center_statistics_url+"center/exportChanReport?" + params.toString()); | |
| 382 | + HttpClient client = new HttpClient(); | |
| 383 | + try { | |
| 384 | + client.executeMethod(utf8GetMethod); | |
| 385 | + int statusCode = utf8GetMethod.getStatusCode(); | |
| 386 | + if (200 == statusCode) { | |
| 387 | + httpServletResponse.setContentType("application/octet-stream"); | |
| 388 | + httpServletResponse.setCharacterEncoding("UTF-8"); | |
| 389 | + httpServletResponse.setHeader("Content-Disposition", "attachment;fileName=datas.xls"); | |
| 390 | + httpServletResponse.getOutputStream().write(utf8GetMethod.getResponseBody()); | |
| 391 | + } | |
| 392 | + } catch (IOException e) { | |
| 393 | + e.printStackTrace(); | |
| 394 | + } | |
| 395 | + } | |
| 396 | + | |
| 397 | + /** | |
| 398 | + * 产检报告 | |
| 399 | + * @param request | |
| 400 | + * @return | |
| 401 | + */ | |
| 402 | + | |
| 403 | + @RequestMapping(value = "/center/queryChanJianReport", method = RequestMethod.GET) | |
| 404 | + @ResponseBody | |
| 405 | + public BaseListResponse queryCenterChanJianReport(HttpServletRequest request, | |
| 406 | + @RequestParam(required = false) Integer userId, | |
| 407 | + @RequestParam(required = false) String exDateStart, | |
| 408 | + @RequestParam(required = false) String exDateEnd, | |
| 409 | + @RequestParam(required = false) String name, | |
| 410 | + @RequestParam(required = false) Integer weekStarts, | |
| 411 | + @RequestParam(required = false) Integer weekEnds, | |
| 412 | + @RequestParam(required = false) String hbsab, | |
| 413 | + @RequestParam(required = false) String hbeag, | |
| 414 | + @RequestParam(required = false) String hbeab, | |
| 415 | + @RequestParam(required = false) String hbcab, | |
| 416 | + @RequestParam(required = false) String syphilis, | |
| 417 | + @RequestParam(required = false) String hiv, | |
| 418 | + @RequestParam(required = false) String hcv, | |
| 419 | + @RequestParam(required = false) String doctorNo, | |
| 420 | + @RequestParam(required = false) Integer page, | |
| 421 | + @RequestParam(required = false) Integer limit){ | |
| 422 | + BaseListResponse objectResponse = bookbuildingFacade.queryChanJianReport(userId, | |
| 423 | + exDateStart, | |
| 424 | + exDateEnd, | |
| 425 | + name, | |
| 426 | + weekStarts, | |
| 427 | + weekEnds, | |
| 428 | + hbsab, | |
| 429 | + hbeag, | |
| 430 | + hbeab, | |
| 431 | + hbcab, | |
| 432 | + syphilis, | |
| 433 | + hiv, | |
| 434 | + hcv, | |
| 435 | + doctorNo, | |
| 436 | + page, | |
| 437 | + limit | |
| 438 | + | |
| 439 | + ); | |
| 440 | + return objectResponse; | |
| 441 | + } | |
| 442 | + | |
| 443 | + | |
| 444 | + @RequestMapping(value = "/center/exportChanReport", method = RequestMethod.GET) | |
| 445 | + public void exportCenterChanReport(HttpServletRequest httpServletRequest,HttpServletResponse httpServletResponse, | |
| 446 | + @RequestParam(required = false) Integer userId, | |
| 447 | + @RequestParam(required = false) String exDateStart, | |
| 448 | + @RequestParam(required = false) String exDateEnd, | |
| 449 | + @RequestParam(required = false) String name, | |
| 450 | + @RequestParam(required = false) Integer weekStarts, | |
| 451 | + @RequestParam(required = false) Integer weekEnds, | |
| 452 | + @RequestParam(required = false) String hbsab, | |
| 453 | + @RequestParam(required = false) String hbeag, | |
| 454 | + @RequestParam(required = false) String hbeab, | |
| 455 | + @RequestParam(required = false) String hbcab, | |
| 456 | + @RequestParam(required = false) String syphilis, | |
| 457 | + @RequestParam(required = false) String hiv, | |
| 458 | + @RequestParam(required = false) String hcv, | |
| 459 | + @RequestParam(required = false) String doctorNo, | |
| 460 | + @RequestParam(required = false) Integer page, | |
| 461 | + @RequestParam(required = false) Integer limit){ | |
| 462 | + bookbuildingFacade.exportChanReport(userId, httpServletResponse, | |
| 463 | + exDateStart, | |
| 464 | + exDateEnd, | |
| 465 | + name, | |
| 466 | + weekStarts, | |
| 467 | + weekEnds, | |
| 468 | + hbsab, | |
| 469 | + hbeag, | |
| 470 | + hbeab, | |
| 471 | + hbcab, | |
| 472 | + syphilis, | |
| 473 | + hiv, | |
| 474 | + hcv, | |
| 475 | + doctorNo); | |
| 476 | + } | |
| 477 | + | |
| 478 | +} |