package com.ycl.controller;
|
|
import com.ycl.common.core.controller.BaseController;
|
import com.ycl.common.core.domain.AjaxResult;
|
import com.ycl.common.core.page.TableDataInfo;
|
import com.ycl.common.utils.poi.ExcelUtil;
|
import com.ycl.system.domain.Meeting;
|
import com.ycl.service.IMeetingService;
|
import com.ycl.system.service.ISysUserService;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.RequiredArgsConstructor;
|
import org.flowable.engine.RuntimeService;
|
import org.flowable.engine.TaskService;
|
import org.flowable.engine.runtime.ProcessInstance;
|
import org.flowable.task.api.Task;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import java.util.List;
|
|
@Controller
|
@RequiredArgsConstructor
|
@RequestMapping("/meeting")
|
public class MeetingController extends BaseController {
|
|
private static final String prefix = "flowable/meeting";
|
|
private final RuntimeService runtimeService;
|
|
private final TaskService taskService;
|
|
private final ISysUserService userService;
|
|
private final IMeetingService meetingService;
|
|
|
/**
|
* 查询会议列表
|
*/
|
@PostMapping("/list")
|
@ResponseBody
|
public TableDataInfo list(Meeting meeting)
|
{
|
startPage();
|
List<Meeting> list = meetingService.selectMeetingList(meeting);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出会议列表
|
*/
|
@PostMapping("/export")
|
@ResponseBody
|
public AjaxResult export(Meeting meeting)
|
{
|
List<Meeting> list = meetingService.selectMeetingList(meeting);
|
ExcelUtil<Meeting> util = new ExcelUtil<Meeting>(Meeting.class);
|
return util.exportExcel(list, "会议数据");
|
}
|
|
|
/**
|
* 新增保存会议
|
*/
|
@ApiOperation("新增保存会议")
|
@PostMapping("/add")
|
@ResponseBody
|
public AjaxResult addSave(Meeting meeting)
|
{
|
return toAjax(meetingService.insertMeeting(meeting));
|
}
|
|
@PostMapping("/edit")
|
@ResponseBody
|
public AjaxResult edit(Meeting meeting)
|
{
|
return toAjax(meetingService.updateMeeting(meeting));
|
}
|
|
/**
|
* 删除会议
|
*/
|
@PostMapping( "/remove")
|
@ResponseBody
|
public AjaxResult remove(String ids)
|
{
|
return toAjax(meetingService.deleteMeetingByIds(ids));
|
}
|
|
/**
|
* 会议签到
|
*/
|
@ApiOperation("会议签到")
|
@GetMapping("/signate")
|
@ResponseBody
|
public AjaxResult signate(String taskid)
|
{
|
Task t = taskService.createTaskQuery().taskId(taskid).singleResult();
|
String processId = t.getProcessInstanceId();
|
ProcessInstance p = runtimeService.createProcessInstanceQuery().processInstanceId(processId).singleResult();
|
if (p != null) {
|
Meeting apply = meetingService.selectMeetingById(Long.parseLong(p.getBusinessKey()));
|
return AjaxResult.success(apply);
|
}
|
return AjaxResult.error("流程不存在");
|
}
|
|
/**
|
* 填写会议纪要
|
*/
|
@ApiOperation("填写会议纪要")
|
@GetMapping("/input")
|
@ResponseBody
|
public AjaxResult input(String taskid)
|
{
|
Task t = taskService.createTaskQuery().taskId(taskid).singleResult();
|
String processId = t.getProcessInstanceId();
|
ProcessInstance p = runtimeService.createProcessInstanceQuery().processInstanceId(processId).singleResult();
|
if (p != null) {
|
Meeting apply = meetingService.selectMeetingById(Long.parseLong(p.getBusinessKey()));
|
return AjaxResult.success(apply);
|
}
|
return AjaxResult.error("流程不存在");
|
}
|
}
|