Quellcode durchsuchen

Merge branch 'dev/20211015_2.1.1' into test

chengyao vor 3 Jahren
Ursprung
Commit
8b212ecc6f
27 geänderte Dateien mit 1034 neuen und 86 gelöschten Zeilen
  1. 15 0
      pom.xml
  2. 2 0
      src/main/java/com/diagbot/config/ResourceServerConfigurer.java
  3. 2 0
      src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java
  4. 61 0
      src/main/java/com/diagbot/entity/ImageCaptchaParams.java
  5. 1 0
      src/main/java/com/diagbot/facade/ConsoleExportFacade.java
  6. 1 0
      src/main/java/com/diagbot/facade/ConsoleFacade.java
  7. 75 32
      src/main/java/com/diagbot/facade/SysUserFacade.java
  8. 1 0
      src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java
  9. 1 1
      src/main/java/com/diagbot/service/BehospitalInfoService.java
  10. 1 0
      src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java
  11. 60 0
      src/main/java/com/diagbot/util/ImageCaptchaUtil.java
  12. 611 0
      src/main/java/com/diagbot/util/RedisUtils.java
  13. 57 0
      src/main/java/com/diagbot/vo/FilterOrderPageVO.java
  14. 15 0
      src/main/java/com/diagbot/vo/FilterPageVO.java
  15. 5 0
      src/main/java/com/diagbot/vo/FilterVO.java
  16. 5 0
      src/main/java/com/diagbot/vo/QcResultPageVO.java
  17. 5 0
      src/main/java/com/diagbot/vo/QcResultShortPageVO.java
  18. 2 1
      src/main/java/com/diagbot/vo/UserLoginVO.java
  19. 1 0
      src/main/java/com/diagbot/web/ConsoleByDeptController.java
  20. 1 0
      src/main/java/com/diagbot/web/ConsoleController.java
  21. 0 1
      src/main/java/com/diagbot/web/ConsoleExportController.java
  22. 14 2
      src/main/java/com/diagbot/web/SysUserController.java
  23. 1 1
      src/main/resources/application-local.yml
  24. 3 3
      src/main/resources/application-pre.yml
  25. 1 1
      src/main/resources/bootstrap.yml
  26. 69 44
      src/main/resources/mapper/BehospitalInfoMapper.xml
  27. 24 0
      src/main/resources/mapper/QcresultInfoMapper.xml

+ 15 - 0
pom.xml

@@ -36,6 +36,8 @@
         <aggregator.version>1.1.0</aggregator.version>
         <okhttp.version>4.2.2</okhttp.version>
         <easypoi.version>4.2.0</easypoi.version>
+        <patchca.version>1.1.2</patchca.version>
+        <hutool.version>5.0.7</hutool.version>
         <docker-maven-plugin.version>1.2.1</docker-maven-plugin.version>
         <docker.image.prefix>192.168.2.241:5000/diagbotcloud</docker.image.prefix>
         <registryUrl>http://192.168.2.241:5000/repository/diagbotcloud/</registryUrl>
@@ -108,6 +110,19 @@
             <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>com.bladejava</groupId>
+            <artifactId>blade-patchca</artifactId>
+            <version>${patchca.version}</version>
+
+        </dependency>
+
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>${hutool.version}</version>
+        </dependency>
+
         <!--swagger-->
         <dependency>
             <groupId>io.springfox</groupId>

+ 2 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -38,6 +38,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .authorizeRequests()
                 .regexMatchers(".*swagger.*", ".*v2.*", ".*webjars.*", "/druid.*", "/actuator.*", "/hystrix.*").permitAll()
                 .antMatchers("/sys/user/getJwt").permitAll()
+                .antMatchers("/sys/user/getCaptcha").permitAll()
                 .antMatchers("/sys/user/getHospitalMark").permitAll()
                 .antMatchers("/sys/user/getJwtNoPass").permitAll()
                 .antMatchers("/sys/user/refreshJwt").permitAll()
@@ -209,6 +210,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/consoleByDept/beHosCountByDept").permitAll()
                 .antMatchers("/consoleByDept/casesEntryStatisticsByDept").permitAll()
                 .antMatchers("/bas/doctor/getList").permitAll()
+                .antMatchers("/bas/doctor/getDoctorProfessorList").permitAll()
                 .antMatchers("/consoleByDept/homePageOrGoodLevelByDept").permitAll()
                 .antMatchers("/print/export/homePageLevelExportByDept").permitAll()
                 .antMatchers("/print/export/homePageOrLevelExportByDept").permitAll()

+ 2 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -81,6 +81,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/actuator/**", request)
                 || matchers("/hystrix/**", request)
                 || matchers("/sys/user/getJwt", request)
+                || matchers("/sys/user/getCaptcha", request)
                 || matchers("/sys/user/getHospitalMark", request)
                 || matchers("/sys/user/getJwtNoPass", request)
                 || matchers("/sys/user/refreshJwt", request)
@@ -253,6 +254,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/consoleByDept/beHosCountByDept", request)
                 || matchers("/consoleByDept/casesEntryStatisticsByDept", request)
                 || matchers("/bas/doctor/getList", request)
+                || matchers("/bas/doctor/getDoctorProfessorList", request)
                 || matchers("/consoleByDept/homePageOrGoodLevelByDept", request)
                 || matchers("/print/export/homePageLevelExportByDept", request)
                 || matchers("/print/export/homePageOrLevelExportByDept", request)

+ 61 - 0
src/main/java/com/diagbot/entity/ImageCaptchaParams.java

@@ -0,0 +1,61 @@
+package com.diagbot.entity;
+import lombok.Data;
+
+
+/**
+ * @Author chengyao
+ * @Date 2021/10/14 19:57
+ * @Version 1.0
+ */
+
+@Data
+public class ImageCaptchaParams {
+    /**
+     * 默认图片验证码的文字内容
+     */
+    public static final String DEFAULT_WORDS = "123456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ";
+    public static final String DEFAULT_FORMAT = "png";
+    /**
+     * 图片验证码宽度
+     */
+    private int width;
+    /**
+     * 图片验证码高度
+     */
+    private int height;
+    /**
+     * 最多生成几个文字
+     */
+    private int maxWordAmount;
+    /**
+     * 最小生成几个文字
+     */
+    private int minWordAmount;
+    /**
+     * 字体最大尺寸
+     */
+    private int maxFontSize;
+    /**
+     * 文字最小尺寸
+     */
+    private int minFontSize;
+    /**
+     * 生成图片验证码内容的字体
+     */
+    private String words;
+    /**
+     * 图片类型
+     */
+    private String format;
+
+    public ImageCaptchaParams(){
+        this.width = 105;
+        this.height = 35;
+        this.maxWordAmount = 4;
+        this.minWordAmount = 4;
+        this.minFontSize = 24;
+        this.maxFontSize = 25;
+        this.words = DEFAULT_WORDS;
+        this.format = DEFAULT_FORMAT;
+    }
+}

