|
@@ -0,0 +1,596 @@
|
|
|
+package com.jeeplus.modules.ruralprojectrecords.web;
|
|
|
+
|
|
|
+import com.jeeplus.common.config.Global;
|
|
|
+import com.jeeplus.common.json.AjaxJson;
|
|
|
+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.web.BaseController;
|
|
|
+import com.jeeplus.modules.historical.entity.HistoricalData;
|
|
|
+import com.jeeplus.modules.projectAccessory.entity.ProjectAccessoryRelationInfo;
|
|
|
+import com.jeeplus.modules.projectEngineering.entity.ProjectEngineeringInfo;
|
|
|
+import com.jeeplus.modules.projectEngineering.service.ProjectEngineeringService;
|
|
|
+import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
|
|
|
+import com.jeeplus.modules.projectcontentinfo.entity.Projectcontentinfo;
|
|
|
+import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
|
|
|
+import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
|
|
|
+import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.entity.*;
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageAllService;
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectMessageService;
|
|
|
+import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
|
|
|
+import com.jeeplus.modules.sys.entity.Dict;
|
|
|
+import com.jeeplus.modules.sys.entity.MainDictDetail;
|
|
|
+import com.jeeplus.modules.sys.entity.User;
|
|
|
+import com.jeeplus.modules.sys.service.UserService;
|
|
|
+import com.jeeplus.modules.sys.utils.DictUtils;
|
|
|
+import com.jeeplus.modules.sys.utils.UserUtils;
|
|
|
+import com.jeeplus.modules.workclientinfo.entity.WorkClientLinkman;
|
|
|
+import com.jeeplus.modules.workcontractinfo.entity.WorkContractInfo;
|
|
|
+import com.jeeplus.modules.workstaff.entity.WorkStaffCertificate;
|
|
|
+import jersey.repackaged.com.google.common.collect.Lists;
|
|
|
+import org.activiti.engine.HistoryService;
|
|
|
+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.*;
|
|
|
+import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 电子签章项目列表Controller
|
|
|
+ * B级项目
|
|
|
+ * @author 徐滕
|
|
|
+ * @version 2020-04-15
|
|
|
+ */
|
|
|
+@Controller
|
|
|
+@RequestMapping(value = "${adminPath}/ruralProject/electronicSeal")
|
|
|
+public class RuralProjectMessageElectronicSealController extends BaseController {
|
|
|
+ @Autowired
|
|
|
+ private RuralProjectRecordsService projectRecordsService;
|
|
|
+ @Autowired
|
|
|
+ private RuralProjectMessageAllService ruralProjectMessageAllService;
|
|
|
+ @Autowired
|
|
|
+ protected HistoryService historyService;
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
+ @Autowired
|
|
|
+ private ProjectcontentinfoService projectcontentinfoService;
|
|
|
+ @Autowired
|
|
|
+ private ProjectReportDataService projectReportDataService;
|
|
|
+ @Autowired
|
|
|
+ private RuralProjectMessageService ruralProjectMessageService;
|
|
|
+ @Autowired
|
|
|
+ private ProjectEngineeringService engineeringService;
|
|
|
+
|
|
|
+ @ModelAttribute
|
|
|
+ public RuralProjectRecords get(@RequestParam(required=false) String id) {
|
|
|
+ RuralProjectRecords entity = null;
|
|
|
+ if (StringUtils.isNotBlank(id)){
|
|
|
+ entity = projectRecordsService.get(id);
|
|
|
+ }
|
|
|
+ if (entity == null){
|
|
|
+ entity = new RuralProjectRecords();
|
|
|
+ }
|
|
|
+ return entity;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 项目列表页面
|
|
|
+ */
|
|
|
+ @RequiresPermissions("ruralProject:electronicSeal:list")
|
|
|
+ @RequestMapping(value = {"list", ""})
|
|
|
+ public String list(RuralProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, Model model) {
|
|
|
+ if(UserUtils.isManager()){
|
|
|
+ model.addAttribute("flag","1");
|
|
|
+ }
|
|
|
+ String oldSubmitMoney = "";
|
|
|
+ //进行查询之后进行任何操作,返回还是查询之后的数据页面
|
|
|
+ if (StringUtils.isNotBlank(projectRecords.getToflag())){
|
|
|
+ request.getSession().removeAttribute("searchRuralProjectRecordsAll");
|
|
|
+ RuralProjectRecords search=projectRecords;
|
|
|
+ request.getSession().setAttribute("searchRuralProjectRecordsAll",search);
|
|
|
+ }else{
|
|
|
+ if (request.getSession().getAttribute("searchRuralProjectRecordsAll")!=null){
|
|
|
+ projectRecords= (RuralProjectRecords) request.getSession().getAttribute("searchRuralProjectRecordsAll");
|
|
|
+ model.addAttribute("ruralProjectRecords", projectRecords);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //添加查询类型(工程咨询)
|
|
|
+ List<String> typeList = Lists.newArrayList();
|
|
|
+ String oldProjectSort = null;
|
|
|
+ if (StringUtils.isBlank(projectRecords.getAttachmentProjectSort())){
|
|
|
+ typeList.add("1");
|
|
|
+ typeList.add("2");
|
|
|
+ }else {
|
|
|
+ oldProjectSort=projectRecords.getAttachmentProjectSort();
|
|
|
+ String attachmentProjectSort=projectRecords.getAttachmentProjectSort();
|
|
|
+ typeList.add(attachmentProjectSort.split("-")[0]);
|
|
|
+ projectRecords.setAttachmentProjectSort(attachmentProjectSort.split("-")[1]);
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询总审人员信息
|
|
|
+ List<User> auditUserList = userService.getAuditUserList();
|
|
|
+ model.addAttribute("userList", auditUserList);
|
|
|
+ //添加查询类型list
|
|
|
+ projectRecords.setTypeList(typeList);
|
|
|
+ projectRecords.setSubmitMoney("1");
|
|
|
+ Page<RuralProjectRecords> page = ruralProjectMessageAllService.findPage(new Page<RuralProjectRecords>(request, response), projectRecords);
|
|
|
+ model.addAttribute("page", page);
|
|
|
+ if(null != projectRecords.getWorkContractInfo()){
|
|
|
+ model.addAttribute("workContractInfoName", projectRecords.getWorkContractInfo().getName());
|
|
|
+ if(null != projectRecords.getWorkContractInfo().getClient()){
|
|
|
+ model.addAttribute("workContractInfoClientName", projectRecords.getWorkContractInfo().getClient().getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //无合同状态下,获取委托方的名称
|
|
|
+ List<RuralProjectRecords> list = page.getList();
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ RuralProjectRecords records1 = list.get(i);
|
|
|
+ if (records1.getWorkContractInfo() == null) {
|
|
|
+ projectRecordsService.queryLinkmanInfos(records1);
|
|
|
+ if (records1.getWorkClientLinkmanList() != null && records1.getWorkClientLinkmanList().size() > 0) {
|
|
|
+ WorkClientLinkman linkman = records1.getWorkClientLinkmanList().get(0);
|
|
|
+ WorkContractInfo contractInfo = new WorkContractInfo();
|
|
|
+ contractInfo.setClient(linkman.getClientId());
|
|
|
+ records1.setWorkContractInfo(contractInfo);
|
|
|
+ records1.getWorkContractInfo().setClientName(records1.getWorkContractInfo().getClient().getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(oldSubmitMoney)){
|
|
|
+ projectRecords.setSubmitMoney(oldSubmitMoney);
|
|
|
+ }
|
|
|
+ //查询工程类型
|
|
|
+ if (projectRecords.getEngineeringType()!=null){
|
|
|
+ ProjectEngineeringInfo engineeringInfo=engineeringService.get(projectRecords.getEngineeringType());
|
|
|
+ model.addAttribute("engineeringInfo", engineeringInfo);
|
|
|
+ }
|
|
|
+ model.addAttribute("beginDate", projectRecords.getBeginDate());
|
|
|
+ model.addAttribute("endDate", projectRecords.getEndDate());
|
|
|
+ model.addAttribute("moneyAll", ruralProjectMessageAllService.getMoneyAll(projectRecords));
|
|
|
+ model.addAttribute("reportSwitch", BaseController.REPORTSWITCH);
|
|
|
+ if (StringUtils.isNotBlank(oldProjectSort)){
|
|
|
+ model.addAttribute("oldProjectSort", oldProjectSort);
|
|
|
+ }
|
|
|
+ return "modules/ruralprojectrecords/ruralporjectmessage/electronicSeal/ruralProjectMessageElectronicSealList";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 项目列表页面
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "getProjectList")
|
|
|
+ @ResponseBody
|
|
|
+ public Map<String,List> getProjectList(RuralProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ Map<String, List> map = ruralProjectMessageAllService.getProjectList(projectRecords, request, response);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * admin跳转修改报告页面
|
|
|
+ * @param projectcontentinfo
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @param model
|
|
|
+ * @param attr
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = {"adminEditForm"})
|
|
|
+ public String adminEditForm(RuralProjectcontentinfo projectcontentinfo, HttpServletRequest request, HttpServletResponse response, Model model, RedirectAttributes attr) {
|
|
|
+ RuralProjectRecords projectRecords=new RuralProjectRecords();
|
|
|
+ if (null!=projectcontentinfo.getProjectId()){
|
|
|
+ projectRecords = projectRecordsService.get(projectcontentinfo.getProjectId());
|
|
|
+ model.addAttribute("projectRecords", projectRecords);
|
|
|
+ }
|
|
|
+ Projectcontentinfo projectcontentinfo1 = projectcontentinfoService.getByProjectId(projectcontentinfo.getProjectId());
|
|
|
+ if (null ==projectcontentinfo1){
|
|
|
+ model.addAttribute("projectReportData",null);
|
|
|
+ return "modules/ruralprojectrecords/view/reportView";
|
|
|
+ }
|
|
|
+ ProjectReportData projectReportData = projectReportDataService.getOnRural(projectcontentinfo1.getInfoId());
|
|
|
+ if (null ==projectReportData){
|
|
|
+ model.addAttribute("projectReportData",null);
|
|
|
+ return "modules/ruralprojectrecords/view/reportView";
|
|
|
+ }
|
|
|
+ projectReportData = projectReportDataService.get(projectReportData.getId());
|
|
|
+ RuralProjectRecords ruralProjectRecords = projectRecordsService.getQueryProjectUsers(projectcontentinfo1.getProject().getId());
|
|
|
+ Projectcontentinfo projectcontent = projectcontentinfoService.getByInfoId(projectReportData.getId());
|
|
|
+ projectcontent.setProjectReportData(projectReportData);
|
|
|
+ RuralProjectcontentinfo ruralProjectcontentinfo = projectRecordsService.formAccessory(projectRecords);
|
|
|
+ projectRecordsService.disposeData(ruralProjectcontentinfo);
|
|
|
+ projectcontent.setFileAttachmentList(ruralProjectcontentinfo.getFileAttachmentList());
|
|
|
+ projectcontent.setFileGistdataList(ruralProjectcontentinfo.getFileGistdataList());
|
|
|
+ projectcontent.setFileOtherList(ruralProjectcontentinfo.getFileOtherList());
|
|
|
+ //根据条件查询附件必填项
|
|
|
+ ProjectAccessoryRelationInfo relateInfo = new ProjectAccessoryRelationInfo();
|
|
|
+ //添加项目类型
|
|
|
+ relateInfo.setAttachmentProjectType(ruralProjectRecords.getProjectType());
|
|
|
+ relateInfo.setAttachmentProjectSort(ruralProjectRecords.getAttachmentProjectSort());
|
|
|
+ //判断是否为打包项目,打包项目无需查看项目送审金额是否为500w以上判定
|
|
|
+ String money=ruralProjectRecords.getSubmitMoney();
|
|
|
+ Integer approvalMoney=null;
|
|
|
+ if(StringUtils.isBlank(money)){
|
|
|
+ approvalMoney=1;
|
|
|
+ }else{
|
|
|
+ approvalMoney=Integer.parseInt(money);
|
|
|
+ }
|
|
|
+ switch (approvalMoney){
|
|
|
+ case 0:
|
|
|
+ //金额为0
|
|
|
+ relateInfo.setAttachmentProjectApprovalMoney(null);
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ //500w以下金额状态
|
|
|
+ relateInfo.setAttachmentProjectApprovalMoney("1");
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ //500w以上金额状态
|
|
|
+ relateInfo.setAttachmentProjectApprovalMoney("2");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ //添加报告类型
|
|
|
+ relateInfo.setRequiredStage(1);
|
|
|
+ relateInfo.setId(ruralProjectRecords.getId());
|
|
|
+ List<RuralReportConsultant> consultants = com.google.common.collect.Lists.newArrayList();
|
|
|
+ //将自己添加到咨询员数据中
|
|
|
+ //根据用户查询技能信息
|
|
|
+ RuralReportConsultant currentConsultant = new RuralReportConsultant();
|
|
|
+ List<WorkStaffCertificate> userCertificateList = com.google.common.collect.Lists.newArrayList();
|
|
|
+ if(StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
|
|
|
+ userCertificateList = ruralProjectMessageService.getCertificateByUser(ruralProjectRecords.getProjectMasterId());
|
|
|
+ }
|
|
|
+ //获取专业类型
|
|
|
+ List<MainDictDetail> certificateMajor = DictUtils.getMainDictList("certificate_major");
|
|
|
+ for (WorkStaffCertificate certificateInfo: userCertificateList) {
|
|
|
+ currentConsultant.setZhucezigezhID(certificateInfo.getNum());
|
|
|
+ currentConsultant.setZhucezigezhKey(certificateInfo.getName());
|
|
|
+ for (MainDictDetail type : certificateMajor) {
|
|
|
+ if(certificateInfo.getMajor().equals(type.getValue())){
|
|
|
+ currentConsultant.setMajor(type.getLabel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ User currentUser=userService.get(ruralProjectRecords.getProjectMasterId());
|
|
|
+ currentConsultant.setZixunyuanName(currentUser.getName());
|
|
|
+ currentConsultant.setZixunyuan(currentUser.getId());
|
|
|
+ currentConsultant.setRole("负责人");
|
|
|
+ consultants.add(currentConsultant);
|
|
|
+ }
|
|
|
+ //查询总审人员信息
|
|
|
+ RuralReportConsultant bzshbConsultant = new RuralReportConsultant();
|
|
|
+ //根据项目id查找报告咨询员信息
|
|
|
+ List<RuralReportConsultant> consultantList = ruralProjectMessageService.getConsultantsList(projectcontentinfo.getProjectId());
|
|
|
+ //使用迭代器去除重复信息
|
|
|
+ //排除 重新申请|撤销
|
|
|
+ Iterator<RuralReportConsultant> it = consultantList.iterator();
|
|
|
+ while(it.hasNext()){
|
|
|
+ RuralReportConsultant consultant = it.next();
|
|
|
+ if(consultant.getZixunyuan().equals(currentConsultant.getZixunyuan())){
|
|
|
+ try {
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(consultant, currentConsultant);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ it.remove();
|
|
|
+ }else{
|
|
|
+ //根据用户查询技能信息
|
|
|
+ List<WorkStaffCertificate> certificateList = ruralProjectMessageService.getCertificateByUser(consultant.getZixunyuan());
|
|
|
+ for (WorkStaffCertificate certificateInfo: certificateList) {
|
|
|
+ if(certificateInfo.getName().equals(consultant.getZhucezigezhKey())){
|
|
|
+ consultant.setZhucezigezhID(certificateInfo.getNum());
|
|
|
+ }
|
|
|
+ for (MainDictDetail type : certificateMajor) {
|
|
|
+ if(certificateInfo.getMajor().equals(type.getValue())){
|
|
|
+ consultant.setMajor(type.getLabel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ User user=userService.get(consultant.getZixunyuan());
|
|
|
+ consultant.setRole("咨询员");
|
|
|
+ consultant.setZixunyuanName(user.getName());
|
|
|
+ if(consultant.getZixunyuan().equals(projectReportData.getBzshbUserId())){
|
|
|
+ bzshbConsultant = consultant;
|
|
|
+ bzshbConsultant.setZixunyuanName("陈红星("+consultant.getZixunyuanName()+"代)");
|
|
|
+ bzshbConsultant.setRole("技术负责人");
|
|
|
+ it.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ consultants.addAll(consultantList);
|
|
|
+
|
|
|
+ if(StringUtils.isNotBlank(bzshbConsultant.getZixunyuan())){
|
|
|
+ consultants.add(bzshbConsultant);
|
|
|
+ }else{
|
|
|
+ //查询总审人员信息
|
|
|
+ bzshbConsultant = new RuralReportConsultant();
|
|
|
+ List<WorkStaffCertificate> bzshbCertificateList = com.google.common.collect.Lists.newArrayList();
|
|
|
+ if(StringUtils.isNotBlank(ruralProjectRecords.getProjectMasterId())){
|
|
|
+ bzshbCertificateList = ruralProjectMessageService.getCertificateByUser(projectReportData.getBzshbUserId());
|
|
|
+ }
|
|
|
+ for (WorkStaffCertificate certificateInfo: bzshbCertificateList) {
|
|
|
+ bzshbConsultant.setZhucezigezhID(certificateInfo.getNum());
|
|
|
+ bzshbConsultant.setZhucezigezhKey(certificateInfo.getName());
|
|
|
+ for (MainDictDetail dictType : certificateMajor) {
|
|
|
+ if(certificateInfo.getMajor().equals(dictType.getValue())){
|
|
|
+ bzshbConsultant.setMajor(dictType.getLabel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ User bzshbUser=userService.get(projectReportData.getBzshbUserId());
|
|
|
+ bzshbConsultant.setZixunyuanName(bzshbUser.getName());
|
|
|
+ bzshbConsultant.setZixunyuan(bzshbUser.getId());
|
|
|
+ consultants.add(bzshbConsultant);
|
|
|
+ }
|
|
|
+ Iterator<RuralReportConsultant> itView = consultants.iterator();
|
|
|
+ while(itView.hasNext()){
|
|
|
+ RuralReportConsultant consultant = itView.next();
|
|
|
+ if(bzshbCertificateList.size()>0){
|
|
|
+ if(consultant.getZixunyuan().equals(bzshbConsultant.getZixunyuan())){
|
|
|
+ try {
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
|
|
|
+ bzshbConsultant.setZixunyuanName("陈红星("+bzshbConsultant.getZixunyuanName()+"代)");
|
|
|
+ bzshbConsultant.setRole("技术负责人");
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ itView.remove();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(consultant.getZixunyuan().equals(projectReportData.getBzshbUserId())){
|
|
|
+ try {
|
|
|
+ MyBeanUtils.copyBeanNotNull2Bean(consultant, bzshbConsultant);
|
|
|
+ bzshbConsultant.setZixunyuanName("陈红星("+bzshbConsultant.getZixunyuanName()+"代)");
|
|
|
+ bzshbConsultant.setRole("技术负责人");
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ itView.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(bzshbConsultant.getZixunyuan())){
|
|
|
+ consultants.add(bzshbConsultant);
|
|
|
+ }else{
|
|
|
+ User user=userService.get(projectReportData.getBzshbUserId());
|
|
|
+ bzshbConsultant.setZixunyuanName("陈红星("+user.getName()+"代)");
|
|
|
+ bzshbConsultant.setZixunyuan(user.getId());
|
|
|
+ bzshbConsultant.setRole("技术负责人");
|
|
|
+ consultants.add(bzshbConsultant);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询上报信息表中是否含有数据,没有则进行获取基础数据
|
|
|
+ RuralProjectRecordsReported reported = ruralProjectMessageService.getRuralProjectRecordsReported(projectRecords.getId());
|
|
|
+ if(reported == null){
|
|
|
+ model.addAttribute("reportedFalg", false);
|
|
|
+
|
|
|
+ }else{
|
|
|
+ //根据上报id查询上报咨询员的信息
|
|
|
+ List<RuralReportConsultant> reportedConsultants=ruralProjectMessageService.getReportedConsultantsList(reported.getId());
|
|
|
+ //查询报告咨询员的信息
|
|
|
+ List<RuralReportConsultant> reportConsultants=ruralProjectMessageService.getConsultantsList(projectRecords.getId());
|
|
|
+ List<RuralReportConsultant> consultantLista = com.google.common.collect.Lists.newArrayList();
|
|
|
+ if(reportedConsultants.size() == 0){
|
|
|
+ //如果上报的咨询员信息为空 则处理报告咨询员信息
|
|
|
+ consultantLista = ruralProjectMessageService.disposeConsultant(reportConsultants, projectRecords);
|
|
|
+ }else{
|
|
|
+ //对上报的咨询员进行处理
|
|
|
+ consultantLista = ruralProjectMessageService.disposereportedConsultant(reportedConsultants);
|
|
|
+ }
|
|
|
+ RuralProjectRecords records = projectRecordsService.getQueryProjectUsers(reported.getProjectId());
|
|
|
+ if(StringUtils.isBlank(reported.getProjectRecordId())){
|
|
|
+ reported.setProjectRecordId(records.getProjectId());
|
|
|
+ }
|
|
|
+ model.addAttribute("ruralProjectRecordsReported", reported);
|
|
|
+ projectcontent.setRecordsReported(reported);
|
|
|
+ //查询项目信息
|
|
|
+ model.addAttribute("ruralProjectRecords", records);
|
|
|
+ model.addAttribute("consultantInfo1", consultantLista);
|
|
|
+ if(StringUtils.isBlank(reported.getS1())){
|
|
|
+ reported.setS1("10");
|
|
|
+ }
|
|
|
+ //获取工程类型
|
|
|
+ ProjectEngineeringInfo engineeringInfos=engineeringService.getProjectReportedType(reported.getPorjectUse());
|
|
|
+ model.addAttribute("engineeringInfo", engineeringInfos);
|
|
|
+ }
|
|
|
+
|
|
|
+ //查询总审人员信息
|
|
|
+ List<User> auditUserList = userService.getAuditUserList();
|
|
|
+ ruralProjectRecords.setBzshbUserList(auditUserList);
|
|
|
+ model.addAttribute("processInstanceId",projectReportData.getProcessInstanceId());
|
|
|
+ model.addAttribute("projectReportData",projectReportData);
|
|
|
+ model.addAttribute("projectId", projectcontentinfo1.getProject().getId());
|
|
|
+ model.addAttribute("project", projectcontentinfo1.getProject());
|
|
|
+ model.addAttribute("reportedId", projectcontentinfo.getReportedId());
|
|
|
+ model.addAttribute("projectRecords", ruralProjectRecords);
|
|
|
+ model.addAttribute("id", projectcontentinfo.getId());
|
|
|
+ model.addAttribute("projectcontentinfo", projectcontent);
|
|
|
+ model.addAttribute("consultantinfo", consultants);
|
|
|
+
|
|
|
+ List<MainDictDetail> achievementTypes = DictUtils.getMainDictList("achievement_type");
|
|
|
+ if(null != achievementTypes){
|
|
|
+ for (MainDictDetail achievementType:achievementTypes) {
|
|
|
+ if(achievementType.getValue().equals(projectReportData.getAchievementType())){
|
|
|
+ projectReportData.setAchievementType(achievementType.getLabel());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "modules/ruralprojectrecords/ruralporjectmessage/all/adminReportEditFormAlls";
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * admin修改报告信息
|
|
|
+ * @param projectcontentinfo
|
|
|
+ * @param model
|
|
|
+ * @param redirectAttributes
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = {"adminModifyReport"})
|
|
|
+ public String adminModifyReport(Projectcontentinfo projectcontentinfo,HttpServletRequest request, Model model,RedirectAttributes redirectAttributes) {
|
|
|
+ try{
|
|
|
+ String toJson = ruralProjectMessageService.getReportToJson(projectcontentinfo);
|
|
|
+ HistoricalData historicalData = new HistoricalData();
|
|
|
+ historicalData.setDataType("1");
|
|
|
+ historicalData.setDataId(projectcontentinfo.getProjectReportData().getId());
|
|
|
+ historicalData.setIp(StringUtils.getRemoteAddr(request));
|
|
|
+ historicalData.setOperator(UserUtils.getUser().getId());
|
|
|
+ historicalData.setDataObj(toJson);
|
|
|
+ String str = ruralProjectMessageService.adminModifyReport(projectcontentinfo,historicalData);
|
|
|
+ addMessage(redirectAttributes, "修改报告"+(str.equals("true")?"成功":"失败"));
|
|
|
+ ProjectReportData projectReportData = projectcontentinfo.getProjectReportData();
|
|
|
+ if (projectReportData!=null){
|
|
|
+ if (StringUtils.isNotBlank(projectcontentinfo.getEdit()) && projectcontentinfo.getEdit().equals("edit")){
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralProjectMessageAll/?repage";
|
|
|
+ }
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralProjectMessageAll/?repage";
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ logger.error("ProjectcontentinfoController save Exception e"+e);
|
|
|
+ }
|
|
|
+ if(UserUtils.isManager()){
|
|
|
+ model.addAttribute("flag","1");
|
|
|
+ }
|
|
|
+ addMessage(redirectAttributes, "修改报告失败");
|
|
|
+ ProjectRecords projectRecords = projectcontentinfo.getProject()==null?new ProjectRecords():projectcontentinfo.getProject();
|
|
|
+ return "redirect:" + Global.getAdminPath() + "/ruralProject/ruralProjectMessageAll/?repage";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置上报按钮开关
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "setReportSwitch")
|
|
|
+ @ResponseBody
|
|
|
+ public String setReportSwitch(boolean reportSwitch){
|
|
|
+ BaseController.REPORTSWITCH=reportSwitch;
|
|
|
+ String str="";
|
|
|
+ if (reportSwitch){
|
|
|
+ str="修改成功,上报按钮已开启";
|
|
|
+ }else{
|
|
|
+ str="修改成功,上报按钮已关闭";
|
|
|
+ }
|
|
|
+ return str;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 跳转归档信息导出信息页
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "skipDownloadRecordForm")
|
|
|
+ public String skipDownloadRecordForm(RuralProjectRecords projectRecords,Model model) {
|
|
|
+ model.addAttribute("projectRecords",projectRecords);
|
|
|
+ return "modules/ruralprojectrecords/ruralporjectmessage/all/downloadRecordForm";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询归档
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping("getRecordType")
|
|
|
+ @ResponseBody
|
|
|
+ public AjaxJson getRecordType(String type){
|
|
|
+ AjaxJson ajaxJson = new AjaxJson();
|
|
|
+ try {
|
|
|
+ List<Dict> archiveStateList = DictUtils.getDictList(type);
|
|
|
+ List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
+ for (int i = 0; i < archiveStateList.size(); i++) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("name", archiveStateList.get(i).getLabel());
|
|
|
+ map.put("value", archiveStateList.get(i).getValue());
|
|
|
+ mapList.add(map);
|
|
|
+ }
|
|
|
+ ajaxJson.getBody().put("list", mapList);
|
|
|
+ ajaxJson.setMsg("获取数据成功");
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error("获取数据异常!", e);
|
|
|
+ ajaxJson.setSuccess(false);
|
|
|
+ ajaxJson.setMsg("获取数据异常");
|
|
|
+ }
|
|
|
+ return ajaxJson;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出归档excel文件
|
|
|
+ */
|
|
|
+ @RequiresPermissions("ruralProject:ruralProjectMessageAll:recordDownload")
|
|
|
+ @RequestMapping(value = "recordDownload", method= RequestMethod.POST)
|
|
|
+ public String recordDownload(RuralProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
|
|
+ try {
|
|
|
+ String fileName = "归档项目"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
|
|
|
+ Page<DownloadProjectRecords> page = ruralProjectMessageAllService.findPageRecordDownload(new Page<DownloadProjectRecords>(request, response, -1), projectRecords);
|
|
|
+ if(null != projectRecords.getBeginDate() && null != projectRecords.getEndDate()){
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ new ExportExcel(sdf.format(projectRecords.getBeginDate()) + " 至 " + sdf.format(projectRecords.getEndDate()) + "归档一览表", DownloadProjectRecords.class).setDataList(page.getList()).write(response, fileName).dispose();
|
|
|
+ }else{
|
|
|
+ new ExportExcel("归档一览表", DownloadProjectRecords.class).setDataList(page.getList()).write(response, fileName).dispose();
|
|
|
+ }
|
|
|
+
|
|
|
+ return null;
|
|
|
+ } catch (Exception e) {
|
|
|
+ addMessage(redirectAttributes, "导出项目记录失败!失败信息:"+e.getMessage());
|
|
|
+ logger.error("Exception e:"+e);
|
|
|
+ }
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectMessageAll/?repage";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 跳转上报信息导出信息页
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "skipDownloadReportedForm")
|
|
|
+ public String skipDownloadReportedForm(RuralProjectRecords projectRecords,Model model) {
|
|
|
+ model.addAttribute("projectRecords",projectRecords);
|
|
|
+ return "modules/ruralprojectrecords/ruralporjectmessage/all/downloadReportedForm";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出上报excel文件
|
|
|
+ */
|
|
|
+ @RequiresPermissions("ruralProject:ruralProjectMessageAll:reportedDownload")
|
|
|
+ @RequestMapping(value = "reportedDownload", method= RequestMethod.POST)
|
|
|
+ public String reportedDownload(RuralProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
|
|
+ try {
|
|
|
+ String fileName = "上报项目"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
|
|
|
+ Page<DownloadProjectReporteds> page = ruralProjectMessageAllService.findPageReportedDownload(new Page<DownloadProjectReporteds>(request, response, -1), projectRecords);
|
|
|
+ if(null != projectRecords.getBeginDate() && null != projectRecords.getEndDate()){
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ new ExportExcel(sdf.format(projectRecords.getBeginDate()) + " 至 " + sdf.format(projectRecords.getEndDate()) + "上报一览表", DownloadProjectReporteds.class).setDataList(page.getList()).write(response, fileName).dispose();
|
|
|
+ }else{
|
|
|
+ new ExportExcel("上报一览表", DownloadProjectReporteds.class).setDataList(page.getList()).write(response, fileName).dispose();
|
|
|
+ }
|
|
|
+
|
|
|
+ return null;
|
|
|
+ } catch (Exception e) {
|
|
|
+ addMessage(redirectAttributes, "导出项目记录失败!失败信息:"+e.getMessage());
|
|
|
+ logger.error("Exception e:"+e);
|
|
|
+ }
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralProjectMessageAll/?repage";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出excel文件
|
|
|
+ */
|
|
|
+ @RequiresPermissions("ruralProject:ruralProjectMessageAll:export")
|
|
|
+ @RequestMapping(value = "export", method=RequestMethod.POST)
|
|
|
+ public String exportFile(RuralProjectRecords projectRecords, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
|
|
+ try {
|
|
|
+
|
|
|
+ //添加查询类型(工程咨询)
|
|
|
+ List<String> typeList = Lists.newArrayList();
|
|
|
+ typeList.add("1");
|
|
|
+ typeList.add("2");
|
|
|
+ //添加查询类型list
|
|
|
+ projectRecords.setTypeList(typeList);
|
|
|
+ String fileName = "项目"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
|
|
|
+ Page<RuralProjectRecords> page = ruralProjectMessageAllService.findPageByExport(new Page<RuralProjectRecords>(request, response, -1), projectRecords);
|
|
|
+ new ExportExcel("项目一览表", RuralProjectRecords.class).setDataList(page.getList()).write(response, fileName).dispose();
|
|
|
+ return null;
|
|
|
+ } catch (Exception e) {
|
|
|
+ addMessage(redirectAttributes, "导出项目记录失败!失败信息:"+e.getMessage());
|
|
|
+ logger.error("Exception e:"+e);
|
|
|
+ }
|
|
|
+ return "redirect:"+Global.getAdminPath()+"/ruralProject/ruralCostProjectRecords/?repage";
|
|
|
+ }
|
|
|
+}
|