浏览代码

添加用户基本操作接口

ljx 4 年之前
父节点
当前提交
5096fa1c00
共有 24 个文件被更改,包括 1224 次插入1 次删除
  1. 57 0
      src/main/java/com/imed/costaccount/common/config/exception/BusinessException.java
  2. 70 0
      src/main/java/com/imed/costaccount/common/config/exception/ExceptionHandle.java
  3. 167 0
      src/main/java/com/imed/costaccount/constants/CommonConstant.java
  4. 43 0
      src/main/java/com/imed/costaccount/constants/FileConstant.java
  5. 100 0
      src/main/java/com/imed/costaccount/constants/NumberConstant.java
  6. 10 0
      src/main/java/com/imed/costaccount/constants/RedisKeyConstant.java
  7. 1 1
      src/main/java/com/imed/costaccount/controller/LoginController.java
  8. 77 0
      src/main/java/com/imed/costaccount/controller/UserController.java
  9. 64 0
      src/main/java/com/imed/costaccount/controller/response/CommonResponse.java
  10. 39 0
      src/main/java/com/imed/costaccount/enums/CheckStatusEnum.java
  11. 64 0
      src/main/java/com/imed/costaccount/enums/DateStyleEnum.java
  12. 47 0
      src/main/java/com/imed/costaccount/enums/ErrorCodeEnum.java
  13. 39 0
      src/main/java/com/imed/costaccount/enums/NoticeBusinessEnum.java
  14. 25 0
      src/main/java/com/imed/costaccount/enums/NoticeOriginEnum.java
  15. 52 0
      src/main/java/com/imed/costaccount/enums/NoticeTemplateEnum.java
  16. 41 0
      src/main/java/com/imed/costaccount/enums/PermissionEnum.java
  17. 39 0
      src/main/java/com/imed/costaccount/enums/PlanStatusEnum.java
  18. 37 0
      src/main/java/com/imed/costaccount/enums/ResponseCodeEnum.java
  19. 26 0
      src/main/java/com/imed/costaccount/enums/SituationEnum.java
  20. 40 0
      src/main/java/com/imed/costaccount/enums/TaskCirculationEnum.java
  21. 12 0
      src/main/java/com/imed/costaccount/enums/WSMessageTypeEnum.java
  22. 96 0
      src/main/java/com/imed/costaccount/enums/WeekEnum.java
  23. 59 0
      src/main/java/com/imed/costaccount/model/Hosptail.java
  24. 19 0
      src/main/resources/mapper/UserMapper.xml

+ 57 - 0
src/main/java/com/imed/costaccount/common/config/exception/BusinessException.java

@@ -0,0 +1,57 @@
+package com.imed.costaccount.common.config.exception;
+
+
+import com.imed.costaccount.constants.CommonConstant;
+import com.imed.costaccount.enums.ErrorCodeEnum;
+import com.imed.costaccount.enums.ResponseCodeEnum;
+
+/**
+ * @Description: 基类异常信息
+ */
+public class BusinessException extends RuntimeException {
+
+    private String code;
+
+    private String message;
+
+    public BusinessException(String code, String message) {
+        super(message);
+        this.code = code;
+        this.message = message;
+    }
+
+    public BusinessException(String message) {
+        super(message);
+        this.code = CommonConstant.ERROR;
+        this.message = message;
+    }
+
+    /**
+     * 自定义异常
+     * @param enums 异常的枚举类型
+     */
+    public BusinessException(ErrorCodeEnum enums) {
+        super(enums.getDescription());
+        this.code = enums.getCode();
+        this.message = enums.getDescription();
+    }
+
+    /**
+     * 自定义的系统异常类型
+     * @param enums
+     */
+    public BusinessException(ResponseCodeEnum enums) {
+        super(enums.getMessage());
+        this.code = enums.getCode();
+        this.message = enums.getMessage();
+    }
+
+	public String getCode() {
+		return code;
+	}
+
+	@Override
+	public String getMessage() {
+		return message;
+	}
+}

+ 70 - 0
src/main/java/com/imed/costaccount/common/config/exception/ExceptionHandle.java

