Commit 7659392ea7821804fabaa53702645ed4f26a00e8

Authored by guzijian
1 parent 7330037d

fix: 新增清除异常接口

ruoyi-admin/src/main/java/com/ruoyi/num/controller/RuleNumController.java 0 → 100644
  1 +package com.ruoyi.num.controller;
  2 +
  3 +import java.util.List;
  4 +import javax.servlet.http.HttpServletResponse;
  5 +import org.springframework.security.access.prepost.PreAuthorize;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.web.bind.annotation.GetMapping;
  8 +import org.springframework.web.bind.annotation.PostMapping;
  9 +import org.springframework.web.bind.annotation.PutMapping;
  10 +import org.springframework.web.bind.annotation.DeleteMapping;
  11 +import org.springframework.web.bind.annotation.PathVariable;
  12 +import org.springframework.web.bind.annotation.RequestBody;
  13 +import org.springframework.web.bind.annotation.RequestMapping;
  14 +import org.springframework.web.bind.annotation.RestController;
  15 +import com.ruoyi.common.annotation.Log;
  16 +import com.ruoyi.common.core.controller.BaseController;
  17 +import com.ruoyi.common.core.domain.AjaxResult;
  18 +import com.ruoyi.common.enums.BusinessType;
  19 +import com.ruoyi.num.domain.RuleNum;
  20 +import com.ruoyi.num.service.IRuleNumService;
  21 +import com.ruoyi.common.utils.poi.ExcelUtil;
  22 +import com.ruoyi.common.core.page.TableDataInfo;
  23 +
  24 +/**
  25 + * 班次管理Controller
  26 + *
  27 + * @author guzijian
  28 + * @date 2023-08-03
  29 + */
  30 +@RestController
  31 +@RequestMapping("/num/num")
  32 +public class RuleNumController extends BaseController
  33 +{
  34 + @Autowired
  35 + private IRuleNumService ruleNumService;
  36 +
  37 + /**
  38 + * 查询班次管理列表
  39 + */
  40 + @PreAuthorize("@ss.hasPermi('num:num:list')")
  41 + @GetMapping("/list")
  42 + public TableDataInfo list(RuleNum ruleNum)
  43 + {
  44 + startPage();
  45 + List<RuleNum> list = ruleNumService.selectRuleNumList(ruleNum);
  46 + return getDataTable(list);
  47 + }
  48 +
  49 + /**
  50 + * 导出班次管理列表
  51 + */
  52 + @PreAuthorize("@ss.hasPermi('num:num:export')")
  53 + @Log(title = "班次管理", businessType = BusinessType.EXPORT)
  54 + @PostMapping("/export")
  55 + public void export(HttpServletResponse response, RuleNum ruleNum)
  56 + {
  57 + List<RuleNum> list = ruleNumService.selectRuleNumList(ruleNum);
  58 + ExcelUtil<RuleNum> util = new ExcelUtil<RuleNum>(RuleNum.class);
  59 + util.exportExcel(response, list, "班次管理数据");
  60 + }
  61 +
  62 + /**
  63 + * 获取班次管理详细信息
  64 + */
  65 + @PreAuthorize("@ss.hasPermi('num:num:query')")
  66 + @GetMapping(value = "/{id}")
  67 + public AjaxResult getInfo(@PathVariable("id") Long id)
  68 + {
  69 + return success(ruleNumService.selectRuleNumById(id));
  70 + }
  71 +
  72 + /**
  73 + * 新增班次管理
  74 + */
  75 + @PreAuthorize("@ss.hasPermi('num:num:add')")
  76 + @Log(title = "班次管理", businessType = BusinessType.INSERT)
  77 + @PostMapping
  78 + public AjaxResult add(@RequestBody RuleNum ruleNum)
  79 + {
  80 + return toAjax(ruleNumService.insertRuleNum(ruleNum));
  81 + }
  82 +
  83 + /**
  84 + * 修改班次管理
  85 + */
  86 + @PreAuthorize("@ss.hasPermi('num:num:edit')")
  87 + @Log(title = "班次管理", businessType = BusinessType.UPDATE)
  88 + @PutMapping
  89 + public AjaxResult edit(@RequestBody RuleNum ruleNum)
  90 + {
  91 + return toAjax(ruleNumService.updateRuleNum(ruleNum));
  92 + }
  93 +
  94 + /**
  95 + * 删除班次管理
  96 + */
  97 + @PreAuthorize("@ss.hasPermi('num:num:remove')")
  98 + @Log(title = "班次管理", businessType = BusinessType.DELETE)
  99 + @DeleteMapping("/{ids}")
  100 + public AjaxResult remove(@PathVariable Long[] ids)
  101 + {
  102 + return toAjax(ruleNumService.deleteRuleNumByIds(ids));
  103 + }
  104 +}
