Commit 9881ea9e9d2dfcf985e708278a72c0b76032832b

Authored by guzijian
1 parent 8b603b11

fix: 更新注册接口新增排班和班次管理,更新日志文件配置。

ruoyi-admin/src/main/java/com/ruoyi/driver/service/impl/DriverServiceImpl.java
... ... @@ -171,9 +171,17 @@ public class DriverServiceImpl implements IDriverService {
171 171 log.info("获取到排班数据:{}", cacheMapValue);
172 172 // 优先从缓存中读取
173 173 if (cacheMapValue != null && cacheMapValue.size() > 0) {
174   -
175 174 return AjaxResult.success(cacheMapValue);
176 175 }
  176 + // 获取昨天的排班数据
  177 + String yesterdayKey = DRIVER_SCHEDULING_PRE + ConstDateUtil.formatDate(ConstDateUtil.getTheSpecifiedNumberOfDaysOfTime(-1));
  178 + cacheMapValue = redisCache.getCacheMapValue(yesterdayKey, jobCode);
  179 + if (cacheMapValue != null && cacheMapValue.size() > 0) {
  180 + String yesterdayDate = ConstDateUtil.formatDate(new Date(cacheMapValue.get(cacheMapValue.size() - 1).getZdsjT()));
  181 + if (yesterdayDate.equals(schedulingDate)) {
  182 + return AjaxResult.success(cacheMapValue);
  183 + }
  184 + }
177 185 // 没有再次请求地址获取值
178 186 long timestamp = System.currentTimeMillis();
179 187 // 请求资源地址格式化
... ... @@ -364,7 +372,10 @@ public class DriverServiceImpl implements IDriverService {
364 372 driver.setImage(fileName);
365 373 driver.setUpdateTime(new Date());
366 374 int result = driverMapper.insertDriver(driver);
367   - if (result == 0) driverMapper.updateSignStatusDriversByJobCodes(new ArrayList<>(Arrays.asList(driver)));
  375 + if (result == 0) {
  376 + driverMapper.updateSignStatusDriversByJobCodes(new ArrayList<>(Arrays.asList(driver)));
  377 + driverMapper.deleteDeviceIdAssociatedJobCode(new ArrayList<>(Arrays.asList(driver.getJobCode())));
  378 + }
368 379 log.info("开始上传签到图片");
369 380 // 异步上传文件
370 381 threadJobService.asyncStartUploadBase64Image(filePath, base64);
... ... @@ -378,8 +389,8 @@ public class DriverServiceImpl implements IDriverService {
378 389 @Override
379 390 public void clearExceptionRecordByJobCode(String jobCode) {
380 391 String dateKey = REDIS_SIGN_IN_DRIVER_ALCOHOL_OVERFLOW + ConstDateUtil.formatDate(new Date());
381   - log.info("在:{}时间工号:{}的异常记录被清除了",dateKey,jobCode);
382   - redisCache.deleteCacheMapValue(dateKey,jobCode);
  392 + log.info("在:{}时间工号:{}的异常记录被清除了", dateKey, jobCode);
  393 + redisCache.deleteCacheMapValue(dateKey, jobCode);
383 394 }
384 395  
385 396 /**
... ...
ruoyi-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
... ... @@ -5,11 +5,7 @@ import java.io.IOException;
5 5 import java.math.BigDecimal;
6 6 import java.time.LocalDateTime;
7 7 import java.time.temporal.ChronoUnit;
8   -import java.util.Base64;
9   -import java.util.Date;
10   -import java.util.List;
11   -import java.util.Objects;
12   -import java.util.stream.Collectors;
  8 +import java.util.*;
13 9  
14 10 import com.ruoyi.common.config.RuoYiConfig;
15 11 import com.ruoyi.common.constant.Constants;
... ... @@ -130,7 +126,7 @@ public class SignInServiceImpl implements ISignInService {
130 126 }
131 127 }
132 128 if (SIGN_IN_FAIL.equals(signIn.getStatus())) {
133   - return AjaxResult.error(SIGN_IN_ERROR + ": " + signIn.getRemark(), vo);
  129 + return AjaxResult.warn(SIGN_IN_ERROR + ": " + signIn.getRemark(), vo);
134 130 }
135 131 return AjaxResult.success(SIGN_IN_SUCCESS_STRING, vo);
136 132 }
... ... @@ -245,7 +241,7 @@ public class SignInServiceImpl implements ISignInService {
245 241 // 酒精测试校验 确定 且员工工种是驾驶员
246 242 if (ALCOHOL_FLAG_YES.equals(signIn.getAlcoholFlag()) && PERSONNEL_POSTS_DRIVER.equals(driver.getPosts())) {
247 243 if (new BigDecimal(20).compareTo(signIn.getAlcoholIntake()) <= 0) {
248   - signIn.setRemark(signIn.getRemark() + ALCOHOL_SIGN_IN_ERROR + "," + signIn.getAlcoholIntake().toString() +"mg/100ml");
  244 + signIn.setRemark(signIn.getRemark() + ALCOHOL_SIGN_IN_ERROR + signIn.getAlcoholIntake().toString() +"mg/100ml。");
249 245 result = false;
250 246 }
251 247 }
... ... @@ -261,7 +257,7 @@ public class SignInServiceImpl implements ISignInService {
261 257 * @return
262 258 */
263 259 private boolean checkWorkDay(SignIn signIn, String posts) {
264   - boolean result = true;
  260 + Boolean result = true;
265 261 List<ResponseScheduling> jobs = null;
266 262 switch (posts) {
267 263 case "驾驶员":
... ... @@ -270,8 +266,20 @@ public class SignInServiceImpl implements ISignInService {
270 266 jobs = redisCache.getCacheMapValue(key, signIn.getJobCode());
271 267 log.debug("签到key:{},排班数据:{}",key,jobs);
272 268 if (Objects.isNull(jobs) || jobs.size() == 0) {
273   - signIn.setRemark(signIn.getRemark() + WORK_DAY_ERROR);
274   - result = false;
  269 + // 当天的排班没有记录的话
  270 + key = DRIVER_SCHEDULING_PRE + ConstDateUtil.formatDate(ConstDateUtil.getTheSpecifiedNumberOfDaysOfTime(-1));
  271 + jobs = redisCache.getCacheMapValue(key, signIn.getJobCode());
  272 + if (Objects.isNull(jobs) || jobs.size() == 0){
  273 + signIn.setRemark(signIn.getRemark() + WORK_DAY_ERROR);
  274 + result = false;
  275 + }else {
  276 + ResponseScheduling responseScheduling = jobs.get(jobs.size() - 1);
  277 + if (!ConstDateUtil.formatDate(new Date(responseScheduling.getZdsjT())).equals(ConstDateUtil.formatDate("yyyyMMdd"))){
  278 + signIn.setRemark(signIn.getRemark() + WORK_DAY_ERROR);
  279 + result = false;
  280 + }
  281 + }
  282 +
275 283 }
276 284 break;
277 285 case "1":
... ...
ruoyi-admin/src/main/java/com/ruoyi/job/DriverJob.java
... ... @@ -13,6 +13,7 @@ import com.ruoyi.pojo.response.personnel.*;
13 13 import com.ruoyi.service.ThreadJobService;
14 14 import com.ruoyi.utils.ConstDateUtil;
15 15 import lombok.extern.slf4j.Slf4j;
  16 +import org.apache.tomcat.util.bcel.Const;
16 17 import org.springframework.beans.factory.InitializingBean;
17 18 import org.springframework.beans.factory.annotation.Autowired;
18 19 import org.springframework.beans.factory.annotation.Value;
... ... @@ -180,6 +181,7 @@ public class DriverJob implements InitializingBean {
180 181 public void getSchedulingInfo() {
181 182 long timestamp = System.currentTimeMillis();
182 183 String formatDate = ConstDateUtil.formatDate(timestamp);
  184 +// String formatDate = ConstDateUtil.formatDate(ConstDateUtil.getTheSpecifiedNumberOfDaysOfTime(-1));
183 185 log.info("获取排班任务触发时间:{}", formatDate);
184 186 // 获取排班请求
185 187 String getSchedulingInfoUrl = null;
... ... @@ -232,10 +234,16 @@ public class DriverJob implements InitializingBean {
232 234 driverSchedulingMap.get(jobCode).add(item);
233 235 }
234 236 });
  237 + // 排序
  238 + List<String> keys = new ArrayList<>(driverSchedulingMap.keySet());
  239 + for (String key : keys) {
  240 + List<ResponseScheduling> schedulingList = driverSchedulingMap.get(key);
  241 + schedulingList.sort(Comparator.comparing(ResponseScheduling::getFcsjT));
  242 + }
235 243 // 存入数据库
236 244 // DRIVER_SERVICE.saveDriverScheduling(originSchedulingList);
237 245 // 存入redis
238   - REDIS_CACHE.setCacheMap(DRIVER_SCHEDULING_PRE + dateKey, driverSchedulingMap, 1, TimeUnit.DAYS);
  246 + REDIS_CACHE.setCacheMap(DRIVER_SCHEDULING_PRE + dateKey, driverSchedulingMap, 2, TimeUnit.DAYS);
239 247 log.info("拉取排班完毕:{}", dateKey);
240 248 return driverSchedulingMap;
241 249 }
... ...
ruoyi-admin/src/main/java/com/ruoyi/pojo/response/ReportViewResponseVo.java
... ... @@ -79,6 +79,7 @@ public class ReportViewResponseVo {
79 79 @ExcelProperty(value = "头像",converter = ImageConverter.class)
80 80 @ApiModelProperty("头像")
81 81 private String image;
  82 +
82 83 @ExcelProperty(value = "工种")
83 84 @ApiModelProperty("工种")
84 85 private String posts;
... ... @@ -87,7 +88,7 @@ public class ReportViewResponseVo {
87 88 * 签到地址
88 89 */
89 90 @ExcelProperty("签到地址")
90   - @ColumnWidth(10)
  91 + @ColumnWidth(40)
91 92 @ApiModelProperty("签到地址")
92 93 String address;
93 94  
... ... @@ -102,4 +103,14 @@ public class ReportViewResponseVo {
102 103 @ColumnWidth(40)
103 104 @ApiModelProperty("备注")
104 105 private String remark;
  106 +
  107 + @ExcelProperty(value = "线路名称")
  108 + @ApiModelProperty("线路名称")
  109 + @ColumnWidth(20)
  110 + private String lineName;
  111 +
  112 + @ExcelProperty(value = "车队名称")
  113 + @ApiModelProperty("车队名称")
  114 + @ColumnWidth(20)
  115 + private String fleetName;
105 116 }
... ...
ruoyi-admin/src/main/java/com/ruoyi/scheduling/controller/RuleSchedulingController.java 0 → 100644
  1 +package com.ruoyi.scheduling.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.scheduling.domain.RuleScheduling;
  20 +import com.ruoyi.scheduling.service.IRuleSchedulingService;
  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-04
  29 + */
  30 +@RestController
  31 +@RequestMapping("/scheduling/scheduling")
  32 +public class RuleSchedulingController extends BaseController
  33 +{
  34 + @Autowired
  35 + private IRuleSchedulingService ruleSchedulingService;
  36 +
  37 + /**
  38 + * 查询排版规则列表
  39 + */
  40 + @PreAuthorize("@ss.hasPermi('scheduling:scheduling:list')")
  41 + @GetMapping("/list")
  42 + public TableDataInfo list(RuleScheduling ruleScheduling)
  43 + {
  44 + startPage();
  45 + List<RuleScheduling> list = ruleSchedulingService.selectRuleSchedulingList(ruleScheduling);
  46 + return getDataTable(list);
  47 + }
  48 +
  49 + /**
  50 + * 导出排版规则列表
  51 + */
  52 + @PreAuthorize("@ss.hasPermi('scheduling:scheduling:export')")
  53 + @Log(title = "排版规则", businessType = BusinessType.EXPORT)
  54 + @PostMapping("/export")
  55 + public void export(HttpServletResponse response, RuleScheduling ruleScheduling)
  56 + {
  57 + List<RuleScheduling> list = ruleSchedulingService.selectRuleSchedulingList(ruleScheduling);
  58 + ExcelUtil<RuleScheduling> util = new ExcelUtil<RuleScheduling>(RuleScheduling.class);
  59 + util.exportExcel(response, list, "排版规则数据");
  60 + }
  61 +
  62 + /**
  63 + * 获取排版规则详细信息
  64 + */
  65 + @PreAuthorize("@ss.hasPermi('scheduling:scheduling:query')")
  66 + @GetMapping(value = "/{id}")
  67 + public AjaxResult getInfo(@PathVariable("id") Long id)
  68 + {
  69 + return success(ruleSchedulingService.selectRuleSchedulingById(id));
  70 + }
  71 +
  72 + /**
  73 + * 新增排版规则
  74 + */
  75 + @PreAuthorize("@ss.hasPermi('scheduling:scheduling:add')")
  76 + @Log(title = "排版规则", businessType = BusinessType.INSERT)
  77 + @PostMapping
  78 + public AjaxResult add(@RequestBody RuleScheduling ruleScheduling)
  79 + {
  80 + return toAjax(ruleSchedulingService.insertRuleScheduling(ruleScheduling));
  81 + }
  82 +
  83 + /**
  84 + * 修改排版规则
  85 + */
  86 + @PreAuthorize("@ss.hasPermi('scheduling:scheduling:edit')")
  87 + @Log(title = "排版规则", businessType = BusinessType.UPDATE)
  88 + @PutMapping
  89 + public AjaxResult edit(@RequestBody RuleScheduling ruleScheduling)
  90 + {
  91 + return toAjax(ruleSchedulingService.updateRuleScheduling(ruleScheduling));
  92 + }
  93 +
  94 + /**
  95 + * 删除排版规则
  96 + */
  97 + @PreAuthorize("@ss.hasPermi('scheduling:scheduling:remove')")
  98 + @Log(title = "排版规则", businessType = BusinessType.DELETE)
  99 + @DeleteMapping("/{ids}")
  100 + public AjaxResult remove(@PathVariable Long[] ids)
  101 + {
  102 + return toAjax(ruleSchedulingService.deleteRuleSchedulingByIds(ids));
  103 + }
  104 +}
... ...
ruoyi-admin/src/main/java/com/ruoyi/scheduling/domain/RuleScheduling.java 0 → 100644
  1 +package com.ruoyi.scheduling.domain;
  2 +
  3 +import java.util.Date;
  4 +import com.fasterxml.jackson.annotation.JsonFormat;
  5 +import org.apache.commons.lang3.builder.ToStringBuilder;
  6 +import org.apache.commons.lang3.builder.ToStringStyle;
  7 +import com.ruoyi.common.annotation.Excel;
  8 +import com.ruoyi.common.core.domain.BaseEntity;
  9 +
  10 +/**
  11 + * 排版规则对象 rule_scheduling
  12 + *
  13 + * @author guzijian
  14 + * @date 2023-08-07
  15 + */
  16 +public class RuleScheduling extends BaseEntity
  17 +{
  18 + private static final long serialVersionUID = 1L;
  19 +
  20 + /** 主键 */
  21 + private Long id;
  22 +
  23 + /** 规则名称 */
  24 + @Excel(name = "规则名称")
  25 + private String ruleName;
  26 +
  27 + /** 工时制 */
  28 + @Excel(name = "工时制")
  29 + private Long workingHourPlan;
  30 +
  31 + /** 工时类型 */
  32 + @Excel(name = "工时类型")
  33 + private Long workingHourType;
  34 +
  35 + /** 第一段上班签到时间 */
  36 + @JsonFormat(pattern = "yyyy-MM-dd")
  37 + @Excel(name = "第一段上班签到时间", width = 30, dateFormat = "yyyy-MM-dd")
  38 + private Date firstWorkSignInTime;
  39 +
  40 + /** 第一段上班打卡签到范围 */
  41 + @Excel(name = "第一段上班打卡签到范围")
  42 + private Long firstSignInWorkingRange;
  43 +
  44 + /** 第一段下班签退时间 */
  45 + @JsonFormat(pattern = "yyyy-MM-dd")
  46 + @Excel(name = "第一段下班签退时间", width = 30, dateFormat = "yyyy-MM-dd")
  47 + private Date firstQuittingSignInTime;
  48 +
  49 + /** 第一段上下班标识,今天时间还是隔天 */
  50 + @Excel(name = "第一段上下班标识,今天时间还是隔天")
  51 + private Long firstSignInDayTomorrow;
  52 +
  53 + /** 第一段下班签退签到范围 */
  54 + @Excel(name = "第一段下班签退签到范围")
  55 + private Long firstSignInQuittingRange;
  56 +
  57 + /** 超时范围允许 */
  58 + @Excel(name = "超时范围允许")
  59 + private Long signInTimeOutRange;
  60 +
  61 + /** 第二段开启标识 1默认1 未开启 2 开启 */
  62 + @Excel(name = "第二段开启标识 1默认1 未开启 2 开启")
  63 + private Long secondFlag;
  64 +
  65 + /** 第二段上班签到时间 */
  66 + @JsonFormat(pattern = "yyyy-MM-dd")
  67 + @Excel(name = "第二段上班签到时间", width = 30, dateFormat = "yyyy-MM-dd")
  68 + private Date secondWorkSignInTime;
  69 +
  70 + /** 第二段上班打卡范围 */
  71 + @Excel(name = "第二段上班打卡范围")
  72 + private Long secondSignInWorkingRange;
  73 +
  74 + /** 第二段下班签到签退 */
  75 + @JsonFormat(pattern = "yyyy-MM-dd")
  76 + @Excel(name = "第二段下班签到签退", width = 30, dateFormat = "yyyy-MM-dd")
  77 + private Date secondQuittingSignInTime;
  78 +
  79 + /** 第二段下班打卡范围 */
  80 + @Excel(name = "第二段下班打卡范围")
  81 + private Long secondSignInQuittingRange;
  82 +
  83 + /** 第二段上下班标识,今天时间还是隔天 */
  84 + @Excel(name = "第二段上下班标识,今天时间还是隔天")
  85 + private Long secondSignDayTomorrow;
  86 +
  87 + public void setId(Long id)
  88 + {
  89 + this.id = id;
  90 + }
  91 +
  92 + public Long getId()
  93 + {
  94 + return id;
  95 + }
  96 + public void setRuleName(String ruleName)
  97 + {
  98 + this.ruleName = ruleName;
  99 + }
  100 +
  101 + public String getRuleName()
  102 + {
  103 + return ruleName;
  104 + }
  105 + public void setWorkingHourPlan(Long workingHourPlan)
  106 + {
  107 + this.workingHourPlan = workingHourPlan;
  108 + }
  109 +
  110 + public Long getWorkingHourPlan()
  111 + {
  112 + return workingHourPlan;
  113 + }
  114 + public void setWorkingHourType(Long workingHourType)
  115 + {
  116 + this.workingHourType = workingHourType;
  117 + }
  118 +
  119 + public Long getWorkingHourType()
  120 + {
  121 + return workingHourType;
  122 + }
  123 + public void setFirstWorkSignInTime(Date firstWorkSignInTime)
  124 + {
  125 + this.firstWorkSignInTime = firstWorkSignInTime;
  126 + }
  127 +
  128 + public Date getFirstWorkSignInTime()
  129 + {
  130 + return firstWorkSignInTime;
  131 + }
  132 + public void setFirstSignInWorkingRange(Long firstSignInWorkingRange)
  133 + {
  134 + this.firstSignInWorkingRange = firstSignInWorkingRange;
  135 + }
  136 +
  137 + public Long getFirstSignInWorkingRange()
  138 + {
  139 + return firstSignInWorkingRange;
  140 + }
  141 + public void setFirstQuittingSignInTime(Date firstQuittingSignInTime)
  142 + {
  143 + this.firstQuittingSignInTime = firstQuittingSignInTime;
  144 + }
  145 +
  146 + public Date getFirstQuittingSignInTime()
  147 + {
  148 + return firstQuittingSignInTime;
  149 + }
  150 + public void setFirstSignInDayTomorrow(Long firstSignInDayTomorrow)
  151 + {
  152 + this.firstSignInDayTomorrow = firstSignInDayTomorrow;
  153 + }
  154 +
  155 + public Long getFirstSignInDayTomorrow()
  156 + {
  157 + return firstSignInDayTomorrow;
  158 + }
  159 + public void setFirstSignInQuittingRange(Long firstSignInQuittingRange)
  160 + {
  161 + this.firstSignInQuittingRange = firstSignInQuittingRange;
  162 + }
  163 +
  164 + public Long getFirstSignInQuittingRange()
  165 + {
  166 + return firstSignInQuittingRange;
  167 + }
  168 + public void setSignInTimeOutRange(Long signInTimeOutRange)
  169 + {
  170 + this.signInTimeOutRange = signInTimeOutRange;
  171 + }
  172 +
  173 + public Long getSignInTimeOutRange()
  174 + {
  175 + return signInTimeOutRange;
  176 + }
  177 + public void setSecondFlag(Long secondFlag)
  178 + {
  179 + this.secondFlag = secondFlag;
  180 + }
  181 +
  182 + public Long getSecondFlag()
  183 + {
  184 + return secondFlag;
  185 + }
  186 + public void setSecondWorkSignInTime(Date secondWorkSignInTime)
  187 + {
  188 + this.secondWorkSignInTime = secondWorkSignInTime;
  189 + }
  190 +
  191 + public Date getSecondWorkSignInTime()
  192 + {
  193 + return secondWorkSignInTime;
  194 + }
  195 + public void setSecondSignInWorkingRange(Long secondSignInWorkingRange)
  196 + {
  197 + this.secondSignInWorkingRange = secondSignInWorkingRange;
  198 + }
  199 +
  200 + public Long getSecondSignInWorkingRange()
  201 + {
  202 + return secondSignInWorkingRange;
  203 + }
  204 + public void setSecondQuittingSignInTime(Date secondQuittingSignInTime)
  205 + {
  206 + this.secondQuittingSignInTime = secondQuittingSignInTime;
  207 + }
  208 +
  209 + public Date getSecondQuittingSignInTime()
  210 + {
  211 + return secondQuittingSignInTime;
  212 + }
  213 + public void setSecondSignInQuittingRange(Long secondSignInQuittingRange)
  214 + {
  215 + this.secondSignInQuittingRange = secondSignInQuittingRange;
  216 + }
  217 +
  218 + public Long getSecondSignInQuittingRange()
  219 + {
  220 + return secondSignInQuittingRange;
  221 + }
  222 + public void setSecondSignDayTomorrow(Long secondSignDayTomorrow)
  223 + {
  224 + this.secondSignDayTomorrow = secondSignDayTomorrow;
  225 + }
  226 +
  227 + public Long getSecondSignDayTomorrow()
  228 + {
  229 + return secondSignDayTomorrow;
  230 + }
  231 +
  232 + @Override
  233 + public String toString() {
  234 + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
  235 + .append("id", getId())
  236 + .append("ruleName", getRuleName())
  237 + .append("workingHourPlan", getWorkingHourPlan())
  238 + .append("workingHourType", getWorkingHourType())
  239 + .append("firstWorkSignInTime", getFirstWorkSignInTime())
  240 + .append("firstSignInWorkingRange", getFirstSignInWorkingRange())
  241 + .append("firstQuittingSignInTime", getFirstQuittingSignInTime())
  242 + .append("firstSignInDayTomorrow", getFirstSignInDayTomorrow())
  243 + .append("firstSignInQuittingRange", getFirstSignInQuittingRange())
  244 + .append("signInTimeOutRange", getSignInTimeOutRange())
  245 + .append("secondFlag", getSecondFlag())
  246 + .append("secondWorkSignInTime", getSecondWorkSignInTime())
  247 + .append("secondSignInWorkingRange", getSecondSignInWorkingRange())
  248 + .append("secondQuittingSignInTime", getSecondQuittingSignInTime())
  249 + .append("secondSignInQuittingRange", getSecondSignInQuittingRange())
  250 + .append("secondSignDayTomorrow", getSecondSignDayTomorrow())
  251 + .toString();
  252 + }
  253 +}
... ...
ruoyi-admin/src/main/java/com/ruoyi/scheduling/mapper/RuleSchedulingMapper.java 0 → 100644
  1 +package com.ruoyi.scheduling.mapper;
  2 +
  3 +import java.util.List;
  4 +import com.ruoyi.scheduling.domain.RuleScheduling;
  5 +
  6 +/**
  7 + * 排版规则Mapper接口
  8 + *
  9 + * @author guzijian
  10 + * @date 2023-08-04
  11 + */
  12 +public interface RuleSchedulingMapper
  13 +{
  14 + /**
  15 + * 查询排版规则
  16 + *
  17 + * @param id 排版规则主键
  18 + * @return 排版规则
  19 + */
  20 + public RuleScheduling selectRuleSchedulingById(Long id);
  21 +
  22 + /**
  23 + * 查询排版规则列表
  24 + *
  25 + * @param ruleScheduling 排版规则
  26 + * @return 排版规则集合
  27 + */
  28 + public List<RuleScheduling> selectRuleSchedulingList(RuleScheduling ruleScheduling);
  29 +
  30 + /**
  31 + * 新增排版规则
  32 + *
  33 + * @param ruleScheduling 排版规则
  34 + * @return 结果
  35 + */
  36 + public int insertRuleScheduling(RuleScheduling ruleScheduling);
  37 +
  38 + /**
  39 + * 修改排版规则
  40 + *
  41 + * @param ruleScheduling 排版规则
  42 + * @return 结果
  43 + */
  44 + public int updateRuleScheduling(RuleScheduling ruleScheduling);
  45 +
  46 + /**
  47 + * 删除排版规则
  48 + *
  49 + * @param id 排版规则主键
  50 + * @return 结果
  51 + */
  52 + public int deleteRuleSchedulingById(Long id);
  53 +
  54 + /**
  55 + * 批量删除排版规则
  56 + *
  57 + * @param ids 需要删除的数据主键集合
  58 + * @return 结果
  59 + */
  60 + public int deleteRuleSchedulingByIds(Long[] ids);
  61 +}
... ...
ruoyi-admin/src/main/java/com/ruoyi/scheduling/service/IRuleSchedulingService.java 0 → 100644
  1 +package com.ruoyi.scheduling.service;
  2 +
  3 +import java.util.List;
  4 +import com.ruoyi.scheduling.domain.RuleScheduling;
  5 +
  6 +/**
  7 + * 排版规则Service接口
  8 + *
  9 + * @author guzijian
  10 + * @date 2023-08-04
  11 + */
  12 +public interface IRuleSchedulingService
  13 +{
  14 + /**
  15 + * 查询排版规则
  16 + *
  17 + * @param id 排版规则主键
  18 + * @return 排版规则
  19 + */
  20 + public RuleScheduling selectRuleSchedulingById(Long id);
  21 +
  22 + /**
  23 + * 查询排版规则列表
  24 + *
  25 + * @param ruleScheduling 排版规则
  26 + * @return 排版规则集合
  27 + */
  28 + public List<RuleScheduling> selectRuleSchedulingList(RuleScheduling ruleScheduling);
  29 +
  30 + /**
  31 + * 新增排版规则
  32 + *
  33 + * @param ruleScheduling 排版规则
  34 + * @return 结果
  35 + */
  36 + public int insertRuleScheduling(RuleScheduling ruleScheduling);
  37 +
  38 + /**
  39 + * 修改排版规则
  40 + *
  41 + * @param ruleScheduling 排版规则
  42 + * @return 结果
  43 + */
  44 + public int updateRuleScheduling(RuleScheduling ruleScheduling);
  45 +
  46 + /**
  47 + * 批量删除排版规则
  48 + *
  49 + * @param ids 需要删除的排版规则主键集合
  50 + * @return 结果
  51 + */
  52 + public int deleteRuleSchedulingByIds(Long[] ids);
  53 +
  54 + /**
  55 + * 删除排版规则信息
  56 + *
  57 + * @param id 排版规则主键
  58 + * @return 结果
  59 + */
  60 + public int deleteRuleSchedulingById(Long id);
  61 +}
... ...
ruoyi-admin/src/main/java/com/ruoyi/scheduling/service/impl/RuleSchedulingServiceImpl.java 0 → 100644
  1 +package com.ruoyi.scheduling.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.scheduling.mapper.RuleSchedulingMapper;
  8 +import com.ruoyi.scheduling.domain.RuleScheduling;
  9 +import com.ruoyi.scheduling.service.IRuleSchedulingService;
  10 +
  11 +/**
  12 + * 排版规则Service业务层处理
  13 + *
  14 + * @author guzijian
  15 + * @date 2023-08-04
  16 + */
  17 +@Service
  18 +public class RuleSchedulingServiceImpl implements IRuleSchedulingService
  19 +{
  20 + @Autowired
  21 + private RuleSchedulingMapper ruleSchedulingMapper;
  22 +
  23 + /**
  24 + * 查询排版规则
  25 + *
  26 + * @param id 排版规则主键
  27 + * @return 排版规则
  28 + */
  29 + @Override
  30 + public RuleScheduling selectRuleSchedulingById(Long id)
  31 + {
  32 + return ruleSchedulingMapper.selectRuleSchedulingById(id);
  33 + }
  34 +
  35 + /**
  36 + * 查询排版规则列表
  37 + *
  38 + * @param ruleScheduling 排版规则
  39 + * @return 排版规则
  40 + */
  41 + @Override
  42 + public List<RuleScheduling> selectRuleSchedulingList(RuleScheduling ruleScheduling)
  43 + {
  44 + return ruleSchedulingMapper.selectRuleSchedulingList(ruleScheduling);
  45 + }
  46 +
  47 + /**
  48 + * 新增排版规则
  49 + *
  50 + * @param ruleScheduling 排版规则
  51 + * @return 结果
  52 + */
  53 + @Override
  54 + public int insertRuleScheduling(RuleScheduling ruleScheduling)
  55 + {
  56 + return ruleSchedulingMapper.insertRuleScheduling(ruleScheduling);
  57 + }
  58 +
  59 + /**
  60 + * 修改排版规则
  61 + *
  62 + * @param ruleScheduling 排版规则
  63 + * @return 结果
  64 + */
  65 + @Override
  66 + public int updateRuleScheduling(RuleScheduling ruleScheduling)
  67 + {
  68 + return ruleSchedulingMapper.updateRuleScheduling(ruleScheduling);
  69 + }
  70 +
  71 + /**
  72 + * 批量删除排版规则
  73 + *
  74 + * @param ids 需要删除的排版规则主键
  75 + * @return 结果
  76 + */
  77 + @Override
  78 + public int deleteRuleSchedulingByIds(Long[] ids)
  79 + {
  80 + return ruleSchedulingMapper.deleteRuleSchedulingByIds(ids);
  81 + }
  82 +
  83 + /**
  84 + * 删除排版规则信息
  85 + *
  86 + * @param id 排版规则主键
  87 + * @return 结果
  88 + */
  89 + @Override
  90 + public int deleteRuleSchedulingById(Long id)
  91 + {
  92 + return ruleSchedulingMapper.deleteRuleSchedulingById(id);
  93 + }
  94 +}
... ...
ruoyi-admin/src/main/java/com/ruoyi/utils/ConstDateUtil.java
... ... @@ -4,6 +4,7 @@ import java.text.SimpleDateFormat;
4 4 import java.time.Instant;
5 5 import java.time.LocalDateTime;
6 6 import java.time.ZoneId;
  7 +import java.util.Calendar;
7 8 import java.util.Date;
8 9  
9 10 public class ConstDateUtil {
... ... @@ -20,6 +21,15 @@ public class ConstDateUtil {
20 21 return simpleDateFormat.format(date);
21 22 }
22 23  
  24 + public static Date getTheSpecifiedNumberOfDaysOfTime(Integer amount) {
  25 + // 获取当前日期时间
  26 + Calendar calendar = Calendar.getInstance();
  27 + // 将日期减去一天
  28 + calendar.add(Calendar.DAY_OF_MONTH, amount);
  29 + // 获取昨天的日期时间
  30 + return calendar.getTime();
  31 + }
  32 +
23 33  
24 34 public static LocalDateTime getLocalDateTimeByLongTime(long time){
25 35 Instant instant = Instant.ofEpochMilli(time);
... ...
ruoyi-admin/src/main/resources/application-druid-prd.yml
... ... @@ -9,8 +9,7 @@ spring:
9 9 # 测试地址
10 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 11 username: root
12   -# password: qinpugongjiao20230730
13   - password: guzijian
  12 + password: qinpugongjiao20230730
14 13 # 从库数据源
15 14 slave:
16 15 # 从数据源开关/默认关闭
... ... @@ -179,5 +178,4 @@ api:
179 178 appSecret: ckV20k3jMKJpUkfXXSGhLk077rQQjsSaAusiSVY-nm4glwweCmb_SMJ62Cpf4YQ5
180 179 people:
181 180 url: https://api.dingtalk.com/v1.0/yida/forms/instances/search
182   -log:
183   - path: E:/ruoyi/logs
  181 +
... ...
ruoyi-admin/src/main/resources/application.yml
... ... @@ -154,3 +154,5 @@ api:
154 154 tokenUrl: https://api.dingtalk.com/v1.0/oauth2/accessToken
155 155 appKey: dingsclwvxui5zilg1xk
156 156 appSecret: ckV20k3jMKJpUkfXXSGhLk077rQQjsSaAusiSVY-nm4glwweCmb_SMJ62Cpf4YQ5
  157 +log:
  158 + path: E:/ruoyi/logs
157 159 \ No newline at end of file
... ...
ruoyi-admin/src/main/resources/logback.xml
... ... @@ -3,7 +3,9 @@
3 3 <!-- 日志存放路径 -->
4 4 <!-- <property name="log.path" value="E:/ruoyi/logs" />-->
5 5 <!-- <property name="log.path" value="D:/ruoyi/logs" />-->
6   - <property name="log.path" value="/home/ruoyi/logs" />
  6 + <springProperty name="log.path" source="log.path" defaultValue="E:/ruoyi/logs" />
  7 + />
  8 +<!-- <property name="log.path" value="/home/ruoyi/logs" />-->
7 9 <!-- 日志输出格式 -->
8 10 <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
9 11  
... ...
ruoyi-admin/src/main/resources/mapper/in/SignInMapper.xml
... ... @@ -77,7 +77,9 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
77 77 sign_in.image,
78 78 sign_in.remark,
79 79 driver.posts,
80   - equipment.address
  80 + equipment.address,
  81 + driver.fleet_name,
  82 + driver.line_name
81 83 FROM
82 84 equipment,
83 85 sign_in,
... ...
ruoyi-admin/src/main/resources/mapper/scheduling/RuleSchedulingMapper.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.scheduling.mapper.RuleSchedulingMapper">
  6 +
  7 + <resultMap type="RuleScheduling" id="RuleSchedulingResult">
  8 + <result property="id" column="id" />
  9 + <result property="ruleName" column="rule_name" />
  10 + <result property="workingHourPlan" column="working_hour_plan" />
  11 + <result property="workingHourType" column="working_hour_type" />
  12 + <result property="firstWorkSignInTime" column="first_work_sign_in_time" />
  13 + <result property="firstSignInWorkingRange" column="first_sign_in_working_range" />
  14 + <result property="firstQuittingSignInTime" column="first_quitting_sign_in_time" />
  15 + <result property="firstSignInDayTomorrow" column="first_sign_in_day_tomorrow" />
  16 + <result property="firstSignInQuittingRange" column="first_sign_in_quitting_range" />
  17 + <result property="signInTimeOutRange" column="sign_in_time_out_range" />
  18 + <result property="secondFlag" column="second_flag" />
  19 + <result property="secondWorkSignInTime" column="second_work_sign_in_time" />
  20 + <result property="secondSignInWorkingRange" column="second_sign_in_working_range" />
  21 + <result property="secondQuittingSignInTime" column="second_quitting_sign_in_time" />
  22 + <result property="secondSignInQuittingRange" column="second_sign_in_quitting_range" />
  23 + <result property="secondSignDayTomorrow" column="second_sign_day_tomorrow" />
  24 + </resultMap>
  25 +
  26 + <sql id="selectRuleSchedulingVo">
  27 + 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
  28 + </sql>
  29 +
  30 + <select id="selectRuleSchedulingList" parameterType="RuleScheduling" resultMap="RuleSchedulingResult">
  31 + <include refid="selectRuleSchedulingVo"/>
  32 + <where>
  33 + <if test="ruleName != null and ruleName != ''"> and rule_name like concat('%', #{ruleName}, '%')</if>
  34 + <if test="workingHourPlan != null "> and working_hour_plan = #{workingHourPlan}</if>
  35 + <if test="workingHourType != null "> and working_hour_type = #{workingHourType}</if>
  36 + <if test="firstWorkSignInTime != null "> and first_work_sign_in_time = #{firstWorkSignInTime}</if>
  37 + <if test="firstSignInWorkingRange != null "> and first_sign_in_working_range = #{firstSignInWorkingRange}</if>
  38 + <if test="firstQuittingSignInTime != null "> and first_quitting_sign_in_time = #{firstQuittingSignInTime}</if>
  39 + <if test="firstSignInDayTomorrow != null "> and first_sign_in_day_tomorrow = #{firstSignInDayTomorrow}</if>
  40 + <if test="firstSignInQuittingRange != null "> and first_sign_in_quitting_range = #{firstSignInQuittingRange}</if>
  41 + <if test="signInTimeOutRange != null "> and sign_in_time_out_range = #{signInTimeOutRange}</if>
  42 + <if test="secondFlag != null "> and second_flag = #{secondFlag}</if>
  43 + <if test="secondWorkSignInTime != null "> and second_work_sign_in_time = #{secondWorkSignInTime}</if>
  44 + <if test="secondSignInWorkingRange != null "> and second_sign_in_working_range = #{secondSignInWorkingRange}</if>
  45 + <if test="secondQuittingSignInTime != null "> and second_quitting_sign_in_time = #{secondQuittingSignInTime}</if>
  46 + <if test="secondSignInQuittingRange != null "> and second_sign_in_quitting_range = #{secondSignInQuittingRange}</if>
  47 + <if test="secondSignDayTomorrow != null "> and second_sign_day_tomorrow = #{secondSignDayTomorrow}</if>
  48 + </where>
  49 + </select>
  50 +
  51 + <select id="selectRuleSchedulingById" parameterType="Long" resultMap="RuleSchedulingResult">
  52 + <include refid="selectRuleSchedulingVo"/>
  53 + where id = #{id}
  54 + </select>
  55 +
  56 + <insert id="insertRuleScheduling" parameterType="RuleScheduling" useGeneratedKeys="true" keyProperty="id">
  57 + insert into rule_scheduling
  58 + <trim prefix="(" suffix=")" suffixOverrides=",">
  59 + <if test="ruleName != null and ruleName != ''">rule_name,</if>
  60 + <if test="workingHourPlan != null">working_hour_plan,</if>
  61 + <if test="workingHourType != null">working_hour_type,</if>
  62 + <if test="firstWorkSignInTime != null">first_work_sign_in_time,</if>
  63 + <if test="firstSignInWorkingRange != null">first_sign_in_working_range,</if>
  64 + <if test="firstQuittingSignInTime != null">first_quitting_sign_in_time,</if>
  65 + <if test="firstSignInDayTomorrow != null">first_sign_in_day_tomorrow,</if>
  66 + <if test="firstSignInQuittingRange != null">first_sign_in_quitting_range,</if>
  67 + <if test="signInTimeOutRange != null">sign_in_time_out_range,</if>
  68 + <if test="secondFlag != null">second_flag,</if>
  69 + <if test="secondWorkSignInTime != null">second_work_sign_in_time,</if>
  70 + <if test="secondSignInWorkingRange != null">second_sign_in_working_range,</if>
  71 + <if test="secondQuittingSignInTime != null">second_quitting_sign_in_time,</if>
  72 + <if test="secondSignInQuittingRange != null">second_sign_in_quitting_range,</if>
  73 + <if test="secondSignDayTomorrow != null">second_sign_day_tomorrow,</if>
  74 + </trim>
  75 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  76 + <if test="ruleName != null and ruleName != ''">#{ruleName},</if>
  77 + <if test="workingHourPlan != null">#{workingHourPlan},</if>
  78 + <if test="workingHourType != null">#{workingHourType},</if>
  79 + <if test="firstWorkSignInTime != null">#{firstWorkSignInTime},</if>
  80 + <if test="firstSignInWorkingRange != null">#{firstSignInWorkingRange},</if>
  81 + <if test="firstQuittingSignInTime != null">#{firstQuittingSignInTime},</if>
  82 + <if test="firstSignInDayTomorrow != null">#{firstSignInDayTomorrow},</if>
  83 + <if test="firstSignInQuittingRange != null">#{firstSignInQuittingRange},</if>
  84 + <if test="signInTimeOutRange != null">#{signInTimeOutRange},</if>
  85 + <if test="secondFlag != null">#{secondFlag},</if>
  86 + <if test="secondWorkSignInTime != null">#{secondWorkSignInTime},</if>
  87 + <if test="secondSignInWorkingRange != null">#{secondSignInWorkingRange},</if>
  88 + <if test="secondQuittingSignInTime != null">#{secondQuittingSignInTime},</if>
  89 + <if test="secondSignInQuittingRange != null">#{secondSignInQuittingRange},</if>
  90 + <if test="secondSignDayTomorrow != null">#{secondSignDayTomorrow},</if>
  91 + </trim>
  92 + </insert>
  93 +
  94 + <update id="updateRuleScheduling" parameterType="RuleScheduling">
  95 + update rule_scheduling
  96 + <trim prefix="SET" suffixOverrides=",">
  97 + <if test="ruleName != null and ruleName != ''">rule_name = #{ruleName},</if>
  98 + <if test="workingHourPlan != null">working_hour_plan = #{workingHourPlan},</if>
  99 + <if test="workingHourType != null">working_hour_type = #{workingHourType},</if>
  100 + <if test="firstWorkSignInTime != null">first_work_sign_in_time = #{firstWorkSignInTime},</if>
  101 + <if test="firstSignInWorkingRange != null">first_sign_in_working_range = #{firstSignInWorkingRange},</if>
  102 + <if test="firstQuittingSignInTime != null">first_quitting_sign_in_time = #{firstQuittingSignInTime},</if>
  103 + <if test="firstSignInDayTomorrow != null">first_sign_in_day_tomorrow = #{firstSignInDayTomorrow},</if>
  104 + <if test="firstSignInQuittingRange != null">first_sign_in_quitting_range = #{firstSignInQuittingRange},</if>
  105 + <if test="signInTimeOutRange != null">sign_in_time_out_range = #{signInTimeOutRange},</if>
  106 + <if test="secondFlag != null">second_flag = #{secondFlag},</if>
  107 + <if test="secondWorkSignInTime != null">second_work_sign_in_time = #{secondWorkSignInTime},</if>
  108 + <if test="secondSignInWorkingRange != null">second_sign_in_working_range = #{secondSignInWorkingRange},</if>
  109 + <if test="secondQuittingSignInTime != null">second_quitting_sign_in_time = #{secondQuittingSignInTime},</if>
  110 + <if test="secondSignInQuittingRange != null">second_sign_in_quitting_range = #{secondSignInQuittingRange},</if>
  111 + <if test="secondSignDayTomorrow != null">second_sign_day_tomorrow = #{secondSignDayTomorrow},</if>
  112 + </trim>
  113 + where id = #{id}
  114 + </update>
  115 +
  116 + <delete id="deleteRuleSchedulingById" parameterType="Long">
  117 + delete from rule_scheduling where id = #{id}
  118 + </delete>
  119 +
  120 + <delete id="deleteRuleSchedulingByIds" parameterType="String">
  121 + delete from rule_scheduling where id in
  122 + <foreach item="id" collection="array" open="(" separator="," close=")">
  123 + #{id}
  124 + </foreach>
  125 + </delete>
  126 +</mapper>
0 127 \ No newline at end of file
... ...