package com.vci.web.controller;
|
|
|
import com.vci.starter.web.annotation.controller.VciUnCheckRight;
|
import com.vci.starter.web.annotation.log.VciBusinessLog;
|
import com.vci.starter.web.annotation.permission.VciPermission;
|
import com.vci.starter.web.annotation.permission.VciUseReferMethod;
|
import com.vci.starter.web.pagemodel.BaseQueryObject;
|
import com.vci.starter.web.pagemodel.BaseResult;
|
import com.vci.starter.web.pagemodel.DataGrid;
|
import com.vci.web.dto.WebHomeTaskActionDTO;
|
import com.vci.web.pageModel.WebHomeTaskActionVO;
|
import com.vci.web.service.WebHomeTaskServiceI;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
/**
|
* 首页的待办事项
|
* @author weidy
|
* @since 208mes项目
|
*/
|
@RestController
|
@RequestMapping("/homeTaskController")
|
@VciBusinessLog(modelName = "首页的待办事项")
|
@VciUnCheckRight
|
public class HomeTaskController {
|
|
/**
|
* 待办事项汇总服务
|
*/
|
@Autowired
|
private WebHomeTaskServiceI homeTaskService;
|
|
/**
|
* 查询当前用户的待办任务数量 ,不使用功能权限,因为其内容会根据功能权限和数据权限来查询,
|
* @return 任务的显示对象
|
*/
|
@GetMapping("/listMyHomeTask")
|
@VciBusinessLog(operateName = "查询当前用户的待办任务数量",notStore = true)
|
public List<WebHomeTaskActionVO> listMyHomeTask(){
|
return homeTaskService.listMyHomeTask();
|
}
|
|
/**
|
* 首页待办任务
|
* @param queryObject 查询对象
|
* @return 列表的信息
|
*/
|
@GetMapping("/dataGrid")
|
@VciBusinessLog(operateName = "查看首页待办任务动作定义")
|
@VciPermission(methodName = "查看",methodKey = "VIEW",methodAlias = "查看",methodOrder = 1)
|
public DataGrid dataGrid(BaseQueryObject queryObject) {
|
return homeTaskService.dataGrid(queryObject.getConditionMap(),queryObject.getPageHelper());
|
}
|
|
/**
|
* 添加待办事项
|
* @param action 数据显示对象
|
* @return 执行结果
|
*/
|
@PostMapping("/addSave")
|
@VciBusinessLog(operateName = "添加首页待办任务动作定义")
|
@VciPermission(methodName = "增加",methodKey = "ADD",methodAlias = "添加",methodOrder = 2)
|
@VciUseReferMethod(useReferKey = "menu")
|
public BaseResult addSave(WebHomeTaskActionDTO action) {
|
homeTaskService.addAction(action);
|
return BaseResult.success();
|
}
|
|
/**
|
* 修改待办事项
|
* @param action 数据显示对象
|
* @return 执行结果
|
*/
|
@PutMapping("/editSave")
|
@VciBusinessLog(operateName = "修改首页待办任务动作定义")
|
@VciPermission(methodName = "修改",methodKey = "EDIT",methodAlias = "修改",methodOrder = 3)
|
@VciUseReferMethod(useReferKey = "menu")
|
public BaseResult editSave(WebHomeTaskActionDTO action) {
|
homeTaskService.editAction(action);
|
return BaseResult.success();
|
}
|
|
/**
|
* 删除待办事项
|
* @param action 数据显示对象
|
* @return 执行结果
|
*/
|
@DeleteMapping("/delete")
|
@VciBusinessLog(operateName = "删除首页待办任务动作定义")
|
@VciPermission(methodName = "删除",methodKey = "DELETE",methodAlias = "删除",methodOrder = 4)
|
public BaseResult delete(WebHomeTaskActionDTO action) {
|
homeTaskService.deleteAction(action);
|
return BaseResult.success();
|
}
|
|
}
|