mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-06 07:21:24 +08:00
Change the menu bar and merge pages
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package com.cfive.pinnacle.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.cfive.pinnacle.controller.permission.UserController;
|
||||
import com.cfive.pinnacle.entity.Affair;
|
||||
import com.cfive.pinnacle.entity.common.ResponseCode;
|
||||
import com.cfive.pinnacle.entity.common.ResponseResult;
|
||||
@@ -27,11 +26,6 @@ import java.util.List;
|
||||
public class AffairController {
|
||||
@Autowired
|
||||
IAffairService affairService;
|
||||
// IUserService userService;
|
||||
// 不用userService的方法了,userController中已经写好了直接拿来用
|
||||
@Autowired
|
||||
UserController userController;
|
||||
|
||||
|
||||
@PostMapping("/add")
|
||||
@PreAuthorize("hasAuthority('affair:self:add')")
|
||||
@@ -39,6 +33,7 @@ public class AffairController {
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SAVE_OK, "success", affairService.save(affair));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/personal_affairs")
|
||||
@PreAuthorize("hasAuthority('affair:self:get')")
|
||||
public ResponseResult<List<Affair>> getPersonalAffairs() {
|
||||
@@ -48,7 +43,6 @@ public class AffairController {
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", affairService.list(wrapper));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/not_approved")
|
||||
@PreAuthorize("hasAuthority('affair:manage:get')")
|
||||
public ResponseResult<List<Affair>> selectNotApproved() {
|
||||
@@ -70,7 +64,7 @@ public class AffairController {
|
||||
|
||||
@PutMapping("/yes")
|
||||
@PreAuthorize("hasAuthority('affair:manage:modify')")
|
||||
public ResponseResult updateAffairYes(@RequestBody Affair affair) {
|
||||
public ResponseResult<Integer> updateAffairYes(@RequestBody Affair affair) {
|
||||
System.out.println(affair);
|
||||
return ResponseResult.build(ResponseCode.DATABASE_UPDATE_OK, "success", affairService.updateAffairYes(affair));
|
||||
//审批同意
|
||||
@@ -78,7 +72,7 @@ public class AffairController {
|
||||
|
||||
@PutMapping("/no")
|
||||
@PreAuthorize("hasAuthority('affair:manage:modify')")
|
||||
public ResponseResult updateAffairNo(@RequestBody Affair affair) {
|
||||
public ResponseResult<Integer> updateAffairNo(@RequestBody Affair affair) {
|
||||
return ResponseResult.build(ResponseCode.DATABASE_UPDATE_OK, "success", affairService.updateAffairNo(affair));
|
||||
//审批驳回
|
||||
}
|
||||
@@ -86,12 +80,10 @@ public class AffairController {
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("hasAuthority('affair:manage:delete')")
|
||||
public ResponseResult deleteAffairApproved(@PathVariable Long id) {
|
||||
public ResponseResult<Boolean> deleteAffairApproved(@PathVariable Long id) {
|
||||
System.out.println("affair");
|
||||
return ResponseResult.build(ResponseCode.DATABASE_DELETE_OK, "success", affairService.removeById(id));
|
||||
//删除已审批事务
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cfive.pinnacle.mapper;
|
||||
|
||||
import com.cfive.pinnacle.entity.Affair;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cfive.pinnacle.entity.permission.User;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -32,13 +33,11 @@ public interface AffairMapper extends BaseMapper<Affair> {
|
||||
//管理员权限--->修改事务的状态(AffairsStatus)--->达到审批的效果
|
||||
//同意
|
||||
|
||||
@Update("update t_affair set Status=2 where id=#{id}" )
|
||||
@Update("update t_affair set Status=2 where id=#{id}")
|
||||
int updateAffairsNO(Affair affair);
|
||||
//不同意
|
||||
|
||||
|
||||
|
||||
|
||||
List<User> getSameDepartmentUser(@Param("id") long id);
|
||||
|
||||
//
|
||||
// @Select("SELECT t_affair.applicant_id,t_affair.inspector_id,t_user.id,t_user.username from t_affair,t_user ")
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.cfive.pinnacle.service;
|
||||
|
||||
import com.cfive.pinnacle.entity.Affair;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.cfive.pinnacle.entity.permission.User;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -19,4 +22,7 @@ public interface IAffairService extends IService<Affair> {
|
||||
|
||||
|
||||
// int deleteAffair_ApprovedByID(Affair affair);
|
||||
List<User> getSameDepartmentUser (long id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package com.cfive.pinnacle.service.impl;
|
||||
|
||||
import com.cfive.pinnacle.entity.Affair;
|
||||
import com.cfive.pinnacle.entity.permission.User;
|
||||
import com.cfive.pinnacle.mapper.AffairMapper;
|
||||
import com.cfive.pinnacle.service.IAffairService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 事务 服务实现类
|
||||
@@ -21,7 +24,6 @@ public class AffairServiceImpl extends ServiceImpl<AffairMapper, Affair> impleme
|
||||
@Autowired
|
||||
private AffairMapper affairMapper;
|
||||
|
||||
|
||||
public int updateAffairYes(Affair affair) {
|
||||
return affairMapper.updateAffairsYes(affair);
|
||||
}
|
||||
@@ -30,6 +32,8 @@ public class AffairServiceImpl extends ServiceImpl<AffairMapper, Affair> impleme
|
||||
return affairMapper.updateAffairsNO(affair);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<User> getSameDepartmentUser(long id) {
|
||||
List<User> user = affairMapper.getSameDepartmentUser(id);
|
||||
return user;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user