|  | @ -1,16 +1,13 @@
 | 
	
		
			
				|  |  | package com.yihu.rehabilitation.controller;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.yihu.jw.exception.ApiException;
 | 
	
		
			
				|  |  | import com.yihu.jw.rehabilitation.RehabilitationInformationDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.common.Envelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.common.EnvelopRestController;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.rehabilitation.RehabilitationInformationVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.iot.IotRequestMapping;
 | 
	
		
			
				|  |  | import com.yihu.rehabilitation.service.RehabilitationInformationService;
 | 
	
		
			
				|  |  | import io.swagger.annotations.Api;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiOperation;
 | 
	
		
			
				|  |  | import io.swagger.annotations.ApiParam;
 | 
	
		
			
				|  |  | import org.apache.commons.lang.StringUtils;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | import org.springframework.http.MediaType;
 | 
	
		
			
				|  |  | import org.springframework.web.bind.annotation.*;
 | 
	
	
		
			
				|  | @ -29,7 +26,7 @@ public class RehabilitationInformationController extends EnvelopRestController {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @GetMapping(value = RehabilitationRequestMapping.Information.findInformationPage)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "分页查找就诊信息", notes = "分页查找就诊信息")
 | 
	
		
			
				|  |  |     public Envelop<RehabilitationInformationVO> findCompanyPage(@ApiParam(name = "hospital", value = "就诊医院名称", defaultValue = "")
 | 
	
		
			
				|  |  |     public Envelop<RehabilitationInformationVO> findInformationPage(@ApiParam(name = "hospital", value = "就诊医院名称", defaultValue = "")
 | 
	
		
			
				|  |  |                                                  @RequestParam(value = "hospital", required = false) String hospital,
 | 
	
		
			
				|  |  |                                                  @ApiParam(name = "patientId", value = "居民id", defaultValue = "")
 | 
	
		
			
				|  |  |                                                  @RequestParam(value = "patientId", required = false) String patientId,
 | 
	
	
		
			
				|  | @ -68,7 +65,7 @@ public class RehabilitationInformationController extends EnvelopRestController {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @GetMapping(value = RehabilitationRequestMapping.Information.findInformationById)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "根据id查找就诊信息", notes = "根据id查找就诊信息")
 | 
	
		
			
				|  |  |     public Envelop<RehabilitationInformationVO> findByCode(@ApiParam(name = "id", value = "id")
 | 
	
		
			
				|  |  |     public Envelop<RehabilitationInformationVO> findById(@ApiParam(name = "id", value = "id")
 | 
	
		
			
				|  |  |                                             @RequestParam(value = "id", required = true) String id) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             RehabilitationInformationDO informationDO = rehabilitationInformationService.findById(id);
 | 
	
	
		
			
				|  | @ -80,7 +77,7 @@ public class RehabilitationInformationController extends EnvelopRestController {
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @GetMapping(value = RehabilitationRequestMapping.Information.findInformationById)
 | 
	
		
			
				|  |  |     @GetMapping(value = RehabilitationRequestMapping.Information.findInformationByPatientId)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "根据patientId查找就诊信息", notes = "根据patientId查找就诊信息")
 | 
	
		
			
				|  |  |     public Envelop<RehabilitationInformationVO> findByPatientId(@ApiParam(name = "patientId", value = "patientId")
 | 
	
		
			
				|  |  |                                                            @RequestParam(value = "patientId", required = true) String patientId) {
 | 
	
	
		
			
				|  | @ -95,14 +92,14 @@ public class RehabilitationInformationController extends EnvelopRestController {
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = RehabilitationRequestMapping.Information.api_update)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "修改就诊信息", notes = "修改就诊信息")
 | 
	
		
			
				|  |  |     public Envelop<RehabilitationInformationVO> updCompany(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
 | 
	
		
			
				|  |  |     @ApiOperation(value = "修改就诊信息", notes = "修改就诊信息(记得传入修改id)")
 | 
	
		
			
				|  |  |     public Envelop<RehabilitationInformationVO> updateInformation(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
 | 
	
		
			
				|  |  |                                             @RequestParam(value = "jsonData", required = true)String jsonData) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             RehabilitationInformationVO informationVO = toEntity(jsonData, RehabilitationInformationVO.class);
 | 
	
		
			
				|  |  |             RehabilitationInformationDO informationDO = rehabilitationInformationService.convertToModel(informationVO, RehabilitationInformationDO.class);
 | 
	
		
			
				|  |  |             rehabilitationInformationService.update(informationDO);
 | 
	
		
			
				|  |  |             return Envelop.getSuccess(RehabilitationRequestMapping.Information.message_success_find);
 | 
	
		
			
				|  |  |             return Envelop.getSuccess(RehabilitationRequestMapping.Information.message_success_update);
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |             return Envelop.getError(e.getMessage());
 | 
	
	
		
			
				|  | @ -110,12 +107,12 @@ public class RehabilitationInformationController extends EnvelopRestController {
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @PostMapping(value = RehabilitationRequestMapping.Information.api_delete)
 | 
	
		
			
				|  |  |     @ApiOperation(value = "删除企业", notes = "删除企业")
 | 
	
		
			
				|  |  |     public Envelop<RehabilitationInformationVO> delCompany(@ApiParam(name = "id", value = "id")
 | 
	
		
			
				|  |  |     @ApiOperation(value = "删除就诊信息", notes = "删除就诊信息")
 | 
	
		
			
				|  |  |     public Envelop<RehabilitationInformationVO> delInformation(@ApiParam(name = "id", value = "id")
 | 
	
		
			
				|  |  |                                             @RequestParam(value = "id", required = true) String id) {
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             rehabilitationInformationService.delete(id);
 | 
	
		
			
				|  |  |             return Envelop.getSuccess(RehabilitationRequestMapping.Information.message_success_find);
 | 
	
		
			
				|  |  |             return Envelop.getSuccess(RehabilitationRequestMapping.Information.message_success_delete);
 | 
	
		
			
				|  |  |         } catch (Exception e) {
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |             return Envelop.getError(e.getMessage());
 |