mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 23:11:24 +08:00
Add affair management
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
package com.cfive.pinnacle.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.cfive.pinnacle.entity.Affair;
|
||||
import com.cfive.pinnacle.entity.common.ResponseCode;
|
||||
import com.cfive.pinnacle.entity.common.ResponseResult;
|
||||
import com.cfive.pinnacle.service.IAffairService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -11,8 +16,57 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @author FatttSnake
|
||||
* @since 2023-04-30
|
||||
*/
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/affair")
|
||||
public class AffairController {
|
||||
@Autowired
|
||||
IAffairService affairService;
|
||||
|
||||
|
||||
|
||||
@PostMapping("/add")
|
||||
public ResponseResult addAffair(@RequestBody Affair affair){
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SAVE_OK,"success",affairService.save(affair));
|
||||
}
|
||||
|
||||
@GetMapping("/NotApproved")
|
||||
public ResponseResult select_NotApproved(){
|
||||
LambdaQueryWrapper<Affair> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(Affair::getStatus, 0);
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK, "success", affairService.list(wrapper));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/Approved")
|
||||
public ResponseResult select_Approved(){
|
||||
LambdaQueryWrapper<Affair> wrapper2 =new LambdaQueryWrapper<>();
|
||||
wrapper2.ne(Affair::getStatus,0);
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SELECT_OK,"success",affairService.list(wrapper2)) ;
|
||||
}
|
||||
|
||||
@PutMapping("/yes")
|
||||
public ResponseResult updateAffair_yes(@RequestBody Affair affair){
|
||||
System.out.println(affair);
|
||||
return ResponseResult.build(ResponseCode.DATABASE_UPDATE_OK,"success",affairService.updateAffair_Yes(affair));
|
||||
//审批同意
|
||||
}
|
||||
|
||||
@PutMapping("/no")
|
||||
public ResponseResult updateAffair_No(@RequestBody Affair affair){
|
||||
return ResponseResult.build(ResponseCode.DATABASE_UPDATE_OK,"success",affairService.updateAffair_No(affair));
|
||||
//审批驳回
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseResult deleteAffair_Apprioved(@PathVariable Long id){
|
||||
System.out.println("affair");
|
||||
return ResponseResult.build(ResponseCode.DATABASE_DELETE_OK,"success",affairService.removeById(id));
|
||||
//删除已审批事务
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user