浏览代码

批量归档查看页面(下载批量归档目录清单)

[user3] 3 年之前
父节点
当前提交
441e48622e

+ 10 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java

@@ -6,6 +6,7 @@ package com.jeeplus.modules.ruralprojectrecords.entity;
 import com.google.common.collect.Lists;
 import com.jeeplus.common.persistence.ActEntity;
 import com.jeeplus.common.utils.excel.annotation.ExcelField;
+import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchProInfo;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
 import com.jeeplus.modules.sys.entity.Area;
@@ -234,6 +235,7 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	private List<WorkClientAttachment> workAttachments = Lists.newArrayList();
 
 	private List<ProjectReportData> projectReportData = Lists.newArrayList();
+	private List<ProjectFilingBatchProInfo> proInfos=Lists.newArrayList();
 
 	public String getPrrId() {
 		return prrId;
@@ -1656,4 +1658,12 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	public void setNewRecordTwoAuditNotifyFlag(Integer newRecordTwoAuditNotifyFlag) {
 		this.newRecordTwoAuditNotifyFlag = newRecordTwoAuditNotifyFlag;
 	}
+
+	public List<ProjectFilingBatchProInfo> getProInfos() {
+		return proInfos;
+	}
+
+	public void setProInfos(List<ProjectFilingBatchProInfo> proInfos) {
+		this.proInfos = proInfos;
+	}
 }

+ 113 - 0
src/main/java/com/jeeplus/modules/workfullmanage/web/WorkFullManageController.java

@@ -17,6 +17,9 @@ import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.contractclient.entity.WorkContractClient;
 import com.jeeplus.modules.contractclient.service.WorkContractClientService;
+import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
+import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchProInfo;
+import com.jeeplus.modules.projectFilingBatch.service.ProjectFilingBatchService;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportData;
 import com.jeeplus.modules.projectcontentinfo.entity.ProjectReportDataTwo;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
