修改增加水印文本,修改病案室审核页面查询纸质状态bug,录入纸质信息bug,合并pdfbug

master
zengwh 4 years ago
parent 93c0b10dc1
commit 97262932a0

@ -75,8 +75,6 @@ public class lastVerifyController {
archiveMasterVo.setEndDateTo(null);
}
try {
//是否查询纸质签收状态的相关处理
archiveMasterService.setLastVerifyList(archiveMasterVo);
OffsetLimitPage offsetLimitPage = archiveMasterService.selectByLast(archiveMasterVo, offset, limit);
return offsetLimitPage;
} catch (Exception e) {
@ -98,11 +96,8 @@ public class lastVerifyController {
String tableThNames = "住院号,住院次数,名字,性别,出院科室,出院日期,主管医生,状态,纸质状态,纸质扫描";
String fieldCns = "inpNo,visitId,name,sex,deptName,dischargeDateTime,doctorInCharge,status,remark,checkName";
try {
//是否查询纸质签收状态的相关处理
archiveMasterService.setLastVerifyList(archiveMasterVo);
//构造excel的数据
List<Archive_Master_Vo> list = archiveMasterService.selectLastVerifyList(archiveMasterVo);
//文件名
String fileName = "病案室终审" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls";
//ExportExcelUtil

@ -118,13 +118,13 @@ public interface Archive_MasterService {
List<Archive_Master_Vo> selectLastVerifyList(Archive_Master_Vo archiveMasterVo);
Archive_Master_Vo setLastVerifyList(Archive_Master_Vo vo);
List<Archive_Master> loadDoctorInCharge(String deptName);
List<Archive_Master> loadOverTimeDoctorInCharge();
List<String> selectOracleGetSignList(StringBuilder patientIdStr, List<String> selectList);
//String selectLockInfoByMasterId(String archiveDetailId);
}

@ -197,59 +197,6 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
return new OffsetLimitPage((Page) list);
}
/**
*
* @param vo
* @return
*/
@Override
public Archive_Master_Vo setLastVerifyList(Archive_Master_Vo vo) {
if(null != vo.getIsSign()){
//查询护士长已审核与召回病历记账号集合
List<Archive_Master> masters = archiveMasterMapper.selectPatientIdsForSign();
//处理记账号返回字符串
StringBuilder patientIds = new StringBuilder();
if(!CollectionUtils.isEmpty(masters)){
for(Archive_Master master : masters){
if(StringUtils.isNotBlank(master.getPatientId())){
if(StringUtils.isNotBlank(patientIds)){
patientIds.append(",");
}
patientIds.append("'").append(master.getPatientId()).append("'");
}
}
//将查询结果带入查询oracle返回集合
List<String> selectList = new ArrayList<>();
List<String> selectList1 = new ArrayList<>();
//selectList.add("1304063");
//selectList.add("1304458");
if(masters.size() > 30){
patientIds = null;
}
selectList = selectOracleGetSignList(patientIds,selectList);
if(!CollectionUtils.isEmpty(selectList)) {
for (Archive_Master master : masters) {
if (StringUtils.isNotBlank(master.getPatientId())) {
if (StringUtils.isNotBlank(master.getPatientId())) {
for (String patientId : selectList) {
if (master.getPatientId().equals(patientId)) {
selectList1.add(master.getPatientId());
break;
}
}
}
}
}
}
//设置进查询条件
if(!CollectionUtils.isEmpty(selectList1)) {
vo.setPatientIdsForSign(selectList1);
}
}
}
return vo;
}
/**
*
* */
@ -267,8 +214,6 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
public List<Archive_Master_Vo> selectLastVerifyList(Archive_Master_Vo archiveMasterVo){
List<Archive_Master_Vo> list = archiveMasterMapper.selectByLast(archiveMasterVo);
if(null != list && !list.isEmpty()){
//记帐号集合
StringBuilder patientIdStr = new StringBuilder();
//查询科室集合
Emr_Dictionary dictionary = new Emr_Dictionary();
dictionary.setTypecode("dept_code");
@ -283,40 +228,6 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
}else if(status.equals(EnumVerify.DocState.CallBacked.getCode())){
masterVo.setStatus(EnumVerify.DocState.CallBacked.getName());
}
//科室转换
//组织记帐号集合
if(StringUtils.isNotBlank(masterVo.getPatientId())) {
if (StringUtils.isNotBlank(patientIdStr)) {
patientIdStr.append(",'").append(masterVo.getPatientId()).append("'");
} else {
patientIdStr.append("'").append(masterVo.getPatientId()).append("'");
}
}
}
//赋值签收情况
List<String> selectList = new ArrayList<>();
try{
selectList = selectOracleGetSignList(patientIdStr, selectList);
for (Archive_Master_Vo masterVo : list) {
if(null == archiveMasterVo.getIsSign()) {
masterVo.setRemark("未签收");
//赋值
if (!CollectionUtils.isEmpty(selectList)) {
String patientId = masterVo.getPatientId();
if (StringUtils.isNotBlank(patientId)) {
for (String str : selectList) {
if (str.equals(patientId)) {
masterVo.setRemark("已签收");
break;
}
}
}
}
}
}
}catch (Exception e){
e.printStackTrace();
ExceptionPrintUtil.printException(e);
}
}
return list;
@ -1194,6 +1105,11 @@ public class Archive_MasterServiceImpl implements Archive_MasterService {
}
return selectList;
}
/*@Override
public String selectLockInfoByMasterId(String archiveDetailId) {
return null;
}*/
}