+ 1 - 0
src/main/java/com/diagbot/facade/ConsoleExportFacade.java

@@ -50,6 +50,7 @@ public class ConsoleExportFacade {
         ExcelUtils.exportExcel(res, null, "sheet1", HomePageNumDTO.class, fileName, response, 12.8f);
     }
 
+
     /**
      * 条目缺陷占比(内页)
      *

+ 1 - 0
src/main/java/com/diagbot/facade/ConsoleFacade.java

@@ -2161,6 +2161,7 @@ public class ConsoleFacade {
         return records;
     }
 
+
     /**
      * 病历质控报表
      *

+ 75 - 32
src/main/java/com/diagbot/facade/SysUserFacade.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.client.AuthServiceClient;
 import com.diagbot.dto.*;
 import com.diagbot.entity.BasHospitalInfo;
+import com.diagbot.entity.ImageCaptchaParams;
 import com.diagbot.entity.JWT;
 import com.diagbot.entity.JwtStore;
 import com.diagbot.entity.SysHospitalSet;
@@ -26,7 +27,9 @@ import com.diagbot.service.impl.SysUserServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ImageCaptchaUtil;
 import com.diagbot.util.ListUtil;
+import com.diagbot.util.RedisUtils;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.BasDeptInfoVO;
@@ -41,7 +44,16 @@ import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.security.oauth2.common.OAuth2AccessToken;
 import org.springframework.stereotype.Component;
 import org.springframework.util.DigestUtils;
-
+import org.springframework.util.StringUtils;
+
+import javax.imageio.ImageIO;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -87,12 +99,13 @@ public class SysUserFacade extends SysUserServiceImpl {
     private SysDictionaryFacade sysDictionaryFacade;
     @Autowired
     private SysHospitalSetFacade sysHospitalSetFacade;
-
-
+    @Autowired
+    private RedisUtils redisUtils;
 
 
     /**
      * 获取标识--选择登录页面
+     *
      * @return java.lang.Long
      */
     public Long getHospitalMark() {
@@ -101,21 +114,40 @@ public class SysUserFacade extends SysUserServiceImpl {
                 .eq(SysHospitalSet::getHospitalId, 35)
                 .eq(SysHospitalSet::getIsDeleted, IsDeleteEnum.N.getKey())
                 .eq(SysHospitalSet::getCode, "special_page_csxy").one();
-        if(null != sysHospitalSet){
+        if (null != sysHospitalSet) {
             String val = sysHospitalSet.getValue();
-            if(StringUtil.isNotBlank(val) && "1".equals(val)){
-               mark =  Long.valueOf(val);
+            if (StringUtil.isNotBlank(val) && "1".equals(val)) {
+                mark = Long.valueOf(val);
             }
         }
         return mark;
     }
+
+    public void getCaptcha(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        response.setContentType("image/png");
+        response.setHeader("Pragma", "no-cache");
+        response.setHeader("Cache-Control", "no-cache");
+        response.setDateHeader("Expires", 0);
+        HttpSession session = request.getSession();
+        String captchaId = session.getId();
+        ServletOutputStream outputStream = response.getOutputStream();
+        ImageCaptchaUtil imageCaptchaUtil = new ImageCaptchaUtil();
+        BufferedImage image = imageCaptchaUtil.createRandom();
+        String captcha = imageCaptchaUtil.getText();
+        redisUtils.set("user:captchaIds:" + captchaId, captcha, 60 * 3);
+        ImageIO.write(image, ImageCaptchaParams.DEFAULT_FORMAT, outputStream);
+        outputStream.flush();
+        outputStream.close();
+    }
+
     /**
      * 获取jwt
+     *
      * @param username 用户名
      * @param password 密码
      * @return jwt
      */
-    public JwtDTO getJwt(String username, String password) {
+    public JwtDTO getJwt(HttpServletRequest request, String username, String password, String captcha) {
         JwtDTO data = new JwtDTO();
         if (StringUtil.isBlank(username)) {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
@@ -125,6 +157,16 @@ public class SysUserFacade extends SysUserServiceImpl {
             throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
                     "请输入密码");
         }
+        if (StringUtils.isEmpty(captcha)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                    "请输入验证码");
+        }
+        // 验证码校验
+        String captchaId = request.getSession().getId();
+        Object captchaObject = redisUtils.get("user:captchaIds:" + captchaId);
+        if (null == captchaObject || StringUtil.isBlank(captchaObject.toString()) || !captchaObject.toString().trim().equalsIgnoreCase(captcha)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "验证码错误");
+        }
         //使用MD5对密码进行加密
         String MD5Password = DigestUtils.md5DigestAsHex(password.getBytes());
         QueryWrapper<SysUser> userQueryWrapper = new QueryWrapper<>();
@@ -144,6 +186,7 @@ public class SysUserFacade extends SysUserServiceImpl {
         if (null == jwt) {
             throw new CommonException(ServiceErrorCode.GET_TOKEN_FAIL);
         }
+        redisUtils.del("user:captchaIds:" + captchaId);
         data.setAccessToken(jwt.getAccess_token());
         data.setRefreshToken(jwt.getRefresh_token());
         data.setType(user.getType());
@@ -152,15 +195,12 @@ public class SysUserFacade extends SysUserServiceImpl {
         try {
             SysUserBaseVO sysUserBaseVO = new SysUserBaseVO();
             sysUserBaseVO.setUserId(user.getId());
-            List<SysRoleDTO> selRoles =getlocalUserRoles(sysUserBaseVO);
-            if(selRoles!=null&&!selRoles.isEmpty())
-            {
+            List<SysRoleDTO> selRoles = getlocalUserRoles(sysUserBaseVO);
+            if (selRoles != null && !selRoles.isEmpty()) {
                 data.setSelRoles(selRoles);
             }
 
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             e.printStackTrace();
         }
         //token存入redis
@@ -171,8 +211,8 @@ public class SysUserFacade extends SysUserServiceImpl {
         /***
          * 未经过MD5加密密码复杂度判断
          */
-     //   获取用户医院id
-   //     String hospitalID = SysUserUtils.getCurrentHospitalID();
+        //   获取用户医院id
+        //     String hospitalID = SysUserUtils.getCurrentHospitalID();
         Long id = user.getId();
         QueryWrapper<SysUserHospital> UserHospitalQueryWrapper = new QueryWrapper<>();
         UserHospitalQueryWrapper
@@ -181,8 +221,8 @@ public class SysUserFacade extends SysUserServiceImpl {
         SysUserHospital userHospital = sysUserHospitalFacade.getOne(UserHospitalQueryWrapper, false);
         Long hospitalId = userHospital.getHospitalId();
         String idStr = String.valueOf(hospitalId);
-        Boolean passwordRegular = passwordRegular(password,idStr);
-        if(!passwordRegular){
+        Boolean passwordRegular = passwordRegular(password, idStr);
+        if (!passwordRegular) {
             data.setPasswordComplexity("未修改初始密码,请及时修改密码");
         }
         return data;
@@ -294,8 +334,8 @@ public class SysUserFacade extends SysUserServiceImpl {
         }
         //对传入的密码进行格式验证
         String hospitalID = SysUserUtils.getCurrentHospitalID();
-        Boolean regularBoolean = passwordRegular(modifyPassword,hospitalID);
-        if(!regularBoolean){
+        Boolean regularBoolean = passwordRegular(modifyPassword, hospitalID);
+        if (!regularBoolean) {
             throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "请输入正确格式的新密码");
         }
         String userId = SysUserUtils.getCurrentPrincipleID();
@@ -325,23 +365,25 @@ public class SysUserFacade extends SysUserServiceImpl {
 
     /**
      * 未加密密文正则表达式  至少8个字符,1个大写字母,1个小写字母,1个数字和1个特殊字符:
+     *
      * @param password
      * @return
      */
-    public Boolean passwordRegular(String password,String hospitalId){
-        boolean check=true;
+    public Boolean passwordRegular(String password, String hospitalId) {
+        boolean check = true;
         Map<String, Map<String, String>> dictionaryWithKey = sysDictionaryFacade.getDictionaryWithKey();
-        if(dictionaryWithKey!=null){
+        if (dictionaryWithKey != null) {
             Map<String, String> stringStringMap = dictionaryWithKey.get("30");
-            if(stringStringMap!=null) {
+            if (stringStringMap != null) {
                 String regular = stringStringMap.get(hospitalId);
-                if(StringUtil.isNotEmpty(regular)) {
+                if (StringUtil.isNotEmpty(regular)) {
                     check = password.matches(regular);
                 }
             }
         }
         return check;
     }
+
     /**
      * 登录
      *
@@ -356,13 +398,13 @@ public class SysUserFacade extends SysUserServiceImpl {
                 .eq("status", StatusEnum.Enable.getKey())
                 .eq("id", userId), false);
         QueryWrapper<SysUserRole> sysUserRoleQueryWrapper = new QueryWrapper<>();
-        sysUserRoleQueryWrapper.eq("user_id",userId);
-        sysUserRoleQueryWrapper .eq("is_deleted", IsDeleteEnum.N.getKey());
+        sysUserRoleQueryWrapper.eq("user_id", userId);
+        sysUserRoleQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
         List<SysUserRole> sysUserRoleList = sysUserRoleFacade.list(sysUserRoleQueryWrapper);
-        if(ListUtil.isNotEmpty(sysUserRoleList)){
-            sysUserRoleList.forEach(sysUserRole ->{
-                roleSet.add(sysUserRole.getRoleId()+"");
-            } );
+        if (ListUtil.isNotEmpty(sysUserRoleList)) {
+            sysUserRoleList.forEach(sysUserRole -> {
+                roleSet.add(sysUserRole.getRoleId() + "");
+            });
         }
         if (user == null) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
@@ -385,8 +427,8 @@ public class SysUserFacade extends SysUserServiceImpl {
         }
 
         //添加菜单信息
-        List<SysMenuWrapper> menuList = sysMenuFacade.getByRole(user.getId(),roleSet);
-        List<SysUserPermissionDTO> sysUserPermissionDTOList = sysMenuFacade.getByRolePermission(user.getId(),roleSet);
+        List<SysMenuWrapper> menuList = sysMenuFacade.getByRole(user.getId(), roleSet);
+        List<SysUserPermissionDTO> sysUserPermissionDTOList = sysMenuFacade.getByRolePermission(user.getId(), roleSet);
         Map<Long, List<SysMenuWrapper>> menuMap = EntityUtil.makeEntityListMap(menuList, "parentId");
         Map<Long, List<SysUserPermissionDTO>> menuPermissionMap = EntityUtil.makeEntityListMap(sysUserPermissionDTOList, "menuId");
         List<SysMenuWrapper> menuRes = menuMap.get(-1L);
@@ -542,6 +584,7 @@ public class SysUserFacade extends SysUserServiceImpl {
 
         return sysUserRoleDTO;
     }
+
     /**
      * 获取用户角色
      *

+ 1 - 0
src/main/java/com/diagbot/mapper/BehospitalInfoMapper.java

@@ -12,6 +12,7 @@ import com.diagbot.vo.EntryStatisticsVO;
 import com.diagbot.vo.ExportQcresultVO;
 import com.diagbot.vo.FilterMedicalCheckVO;
 import com.diagbot.vo.FilterOrderByDeptVO;
+import com.diagbot.vo.FilterOrderPageVO;
 import com.diagbot.vo.FilterOrderVO;
 import com.diagbot.vo.FilterPageByDeptVO;
 import com.diagbot.vo.FilterPageVO;

+ 1 - 1
src/main/java/com/diagbot/service/BehospitalInfoService.java

@@ -185,7 +185,6 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
     public List<HomePageNumDTO> homePageLevelStatistics(FilterOrderVO filterOrderVO);
 
 
-
     /**
      * 病历质控报表-扣分项
      *
@@ -261,6 +260,7 @@ public interface BehospitalInfoService extends IService<BehospitalInfo> {
      */
     public List<HomePageByDeptDTO> homePageLevelStatisticsByDept(FilterOrderByDeptVO filterOrderByDeptVO);
 
+
     /**
      * 缺陷明细-科室(分页)
      *

+ 1 - 0
src/main/java/com/diagbot/service/impl/BehospitalInfoServiceImpl.java

@@ -217,6 +217,7 @@ public class BehospitalInfoServiceImpl extends ServiceImpl<BehospitalInfoMapper,
         return baseMapper.homePageLevelStatistics(filterOrderVO);
     }
 
+
     /**
      * 病历质控报表-扣分项
      *

+ 60 - 0
src/main/java/com/diagbot/util/ImageCaptchaUtil.java

@@ -0,0 +1,60 @@
+package com.diagbot.util;
+
+import com.diagbot.entity.ImageCaptchaParams;
+import org.patchca.color.SingleColorFactory;
+import org.patchca.filter.predefined.CurvesRippleFilterFactory;
+import org.patchca.font.RandomFontFactory;
+import org.patchca.service.Captcha;
+import org.patchca.service.ConfigurableCaptchaService;
+import org.patchca.word.RandomWordFactory;
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+
+/**
+ * @author huangrusheng
+ * @version 1.0
+ * @date 2021/5/20 9:54
+ */
+public class ImageCaptchaUtil {
+    private String text;
+
+    /**
+     * 以Web的img识别的base64返回
+     * @param
+     * @return 图片文字内容+base64格式的img标签识别的图片
+     * @throws IOException
+     */
+    public BufferedImage createRandom() throws IOException{
+        ImageCaptchaParams params = new ImageCaptchaParams();
+        ConfigurableCaptchaService  captchaService = new ConfigurableCaptchaService();
+        captchaService.setColorFactory(new SingleColorFactory(Color.black));
+        CurvesRippleFilterFactory curvesRippleFilterFactory = new CurvesRippleFilterFactory();
+        curvesRippleFilterFactory.setColorFactory(captchaService.getColorFactory());
+        curvesRippleFilterFactory.setStrokeMin(1);
+        curvesRippleFilterFactory.setStrokeMax(1.5f);
+        captchaService.setFilterFactory(curvesRippleFilterFactory);
+        captchaService.setHeight(params.getHeight());
+        captchaService.setWidth(params.getWidth());
+        RandomWordFactory wordFactory = new RandomWordFactory();
+        wordFactory.setCharacters(params.getWords());
+        wordFactory.setMaxLength(params.getMaxWordAmount());
+        wordFactory.setMinLength(params.getMinWordAmount());
+        captchaService.setWordFactory(wordFactory);
+        RandomFontFactory fontFactory = new RandomFontFactory();
+        fontFactory.setMaxSize(params.getMaxFontSize());
+        fontFactory.setMinSize(params.getMinFontSize());
+        captchaService.setFontFactory(fontFactory);
+        Captcha captcha = captchaService.getCaptcha();
+        this.text = captcha.getChallenge();
+        return captcha.getImage();
+    }
+
+    /**
+     * 获取验证码文本的方法
+     */
+    public String getText() {
+        return text;
+    }
+}

+ 611 - 0
src/main/java/com/diagbot/util/RedisUtils.java

@@ -0,0 +1,611 @@
+
+package com.diagbot.util;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+@Component
+public class RedisUtils {
+@Autowired
+    private RedisTemplate<String, Object> redisTemplate;
+
+    public void setRedisTemplate(RedisTemplate<String, Object> redisTemplate) {
+        this.redisTemplate = redisTemplate;
+    }
+    // =============================common============================
+
+    /**
+     * 普通缓存获取
+     *
+     * @param
+     * @return 值
+     */
+    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
+    public Set<String> keys(String pattern) {
+        return redisTemplate.keys(pattern);
+    }
+
+    /**
+     * 指定缓存失效时间
+     *
+     * @param key  键
+     * @param time 时间(秒)
+     * @return
+     */
+    public boolean expire(String key, long time) {
+        try {
+            if (time > 0) {
+                redisTemplate.expire(key, time, TimeUnit.SECONDS);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 根据key 获取过期时间
+     *
+     * @param key 键 不能为null
+     * @return 时间(秒) 返回0代表为永久有效
+     */
+    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
+    public long getExpire(String key) {
+        return redisTemplate.getExpire(key, TimeUnit.SECONDS);
+    }
+
+    /**
+     * 判断key是否存在
+     *
+     * @param key 键
+     * @return true 存在 false不存在
+     */
+    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
+    public boolean hasKey(String key) {
+        try {
+            return redisTemplate.hasKey(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 删除缓存
+     *
+     * @param key 可以传一个值 或多个
+     */
+    @SuppressWarnings("unchecked")
+    public void del(String... key) {
+        if (key != null && key.length > 0) {
+            if (key.length == 1) {
+                redisTemplate.delete(key[0]);
+            } else {
+                redisTemplate.delete(CollectionUtils.arrayToList(key));
+            }
+        }
+    }
+
+    // ============================String=============================
+
+    /**
+     * 普通缓存获取
+     *
+     * @param key 键
+     * @return 值
+     */
+    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
+    public Object get(String key) {
+        return key == null ? null : redisTemplate.opsForValue().get(key);
+    }
+
+    /**
+     * 普通缓存放入
+     *
+     * @param key   键
+     * @param value 值
+     * @return true成功 false失败
+     */
+    public boolean set(String key, Object value) {
+        try {
+            redisTemplate.opsForValue().set(key, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+
+    }
+
+    /**
+     * 普通缓存放入并设置时间
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒) time要大于0 如果time小于等于0 将设置无限期
+     * @return true成功 false 失败
+     */
+    public boolean set(String key, Object value, long time) {
+        try {
+            if (time > 0) {
+                redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
+            } else {
+                set(key, value);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 递增
+     *
+     * @param key   键
+     * @param delta 要增加几(大于0)
+     * @return
+     */
+    public long incr(String key, long delta) {
+        if (delta < 0) {
+            throw new RuntimeException("递增因子必须大于0");
+        }
+        return redisTemplate.opsForValue().increment(key, delta);
+    }
+
+    /**
+     * 递减
+     *
+     * @param key   键
+     * @param delta 要减少几(小于0)
+     * @return
+     */
+    public long decr(String key, long delta) {
+        if (delta < 0) {
+            throw new RuntimeException("递减因子必须大于0");
+        }
+        return redisTemplate.opsForValue().increment(key, -delta);
+    }
+
+    // ================================Map=================================
+
+    /**
+     * HashGet
+     *
+     * @param key  键 不能为null
+     * @param item 项 不能为null
+     * @return 值
+     */
+    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
+    public Object hget(String key, String item) {
+        return redisTemplate.opsForHash().get(key, item);
+    }
+
+    /**
+     * 获取hashKey对应的所有键值
+     *
+     * @param key 键
+     * @return 对应的多个键值
+     */
+    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
+    public Map<Object, Object> hmget(String key) {
+        return redisTemplate.opsForHash().entries(key);
+    }
+
+    /**
+     * HashSet
+     *
+     * @param key 键
+     * @param map 对应多个键值
+     * @return true 成功 false 失败
+     */
+    public boolean hmset(String key, Map<String, Object> map) {
+        try {
+            redisTemplate.opsForHash().putAll(key, map);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * HashSet 并设置时间
+     *
+     * @param key  键
+     * @param map  对应多个键值
+     * @param time 时间(秒)
+     * @return true成功 false失败
+     */
+    public boolean hmset(String key, Map<String, Object> map, long time) {
+        try {
+            redisTemplate.opsForHash().putAll(key, map);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 向一张hash表中放入数据,如果不存在将创建
+     *
+     * @param key   键
+     * @param item  项
+     * @param value 值
+     * @return true 成功 false失败
+     */
+    public boolean hset(String key, String item, Object value) {
+        try {
+            redisTemplate.opsForHash().put(key, item, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 向一张hash表中放入数据,如果不存在将创建
+     *
+     * @param key   键
+     * @param item  项
+     * @param value 值
+     * @param time  时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间
+     * @return true 成功 false失败
+     */
+    public boolean hset(String key, String item, Object value, long time) {
+        try {
+            redisTemplate.opsForHash().put(key, item, value);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 删除hash表中的值
+     *
+     * @param key  键 不能为null
+     * @param item 项 可以使多个 不能为null
+     */
+    public void hdel(String key, Object... item) {
+        redisTemplate.opsForHash().delete(key, item);
+    }
+
+    /**
+     * 判断hash表中是否有该项的值
+     *
+     * @param key  键 不能为null
+     * @param item 项 不能为null
+     * @return true 存在 false不存在
+     */
+    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
+    public boolean hHasKey(String key, String item) {
+        return redisTemplate.opsForHash().hasKey(key, item);
+    }
+
+    /**
+     * hash递增 如果不存在,就会创建一个 并把新增后的值返回
+     *
+     * @param key  键
+     * @param item 项
+     * @param by   要增加几(大于0)
+     * @return
+     */
+    public double hincr(String key, String item, double by) {
+        return redisTemplate.opsForHash().increment(key, item, by);
+    }
+
+    /**
+     * hash递减
+     *
+     * @param key  键
+     * @param item 项
+     * @param by   要减少记(小于0)
+     * @return
+     */
+    public double hdecr(String key, String item, double by) {
+        return redisTemplate.opsForHash().increment(key, item, -by);
+    }
+
+    // ============================set=============================
+
+    /**
+     * 根据key获取Set中的所有值
+     *
+     * @param key 键
+     * @return
+     */
+    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
+    public Set<Object> sGet(String key) {
+        try {
+            return redisTemplate.opsForSet().members(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * 根据value从一个set中查询,是否存在
+     *
+     * @param key   键
+     * @param value 值
+     * @return true 存在 false不存在
+     */
+    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
+    public boolean sHasKey(String key, Object value) {
+        try {
+            return redisTemplate.opsForSet().isMember(key, value);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 将数据放入set缓存
+     *
+     * @param key    键
+     * @param values 值 可以是多个
+     * @return 成功个数
+     */
+    public long sSet(String key, Object... values) {
+        try {
+            return redisTemplate.opsForSet().add(key, values);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    /**
+     * 将set数据放入缓存
+     *
+     * @param key    键
+     * @param time   时间(秒)
+     * @param values 值 可以是多个
+     * @return 成功个数
+     */
+    public long sSetAndTime(String key, long time, Object... values) {
+        try {
+            Long count = redisTemplate.opsForSet().add(key, values);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return count;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    /**
+     * 获取set缓存的长度
+     *
+     * @param key 键
+     * @return
+     */
+    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
+    public long sGetSetSize(String key) {
+        try {
+            return redisTemplate.opsForSet().size(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    /**
+     * 移除值为value的
+     *
+     * @param key    键
+     * @param values 值 可以是多个
+     * @return 移除的个数
+     */
+    public long setRemove(String key, Object... values) {
+        try {
+            Long count = redisTemplate.opsForSet().remove(key, values);
+            return count;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+    // ===============================list=================================
+
+    /**
+     * 获取list缓存的内容
+     *
+     * @param key   键
+     * @param start 开始
+     * @param end   结束 0 到 -1代表所有值
+     * @return
+     */
+    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
+    public List<Object> lGet(String key, long start, long end) {
+        try {
+            return redisTemplate.opsForList().range(key, start, end);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * 获取list缓存的长度
+     *
+     * @param key 键
+     * @return
+     */
+    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
+    public long lGetListSize(String key) {
+        try {
+            return redisTemplate.opsForList().size(key);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    /**
+     * 通过索引 获取list中的值
+     *
+     * @param key   键
+     * @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推
+     * @return
+     */
+    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
+    public Object lGetIndex(String key, long index) {
+        try {
+            return redisTemplate.opsForList().index(key, index);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒)
+     * @return
+     */
+    public boolean lSet(String key, Object value) {
+        try {
+            redisTemplate.opsForList().rightPush(key, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒)
+     * @return
+     */
+    public boolean lSet(String key, Object value, long time) {
+        try {
+            redisTemplate.opsForList().rightPush(key, value);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒)
+     * @return
+     */
+    public boolean lSet(String key, List<Object> value) {
+        try {
+            redisTemplate.opsForList().rightPushAll(key, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 将list放入缓存
+     *
+     * @param key   键
+     * @param value 值
+     * @param time  时间(秒)
+     * @return
+     */
+    public boolean lSet(String key, List<Object> value, long time) {
+        try {
+            redisTemplate.opsForList().rightPushAll(key, value);
+            if (time > 0) {
+                expire(key, time);
+            }
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 根据索引修改list中的某条数据
+     *
+     * @param key   键
+     * @param index 索引
+     * @param value 值
+     * @return
+     */
+    public boolean lUpdateIndex(String key, long index, Object value) {
+        try {
+            redisTemplate.opsForList().set(key, index, value);
+            return true;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    /**
+     * 移除N个值为value
+     *
+     * @param key   键
+     * @param count 移除多少个
+     * @param value 值
+     * @return 移除的个数
+     */
+    public long lRemove(String key, long count, Object value) {
+        try {
+            Long remove = redisTemplate.opsForList().remove(key, count, value);
+            return remove;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return 0;
+        }
+    }
+
+    /**
+     * 按键的排序获取对应的值
+     *
+     * @param keys 多个键
+     * @return List<Object>
+     */
+    @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW)
+    public List<Object> mget(Collection<String> keys) {
+        return redisTemplate.opsForValue().multiGet(keys);
+    }
+
+}

+ 57 - 0
src/main/java/com/diagbot/vo/FilterOrderPageVO.java

@@ -0,0 +1,57 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/5/19 13:39
+ */
+@Getter
+@Setter
+public class FilterOrderPageVO extends Page {
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(hidden = true)
+    private String hospitalId;
+    /**
+     * 医生id
+     */
+    @ApiModelProperty(hidden = true)
+    private Long userId;
+    /**
+     * 科室名称
+     */
+    private String deptName;
+
+    /**
+     * 医生名称
+     */
+    private String doctorName;
+    private String isPlacefile;
+    /**
+     * 医生Id
+     */
+    private String doctorId;
+
+    /**
+     * 医生职称
+     */
+    private String professor;
+    /**
+     * 起始时间
+     */
+    @NotBlank(message = "请输入起始时间")
+    private String startDate;
+    /**
+     * 结束时间
+     */
+    @NotBlank(message = "请输入结束时间")
+    private String endDate;
+}

+ 15 - 0
src/main/java/com/diagbot/vo/FilterPageVO.java

@@ -51,6 +51,21 @@ public class FilterPageVO extends Page {
      */
     private String deptName;
 
+    /**
+     * 科室id
+     */
+    private String deptId;
+
+    /**
+     * 医生姓名
+     */
+    private String doctorName;
+
+    /**
+     * 医生id
+     */
+    private String doctorId;
+
     /**
      * 模块id:243=病案首页
      */

+ 5 - 0
src/main/java/com/diagbot/vo/FilterVO.java

@@ -62,6 +62,11 @@ public class FilterVO {
     //科室名称
     private String deptName;
 
+    /**
+     * 科室分类
+     */
+    private String deptId;
+
     private String level;
     /**
      * 是否归档(0:未归档,1:已归档)

+ 5 - 0
src/main/java/com/diagbot/vo/QcResultPageVO.java

@@ -66,6 +66,11 @@ public class QcResultPageVO extends Page {
      */
     private String deptClass;
 
+    /**
+     * 科室id
+     */
+    private String deptId;
+
     /**
      * 医生姓名
      */

+ 5 - 0
src/main/java/com/diagbot/vo/QcResultShortPageVO.java

@@ -64,6 +64,11 @@ public class QcResultShortPageVO extends Page {
      * 科室名称
      */
     private String deptName;
+
+    /**
+     * 科室id
+     */
+    private String deptId;
     /**
      * 医生姓名
      */

+ 2 - 1
src/main/java/com/diagbot/vo/UserLoginVO.java

@@ -18,5 +18,6 @@ public class UserLoginVO {
     private String username;
     @NotBlank(message = "请输入密码!")
     private String password;
-
+   //验证码
+    private String captcha;
 }

+ 1 - 0
src/main/java/com/diagbot/web/ConsoleByDeptController.java

@@ -230,6 +230,7 @@ public class ConsoleByDeptController {
     public RespDTO<List<HomePageByDeptDTO>> homePageLevelStatisticsByDept(@RequestBody @Valid FilterOrderByDeptVO filterOrderByDeptVO) {
         return RespDTO.onSuc(consoleByDeptFacade.homePageLevelStatisticsByDept(filterOrderByDeptVO));
     }
+
     /**
      * 病案首页合格/不合格数
      *

+ 1 - 0
src/main/java/com/diagbot/web/ConsoleController.java

@@ -474,6 +474,7 @@ public class ConsoleController {
         return RespDTO.onSuc(consoleFacade.homePageLevelStatistics(filterOrderVO));
     }
 
+
     /**
      * 病历质控报表
      *

+ 0 - 1
src/main/java/com/diagbot/web/ConsoleExportController.java

@@ -50,7 +50,6 @@ public class ConsoleExportController {
         consoleExportFacade.homePageLevelExport(response, filterOrderVO);
     }
 
-
     /**
      * 条目缺陷占比(内页)
      *

+ 14 - 2
src/main/java/com/diagbot/web/SysUserController.java

@@ -24,13 +24,18 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.oauth2.common.OAuth2AccessToken;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import springfox.documentation.annotations.ApiIgnore;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
+import java.io.IOException;
+
 
 /**
  * @Description: 用户账号API
@@ -64,11 +69,18 @@ public class SysUserController {
                     "password:密码, 必填, 默认密码:a123456<br> ")
     @PostMapping("/getJwt")
     @SysLogger("getJwt")
-    public RespDTO<JwtDTO> getJwt(@RequestBody UserLoginVO userLoginVO) {
-        JwtDTO data = userFacade.getJwt(userLoginVO.getUsername(), userLoginVO.getPassword());
+    public RespDTO<JwtDTO> getJwt(HttpServletRequest request,@RequestBody UserLoginVO userLoginVO) {
+        JwtDTO data = userFacade.getJwt(request,userLoginVO.getUsername(), userLoginVO.getPassword(),userLoginVO.getCaptcha());
         return RespDTO.onSuc(data);
     }
 
+    @ApiOperation(value = "获取验证码[by:cy]")
+    @GetMapping("/getCaptcha")
+    @SysLogger("getCaptcha")
+    public void getCaptcha(HttpServletRequest request, HttpServletResponse response) throws IOException {
+           userFacade.getCaptcha(request, response);
+    }
+
     @ApiOperation(value = "获取标识--选择登录页面[by:cy]")
     @PostMapping("/getHospitalMark")
     @SysLogger("getHospitalMark")

+ 1 - 1
src/main/resources/application-local.yml

@@ -59,7 +59,7 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.236:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      url: jdbc:mysql://192.168.2.237:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
       username: root
       password: lantone
       # 连接池的配置信息

+ 3 - 3
src/main/resources/application-pre.yml

@@ -59,9 +59,9 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.121:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
-      username: teamback
-      password: goTulmLeon
+      url: jdbc:mysql://192.168.2.125:3307/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      username: root
+      password: LangT0ng@lt
       # 连接池的配置信息
       # 初始化大小,最小,最大
       initialSize: 5

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -2,7 +2,7 @@ spring:
   application:
     name: mrqc-sys
   profiles:
-    active: test
+    active: local
   main:
     allow-bean-definition-overriding: true
 

+ 69 - 44
src/main/resources/mapper/BehospitalInfoMapper.xml

@@ -3375,6 +3375,7 @@
         </if>
     </select>
 
+
     <!-- 各科室缺陷占比-科室 -->
     <select id="levelStatisticsByDept" parameterType="com.diagbot.vo.FilterOrderByDeptVO"
             resultType="com.diagbot.dto.LevelStsByDeptDTO">
@@ -3870,6 +3871,15 @@
         <if test="deptName!=null and deptName !=''">
             AND a.beh_dept_name = #{deptName}
         </if>
+        <if test="deptId!=null and deptId !=''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        <if test="doctorId != null and doctorId != ''">
+            AND a.doctor_id  = #{doctorId}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            AND a.doctor_name  like CONCAT('%', #{doctorName}, '%')
+        </if>
         <if test="name != null and name != ''">
             AND a.doctor_name  like CONCAT('%', #{name}, '%')
         </if>
@@ -3943,6 +3953,15 @@
         <if test="deptName!=null and deptName !=''">
             AND a.beh_dept_name = #{deptName}
         </if>
+        <if test="deptId!=null and deptId !=''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        <if test="doctorId != null and doctorId != ''">
+            AND a.doctor_id  = #{doctorId}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            AND a.doctor_name  like CONCAT('%', #{doctorName}, '%')
+        </if>
         <if test="name != null and name != ''">
             AND a.doctor_name  like CONCAT('%', #{name}, '%')
         </if>
@@ -4032,6 +4051,15 @@
         <if test="deptName!=null and deptName !=''">
             AND a.beh_dept_name = #{deptName}
         </if>
+        <if test="deptId!=null and deptId !=''">
+            AND a.beh_dept_id = #{deptId}
+        </if>
+        <if test="doctorId != null and doctorId != ''">
+            AND a.doctor_id  = #{doctorId}
+        </if>
+        <if test="doctorName != null and doctorName != ''">
+            AND a.doctor_name  like CONCAT('%', #{doctorName}, '%')
+        </if>
         <if test="name != null and name != ''">
             AND a.doctor_name  like CONCAT('%', #{name}, '%')
         </if>
@@ -5491,6 +5519,9 @@
         <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
             AND a.beh_dept_name = #{qcResultShortPageVO.deptName}
         </if>
+        <if test="qcResultShortPageVO.deptId != null and qcResultShortPageVO.deptId != ''">
+            AND a.beh_dept_id = #{qcResultShortPageVO.deptId}
+        </if>
         <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
             AND b.`level` = #{qcResultShortPageVO.level}
         </if>
@@ -5513,9 +5544,7 @@
             AND d.cases_id = #{qcResultShortPageVO.casesId}
         </if>
         <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
-            AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
+            AND a.doctor_id = #{qcResultShortPageVO.doctorId}
         </if>
         <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
             AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
@@ -9574,13 +9603,11 @@
         <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
             AND a.beh_dept_name = #{qcResultShortPageVO.deptName}
         </if>
-        <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
-            AND a.doctor_name = #{qcResultShortPageVO.doctorName}
+        <if test="qcResultShortPageVO.deptId != null and qcResultShortPageVO.deptId != ''">
+            AND a.beh_dept_id = #{qcResultShortPageVO.deptId}
         </if>
         <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
-            AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
+            AND a.doctor_id = #{qcResultShortPageVO.doctorId}
         </if>
         <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
             AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
@@ -9845,6 +9872,9 @@
         <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
             AND a.beh_dept_name = #{qcResultShortPageVO.deptName}
         </if>
+        <if test="qcResultShortPageVO.deptId != null and qcResultShortPageVO.deptId != ''">
+            AND a.beh_dept_id = #{qcResultShortPageVO.deptId}
+        </if>
         <if test="qcResultShortPageVO.level != null and qcResultShortPageVO.level != ''">
             AND b.`level` = #{qcResultShortPageVO.level}
         </if>
@@ -9867,9 +9897,7 @@
             AND d.cases_id = #{qcResultShortPageVO.casesId}
         </if>
         <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
-            AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
+            AND a.doctor_id = #{qcResultShortPageVO.doctorId}
         </if>
         <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
             AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
@@ -11205,6 +11233,9 @@
         <if test="deptClass != null and deptClass != ''">
             and a.beh_dept_id = #{deptClass}
         </if>
+        <if test="deptId != null and deptId != ''">
+            and a.beh_dept_id = #{deptId}
+        </if>
         <if test="titleName != null and titleName != '' ">
             <if test="titleName == '不合格数'">
                 AND e.`level`='不合格'
@@ -11217,7 +11248,9 @@
             and a.is_placefile = #{isPlacefile}
         </if>
         <if test="doctorName != null and doctorName != ''">
-            AND a.doctor_name like CONCAT('%', #{doctorName}, '%')
+            AND (a.doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
+            OR a.beh_doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
+            OR a.director_doctor_name LIKE CONCAT( '%', #{doctorName}, '%'))
         </if>
         <if test="hospitalId != null and hospitalId != ''">
             AND a.hospital_id = #{hospitalId}
@@ -11248,9 +11281,7 @@
             AND a.NAME LIKE CONCAT( '%', #{patName}, '%' )
         </if>
         <if test="doctorId != null and doctorId != ''">
-            AND (a.doctor_id LIKE CONCAT( '%', #{doctorId}, '%' )
-            OR a.beh_doctor_id LIKE CONCAT( '%', #{doctorId}, '%' )
-            OR a.director_doctor_id LIKE CONCAT( '%', #{doctorId}, '%' ))
+            AND a.doctor_id = #{doctorId}
         </if>
         )be
         left join med_check_info mci
@@ -11304,14 +11335,6 @@
         AND d.cases_entry_id = e.id
         AND d.cases_id = 243
         AND a.qc_type_id != 0
-        <!--        <if test="titleName != null ">-->
-        <!--            <if test="titleName == '不合格数'">-->
-        <!--                AND c.`level`='不合格'-->
-        <!--            </if>-->
-        <!--            <if test="titleName == '合格数'">-->
-        <!--                AND c.`level`='合格'-->
-        <!--            </if>-->
-        <!--        </if>-->
         <if test="userId!=null">
             AND b.user_id = #{userId}
         </if>
@@ -11319,11 +11342,19 @@
             and a.beh_dept_name = #{deptName}
         </if>
         <if test="doctorName != null and doctorName != ''">
-            AND a.doctor_name like CONCAT('%', #{doctorName}, '%')
+            AND (a.doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
+            OR a.beh_doctor_name LIKE CONCAT( '%', #{doctorName}, '%' )
+            OR a.director_doctor_name LIKE CONCAT( '%', #{doctorName}, '%'))
+        </if>
+        <if test="doctorId != null and doctorId != ''">
+            AND a.doctor_id = #{doctorId}
         </if>
         <if test="deptClass != null and deptClass != ''">
             and a.beh_dept_id = #{deptClass}
         </if>
+        <if test="deptId != null and deptId != ''">
+            and a.beh_dept_id = #{deptId}
+        </if>
         <if test="isPlacefile != null and isPlacefile != ''">
             and a.is_placefile = #{isPlacefile}
         </if>
@@ -11508,6 +11539,9 @@
         <if test="qcResultPageVO.deptName != null and qcResultPageVO.deptName != ''">
             AND a.beh_dept_name = #{qcResultPageVO.deptName}
         </if>
+        <if test="qcResultPageVO.deptId != null and qcResultPageVO.deptId != ''">
+            AND a.beh_dept_id = #{qcResultPageVO.deptId}
+        </if>
         <if test="qcResultPageVO.behospitalCode != null and qcResultPageVO.behospitalCode != ''">
             AND a.behospital_code LIKE CONCAT( '%', #{qcResultPageVO.behospitalCode}, '%' )
         </if>
@@ -11608,6 +11642,9 @@
         <if test="qcResultPageVO.deptName != null and qcResultPageVO.deptName != ''">
             AND a.beh_dept_name LIKE CONCAT( '%', #{qcResultPageVO.deptName}, '%' )
         </if>
+        <if test="qcResultPageVO.deptId != null and qcResultPageVO.deptId != ''">
+            AND a.beh_dept_id = #{qcResultPageVO.deptId}
+        </if>
         <if test="qcResultPageVO.behospitalCode != null and qcResultPageVO.behospitalCode != ''">
             AND a.behospital_code LIKE CONCAT( '%', #{qcResultPageVO.behospitalCode}, '%' )
         </if>
@@ -12678,9 +12715,6 @@
                 AND c.`level`='合格'
             </if>
         </if>
-        <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
-            AND a.doctor_name  like CONCAT('%', #{qcResultShortPageVO.doctorName}, '%')
-        </if>
         <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
             and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
         </if>
@@ -12709,6 +12743,9 @@
         <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
             AND a.beh_dept_name LIKE CONCAT( '%', #{qcResultShortPageVO.deptName}, '%' )
         </if>
+        <if test="qcResultShortPageVO.deptId != null and qcResultShortPageVO.deptId != ''">
+            AND a.beh_dept_id = #{qcResultShortPageVO.deptId}
+        </if>
         <if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
             AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
         </if>
@@ -12716,9 +12753,7 @@
             AND a.NAME LIKE CONCAT( '%', #{qcResultShortPageVO.patName}, '%' )
         </if>
         <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
-            AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
+            AND a.doctor_id = #{qcResultShortPageVO.doctorId}
         </if>
         <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
             AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )
@@ -12899,21 +12934,10 @@
         AND c.cases_id = k.cases_id
         AND k.cases_id = d.cases_id
         AND k.cases_entry_id = d.id
-        <!--        <if test="qcResultShortPageVO.titleName != null ">-->
-        <!--            <if test="qcResultShortPageVO.titleName == '不合格数'">-->
-        <!--                AND c.`level`='不合格'-->
-        <!--            </if>-->
-        <!--            <if test="qcResultShortPageVO.titleName == '合格数'">-->
-        <!--                AND c.`level`='合格'-->
-        <!--            </if>-->
-        <!--        </if>-->
         AND a.qc_type_id != 0
         <if test="qcResultShortPageVO.userId!=null">
             AND b.user_id = #{qcResultShortPageVO.userId}
         </if>
-        <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
-            and a.doctor_name = #{qcResultShortPageVO.doctorName}
-        </if>
         <if test="qcResultShortPageVO.isPlacefile != null and qcResultShortPageVO.isPlacefile != ''">
             and a.is_placefile = #{qcResultShortPageVO.isPlacefile}
         </if>
@@ -12942,6 +12966,9 @@
         <if test="qcResultShortPageVO.deptName != null and qcResultShortPageVO.deptName != ''">
             AND a.beh_dept_name LIKE CONCAT( '%', #{qcResultShortPageVO.deptName}, '%' )
         </if>
+        <if test="qcResultShortPageVO.deptId != null and qcResultShortPageVO.deptId != ''">
+            AND a.beh_dept_id = #{qcResultShortPageVO.deptId}
+        </if>
         <if test="qcResultShortPageVO.behospitalCode != null and qcResultShortPageVO.behospitalCode != ''">
             AND a.behospital_code LIKE CONCAT( '%', #{qcResultShortPageVO.behospitalCode}, '%' )
         </if>
@@ -12952,9 +12979,7 @@
             AND d.NAME = #{qcResultShortPageVO.casesEntryName}
         </if>
         <if test="qcResultShortPageVO.doctorId != null and qcResultShortPageVO.doctorId != ''">
-            AND (a.doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.beh_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' )
-            OR a.director_doctor_id LIKE CONCAT( '%', #{qcResultShortPageVO.doctorId}, '%' ))
+            AND a.doctor_id = #{qcResultShortPageVO.doctorId}
         </if>
         <if test="qcResultShortPageVO.doctorName != null and qcResultShortPageVO.doctorName != ''">
             AND (a.doctor_name LIKE CONCAT( '%', #{qcResultShortPageVO.doctorName}, '%' )

+ 24 - 0
src/main/resources/mapper/QcresultInfoMapper.xml

@@ -1683,6 +1683,12 @@
         <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
             AND a.beh_dept_name = #{filterPageVO.deptName}
         </if>
+        <if test="filterPageVO.deptId != null and filterPageVO.deptId != ''">
+            AND a.beh_dept_id = #{filterPageVO.deptId}
+        </if>
+        <if test="filterPageVO.doctorName != null and filterPageVO.doctorName != ''">
+            AND a.doctor_name = #{filterPageVO.doctorName}
+        </if>
         <if test="filterPageVO.casesId != null and filterPageVO.casesId != 0">
             AND d.cases_id = #{filterPageVO.casesId}
         </if>
@@ -1745,9 +1751,15 @@
                 <![CDATA[ AND a.leave_hospital_date <= #{filterPageVO.endDate}]]>
             </if>
         </if>
+        <if test="filterPageVO.doctorName != null and filterPageVO.doctorName != ''">
+            AND a.doctor_name = #{filterPageVO.doctorName}
+        </if>
         <if test="filterPageVO.deptName != null and filterPageVO.deptName != ''">
             AND a.beh_dept_name  =  #{filterPageVO.deptName}
         </if>
+        <if test="filterPageVO.deptId != null and filterPageVO.deptId != ''">
+            AND a.beh_dept_id = #{filterPageVO.deptId}
+        </if>
         <if test="filterPageVO.isReject != null">
             AND d.is_reject = #{filterPageVO.isReject}
         </if>
@@ -2122,6 +2134,12 @@
         <if test="filterPageByDeptVO.deptName != null and filterPageByDeptVO.deptName != ''">
             AND a.beh_dept_name = #{filterPageByDeptVO.deptName}
         </if>
+        <if test="filterPageByDeptVO.deptId != null and filterPageByDeptVO.deptId != ''">
+            AND a.beh_dept_id = #{filterPageByDeptVO.deptId}
+        </if>
+        <if test="filterPageByDeptVO.doctorId != null and filterPageByDeptVO.doctorId != ''">
+            AND a.doctor_id = #{filterPageByDeptVO.doctorId}
+        </if>
         <if test="filterPageByDeptVO.doctorName != null and filterPageByDeptVO.doctorName != ''">
             AND a.doctor_name  like CONCAT('%', #{filterPageByDeptVO.doctorName}, '%')
         </if>
@@ -2200,6 +2218,12 @@
         <if test="filterPageByDeptVO.doctorName != null and filterPageByDeptVO.doctorName != ''">
             AND a.doctor_name  like CONCAT('%', #{filterPageByDeptVO.doctorName}, '%')
         </if>
+        <if test="filterPageByDeptVO.deptId != null and filterPageByDeptVO.deptId != ''">
+            AND a.beh_dept_id = #{filterPageByDeptVO.deptId}
+        </if>
+        <if test="filterPageByDeptVO.doctorId != null and filterPageByDeptVO.doctorId != ''">
+            AND a.doctor_id = #{filterPageByDeptVO.doctorId}
+        </if>
         <if test="filterPageByDeptVO.isReject != null">
             AND d.is_reject = #{filterPageByDeptVO.isReject}
         </if>