|
|
@ -3,6 +3,7 @@ package com.docus.server.controller;
|
|
|
|
import com.docus.infrastructure.web.request.SearchDTO;
|
|
|
|
import com.docus.infrastructure.web.request.SearchDTO;
|
|
|
|
import com.docus.infrastructure.web.response.PageResult;
|
|
|
|
import com.docus.infrastructure.web.response.PageResult;
|
|
|
|
import com.docus.server.api.recovery.RcvBasicApi;
|
|
|
|
import com.docus.server.api.recovery.RcvBasicApi;
|
|
|
|
|
|
|
|
import com.docus.server.common.IgnoreValidate;
|
|
|
|
import com.docus.server.dto.recovery.rcvbasic.AddRcvBasicDTO;
|
|
|
|
import com.docus.server.dto.recovery.rcvbasic.AddRcvBasicDTO;
|
|
|
|
import com.docus.server.dto.recovery.rcvbasic.DeleteRcvBasicDTO;
|
|
|
|
import com.docus.server.dto.recovery.rcvbasic.DeleteRcvBasicDTO;
|
|
|
|
import com.docus.server.dto.recovery.rcvbasic.EditRcvBasicDTO;
|
|
|
|
import com.docus.server.dto.recovery.rcvbasic.EditRcvBasicDTO;
|
|
|
@ -11,10 +12,15 @@ import com.docus.server.vo.recovery.rcvbasic.RcvBasicVO;
|
|
|
|
import com.docus.server.vo.recovery.rcvbasic.SearchRcvBasicVO;
|
|
|
|
import com.docus.server.vo.recovery.rcvbasic.SearchRcvBasicVO;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
|
|
|
|
import java.io.OutputStream;
|
|
|
|
import java.io.Serializable;
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
@ -119,17 +125,29 @@ public class RcvBasicController implements RcvBasicApi {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 关键字搜索
|
|
|
|
* 关键字搜索(安卓)
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param searchDTO 搜索参数
|
|
|
|
* @param searchDTO 搜索参数
|
|
|
|
* @return 分页列表
|
|
|
|
* @return 分页列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation("关键字搜索")
|
|
|
|
@ApiOperation("关键字搜索(安卓)")
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public PageResult<SearchRcvBasicVO> search(SearchDTO searchDTO) {
|
|
|
|
public PageResult<SearchRcvBasicVO> search(SearchDTO searchDTO) {
|
|
|
|
return iRcvBasicService.search(searchDTO);
|
|
|
|
return iRcvBasicService.search(searchDTO);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 关键字搜索(PC)
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param searchDTO 搜索参数
|
|
|
|
|
|
|
|
* @return 分页列表
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@ApiOperation("关键字搜索(PC)")
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public PageResult<RcvBasicVO> page(SearchDTO searchDTO) {
|
|
|
|
|
|
|
|
return iRcvBasicService.page(searchDTO);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 新增
|
|
|
|
* 新增
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -265,4 +283,27 @@ public class RcvBasicController implements RcvBasicApi {
|
|
|
|
public int findByIdAndName(Serializable id, String name) {
|
|
|
|
public int findByIdAndName(Serializable id, String name) {
|
|
|
|
return iRcvBasicService.findByIdAndName(id, name);
|
|
|
|
return iRcvBasicService.findByIdAndName(id, name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@IgnoreValidate
|
|
|
|
|
|
|
|
@ApiOperation("下载病案回收导入基础数据excel模板")
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void excelTemplateDownload(HttpServletResponse response) throws Exception {
|
|
|
|
|
|
|
|
// 取要下载的模板名称
|
|
|
|
|
|
|
|
String fileName = "病案回收导入基础数据模板.xlsx";
|
|
|
|
|
|
|
|
String address = "/tpl/病案回收导入基础数据模板.xlsx";
|
|
|
|
|
|
|
|
//得到该文件
|
|
|
|
|
|
|
|
ClassPathResource classPathResource = new ClassPathResource(address);
|
|
|
|
|
|
|
|
InputStream fileInputStream = classPathResource.getInputStream();
|
|
|
|
|
|
|
|
//设置Http响应头告诉浏览器下载这个附件,下载的文件名也是在这里设置的
|
|
|
|
|
|
|
|
response.setHeader("Content-Disposition", "attachment;Filename=" + URLEncoder.encode(fileName, "UTF-8"));
|
|
|
|
|
|
|
|
OutputStream outputStream = response.getOutputStream();
|
|
|
|
|
|
|
|
byte[] bytes = new byte[2048];
|
|
|
|
|
|
|
|
int len = 0;
|
|
|
|
|
|
|
|
while ((len = fileInputStream.read(bytes)) > 0) {
|
|
|
|
|
|
|
|
outputStream.write(bytes, 0, len);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
outputStream.flush();
|
|
|
|
|
|
|
|
fileInputStream.close();
|
|
|
|
|
|
|
|
outputStream.close();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|