@ -82,7 +82,6 @@ public class Jpg2PdfUtil {
if (!CollectionUtils.isEmpty(list)) {
// pdf合并工具类
Document document = null;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
PdfCopy copy = null;
try {
response.reset();
@ -90,24 +89,34 @@ public class Jpg2PdfUtil {
copy = new PdfCopy(document, response.getOutputStream());
document.open();
for (PdfReader reader : list) {
bos.flush();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
PdfReader pdfReader = null;
//判断是否加水印
if (StringUtils.isNotBlank(waterMarkName)) {
setWatermark(bos, reader, waterMarkName, null);
reader = new PdfReader(bos.toByteArray());
pdfReader = new PdfReader(bos.toByteArray());
}
int n = reader.getNumberOfPages();
for (int j = 1; j <= n; j++) {
document.newPage();
PdfImportedPage page = null;
if (StringUtils.isNotBlank(waterMarkName)) {
page = copy.getImportedPage(reader, j);
page = copy.getImportedPage(pdfReader, j);
} else {
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();
@ -115,12 +124,6 @@ public class Jpg2PdfUtil {
if (null != copy) {
copy.close();
}
try {
bos.flush();
bos.close();
} catch (Exception e) {
//e.printStackTrace();
}
if (null != document) {
document.close();
}
@ -150,15 +153,27 @@ public class Jpg2PdfUtil {
content.setColorFill(Color.LIGHT_GRAY);
content.setFontAndSize(base, 50);
content.setTextMatrix(70, 200);
String[] waterMarks = waterMarkName.split("&");
//v:距左 v1:距下 v2:
content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 600, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 200, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 600, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 200, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 1100, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 300, 1500, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 1100, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarkName, 800, 1500, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 250, 600, 40);
/*content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 250, 200, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 800, 600, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 800, 200, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 250, 1100, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 250, 1500, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 800, 1100, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[0], 800, 1500, 40);*/
if(waterMarks.length > 1){
//v:距左 v1:距下 v2:
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 310, 400, 40);
/* content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 310, 150, 40);*/
/*content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 860, 550, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 860, 150, 40);*/
/* content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 300, 900, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 300, 1300, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 800, 900, 40);
content.showTextAligned(Element.ALIGN_CENTER, waterMarks[1], 800, 1300, 40);*/
}
content.endText();
}
if (StringUtils.isNotBlank(imgPath)) {

@ -39,7 +39,7 @@ STR_SPLIT = *^:|,.
recallReason=\u533B\u9662\u9700\u8981\u8FD9\u4EFD\u6587\u6863
#pdf\u6C34\u5370
pdfWater = \u4F5B\u5C71\u5E02\u9AD8\u660E\u4EBA\u6C11\u533B\u9662
pdfWater = \u4F5B\u5C71\u5E02\u9AD8\u660E\u4EBA\u6C11\u533B\u9662&\u62CD\u7167\u65E0\u6548,\u9700\u8981\u590D\u5370\u8BF7\u627E\u75C5\u6848\u5BA4
#\u672C\u5730\u56FE\u7247\u5730\u5740
pictureUrl=D:\\JiaShiPic\\

@ -646,7 +646,12 @@
CASE
WHEN MasterID IS NULL THEN
'否' ELSE '是'
END checkName
END checkName,
CASE
WHEN T1 IS NOT NULL
AND YEAR ( T1 ) != '1801' THEN
'已签收' ELSE '未签收'
END remark
from archive_master m
LEFT JOIN ( SELECT MasterID FROM archive_detail INNER JOIN archive_master ON archive_detail.MasterID =
archive_master.id WHERE Source = '扫描上传' GROUP BY MasterID ) archive_detail ON m.id = archive_detail.MasterID
@ -662,26 +667,15 @@
</when>
</choose>
</if>
<!--查询纸质签收状态-->
<if test="isSign != null">
and patient_id
<choose>
<!--已签收-->
<when test="isSign == 1">
in
<when test="isSign == 0">
AND (T1 IS NULL OR YEAR(T1) = '1801')
</when>
<otherwise>
not in
</otherwise>
</choose>
(
<choose>
<when test="patientIdsForSign != null">
<foreach collection="patientIdsForSign" item="item" separator=",">#{item}</foreach>
<when test="isSign == 1">
AND (T1 IS NOT NULL AND YEAR(T1) != '1801')
</when>
<otherwise>'无效'</otherwise>
</choose>
)
</if>
<if test="id != null and id != ''">
and m.id = #{id,jdbcType=NVARCHAR}

@ -52,6 +52,9 @@
<insert id="insertSelective" parameterType="com.emr.entity.EmrPaperPositionInfo" >
insert into emr_paper_position_info
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="patientId != null" >
patient_id,
</if>
@ -102,6 +105,9 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=BIGINT},
</if>
<if test="patientId != null" >
#{patientId,jdbcType=NVARCHAR},
</if>

Loading…
Cancel
Save