ruoyi-admin/src/main/java/com/ruoyi/num/domain/RuleNum.java 0 → 100644
  1 +package com.ruoyi.num.domain;
  2 +
  3 +import org.apache.commons.lang3.builder.ToStringBuilder;
  4 +import org.apache.commons.lang3.builder.ToStringStyle;
  5 +import com.ruoyi.common.annotation.Excel;
  6 +import com.ruoyi.common.core.domain.BaseEntity;
  7 +
  8 +/**
  9 + * 班次管理对象 rule_num
  10 + *
  11 + * @author guzijian
  12 + * @date 2023-08-03
  13 + */
  14 +public class RuleNum extends BaseEntity
  15 +{
  16 + private static final long serialVersionUID = 1L;
  17 +
  18 + /** id */
  19 + private Long id;
  20 +
  21 + /** 班型名称 */
  22 + @Excel(name = "班型名称")
  23 + private String ruleDictName;
  24 +
  25 + /** 班次类型 */
  26 + @Excel(name = "班次类型")
  27 + private Long ruleType;
  28 +
  29 + /** 工作天数 */
  30 + @Excel(name = "工作天数")
  31 + private Long workDay;
  32 +
  33 + /** 休息天数 */
  34 + @Excel(name = "休息天数")
  35 + private Long freeDay;
  36 +
  37 + /** 星期翻班详情 */
  38 + @Excel(name = "星期翻班详情")
  39 + private String ruleWeek;
  40 +
  41 + public void setId(Long id)
  42 + {
  43 + this.id = id;
  44 + }
  45 +
  46 + public Long getId()
  47 + {
  48 + return id;
  49 + }
  50 + public void setRuleDictName(String ruleDictName)
  51 + {
  52 + this.ruleDictName = ruleDictName;
  53 + }
  54 +
  55 + public String getRuleDictName()
  56 + {
  57 + return ruleDictName;
  58 + }
  59 + public void setRuleType(Long ruleType)
  60 + {
  61 + this.ruleType = ruleType;
  62 + }
  63 +
  64 + public Long getRuleType()
  65 + {
  66 + return ruleType;
  67 + }
  68 + public void setWorkDay(Long workDay)
  69 + {
  70 + this.workDay = workDay;
  71 + }
  72 +
  73 + public Long getWorkDay()
  74 + {
  75 + return workDay;
  76 + }
  77 + public void setFreeDay(Long freeDay)
  78 + {
  79 + this.freeDay = freeDay;
  80 + }
  81 +
  82 + public Long getFreeDay()
  83 + {
  84 + return freeDay;
  85 + }
  86 + public void setRuleWeek(String ruleWeek)
  87 + {
  88 + this.ruleWeek = ruleWeek;
  89 + }
  90 +
  91 + public String getRuleWeek()
  92 + {
  93 + return ruleWeek;
  94 + }
  95 +
  96 + @Override
  97 + public String toString() {
  98 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  99 + .append("id", getId())
  100 + .append("ruleDictName", getRuleDictName())
  101 + .append("ruleType", getRuleType())
  102 + .append("workDay", getWorkDay())
  103 + .append("freeDay", getFreeDay())
  104 + .append("ruleWeek", getRuleWeek())
  105 + .toString();
  106 + }
  107 +}
