Commit e26e27bfedcff905879ef37a843cfcd3b011dead

Authored by guzijian
1 parent f140e57a

fix: 新增修改人

ruoyi-admin/src/main/java/com/ruoyi/controller/AttendanceController.java
1 1 package com.ruoyi.controller;
2 2  
  3 +import com.ruoyi.common.annotation.Log;
3 4 import com.ruoyi.common.core.controller.BaseController;
4 5 import com.ruoyi.common.core.page.TableDataInfo;
  6 +import com.ruoyi.common.enums.BusinessType;
5 7 import com.ruoyi.common.global.Result;
6 8 import com.ruoyi.domain.RuleAttendanceMain;
7 9 import com.ruoyi.pojo.dto.SchedulingDto;
... ... @@ -64,6 +66,7 @@ public class AttendanceController extends BaseController {
64 66 */
65 67 @ApiOperation("排班设置")
66 68 @PostMapping("/saveSchedulingSetting")
  69 + @Log(title = "新增排班设置", businessType = BusinessType.INSERT)
67 70 public Result<?> saveSchedulingSetting(@RequestBody @Validated SchedulingSettingDto dto) {
68 71 attendanceService.saveSchedulingSetting(dto);
69 72 return Result.OK("新增成功");
... ... @@ -74,6 +77,7 @@ public class AttendanceController extends BaseController {
74 77 */
75 78 @ApiOperation("排班设置")
76 79 @PutMapping("/updateSchedulingSetting")
  80 + @Log(title = "修改排班设置", businessType = BusinessType.UPDATE)
77 81 public Result<?> updateSchedulingSetting(@RequestBody @Validated SchedulingDto dto) {
78 82 attendanceService.updateSchedulingSetting(dto);
79 83 return Result.OK("新增成功");
... ... @@ -84,6 +88,7 @@ public class AttendanceController extends BaseController {
84 88 */
85 89 @ApiOperation("排班设置")
86 90 @DeleteMapping("/deleteSchedulingSetting/{settingId}")
  91 + @Log(title = "删除排班设置", businessType = BusinessType.DELETE)
87 92 public Result<?> deleteSchedulingSetting(@PathVariable("settingId") Integer settingId) {
88 93 attendanceService.deleteSchedulingSetting(settingId);
89 94 return Result.OK("删除成功");
... ... @@ -102,6 +107,7 @@ public class AttendanceController extends BaseController {
102 107  
103 108 @ApiOperation("修改考情表")
104 109 @PutMapping("/update/attendance")
  110 + @Log(title = "修改考情表", businessType = BusinessType.UPDATE)
105 111 public Result<?> updateAttendance(@RequestBody @Validated UpdateAttendanceVo vo) {
106 112 try {
107 113 attendanceService.updateAttendance(vo);
... ... @@ -113,6 +119,7 @@ public class AttendanceController extends BaseController {
113 119  
114 120 @ApiOperation("删除考勤表")
115 121 @PostMapping("/delete/attendance")
  122 + @Log(title = "删除考勤表", businessType = BusinessType.DELETE)
116 123 public Result<?> deleteAttendance(@RequestBody DeleteAttendanceVo vo) {
117 124 try {
118 125 attendanceService.deleteAttendance(vo);
... ... @@ -127,4 +134,13 @@ public class AttendanceController extends BaseController {
127 134 public Result<?> getPeopleList(@ModelAttribute PeopleRequestVo vo){
128 135 return Result.OK(attendanceService.getPeopleList(vo));
129 136 }
  137 +
  138 +
  139 + @GetMapping("/table/month")
  140 + @ApiOperation("获取一个月的table")
  141 + public Result<?> getTableMonth(){
  142 + // 修改周期
  143 + return null;
  144 + }
  145 +
130 146 }
... ...
ruoyi-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
... ... @@ -401,7 +401,7 @@ public class SignInServiceImpl implements ISignInService {
401 401 Integer count = redisCache.getCacheObject(key);
402 402 if (Objects.isNull(count) || count.equals(0)) {
403 403 count = 1;
404   - redisCache.setCacheMapValue(key, signIn.getJobCode(), count);
  404 + redisCache.setCacheObject(key, count);
405 405 } else {
406 406 redisCache.setCacheObject(key, ++count);
407 407 }
... ...
ruoyi-admin/src/main/java/com/ruoyi/num/domain/RuleNum.java
... ... @@ -6,6 +6,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
6 6 import com.ruoyi.common.annotation.Excel;
7 7 import com.ruoyi.common.core.domain.BaseEntity;
8 8  
  9 +import java.util.Date;
  10 +
9 11 /**
10 12 * 班次管理对象 rule_num
11 13 *
... ... @@ -40,4 +42,12 @@ public class RuleNum extends BaseEntity
40 42 @Excel(name = "星期翻班详情")
41 43 private String ruleWeek;
42 44  
  45 + private Date createTime;
  46 +
  47 + private Date updateTime;
  48 +
  49 + private String createBy;
  50 +
  51 + private String updateBy;
  52 +
43 53 }
... ...
ruoyi-admin/src/main/java/com/ruoyi/num/service/impl/RuleNumServiceImpl.java
... ... @@ -8,6 +8,7 @@ import java.util.stream.Collectors;
8 8 import java.util.stream.Stream;
9 9  
10 10 import cn.hutool.core.bean.BeanUtil;
  11 +import com.ruoyi.common.utils.DateUtils;
11 12 import com.ruoyi.common.utils.SecurityUtils;
12 13 import com.ruoyi.pojo.dto.RuleNumDto;
13 14 import com.ruoyi.pojo.vo.RuleNumTemplateVo;
... ... @@ -65,6 +66,11 @@ public class RuleNumServiceImpl implements IRuleNumService
65 66 @Override
66 67 public int insertRuleNum(RuleNum ruleNum)
67 68 {
  69 + String username = SecurityUtils.getUsername();
  70 + ruleNum.setCreateBy(username);
  71 + ruleNum.setUpdateBy(username);
  72 + ruleNum.setCreateTime(DateUtils.getNowDate());
  73 + ruleNum.setUpdateTime(DateUtils.getNowDate());
68 74 return ruleNumMapper.insertRuleNum(ruleNum);
69 75 }
70 76  
... ... @@ -77,6 +83,8 @@ public class RuleNumServiceImpl implements IRuleNumService
77 83 @Override
78 84 public int updateRuleNum(RuleNum ruleNum)
79 85 {
  86 + ruleNum.setUpdateTime(DateUtils.getNowDate());
  87 + ruleNum.setUpdateBy(ruleNum.getUpdateBy());
80 88 return ruleNumMapper.updateRuleNum(ruleNum);
81 89 }
82 90  
... ...
ruoyi-admin/src/main/java/com/ruoyi/pojo/vo/SchedulingResponseVo.java
... ... @@ -4,6 +4,7 @@ import com.ruoyi.domain.RuleNumSetting;
4 4 import io.swagger.annotations.ApiModelProperty;
5 5 import lombok.Data;
6 6  
  7 +import java.util.Date;
7 8 import java.util.List;
8 9  
9 10 /**
... ... @@ -20,4 +21,8 @@ public class SchedulingResponseVo extends RuleNumSetting {
20 21 private List<String> ruleList;
21 22 @ApiModelProperty("适用人员")
22 23 private List<String> peopleList;
  24 + private Date createTime;
  25 + private Date updateTime;
  26 + private String createBy;
  27 + private String updateBy;
23 28 }
... ...
ruoyi-admin/src/main/java/com/ruoyi/pojo/vo/TableMonthResponseVo.java 0 → 100644
  1 +package com.ruoyi.pojo.vo;
  2 +
  3 +import com.ruoyi.domain.RuleAttendanceMain;
  4 +import lombok.Data;
  5 +
  6 +import java.util.List;
  7 +
  8 +/**
  9 + *
  10 + * @author 20412
  11 + */
  12 +@Data
  13 +public class TableMonthResponseVo {
  14 + private String jobCode;
  15 + private String name;
  16 + private String fleetName;
  17 + private String posts;
  18 + private List<RuleAttendanceMain> monthList;
  19 + private Integer nowMonthDaysCount;
  20 +//
  21 +// @Data
  22 +// public
  23 +}
... ...
ruoyi-admin/src/main/java/com/ruoyi/scheduling/domain/RuleScheduling.java
... ... @@ -91,4 +91,12 @@ public class RuleScheduling extends BaseEntity
91 91 @Excel(name = "第二段上下班标识,今天时间还是隔天")
92 92 private Integer secondSignDayTomorrow;
93 93  
  94 + private Date updateTime;
  95 +
  96 + private Date createTime;
  97 +
  98 + private String updateBy;
  99 +
  100 + private String createBy;
  101 +
94 102 }
... ...
ruoyi-admin/src/main/java/com/ruoyi/scheduling/service/impl/RuleSchedulingServiceImpl.java
... ... @@ -7,6 +7,8 @@ import java.util.List;
7 7 import java.util.stream.Collectors;
8 8  
9 9 import cn.hutool.core.collection.CollectionUtil;
  10 +import com.ruoyi.common.utils.DateUtils;
  11 +import com.ruoyi.common.utils.SecurityUtils;
10 12 import com.ruoyi.pojo.dto.RuleSchedulingDto;
11 13 import com.ruoyi.pojo.vo.RuleSchedulingResponseVo;
12 14 import com.ruoyi.pojo.vo.RuleSchedulingVo;
... ... @@ -62,6 +64,12 @@ public class RuleSchedulingServiceImpl implements IRuleSchedulingService {
62 64 @Override
63 65 public int insertRuleScheduling(RuleScheduling ruleScheduling) {
64 66 handleNewAddScheduling(ruleScheduling);
  67 + String username = SecurityUtils.getUsername();
  68 + ruleScheduling.setCreateBy(username);
  69 + ruleScheduling.setUpdateBy(username);
  70 + Date date = DateUtils.getNowDate();
  71 + ruleScheduling.setCreateTime(date);
  72 + ruleScheduling.setUpdateTime(date);
65 73 return ruleSchedulingMapper.insertRuleScheduling(ruleScheduling);
66 74 }
67 75  
... ... @@ -85,6 +93,8 @@ public class RuleSchedulingServiceImpl implements IRuleSchedulingService {
85 93 @Override
86 94 public int updateRuleScheduling(RuleScheduling ruleScheduling) {
87 95 handleNewAddScheduling(ruleScheduling);
  96 + ruleScheduling.setUpdateTime(DateUtils.getNowDate());
  97 + ruleScheduling.setUpdateBy(SecurityUtils.getUsername());
88 98 return ruleSchedulingMapper.updateRuleScheduling(ruleScheduling);
89 99 }
90 100  
... ...
ruoyi-admin/src/main/resources/application-druid-dev.yml
... ... @@ -99,9 +99,10 @@ spring:
99 99 # redis 配置
100 100 redis:
101 101 # 地址
102   - host: 121.41.83.61
  102 +# host: 121.41.83.61
  103 + host: 127.0.0.1
103 104 database: 0
104   - password: "guzijian"
  105 +# password: "guzijian"
105 106 port: 6379
106 107 # 连接超时时间
107 108 timeout: 10s
... ...
ruoyi-admin/src/main/resources/application-druid-prd.yml
... ... @@ -96,9 +96,10 @@ spring:
96 96 # redis 配置
97 97 redis:
98 98 # 地址
99   - host: 121.41.83.61
  99 +# host: 121.41.83.61
  100 + host: 127.0.0.1
100 101 database: 0
101   - password: "guzijian"
  102 + password: "@qpgj#redis"
102 103 port: 6379
103 104 # 连接超时时间
104 105 timeout: 10s
... ...
ruoyi-admin/src/main/resources/application.yml
... ... @@ -71,24 +71,24 @@ spring:
71 71 # 热部署开关
72 72 enabled: true
73 73 # redis 配置
74   - redis:
75   - # 地址
76   - host: 121.41.83.61
77   - database: 0
78   - password: "guzijian"
79   - port: 6379
80   - # 连接超时时间
81   - timeout: 10s
82   - lettuce:
83   - pool:
84   - # 连接池中的最小空闲连接
85   - min-idle: 0
86   - # 连接池中的最大空闲连接
87   - max-idle: 8
88   - # 连接池的最大数据库连接数
89   - max-active: 8
90   - # #连接池最大阻塞等待时间(使用负值表示没有限制)
91   - max-wait: -1ms
  74 +# redis:
  75 +# # 地址
  76 +# host: 127.0.0.1
  77 +# database: 0
  78 +## password: "guzijian"
  79 +# port: 6379
  80 +# # 连接超时时间
  81 +# timeout: 10s
  82 +# lettuce:
  83 +# pool:
  84 +# # 连接池中的最小空闲连接
  85 +# min-idle: 0
  86 +# # 连接池中的最大空闲连接
  87 +# max-idle: 8
  88 +# # 连接池的最大数据库连接数
  89 +# max-active: 8
  90 +# # #连接池最大阻塞等待时间(使用负值表示没有限制)
  91 +# max-wait: -1ms
92 92  
93 93 # token配置
94 94 token:
... ...
ruoyi-admin/src/main/resources/mapper/eexception/EquipmentExceptionMapper.xml
... ... @@ -89,7 +89,12 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
89 89 <if test="jobCode != null and jobCode != ''"> and driver.job_code = #{jobCode}</if>
90 90 <if test="exType != null "> and ex_type = #{exType}</if>
91 91 <if test="id != null "> and equipment_exception.id #{id}</if>
92   - <if test="date != null "> and equipment_exception.create_time like concat(#{date},'%')</if>
  92 + <if test="date != null ">
  93 + and
  94 + equipment_exception.create_time &gt;= CONCAT(#{date}, ' 02:30:00')
  95 + and
  96 + equipment_exception.create_time &lt;= CONCAT(DATE_ADD(#{date}, INTERVAL 1 DAY), ' 02:30:00')
  97 + </if>
93 98 </where>
94 99 </select>
95 100 <select id="selectEquipmentExceptionByDeviceIdStatus"
... ...
ruoyi-admin/src/main/resources/mapper/num/RuleNumMapper.xml
... ... @@ -11,6 +11,10 @@
11 11 <result property="workDay" column="work_day"/>
12 12 <result property="freeDay" column="free_day"/>
13 13 <result property="ruleWeek" column="rule_week"/>
  14 + <result property="createTime" column="create_time" />
  15 + <result property="updateTime" column="update_time" />
  16 + <result property="createBy" column="create_by" />
  17 + <result property="updateBy" column="update_by" />
14 18 </resultMap>
15 19  
16 20 <resultMap type="com.ruoyi.pojo.dto.RuleNumDto" id="RuleNumDtoResult">
... ... @@ -21,10 +25,14 @@
21 25 <result property="freeDay" column="free_day"/>
22 26 <result property="ruleWeek" column="rule_week"/>
23 27 <result property="settingId" column="setting_id"/>
  28 + <result property="createTime" column="create_time" />
  29 + <result property="updateTime" column="update_time" />
  30 + <result property="createBy" column="create_by" />
  31 + <result property="updateBy" column="update_by" />
24 32 </resultMap>
25 33  
26 34 <sql id="selectRuleNumVo">
27   - select id, rule_dict_name, rule_type, work_day, free_day, rule_week
  35 + select id, rule_dict_name, rule_type, work_day, free_day, rule_week,update_by,update_time,create_by,create_time
28 36 from rule_num
29 37 </sql>
30 38  
... ... @@ -70,6 +78,10 @@
70 78 <if test="workDay != null">work_day,</if>
71 79 <if test="freeDay != null">free_day,</if>
72 80 <if test="ruleWeek != null">rule_week,</if>
  81 + <if test="createTime != null">create_time,</if>
  82 + <if test="updateTime != null">update_time,</if>
  83 + <if test="createBy != null">create_by,</if>
  84 + <if test="updateBy != null">update_by,</if>
73 85 </trim>
74 86 <trim prefix="values (" suffix=")" suffixOverrides=",">
75 87 <if test="ruleDictName != null">#{ruleDictName},</if>
... ... @@ -77,6 +89,10 @@
77 89 <if test="workDay != null">#{workDay},</if>
78 90 <if test="freeDay != null">#{freeDay},</if>
79 91 <if test="ruleWeek != null">#{ruleWeek},</if>
  92 + <if test="createTime != null">#{createTime},</if>
  93 + <if test="updateTime != null">#{updateTime},</if>
  94 + <if test="createBy != null">#{createBy},</if>
  95 + <if test="updateBy != null">#{updateBy},</if>
80 96 </trim>
81 97 </insert>
82 98  
... ... @@ -88,6 +104,8 @@
88 104 <if test="workDay != null">work_day = #{workDay},</if>
89 105 <if test="freeDay != null">free_day = #{freeDay},</if>
90 106 <if test="ruleWeek != null">rule_week = #{ruleWeek},</if>
  107 + <if test="updateBy != null">update_by = #{updateBy},</if>
  108 + <if test="updateTime != null">update_time = #{updateTime},</if>
91 109 </trim>
92 110 where id = #{id}
93 111 </update>
... ...
ruoyi-admin/src/main/resources/mapper/scheduling/RuleSchedulingMapper.xml
... ... @@ -23,6 +23,10 @@
23 23 <result property="secondSignDayTomorrow" column="second_sign_day_tomorrow" />
24 24 <result property="settingId" column="setting_id" />
25 25 <result property="sort" column="sort" />
  26 + <result property="createTime" column="create_time" />
  27 + <result property="updateTime" column="update_time" />
  28 + <result property="createBy" column="create_by" />
  29 + <result property="updateBy" column="update_by" />
26 30 </resultMap>
27 31  
28 32 <resultMap type="RuleScheduling" id="RuleSchedulingResult">
... ... @@ -42,10 +46,14 @@
42 46 <result property="secondQuittingSignInTime" column="second_quitting_sign_in_time" />
43 47 <result property="secondSignInQuittingRange" column="second_sign_in_quitting_range" />
44 48 <result property="secondSignDayTomorrow" column="second_sign_day_tomorrow" />
  49 + <result property="createTime" column="create_time" />
  50 + <result property="updateTime" column="update_time" />
  51 + <result property="createBy" column="create_by" />
  52 + <result property="updateBy" column="update_by" />
45 53 </resultMap>
46 54  
47 55 <sql id="selectRuleSchedulingVo">
48   - select id, rule_name, working_hour_plan, working_hour_type, first_work_sign_in_time, first_sign_in_working_range, first_quitting_sign_in_time, first_sign_in_day_tomorrow, first_sign_in_quitting_range, sign_in_time_out_range, second_flag, second_work_sign_in_time, second_sign_in_working_range, second_quitting_sign_in_time, second_sign_in_quitting_range, second_sign_day_tomorrow from rule_scheduling
  56 + select id, rule_name, working_hour_plan, working_hour_type, first_work_sign_in_time, first_sign_in_working_range, first_quitting_sign_in_time, first_sign_in_day_tomorrow, first_sign_in_quitting_range, sign_in_time_out_range, second_flag, second_work_sign_in_time, second_sign_in_working_range, second_quitting_sign_in_time, second_sign_in_quitting_range, second_sign_day_tomorrow,update_by,update_time,create_by,create_time from rule_scheduling
49 57 </sql>
50 58  
51 59 <select id="selectRuleSchedulingList" parameterType="RuleScheduling" resultMap="RuleSchedulingResult">
... ... @@ -110,6 +118,10 @@
110 118 <if test="secondQuittingSignInTime != null">second_quitting_sign_in_time,</if>
111 119 <if test="secondSignInQuittingRange != null">second_sign_in_quitting_range,</if>
112 120 <if test="secondSignDayTomorrow != null">second_sign_day_tomorrow,</if>
  121 + <if test="updateTime != null">update_time,</if>
  122 + <if test="createTime != null">create_time,</if>
  123 + <if test="createBy != null">create_by,</if>
  124 + <if test="updateBy != null">update_by,</if>
113 125 </trim>
114 126 <trim prefix="values (" suffix=")" suffixOverrides=",">
115 127 <if test="ruleName != null and ruleName != ''">#{ruleName},</if>
... ... @@ -127,6 +139,10 @@
127 139 <if test="secondQuittingSignInTime != null">#{secondQuittingSignInTime},</if>
128 140 <if test="secondSignInQuittingRange != null">#{secondSignInQuittingRange},</if>
129 141 <if test="secondSignDayTomorrow != null">#{secondSignDayTomorrow},</if>
  142 + <if test="updateTime != null">#{updateTime},</if>
  143 + <if test="createTime != null">#{createTime},</if>
  144 + <if test="createBy != null">#{createBy},</if>
  145 + <if test="updateBy != null">#{updateBy},</if>
130 146 </trim>
131 147 </insert>
132 148  
... ... @@ -148,6 +164,8 @@
148 164 <if test="secondQuittingSignInTime != null">second_quitting_sign_in_time = #{secondQuittingSignInTime},</if>
149 165 <if test="secondSignInQuittingRange != null">second_sign_in_quitting_range = #{secondSignInQuittingRange},</if>
150 166 <if test="secondSignDayTomorrow != null">second_sign_day_tomorrow = #{secondSignDayTomorrow},</if>
  167 + <if test="updateBy != null">update_by = #{updateBy},</if>
  168 + <if test="updateTime != null">update_time = #{updateTime},</if>
151 169 </trim>
152 170 where id = #{id}
153 171 </update>
... ...