Browse Source

新增群众评议

jz.kai 2 years ago
parent
commit
9e7bb75478

+ 3 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/dao/OfficeAttachmentDAO.java

@@ -1,6 +1,8 @@
 package com.jpsoft.excellent.modules.base.dao;
 
 import java.util.List;
+
+import com.jpsoft.excellent.modules.base.entity.FeedbackAttachment;
 import org.springframework.stereotype.Repository;
 import com.jpsoft.excellent.modules.base.entity.OfficeAttachment;
 import java.util.Map;
@@ -15,4 +17,5 @@ public interface OfficeAttachmentDAO {
 	int delete(String id);
 	List<OfficeAttachment> list();
 	List<OfficeAttachment> search(Map<String,Object> searchParams,List<Sort> sortList);
+	List<OfficeAttachment> findListByOfficeOpinionId(String officeOpinionId, String attachmentType);
 }

+ 14 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/entity/OfficeOpinion.java

@@ -4,6 +4,9 @@ import java.io.Serializable;
 import java.util.Date;
 import java.text.SimpleDateFormat;
 import java.math.BigDecimal;
+import java.util.List;
+
+import com.jpsoft.excellent.modules.base.dto.FeedbackAttachmentDTO;
 import org.springframework.format.annotation.DateTimeFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
@@ -24,12 +27,14 @@ public class OfficeOpinion {
     private String connectPhone;
         @ApiModelProperty(value = "机关编号")
     private String officeId;
+    private String officeName;
         @ApiModelProperty(value = "是否满意")
     private Boolean isSatisfied;
         @ApiModelProperty(value = "内容")
     private String content;
         @ApiModelProperty(value = "附件")
     private String appendix;
+    private String[] appendixList;
         @ApiModelProperty(value = "处理进度")
     private Boolean opinionStatus;
         @ApiModelProperty(value = "确认状态")
@@ -50,4 +55,13 @@ public class OfficeOpinion {
     private Date updateTime;
         @ApiModelProperty(value = "更新人")
     private String updateBy;
+
+    private String areaId;
+    private String areaName;
+    @ApiModelProperty(value = "附件列表")
+    private List<FeedbackAttachmentDTO> attList;
+    @ApiModelProperty(value = "图片列表")
+    private List<FeedbackAttachmentDTO> picList;
+    @ApiModelProperty(value = "图片路径数组")
+    private String[] picUrlList;
 }

+ 3 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/OfficeAttachmentService.java

@@ -2,6 +2,8 @@ package com.jpsoft.excellent.modules.base.service;
 
 import java.util.List;
 import java.util.Map;
+
+import com.jpsoft.excellent.modules.base.entity.FeedbackAttachment;
 import com.jpsoft.excellent.modules.base.entity.OfficeAttachment;
 import com.github.pagehelper.Page;
 import com.jpsoft.excellent.modules.common.dto.Sort;
@@ -14,4 +16,5 @@ public interface OfficeAttachmentService {
 	int delete(String id);
 	List<OfficeAttachment> list();
 	Page<OfficeAttachment> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
+	List<OfficeAttachment> findListByOfficeOpinionId(String officeOpinionId, String attachmentType);
 }

+ 8 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/OfficeAttachmentServiceImpl.java

@@ -4,6 +4,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 import javax.annotation.Resource;
+
+import com.jpsoft.excellent.modules.base.entity.FeedbackAttachment;
 import org.springframework.stereotype.Component;
 import org.springframework.transaction.annotation.Transactional;
 import com.jpsoft.excellent.modules.base.dao.OfficeAttachmentDAO;
@@ -67,4 +69,10 @@ public class OfficeAttachmentServiceImpl implements OfficeAttachmentService {
         
         return page;
 	}
+
+	@Override
+	public List<OfficeAttachment> findListByOfficeOpinionId(String officeOpinionId, String attachmentType) {
+		// TODO Auto-generated method stub
+		return officeAttachmentDAO.findListByOfficeOpinionId(officeOpinionId, attachmentType);
+	}
 }