@@ -0,0 +1,70 @@
+package com.imed.costaccount.common.config.exception;
+
+import com.imed.costaccount.constants.CommonConstant;
+import com.imed.costaccount.controller.response.CommonResponse;
+import com.imed.costaccount.enums.ResponseCodeEnum;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.dao.DataAccessException;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.converter.HttpMessageConversionException;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.MissingServletRequestParameterException;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.ResponseStatus;
+
+/**
+ * 自定义异常信息
+ * TODO 建议加上@ResponseStatus
+ */
+@ControllerAdvice
+@Slf4j
+public class ExceptionHandle {
+
+    @ResponseBody
+    @ExceptionHandler(value = MethodArgumentNotValidException.class)
+    public CommonResponse handleMethodArgumentNotValidException(MethodArgumentNotValidException e) {
+        String msg = e.getBindingResult().getFieldError().getField() + CommonConstant.SEPARATOR_NUMBER + e.getBindingResult().getFieldError().getDefaultMessage();
+        log.error("参数校验失败:[{}]", msg);
+        return new CommonResponse(ResponseCodeEnum.ILLEGAL_ARGUMENT.getCode(), msg);
+    }
+
+    @ResponseBody
+    @ExceptionHandler(value = MissingServletRequestParameterException.class)
+    public CommonResponse handleMethodArgumentNotValidException(MissingServletRequestParameterException e) {
+        log.error("参数校验失败:[{}]", e.getParameterName());
+        return new CommonResponse(ResponseCodeEnum.ILLEGAL_ARGUMENT.getCode(), ResponseCodeEnum.ILLEGAL_ARGUMENT.getMessage() + CommonConstant.SEPARATOR_NUMBER + e.getParameterName());
+    }
+
+    @ResponseBody
+    @ResponseStatus(HttpStatus.BAD_REQUEST)
+    @ExceptionHandler(value = HttpMessageConversionException.class)
+    public CommonResponse handleMissingServletRequestParameter(HttpMessageConversionException e) {
+        log.error("参数解析异常:{}", e.getMessage());
+        return new CommonResponse(ResponseCodeEnum.ILLEGAL_ARGUMENT.getCode(), "参数解析异常");
+    }
+
+    @ExceptionHandler(value = BusinessException.class)
+    @ResponseBody
+    public CommonResponse handleBusinessException(BusinessException e) {
+        log.error("自定义异常:{}", e.getMessage(), e);
+        return new CommonResponse(e);
+    }
+
+    @ExceptionHandler(DataAccessException.class)
+    @ResponseBody
+    public CommonResponse handleDataAccessException(DataAccessException e) {
+        log.error("数据库错误:{}", e.getMessage(), e);
+        return new CommonResponse(ResponseCodeEnum.DATABASE_ERROR);
+
+    }
+
+    @ExceptionHandler(Exception.class)
+    @ResponseBody
+    public CommonResponse handleException(Exception e) {
+        log.error("系统异常:{}", e.getMessage(), e);
+        return new CommonResponse(ResponseCodeEnum.ERROR);
+    }
+
+}

+ 167 - 0
src/main/java/com/imed/costaccount/constants/CommonConstant.java

@@ -0,0 +1,167 @@
+package com.imed.costaccount.constants;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @Description: 分隔符公共类
+ */
+public final class CommonConstant {
+    public CommonConstant() {
+    }
+
+    /**
+     * 分割符-分号
+     */
+    public static final String SEPARATOR_SEMICOLON = ";";
+
+    /**
+     * 分割符-右箭头
+     */
+    public static final String RIGHT_ARROWS = "→";
+
+    /**
+     * 分割符-分号
+     */
+    public static final String SEPARATOR_SEMICOLON_C = ";";
+
+    /**
+     * 分割符-冒号
+     */
+    public static final String SEPARATOR_NUMBER = ":";
+
+    /**
+     * 分割符-冒号
+     */
+    public static final String SEPARATOR_NUMBER_C = ":";
+
+    /**
+     *  分割符-下划线
+     */
+    public static final String SEPARATOR_UNDERLINE = "_";
+    /**
+     * 分割符-竖线
+     */
+    public static final String SEPARATOR_VERTICALLINE="\\|";
+
+    /**
+     * 分割符-逗号
+     */
+    public static final String SEPARATOR_COMMA = ",";
+
+    /**
+     * 分割符-逗号
+     */
+    public static final String SEPARATOR_COMMA_C = ",";
+
+
+    /**
+     * 分割符-反斜杠
+     */
+    public static final String SEPARATOR_BACKSLASH = "/";
+
+    /**
+     * 分割符-反斜杠
+     */
+    public static final String SEPARATOR_BACKSLASH_C = "、";
+
+    /**
+     * 分割符-横杠
+     */
+    public static final String SEPARATOR_WHIPPTREE = "-";
+
+
+    /**
+     * 分割符-波浪号
+     */
+    public static final String SEPARATOR_WAVE = "~";
+
+    /**
+     * 分割符-分号
+     */
+    public static final String SEPARATOR_POINT = ".";
+
+    /**
+     * 分割符-分号
+     */
+    public static final String SEPARATOR_POINT_C = "。";
+
+    /**
+     * 分割符-空格
+     */
+    public static final String SEPARATOR_BlankSpace = " ";
+
+
+    /**
+     * 常量A
+     */
+    public static final String SEPARATOR_A = "A";
+    /**
+     * 左括号
+     */
+    public static final String LEFT_PARENTHESES = "(";
+    /**
+     * 左括号
+     */
+    public static final String LEFT_PARENTHESES_C = "(";
+    /**
+     * 右括号
+     */
+    public static final String RIGHT_PARENTHESES = ")";
+
+    /**
+     * 右括号
+     */
+    public static final String RIGHT_PARENTHESES_C = ")";
+    /**
+     * 导管表默认时间
+     */
+    public static final String ZERO_POINT = "0001-01-01 00:00:00";
+
+    /**
+     * 分隔符 - 乘号
+     */
+    public static final String MULTIPLICATION_SIGN = "×";
+
+
+    /**
+     * 分隔符 - 加号
+     */
+
+    public static final String MULTIPLICATION_PLUS = "\\+";
+
+    /**
+     * error
+     */
+    public static final String ERROR = "error";
+
+    /**
+     * UTF_8
+     */
+    public static final String UTF_8 = "UTF-8";
+
+    public static final String BLANK = " ";
+
+    /** 取消/作废 */
+    public static final Integer CANCEL = 1;
+    /** 正常 */
+    public static final Integer ENABLE = 0;
+
+    public static final String LIMIT_1 = "limit 1";
+
+    public static final String TOKEN = "token";
+
+    public static final String CHECK_PLAN_MSG_TITLE = "你有一个查核计划即将开始";
+
+    public static final String NULL = "";
+
+    public static final String X = "+";
+
+    public static final List<Integer> ADMIN = Arrays.asList(2, 5, 10);
+
+    public static final List<Integer> DEPT_MANAGER = Arrays.asList(1, 3, 12, 14, 16, 18);
+
+    public static final List<Integer> IMPROVER = Arrays.asList(4, 6, 7, 8, 9, 11, 13, 15);
+
+    public static final String NOT_APPLICABLE_NAME = "不适用";
+}

