feat:
This commit is contained in:
parent
a9a30ab8c9
commit
2b2d5bd83b
|
@ -158,7 +158,7 @@ public class NonWorkingDayDrinkingReportController extends BaseController {
|
|||
|
||||
@ApiOperation("审批非工作日饮酒报备单")
|
||||
@PostMapping("/approval")
|
||||
public AjaxResult approval(@RequestBody ApprovaltDto dto) {
|
||||
public AjaxResult approval(ApprovaltDto dto) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
Long id = dto.getId();
|
||||
Integer state = dto.getState();
|
||||
|
@ -174,6 +174,7 @@ public class NonWorkingDayDrinkingReportController extends BaseController {
|
|||
gwglLog.setCreateTime(nonWorkingDayDrinkingReport.getCreateTime());
|
||||
gwglLog.setReason(nonWorkingDayDrinkingReport.getReason());
|
||||
gwglLog.setType(1);
|
||||
gwglLog.setApplyNo(nonWorkingDayDrinkingReport.getApplyNo());
|
||||
gwglLog.setChecker(user.getNickName());
|
||||
gwglLog.setCheckTime(LocalDateTime.now());
|
||||
gwglLog.setCheckState(state);
|
||||
|
|
|
@ -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.SysUser;
|
||||
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.dto.ApprovaltDto;
|
||||
import com.ruoyi.database.domain.gwglLog;
|
||||
|
@ -18,8 +20,10 @@ import io.swagger.annotations.ApiOperation;
|
|||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
@ -110,7 +114,7 @@ public class PoliceLeaveApprovalController extends BaseController {
|
|||
policeLeaveApproval.setCreateBy(user.getNickName());
|
||||
policeLeaveApproval.setUserId(user.getUserId());
|
||||
policeLeaveApproval.setDeptId(user.getDeptId());
|
||||
|
||||
policeLeaveApproval.setApplyNo(OrderNumberGenerator());
|
||||
if (leader.contains(user.getNickName())) {
|
||||
// 单位领导
|
||||
policeLeaveApproval.setUserType(1);
|
||||
|
@ -173,6 +177,8 @@ public class PoliceLeaveApprovalController extends BaseController {
|
|||
gwglLog.setUserName(policeLeaveApproval.getName());
|
||||
gwglLog.setCreateTime(policeLeaveApproval.getCreateTime());
|
||||
gwglLog.setReason(policeLeaveApproval.getReason());
|
||||
gwglLog.setResult(state);
|
||||
gwglLog.setApplyNo(policeLeaveApproval.getApplyNo());
|
||||
gwglLog.setType(1);
|
||||
gwglLog.setChecker(user.getNickName());
|
||||
gwglLog.setCheckTime(LocalDateTime.now());
|
||||
|
@ -184,4 +190,15 @@ public class PoliceLeaveApprovalController extends BaseController {
|
|||
|
||||
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)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
package com.ruoyi.database.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("non_working_day_drinking_report")
|
||||
|
@ -40,9 +36,7 @@ public class NonWorkingDayDrinkingReport {
|
|||
private Long deptId;
|
||||
|
||||
@ApiModelProperty("饮酒时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime drinkTime;
|
||||
private Long drinkTime;
|
||||
|
||||
@ApiModelProperty("出行方式")
|
||||
private String travelMode;
|
||||
|
@ -84,16 +78,14 @@ public class NonWorkingDayDrinkingReport {
|
|||
@ApiModelProperty("责任领导签名")
|
||||
private String leaderSign;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
private Long createTime;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
private Long updateTime;
|
||||
|
||||
@ApiModelProperty("修改人")
|
||||
private String updateBy;
|
||||
|
|
|
@ -1,14 +1,9 @@
|
|||
package com.ruoyi.database.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("police_leave_approval")
|
||||
|
@ -34,9 +29,11 @@ public class PoliceLeaveApproval {
|
|||
@ApiModelProperty("身份证号码")
|
||||
private String idCard;
|
||||
|
||||
|
||||
@ApiModelProperty("参加工作时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate joinWorkTime;
|
||||
private Long joinWorkTime;
|
||||
@TableField(exist = false)
|
||||
private String joinWorkTimeCn;
|
||||
|
||||
@ApiModelProperty("联系电话")
|
||||
private String phone;
|
||||
|
@ -60,30 +57,33 @@ public class PoliceLeaveApproval {
|
|||
private Integer leaveType;
|
||||
|
||||
@ApiModelProperty("请假开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime startDate;
|
||||
private Long startDate;
|
||||
@TableField(exist = false)
|
||||
private String startDateCn;
|
||||
|
||||
@ApiModelProperty("请假结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private LocalDateTime endDate;
|
||||
private Long endDate;
|
||||
@TableField(exist = false)
|
||||
private String endDateCn;
|
||||
|
||||
|
||||
@ApiModelProperty("审批流程 0-未审批 1-部门审批通过 2-部门审批不通过 3-政治处审批通过 4-政治处审批不通过 5-局领导审批通过 6-局领导审批不通过")
|
||||
@TableField(condition = SqlCondition.EQUAL)
|
||||
private Integer state;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
private Long createTime;
|
||||
@TableField(exist = false)
|
||||
private String createTimeCn;
|
||||
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
private Long updateTime;
|
||||
@TableField(exist = false)
|
||||
private String updateTimeCn;
|
||||
|
||||
@ApiModelProperty("修改人")
|
||||
private String updateBy;
|
||||
|
|
|
@ -44,7 +44,7 @@ public class gwglLog {
|
|||
|
||||
@ApiModelProperty("申请时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
private Long createTime;
|
||||
|
||||
@ApiModelProperty("申请类型")
|
||||
private Integer type;
|
||||
|
|
Loading…
Reference in New Issue