ruoyi-admin/src/main/java/com/ruoyi/num/mapper/RuleNumMapper.java 0 → 100644
  1 +package com.ruoyi.num.mapper;
  2 +
  3 +import java.util.List;
  4 +import com.ruoyi.num.domain.RuleNum;
  5 +
  6 +/**
  7 + * 班次管理Mapper接口
  8 + *
  9 + * @author guzijian
  10 + * @date 2023-08-03
  11 + */
  12 +public interface RuleNumMapper
  13 +{
  14 + /**
  15 + * 查询班次管理
  16 + *
  17 + * @param id 班次管理主键
  18 + * @return 班次管理
  19 + */
  20 + public RuleNum selectRuleNumById(Long id);
  21 +
  22 + /**
  23 + * 查询班次管理列表
  24 + *
  25 + * @param ruleNum 班次管理
  26 + * @return 班次管理集合
  27 + */
  28 + public List<RuleNum> selectRuleNumList(RuleNum ruleNum);
  29 +
  30 + /**
  31 + * 新增班次管理
  32 + *
  33 + * @param ruleNum 班次管理
  34 + * @return 结果
  35 + */
  36 + public int insertRuleNum(RuleNum ruleNum);
  37 +
  38 + /**
  39 + * 修改班次管理
  40 + *
  41 + * @param ruleNum 班次管理
  42 + * @return 结果
  43 + */
  44 + public int updateRuleNum(RuleNum ruleNum);
  45 +
  46 + /**
  47 + * 删除班次管理
  48 + *
  49 + * @param id 班次管理主键
  50 + * @return 结果
  51 + */
  52 + public int deleteRuleNumById(Long id);
  53 +
  54 + /**
  55 + * 批量删除班次管理
  56 + *
  57 + * @param ids 需要删除的数据主键集合
  58 + * @return 结果
  59 + */
  60 + public int deleteRuleNumByIds(Long[] ids);
  61 +}
ruoyi-admin/src/main/java/com/ruoyi/num/service/IRuleNumService.java 0 → 100644
  1 +package com.ruoyi.num.service;
  2 +
  3 +import java.util.List;
  4 +import com.ruoyi.num.domain.RuleNum;
  5 +
  6 +/**
  7 + * 班次管理Service接口
  8 + *
  9 + * @author guzijian
  10 + * @date 2023-08-03
  11 + */
  12 +public interface IRuleNumService
  13 +{
  14 + /**
  15 + * 查询班次管理
  16 + *
  17 + * @param id 班次管理主键
  18 + * @return 班次管理
  19 + */
  20 + public RuleNum selectRuleNumById(Long id);
  21 +
  22 + /**
  23 + * 查询班次管理列表
  24 + *
  25 + * @param ruleNum 班次管理
  26 + * @return 班次管理集合
  27 + */
  28 + public List<RuleNum> selectRuleNumList(RuleNum ruleNum);
  29 +
  30 + /**
  31 + * 新增班次管理
  32 + *
  33 + * @param ruleNum 班次管理
  34 + * @return 结果
  35 + */
  36 + public int insertRuleNum(RuleNum ruleNum);
  37 +
  38 + /**
  39 + * 修改班次管理
  40 + *
  41 + * @param ruleNum 班次管理
  42 + * @return 结果
  43 + */
  44 + public int updateRuleNum(RuleNum ruleNum);
  45 +
  46 + /**
  47 + * 批量删除班次管理
  48 + *
  49 + * @param ids 需要删除的班次管理主键集合
  50 + * @return 结果
  51 + */
  52 + public int deleteRuleNumByIds(Long[] ids);
  53 +
  54 + /**
  55 + * 删除班次管理信息
  56 + *
  57 + * @param id 班次管理主键
  58 + * @return 结果
  59 + */
  60 + public int deleteRuleNumById(Long id);
  61 +}