+ 43 - 0
src/main/java/com/imed/costaccount/constants/FileConstant.java

@@ -0,0 +1,43 @@
+package com.imed.costaccount.constants;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 文件名常量
+ */
+public final class FileConstant {
+    public FileConstant() {
+    }
+
+    /**
+     * 图片后缀名
+     */
+    public static final List<String> PIC_SUFFIX = Arrays.asList(new String[]{"jpeg", "gif", "png", "ico", "jpg"});
+    /**
+     * excel后缀名
+     */
+    public static final List<String> EXCEL_SUFFIX = Arrays.asList(new String[]{"xls", "xlsx"});
+    /**
+     * word后缀名
+     */
+    public static final List<String> WORD_SUFFIX = Arrays.asList(new String[]{"doc", "docx"});
+    /**
+     * ppt后缀名
+     */
+    public static final List<String> PPT_SUFFIX = Arrays.asList(new String[]{"ppt", "pptx"});
+    /**
+     * pdf后缀名
+     */
+    public static final String PDF_SUFFIX = "pdf";
+    /**
+     * txt后缀名
+     */
+    public static final String TXT_SUFFIX = "txt";
+
+    /**
+     * mp4后缀名
+     */
+    public static final String MP4_SUFFIX = "mp4";
+
+}

+ 100 - 0
src/main/java/com/imed/costaccount/constants/NumberConstant.java

@@ -0,0 +1,100 @@
+package com.imed.costaccount.constants;
+
+/**
+ * 数字设置
+ */
+public final class NumberConstant {
+    public NumberConstant() {
+    }
+
+    /**
+     * 零
+     */
+    public static final Integer ZERO = 0;
+
+    /**
+     * 一
+     */
+    public static final Integer ONE = 1;
+
+    /**
+     * 二
+     */
+    public static final Integer TWO = 2;
+
+    /**
+     * 三
+     */
+    public static final Integer THREE = 3;
+
+    /**
+     * 四
+     */
+    public static final Integer FOUR = 4;
+
+    /**
+     * 五
+     */
+    public static final Integer FIVE = 5;
+
+    /**
+     * 六
+     */
+    public static final Integer SIX = 6;
+
+    /**
+     * 七
+     */
+    public static final Integer SEVEN = 7;
+
+    /**
+     * 八
+     */
+    public static final Integer EIGHT = 8;
+
+    /**
+     * 九
+     */
+    public static final Integer NINE = 9;
+
+    /**
+     * 10
+     */
+    public static final Integer TEN = 10;
+
+    /**
+     * 二十四
+     */
+    public static final Integer TWENTY_FOUR = 24;
+
+    /**
+     * 三十
+     */
+    public static final Integer THIRTY = 30;
+
+    /**
+     * 五十八
+     */
+    public static final Integer FIFTY_EIGHT = 58;
+
+    /**
+     * 五十九
+     */
+    public static final Integer FIFTY_NINE = 59;
+
+    /**
+     * 一百
+     */
+    public static final Integer ONE_HUNDRED = 100;
+    /**
+     * 一千
+     */
+    public static final Integer ONE_THOUSAND = 1000;
+
+    /**
+     * 负一
+     */
+    public static final Integer NEGATIVE = -1;
+
+
+}

