mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 23:11: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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,38 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cfive.pinnacle.mapper.AffairMapper">
|
||||
|
||||
<select id="getSameDepartmentUser" resultMap="userMap">
|
||||
select t_user.id as user_id,
|
||||
t_user.username as user_username,
|
||||
t_user.department_id as user_department_id,
|
||||
t_user.enable as user_enable,
|
||||
t_user.deleted as user_deleted,
|
||||
t_user.version as user_version,
|
||||
ts.id as staff_id,
|
||||
ts.first_name as staff_first_name,
|
||||
ts.last_name as staff_last_name,
|
||||
ts.deleted as staff_deleted,
|
||||
ts.version as staff_version,
|
||||
from t_user
|
||||
left join (select * from t_staff where deleted = 0) as ts on ts.user_id = t_user.id
|
||||
where t_user.id=#{id}
|
||||
t_user.deleted = 0;
|
||||
</select>
|
||||
|
||||
<resultMap id="userMap" type="user">
|
||||
<id property="id" column="user_id"/>
|
||||
<result property="username" column="user_username"/>
|
||||
<result property="departmentId" column="user_department_id"/>
|
||||
<result property="enable" column="user_enable"/>
|
||||
<result property="deleted" column="user_deleted"/>
|
||||
<result property="version" column="user_version"/>
|
||||
<association property="staff" javaType="staff">
|
||||
<id property="id" column="staff_id"/>
|
||||
<result property="firstName" column="staff_first_name"/>
|
||||
<result property="lastName" column="staff_last_name"/>
|
||||
<result property="deleted" column="staff_deleted"/>
|
||||
<result property="version" column="staff_version"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user