package cn.besteam.modules.medical.controller;
|
|
import cn.besteam.common.api.vo.Result;
|
import cn.besteam.modules.medical.dto.MwServicePeriodDTO;
|
import cn.besteam.modules.medical.dto.MwServicePeriodEditDTO;
|
import cn.besteam.modules.medical.dto.RenewOrderRequestVO;
|
import cn.besteam.modules.medical.service.IMwServicePeriodService;
|
import cn.besteam.modules.system.entity.SysUser;
|
import cn.besteam.modules.system.service.ISysUserService;
|
import com.alibaba.fastjson.JSONObject;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletResponse;
|
|
/**
|
* 服务期管理
|
* @author pzb
|
* @Date 2022/7/13 20:03
|
*/
|
@RestController
|
@RequestMapping("/medical/mwServicePeriod")
|
@Slf4j
|
@Api(description = "服务期管理")
|
public class MwServicePeriodController {
|
|
@Autowired
|
private IMwServicePeriodService mwServicePeriodService;
|
|
@Autowired
|
private ISysUserService sysUserService;
|
|
|
/**
|
* 获取服务期管理列表
|
* @param dto
|
* @return
|
*/
|
@GetMapping(value = "/getServicePeriodList")
|
@ApiOperation(value = "获取服务期管理列表", notes = "获取服务期管理列表", produces = "application/json")
|
public Result<?> getServicePeriodList(MwServicePeriodDTO dto){
|
return Result.ok(mwServicePeriodService.getServicePeriodList(dto));
|
}
|
|
|
/**
|
* 获取服务期管理编辑页面内容
|
* @param id
|
* @return
|
*/
|
@RequestMapping(value = "/getServicePeriodInfo", method = RequestMethod.GET)
|
@ApiOperation(value = "获取服务期管理编辑页面内容", notes = "获取服务期管理编辑页面内容", produces = "application/json")
|
@ApiImplicitParams({
|
@ApiImplicitParam(value = "数据id", name = "id", required = true, dataType = "int", paramType = "form")
|
})
|
public Result<?> getServicePeriodInfo(Integer id){
|
return Result.ok(mwServicePeriodService.getServicePeriodInfo(id));
|
}
|
|
|
/**
|
* 获取服务期管理编辑历史数据
|
* @param id
|
* @return
|
*/
|
@RequestMapping(value = "/getServicePeriodHistoryRecord", method = RequestMethod.GET)
|
@ApiOperation(value = "获取服务期管理编辑历史数据", notes = "获取服务期管理编辑历史数据", produces = "application/json")
|
@ApiImplicitParams({
|
@ApiImplicitParam(value = "数据id", name = "id", required = true, dataType = "int", paramType = "form")
|
})
|
public Result<?> getServicePeriodHistoryRecord(Integer id){
|
return Result.ok(mwServicePeriodService.getServicePeriodHistoryRecord(id));
|
}
|
|
|
/**
|
* 编辑服务期管理数据
|
* @param dto
|
* @param request
|
* @return
|
*/
|
@GetMapping(value = "/editServicePeriod")
|
@ApiOperation(value = "编辑服务期管理数据", notes = "编辑服务期管理数据", produces = "application/json")
|
public Result editServicePeriod(MwServicePeriodEditDTO dto, HttpServletRequest request){
|
String token = sysUserService.getToken(request);
|
SysUser user = sysUserService.getByToken(token);
|
mwServicePeriodService.editServicePeriod(dto, user.getId());
|
return Result.ok(new JSONObject());
|
}
|
|
|
/**
|
* 导出服务期管理数据
|
* @param dto
|
* @param response
|
*/
|
@GetMapping(value = "/exportServicePeriodList")
|
@ApiOperation(value = "导出服务期管理数据", notes = "导出服务期管理数据", produces = "application/json")
|
public void exportServicePeriodList(MwServicePeriodDTO dto, HttpServletResponse response){
|
try {
|
mwServicePeriodService.exportServicePeriodList(dto, response);
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}
|
|
|
/**
|
* 获取续费订单列表数据
|
* @param vo
|
* @param pageNo
|
* @param pageSize
|
* @return
|
*/
|
@GetMapping(value = "/getRenewOrderList")
|
@ApiOperation(value = "获取续费订单列表数据", notes = "获取续费订单列表数据", produces = "application/json")
|
public Result<?> getRenewOrderList(RenewOrderRequestVO vo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
|
return Result.ok(mwServicePeriodService.getRenewOrderList(vo, pageNo, pageSize));
|
}
|
|
|
/**
|
* 导出续费订单列表数据
|
* @param vo
|
* @param response
|
*/
|
@GetMapping(value = "/exportRenewOrder")
|
@ApiOperation(value = "导出续费订单列表数据", notes = "导出续费订单列表数据", produces = "application/json")
|
public void exportRenewOrder(RenewOrderRequestVO vo, HttpServletResponse response){
|
try {
|
mwServicePeriodService.exportRenewOrder(vo, response);
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}
|
|
|
@GetMapping(value = "/getRenewOrderOne")
|
@ApiOperation(value = "获取续费订单单条数据", notes = "获取续费订单单条数据", produces = "application/json")
|
public Result<?> getRenewOrderOne(Integer id){
|
return Result.ok(mwServicePeriodService.getRenewOrderOne(id));
|
}
|
|
|
/**
|
* 获取开票地址
|
* @param id
|
* @return
|
*/
|
@RequestMapping(value = "/getBillingAddress", method = RequestMethod.GET)
|
@ApiOperation(value = "获取开票地址", notes = "获取开票地址", produces = "application/json")
|
@ApiImplicitParams({
|
@ApiImplicitParam(value = "数据id", name = "id", required = true, dataType = "int", paramType = "form")
|
})
|
public Result<?> getBillingAddress(Integer id){
|
return Result.ok(mwServicePeriodService.getBillingAddress(id));
|
}
|
}
|