+ 10 - 0
src/main/java/com/imed/costaccount/constants/RedisKeyConstant.java

@@ -0,0 +1,10 @@
+package com.imed.costaccount.constants;
+
+/**
+ * @Description: redis key
+ */
+public final class RedisKeyConstant {
+    public RedisKeyConstant() {
+    }
+
+}

+ 1 - 1
src/main/java/com/imed/costaccount/web/LoginController.java → src/main/java/com/imed/costaccount/controller/LoginController.java

@@ -1,4 +1,4 @@
-package com.imed.costaccount.web;
+package com.imed.costaccount.controller;
 
 import com.imed.costaccount.common.util.Result;
 import com.imed.costaccount.model.dto.LoginDTO;

+ 77 - 0
src/main/java/com/imed/costaccount/controller/UserController.java

@@ -0,0 +1,77 @@
+package com.imed.costaccount.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import com.imed.costaccount.common.util.PageUtils;
+import com.imed.costaccount.controller.response.CommonResponse;
+import com.imed.costaccount.model.User;
+import com.imed.costaccount.service.UserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 用户表
+ *
+ * @author KCYG
+ * @date 2021-07-26 08:52:56
+ */
+@RestController
+@RequestMapping("/user")
+public class UserController {
+    @Autowired
+    private UserService userService;
+
+    /**
+     * 列表
+     */
+//    @RequestMapping("/list")
+//    public CommonResponse list(@RequestParam Map<String, Object> params){
+//        PageUtils page = userService.queryPage(params);
+//        return CommonResponse.success(page);
+//    }
+
+    @GetMapping("/list")
+    public CommonResponse list(){
+        List<User> userList = userService.list();
+        return CommonResponse.success(userList);
+    }
+
+    /**
+     * 信息
+     */
+    @GetMapping("/info/{id}")
+    public CommonResponse info(@PathVariable("id") Integer id){
+		User user = userService.getById(id);
+        return CommonResponse.success(user);
+    }
+
+    /**
+     * 保存
+     */
+    @PostMapping("/save")
+    public CommonResponse save(@RequestBody User user){
+		userService.save(user);
+        return CommonResponse.success();
+    }
+
+    /**
+     * 修改
+     */
+    @PutMapping("/update")
+    public CommonResponse update(@RequestBody User user){
+		userService.updateById(user);
+        return CommonResponse.success();
+    }
+
+    /**
+     * 删除
+     */
+    @DeleteMapping("/delete")
+    public CommonResponse delete(@RequestBody Integer[] ids){
+		userService.removeByIds(Arrays.asList(ids));
+        return CommonResponse.success();
+    }
+
+}

+ 64 - 0
src/main/java/com/imed/costaccount/controller/response/CommonResponse.java

