Browse Source

Merge remote-tracking branch 'origin/dev/20200513end_1.2.0' into dev/20200513end_1.2.0

zhaops 5 years ago
parent
commit
2af345d86b

+ 95 - 0
src/main/java/com/diagbot/dto/QcAbnormalDTO.java

@@ -0,0 +1,95 @@
+package com.diagbot.dto;
+
+import com.diagbot.enums.AbnormalStatusEnum;
+import com.diagbot.enums.AbnormalTypeEnum;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/5/15 9:27
+ */
+@Getter
+@Setter
+public class QcAbnormalDTO {
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 异常类型(1:数据模块 2:质控类型 3:XML结构)
+     */
+    private Integer type;
+
+    /**
+     * 异常类型名称(1:数据模块 2:质控类型 3:XML结构)
+     */
+    private String typeName;
+
+    public String getTypeName() {
+        return AbnormalTypeEnum.getName(this.type);
+    }
+
+    /**
+     * 异常描述
+     */
+    private String description;
+
+    /**
+     * 状态(0:未处理,1:已处理)
+     */
+    private Integer status;
+
+    /**
+     * 状态名称(0:未处理,1:已处理)
+     */
+    private String statusName;
+
+    public String getStatusName() {
+        return AbnormalStatusEnum.getName(this.status);
+    }
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 2 - 1
src/main/java/com/diagbot/dto/QcCasesDTO.java

@@ -5,6 +5,7 @@ import lombok.Setter;
 
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
+import java.util.Date;
 
 /**
  * @Description:
@@ -27,7 +28,7 @@ public class QcCasesDTO {
     /**
      * 记录修改时间,如果时间是1970年则表示纪录未修改
      */
-    private LocalDateTime gmtModified;
+    private Date gmtModified;
 
     /**
      * 模块名称

+ 195 - 0
src/main/java/com/diagbot/entity/QcAbnormal.java

@@ -0,0 +1,195 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 异常数据监控信息
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-05-15
+ */
+public class QcAbnormal implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 医院ID
+     */
+    private Long hospitalId;
+
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 异常类型(1:数据模块 2:质控类型 3:XML结构)
+     */
+    private Integer type;
+
+    /**
+     * 异常描述
+     */
+    private String description;
+
+    /**
+     * 状态(0:未处理,1:已处理)
+     */
+    private Integer status;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getBehospitalCode() {
+        return behospitalCode;
+    }
+
+    public void setBehospitalCode(String behospitalCode) {
+        this.behospitalCode = behospitalCode;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "QcAbnormal{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", behospitalCode=" + behospitalCode +
+                ", type=" + type +
+                ", description=" + description +
+                ", status=" + status +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 50 - 0
src/main/java/com/diagbot/enums/AbnormalStatusEnum.java

@@ -0,0 +1,50 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2018年11月21日 下午2:31:42
+ */
+public enum AbnormalStatusEnum implements KeyedNamed {
+    NOT_HANDLED(0, "未处理"),
+    HAS_HANDLED(1, "已处理");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    AbnormalStatusEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static AbnormalStatusEnum getEnum(int key) {
+        for (AbnormalStatusEnum item : AbnormalStatusEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        AbnormalStatusEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}
+

+ 51 - 0
src/main/java/com/diagbot/enums/AbnormalTypeEnum.java

@@ -0,0 +1,51 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2018年11月21日 下午2:31:42
+ */
+public enum AbnormalTypeEnum implements KeyedNamed {
+    DATA_MODEL(1, "数据模块"),
+    QC_TYPE(2, "质控类型"),
+    XML(3, "XML结构");
+
+    @Setter
+    private int key;
+
+    @Setter
+    private String name;
+
+    AbnormalTypeEnum(int key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static AbnormalTypeEnum getEnum(int key) {
+        for (AbnormalTypeEnum item : AbnormalTypeEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(int key) {
+        AbnormalTypeEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}
+

+ 51 - 0
src/main/java/com/diagbot/facade/QcAbnormalFacade.java

@@ -0,0 +1,51 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.QcAbnormalDTO;
+import com.diagbot.entity.QcAbnormal;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.QcAbnormalServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.QcAbnormalSaveVO;
+import com.diagbot.vo.QcAbnormalVO;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/5/15 9:26
+ */
+@Component
+public class QcAbnormalFacade extends QcAbnormalServiceImpl {
+
+    /**
+     * 查询异常数据监控信息
+     *
+     * @param qcAbnormalVO 异常数据监控信息查询参数
+     * @return 异常数据监控信息
+     */
+    public IPage<QcAbnormalDTO> getQcAnnormalFac(QcAbnormalVO qcAbnormalVO) {
+        qcAbnormalVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        return this.getQcAnnormal(qcAbnormalVO);
+    }
+
+    /**
+     * 更新异常数据监控信息
+     *
+     * @param qcAbnormalSaveVO 异常数据监控信息更新参数
+     * @return 是否成功
+     */
+    public Boolean saveQcAnnormal(QcAbnormalSaveVO qcAbnormalSaveVO) {
+        return this.update(new UpdateWrapper<QcAbnormal>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", SysUserUtils.getCurrentHospitalID())
+                .eq("id", qcAbnormalSaveVO.getId())
+                .set("status", qcAbnormalSaveVO.getStatus())
+                .set("remark", qcAbnormalSaveVO.getRemark())
+                .set("gmt_modified", DateUtil.now())
+                .set("modifier", SysUserUtils.getCurrentPrincipleID())
+        );
+    }
+}

+ 19 - 0
src/main/java/com/diagbot/mapper/QcAbnormalMapper.java

@@ -0,0 +1,19 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.QcAbnormalDTO;
+import com.diagbot.entity.QcAbnormal;
+import com.diagbot.vo.QcAbnormalVO;
+
+/**
+ * <p>
+ * 异常数据监控信息 Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-05-15
+ */
+public interface QcAbnormalMapper extends BaseMapper<QcAbnormal> {
+    IPage<QcAbnormalDTO> getQcAnnormal(QcAbnormalVO qcAbnormalVO);
+}

+ 19 - 0
src/main/java/com/diagbot/service/QcAbnormalService.java

@@ -0,0 +1,19 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.QcAbnormalDTO;
+import com.diagbot.entity.QcAbnormal;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.vo.QcAbnormalVO;
+
+/**
+ * <p>
+ * 异常数据监控信息 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-05-15
+ */
+public interface QcAbnormalService extends IService<QcAbnormal> {
+    IPage<QcAbnormalDTO> getQcAnnormal(QcAbnormalVO qcAbnormalVO);
+}

+ 25 - 0
src/main/java/com/diagbot/service/impl/QcAbnormalServiceImpl.java

@@ -0,0 +1,25 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.QcAbnormalDTO;
+import com.diagbot.entity.QcAbnormal;
+import com.diagbot.mapper.QcAbnormalMapper;
+import com.diagbot.service.QcAbnormalService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.vo.QcAbnormalVO;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 异常数据监控信息 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-05-15
+ */
+@Service
+public class QcAbnormalServiceImpl extends ServiceImpl<QcAbnormalMapper, QcAbnormal> implements QcAbnormalService {
+    public IPage<QcAbnormalDTO> getQcAnnormal(QcAbnormalVO qcAbnormalVO){
+        return baseMapper.getQcAnnormal(qcAbnormalVO);
+    }
+}

+ 32 - 0
src/main/java/com/diagbot/vo/QcAbnormalSaveVO.java

@@ -0,0 +1,32 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/5/15 10:16
+ */
+@Getter
+@Setter
+public class QcAbnormalSaveVO {
+    /**
+     * 主键
+     */
+    @NotNull(message = "请输入异常数据监控ID")
+    private Long id;
+
+    /**
+     * 状态(0:未处理,1:已处理)
+     */
+    @NotNull(message = "请输入处理状态")
+    private Integer status;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 34 - 0
src/main/java/com/diagbot/vo/QcAbnormalVO.java

@@ -0,0 +1,34 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/5/15 10:16
+ */
+@Getter
+@Setter
+public class QcAbnormalVO extends Page {
+    /**
+     * 病人住院ID
+     */
+    private String behospitalCode;
+
+    /**
+     * 异常类型(1:数据模块 2:质控类型 3:XML结构)
+     */
+    private Integer type;
+
+    /**
+     * 状态(0:未处理,1:已处理)
+     */
+    private Integer status;
+
+    //医院ID
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+}

+ 54 - 0
src/main/java/com/diagbot/web/QcAbnormalController.java

@@ -0,0 +1,54 @@
+package com.diagbot.web;
+
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.QcAbnormalDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.QcAbnormalFacade;
+import com.diagbot.vo.QcAbnormalSaveVO;
+import com.diagbot.vo.QcAbnormalVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+/**
+ * <p>
+ * 异常数据监控信息 前端控制器
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-05-15
+ */
+@RequestMapping("/qc/abnormal")
+@RestController
+@Api(value = "异常数据监控相关API", tags = { "异常数据监控相关API" })
+@SuppressWarnings("unchecked")
+public class QcAbnormalController {
+    @Autowired
+    private QcAbnormalFacade qcAbnormalFacade;
+
+    @ApiOperation(value = "查询异常数据监控信息[by:gaodm]",
+            notes = "")
+    @PostMapping("/getQcAnnormal")
+    @SysLogger("getQcAnnormal")
+    public RespDTO<IPage<QcAbnormalDTO>> getQcAnnormal(@RequestBody QcAbnormalVO qcAbnormalVO) {
+        return RespDTO.onSuc(qcAbnormalFacade.getQcAnnormalFac(qcAbnormalVO));
+    }
+
+    @ApiOperation(value = "更新异常数据监控信息[by:gaodm]",
+            notes = "")
+    @PostMapping("/saveQcAnnormal")
+    @SysLogger("saveQcAnnormal")
+    @Transactional
+    public RespDTO<Boolean> saveQcAnnormal(@RequestBody @Valid QcAbnormalSaveVO qcAbnormalSaveVO) {
+        return RespDTO.onSuc(qcAbnormalFacade.saveQcAnnormal(qcAbnormalSaveVO));
+    }
+}

+ 41 - 0
src/main/resources/mapper/QcAbnormalMapper.xml

@@ -0,0 +1,41 @@
+<?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.QcAbnormalMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.QcAbnormal">
+        <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="hospital_id" property="hospitalId" />
+        <result column="behospital_code" property="behospitalCode" />
+        <result column="type" property="type" />
+        <result column="description" property="description" />
+        <result column="status" property="status" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+    <select id="getQcAnnormal" resultType="com.diagbot.dto.QcAbnormalDTO" parameterType="com.diagbot.vo.QcAbnormalVO">
+        SELECT
+        t1.*
+        FROM
+        `qc_abnormal` t1
+        WHERE
+        t1.is_deleted = 'N'
+        <if test="hospitalId != null">
+            and t1.hospital_id = #{hospitalId}
+        </if>
+        <if test="type != null">
+            and t1.type = #{type}
+        </if>
+        <if test="status != null">
+            and t1.status = #{status}
+        </if>
+        <if test="behospitalCode != null and behospitalCode != ''">
+            and t1.behospital_code like CONCAT('%',#{behospitalCode},'%')
+        </if>
+    </select>
+</mapper>

+ 1 - 1
src/test/java/com/diagbot/CodeGeneration.java

@@ -56,7 +56,7 @@ public class CodeGeneration {
         StrategyConfig strategy = new StrategyConfig();
 //        strategy.setTablePrefix(new String[] { "med_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "sys_user_hospital"}); // 需要生成的表
+        strategy.setInclude(new String[] { "qc_abnormal"}); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);