Przeglądaj źródła

icssman删除无用代码

gaodm 6 lat temu
rodzic
commit
6df1b9b71e

+ 0 - 259
icssman-service/src/main/java/com/diagbot/facade/DeptInfoFacade.java

@@ -1,259 +0,0 @@
-package com.diagbot.facade;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.client.UserServiceClient;
-import com.diagbot.dto.GetAllDeptsDTO;
-import com.diagbot.dto.GetDeptInfoDTO;
-import com.diagbot.dto.GetDeptNameDTO;
-import com.diagbot.dto.GetQuestionUsualAndTypeDTO;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.DeptInfo;
-import com.diagbot.entity.ModuleDetail;
-import com.diagbot.entity.ModuleInfo;
-import com.diagbot.entity.QuestionUsual;
-import com.diagbot.enums.IsDeleteEnum;
-import com.diagbot.exception.CommonErrorCode;
-import com.diagbot.exception.CommonException;
-import com.diagbot.service.impl.DeptInfoServiceImpl;
-import com.diagbot.util.BeanUtil;
-import com.diagbot.util.DateUtil;
-import com.diagbot.util.ListUtil;
-import com.diagbot.util.UserUtils;
-import com.diagbot.vo.AddDeptInfoVO;
-import com.diagbot.vo.DeleteDeptInfoVO;
-import com.diagbot.vo.GetAllDeptsVO;
-import com.diagbot.vo.GetDeptInfoDetialsVO;
-import com.diagbot.vo.GetDeptInfoVO;
-import com.diagbot.vo.GetQuestionUsualAndTypeVO;
-import com.diagbot.vo.UpdateDeptInfoVO;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-/**
- * @Description:
- * @Author:zhaops
- * @time: 2018/11/22 11:44
- */
-@Component
-public class DeptInfoFacade extends DeptInfoServiceImpl {
-
-    @Autowired
-    private UserServiceClient userServiceClient;
-    @Autowired
-    private QuestionUsualFacade questionUsualFacade;
-    @Autowired
-    ModuleInfoFacade moduleInfoFacade;
-    @Autowired
-    ModuleDetailFacade moduleDetailFacade;
-    /**
-     * 添加科室信息
-     *
-     * @param addDeptInfoVO
-     * @return
-     */
-    public Boolean addDeptInfo(AddDeptInfoVO addDeptInfoVO) {
-        //判断科室是否重名
-        QueryWrapper<DeptInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
-        queryWrapper.eq("name", addDeptInfoVO.getName());
-        if (this.count(queryWrapper) > 0) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "添加失败,科室已存在");
-        }
-        //添加科室
-        DeptInfo deptInfo = new DeptInfo();
-        BeanUtil.copyProperties(addDeptInfoVO, deptInfo);
-        Date now = DateUtil.now();
-        String userId = UserUtils.getCurrentPrincipleID();
-        deptInfo.setCreator(userId);
-        deptInfo.setGmtCreate(now);
-        deptInfo.setGmtModified(now);
-        deptInfo.setModifier(userId);
-        this.save(deptInfo);
-        return true;
-    }
-
-    /**
-     * 修改科室信息
-     *
-     * @param updateDeptInfoVO
-     * @return
-     */
-    public Boolean updateDeptInfo(UpdateDeptInfoVO updateDeptInfoVO) {
-        //判断科室是否已被删除
-        if(deptInfoIsDeletedStatus(Long.parseLong(updateDeptInfoVO.getId()))){
-            throw new CommonException(CommonErrorCode.NOT_EXISTS,
-                    "科室已删除");
-        }
-        //判断科室是否重名
-        Boolean boole = false;
-        QueryWrapper<DeptInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
-                .notIn("id",updateDeptInfoVO.getId());
-        List<DeptInfo> deptInfoList = this.list(queryWrapper);
-        for (DeptInfo deptInfo: deptInfoList) {
-            if(updateDeptInfoVO.getName().equals(deptInfo.getName())){
-                boole = true;
-            }
-        }
-        if(boole){
-            throw new CommonException(CommonErrorCode.IS_EXISTS,
-                    "科室名称重复");
-        }
-        //修改操作
-        DeptInfo deptInfo = this.getById(updateDeptInfoVO.getId());
-        BeanUtil.copyProperties(updateDeptInfoVO, deptInfo);
-        deptInfo.setModifier(UserUtils.getCurrentPrincipleID());
-        deptInfo.setGmtModified(DateUtil.now());
-        this.updateById(deptInfo);
-        return true;
-    }
-
-    /**
-     * 删除科室信息
-     *
-     * @param deleteDeptInfoVO
-     * @return
-     */
-    public Boolean deleteDeptInfo(DeleteDeptInfoVO deleteDeptInfoVO) {
-        Date now = DateUtil.now();
-        String person = UserUtils.getCurrentPrincipleID();
-        //判断科室是否已被删除
-        if(deptInfoIsDeletedStatus(Long.parseLong(deleteDeptInfoVO.getId()))){
-            throw new CommonException(CommonErrorCode.NOT_EXISTS,
-                    "科室已删除");
-        }
-        QueryWrapper<QuestionUsual> questionUsualQueryWrapper = new QueryWrapper<>();
-        questionUsualQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
-                .eq("dept_id",deleteDeptInfoVO.getId());
-        if(questionUsualFacade.count(questionUsualQueryWrapper) > 0){
-            throw new CommonException(CommonErrorCode.NOT_EXISTS,
-                    "与常用标签关联未删除");
-        }
-        //删除操作
-        DeptInfo deptInfo = new DeptInfo();
-        deptInfo.setId(Long.parseLong(deleteDeptInfoVO.getId()));
-        deptInfo.setModifier(person);
-        deptInfo.setIsDeleted(IsDeleteEnum.Y.getKey());
-        deptInfo.setGmtModified(now);
-        this.updateById(deptInfo);
-        //删除慢病模板
-        QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
-        moduleInfoQueryWrapper.eq("relation_id",deleteDeptInfoVO.getId())
-                .eq("is_deleted", IsDeleteEnum.N.getKey());
-        List<ModuleInfo> moduleInfoList = moduleInfoFacade.list(moduleInfoQueryWrapper);
-        List<Long> moduleIds = moduleInfoList.stream().map(ModuleInfo::getId).collect(Collectors.toList());
-        moduleInfoFacade.update(new ModuleInfo(), new UpdateWrapper<ModuleInfo>()
-                .in("id", moduleIds)
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .set("gmt_modified", now)
-                .set("modifier", person)
-                .set("is_deleted", IsDeleteEnum.Y.getKey()));
-        //删除模板明细
-        moduleDetailFacade.update(new ModuleDetail(), new UpdateWrapper<ModuleDetail>()
-                .in("module_id", moduleIds)
-                .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .set("gmt_modified", now)
-                .set("modifier", person)
-                .set("is_deleted", IsDeleteEnum.Y.getKey()));
-        return true;
-    }
-
-
-    /**
-     * 获取科室信息
-     *
-     * @param getDeptInfoVO
-     * @return
-     */
-    public IPage<GetDeptInfoDTO> getDeptInfo(GetDeptInfoVO getDeptInfoVO) {
-        IPage<GetDeptInfoDTO> iPage = this.getDeptInfos(getDeptInfoVO);
-        RespDTO<Map<String, String>> respDTO = new RespDTO<>();
-        if (ListUtil.isNotEmpty(iPage.getRecords())) {
-            List<String> ids = new ArrayList<>();
-            for (GetDeptInfoDTO getDeptInfoDTO : iPage.getRecords()) {
-                ids.add(getDeptInfoDTO.getModifier());
-            }
-            //获取用户信息
-            respDTO = userServiceClient.getUserInfoByIds(ids);
-            if (respDTO == null || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
-                throw new CommonException(CommonErrorCode.RPC_ERROR,
-                        "获取用户信息失败");
-            }
-            //将用户信息放入实体
-            for (GetDeptInfoDTO getDeptInfoDTO : iPage.getRecords()) {
-                getDeptInfoDTO.setUserName(respDTO.data.get(getDeptInfoDTO.getModifier()));
-            }
-        }
-        return iPage;
-    }
-
-    /**
-     * 常用标签维护获取科室名称
-     *
-     * @return
-     */
-    public List<GetDeptNameDTO> getAllDeptInfo(GetQuestionUsualAndTypeVO getQuestionUsualAndTypeVO) {
-        //查询当前类型已经添加过得常用标签所关联的科室
-        List<GetQuestionUsualAndTypeDTO> getQuestionUsualAndTypeDTOS = questionUsualFacade.getQuestionUsualByDeptIds(getQuestionUsualAndTypeVO);
-        List<Long> deptIds = getQuestionUsualAndTypeDTOS.stream().map(getQuestionUsualAndTypeDTO -> getQuestionUsualAndTypeDTO.getDeptId()).collect(Collectors.toList());
-        //查询科室信息过滤掉已经添加过得科室
-        QueryWrapper<DeptInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
-                .notIn("id",deptIds);
-        List<DeptInfo> deptInfoList = this.list(queryWrapper);
-        List<GetDeptNameDTO> getDeptNameDTOS = BeanUtil.listCopyTo(deptInfoList,GetDeptNameDTO.class);
-        return getDeptNameDTOS;
-    }
-
-    /**
-     * 科室维护详情
-     *
-     * @param getDeptInfoDetialsVO
-     * @return
-     */
-    public DeptInfo getDeptInfoDetials(GetDeptInfoDetialsVO getDeptInfoDetialsVO) {
-        QueryWrapper<DeptInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
-                    .eq("id",getDeptInfoDetialsVO.getId());
-        DeptInfo deptInfo = this.getOne(queryWrapper);
-        if(deptInfo == null){
-            throw new CommonException(CommonErrorCode.NOT_EXISTS,
-                    "科室信息不存在");
-        }
-        return deptInfo;
-    }
-
-    /**
-     * 判断科室是否被删除
-     *
-     * @param deptId
-     * @return
-     */
-    public Boolean deptInfoIsDeletedStatus(Long deptId){
-        QueryWrapper<DeptInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("is_deleted",IsDeleteEnum.Y.getKey());
-        queryWrapper.eq("id",deptId);
-        return this.count(queryWrapper) > 0 ? true:false;
-    }
-
-    /**
-     * 获取所有科室
-     * @param getAllDeptsVO
-     * @return
-     */
-    public List<GetAllDeptsDTO> getAllDepts(GetAllDeptsVO getAllDeptsVO){
-    	 QueryWrapper<DeptInfo> deptInfoQe = new QueryWrapper<>();
-    	 deptInfoQe.eq("is_deleted",IsDeleteEnum.N.getKey());
-    	 deptInfoQe.like("name", getAllDeptsVO.getName());
-    	 return BeanUtil.listCopyTo(list(deptInfoQe), GetAllDeptsDTO.class);
-    }
-
-}