+ 12 - 0
common/src/main/resources/mapper/base/OfficeAttachment.xml

@@ -88,4 +88,16 @@ id_,office_opinion_id,attachment_type,attachment_title,attachment_url,sort_no,cr
 	        ${sort.name} ${sort.order}
 	 	</foreach>
 	</select>
+	<select id="findListByOfficeOpinionId" parameterType="string" resultMap="OfficeAttachmentMap">
+		select * from base_office_attachment
+		<where>
+			<if test="officeOpinionId != null">
+				and office_opinion_id=#{officeOpinionId}
+			</if>
+			<if test="attachmentType != null">
+				and attachment_type=#{attachmentType}
+			</if>
+		</where>
+		order by sort_no asc
+	</select>
 </mapper>

+ 56 - 20
common/src/main/resources/mapper/base/OfficeOpinion.xml

@@ -5,21 +5,24 @@
 <mapper namespace="com.jpsoft.excellent.modules.base.dao.OfficeOpinionDAO">
 	<resultMap id="OfficeOpinionMap" type="com.jpsoft.excellent.modules.base.entity.OfficeOpinion">
 		<id property="id" column="id_" />
-			<result property="connect" column="connect_" />
-			<result property="connectPhone" column="connect_phone" />
-			<result property="officeId" column="office_id" />
-			<result property="isSatisfied" column="is_satisfied" />
-			<result property="content" column="content_" />
-			<result property="appendix" column="appendix_" />
-			<result property="opinionStatus" column="opinion_status" />
-			<result property="confirmStatus" column="confirm_status" />
-			<result property="contentAttachment" column="content_attachment" />
-			<result property="delFlag" column="del_flag" />
-			<result property="createTime" column="create_time" />
-			<result property="createBy" column="create_by" />
-			<result property="updateTime" column="update_time" />
-			<result property="updateBy" column="update_by" />
-			</resultMap>
+		<result property="connect" column="connect_" />
+		<result property="connectPhone" column="connect_phone" />
+		<result property="officeId" column="office_id" />
+		<result property="isSatisfied" column="is_satisfied" />
+		<result property="content" column="content_" />
+		<result property="appendix" column="appendix_" />
+		<result property="opinionStatus" column="opinion_status" />
+		<result property="confirmStatus" column="confirm_status" />
+		<result property="contentAttachment" column="content_attachment" />
+		<result property="delFlag" column="del_flag" />
+		<result property="createTime" column="create_time" />
+		<result property="createBy" column="create_by" />
+		<result property="updateTime" column="update_time" />
+		<result property="updateBy" column="update_by" />
+
+		<result property="areaId" column="area_id" />
+		<result property="officeName" column="office_name" />
+	</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.excellent.modules.base.entity.OfficeOpinion">
 	<!--
 	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
@@ -101,8 +104,9 @@
 	where id_=#{id}
 	</update>
 	<select id="get" parameterType="string" resultMap="OfficeOpinionMap">
-		select 
-id_,connect_,connect_phone,office_id,is_satisfied,content_,appendix_,opinion_status,confirm_status,content_attachment,del_flag,create_time,create_by,update_time,update_by		from base_office_opinion where id_=#{0}
+		SELECT a.*,b.area_id,b.name_ AS office_name FROM base_office_opinion a
+		LEFT JOIN base_office b ON a.office_id = b.id_
+		where a.id_=#{0}
 	</select>
 	<select id="exist" parameterType="string" resultType="int">
 		select count(*) from base_office_opinion where id_=#{0}
@@ -112,11 +116,43 @@ id_,connect_,connect_phone,office_id,is_satisfied,content_,appendix_,opinion_sta
 	</select>
 	<select id="search" parameterType="hashmap" resultMap="OfficeOpinionMap">
 		<![CDATA[
-			select * from base_office_opinion
+			SELECT a.*,b.area_id,b.name_ AS office_name FROM base_office_opinion a
+			LEFT JOIN base_office b ON a.office_id = b.id_
 		]]>
 		<where>