ruoyi-admin/src/main/java/com/ruoyi/num/service/impl/RuleNumServiceImpl.java 0 → 100644
  1 +package com.ruoyi.num.service.impl;
  2 +
  3 +import java.util.List;
  4 +import com.ruoyi.common.utils.SecurityUtils;
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.stereotype.Service;
  7 +import com.ruoyi.num.mapper.RuleNumMapper;
  8 +import com.ruoyi.num.domain.RuleNum;
  9 +import com.ruoyi.num.service.IRuleNumService;
  10 +
  11 +/**
  12 + * 班次管理Service业务层处理
  13 + *
  14 + * @author guzijian
  15 + * @date 2023-08-03
  16 + */
  17 +@Service
  18 +public class RuleNumServiceImpl implements IRuleNumService
  19 +{
  20 + @Autowired
  21 + private RuleNumMapper ruleNumMapper;
  22 +
  23 + /**
  24 + * 查询班次管理
  25 + *
  26 + * @param id 班次管理主键
  27 + * @return 班次管理
  28 + */
  29 + @Override
  30 + public RuleNum selectRuleNumById(Long id)
  31 + {
  32 + return ruleNumMapper.selectRuleNumById(id);
  33 + }
  34 +
  35 + /**
  36 + * 查询班次管理列表
  37 + *
  38 + * @param ruleNum 班次管理
  39 + * @return 班次管理
  40 + */
  41 + @Override
  42 + public List<RuleNum> selectRuleNumList(RuleNum ruleNum)
  43 + {
  44 + return ruleNumMapper.selectRuleNumList(ruleNum);
  45 + }
  46 +
  47 + /**
  48 + * 新增班次管理
  49 + *
  50 + * @param ruleNum 班次管理
  51 + * @return 结果
  52 + */
  53 + @Override
  54 + public int insertRuleNum(RuleNum ruleNum)
  55 + {
  56 + return ruleNumMapper.insertRuleNum(ruleNum);
  57 + }
  58 +
  59 + /**
  60 + * 修改班次管理
  61 + *
  62 + * @param ruleNum 班次管理
  63 + * @return 结果
  64 + */
  65 + @Override
  66 + public int updateRuleNum(RuleNum ruleNum)
  67 + {
  68 + return ruleNumMapper.updateRuleNum(ruleNum);
  69 + }
  70 +
  71 + /**
  72 + * 批量删除班次管理
  73 + *
  74 + * @param ids 需要删除的班次管理主键
  75 + * @return 结果
  76 + */
  77 + @Override
  78 + public int deleteRuleNumByIds(Long[] ids)
  79 + {
  80 + return ruleNumMapper.deleteRuleNumByIds(ids);
  81 + }
  82 +
  83 + /**
  84 + * 删除班次管理信息
  85 + *
  86 + * @param id 班次管理主键
  87 + * @return 结果
  88 + */
  89 + @Override
  90 + public int deleteRuleNumById(Long id)
  91 + {
  92 + return ruleNumMapper.deleteRuleNumById(id);
  93 + }
  94 +}
ruoyi-admin/src/main/resources/application-druid-prd.yml
@@ -9,7 +9,8 @@ spring: @@ -9,7 +9,8 @@ spring:
9 # 测试地址 9 # 测试地址
10 url: jdbc:mysql://127.0.0.1:3306/all-in-one?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&useAffectedRows=true&allowMultiQueries=true 10 url: jdbc:mysql://127.0.0.1:3306/all-in-one?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&useAffectedRows=true&allowMultiQueries=true
11 username: root 11 username: root
12 - password: qinpugongjiao20230730 12 +# password: qinpugongjiao20230730
  13 + password: guzijian
13 # 从库数据源 14 # 从库数据源
14 slave: 15 slave:
15 # 从数据源开关/默认关闭 16 # 从数据源开关/默认关闭
@@ -117,7 +118,13 @@ ruoyi: @@ -117,7 +118,13 @@ ruoyi:
117 # 验证码类型 math 数字计算 char 字符验证 118 # 验证码类型 math 数字计算 char 字符验证
118 captchaType: math 119 captchaType: math
119 # 开发环境配置 120 # 开发环境配置
  121 + #SSL Key Info
  122 +security:
  123 + require-ssl: true
120 server: 124 server:
  125 + ssl:
  126 + key-store-password: guzijian
  127 + key-store: ruoyi-admin/src/main/resources/keystore.jks
121 # 服务器的HTTP端口,默认为8080 128 # 服务器的HTTP端口,默认为8080
122 port: 8080 129 port: 8080
123 servlet: 130 servlet:
@@ -179,4 +186,4 @@ api: @@ -179,4 +186,4 @@ api:
179 people: 186 people:
180 url: https://api.dingtalk.com/v1.0/yida/forms/instances/search 187 url: https://api.dingtalk.com/v1.0/yida/forms/instances/search
181 log: 188 log:
182 - path: E:/ruoyi/logs  
183 \ No newline at end of file 189 \ No newline at end of file
  190 + path: E:/ruoyi/logs
