Bladeren bron

义乌核查分配相关功能提交

songxinlu 4 jaren geleden
bovenliggende
commit
c89be20519

+ 1 - 2
src/main/java/com/diagbot/entity/MedCheckInfo.java

@@ -85,8 +85,7 @@ public class MedCheckInfo implements Serializable {
     /**
      * 核查类型(0病历,1病案首页,2全部)
      */
-    private Integer checkType;
-
+    private Integer checkType = 2;
 
     /**
      * 核查任务创建人编号

+ 60 - 14
src/main/java/com/diagbot/facade/MedCheckWorkFacade.java

@@ -1,23 +1,24 @@
 package com.diagbot.facade;
 
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.CheckWorkDTO;
 import com.diagbot.dto.MedicalRecordDTO;
-import com.diagbot.entity.MedBehospitalType;
+import com.diagbot.entity.*;
+import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.MedBehospitalTypeServiceImpl;
 import com.diagbot.service.impl.MedicalRecordServiceImpl;
 import com.diagbot.util.DateUtil;
+import com.diagbot.util.ListUtil;
 import com.diagbot.util.SysUserUtils;
 import com.diagbot.vo.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
+import java.util.*;
 
 
 /**
@@ -26,6 +27,8 @@ import java.util.List;
  */
 @Component
 public class MedCheckWorkFacade {
+    @Autowired
+    SysUserFacade sysUserFacade;
     @Autowired
     private MedCheckInfoFacade medCheckInfoFacade;
     @Autowired
@@ -35,25 +38,68 @@ public class MedCheckWorkFacade {
 
     /**
      * @Author songxl
-     * @Description 批量插入任务
+     * @Description 批量操作核查任务(增加和删除)
      * @Date 2021/5/11
      * @Param [medCheckWorkVO]
      * @Return java.lang.Boolean
      * @MethodName addCheck
      */
-    public Boolean addCheck(MedCheckWorkAddVO medCheckWorkVO) {
+    public Boolean addCheckWork(MedCheckWorkAddVO medCheckWorkVO) {
 
+        Date now = DateUtil.now();
         Long hospitalId = Long.parseLong(SysUserUtils.getCurrentHospitalID());
-        String create = SysUserUtils.getCurrentPrincipleID();
-        switch (medCheckWorkVO.getWorkType()){
-            case 0:
-                break;
-            case 1:
-                break;
-            default:
-                break;
+        Long principleId = Long.valueOf(SysUserUtils.getCurrentPrincipleID());
+        QueryWrapper<SysUser> userQuer = new QueryWrapper<>();
+        userQuer.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", principleId)
+                .eq("status", 1);
+        SysUser user = sysUserFacade.getOne(userQuer);
+        String principleName = user.getLinkman();
+        //操作类型(0-取消,1-添加)
+        if (medCheckWorkVO.getCheckType() == 0) {
+            QueryWrapper<MedCheckInfo> medicalRecordQe = new QueryWrapper<>();
+            medicalRecordQe.eq("hospital_id", medCheckWorkVO.getHospitalId());
+            medicalRecordQe.eq("is_deleted", IsDeleteEnum.N.getKey());
+            if (medCheckWorkVO.getBehospitalCodeList().size() > 0) {
+                medicalRecordQe.in("behospital_code", medCheckWorkVO.getBehospitalCodeList());
+            }
+//            List<MedCheckInfo> medCheckInfoList = medCheckInfoFacade.list(medicalRecordQe);
+            List<MedCheckInfo> list = medCheckInfoFacade.list(medicalRecordQe);
+            if (ListUtil.isEmpty(list)) {
+                throw new CommonException(CommonErrorCode.UPDATE_INFO_FAIL, "存在未生成数据!");
+            }
+
+            medCheckInfoFacade.getBaseMapper().getUpdateBatch(medCheckWorkVO.getBehospitalCodeList());
+        } else {
+            //获取核查任务类型(0-科室任务 1-院级 2-质控科)
+            switch (medCheckWorkVO.getWorkType()) {
+                case 0:
+                    //该病历没有核查的时候, 就添加核查记录
+                    List<MedCheckInfo> medCheckInfoList = new ArrayList<>();
+                    for (String behospitalCode : medCheckWorkVO.getBehospitalCodeList()) {
+                        MedCheckInfo medCheckInfo = new MedCheckInfo();
+                        medCheckInfo.setBehospitalCode(behospitalCode);
+                        medCheckInfo.setGmtCreate(now);
+                        medCheckInfo.setGmtModified(now);
+                        medCheckInfo.setHospitalId(hospitalId);
+                        medCheckInfo.setCheckType(medCheckWorkVO.getCheckType());
+                        medCheckInfo.setJobCreator(principleId);
+                        medCheckInfo.setJobCreatorName(principleName);
+                        medCheckInfo.setJobCreateTime(now);
+                        medCheckInfo.setJobType(medCheckWorkVO.getWorkType());
+                        medCheckInfo.setJobDistributionTime(now);
+                        medCheckInfoList.add(medCheckInfo);
+                    }
+                    medCheckInfoFacade.saveBatch(medCheckInfoList);
+                    break;
+                case 1:
+                    break;
+                default:
+                    break;
+            }
         }
 
+
 //        List<MedCheckWork> checkWorkList = new ArrayList<>();
 
 //        return medCheckWorkServiceImpl.saveBatch(checkWorkList, 10);

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

@@ -34,4 +34,5 @@ public interface MedCheckInfoMapper extends BaseMapper<MedCheckInfo> {
     IPage<CheckWorkDTO> getCheckWorkPage(CheckWorkPageVO checkWorkPageVO);
     //获取指定核查人员的核查任务
     List<CheckJobDTO> getCheckListByUserId(CheckJobVO checkJobVO);
+    void getUpdateBatch(List<String> list);
 }

+ 9 - 0
src/main/java/com/diagbot/service/impl/MedCheckInfoServiceImpl.java

@@ -1,6 +1,8 @@
 package com.diagbot.service.impl;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.CheckJobDTO;
+import com.diagbot.dto.CheckWorkDTO;
 import com.diagbot.dto.DeptCheckUserDTO;
 import com.diagbot.entity.MedCheckInfo;
 import com.diagbot.mapper.MedCheckInfoMapper;
@@ -8,6 +10,7 @@ import com.diagbot.service.MedCheckInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.vo.CheckJobVO;
 import com.diagbot.vo.CheckUserVO;
+import com.diagbot.vo.CheckWorkPageVO;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -23,5 +26,11 @@ import java.util.List;
 @Service
 public class MedCheckInfoServiceImpl extends ServiceImpl<MedCheckInfoMapper, MedCheckInfo> implements MedCheckInfoService {
 
+    public IPage<CheckWorkDTO> getCheckWorkPage(CheckWorkPageVO checkWorkPageVO) {
+        return baseMapper.getCheckWorkPage(checkWorkPageVO);
+    }
 
+    public void getUpdateBatch(List<String> list) {
+        baseMapper.getUpdateBatch(list);
+    }
 }

+ 2 - 2
src/main/java/com/diagbot/vo/MedCheckWorkAddVO.java

@@ -23,7 +23,7 @@ public class MedCheckWorkAddVO {
     @ApiModelProperty(hidden = true)
     private String workCreator;         // 创建用户编号
     private Integer workType;           // 任务类型 0-科室任务 1-院级 1-质控科
-    private Integer checkType;          // 添加或取消0-取消,1-添加
+    private Integer checkStatus;        // 操作类型 0-取消,1-添加
     private String createTime;          // 操作时间
-    private String checkStatus;         // 核查类型 (0病历,1病案首页,2全部 默认)
+    private Integer checkType;          // 核查类型 0病历,1病案首页,2全部 默认
 }

+ 7 - 2
src/main/java/com/diagbot/web/MedCheckWorkController.java

@@ -29,8 +29,13 @@ public class MedCheckWorkController {
     @Autowired
     MedCheckWorkFacade medCheckworkFacade;
 
-    @ApiOperation(value = "生成/取消核查任务[by:songxl]",
-            notes = "生成/取消核查任务")
+    @ApiOperation(value = "生成/取消核查任务[by:wangsy]",
+            notes = "生成/取消核查任务 <br>" +
+            "behospitalCodeList:病历id(List) 【必填】<br>" +
+            "workType:任务类型(0-科室任务 1-院级 1-质控科) 【必填】<br>" +
+            "checkStatus:操作类型(0-取消,1-添加) 【必填】<br>" +
+            "createTime: 操作时间<br>" +
+            "checkType:核查类型(0病历,1病案首页,2全部 默认)<br>")
     @PostMapping("/addCheckWork")
     @SysLogger("addCheckWork")
     public RespDTO<Boolean> addCheckTask(@RequestBody MedCheckWorkAddVO medCheckWorkVO) {

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

@@ -164,7 +164,7 @@ oath.self.address: http://${myhost}:${server.port}
 
 # 加解密开关
 encrypt:
-  enable: false
+  enable: true
 
 swagger:
   enable: true

+ 8 - 4
src/main/resources/application-test.yml

@@ -59,7 +59,8 @@ spring:
     druid:
       driver-class-name: com.mysql.cj.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://192.168.2.241:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+#      url: jdbc:mysql://192.168.2.241:3306/qc?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
+      url: jdbc:mysql://192.168.2.236:3306/stu?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false&allowMultiQueries=true
       username: root
       password: lantone
       # 连接池的配置信息
@@ -109,9 +110,12 @@ spring:
   #redis
   redis:
     database:
-      cache: 8 # cache索引
-      token: 8 # Token索引
-    host: 192.168.2.241  #Redis服务器地址
+#      cache: 8 # cache索引
+#      token: 8 # Token索引
+#    host: 192.168.2.241  #Redis服务器地址
+      cache: 3 # cache索引
+      token: 3 # Token索引
+    host: 192.168.2.236  #Redis服务器地址
     port: 6379 # Redis服务器连接端口(本地环境端口6378,其他环境端口是6379)
     password: lantone # Redis服务器连接密码(默认为空)
     lettuce:

+ 12 - 0
src/main/resources/mapper/MedCheckInfoMapper.xml

@@ -180,4 +180,16 @@
             AND mbi.is_placefile = #{isPlacefile}
         </if>
     </select>
+
+    <!--通过住院号,取消核查任务-->
+    <update id="getUpdateBatch">
+        <foreach collection="list" item="item"  separator=";">
+            update med_check_info
+            <set>
+                is_deleted = 'Y'
+            </set>
+            where behospital_code = #{item.behospitalCode} and is_deleted = 'N'
+        </foreach>
+    </update>
+
 </mapper>