潮州人医快速借阅、快速归还

master
linjj 2 years ago
parent dcbcf482b8
commit 2c327b1720

@ -1,11 +1,16 @@
package com.emr.controller; package com.emr.controller;
import com.emr.dao.Archive_DetailMapper;
import com.emr.dao.Archive_MasterMapper;
import com.emr.dao.CommomMapper; import com.emr.dao.CommomMapper;
import com.emr.dao.approve.Emr_Apply_ApproveMapper; import com.emr.dao.approve.Emr_Apply_ApproveMapper;
import com.emr.dao.commomSearch.ScanPathMapper;
import com.emr.dao.emrPdfWaterSet.EmrPdfWaterSetMapper;
import com.emr.dao.recordLock.Emr_LockMapper; import com.emr.dao.recordLock.Emr_LockMapper;
import com.emr.dao.tScanAssort.T_Scan_AssortMapper; import com.emr.dao.tScanAssort.T_Scan_AssortMapper;
import com.emr.entity.Power_User; import com.emr.entity.Power_User;
import com.emr.entity.Zd_Assort; import com.emr.entity.Zd_Assort;
import com.emr.entity.emrPdfWaterSet.EmrPdfWaterSet;
import com.emr.entity.recordType.Emr_Type; import com.emr.entity.recordType.Emr_Type;
import com.emr.service.FontService; import com.emr.service.FontService;
import com.emr.service.Zd_AssortServiceImpl; import com.emr.service.Zd_AssortServiceImpl;
@ -14,11 +19,14 @@ import com.emr.service.recordType.EmrTypeService;
import com.emr.service.tScanAssort.T_Scan_AssortService; import com.emr.service.tScanAssort.T_Scan_AssortService;
import com.emr.util.ExceptionPrintUtil; import com.emr.util.ExceptionPrintUtil;
import com.emr.util.Jpg2PdfUtil; import com.emr.util.Jpg2PdfUtil;
import com.emr.vo.ArchiveMasterVo;
import com.emr.vo.FontVo.*; import com.emr.vo.FontVo.*;
import com.emr.vo.Msg; import com.emr.vo.Msg;
import com.emr.vo.PushRcvBasicDTO; import com.emr.vo.PushRcvBasicDTO;
import com.emr.vo.ZhFyImageVo; import com.emr.vo.ZhFyImageVo;
import com.emr.vo.commomSearch.CommomTree;
import com.emr.vo.commomSearch.CommomVo; import com.emr.vo.commomSearch.CommomVo;
import com.emr.vo.commomSearch.ScanPathVo;
import com.lowagie.text.Document; import com.lowagie.text.Document;
import com.lowagie.text.Image; import com.lowagie.text.Image;
import com.lowagie.text.Utilities; import com.lowagie.text.Utilities;
@ -77,9 +85,16 @@ public class FontController {
@Autowired @Autowired
private PushRcvBasicService pushRcvBasicService; private PushRcvBasicService pushRcvBasicService;
@Autowired
private Archive_MasterMapper archiveMasterMapper;
@Autowired
private Archive_DetailMapper archiveDetailMapper;
@Autowired
private EmrPdfWaterSetMapper pdfWaterSetMapper;
/** /**
* 2.1 * 2.1
*
* @MethodName getLockList * @MethodName getLockList
* @Description: * @Description:
* @Param lockVo.patientId, admissTimes, admissId * @Param lockVo.patientId, admissTimes, admissId
@ -110,6 +125,7 @@ public class FontController {
/** /**
* 2.2 * 2.2
*
* @MethodName getInpatientList * @MethodName getInpatientList
* @Description: * @Description:
* @Param lockVo.patientId, admissTimes, admissId * @Param lockVo.patientId, admissTimes, admissId
@ -165,6 +181,7 @@ public class FontController {
/** /**
* 2.3 * 2.3
*
* @MethodName getScanAssortPathList * @MethodName getScanAssortPathList
* @Description: PDF(PDF) * @Description: PDF(PDF)
* @Param lockVo.patientId, admissTimes, admissId * @Param lockVo.patientId, admissTimes, admissId
@ -280,8 +297,45 @@ public class FontController {
return Msg.success().add("list", scanAssortVos1); return Msg.success().add("list", scanAssortVos1);
} }
/**
* @description: 23
* @author linjj
* @date: 2024/3/25 15:25
*/
@RequestMapping(value = "downloadPdfBlood", method = RequestMethod.GET)
@ResponseBody
public void downloadPdf(HttpServletResponse response) {
//查询需要下载患者
List<ArchiveMasterVo> list = archiveMasterMapper.getMasterID();
for (ArchiveMasterVo archiveMaster : list) {
String masterId = archiveMaster.getId();
List<String> pdfPaths = archiveDetailMapper.selectPDFRATH2(masterId, "7A9C621E3F4F4C9CA95292141C5E15E8");
if (pdfPaths!=null||pdfPaths.isEmpty()){
String newPath = "D:\\jiashi\\copy" + File.separator + archiveMaster.getName() + "-" + archiveMaster.getInpNo()+"-知情同意书";
if (!new File(newPath).isDirectory()) {
new File(newPath).mkdirs();
}
for (String pdfPath:pdfPaths){
String newSrc = newPath + File.separator + new File(pdfPath).getName();
try (InputStream inputStream = new FileInputStream(pdfPath);
OutputStream outputStream = new FileOutputStream(newSrc)) {
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
System.out.println("文件拷贝完成");
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
/** /**
* 2.4 * 2.4
*
* @MethodName getScanAssortFilePathList * @MethodName getScanAssortFilePathList
* @Description: PDF * @Description: PDF
* @Param lockVo.patientId, admissTimes, admissId * @Param lockVo.patientId, admissTimes, admissId
@ -422,6 +476,7 @@ public class FontController {
/** /**
* 2.8 * 2.8
*
* @MethodName updateTableCommom * @MethodName updateTableCommom
* @Description: commomtablecommomtable1 * @Description: commomtablecommomtable1
* @Param * @Param
@ -477,6 +532,7 @@ public class FontController {
model.addAttribute("flag", flag); model.addAttribute("flag", flag);
return "recordManage/commomSearch/showRecordIframeBlood"; return "recordManage/commomSearch/showRecordIframeBlood";
} }
/** /**
* @description: * @description:
* @params: inpatientNo * @params: inpatientNo
@ -517,6 +573,7 @@ public class FontController {
List<ZhFyImageVo> list = tScanAssortService.getPathListByDisDate(startTime, endTime); List<ZhFyImageVo> list = tScanAssortService.getPathListByDisDate(startTime, endTime);
return Msg.successData(list); return Msg.successData(list);
} }
/** /**
* @description: * @description:
* @author linjj * @author linjj

@ -521,6 +521,21 @@ public class ApproveController {
emrApplyApprove.setDisTime(fmt.format(disDate)); emrApplyApprove.setDisTime(fmt.format(disDate));
} }
} }
List<User> userList = commomService.getUserList(user.getUserName(), request);
//查询条件用户名转姓名
for (Emr_Apply_Approve obj : approve){
//转换用户名
//获取申请者工号
String applyer = obj.getApplyer();
if(!CollectionUtils.isEmpty(userList)){
for(User user1 : userList){
String name = user1.getName();
if(StringUtils.isNotBlank(applyer) && user1.getUserName().equals(applyer)){
obj.setApplyer(name);
}
}
}
}
return JSON.toJSONString(emrApplyApprove); return JSON.toJSONString(emrApplyApprove);
}catch (Exception e){ }catch (Exception e){
ExceptionPrintUtil.printException(e); ExceptionPrintUtil.printException(e);

@ -16,6 +16,9 @@ public interface Archive_DetailMapper {
List<CommomTree> selectPdfPathByPatient2(@Param("patientId")String patientId); List<CommomTree> selectPdfPathByPatient2(@Param("patientId")String patientId);
List<String> selectPDFRATH(@Param("patientId")String patientId); List<String> selectPDFRATH(@Param("patientId")String patientId);
List<String> selectPDFRATH2(@Param("masterId")String masterId,@Param("assortId")String assortId);
List<String> getPDFRATH(@Param("patientId")String patientId,@Param("scanPages")String scanPages); List<String> getPDFRATH(@Param("patientId")String patientId,@Param("scanPages")String scanPages);

@ -1,5 +1,6 @@
package com.emr.dao; package com.emr.dao;
import com.emr.vo.ArchiveMasterVo;
import com.emr.vo.UpdateReturnVo; import com.emr.vo.UpdateReturnVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -24,4 +25,6 @@ public interface Archive_MasterMapper {
* @date: 2023/12/27 17:11 * @date: 2023/12/27 17:11
*/ */
List<UpdateReturnVo> getInpNoAndVisitIdByBarCode(@Param("barCode") String barCode); List<UpdateReturnVo> getInpNoAndVisitIdByBarCode(@Param("barCode") String barCode);
List<ArchiveMasterVo> getMasterID();
} }

@ -33,6 +33,7 @@ import java.util.List;
*/ */
public class Jpg2PdfUtil { public class Jpg2PdfUtil {
static Logger logger = LoggerFactory.getLogger(Jpg2PdfUtil.class); static Logger logger = LoggerFactory.getLogger(Jpg2PdfUtil.class);
public static void imageToPdf(HttpServletResponse response, List<String> filePaths, String pdfName) throws Exception { public static void imageToPdf(HttpServletResponse response, List<String> filePaths, String pdfName) throws Exception {
// 实例化图牿 // 实例化图牿
Image image = null; Image image = null;
@ -132,6 +133,7 @@ public class Jpg2PdfUtil {
writer.close(); writer.close();
} }
} }
public static boolean check(String file) { public static boolean check(String file) {
PdfReader pdfReader = null; PdfReader pdfReader = null;
try { try {
@ -357,6 +359,54 @@ public class Jpg2PdfUtil {
} }
} }
public static void mulFile2One4(HttpServletResponse response, List<String> filePath, String filename) {
// pdf合并工具类
Document document = null;
PdfCopy copy = null;
try {
filename = java.net.URLEncoder.encode(filename, "UTF-8");
response.reset();
response.setCharacterEncoding("utf-8");
response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "attachment; filename=" + filename + ".pdf");
document = new Document(new PdfReader(filePath.get(0)).getPageSize(1));
copy = new PdfCopy(document, response.getOutputStream());
document.open();
for (String file : filePath) {
PdfReader reader = new PdfReader(file);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
PdfReader pdfReader = null;
//判断是否加水印
int n = reader.getNumberOfPages();
for (int j = 1; j <= n; j++) {
document.newPage();
PdfImportedPage page = null;
page = copy.getImportedPage(reader, j);
copy.addPage(page);
}
if (null != pdfReader) {
pdfReader.close();
}
reader.close();
try {
bos.flush();
bos.close();
} catch (Exception e) {
//e.printStackTrace();
}
}
} catch (Exception e) {
//e.printStackTrace();
} finally {
if (null != document) {
document.close();
}
}
}
public static void mulFile2One2(HttpServletResponse response, List<String> filePaths, String filename, EmrPdfWaterSet emrPdfWaterSet) { public static void mulFile2One2(HttpServletResponse response, List<String> filePaths, String filename, EmrPdfWaterSet emrPdfWaterSet) {
//是否启用水印 //是否启用水印
Short effective = emrPdfWaterSet.getEffective(); Short effective = emrPdfWaterSet.getEffective();
@ -435,6 +485,7 @@ public class Jpg2PdfUtil {
/** /**
* h>whw>hw=h * h>whw>hw=h
*
* @param h * @param h
* @param w * @param w
* @return * @return

@ -0,0 +1,19 @@
package com.emr.vo;
import lombok.Data;
/**
* @ClassName ArchiveMasterVO
* @Author linjj
* @Date 2024/3/25 15:42
* @Version 1.0
*/
@Data
public class ArchiveMasterVo {
private String id;
private String inpNo;
private String visitId;
private String name;
}

@ -1,12 +1,12 @@
#power\u6743\u9650\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934 #power\u6743\u9650\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934
POWER_IP =localhost POWER_IP =172.16.11.90
POWER_URLHEAD = http://localhost:8081/power POWER_URLHEAD = http://172.16.11.90:8081/power
POWER_JSPHEAD = localhost POWER_JSPHEAD = 172.16.11.90
POWER_JSP = http://localhost:8081/power POWER_JSP = http://172.16.11.90:8081/power
#\u672C\u8EAB\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934 #\u672C\u8EAB\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934
EMR_RECORD_JSP = http://localhost:8081/emr_record EMR_RECORD_JSP = http://172.16.11.90:8081/emr_record
#webSocket\u670D\u52A1\u5668\u5730\u5740 #webSocket\u670D\u52A1\u5668\u5730\u5740
@ -53,4 +53,5 @@ fullTextSearchMethod = SearchFulltext
fullTextDays = 90 fullTextDays = 90
NEW_EMR_RECORD_JSP : http://localhost:8081/emr_record NEW_EMR_RECORD_JSP : http://localhost:8081/emr_record

@ -3,9 +3,9 @@ jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
#jdbc.username=sa #jdbc.username=sa
#jdbc.password=docus@702 #jdbc.password=docus@702
jdbc.url=jdbc\:sqlserver\://localhost:1433;databaseName=qf_record jdbc.url=jdbc\:sqlserver\://localhost:1433;databaseName=emr_record
jdbc.username=sa jdbc.username=sa
jdbc.password=admin123 jdbc.password=docus@702
#dataSource2 #dataSource2
jdbc.url2=jdbc\:sqlserver\://localhost:1433;databaseName=blgd_java jdbc.url2=jdbc\:sqlserver\://localhost:1433;databaseName=blgd_java

@ -160,6 +160,21 @@
<select id="selectPDFRATH2" resultType="java.lang.String">
SELECT
archive_detail.PDF_PATH
FROM
archive_detail
LEFT JOIN zd_assort
ON archive_detail.AssortID = zd_assort.assort_id
WHERE
MasterID = #{masterId} and zd_assort.assort_id=#{assortId}
ORDER BY zd_assort.assort_sort,UpLoadDateTime
</select>
<select id="getPDFRATH" resultType="java.lang.String"> <select id="getPDFRATH" resultType="java.lang.String">
SELECT SELECT
archive_detail.PDF_PATH archive_detail.PDF_PATH

@ -6,4 +6,8 @@
<select id="getInpNoAndVisitIdByBarCode" resultType="com.emr.vo.UpdateReturnVo"> <select id="getInpNoAndVisitIdByBarCode" resultType="com.emr.vo.UpdateReturnVo">
select inp_no,visit_id,discharge_date_time,name from archive_master where bar_code=#{barCode} select inp_no,visit_id,discharge_date_time,name from archive_master where bar_code=#{barCode}
</select> </select>
<select id="getMasterID" resultType="com.emr.vo.ArchiveMasterVo">
select * from archive_master where discharge_date_time between'2024-02-01 00:00:00' and '2024-03-31 23:59:59'
</select>
</mapper> </mapper>

@ -1158,7 +1158,7 @@
commomtable commomtable
<where> <where>
<if test="inpatientNo != null and inpatientNo != ''"> <if test="inpatientNo != null and inpatientNo != ''">
AND inpatient_no like '%${inpatientNo}%' AND admiss_id =#{inpatientNo}
</if> </if>
<if test="admissId != null and admissId != ''"> <if test="admissId != null and admissId != ''">
AND admiss_id = #{admissId} AND admiss_id = #{admissId}
@ -1239,7 +1239,7 @@
from commomtable from commomtable
<where> 1=1 <where> 1=1
<if test="inpatientNo != null and inpatientNo != ''"> <if test="inpatientNo != null and inpatientNo != ''">
AND inpatient_no like '%${inpatientNo}%' AND admiss_id =#{inpatientNo}
</if> </if>
<if test="idCard != null and idCard != ''"> <if test="idCard != null and idCard != ''">
AND id_card = #{idCard} AND id_card = #{idCard}

Loading…
Cancel
Save