ruoyi-admin/src/main/resources/keystore.jks 0 → 100644
No preview for this file type
ruoyi-admin/src/main/resources/logback.xml
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <!-- 日志存放路径 --> 3 <!-- 日志存放路径 -->
4 <!-- <property name="log.path" value="E:/ruoyi/logs" />--> 4 <!-- <property name="log.path" value="E:/ruoyi/logs" />-->
5 <!-- <property name="log.path" value="D:/ruoyi/logs" />--> 5 <!-- <property name="log.path" value="D:/ruoyi/logs" />-->
6 - <springProperty scope="context" name="log.path" source="log.path"/> 6 + <property name="log.path" value="/home/ruoyi/logs" />
7 <!-- 日志输出格式 --> 7 <!-- 日志输出格式 -->
8 <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> 8 <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
9 9
ruoyi-admin/src/main/resources/mapper/num/RuleNumMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper
  3 +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 +"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.ruoyi.num.mapper.RuleNumMapper">
  6 +
  7 + <resultMap type="RuleNum" id="RuleNumResult">
  8 + <result property="id" column="id" />
  9 + <result property="ruleDictName" column="rule_dict_name" />
  10 + <result property="ruleType" column="rule_type" />
  11 + <result property="workDay" column="work_day" />
  12 + <result property="freeDay" column="free_day" />
  13 + <result property="ruleWeek" column="rule_week" />
  14 + </resultMap>
  15 +
  16 + <sql id="selectRuleNumVo">
  17 + select id, rule_dict_name, rule_type, work_day, free_day, rule_week from rule_num
  18 + </sql>
  19 +
  20 + <select id="selectRuleNumList" parameterType="RuleNum" resultMap="RuleNumResult">
  21 + <include refid="selectRuleNumVo"/>
  22 + <where>
  23 + <if test="ruleDictName != null "> and rule_dict_name like concat('%', #{ruleDictName}, '%')</if>
  24 + <if test="ruleType != null "> and rule_type = #{ruleType}</if>
  25 + <if test="workDay != null "> and work_day = #{workDay}</if>
  26 + <if test="freeDay != null "> and free_day = #{freeDay}</if>
  27 + <if test="ruleWeek != null and ruleWeek != ''"> and rule_week = #{ruleWeek}</if>
  28 + </where>
  29 + </select>
  30 +
  31 + <select id="selectRuleNumById" parameterType="Long" resultMap="RuleNumResult">
  32 + <include refid="selectRuleNumVo"/>
  33 + where id = #{id}
  34 + </select>
  35 +
  36 + <insert id="insertRuleNum" parameterType="RuleNum" useGeneratedKeys="true" keyProperty="id">
  37 + insert into rule_num
  38 + <trim prefix="(" suffix=")" suffixOverrides=",">
  39 + <if test="ruleDictName != null">rule_dict_name,</if>
  40 + <if test="ruleType != null">rule_type,</if>
  41 + <if test="workDay != null">work_day,</if>
  42 + <if test="freeDay != null">free_day,</if>
  43 + <if test="ruleWeek != null">rule_week,</if>
  44 + </trim>
  45 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  46 + <if test="ruleDictName != null">#{ruleDictName},</if>
  47 + <if test="ruleType != null">#{ruleType},</if>
  48 + <if test="workDay != null">#{workDay},</if>
  49 + <if test="freeDay != null">#{freeDay},</if>
  50 + <if test="ruleWeek != null">#{ruleWeek},</if>
  51 + </trim>
  52 + </insert>
  53 +
  54 + <update id="updateRuleNum" parameterType="RuleNum">
  55 + update rule_num
  56 + <trim prefix="SET" suffixOverrides=",">
  57 + <if test="ruleDictName != null">rule_dict_name = #{ruleDictName},</if>
  58 + <if test="ruleType != null">rule_type = #{ruleType},</if>
  59 + <if test="workDay != null">work_day = #{workDay},</if>
  60 + <if test="freeDay != null">free_day = #{freeDay},</if>
  61 + <if test="ruleWeek != null">rule_week = #{ruleWeek},</if>
  62 + </trim>
  63 + where id = #{id}
  64 + </update>
  65 +
  66 + <delete id="deleteRuleNumById" parameterType="Long">
  67 + delete from rule_num where id = #{id}
  68 + </delete>
  69 +
  70 + <delete id="deleteRuleNumByIds" parameterType="String">
  71 + delete from rule_num where id in
  72 + <foreach item="id" collection="array" open="(" separator="," close=")">
  73 + #{id}
  74 + </foreach>
  75 + </delete>
  76 +</mapper>
0 \ No newline at end of file 77 \ No newline at end of file