@@ -0,0 +1,64 @@
+package com.imed.costaccount.controller.response;
+
+import com.imed.costaccount.common.config.exception.BusinessException;
+import com.imed.costaccount.enums.ResponseCodeEnum;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class CommonResponse<T> implements Serializable {
+    private static final long serialVersionUID = 3978461145132490879L;
+
+    private String code;// 返回码
+
+    private String msg;// 返回消息
+
+    private T data;// 数据源
+
+    public CommonResponse(String code, String msg, T data) {
+        this.code = code;
+        this.msg = msg;
+        this.data = data;
+    }
+
+    public CommonResponse(String code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public CommonResponse(ResponseCodeEnum responseCodeEnum) {
+        this.code = responseCodeEnum.getCode();
+        this.msg = responseCodeEnum.getMessage();
+    }
+
+    public CommonResponse(BusinessException exception) {
+        this.code = exception.getCode();
+        this.msg = exception.getMessage();
+    }
+
+    public static <T> CommonResponse success(T data) {
+        return new CommonResponse<>(ResponseCodeEnum.SUCCESS.getCode(),
+                ResponseCodeEnum.SUCCESS.getMessage(), data);
+    }
+
+    public static <T> CommonResponse success(T data, String msg) {
+        return new CommonResponse<>(ResponseCodeEnum.SUCCESS.getCode(), msg, data);
+    }
+
+    public static CommonResponse success() {
+        return success(null);
+    }
+
+    public static <T> CommonResponse error(String msg) {
+        return new CommonResponse<>(ResponseCodeEnum.FAIL.getCode(), msg, null);
+    }
+
+    public static <T> CommonResponse error(String code, String msg) {
+        return new CommonResponse<>(code, msg, null);
+    }
+
+    public static <T> CommonResponse error(String code, String msg, T data) {
+        return new CommonResponse<>(code, msg, data);
+    }
+}

+ 39 - 0
src/main/java/com/imed/costaccount/enums/CheckStatusEnum.java

@@ -0,0 +1,39 @@
+package com.imed.costaccount.enums;
+
+import java.util.Objects;
+
+/**
+ * 计划状态枚举
+ */
+public enum CheckStatusEnum {
+    NOT_START(1, "未开始"),
+    START(2, "查核中"),
+    END(3, "已完成"),
+    ;
+
+    private Integer key;
+
+    private String value;
+
+    CheckStatusEnum(Integer key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public Integer getKey() {
+        return key;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public static String getByCode(Integer key) {
+        for (CheckStatusEnum jobUserTypeEnum : CheckStatusEnum.values()) {
+            if (Objects.equals(key, jobUserTypeEnum.key)) {
+                return jobUserTypeEnum.value;
+            }
+        }
+        return null;
+    }
+}

+ 64 - 0
src/main/java/com/imed/costaccount/enums/DateStyleEnum.java

@@ -0,0 +1,64 @@
+package com.imed.costaccount.enums;
+
+public enum DateStyleEnum {
+    DD("dd"),
+    MM_DD("MM-dd"),
+    YYYY("yyyy"),
+    YYYYMM("yyyyMM"),
+    YYYY_MM("yyyy-MM"),
+    MM("MM"),
+    YYYY_MM_DD("yyyy-MM-dd"),
+    MM_DD_HH_MM("MM-dd HH:mm"),
+    MM_DD_HH_MM_SS("MM-dd HH:mm:ss"),
+    YYYY_MM_DD_HH("yyyy-MM-dd HH"),
+    YYYY_MM_DD_HH_MM("yyyy-MM-dd HH:mm"),
+    YYYY_MM_DD_HH_MM_SS("yyyy-MM-dd HH:mm:ss"),
+
+    MM_DD_EN("MM/dd"),
+    YYYY_MM_EN("yyyy/MM"),
+    YYYY_MM_DD_EN("yyyy/MM/dd"),
+    MM_DD_HH_MM_EN("MM/dd HH:mm"),
+    MM_DD_HH_MM_SS_EN("MM/dd HH:mm:ss"),
+    YYYY_MM_DD_HH_MM_EN("yyyy/MM/dd HH:mm"),
+    YYYY_MM_DD_HH_MM_SS_EN("yyyy/MM/dd HH:mm:ss"),
+    YYYY_M_D_H_MM_SS_EN("yyyy/M/d H:mm:ss"),
+
+    MM_DD_CN("MM月dd日"),
+    YYYY_MM_CN("yyyy年MM月"),
+    YYYY_MM_DD_CN("yyyy年MM月dd日"),
+    MM_DD_HH_MM_CN("MM月dd日 HH:mm"),
+    MM_DD_HH_MM_SS_CN("MM月dd日 HH:mm:ss"),
+    YYYY_MM_DD_HH_MM_CN("yyyy年MM月dd日 HH:mm"),
+    YYYY_MM_DD_HH_MM_SS_CN("yyyy年MM月dd日 HH:mm:ss"),
+
+    HH("HH"),
+    HH_MM("HH:mm"),
+    HH_MM_SS("HH:mm:ss"),
+
+    YYYYMMDD("yyyyMMdd"),
+    YYYYMMDD_HH_MM_SS("yyyyMMdd HH:mm:ss"),
+
+    YYMMDDHHMMSS("yyyyMMddHHmmss"),
+
+    YYMMDDHHMMSSSSS("yyMMddHHmmssSSS"),
+
+    YYYYMMDDHHMMSSSSS("yyyyMMddHHmmssSSS"),
+
+    SSSSSS("ssSSSS"),
+
+    HHMMSS("HHmmss"),
+
+    AM("上午"),
+
+    PM("下午");
+
+    private String value;
+
+    DateStyleEnum(String value) {
+        this.value = value;
+    }
+
+    public String getValue() {
+        return value;
+    }
+}

+ 47 - 0
src/main/java/com/imed/costaccount/enums/ErrorCodeEnum.java

@@ -0,0 +1,47 @@
+package com.imed.costaccount.enums;
+
+public enum ErrorCodeEnum {
+    VERSION_NO_NOT_EXIST("400", "版本号不能为空"),
+    DATA_NOT_EXIST("DATA_NOT_EXIST", "数据不存在"),
+    USER_NOT_EXIST("USER_NOT_EXIST", "用户不存在"),
+    USER_PASS_FALSE("USER_PASS_FALSE", "用户名或密码错误"),
+    USER_NOT_LOGIN("401", "用户未登录"),
+    NO_PERMISSION("NO_PERMISSION", "权限不足"),
+    SITUATION_NOT_EXIST("4", "情景不存在"),
+    SITUATION_NAME_EXIST("SITUATION_NAME_EXIST", "情景名称已存在"),
+    TASK_NOT_EXIST("6", "改善任务不存在"),
+    NOTICE_TEMPLATE_NOT_EXIST("NOTICE_TEMPLATE_NOT_EXIST","消息模板未配置"),
+    CHECK_GROUP_EMPTY("CHECK_GROUP_EMPTY", "查核组未选择"),
+    PLAN_HAS_START("PLAN_HAS_START", "计划已开始"),
+    HOSP_NOT_EXIST("HOSP_NOT_EXIST", "用户医院不存在"),
+    FILE_UPLOAD("7", "图片上传失败"),
+    FILE_EMP("8", "上传内容不能为空"),
+    PLAN_NOT_EXIST("PLAN_NOT_EXIST", "计划不存在"),
+    CHECK_DETAIL_NOT_EXIST("9", "查核项不存在"),
+    PLAN_CAN_NOT_ADVANCE("PLAN_CAN_NOT_ADVANCE", "本计划不能提前开始"),
+    PLAN_CAN_NOT_ADD("PLAN_CAN_NOT_ADD", "本情景已结束不能新增"),
+    MODIFY_PASSWORD_ERROR_NOT_EQUAL("10", "两次输入密码不相同"),
+    RESPONSIBLE_USER_NOT_EXIST("500", "批量查核前,请选择某个查核项的当事人"),
+    RESPONSIBLE_USER_NEED_CHECKER("500", "非查核组员不允许分配当事人"),
+    NOTICE_TIME_ERROR("500", "计划提前提醒时间不正确"),
+    PARAM_ERROR("500", "参数错误"),
+    ;
+
+    private String code;
+
+    private String description;
+
+    ErrorCodeEnum(String code, String description) {
+        this.code = code;
+        this.description = description;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+}

+ 39 - 0
src/main/java/com/imed/costaccount/enums/NoticeBusinessEnum.java

@@ -0,0 +1,39 @@
+package com.imed.costaccount.enums;
+
+import java.util.Objects;
+
+/**
+ * 消息枚举
+ */
+public enum NoticeBusinessEnum {
+    CHECK_PLAN(1, "查核计划"),
+    IMPROVE_TASK(2, "改善任务"),
+    SITUATION_DETAIL(3, "情境详情"),
+    ;
+
+    private Integer key;
+
+    private String value;
+
+    NoticeBusinessEnum(Integer key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public Integer getKey() {
+        return key;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public static String getByCode(Integer key) {
+        for (NoticeBusinessEnum jobUserTypeEnum : NoticeBusinessEnum.values()) {
+            if (Objects.equals(key, jobUserTypeEnum.key)) {
+                return jobUserTypeEnum.value;
+            }
+        }
+        return null;
+    }
+}

+ 25 - 0
src/main/java/com/imed/costaccount/enums/NoticeOriginEnum.java

@@ -0,0 +1,25 @@
+package com.imed.costaccount.enums;
+
+public enum NoticeOriginEnum {
+    SITUATION("SITUATION", "情境创建或修改(来源id为情境id)"),
+    CHECK_DISTRIBUTE("CHECK_DISTRIBUTE", "查核者单位分配(来源id为查核/单位)"),
+    ;
+
+    private String code;
+
+    private String description;
+
+    NoticeOriginEnum(String code, String description) {
+        this.code = code;
+        this.description = description;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+}

+ 52 - 0
src/main/java/com/imed/costaccount/enums/NoticeTemplateEnum.java

@@ -0,0 +1,52 @@
+package com.imed.costaccount.enums;
+
+import java.util.Objects;
+
+/**
+ * 权限枚举
+ */
+public enum NoticeTemplateEnum {
+    CHECK_PLAN("CHECK_PLAN", "查核计划提醒"),
+    IMPROVE_START("IMPROVE_START", "改善通知提醒"),
+    IMPROVE_REPLY("IMPROVE_REPLY", "改善回复提交"),
+    IMPROVE_ASSIGN("IMPROVE_ASSIGN", "改善任务指派"),
+    APPLY_REASSIGN("APPLY_REASSIGN", "申请更换改善人"),
+    DISAPPROVAL("DISAPPROVAL", "不认可提醒"),
+    REJECT_REASSIGN("REJECT_REASSIGN", "驳回申请更换改善人"),
+    RESEND("RESEND", "重新发送改善通知"),
+    APPROVED_PLAN("APPROVED_PLAN", "通过改善计划"),
+    REJECT("REJECT", "驳回计划方案"),
+    SUBMIT_PLAN("SUBMIT_PLAN", "提交改善计划"),
+    SUBMIT_PDCA("SUBMIT_PDCA", "提交改善方案"),
+    APPROVED_PDCA("APPROVED_PDCA", "通过改善方案"),
+    IMPROVE_FINISHED("IMPROVE_FINISHED", "改善结案"),
+    ALL_RESTART("ALL_RESTART", "改善重新开始")
+
+    ;
+
+    private String key;
+
+    private String value;
+
+    NoticeTemplateEnum(String key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public static String getByCode(String key) {
+        for (NoticeTemplateEnum jobUserTypeEnum : NoticeTemplateEnum.values()) {
+            if (Objects.equals(key, jobUserTypeEnum.key)) {
+                return jobUserTypeEnum.value;
+            }
+        }
+        return null;
+    }
+}

+ 41 - 0
src/main/java/com/imed/costaccount/enums/PermissionEnum.java

@@ -0,0 +1,41 @@
+package com.imed.costaccount.enums;
+
+import java.util.Objects;
+
+/**
+ * 权限枚举
+ */
+public enum PermissionEnum {
+    ADMIN(1, "管理员"),
+    CHECK_MANAGER(2, "查核组长"),
+    CHECK_MAN(3, "查核组员"),
+    DEPT_MANAGER(4, "单位负责人"),
+    IMPROVER(5, "改善者"),
+    ;
+
+    private Integer key;
+
+    private String value;
+
+    PermissionEnum(Integer key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public Integer getKey() {
+        return key;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public static String getByCode(Integer key) {
+        for (PermissionEnum jobUserTypeEnum : PermissionEnum.values()) {
+            if (Objects.equals(key, jobUserTypeEnum.key)) {
+                return jobUserTypeEnum.value;
+            }
+        }
+        return null;
+    }
+}

+ 39 - 0
src/main/java/com/imed/costaccount/enums/PlanStatusEnum.java

@@ -0,0 +1,39 @@
+package com.imed.costaccount.enums;
+
+import java.util.Objects;
+
+/**
+ * 计划状态枚举
+ */
+public enum PlanStatusEnum {
+    NOT_START(1, "未开始"),
+    START(2, "进行中"),
+    END(3, "已结束"),
+    ;
+
+    private Integer key;
+
+    private String value;
+
+    PlanStatusEnum(Integer key, String value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public Integer getKey() {
+        return key;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public static String getByCode(Integer key) {
+        for (PlanStatusEnum jobUserTypeEnum : PlanStatusEnum.values()) {
+            if (Objects.equals(key, jobUserTypeEnum.key)) {
+                return jobUserTypeEnum.value;
+            }
+        }
+        return null;
+    }
+}

+ 37 - 0
src/main/java/com/imed/costaccount/enums/ResponseCodeEnum.java

@@ -0,0 +1,37 @@
+package com.imed.costaccount.enums;
+
+public enum ResponseCodeEnum {
+    SUCCESS("SUCCESS", "返回成功"),
+
+    ILLEGAL_ARGUMENT("400", "参数校验失败"),
+
+    FAIL("500", "返回失败"),
+
+    ERROR("ERROR", "系统异常"),
+
+    DATABASE_ERROR("999", "数据库错误"),
+
+    TOKEN_INVALID("403", "认证失败"),
+
+    PERMISSION_NULL("402", "未选择角色"),
+
+    ;
+
+    private final String code;
+
+    private final String message;
+
+    ResponseCodeEnum(String code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+}

+ 26 - 0
src/main/java/com/imed/costaccount/enums/SituationEnum.java

@@ -0,0 +1,26 @@
+package com.imed.costaccount.enums;
+
+import lombok.Getter;
+
+/**
+ * 情景枚举,根据医院需求可能通过DB维护
+ */
+@Getter
+public enum SituationEnum {
+
+    NORMAL_SITUATION(1, "普通情景"),
+    PAGING_SITUATION(2, "分页情景"),
+    CATEGORY_SITUATION(3, "小分类情景"),
+    ;
+
+    private Integer situationType;
+
+    private String situationName;
+
+    SituationEnum(Integer situationType, String situationName) {
+        this.situationName = situationName;
+        this.situationType = situationType;
+    }
+
+
+}

+ 40 - 0
src/main/java/com/imed/costaccount/enums/TaskCirculationEnum.java

@@ -0,0 +1,40 @@
+package com.imed.costaccount.enums;
+
+/**
+ * @description: imed-pfm
+ * @author: juejueguai
+ * @date: 2021/2/1 11:42
+ * @copyright: Copyright (c) 2020
+ * @version: V1.0
+ * @modified: juejueguai
+ */
+public enum TaskCirculationEnum {
+    UNALLOCATED(1, "创建改善任务"),
+    ALLOCATED(2, "创建任务完成后指派改善任务"),
+    DONT_APPROVAL(3, "不认可"),
+    DESIGNATED_SCHEME(4, "制定改善方案"),
+    PDCA_CHECK(5, "PDCA改善方案审核"),
+    PDCA_ADOPT(6, "PDCA改善方案通过"),
+    CHECKING(7, "单位负责人审核中"),
+    CHECKING_PASS(8, "单位负责人审核通过"),
+    ADMIN_CHECKING(9, "管理员审核中"),
+    ADMIN_CHECKING_PASS(10, "管理员审核通过")
+    ;
+
+    private Integer taskType;
+
+    private String description;
+
+    TaskCirculationEnum(Integer taskType, String description) {
+        this.taskType = taskType;
+        this.description = description;
+    }
+
+    public Integer getTaskType() {
+        return taskType;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+}

+ 12 - 0
src/main/java/com/imed/costaccount/enums/WSMessageTypeEnum.java

@@ -0,0 +1,12 @@
+package com.imed.costaccount.enums;
+
+public enum WSMessageTypeEnum {
+    /**
+     * 未读消息
+     */
+    TO_READ,
+    /**
+     * 有未读消息
+     */
+    NO_READ;;
+}

+ 96 - 0
src/main/java/com/imed/costaccount/enums/WeekEnum.java

@@ -0,0 +1,96 @@
+package com.imed.costaccount.enums;
+
+/**
+ * 星期一 ~ 星期日
+ *
+ * @author lys
+ * @ClassName: WeekEnum
+ * @Description: (这里用一句话描述这个类的作用)
+ * @date 2015年3月5日 下午1:47:27
+ */
+public enum WeekEnum {
+
+    /**
+     * 星期一
+     */
+    MONDAY("星期一", "Monday", "Mon.", 1),
+    /**
+     * 星期二
+     */
+    TUESDAY("星期二", "Tuesday", "Tues.", 2),
+    /**
+     * 星期三
+     */
+    WEDNESDAY("星期三", "Wednesday", "Wed.", 3),
+    /**
+     * 星期四
+     */
+    THURSDAY("星期四", "Thursday", "Thur.", 4),
+    /**
+     * 星期五
+     */
+    FRIDAY("星期五", "Friday", "Fri.", 5),
+    /**
+     * 星期六
+     */
+    SATURDAY("星期六", "Saturday", "Sat.", 6),
+    /**
+     * 星期日
+     */
+    SUNDAY("星期日", "Sunday", "Sun.", 7);
+
+    private String name_cn;
+    private String name_en;
+    private String name_enShort;
+    private int number;
+
+    private WeekEnum(String name_cn, String name_en, String name_enShort, int number) {
+        this.name_cn = name_cn;
+        this.name_en = name_en;
+        this.name_enShort = name_enShort;
+        this.number = number;
+    }
+
+    /**
+     * 中文名获取
+     *
+     * @return
+     * @Title: getChineseName
+     * @Description: (这里用一句话描述这个方法的作用)
+     * @date 2015年3月5日 下午1:48:13
+     * @author lys
+     */
+    public String getChineseName() {
+        return name_cn;
+    }
+
+    public String getName() {
+        return name_en;
+    }
+
+    /**
+     * 英文名获取
+     *
+     * @return
+     * @Title: getShortName
+     * @Description: (这里用一句话描述这个方法的作用)
+     * @date 2015年3月5日 下午1:48:31
+     * @author lys
+     */
+    public String getShortName() {
+        return name_enShort;
+    }
+
+    /**
+     * 编号获取
+     *
+     * @return
+     * @Title: getNumber
+     * @Description: (这里用一句话描述这个方法的作用)
+     * @date 2015年3月5日 下午1:48:41
+     * @author lys
+     */
+    public int getNumber() {
+        return number;
+    }
+}

+ 59 - 0
src/main/java/com/imed/costaccount/model/Hosptail.java

@@ -0,0 +1,59 @@
+package com.imed.costaccount.model;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+/**
+ * 医院表
+ * 
+ * @author KCYG
+ * @email KCYG@xinxicom
+ * @date 2021-07-26 08:52:56
+ */
+@Data
+@Accessors(chain = true)
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("sys_hosptail")
+public class Hosptail implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 医院或者病区Id
+	 */
+	@TableId
+	private Integer id;
+	/**
+	 * 是否是院区(0不是 1是)
+	 */
+	private String name;
+	/**
+	 * 账号
+	 */
+	private Integer isHosptail;
+	/**
+	 * 如果是院区医院的id,默认为0
+	 */
+	private Integer parentId;
+	/**
+	 * 如果是院区医院的名称,默认为'
+	 */
+	private String parentName;
+	/**
+	 * 创建时间13位时间戳
+	 */
+	private Long createTime;
+	/**
+	 * 删除时间,如果存在表示已删除13位时间戳
+	 */
+	private Long deleteTime;
+
+}

+ 19 - 0
src/main/resources/mapper/UserMapper.xml

@@ -0,0 +1,19 @@
+<?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.imed.costaccount.mapper.UserMapper">
+
+	<!-- 可根据自己的需求,是否要使用 -->
+    <resultMap type="com.imed.costaccount.model.User" id="userMap">
+        <result property="id" column="id"/>
+        <result property="name" column="name"/>
+        <result property="account" column="account"/>
+        <result property="password" column="password"/>
+        <result property="dbBedno" column="DB_BedNo"/>
+        <result property="hospId" column="hosp_id"/>
+        <result property="createTime" column="create_time"/>
+        <result property="deleteTime" column="delete_time"/>
+    </resultMap>
+
+
+</mapper>