yinzuomei 3 years ago
parent
commit
5b5161de13
  1. 12
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ExportResiUserFormDTO.java
  2. 23
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReportDataFormDTO.java
  3. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java

12
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ExportResiUserFormDTO.java

@ -11,12 +11,9 @@ import java.io.Serializable;
* @Date 2021/10/27 2:06 下午
*/
@Data
public class ExportResiUserFormDTO implements Serializable {
public class ExportResiUserFormDTO extends ReportDataFormDTO implements Serializable {
private static final long serialVersionUID = 8777535966834678256L;
/**
* 客户Id
*/
private String customerId;
/**
* 表单查询条件
*/
@ -31,11 +28,6 @@ public class ExportResiUserFormDTO implements Serializable {
*/
private IcExportTemplateSaveFormDTO exportConfig;
/**
* pageNo 报表用的
*/
private Integer pageNo = 1;
private Integer pageSize = 1000;
}

23
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ReportDataFormDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.form;
import lombok.Data;
/**
* @Description
* @Author yzm
* @Date 2022/8/17 11:13
*/
@Data
public class ReportDataFormDTO {
/**
* 客户Id
*/
private String customerId;
/**
* pageNo 报表用的
*/
private Integer pageNo = 1;
private Integer pageSize = 1000;
private String id;
}

19
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java

@ -31,6 +31,7 @@ import com.epmet.constant.IcResiUserConstant;
import com.epmet.dto.form.ExportResiUserFormDTO;
import com.epmet.dto.form.IcExportTemplateQueryFormDTO;
import com.epmet.dto.form.IcResiUserPageFormDTO;
import com.epmet.dto.form.ResiUserQueryValueDTO;
import com.epmet.dto.result.FormItemResult;
import com.epmet.dto.result.IcCustomExportResultDTO;
import com.epmet.dto.result.OptionDTO;
@ -45,6 +46,7 @@ import com.google.common.base.Joiner;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.VerticalAlignment;
@ -103,7 +105,7 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService {
ExcelWriter excelWriter = null;
WriteSheet writeSheet = null;
try {
String dynamicCustomerId=StringUtils.isNotBlank(exportResiUserFormDTO.getCustomerId()) ? exportResiUserFormDTO.getCustomerId() : tokenDto.getCustomerId()
String dynamicCustomerId=StringUtils.isNotBlank(exportResiUserFormDTO.getCustomerId()) ? exportResiUserFormDTO.getCustomerId() : tokenDto.getCustomerId();
//获取用户配置的导出条件
Result<IcCustomExportResultDTO> exportConfigResult = this.getIcCustomExportConfig(dynamicCustomerId, templateId, exportResiUserFormDTO.getExportConfig());
@ -164,6 +166,21 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService {
allShowColumns.addAll(exportConfigData.getHiddenSqlColumns());
do {
if(StringUtils.isNotBlank(exportResiUserFormDTO.getId())){
ResiUserQueryValueDTO idCondition=new ResiUserQueryValueDTO();
idCondition.setTableName("ic_resi_user");
idCondition.setQueryType("equal");
idCondition.setColumnName("ID");
idCondition.setColumnValue(Arrays.asList(exportResiUserFormDTO.getId()));
if(CollectionUtils.isNotEmpty(searchForm.getConditions())){
searchForm.getConditions().add(idCondition);
}else{
List<ResiUserQueryValueDTO> conditions=new ArrayList<>();
conditions.add(idCondition);
searchForm.setConditions(conditions);
}
}
String finalStaffOrgPath = staffOrgPath;
mapListPage = PageHelper.startPage(searchForm.getPageNo(), searchForm.getPageSize(), searchForm.getIsPage()).doSelectPage(() -> {
icResiUserService.dynamicQuery(searchForm.getCustomerId(), searchForm.getFormCode(), IcResiUserConstant.IC_RESI_USER, allShowColumns, searchForm.getConditions(), staffInfoCacheResult.getAgencyId(), finalStaffOrgPath);

Loading…
Cancel
Save