病案回收接口

master
linjj 2 years ago
parent 8140356149
commit 8d559dd7bd

@ -132,14 +132,14 @@ public class BatchApplyDetailsController {
/**
* @description:
* @params:
* @return:
* @params: ids
* @return: int
* @author linjj
* @date: 2023/9/20 14:54
*/
@RequestMapping("agreeById")
@ResponseBody
public int agreeById(String ids) {
return batchApplyDetailsService.agreeById(ids);
public int agreeById(String ids,Integer batchId) {
return batchApplyDetailsService.agreeById(ids,batchId);
}
}

@ -29,8 +29,14 @@ public interface BatchApplyMapper {
BatchApplyVo getBorrowingNum(int batchId);
BatchApplyVo getreadNum(int batchId);
int updateBorrowingNum(@Param("borrowingNum") int borrowingNum, @Param("batchId") int batchId);
int updateReadNumm(@Param("readNum") int readNum, @Param("batchId") int batchId);
int updateStatc(@Param("statc") int statc, @Param("batchId") int batchId);
int deleteById(int id);
}

@ -27,5 +27,5 @@ public interface BatchApplyDetailsService {
int rejectById(int id);
int agreeById(String ids);
int agreeById(String ids,Integer batchId);
}

@ -5,7 +5,6 @@ import com.emr.dao.BatchApplyMapper;
import com.emr.dao.EmrComomSetMapper;
import com.emr.dao.Emr_DictionaryMapper;
import com.emr.entity.*;
import com.emr.util.ExceptionPrintUtil;
import com.emr.util.ListUtils;
import com.emr.util.Setters;
import com.emr.vo.BatchApplyDetailsVo;
@ -13,11 +12,8 @@ import com.emr.vo.BatchApplyVo;
import com.emr.vo.BatchBorrowingVo;
import com.emr.vo.commomSearch.CommomVo;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@ -105,21 +101,21 @@ public class BatchApplyDetailsServiceImpl implements BatchApplyDetailsService {
}
@Override
public int agreeById(String ids) {
public int agreeById(String ids, Integer batchId) {
int i=0;
//获取系统当前时间
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
//获取登录用户信息
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
// 从session获取用户名
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
//声明一个BatchApplyDetailsVo对象
BatchApplyDetailsVo batchApplyDetailsVo = new BatchApplyDetailsVo();
//声明一个BatchApplyDetailsVo集合
List<BatchApplyDetailsVo> list = Collections.synchronizedList(new ArrayList<>());
//将字符串转为List<String>在转成List<Integer>
List<Integer> idsList = Arrays.asList(ids.split(",")).stream().mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());
//遍历审核信息
for (Integer id : idsList) {
BatchApplyDetailsVo batchApplyDetailsVo = new BatchApplyDetailsVo();
batchApplyDetailsVo.setExamineName(user.getUserPosition());
batchApplyDetailsVo.setExamineTime(fmt.format(new Date()));
batchApplyDetailsVo.setApplyStatc(1);
@ -128,9 +124,36 @@ public class BatchApplyDetailsServiceImpl implements BatchApplyDetailsService {
}
//给有效时间赋值
upDateEffectiveTimeList(list);
return batchApplyDetailsMapper.upadteApplyDetailsList(list);
boolean b = upadteApplyDetais(list);
if (b){
i=1;
}
//更新审批数量
upDateAgreeNum(batchId,list.size());
return i;
}
private void upDateAgreeNum(int batchId,int readNum){
BatchApplyVo batchApplyVo = batchApplyMapper.getreadNum(batchId);
int i = readNum + batchApplyVo.getReadNum();
batchApplyMapper.updateReadNumm(i,batchId);
// //如果借阅数量跟审批数量一样则改为已审批
if (batchApplyVo.getBorrowingNum()==i){
batchApplyMapper.updateStatc(2,batchId);
}else {
batchApplyMapper.updateStatc(3,batchId);
}
}
private boolean upadteApplyDetais(List<BatchApplyDetailsVo> list){
boolean flag=false;
for (BatchApplyDetailsVo batchApplyDetailsVo:list){
batchApplyDetailsMapper.upadteApplyDetails(batchApplyDetailsVo);
flag=true;
}
return flag;
}
private void upDateEffectiveTimeList(List<BatchApplyDetailsVo> batchApplyDetailsVolist) {
for (BatchApplyDetailsVo list : batchApplyDetailsVolist) {

@ -635,8 +635,8 @@ public class CommomService {
//定义输出地址
String outSrc = "";
//获取项目上下文地址
if ((printEffective != null && printEffective == 1 && roleId == 8) ||
(printIsImg != null && printIsImg == 1) && roleId == 8) {
if ((printEffective != null && printEffective == 1 ) ||
(printIsImg != null && printIsImg == 1) ) {
if ("99".equals(sourceList[i])) {
String rootSrcPath = selectRootByNotWater(srcPath);
String str2 = srcPath.substring(0, srcPath.indexOf(File.separator));
@ -937,6 +937,8 @@ public class CommomService {
return "reloadJ\\";
case "K":
return "reloadK\\";
case "Z":
return "reloadZ\\";
default:
;
}

@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.DigestUtils;
import java.io.File;
import java.net.MalformedURLException;
@ -96,6 +97,7 @@ public class T_Scan_AssortServiceImpl implements T_Scan_AssortService{
List<ZhFyImageVo> list = scanAssortMapper.getPathListByInpatientNo(inpatientNo, admissTimes);
for (ZhFyImageVo scanAssortList:list){
List<PicListVo> picList = scanAssortList.getPicList();
//编辑图片信息
for (PicListVo picPathList:picList){
//获取盘符并转换映射地址的头部地址
String root = selectRootByNotWater(picPathList.getPicUrl());
@ -104,6 +106,10 @@ public class T_Scan_AssortServiceImpl implements T_Scan_AssortService{
String picPath = picPathList.getPicUrl().substring(str1.length() + 1, picPathList.getPicUrl().length());
String fileUrl = NEW_EMR_RECORD_JSP+ File.separator + root + picPath;
picPathList.setPicUrl(fileUrl);
//生成文件id
String fileId = scanAssortList.getPatientId() + picPathList.getScanPage();
String s = DigestUtils.md5DigestAsHex(fileId.getBytes());
picPathList.setFileId(s);
}
}
return list;
@ -122,6 +128,10 @@ public class T_Scan_AssortServiceImpl implements T_Scan_AssortService{
String picPath = picPathList.getPicUrl().substring(str1.length() + 1, picPathList.getPicUrl().length());
String fileUrl = NEW_EMR_RECORD_JSP+ File.separator + root + picPath;
picPathList.setPicUrl(fileUrl);
//生成文件id
String fileId = scanAssortList.getPatientId() + picPathList.getScanPage();
String s = DigestUtils.md5DigestAsHex(fileId.getBytes());
picPathList.setFileId(s);
}
}
return list;

@ -23,5 +23,9 @@ public class PicListVo {
//分段名称
private String assortName;
//文件名
private String scanPage;
//文件id
private String fileId;
}

@ -14,7 +14,8 @@ import java.util.List;
@Data
public class ZhFyImageVo {
//病案id
private String patientId;
//住院号
private String inpatientNo;
//住院次数
@ -26,4 +27,5 @@ public class ZhFyImageVo {
private List<PicListVo> picList;
}

@ -6,7 +6,7 @@ POWER_JSPHEAD = localhost
POWER_JSP = http://localhost:8081/power
#\u672C\u8EAB\u7CFB\u7EDF\u7684\u670D\u52A1\u5668\u5730\u5740\u5934
EMR_RECORD_JSP = http://localhost:8083/emr_record
EMR_RECORD_JSP = http://localhost:8081/emr_record
#webSocket\u670D\u52A1\u5668\u5730\u5740
@ -53,4 +53,4 @@ fullTextSearchMethod = SearchFulltext
fullTextDays = 90
NEW_EMR_RECORD_JSP : http://192.168.16.122:8083/emr_record
NEW_EMR_RECORD_JSP : http://localhost:8081/emr_record

@ -41,16 +41,16 @@
<if test="item.effectiveTime != null and item.effectiveTime != ''" >
effective_time = #{item.effectiveTime},
</if>
<if test="item.handlingName != null" >
<if test="item.handlingName != null and item.handlingName != ''" >
handling_name = #{item.handlingName},
</if>
<if test="item.examineName != null" >
<if test="item.examineName != null and item.examineName != ''" >
examine_name = #{item.examineName},
</if>
<if test="item.examineTime != null" >
<if test="item.examineTime != null and item.examineTime != ''" >
examine_time = #{item.examineTime},
</if>
<if test="item.applyStatc != null" >
<if test="item.applyStatc != null and item.applyStatc != ''" >
apply_statc = #{item.applyStatc},
</if>
</set>
@ -59,7 +59,6 @@
</update>
<delete id="deleteByBatchId">
delete from batch_apply_details where batch_id=#{batchId}
</delete>

@ -56,6 +56,12 @@
<update id="updateBorrowingNum">
update batch_apply set borrowing_num=#{borrowingNum} where id=#{batchId}
</update>
<update id="updateReadNumm">
update batch_apply set read_num=#{readNum} where id=#{batchId}
</update>
<update id="updateStatc">
update batch_apply set statc=#{statc} where id=#{batchId}
</update>
<delete id="deleteById">
DELETE FROM batch_apply WHERE id =#{id}
</delete>
@ -110,5 +116,8 @@
#{item}
</foreach>
</select>
<select id="getreadNum" resultType="com.emr.vo.BatchApplyVo">
select borrowing_num,read_num from batch_apply where id=#{batchId}
</select>
</mapper>

@ -28,6 +28,7 @@
<resultMap id="ZhFyImagetMap" type="com.emr.vo.ZhFyImageVo" >
<result column="inpatient_No" property="inpatientNo" jdbcType="VARCHAR" />
<result column="admiss_times" property="admissTimes" jdbcType="VARCHAR" />
<result column="patient_id" property="patientId" jdbcType="VARCHAR" />
<result column="dis_date" property="disDate" jdbcType="VARCHAR" />
<collection property="picList" resultMap="PicListMap"/>
</resultMap>
@ -36,7 +37,7 @@
<result column="picUrl" property="picUrl"/>
<result column="assort_id" property="assortId"/>
<result column="assort_name" property="assortName"/>
<result column="scan_page" property="scanPage"/>
</resultMap>
<insert id="insert" parameterType="com.emr.entity.tScanAssort.T_Scan_Assort" >
insert into t_scan_assort (patient_id, assort_id, scan_page
@ -217,7 +218,7 @@
</select>
<select id="getPathListByInpatientNo" resultMap="ZhFyImagetMap">
SELECT
rtrim(c.inpatient_no) AS inpatient_no,c.admiss_times,c.dis_date,c.file_path+'\'+t.scan_page as picUrl,t.assort_id,z.assort_name
rtrim(c.inpatient_no) AS inpatient_no,c.admiss_times,c.dis_date,c.file_path+'\'+t.scan_page as picUrl,t.assort_id,z.assort_name,t.scan_page,c.patient_id
FROM
commomtable c
LEFT JOIN t_scan_assort t on c.patient_id=t.patient_id
@ -229,7 +230,7 @@
</select>
<select id="getPathListByDisDate" resultMap="ZhFyImagetMap">
SELECT
rtrim(c.inpatient_no) AS inpatient_no,c.admiss_times,c.dis_date,c.file_path+'\'+t.scan_page as picUrl,t.assort_id,z.assort_name
rtrim(c.inpatient_no) AS inpatient_no,c.admiss_times,c.dis_date,c.file_path+'\'+t.scan_page as picUrl,t.assort_id,z.assort_name,t.scan_page,c.patient_id
FROM
commomtable c
LEFT JOIN t_scan_assort t on c.patient_id=t.patient_id

@ -86,11 +86,11 @@
<div class="col-sm-2">
<button type="button" class="btn btn-sm btn-primary" onclick="onloadPdfMethod()">加载PDF</button>
</div>
<c:if test="${CURRENT_USER.userEmail == '1' || isDownload == '1'}">
<shiro:hasPermission name="/commom/downloadPdf">
<div class="col-sm-2">
<button type="button" class="btn btn-sm btn-primary" onclick="onloadJpgForPdf()">下载PDF</button>
</div>
</c:if>
</shiro:hasPermission>
<%-- <c:if test="${CURRENT_USER.userEmail == '1' || isDownload == '1'}">--%>
<%-- <div class="col-sm-2">--%>
<%-- <button type="button" class="btn btn-sm btn-primary" onclick="printCurrent()">打印当前页</button>--%>

@ -48,11 +48,11 @@ $('#mytab').bootstrapTable({
field: 'statc',
formatter: function (value, row, index) {
var spanValue;
if (value == 1) {
if (value == 2) {
spanValue = '<p style="color:green">已审批</p>';
} else if (value == 0) {
spanValue = '<p style="color:red">未审批</p>';
} else if (value == 2) {
} else if (value == 3) {
spanValue = '<p style="color:orange">审批中</p>';
}
return spanValue;

@ -365,6 +365,10 @@ function borrowingTab() {
return pageSize * (pageNumber - 1) + index + 1;
}
},
{
title: '申请人工号',
field: 'applyName',
},
{
title: '申请日期',
field: 'applyTime',
@ -562,7 +566,7 @@ function deleteById(id) {
//借阅审批
function approveById(id,effectiveDay) {
console.log(id,effectiveDay)
var batchId = getUrlParam('batchId');
Common.confirm({
title: "提示",
message: "请确认是否通过此申请?",
@ -571,7 +575,7 @@ function approveById(id,effectiveDay) {
$.ajax({
type: 'post',
url: path + '/applyDetails/agreeById/',
data: {ids: id,effectiveDay:effectiveDay},
data: {ids: id,effectiveDay:effectiveDay,batchId:batchId},
dataType: 'json',
success: function (data) {
console
@ -700,8 +704,9 @@ function refreshBorrowingTab() {
//保存批量申请
//保存批量审批
function addApprove() {
var batchId = getUrlParam('batchId');
var ids = borrowingIds.join();
if (borrowingIds.length == 0) {
return toastr.warning("至少选择一条以上");
@ -711,17 +716,19 @@ function addApprove() {
url: path + '/applyDetails/agreeById',
data: {
ids: ids,
batchId:batchId
},
dataType: 'json',
success: function (data) {
if (data.code == 200) {
if (data== 0) {
borrowingIds = []
return toastr.warning("批量借阅申请失败!");
}
if (data.code == 100) {
if (data == 1) {
borrowingIds = []
toastr.success("批量借阅申请成功!");
// $('#borrowingModal').modal('hide');
// //刷新申请借阅列表
// reLoadBorrowingTab();
$('#approveModal').modal('hide');
reLoadBorrowingTab();
}
}
})

Loading…
Cancel
Save