@@ -123,6 +126,8 @@ public class WorkFullManageController extends BaseController {
 	private RuralProjectRecordsService projectRecordsService;
 	@Autowired
 	private OfficeService officeService;
+	@Autowired
+	private ProjectFilingBatchService projectFilingBatchService;
 
 	@Autowired
 	private WorkFullDesignService workFullDesignService;
@@ -1666,5 +1671,113 @@ public class WorkFullManageController extends BaseController {
 		data.put("list",list);
 		return data;
 	}
+	/**
+	 * 下载批量归档清单
+	 * @param response
+	 * @param projectFilingBatch
+	 */
+	@RequestMapping(value="downloadBatchFilingList")
+	@ResponseBody
+	public void downloadBatchFilingList(HttpServletResponse response, ProjectFilingBatch projectFilingBatch)  {
+		Map data = batchFilingListData(projectFilingBatch);
+
+
+		//模板对象
+		Template template=null;
+		//freemaker模板路径
+		File path = new File(this.getClass().getResource("/").getPath()+"/freemarker");
+		Configuration cfg = new Configuration();
+		try {
+			cfg.setDirectoryForTemplateLoading(path);
+			//选择对应的ftl文件
+			template = cfg.getTemplate("batchFilingList.ftl","UTF-8");
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		File docFile = new File("批量归档清单.xlsx");
+		FreemarkerUtil.generateFile(data,template,docFile);
+		ResponseUtil.docResponse("批量归档清单.xlsx",docFile,response);
+
+	}
+	private Map<String,Object> batchFilingListData(ProjectFilingBatch projectFilingBatch){
+		//获取详细信息
+		projectFilingBatch = projectFilingBatchService.get(projectFilingBatch.getId());
+		List<RuralProjectRecords> ruralProjectRecordsList = new ArrayList<>();
+		//获取详细信息
+		projectFilingBatch = projectFilingBatchService.get(projectFilingBatch.getId());
+		//归档文件类型/归档文件描述
+		List<ProjectFilingBatch> projectFilingBatches = projectFilingBatchService.findProjectIdByFiling(projectFilingBatch.getId());
+		for (ProjectFilingBatch filingBatch : projectFilingBatches) {
+			Map<String, Object> map=new HashMap<>();
+			RuralProjectRecords ruralProjectRecords = ruralProjectRecordsService.getById(filingBatch.getProjectId());
+			ruralProjectRecords.setProjectReportNumber(filingBatch.getNumber());
+			map= projectFilingBatchService.getFilingBatchProInfo(filingBatch.getProjectId(),filingBatch.getId());
+			boolean result= (boolean) map.get("result");
+			if (result){
+				List<ProjectFilingBatchProInfo> proinfos=(List<ProjectFilingBatchProInfo>) map.get("data");
+				ruralProjectRecords.setProInfos(proinfos);
+			}
+			ruralProjectRecordsList.add(ruralProjectRecords);
+		}
+		//获取归档人
+		projectFilingBatch.setCreateBy(UserUtils.get(projectFilingBatch.getCreateBy().getId()));
+		//项目信息
+		projectFilingBatch.setProject(ruralProjectRecordsList);
+		//freemarker参数值准备
+		Map<String,Object> data  = new LinkedHashMap<>();
+		//表头
+		if (StringUtils.isNotBlank(projectFilingBatch.getFilingBatch())){
+			data.put("filingBatch",projectFilingBatch.getFilingBatch());
+		}else{
+			data.put("filingBatch","");
+		}
+		if (StringUtils.isNotBlank(projectFilingBatch.getFilingName())){
+			data.put("batchName",projectFilingBatch.getFilingName());
+		}else{
+			data.put("batchName","");
+		}
+		if (null!=projectFilingBatch.getCreateBy()){
+			User user=UserUtils.get(projectFilingBatch.getCreateBy().getId());
+			data.put("batchUser",user.getName());
+		}else{
+			data.put("batchUser","");
+		}
+		List<Map<String,String>> list=new LinkedList<>();
+		for (RuralProjectRecords ruralProjectRecords:ruralProjectRecordsList){
+			if (ruralProjectRecords.getProInfos().size()>0){
+				for(ProjectFilingBatchProInfo proInfo:ruralProjectRecords.getProInfos()){
+					Map<String,String> map=new HashMap<>();
+					map.put("projectId",ruralProjectRecords.getProjectId());
+					if (StringUtils.isNotBlank(ruralProjectRecords.getProjectReportNumber())){
+						map.put("number",ruralProjectRecords.getProjectReportNumber());
+					}else{
+						map.put("number","");
+					}
+					map.put("projectName",ruralProjectRecords.getProjectName());
+					map.put("batchFileType", proInfo.getProInfoType());
+					if (StringUtils.isNotBlank(proInfo.getProInfoName())){
+						map.put("batchFileMiao",proInfo.getProInfoName());
+					}else{
+						map.put("batchFileMiao","");
+					}
+					list.add(map);
+				}
+			}else{
+				Map<String,String> map=new HashMap<>();
+				map.put("projectId",ruralProjectRecords.getProjectId());
+				if (StringUtils.isNotBlank(ruralProjectRecords.getProjectReportNumber())){
+					map.put("number",ruralProjectRecords.getProjectReportNumber());
+				}else{
+					map.put("number","");
+				}
+				map.put("projectName",ruralProjectRecords.getProjectName());
+				map.put("batchFileType","");
+				map.put("batchFileMiao","");
+				list.add(map);
+			}
+		}
+		data.put("list",list);
+		return data;
+	}
 
 }

+ 216 - 0
src/main/resources/freemarker/batchFilingList.ftl

@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<?mso-application progid="Excel.Sheet"?>
+<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">
+	<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
+		<Author>Admin</Author>
+		<LastAuthor>enford</LastAuthor>
+		<Created>2021-07-28T01:37:00Z</Created>
+		<LastSaved>2021-07-28T02:13:27Z</LastSaved>
+	</DocumentProperties>
+	<CustomDocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
+		<KSOProductBuildVer dt:dt="string">2052-11.1.0.10667</KSOProductBuildVer>
+		<ICV dt:dt="string">25F8FAA23C8546179E6DFC1480405460</ICV>
+	</CustomDocumentProperties>
+	<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
+		<WindowWidth>23040</WindowWidth>
+		<WindowHeight>9420</WindowHeight>
+		<ProtectStructure>False</ProtectStructure>
+		<ProtectWindows>False</ProtectWindows>
+	</ExcelWorkbook>
+	<Styles>
+		<Style ss:ID="Default" ss:Name="Normal">
+			<Alignment ss:Vertical="Center"/>
+			<Borders/>
+			<Font ss:FontName="宋体" x:CharSet="134" ss:Size="11" ss:Color="#000000"/>
+			<Interior/>
+			<NumberFormat/>
+			<Protection/>
+		</Style>
+		<Style ss:ID="s49"/>
+		<Style ss:ID="s50">
+			<Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
+		</Style>
+		<Style ss:ID="s51">
+			<Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
+			<Borders>
+				<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#DDDDDD"/>
+				<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#EBEBEB"/>
+				<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7E7E7"/>
+				<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#EBEBEB"/>
+			</Borders>
+			<Font ss:FontName="宋体" x:CharSet="134" ss:Size="10.5" ss:Color="#333333" ss:Bold="1"/>
+			<Interior ss:Color="#F5F5F6" ss:Pattern="Solid"/>
+		</Style>
+		<Style ss:ID="s52">
+			<Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
+			<Borders>
+				<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#DDDDDD"/>
+				<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2"/>
+				<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7E7E7"/>
+				<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#EBEBEB"/>
+			</Borders>
+			<Font ss:FontName="宋体" x:CharSet="134" ss:Size="10.5" ss:Color="#333333" ss:Bold="1"/>
+			<Interior ss:Color="#F5F5F6" ss:Pattern="Solid"/>
+		</Style>
+		<Style ss:ID="s53">
+			<Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1"/>
+			<Borders>
+				<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#DDDDDD"/>
+				<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7E7E7"/>
+				<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7E7E7"/>
+				<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#EBEBEB"/>
+			</Borders>
+			<Font ss:FontName="宋体" x:CharSet="134" ss:Size="10.5" ss:Color="#333333" ss:Bold="1"/>
+			<Interior ss:Color="#F5F5F6" ss:Pattern="Solid"/>
+		</Style>
+		<Style ss:ID="s54">
+			<Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
+			<Borders>
+				<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7E7E7"/>
+				<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#EBEBEB"/>
+				<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7E7E7"/>
+				<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7EAEC"/>
+			</Borders>
+			<Font ss:FontName="Helvetica" x:CharSet="134" ss:Size="10.5" ss:Color="#333333"/>
+			<Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+		</Style>
+		<Style ss:ID="s55">
+			<Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
+			<Borders>
+				<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7E7E7"/>
+				<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7E7E7"/>
+				<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7E7E7"/>
+				<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7EAEC"/>
+			</Borders>
+			<Font ss:FontName="Helvetica" x:CharSet="134" ss:Size="10.5" ss:Color="#333333"/>
+			<Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+		</Style>
+		<Style ss:ID="s56">
+			<Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
+			<Borders>
+				<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7E7E7"/>
+				<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7E7E7"/>
+				<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7E7E7"/>
+				<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7EAEC"/>
+			</Borders>
+			<Font ss:FontName="宋体" x:CharSet="134" ss:Size="10.5" ss:Color="#333333"/>
+			<Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+		</Style>
+		<Style ss:ID="s57">
+			<Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
+			<Borders>
+				<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7E7E7"/>
+				<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#EBEBEB"/>
+				<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7E7E7"/>
+				<Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="2" ss:Color="#E7EAEC"/>
+			</Borders>
+			<Font ss:FontName="宋体" x:CharSet="134" ss:Size="10.5" ss:Color="#333333"/>
+			<Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+		</Style>
+		<Style ss:ID="s58">
+			<Alignment ss:Horizontal="Center" ss:Vertical="Center"/>
+		</Style>
+	</Styles>
+	<Worksheet ss:Name="Sheet1">
+		<Table ss:ExpandedColumnCount="5" ss:ExpandedRowCount="6" x:FullColumns="1" x:FullRows="1" ss:DefaultColumnWidth="48.6" ss:DefaultRowHeight="14.4">
+			<Column ss:Index="1" ss:StyleID="Default" ss:AutoFitWidth="0" ss:Width="116.8"/>
+			<Column ss:Index="2" ss:StyleID="Default" ss:AutoFitWidth="0" ss:Width="126.25"/>
+			<Column ss:StyleID="Default" ss:AutoFitWidth="0" ss:Width="292.3"/>
+			<Column ss:StyleID="Default" ss:AutoFitWidth="0" ss:Width="314.55"/>
+			<Column ss:StyleID="Default" ss:AutoFitWidth="0" ss:Width="113.4"/>
+			<Row ss:Height="15.15">
+				<Cell ss:StyleID="s58" ss:MergeAcross="4">
+					<Data ss:Type="String">${filingBatch}+${batchName}+${batchUser}</Data>
+				</Cell>
+			</Row>
+			<Row ss:Height="15.15">
+				<Cell ss:StyleID="s51">
+					<Data ss:Type="String">项目编号</Data>
+				</Cell>
+				<Cell ss:StyleID="s52">
+					<Data ss:Type="String">报告号</Data>
+				</Cell>
+				<Cell ss:StyleID="s52">
+					<Data ss:Type="String">项目名称</Data>
+				</Cell>
+				<Cell ss:StyleID="s53">
+					<Data ss:Type="String">归档文件类型</Data>
+				</Cell>
+				<Cell ss:StyleID="s53">
+					<Data ss:Type="String">归档文件描述</Data>
+				</Cell>
+			</Row>
+			<#list list as list>
+				<Row ss:Height="15.15">
+					<Cell ss:StyleID="s54">
+						<Data ss:Type="String">${list.projectId}</Data>
+					</Cell>
+					<Cell ss:StyleID="s55">
+						<Data ss:Type="String">${list.number}</Data>
+					</Cell>
+					<Cell ss:StyleID="s55">
+						<Data ss:Type="String">${list.projectName}</Data>
+					</Cell>
+					<Cell ss:StyleID="s56">
+						<Data ss:Type="String">${list.batchFileType}</Data>
+					</Cell>
+					<Cell ss:StyleID="s56">
+						<Data ss:Type="String">${list.batchFileMiao}</Data>
+					</Cell>
+				</Row>
+			</#list>
+				<Cell ss:StyleID="s57">
+					<ss:Data ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40">
+						<Font html:Color="#333333"/>
+						<Font html:Color="#333333">苏兴审核</Font>
+						<Font html:Face="Helvetica" html:Color="#333333">-2021-0154</Font>
+					</ss:Data>
+				</Cell>
+				<Cell ss:StyleID="s56">
+					<ss:Data ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40">
+						<Font html:Color="#333333"/>
+						<Font html:Color="#333333">苏兴造字【</Font>
+						<Font html:Face="Helvetica" html:Color="#333333">2021</Font>
+						<Font html:Color="#333333">】</Font>
+						<Font html:Face="Helvetica" html:Color="#333333">1551</Font>
+					</ss:Data>
+				</Cell>
+				<Cell ss:StyleID="s55">
+					<ss:Data ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40">
+						<Font html:Color="#333333"/>
+						<Font html:Color="#333333">2020</Font>
+						<Font html:Face="宋体" html:Color="#333333">年南京江宁</Font>
+						<Font html:Color="#333333">10kv</Font>
+						<Font html:Face="宋体" html:Color="#333333">及以下</Font>
+					</ss:Data>
+				</Cell>
+				<Cell ss:StyleID="s56">
+					<Data ss:Type="String">报告</Data>
+				</Cell>
+				<Cell ss:StyleID="s56">
+					<Data ss:Type="String">报告正文</Data>
+				</Cell>
+			</Row>
+		</Table>
+		<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
+			<PageSetup>
+				<Header/>
+				<Footer/>
+			</PageSetup>
+			<Selected/>
+			<TopRowVisible>0</TopRowVisible>
+			<LeftColumnVisible>0</LeftColumnVisible>
+			<PageBreakZoom>100</PageBreakZoom>
+			<Panes>
+				<Pane>
+					<Number>3</Number>
+					<ActiveRow>8</ActiveRow>
+					<ActiveCol>2</ActiveCol>
+					<RangeSelection>R9C3</RangeSelection>
+				</Pane>
+			</Panes>
+			<ProtectObjects>False</ProtectObjects>
+			<ProtectScenarios>False</ProtectScenarios>
+		</WorksheetOptions>
+	</Worksheet>
+</Workbook>

+ 3 - 1
src/main/webapp/webpage/modules/projectFilingBatch/projectFilingBatchView.jsp

@@ -245,7 +245,9 @@
             </div>
 
         <div class="form-group layui-row">
-            <div class="form-group-label"><h2>归档项目信息</h2></div>
+            <div class="form-group-label" style="overflow:hidden;"><h2 style="float: left">归档项目信息</h2>
+                <div style="float: right"> <a href="${ctx}/workfullmanage/workFullManage/downloadBatchFilingList?id=${projectFilingBatch.id}"  onclick="return confirmx('确认要下载批量归档清单吗?', this.href)" class="layui-btn layui-btn-sm" ><i class="fa fa-file-excel-o"></i> 下载批量归档清单</a></div>
+            </div>
             <table id="permissionTable" class="layui-table" lay-filter="permissionTable"></table>
         </div>
         </form:form>