From d117d3af15dddc4f07baffa8b5bf6b727c05de7c Mon Sep 17 00:00:00 2001 From: cjl <276999030@qq.com> Date: Wed, 15 Nov 2023 15:48:14 +0800 Subject: [PATCH] fix:补充提交 --- screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationListExcelVo.java | 39 +++++++++++++++++-- screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationExcelExt.java | 6 +- screen-api/src/main/resources/application-qa.yml | 2 screen-api/src/main/java/com/moral/api/controller/AllocationController.java | 22 +++++++--- screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java | 1 screen-api/src/main/resources/mapper/AllocationMapper.xml | 6 ++ 6 files changed, 59 insertions(+), 17 deletions(-) diff --git a/screen-api/src/main/java/com/moral/api/controller/AllocationController.java b/screen-api/src/main/java/com/moral/api/controller/AllocationController.java index afdc6de..329c765 100644 --- a/screen-api/src/main/java/com/moral/api/controller/AllocationController.java +++ b/screen-api/src/main/java/com/moral/api/controller/AllocationController.java @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.moral.api.entity.AllocationLog; import com.moral.api.entity.ResponsibilityUnit; +import com.moral.api.pojo.enums.AllocationApproveEnum; +import com.moral.api.pojo.enums.ChangeEnum; import com.moral.api.pojo.ext.allocation.AllocationExcelExt; import com.moral.api.pojo.ext.allocation.AllocationExt; import com.moral.api.pojo.ext.allocation.AllocationPageExt; @@ -35,10 +37,7 @@ import java.io.IOException; import java.net.URL; import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.atomic.AtomicReference; @@ -232,7 +231,6 @@ } - private final String PARHTINAGE = "https://qx.7drlb.com/api/file/preview/"; private void genImageExcel(List<AllocationExcelExt> list, HttpServletResponse response) throws IOException { if (CollectionUtils.isEmpty(list)) { @@ -240,12 +238,22 @@ } List<AllocationListExcelVo> demoDataList = new ArrayList<>(); for(int i = 0;i<list.size();i++){ - AllocationListExcelVo item = AllocationListExcelVo.convert(list.get(i)); + AllocationExcelExt excelExt = list.get(i); + AllocationListExcelVo item = AllocationListExcelVo.convert(excelExt); List<String> urls = new ArrayList<>(); - for(FileAddressVo z : list.get(i).getFileBaseList()){ + for(FileAddressVo z : excelExt.getFileBaseList()){ urls.add(handleFileRealPath(z.getFileAddress())); } + item.setChangeTypeStr(Objects.isNull(excelExt.getChangeType())?" ":ChangeEnum.getByValue(excelExt.getChangeType()).getName()); + item.setChangeStr(Objects.isNull(excelExt.getIsChange())?"���":ChangeEnum.getByValue(excelExt.getChangeType()).getName()); item.setWriteCellDataFile(urls); + List<String> urlsAfter = new ArrayList<>(); + for(FileAddressVo z : excelExt.getFileChangeList()){ + urlsAfter.add(handleFileRealPath(z.getFileAddress())); + } + item.setWriteCellDataFileResult(urlsAfter); + item.setEscalationTimeStr(DateUtils.dateToDateString(excelExt.getEscalationTime(),DateUtils.yyyy_MM_dd_EN)); + item.setChangeTimeStr(DateUtils.dateToDateString(excelExt.getChangeTime(),DateUtils.yyyy_MM_dd_EN)); demoDataList.add(item); } try { diff --git a/screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationExcelExt.java b/screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationExcelExt.java index a73cc6d..2d0571f 100644 --- a/screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationExcelExt.java +++ b/screen-api/src/main/java/com/moral/api/pojo/ext/allocation/AllocationExcelExt.java @@ -28,10 +28,10 @@ @ApiModelProperty(value = "������������") private List<FileAddressVo> fileBaseList; - /* @ApiModelProperty(value = "������������") - private List<FileVo> fileChangeList; + @ApiModelProperty(value = "������������") + private List<FileAddressVo> fileChangeList; - @ApiModelProperty(value = "������������") + /* @ApiModelProperty(value = "������������") private List<FileVo> fileApproveList; @ApiModelProperty(value = "������������") diff --git a/screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationListExcelVo.java b/screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationListExcelVo.java index f5fefde..5238ee0 100644 --- a/screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationListExcelVo.java +++ b/screen-api/src/main/java/com/moral/api/pojo/vo/allocation/AllocationListExcelVo.java @@ -44,13 +44,26 @@ @ApiModelProperty(value = "������������") - @JsonFormat(pattern="yyyy-MM-dd") @ExcelProperty(value = "������������") - private Date escalationTime; + private String escalationTimeStr; + + @ExcelProperty(value = "������������") + private String unitName; + + @ExcelProperty(value = "������������") + private String polluteTypeName; @ApiModelProperty(value = "������������") @ExcelProperty(value = "������������") private String pollutePosition; + + @ApiModelProperty(value = "������������id") + @ExcelProperty(value = "������������") + private String changeTypeStr; + + @ApiModelProperty(value = "���������") + @ExcelProperty(value = "���������") + private String escalationName; /* @ApiModelProperty(value = "������������") private List<FileAddressVo> fileBaseList;*/ @@ -59,9 +72,25 @@ @ExcelProperty(value = "���������������",converter = MyStringImageConverterUtil.class) private List<String> writeCellDataFile; - @ApiModelProperty(value = "���������") - @ExcelProperty(value = "���������") - private String escalationName; + @ApiModelProperty(value = "������������") + @ExcelProperty(value = "������������") + private String changeStr; + + @ApiModelProperty(value = "������������") + @ExcelProperty(value = "������������") + private String changeDescribe; + + @ApiModelProperty(value = "���������������") + @ExcelProperty(value = "���������������") + private String changeName; + + @ApiModelProperty(value = "������������") + @ExcelProperty(value = "������������") + private String changeTimeStr; + + + @ExcelProperty(value = "���������������",converter = MyStringImageConverterUtil.class) + private List<String> writeCellDataFileResult; /* @ApiModelProperty(value = "������������id") private Integer unitId; diff --git a/screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java b/screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java index c7c3ebf..ec92c53 100644 --- a/screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java +++ b/screen-api/src/main/java/com/moral/api/service/impl/AllocationServiceImpl.java @@ -1003,6 +1003,7 @@ AllocationExt allocationExt = oneAllocation(i); AllocationExcelExt allocationExcelExt = BeanConverts.convert(allocationExt,AllocationExcelExt.class); allocationExcelExt.setFileBaseList(fileTableService.list(i,FileTableEnum.ALLOCATION_FOUNDATION.value,FileType.PICTURE.getValue())); + allocationExcelExt.setFileChangeList(fileTableService.list(i,FileTableEnum.ALLOCATION_RECTIFICATION.value,FileType.PICTURE.getValue())); list.add(allocationExcelExt); } return list; diff --git a/screen-api/src/main/resources/application-qa.yml b/screen-api/src/main/resources/application-qa.yml index 66a5a9f..ccec2b7 100644 --- a/screen-api/src/main/resources/application-qa.yml +++ b/screen-api/src/main/resources/application-qa.yml @@ -141,4 +141,4 @@ foh3wi2ooghiCh5 file: - path: E:/upload \ No newline at end of file + path: /data/upload/ \ No newline at end of file diff --git a/screen-api/src/main/resources/mapper/AllocationMapper.xml b/screen-api/src/main/resources/mapper/AllocationMapper.xml index 8572d20..a51cb05 100644 --- a/screen-api/src/main/resources/mapper/AllocationMapper.xml +++ b/screen-api/src/main/resources/mapper/AllocationMapper.xml @@ -43,8 +43,12 @@ <select id="extOne" resultType="com.moral.api.pojo.ext.allocation.AllocationExt"> SELECT - <include refid="Allocation_Column_List"/> + <include refid="Allocation_Column_List"/>,t1.unit_name as unitName,t5.dataValue as polluteTypeName FROM allocation allocation + left join responsibility_unit t1 on t1.unit_id = allocation.unit_id + left join (SELECT t3.dataKey,t3.dataValue FROM sys_dict_data t3 + LEFT JOIN sys_dict_type t4 on t4.id = t3.dict_type_id + where t4.name = 'contaminate') t5 on t5.dataKey = allocation.pollute_type where allocation.allocation_id = #{id} and allocation.is_del = 0 </select> -- Gitblit v1.8.0