浏览代码

盖章申请添加批量导出功能
项目导出添加“项目类别”展示列
盖章申请添加“一达”选项列

user5 2 年之前
父节点
当前提交
69ead23d67

+ 2 - 1
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java

@@ -1115,6 +1115,7 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 		this.flagArchive = flagArchive;
 	}
 
+	@ExcelField(title="项目类别", align=2, sort=4,mainDictType = "attachment_project_sort_cost")
 	public String getAttachmentProjectSort() {
 		return attachmentProjectSort;
 	}
@@ -2236,7 +2237,7 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 		this.caseProcessId = caseProcessId;
 	}
 
-	@ExcelField(title="标的额(万元)", align=2, sort=12)
+	//@ExcelField(title="标的额(万元)", align=2, sort=12)
 	public String getZiXunBDE() {
 		return ziXunBDE;
 	}

+ 1 - 1
src/main/java/com/jeeplus/modules/sealApplyFor/service/SealApplyForService.java

@@ -136,7 +136,7 @@ public class SealApplyForService extends CrudService<SealApplyForDao, SealApplyF
         //设置数据权限
         //设置数据权限
         if(!UserUtils.getUser().isAdmin()) {
-            String dataScopeSql = dataScopeFilterOR(sealApplyForInfo.getCurrentUser(), "o", "u", "s", MenuStatusEnum.SEAL_APPLY_FOR.getValue());
+            String dataScopeSql = dataScopeFilter(sealApplyForInfo.getCurrentUser(), "o", "u", "s", MenuStatusEnum.SEAL_APPLY_FOR.getValue());
             sealApplyForInfo.getSqlMap().put("dsf", dataScopeSql);
         }
         if(null!= sealApplyForInfo.getOffice() && StringUtils.isNotBlank(sealApplyForInfo.getOffice().getId())){

+ 7 - 0
src/main/java/com/jeeplus/modules/sealMaterial/dao/SealMaterialDao.java

@@ -41,6 +41,13 @@ public interface SealMaterialDao extends CrudDao<SealMaterialInfoImport> {
     List<SealMaterialInfoExport> findExportList(String projectId);
 
     /**
+     * 导出数据
+     * @param
+     * @return
+     */
+    List<SealMaterialInfoExport> findExportAll(@Param("idList")List<String> idList);
+
+    /**
      * 审批完成后的时间更新
      */
      public Integer updateById(SealMaterialInfoImport sealMaterialInfo);

+ 30 - 6
src/main/java/com/jeeplus/modules/sealMaterial/entity/SealMaterialInfoExport.java

@@ -8,30 +8,38 @@ import java.util.List;
 
 public class SealMaterialInfoExport extends ActEntity<SealMaterialInfoExport> {
 
+    //项目名称
+    @ExcelField(title="项目名称", align=2, sort=1)
+    private String projectName;
+
+    //报告号
+    @ExcelField(title="报告号", align=2, sort=2)
+    private String projectReportNum;
+
     //用印材料名称
-    @ExcelField(title="用印材料名称", align=2, sort=1)
+    @ExcelField(title="用印材料名称", align=2, sort=3)
     private String sealMaterialName;
 
     //    数量
-    @ExcelField(title="份数", align=2, sort=2)
+    @ExcelField(title="份数", align=2, sort=4)
     private Integer amount;
 
     //    主要内容简述
-    @ExcelField(title="主要内容简述", align=2, sort=3)
+    @ExcelField(title="主要内容简述", align=2, sort=5)
     private String mainContents;
 
     //    经办人
     private User agent;
 
-    @ExcelField(title="经办人", align=2, sort=5)
+    @ExcelField(title="经办人", align=2, sort=7)
     private String agentName;   //经办人名称
 
 
-    @ExcelField(title="备注", align=2, sort=6)
+    @ExcelField(title="备注", align=2, sort=8)
     private String sealMaterialImportRemarks;//材料备注
 
     //    用印时间
-    @ExcelField(title="用印时间", align=2, sort=4)
+    @ExcelField(title="用印时间", align=2, sort=6)
     private String useSealTime;
 
     private String projectId; //项目id
@@ -109,4 +117,20 @@ public class SealMaterialInfoExport extends ActEntity<SealMaterialInfoExport> {
     public void setAgentName(String agentName) {
         this.agentName = agentName;
     }
+
+    public String getProjectName() {
+        return projectName;
+    }
+
+    public void setProjectName(String projectName) {
+        this.projectName = projectName;
+    }
+
+    public String getProjectReportNum() {
+        return projectReportNum;
+    }
+
+    public void setProjectReportNum(String projectReportNum) {
+        this.projectReportNum = projectReportNum;
+    }
 }

+ 8 - 0
src/main/java/com/jeeplus/modules/sealMaterial/service/SealMaterialService.java

@@ -100,6 +100,14 @@ public class SealMaterialService extends CrudService<SealMaterialDao,SealMateria
         return sealMaterialInfoExports;
     }
 
+    /**
+     * 查询分页导出用
+     */
+    public List<SealMaterialInfoExport> findPageExportAll(List<String> idList) {
+        List<SealMaterialInfoExport> sealMaterialInfoExports = sealMaterialDao.findExportAll(idList);
+        return sealMaterialInfoExports;
+    }
+
 
     /**
      * 批量更新

+ 23 - 1
src/main/java/com/jeeplus/modules/sealMaterial/web/SealMaterialController.java

@@ -24,6 +24,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 @Controller
@@ -76,7 +77,6 @@ public class SealMaterialController extends BaseController{
      */
     @RequestMapping(value = "export")
     public String exportFile(SealMaterialInfoExport sealMaterialInfoExport, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
-        System.out.println("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
         try {
             //添加查询类型
             String fileName = "盖章材料表"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
@@ -90,6 +90,28 @@ public class SealMaterialController extends BaseController{
         return "redirect:"+Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
     }
 
+
+
+    /**
+     * 导出excel文件
+     */
+    @RequestMapping(value = "exportAllFile")
+    public String exportAllFile(HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+        try {
+            String listIds = request.getParameter("listId");
+            List<String> idList = Arrays.asList(listIds.split(","));
+            //添加查询类型
+            String fileName = "盖章材料表"+ DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
+            List<SealMaterialInfoExport> list = sealMaterialService.findPageExportAll(idList);
+            new ExportExcel("盖章材料", SealMaterialInfoExport.class).setDataList(list).write(response, fileName).dispose();
+            return null;
+        } catch (Exception e) {
+            addMessage(redirectAttributes, "导出项目记录失败!失败信息:"+e.getMessage());
+            logger.error("Exception e:"+e);
+        }
+        return "redirect:"+Global.getAdminPath()+"/sealApplyFor/sealApplyFor/?repage";
+    }
+
 //    @RequestMapping(value = "export")
 //    public String exportFile(ProjectRecords projectRecords, HttpServletResponse response, RedirectAttributes redirectAttributes) {
 //        ProjectRecords ProjectRecord = ruralProjectRecordsService.getProjectRecords(projectRecords.getId());

+ 1 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageAllDao.xml

@@ -143,6 +143,7 @@
 		a.under_ground_num AS "underGroundNum",
 		a.building_scale AS "buildingScale",
 		a.measuring_unit AS "measuringUnit",
+		a.attachment_project_sort AS "attachmentProjectSort",
 		a.project_use AS "projectUse",
 		a.install_fees AS "installFees",
 		a.building_fees AS "buildingFees",

+ 7 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -112,6 +112,7 @@
 		a.under_ground_num AS "underGroundNum",
 		a.building_scale AS "buildingScale",
 		a.measuring_unit AS "measuringUnit",
+		a.attachment_project_sort AS "attachmentProjectSort",
 		a.project_use AS "projectUse",
 		a.install_fees AS "installFees",
 		a.building_fees AS "buildingFees",
@@ -315,6 +316,12 @@
 		'已完成' else '未完成'
 		end) as completionStatus
 		,a.project_type as projectType,
+		(case
+		when a.submit_money = '1' and pfp.status = '5' then
+		'已归档'
+		when a.submit_money = '2' and ppf.status = '5' then
+		'已归档' else '未归档'
+		end) as downArchiveStatus,
 		wci.name AS "workContractInfo.name",
 		wci.contract_num as "workContractInfo.contractNum",
 		wci.contract_price as "workContractInfo.contractPrice",

+ 6 - 0
src/main/resources/mappings/modules/sealApplyFor/SealApplyForDao.xml

@@ -157,6 +157,9 @@
 			<if test="status != null and status != ''">
 				AND a.status = #{status}
 			</if>
+			<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
+				${sqlMap.dsf}
+			</if>
 
 		</where>
 		GROUP BY a.id
@@ -204,6 +207,9 @@
 			<if test="status != null and status != ''">
 				AND a.status = #{status}
 			</if>
+			<if test="sqlMap.dsf !=null and sqlMap.dsf!=''">
+				${sqlMap.dsf}
+			</if>
 		</where>
 	</select>
 

+ 30 - 3
src/main/resources/mappings/modules/sealMaterial/sealMaterialDao.xml

@@ -93,14 +93,41 @@
 		s.main_contents as "mainContents",
 		u.name as "agentName",
 		DATE_FORMAT(s.use_seal_time,'%Y-%m-%d') as "useSealTime",
-		s.seal_contents_remarks as "sealMaterialImportRemarks"
+		s.seal_contents_remarks as "sealMaterialImportRemarks",
+		rpr.project_name as projectName,
+		prd.number as projectReportNum
 		from seal_material_info s
-		left join sys_user  u
-		on s.agent = u.id
+		left join sys_user u on s.agent = u.id
+		left join rural_project_records rpr on rpr.id = s.project_id
+		left join project_report_data prd on rpr.id = prd.project_id
 		where s.project_id = #{projectId}
 		order by s.sort asc
 	</select>
 
+	<select id="findExportAll" resultType="com.jeeplus.modules.sealMaterial.entity.SealMaterialInfoExport">
+		select
+		s.seal_material_name as "sealMaterialName",
+		s.amount as "amount",
+		s.main_contents as "mainContents",
+		u.name as "agentName",
+		DATE_FORMAT(s.use_seal_time,'%Y-%m-%d') as "useSealTime",
+		s.seal_contents_remarks as "sealMaterialImportRemarks",
+		rpr.project_name as projectName,
+		prd.number as projectReportNum
+		from seal_material_info s
+		left join sys_user u on s.agent = u.id
+		left join rural_project_records rpr on rpr.id = s.project_id
+		left join project_report_data prd on rpr.id = prd.project_id
+		<where>
+			s.project_id in (select project_id from seal_apply_for_info where id in
+				<foreach collection="idList" item="id" separator="," open="(" close=")">
+					#{id}
+				</foreach>
+			)
+		</where>
+		order by prd.number desc,s.sort asc
+	</select>
+
 	<update id="updateById">
 		update seal_material_info
 			<if test="sealMaterialName!=null and sealMaterialName!=''">

+ 1 - 0
src/main/webapp/webpage/modules/sealApplyFor/sealApplyForAudit.jsp

@@ -170,6 +170,7 @@
                     <div class="layui-input-block">
                         <input type="radio" name="sealCompany" value="0" title="东兴" disabled <c:if test="${sealApplyForInfo.sealCompany=='0'}">checked</c:if>>
                         <input type="radio" name="sealCompany" value="1" title="赣能" disabled <c:if test="${sealApplyForInfo.sealCompany=='1'}">checked</c:if> >
+                        <input type="radio" name="sealCompany" value="2" title="一达" disabled <c:if test="${sealApplyForInfo.sealCompany=='2'}">checked</c:if>>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw6 with-textarea">

+ 2 - 1
src/main/webapp/webpage/modules/sealApplyFor/sealApplyForForm.jsp

@@ -238,7 +238,8 @@
                     <label class="layui-form-label"><span class="require-item">*</span>单位:</label>
                     <div class="layui-input-block">
                         <input type="radio" name="sealCompany" value="0" title="东兴" <c:if test="${sealApplyForInfo.sealCompany=='0'}">checked</c:if>>
-                        <input type="radio" name="sealCompany" value="1" title="赣能" <c:if test="${sealApplyForInfo.sealCompany=='1'}">checked</c:if> >
+                        <input type="radio" name="sealCompany" value="1" title="赣能" <c:if test="${sealApplyForInfo.sealCompany=='1'}">checked</c:if>>
+                        <input type="radio" name="sealCompany" value="2" title="一达" <c:if test="${sealApplyForInfo.sealCompany=='2'}">checked</c:if>>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw6 with-textarea">

+ 6 - 3
src/main/webapp/webpage/modules/sealApplyFor/sealApplyForList.jsp

@@ -237,6 +237,9 @@
 						<shiro:hasPermission name="sealApplyFor:sealApplyFor:add">
 							<table:addRow url="${ctx}/sealApplyFor/sealApplyFor/form" title="项目"></table:addRow><!-- 增加按钮 -->
 						</shiro:hasPermission>
+						<shiro:hasPermission name="sealApplyFor:sealApplyFor:exportAll">
+							<button type="button" data-toggle="tooltip" data-placement="top" class="layui-btn layui-btn-sm layui-bg-blue" id="exportAll"> 批量下载</button>
+						</shiro:hasPermission>
 						<button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
 					</div>
 					<div style="clear: both;"></div>
@@ -371,7 +374,7 @@
             // ,even: true
             // ,height: 315
         });
-		/*$("#delUser").bind("click",function () {
+		$("#exportAll").bind("click",function () {
 			//获得表格CheckBox已经选中的行的信息
 			var checkList = layui.table.checkStatus('checkboxTable').data;
 			//定义数组存放批量删除的行的id
@@ -383,11 +386,11 @@
 			if (listId.length <= 0) {
 				layer.msg("请选择需要下载的项目信息", {icon: 2})
 			} else {
-				$("#searchForm").attr("action","${ctx}/ruralProject/ruralProjectRecords/exportAll?listId="+ listId);
+				$("#searchForm").attr("action","${ctx}/seal/sealMaterial/exportAllFile?listId="+ listId);
 				$("#searchForm").submit();
 				return true;
 			}
-		});*/
+		});
     })
 
     resizeListTable();

