记录资源下架发起人姓名

This commit is contained in:
wangliwen 2022-05-10 17:21:57 +08:00
parent dd261257b8
commit d0ae226585
4 changed files with 77 additions and 56 deletions

View File

@ -20,6 +20,9 @@ import io.renren.modules.resourceMountApply.dto.TResourceBatchMountApplyDTO;
import io.renren.modules.resourceMountApply.dto.TResourceMountApplyDTO;
import io.renren.modules.resourceMountApply.dto.TResourceUndercarriageApplyDTO;
import io.renren.modules.resourceMountApply.service.TResourceMountApplyService;
import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.sys.dto.SysUserDTO;
import io.renren.modules.sys.service.SysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.codehaus.jackson.map.ObjectMapper;
@ -51,6 +54,8 @@ public class ResourceMountController {
private TResourceMountApplyService tResourceMountApplyService;
@Autowired
private ResourceService resourceService;
@Autowired
private SysUserService sysUserService;
private static String apply_key = "resourcemountapply"; // 资源上架
@ -139,6 +144,11 @@ public class ResourceMountController {
resourceDTO.ifPresent(dto -> {
dto.setUndercarriageReason(tResourceUndercarriageApplyDTO.getReason());
dto.setDelFlag(ResourceEntityDelFlag.UNDERCARRIAGE_REVIEW.getFlag()); // 设置为下架审核中
String userId = SecurityUser.getUserId().toString();
Optional<SysUserDTO> userDTO = Optional.ofNullable(sysUserService.get(Long.valueOf(userId)));
userDTO.ifPresent(user -> {
dto.setUndercarriageUserName(user.getRealName());
});
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
resourceService.update(dto);
});

View File

@ -14,7 +14,6 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
@ -24,11 +23,12 @@ import java.util.Map;
/**
* 任务管理
*
* @author Jone
*/
@RestController
@RequestMapping("/act/task")
@Api(tags="任务管理")
@Api(tags = "任务管理")
public class ActTaskController {
@Autowired
private ActTaskService actTaskService;
@ -38,40 +38,42 @@ public class ActTaskController {
/**
* 获取用户任务列表
* 根据用户ID或角色组获取任务信息
*
* @return
*/
@GetMapping("page")
@ApiOperation("待办任务默认查询所有待办任务。根据用户ID或角色ID查询个人或组的任务")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = "roleIds", value = "roleIds", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "userId", value = "userId", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "isRoleGroup", value = "是否查询分组", paramType = "query", dataType="String")
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = "roleIds", value = "roleIds", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "userId", value = "userId", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "isRoleGroup", value = "是否查询分组", paramType = "query", dataType = "String")
})
// @RequiresPermissions("sys:task:all")
public Result<PageData<TaskDTO>> queryUserTaskPage(@ApiIgnore @RequestParam Map<String, Object> params){
public Result<PageData<TaskDTO>> queryUserTaskPage(@ApiIgnore @RequestParam Map<String, Object> params) {
PageData<TaskDTO> page = actTaskService.page(params);
return new Result<PageData<TaskDTO>>().ok(page);
}
/**
* 我的待办列表
*
* @return
*/
@GetMapping("myToDoTaskPage")
@ApiOperation("我的待办列表")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int"),
@ApiImplicitParam(name = "taskName", value = "任务名称", paramType = "query", dataType="String")
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = "taskName", value = "任务名称", paramType = "query", dataType = "String")
})
// @RequiresPermissions("sys:task:all")
public Result<PageData<TaskDTO>> myToDoTaskPage(@ApiIgnore @RequestParam Map<String, Object> params){
public Result<PageData<TaskDTO>> myToDoTaskPage(@ApiIgnore @RequestParam Map<String, Object> params) {
params.put("userId", SecurityUser.getUserId().toString());
PageData<TaskDTO> page = actTaskService.page(params);
for(TaskDTO taskDTO : page.getList()){
if(!StringUtils.isEmpty(taskDTO.getAssignee())){
for (TaskDTO taskDTO : page.getList()) {
if (!StringUtils.isEmpty(taskDTO.getAssignee())) {
SysUserDTO userDTO = sysUserService.get(Long.valueOf(taskDTO.getAssignee()));
taskDTO.setAssigneeName(userDTO.getRealName());
}
@ -86,7 +88,7 @@ public class ActTaskController {
@ApiOperation("获取任务详情")
@LogOperation("获取任务详情")
// @RequiresPermissions("sys:task:all")
public Result getTaskById(@PathVariable("id") String id){
public Result getTaskById(@PathVariable("id") String id) {
TaskDTO task = actTaskService.taskDetail(id);
return new Result().ok(task);
}
@ -96,10 +98,10 @@ public class ActTaskController {
*/
@PostMapping("claim")
@ApiOperation("认领任务")
@ApiImplicitParam(name = "taskId", value = "taskId", paramType = "query", dataType="String")
@ApiImplicitParam(name = "taskId", value = "taskId", paramType = "query", dataType = "String")
// @RequiresPermissions("sys:task:all")
public Result claimTask(String taskId){
if(StringUtils.isEmpty(taskId)){
public Result claimTask(String taskId) {
if (StringUtils.isEmpty(taskId)) {
return new Result().error(ErrorCode.PARAMS_GET_ERROR);
}
actTaskService.claimTask(taskId);
@ -111,10 +113,10 @@ public class ActTaskController {
*/
@PostMapping("unclaim")
@ApiOperation("释放任务")
@ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType="String")
@ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType = "String")
// @RequiresPermissions("sys:task:all")
public Result unclaimTask(String taskId){
if(StringUtils.isEmpty(taskId)){
public Result unclaimTask(String taskId) {
if (StringUtils.isEmpty(taskId)) {
return new Result().error(ErrorCode.PARAMS_GET_ERROR);
}
actTaskService.unclaimTask(taskId);
@ -127,25 +129,26 @@ public class ActTaskController {
@PostMapping("complete")
@ApiOperation("任务处理(完成任务)")
@ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "comment", value = "审批意见", paramType = "query", dataType="String")
@ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "comment", value = "审批意见", paramType = "query", dataType = "String")
})
// @RequiresPermissions("sys:task:all")
public Result completeTask(String taskId, String comment){
if(StringUtils.isEmpty(taskId)){
public Result completeTask(String taskId, String comment) {
if (StringUtils.isEmpty(taskId)) {
return new Result().error(ErrorCode.PARAMS_GET_ERROR);
}
actTaskService.completeTask(taskId, comment);
return new Result();
}
/**
* 带参数的任务处理
*/
@PostMapping("completeByVariables")
@ApiOperation("带参数的任务处理(完成任务)")
// @RequiresPermissions("sys:task:all")
public Result completeTaskByVariables(@RequestBody TaskDTO taskDTO){
if(StringUtils.isEmpty(taskDTO.getTaskId())){
public Result completeTaskByVariables(@RequestBody TaskDTO taskDTO) {
if (StringUtils.isEmpty(taskDTO.getTaskId())) {
return new Result().error(ErrorCode.PARAMS_GET_ERROR);
}
actTaskService.completeTaskByVariables(taskDTO);
@ -158,12 +161,12 @@ public class ActTaskController {
@PostMapping("entrust")
@ApiOperation("任务委托")
@ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "assignee", value = "受理人", paramType = "query", dataType="String")
@ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "assignee", value = "受理人", paramType = "query", dataType = "String")
})
// @RequiresPermissions("sys:task:all")
public Result taskEntrust(String taskId, String assignee){
if(StringUtils.isEmpty(taskId) || StringUtils.isEmpty(assignee)){
public Result taskEntrust(String taskId, String assignee) {
if (StringUtils.isEmpty(taskId) || StringUtils.isEmpty(assignee)) {
return new Result().error(ErrorCode.PARAMS_GET_ERROR);
}
String depositorId = SecurityUser.getUserId().toString();
@ -177,12 +180,12 @@ public class ActTaskController {
@GetMapping("getTaskVariables")
@ApiOperation("获取流程变量")
@ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "当前任务ID", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "variableName", value = "参数的键", paramType = "query", dataType="String")
@ApiImplicitParam(name = "taskId", value = "当前任务ID", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "variableName", value = "参数的键", paramType = "query", dataType = "String")
})
// @RequiresPermissions("sys:task:all")
public Result getTaskVariables(String taskId, String variableName){
if(StringUtils.isEmpty(taskId) || StringUtils.isEmpty(variableName)){
public Result getTaskVariables(String taskId, String variableName) {
if (StringUtils.isEmpty(taskId) || StringUtils.isEmpty(variableName)) {
return new Result().error(ErrorCode.PARAMS_GET_ERROR);
}
return new Result().ok(actTaskService.getTaskVariables(taskId, variableName));
@ -194,8 +197,8 @@ public class ActTaskController {
@PostMapping("updateTaskVariable")
@ApiOperation("更新任务变量")
// @RequiresPermissions("sys:task:all")
public Result updateTaskVariable(@RequestBody TaskDTO taskDTO){
if(StringUtils.isEmpty(taskDTO.getTaskId())){
public Result updateTaskVariable(@RequestBody TaskDTO taskDTO) {
if (StringUtils.isEmpty(taskDTO.getTaskId())) {
return new Result().error(ErrorCode.PARAMS_GET_ERROR);
}
actTaskService.updateTaskVariable(taskDTO);
@ -207,10 +210,10 @@ public class ActTaskController {
*/
@DeleteMapping("deleteTaskVariables")
@ApiOperation("删除任务的所有变量")
@ApiImplicitParam(name = "taskId", value = "当前任务ID", paramType = "query", dataType="String")
@ApiImplicitParam(name = "taskId", value = "当前任务ID", paramType = "query", dataType = "String")
// @RequiresPermissions("sys:task:all")
public Result deleteTaskVariables(String taskId){
if(StringUtils.isEmpty(taskId)){
public Result deleteTaskVariables(String taskId) {
if (StringUtils.isEmpty(taskId)) {
return new Result().error(ErrorCode.PARAMS_GET_ERROR);
}
actTaskService.deleteTaskVariables(taskId);
@ -223,13 +226,13 @@ public class ActTaskController {
@DeleteMapping("deleteVariable")
@ApiOperation("删除指定变量,默认删除本地变量")
@ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "当前任务ID", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "variableName", value = "变量名", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "scope", value = "变量的范围local本地global,全局)", paramType = "query", dataType="String")
@ApiImplicitParam(name = "taskId", value = "当前任务ID", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "variableName", value = "变量名", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "scope", value = "变量的范围local本地global,全局)", paramType = "query", dataType = "String")
})
// @RequiresPermissions("sys:task:all")
public Result deleteVariable(String taskId, String variableName, String scope){
if(StringUtils.isEmpty(taskId) || StringUtils.isEmpty(variableName)){
public Result deleteVariable(String taskId, String variableName, String scope) {
if (StringUtils.isEmpty(taskId) || StringUtils.isEmpty(variableName)) {
return new Result().error(ErrorCode.PARAMS_GET_ERROR);
}
actTaskService.deleteTaskVariable(taskId, variableName, scope);
@ -242,12 +245,12 @@ public class ActTaskController {
@PostMapping("backPreviousTask")
@ApiOperation("回退任务到上一节点")
@ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "comment", value = "回退审核意见", paramType = "query", dataType="String")
@ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "comment", value = "回退审核意见", paramType = "query", dataType = "String")
})
// @RequiresPermissions("sys:task:all")
public Result backPreviousTask(String taskId, String comment){
if(StringUtils.isEmpty(taskId)){
public Result backPreviousTask(String taskId, String comment) {
if (StringUtils.isEmpty(taskId)) {
return new Result().error(ErrorCode.PARAMS_GET_ERROR);
}
actTaskService.doBackPreviousTask(taskId, comment);
@ -260,11 +263,11 @@ public class ActTaskController {
@PostMapping("endProcess")
@ApiOperation("终止流程")
@ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "comment", value = "终止审核意见", paramType = "query", dataType="String")
@ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "comment", value = "终止审核意见", paramType = "query", dataType = "String")
})
// @RequiresPermissions("sys:task:all")
public Result endProcess(String taskId, String comment){
public Result endProcess(String taskId, String comment) {
actTaskService.endProcess(taskId, comment);
return new Result();
}
@ -275,12 +278,12 @@ public class ActTaskController {
@PostMapping("backToFirst")
@ApiOperation("驳回,回退至第一个用户任务")
@ApiImplicitParams({
@ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "comment", value = "驳回审核意见", paramType = "query", dataType="String")
@ApiImplicitParam(name = "taskId", value = "任务ID", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "comment", value = "驳回审核意见", paramType = "query", dataType = "String")
})
// @RequiresPermissions("sys:task:all")
public Result backToFirst(String taskId, String comment){
if(StringUtils.isEmpty(taskId)){
public Result backToFirst(String taskId, String comment) {
if (StringUtils.isEmpty(taskId)) {
return new Result().error(ErrorCode.PARAMS_GET_ERROR);
}
actTaskService.backToFirst(taskId, comment);

View File

@ -98,6 +98,8 @@ public class ResourceDTO implements Serializable {
private String enclosure;
@ApiModelProperty(value = "下架理由")
private String undercarriageReason;
@ApiModelProperty(value = "提起下架人员姓名")
private String undercarriageUserName;
public String getDelFlagTip() {
if (this.delFlag != null) {

View File

@ -125,4 +125,10 @@ public class ResourceEntity extends BaseEntity {
* 下架理由
*/
private String undercarriageReason;
/**
* 提起下架人员
*/
private String undercarriageUserName;
}