Explorar o código

添加生成核查任务列表、分配列表分值筛选功能

songxinlu %!s(int64=4) %!d(string=hai) anos
pai
achega
8cdc983974

+ 5 - 0
src/main/java/com/diagbot/dto/CheckedRecordListDTO.java

@@ -36,6 +36,11 @@ public class CheckedRecordListDTO {
      */
     @ApiModelProperty("科室Id")
     private String behDeptId;
+    /**
+     * 任务来源
+     */
+    @ApiModelProperty("任务来源")
+    private String jobTypeName;
 
     /**
      * 科室

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

@@ -6,6 +6,7 @@ import com.diagbot.dto.BehospitalInfoAgeDTO;
 import com.diagbot.dto.CheckedRecordListDTO;
 import com.diagbot.dto.SysUserDeptDTO;
 import com.diagbot.entity.BasDeptInfo;
+import com.diagbot.entity.MedBehospitalType;
 import com.diagbot.entity.MedCheckInfo;
 import com.diagbot.entity.SysUserDept;
 import com.diagbot.entity.SysUserRole;
@@ -17,6 +18,7 @@ import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.MedQcresultDetailService;
+import com.diagbot.service.impl.MedBehospitalTypeServiceImpl;
 import com.diagbot.util.DateUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.SysUserUtils;
@@ -24,9 +26,11 @@ import com.diagbot.vo.CheckedRecordListVO;
 import com.diagbot.vo.RecordCheckVO;
 import com.diagbot.vo.SysUserBaseVO;
 import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -53,6 +57,8 @@ public class RecordCheckFacade {
     BehospitalInfoFacade behospitalInfoFacade;
     @Autowired
     BasDeptInfoFacade basDeptInfoFacade;
+    @Autowired
+    MedBehospitalTypeServiceImpl medBehospitalTypeServiceImpl;
 
 
     public IPage<CheckedRecordListDTO> checkedRecordList(CheckedRecordListVO checkedRecordListVO) {
@@ -153,5 +159,40 @@ public class RecordCheckFacade {
 
         return true;
     }
-
+    /**
+     * @Author songxl
+     * @Description获取当前用户的任务来源 和筛选分值
+     * @Date  2021/5/28
+     * @Param []
+     * @Return java.util.Map<java.lang.String,java.lang.String>
+     * @MethodName getCheckType
+     */
+    public Map<String, Object> getCheckType() {
+        Map<String,Object> out = Maps.newLinkedHashMap();
+        Map<Integer,String> checkTypes = Maps.newLinkedHashMap();
+        Long userId = Long.parseLong(SysUserUtils.getCurrentPrincipleID());
+        SysUserBaseVO sysUserBaseVO = new SysUserBaseVO();
+        sysUserBaseVO.setUserId(userId);
+        List<Long> roleIds = sysUserFacade.getUserRoles(sysUserBaseVO).getSelRoles().stream().map(i -> i.getId()).collect(Collectors.toList());
+        roleIds.stream().forEach(roleId -> {
+            if (roleId.intValue() == CheckerRoleEnum.DEPT_SUPERVISOR.getKey()||roleId.intValue() == CheckerRoleEnum.DEPT_GENERAL.getKey()){
+                checkTypes.put(CheckJobTypeEnum.DEPT_SUPERVISOR.getKey(),CheckJobTypeEnum.DEPT_SUPERVISOR.getName());
+            }
+            if (roleId.intValue() == CheckerRoleEnum.QUAT_SUPERVISOR.getKey()||roleId.intValue() == CheckerRoleEnum.QUAT_GENERAL.getKey()){
+                checkTypes.put(CheckJobTypeEnum.QUAT_SUPERVISOR.getKey(),CheckJobTypeEnum.QUAT_SUPERVISOR.getName());
+            }
+            if (roleId.intValue() == CheckerRoleEnum.HOSP_SUPERVISOR.getKey()||roleId.intValue() == CheckerRoleEnum.HOSP_GENERAL.getKey()){
+                checkTypes.put(CheckJobTypeEnum.HOSP_SUPERVISOR.getKey(),CheckJobTypeEnum.HOSP_SUPERVISOR.getName());
+            }
+        });
+        Long hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
+        List<Integer> valus = medBehospitalTypeServiceImpl.list(new QueryWrapper<MedBehospitalType>()
+                .eq("hospital_id", hospitalId)
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .isNotNull("value")
+                .groupBy("value")).stream().map(MedBehospitalType::getValue).collect(Collectors.toList());
+        out.put("source",checkTypes);
+        out.put("value",valus);
+        return out;
+    }
 }

