|
@ -0,0 +1,63 @@
|
|
|
package com.yihu.wlyy.web.third.rehabilitation;
|
|
|
|
|
|
import com.yihu.wlyy.service.third.rehabilitation.RehabilitationPlanningService;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
/**
|
|
|
* @author humingfen on 2018/5/4.
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping(value = "/rehabilitation",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(description = "康复计划")
|
|
|
public class RehabilitationPlanningController extends BaseController {
|
|
|
@Autowired
|
|
|
private RehabilitationPlanningService rehabilitationPlanningService;
|
|
|
|
|
|
@RequestMapping(value = "/findById",method = RequestMethod.GET)
|
|
|
@ApiOperation("按id查询")
|
|
|
public String findById(@ApiParam(name = "id",value = "id",defaultValue = "")
|
|
|
@RequestParam(name="id",required = true) String id) {
|
|
|
try {
|
|
|
return write(200, "查询成功", "data", rehabilitationPlanningService.getById(id));
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/updatePlanning",method = RequestMethod.POST)
|
|
|
@ApiOperation("修改康复计划数据")
|
|
|
public String updatePlanning(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
|
|
|
@RequestParam(value = "jsonData", required = true)String jsonData){
|
|
|
try {
|
|
|
rehabilitationPlanningService.update(jsonData);
|
|
|
return success("更新成功");
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return error(-1,e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/delPlanning",method = RequestMethod.POST)
|
|
|
@ApiOperation("删除康复计划")
|
|
|
public String delHealthIndex(@ApiParam(name = "id",value = "id",defaultValue = "")
|
|
|
@RequestParam(name="id",required = true) String id){
|
|
|
try {
|
|
|
rehabilitationPlanningService.delete(id);
|
|
|
return success("删除成功");
|
|
|
}catch (Exception e){
|
|
|
error(e);
|
|
|
return error(-1,e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|