/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.security.trans.task.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.security.trans.app.vo.BacklogVO;
import org.security.trans.common.service.FlowableService;
import org.security.trans.dataStatistics.dto.EduAndDrillDataDTO;
import org.security.trans.dataStatistics.dto.StatisticsDataDTO;
import org.security.trans.dataStatistics.vo.EduAndDrillDataVO;
import org.security.trans.task.dto.TaskDTO;
import org.security.trans.task.dto.TaskHandinDTO;
import org.security.trans.task.entity.TaskHandin;
import org.security.trans.task.vo.TaskHandinVO;
import org.security.trans.task.vo.TaskTodoVO;
import org.security.trans.taskCheck.task.dto.TaskHandinCheckDTO;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;

import java.math.BigDecimal;
import java.text.ParseException;
import java.util.List;

/**
 * 任务-任务提报 服务类
 *
 * @author BladeX
 * @since 2022-03-14
 */
public interface ITaskHandinService extends FlowableService<TaskHandin> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param taskHandinDTO
	 * @return
	 */
	IPage<TaskHandinVO> selectTaskHandinPage(IPage<TaskHandinVO> page, TaskHandinDTO taskHandinDTO);

	/**
	 * 暂存
	 *
	 * @param taskHandin
	 * @return
	 */
	R saveTaskHandin(TaskHandinDTO taskHandin);


	/**
	 * 提报
	 *
	 * @param taskHandin
	 * @return
	 */
	R handin(TaskHandinDTO taskHandin) throws ParseException;

	/**
	 * 查询详情
	 *
	 * @param id
	 * @return
	 */
	TaskHandinVO getDetail(BigDecimal id);

	/**
	 * 发布任务并新建对应的taskHandin
	 *
	 * @param task 任务信息
	 * @return
	 */
	R publishTask(TaskDTO task);

	TaskHandin getTaskHandin(TaskHandinCheckDTO taskHandinCheckDTO);

	List<TaskHandin> getTaskList(String status);

	/**
	 * 查询app用户待办
	 *
	 * @param user
	 * @return
	 */
	List<BacklogVO> getAppBacklog(BladeUser user,String moduleType);

	/**
	 * 待办事项分页
	 *
	 * @param
	 * @return
	 */
	List<TaskTodoVO> selectTaskTodo();

	/**
	 * 暂存
	 *
	 * @param taskHandin
	 * @return
	 */
	Boolean updateTaskHandin(TaskHandin taskHandin);

	R endTaskByIds( TaskDTO task);

	/**
	 *定时任务-教育培训或应急演练获取机构名称
	 */
	String getDeptName(String deptId);

	/**
	 *教育培训/应急演练数据统计列表数据获取
	 */
	List<EduAndDrillDataVO> getAimStatisticsData(EduAndDrillDataDTO eduAndDrillDataDTO, List<String> aimDepts, String aimModule);
}
