Browse Source
# Conflicts: # epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.javadev
20 changed files with 373 additions and 19 deletions
@ -0,0 +1,19 @@ |
|||||
|
/** |
||||
|
* Copyright (c) 2018 人人开源 All rights reserved. |
||||
|
* |
||||
|
* https://www.renren.io
|
||||
|
* |
||||
|
* 版权所有,侵权必究! |
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.commons.tools.validator.group; |
||||
|
|
||||
|
/** |
||||
|
* 导出 Group |
||||
|
* |
||||
|
* @author Mark sunlightcs@gmail.com |
||||
|
* @since 1.0.0 |
||||
|
*/ |
||||
|
public interface ExportGroup { |
||||
|
|
||||
|
} |
@ -0,0 +1,39 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 自定义表单导出模板 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-21 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcExportTemplateFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 模板主键 |
||||
|
*/ |
||||
|
private String tempId; |
||||
|
|
||||
|
/** |
||||
|
* 客户id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 表单CODE,从字典获取 |
||||
|
*/ |
||||
|
private String formCode; |
||||
|
|
||||
|
/** |
||||
|
* 模板名称 |
||||
|
*/ |
||||
|
private String name; |
||||
|
|
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 自定义表单导出模板配置项 for 导出时使用 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-21 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcCustomExportResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 表头 |
||||
|
*/ |
||||
|
private List<List<String>> headers = new ArrayList<>(); |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* sql中要返回的 列名 顺序跟表头顺序一致 |
||||
|
*/ |
||||
|
private List<SqlColumn> sqlColumns; |
||||
|
|
||||
|
@AllArgsConstructor |
||||
|
@Data |
||||
|
public static class SqlColumn { |
||||
|
private String tableName; |
||||
|
private String columnName; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,64 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 自定义表单导出模板配置项 for 导出时使用 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2022-04-21 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IcExportTemplateForExportResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 模板主键id |
||||
|
*/ |
||||
|
private String tempId; |
||||
|
|
||||
|
/** |
||||
|
* 父id |
||||
|
*/ |
||||
|
private String pid; |
||||
|
|
||||
|
/** |
||||
|
* 表头宽度 |
||||
|
*/ |
||||
|
private Integer width; |
||||
|
|
||||
|
/** |
||||
|
* 项标签 |
||||
|
*/ |
||||
|
private String label; |
||||
|
|
||||
|
/** |
||||
|
* 排序 |
||||
|
*/ |
||||
|
private Integer sort; |
||||
|
|
||||
|
/** |
||||
|
* 表名 |
||||
|
*/ |
||||
|
private String tableName; |
||||
|
/** |
||||
|
* 列名 |
||||
|
*/ |
||||
|
private String columnName; |
||||
|
|
||||
|
/** |
||||
|
* 子节点 |
||||
|
*/ |
||||
|
private List<IcExportTemplateForExportResultDTO> children; |
||||
|
|
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
alter table ic_form_query_builder add COLUMN VALID_TYPE VARCHAR(32) COMMENT '手机号:mobile; 身份证:id_card;只能输入数字:num' after FUN_TYPE; |
||||
|
|
||||
|
update ic_form_query_builder set VALID_TYPE=( |
||||
|
select i.VALID_TYPE from ic_form_item i where i.id=FORM_ITEM_ID |
||||
|
and i.CUSTOMER_ID=CUSTOMER_ID |
||||
|
)where DEL_FLAG='0'; |
@ -0,0 +1,24 @@ |
|||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.dto.form.IcResiUserPageFormDTO; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
|
||||
|
/** |
||||
|
*@Description 居民信息导出service |
||||
|
*@Author wangxianzhang |
||||
|
*@Date 2021/11/4 |
||||
|
*/ |
||||
|
public interface IcResiUserExportService { |
||||
|
|
||||
|
/** |
||||
|
* desc: 根据条件查询居民信息并根据配置模板导出 |
||||
|
* |
||||
|
* @param pageFormDTO |
||||
|
* @param response |
||||
|
* @return void |
||||
|
* @author LiuJanJun |
||||
|
* @date 2022/4/22 1:35 下午 |
||||
|
*/ |
||||
|
void exportIcResiUser(IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response); |
||||
|
} |
@ -0,0 +1,48 @@ |
|||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.epmet.commons.tools.security.user.LoginUserUtil; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dto.form.IcExportTemplateFormDTO; |
||||
|
import com.epmet.dto.form.IcResiUserPageFormDTO; |
||||
|
import com.epmet.dto.result.IcCustomExportResultDTO; |
||||
|
import com.epmet.feign.OperCustomizeOpenFeignClient; |
||||
|
import com.epmet.service.IcResiUserExportService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
|
||||
|
/** |
||||
|
* desc: |
||||
|
* |
||||
|
* @author: LiuJanJun |
||||
|
* @date: 2022/4/22 1:36 下午 |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class IcResiUserExportServiceImpl implements IcResiUserExportService { |
||||
|
@Autowired |
||||
|
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; |
||||
|
@Autowired |
||||
|
private LoginUserUtil loginUserUtil; |
||||
|
/** |
||||
|
* desc: 根据条件查询居民信息并根据配置模板导出 |
||||
|
* |
||||
|
* @param pageFormDTO |
||||
|
* @param response |
||||
|
* @return void |
||||
|
* @author LiuJanJun |
||||
|
* @date 2022/4/22 1:35 下午 |
||||
|
*/ |
||||
|
@Override |
||||
|
public void exportIcResiUser(IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) { |
||||
|
//获取模板条件
|
||||
|
IcExportTemplateFormDTO param = new IcExportTemplateFormDTO(); |
||||
|
param.setCustomerId(loginUserUtil.getLoginUserCustomerId()); |
||||
|
param.setTempId(pageFormDTO.getTemplateId()); |
||||
|
Result<IcCustomExportResultDTO> exportConfigResult = operCustomizeOpenFeignClient.getExcelHeaderAndSqlColumnForExport(param); |
||||
|
|
||||
|
} |
||||
|
} |
Loading…
Reference in new issue