+ 0 - 42
icssman-service/src/main/java/com/diagbot/mapper/DeptInfoMapper.java

@@ -1,42 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.diagbot.dto.DeptInfoDTO;
-import com.diagbot.dto.GetDeptInfoDTO;
-import com.diagbot.entity.DeptInfo;
-import com.diagbot.vo.GetDeptInfoVO;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * <p>
- * 科室信息表 Mapper 接口
- * </p>
- *
- * @author zhaops
- * @since 2018-11-22
- */
-public interface DeptInfoMapper extends BaseMapper<DeptInfo> {
-
-    /**
-     * 常用标签修改获取科室信息
-     * @param getDeptInfoVO
-     * @return
-     */
-    public IPage<GetDeptInfoDTO> getAllDeptInfo(GetDeptInfoVO getDeptInfoVO);
-
-    /**
-     * 分页获取科室信息
-     * @param getDeptInfoVO
-     * @return
-     */
-    public IPage<GetDeptInfoDTO> getDeptInfos(GetDeptInfoVO getDeptInfoVO);
-
-    /**
-     * 获取科室名称
-     * @return
-     */
-    public List<DeptInfoDTO> getDeptName();
-}

+ 0 - 45
icssman-service/src/main/java/com/diagbot/service/DeptInfoService.java

