Compare commits

...

2 Commits

Author SHA1 Message Date
jiangs
4764a89ccb Merge remote-tracking branch 'lis8.0/master' 2025-09-04 16:57:47 +08:00
jiangs
de7b03c172 文件下载,住院采血修改 2025-09-04 16:57:39 +08:00
5 changed files with 84 additions and 4 deletions

View File

@ -11,6 +11,8 @@ import java.net.URLEncoder;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import com.czlis.common.config.RuoYiConfig; import com.czlis.common.config.RuoYiConfig;
@ -28,6 +30,37 @@ public class FileUtils
{ {
public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+"; public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
public static void writeBytes(HttpServletResponse response,String filePath, OutputStream os) throws IOException
{
FileInputStream fis = null;
try
{
File file = new File(filePath);
if (!file.exists())
{
throw new FileNotFoundException(filePath);
}
response.setHeader("Content-Length", String.valueOf(file.length()));
fis = new FileInputStream(file);
byte[] b = new byte[1024];
int length;
while ((length = fis.read(b)) > 0)
{
os.write(b, 0, length);
}
}
catch (IOException e)
{
throw e;
}
finally
{
IOUtils.close(os);
IOUtils.close(fis);
}
}
/** /**
* 输出指定文件的byte数组 * 输出指定文件的byte数组
* *

View File

@ -55,7 +55,7 @@ public class CommonController {
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
FileUtils.setAttachmentResponseHeader(response, realFileName); FileUtils.setAttachmentResponseHeader(response, realFileName);
FileUtils.writeBytes(filePath, response.getOutputStream()); FileUtils.writeBytes(response,filePath, response.getOutputStream());
if (delete) { if (delete) {
FileUtils.deleteFile(filePath); FileUtils.deleteFile(filePath);
} }

View File

@ -27,6 +27,7 @@ public class Web_fs_printReport {
private String confirmer; private String confirmer;
private String sqh; private String sqh;
private String bgdh; private String bgdh;
private String bgdhTemp;
private String xmdh; private String xmdh;
private String csjg; private String csjg;
private String refs; private String refs;

View File

@ -24,6 +24,7 @@ import java.io.IOException;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@Service @Service
@Slf4j @Slf4j
@ -101,8 +102,51 @@ public class ZybgcxServcieImpl implements ZybgcxService {
@Override @Override
public Result getFSResult(Web_fs_printReport webFsPrintReport) { public Result getFSResult(Web_fs_printReport webFsPrintReport) {
List<Web_fs_printReport> webFsPrintReportList = zybgcxMapper.getFSResult(webFsPrintReport); //List<Web_fs_printReport> webFsPrintReportList = zybgcxMapper.getFSResult(webFsPrintReport);
return new Result("0","获取数据成功!",webFsPrintReportList); String bgdhTemp = "";
String yqdl = webFsPrintReport.getYqdl();
String brdh = webFsPrintReport.getBrdh();
List<Web_fs_printReport> fsResultList = zybgcxMapper.getFSResult(webFsPrintReport);
//查询这个仪器大类数据中包含这个项目的报告单号
List<Web_fs_printReport> webFsPrintReportCollect = fsResultList.stream().filter(webFsPrintReport1 -> webFsPrintReport1.getXmdh().equals(webFsPrintReport.getXmdh())).collect(Collectors.toList());
for (Web_fs_printReport web_fs_printReport : webFsPrintReportCollect) {
bgdhTemp = bgdhTemp + ",'" + web_fs_printReport.getBgdh() + "'";
}
if(bgdhTemp.length() > 0){
bgdhTemp = bgdhTemp.substring(1);
}
Web_fs_printReport webFsPrintReport1 = new Web_fs_printReport();
webFsPrintReport1.setYqdl(yqdl);
webFsPrintReport1.setBrdh(brdh);
webFsPrintReport1.setBgdhTemp(bgdhTemp);
List<Web_fs_printReport> fsResult = zybgcxMapper.getFSResult(webFsPrintReport1);
// for (Web_fs_printReport web_fs_printReport : fsResultList) {
// bgdhTemp = bgdhTemp + "," + web_fs_printReport.getBgdh();
// }
// if(bgdhTemp.length() > 0){
// bgdhTemp = bgdhTemp.substring(1);
// }
// Web_fs_printReport webFsPrintReport1 = new Web_fs_printReport();
// webFsPrintReport1.setYqdl(yqdl);
// webFsPrintReport1.setBrdh(brdh);
// if(webFsPrintReportList.size() > 0){
// String yqdl = webFsPrintReportList.get(0).getYqdl();
// Web_fs_printReport webFsPrintReport1 = new Web_fs_printReport();
// webFsPrintReport1.setBrdh(webFsPrintReportList.get(0).getBrdh());
// webFsPrintReport1.setYqdl(yqdl);
// List<Web_fs_printReport> fsResultList = zybgcxMapper.getFSResult(webFsPrintReport1);
// for (Web_fs_printReport web_fs_printReport : fsResultList) {
// bgdhTemp = bgdhTemp + "," + web_fs_printReport.getBgdh();
// }
// if(bgdhTemp.length() > 0){
// bgdhTemp = bgdhTemp.substring(1);
// }
// }
return new Result("0","获取数据成功!",fsResult);
} }

View File

@ -26,9 +26,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="getFSResult" resultType="com.czlis.zybgcx.pojo.Web_fs_printReport"> <select id="getFSResult" resultType="com.czlis.zybgcx.pojo.Web_fs_printReport">
select * from web_fs_printReport where brdh = #{brdh} select * from web_fs_printReport where brdh = #{brdh} and jyrq > getdate() - 90 and brlyname = '住院'
<if test="xmdh != null and xmdh != ''"> and xmdh = #{xmdh}</if> <if test="xmdh != null and xmdh != ''"> and xmdh = #{xmdh}</if>
<if test="bgdh != null and bgdh != ''"> and bgdh = #{bgdh}</if> <if test="bgdh != null and bgdh != ''"> and bgdh = #{bgdh}</if>
<if test="yqdl != null and yqdl != ''"> and yqdl = #{yqdl}</if>
<if test="bgdhTemp != null and bgdhTemp != ''"> and bgdh in (${bgdhTemp})</if>
order by bgdh order by bgdh
</select> </select>