feat: 非工作日饮酒报备单
This commit is contained in:
parent
3080911e77
commit
708fe54178
|
@ -0,0 +1,104 @@
|
||||||
|
package com.ruoyi.business.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.database.domain.NonWorkingDayDrinkingReport;
|
||||||
|
import com.ruoyi.database.domain.dto.ApprovaltDto;
|
||||||
|
import com.ruoyi.database.service.NonWorkingDayDrinkingReportService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description NonWorkingDayDrinkingReportController
|
||||||
|
* @Author lijingtong
|
||||||
|
* @Date 2025-05-29
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Api(tags = "非工作日饮酒报备单")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("NonWorkingDayDrinkingReport")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class NonWorkingDayDrinkingReportController extends BaseController {
|
||||||
|
private final NonWorkingDayDrinkingReportService nonWorkingDayDrinkingReportService;
|
||||||
|
@ApiOperation("查询非工作日饮酒报备单")
|
||||||
|
@GetMapping("")
|
||||||
|
public TableDataInfo query(NonWorkingDayDrinkingReport nonWorkingDayDrinkingReport) {
|
||||||
|
startPage();
|
||||||
|
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
QueryWrapper<NonWorkingDayDrinkingReport> queryWrapper = new QueryWrapper<>(nonWorkingDayDrinkingReport);
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
String fTime = nonWorkingDayDrinkingReport.getFTime();
|
||||||
|
String eTime = nonWorkingDayDrinkingReport.getETime();
|
||||||
|
LocalDateTime time = LocalDateTime.parse(fTime);
|
||||||
|
LocalDateTime time1 = LocalDateTime.parse(eTime);
|
||||||
|
if (fTime != null && fTime != null) {
|
||||||
|
queryWrapper.between("create_time", time, time1);
|
||||||
|
}
|
||||||
|
List<NonWorkingDayDrinkingReport> list = nonWorkingDayDrinkingReportService.list(queryWrapper);
|
||||||
|
long count = nonWorkingDayDrinkingReportService.count(queryWrapper);
|
||||||
|
return getDataTableEnhance(list, count);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询非工作日饮酒报备单详情")
|
||||||
|
@GetMapping("/detail/{id}")
|
||||||
|
public AjaxResult detail(@PathVariable Long id) {
|
||||||
|
NonWorkingDayDrinkingReport nonWorkingDayDrinkingReport = nonWorkingDayDrinkingReportService.getById(id);
|
||||||
|
return AjaxResult.success(nonWorkingDayDrinkingReport);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("新增或修改非工作日饮酒报备单 传id为修改 不传id为新增")
|
||||||
|
@PostMapping("/add")
|
||||||
|
public AjaxResult add(@RequestBody NonWorkingDayDrinkingReport nonWorkingDayDrinkingReport) {
|
||||||
|
SysUser user = getLoginUser().getUser();
|
||||||
|
if (nonWorkingDayDrinkingReport.getId() == null) {
|
||||||
|
nonWorkingDayDrinkingReport.setCreateBy(user.getNickName());
|
||||||
|
boolean result = nonWorkingDayDrinkingReportService.save(nonWorkingDayDrinkingReport);
|
||||||
|
if (!result) {
|
||||||
|
return AjaxResult.error("新增非工作日inksReport失败");
|
||||||
|
}
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}else {
|
||||||
|
nonWorkingDayDrinkingReport.setUpdateBy(user.getNickName());
|
||||||
|
boolean result = nonWorkingDayDrinkingReportService.updateById(nonWorkingDayDrinkingReport);
|
||||||
|
if (!result) {
|
||||||
|
return AjaxResult.error("修改非工作日inksReport失败");
|
||||||
|
}
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除非工作日饮酒报备单")
|
||||||
|
@DeleteMapping("/delete/{id}")
|
||||||
|
public AjaxResult delete(@PathVariable Long id) {
|
||||||
|
boolean result = nonWorkingDayDrinkingReportService.removeById(id);
|
||||||
|
if (!result) {
|
||||||
|
return AjaxResult.error("删除非工作日inksReport失败");
|
||||||
|
}
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("审批非工作日饮酒报备单")
|
||||||
|
@PostMapping("/approval")
|
||||||
|
public AjaxResult approval(@RequestBody ApprovaltDto dto) {
|
||||||
|
Long id = dto.getId();
|
||||||
|
Integer state = dto.getState();
|
||||||
|
NonWorkingDayDrinkingReport nonWorkingDayDrinkingReport = nonWorkingDayDrinkingReportService.getById(id);
|
||||||
|
nonWorkingDayDrinkingReport.setState(state);
|
||||||
|
boolean result = nonWorkingDayDrinkingReportService.updateById(nonWorkingDayDrinkingReport);
|
||||||
|
if (!result) {
|
||||||
|
return AjaxResult.error("审批公务用车出县申请失败");
|
||||||
|
}
|
||||||
|
return AjaxResult.success("审批公务用车出县申请成功");
|
||||||
|
}
|
||||||
|
}
|
|
@ -50,6 +50,7 @@ public class BusinessTripApproval {
|
||||||
private Integer hasOfficialCar;
|
private Integer hasOfficialCar;
|
||||||
|
|
||||||
@ApiModelProperty("审批流程 0-未审批 1-部门审批通过 2-部门审批不通过 3-警务保障部门审批通过 4-警务保障部门审批不通过 5-局领导审批通过 6-局领导审批不通过")
|
@ApiModelProperty("审批流程 0-未审批 1-部门审批通过 2-部门审批不通过 3-警务保障部门审批通过 4-警务保障部门审批不通过 5-局领导审批通过 6-局领导审批不通过")
|
||||||
|
@TableField(condition = SqlCondition.EQUAL)
|
||||||
private Integer state;
|
private Integer state;
|
||||||
|
|
||||||
@ApiModelProperty("单位负责人意见")
|
@ApiModelProperty("单位负责人意见")
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package com.ruoyi.database.domain;
|
package com.ruoyi.database.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
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;
|
||||||
|
@ -56,6 +53,10 @@ public class NonWorkingDayDrinkingReport {
|
||||||
@ApiModelProperty("是否接受下属或地方公安机关宴请(0-否 1-是)")
|
@ApiModelProperty("是否接受下属或地方公安机关宴请(0-否 1-是)")
|
||||||
private Integer acceptSubordinateInvite;
|
private Integer acceptSubordinateInvite;
|
||||||
|
|
||||||
|
@ApiModelProperty("审批流程 0-未审批 1-部门审批通过 2-部门审批不通过 3-警务保障部门审批通过 4-警务保障部门审批不通过 5-局领导审批通过 6-局领导审批不通过")
|
||||||
|
@TableField(condition = SqlCondition.EQUAL)
|
||||||
|
private Integer state;
|
||||||
|
|
||||||
@ApiModelProperty("是否出入私人会所或参与一桌餐(0-否 1-是)")
|
@ApiModelProperty("是否出入私人会所或参与一桌餐(0-否 1-是)")
|
||||||
private Integer privateClub;
|
private Integer privateClub;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.ruoyi.database.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.ruoyi.database.domain.NonWorkingDayDrinkingReport;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description NonWorkingDayDrinkingReportMapper
|
||||||
|
* @Author lijingtong
|
||||||
|
* @Date 2025-05-29
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface NonWorkingDayDrinkingReportMapper extends BaseMapper<NonWorkingDayDrinkingReport> {
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.ruoyi.database.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.ruoyi.database.domain.NonWorkingDayDrinkingReport;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description NonWorkingDayDrinkingReportService
|
||||||
|
* @Author lijingtong
|
||||||
|
* @Date 2025-05-29
|
||||||
|
*/
|
||||||
|
public interface NonWorkingDayDrinkingReportService extends IService<NonWorkingDayDrinkingReport> {
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.ruoyi.database.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.ruoyi.database.domain.NonWorkingDayDrinkingReport;
|
||||||
|
import com.ruoyi.database.mapper.NonWorkingDayDrinkingReportMapper;
|
||||||
|
import com.ruoyi.database.service.NonWorkingDayDrinkingReportService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description NonWorkingDayDrinkingReportServiceImpl
|
||||||
|
* @Author lijingtong
|
||||||
|
* @Date 2025-05-29
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class NonWorkingDayDrinkingReportServiceImpl extends ServiceImpl<NonWorkingDayDrinkingReportMapper, NonWorkingDayDrinkingReport> implements NonWorkingDayDrinkingReportService {
|
||||||
|
}
|
Loading…
Reference in New Issue