|
@@ -3,6 +3,7 @@ package com.diagbot.facade;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.diagbot.dto.CheckDeptDTO;
|
|
|
import com.diagbot.dto.CheckJobDTO;
|
|
|
import com.diagbot.dto.DeptCheckUserDTO;
|
|
@@ -146,13 +147,9 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
|
|
|
* @Return java.util.Map<java.lang.String,java.util.List<com.diagbot.dto.CheckDeptDTO>>
|
|
|
* @MethodName getCheckUserMap
|
|
|
*/
|
|
|
- public List<CheckJobDTO> getUserCheckList(CheckJobVO checkJobVO) {
|
|
|
- //非空校验
|
|
|
- if(StringUtil.isBlank(checkJobVO.getStartTime())&&StringUtil.isBlank(checkJobVO.getEndTime())
|
|
|
- &&StringUtil.isBlank(checkJobVO.getBehosDateStart())&&StringUtil.isBlank(checkJobVO.getBehosDateEnd()))
|
|
|
- {
|
|
|
- throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "没有时间区间!");
|
|
|
- }
|
|
|
+ public IPage<CheckJobDTO> getUserCheckList(CheckJobVO checkJobVO) {
|
|
|
+ //校验
|
|
|
+ userCheckPageSet(checkJobVO);
|
|
|
//质控管理员要判断该角色是否是质控科
|
|
|
//1.获取质控科id
|
|
|
//获取人员id 和 该人员的医院id
|
|
@@ -167,11 +164,10 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
|
|
|
List<Long> roleIds = sysUserRoleFacade.list(new QueryWrapper<SysUserRole>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("user_id", principleId)
|
|
|
- .in("role_id",checkRoleIds)
|
|
|
).stream().distinct().map(SysUserRole::getRoleId).collect(Collectors.toList());
|
|
|
List<Long> searchRoleIds = new ArrayList<>();
|
|
|
//当前用户是监管人员或者是超级管理员
|
|
|
- if(roleIds.contains(-1))
|
|
|
+ if(roleIds.contains(-1L))
|
|
|
{
|
|
|
searchRoleIds.addAll(checkRoleIds);
|
|
|
}
|
|
@@ -203,7 +199,7 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
|
|
|
//3.判断这个人是否在质控科
|
|
|
if(deptIds.contains(zkkDeptId))
|
|
|
{
|
|
|
- return baseMapper.getCheckList(checkJobVO);
|
|
|
+ return getCheckList(checkJobVO);
|
|
|
}
|
|
|
}
|
|
|
//临床科室监管人员
|
|
@@ -218,7 +214,7 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
|
|
|
if(deptIds.isEmpty()){
|
|
|
checkJobVO.setDeptList(deptIds);
|
|
|
}
|
|
|
- return baseMapper.getCheckList(checkJobVO);
|
|
|
+ return getCheckList(checkJobVO);
|
|
|
}
|
|
|
//院级监管人员
|
|
|
else if(searchRoleIds.contains(6L)&&"1".equals(checkJobVO.getJobType()))
|
|
@@ -244,14 +240,49 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
|
|
|
checkJobVO.setDeptList(deptIds);
|
|
|
}
|
|
|
}
|
|
|
- return baseMapper.getCheckList(checkJobVO);
|
|
|
+ return getCheckList(checkJobVO);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该用户的角色和任务类型不对应!");
|
|
|
}
|
|
|
- return new ArrayList<>();
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * @Author songxl
|
|
|
+ * @Description 待分配列表页面校验
|
|
|
+ * @Date 2021/5/18
|
|
|
+ * @Param [checkJobVO]
|
|
|
+ * @Return void
|
|
|
+ * @MethodName userCheckPageSet
|
|
|
+ */
|
|
|
+ private void userCheckPageSet(CheckJobVO checkJobVO) {
|
|
|
+ if(StringUtil.isBlank(checkJobVO.getStartTime())&&StringUtil.isBlank(checkJobVO.getEndTime())
|
|
|
+ &&StringUtil.isBlank(checkJobVO.getBehosDateStart())&&StringUtil.isBlank(checkJobVO.getBehosDateEnd()))
|
|
|
+ {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "没有时间区间!");
|
|
|
+ }
|
|
|
+ if(StringUtil.isBlank(checkJobVO.getJobType()))
|
|
|
+ {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "没有任务类型!");
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotBlank(checkJobVO.getBehosDateStart())&&StringUtil.isNotBlank(checkJobVO.getBehosDateEnd()))
|
|
|
+ {
|
|
|
+ if (DateUtil.after(DateUtil.parseDate(checkJobVO.getBehosDateStart()),
|
|
|
+ DateUtil.parseDate(checkJobVO.getBehosDateEnd()))) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "出院时间的开始时间必须小于结束时间!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotBlank(checkJobVO.getStartTime())&&StringUtil.isNotBlank(checkJobVO.getEndTime()))
|
|
|
+ {
|
|
|
+ if (DateUtil.after(DateUtil.parseDate(checkJobVO.getStartTime()),
|
|
|
+ DateUtil.parseDate(checkJobVO.getEndTime()))) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "任务生成的开始时间必须小于结束时间!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* @Author songxl
|
|
|
* @Description 获取操作用户的核查科室以及科室核查人员
|
|
@@ -275,11 +306,10 @@ public class MedCheckInfoFacade extends MedCheckInfoServiceImpl {
|
|
|
List<Long> roleIds = sysUserRoleFacade.list(new QueryWrapper<SysUserRole>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("user_id", principleId)
|
|
|
- .in("role_id",checkRoleIds)
|
|
|
).stream().distinct().map(SysUserRole::getRoleId).collect(Collectors.toList());
|
|
|
List<Long> searchRoleIds = new ArrayList<>();
|
|
|
//当前用户是监管人员或者是超级管理员
|
|
|
- if(roleIds.contains(-1))
|
|
|
+ if(roleIds.contains(-1L))
|
|
|
{
|
|
|
searchRoleIds.addAll(checkRoleIds);
|
|
|
}
|