@@ -1,45 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.dto.DeptInfoDTO;
-import com.diagbot.dto.GetDeptInfoDTO;
-import com.diagbot.entity.DeptInfo;
-import com.diagbot.vo.GetDeptInfoVO;
-
-import java.util.List;
-
-/**
- * <p>
- * 科室信息表 服务类
- * </p>
- *
- * @author zhaops
- * @since 2018-11-22
- */
-public interface DeptInfoService extends IService<DeptInfo> {
-
-    /**
-     * 获取科室信息
-     *
-     * @param getDeptInfoVO
-     * @return
-     */
-    public IPage<GetDeptInfoDTO> getAllDeptInfo(GetDeptInfoVO getDeptInfoVO);
-
-
-    /**
-     * 分页获取科室信息
-     *
-     * @param getDeptInfoVO
-     * @return
-     */
-    public IPage<GetDeptInfoDTO> getDeptInfos(GetDeptInfoVO getDeptInfoVO);
-
-    /**
-     * 获取科室名称
-     *
-     * @return
-     */
-    public List<DeptInfoDTO> getDeptName();
-}

+ 0 - 40
icssman-service/src/main/java/com/diagbot/service/impl/DeptInfoServiceImpl.java

@@ -1,40 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.dto.DeptInfoDTO;
-import com.diagbot.dto.GetDeptInfoDTO;
-import com.diagbot.entity.DeptInfo;
-import com.diagbot.mapper.DeptInfoMapper;
-import com.diagbot.service.DeptInfoService;
-import com.diagbot.vo.GetDeptInfoVO;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-/**
- * <p>
- * 科室信息表 服务实现类
- * </p>
- *
- * @author zhaops
- * @since 2018-11-22
- */
-@Service
-public class DeptInfoServiceImpl extends ServiceImpl<DeptInfoMapper, DeptInfo> implements DeptInfoService {
-
-    @Override
-    public IPage<GetDeptInfoDTO> getDeptInfos(GetDeptInfoVO getDeptInfoVO) {
-        return baseMapper.getDeptInfos(getDeptInfoVO);
-    }
-
-    @Override
-    public IPage<GetDeptInfoDTO> getAllDeptInfo(GetDeptInfoVO getDeptInfoVO) {
-        return baseMapper.getAllDeptInfo(getDeptInfoVO);
-    }
-
-    @Override
-    public List<DeptInfoDTO> getDeptName() {
-        return baseMapper.getDeptName();
-    }
-}

