gaodm 5 年 前
コミット
0c84394b78

+ 17 - 14
src/main/java/com/diagbot/facade/BasDeptInfoFacade.java

@@ -1,15 +1,11 @@
 package com.diagbot.facade;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.diagbot.dto.BasDeptInfoDTO;
-import com.diagbot.entity.BasDeptInfo;
 import com.diagbot.service.impl.BasDeptInfoServiceImpl;
-import com.diagbot.util.BeanUtil;
-import com.diagbot.util.ListUtil;
 import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.BasDeptInfoVO;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -25,15 +21,22 @@ public class BasDeptInfoFacade extends BasDeptInfoServiceImpl {
      *
      * @return
      */
-    public List<BasDeptInfoDTO> listForUser() {
-        List<BasDeptInfoDTO> basDeptInfoDTOList = new ArrayList<>();
-        List<BasDeptInfo> basDeptInfoList = this.list(new QueryWrapper<BasDeptInfo>()
-                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
-                .eq("station", "住院")
-        );
-        if (ListUtil.isNotEmpty(basDeptInfoList)) {
-            basDeptInfoDTOList = BeanUtil.listCopyTo(basDeptInfoList, BasDeptInfoDTO.class);
-        }
+    public List<BasDeptInfoDTO> listForUser(BasDeptInfoVO basDeptInfoVO) {
+        basDeptInfoVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        List<BasDeptInfoDTO> basDeptInfoDTOList = this.getList(basDeptInfoVO);
+        return basDeptInfoDTOList;
+    }
+
+
+    /**
+     * 获取医院用户下拉列表信息
+     *
+     * @return
+     */
+    public List<BasDeptInfoDTO> getListUserFac(BasDeptInfoVO basDeptInfoVO) {
+        basDeptInfoVO.setUseId(Long.valueOf(SysUserUtils.getCurrentPrincipleID()));
+        basDeptInfoVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        List<BasDeptInfoDTO> basDeptInfoDTOList = this.getListUser(basDeptInfoVO);
         return basDeptInfoDTOList;
     }
 }

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

@@ -37,6 +37,7 @@ import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.BasDeptInfoVO;
 import com.diagbot.vo.SysUserBaseVO;
 import com.diagbot.vo.SysUserDeptVO;
 import com.diagbot.vo.SysUserQueryVO;
@@ -357,7 +358,8 @@ public class SysUserFacade extends SysUserServiceImpl {
         checkUser(sysUserBaseVO.getUserId());
         SysUserDeptDTO sysUserDeptDTO = new SysUserDeptDTO();
         sysUserDeptDTO.setUserId(sysUserBaseVO.getUserId());
-        List<BasDeptInfoDTO> basDeptInfoDTOList = basDeptInfoFacade.listForUser();
+        BasDeptInfoVO basDeptInfoVO = new BasDeptInfoVO();
+        List<BasDeptInfoDTO> basDeptInfoDTOList = basDeptInfoFacade.listForUser(basDeptInfoVO);
         List<SysUserDept> sysUserDeptList
                 = sysUserDeptService.list(new QueryWrapper<SysUserDept>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())

+ 7 - 1
src/main/java/com/diagbot/mapper/BasDeptInfoMapper.java

@@ -1,7 +1,11 @@
 package com.diagbot.mapper;
 
-import com.diagbot.entity.BasDeptInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.diagbot.dto.BasDeptInfoDTO;
+import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.vo.BasDeptInfoVO;
+
+import java.util.List;
 
 /**
  * <p>
@@ -12,5 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @since 2020-04-27
  */
 public interface BasDeptInfoMapper extends BaseMapper<BasDeptInfo> {
+    List<BasDeptInfoDTO> getList(BasDeptInfoVO basDeptInfoVO);
 
+    List<BasDeptInfoDTO> getListUser(BasDeptInfoVO basDeptInfoVO);
 }

+ 6 - 0
src/main/java/com/diagbot/service/BasDeptInfoService.java

@@ -1,7 +1,11 @@
 package com.diagbot.service;
 
+import com.diagbot.dto.BasDeptInfoDTO;
 import com.diagbot.entity.BasDeptInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.vo.BasDeptInfoVO;
+
+import java.util.List;
 
 /**
  * <p>
@@ -12,5 +16,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  * @since 2020-04-27
  */
 public interface BasDeptInfoService extends IService<BasDeptInfo> {
+    List<BasDeptInfoDTO> getList(BasDeptInfoVO basDeptInfoVO);
 
+    List<BasDeptInfoDTO> getListUser(BasDeptInfoVO basDeptInfoVO);
 }

+ 13 - 0
src/main/java/com/diagbot/service/impl/BasDeptInfoServiceImpl.java

@@ -1,11 +1,15 @@
 package com.diagbot.service.impl;
 
+import com.diagbot.dto.BasDeptInfoDTO;
 import com.diagbot.entity.BasDeptInfo;
 import com.diagbot.mapper.BasDeptInfoMapper;
 import com.diagbot.service.BasDeptInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.vo.BasDeptInfoVO;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 医院科室信息 服务实现类
@@ -17,4 +21,13 @@ import org.springframework.stereotype.Service;
 @Service
 public class BasDeptInfoServiceImpl extends ServiceImpl<BasDeptInfoMapper, BasDeptInfo> implements BasDeptInfoService {
 
+    @Override
+    public List<BasDeptInfoDTO> getList(BasDeptInfoVO basDeptInfoVO){
+        return baseMapper.getList(basDeptInfoVO);
+    }
+
+    @Override
+    public List<BasDeptInfoDTO> getListUser(BasDeptInfoVO basDeptInfoVO){
+        return baseMapper.getListUser(basDeptInfoVO);
+    }
 }

+ 24 - 0
src/main/java/com/diagbot/vo/BasDeptInfoVO.java

@@ -0,0 +1,24 @@
+package com.diagbot.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/4/29 11:28
+ */
+@Getter
+@Setter
+public class BasDeptInfoVO {
+    /**
+     * 搜索参数
+     */
+    private String inputStr;
+
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+    @ApiModelProperty(hidden = true)
+    private Long useId;
+}

+ 0 - 14
src/main/java/com/diagbot/vo/SysRoleQueryVO.java

@@ -1,14 +0,0 @@
-package com.diagbot.vo;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @Description:
- * @author: gaodm
- * @time: 2020/4/27 11:09
- */
-@Getter
-@Setter
-public class SysRoleQueryVO {
-}

+ 22 - 8
src/main/java/com/diagbot/web/BasDeptInfoController.java

@@ -4,17 +4,14 @@ package com.diagbot.web;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.BasDeptInfoDTO;
 import com.diagbot.dto.RespDTO;
-import com.diagbot.dto.SysRoleDTO;
 import com.diagbot.facade.BasDeptInfoFacade;
-import com.diagbot.vo.SysRoleQueryVO;
+import com.diagbot.vo.BasDeptInfoVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
@@ -35,11 +32,28 @@ public class BasDeptInfoController {
     @Autowired
     private BasDeptInfoFacade basDeptInfoFacade;
 
-    @ApiOperation(value = "获取医院科室下拉列表信息[by:gaodm]",
-            notes = "")
+    @ApiOperation(value = "获取用户管理下医院科室下拉列表信息[by:gaodm]",
+            notes = "inputStr: 搜索参数")
     @PostMapping("/listForUser")
     @SysLogger("listForUser")
-    public RespDTO<List<BasDeptInfoDTO>> listForUser() {
-        return RespDTO.onSuc(basDeptInfoFacade.listForUser());
+    public RespDTO<List<BasDeptInfoDTO>> listForUser(@RequestBody BasDeptInfoVO basDeptInfoVO) {
+        return RespDTO.onSuc(basDeptInfoFacade.listForUser(basDeptInfoVO));
+    }
+
+
+    @ApiOperation(value = "获取病历质控一览下医院科室下拉列表信息[by:gaodm]",
+            notes = "inputStr: 搜索参数")
+    @PostMapping("/getList")
+    @SysLogger("getList")
+    public RespDTO<List<BasDeptInfoDTO>> getList(@RequestBody BasDeptInfoVO basDeptInfoVO) {
+        return RespDTO.onSuc(basDeptInfoFacade.listForUser(basDeptInfoVO));
+    }
+
+    @ApiOperation(value = "获取病历质控一览下用户科室下拉列表信息[by:gaodm]",
+            notes = "inputStr: 搜索参数")
+    @PostMapping("/getListUser")
+    @SysLogger("getListUser")
+    public RespDTO<List<BasDeptInfoDTO>> getListUser(@RequestBody BasDeptInfoVO basDeptInfoVO) {
+        return RespDTO.onSuc(basDeptInfoFacade.getListUserFac(basDeptInfoVO));
     }
 }

+ 28 - 0
src/main/java/com/diagbot/web/BehospitalInfoController.java

@@ -136,4 +136,32 @@ public class BehospitalInfoController {
         behospitalInfoFacade.execute();
         return RespDTO.onSuc(true);
     }
+
+    @ApiOperation(value = "病历分页列表(科室)[by:zhoutg]",
+            notes = "name:姓名<br>" +
+                    "fileCode:档案号<br>" +
+                    "behosDateStart:入院时间开始时间<br>" +
+                    "behosDateEnd:入院时间结束时间<br>" +
+                    "leaveHosDateStart:出院时间开始时间<br>" +
+                    "leaveHosDateEnd:出院时间结束时间<br>")
+    @PostMapping("/page_dept")
+    @SysLogger("page_dept")
+    public RespDTO<IPage<BehospitalInfoDTO>> pageDept(@RequestBody BehospitalPageVO behospitalPageVO) {
+        IPage<BehospitalInfoDTO> data = behospitalInfoFacade.pageFac(behospitalPageVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "病历分页列表(个人)[by:zhoutg]",
+            notes = "name:姓名<br>" +
+                    "fileCode:档案号<br>" +
+                    "behosDateStart:入院时间开始时间<br>" +
+                    "behosDateEnd:入院时间结束时间<br>" +
+                    "leaveHosDateStart:出院时间开始时间<br>" +
+                    "leaveHosDateEnd:出院时间结束时间<br>")
+    @PostMapping("/page_person")
+    @SysLogger("page_person")
+    public RespDTO<IPage<BehospitalInfoDTO>> pagePerson(@RequestBody BehospitalPageVO behospitalPageVO) {
+        IPage<BehospitalInfoDTO> data = behospitalInfoFacade.pageFac(behospitalPageVO);
+        return RespDTO.onSuc(data);
+    }
 }

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

@@ -7,7 +7,6 @@ import com.diagbot.dto.SysRoleMenuDTO;
 import com.diagbot.facade.SysRoleFacade;
 import com.diagbot.vo.SysRoleMenuQueryVO;
 import com.diagbot.vo.SysRoleMenuSaveVO;
-import com.diagbot.vo.SysRoleQueryVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;

+ 48 - 13
src/main/resources/mapper/BasDeptInfoMapper.xml

@@ -1,21 +1,56 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.diagbot.mapper.BasDeptInfoMapper">
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.diagbot.entity.BasDeptInfo">
-        <id column="dept_id" property="deptId" />
-        <result column="hospital_id" property="hospitalId" />
-        <result column="parent_dept_id" property="parentDeptId" />
-        <result column="dept_name" property="deptName" />
-        <result column="dept_type" property="deptType" />
-        <result column="spell" property="spell" />
-        <result column="station" property="station" />
-        <result column="is_deleted" property="isDeleted" />
-        <result column="gmt_create" property="gmtCreate" />
-        <result column="gmt_modified" property="gmtModified" />
-        <result column="creator" property="creator" />
-        <result column="modifier" property="modifier" />
+        <id column="dept_id" property="deptId"/>
+        <result column="hospital_id" property="hospitalId"/>
+        <result column="parent_dept_id" property="parentDeptId"/>
+        <result column="dept_name" property="deptName"/>
+        <result column="dept_type" property="deptType"/>
+        <result column="spell" property="spell"/>
+        <result column="station" property="station"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="gmt_create" property="gmtCreate"/>
+        <result column="gmt_modified" property="gmtModified"/>
+        <result column="creator" property="creator"/>
+        <result column="modifier" property="modifier"/>
     </resultMap>
+    <select id="getList" resultType="com.diagbot.dto.BasDeptInfoDTO"
+            parameterType="com.diagbot.vo.BasDeptInfoVO">
+        SELECT DISTINCT
+            t.dept_id AS deptId,
+            dept_name AS deptName
+        FROM
+            `bas_dept_info` t
+        WHERE
+            t.is_deleted = 'N'
+        AND t.station = '住院'
+        AND t.hospital_id = #{hospitalId}
+        <if test="inputStr !=null and inputStr != ''">
+            AND (UPPER(t.spell) LIKE CONCAT('%', UPPER(TRIM(#{inputStr})),'%') OR UPPER(t.dept_name) LIKE CONCAT('%', UPPER(TRIM(#{inputStr})),'%'));
+        </if>
+    </select>
 
+    <select id="getListUser" resultType="com.diagbot.dto.BasDeptInfoDTO"
+            parameterType="com.diagbot.vo.BasDeptInfoVO">
+        SELECT DISTINCT
+        t.dept_id AS deptId,
+        dept_name AS deptName
+        FROM
+        `bas_dept_info` t
+        INNER JOIN sys_user_dept t1 ON t1.is_deleted = 'N'
+        AND t1.dept_id = t.dept_id
+        AND t1.hospital_id = t.hospital_id
+        WHERE
+        t.is_deleted = 'N'
+        AND t.station = '住院'
+        AND t.hospital_id = #{hospitalId}
+        AND t1.user_id = #{userId}
+        <if test="inputStr !=null and inputStr != ''">
+            AND (UPPER(t.spell) LIKE CONCAT('%', UPPER(TRIM(#{inputStr})),'%') OR UPPER(t.dept_name) LIKE CONCAT('%', UPPER(TRIM(#{inputStr})),'%'));
+        </if>
+    </select>
 </mapper>