/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.workreceiptsrevise.web;

import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.jeeplus.common.config.Global;
import com.jeeplus.common.persistence.Page;
import com.jeeplus.common.utils.DateUtils;
import com.jeeplus.common.utils.MyBeanUtils;
import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.common.utils.excel.ExportExcel;
import com.jeeplus.common.utils.excel.ImportExcel;
import com.jeeplus.common.web.BaseController;
import com.jeeplus.modules.act.entity.Act;
import com.jeeplus.modules.act.service.ActTaskService;
import com.jeeplus.modules.sys.entity.Office;
import com.jeeplus.modules.sys.entity.User;
import com.jeeplus.modules.sys.service.OfficeService;
import com.jeeplus.modules.sys.utils.UserUtils;
import com.jeeplus.modules.sysmtree.service.SysMtreeService;
import com.jeeplus.modules.workactivity.service.ActivityService;
import com.jeeplus.modules.workreceiptsrevise.entity.WorkReceiptsRevise;
import com.jeeplus.modules.workreceiptsrevise.service.WorkReceiptsReviseService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolationException;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 收入调整Controller
 * @author lw
 * @version 2018-06-29
 */
@Controller
@RequestMapping(value = "${adminPath}/workreceiptsreviseinvalid/workReceiptsReviseInvalid")
public class WorkReceiptsReviseInvalidController extends BaseController {

	@Autowired
	private WorkReceiptsReviseService workReceiptsReviseService;

	@Autowired
	protected RuntimeService runtimeService;

	@Autowired
	protected TaskService taskService;

	@Autowired
	private ActTaskService actTaskService;

	@Autowired
	private HttpServletRequest request;

	@Autowired
	private SysMtreeService sysMtreeService;
	@Autowired
	private ActivityService activityService;
	@Autowired
	private OfficeService officeService;
	@ModelAttribute
	public WorkReceiptsRevise get(@RequestParam(required=false) String id) {
		WorkReceiptsRevise entity = null;
		if (StringUtils.isNotBlank(id)){
			entity = workReceiptsReviseService.get(id);
		}
		if (entity == null){
			entity = new WorkReceiptsRevise();
		}
		return entity;
	}
	
	/**
	 * 收入调整列表页面
	 */
	@RequiresPermissions("workreceiptsrevise:workReceiptsRevise:list")
	@RequestMapping(value = {"list", ""})
	public String list(WorkReceiptsRevise workReceiptsRevise, HttpServletRequest request, HttpServletResponse response, Model model) {
		Page<WorkReceiptsRevise> page = workReceiptsReviseService.findPageInvalid(new Page<WorkReceiptsRevise>(request, response), workReceiptsRevise);
		model.addAttribute("page", page);
		return "modules/workreceiptsrevise/workReceiptsReviseInvalidList";
	}

}