Bladeren bron

医院大模块翻页信息

gaodm 5 jaren geleden
bovenliggende
commit
df75260cc2

+ 1 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -30,6 +30,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/sys/user/getJwt").permitAll()
                 .antMatchers("/sys/user/refreshJwt").permitAll()
                 .antMatchers("/sys/user/checkToken").permitAll()
+                .antMatchers("/sys/dictionaryInfo/getDictionary").permitAll()
                 .antMatchers("/oauth/token").permitAll()
                 .antMatchers("/oauth/check_token").permitAll()
                 .antMatchers("/**").authenticated();

+ 1 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -82,6 +82,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/hystrix/**", request)
                 || matchers("/sys/user/getJwt", request)
                 || matchers("/sys/user/refreshJwt", request)
+                || matchers("/sys/dictionaryInfo/getDictionary", request)
                 || matchers("/sys/user/checkToken", request)
                 || matchers("/oauth/token", request)
                 || matchers("/oauth/check_token", request)

+ 47 - 0
src/main/java/com/diagbot/dto/QcCasesDTO.java

@@ -0,0 +1,47 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/4/12 13:58
+ */
+@Getter
+@Setter
+public class QcCasesDTO {
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 模块总分
+     */
+    private BigDecimal score;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private LocalDateTime gmtModified;
+
+    /**
+     * 病历
+     */
+    private String name;
+
+    /**
+     * 模块编码前缀
+     */
+    private String prefix;
+
+    /**
+     * 顺序号
+     */
+    private Integer orderNo;
+
+}

+ 48 - 0
src/main/java/com/diagbot/dto/SysDictionaryInfoDTO.java

@@ -0,0 +1,48 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * icss字典表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+@Getter
+@Setter
+public class SysDictionaryInfoDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 分组(值自定义)
+     */
+    private Long groupType;
+
+    /**
+     * 内容
+     */
+    private String name;
+
+    /**
+     * 值
+     */
+    private String val;
+
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 0 - 196
src/main/java/com/diagbot/entity/SysLog.java

@@ -1,196 +0,0 @@
-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 2018-09-14
- */
-public class SysLog implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 日志ID
-     */
-    @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;
-
-    /**
-     * 访问者的IP
-     */
-    private String ip;
-
-    /**
-     * 访问的系统类型 1:user-service,2:diagbotman-service,3:uaa-service,4:log-service,5:bi-service,6:knowledge-service,7:feedback-service,8:icss-web
-     */
-    private Integer sysType;
-
-    /**
-     * 方法
-     */
-    private String method;
-
-    /**
-     * 操作名
-     */
-    private String operation;
-
-    /**
-     * 参数
-     */
-    private String params;
-
-    /**
-     * 用户名
-     */
-    private String username;
-
-
-    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 String getIp() {
-        return ip;
-    }
-
-    public void setIp(String ip) {
-        this.ip = ip;
-    }
-
-    public Integer getSysType() {
-        return sysType;
-    }
-
-    public void setSysType(Integer sysType) {
-        this.sysType = sysType;
-    }
-
-    public String getMethod() {
-        return method;
-    }
-
-    public void setMethod(String method) {
-        this.method = method;
-    }
-
-    public String getOperation() {
-        return operation;
-    }
-
-    public void setOperation(String operation) {
-        this.operation = operation;
-    }
-
-    public String getParams() {
-        return params;
-    }
-
-    public void setParams(String params) {
-        this.params = params;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public void setUsername(String username) {
-        this.username = username;
-    }
-
-    @Override
-    public String toString() {
-        return "SysLog{" +
-                "id=" + id +
-                ", isDeleted=" + isDeleted +
-                ", gmtCreate=" + gmtCreate +
-                ", gmtModified=" + gmtModified +
-                ", creator=" + creator +
-                ", modifier=" + modifier +
-                ", ip=" + ip +
-                ", sysType=" + sysType +
-                ", method=" + method +
-                ", operation=" + operation +
-                ", params=" + params +
-                ", username=" + username +
-                "}";
-    }
-}

+ 22 - 0
src/main/java/com/diagbot/facade/QcCasesFacade.java

@@ -0,0 +1,22 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.QcCasesDTO;
+import com.diagbot.service.impl.QcCasesServiceImpl;
+import com.diagbot.util.SysUserUtils;
+import com.diagbot.vo.QcCasesPageVO;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/4/12 14:07
+ */
+@Component
+public class QcCasesFacade extends QcCasesServiceImpl {
+
+    public IPage<QcCasesDTO> getQcCasesFac(QcCasesPageVO qcCasesPageVO){
+        qcCasesPageVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
+        return this.getQcCases(qcCasesPageVO);
+    }
+}

+ 37 - 0
src/main/java/com/diagbot/facade/SysDictionaryFacade.java

