查看pdf修改
parent
2bd840766e
commit
819bf862de
@ -0,0 +1,104 @@
|
||||
package com.emr.controller.quality;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.emr.annotation.OptionalLog;
|
||||
import com.emr.service.quality.QualityService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* @ClassName QualityController
|
||||
* @Description 文件质检模块
|
||||
* @Author linjj
|
||||
* @Date 2023/4/13 14:51
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("qualityModel/")
|
||||
public class QualityController {
|
||||
|
||||
@Autowired
|
||||
QualityService qualityService;
|
||||
|
||||
|
||||
@RequiresPermissions("/qualityModel/qualityJsp")
|
||||
@OptionalLog(module = "查看", methods = "常用查询页面")
|
||||
@RequestMapping("qualityJsp")
|
||||
public String qualityModel(Model model) {
|
||||
return "quality/quality";
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 查询功能
|
||||
* @params: startRange
|
||||
* @params: endRange
|
||||
* @return: String
|
||||
* @author linjj
|
||||
* @date: 2023/4/13 15:24
|
||||
*/
|
||||
@RequestMapping(value = "getPhAndDocumentNum", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String getPhAndDocumentNum(String startRange, String endRange) {
|
||||
if (StringUtils.isEmpty(startRange) && StringUtils.isEmpty(endRange)) {
|
||||
return "开始范围,结束范围不能全部为空";
|
||||
}
|
||||
if (StringUtils.isNotEmpty(startRange) && StringUtils.isNotEmpty(endRange)) {
|
||||
if (startRange.compareTo(endRange) > 0) {
|
||||
return "开始范围不能小于结束范围";
|
||||
}
|
||||
}
|
||||
String phAndDocumentNum = qualityService.getPhAndDocumentNum(startRange, endRange);
|
||||
return JSON.toJSONString(phAndDocumentNum);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 检查功能
|
||||
* @params: startRange
|
||||
* @params: endRange
|
||||
* @return: String
|
||||
* @author linjj
|
||||
* @date: 2023/4/14 9:32
|
||||
*/
|
||||
@RequestMapping(value = "examineDocument", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String examineDocument(String startRange, String endRange) {
|
||||
if (StringUtils.isEmpty(startRange) && StringUtils.isEmpty(endRange)) {
|
||||
return "开始范围,结束范围不能全部为空";
|
||||
}
|
||||
if (StringUtils.isNotEmpty(startRange) && StringUtils.isNotEmpty(endRange)) {
|
||||
if (startRange.compareTo(endRange) > 0) {
|
||||
return "开始范围不能小于结束范围";
|
||||
}
|
||||
}
|
||||
String s = qualityService.examineDocument(startRange, endRange);
|
||||
return JSON.toJSONString(s);
|
||||
}
|
||||
/**
|
||||
* @description: 高级检查
|
||||
* @params: startRange
|
||||
* @params: endRange
|
||||
* @return: String
|
||||
* @author linjj
|
||||
* @date: 2023/4/14 9:32
|
||||
*/
|
||||
@RequestMapping(value = "SeniorExamine", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public String SeniorExamine(String startRange, String endRange) {
|
||||
if (StringUtils.isEmpty(startRange) && StringUtils.isEmpty(endRange)) {
|
||||
return "开始范围,结束范围不能全部为空";
|
||||
}
|
||||
if (StringUtils.isNotEmpty(startRange) && StringUtils.isNotEmpty(endRange)) {
|
||||
if (startRange.compareTo(endRange) > 0) {
|
||||
return "开始范围不能小于结束范围";
|
||||
}
|
||||
}
|
||||
String s = qualityService.SeniorExamine(startRange, endRange);
|
||||
return JSON.toJSONString(s);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
package com.emr.dao.quality;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName QualityMapper
|
||||
* @Description 文件质检
|
||||
* @Author linjj
|
||||
* @Date 2023/4/13 15:29
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface QualityMapper {
|
||||
|
||||
Integer getPhNum(@Param("startRange")String startRange, @Param("endRange")String endRange);
|
||||
|
||||
Integer getFileNum(@Param("startRange")String startRange, @Param("endRange")String endRange);
|
||||
|
||||
List<String>getFliePath(@Param("ph")String ph);
|
||||
|
||||
List<String>getPh(@Param("startRange")String startRange, @Param("endRange")String endRange);
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.emr.service.quality;
|
||||
|
||||
/**
|
||||
* @InterfaceName QualityService
|
||||
* @Description 文件质检服务
|
||||
* @Author linjj
|
||||
* @Date 2023/4/13 15:26
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface QualityService {
|
||||
|
||||
String getPhAndDocumentNum(String startRange,String endRange);
|
||||
|
||||
String examineDocument(String startRange,String endRange);
|
||||
|
||||
String SeniorExamine(String startRange,String endRange);
|
||||
}
|
||||
@ -0,0 +1,98 @@
|
||||
package com.emr.service.quality;
|
||||
|
||||
import com.emr.dao.quality.QualityMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName QualityServiceImpl
|
||||
* @Description
|
||||
* @Author linjj
|
||||
* @Date 2023/4/13 15:26
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
@Service
|
||||
@Transactional
|
||||
public class QualityServiceImpl implements QualityService {
|
||||
|
||||
@Autowired
|
||||
QualityMapper qualityMapper;
|
||||
|
||||
@Override
|
||||
public String getPhAndDocumentNum(String startRange, String endRange) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
Integer phNum = qualityMapper.getPhNum(startRange, endRange);
|
||||
Integer fileNum = qualityMapper.getFileNum(startRange, endRange);
|
||||
String s = sb.append("查询结果:" + phNum + "盘," + fileNum + "个文件数据").toString();
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String examineDocument(String startRange, String endRange) {
|
||||
//用来记录确实记录
|
||||
int i = 0;
|
||||
//用来拼接缺失文件地址
|
||||
StringBuffer lackPath = new StringBuffer();
|
||||
//用来返回记录
|
||||
StringBuffer sb = new StringBuffer();
|
||||
List<String> phList = qualityMapper.getPh(startRange, endRange);
|
||||
for (String ph : phList) {
|
||||
List<String> fliePathList = qualityMapper.getFliePath(ph);
|
||||
for (String fliePath : fliePathList) {
|
||||
File file = new File(fliePath);// 图片存放路径
|
||||
if (!file.exists() && !file.isDirectory()) {
|
||||
i++;
|
||||
lackPath.append(fliePath + ",");
|
||||
}
|
||||
}
|
||||
}
|
||||
String s = sb.append("缺失" + i + "个文件," + "缺失文件为:" + lackPath).toString();
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String SeniorExamine(String startRange, String endRange) {
|
||||
//用来记录缺失数量
|
||||
int i = 0;
|
||||
//用来继续故障数量
|
||||
int faultNum = 0;
|
||||
//用来拼接缺失文件地址
|
||||
StringBuffer lackPath = new StringBuffer();
|
||||
//用来拼接故障文件地址
|
||||
StringBuffer faultPath = new StringBuffer();
|
||||
//用来返回记录
|
||||
StringBuffer sb = new StringBuffer();
|
||||
List<String> phList = qualityMapper.getPh(startRange, endRange);
|
||||
for (String ph : phList) {
|
||||
List<String> fliePathList = qualityMapper.getFliePath(ph);
|
||||
for (String fliePath : fliePathList) {
|
||||
File file = new File(fliePath);// 图片存放路径
|
||||
if (!file.exists() && !file.isDirectory()) {
|
||||
i++;
|
||||
lackPath.append(fliePath + ",");
|
||||
}
|
||||
}
|
||||
for (String list : fliePathList) {
|
||||
try {
|
||||
Image image = ImageIO.read(new FileInputStream(list));
|
||||
} catch (IOException e) {
|
||||
faultNum++;
|
||||
faultPath.append(list + ",");
|
||||
}
|
||||
}
|
||||
}
|
||||
String s = sb.append("缺失" + i + "个文件," + "缺失文件为:" + lackPath+"故障文件"+faultNum+"个文件,"+"故障文件为:"+faultPath).toString();
|
||||
return s;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.emr.dao.quality.QualityMapper" >
|
||||
|
||||
<select id="getPhNum" resultType="java.lang.Integer">
|
||||
SELECT COUNT(distinct ph) FROM commomtable
|
||||
<where> 1=1
|
||||
<if test="startRange != null and startRange != ''">
|
||||
and ph >= #{startRange,jdbcType=NVARCHAR}
|
||||
</if>
|
||||
<if test="endRange != null and endRange != ''">
|
||||
and ph <= #{endRange,jdbcType=NVARCHAR}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getFileNum" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(t.patient_id)
|
||||
FROM
|
||||
commomtable c
|
||||
LEFT JOIN t_scan_assort t on c.patient_id=t.patient_id
|
||||
<where> t.is_del!=1
|
||||
<!-- <if test="startRange != null and startRange != '' and endRange != null and endRange != ''">-->
|
||||
<!-- and ph >= #{startRange,jdbcType=NVARCHAR}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="startRange != null and startRange != '' and endRange != null and endRange != ''">-->
|
||||
<!-- and ph <= #{endRange,jdbcType=NVARCHAR}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="startRange != null and startRange != '' and endRange = null and endRange = ''">-->
|
||||
<!-- and ph = #{startRange,jdbcType=NVARCHAR}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="startRange = null and startRange = '' and endRange != null and endRange != ''">-->
|
||||
<!-- and ph = #{endRange,jdbcType=NVARCHAR}-->
|
||||
<!-- </if>-->
|
||||
<if test="startRange != null and startRange != '' ">
|
||||
and ph >= #{startRange,jdbcType=NVARCHAR}
|
||||
</if>
|
||||
<if test="endRange != null and endRange != ''">
|
||||
and ph <= #{endRange,jdbcType=NVARCHAR}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getFliePath" resultType="java.lang.String">
|
||||
SELECT
|
||||
c.file_path+'\'+t.scan_page as fliePath
|
||||
FROM
|
||||
commomtable c
|
||||
LEFT JOIN t_scan_assort t on c.patient_id=t.patient_id
|
||||
where t.is_del!=1 and c.ph=#{ph,jdbcType=NVARCHAR}
|
||||
</select>
|
||||
<select id="getPh" resultType="java.lang.String">
|
||||
SELECT distinct ph FROM commomtable
|
||||
<where> 1=1
|
||||
<if test="startRange != null and startRange != '' ">
|
||||
and ph >= #{startRange,jdbcType=NVARCHAR}
|
||||
</if>
|
||||
<if test="endRange != null and endRange != ''">
|
||||
and ph <= #{endRange,jdbcType=NVARCHAR}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,167 @@
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<c:set var="path" value="${pageContext.request.contextPath}"/>
|
||||
<%@ include file="/WEB-INF/jspf/common.jspf" %>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>文件质检</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta http-equiv=X-UA-Compatible IE=EmulateIE7>
|
||||
<!--[if lt IE 9]>
|
||||
<script type="text/javascript" src="${path}/static/js/html5shiv.min.js"></script>
|
||||
<script type="text/javascript" src="${path}/static/js/jquery-1.11.3.min.js"></script>
|
||||
<script type="text/javascript" src="${path}/static/js/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<script>
|
||||
var path = "${path}";
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.mainDiv {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
/**搜索区*/
|
||||
.searchDiv {
|
||||
padding-top: 10px;
|
||||
width: 100%;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.dateSearchDiv {
|
||||
width: 29%;
|
||||
}
|
||||
|
||||
.dateSearchInput {
|
||||
width: 30%;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.dateLabelDiv {
|
||||
width: 30%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.searchInput {
|
||||
width: 21%;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.searchElement {
|
||||
text-align: right;
|
||||
width: 40%;
|
||||
}
|
||||
|
||||
.searchInputElement {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.labelDiv {
|
||||
padding-top: 4%;
|
||||
margin-left: 2%;
|
||||
}
|
||||
|
||||
/**查询按钮组*/
|
||||
.btnsDiv {
|
||||
margin-top: 0.4%;
|
||||
height: 35px;
|
||||
text-align: right;
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
||||
.btns {
|
||||
margin-left: 2%;
|
||||
}
|
||||
|
||||
/**表格div*/
|
||||
.tableDiv {
|
||||
margin-left: 1%;
|
||||
margin-right: 1%;
|
||||
margin-top: -15px;
|
||||
}
|
||||
|
||||
.hidden-xs {
|
||||
max-width: 250px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.boxDiv {
|
||||
width: 200px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.documentNum {
|
||||
padding-left: 100px;
|
||||
}
|
||||
.examineDocument {
|
||||
padding-left: 100px;
|
||||
}
|
||||
.seniorExamine{
|
||||
padding-left: 100px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="main">
|
||||
<div class="headDiv">
|
||||
<div class="headSpanDiv">
|
||||
<span class="headspan">
|
||||
文件质检
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mainDiv">
|
||||
<div class="searchDiv" style="margin-top: 0.4%">
|
||||
<div class="dateSearchDiv left">
|
||||
<div class="dateLabelDiv left">
|
||||
<label class="labelDiv">盘号:</label>
|
||||
</div>
|
||||
<div class="dateSearchInput left">
|
||||
<input type="number" class="form-control input-sm" id="startRange" placeholder="开始范围"
|
||||
maxlength="10" min="0" autocomplete="off">
|
||||
</div>
|
||||
<div class="dateSearchInput left">
|
||||
<input type="number" oninput="" min="0" class="form-control input-sm" id="endRange" placeholder="结束范围" maxlength="10"
|
||||
autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxDiv">
|
||||
<div class="left">
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="getPhAndDocumentNum()">查询</button>
|
||||
</div>
|
||||
<div class="left">
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="examineDocument()">检查</button>
|
||||
</div>
|
||||
<div class="left">
|
||||
<button type="button" class="btn btn-sm btn-primary" onclick="SeniorExamine()">高级检查</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--数据表格-->
|
||||
<div id="tableDiv" class="tableDiv">
|
||||
<input type="hidden" id="checks">
|
||||
<table id="mytab" class="table text-nowrap table-bordered">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="documentNum">
|
||||
|
||||
</div>
|
||||
<div class="examineDocument">
|
||||
|
||||
</div>
|
||||
<div class="seniorExamine">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript" src="${path}/static/js/otherManage/quality.js?t=2022-01-17"></script>
|
||||
<script type="text/javascript" src="${path}/static/js/dateUtil.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,73 @@
|
||||
function getPhAndDocumentNum() {
|
||||
var startRange = $("#startRange").val();
|
||||
var endRange = $("#endRange").val();
|
||||
if (!startRange &&!endRange) {
|
||||
return toastr.warning("开始范围,结束范围不能全部为空")
|
||||
}
|
||||
if (!startRange &&!endRange) {
|
||||
if (startRange > endRange) {
|
||||
return toastr.warning("开始范围不能小于结束范围")
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url:path+"/qualityModel/getPhAndDocumentNum",
|
||||
data:{startRange:startRange,endRange:endRange},
|
||||
dataType:'json',
|
||||
success:function(data){
|
||||
$('.documentNum').html(data)
|
||||
},
|
||||
})
|
||||
$('.examineDocument').html("")
|
||||
$('.seniorExamine').html("")
|
||||
|
||||
}
|
||||
function examineDocument(){
|
||||
var startRange = $("#startRange").val();
|
||||
var endRange = $("#endRange").val();
|
||||
if (!startRange &&!endRange) {
|
||||
return toastr.warning("开始范围,结束范围不能全部为空")
|
||||
}
|
||||
if (!startRange &&!endRange) {
|
||||
if (startRange > endRange) {
|
||||
return toastr.warning("开始范围不能小于结束范围")
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url:path+"/qualityModel/examineDocument",
|
||||
data:{startRange:startRange,endRange:endRange},
|
||||
dataType:'json',
|
||||
success:function(data){
|
||||
$('.examineDocument').html(data)
|
||||
},
|
||||
})
|
||||
$('.seniorExamine').html("")
|
||||
$('.documentNum').html("")
|
||||
}
|
||||
|
||||
function SeniorExamine(){
|
||||
var startRange = $("#startRange").val();
|
||||
var endRange = $("#endRange").val();
|
||||
if (!startRange &&!endRange) {
|
||||
return toastr.warning("开始范围,结束范围不能全部为空")
|
||||
}
|
||||
if (!startRange &&!endRange) {
|
||||
if (startRange > endRange) {
|
||||
return toastr.warning("开始范围不能小于结束范围")
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url:path+"/qualityModel/SeniorExamine",
|
||||
data:{startRange:startRange,endRange:endRange},
|
||||
dataType:'json',
|
||||
success:function(data){
|
||||
$('.seniorExamine').html(data)
|
||||
},
|
||||
})
|
||||
$('.examineDocument').html("")
|
||||
$('.documentNum').html("")
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue