feat:
This commit is contained in:
parent
33f7454c1f
commit
a9a30ab8c9
|
@ -8,7 +8,9 @@ import com.ruoyi.common.core.domain.entity.SysUser;
|
|||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.database.domain.PoliceLeaveApproval;
|
||||
import com.ruoyi.database.domain.dto.ApprovaltDto;
|
||||
import com.ruoyi.database.domain.gwglLog;
|
||||
import com.ruoyi.database.service.PoliceLeaveApprovalService;
|
||||
import com.ruoyi.database.service.gwglLogService;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
|
@ -35,6 +37,7 @@ public class PoliceLeaveApprovalController extends BaseController {
|
|||
private final PoliceLeaveApprovalService policeLeaveApprovalService;
|
||||
private final ISysDeptService deptService;
|
||||
private final ISysUserService userService;
|
||||
private final gwglLogService gwglLogService;
|
||||
|
||||
@RequestMapping("/list")
|
||||
@ApiOperation("查询")
|
||||
|
@ -157,13 +160,28 @@ public class PoliceLeaveApprovalController extends BaseController {
|
|||
@PostMapping("/approval")
|
||||
public AjaxResult approval(@RequestBody ApprovaltDto dto) {
|
||||
Long id = dto.getId();
|
||||
SysUser user = getLoginUser().getUser();
|
||||
Integer state = dto.getState();
|
||||
PoliceLeaveApproval policeLeaveApproval = policeLeaveApprovalService.getById(id);
|
||||
policeLeaveApproval.setState(state);
|
||||
boolean result = policeLeaveApprovalService.updateById(policeLeaveApproval);
|
||||
if (!result) {
|
||||
return AjaxResult.error("审批请(休)假失败");
|
||||
gwglLog gwglLog = new gwglLog();
|
||||
gwglLog.setApplyNo(policeLeaveApproval.getApplyNo());
|
||||
gwglLog.setDeptId(policeLeaveApproval.getDeptId());
|
||||
gwglLog.setDeptName(policeLeaveApproval.getDeptName());
|
||||
gwglLog.setUserId(policeLeaveApproval.getUserId());
|
||||
gwglLog.setUserName(policeLeaveApproval.getName());
|
||||
gwglLog.setCreateTime(policeLeaveApproval.getCreateTime());
|
||||
gwglLog.setReason(policeLeaveApproval.getReason());
|
||||
gwglLog.setType(1);
|
||||
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("审批请(休)假成功");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,12 @@ public class PoliceLeaveApproval {
|
|||
@ApiModelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("编号")
|
||||
private String applyNo;
|
||||
|
||||
@ApiModelProperty("原因")
|
||||
private String reason;
|
||||
|
||||
@ApiModelProperty("姓名")
|
||||
private String name;
|
||||
|
||||
|
@ -38,6 +44,9 @@ public class PoliceLeaveApproval {
|
|||
@ApiModelProperty("用户类型 0-普通民警 1-部门领导 2-分管局成员")
|
||||
private Integer userType;
|
||||
|
||||
@ApiModelProperty("是否已读")
|
||||
private Integer read;
|
||||
|
||||
@ApiModelProperty("所在单位")
|
||||
private String deptName;
|
||||
|
||||
|
|
|
@ -24,6 +24,12 @@ public class gwglLog {
|
|||
@ApiModelProperty("申请编号")
|
||||
private String applyNo;
|
||||
|
||||
@ApiModelProperty("单位意见")
|
||||
private String reason;
|
||||
|
||||
@ApiModelProperty("申请编号")
|
||||
private Integer result;
|
||||
|
||||
@ApiModelProperty("部门ID")
|
||||
private Long deptId;
|
||||
|
||||
|
@ -40,9 +46,6 @@ public class gwglLog {
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("申请原因")
|
||||
private String reason;
|
||||
|
||||
@ApiModelProperty("申请类型")
|
||||
private Integer type;
|
||||
|
||||
|
|
|
@ -121,10 +121,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
|||
// 过滤请求
|
||||
.authorizeRequests()
|
||||
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
||||
.antMatchers("/login", "/register","/base/SySMSLoginMsg/**", "/captchaImage","/loginApp","/loginAppBySms","/loginByFace","/base/sendMes").permitAll()
|
||||
.antMatchers("/login","/loginBySMS", "/register","/base/SySMSLoginMsg/**", "/captchaImage","/loginApp","/loginAppBySms","/loginByFace","/base/sendMes").permitAll()
|
||||
// 静态资源,可匿名访问
|
||||
.antMatchers(HttpMethod.GET, "/", "/base/SySMSLoginMsg/**","/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||
.antMatchers("/swagger-ui.html", "/base/SySMSLoginMsg/**","/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||
.antMatchers(HttpMethod.GET, "/","/PublicAffairs/loginBySMS", "/base/SySMSLoginMsg/**","/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||
.antMatchers("/swagger-ui.html","/PublicAffairs/loginBySMS", "/base/SySMSLoginMsg/**","/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||
// 除上面外的所有请求全部需要鉴权认证
|
||||
.anyRequest().authenticated()
|
||||
.and()
|
||||
|
|
Loading…
Reference in New Issue