+ 3 - 0
src/main/java/com/diagbot/vo/CheckJobPageVO.java

@@ -45,6 +45,9 @@ public class CheckJobPageVO extends Page implements Serializable {
     //科室id集合
     @ApiModelProperty(hidden = true)
     private List<String> deptList;
+    //筛选分值集合
+    @ApiModelProperty("筛选分值集合")
+    private List<String> values;
 
 
 

+ 3 - 1
src/main/java/com/diagbot/vo/CheckWorkPageVO.java

@@ -109,5 +109,7 @@ public class CheckWorkPageVO extends Page implements Serializable {
      */
     @ApiModelProperty("是否归档(0:未归档,1:已归档)")
     private String isPlacefile = "1";
-
+    //筛选分值集合
+    @ApiModelProperty("筛选分值集合")
+    private List<String> values;
 }

+ 9 - 0
src/main/java/com/diagbot/web/RecordCheckController.java

@@ -16,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Map;
+
 /**
  * @author rengb
  * @since 2021-05-11
@@ -45,4 +47,11 @@ public class RecordCheckController {
         return RespDTO.onSuc(res);
     }
 
+    @ApiOperation(value = "获取核查任务来源[by:songxl]")
+    @PostMapping("/getCheckType")
+    @SysLogger("getCheckType")
+    public RespDTO<Map<String, Object>> getCheckType() {
+        Map<String, Object> data = recordCheckFacade.getCheckType();
+        return RespDTO.onSuc(data);
+    }
 }

+ 16 - 2
src/main/resources/mapper/MedCheckInfoMapper.xml

@@ -156,9 +156,14 @@
                         #{item}
                     </foreach>
                 </if>
-
-        ) a LEFT JOIN med_behospital_type b on a.behospital_code = b.behospital_code
+        ) a  JOIN med_behospital_type b on a.behospital_code = b.behospital_code
         and a.hospital_id = b.hospital_id and b.is_deleted = 'N' and  b.`value` is not null
+        <if test="values !=null and values.size()!=0 ">
+            and b.`value` in
+            <foreach collection="values" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
     </select>
 
 
@@ -311,6 +316,12 @@
         <if test="isPlacefile != null and isPlacefile != ''">
             AND mbi.is_placefile = #{isPlacefile}
         </if>
+        <if test="values !=null and values.size > 0">
+            and mbt.`value` in
+            <foreach collection="values" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
     </select>
 
     <!--通过住院号,取消核查任务-->
@@ -341,6 +352,9 @@
         a.check_time as checkTime,
         c.`level` as level,
         c.score_res as scoreRes,
+        CASE WHEN a.job_type='0' THEN '科室任务'
+        WHEN a.job_type='1' THEN '质控科'
+        WHEN a.job_type='2' THEN '院级' END AS jobTypeName,
         <!-- 张三是A科室的监管员,李四是A科室和B科室的普通质控员,那么张三在核查任务列表中不能看到李四B科室的数据  -->
         case when a.job_type='0' and FIND_IN_SET(b.beh_dept_id,#{currentDeptIds})=0 then 0 else 1 end as isDel
         from med_check_info a join med_behospital_info b on a.hospital_id=b.hospital_id and