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

import com.jeeplus.common.config.Global;
import com.jeeplus.common.persistence.Page;
import com.jeeplus.common.utils.FreemarkerUtil;
import com.jeeplus.common.utils.ImageUtil;
import com.jeeplus.common.utils.ResponseUtil;
import com.jeeplus.common.web.BaseController;
import com.jeeplus.modules.projectcontentinfo.dao.ProjectReportDataDao;
import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
import com.jeeplus.modules.projectreportnum.entity.ReportNum;
import com.jeeplus.modules.projectreportnum.service.ProjectReportNumService;
import com.jeeplus.modules.sys.utils.UserUtils;
import com.jeeplus.modules.tools.utils.TwoDimensionCode;
import freemarker.template.Configuration;
import freemarker.template.Template;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;


@Controller
@RequestMapping(value = "/projectreportnum/projectReportNum")
public class ProjectReportFindController extends BaseController {

	@Autowired
	private ProjectReportNumService projectReportNumService;
	@Autowired
	private ProjectReportDataDao projectReportDataDao;
	@Autowired
    private ProjectRecordsService projectRecordsService;
	


	@RequestMapping("report")
	public String report(HttpServletRequest request,Model model) throws Exception{
		ProjectRecords data = new ProjectRecords();
    	String num = request.getParameter("number");
		num = URLDecoder.decode(num,"UTF-8");
		ProjectReportData projectReportData = projectReportDataDao.findByNum(num);
		if(projectReportData != null && projectReportData.getProject() != null) {
			String projectId = projectReportData.getProject().getId();
			data = projectRecordsService.getQueryProjectUsers(projectId);
			data.setReportData(projectReportData);
		}
		model.addAttribute("projectRecords",data);
		return "modules/projectreportnum/reportAuditProject";
	}
	




	



	


	
	
	

}