This commit is contained in:
李京通 2025-06-07 10:19:44 +08:00
parent a9a30ab8c9
commit 2b2d5bd83b
5 changed files with 41 additions and 31 deletions

View File

@ -158,7 +158,7 @@ public class NonWorkingDayDrinkingReportController extends BaseController {
@ApiOperation("审批非工作日饮酒报备单") @ApiOperation("审批非工作日饮酒报备单")
@PostMapping("/approval") @PostMapping("/approval")
public AjaxResult approval(@RequestBody ApprovaltDto dto) { public AjaxResult approval(ApprovaltDto dto) {
SysUser user = getLoginUser().getUser(); SysUser user = getLoginUser().getUser();
Long id = dto.getId(); Long id = dto.getId();
Integer state = dto.getState(); Integer state = dto.getState();
@ -174,6 +174,7 @@ public class NonWorkingDayDrinkingReportController extends BaseController {
gwglLog.setCreateTime(nonWorkingDayDrinkingReport.getCreateTime()); gwglLog.setCreateTime(nonWorkingDayDrinkingReport.getCreateTime());
gwglLog.setReason(nonWorkingDayDrinkingReport.getReason()); gwglLog.setReason(nonWorkingDayDrinkingReport.getReason());
gwglLog.setType(1); gwglLog.setType(1);
gwglLog.setApplyNo(nonWorkingDayDrinkingReport.getApplyNo());
gwglLog.setChecker(user.getNickName()); gwglLog.setChecker(user.getNickName());
gwglLog.setCheckTime(LocalDateTime.now()); gwglLog.setCheckTime(LocalDateTime.now());
gwglLog.setCheckState(state); gwglLog.setCheckState(state);

View File

@ -6,6 +6,8 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.database.domain.PoliceLeaveApproval; import com.ruoyi.database.domain.PoliceLeaveApproval;
import com.ruoyi.database.domain.dto.ApprovaltDto; import com.ruoyi.database.domain.dto.ApprovaltDto;
import com.ruoyi.database.domain.gwglLog; import com.ruoyi.database.domain.gwglLog;
@ -18,8 +20,10 @@ import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -110,7 +114,7 @@ public class PoliceLeaveApprovalController extends BaseController {
policeLeaveApproval.setCreateBy(user.getNickName()); policeLeaveApproval.setCreateBy(user.getNickName());
policeLeaveApproval.setUserId(user.getUserId()); policeLeaveApproval.setUserId(user.getUserId());
policeLeaveApproval.setDeptId(user.getDeptId()); policeLeaveApproval.setDeptId(user.getDeptId());
policeLeaveApproval.setApplyNo(OrderNumberGenerator());
if (leader.contains(user.getNickName())) { if (leader.contains(user.getNickName())) {
// 单位领导 // 单位领导
policeLeaveApproval.setUserType(1); policeLeaveApproval.setUserType(1);
@ -173,6 +177,8 @@ public class PoliceLeaveApprovalController extends BaseController {
gwglLog.setUserName(policeLeaveApproval.getName()); gwglLog.setUserName(policeLeaveApproval.getName());
gwglLog.setCreateTime(policeLeaveApproval.getCreateTime()); gwglLog.setCreateTime(policeLeaveApproval.getCreateTime());
gwglLog.setReason(policeLeaveApproval.getReason()); gwglLog.setReason(policeLeaveApproval.getReason());
gwglLog.setResult(state);
gwglLog.setApplyNo(policeLeaveApproval.getApplyNo());
gwglLog.setType(1); gwglLog.setType(1);
gwglLog.setChecker(user.getNickName()); gwglLog.setChecker(user.getNickName());
gwglLog.setCheckTime(LocalDateTime.now()); gwglLog.setCheckTime(LocalDateTime.now());
@ -184,4 +190,15 @@ public class PoliceLeaveApprovalController extends BaseController {
return AjaxResult.success("审批请(休)假成功"); return AjaxResult.success("审批请(休)假成功");
} }
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
private static final String DATA_KEY = "DDATAKEY:";
public static String OrderNumberGenerator() {
String format = sdf.format(new Date());
RedisCache bean = SpringUtils.getBean(RedisCache.class);
bean.setCacheObject(DATA_KEY + format, bean.getCacheObject(DATA_KEY + format) == null ? 1 : (Integer) (bean.getCacheObject(DATA_KEY + format)) + 1);
return format + String.format("%04d", (Integer) (bean.getCacheObject(DATA_KEY + format)));
}
} }

View File

@ -1,13 +1,9 @@
package com.ruoyi.database.domain; package com.ruoyi.database.domain;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Data @Data
@TableName("non_working_day_drinking_report") @TableName("non_working_day_drinking_report")
@ -40,9 +36,7 @@ public class NonWorkingDayDrinkingReport {
private Long deptId; private Long deptId;
@ApiModelProperty("饮酒时间") @ApiModelProperty("饮酒时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") private Long drinkTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
private LocalDateTime drinkTime;
@ApiModelProperty("出行方式") @ApiModelProperty("出行方式")
private String travelMode; private String travelMode;
@ -84,16 +78,14 @@ public class NonWorkingDayDrinkingReport {
@ApiModelProperty("责任领导签名") @ApiModelProperty("责任领导签名")
private String leaderSign; private String leaderSign;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private LocalDateTime createTime; private Long createTime;
@ApiModelProperty("创建人") @ApiModelProperty("创建人")
private String createBy; private String createBy;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("修改时间") @ApiModelProperty("修改时间")
private LocalDateTime updateTime; private Long updateTime;
@ApiModelProperty("修改人") @ApiModelProperty("修改人")
private String updateBy; private String updateBy;

View File

@ -1,14 +1,9 @@
package com.ruoyi.database.domain; package com.ruoyi.database.domain;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Data @Data
@TableName("police_leave_approval") @TableName("police_leave_approval")
@ -34,9 +29,11 @@ public class PoliceLeaveApproval {
@ApiModelProperty("身份证号码") @ApiModelProperty("身份证号码")
private String idCard; private String idCard;
@ApiModelProperty("参加工作时间") @ApiModelProperty("参加工作时间")
@JsonFormat(pattern = "yyyy-MM-dd") private Long joinWorkTime;
private LocalDate joinWorkTime; @TableField(exist = false)
private String joinWorkTimeCn;
@ApiModelProperty("联系电话") @ApiModelProperty("联系电话")
private String phone; private String phone;
@ -60,30 +57,33 @@ public class PoliceLeaveApproval {
private Integer leaveType; private Integer leaveType;
@ApiModelProperty("请假开始时间") @ApiModelProperty("请假开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") private Long startDate;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") @TableField(exist = false)
private LocalDateTime startDate; private String startDateCn;
@ApiModelProperty("请假结束时间") @ApiModelProperty("请假结束时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") private Long endDate;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") @TableField(exist = false)
private LocalDateTime endDate; private String endDateCn;
@ApiModelProperty("审批流程 0-未审批 1-部门审批通过 2-部门审批不通过 3-政治处审批通过 4-政治处审批不通过 5-局领导审批通过 6-局领导审批不通过") @ApiModelProperty("审批流程 0-未审批 1-部门审批通过 2-部门审批不通过 3-政治处审批通过 4-政治处审批不通过 5-局领导审批通过 6-局领导审批不通过")
@TableField(condition = SqlCondition.EQUAL) @TableField(condition = SqlCondition.EQUAL)
private Integer state; private Integer state;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("创建时间") @ApiModelProperty("创建时间")
private LocalDateTime createTime; private Long createTime;
@TableField(exist = false)
private String createTimeCn;
@ApiModelProperty("创建人") @ApiModelProperty("创建人")
private String createBy; private String createBy;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("修改时间") @ApiModelProperty("修改时间")
private LocalDateTime updateTime; private Long updateTime;
@TableField(exist = false)
private String updateTimeCn;
@ApiModelProperty("修改人") @ApiModelProperty("修改人")
private String updateBy; private String updateBy;

View File

@ -44,7 +44,7 @@ public class gwglLog {
@ApiModelProperty("申请时间") @ApiModelProperty("申请时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime; private Long createTime;
@ApiModelProperty("申请类型") @ApiModelProperty("申请类型")
private Integer type; private Integer type;