优化2.0标准版代码

master
jian.wang 1 year ago
parent 1e0f6d46e3
commit 3c4d5bf773

@ -12,6 +12,7 @@ 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.dto.PatInfoEmrTypeDto; import com.emr.dto.PatInfoEmrTypeDto;
import com.emr.entity.Power_User; import com.emr.entity.Power_User;
import com.emr.entity.ResultUtil;
import com.emr.entity.Zd_Assort; import com.emr.entity.Zd_Assort;
import com.emr.entity.recordType.Emr_Type; import com.emr.entity.recordType.Emr_Type;
import com.emr.service.FontService; import com.emr.service.FontService;
@ -655,26 +656,20 @@ public class FontController {
* @return String * @return String
*/ */
@RequestMapping(value = "commomListqf", method = RequestMethod.GET) @RequestMapping(value = "commomListqf", method = RequestMethod.GET)
public String commomListqf(Model model, HttpServletRequest request, public ResultUtil commomListqf(Model model, HttpServletRequest request,
@RequestParam(value="hemodialysisId",required = false) String hemodialysisId, @RequestParam(value="hemodialysisId",required = false) String hemodialysisId,
@RequestParam(value="admissId",required = false) String admissId, @RequestParam(value="admissId",required = false) String admissId,
@RequestParam(value="outpatientNo",required = false) String outpatientNo) { @RequestParam(value="outpatientNo",required = false) String outpatientNo) {
System.out.println("开始跳转接口准备鉴权。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。");
try { try {
String userName = request.getParameter("userName"); String userName = request.getParameter("userName");
String dataSource = request.getParameter("dataSource"); String dataSource = request.getParameter("dataSource");
System.out.println("获取接口传递的参数{}--------------------------用户账号userName为" + userName + "---------dataSource为" + dataSource);
if(ObjectUtils.isEmpty(userName)){ if(ObjectUtils.isEmpty(userName)){
model.addAttribute("msg", "用户账号不能为空"); return ResultUtil.error("用户账号不能为空");
return "font/msg";
} }
if(ObjectUtils.isEmpty(dataSource)){ if(ObjectUtils.isEmpty(dataSource)){
model.addAttribute("msg", "数据源dataSource不能为空"); return ResultUtil.error("数据源dataSource不能为空");
return "font/msg";
} }
Map<String,String> params = new HashMap<>(); Map<String,String> params = new HashMap<>();
Map<String,String> userParams = new HashMap<>(); Map<String,String> userParams = new HashMap<>();
@ -689,32 +684,24 @@ public class FontController {
JSONObject userResultJson = JSONObject.parseObject(userResult); JSONObject userResultJson = JSONObject.parseObject(userResult);
if(ObjectUtils.isEmpty(userResultJson)){ if(ObjectUtils.isEmpty(userResultJson)){
model.addAttribute("msg", "用户账号不存在"); return ResultUtil.error("用户账号不存在");
return "font/msg";
} }
if(!"1".equals(userResultJson.getString("effective"))){ if(!"1".equals(userResultJson.getString("effective"))){
model.addAttribute("msg", "用户账号已设置为无效"); return ResultUtil.error("用户账号已设置为无效");
return "font/msg";
} }
params.put("userName", userResultJson.getString("userName")); params.put("userName", userResultJson.getString("userName"));
params.put("userPwd", userResultJson.getString("userPwd")); params.put("userPwd", userResultJson.getString("userPwd"));
params.put("remark", "GZINTERFACE"); params.put("remark", "GZINTERFACE");
System.out.println("开始模拟登录------------参数为:" + params);
String result = HttpClientUtils.doPost(POWER_URLHEAD + "/login", params); String result = HttpClientUtils.doPost(POWER_URLHEAD + "/login", params);
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
System.out.println("模拟登录成功------------返回结果为:" + jsonObject);
String token = jsonObject.getString("token"); String token = jsonObject.getString("token");
System.out.println("登录成功------------token为" + token);
if(!ObjectUtils.isEmpty(token)){ if(!ObjectUtils.isEmpty(token)){
this.getUserInfo(request, token, userName); this.getUserInfo(request, token, userName);
//查询表格配置表的数据,根据配置动态显示表格字段 //查询表格配置表的数据,根据配置动态显示表格字段
Map<String,Object> tableConfigMap = commomMapper.queryTableConfig(dataSource); /*Map<String,Object> tableConfigMap = commomMapper.queryTableConfig(dataSource);
if(!ObjectUtils.isEmpty(tableConfigMap)){ if(!ObjectUtils.isEmpty(tableConfigMap)){
//血透ID 广总血透接口的参数 //血透ID 广总血透接口的参数
model.addAttribute("hemodialysisId",hemodialysisId); model.addAttribute("hemodialysisId",hemodialysisId);
@ -736,12 +723,11 @@ public class FontController {
request.getSession().setAttribute("defaultSortField",tableConfigMap.get("defaultSortField")); request.getSession().setAttribute("defaultSortField",tableConfigMap.get("defaultSortField"));
//获取默认排序字段方式 //获取默认排序字段方式
request.getSession().setAttribute("defaultSortFieldType",tableConfigMap.get("defaultSortFieldType")); request.getSession().setAttribute("defaultSortFieldType",tableConfigMap.get("defaultSortFieldType"));
} }*/
return ResultUtil.ok(token);
return "recordManage/commomSearch/commomListqf"; //return "recordManage/commomSearch/commomListqf";
}else{ }else{
model.addAttribute("msg", "token获取失败"); return ResultUtil.error("token获取失败");
return "font/msg";
} }
}catch (Exception e) { }catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
@ -771,8 +757,6 @@ public class FontController {
Power_User powerUser = JSON.parseObject(objects[0].toString(), Power_User.class); Power_User powerUser = JSON.parseObject(objects[0].toString(), Power_User.class);
powerUser.setUserName(userName); powerUser.setUserName(userName);
System.out.println("调用power系统登录成功之后的用户信息为----------------------------------------------------------------" + JSONObject.toJSONString(powerUser));
//设置进session //设置进session
//request.getSession().setAttribute("CURRENT_USER", powerUser); //request.getSession().setAttribute("CURRENT_USER", powerUser);
ServletContext context = request.getServletContext(); ServletContext context = request.getServletContext();
@ -784,8 +768,6 @@ public class FontController {
//验证shiro(有shiro才此操作) //验证shiro(有shiro才此操作)
UsernamePasswordToken userToken = new UsernamePasswordToken(userName, "123456"); UsernamePasswordToken userToken = new UsernamePasswordToken(userName, "123456");
System.out.println("验证shiro获取userToken为----------------------------------------------------------" + JSONObject.toJSONString(userToken));
Subject subject = SecurityUtils.getSubject(); Subject subject = SecurityUtils.getSubject();
subject.login(userToken); subject.login(userToken);
} }

@ -148,6 +148,13 @@ public class CommomSearchController {
return "recordManage/commomSearch/imgStatisticsList"; return "recordManage/commomSearch/imgStatisticsList";
} }
@RequiresPermissions("/commom/scanReviewList")
@OptionalLog(module = "查看", methods = "扫描审核统计")
@RequestMapping("scanReviewList")
public String scanReviewList(Model model, HttpServletRequest request) {
return "recordManage/commomSearch/scanReviewList";
}
/** /**
* @Description: * @Description:
* @param page * @param page
@ -1075,7 +1082,7 @@ public class CommomSearchController {
user = (Power_User) currentUser; user = (Power_User) currentUser;
} }
String mapKey = user.getUserName() + "_" + patientId; String mapKey = user.getUserName() + "_" + patientId;
if(!ObjectUtils.isEmpty(rootPaths) && rootPaths.length() > 3){ if(!ObjectUtils.isEmpty(rootPaths)){
List<String> outs = commomService.selectPrintPic(response, patientId, rootPaths, names, sources, mapKey); List<String> outs = commomService.selectPrintPic(response, patientId, rootPaths, names, sources, mapKey);
return ResultUtil.ok(outs); return ResultUtil.ok(outs);
} }

@ -1606,7 +1606,8 @@ public class TemplateSearchController {
String formattedDate = targetFormat.format(date); String formattedDate = targetFormat.format(date);
sb.append("_"+formattedDate); sb.append("_"+formattedDate);
}else { }else {
sb.append("_" + contents + "_" + name); sb.append("_" + contents);
//sb.append("_" + contents + "_" + name);
} }
} }
return sb.toString(); return sb.toString();

@ -19,10 +19,8 @@ import com.emr.util.UploadUtil;
import com.emr.util.img2PdfUtil; import com.emr.util.img2PdfUtil;
import com.emr.vo.ExportInpVo; import com.emr.vo.ExportInpVo;
import com.emr.vo.User; import com.emr.vo.User;
import com.emr.vo.commomSearch.CommomTree;
import com.emr.vo.commomSearch.CommomVo; import com.emr.vo.commomSearch.CommomVo;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
@ -31,8 +29,6 @@ import org.apache.http.util.EntityUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
@ -45,7 +41,6 @@ import javax.imageio.ImageIO;
import javax.servlet.ServletContext; import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.*; import java.io.*;
import java.net.InetAddress; import java.net.InetAddress;
@ -53,8 +48,6 @@ import java.net.UnknownHostException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.*; import java.util.concurrent.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/** /**
* @ProjectName: * @ProjectName:
@ -84,6 +77,9 @@ public class CommomService {
@Value("${cost_pdf_path}") @Value("${cost_pdf_path}")
private String costPdfPath; private String costPdfPath;
@Value("${linuxPath}")
private String linuxPath;
@Autowired @Autowired
private CommomMapper commomMapper; private CommomMapper commomMapper;
@Autowired @Autowired
@ -375,7 +371,6 @@ public class CommomService {
//查询通过审批且未过期的patientId集合 //查询通过审批且未过期的patientId集合
user = (Power_User) currentUser; user = (Power_User) currentUser;
} }
if (user != null) { if (user != null) {
String mapKey = user.getUserName() + "_" + finalPatientId; String mapKey = user.getUserName() + "_" + finalPatientId;
request.getSession().setAttribute(mapKey, filePaths); request.getSession().setAttribute(mapKey, filePaths);
@ -749,12 +744,13 @@ public class CommomService {
} else { } else {
//需要水印 //需要水印
//组织加水印后图片存放目录 //组织加水印后图片存放目录
String waterPicRoot =""; String waterPicRoot = WATERPICPATH + patientId + File.separator + sourceList[i] + File.separator;;
if(srcPath.contains("/mnt/share")){ // if(srcPath.contains("/mnt/share") || srcPath.contains("/data")){
waterPicRoot = "/mnt/share/jiashi/reload/"+ patientId + File.separator + sourceList[i] + File.separator;//D:/jiashi/reload/patientId/1/ // waterPicRoot = "/data/jiashi/reload/"+ patientId + File.separator + sourceList[i] + File.separator;
}else{ // //waterPicRoot = "/mnt/share/jiashi/reload/"+ patientId + File.separator + sourceList[i] + File.separator;//D:/jiashi/reload/patientId/1/
waterPicRoot = WATERPICPATH + patientId + File.separator + sourceList[i] + File.separator;//D:/jiashi/reload/patientId/1/ // }else{
} // waterPicRoot = WATERPICPATH + patientId + File.separator + sourceList[i] + File.separator;//D:/jiashi/reload/patientId/1/
// }
//目录不存在则创建 //目录不存在则创建
if (!new File(waterPicRoot).isDirectory()) { if (!new File(waterPicRoot).isDirectory()) {
@ -773,7 +769,12 @@ public class CommomService {
} }
//组织输出地址 //组织输出地址
String root = selectRootByNotWater(WATERPICPATH); String root = selectRootByNotWater(WATERPICPATH);
if(srcPath.contains("/mnt/share")){ /*if(root == null){
outSrc = EMRRECORDJSP + File.separator + WATERPICPATH + patientId + File.separator + sourceList[i] + File.separator + nameList[i];
}else{
outSrc = EMRRECORDJSP + File.separator + root + "/jiashi/reload/" + patientId + File.separator + sourceList[i] + File.separator + nameList[i];
}*/
if(srcPath.contains(linuxPath)){
root = "picShare"; root = "picShare";
} }
outSrc = EMRRECORDJSP + File.separator + root + "/jiashi/reload/" + patientId + File.separator + sourceList[i] + File.separator + nameList[i]; outSrc = EMRRECORDJSP + File.separator + root + "/jiashi/reload/" + patientId + File.separator + sourceList[i] + File.separator + nameList[i];
@ -813,13 +814,12 @@ public class CommomService {
//获取盘符并转换映射地址的头部地址 //获取盘符并转换映射地址的头部地址
root = selectRootByNotWater(driveLetterPath); root = selectRootByNotWater(driveLetterPath);
if (root == null) { if (root == null) {
if(srcPath.contains("/mnt/share")){ if(srcPath.contains(linuxPath)){
srcPath = srcPath.replace("/mnt/share", "picShare"); srcPath = srcPath.replace(linuxPath, "picShare");
outSrc = EMRRECORDJSP + File.separator + srcPath; outSrc = EMRRECORDJSP + File.separator + srcPath;
}else{ }else{
outSrc = srcPath; outSrc = srcPath;
} }
} else { } else {
//获取盘符后面的地址 //获取盘符后面的地址
picPath = driveLetterPath.substring(driveLetterPath.indexOf('/')); picPath = driveLetterPath.substring(driveLetterPath.indexOf('/'));
@ -1066,29 +1066,29 @@ public class CommomService {
*/ */
private String selectRootByNotWater(String srcPath) { private String selectRootByNotWater(String srcPath) {
//获取盘符 //获取盘符
String str = srcPath.substring(0, 1).toUpperCase(); String str = srcPath.substring(0, 2).toUpperCase();
switch (str) { switch (str) {
case "C": case "C:":
return "reloadC\\"; return "reloadC\\";
case "D": case "D:":
return "reloadD\\"; return "reloadD\\";
case "E": case "E:":
return "reloadE\\"; return "reloadE\\";
case "F": case "F:":
return "reloadF\\"; return "reloadF\\";
case "G": case "G:":
return "reloadG\\"; return "reloadG\\";
case "H": case "H:":
return "reloadH\\"; return "reloadH\\";
case "I": case "I:":
return "reloadI\\"; return "reloadI\\";
case "J": case "J:":
return "reloadJ\\"; return "reloadJ\\";
case "K": case "K:":
return "reloadK\\"; return "reloadK\\";
case "Z": case "Z:":
return "reloadZ\\"; return "reloadZ\\";
case "W": case "W:":
return "reloadW\\"; return "reloadW\\";
default: default:
; ;
@ -1163,7 +1163,7 @@ public class CommomService {
String osName = System.getProperty("os.name").toLowerCase(); String osName = System.getProperty("os.name").toLowerCase();
String costPath =""; String costPath ="";
if (osName.contains("linux")) { if (osName.contains("linux")) {
costPath = "/mnt/share/cost"; costPath = linuxPath + File.separator + "cost";
}else{ }else{
costPath = costPdfPath; costPath = costPdfPath;
} }

@ -54,6 +54,9 @@ public class BatchExportServiceImpl implements BatchExportService {
@Value("${export_pdf_path}") @Value("${export_pdf_path}")
private String exportPdfPath; private String exportPdfPath;
@Value("linuxPath")
private String linuxPath;
@Override @Override
public String batchExportPdf(int taskId) throws Exception { public String batchExportPdf(int taskId) throws Exception {
@ -309,7 +312,7 @@ public class BatchExportServiceImpl implements BatchExportService {
outFlag = true; outFlag = true;
} }
String imagePath = scanPathVos.get(i).getFilePath(); String imagePath = scanPathVos.get(i).getFilePath();
if(imagePath.contains("/mnt/share")){ if(imagePath.contains("linuxPath")){
imagePath = imagePath.replace("\\", "/"); imagePath = imagePath.replace("\\", "/");
} }
Image image = Image.getInstance(imagePath); Image image = Image.getInstance(imagePath);

@ -6,6 +6,9 @@ import com.itextpdf.text.*;
import com.itextpdf.text.Image; import com.itextpdf.text.Image;
import com.itextpdf.text.pdf.*; import com.itextpdf.text.pdf.*;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
@ -26,14 +29,23 @@ import java.util.List;
* @Date 2024/4/8 9:13 * @Date 2024/4/8 9:13
* @Version 1.0 * @Version 1.0
*/ */
@Component
public class imgToPdfUtil { public class imgToPdfUtil {
@Value("${linuxPath}")
private static String linuxPath;
//标签顺序 //标签顺序
private static int outNum = 1; private static int outNum = 1;
private static int pageIndex = 0; private static int pageIndex = 0;
private static String lastOutline = null; //上一个目录名称 private static String lastOutline = null; //上一个目录名称
private static boolean outFlag = true;//是否增加标签 private static boolean outFlag = true;//是否增加标签
@Autowired
public imgToPdfUtil(@Value("${linuxPath}") String linuxPath) {
imgToPdfUtil.linuxPath = linuxPath;
}
/*public static void imageToPdf(HttpServletResponse response, List<ScanPathVo> scanPathVos, String pdfName, EmrPdfWaterSet pdfWaterSet, EmrPdfWaterSet pdfWaterSet1) throws IOException { /*public static void imageToPdf(HttpServletResponse response, List<ScanPathVo> scanPathVos, String pdfName, EmrPdfWaterSet pdfWaterSet, EmrPdfWaterSet pdfWaterSet1) throws IOException {
Document document = new Document(PageSize.A4, 0, 0, 0, 0); //创建文档容器 Document document = new Document(PageSize.A4, 0, 0, 0, 0); //创建文档容器
ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream();
@ -137,7 +149,7 @@ public class imgToPdfUtil {
} }
} }
String imagePath = scanPathVos.getFileRealPath(); String imagePath = scanPathVos.getFileRealPath();
if(imagePath.contains("/mnt/share")){ if(imagePath.contains(linuxPath)){
imagePath = imagePath.replace("\\", "/"); imagePath = imagePath.replace("\\", "/");
} }
Image image = Image.getInstance(imagePath); Image image = Image.getInstance(imagePath);
@ -268,7 +280,7 @@ public class imgToPdfUtil {
} }
} }
String imagePath = scanPathVos.get(i).getFileRealPath(); String imagePath = scanPathVos.get(i).getFileRealPath();
if(imagePath.contains("/mnt/share")){ if(imagePath.contains(linuxPath)){
imagePath = imagePath.replace("\\", "/"); imagePath = imagePath.replace("\\", "/");
} }
Image image = Image.getInstance(imagePath); Image image = Image.getInstance(imagePath);
@ -349,7 +361,7 @@ public class imgToPdfUtil {
public static Image processImage(ScanPathVo scanPathVo) { public static Image processImage(ScanPathVo scanPathVo) {
try { try {
String imagePath = scanPathVo.getFileRealPath(); String imagePath = scanPathVo.getFileRealPath();
if (imagePath.contains("/mnt/share")) { if (imagePath.contains(linuxPath)) {
imagePath = imagePath.replace("\\", "/"); imagePath = imagePath.replace("\\", "/");
} }
Image image = Image.getInstance(imagePath); Image image = Image.getInstance(imagePath);

@ -470,6 +470,26 @@ public class CommomVo {
private String periods; private String periods;
private String dataSource; private String dataSource;
private String opName;
private String opDate;
public String getOpName() {
return opName;
}
public void setOpName(String opName) {
this.opName = opName;
}
public String getOpDate() {
return opDate;
}
public void setOpDate(String opDate) {
this.opDate = opDate;
}
public String getPeriods() { public String getPeriods() {
return periods; return periods;
} }

@ -276,7 +276,7 @@
CONVERT(varchar, c.dis_date, 127)+'.000+0000' as outDate, CONVERT(varchar, c.dis_date, 127)+'.000+0000' as outDate,
c.dis_dept disDept, c.dis_dept disDept,
c.file_path+'\'+t.scan_page as scanFile, c.file_path+'\'+t.scan_page as scanFile,
t.assort_id as fdCode, t.assort_id as fdCode,+++ +
c.patient_id as indexId c.patient_id as indexId
FROM FROM
commomtable c commomtable c

@ -58,7 +58,7 @@
<mvc:resources mapping="/reloadK/**" location="file:K:/" /> <mvc:resources mapping="/reloadK/**" location="file:K:/" />
<mvc:resources mapping="/reloadZ/**" location="file:Z:/" /> <mvc:resources mapping="/reloadZ/**" location="file:Z:/" />
<mvc:resources mapping="/reloadW/**" location="file:W:/" /> <mvc:resources mapping="/reloadW/**" location="file:W:/" />
<mvc:resources mapping="/picShare/**" location="file:/mnt/share/" /> <mvc:resources mapping="/picShare/**" location="file:/data/" />
<!-- 当上面要访问的静态资源不包括在上面的配置中时,则根据此配置来访问 --> <!-- 当上面要访问的静态资源不包括在上面的配置中时,则根据此配置来访问 -->

@ -127,7 +127,7 @@
</div> </div>
</div> </div>
<div class="searchDiv" style="margin-top: 0.4%"> <div class="searchDiv" style="margin-top: 0.4%">
<div class="searchInput left"> <div class="searchInput left" style="display: none">
<div class="searchElement left"> <div class="searchElement left">
<label class="labelDiv">用途:</label> <label class="labelDiv">用途:</label>
</div> </div>

@ -305,7 +305,7 @@
<div class="col-sm-8 inputDiv"> <div class="col-sm-8 inputDiv">
<input type="text" class="form-control input-sm inputValue" id="inpatient_no" <input type="text" class="form-control input-sm inputValue" id="inpatient_no"
maxlength="16"> maxlength="16">
<input type="checkbox" id="inpatientNoCheckbox" <input type="checkbox" id="inpatientNoCheckbox" checked
class="otherTable operTable isOperInput"><label for="inpatientNoCheckbox" class="otherTable operTable isOperInput"><label for="inpatientNoCheckbox"
class="checkBoxClass">模糊查询</label> class="checkBoxClass">模糊查询</label>
</div> </div>

Loading…
Cancel
Save