Pārlūkot izejas kodu

Merge branch '20210512_yw_check' into test

songxinlu 4 gadi atpakaļ
vecāks
revīzija
82a556441b

+ 2 - 0
src/main/java/com/diagbot/dto/JwtDTO.java

@@ -19,4 +19,6 @@ public class JwtDTO {
     private String typeCn; //用户类型中文
     //用户权限列表
     private List<SysRoleDTO> selRoles;
+    //用户密码复杂度是否符合
+//    private String passwordComplexity;
 }

+ 18 - 1
src/main/java/com/diagbot/facade/RecordCheckFacade.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.BehospitalInfoAgeDTO;
 import com.diagbot.dto.CheckedRecordListDTO;
 import com.diagbot.dto.SysUserDeptDTO;
+import com.diagbot.entity.BasDeptInfo;
 import com.diagbot.entity.MedCheckInfo;
 import com.diagbot.entity.SysUserDept;
 import com.diagbot.entity.SysUserRole;
@@ -12,6 +13,7 @@ import com.diagbot.enums.CheckJobTypeEnum;
 import com.diagbot.enums.CheckStatusEnum;
 import com.diagbot.enums.CheckTypeEnum;
 import com.diagbot.enums.CheckerRoleEnum;
+import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.MedQcresultDetailService;
@@ -49,6 +51,8 @@ public class RecordCheckFacade {
     MedQcresultDetailService medQcresultDetailService;
     @Autowired
     BehospitalInfoFacade behospitalInfoFacade;
+    @Autowired
+    BasDeptInfoFacade basDeptInfoFacade;
 
 
     public IPage<CheckedRecordListDTO> checkedRecordList(CheckedRecordListVO checkedRecordListVO) {
@@ -62,17 +66,27 @@ public class RecordCheckFacade {
         if (ListUtil.isNotEmpty(sysUserDeptDTO.getSelDepts())) {
             deptIds.addAll(sysUserDeptDTO.getSelDepts().stream().map(i -> i.getDeptId()).collect(Collectors.toList()));
         }
-
+        //1.2去除质管科
+        String zkkDeptId = basDeptInfoFacade.getOne(new QueryWrapper<BasDeptInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id",hospitalId)
+                .eq("station","质管")).getDeptId();
         List<Long> userIds = Lists.newArrayList();
+        List<String> JobTypes = Lists.newArrayList();
         roleIds.forEach(roleId -> {
             if (roleId.intValue() == CheckerRoleEnum.HOSP_SUPERVISOR.getKey()
                     && (ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes()) || checkedRecordListVO.getCheckJobTypes().contains(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() + ""))) {
                 userIds.addAll(getUserIdsOfRoleId(hospitalId, null, CheckerRoleEnum.HOSP_GENERAL.getKey()));
+                JobTypes.add(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey() + "");
             } else if (roleId.intValue() == CheckerRoleEnum.QUAT_SUPERVISOR.getKey()
                     && (ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes()) || checkedRecordListVO.getCheckJobTypes().contains(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey() + ""))) {
                 userIds.addAll(getUserIdsOfRoleId(hospitalId, deptIds, CheckerRoleEnum.QUAT_GENERAL.getKey()));
+                JobTypes.add(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey() + "");
             } else if (roleId.intValue() == CheckerRoleEnum.DEPT_SUPERVISOR.getKey() && ListUtil.isNotEmpty(deptIds)
                     && (ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes()) || checkedRecordListVO.getCheckJobTypes().contains(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() + ""))) {
+                //移除质管科人员
+                deptIds.remove(zkkDeptId);
+                JobTypes.add(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey() + "");
                 userIds.addAll(getUserIdsOfRoleId(hospitalId, deptIds, CheckerRoleEnum.DEPT_GENERAL.getKey()));
             } else if ((roleId.intValue() == CheckerRoleEnum.DEPT_GENERAL.getKey() && ListUtil.isNotEmpty(deptIds))
                     || roleId.intValue() == CheckerRoleEnum.QUAT_GENERAL.getKey() || roleId.intValue() == CheckerRoleEnum.HOSP_GENERAL.getKey()) {
@@ -80,6 +94,9 @@ public class RecordCheckFacade {
             }
         });
 
+        if(ListUtil.isEmpty(checkedRecordListVO.getCheckJobTypes())){
+            checkedRecordListVO.setCheckJobTypes(JobTypes);
+        }
         if (ListUtil.isEmpty(userIds)) {
             userIds.add(999999999999999999l);
         }

+ 21 - 1
src/main/java/com/diagbot/facade/SysUserFacade.java

@@ -149,6 +149,13 @@ public class SysUserFacade extends SysUserServiceImpl {
         jwtStore.setAccessToken(jwt.getAccess_token());
         jwtStore.setRefreshToken(jwt.getRefresh_token());
         tokenFacade.createToken(jwtStore);
+        /***
+         * 未加密密码复杂度判断
+         */
+/*        Boolean passwordRegular = passwordRegular(password);
+        if(!passwordRegular){
+            data.setPasswordComplexity("密码复杂度过低,请及时修改密码");
+        }*/
         return data;
     }
 
@@ -257,7 +264,10 @@ public class SysUserFacade extends SysUserServiceImpl {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "原密码和新密码不能相同");
         }
-
+/*        Boolean regularBoolean = passwordRegular(modifyPassword);
+        if(!regularBoolean){
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "请输入正确格式的新密码");
+        }*/
         String userId = SysUserUtils.getCurrentPrincipleID();
         SysUser user = this.getOne(new QueryWrapper<SysUser>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
@@ -281,6 +291,16 @@ public class SysUserFacade extends SysUserServiceImpl {
         return true;
     }
 
+    /**
+     * 未加密密文正则表达式  至少8个字符,至少1个大写字母,1个小写字母,1个数字和1个特殊字符:
+     * @param password
+     * @return
+     */
+    public Boolean passwordRegular(String password){
+        String regex="^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[$@$!%*?&])[A-Za-z\\d$@$!%*?&]{8,}";
+        boolean check=password.matches(regex);
+        return check;
+    }
     /**
      * 登录
      *