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

@ -148,6 +148,13 @@ public class CommomSearchController {
return "recordManage/commomSearch/imgStatisticsList";
}
@RequiresPermissions("/commom/scanReviewList")
@OptionalLog(module = "查看", methods = "扫描审核统计")
@RequestMapping("scanReviewList")
public String scanReviewList(Model model, HttpServletRequest request) {
return "recordManage/commomSearch/scanReviewList";
}
/**
* @Description:
* @param page
@ -1075,7 +1082,7 @@ public class CommomSearchController {
user = (Power_User) currentUser;
}
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);
return ResultUtil.ok(outs);
}

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

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

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

@ -6,6 +6,9 @@ import com.itextpdf.text.*;
import com.itextpdf.text.Image;
import com.itextpdf.text.pdf.*;
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.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@ -26,14 +29,23 @@ import java.util.List;
* @Date 2024/4/8 9:13
* @Version 1.0
*/
@Component
public class imgToPdfUtil {
@Value("${linuxPath}")
private static String linuxPath;
//标签顺序
private static int outNum = 1;
private static int pageIndex = 0;
private static String lastOutline = null; //上一个目录名称
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 {
Document document = new Document(PageSize.A4, 0, 0, 0, 0); //创建文档容器
ByteArrayOutputStream bos = new ByteArrayOutputStream();
@ -137,7 +149,7 @@ public class imgToPdfUtil {
}
}
String imagePath = scanPathVos.getFileRealPath();
if(imagePath.contains("/mnt/share")){
if(imagePath.contains(linuxPath)){
imagePath = imagePath.replace("\\", "/");
}
Image image = Image.getInstance(imagePath);
@ -268,7 +280,7 @@ public class imgToPdfUtil {
}
}
String imagePath = scanPathVos.get(i).getFileRealPath();
if(imagePath.contains("/mnt/share")){
if(imagePath.contains(linuxPath)){
imagePath = imagePath.replace("\\", "/");
}
Image image = Image.getInstance(imagePath);
@ -349,7 +361,7 @@ public class imgToPdfUtil {
public static Image processImage(ScanPathVo scanPathVo) {
try {
String imagePath = scanPathVo.getFileRealPath();
if (imagePath.contains("/mnt/share")) {
if (imagePath.contains(linuxPath)) {
imagePath = imagePath.replace("\\", "/");
}
Image image = Image.getInstance(imagePath);

@ -470,6 +470,26 @@ public class CommomVo {
private String periods;
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() {
return periods;
}

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

@ -58,7 +58,7 @@
<mvc:resources mapping="/reloadK/**" location="file:K:/" />
<mvc:resources mapping="/reloadZ/**" location="file:Z:/" />
<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 class="searchDiv" style="margin-top: 0.4%">
<div class="searchInput left">
<div class="searchInput left" style="display: none">
<div class="searchElement left">
<label class="labelDiv">用途:</label>
</div>

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

Loading…
Cancel
Save