-			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+			and a.del_flag = 0
+			<if test="searchParams.connect != null">
+				and a.connect_ like #{searchParams.connect}
+			</if>
+			<if test="searchParams.connectPhone != null">
+				and a.connect_phone like #{searchParams.connectPhone}
+			</if>
+			<if test="searchParams.areaId != null">
+				and b.area_id = #{searchParams.areaId}
+			</if>
+			<if test="searchParams.areaIds != null">
+				<foreach collection="searchParams.areaIds" item="areaId" open="and b.area_id in (" separator="," close=")">
+					#{areaId}
+				</foreach>
+			</if>
+			<if test="searchParams.isSatisfied != null">
+				and a.is_satisfied = #{searchParams.isSatisfied}
+			</if>
+			<if test="searchParams.opinionStatus != null">
+				and a.opinion_status = #{searchParams.opinionStatus}
+			</if>
+			<if test="searchParams.confirmStatus != null">
+				and a.confirm_status = #{searchParams.confirmStatus}
+			</if>
+			<if test="searchParams.reportDateStart != null">
+				<![CDATA[
+				and a.create_time >= #{searchParams.reportDateStart}
+				]]>
+			</if>
+			<if test="searchParams.reportDateEnd != null">
+				<![CDATA[
+				and a.create_time < #{searchParams.reportDateEnd}
+				]]>
 			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">

+ 377 - 11
web/src/main/java/com/jpsoft/excellent/modules/base/controller/OfficeOpinionController.java

@@ -1,20 +1,29 @@
 package com.jpsoft.excellent.modules.base.controller;
 
 import com.github.pagehelper.Page;
+import com.jpsoft.excellent.config.OSSConfig;
+import com.jpsoft.excellent.modules.base.dto.FeedbackAttachmentDTO;
+import com.jpsoft.excellent.modules.base.entity.*;
+import com.jpsoft.excellent.modules.base.service.AreaService;
+import com.jpsoft.excellent.modules.base.service.OfficeAttachmentService;
+import com.jpsoft.excellent.modules.common.utils.OSSUtil;
 import com.jpsoft.excellent.modules.common.utils.PojoUtils;
 import com.jpsoft.excellent.modules.common.dto.Sort;
 import com.jpsoft.excellent.modules.common.dto.MessageResult;