@@ -0,0 +1,37 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.SysDictionaryInfoDTO;
+import com.diagbot.entity.SysDictionaryInfo;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.SysDictionaryInfoServiceImpl;
+import com.diagbot.util.BeanUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ListUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2018/11/23 11:37
+ */
+@Component
+public class SysDictionaryFacade extends SysDictionaryInfoServiceImpl {
+
+    /**
+     * 返回字典信息
+     *
+     * @return
+     */
+    public Map<Long, List<SysDictionaryInfoDTO>> getDictionary() {
+        List<SysDictionaryInfo> list = this.list(new QueryWrapper<SysDictionaryInfo>()
+                .in("return_type", ListUtil.arrayToList(new Long[] { 0L, 2L }))
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .orderByAsc("group_type", "order_no"));
+        List<SysDictionaryInfoDTO> listRes = BeanUtil.listCopyTo(list, SysDictionaryInfoDTO.class);
+        return EntityUtil.makeEntityListMap(listRes, "groupType");
+    }
+}

+ 0 - 13
src/main/java/com/diagbot/facade/SysLogFacade.java

@@ -1,13 +0,0 @@
-package com.diagbot.facade;
-
-import com.diagbot.service.impl.SysLogServiceImpl;
-import org.springframework.stereotype.Component;
-
-/**
- * @Description: 用户日志业务层
- * @author: gaodm
- * @time: 2018/8/6 9:11
- */
-@Component
-public class SysLogFacade extends SysLogServiceImpl {
-}

+ 0 - 16
src/main/java/com/diagbot/mapper/SysLogMapper.java

@@ -1,16 +0,0 @@
-package com.diagbot.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.diagbot.entity.SysLog;
-
-/**
- * <p>
- * Mapper 接口
- * </p>
- *
- * @author gaodm
- * @since 2018-08-02
- */
-public interface SysLogMapper extends BaseMapper<SysLog> {
-
-}

+ 0 - 15
src/main/java/com/diagbot/service/SysLogService.java

@@ -1,15 +0,0 @@
-package com.diagbot.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.diagbot.entity.SysLog;
-
-/**
- * <p>
- * 服务类
- * </p>
- *
- * @author gaodm
- * @since 2018-08-02
- */
-public interface SysLogService extends IService<SysLog> {
-}

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

@@ -1,19 +0,0 @@
-package com.diagbot.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.diagbot.entity.SysLog;
-import com.diagbot.mapper.SysLogMapper;
-import com.diagbot.service.SysLogService;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * 服务实现类
- * </p>
- *
- * @author gaodm
- * @since 2018-08-02
- */
-@Service
-public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements SysLogService {
-}

+ 21 - 0
src/main/java/com/diagbot/vo/QcCasesPageVO.java

@@ -0,0 +1,21 @@
+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/4/12 13:49
+ */
+@Getter
+@Setter
+public class QcCasesPageVO extends Page {
+    /**
+     * 医院ID
+     */
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+}

+ 0 - 110
src/main/java/com/diagbot/web/SysLogController.java

@@ -1,110 +0,0 @@
-package com.diagbot.web;
-
-
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.diagbot.annotation.SysLogger;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.SysLog;
-import com.diagbot.facade.SysLogFacade;
-import com.diagbot.vo.SysLogVo;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-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 java.util.Date;
-
-/**
- * @Description: 日志操作控制层
- * @author: gaodm
- * @time: 2018/8/30 10:12
- */
-@RestController
-@RequestMapping("/log")
-public class SysLogController {
-
-    @Autowired
-    private SysLogFacade sysLogFacade;
-
-    /**
-     * 新增日志信息
-     *
-     * @param sysLogVo 新增日志输入参数
-     * @return 新增日志是否成功
-     */
-    @ApiOperation(value = "添加日志", notes = "添加日志")
-    @PostMapping("/add")
-    @SysLogger("postLog")
-    public RespDTO add(@RequestBody SysLogVo sysLogVo) {
-        //初始化新增日志信息
-        SysLog sysLog = new SysLog();
-        sysLog.setGmtCreate(new Date());
-        sysLog.setIp(sysLogVo.getIp());
-        sysLog.setMethod(sysLogVo.getMethod());
-        sysLog.setOperation(sysLogVo.getOperation());
-        sysLog.setParams(sysLogVo.getParams());
-        return RespDTO.onSuc(sysLogFacade.save(sysLog) ? "添加成功" : "添加失败");
-    }
-
-    /**
-     * 删除日志
-     *
-     * @param id 日志信息ID
-     * @return 删除是否成功
-     */
-    @ApiOperation(value = "删除日志", notes = "删除日志")
-    @DeleteMapping("/delete/{id}")
-    @SysLogger("deleteLog")
-    public RespDTO delete(@PathVariable(value = "id") Integer id) {
-        return RespDTO.onSuc(sysLogFacade.removeById(id) ? "删除成功" : "删除失败");
-    }
-
-    /**
-     * 修改日志
-     *
-     * @param sysLog 修改日志输入参数
-     * @return 修改是否成功
-     */
-    @ApiOperation(value = "修改日志", notes = "修改日志")
-    @PostMapping("/update")
-    @SysLogger("updateLog")
-    public RespDTO update(@RequestBody SysLog sysLog) {
-        return RespDTO.onSuc(sysLogFacade.updateById(sysLog) ? "修改成功" : "修改失败");
-    }
-
-    /**
-     * 获取日志列表
-     *
-     * @return 日志列信息
-     */
-    @ApiOperation(value = "获取日志列表", notes = "获取日志列表")
-    @GetMapping("/list")
-    @SysLogger("listLog")
-    public RespDTO list() {
-        Wrapper<SysLog> wrapper = new QueryWrapper<>();
-        return RespDTO.onSuc(sysLogFacade.list(wrapper));
-    }
-
-    /**
-     * 获取日志翻页信息
-     *
-     * @return 日志翻页信息
-     */
-    @ApiOperation(value = "获取日志翻页信息", notes = "获取日志翻页信息")
-    @GetMapping("/page")
-    @SysLogger("pageLog")
-    public RespDTO page() {
-        //初始化日志翻页参数
-        IPage<SysLog> wrapper = new Page<>();
-        return RespDTO.onSuc(sysLogFacade.page(wrapper, null));
-    }
-}
-

