浏览代码

增加慢病登记作废

hsh 1 年之前
父节点
当前提交
99d84d7e78

+ 18 - 0
src/main/java/thyyxxk/webserver/controller/chronicDisease/ChronicDiseaseController.java

@@ -108,4 +108,22 @@ public class ChronicDiseaseController {
         return service.selectChronicDisease(vo);
     }
 
+    @PassToken
+    @GetMapping("/selectMbDelPermissions")
+    public ResultVo<Map<String, Object>> selectMbDelPermissions(){
+        return service.selectMbDelPermissions();
+    }
+
+    @PassToken
+    @GetMapping("/delChronicDiseaseById")
+    public ResultVo<Map<String, Object>> delChronicDiseaseById(@RequestParam("pId") String pId){
+        return service.delChronicDiseaseById(pId);
+    }
+
+    @PassToken
+    @GetMapping("/hfChronicDiseaseById")
+    public ResultVo<Map<String, Object>> hfChronicDiseaseById(@RequestParam("pId") String pId){
+        return service.hfChronicDiseaseById(pId);
+    }
+
 }

+ 16 - 0
src/main/java/thyyxxk/webserver/dao/his/chronicDisease/CrmPatientMiDao.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Delete;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
 import thyyxxk.webserver.entity.chronicDisease.CrmPatientMi;
 import thyyxxk.webserver.entity.chronicDisease.CrmPatientVo;
 
@@ -67,8 +68,23 @@ public interface CrmPatientMiDao extends BaseMapper<CrmPatientMi> {
             "<if test=\"diseaseType != null and diseaseType != '' \">" +
             " and chronic_disease_type like '%${diseaseType}%'  " +
             "</if>" +
+            "<if test=\"delFlag == '0'.toString() \">" +
+            " and isnull(mi.del_flag, '0') = '0'  " +
+            "</if>" +
+            "<if test=\"delFlag == '1'.toString() \">" +
+            " and mi.del_flag = '1'  " +
+            "</if>" +
             " order by mi.create_date " +
             "</script> ")
     List<CrmPatientMi> selectChronicDisease(CrmPatientVo vo);
 
+    @Select(" select name as userId from sys_parameters where code = 'mbDel' ")
+    String selectMbDelPermissions();
+
+    @Update(" update crm_patient_mi set del_flag = '1' where p_id = #{pId} ")
+    int delChronicDiseaseById(@Param("pId") String pId);
+
+    @Update(" update crm_patient_mi set del_flag = '0' where p_id = #{pId} ")
+    int hfChronicDiseaseById(@Param("pId") String pId);
+
 }

+ 4 - 0
src/main/java/thyyxxk/webserver/entity/chronicDisease/CrmPatientMi.java

@@ -239,6 +239,10 @@ public class CrmPatientMi implements Serializable {
      * 区(地区)
      */
     private String areaCode;
+    /**
+     * 是否有效(1: 无效)
+     */
+    private String delFlag;
     /**
      * 身高
      */

+ 1 - 0
src/main/java/thyyxxk/webserver/entity/chronicDisease/CrmPatientVo.java

@@ -16,5 +16,6 @@ public class CrmPatientVo {
     private String endTime;
     private String keyCode;
     private String diseaseType;
+    private String delFlag;
 
 }

+ 43 - 0
src/main/java/thyyxxk/webserver/service/chronicDisease/ChronicDiseaseService.java

@@ -597,4 +597,47 @@ public class ChronicDiseaseService {
         }
     }
 
+    /**
+     * @Description 查询慢病作废权限
+     * @Author hsh
+     * @return map
+     * @Date 2024/3/28 10:18
+     */
+    public ResultVo<Map<String, Object>> selectMbDelPermissions(){
+        UserInfo user = redisLikeService.getUserInfoByToken();
+        Map<String, Object> map = new HashMap<>();
+        String f = cpmDao.selectMbDelPermissions();
+        if(f.contains(user.getCode())){
+            map.put("qx", "0");
+        } else {
+            map.put("qx", "1");
+        }
+        return ResultVoUtil.success(map);
+    }
+
+    /**
+     * @Description 根据id作废慢病登记信息
+     * @Author hsh
+     * @param pId 慢病登记id
+     * @return map
+     * @Date 2024/3/28 10:30
+     */
+    public ResultVo<Map<String, Object>> delChronicDiseaseById(String pId){
+        Map<String, Object> map = new HashMap<>();
+        int f = cpmDao.delChronicDiseaseById(pId);
+        if(f > 0){
+            map.put("cg", "慢病登记作废成功!");
+        }
+        return ResultVoUtil.success(map);
+    }
+
+    public ResultVo<Map<String, Object>> hfChronicDiseaseById(String pId){
+        Map<String, Object> map = new HashMap<>();
+        int f = cpmDao.hfChronicDiseaseById(pId);
+        if(f > 0){
+            map.put("cg", "慢病登记恢复成功!");
+        }
+        return ResultVoUtil.success(map);
+    }
+
 }