解决超期提前提醒查询统计数据bug

master
zengwh 5 years ago
parent b972eeb771
commit 729eede60e

@ -7,7 +7,10 @@
package com.emr.controller;
import com.emr.dao.ArchiveFlowRoleMapper;
import com.emr.entity.*;
import com.emr.entity.ArchiveFlowRole;
import com.emr.entity.Archive_Master;
import com.emr.entity.Archive_Master_Vo;
import com.emr.entity.OffsetLimitPage;
import com.emr.service.Archive_MasterService;
import com.emr.service.ipml.ArchiveFlowInfoService;
import com.emr.util.ExceptionPrintUtil;

@ -70,6 +70,7 @@ public class Task1 {
recordSearch.setSurplus(emrOvertimeSet.getSurplusDays());
//查询超期记录
List<SubmitRecord> list = recordMapper.selectUnCountGroupDept(recordSearch);
log.info(list);
if(!CollectionUtils.isEmpty(list)){
//定义添加记录集合
List<ArchiveRemindDeptUserInfo> remindList = new ArrayList<>();
@ -79,6 +80,8 @@ public class Task1 {
List<ArchiveRemindcancleDept> cancleDeptList = remindcancleDeptMapper.selectAll();
//查询科室取消单独开启的用户
List<ArchiveRemindDeptUser> deptUsers = remindDeptUserMapper.selectAll();
//定义病案室待审核数量
int unRecordRoomCount = 0;
for(SubmitRecord vo : list){
//获取科室编号
String deptCode = vo.getDeptName();
@ -101,7 +104,11 @@ public class Task1 {
selectRemindOtherRoleInfo(remindList, vo, userList);
}
}
//统计病案室待审核数量
unRecordRoomCount += vo.getUnRecordRoomCount();
}
//添加提醒病案室用户信息
selectRemindRecordRoomInfo(remindList, userListTemp, cancleDeptList, deptUsers, unRecordRoomCount);
log.info(remindList);
//处理添加数据业务
insertData(list, remindList);
@ -170,7 +177,7 @@ public class Task1 {
}
/**
*
*
* @param remindList list
* @param vo
* @param userList
@ -187,8 +194,6 @@ public class Task1 {
remindList.addAll(remindDoctorCheck(vo, userList, 8, "unNurseCheckCount"));
//通知护士长
remindList.addAll(remindDoctorCheck(vo, userList, 7, "unHeadNurseCount"));
//通知病案室
remindList.addAll(remindDoctorCheck(vo, userList, 3, "unRecordRoomCount"));
}
/**
@ -215,7 +220,42 @@ public class Task1 {
}
/**
*
*
* @param remindList
* @param userListTemp
* @param cancleDeptList
* @param deptUsers
* @param unRecordRoomCount
* @throws Exception
*/
private void selectRemindRecordRoomInfo(List<ArchiveRemindDeptUserInfo> remindList, List<User> userListTemp, List<ArchiveRemindcancleDept> cancleDeptList, List<ArchiveRemindDeptUser> deptUsers, int unRecordRoomCount) throws Exception {
if(unRecordRoomCount > 0){
//定义需要通知的集合
List<User> recordRoomList = new ArrayList<>();
//添加病案室提醒通知 deptCode = 507
String recordRoomDeptCode = "507";
//根据科室取消提醒集合判断是否需要提醒
boolean recordRoomRemindFlag = judgeRemindFlag(recordRoomDeptCode, cancleDeptList);
if(!recordRoomRemindFlag){
//通知取消通知的该科室下需要通知的用户
recordRoomList = selectUserListByDeptUsers(userListTemp,deptUsers,recordRoomDeptCode);
}else{
//通知该科室所有用户
recordRoomList = userListTemp;
}
if(!CollectionUtils.isEmpty(recordRoomList)){
SubmitRecord recordRoomVo = new SubmitRecord();
recordRoomVo.setUnRecordRoomCount(unRecordRoomCount);
recordRoomVo.setDeptName(recordRoomDeptCode);
recordRoomVo.setDeptNameCn("病案室");
//通知病案室
remindList.addAll(remindDoctorCheck(recordRoomVo, recordRoomList, 3, "unRecordRoomCount"));
}
}
}
/**
*
* @param vo
* @param userList
* @return
@ -227,8 +267,15 @@ public class Task1 {
field.setAccessible(true);
Integer unCheckCount = (Integer) field.get(vo);
if(unCheckCount > 0){
List<User> roleUserList = new ArrayList<>();
//获取该角色的用户集合
List<User> roleUserList = selectUserByDeptCodeAndRoleId(vo.getDeptName(), roleId, userList);
if(roleId != 3) {
//非病案室人员
roleUserList = selectUserByDeptCodeAndRoleId(vo.getDeptName(), roleId, userList);
}else{
//病案室人员
roleUserList = selectUserByDeptCodeAndRoleId("507",roleId, userList);
}
if(!CollectionUtils.isEmpty(roleUserList)){
for(User user : roleUserList) {
//根据用户名获取用户
@ -253,6 +300,7 @@ public class Task1 {
if(vo.getUnDoctorSubmitCount() > 0){
String deptCode = vo.getDeptName();
recordSearch.setDeptName(deptCode);
recordSearch.setInfoId(2);
//查询超期记录
List<Archive_Master_Vo> masterVoList = recordMapper.selectRecordGroupDeptAndRole(recordSearch);
if(!CollectionUtils.isEmpty(masterVoList)){
@ -295,7 +343,7 @@ public class Task1 {
//设置用户名
obj.setUserName(currentUser.getUserName());
String name = "";
if(null != currentUser){
if(null != currentUser.getUserName()){
name = currentUser.getName();
obj.setRoleId(currentUser.getRoleId());
obj.setRoleName(currentUser.getRoleName());
@ -406,6 +454,7 @@ public class Task1 {
return list;
}
/**
*
* @param deptCode

@ -117,9 +117,9 @@ public class EmrOvertimeSetService {
"{'roleId':5,roleName:'医生质控员'}," +
"{'roleId':6,roleName:'科主任'}," +
"{'roleId':2,roleName:'护士'}," +
"{'roleId':3,roleName:'护士质控员'}," +
"{'roleId':8,roleName:'护士质控员'}," +
"{'roleId':7,roleName:'护士长'}," +
"{'roleId':8,roleName:'病案室人员'}" +
"{'roleId':3,roleName:'病案室人员'}" +
"]";
List<User> roleList = JSON.parseArray(roleListJson, User.class);
//设定用户id从20000开始

@ -427,11 +427,17 @@
archive_master.DOCTOR_IN_CHARGE,
archive_master.visit_id,
archive_master.discharge_date_time,
v_overtime_record.overtime_days,
<!--非提醒功能查过期天数-->
<if test="surplus == null">
v_overtime_record.overtime_days,
</if>
archive_masterTemp.overTimeCounts
from archive_master
inner join v_overtime_record
on archive_master.id = v_overtime_record.id
<!--非提醒功能查过期天数-->
<if test="surplus == null">
inner join v_overtime_record
on archive_master.id = v_overtime_record.id
</if>
inner join (select DOCTOR_IN_CHARGE,COUNT(DOCTOR_IN_CHARGE) overTimeCounts from archive_master
<where>
<include refid="selectByDate"></include>

Loading…
Cancel
Save