|
@@ -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;
|
|
|
+ }
|
|
|
}
|