+ 0 - 70
icssman-service/src/main/resources/mapper/DeptInfoMapper.xml

@@ -1,70 +0,0 @@
-<?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">
-<mapper namespace="com.diagbot.mapper.DeptInfoMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.diagbot.entity.DeptInfo">
-        <id column="id" property="id" />
-        <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" />
-        <result column="name" property="name" />
-        <result column="remark" property="remark" />
-    </resultMap>
-
-    <select id="getAllDeptInfo" resultType="com.diagbot.dto.GetDeptInfoDTO">
-        SELECT
-        a.id,a.gmt_create,b.gmt_modified,b.creator,b.modifier,a.`name`,a.remark,c.type
-        FROM
-        `icss_dept_info` a
-        LEFT JOIN icss_question_usual b ON a.id = b.dept_id
-        LEFT JOIN icss_question_info c ON b.question_id = c.id
-        WHERE
-        a.is_deleted = 'N' AND b.is_deleted = 'N' AND c.is_deleted = 'N'
-        <if test="name != null and name != ''">
-            AND a.`name` LIKE CONCAT('%',#{name},'%')
-        </if>
-        GROUP BY a.id,c.type
-        ORDER BY
-        b.gmt_modified DESC
-    </select>
-
-    <select id="getDeptInfos" resultType="com.diagbot.dto.GetDeptInfoDTO">
-        SELECT
-        a.id,a.gmt_create,a.gmt_modified,a.creator,a.modifier,a.`name`,a.remark
-        FROM
-        `icss_dept_info` a
-        WHERE
-        a.is_deleted = 'N'
-        <if test="name != null and name != ''">
-            AND a.`name` LIKE CONCAT('%',#{name},'%')
-        </if>
-        ORDER BY a.gmt_modified DESC
-    </select>
-
-    <select id="getDeptName" resultType="com.diagbot.dto.DeptInfoDTO">
-        SELECT
-	      *
-        FROM
-	      `icss_dept_info` a
-        WHERE
-          a.is_deleted = 'N'
-          AND a.id NOT IN (
-		      SELECT
-			    b.dept_id
-		      FROM
-			    icss_question_usual b
-		      WHERE
-		        b.is_deleted = 'N'
-		        AND b.dept_id IN (
-				    SELECT
-					  c.id
-				    FROM
-					  `icss_dept_info` c
-				    WHERE c.is_deleted = 'N'
-			  )
-	      )
-    </select>
-</mapper>