+ 1 - 0
src/main/webapp/webpage/modules/sealApplyFor/sealApplyForModify.jsp

@@ -243,6 +243,7 @@
                     <div class="layui-input-block">
                         <input type="radio" name="sealCompany" value="0" title="东兴" <c:if test="${sealApplyForInfo.sealCompany=='0'}">checked</c:if>>
                         <input type="radio" name="sealCompany" value="1" title="赣能" <c:if test="${sealApplyForInfo.sealCompany=='1'}">checked</c:if> >
+                        <input type="radio" name="sealCompany" value="2" title="一达" <c:if test="${sealApplyForInfo.sealCompany=='2'}">checked</c:if>>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw6 with-textarea">

+ 1 - 0
src/main/webapp/webpage/modules/sealApplyFor/sealApplyForView.jsp

@@ -143,6 +143,7 @@
                     <div class="layui-input-block">
                         <input type="radio" name="sealCompany" value="0" title="东兴" disabled <c:if test="${sealApplyForInfo.sealCompany=='0'}">checked</c:if>>
                         <input type="radio" name="sealCompany" value="1" title="赣能" disabled <c:if test="${sealApplyForInfo.sealCompany=='1'}">checked</c:if> >
+                        <input type="radio" name="sealCompany" value="2" title="一达" disabled <c:if test="${sealApplyForInfo.sealCompany=='2'}">checked</c:if>>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6 lw6 with-textarea">