+ 0 - 32
src/main/java/com/diagbot/web/TestController.java

@@ -1,32 +0,0 @@
-package com.diagbot.web;
-
-import com.diagbot.client.AuthServiceClient;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.JWT;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @Description:
- * @author: gaodm
- * @date: 2020/4/9 20:03
- * @version: V1.0
- */
-@RestController
-public class TestController {
-    @Autowired
-    private AuthServiceClient authServiceClient;
-    //p:dc483e80a7a0bd9ef71d8cf973673924
-    @PostMapping(value = "/test/oauth/token")
-    public JWT getToken(String username, String password) {
-        return authServiceClient.getToken("Basic dWFhLXNlcnZpY2U6MTIzNDU2",
-                "password", username, password);
-    }
-
-    @PostMapping(value = "/statistics/count")
-    public RespDTO<Boolean> getToken() {
-        return RespDTO.onSuc(true);
-    }
-}

+ 18 - 0
src/main/resources/mapper/QcCasesHospitalMapper.xml

@@ -0,0 +1,18 @@
+<?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.QcCasesHospitalMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.QcCasesHospital">
+        <id column="id" property="id" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="cases_id" property="casesId" />
+        <result column="score" property="score" />
+        <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" />
+    </resultMap>
+
+</mapper>

+ 36 - 0
src/main/resources/mapper/QcCasesMapper.xml

@@ -0,0 +1,36 @@
+<?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.QcCasesMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.QcCases">
+        <id column="id" property="id" />
+        <result column="name" property="name" />
+        <result column="prefix" property="prefix" />
+        <result column="order_no" property="orderNo" />
+        <result column="remark" property="remark" />
+        <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" />
+    </resultMap>
+
+    <select id="getQcCases" resultType="com.diagbot.dto.QcCasesDTO">
+        SELECT
+            qch.*,
+            qc.`name` AS NAME,
+            qc.prefix AS prefix
+        FROM
+            `qc_cases_hospital` qch,
+            qc_cases qc
+        WHERE
+            qch.cases_id = qc.id
+        AND qch.is_deleted = 'N'
+        AND qc.is_deleted = 'N'
+        <if test="hospitalId != null and hospitalId != ''">
+            and qch.hospital_id = #{hospitalId}
+        </if>
+        order by qch.gmt_modified desc
+    </select>
+</mapper>

+ 21 - 0
src/main/resources/mapper/SysDictionaryInfoMapper.xml

@@ -0,0 +1,21 @@
+<?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.SysDictionaryInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.SysDictionaryInfo">
+        <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="group_type" property="groupType" />
+        <result column="name" property="name" />
+        <result column="val" property="val" />
+        <result column="return_type" property="returnType" />
+        <result column="order_no" property="orderNo" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>

+ 0 - 22
src/main/resources/mapper/SysLogMapper.xml

@@ -1,22 +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.SysLogMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.diagbot.entity.SysLog">
-        <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="ip" property="ip"/>
-        <result column="sys_type" property="sysType"/>
-        <result column="method" property="method"/>
-        <result column="operation" property="operation"/>
-        <result column="params" property="params"/>
-        <result column="username" property="username"/>
-    </resultMap>
-
-</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[] { "sys_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "bas_hospital_info" }); // 需要生成的表
+        strategy.setInclude(new String[] { "qc_cases","qc_cases_hospital" }); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);