|
@@ -1,19 +1,25 @@
|
|
package com.sooka.sponest.data.housingconstruction.controller;
|
|
package com.sooka.sponest.data.housingconstruction.controller;
|
|
|
|
|
|
|
|
+import com.ruoyi.common.core.utils.StringUtils;
|
|
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
|
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
|
import com.ruoyi.common.core.web.controller.BaseController;
|
|
import com.ruoyi.common.core.web.controller.BaseController;
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
import com.ruoyi.common.core.web.page.TableDataInfo;
|
|
import com.ruoyi.common.core.web.page.TableDataInfo;
|
|
import com.ruoyi.common.log.annotation.Log;
|
|
import com.ruoyi.common.log.annotation.Log;
|
|
import com.ruoyi.common.log.enums.BusinessType;
|
|
import com.ruoyi.common.log.enums.BusinessType;
|
|
|
|
+import com.ruoyi.common.redis.configure.RedisConfig;
|
|
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
|
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
|
|
|
+import com.ruoyi.common.security.utils.DictUtils;
|
|
import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionEnterpriseproductionreport;
|
|
import com.sooka.sponest.data.housingconstruction.domain.CenterdataTHousingconstructionEnterpriseproductionreport;
|
|
|
|
+import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionAttachService;
|
|
import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionEnterpriseproductionreportService;
|
|
import com.sooka.sponest.data.housingconstruction.service.ICenterdataTHousingconstructionEnterpriseproductionreportService;
|
|
|
|
+import org.apache.commons.collections4.MapUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 企业生产报告Controller
|
|
* 企业生产报告Controller
|
|
@@ -27,6 +33,9 @@ public class CenterdataTHousingconstructionEnterpriseproductionreportController
|
|
@Autowired
|
|
@Autowired
|
|
private ICenterdataTHousingconstructionEnterpriseproductionreportService centerdataTHousingconstructionEnterpriseproductionreportService;
|
|
private ICenterdataTHousingconstructionEnterpriseproductionreportService centerdataTHousingconstructionEnterpriseproductionreportService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICenterdataTHousingconstructionAttachService attachService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询企业生产报告列表
|
|
* 查询企业生产报告列表
|
|
*/
|
|
*/
|
|
@@ -46,8 +55,39 @@ public class CenterdataTHousingconstructionEnterpriseproductionreportController
|
|
@PostMapping("/export")
|
|
@PostMapping("/export")
|
|
public void export(HttpServletResponse response, CenterdataTHousingconstructionEnterpriseproductionreport centerdataTHousingconstructionEnterpriseproductionreport) {
|
|
public void export(HttpServletResponse response, CenterdataTHousingconstructionEnterpriseproductionreport centerdataTHousingconstructionEnterpriseproductionreport) {
|
|
List<CenterdataTHousingconstructionEnterpriseproductionreport> list = centerdataTHousingconstructionEnterpriseproductionreportService.selectCenterdataTHousingconstructionEnterpriseproductionreportList(centerdataTHousingconstructionEnterpriseproductionreport);
|
|
List<CenterdataTHousingconstructionEnterpriseproductionreport> list = centerdataTHousingconstructionEnterpriseproductionreportService.selectCenterdataTHousingconstructionEnterpriseproductionreportList(centerdataTHousingconstructionEnterpriseproductionreport);
|
|
|
|
+ /*list.forEach(report->{
|
|
|
|
+ report.setFileUrl(attachService.replasePathToFile(report.getId(),null));
|
|
|
|
+ });*/
|
|
ExcelUtil<CenterdataTHousingconstructionEnterpriseproductionreport> util = new ExcelUtil<CenterdataTHousingconstructionEnterpriseproductionreport>(CenterdataTHousingconstructionEnterpriseproductionreport.class);
|
|
ExcelUtil<CenterdataTHousingconstructionEnterpriseproductionreport> util = new ExcelUtil<CenterdataTHousingconstructionEnterpriseproductionreport>(CenterdataTHousingconstructionEnterpriseproductionreport.class);
|
|
- util.exportExcel(response, list, "企业生产报告数据");
|
|
|
|
|
|
+ switch (centerdataTHousingconstructionEnterpriseproductionreport.getRequestType()){
|
|
|
|
+ case "1":
|
|
|
|
+ Map<String, Object> reportMap = DictUtils.getDictCacheToMap("enterprise_production_report");
|
|
|
|
+ list.forEach(data->{
|
|
|
|
+ data.setReportType(MapUtils.getString(reportMap,data.getReportType()));
|
|
|
|
+ });
|
|
|
|
+ util.exportExcel(response, list, "企业生产报告数据");
|
|
|
|
+ break;
|
|
|
|
+ case "2":
|
|
|
|
+ Map<String, Object> fileMap = DictUtils.getDictCacheToMap("enterprise_qualification_file");
|
|
|
|
+ list.forEach(data->{
|
|
|
|
+ data.setReportType(MapUtils.getString(fileMap,data.getReportType()));
|
|
|
|
+ });
|
|
|
|
+ util.exportExcel(response, list, "企业资质文件数据");
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ Map<String, Object> reportMapAll = DictUtils.getDictCacheToMap("enterprise_production_report");
|
|
|
|
+ Map<String, Object> fileMapAll = DictUtils.getDictCacheToMap("enterprise_qualification_file");
|
|
|
|
+ list.forEach(data->{
|
|
|
|
+ if(reportMapAll.containsKey(data.getReportType())){
|
|
|
|
+ data.setReportType(MapUtils.getString(reportMapAll, data.getReportType()));
|
|
|
|
+ }
|
|
|
|
+ if(fileMapAll.containsKey(data.getReportType())){
|
|
|
|
+ data.setReportType(MapUtils.getString(fileMapAll, data.getReportType()));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ util.exportExcel(response, list, "企业相关附件数据");
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|