-import com.jpsoft.excellent.modules.base.entity.OfficeOpinion;
 import com.jpsoft.excellent.modules.base.service.OfficeOpinionService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -24,15 +33,24 @@ import java.util.*;
 public class OfficeOpinionController {
     private Logger logger = LoggerFactory.getLogger(getClass());
 
+    @Autowired
+    private OSSConfig ossConfig;
     @Autowired
     private OfficeOpinionService officeOpinionService;
+    @Autowired
+    private OfficeAttachmentService officeAttachmentService;
+    @Autowired
+    private AreaService areaService;
 
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
     public MessageResult<OfficeOpinion> create(){
         MessageResult<OfficeOpinion> msgResult = new MessageResult<>();
 
+        List<FeedbackAttachmentDTO> feedbackAttachmentList = new ArrayList<>();
         OfficeOpinion officeOpinion = new OfficeOpinion();
+        officeOpinion.setAttList(feedbackAttachmentList);
+        officeOpinion.setPicList(feedbackAttachmentList);
 
         msgResult.setData(officeOpinion);
         msgResult.setResult(true);
@@ -78,6 +96,38 @@ public class OfficeOpinionController {
 
         try {
             OfficeOpinion officeOpinion = officeOpinionService.get(id);
+            Area area = areaService.get(officeOpinion.getAreaId());
+            if(area != null){
+                officeOpinion.setAreaName(area.getName());
+            }
+            if(StringUtils.isNotEmpty(officeOpinion.getAppendix())){
+                officeOpinion.setAppendixList(officeOpinion.getAppendix().split(","));
+            }
+
+            //附件列表
+            List<FeedbackAttachmentDTO> feedbackAttachmentDTOList1 = new ArrayList<>();
+            List<OfficeAttachment> officeAttachmentList1 = officeAttachmentService.findListByOfficeOpinionId(id,"1");
+            for(OfficeAttachment officeAttachment : officeAttachmentList1){
+                FeedbackAttachmentDTO feedbackAttachmentDTO = new FeedbackAttachmentDTO();
+                feedbackAttachmentDTO.setName(officeAttachment.getAttachmentTitle());
+                feedbackAttachmentDTO.setUrl(officeAttachment.getAttachmentUrl());
+                feedbackAttachmentDTOList1.add(feedbackAttachmentDTO);
+            }
+            officeOpinion.setAttList(feedbackAttachmentDTOList1);
+            //图片列表
+            List<FeedbackAttachmentDTO> feedbackAttachmentDTOList2 = new ArrayList<>();
+            List<OfficeAttachment> officeAttachmentList2 = officeAttachmentService.findListByOfficeOpinionId(id,"2");
+            String[] picUrlList = new String[officeAttachmentList2.size()];
+            for(int i=0;i<officeAttachmentList2.size();i++){
+                OfficeAttachment officeAttachment = officeAttachmentList2.get(i);
+                FeedbackAttachmentDTO feedbackAttachmentDTO = new FeedbackAttachmentDTO();
+                feedbackAttachmentDTO.setName(officeAttachment.getAttachmentTitle());
+                feedbackAttachmentDTO.setUrl(officeAttachment.getAttachmentUrl());
+                feedbackAttachmentDTOList2.add(feedbackAttachmentDTO);
+                picUrlList[i] = officeAttachment.getAttachmentUrl();
+            }
+            officeOpinion.setPicList(feedbackAttachmentDTOList2);
+            officeOpinion.setPicUrlList(picUrlList);
 
             if (officeOpinion != null) {
                 msgResult.setResult(true);
@@ -109,6 +159,42 @@ public class OfficeOpinionController {
             int affectCount = officeOpinionService.update(officeOpinion);
 
             if (affectCount > 0) {
+                if (officeOpinion.getConfirmStatus() == null || !officeOpinion.getConfirmStatus()) {
+                    //删除关联附件及图片
+                    List<OfficeAttachment> officeAttachmentList = officeAttachmentService.findListByOfficeOpinionId(officeOpinion.getId(), null);
+                    for (OfficeAttachment officeAttachment : officeAttachmentList) {
+                        officeAttachmentService.delete(officeAttachment.getId());
+                    }
+                    //关联附件
+                    for (int i = 0; i < officeOpinion.getAttList().size(); i++) {
+                        FeedbackAttachmentDTO feedbackAttachmentDTO = officeOpinion.getAttList().get(i);
+                        OfficeAttachment officeAttachment = new OfficeAttachment();
+                        officeAttachment.setId(UUID.randomUUID().toString());
+                        officeAttachment.setOfficeOpinionId(officeOpinion.getId());
+                        officeAttachment.setAttachmentType("1");
+                        officeAttachment.setAttachmentTitle(feedbackAttachmentDTO.getName());
+                        officeAttachment.setAttachmentUrl(feedbackAttachmentDTO.getUrl());
+                        officeAttachment.setSortNo(i);
+                        officeAttachment.setCreateBy(subject);
+                        officeAttachment.setCreateTime(new Date());
+                        officeAttachmentService.insert(officeAttachment);
+                    }
+                    //关联图片
+                    for (int i = 0; i < officeOpinion.getPicList().size(); i++) {
+                        FeedbackAttachmentDTO feedbackAttachmentDTO = officeOpinion.getPicList().get(i);
+                        OfficeAttachment officeAttachment = new OfficeAttachment();
+                        officeAttachment.setId(UUID.randomUUID().toString());
+                        officeAttachment.setOfficeOpinionId(officeOpinion.getId());
+                        officeAttachment.setAttachmentType("2");
+                        officeAttachment.setAttachmentTitle(feedbackAttachmentDTO.getName());
+                        officeAttachment.setAttachmentUrl(feedbackAttachmentDTO.getUrl());
+                        officeAttachment.setSortNo(i);
+                        officeAttachment.setCreateBy(subject);
+                        officeAttachment.setCreateTime(new Date());
+                        officeAttachmentService.insert(officeAttachment);
+                    }
+                }
+
                 msgResult.setResult(true);
                 msgResult.setData(officeOpinion);
             } else {
@@ -196,30 +282,310 @@ public class OfficeOpinionController {
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
-            String id,
+            String connect, String connectPhone, String areaId, Boolean areaSubordinate, String isSatisfied, String opinionStatus, String confirmStatus, Date[] reportDate,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
-
-        //当前用户ID
-        System.out.println(subject);
-
         MessageResult<Map> msgResult = new MessageResult<>();
 
         Map<String,Object> searchParams = new HashMap<>();
+        if (StringUtils.isNotEmpty(connect)) {
+            searchParams.put("connect","%" + connect + "%");
+        }
+        if (StringUtils.isNotEmpty(connectPhone)) {
+            searchParams.put("connectPhone","%" + connectPhone + "%");
+        }
+        if (StringUtils.isNotEmpty(areaId) && !"null".equals(areaId)) {
+            if (areaSubordinate) {
+                searchParams.put("areaIds", parentIds(areaId));
+            }
+            else {
+                searchParams.put("areaId", areaId);
+            }
+        }
+        if (StringUtils.isNotEmpty(isSatisfied)) {
+            if("1".equals(isSatisfied)) {
+                searchParams.put("isSatisfied", true);
+            }
+            if("0".equals(isSatisfied)) {
+                searchParams.put("isSatisfied", false);
+            }
+        }
+        if (StringUtils.isNotEmpty(opinionStatus)) {
+            if("1".equals(opinionStatus)) {
+                searchParams.put("opinionStatus", true);
+            }
+            if("0".equals(opinionStatus)) {
+                searchParams.put("opinionStatus", false);
+            }
+        }
+        if (StringUtils.isNotEmpty(confirmStatus)) {
+            if("1".equals(confirmStatus)) {
+                searchParams.put("confirmStatus", true);
+            }
+            if("0".equals(confirmStatus)) {
+                searchParams.put("confirmStatus", false);
+            }
+        }
+        if (reportDate.length > 0) {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            Calendar calendar = new GregorianCalendar();
+            calendar.setTime(reportDate[1]);
+            calendar.add(calendar.DATE,1);
+
+            searchParams.put("reportDateStart",sdf.format(reportDate[0]));
+            searchParams.put("reportDateEnd",sdf.format(calendar.getTime()));
+        }
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("id_","asc"));
-
-        if (StringUtils.isNotEmpty(id)) {
-            searchParams.put("id","%" + id + "%");
-        }
+        sortList.add(new Sort("create_time","desc"));
 
         Page<OfficeOpinion> page = officeOpinionService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+        for(OfficeOpinion officeOpinion : page.getResult()){
+            if(StringUtils.isNotEmpty(officeOpinion.getAreaId())) {
+                officeOpinion.setAreaName(parentFullName(officeOpinion.getAreaId()));
+            }
+        }
 
         msgResult.setResult(true);
         msgResult.setData(PojoUtils.pageWrapper(page));
 
         return msgResult;
     }
+
+    private String parentFullName(String parentId){
+        String fullName = "";
+
+        Area area = areaService.get(parentId);
+        if(StringUtils.isNotEmpty(area.getParentId())){
+            fullName = parentFullName(area.getParentId()) + "-" + area.getName();
+        }
+        else {
+            fullName = area.getName();
+        }
+
+        return fullName;
+    }
+
+    @ApiOperation(value="确认")
+    @PostMapping("checked/{id}")
+    public MessageResult checked(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult msgResult = new MessageResult<>();
+
+        try {
+            OfficeOpinion officeOpinion = officeOpinionService.get(id);
+            officeOpinion.setConfirmStatus(true);
+            officeOpinion.setUpdateBy(subject);
+            officeOpinion.setUpdateTime(new Date());
+
+            int affectCount = officeOpinionService.update(officeOpinion);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(officeOpinion);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    private List<String> parentIds(String parentId){
+        List<String> ids = new ArrayList<>();
+        ids.add(parentId);
+
+        List<Area> areaList = areaService.getListByParentId(parentId);
+        for(Area area : areaList){
+            ids.addAll(parentIds(area.getId()));
+        }
+
+        return ids;
+    }
+
+    @ApiOperation(value="导出报表")
+    @RequestMapping(value = "reportListXls",method = RequestMethod.POST)
+    public String reportListXls(String sort, String connect, String connectPhone, String areaId, String workStation, String window,
+                                String isSatisfied, String opinionStatus, String confirmStatus, String[] cause, Date[] reportDate,
+                                Boolean areaSubordinate, @RequestAttribute String subject){
+        String downloadUrl = "";
+
+        //新建文档
+        Workbook workbook = new HSSFWorkbook();
+        Sheet sheet = workbook.createSheet();
+
+        //单元格样式
+        sheet.setDefaultColumnWidth(15);
+        sheet.setDefaultRowHeight((short) 400);
+
+        Font fontTitle = workbook.createFont();
+        fontTitle.setFontName("宋体");
+        fontTitle.setFontHeightInPoints((short) 11);
+        fontTitle.setBold(true);
+
+        CellStyle cellStyleTitle = workbook.createCellStyle();
+        cellStyleTitle.setBorderTop(BorderStyle.THIN);
+        cellStyleTitle.setBorderBottom(BorderStyle.THIN);
+        cellStyleTitle.setBorderLeft(BorderStyle.THIN);
+        cellStyleTitle.setBorderRight(BorderStyle.THIN);
+        cellStyleTitle.setVerticalAlignment(VerticalAlignment.CENTER);
+        cellStyleTitle.setAlignment(HorizontalAlignment.CENTER);
+        cellStyleTitle.setFont(fontTitle);
+
+        Font fontContent = workbook.createFont();
+        fontContent.setFontName("宋体");
+        fontContent.setFontHeightInPoints((short) 11);
+
+        CellStyle cellStyleContent = workbook.createCellStyle();
+        cellStyleContent.setBorderTop(BorderStyle.THIN);
+        cellStyleContent.setBorderBottom(BorderStyle.THIN);
+        cellStyleContent.setBorderLeft(BorderStyle.THIN);
+        cellStyleContent.setBorderRight(BorderStyle.THIN);
+        cellStyleContent.setVerticalAlignment(VerticalAlignment.CENTER);
+        cellStyleContent.setAlignment(HorizontalAlignment.CENTER);
+        cellStyleContent.setFont(fontContent);
+
+        //表头
+        Row rowTitle = sheet.createRow(0);
+        String[] titles = new String[]{"序号","联系人","联系电话","区域","单位","是否满意","处理进度","确认状态","内容","上报时间"};
+        for (int i=0;i<titles.length;i++) {
+            Cell cell = rowTitle.createCell(i);
+            cell.setCellValue(titles[i]);
+            cell.setCellStyle(cellStyleTitle);
+        }
+
+        //读取数据
+        Map<String,Object> searchParams = new HashMap<>();
+        if (StringUtils.isNotEmpty(connect)) {
+            searchParams.put("connect","%" + connect + "%");
+        }
+        if (StringUtils.isNotEmpty(connectPhone)) {
+            searchParams.put("connectPhone","%" + connectPhone + "%");
+        }
+        if (StringUtils.isNotEmpty(areaId) && !"null".equals(areaId)) {
+            if (areaSubordinate) {
+                searchParams.put("areaIds", parentIds(areaId));
+            }
+            else {
+                searchParams.put("areaId", areaId);
+            }
+        }
+        if (StringUtils.isNotEmpty(isSatisfied)) {
+            if("1".equals(isSatisfied)) {
+                searchParams.put("isSatisfied", true);
+            }
+            if("0".equals(isSatisfied)) {
+                searchParams.put("isSatisfied", false);
+            }
+        }
+        if (StringUtils.isNotEmpty(opinionStatus)) {
+            if("1".equals(opinionStatus)) {
+                searchParams.put("opinionStatus", true);
+            }
+            if("0".equals(opinionStatus)) {
+                searchParams.put("opinionStatus", false);
+            }
+        }
+        if (StringUtils.isNotEmpty(confirmStatus)) {
+            if("1".equals(confirmStatus)) {
+                searchParams.put("confirmStatus", true);
+            }
+            if("0".equals(confirmStatus)) {
+                searchParams.put("confirmStatus", false);
+            }
+        }
+        if (reportDate.length > 0) {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            Calendar calendar = new GregorianCalendar();
+            calendar.setTime(reportDate[1]);
+            calendar.add(calendar.DATE,1);
+
+            searchParams.put("reportDateStart",sdf.format(reportDate[0]));
+            searchParams.put("reportDateEnd",sdf.format(calendar.getTime()));
+        }
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("create_time","desc"));
+
+        Page<OfficeOpinion> page = officeOpinionService.pageSearch(searchParams,1,100000,true,sortList);
+        //写入数据
+        for(int i=0; i<page.getResult().size(); i++){
+            OfficeOpinion officeOpinion = page.getResult().get(i);
+
+            Row row = sheet.createRow(i+1);
+            row.createCell(0);
+            row.createCell(1);
+            row.createCell(2);
+            row.createCell(3);
+            row.createCell(4);
+            row.createCell(5);
+            row.createCell(6);
+            row.createCell(7);
+            row.createCell(8);
+            row.createCell(9);
+
+            row.getCell(0).setCellValue(i+1);
+            row.getCell(1).setCellValue(officeOpinion.getConnect());
+            row.getCell(2).setCellValue(officeOpinion.getConnectPhone());
+            row.getCell(3).setCellValue(parentFullName(officeOpinion.getAreaId()));
+            row.getCell(4).setCellValue(officeOpinion.getOfficeName());
+            if(officeOpinion.getIsSatisfied()){
+                row.getCell(5).setCellValue("满意");
+            }
+            else{
+                row.getCell(5).setCellValue("不满意");
+            }
+            if(officeOpinion.getOpinionStatus()){
+                row.getCell(6).setCellValue("已处理");
+            }
+            else{
+                row.getCell(6).setCellValue("未处理");
+            }
+            if(officeOpinion.getConfirmStatus()){
+                row.getCell(7).setCellValue("已确认");
+            }
+            else{
+                row.getCell(7).setCellValue("待确认");
+            }
+            row.getCell(8).setCellValue(officeOpinion.getContent());
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+            row.getCell(9).setCellValue(sdf.format(officeOpinion.getCreateTime()));
+
+            row.getCell(0).setCellStyle(cellStyleContent);
+            row.getCell(1).setCellStyle(cellStyleContent);
+            row.getCell(2).setCellStyle(cellStyleContent);
+            row.getCell(3).setCellStyle(cellStyleContent);
+            row.getCell(4).setCellStyle(cellStyleContent);
+            row.getCell(5).setCellStyle(cellStyleContent);
+            row.getCell(6).setCellStyle(cellStyleContent);
+            row.getCell(7).setCellStyle(cellStyleContent);
+            row.getCell(8).setCellStyle(cellStyleContent);
+            row.getCell(9).setCellStyle(cellStyleContent);
+        }
+
+        ByteArrayOutputStream output = new ByteArrayOutputStream();
+        try {
+            workbook.write(output);
+
+            byte[] buffer = output.toByteArray();
+            ByteArrayInputStream input = new ByteArrayInputStream(buffer);
+
+            SimpleDateFormat sdf2 = new SimpleDateFormat("yyyyMMddHHmm");
+            String now = sdf2.format(new Date());
+            String fileName = "群众评议-" + now + ".xls";
+            downloadUrl = OSSUtil.upload(ossConfig,"InsuranceReport",fileName,input);
+        }
+        catch (Exception ex){
+            logger.error(ex.getMessage(),ex);
+        }
+
+        return downloadUrl;
+    }
 }