package com.sunxung.factoring.service.weekWorkPlan;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.sunxung.factoring.entity.GridPage;
import com.sunxung.factoring.entity.weekWorkPlan.MonthCalendarWorkPlanView;
import com.sunxung.factoring.entity.weekWorkPlan.WeekCalendarWorkPlanView;
import com.sunxung.factoring.entity.weekWorkPlan.WeekWorkPlan;
import com.sunxung.factoring.entity.weekWorkPlan.WeekWorkPlanSeeView;
import com.sunxung.factoring.entity.weekWorkPlan.WeekWorkPlanView;
import com.sunxung.factoring.entity.weekWorkPlan.WeeklyMeetingLastWeekPlan;
import com.sunxung.factoring.entity.weekWorkPlan.WeeklyMeetingLastWorkPlanDetail;
import com.sunxung.factoring.entity.weekWorkPlan.WeeklyMeetingThisLastWeekPlan;
import com.sunxung.factoring.entity.weekWorkPlan.Weeks;
import com.sunxung.factoring.entity.weekWorkPlan.vo.SearchBusinessProcessingVo;
import com.sunxung.factoring.entity.weekWorkPlan.vo.SearchWeekWorkPlan;
import com.sunxung.factoring.entity.weekWorkPlan.vo.WeeklyMeetingLastWorkPlanBusinessProcessingVo;
import org.apache.ibatis.annotations.Param;

/**
 * @Description:周工作计划Service
 * @author:wuduanli
 * @e-mail:1912942707@qq.com
 * @date:2018年1月2日 下午4:05:53
 */
public interface WeekWorkPlanService {

    /**
     * 查询当前登录用户的周工作计划. <br/>
     *
     * @param search
     * @return
     */
    WeekWorkPlanView findWeekWorkPlan(SearchWeekWorkPlan search);

    WeekWorkPlan add(WeekWorkPlan plan);

    WeekWorkPlan update(WeekWorkPlan plan);

    boolean delete(Long id);

    WeekWorkPlan get(Long id);

    WeekWorkPlan getDetail(Long id);

    /**
     * 根据上周计划ID查询下周继续的周计划. <br/>
     *
     * @param lastWeekWorkId
     * @return
     */
    WeekWorkPlan getByLastWeekWorkId(Long lastWeekWorkId);

    /**
     * 验证同一天内是否存在标题相同的工作计划. <br/>
     *
     * @param plan
     * @return
     */
    boolean validatorPlan(WeekWorkPlan plan);

    /**
     * 获取月历工作计划数据 . <br/>
     *
     * @param search
     * @return
     */
    List<MonthCalendarWorkPlanView> findCalendarList(SearchWeekWorkPlan search);

    /**
     * 获取周历工作计划数据. <br/>
     *
     * @param search
     * @return
     */
    List<WeekCalendarWorkPlanView> findWeekList(SearchWeekWorkPlan search);

    /**
     * 获取每年对应周及周对应日期. <br/>
     *
     * @return
     */
    List<Weeks> getWeeks(Integer year);

    /**
     * 获取周计划查看页面列表数据. <br/>
     *
     * @return
     */
    GridPage<WeekWorkPlanSeeView> findWeekPlanList(SearchWeekWorkPlan search);

    /**
     * 获取周例会中上周工作计划统计数据. <br/>
     *
     * @param search
     * @return
     */
    List<WeeklyMeetingLastWeekPlan> getLastWeekWorkPlanStatistics(SearchWeekWorkPlan search);

    /**
     * 获取周例会中上周工作计划数据. <br/>
     *
     * @param search
     * @return
     */
    WeeklyMeetingThisLastWeekPlan findLastWeekWorkPlanList(SearchWeekWorkPlan search);

    /**
     * 获取周例会中上周工作计划统计点击进入详情列表数据. <br/>
     *
     * @param search
     * @return
     */
    GridPage<WeeklyMeetingLastWorkPlanDetail> findLastWeekPlanDetailList(SearchWeekWorkPlan search);

    /**
     * 处理所有逾期的计划. <br/>
     */
    void handleOverdueWork();

    /**
     * 根据判断当前时间是否在周一0点到5点之间返回系统时间. <br/>
     *
     * @return
     */
    Date getNowDate();

    /**
     * 上周业务进度统计：获取业务模块
     *
     * @return Map<String,String> 业务模块的集合
     */
    Map<String, String> getBusinessModule();

    /**
     * 上周业务进度统计
     *
     * @param search
     * @return
     */
    Map<String, Object> weeklyMeetingLastBusinessProcessingStatistics(SearchBusinessProcessingVo search);

    /**
     * 业务进度查询列表
     *
     * @param pageSearch
     * @return GridPage<WeeklyMeetingLastWorkPlanBusinessProcessingVo>
     */
    GridPage<WeeklyMeetingLastWorkPlanBusinessProcessingVo> weeklyMeetingBusinessProcessingList(
            SearchBusinessProcessingVo pageSearch);
}
