diff --git a/doc/gm_record.bak b/doc/gm_record.bak index 7751b5e..060f6af 100644 Binary files a/doc/gm_record.bak and b/doc/gm_record.bak differ diff --git a/src/main/java/com/emr/controller/ArchiveOtherExtController.java b/src/main/java/com/emr/controller/ArchiveOtherExtController.java index e313f07..e26c542 100644 --- a/src/main/java/com/emr/controller/ArchiveOtherExtController.java +++ b/src/main/java/com/emr/controller/ArchiveOtherExtController.java @@ -1,7 +1,6 @@ package com.emr.controller; import com.emr.entity.ArchiveOther; -import com.emr.entity.ArchiveOtherExtSubmittime; import com.emr.entity.OffsetLimitPage; import com.emr.service.ipml.ArchiveOtherExtService; import com.emr.service.ipml.ArchiveOtherService; @@ -64,13 +63,18 @@ public class ArchiveOtherExtController { /** * 同步更新 - * @param ids + * @param ids 全部选中的ext_id + * @param notNursingIds 不包含护理ext_id的ext_id + * @param detailIds detail表的id集合 + * @param jzh 记账号 + * @param masterId master表的id + * @param sysFlag ext表的权限标识 * @return * @throws Exception */ @RequestMapping("submitUpdate") @ResponseBody - public Msg submitUpdate(String ids,String notNursingIds,String jzh,String masterId,Integer sysFlag) throws Exception{ + public Msg submitUpdate(String ids,String notNursingIds,String detailIds,String jzh,String masterId,Integer sysFlag) throws Exception{ if(StringUtils.isBlank(ids)){ return Msg.fail("至少选中一个!"); } @@ -82,7 +86,7 @@ public class ArchiveOtherExtController { return Msg.fail("masterId不能为空!"); } } - archiveOtherExtService.updateSubmit(ids,notNursingIds,jzh,masterId,sysFlag); + archiveOtherExtService.updateSubmit(ids,notNursingIds,detailIds,jzh,masterId,sysFlag); return Msg.success(); } diff --git a/src/main/java/com/emr/controller/SendMessageController.java b/src/main/java/com/emr/controller/SendMessageController.java new file mode 100644 index 0000000..80ce46c --- /dev/null +++ b/src/main/java/com/emr/controller/SendMessageController.java @@ -0,0 +1,42 @@ +package com.emr.controller; + +import com.emr.entity.Power_User; +import com.emr.service.ipml.SendMessageService; +import com.emr.util.Msg; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.servlet.http.HttpServletRequest; +import java.util.Arrays; + +/** + * @ProjectName: + * @Description: + * @Param 传输参数 + * @Return + * @Author: 曾文和 + * @CreateDate: 2020/11/10 14:19 + * @UpdateUser: 曾文和 + * @UpdateDate: 2020/11/10 14:19 + * @UpdateRemark: 更新说明 + * @Version: 1.0 + */ +@Controller +@RequestMapping("sendMessage") +public class SendMessageController { + @Autowired + private SendMessageService sendMessageService; + /** + * 发送即将超期的病历份数 + * @return + */ + @RequestMapping(value="sendMessageForSubmit") + @ResponseBody + public Msg sendMessageForSubmit(HttpServletRequest request) throws Exception{ + sendMessageService.sendMessageForSubmit(request); + return Msg.success(); + } +} + diff --git a/src/main/java/com/emr/controller/beHospitaledController.java b/src/main/java/com/emr/controller/beHospitaledController.java index 4c5a51a..1f54d6d 100644 --- a/src/main/java/com/emr/controller/beHospitaledController.java +++ b/src/main/java/com/emr/controller/beHospitaledController.java @@ -13,6 +13,7 @@ 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.service.ipml.EmrOvertimeSetService; import com.emr.util.ExceptionPrintUtil; import com.emr.util.ExportExcelUtil; import com.emr.util.Msg; @@ -37,6 +38,8 @@ import java.util.List; @Controller @RequestMapping("/beHosp") public class beHospitaledController { + @Value("${overDateSet}") + private String overDateSet; @Autowired private Archive_MasterService archiveMasterService; @Value("${HomepageDictionary}") @@ -47,8 +50,19 @@ public class beHospitaledController { private ArchiveFlowRoleMapper flowRoleMapper; @Autowired private ArchiveFlowInfoService flowInfoService; + @Autowired + private EmrOvertimeSetService emrOvertimeSetService; @RequestMapping(value = "/beHosps") - public String inHospitals(){ + public String inHospitals(Integer flag,Model model){ + if(null != flag){ + model.addAttribute("flag",flag); + model.addAttribute("overDateSet",overDateSet); + //获取超期提醒日期 + String remindDate = emrOvertimeSetService.getRemindDate(); + if(StringUtils.isNotBlank(remindDate)){ + model.addAttribute("remindDate",remindDate); + } + } return "beHospitaledDir/beHospList"; } diff --git a/src/main/java/com/emr/controller/lastVerifyController.java b/src/main/java/com/emr/controller/lastVerifyController.java index 1c16e3e..4ff71f6 100644 --- a/src/main/java/com/emr/controller/lastVerifyController.java +++ b/src/main/java/com/emr/controller/lastVerifyController.java @@ -11,11 +11,15 @@ import com.emr.service.Archive_MasterService; import com.emr.service.Emr_Fault_DetailService; import com.emr.service.Emr_Fault_TypeService; import com.emr.service.ipml.Archive_DetailServiceImpl; +import com.emr.service.ipml.EmrOvertimeSetService; import com.emr.util.ExceptionPrintUtil; import com.emr.util.ExportExcelUtil; import com.emr.util.Msg; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -27,6 +31,8 @@ import java.util.List; @Controller @RequestMapping("lastVerify") public class lastVerifyController { + @Value("${overDateSet}") + private String overDateSet; @Autowired private Archive_MasterService archiveMasterService; @@ -39,8 +45,20 @@ public class lastVerifyController { @Autowired private Archive_DetailServiceImpl archiveDetailService; + @Autowired + private EmrOvertimeSetService emrOvertimeSetService; + @RequestMapping(value = "/lastVerifys") - public String faults(){ + public String faults(Integer flag, Model model){ + if(null != flag){ + model.addAttribute("flag",flag); + model.addAttribute("overDateSet",overDateSet); + //获取超期提醒日期 + String remindDate = emrOvertimeSetService.getRemindDate(); + if(StringUtils.isNotBlank(remindDate)){ + model.addAttribute("remindDate",remindDate); + } + } return "lastVerifyDir/lastVerifyList"; } diff --git a/src/main/java/com/emr/dao/ArchiveOtherExtSubmittimeMapper.java b/src/main/java/com/emr/dao/ArchiveOtherExtSubmittimeMapper.java index 1692bae..ef2de37 100644 --- a/src/main/java/com/emr/dao/ArchiveOtherExtSubmittimeMapper.java +++ b/src/main/java/com/emr/dao/ArchiveOtherExtSubmittimeMapper.java @@ -20,7 +20,7 @@ public interface ArchiveOtherExtSubmittimeMapper { List selectAllByExtId(@Param("ids")String ids); - int createInfo(@Param("ids") String ids); + int createInfo(@Param("list") List list); - int updateInfo(@Param("ids") String ids); + int updateInfo(@Param("list") List list); } \ No newline at end of file diff --git a/src/main/java/com/emr/dao/EmrHolidaySetMapper.java b/src/main/java/com/emr/dao/EmrHolidaySetMapper.java index 506fb5b..ad8e18b 100644 --- a/src/main/java/com/emr/dao/EmrHolidaySetMapper.java +++ b/src/main/java/com/emr/dao/EmrHolidaySetMapper.java @@ -31,4 +31,8 @@ public interface EmrHolidaySetMapper { int selectColByTableName(@Param("tableName")String tableName); int selectHolidayByDate(@Param("startDate") Date startDate); + + List selectWorkDayByDate(@Param("startDate")String startDate, + @Param("endDate")String endDate, + @Param("order")String order); } \ No newline at end of file diff --git a/src/main/java/com/emr/dao/RecordMapper.java b/src/main/java/com/emr/dao/RecordMapper.java index fd3610c..77c0e4e 100644 --- a/src/main/java/com/emr/dao/RecordMapper.java +++ b/src/main/java/com/emr/dao/RecordMapper.java @@ -20,4 +20,6 @@ public interface RecordMapper { List selectCountWithDate(RecordSearch recordSearch); List selectRecordGroupDeptAndRole(RecordSearch recordSearch); + + int selectCountOverTimeByRoleId(RecordSearch recordSearch); } diff --git a/src/main/java/com/emr/quart/Task1.java b/src/main/java/com/emr/quart/Task1.java index d6c5383..9e4093c 100644 --- a/src/main/java/com/emr/quart/Task1.java +++ b/src/main/java/com/emr/quart/Task1.java @@ -7,6 +7,7 @@ import com.emr.dao.RecordMapper; import com.emr.entity.*; import com.emr.service.ipml.CommomService; import com.emr.service.ipml.EmrOvertimeSetService; +import com.emr.service.ipml.SendMessageService; import com.emr.service.ipml.StatisticsService; import com.emr.util.ExceptionPrintUtil; import com.emr.util.IDHelper; @@ -17,6 +18,7 @@ import com.emr.vo.User; import org.apache.commons.lang3.StringUtils; import org.apache.log4j.Logger; import org.apache.shiro.util.CollectionUtils; +import org.aspectj.weaver.ast.Var; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @@ -39,8 +41,6 @@ import java.util.*; @Component public class Task1 { private static Logger log = Logger.getLogger("myMsg"); - @Value("${overDateSet}") - private String overDateSet; @Autowired private RecordMapper recordMapper; @Autowired @@ -50,23 +50,16 @@ public class Task1 { @Autowired private StatisticsService statisticsService; @Autowired - private EmrOvertimeSetService overtimeSetService; - @Autowired private CommomService commomService; @Autowired private ArchiveRemindDeptUserInfoMapper remindDeptUserInfoMapper; + @Autowired + private SendMessageService sendMessageService; //@Scheduled(cron="#{@getCronValue}") public void task1(){ try { long start = System.currentTimeMillis(); - RecordSearch recordSearch = new RecordSearch(); - //设置查询超期标识 - recordSearch.setFlag(2); - //设置起始时间 - recordSearch.setStartDate(overDateSet); - //设置提前提醒天数 - EmrOvertimeSet emrOvertimeSet = overtimeSetService.selectByPrimaryKey(1); - recordSearch.setSurplus(emrOvertimeSet.getSurplusDays()); + RecordSearch recordSearch = sendMessageService.selectRecordSearch(); //查询超期记录 List list = recordMapper.selectUnCountGroupDept(recordSearch); log.info(list); @@ -74,7 +67,7 @@ public class Task1 { //定义添加记录集合 List remindList = new ArrayList<>(); //获取用户集合 - List userListTemp = statisticsService.getUserList("admin"); + List userListTemp = commomService.getUserList("admin"); //查询科室取消提醒集合 List cancleDeptList = remindcancleDeptMapper.selectAll(); //查询科室取消单独开启的用户 @@ -355,46 +348,11 @@ public class Task1 { } //设置姓名 obj.setName(name); - //定义审核角色 - String roleBranchName = ""; - //定义待审核状态 - String roleStatus = ""; - switch (obj.getRoleId()){ - case 1: - roleBranchName = "医生"; - roleStatus = "医生待审核"; - break; - case 5: - roleBranchName = "医生"; - roleStatus = "质控员待审核"; - break; - case 6: - roleBranchName = "主任"; - roleStatus = "科主任待审核"; - break; - case 2: - roleBranchName = "护士"; - roleStatus = "护士待审核"; - break; - case 8: - roleBranchName = "护士"; - roleStatus = "质控员待审核"; - break; - case 7: - roleBranchName = "护士长"; - roleStatus = "护士长待审核"; - break; - case 3: - roleBranchName = "病案室人员"; - roleStatus = "病案室人员待审核"; - break; - default: - roleBranchName = "无效角色"; - roleStatus = "无效角色待审核"; - } - obj.setStr1(roleStatus); + //根据角色Id获取角色名称和角色称呼 list.get(0) = 角色名称 list.get(1) = 角色称呼 + List roleList = sendMessageService.selectInfoIdAndRoleName(obj.getRoleId()); + obj.setStr1(roleList.get(1)); //设置发送内容 ***医生,你有多少份病历是质控员待审核状态,请及时查阅 - String sendContext = name + roleBranchName + ",您有"+count+"份病历是"+roleStatus+"状态,请及时查阅"; + String sendContext = sendMessageService.selectContentByRole(name,count,roleList); obj.setSendContext(sendContext); return obj; } diff --git a/src/main/java/com/emr/service/ArchiveTransferDeptUserService.java b/src/main/java/com/emr/service/ArchiveTransferDeptUserService.java index 07da9b6..c042f5f 100644 --- a/src/main/java/com/emr/service/ArchiveTransferDeptUserService.java +++ b/src/main/java/com/emr/service/ArchiveTransferDeptUserService.java @@ -38,8 +38,6 @@ public class ArchiveTransferDeptUserService { @Autowired private Emr_DictionaryService dictionaryService; @Autowired - private StatisticsService statisticsService; - @Autowired private ArchiveTransferDeptUserMapper transferDeptUserMapper; @Autowired private CommomService commomService; @@ -49,7 +47,7 @@ public class ArchiveTransferDeptUserService { List list = new ArrayList<>(); if(!CollectionUtils.isEmpty(dictionaries)){ //查询用户信息 - List userList = statisticsService.getUserList(); + List userList = commomService.getUserList(); if(!CollectionUtils.isEmpty(userList)){ //查询有选中的用户 List transferDeptUsers = transferDeptUserMapper.selectAllByMasterId(masterId); diff --git a/src/main/java/com/emr/service/ipml/ArchiveCallbackInfoService.java b/src/main/java/com/emr/service/ipml/ArchiveCallbackInfoService.java index 84a5107..4fe20ac 100644 --- a/src/main/java/com/emr/service/ipml/ArchiveCallbackInfoService.java +++ b/src/main/java/com/emr/service/ipml/ArchiveCallbackInfoService.java @@ -49,7 +49,7 @@ public class ArchiveCallbackInfoService { @Autowired private ArchiveFlowInfoService archiveFlowInfoService; @Autowired - private StatisticsService statisticsService; + private CommomService commomService; @Autowired private ArchiveFlowRoleMapper flowRoleMapper; /** @@ -129,7 +129,7 @@ public class ArchiveCallbackInfoService { if (!CollectionUtils.isEmpty(list)) { //转换状态 //计算属于哪种审核角色 - List userList = statisticsService.getUserList(); + List userList = commomService.getUserList(); for (ArchiveCallbackInfoVo callbackInfoVo1 : list) { String archivestate = callbackInfoVo1.getArchivestate(); if (StringUtils.isNotBlank(archivestate)) { diff --git a/src/main/java/com/emr/service/ipml/ArchiveFlowInfoService.java b/src/main/java/com/emr/service/ipml/ArchiveFlowInfoService.java index 0c1cfe4..da6aff0 100644 --- a/src/main/java/com/emr/service/ipml/ArchiveFlowInfoService.java +++ b/src/main/java/com/emr/service/ipml/ArchiveFlowInfoService.java @@ -42,7 +42,7 @@ public class ArchiveFlowInfoService { @Autowired private Archive_MasterMapper archiveMasterMapper; @Autowired - private StatisticsService statisticsService; + private CommomService commomService; @Autowired private Emr_Fault_TypeService faultTypeService; @Autowired @@ -268,7 +268,7 @@ public class ArchiveFlowInfoService { Emr_Fault_Type obj = new Emr_Fault_Type(); obj.setEffective(1); List typeList = faultTypeService.selectByCol(obj); - List userList = statisticsService.getUserList(); + List userList = commomService.getUserList(); //替换姓名 if (!CollectionUtils.isEmpty(userList)) { for (ArchiveFlowInfoVo infoVo : list) { @@ -314,7 +314,7 @@ public class ArchiveFlowInfoService { String checkName = flowInfoVo.getUserName(); if(StringUtils.isNoneBlank(checkName)){ //转换姓名 - List userList = statisticsService.getUserList(); + List userList = commomService.getUserList(); StringBuilder checkNames = new StringBuilder(); for(User user:userList){ if(StringUtils.isNoneBlank(user.getName()) && user.getName().contains(checkName)){ @@ -331,7 +331,7 @@ public class ArchiveFlowInfoService { List list = flowInfoMapper.selectFlowInfoList(flowInfoVo,sql); //替换姓名 if(!CollectionUtils.isEmpty(list)) { - List userList = statisticsService.getUserList(); + List userList = commomService.getUserList(); if (!CollectionUtils.isEmpty(userList)) { for (ArchiveFlowInfoVo infoVo : list) { //转换姓名 diff --git a/src/main/java/com/emr/service/ipml/ArchiveOtherExtService.java b/src/main/java/com/emr/service/ipml/ArchiveOtherExtService.java index 2bc1bbd..dcf844b 100644 --- a/src/main/java/com/emr/service/ipml/ArchiveOtherExtService.java +++ b/src/main/java/com/emr/service/ipml/ArchiveOtherExtService.java @@ -17,7 +17,9 @@ import org.springframework.transaction.annotation.Transactional; import javax.servlet.http.HttpServletRequest; import java.io.*; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Date; import java.util.LinkedList; import java.util.List; @@ -118,7 +120,7 @@ public class ArchiveOtherExtService { * @param masterId * @param sysFlag */ - public void updateSubmit(String ids,String notNursingIds, String jzh, String masterId, Integer sysFlag) throws Exception{ + public void updateSubmit(String ids,String notNursingIds, String detailIds,String jzh, String masterId, Integer sysFlag) throws Exception{ String idsStr = splitString2String(ids); String idsTemp = idsStr; //存在护理记录则调用护理按需采集功能 @@ -133,10 +135,9 @@ public class ArchiveOtherExtService { //ext表更新非护理记录 if(StringUtils.isNotBlank(notNursingIds)){ updateCommomSubmit(idsTemp); - //archiveOtherExtMapper.updateSubmit(idsTemp); } //操作提交信息表 - operOtherExtSubmitInfo(ids, idsStr); + operOtherExtSubmitInfo(ids,idsStr,detailIds); } /** @@ -235,18 +236,32 @@ public class ArchiveOtherExtService { /** * 操作提交信息表 - * @param ids - * @param idsStr + * @param ids 不带单引号的ext_id + * @param idsStr 带单引号的ext_id */ - private void operOtherExtSubmitInfo(String ids, String idsStr) { + private void operOtherExtSubmitInfo(String ids,String idsStr,String detailIds) { //查询ext_id在ext_info表中是否存在 List infoList = archiveOtherExtSubmittimeMapper.selectAllByExtId(idsStr); - //定义需要新增的id集合 - StringBuilder createStr = new StringBuilder(); - //定义需要更新的id集合 - StringBuilder updateStr = new StringBuilder(); + //定义需要新增的集合 + List createList = new ArrayList<>(); + //定义需要更新的集合 + List updateList = new ArrayList<>(); + //获取id集合 String[] idArr = ids.split(","); - for(String id : idArr){ + //获取detailId集合 + String[] detailIdArr = detailIds.split(","); + //获取当前时间 + Date date = new Date(); + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + for(int i = 0;i < idArr.length;i++){ + //定义需求操作的对象 + String id = idArr[i]; + ArchiveOtherExtSubmittime objTemp = new ArchiveOtherExtSubmittime(); + objTemp.setCreateTime(fmt.format(date)); + objTemp.setOtherExtId(id); + if(StringUtils.isNoneBlank(detailIdArr[i]) && !"null".equals(detailIdArr[i])) { + objTemp.setStr1(detailIdArr[i]); + } if(StringUtils.isNotBlank(id)) { //定义是否存在 boolean flag = false; @@ -255,6 +270,8 @@ public class ArchiveOtherExtService { for(ArchiveOtherExtSubmittime obj : infoList){ String otherExtId = obj.getOtherExtId(); if(id.equals(otherExtId)){ + //存在赋值id + objTemp.setId(obj.getId()); flag = true; break; } @@ -262,25 +279,19 @@ public class ArchiveOtherExtService { } //存在添加进updateStr,不存在添加进createStr if(flag){ - if (StringUtils.isNotBlank(updateStr)) { - updateStr.append(","); - } - updateStr.append("'").append(id).append("'"); + updateList.add(objTemp); }else{ - if (StringUtils.isNotBlank(createStr)) { - createStr.append(","); - } - createStr.append(id); + createList.add(objTemp); } } } //存在则批量更新 - if(StringUtils.isNotBlank(updateStr)){ - archiveOtherExtSubmittimeMapper.updateInfo(updateStr.toString()); + if(!CollectionUtils.isEmpty(updateList)){ + archiveOtherExtSubmittimeMapper.updateInfo(updateList); } - //不存在则批量新增 - if(StringUtils.isNotBlank(createStr)){ - archiveOtherExtSubmittimeMapper.createInfo(createStr.toString()); + //存在则批量新增 + if(!CollectionUtils.isEmpty(createList)){ + archiveOtherExtSubmittimeMapper.createInfo(createList); } } } diff --git a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java index d8c9176..515e803 100644 --- a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java @@ -131,7 +131,7 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { } } //如果成功匹配个数和需校验分类个数相等,全部匹配 - //特殊情况验证完整性,婴儿带B的住院号少验证三类:病案首页、入(出、死亡)院记录 + //特殊情况验证完整性,婴儿带B的住院号少验证两类:病案首页、入(出、死亡)院记录 int verificationCount = 0; String inpNo = master.getInpNo(); if(StringUtils.isNotBlank(inpNo)){ @@ -215,7 +215,7 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { List dictionaries = dictionaryMapper.dicByTypeCode(dictionary); for (Archive_Master_Vo masterVo : list) { //科室名称编码转名称 - DeptNameCode2Name(dictionaries, masterVo); + deptNameCode2Name(dictionaries, masterVo); //状态均为护士长已质控,取出一个对象,转换中文状态 Integer status = Integer.valueOf(masterVo.getArchivestate()); if(status.equals(EnumVerify.DocState.HeadNurseCheck.getCode())){ @@ -310,10 +310,11 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { @Override public List selectByColumn(Archive_Master_Vo archiveMasterVo,HttpServletRequest request) { - setMaxRoleId(archiveMasterVo); + //设置查询条件审核角色 + setInfoId(archiveMasterVo); //设置登录用户 Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); - if(user.getRoleId() == 1 && user.getRoleId() != -100){ + if(user.getRoleId() != 1 && user.getRoleId() != -100 && user.getRoleId() != 0){ archiveMasterVo.setUserName(user.getUserName()); } List list = archiveMasterMapper.selectByColumn(archiveMasterVo); @@ -346,6 +347,36 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { return list; } + /** + * 设置审核角色 + * @param archiveMasterVo + */ + private void setInfoId(Archive_Master_Vo archiveMasterVo) { + String status = archiveMasterVo.getStatus(); + //取最大值 + String archivestate = archiveMasterVo.getArchivestate(); + if(StringUtils.isNotBlank(status) && StringUtils.isNotBlank(archivestate)){ + if ("1".equals(archivestate)){ + //已审核,取最大 + Integer maxStatus = 0; + String[] statusArr = status.split(","); + for (String statu : statusArr) { + if (StringUtils.isNotBlank(statu)) { + Integer integer = Integer.valueOf(statu); + if (maxStatus < integer) { + //重新赋值 + maxStatus = integer; + } + } + } + archiveMasterVo.setStatus(maxStatus+""); + }else{ + //待审核,取带逗号的字符串的数 + archiveMasterVo.setStatus(status); + } + } + } + /** * 出院浏览转换科室中文、查询天数 * @@ -375,7 +406,7 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { vo.setD1(new BigDecimal(0)); } //科室名称编码转名称 - DeptNameCode2Name(dictionaries, vo); + deptNameCode2Name(dictionaries, vo); //赋值出院天数 if(!CollectionUtils.isEmpty(selectDays)){ for(Archive_Master_Vo days : selectDays){ @@ -394,7 +425,7 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { * @param dictionaries 科室字典列表 * @param vo 患者记录对象 */ - private void DeptNameCode2Name(List dictionaries, Archive_Master_Vo vo) { + private void deptNameCode2Name(List dictionaries, Archive_Master_Vo vo) { if(!CollectionUtils.isEmpty(dictionaries)) { //在院科室 String deptAdmissionTo = vo.getDeptAdmissionTo(); @@ -1045,7 +1076,6 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { int genegrateRole = 0; //拼接有权限的code StringBuilder powerCode = new StringBuilder(); - Integer role = 0; //遍历,判断拥有权限,拥有护士长权限立即返回4,拥有医生支线赋值doctorRole=1,拥有护士支线赋值nurseRole=1 for (String menu : menus) { if(StringUtils.isNotBlank(menu)){ diff --git a/src/main/java/com/emr/service/ipml/CommomService.java b/src/main/java/com/emr/service/ipml/CommomService.java index 5af81fb..c5b1872 100644 --- a/src/main/java/com/emr/service/ipml/CommomService.java +++ b/src/main/java/com/emr/service/ipml/CommomService.java @@ -1,9 +1,23 @@ package com.emr.service.ipml; +import com.alibaba.fastjson.JSON; import com.emr.dao.CommomMapper; +import com.emr.entity.Power_User; +import com.emr.vo.User; +import net.sf.json.JSONObject; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; import org.apache.shiro.util.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; import java.util.List; @@ -22,6 +36,10 @@ import java.util.List; @Service @Transactional public class CommomService { + @Value("${POWER_URLHEAD}") + private String POWER_URLHEAD; + @Autowired + private StatisticsService statisticsService; /** * 批量添加 * @param tableName 表名 @@ -49,4 +67,78 @@ public class CommomService { } } } + + /** + * 适用可直接从session中取用户列表 + * @return + * @throws Exception + */ + public List getUserList() throws Exception{ + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + List userList = (List)request.getSession().getAttribute("USER_LIST"); + if(null == userList || userList.isEmpty()){ + String userName = (String) request.getSession().getAttribute("userSession"); + //调用接口查询 + String resultString = ""; + // 创建uri + String url = POWER_URLHEAD+"/font/getUserList?userName="+userName; + // 执行请求 + CloseableHttpResponse response = HttpClients.createDefault().execute(new HttpGet(url)); + // 判断返回状态是否为200 + if (response.getStatusLine().getStatusCode() == 200) { + resultString = EntityUtils.toString(response.getEntity(), "UTF-8"); + } + JSONObject jsonObject = JSONObject.fromObject(resultString); + String extend = jsonObject.getString("extend"); + JSONObject extendObject = JSONObject.fromObject(extend); + String userList1 = extendObject.getString("userList"); + userList = JSON.parseArray(userList1,User.class); + //设置进session + request.getSession().setAttribute("USER_LIST",userList); + } + return userList; + } + + /** + * 适用可不能从session中取用户列表,直接调用权限系统接口 + * @return + * @throws Exception + */ + public List getUserList(String userName) throws Exception{ + //调用接口查询 + String resultString = ""; + // 创建uri + String url = POWER_URLHEAD+"/font/getUserList?userName="+userName; + // 执行请求 + CloseableHttpResponse response = HttpClients.createDefault().execute(new HttpGet(url)); + // 判断返回状态是否为200 + if (response.getStatusLine().getStatusCode() == 200) { + resultString = EntityUtils.toString(response.getEntity(), "UTF-8"); + } + JSONObject jsonObject = JSONObject.fromObject(resultString); + String extend = jsonObject.getString("extend"); + JSONObject extendObject = JSONObject.fromObject(extend); + String userList1 = extendObject.getString("userList"); + List userList = JSON.parseArray(userList1,User.class); + //设置进session + return userList; + } + + /** + * 根据用户获取session中用户集合的中对应的科室编号deptCode + * @param userName + * @return + * @throws Exception + */ + public String selectDeptCodeByUser(String userName) throws Exception { + List userList = getUserList(); + if(!CollectionUtils.isEmpty(userList)){ + for(User user : userList){ + if(user.getUserName().equals(userName)){ + return user.getDeptCode(); + } + } + } + return null; + } } diff --git a/src/main/java/com/emr/service/ipml/EmrOvertimeSetService.java b/src/main/java/com/emr/service/ipml/EmrOvertimeSetService.java index 966ee66..bbd052f 100644 --- a/src/main/java/com/emr/service/ipml/EmrOvertimeSetService.java +++ b/src/main/java/com/emr/service/ipml/EmrOvertimeSetService.java @@ -1,10 +1,7 @@ package com.emr.service.ipml; import com.alibaba.fastjson.JSON; -import com.emr.dao.ArchiveRemindDeptUserMapper; -import com.emr.dao.ArchiveRemindcancleDeptMapper; -import com.emr.dao.ArchiveTransferDeptUserMapper; -import com.emr.dao.EmrOvertimeSetMapper; +import com.emr.dao.*; import com.emr.entity.*; import com.emr.quart.DynamicScheduleTaskSecond; import com.emr.service.Emr_DictionaryService; @@ -13,10 +10,13 @@ import com.emr.vo.User; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.util.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -34,13 +34,13 @@ import java.util.List; @Service @Transactional public class EmrOvertimeSetService { + @Value("${overDateSet}") + private String overDateSet; @Autowired private EmrOvertimeSetMapper overtimeSetMapper; @Autowired private Emr_DictionaryService dictionaryService; @Autowired - private StatisticsService statisticsService; - @Autowired private ArchiveRemindcancleDeptMapper remindcancleDeptMapper; @Autowired private ArchiveRemindDeptUserMapper remindDeptUserMapper; @@ -49,7 +49,7 @@ public class EmrOvertimeSetService { @Autowired private DynamicScheduleTaskSecond dynamicScheduleTaskSecond; @Autowired - private ArchiveTransferDeptUserMapper transferDeptUserMapper; + private EmrHolidaySetMapper holidaySetMapper; /** * 根据主键查询 * @return @@ -113,7 +113,7 @@ public class EmrOvertimeSetService { List list = new ArrayList<>(); if(!CollectionUtils.isEmpty(dictionaries)){ //查询用户信息 - List userList = statisticsService.getUserList(); + List userList = commomService.getUserList(); if(!CollectionUtils.isEmpty(userList)){ //查询取消科室提醒单独提醒的用户 List remindDeptUsers = remindDeptUserMapper.selectAll(); @@ -237,4 +237,24 @@ public class EmrOvertimeSetService { //批量插入 commomService.insertBatch("archive_remind_dept_user",list,remindDeptUserMapper); } + + /** + * 获取即将超期通知的日期 + * @return + */ + public String getRemindDate(){ + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); + //获取工作日集合 + List workDateList = holidaySetMapper.selectWorkDayByDate(overDateSet, fmt.format(new Date()), "date desc"); + if(!CollectionUtils.isEmpty(workDateList)){ + //查询超期设置参数 + EmrOvertimeSet emrOvertimeSet = overtimeSetMapper.selectByPrimaryKey(1); + //获取提前超期天数 + Integer surplusDays = emrOvertimeSet.getSurplusDays(); + if(workDateList.size() >= surplusDays){ + return workDateList.get(surplusDays).getDate(); + } + } + return null; + } } diff --git a/src/main/java/com/emr/service/ipml/Emr_Fault_DetailServiceImpl.java b/src/main/java/com/emr/service/ipml/Emr_Fault_DetailServiceImpl.java index c62949a..9be637c 100644 --- a/src/main/java/com/emr/service/ipml/Emr_Fault_DetailServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/Emr_Fault_DetailServiceImpl.java @@ -40,7 +40,7 @@ public class Emr_Fault_DetailServiceImpl implements Emr_Fault_DetailService { @Autowired private Archive_MasterService archiveMasterService; @Autowired - private StatisticsService statisticsService; + private CommomService commomService; /** * 根据条件查询缺陷列表 * 病案终审退回 @@ -66,7 +66,7 @@ public class Emr_Fault_DetailServiceImpl implements Emr_Fault_DetailService { obj.setEffective(1); List typeLis = emrFaultTypeService.selectByCol(obj); Msg role = archiveMasterService.getRole(); - List userList = statisticsService.getUserList(); + List userList = commomService.getUserList(); if(null != role) { for (Emr_Fault_Vo emr_fault_vo : list) { //根据状态code转换状态及判断显示按钮 diff --git a/src/main/java/com/emr/service/ipml/RecordService.java b/src/main/java/com/emr/service/ipml/RecordService.java index 78417b6..78118f5 100644 --- a/src/main/java/com/emr/service/ipml/RecordService.java +++ b/src/main/java/com/emr/service/ipml/RecordService.java @@ -21,7 +21,7 @@ public class RecordService { @Autowired private Emr_DictionaryMapper dictionaryMapper; @Autowired - private StatisticsService statisticsService; + private CommomService commomService; @Autowired private Archive_MasterService archiveMasterService; /** @@ -203,7 +203,7 @@ public class RecordService { public List selectRecordGroupDeptAndRole(RecordSearch recordSearch) throws Exception{ List list = recordMapper.selectRecordGroupDeptAndRole(recordSearch); if(!CollectionUtils.isEmpty(list)){ - List userList = statisticsService.getUserList(); + List userList = commomService.getUserList(); for (Archive_Master_Vo obj : list) { //转换工号 if(!CollectionUtils.isEmpty(userList)) { diff --git a/src/main/java/com/emr/service/ipml/SendMessageService.java b/src/main/java/com/emr/service/ipml/SendMessageService.java new file mode 100644 index 0000000..3ad851d --- /dev/null +++ b/src/main/java/com/emr/service/ipml/SendMessageService.java @@ -0,0 +1,176 @@ +package com.emr.service.ipml; + +import com.emr.dao.RecordMapper; +import com.emr.entity.EmrOvertimeSet; +import com.emr.entity.Power_User; +import com.emr.util.HttpClientUtils; +import com.emr.vo.RecordSearch; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +/** + * @ProjectName: + * @Description: + * @Param 传输参数 + * @Return + * @Author: 曾文和 + * @CreateDate: 2020/11/10 14:20 + * @UpdateUser: 曾文和 + * @UpdateDate: 2020/11/10 14:20 + * @UpdateRemark: 更新说明 + * @Version: 1.0 + */ +@Service +public class SendMessageService { + @Value("${overDateSet}") + private String overDateSet; + @Value("${POWER_URLHEAD}") + private String POWER_URLHEAD; + @Autowired + private EmrOvertimeSetService overtimeSetService; + @Autowired + private RecordMapper recordMapper; + @Autowired + private CommomService commomService; + /** + * 根据角色Id获取角色名称和角色称呼 + * @param roleId + * @return list list.get(0) = 角色名称 list.get(1) = 角色称呼 list.get(2) = infoId + */ + public List selectInfoIdAndRoleName(int roleId) { + //roleId:1:医生,2:护士,3:病案室人员,5:医生质控员,6:科主任,7:护士长,8:护士质控员 + //infoId:2:医生;3:医生质控员;4:科主任;5:护士;6:护士质控员;7:护士长;8:病案室人员; + List list = new LinkedList<>(); + switch (roleId){ + case 1: + list.add("医生"); + list.add("医生待审核"); + list.add("2"); + break; + case 5: + list.add("医生"); + list.add("质控员待审核"); + list.add("3"); + break; + case 6: + list.add("主任"); + list.add("科主任待审核"); + list.add("4"); + break; + case 2: + list.add("护士"); + list.add("护士待审核"); + list.add("5"); + break; + case 8: + list.add("护士"); + list.add("质控员待审核"); + list.add("6"); + break; + case 7: + list.add("护士长"); + list.add("护士长待审核"); + list.add("7"); + break; + case 3: + list.add("病案室人员"); + list.add("病案室人员待审核"); + list.add("8"); + break; + default: + list.add("无效角色"); + list.add("无效角色待审核"); + list.add("1"); + } + return list; + } + + /** + * 组织发送消息 + * @param name 姓名 + * @param count 待审核份数 + * @param roleList 根据角色Id获取角色名称和角色称呼 list list.get(0) = 角色名称 list.get(1) = 角色称呼 + * @return + */ + public String selectContentByRole(String name,Integer count,List roleList){ + return name + roleList.get(0) + ",您有"+count+"份病历是"+roleList.get(1)+"状态,请及时查阅"; + } + + /** + * 调用权限系统发送消息接口 + * @param userId 用户Id + * @param content 发送内容 + */ + public void sendMessage(Integer userId, String content,String typeFlag) { + Map map = new HashMap<>(); + map.put("title", "待审核病历即将超期通知"); + map.put("content", content); + map.put("sysFlag", "emr_medical_record"); + map.put("userId", userId + ""); + map.put("typeFlag", typeFlag); + //请求power系统发送信息 + HttpClientUtils.doGet(POWER_URLHEAD + "/font/sendMessage", map); + } + + /** + * 根据登录用户发送即将超期待审核提醒 + * @param request + */ + public void sendMessageForSubmit(HttpServletRequest request) throws Exception { + //获取登录用户 + Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); + //定义需要发送通知的角色id集合 + Integer[] roleIdArr = {1,2,3,5,6,7,8}; + int roleId = user.getRoleId(); + //判断是否需要发送通知 + int flag = Arrays.binarySearch(roleIdArr,roleId); + if(flag >= 0) { + //获取deptCode + String deptCode = commomService.selectDeptCodeByUser(user.getUserName()); + if(StringUtils.isNoneBlank(deptCode) && !"1".equals(deptCode)) { + //组织即将到期的待审核病历数的查询条件 + RecordSearch recordSearch = selectRecordSearch(); + //非病案室人员根据科室查 + if(user.getRoleId() != 3) { + recordSearch.setDeptName(deptCode); + } + //是医生的话明细到主管医生份数 + if(user.getRoleId().equals(1)){ + recordSearch.setDoctorInCharge(user.getUserPosition()); + } + //获取角色名称与角色称呼、infoId + List roleList = selectInfoIdAndRoleName(user.getRoleId()); + recordSearch.setInfoId(Integer.valueOf(roleList.get(2))); + //查询该用户即将到期的待审核病历数 + int count = recordMapper.selectCountOverTimeByRoleId(recordSearch); + if(count > 0) { + //组织通知内容 XXX医生或护士,您有X份病历是XX(角色)待审核状态,请及时查阅 + String content = selectContentByRole(user.getUserPosition(), count, roleList); + //调用权限系统发送消息接口 + sendMessage(user.getUserId(), content,"sendOverTimeMessage"); + } + } + } + } + + /** + * 组织即将过期的待审核份数的查询条件 + * @return + */ + public RecordSearch selectRecordSearch(){ + RecordSearch recordSearch = new RecordSearch(); + //设置查询超期标识 + recordSearch.setFlag(2); + //设置起始时间 + recordSearch.setStartDate(overDateSet); + //设置提前提醒天数 + EmrOvertimeSet emrOvertimeSet = overtimeSetService.selectByPrimaryKey(1); + recordSearch.setSurplus(emrOvertimeSet.getSurplusDays()); + return recordSearch; + } +} diff --git a/src/main/java/com/emr/service/ipml/StatisticsService.java b/src/main/java/com/emr/service/ipml/StatisticsService.java index 6240f9d..cff5e79 100644 --- a/src/main/java/com/emr/service/ipml/StatisticsService.java +++ b/src/main/java/com/emr/service/ipml/StatisticsService.java @@ -45,8 +45,6 @@ import java.util.List; @Service @Transactional public class StatisticsService { - @Value("${POWER_URLHEAD}") - private String POWER_URLHEAD; @Autowired private StatisticsMapper statisticsMapper; @Autowired @@ -55,6 +53,8 @@ public class StatisticsService { private TUuInfoMapper uuInfoMapper; @Autowired private RecordStatisticsMapper recordStatisticsMapper; + @Autowired + private CommomService commomService; //终审按天统计 public List getFinalStatistics(Integer offset, Integer limit, String startDate, String endDate,String sql) throws Exception{ if(null != offset && null != limit){ @@ -62,7 +62,7 @@ public class StatisticsService { } List list = statisticsMapper.finalStatistics(startDate, endDate,sql); //转换姓名 - List userList = getUserList(); + List userList = commomService.getUserList(); if(!CollectionUtils.isEmpty(list) && !CollectionUtils.isEmpty(userList)) { for (FinalAndFirstStatistics statistics : list) { for (User user : userList) { @@ -84,7 +84,7 @@ public class StatisticsService { } List list = statisticsMapper.firstStatistics(startDate, endDate,sql); //转换姓名 - List userList = getUserList(); + List userList = commomService.getUserList(); if(!CollectionUtils.isEmpty(list) && !CollectionUtils.isEmpty(userList)) { for (FinalAndFirstStatistics statistics : list) { for (User user : userList) { @@ -117,7 +117,7 @@ public class StatisticsService { public List getDetailList(String disStartDate, String disEndDate, Archive_Master_Vo archiveMasterVo,Integer flag,String sql) throws Exception{ //转换姓名 - List userList = getUserList(); + List userList = commomService.getUserList(); String checkDoctor = archiveMasterVo.getCheckDoctor(); //模糊搜索审核姓名转换工号 if(StringUtils.isNoneBlank(checkDoctor)){ @@ -178,51 +178,6 @@ public class StatisticsService { return uuInfoMapper.getScanInfo(search); } - public List getUserList() throws Exception{ - HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); - List userList = (List)request.getSession().getAttribute("USER_LIST"); - if(null == userList || userList.isEmpty()){ - String userName = (String) request.getSession().getAttribute("userSession"); - //调用接口查询 - String resultString = ""; - // 创建uri - String url = POWER_URLHEAD+"/font/getUserList?userName="+userName; - // 执行请求 - CloseableHttpResponse response = HttpClients.createDefault().execute(new HttpGet(url)); - // 判断返回状态是否为200 - if (response.getStatusLine().getStatusCode() == 200) { - resultString = EntityUtils.toString(response.getEntity(), "UTF-8"); - } - JSONObject jsonObject = JSONObject.fromObject(resultString); - String extend = jsonObject.getString("extend"); - JSONObject extendObject = JSONObject.fromObject(extend); - String userList1 = extendObject.getString("userList"); - userList = JSON.parseArray(userList1,User.class); - //设置进session - request.getSession().setAttribute("USER_LIST",userList); - } - return userList; - } - - public List getUserList(String userName) throws Exception{ - //调用接口查询 - String resultString = ""; - // 创建uri - String url = POWER_URLHEAD+"/font/getUserList?userName="+userName; - // 执行请求 - CloseableHttpResponse response = HttpClients.createDefault().execute(new HttpGet(url)); - // 判断返回状态是否为200 - if (response.getStatusLine().getStatusCode() == 200) { - resultString = EntityUtils.toString(response.getEntity(), "UTF-8"); - } - JSONObject jsonObject = JSONObject.fromObject(resultString); - String extend = jsonObject.getString("extend"); - JSONObject extendObject = JSONObject.fromObject(extend); - String userList1 = extendObject.getString("userList"); - List userList = JSON.parseArray(userList1,User.class); - //设置进session - return userList; - } /** * 统计病案列表 * @param recordStatistics diff --git a/src/main/java/com/emr/shiro/MyRealm.java b/src/main/java/com/emr/shiro/MyRealm.java index 917eb3d..56fd3f7 100644 --- a/src/main/java/com/emr/shiro/MyRealm.java +++ b/src/main/java/com/emr/shiro/MyRealm.java @@ -1,7 +1,9 @@ package com.emr.shiro; import com.alibaba.fastjson.JSONObject; +import com.emr.entity.Power_User; import com.emr.util.HttpClientUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.*; import org.apache.shiro.authz.AuthorizationInfo; @@ -10,22 +12,18 @@ import org.apache.shiro.realm.AuthorizingRealm; import org.apache.shiro.session.Session; import org.apache.shiro.subject.PrincipalCollection; import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.HashSet; +import java.util.Set; /** * @author HJL * @create 2019/4/29 */ public class MyRealm extends AuthorizingRealm { - //获取权限列表 - /*@Autowired - private PermissionService permissionService; - //获取用户 - @Autowired - private UserService userService; - ////获取用户角色 - @Autowired - private RoleService roleService;*/ - @Value("${powerUrl}") private String powerUrl; @@ -35,16 +33,26 @@ public class MyRealm extends AuthorizingRealm { */ @Override protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) { + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER"); //获取登录时输入的用户名 - String username = (String) principalCollection.getPrimaryPrincipal(); - if (username != null) { + if (user != null) { + Set menus = user.getMenus(); + // 用户权限列表 + Set permsSet = new HashSet(); + if(null != menus && !menus.isEmpty()){ + for(String menu : menus){ + if(StringUtils.isNoneBlank(menu)){ + permsSet.add(menu); + } + } + } SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(); - info.addStringPermission("/login"); - info.addStringPermission("index"); - info.addRole("0"); + info.setStringPermissions(permsSet); return info; + }else{ + return null; } - return null; } /** diff --git a/src/main/java/com/emr/vo/Message.java b/src/main/java/com/emr/vo/Message.java new file mode 100644 index 0000000..9cb0ca6 --- /dev/null +++ b/src/main/java/com/emr/vo/Message.java @@ -0,0 +1,55 @@ +package com.emr.vo; + +/** + * @ProjectName: + * @Description: + * @Param 传输参数 + * @Return + * @Author: 曾文和 + * @CreateDate: 2020/11/9 15:30 + * @UpdateUser: 曾文和 + * @UpdateDate: 2020/11/9 15:30 + * @UpdateRemark: 更新说明 + * @Version: 1.0 + */ +public class Message { + private Integer userId; + + private String sysFlag; + + private String title; + + private String content; + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public String getSysFlag() { + return sysFlag; + } + + public void setSysFlag(String sysFlag) { + this.sysFlag = sysFlag; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } +} diff --git a/src/main/resources/config/applicationContext.xml b/src/main/resources/config/applicationContext.xml index 04d9749..2ab764c 100644 --- a/src/main/resources/config/applicationContext.xml +++ b/src/main/resources/config/applicationContext.xml @@ -39,14 +39,30 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/config/config.properties b/src/main/resources/config/config.properties index 30ef18f..7052db2 100644 --- a/src/main/resources/config/config.properties +++ b/src/main/resources/config/config.properties @@ -1,6 +1,6 @@ #power\u6743\u9650\u7CFB\u7EDFIP\u548C\u7AEF\u53E3 -#POWER_IP = localhost -#POWER_PORT = 8080 +#POWER_IP = 192.168.1.3 +#POWER_PORT = 8081 POWER_IP = 200.100.104.40 POWER_PORT = 8081 @@ -17,10 +17,8 @@ powerUrl=${POWER_URLHEAD}/font/getMenusByUserIdAndSysFlag #\u6821\u9A8C\u5B8C\u6574\u6027webService\u670D\u52A1\u63A5\u53E3 #\u6821\u9A8C\u5B8C\u6574\u6027IP -#CHECKSUCCESS_IP = 200.100.104.40 CHECKSUCCESS_IP = ${POWER_IP} #\u6821\u9A8C\u5B8C\u6574\u6027\u7AEF\u53E3 -#CHECKSUCCESS_PORT = 8081 CHECKSUCCESS_PORT = ${POWER_PORT} HomepageDictionary=http://${CHECKSUCCESS_IP}:${CHECKSUCCESS_PORT}/WholeCheckInterface/services/HomepageDictionary?wsdl HomepageMethod=CheckData diff --git a/src/main/resources/config/jdbc.properties b/src/main/resources/config/jdbc.properties index 49cce0a..5617e73 100644 --- a/src/main/resources/config/jdbc.properties +++ b/src/main/resources/config/jdbc.properties @@ -1,13 +1,37 @@ -jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver -#jdbc.url=jdbc\:sqlserver\://localhost:1433;databaseName=gm_record -#jdbc.username=sa -#jdbc.password=docus702 +#\u6570\u636E\u5E93IP +#dataBaseIp=localhost +##\u6570\u636E\u5E93\u540D\u79F0 +#dataBaseName=gm_record +##\u6570\u636E\u5E93\u5BC6\u7801 +#dataBasePassword=docus702 + +#\u6570\u636E\u5E93IP +dataBaseIp=200.100.104.40 +#\u6570\u636E\u5E93\u540D\u79F0 +dataBaseName=emr_record +#\u6570\u636E\u5E93\u5BC6\u7801 +dataBasePassword=AbcXyz123 -jdbc.url=jdbc\:sqlserver\://200.100.104.40:1433;databaseName=emr_record +jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver +jdbc.url=jdbc\:sqlserver\://${dataBaseIp}:1433;databaseName=${dataBaseName} jdbc.username=sa -jdbc.password=AbcXyz123 -filters=stat -maxWait=60000 +jdbc.password=${dataBasePassword} + +filters: stat +maxActive: 20 +initialSize: 1 +maxWait: 60000 +minIdle: 10 +timeBetweenEvictionRunsMillis: 60000 +minEvictableIdleTimeMillis: 300000 +validationQuery: SELECT 'x' +testWhileIdle: true +testOnBorrow: false +testOnReturn: false +maxOpenPreparedStatements: 20 +removeAbandoned: true +removeAbandonedTimeout: 1800 +logAbandoned: true diff --git a/src/main/resources/mapper/ArchiveOtherExtSubmittimeMapper.xml b/src/main/resources/mapper/ArchiveOtherExtSubmittimeMapper.xml index 391ef94..59a6166 100644 --- a/src/main/resources/mapper/ArchiveOtherExtSubmittimeMapper.xml +++ b/src/main/resources/mapper/ArchiveOtherExtSubmittimeMapper.xml @@ -138,7 +138,7 @@ select - t.MasterID,t.id,t.PDF_PATH,t.Source,t.UpLoadDateTime,t.SubAssort,t.Title,t.flag,z.assort_id,z.assort_name,z.assort_sort,z.print_flag,isnull(t.PageCount,0) pageCounts,t.id ids,t.PDF_PATH pdfPaths,CONVERT(varchar(19),archive_other_ext.eTime,120) eTimeStr,archive_other_ext_submitTime.create_time + t.MasterID,t.id,t.PDF_PATH,t.Source,t.UpLoadDateTime,t.SubAssort,t.Title,t.flag,z.assort_id,z.assort_name,z.assort_sort,z.print_flag,isnull(t.PageCount,0) pageCounts,t.id ids,t.PDF_PATH pdfPaths,archive_other_ext_submitTime.create_time from zd_assort z left join archive_detail t on z.assort_id=t.AssortID left join - archive_other_ext - on t.id = archive_other_ext.DID - left join archive_other_ext_submitTime - on archive_other_ext_submitTime.other_ext_id = archive_other_ext.id + on archive_other_ext_submitTime.str1 = t.id where 1=1 and t.MasterID=#{patientId,jdbcType=VARCHAR} @@ -404,11 +401,12 @@ archive_detail.AssortID = zd_assort.assort_id AND zd_assort.is_check = 1 WHERE MasterID IN (${masterIds}) + AND archive_detail.flag = 0 GROUP BY AssortID, MasterID - + + + \ No newline at end of file diff --git a/src/main/resources/mapper/RecordMapper.xml b/src/main/resources/mapper/RecordMapper.xml index 429bbee..a1e6ab6 100644 --- a/src/main/resources/mapper/RecordMapper.xml +++ b/src/main/resources/mapper/RecordMapper.xml @@ -11,7 +11,7 @@ - AND archive_master.DOCTOR_IN_CHARGE in (${doctorInCharge}) + AND archive_master.DOCTOR_IN_CHARGE in (#{doctorInCharge}) @@ -429,4 +429,12 @@ order by archive_master.DOCTOR_IN_CHARGE + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jspf/comm.jspf b/src/main/webapp/WEB-INF/jspf/comm.jspf index 88d94f1..de0ff04 100644 --- a/src/main/webapp/WEB-INF/jspf/comm.jspf +++ b/src/main/webapp/WEB-INF/jspf/comm.jspf @@ -3,7 +3,8 @@ <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %> <% Date d = new Date(); diff --git a/src/main/webapp/WEB-INF/jspf/webSocket.jspf b/src/main/webapp/WEB-INF/jspf/webSocket.jspf index 97e337c..1ffce31 100644 --- a/src/main/webapp/WEB-INF/jspf/webSocket.jspf +++ b/src/main/webapp/WEB-INF/jspf/webSocket.jspf @@ -45,7 +45,20 @@ window.location.href = url; } } - + //跳转到出院浏览待审核页面 + function returnUnSubmitPage(){ + var url = ''; + //获取登录者角色id + var roleId = $("#roleId").val(); + if(roleId == 3){ + //病案室跳转终审页面 + url = path + "/lastVerify/lastVerifys?flag=1"; + }else{ + //其余跳转出院浏览 + url = path + "/beHosp/beHosps?flag=1"; + } + $("#iFrame1").prop("src",url); + } /*******************************webSocket***********************************/ var userId = $("#userId").val(); var webSocketUrl = $("#webSocketUrl").val(); @@ -70,7 +83,7 @@ console.log('连接失败'); } - function narn (type,title,text,noticeId) { + function narn (type,title,text,typeFlag) { naranja()[type]({ title: title, text: text, @@ -78,7 +91,13 @@ buttons: [{ text: '查看详情', click: function (e) { - noticeManage1(noticeId) + if(typeFlag == 'sendOverTimeMessage') { + //跳转归档系统待审核页面 + returnUnSubmitPage(); + }else{ + //跳转权限系统读取通知页面 + noticeManage1(typeFlag); + } } }] }) diff --git a/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp b/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp index 10d4de2..07e6874 100644 --- a/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp +++ b/src/main/webapp/WEB-INF/views/beHospitaledDir/beHospList.jsp @@ -126,9 +126,16 @@ + + + + @@ -181,10 +188,9 @@
+ maxlength="10" autocomplete="off" value="${overDateSet}"/> - - +
@@ -201,20 +207,27 @@
-
+ <%--
- - + + + + + + + -
+
--%> @@ -812,7 +825,7 @@ - - + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/inHospitalDir/inHositalList.jsp b/src/main/webapp/WEB-INF/views/inHospitalDir/inHositalList.jsp index 98b5c07..beca809 100644 --- a/src/main/webapp/WEB-INF/views/inHospitalDir/inHositalList.jsp +++ b/src/main/webapp/WEB-INF/views/inHospitalDir/inHositalList.jsp @@ -448,5 +448,5 @@ - + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/index.jsp b/src/main/webapp/WEB-INF/views/index.jsp index fb5d899..130b3ea 100644 --- a/src/main/webapp/WEB-INF/views/index.jsp +++ b/src/main/webapp/WEB-INF/views/index.jsp @@ -1,5 +1,4 @@ - -<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %> +<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> @@ -14,52 +13,42 @@ <%@ include file="/WEB-INF/jspf/comm.jspf" %> @@ -162,10 +166,9 @@
+ maxlength="10" autocomplete="off" value="${overDateSet}"/> - - +
@@ -644,7 +647,7 @@
- + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp b/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp index 7ba922f..0cc1e5e 100644 --- a/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp +++ b/src/main/webapp/WEB-INF/views/unfileMedicalDir/unfileMedicalList.jsp @@ -588,6 +588,6 @@ var path = "${path}"; - + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index d399265..2702f69 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -50,7 +50,28 @@ shiroFilter /* - + + + DruidWebStatFilter + com.alibaba.druid.support.http.WebStatFilter + + exclusions + *. js ,*. gif ,*. jpg ,*. png ,*. css ,*. ico ,/ druid /* + + + + DruidWebStatFilter + /* + + + DruidStatView + com.alibaba.druid.support.http.StatViewServlet + + + DruidStatView + /druid/* + + contextConfigLocation @@ -83,5 +104,4 @@ / - \ No newline at end of file diff --git a/src/main/webapp/static/js/beHospList/beHospList.js b/src/main/webapp/static/js/beHospList/beHospList.js index fcc103e..48ed08c 100644 --- a/src/main/webapp/static/js/beHospList/beHospList.js +++ b/src/main/webapp/static/js/beHospList/beHospList.js @@ -155,16 +155,16 @@ function initTable() { var url = window.location.href; var index = url.substring(url.lastIndexOf('?') + 1).replace("num=", ""); var html = ""; - if (index != null && index.indexOf("select") !== -1) { + if (selectPower == 1) { html += ''; } if (row.btns != '' && row.btns != null) { html += row.btns; } - if (index != null && index.indexOf("showFlow") !== -1) { + if (showFlowPower == 1) { html += '' } - if (index != null && index.indexOf("other") !== -1) { + if (otherPower == 1) { html += '' } return html; @@ -422,7 +422,6 @@ function paramsMatter(value, row) { value = '

'+result+value+'

'; return value; } - //审核弹窗 单个审批① function verifyInfo(role,archivestate,roleCode,masterId){ //生成表单token,防止表单重复提交 @@ -579,7 +578,6 @@ $("#sureBtn").click(function(){ $('#verifyModal').modal('hide'); save(successCount,failSelects); }) - //提交后台审核 function save(successCount,failSelects){ $("#sureModal").modal('hide'); @@ -672,7 +670,7 @@ function getCurrentCodes() { $.ajaxSettings.async = true; } } -//加载审核节点 +/*//加载审核节点 function getApproveRoles() { //只做一次查询赋值 $.get(path+"/beHosp/getFlowRole",function(data){ @@ -710,7 +708,7 @@ function getApproveRoles() { toastr.error(data.msg); } },'json') -} +}*/ //监听审核节点查询的变更事件,记录属于支线 $("#infoId").change(function(){ @@ -723,8 +721,6 @@ $("#infoId").change(function(){ }) $(function () { - //加载主管医生列表 - loadDoctorInCharge(); //加载权限科室 getPowerDept(); //赋值审核角色 @@ -732,7 +728,9 @@ $(function () { //加载当前角色 getCurrentCodes(); //加载审核节点 - getApproveRoles(); + //getApproveRoles(); + //加载主管医生列表 + loadDoctorInCharge(); var url = window.location.href; var index = url.substring(url.lastIndexOf('?') + 1).replace("num=", ""); if (index != null && index != "" && index.indexOf("excel") != -1) { diff --git a/src/main/webapp/static/js/hospitalCommom/hospitalCommom.js b/src/main/webapp/static/js/hospitalCommom/hospitalCommom.js index 497e40e..3d70fcb 100644 --- a/src/main/webapp/static/js/hospitalCommom/hospitalCommom.js +++ b/src/main/webapp/static/js/hospitalCommom/hospitalCommom.js @@ -20,6 +20,7 @@ function loadDoctorInCharge(){ $.ajax({ type:'get', url:path+'/beHosp/loadDoctorInCharge', + async:false, data:{deptName:deptName}, success:function(data){ $("#doctorInCharge").empty(); @@ -31,7 +32,16 @@ function loadDoctorInCharge(){ var name = list[i].doctorInCharge; var py = makePy(name); var pingyin = ConvertPinyin(name); - html += ''; + var selected = ''; + //判断是否需要选中 + var flag = $("#flag").val(); + var currentRole = $("#currentRole").val(); + if(flag == 1 && currentRole == 1){ + if($("#currentName").val() == name){ + selected = 'selected'; + } + } + html += ''; } } $("#doctorInCharge").append(html); @@ -630,7 +640,7 @@ function initTable2() { valign: 'middle' }, { - title: '最近更新', + title: '采集完成时间', field: 'uploaddatetime', align: 'left', valign: 'middle', @@ -640,7 +650,7 @@ function initTable2() { //是否同步过 var createTime = row.createTime; if(createTime != null){ - return selectTimeColor(createTime,row.etimeStr); + return selectTimeColor(createTime,row.uploaddatetime,2); }else{ return value; } @@ -1031,6 +1041,8 @@ $("#saveBtn").click(function () { }); }); $("#workDetail").click(function(){ + //隐藏加载控件 + $("#loading").hide(); $("#workDetailModal").modal({ show: true//弹出对话框 }); @@ -1182,7 +1194,7 @@ function initTable5(data,sidePagination) { sysflag = ''; notNursingIds = id; } - submitUpdate(id,notNursingIds,sysflag); + submitUpdate(id,notNursingIds,row.did,sysflag); } } }, @@ -1205,7 +1217,7 @@ function initTable5(data,sidePagination) { valign: 'middle', sortable: true, formatter: function (value, row, index) { - return selectTimeColor(value,row.etimeStr); + return selectTimeColor(value,row.etimeStr,1); } }, { @@ -1286,13 +1298,23 @@ function initTable5(data,sidePagination) { $("#table5").bootstrapTable(option); } //对比结束时间方法 -function selectTimeColor(time,etimeStr){ +/** + * @param time 真实的时间 + * @param etimeStr 最后更新的时间 + * @param type 区别,type=1显示time值,type=2显示最新更新的时间 + * @returns {*} + */ +function selectTimeColor(time,etimeStr,type){ if(time != null){ var color = 'red'; if(etimeStr != null && etimeStr > time){ color = 'green'; } - return ''+time+''; + if(type == 1) { + return '' + time + ''; + }else{ + return '' + etimeStr + ''; + } }else{ return time; } @@ -1306,13 +1328,13 @@ var times = 5; $("#loading").css("background","url("+path+"/static/img/load.gif) no-repeat 10px 50%"); //同步更新 var timeInterval; -function submitUpdate(ids,notNursingIds,sysFlag) { +function submitUpdate(ids,notNursingIds,detailIds,sysFlag) { var idsArr = ids.split(","); var jzh = $("#patientId").val(); $.ajax({ type:'post', url:path+'/archiveExt/submitUpdate', - data:{ids:ids,notNursingIds:notNursingIds,jzh:jzh,masterId:$("#idLab").text(),sysFlag:sysFlag}, + data:{ids:ids,notNursingIds:notNursingIds,detailIds:detailIds,jzh:jzh,masterId:$("#idLab").text(),sysFlag:sysFlag}, dataType:'json', success:function (data) { if(data.code == 100){ @@ -1393,22 +1415,36 @@ $("#searchBtn6").click(function(){ var ids = ''; var sysflag = ''; var notNursingIds = ''; + var detailIds = ''; for (var i = 0; i < data.length; i++) { var id = data[i].idTemp; + var detailId = data[i].did; + if(detailId == ''){ + //占位 + detailId = null; + } + //拼接detailId + if(detailIds != ''){ + detailIds += ','; + } + detailIds += detailId; + //拼接id if(ids != ''){ ids += ','; } ids += id; if(data[i].sysflag == 1){ + //判断包含护理 sysflag = 1; }else{ + //拼接不包含护理的id if(notNursingIds != ''){ notNursingIds += ','; } notNursingIds += id; } } - submitUpdate(ids,notNursingIds,sysflag); + submitUpdate(ids,notNursingIds,detailIds,sysflag); } }) diff --git a/src/main/webapp/static/js/index.js b/src/main/webapp/static/js/index.js index 171f028..3eafe24 100644 --- a/src/main/webapp/static/js/index.js +++ b/src/main/webapp/static/js/index.js @@ -1,4 +1,6 @@ $(document).ready(function () { + //请求后台查询即将过期的待审核份数 + //sendMessageForSubmit(); var headerHeight = $(".main-header").height() || 0; var footerHeight = ($(".main-footer").height() || 0) + 31; var windowHeight = $(window).height(); @@ -38,4 +40,9 @@ function deleteLocalStorge(){ } } } +} +//请求后台查询即将过期的待审核份数 +function sendMessageForSubmit(){ + $.get(path+"/sendMessage/sendMessageForSubmit",function(response){ + }); } \ No newline at end of file diff --git a/src/main/webapp/static/js/lastVerifyList/lastVerifyList.js b/src/main/webapp/static/js/lastVerifyList/lastVerifyList.js index b376521..abee9c8 100644 --- a/src/main/webapp/static/js/lastVerifyList/lastVerifyList.js +++ b/src/main/webapp/static/js/lastVerifyList/lastVerifyList.js @@ -186,19 +186,17 @@ function initTable() { valign: 'middle', width: 100, // 定义列的宽度,单位为像素px formatter: function (value, row, index) { - var url = window.location.href; - var index = url.substring(url.lastIndexOf('?') + 1).replace("num=", ""); var html = ""; - if (index != null && index != "" && index.indexOf("select") != -1) { + if (selectPower == 1) { html = ''; } - if (index != null && index != "" && index.indexOf("last") != -1) { + if (udpatePower == 1) { html += ''; } - if (index != null && index != "" && index.indexOf("back") != -1) { + if (backToPower == 1) { html += ''; } - if (index != null && index != "" && index.indexOf("showFlow") != -1) { + if (showFlowPower == 1) { html += '' } return html;