This commit is contained in:
hanrenchun 2025-06-07 16:43:52 +08:00
parent e410205e41
commit 96afbc47d1
6 changed files with 93 additions and 7 deletions

View File

@ -10,12 +10,12 @@ 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.core.redis.RedisCache;
import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.database.domain.ApprovalProcess; import com.ruoyi.database.domain.*;
import com.ruoyi.database.domain.BaseAddressInfo; import com.ruoyi.database.domain.dto.ApprovaltDto;
import com.ruoyi.database.domain.BusinessTripApproval;
import com.ruoyi.database.service.ApprovalProcessService; import com.ruoyi.database.service.ApprovalProcessService;
import com.ruoyi.database.service.BaseAddressInfoService; import com.ruoyi.database.service.BaseAddressInfoService;
import com.ruoyi.database.service.BusinessTripApprovalService; import com.ruoyi.database.service.BusinessTripApprovalService;
import com.ruoyi.database.service.gwglLogService;
import com.ruoyi.system.service.ISysDeptService; import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -24,6 +24,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -44,6 +45,7 @@ public class BusinessTripApprovalController extends BaseController {
private final ISysDeptService sysDeptService; private final ISysDeptService sysDeptService;
private final BaseAddressInfoService baseAddressInfoService; private final BaseAddressInfoService baseAddressInfoService;
private final ApprovalProcessService approvalsProcessService; private final ApprovalProcessService approvalsProcessService;
private final gwglLogService gwglLogService;
@PostMapping("/list") @PostMapping("/list")
@ -201,4 +203,33 @@ public class BusinessTripApprovalController extends BaseController {
return format + String.format("%04d", (Integer) (bean.getCacheObject(DATA_KEY + format))); return format + String.format("%04d", (Integer) (bean.getCacheObject(DATA_KEY + format)));
} }
@ApiOperation("审批出差申请")
@PostMapping("/approval")
public AjaxResult approval(ApprovaltDto dto) {
SysUser user = getLoginUser().getUser();
Long id = dto.getId();
Integer state = dto.getState();
BusinessTripApproval businessTripApproval = businessTripApprovalService.getById(id);
businessTripApproval.setState(state);
boolean result = businessTripApprovalService.updateById(businessTripApproval);
gwglLog gwglLog = new gwglLog();
gwglLog.setApplyNo(businessTripApproval.getApplyNo());
gwglLog.setDeptName(businessTripApproval.getDepartment());
gwglLog.setUserId(businessTripApproval.getUserId());
gwglLog.setUserName(businessTripApproval.getUserName());
// gwglLog.setCreateTime(businessTripApproval.getCreateTime());
gwglLog.setReason(businessTripApproval.getReason());
gwglLog.setType(1);
gwglLog.setApplyNo(businessTripApproval.getApplyNo());
gwglLog.setChecker(user.getNickName());
gwglLog.setCheckTime(LocalDateTime.now());
gwglLog.setCheckState(state);
boolean result1 = gwglLogService.save(gwglLog);
if (!result || !result1) {
return AjaxResult.error("审批出差申请失败");
}
return AjaxResult.success("审批出差申请成功");
}
} }

View File

@ -0,0 +1,26 @@
package com.ruoyi.business.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.database.domain.BusinessTripApproval;
import com.ruoyi.database.service.BusinessTripApprovalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("/DetailsApi")
@RequiredArgsConstructor
@Api(tags = "Api列表")
public class DetailsApiController extends BaseController {
private final BusinessTripApprovalService businessTripApprovalService;
}

View File

@ -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.ruoyi.common.core.domain.BaseEntityMini; import com.ruoyi.common.core.domain.BaseEntityMini;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -81,4 +78,8 @@ public class BusinessTripApproval extends BaseEntityMini {
@ApiModelProperty("关联用uuid") @ApiModelProperty("关联用uuid")
private String uuid; private String uuid;
@ApiModelProperty("审批流程 0-未审批 1-部门审批通过 2-部门审批不通过 3-警务保障部门审批通过 4-警务保障部门审批不通过 5-局领导审批通过 6-局领导审批不通过")
@TableField(condition = SqlCondition.EQUAL)
private Integer state;
} }

View File

@ -0,0 +1,22 @@
package com.ruoyi.database.domain.vo;
import lombok.Data;
@Data
public class MyApvListVO {
private String userName;
private String title;
private String code;
private String crTime;
private Integer afaType;
private Integer apvState;
}

View File

@ -9,4 +9,6 @@ import com.ruoyi.database.domain.gwglLog;
* @Date 2025-06-06 * @Date 2025-06-06
*/ */
public interface gwglLogService extends IService<gwglLog> { public interface gwglLogService extends IService<gwglLog> {
public void addLog();
} }

View File

@ -14,4 +14,8 @@ import org.springframework.stereotype.Service;
@Service @Service
public class gwglLogServiceImpl extends ServiceImpl<gwglLogMapper, gwglLog> implements gwglLogService { public class gwglLogServiceImpl extends ServiceImpl<gwglLogMapper, gwglLog> implements gwglLogService {
@Override
public void addLog() {
gwglLog gwglLog = new gwglLog();
}
} }