Browse Source
# Conflicts: # epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xmlmaster
63 changed files with 3507 additions and 27 deletions
@ -0,0 +1,29 @@ |
|||
package com.epmet.commons.tools.utils; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.UnsupportedEncodingException; |
|||
import java.net.URLEncoder; |
|||
|
|||
/** |
|||
* @Description 文件下载工具类 |
|||
* @Author wangxianzhang |
|||
* @Time 2023/5/25 2:23 PM |
|||
*/ |
|||
public class FileDownloadHelper { |
|||
|
|||
/** |
|||
* @Description: 为下载xlsx文件设置response |
|||
* @param response: |
|||
* @param fileName: |
|||
* @Return void |
|||
* @Author: wangxianzhang |
|||
* @Date: 2023/5/25 2:23 PM |
|||
*/ |
|||
public static void setResponseForXlsx(HttpServletResponse response, String fileName) throws UnsupportedEncodingException { |
|||
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); |
|||
response.setHeader("content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
|||
// response.setHeader("content-Type", "application/vnd.ms-excel");
|
|||
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(fileName, "UTF-8")); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
package com.epmet.enums; |
|||
|
|||
/** |
|||
* @Description 灵山重点帮扶人员通用枚举 |
|||
* @Author wangxianzhang |
|||
* @Time 2023/5/18 3:25 PM |
|||
*/ |
|||
public enum LingShanHelpCrowdCommonEnums { |
|||
HJLX_NC(100, "农村户籍"), |
|||
|
|||
HJLX_CZ(101, "城镇户籍"), |
|||
|
|||
DBLX_NC(200, "农村低保"), |
|||
|
|||
DBLX_CZ(201, "城镇低保"), |
|||
|
|||
LDNL_NO(300, "有劳动能力"), |
|||
|
|||
LDNL_BFSS(301, "部分丧失劳动能力"), |
|||
|
|||
LDNL_WQSS(302, "完全丧失劳动能力"), |
|||
|
|||
JKZK_YB(400, "一般或较弱"), |
|||
|
|||
JKZK_LH(401, "健康或良好"), |
|||
|
|||
CBLX_CX(500, "城乡居民基本医疗保险"), |
|||
|
|||
CBLX_ZG(501, "职工医疗保险"), |
|||
|
|||
CBLX_NH(502, "新型农村合作医疗"), |
|||
|
|||
JZJJSFS_QT(600, "其他"), |
|||
|
|||
JZJJSFS_BC(601, "补差"), |
|||
|
|||
ZLQK_BUZL(700, "不能自理"), |
|||
|
|||
ZLQK_NGZL(701, "能够自理"), |
|||
|
|||
SHZLNL_JB(800, "具备生活自理能力"), |
|||
|
|||
SHZLNL_BFSS(801, "部分丧失生活能力"), |
|||
|
|||
SHZLNL_WQSS(802, "完全丧失生活自理能力"), |
|||
|
|||
GYFS_JZGY(900, "集中供养"), |
|||
|
|||
GYFS_FSGY(901, "分散供养"), |
|||
JZZK_KC(1000, "空巢"), |
|||
JZZK_DU(1001, "独居"); |
|||
|
|||
private int code; |
|||
private String name; |
|||
|
|||
LingShanHelpCrowdCommonEnums(int code, String name) { |
|||
this.code = code; |
|||
this.name = name; |
|||
} |
|||
|
|||
public static LingShanHelpCrowdCommonEnums getByCode(int code) { |
|||
for (LingShanHelpCrowdCommonEnums value : LingShanHelpCrowdCommonEnums.values()) { |
|||
if (value.code == code) { |
|||
return value; |
|||
} |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
|
|||
public static LingShanHelpCrowdCommonEnums getByName(String name) { |
|||
for (LingShanHelpCrowdCommonEnums value : LingShanHelpCrowdCommonEnums.values()) { |
|||
if (value.name.equals(name)) { |
|||
return value; |
|||
} |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
|
|||
public int getCode() { |
|||
return code; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.epmet.bean; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.util.Objects; |
|||
|
|||
@Data |
|||
@AllArgsConstructor |
|||
@NoArgsConstructor |
|||
public class PersonHelpTypeBean { |
|||
private String resiId; |
|||
private String idCard; |
|||
|
|||
private String helpCrowdType; |
|||
|
|||
private String orgIdPath; |
|||
|
|||
@Override |
|||
public boolean equals(Object o) { |
|||
if (this == o) |
|||
return true; |
|||
if (o == null || getClass() != o.getClass()) |
|||
return false; |
|||
PersonHelpTypeBean that = (PersonHelpTypeBean) o; |
|||
return Objects.equals(resiId, that.resiId) && Objects.equals(helpCrowdType, that.helpCrowdType); |
|||
} |
|||
|
|||
@Override |
|||
public int hashCode() { |
|||
return Objects.hash(resiId, helpCrowdType); |
|||
} |
|||
} |
|||
@ -0,0 +1,120 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.exception.ExceptionUtils; |
|||
import com.epmet.commons.tools.utils.DateUtils; |
|||
import com.epmet.commons.tools.utils.FileDownloadHelper; |
|||
import com.epmet.commons.tools.utils.FileUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.enums.LingShanHelpCrowdTypeEnum; |
|||
import com.epmet.service.LingShanHelpCrowdService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.io.IOUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.web.multipart.MultipartFile; |
|||
|
|||
import javax.servlet.ServletOutputStream; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.FileOutputStream; |
|||
import java.io.IOException; |
|||
import java.io.InputStream; |
|||
import java.io.UnsupportedEncodingException; |
|||
import java.nio.file.Path; |
|||
import java.util.Date; |
|||
|
|||
@Slf4j |
|||
@RestController |
|||
@RequestMapping("lingShan/helpCrowd") |
|||
public class LingShanHelpCrowdController { |
|||
|
|||
@Autowired |
|||
private LingShanHelpCrowdService helpCrowdService; |
|||
|
|||
/** |
|||
* @Description: 导入重点帮扶人群 |
|||
* @param file: |
|||
* @param crowdType: |
|||
* @Return com.epmet.commons.tools.utils.Result |
|||
* @Author: wangxianzhang |
|||
* @Date: 2023/5/25 2:13 PM |
|||
*/ |
|||
@PostMapping("import") |
|||
public Result importExcel(@RequestBody MultipartFile file, @RequestParam("crowdType") String crowdType) { |
|||
|
|||
String originalFilename = file.getOriginalFilename(); |
|||
String suffix = originalFilename.substring(originalFilename.lastIndexOf(".")); |
|||
|
|||
// 1.存文件
|
|||
Path fileSavePath = saveHelpCrowdTempFile(file, suffix); |
|||
|
|||
// 2.执行业务导入
|
|||
try { |
|||
String taskId = helpCrowdService.importHelpCrowd(crowdType, fileSavePath.toString(), originalFilename); |
|||
return new Result().ok(taskId); |
|||
} catch (Exception e) { |
|||
// 3.出错的话,删除文件。不能在finally中删除,因为正常执行的话,是在异步线程中执行导入,这里删除了,那子线程就获取不到文件了,所以子线程中有单独的删除逻辑
|
|||
FileUtils.deleteFileIfExists(fileSavePath); |
|||
throw e; |
|||
} |
|||
|
|||
} |
|||
|
|||
/** |
|||
* @Description: 保存临时文件 |
|||
* @param file: |
|||
* @param suffix: |
|||
* @Return java.nio.file.Path |
|||
* @Author: wangxianzhang |
|||
* @Date: 2023/5/25 2:14 PM |
|||
*/ |
|||
public Path saveHelpCrowdTempFile(@RequestParam("file") MultipartFile file, String suffix) { |
|||
Path fileSavePath; |
|||
FileOutputStream os = null; |
|||
try { |
|||
Path fileSaveDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("help_crowd_import"); |
|||
String fileName = DateUtils.format(new Date(), "yyyyMMdd_HHmmss_" + System.nanoTime()) + suffix; |
|||
fileSavePath = fileSaveDir.resolve(fileName); |
|||
IOUtils.copy(file.getInputStream(), (os = new FileOutputStream(fileSavePath.toString()))); |
|||
return fileSavePath; |
|||
} catch ( |
|||
IOException e) { |
|||
log.error("【灵山街道】导入重点帮扶数据,缓存文件失败。"); |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, null); |
|||
} finally { |
|||
org.apache.poi.util.IOUtils.closeQuietly(os); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @Description: 下载导入模板 |
|||
* @param helpType: |
|||
* @Return void |
|||
* @Author: wangxianzhang |
|||
* @Date: 2023/5/25 2:17 PM |
|||
*/ |
|||
@GetMapping("downloadTemplate") |
|||
public void downloadTemplate(@RequestParam("helpType") String helpType, HttpServletResponse response) { |
|||
|
|||
LingShanHelpCrowdTypeEnum typeEnum; |
|||
|
|||
if ((typeEnum = LingShanHelpCrowdTypeEnum.getByType(helpType)) == null ) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【重点帮扶人群】下载模板:指定的类型不正确:" + helpType); |
|||
} |
|||
|
|||
try (ServletOutputStream os = response.getOutputStream()){ |
|||
FileDownloadHelper.setResponseForXlsx(response, "重点帮扶人群导入模板-" + typeEnum.getName() + ".xlsx"); |
|||
|
|||
InputStream is = getClass().getClassLoader().getResourceAsStream("lingshan_help_crowd_" + helpType + "_import.xlsx"); |
|||
IOUtils.copy(is, os); |
|||
} catch (IOException e) { |
|||
log.error("【重点帮扶人群】下载导入模板出错:" + ExceptionUtils.getErrorStackTrace(e)); |
|||
throw new EpmetException(null); |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.LingshanHelpCrowdCanjiEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 重点帮扶-残疾人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Mapper |
|||
public interface LingshanHelpCrowdCanjiDao extends BaseDao<LingshanHelpCrowdCanjiEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.LingshanHelpCrowdDabingEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 重点帮扶-大病 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Mapper |
|||
public interface LingshanHelpCrowdDabingDao extends BaseDao<LingshanHelpCrowdDabingEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.LingshanHelpCrowdDibaoEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 重点帮扶-低保 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Mapper |
|||
public interface LingshanHelpCrowdDibaoDao extends BaseDao<LingshanHelpCrowdDibaoEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.LingshanHelpCrowdDujuEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 重点帮扶-独居老人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Mapper |
|||
public interface LingshanHelpCrowdDujuDao extends BaseDao<LingshanHelpCrowdDujuEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.LingshanHelpCrowdGaolingEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 重点帮扶-高龄老人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Mapper |
|||
public interface LingshanHelpCrowdGaolingDao extends BaseDao<LingshanHelpCrowdGaolingEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.LingshanHelpCrowdKongchaoEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 重点帮扶-空巢老人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Mapper |
|||
public interface LingshanHelpCrowdKongchaoDao extends BaseDao<LingshanHelpCrowdKongchaoEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.LingshanHelpCrowdLiushouEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 重点帮扶-留守儿童 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Mapper |
|||
public interface LingshanHelpCrowdLiushouDao extends BaseDao<LingshanHelpCrowdLiushouEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.LingshanHelpCrowdResiMergeEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 居民-重点帮扶人群对应关系 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-22 |
|||
*/ |
|||
@Mapper |
|||
public interface LingshanHelpCrowdResiMergeDao extends BaseDao<LingshanHelpCrowdResiMergeEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.LingshanHelpCrowdTekunEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 重点帮扶-特困人员 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Mapper |
|||
public interface LingshanHelpCrowdTekunDao extends BaseDao<LingshanHelpCrowdTekunEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 重点帮扶-基础entity |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
public class LingshanHelpCrowdBaseEntity extends BaseEpmetEntity { |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* org id路径,:分割 |
|||
*/ |
|||
private String orgIdPath; |
|||
|
|||
/** |
|||
* 居民id |
|||
*/ |
|||
private String resiId; |
|||
|
|||
/** |
|||
* 证件号 |
|||
*/ |
|||
private String idCard; |
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 重点帮扶-残疾人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("lingshan_help_crowd_canji") |
|||
public class LingshanHelpCrowdCanjiEntity extends LingshanHelpCrowdBaseEntity { |
|||
|
|||
/** |
|||
* 残疾证号 |
|||
*/ |
|||
private String cjzh; |
|||
|
|||
/** |
|||
* 残疾类别 |
|||
*/ |
|||
private String cjlb; |
|||
|
|||
/** |
|||
* 残疾登记(状况) |
|||
*/ |
|||
private String cjzk; |
|||
|
|||
/** |
|||
* 有效期开始时间 |
|||
*/ |
|||
private Date validityStart; |
|||
|
|||
/** |
|||
* 是否在世。0否,1是 |
|||
*/ |
|||
private Integer living; |
|||
|
|||
/** |
|||
* 去世时间 |
|||
*/ |
|||
private Date dieDate; |
|||
|
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 重点帮扶-大病 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("lingshan_help_crowd_dabing") |
|||
public class LingshanHelpCrowdDabingEntity extends LingshanHelpCrowdBaseEntity { |
|||
|
|||
/** |
|||
* 所患病种(大病) |
|||
*/ |
|||
private String shbz; |
|||
|
|||
/** |
|||
* 患病时间 |
|||
*/ |
|||
private Date hbsj; |
|||
|
|||
/** |
|||
* 救助情况 |
|||
*/ |
|||
private String jzqk; |
|||
|
|||
/** |
|||
* 救助金额(元) |
|||
*/ |
|||
private Integer jzje; |
|||
|
|||
/** |
|||
* 个人负担(元) |
|||
*/ |
|||
private Integer grfd; |
|||
|
|||
} |
|||
@ -0,0 +1,116 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 重点帮扶-低保 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("lingshan_help_crowd_dibao") |
|||
public class LingshanHelpCrowdDibaoEntity extends LingshanHelpCrowdBaseEntity { |
|||
|
|||
/** |
|||
* 户籍类型。100农村户籍,101城镇户籍 |
|||
*/ |
|||
private Integer hjlx; |
|||
|
|||
/** |
|||
* 低保类型。200农村低保,201城镇低保 |
|||
*/ |
|||
private Integer dblx; |
|||
|
|||
/** |
|||
* 低保(特困)证号 |
|||
*/ |
|||
private String dbzh; |
|||
|
|||
/** |
|||
* 婚姻状况(字典) |
|||
*/ |
|||
private String hyzk; |
|||
|
|||
/** |
|||
* 就业情况(字典) |
|||
*/ |
|||
private String jyqk; |
|||
|
|||
/** |
|||
* 年收入 |
|||
*/ |
|||
private Integer nsr; |
|||
|
|||
/** |
|||
* 是否残疾【是:1 否:0】 |
|||
*/ |
|||
private Integer isCj; |
|||
|
|||
/** |
|||
* 是否有劳动能力。【300:有劳动能力,301:部分丧失劳动能力,302:完全丧失劳动能力】 |
|||
*/ |
|||
private Integer ynLdnl; |
|||
|
|||
/** |
|||
* 健康状况【400:一般或较弱,401:健康或良好】 |
|||
*/ |
|||
private Integer jkzk; |
|||
|
|||
/** |
|||
* 所患病种 |
|||
*/ |
|||
private String shbz; |
|||
|
|||
/** |
|||
* 参保类型【500城乡居民基本医疗保险,501职工医疗保险,502新型农村合作医疗】 |
|||
*/ |
|||
private Integer cblx; |
|||
|
|||
/** |
|||
* 最初享受月份 |
|||
*/ |
|||
private Date zcxsyf; |
|||
|
|||
/** |
|||
* 是否建档立卡扶贫对象。0否,1是 |
|||
*/ |
|||
private Integer jdlkfpdx; |
|||
|
|||
/** |
|||
* 开户银行 |
|||
*/ |
|||
private String khyh; |
|||
|
|||
/** |
|||
* 户头名称 |
|||
*/ |
|||
private String htmc; |
|||
|
|||
/** |
|||
* 银行账号(一本通账号) |
|||
*/ |
|||
private String yhzh; |
|||
|
|||
/** |
|||
* 户月保障金额(元) |
|||
*/ |
|||
private BigDecimal hybzje; |
|||
|
|||
/** |
|||
* 人员附加政策(元) |
|||
*/ |
|||
private BigDecimal ryfjzc; |
|||
|
|||
/** |
|||
* 救助金计算方式【600其他,601补差】 |
|||
*/ |
|||
private Integer jzjjsfs; |
|||
|
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 重点帮扶-独居老人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("lingshan_help_crowd_duju") |
|||
public class LingshanHelpCrowdDujuEntity extends LingshanHelpCrowdBaseEntity { |
|||
|
|||
/** |
|||
* 监护人姓名 |
|||
*/ |
|||
private String jhrxm; |
|||
|
|||
/** |
|||
* 监护人电话 |
|||
*/ |
|||
private String jhrdh; |
|||
|
|||
/** |
|||
* 监护人与老人关系 |
|||
*/ |
|||
private String jhrylrgx; |
|||
|
|||
/** |
|||
* 健康状况【400:一般或较弱,401:健康或良好】 |
|||
*/ |
|||
private Integer jkzk; |
|||
|
|||
/** |
|||
* 子女探视间隔时间 |
|||
*/ |
|||
private String tsjg; |
|||
|
|||
/** |
|||
* 帮扶及其他情况说明 |
|||
*/ |
|||
private String remark; |
|||
|
|||
} |
|||
@ -0,0 +1,55 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 重点帮扶-高龄老人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("lingshan_help_crowd_gaoling") |
|||
public class LingshanHelpCrowdGaolingEntity extends LingshanHelpCrowdBaseEntity { |
|||
|
|||
/** |
|||
* 银行卡号 |
|||
*/ |
|||
private String yhzh; |
|||
|
|||
/** |
|||
* 津贴金额(元) |
|||
*/ |
|||
private BigDecimal jtje; |
|||
|
|||
/** |
|||
* 津贴发放情况说明 |
|||
*/ |
|||
private String ffqk; |
|||
|
|||
/** |
|||
* 自理情况【700不能自理,701能够自理】 |
|||
*/ |
|||
private Integer zlqk; |
|||
|
|||
/** |
|||
* 监护人姓名 |
|||
*/ |
|||
private String jhrxm; |
|||
|
|||
/** |
|||
* 监护人电话 |
|||
*/ |
|||
private String jhrdh; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
private String remark; |
|||
|
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 重点帮扶-空巢老人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("lingshan_help_crowd_kongchao") |
|||
public class LingshanHelpCrowdKongchaoEntity extends LingshanHelpCrowdBaseEntity { |
|||
|
|||
/** |
|||
* 监护人姓名 |
|||
*/ |
|||
private String jhrxm; |
|||
|
|||
/** |
|||
* 监护人电话 |
|||
*/ |
|||
private String jhrdh; |
|||
|
|||
/** |
|||
* 监护人与老人关系 |
|||
*/ |
|||
private String jhrylrgx; |
|||
|
|||
/** |
|||
* 健康状况【400:一般或较弱,401:健康或良好】 |
|||
*/ |
|||
private Integer jkzk; |
|||
|
|||
/** |
|||
* 子女探视间隔时间 |
|||
*/ |
|||
private String tsjg; |
|||
|
|||
/** |
|||
* 帮扶及其他情况说明 |
|||
*/ |
|||
private String remark; |
|||
|
|||
} |
|||
@ -0,0 +1,53 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 重点帮扶-留守儿童 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("lingshan_help_crowd_liushou") |
|||
public class LingshanHelpCrowdLiushouEntity extends LingshanHelpCrowdBaseEntity { |
|||
|
|||
/** |
|||
* 监护人姓名 |
|||
*/ |
|||
private String jhrxm; |
|||
|
|||
/** |
|||
* 监护人电话 |
|||
*/ |
|||
private String jhrdh; |
|||
|
|||
/** |
|||
* 与监护人关系 |
|||
*/ |
|||
private String yjhrgx; |
|||
|
|||
/** |
|||
* 所在学校及班级 |
|||
*/ |
|||
private String szxxjbj; |
|||
|
|||
/** |
|||
* 班主任姓名 |
|||
*/ |
|||
private String bzrxm; |
|||
|
|||
/** |
|||
* 班主任电话 |
|||
*/ |
|||
private String bzrdh; |
|||
|
|||
/** |
|||
* 帮扶情况及其他说明 |
|||
*/ |
|||
private String remark; |
|||
|
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.FieldFill; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 居民-重点帮扶人群对应关系 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-22 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("lingshan_help_crowd_resi_merge") |
|||
public class LingshanHelpCrowdResiMergeEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String customerId; |
|||
|
|||
/** |
|||
* org id路径,:分割 |
|||
*/ |
|||
private String orgIdPath; |
|||
|
|||
/** |
|||
* 居民id |
|||
*/ |
|||
private String resiId; |
|||
|
|||
/** |
|||
* 证件号 |
|||
*/ |
|||
private String idCard; |
|||
|
|||
/** |
|||
* 人员类别。【canji残疾人,dabing大病,dibao低保,gaoling高龄老人,kongchao空巢老人,duju独居老人,liushou留守儿童, tekun特困人员】 |
|||
*/ |
|||
private String crowdType; |
|||
|
|||
} |
|||
@ -0,0 +1,116 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 重点帮扶-特困人员 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("lingshan_help_crowd_tekun") |
|||
public class LingshanHelpCrowdTekunEntity extends LingshanHelpCrowdBaseEntity { |
|||
|
|||
/** |
|||
* 户籍类型。100农村户籍,101城镇户籍 |
|||
*/ |
|||
private Integer hjlx; |
|||
|
|||
/** |
|||
* 低保(特困)证号 |
|||
*/ |
|||
private String dbzh; |
|||
|
|||
/** |
|||
* 婚姻状况(字典) |
|||
*/ |
|||
private String hyzk; |
|||
|
|||
/** |
|||
* 就业情况(字典) |
|||
*/ |
|||
private String jyqk; |
|||
|
|||
/** |
|||
* 年收入 |
|||
*/ |
|||
private Integer nsr; |
|||
|
|||
/** |
|||
* 是否残疾【是:1 否:0】 |
|||
*/ |
|||
private Integer isCj; |
|||
|
|||
/** |
|||
* 生活自理能力。800具备生活自理能力,801部分丧失生活能力,802完全丧失生活自理能力 |
|||
*/ |
|||
private Integer shzlnl; |
|||
|
|||
/** |
|||
* 健康状况【400:一般或较弱,401:健康或良好】 |
|||
*/ |
|||
private Integer jkzk; |
|||
|
|||
/** |
|||
* 所患病种 |
|||
*/ |
|||
private String shbz; |
|||
|
|||
/** |
|||
* 参保类型【500城乡居民基本医疗保险,501职工医疗保险,502新型农村合作医疗】 |
|||
*/ |
|||
private Integer cblx; |
|||
|
|||
/** |
|||
* 最初享受月份 |
|||
*/ |
|||
private Date zcxsyf; |
|||
|
|||
/** |
|||
* 是否建档立卡扶贫对象。0否,1是 |
|||
*/ |
|||
private Integer jdlkfpdx; |
|||
|
|||
/** |
|||
* 开户银行 |
|||
*/ |
|||
private String khyh; |
|||
|
|||
/** |
|||
* 户头名称 |
|||
*/ |
|||
private String htmc; |
|||
|
|||
/** |
|||
* 银行账号(一本通账号) |
|||
*/ |
|||
private String yhzh; |
|||
|
|||
/** |
|||
* 供养方式。900集中供养,901分散供养 |
|||
*/ |
|||
private Integer gyfs; |
|||
|
|||
/** |
|||
* 供养机构名称 |
|||
*/ |
|||
private String gyjgmc; |
|||
|
|||
/** |
|||
* 基本生活标准(元) |
|||
*/ |
|||
private BigDecimal jbshbz; |
|||
|
|||
/** |
|||
* 照料护理费用(元) |
|||
*/ |
|||
private BigDecimal zlhlfy; |
|||
|
|||
} |
|||
@ -0,0 +1,157 @@ |
|||
package com.epmet.excel.converter; |
|||
|
|||
import com.alibaba.excel.converters.Converter; |
|||
import com.alibaba.excel.enums.CellDataTypeEnum; |
|||
import com.alibaba.excel.metadata.GlobalConfiguration; |
|||
import com.alibaba.excel.metadata.data.ReadCellData; |
|||
import com.alibaba.excel.metadata.data.WriteCellData; |
|||
import com.alibaba.excel.metadata.property.ExcelContentProperty; |
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.feign.ResultDataResolver; |
|||
import com.epmet.commons.tools.utils.SpringContextUtils; |
|||
import com.epmet.enums.LingShanHelpCrowdCommonEnums; |
|||
import com.epmet.feign.EpmetAdminOpenFeignClient; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
public class LingShanHelpCrowdExcelConverter implements Converter<Object> , ResultDataResolver { |
|||
|
|||
// 残疾类别,婚姻状况,就业情况,残疾等级,从字典查询
|
|||
public static final List<String> DICT_COLUMNS = Arrays.asList("cjlb", "hyzk", "jyqk", "cjzk"); |
|||
|
|||
private EpmetAdminOpenFeignClient adminOpenFeignClient; |
|||
|
|||
{ |
|||
adminOpenFeignClient = SpringContextUtils.getBean(EpmetAdminOpenFeignClient.class); |
|||
} |
|||
|
|||
@Override |
|||
public CellDataTypeEnum supportExcelTypeKey() { |
|||
return CellDataTypeEnum.STRING; |
|||
} |
|||
|
|||
@Override |
|||
public Class<?> supportJavaTypeKey() { |
|||
return Integer.class; |
|||
} |
|||
|
|||
/** |
|||
* @Description: 将label转化为字典值 |
|||
* @param cellData: |
|||
* @param contentProperty: |
|||
* @param globalConfiguration: |
|||
* @Return java.lang.Integer |
|||
* @Author: wangxianzhang |
|||
* @Date: 2023/5/18 4:40 PM |
|||
*/ |
|||
@Override |
|||
public Object convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
|||
String fieldName = contentProperty.getField().getName(); |
|||
String value = cellData.getStringValue(); |
|||
|
|||
if (DICT_COLUMNS.contains(fieldName)) { |
|||
// 是字典,查字典
|
|||
String dictValue = getValueFromDict(fieldName, value); |
|||
return dictValue; |
|||
} |
|||
|
|||
// 不是字典,那么遍历枚举
|
|||
LingShanHelpCrowdCommonEnums enumObj = LingShanHelpCrowdCommonEnums.getByName(value); |
|||
if (enumObj == null) { |
|||
return null; |
|||
} else { |
|||
return enumObj.getCode(); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @Description: 将字典值转化为label |
|||
* @param value: |
|||
* @param contentProperty: |
|||
* @param globalConfiguration: |
|||
* @Return com.alibaba.excel.metadata.data.WriteCellData<?> |
|||
* @Author: wangxianzhang |
|||
* @Date: 2023/5/18 4:40 PM |
|||
*/ |
|||
@Override |
|||
public WriteCellData<?> convertToExcelData(Object value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
|||
|
|||
String fieldName = contentProperty.getField().getName(); |
|||
|
|||
if (DICT_COLUMNS.contains(fieldName)) { |
|||
// 是字典,查字典
|
|||
if (value == null) { |
|||
return null; |
|||
} |
|||
String dictLabel = getLabelFromDict(fieldName, value.toString()); |
|||
return new WriteCellData<>(dictLabel); |
|||
} |
|||
|
|||
// 不是字典,那么遍历枚举
|
|||
LingShanHelpCrowdCommonEnums enumObj = LingShanHelpCrowdCommonEnums.getByCode(Integer.valueOf(value.toString())); |
|||
if (enumObj == null) { |
|||
return null; |
|||
} else { |
|||
return new WriteCellData<>(enumObj.getName()); |
|||
} |
|||
} |
|||
|
|||
private String getDictTypeFromFieldName(String fieldName) { |
|||
String dictType; |
|||
if ("cjlb".equals(fieldName)) { |
|||
dictType = "disability_category_code"; |
|||
} else if ("cjzk".equals(fieldName)) { |
|||
dictType = "disability_level"; |
|||
} else if("hyzk".equals(fieldName)) { |
|||
dictType = "marriage"; |
|||
} else if ("jyqk".equals(fieldName)) { |
|||
dictType = "job"; |
|||
} else { |
|||
logger.error("【灵山-重点帮扶】导入:未找到对应的字典类型,fieldName:" + fieldName); |
|||
return null; |
|||
} |
|||
|
|||
return dictType; |
|||
} |
|||
|
|||
/** |
|||
* @Description: 根据值获取label |
|||
* @param fieldName: |
|||
* @param value: |
|||
* @Return java.lang.String |
|||
* @Author: wangxianzhang |
|||
* @Date: 2023/5/18 4:36 PM |
|||
*/ |
|||
private String getLabelFromDict(String fieldName, String value) { |
|||
Map<String, String> dictMap; |
|||
String dictType = getDictTypeFromFieldName(fieldName); |
|||
dictMap = getResultDataOrReturnNull(adminOpenFeignClient.dictMap(dictType), ServiceConstant.EPMET_ADMIN_SERVER); |
|||
|
|||
return dictMap.get(value); |
|||
} |
|||
|
|||
/** |
|||
* @Description: 从字典,根据label查找值 |
|||
* @param fieldName: |
|||
* @param label: |
|||
* @Return java.lang.String |
|||
* @Author: wangxianzhang |
|||
* @Date: 2023/5/18 4:36 PM |
|||
*/ |
|||
private String getValueFromDict(String fieldName, String label) { |
|||
Map<String, String> dictMap; |
|||
String dictType = getDictTypeFromFieldName(fieldName); |
|||
|
|||
dictMap = getResultDataOrReturnNull(adminOpenFeignClient.dictMap(dictType), ServiceConstant.EPMET_ADMIN_SERVER); |
|||
|
|||
for (Map.Entry<String, String> entry : dictMap.entrySet()) { |
|||
if (entry.getValue().equals(label)) { |
|||
return entry.getKey(); |
|||
} |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelIgnore; |
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
@Data |
|||
public class LingShanHelpCrowdBaseExcelData { |
|||
/** |
|||
* 姓名 |
|||
*/ |
|||
@ExcelProperty(value = "*姓名") |
|||
@NotBlank(message = "姓名不能为空") |
|||
private String name; |
|||
/** |
|||
* 证件号 |
|||
*/ |
|||
@ExcelProperty(value = "*身份证号") |
|||
@NotBlank(message = "身份证号不能为空") |
|||
private String idCard; |
|||
|
|||
/** |
|||
* 错误信息 |
|||
*/ |
|||
@ExcelProperty(value = "错误信息") |
|||
private String errorInfo; |
|||
|
|||
/** |
|||
* 居民id |
|||
*/ |
|||
@ExcelIgnore |
|||
private String resiId; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
@ExcelIgnore |
|||
private String resiGridId; |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.alibaba.excel.annotation.format.DateTimeFormat; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import com.epmet.excel.converter.LingShanHelpCrowdExcelConverter; |
|||
import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 重点帮扶-残疾人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
public class LingshanHelpCrowdCanjiExcelData extends LingShanHelpCrowdBaseExcelData { |
|||
|
|||
/** |
|||
* 残疾证号 |
|||
*/ |
|||
@ExcelProperty(value = "*残疾证号") |
|||
private String cjzh; |
|||
|
|||
/** |
|||
* 残疾类别,字典 |
|||
*/ |
|||
@ExcelProperty(value = "*残疾类型", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private String cjlb; |
|||
|
|||
/** |
|||
* 残疾登记(状况) 字典 |
|||
*/ |
|||
@ExcelProperty(value = "*残疾等级", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private String cjzk; |
|||
|
|||
/** |
|||
* 有效期开始时间 |
|||
*/ |
|||
@ExcelProperty(value = "有效期开始时间") |
|||
@DateTimeFormat("yyyy/MM/dd") |
|||
private Date validityStart; |
|||
|
|||
/** |
|||
* 是否在世。0否,1是 |
|||
*/ |
|||
@ExcelProperty(value = "是否在世", converter = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer living; |
|||
|
|||
/** |
|||
* 去世时间 |
|||
*/ |
|||
@ExcelProperty(value = "去世时间") |
|||
@DateTimeFormat("yyyy/MM/dd") |
|||
private Date dieDate; |
|||
|
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 重点帮扶-大病 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
public class LingshanHelpCrowdDabingExcelData extends LingShanHelpCrowdBaseExcelData { |
|||
|
|||
/** |
|||
* 所患病种(大病) |
|||
*/ |
|||
@ExcelProperty(value = "*患病病种") |
|||
private String shbz; |
|||
|
|||
/** |
|||
* 患病时间 |
|||
*/ |
|||
@ExcelProperty(value = "*患病时间") |
|||
private Date hbsj; |
|||
|
|||
/** |
|||
* 救助情况 |
|||
*/ |
|||
@ExcelProperty(value = "救助情况说明") |
|||
private String jzqk; |
|||
|
|||
/** |
|||
* 救助金额(元) |
|||
*/ |
|||
@ExcelProperty(value = "救助金额(元)") |
|||
private Integer jzje; |
|||
|
|||
/** |
|||
* 个人负担(元) |
|||
*/ |
|||
@ExcelProperty(value = "个人负担(元)") |
|||
private Integer grfd; |
|||
|
|||
} |
|||
@ -0,0 +1,137 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import com.epmet.excel.converter.LingShanHelpCrowdExcelConverter; |
|||
import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 重点帮扶-低保 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
public class LingshanHelpCrowdDibaoExcelData extends LingShanHelpCrowdBaseExcelData { |
|||
|
|||
/** |
|||
* 户籍类型。100农村户籍,101城镇户籍 |
|||
*/ |
|||
@ExcelProperty(value = "户籍类型", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private Integer hjlx; |
|||
|
|||
/** |
|||
* 低保类型。200农村低保,201城镇低保 |
|||
*/ |
|||
@ExcelProperty(value = "*低保类型", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private Integer dblx; |
|||
|
|||
/** |
|||
* 低保(特困)证号 |
|||
*/ |
|||
@ExcelProperty(value = "*低保(特困)证号") |
|||
private String dbzh; |
|||
|
|||
/** |
|||
* 婚姻状况(字典) |
|||
*/ |
|||
@ExcelProperty(value = "婚姻状况", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private String hyzk; |
|||
|
|||
/** |
|||
* 就业情况(字典) |
|||
*/ |
|||
@ExcelProperty(value = "就业情况", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private String jyqk; |
|||
|
|||
/** |
|||
* 年收入 |
|||
*/ |
|||
@ExcelProperty(value = "年收入(元)") |
|||
private Integer nsr; |
|||
|
|||
/** |
|||
* 是否残疾【是:1 否:0】 |
|||
*/ |
|||
@ExcelProperty(value = "是否残疾人", converter = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer isCj; |
|||
|
|||
/** |
|||
* 是否有劳动能力。【300:有劳动能力,301:部分丧失劳动能力,302:完全丧失劳动能力】 |
|||
*/ |
|||
@ExcelProperty(value = "劳动能力", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private Integer ynLdnl; |
|||
|
|||
/** |
|||
* 健康状况【400:一般或较弱,401:健康或良好】 |
|||
*/ |
|||
@ExcelProperty(value = "健康状况", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private Integer jkzk; |
|||
|
|||
/** |
|||
* 所患病种 |
|||
*/ |
|||
@ExcelProperty(value = "患病病种") |
|||
private String shbz; |
|||
|
|||
/** |
|||
* 参保类型【500城乡居民基本医疗保险,501职工医疗保险,502新型农村合作医疗】 |
|||
*/ |
|||
@ExcelProperty(value = "参保类型", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private Integer cblx; |
|||
|
|||
/** |
|||
* 最初享受月份 |
|||
*/ |
|||
@ExcelProperty(value = "最初享受月份") |
|||
private Date zcxsyf; |
|||
|
|||
/** |
|||
* 是否建档立卡扶贫对象。0否,1是 |
|||
*/ |
|||
@ExcelProperty(value = "是否建档立卡扶贫对象", converter = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer jdlkfpdx; |
|||
|
|||
/** |
|||
* 开户银行 |
|||
*/ |
|||
@ExcelProperty(value = "开户银行") |
|||
private String khyh; |
|||
|
|||
/** |
|||
* 户头名称 |
|||
*/ |
|||
@ExcelProperty(value = "户头名称") |
|||
private String htmc; |
|||
|
|||
/** |
|||
* 银行账号(一本通账号) |
|||
*/ |
|||
@ExcelProperty(value = "银行账号(一本通账号)") |
|||
private String yhzh; |
|||
|
|||
/** |
|||
* 户月保障金额(元) |
|||
*/ |
|||
@ExcelProperty(value = "户月保障金额(元)") |
|||
private BigDecimal hybzje; |
|||
|
|||
/** |
|||
* 人员附加政策(元) |
|||
*/ |
|||
@ExcelProperty(value = "人员附加政策(元)") |
|||
private BigDecimal ryfjzc; |
|||
|
|||
/** |
|||
* 救助金计算方式【600其他,601补差】 |
|||
*/ |
|||
@ExcelProperty(value = "救助金计算方式", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private Integer jzjjsfs; |
|||
|
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.epmet.excel.converter.LingShanHelpCrowdExcelConverter; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 重点帮扶-独居老人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
public class LingshanHelpCrowdDujuExcelData extends LingShanHelpCrowdBaseExcelData { |
|||
|
|||
/** |
|||
* 监护人姓名 |
|||
*/ |
|||
@ExcelProperty(value = "*监护人姓名") |
|||
private String jhrxm; |
|||
|
|||
/** |
|||
* 监护人电话 |
|||
*/ |
|||
@ExcelProperty(value = "*监护人电话") |
|||
private String jhrdh; |
|||
|
|||
/** |
|||
* 监护人与老人关系 |
|||
*/ |
|||
@ExcelProperty(value = "监护人与老人关系") |
|||
private String jhrylrgx; |
|||
|
|||
/** |
|||
* 健康状况【400:一般或较弱,401:健康或良好】 |
|||
*/ |
|||
@ExcelProperty(value = "健康状况", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private Integer jkzk; |
|||
|
|||
/** |
|||
* 子女探视间隔时间 |
|||
*/ |
|||
@ExcelProperty(value = "子女探视间隔时间") |
|||
private String tsjg; |
|||
|
|||
/** |
|||
* 帮扶及其他情况说明 |
|||
*/ |
|||
@ExcelProperty(value = "帮扶及其他情况说明") |
|||
private String remark; |
|||
|
|||
} |
|||
@ -0,0 +1,63 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.entity.LingshanHelpCrowdBaseEntity; |
|||
import com.epmet.excel.converter.LingShanHelpCrowdExcelConverter; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 重点帮扶-高龄老人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
public class LingshanHelpCrowdGaolingExcelData extends LingShanHelpCrowdBaseExcelData { |
|||
|
|||
/** |
|||
* 银行卡号 |
|||
*/ |
|||
@ExcelProperty(value = "银行卡号") |
|||
private String yhzh; |
|||
|
|||
/** |
|||
* 津贴金额(元) |
|||
*/ |
|||
@ExcelProperty(value = "*津贴金额(元)") |
|||
private BigDecimal jtje; |
|||
|
|||
/** |
|||
* 津贴发放情况说明 |
|||
*/ |
|||
@ExcelProperty(value = "津贴发放情况说明") |
|||
private String ffqk; |
|||
|
|||
/** |
|||
* 自理情况【700不能自理,701能够自理】 |
|||
*/ |
|||
@ExcelProperty(value = "自理情况", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private Integer zlqk; |
|||
|
|||
/** |
|||
* 监护人姓名 |
|||
*/ |
|||
@ExcelProperty(value = "监护人姓名") |
|||
private String jhrxm; |
|||
|
|||
/** |
|||
* 监护人电话 |
|||
*/ |
|||
@ExcelProperty(value = "监护人电话") |
|||
private String jhrdh; |
|||
|
|||
/** |
|||
* 备注 |
|||
*/ |
|||
@ExcelProperty(value = "备注") |
|||
private String remark; |
|||
|
|||
} |
|||
@ -0,0 +1,55 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import com.epmet.excel.converter.LingShanHelpCrowdExcelConverter; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 重点帮扶-独居老人 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
public class LingshanHelpCrowdKongchaoExcelData extends LingShanHelpCrowdBaseExcelData { |
|||
|
|||
/** |
|||
* 监护人姓名 |
|||
*/ |
|||
@ExcelProperty(value = "*监护人姓名") |
|||
private String jhrxm; |
|||
|
|||
/** |
|||
* 监护人电话 |
|||
*/ |
|||
@ExcelProperty(value = "*监护人电话") |
|||
private String jhrdh; |
|||
|
|||
/** |
|||
* 监护人与老人关系 |
|||
*/ |
|||
@ExcelProperty(value = "监护人与老人关系") |
|||
private String jhrylrgx; |
|||
|
|||
/** |
|||
* 健康状况【400:一般或较弱,401:健康或良好】 |
|||
*/ |
|||
@ExcelProperty(value = "健康状况", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private Integer jkzk; |
|||
|
|||
/** |
|||
* 子女探视间隔时间 |
|||
*/ |
|||
@ExcelProperty(value = "子女探视间隔时间") |
|||
private String tsjg; |
|||
|
|||
/** |
|||
* 帮扶及其他情况说明 |
|||
*/ |
|||
@ExcelProperty(value = "帮扶及其他情况说明") |
|||
private String remark; |
|||
|
|||
} |
|||
@ -0,0 +1,60 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 重点帮扶-留守儿童 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
public class LingshanHelpCrowdLiushouExcelData extends LingShanHelpCrowdBaseExcelData { |
|||
|
|||
/** |
|||
* 监护人姓名 |
|||
*/ |
|||
@ExcelProperty(value = "*监护人姓名") |
|||
private String jhrxm; |
|||
|
|||
/** |
|||
* 监护人电话 |
|||
*/ |
|||
@ExcelProperty(value = "*监护人电话") |
|||
private String jhrdh; |
|||
|
|||
/** |
|||
* 与监护人关系 |
|||
*/ |
|||
@ExcelProperty(value = "*与监护人关系") |
|||
private String yjhrgx; |
|||
|
|||
/** |
|||
* 所在学校及班级 |
|||
*/ |
|||
@ExcelProperty(value = "*所在学校及班级") |
|||
private String szxxjbj; |
|||
|
|||
/** |
|||
* 班主任姓名 |
|||
*/ |
|||
@ExcelProperty(value = "班主任姓名") |
|||
private String bzrxm; |
|||
|
|||
/** |
|||
* 班主任电话 |
|||
*/ |
|||
@ExcelProperty(value = "班主任电话") |
|||
private String bzrdh; |
|||
|
|||
/** |
|||
* 帮扶情况及其他说明 |
|||
*/ |
|||
@ExcelProperty(value = "帮扶情况及其他说明") |
|||
private String remark; |
|||
|
|||
} |
|||
@ -0,0 +1,137 @@ |
|||
package com.epmet.excel.data; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import com.epmet.excel.converter.LingShanHelpCrowdExcelConverter; |
|||
import com.epmet.excel.converter.LingShanSpecialCrowdYesOrNoConverter; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 重点帮扶-特困人员 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2023-05-18 |
|||
*/ |
|||
@Data |
|||
public class LingshanHelpCrowdTekunExcelData extends LingShanHelpCrowdBaseExcelData{ |
|||
|
|||
/** |
|||
* 户籍类型。100农村户籍,101城镇户籍 |
|||
*/ |
|||
@ExcelProperty(value = "户籍类型", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private Integer hjlx; |
|||
|
|||
/** |
|||
* 低保(特困)证号 |
|||
*/ |
|||
@ExcelProperty(value = "*低保(特困)证号") |
|||
private String dbzh; |
|||
|
|||
/** |
|||
* 婚姻状况(字典) |
|||
*/ |
|||
@ExcelProperty(value = "婚姻状况", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private String hyzk; |
|||
|
|||
/** |
|||
* 就业情况(字典) |
|||
*/ |
|||
@ExcelProperty(value = "就业情况", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private String jyqk; |
|||
|
|||
/** |
|||
* 年收入 |
|||
*/ |
|||
@ExcelProperty(value = "年收入(元)") |
|||
private Integer nsr; |
|||
|
|||
/** |
|||
* 是否残疾【是:1 否:0】 |
|||
*/ |
|||
@ExcelProperty(value = "是否残疾人", converter = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer isCj; |
|||
|
|||
/** |
|||
* 生活自理能力。800具备生活自理能力,801部分丧失生活能力,802完全丧失生活自理能力 |
|||
*/ |
|||
@ExcelProperty(value = "生活自理能力", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private Integer shzlnl; |
|||
|
|||
/** |
|||
* 健康状况【400:一般或较弱,401:健康或良好】 |
|||
*/ |
|||
@ExcelProperty(value = "健康状况", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private Integer jkzk; |
|||
|
|||
/** |
|||
* 所患病种 |
|||
*/ |
|||
@ExcelProperty(value = "患病病种") |
|||
private String shbz; |
|||
|
|||
/** |
|||
* 参保类型【500城乡居民基本医疗保险,501职工医疗保险,502新型农村合作医疗】 |
|||
*/ |
|||
@ExcelProperty(value = "参保类型", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private Integer cblx; |
|||
|
|||
/** |
|||
* 最初享受月份 |
|||
*/ |
|||
@ExcelProperty(value = "最初享受月份") |
|||
private Date zcxsyf; |
|||
|
|||
/** |
|||
* 是否建档立卡扶贫对象。0否,1是 |
|||
*/ |
|||
@ExcelProperty(value = "是否建档立卡扶贫对象", converter = LingShanSpecialCrowdYesOrNoConverter.class) |
|||
private Integer jdlkfpdx; |
|||
|
|||
/** |
|||
* 开户银行 |
|||
*/ |
|||
@ExcelProperty(value = "开户银行") |
|||
private String khyh; |
|||
|
|||
/** |
|||
* 户头名称 |
|||
*/ |
|||
@ExcelProperty(value = "户头名称") |
|||
private String htmc; |
|||
|
|||
/** |
|||
* 银行账号(一本通账号) |
|||
*/ |
|||
@ExcelProperty(value = "银行账号(一本通账号)") |
|||
private String yhzh; |
|||
|
|||
/** |
|||
* 供养方式。900集中供养,901分散供养 |
|||
*/ |
|||
@ExcelProperty(value = "供养方式", converter = LingShanHelpCrowdExcelConverter.class) |
|||
private Integer gyfs; |
|||
|
|||
/** |
|||
* 供养机构名称 |
|||
*/ |
|||
@ExcelProperty(value = "供养机构名称") |
|||
private String gyjgmc; |
|||
|
|||
/** |
|||
* 基本生活标准(元) |
|||
*/ |
|||
@ExcelProperty(value = "基本生活标准(元)") |
|||
private BigDecimal jbshbz; |
|||
|
|||
/** |
|||
* 照料护理费用(元) |
|||
*/ |
|||
@ExcelProperty(value = "照料护理费用(元)") |
|||
private BigDecimal zlhlfy; |
|||
|
|||
} |
|||
@ -0,0 +1,418 @@ |
|||
package com.epmet.excel.handler; |
|||
|
|||
import com.alibaba.excel.context.AnalysisContext; |
|||
import com.alibaba.excel.event.AnalysisEventListener; |
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
import com.epmet.bean.PersonHelpTypeBean; |
|||
import com.epmet.commons.tools.distributedlock.DistributedLock; |
|||
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.exception.ValidateException; |
|||
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|||
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|||
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.utils.EpmetRequestHolder; |
|||
import com.epmet.commons.tools.utils.PidUtils; |
|||
import com.epmet.commons.tools.utils.SpringContextUtils; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.entity.LingshanHelpCrowdBaseEntity; |
|||
import com.epmet.enums.LingShanHelpCrowdTypeEnum; |
|||
import com.epmet.excel.data.LingShanHelpCrowdBaseExcelData; |
|||
import com.epmet.exceptions.ReadExcelHeaderOnlyException; |
|||
import com.epmet.service.LingShanHelpCrowdService; |
|||
import lombok.Data; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.redisson.api.RLock; |
|||
|
|||
import java.util.*; |
|||
import java.util.concurrent.atomic.AtomicInteger; |
|||
|
|||
/** |
|||
* 灵山大屏-抽象的导入excel监听器 |
|||
*/ |
|||
@Data |
|||
@Slf4j |
|||
public abstract class AbstractLingShanHelpCrowdExcelImportListener<T extends LingShanHelpCrowdBaseExcelData, E extends LingshanHelpCrowdBaseEntity> |
|||
extends AnalysisEventListener<T> { |
|||
|
|||
/** |
|||
* @description: 分布式锁 |
|||
* @param null: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 11:43 PM |
|||
*/ |
|||
private DistributedLock distributedLock; |
|||
|
|||
/** |
|||
* 按批次保存,单次最大数据量 |
|||
*/ |
|||
private static final Integer MAX_BATCH_SIZE = 500; |
|||
|
|||
private String templateFileName; |
|||
|
|||
/** |
|||
* 表头应有行数 |
|||
*/ |
|||
private Integer maxHeadRowNum; |
|||
|
|||
/** |
|||
* 文件的表头中应当有哪些列 |
|||
*/ |
|||
private List<String> headerZhList; |
|||
|
|||
/** |
|||
* @description: 是否只校验表头 |
|||
* @param null: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/19 5:16 PM |
|||
*/ |
|||
private Boolean validateHeaderOnly = false; |
|||
|
|||
/** |
|||
* 当前表头读到了第几行 |
|||
*/ |
|||
private Integer currentHeadRowNum = 0; |
|||
|
|||
/** |
|||
* 原始数据列表 |
|||
*/ |
|||
private List<T> originDatas = new ArrayList<>(); |
|||
|
|||
/** |
|||
* 错误数据列表 |
|||
*/ |
|||
private List<T> errorDatas = new ArrayList<>(); |
|||
|
|||
/** |
|||
* 正确数据 |
|||
*/ |
|||
private List<E> correctDatas = new ArrayList<>(); |
|||
|
|||
private AtomicInteger correctDatasQty = new AtomicInteger(); |
|||
|
|||
// 为什么去掉了?因为需求改成了:直接用type根居民基础信息关联
|
|||
// private List<LingshanSpecialCrowdPersonEntity> persons = new ArrayList<>();
|
|||
// private List<LingshanSpecialCrowdPersonTypeEntity> personTypes = new ArrayList<>();
|
|||
private List<PersonHelpTypeBean> helpTypes = new ArrayList<>(); |
|||
|
|||
protected LingShanHelpCrowdService lingShanHelpCrowdService; |
|||
|
|||
private Class<E> entityClass; |
|||
|
|||
private CustomerStaffInfoCacheResult currentStaffInfo; |
|||
|
|||
private LingShanHelpCrowdTypeEnum helpCrowdType; |
|||
|
|||
public AbstractLingShanHelpCrowdExcelImportListener() { |
|||
lingShanHelpCrowdService = SpringContextUtils.getBean(LingShanHelpCrowdService.class); |
|||
distributedLock = SpringContextUtils.getBean(DistributedLock.class); |
|||
currentStaffInfo = CustomerStaffRedis.getStaffInfo(EpmetRequestHolder.getLoginUserCustomerId(), EpmetRequestHolder.getLoginUserId()); |
|||
maxHeadRowNum = setMaxHeadRowNum(); |
|||
headerZhList = setHeaderZhList(); |
|||
helpCrowdType = getHelpCrowdType(); |
|||
entityClass = getEntityClass(); |
|||
templateFileName = setTemplateFileName(); |
|||
} |
|||
|
|||
/** |
|||
* @param headMap: |
|||
* @param context: |
|||
* @return |
|||
* @description: 表头回调函数,此处做统一表头校验,确认文件内容与当前要导入的数据的字段一致,防止导错类型. |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 10:42 AM |
|||
*/ |
|||
@Override |
|||
public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) { |
|||
// super.invokeHeadMap(headMap, context);
|
|||
|
|||
if (maxHeadRowNum == null || CollectionUtils.isEmpty(headerZhList)) { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【灵山街道】社会维稳数据导入-子类未设置header行数以及header字段列表。"); |
|||
} |
|||
|
|||
if ((++currentHeadRowNum).equals(maxHeadRowNum)) { |
|||
// 如果是表头最后一行,则校验表头
|
|||
List<String> redundentHeaders = new ArrayList<>(); |
|||
List<String> lackHeaders = new ArrayList<>(); |
|||
|
|||
Collection<String> headersFromFile = headMap.values(); |
|||
// 2次循环,双向校验
|
|||
for (String headerZh : headersFromFile) { |
|||
if (StringUtils.isNotBlank(headerZh) && !headerZhList.contains(headerZh)) { |
|||
redundentHeaders.add(headerZh); |
|||
} |
|||
} |
|||
|
|||
for (String headerZh : headerZhList) { |
|||
if (StringUtils.isNotBlank(headerZh) && !headersFromFile.contains(headerZh)) { |
|||
lackHeaders.add(headerZh); |
|||
} |
|||
} |
|||
|
|||
// 汇总错误字段,成一句话
|
|||
String preValidTipStr = ""; |
|||
if (CollectionUtils.isNotEmpty(redundentHeaders)) { |
|||
preValidTipStr += "多余【" + String.join(",", redundentHeaders) + "】字段。"; |
|||
} |
|||
|
|||
if (CollectionUtils.isNotEmpty(lackHeaders)) { |
|||
preValidTipStr += "缺少【" + String.join(",", lackHeaders) + "】必填字段。"; |
|||
} |
|||
|
|||
if (StringUtils.isNotBlank(preValidTipStr)) { |
|||
log.error("【灵山街道-社会维稳导入】表格表头不对应," + preValidTipStr); |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "上传文件有误!" + preValidTipStr + "请确认表格格式正确"); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @description: 行读取回调函数 |
|||
* @param row: |
|||
* @param context: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 11:44 PM |
|||
*/ |
|||
@Override |
|||
public void invoke(T row, AnalysisContext context) { |
|||
if (validateHeaderOnly) { |
|||
// 如果仅解析表头,那么抛出异常,外层接住
|
|||
throw new ReadExcelHeaderOnlyException(); |
|||
} |
|||
try { |
|||
ValidatorUtils.validateEntity(row); |
|||
} catch (ValidateException e) { |
|||
// 加入到错误记录中去
|
|||
row.setErrorInfo(e.getMsg()); |
|||
errorDatas.add(row); |
|||
return; |
|||
} |
|||
|
|||
originDatas.add(row); |
|||
|
|||
if (originDatas.size() >= MAX_BATCH_SIZE) { |
|||
// 满足了一批次的数量,执行保存
|
|||
saveBatchWithLock(); |
|||
clear(); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void doAfterAllAnalysed(AnalysisContext context) { |
|||
if (validateHeaderOnly) { |
|||
throw new ReadExcelHeaderOnlyException(); |
|||
} |
|||
|
|||
if (originDatas.size() > 0) { |
|||
saveBatchWithLock(); |
|||
clear(); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @param : |
|||
* @return |
|||
* @description: 批量保存,带锁的。因为要在Listener中过滤出哪些数据不能导入,返回给前端。 |
|||
* 所以需要再lisener中做批量检查,然后批量保存。过程需要一点时间,为了防止并发问题,加分布式锁。以agencyId为粒度。 |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 4:33 PM |
|||
*/ |
|||
private void saveBatchWithLock() { |
|||
String customerId = EpmetRequestHolder.getLoginUserCustomerId(); |
|||
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, EpmetRequestHolder.getLoginUserId()); |
|||
RLock lock = distributedLock.getLock(String.format("{}:{}:{}", "lock:helpcrowd", customerId, staffInfo.getAgencyId())); |
|||
try { |
|||
this.saveBatch(); |
|||
} catch (Exception e) { |
|||
throw e; |
|||
} finally { |
|||
if (lock != null && lock.isHeldByCurrentThread()) { |
|||
lock.unlock(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @param : |
|||
* @return |
|||
* @description: 批量保存 |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 3:42 PM |
|||
*/ |
|||
protected void saveBatch() { |
|||
String customerId = EpmetRequestHolder.getLoginUserCustomerId(); |
|||
Date now = new Date(); |
|||
Iterator<T> it = getOriginDatas().iterator(); |
|||
for (; it.hasNext(); ) { |
|||
T row = it.next(); |
|||
String errorInfo = lingShanHelpCrowdService.validate(row); |
|||
if (StringUtils.isNotBlank(errorInfo)) { |
|||
row.setErrorInfo(errorInfo); |
|||
errorDatas.add(row); |
|||
it.remove(); |
|||
} else { |
|||
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(row.getResiGridId()); |
|||
|
|||
if (gridInfo == null) { |
|||
log.error("未找到网格信息,网格ID:{}", row.getResiGridId()); |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "未找到网格信息,网格ID:" + row.getResiGridId()); |
|||
} |
|||
|
|||
String orgIdPath = PidUtils.convertPid2OrgIdPath(row.getResiGridId(), gridInfo.getPids()); |
|||
|
|||
// 添加人员-类别对应关系
|
|||
helpTypes.add(new PersonHelpTypeBean(row.getResiId(), row.getIdCard(), helpCrowdType.getType(), orgIdPath)); |
|||
|
|||
E e = ConvertUtils.sourceToTarget(row, entityClass); |
|||
e.setCustomerId(customerId); |
|||
e.setOrgIdPath(orgIdPath); |
|||
e.setRevision(0); |
|||
e.setCreatedTime(now); |
|||
e.setUpdatedTime(now); |
|||
e.setCreatedBy(currentStaffInfo.getStaffId()); |
|||
e.setUpdatedBy(currentStaffInfo.getStaffId()); |
|||
e.setDelFlag("0"); |
|||
|
|||
// 添加类别详情
|
|||
correctDatas.add(e); |
|||
correctDatasQty.incrementAndGet(); |
|||
} |
|||
} |
|||
|
|||
// 执行保存
|
|||
if(!CollectionUtils.isEmpty(helpTypes)) { |
|||
savePersonAndTypes(helpTypes); |
|||
} |
|||
|
|||
// 保存人群详情数据
|
|||
saveBatchCallback(correctDatas); |
|||
} |
|||
|
|||
/** |
|||
* @description: 保存人员信息,人员类型 |
|||
* @param personTypes: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/19 11:06 AM |
|||
*/ |
|||
private void savePersonAndTypes(List<PersonHelpTypeBean> personTypes) { |
|||
lingShanHelpCrowdService.savePersonAndTypes(personTypes, false); |
|||
} |
|||
|
|||
/** |
|||
* @param : |
|||
* @return |
|||
* @description: 清理数据 |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 4:41 PM |
|||
*/ |
|||
protected void clear() { |
|||
originDatas.clear(); |
|||
} |
|||
|
|||
/** |
|||
* @description: 获取读取到的原始数据 |
|||
* @param : |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 11:21 PM |
|||
*/ |
|||
protected List<T> getOriginDatas() { |
|||
return originDatas; |
|||
} |
|||
|
|||
/** |
|||
* @description: 获取错误数据行 |
|||
* @param : |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 11:22 PM |
|||
*/ |
|||
public List<T> getErrorDatas() { |
|||
return errorDatas; |
|||
} |
|||
|
|||
public Integer getFailedItemsQty() { |
|||
return errorDatas.size(); |
|||
} |
|||
|
|||
public Integer getSuccessedItemsQty() { |
|||
return correctDatasQty.get(); |
|||
} |
|||
|
|||
/** |
|||
* @description: 获取正确数据行 |
|||
* @param : |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 11:22 PM |
|||
*/ |
|||
protected List<E> getCorrectDatas() { |
|||
return correctDatas; |
|||
} |
|||
|
|||
/** |
|||
* @param : |
|||
* @return |
|||
* @description: 批量保存,子类实现 |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 4:32 PM |
|||
*/ |
|||
abstract void saveBatchCallback(List<E> entities); |
|||
|
|||
/** |
|||
* @description: 设置表头行数 |
|||
* @param : |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 11:22 PM |
|||
*/ |
|||
abstract Integer setMaxHeadRowNum(); |
|||
|
|||
/** |
|||
* @description: 设置header字段列表。子类应当调用该方法设置该值 |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 11:21 PM |
|||
*/ |
|||
abstract List<String> setHeaderZhList(); |
|||
|
|||
/** |
|||
* @description: 设置模板名称 |
|||
* @param : |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/20 9:07 AM |
|||
*/ |
|||
abstract String setTemplateFileName(); |
|||
|
|||
/** |
|||
* @description: 获取entity的class,用于数据拷贝 |
|||
* @param : |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/19 9:47 AM |
|||
*/ |
|||
abstract Class<E> getEntityClass(); |
|||
|
|||
/** |
|||
* @description: 指定特殊人群类型 |
|||
* @param : |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/19 11:00 AM |
|||
*/ |
|||
abstract LingShanHelpCrowdTypeEnum getHelpCrowdType(); |
|||
|
|||
/** |
|||
* 人员类别信息bean,用于导入临时存储数据 |
|||
*/ |
|||
|
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
package com.epmet.excel.handler; |
|||
|
|||
import com.epmet.entity.LingshanHelpCrowdCanjiEntity; |
|||
import com.epmet.enums.LingShanHelpCrowdTypeEnum; |
|||
import com.epmet.excel.data.LingshanHelpCrowdCanjiExcelData; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
public class LingShanHelpCrowdCanjiExcelImportListener |
|||
extends AbstractLingShanHelpCrowdExcelImportListener<LingshanHelpCrowdCanjiExcelData, LingshanHelpCrowdCanjiEntity> { |
|||
@Override |
|||
void saveBatchCallback(List<LingshanHelpCrowdCanjiEntity> entities) { |
|||
lingShanHelpCrowdService.save(entities, new LingshanHelpCrowdCanjiEntity()); |
|||
} |
|||
|
|||
@Override |
|||
Integer setMaxHeadRowNum() { |
|||
return 1; |
|||
} |
|||
|
|||
@Override |
|||
List<String> setHeaderZhList() { |
|||
return Arrays.asList("*姓名", "*身份证号", "*残疾证号", "*残疾类型", "*残疾等级", "有效期开始时间", "是否在世", "去世时间"); |
|||
} |
|||
|
|||
@Override |
|||
String setTemplateFileName() { |
|||
return "excel/lingshan/lingshan_help_crowd_canji_export.xlsx"; |
|||
} |
|||
|
|||
@Override |
|||
Class<LingshanHelpCrowdCanjiEntity> getEntityClass() { |
|||
return LingshanHelpCrowdCanjiEntity.class; |
|||
} |
|||
|
|||
@Override |
|||
LingShanHelpCrowdTypeEnum getHelpCrowdType() { |
|||
return LingShanHelpCrowdTypeEnum.CANJI; |
|||
} |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
package com.epmet.excel.handler; |
|||
|
|||
import com.epmet.entity.LingshanHelpCrowdCanjiEntity; |
|||
import com.epmet.entity.LingshanHelpCrowdDabingEntity; |
|||
import com.epmet.enums.LingShanHelpCrowdTypeEnum; |
|||
import com.epmet.excel.data.LingshanHelpCrowdCanjiExcelData; |
|||
import com.epmet.excel.data.LingshanHelpCrowdDabingExcelData; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
public class LingShanHelpCrowdDabingExcelImportListener |
|||
extends AbstractLingShanHelpCrowdExcelImportListener<LingshanHelpCrowdDabingExcelData, LingshanHelpCrowdDabingEntity> { |
|||
@Override |
|||
void saveBatchCallback(List<LingshanHelpCrowdDabingEntity> entities) { |
|||
lingShanHelpCrowdService.save(entities, entities.get(0)); |
|||
} |
|||
|
|||
@Override |
|||
Integer setMaxHeadRowNum() { |
|||
return 1; |
|||
} |
|||
|
|||
@Override |
|||
List<String> setHeaderZhList() { |
|||
return Arrays.asList("*姓名", "*身份证号", "*患病病种", "*患病时间", "救助情况说明", "救助金额(元)", "个人负担(元)"); |
|||
} |
|||
|
|||
@Override |
|||
String setTemplateFileName() { |
|||
return "excel/lingshan/lingshan_help_crowd_dabing_export.xlsx"; |
|||
} |
|||
|
|||
@Override |
|||
Class<LingshanHelpCrowdDabingEntity> getEntityClass() { |
|||
return LingshanHelpCrowdDabingEntity.class; |
|||
} |
|||
|
|||
@Override |
|||
LingShanHelpCrowdTypeEnum getHelpCrowdType() { |
|||
return LingShanHelpCrowdTypeEnum.DABING; |
|||
} |
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
package com.epmet.excel.handler; |
|||
|
|||
import com.epmet.entity.LingshanHelpCrowdDabingEntity; |
|||
import com.epmet.entity.LingshanHelpCrowdDibaoEntity; |
|||
import com.epmet.enums.LingShanHelpCrowdTypeEnum; |
|||
import com.epmet.excel.data.LingshanHelpCrowdDabingExcelData; |
|||
import com.epmet.excel.data.LingshanHelpCrowdDibaoExcelData; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
public class LingShanHelpCrowdDibaoExcelImportListener |
|||
extends AbstractLingShanHelpCrowdExcelImportListener<LingshanHelpCrowdDibaoExcelData, LingshanHelpCrowdDibaoEntity> { |
|||
@Override |
|||
void saveBatchCallback(List<LingshanHelpCrowdDibaoEntity> entities) { |
|||
lingShanHelpCrowdService.save(entities, entities.get(0)); |
|||
} |
|||
|
|||
@Override |
|||
Integer setMaxHeadRowNum() { |
|||
return 1; |
|||
} |
|||
|
|||
@Override |
|||
List<String> setHeaderZhList() { |
|||
return Arrays.asList("*姓名", "*身份证号", "户籍类型", "*低保类型", "*低保(特困)证号", "婚姻状况", "就业情况", "年收入(元)", |
|||
"是否残疾人", "劳动能力", "健康状况", "患病病种", "参保类型", "最初享受月份", "是否建档立卡扶贫对象", "开户银行", "户头名称", |
|||
"银行账号(一本通账号)", "户月保障金额(元)", "人员附加政策(元)", "救助金计算方式"); |
|||
} |
|||
|
|||
@Override |
|||
String setTemplateFileName() { |
|||
return "excel/lingshan/lingshan_help_crowd_dibao_export.xlsx"; |
|||
} |
|||
|
|||
@Override |
|||
Class<LingshanHelpCrowdDibaoEntity> getEntityClass() { |
|||
return LingshanHelpCrowdDibaoEntity.class; |
|||
} |
|||
|
|||
@Override |
|||
LingShanHelpCrowdTypeEnum getHelpCrowdType() { |
|||
return LingShanHelpCrowdTypeEnum.DIBAO; |
|||
} |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
package com.epmet.excel.handler; |
|||
|
|||
import com.epmet.entity.LingshanHelpCrowdDujuEntity; |
|||
import com.epmet.enums.LingShanHelpCrowdTypeEnum; |
|||
import com.epmet.excel.data.LingshanHelpCrowdDujuExcelData; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
public class LingShanHelpCrowdDujuExcelImportListener |
|||
extends AbstractLingShanHelpCrowdExcelImportListener<LingshanHelpCrowdDujuExcelData, LingshanHelpCrowdDujuEntity> { |
|||
|
|||
@Override |
|||
void saveBatchCallback(List<LingshanHelpCrowdDujuEntity> entities) { |
|||
lingShanHelpCrowdService.save(entities, entities.get(0)); |
|||
} |
|||
|
|||
@Override |
|||
Integer setMaxHeadRowNum() { |
|||
return 1; |
|||
} |
|||
|
|||
@Override |
|||
List<String> setHeaderZhList() { |
|||
return Arrays.asList("*姓名", "*身份证号", "*监护人姓名", "*监护人电话", "监护人与老人关系", "健康状况", "子女探视间隔时间", "帮扶及其他情况说明"); |
|||
} |
|||
|
|||
@Override |
|||
String setTemplateFileName() { |
|||
return "excel/lingshan/lingshan_help_crowd_duju_export.xlsx"; |
|||
} |
|||
|
|||
@Override |
|||
Class<LingshanHelpCrowdDujuEntity> getEntityClass() { |
|||
return LingshanHelpCrowdDujuEntity.class; |
|||
} |
|||
|
|||
@Override |
|||
LingShanHelpCrowdTypeEnum getHelpCrowdType() { |
|||
return LingShanHelpCrowdTypeEnum.DUJU; |
|||
} |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
package com.epmet.excel.handler; |
|||
|
|||
import com.epmet.entity.LingshanHelpCrowdGaolingEntity; |
|||
import com.epmet.enums.LingShanHelpCrowdTypeEnum; |
|||
import com.epmet.excel.data.LingshanHelpCrowdGaolingExcelData; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
public class LingShanHelpCrowdGaolingExcelImportListener |
|||
extends AbstractLingShanHelpCrowdExcelImportListener<LingshanHelpCrowdGaolingExcelData, LingshanHelpCrowdGaolingEntity> { |
|||
|
|||
@Override |
|||
void saveBatchCallback(List<LingshanHelpCrowdGaolingEntity> entities) { |
|||
lingShanHelpCrowdService.save(entities, entities.get(0)); |
|||
} |
|||
|
|||
@Override |
|||
Integer setMaxHeadRowNum() { |
|||
return 1; |
|||
} |
|||
|
|||
@Override |
|||
List<String> setHeaderZhList() { |
|||
return Arrays.asList("*姓名","*身份证号","银行卡号","*津贴金额(元)","津贴发放情况说明","自理情况","监护人姓名","监护人电话","备注"); |
|||
} |
|||
|
|||
@Override |
|||
String setTemplateFileName() { |
|||
return "excel/lingshan/lingshan_help_crowd_gaoling_export.xlsx"; |
|||
} |
|||
|
|||
@Override |
|||
Class<LingshanHelpCrowdGaolingEntity> getEntityClass() { |
|||
return LingshanHelpCrowdGaolingEntity.class; |
|||
} |
|||
|
|||
@Override |
|||
LingShanHelpCrowdTypeEnum getHelpCrowdType() { |
|||
return LingShanHelpCrowdTypeEnum.GAOLING; |
|||
} |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
package com.epmet.excel.handler; |
|||
|
|||
import com.epmet.entity.LingshanHelpCrowdKongchaoEntity; |
|||
import com.epmet.enums.LingShanHelpCrowdTypeEnum; |
|||
import com.epmet.excel.data.LingshanHelpCrowdKongchaoExcelData; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
public class LingShanHelpCrowdKongchaoExcelImportListener |
|||
extends AbstractLingShanHelpCrowdExcelImportListener<LingshanHelpCrowdKongchaoExcelData, LingshanHelpCrowdKongchaoEntity> { |
|||
|
|||
@Override |
|||
void saveBatchCallback(List<LingshanHelpCrowdKongchaoEntity> entities) { |
|||
lingShanHelpCrowdService.save(entities, entities.get(0)); |
|||
} |
|||
|
|||
@Override |
|||
Integer setMaxHeadRowNum() { |
|||
return 1; |
|||
} |
|||
|
|||
@Override |
|||
List<String> setHeaderZhList() { |
|||
return Arrays.asList("*姓名", "*身份证号", "*监护人姓名", "*监护人电话", "监护人与老人关系", "健康状况", "子女探视间隔时间", "帮扶及其他情况说明"); |
|||
} |
|||
|
|||
@Override |
|||
String setTemplateFileName() { |
|||
return "excel/lingshan/lingshan_help_crowd_kongchao_export.xlsx"; |
|||
} |
|||
|
|||
@Override |
|||
Class<LingshanHelpCrowdKongchaoEntity> getEntityClass() { |
|||
return LingshanHelpCrowdKongchaoEntity.class; |
|||
} |
|||
|
|||
@Override |
|||
LingShanHelpCrowdTypeEnum getHelpCrowdType() { |
|||
return LingShanHelpCrowdTypeEnum.KONGCHAO; |
|||
} |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
package com.epmet.excel.handler; |
|||
|
|||
import com.epmet.entity.LingshanHelpCrowdLiushouEntity; |
|||
import com.epmet.enums.LingShanHelpCrowdTypeEnum; |
|||
import com.epmet.excel.data.LingshanHelpCrowdLiushouExcelData; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
public class LingShanHelpCrowdLiushouExcelImportListener |
|||
extends AbstractLingShanHelpCrowdExcelImportListener<LingshanHelpCrowdLiushouExcelData, LingshanHelpCrowdLiushouEntity> { |
|||
|
|||
@Override |
|||
void saveBatchCallback(List<LingshanHelpCrowdLiushouEntity> entities) { |
|||
lingShanHelpCrowdService.save(entities, entities.get(0)); |
|||
} |
|||
|
|||
@Override |
|||
Integer setMaxHeadRowNum() { |
|||
return 1; |
|||
} |
|||
|
|||
@Override |
|||
List<String> setHeaderZhList() { |
|||
return Arrays.asList("*姓名", "*身份证号", "*监护人姓名", "*监护人电话", "*与监护人关系", "*所在学校及班级", "班主任姓名", "班主任电话", "帮扶情况及其他说明"); |
|||
} |
|||
|
|||
@Override |
|||
String setTemplateFileName() { |
|||
return "excel/lingshan/lingshan_help_crowd_liushou_export.xlsx"; |
|||
} |
|||
|
|||
@Override |
|||
Class<LingshanHelpCrowdLiushouEntity> getEntityClass() { |
|||
return LingshanHelpCrowdLiushouEntity.class; |
|||
} |
|||
|
|||
@Override |
|||
LingShanHelpCrowdTypeEnum getHelpCrowdType() { |
|||
return LingShanHelpCrowdTypeEnum.LIUSHOU; |
|||
} |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
package com.epmet.excel.handler; |
|||
|
|||
import com.epmet.entity.LingshanHelpCrowdTekunEntity; |
|||
import com.epmet.enums.LingShanHelpCrowdTypeEnum; |
|||
import com.epmet.excel.data.LingshanHelpCrowdTekunExcelData; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
|
|||
public class LingShanHelpCrowdTekunExcelImportListener |
|||
extends AbstractLingShanHelpCrowdExcelImportListener<LingshanHelpCrowdTekunExcelData, LingshanHelpCrowdTekunEntity> { |
|||
|
|||
@Override |
|||
void saveBatchCallback(List<LingshanHelpCrowdTekunEntity> entities) { |
|||
lingShanHelpCrowdService.save(entities, entities.get(0)); |
|||
} |
|||
|
|||
@Override |
|||
Integer setMaxHeadRowNum() { |
|||
return 1; |
|||
} |
|||
|
|||
@Override |
|||
List<String> setHeaderZhList() { |
|||
return Arrays.asList("*姓名", "*身份证号", "户籍类型", "*低保(特困)证号", "婚姻状况", "就业情况", "年收入(元)", "是否残疾人", |
|||
"生活自理能力", "健康状况", "患病病种", "参保类型", "最初享受月份", "是否建档立卡扶贫对象", "开户银行", "户头名称", |
|||
"银行账号(一本通账号)", "供养方式", "供养机构名称", "基本生活标准(元)", "照料护理费用(元)"); |
|||
} |
|||
|
|||
@Override |
|||
String setTemplateFileName() { |
|||
return "excel/lingshan/lingshan_help_crowd_tekun_export.xlsx"; |
|||
} |
|||
|
|||
@Override |
|||
Class<LingshanHelpCrowdTekunEntity> getEntityClass() { |
|||
return LingshanHelpCrowdTekunEntity.class; |
|||
} |
|||
|
|||
@Override |
|||
LingShanHelpCrowdTypeEnum getHelpCrowdType() { |
|||
return LingShanHelpCrowdTypeEnum.TEKUN; |
|||
} |
|||
} |
|||
@ -0,0 +1,91 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.bean.PersonHelpTypeBean; |
|||
import com.epmet.bean.PersonSpecialTypeBean; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.form.lingshan.LingShanSpecialTypeSaveFormDTO; |
|||
import com.epmet.dto.form.lingshan.LingShanSpecialTypeSaveResultDTO; |
|||
import com.epmet.dto.result.LingShanSpecialCrowdListResultDTO; |
|||
import com.epmet.entity.*; |
|||
import com.epmet.excel.data.LingShanHelpCrowdBaseExcelData; |
|||
import com.epmet.excel.data.LingShanSpecialCrowdDetailBaseExcelData; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 灵山帮扶人群service |
|||
*/ |
|||
public interface LingShanHelpCrowdService { |
|||
|
|||
/** |
|||
* @description: 数据校验 |
|||
* @param row: |
|||
* @returns |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/18 4:49 PM |
|||
*/ |
|||
String validate(LingShanHelpCrowdBaseExcelData row); |
|||
|
|||
/** |
|||
* @description: |
|||
* @param personTypes: |
|||
* @param hard: 是否硬性写入。true:会覆盖现有的,用于页面的修改。false:会与现有的合并,用户导入 |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/24 3:25 PM |
|||
*/ |
|||
void savePersonAndTypes(List<PersonHelpTypeBean> personTypes, Boolean hard); |
|||
|
|||
String importHelpCrowd(String crowdType, String toString, String originalFilename); |
|||
|
|||
void save(List<LingshanHelpCrowdCanjiEntity> entities, LingshanHelpCrowdCanjiEntity t); |
|||
|
|||
void save(List<LingshanHelpCrowdDabingEntity> entities, LingshanHelpCrowdDabingEntity t); |
|||
|
|||
void save(List<LingshanHelpCrowdDibaoEntity> entities, LingshanHelpCrowdDibaoEntity lingshanHelpCrowdDibaoEntity); |
|||
|
|||
void save(List<LingshanHelpCrowdDujuEntity> entities, LingshanHelpCrowdDujuEntity lingshanHelpCrowdDujuEntity); |
|||
|
|||
void save(List<LingshanHelpCrowdGaolingEntity> entities, LingshanHelpCrowdGaolingEntity lingshanHelpCrowdGaolingEntity); |
|||
|
|||
void save(List<LingshanHelpCrowdKongchaoEntity> entities, LingshanHelpCrowdKongchaoEntity lingshanHelpCrowdKongchaoEntity); |
|||
|
|||
void save(List<LingshanHelpCrowdLiushouEntity> entities, LingshanHelpCrowdLiushouEntity lingshanHelpCrowdLiushouEntity); |
|||
|
|||
void save(List<LingshanHelpCrowdTekunEntity> entities, LingshanHelpCrowdTekunEntity lingshanHelpCrowdTekunEntity); |
|||
|
|||
// /**
|
|||
// * @description: 特殊人群详情
|
|||
// * @param idCard:
|
|||
// * @return
|
|||
// * @author: WangXianZhang
|
|||
// * @date: 2023/4/20 3:45 PM
|
|||
// */
|
|||
// LingShanSpecialTypeSaveResultDTO getPersonHelpTypeDetail(String resiId);
|
|||
|
|||
// /**
|
|||
// * @description: 列表查询
|
|||
// * @param orgId:
|
|||
// * @param orgType:
|
|||
// * @param helpType:
|
|||
// * @param name:
|
|||
// * @param mobile:
|
|||
// * @param idCard:
|
|||
// * @return
|
|||
// * @author: WangXianZhang
|
|||
// * @date: 2023/4/20 5:44 PM
|
|||
// */
|
|||
// PageData<LingShanSpecialCrowdListResultDTO> listHelpCrowds(String orgId, String orgType, String helpType, String name, String mobile,
|
|||
// String idCard, Integer pageNo, Integer pageSize);
|
|||
|
|||
// void deleteByResi(String resiId);
|
|||
|
|||
// /**
|
|||
// * @description: 保存或修改
|
|||
// * @param input:
|
|||
// * @return
|
|||
// * @author: WangXianZhang
|
|||
// * @date: 2023/4/23 11:06 AM
|
|||
// */
|
|||
// void saveHelpCrowd(LingShanSpecialTypeSaveFormDTO input);
|
|||
} |
|||
@ -0,0 +1,476 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.alibaba.excel.EasyExcel; |
|||
import com.alibaba.excel.ExcelWriter; |
|||
import com.alibaba.excel.write.metadata.WriteSheet; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|||
import com.epmet.bean.PersonHelpTypeBean; |
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.enums.BizTypeEnum; |
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.exception.ExceptionUtils; |
|||
import com.epmet.commons.tools.feign.ResultDataResolver; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.utils.DateUtils; |
|||
import com.epmet.commons.tools.utils.EpmetRequestHolder; |
|||
import com.epmet.commons.tools.utils.FileUtils; |
|||
import com.epmet.constants.ImportTaskConstants; |
|||
import com.epmet.dao.*; |
|||
import com.epmet.dto.result.ImportTaskCommonResultDTO; |
|||
import com.epmet.dto.result.UploadImgResultDTO; |
|||
import com.epmet.entity.*; |
|||
import com.epmet.enums.LingShanHelpCrowdTypeEnum; |
|||
import com.epmet.enums.LingShanSpecialCrowdTypeEnums; |
|||
import com.epmet.excel.data.*; |
|||
import com.epmet.excel.handler.*; |
|||
import com.epmet.exceptions.ReadExcelHeaderOnlyException; |
|||
import com.epmet.feign.OssFeignClient; |
|||
import com.epmet.service.LingShanHelpCrowdService; |
|||
import com.epmet.utils.ImportTaskUtils; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.collections4.CollectionUtils; |
|||
import org.apache.commons.collections4.ListUtils; |
|||
import org.apache.commons.fileupload.FileItem; |
|||
import org.apache.commons.fileupload.disk.DiskFileItemFactory; |
|||
import org.apache.http.entity.ContentType; |
|||
import org.springframework.beans.BeanUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.web.multipart.commons.CommonsMultipartFile; |
|||
|
|||
import java.io.IOException; |
|||
import java.io.InputStream; |
|||
import java.io.OutputStream; |
|||
import java.util.*; |
|||
import java.util.concurrent.CompletableFuture; |
|||
import java.util.concurrent.ExecutorService; |
|||
import java.util.stream.Collectors; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, ResultDataResolver { |
|||
|
|||
@Autowired |
|||
private OssFeignClient ossFeignClient; |
|||
|
|||
@Autowired |
|||
private ExecutorService executorService; |
|||
|
|||
@Autowired |
|||
private IcResiUserDao icResiUserDao; |
|||
|
|||
@Autowired |
|||
private LingshanHelpCrowdResiMergeDao helpCrowdResiMergeDao; |
|||
|
|||
@Autowired |
|||
private LingshanHelpCrowdCanjiDao lingshanHelpCrowdCanjiDao; |
|||
|
|||
@Autowired |
|||
private LingshanHelpCrowdDabingDao lingshanHelpCrowdDabingDao; |
|||
|
|||
@Autowired |
|||
private LingshanHelpCrowdDibaoDao lingshanHelpCrowdDibaoDao; |
|||
|
|||
@Autowired |
|||
private LingshanHelpCrowdDujuDao lingshanHelpCrowdDujuDao; |
|||
|
|||
@Autowired |
|||
private LingshanHelpCrowdGaolingDao lingshanHelpCrowdGaolingDao; |
|||
|
|||
@Autowired |
|||
private LingshanHelpCrowdKongchaoDao lingshanHelpCrowdKongchaoDao; |
|||
|
|||
@Autowired |
|||
private LingshanHelpCrowdLiushouDao lingshanHelpCrowdLiushouDao; |
|||
|
|||
@Autowired |
|||
private LingshanHelpCrowdTekunDao lingshanHelpCrowdTekunDao; |
|||
|
|||
private String[] COPY_IGNORED_FIELDS = { "id", "customerId", "resiId", "idCard", "createdTime", "createdBy" }; |
|||
|
|||
@Override |
|||
public String validate(LingShanHelpCrowdBaseExcelData row) { |
|||
String idCard = row.getIdCard(); |
|||
String name = row.getName(); |
|||
|
|||
IcResiUserEntity resiEntity = icResiUserDao.selectResiUserEntityByIdCard(idCard, EpmetRequestHolder.getLoginUserCustomerId()); |
|||
if (resiEntity == null) { |
|||
// 居民不存在,报错
|
|||
return "居民信息不存在,请先维护居民基础信息。"; |
|||
} |
|||
if (!resiEntity.getName().equals(name)) { |
|||
return String.format("姓名信息与居民基础信息不一致。(在居民库中根据身份证号找到的居民姓名为:%s)", resiEntity.getName()); |
|||
} |
|||
|
|||
// 设置居民id
|
|||
row.setResiId(resiEntity.getId()); |
|||
row.setResiGridId(resiEntity.getGridId()); |
|||
|
|||
return null; |
|||
} |
|||
|
|||
@Override |
|||
public void savePersonAndTypes(List<PersonHelpTypeBean> personTypes, Boolean hard) { |
|||
|
|||
if (hard) { |
|||
// <resiId:set<PersonHelpTypeBean>>
|
|||
HashMap<String, Set<PersonHelpTypeBean>> resiIdAndTypeBeans = new HashMap<>(); |
|||
|
|||
for (PersonHelpTypeBean personType : personTypes) { |
|||
|
|||
Set<PersonHelpTypeBean> typeBeans = resiIdAndTypeBeans.get(personType.getResiId()); |
|||
if (typeBeans == null) { |
|||
typeBeans = new HashSet<>(); |
|||
resiIdAndTypeBeans.put(personType.getResiId(), typeBeans); |
|||
} |
|||
|
|||
typeBeans.add(personType); |
|||
} |
|||
|
|||
for (Map.Entry<String, Set<PersonHelpTypeBean>> kv : resiIdAndTypeBeans.entrySet()) { |
|||
String resiId = kv.getKey(); |
|||
Set<PersonHelpTypeBean> typeBeans = kv.getValue(); |
|||
|
|||
// 按照居民,一个一个来,先清除,后新增,别怕,暴力一点
|
|||
LambdaQueryWrapper<LingshanHelpCrowdResiMergeEntity> dq = new LambdaQueryWrapper<>(); |
|||
dq.eq(LingshanHelpCrowdResiMergeEntity::getResiId, resiId); |
|||
dq.in(LingshanHelpCrowdResiMergeEntity::getCrowdType, typeBeans.stream().map(PersonHelpTypeBean::getHelpCrowdType).collect(Collectors.toSet())); |
|||
helpCrowdResiMergeDao.delete(dq); |
|||
|
|||
for (PersonHelpTypeBean typeBean : typeBeans) { |
|||
LingshanHelpCrowdResiMergeEntity e2insert = new LingshanHelpCrowdResiMergeEntity(); |
|||
e2insert.setCrowdType(typeBean.getHelpCrowdType()); |
|||
e2insert.setOrgIdPath(typeBean.getOrgIdPath()); |
|||
e2insert.setResiId(resiId); |
|||
e2insert.setIdCard(typeBean.getIdCard()); |
|||
helpCrowdResiMergeDao.insert(e2insert); |
|||
} |
|||
} |
|||
} else { |
|||
// 增加新的
|
|||
for (PersonHelpTypeBean personAndType : personTypes) { |
|||
LambdaQueryWrapper<LingshanHelpCrowdResiMergeEntity> q = new LambdaQueryWrapper<>(); |
|||
q.eq(LingshanHelpCrowdResiMergeEntity::getResiId, personAndType.getResiId()); |
|||
q.eq(LingshanHelpCrowdResiMergeEntity::getCrowdType, personAndType.getHelpCrowdType()); |
|||
|
|||
if (helpCrowdResiMergeDao.selectCount(q) == 0) { |
|||
// 需要新增
|
|||
LingshanHelpCrowdResiMergeEntity e2insert = new LingshanHelpCrowdResiMergeEntity(); |
|||
e2insert.setCrowdType(personAndType.getHelpCrowdType()); |
|||
e2insert.setOrgIdPath(personAndType.getOrgIdPath()); |
|||
e2insert.setResiId(personAndType.getResiId()); |
|||
e2insert.setIdCard(personAndType.getIdCard()); |
|||
helpCrowdResiMergeDao.insert(e2insert); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public String importHelpCrowd(String crowdType, String fileSavePath, String originalFilename) { |
|||
Class<? extends LingShanHelpCrowdBaseExcelData> excelDataClass; |
|||
AbstractLingShanHelpCrowdExcelImportListener listener; |
|||
|
|||
if (LingShanHelpCrowdTypeEnum.CANJI.getType().equals(crowdType)) { |
|||
listener = new LingShanHelpCrowdCanjiExcelImportListener(); |
|||
excelDataClass = LingshanHelpCrowdCanjiExcelData.class; |
|||
} else if (LingShanHelpCrowdTypeEnum.DABING.getType().equals(crowdType)) { |
|||
listener = new LingShanHelpCrowdDabingExcelImportListener(); |
|||
excelDataClass = LingshanHelpCrowdDabingExcelData.class; |
|||
} else if (LingShanHelpCrowdTypeEnum.DIBAO.getType().equals(crowdType)) { |
|||
listener = new LingShanHelpCrowdDibaoExcelImportListener(); |
|||
excelDataClass = LingshanHelpCrowdDibaoExcelData.class; |
|||
} else if (LingShanHelpCrowdTypeEnum.DUJU.getType().equals(crowdType)) { |
|||
listener = new LingShanHelpCrowdDujuExcelImportListener(); |
|||
excelDataClass = LingshanHelpCrowdDujuExcelData.class; |
|||
} else if (LingShanHelpCrowdTypeEnum.GAOLING.getType().equals(crowdType)) { |
|||
listener = new LingShanHelpCrowdGaolingExcelImportListener(); |
|||
excelDataClass = LingshanHelpCrowdGaolingExcelData.class; |
|||
} else if (LingShanHelpCrowdTypeEnum.KONGCHAO.getType().equals(crowdType)) { |
|||
listener = new LingShanHelpCrowdKongchaoExcelImportListener(); |
|||
excelDataClass = LingshanHelpCrowdKongchaoExcelData.class; |
|||
} else if (LingShanHelpCrowdTypeEnum.LIUSHOU.getType().equals(crowdType)) { |
|||
listener = new LingShanHelpCrowdLiushouExcelImportListener(); |
|||
excelDataClass = LingshanHelpCrowdLiushouExcelData.class; |
|||
} else if (LingShanHelpCrowdTypeEnum.TEKUN.getType().equals(crowdType)) { |
|||
listener = new LingShanHelpCrowdTekunExcelImportListener(); |
|||
excelDataClass = LingshanHelpCrowdTekunExcelData.class; |
|||
} else { |
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "【灵山街道-重点帮扶】导入。不支持的人群类别:" + crowdType); |
|||
} |
|||
|
|||
// Execute reading
|
|||
// ReadSheet sheet = EasyExcel.readSheet(0).registerReadListener(listener).build();
|
|||
// EasyExcel.read(fileSavePath).build().read(sheet);
|
|||
|
|||
// 解析表头,判断表头是否合格
|
|||
try { |
|||
listener.setValidateHeaderOnly(true); |
|||
EasyExcel.read(fileSavePath, excelDataClass, listener) |
|||
.headRowNumber(listener.getMaxHeadRowNum()) |
|||
.sheet(0) |
|||
.doRead(); |
|||
} catch ( |
|||
ReadExcelHeaderOnlyException e) { |
|||
log.info("【灵山街道-导入社会维稳】验证通过,可以继续导入"); |
|||
} |
|||
|
|||
// 正式开始导入。异步导入
|
|||
listener.setValidateHeaderOnly(false); |
|||
|
|||
// 创建导入任务
|
|||
ImportTaskCommonResultDTO importTaskRst = getResultDataOrThrowsException(ImportTaskUtils.createImportTask(originalFilename, |
|||
BizTypeEnum.SPECIAL_CROWD.getType()), |
|||
ServiceConstant.EPMET_COMMON_SERVICE, |
|||
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), |
|||
null, "【灵山街道-导入重点帮扶人群】创建导入任务失败"); |
|||
|
|||
try { |
|||
submitAsyncImport(fileSavePath, excelDataClass, listener, importTaskRst.getTaskId()); |
|||
return importTaskRst.getTaskId(); |
|||
} catch (Exception e) { |
|||
// 如果提交异步任务失败了,也要将导入任务置为结束,并且返回一个未知错误
|
|||
log.error("【灵山街道-导入重点帮扶人群】失败,错误信息:" + ExceptionUtils.getErrorStackTrace(e)); |
|||
ImportTaskUtils.finishImportTask(importTaskRst.getTaskId(), |
|||
ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, null, "未知错误"); |
|||
|
|||
// 删除文件
|
|||
FileUtils.deleteFileIfExists(fileSavePath); |
|||
|
|||
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "导入失败,未知错误"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @Description: 提交异步任务 |
|||
* @param fileSavePath: |
|||
* @param excelDataClass: |
|||
* @param listener: |
|||
* @param taskId: |
|||
* @Return void |
|||
* @Author: wangxianzhang |
|||
* @Date: 2023/5/19 4:02 PM |
|||
*/ |
|||
private void submitAsyncImport(String fileSavePath, Class excelDataClass, AbstractLingShanHelpCrowdExcelImportListener listener, String taskId) { |
|||
CompletableFuture.runAsync(() -> { |
|||
try { |
|||
EasyExcel.read(fileSavePath, excelDataClass, listener) |
|||
.headRowNumber(listener.getMaxHeadRowNum()) |
|||
.sheet(0) |
|||
.doRead(); |
|||
|
|||
List<LingShanSpecialCrowdDetailBaseExcelData> errorDatas = listener.getErrorDatas(); |
|||
if (CollectionUtils.isNotEmpty(errorDatas)) { |
|||
// 有错误数据需要提示
|
|||
String resultDescFilePath = uploadResultDescFilePath(errorDatas, listener.getTemplateFileName()); |
|||
ImportTaskUtils.finishImportTask(taskId, |
|||
ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, resultDescFilePath, "失败,请导出文件查看详细信息", |
|||
listener.getSuccessedItemsQty(), listener.getFailedItemsQty()); |
|||
} else { |
|||
// 全部成功
|
|||
ImportTaskUtils.finishImportTask(taskId, |
|||
ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS, null, "成功"); |
|||
} |
|||
} catch (Exception e) { |
|||
log.error("【灵山街道-导入重点帮扶人群】失败,错误信息:" + ExceptionUtils.getErrorStackTrace(e)); |
|||
ImportTaskUtils.finishImportTask(taskId, |
|||
ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, null, "未知错误"); |
|||
} finally { |
|||
FileUtils.deleteFileIfExists(fileSavePath); |
|||
} |
|||
}, executorService); |
|||
} |
|||
|
|||
/** |
|||
* @description: 上传错误描述文件 |
|||
* @param errorDatas: |
|||
* @return |
|||
* @author: WangXianZhang |
|||
* @date: 2023/4/19 10:19 PM |
|||
*/ |
|||
private String uploadResultDescFilePath(List<LingShanSpecialCrowdDetailBaseExcelData> errorDatas, String templateFileName) { |
|||
FileItem fileItem = null; |
|||
try { |
|||
String fileName = |
|||
DateUtils.format(new Date(), "yyyyMMdd_HHmmss_") + System.nanoTime() + "重点帮扶人群导入失败数据.xlsx"; |
|||
|
|||
// 创建临时文件
|
|||
fileItem = new DiskFileItemFactory(DiskFileItemFactory.DEFAULT_SIZE_THRESHOLD, FileUtils.getAndCreateDirUnderEpmetFilesDir("temp").toFile()) |
|||
.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), false, fileName); |
|||
|
|||
// 写入临时文件
|
|||
try (OutputStream os = fileItem.getOutputStream()) { |
|||
WriteSheet sheet = EasyExcel.writerSheet(0).build(); |
|||
InputStream templateIs = this.getClass().getClassLoader().getResourceAsStream(templateFileName); |
|||
ExcelWriter excelWriter = EasyExcel.write(os).withTemplate(templateIs).build().fill(errorDatas, sheet); |
|||
excelWriter.finish(); |
|||
} catch (IOException e) { |
|||
throw new RuntimeException(e); |
|||
} |
|||
|
|||
// 上传文件
|
|||
UploadImgResultDTO uploadRst = getResultDataOrThrowsException(ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)), ServiceConstant.EPMET_COMMON_SERVICE, |
|||
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), |
|||
null, "【灵山街道-导入重点帮扶人群】上传错误描述文件失败。"); |
|||
|
|||
return uploadRst.getUrl(); |
|||
|
|||
} catch (IOException e) { |
|||
throw new RuntimeException("【灵山街道-导入重点帮扶人群】生成错误描述文件-创建临时目录失败"); |
|||
} finally { |
|||
try { |
|||
fileItem.delete(); |
|||
} catch (Exception e) { |
|||
log.error("【灵山街道-导入重点帮扶人群】删除fileItem临时文件失败"); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
@Override |
|||
public void save(List<LingshanHelpCrowdCanjiEntity> entities, LingshanHelpCrowdCanjiEntity t) { |
|||
for (LingshanHelpCrowdCanjiEntity entity : entities) { |
|||
LambdaQueryWrapper<LingshanHelpCrowdCanjiEntity> q = new LambdaQueryWrapper<>(); |
|||
q.eq(LingshanHelpCrowdCanjiEntity::getResiId, entity.getResiId()); |
|||
|
|||
LingshanHelpCrowdCanjiEntity existsOne; |
|||
if ((existsOne = lingshanHelpCrowdCanjiDao.selectOne(q)) != null) { |
|||
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); |
|||
lingshanHelpCrowdCanjiDao.updateById(existsOne); |
|||
continue; |
|||
} |
|||
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
lingshanHelpCrowdCanjiDao.insert(entity); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void save(List<LingshanHelpCrowdDabingEntity> entities, LingshanHelpCrowdDabingEntity t) { |
|||
for (LingshanHelpCrowdDabingEntity entity : entities) { |
|||
LambdaQueryWrapper<LingshanHelpCrowdDabingEntity> q = new LambdaQueryWrapper<>(); |
|||
q.eq(LingshanHelpCrowdDabingEntity::getResiId, entity.getResiId()); |
|||
|
|||
LingshanHelpCrowdDabingEntity existsOne; |
|||
if ((existsOne = lingshanHelpCrowdDabingDao.selectOne(q)) != null) { |
|||
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); |
|||
lingshanHelpCrowdDabingDao.updateById(existsOne); |
|||
continue; |
|||
} |
|||
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
lingshanHelpCrowdDabingDao.insert(entity); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void save(List<LingshanHelpCrowdDibaoEntity> entities, LingshanHelpCrowdDibaoEntity lingshanHelpCrowdDibaoEntity) { |
|||
for (LingshanHelpCrowdDibaoEntity entity : entities) { |
|||
LambdaQueryWrapper<LingshanHelpCrowdDibaoEntity> q = new LambdaQueryWrapper<>(); |
|||
q.eq(LingshanHelpCrowdDibaoEntity::getResiId, entity.getResiId()); |
|||
|
|||
LingshanHelpCrowdDibaoEntity existsOne; |
|||
if ((existsOne = lingshanHelpCrowdDibaoDao.selectOne(q)) != null) { |
|||
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); |
|||
lingshanHelpCrowdDibaoDao.updateById(existsOne); |
|||
continue; |
|||
} |
|||
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
|
|||
lingshanHelpCrowdDibaoDao.insert(entity); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void save(List<LingshanHelpCrowdDujuEntity> entities, LingshanHelpCrowdDujuEntity lingshanHelpCrowdDujuEntity) { |
|||
for (LingshanHelpCrowdDujuEntity entity : entities) { |
|||
LambdaQueryWrapper<LingshanHelpCrowdDujuEntity> q = new LambdaQueryWrapper<>(); |
|||
q.eq(LingshanHelpCrowdDujuEntity::getResiId, entity.getResiId()); |
|||
|
|||
LingshanHelpCrowdDujuEntity existsOne; |
|||
if ((existsOne = lingshanHelpCrowdDujuDao.selectOne(q)) != null) { |
|||
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); |
|||
lingshanHelpCrowdDujuDao.updateById(existsOne); |
|||
continue; |
|||
} |
|||
|
|||
entity.setId(IdWorker.getIdStr()); |
|||
|
|||
lingshanHelpCrowdDujuDao.insert(entity); |
|||
} |
|||
|
|||
} |
|||
|
|||
@Override |
|||
public void save(List<LingshanHelpCrowdGaolingEntity> entities, LingshanHelpCrowdGaolingEntity lingshanHelpCrowdGaolingEntity) { |
|||
for (LingshanHelpCrowdGaolingEntity entity : entities) { |
|||
LambdaQueryWrapper<LingshanHelpCrowdGaolingEntity> q = new LambdaQueryWrapper<>(); |
|||
q.eq(LingshanHelpCrowdGaolingEntity::getResiId, entity.getResiId()); |
|||
|
|||
LingshanHelpCrowdGaolingEntity existsOne; |
|||
if ((existsOne = lingshanHelpCrowdGaolingDao.selectOne(q)) != null) { |
|||
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); |
|||
lingshanHelpCrowdGaolingDao.updateById(existsOne); |
|||
continue; |
|||
} |
|||
|
|||
lingshanHelpCrowdGaolingDao.insert(entity); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void save(List<LingshanHelpCrowdKongchaoEntity> entities, LingshanHelpCrowdKongchaoEntity lingshanHelpCrowdKongchaoEntity) { |
|||
for (LingshanHelpCrowdKongchaoEntity entity : entities) { |
|||
LambdaQueryWrapper<LingshanHelpCrowdKongchaoEntity> q = new LambdaQueryWrapper<>(); |
|||
q.eq(LingshanHelpCrowdKongchaoEntity::getResiId, entity.getResiId()); |
|||
|
|||
LingshanHelpCrowdKongchaoEntity existsOne; |
|||
if ((existsOne = lingshanHelpCrowdKongchaoDao.selectOne(q)) != null) { |
|||
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); |
|||
lingshanHelpCrowdKongchaoDao.updateById(existsOne); |
|||
continue; |
|||
} |
|||
|
|||
lingshanHelpCrowdKongchaoDao.insert(entity); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void save(List<LingshanHelpCrowdLiushouEntity> entities, LingshanHelpCrowdLiushouEntity lingshanHelpCrowdLiushouEntity) { |
|||
for (LingshanHelpCrowdLiushouEntity entity : entities) { |
|||
LambdaQueryWrapper<LingshanHelpCrowdLiushouEntity> q = new LambdaQueryWrapper<>(); |
|||
q.eq(LingshanHelpCrowdLiushouEntity::getResiId, entity.getResiId()); |
|||
|
|||
LingshanHelpCrowdLiushouEntity existsOne; |
|||
if ((existsOne = lingshanHelpCrowdLiushouDao.selectOne(q)) != null) { |
|||
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); |
|||
lingshanHelpCrowdLiushouDao.updateById(existsOne); |
|||
continue; |
|||
} |
|||
|
|||
lingshanHelpCrowdLiushouDao.insert(entity); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public void save(List<LingshanHelpCrowdTekunEntity> entities, LingshanHelpCrowdTekunEntity lingshanHelpCrowdTekunEntity) { |
|||
|
|||
for (LingshanHelpCrowdTekunEntity entity : entities) { |
|||
LambdaQueryWrapper<LingshanHelpCrowdTekunEntity> q = new LambdaQueryWrapper<>(); |
|||
q.eq(LingshanHelpCrowdTekunEntity::getResiId, entity.getResiId()); |
|||
|
|||
LingshanHelpCrowdTekunEntity existsOne; |
|||
if ((existsOne = lingshanHelpCrowdTekunDao.selectOne(q)) != null) { |
|||
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS); |
|||
lingshanHelpCrowdTekunDao.updateById(existsOne); |
|||
continue; |
|||
} |
|||
|
|||
lingshanHelpCrowdTekunDao.insert(entity); |
|||
} |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.LingshanHelpCrowdCanjiDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.LingshanHelpCrowdCanjiEntity" id="lingshanHelpCrowdCanjiMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="orgIdPath" column="ORG_ID_PATH"/> |
|||
<result property="resiId" column="RESI_ID"/> |
|||
<result property="idCard" column="ID_CARD"/> |
|||
<result property="cjzh" column="CJZH"/> |
|||
<result property="cjlb" column="CJLB"/> |
|||
<result property="cjzk" column="CJZK"/> |
|||
<result property="validityStart" column="VALIDITY_START"/> |
|||
<result property="living" column="LIVING"/> |
|||
<result property="dieDate" column="DIE_DATE"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,26 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.LingshanHelpCrowdDabingDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.LingshanHelpCrowdDabingEntity" id="lingshanHelpCrowdDabingMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="orgIdPath" column="ORG_ID_PATH"/> |
|||
<result property="resiId" column="RESI_ID"/> |
|||
<result property="idCard" column="ID_CARD"/> |
|||
<result property="shbz" column="SHBZ"/> |
|||
<result property="hbsj" column="HBSJ"/> |
|||
<result property="jzqk" column="JZQK"/> |
|||
<result property="jzje" column="JZJE"/> |
|||
<result property="grfd" column="GRFD"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,40 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.LingshanHelpCrowdDibaoDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.LingshanHelpCrowdDibaoEntity" id="lingshanHelpCrowdDibaoMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="orgIdPath" column="ORG_ID_PATH"/> |
|||
<result property="resiId" column="RESI_ID"/> |
|||
<result property="idCard" column="ID_CARD"/> |
|||
<result property="hjlx" column="HJLX"/> |
|||
<result property="dblx" column="DBLX"/> |
|||
<result property="dbzh" column="DBZH"/> |
|||
<result property="hyzk" column="HYZK"/> |
|||
<result property="jyqk" column="JYQK"/> |
|||
<result property="nsr" column="NSR"/> |
|||
<result property="isCj" column="IS_CJ"/> |
|||
<result property="ynLdnl" column="YN_LDNL"/> |
|||
<result property="jkzk" column="JKZK"/> |
|||
<result property="shbz" column="SHBZ"/> |
|||
<result property="cblx" column="CBLX"/> |
|||
<result property="zcxsyf" column="ZCXSYF"/> |
|||
<result property="jdlkfpdx" column="JDLKFPDX"/> |
|||
<result property="khyh" column="KHYH"/> |
|||
<result property="htmc" column="HTMC"/> |
|||
<result property="yhzh" column="YHZH"/> |
|||
<result property="hybzje" column="HYBZJE"/> |
|||
<result property="ryfjzc" column="RYFJZC"/> |
|||
<result property="jzjjsfs" column="JZJJSFS"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,28 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.LingshanHelpCrowdDujuDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.LingshanHelpCrowdDujuEntity" id="lingshanHelpCrowdDujuMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="orgIdPath" column="ORG_ID_PATH"/> |
|||
<result property="resiId" column="RESI_ID"/> |
|||
<result property="idCard" column="ID_CARD"/> |
|||
<result property="jzzk" column="JZZK"/> |
|||
<result property="jhrxm" column="JHRXM"/> |
|||
<result property="jhrdh" column="JHRDH"/> |
|||
<result property="jhrylrgx" column="JHRYLRGX"/> |
|||
<result property="jkzk" column="JKZK"/> |
|||
<result property="tsjg" column="TSJG"/> |
|||
<result property="remark" column="REMARK"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,28 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.LingshanHelpCrowdGaolingDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.LingshanHelpCrowdGaolingEntity" id="lingshanHelpCrowdGaolingMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="orgIdPath" column="ORG_ID_PATH"/> |
|||
<result property="resiId" column="RESI_ID"/> |
|||
<result property="idCard" column="ID_CARD"/> |
|||
<result property="yhzh" column="YHZH"/> |
|||
<result property="jtje" column="JTJE"/> |
|||
<result property="ffqk" column="FFQK"/> |
|||
<result property="zlqk" column="ZLQK"/> |
|||
<result property="jhrxm" column="JHRXM"/> |
|||
<result property="jhrdh" column="JHRDH"/> |
|||
<result property="remark" column="REMARK"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,28 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.LingshanHelpCrowdKongchaoDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.LingshanHelpCrowdKongchaoEntity" id="lingshanHelpCrowdKongchaoMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="orgIdPath" column="ORG_ID_PATH"/> |
|||
<result property="resiId" column="RESI_ID"/> |
|||
<result property="idCard" column="ID_CARD"/> |
|||
<result property="jzzk" column="JZZK"/> |
|||
<result property="jhrxm" column="JHRXM"/> |
|||
<result property="jhrdh" column="JHRDH"/> |
|||
<result property="jhrylrgx" column="JHRYLRGX"/> |
|||
<result property="jkzk" column="JKZK"/> |
|||
<result property="tsjg" column="TSJG"/> |
|||
<result property="remark" column="REMARK"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,28 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.LingshanHelpCrowdLiushouDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.LingshanHelpCrowdLiushouEntity" id="lingshanHelpCrowdLiushouMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="orgIdPath" column="ORG_ID_PATH"/> |
|||
<result property="resiId" column="RESI_ID"/> |
|||
<result property="idCard" column="ID_CARD"/> |
|||
<result property="jhrxm" column="JHRXM"/> |
|||
<result property="jhrdh" column="JHRDH"/> |
|||
<result property="yjhrgx" column="YJHRGX"/> |
|||
<result property="szxxjbj" column="SZXXJBJ"/> |
|||
<result property="bzrxm" column="BZRXM"/> |
|||
<result property="bzrdh" column="BZRDH"/> |
|||
<result property="remark" column="REMARK"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,22 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.LingshanHelpCrowdResiMergeDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.LingshanHelpCrowdResiMergeEntity" id="lingshanHelpCrowdResiMergeMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="orgIdPath" column="ORG_ID_PATH"/> |
|||
<result property="resiId" column="RESI_ID"/> |
|||
<result property="idCard" column="ID_CARD"/> |
|||
<result property="crowdType" column="CROWD_TYPE"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
@ -0,0 +1,40 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.LingshanHelpCrowdTekunDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.LingshanHelpCrowdTekunEntity" id="lingshanHelpCrowdTekunMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="orgIdPath" column="ORG_ID_PATH"/> |
|||
<result property="resiId" column="RESI_ID"/> |
|||
<result property="idCard" column="ID_CARD"/> |
|||
<result property="hjlx" column="HJLX"/> |
|||
<result property="dbzh" column="DBZH"/> |
|||
<result property="hyzk" column="HYZK"/> |
|||
<result property="jyqk" column="JYQK"/> |
|||
<result property="nsr" column="NSR"/> |
|||
<result property="isCj" column="IS_CJ"/> |
|||
<result property="shzlnl" column="SHZLNL"/> |
|||
<result property="jkzk" column="JKZK"/> |
|||
<result property="shbz" column="SHBZ"/> |
|||
<result property="cblx" column="CBLX"/> |
|||
<result property="zcxsyf" column="ZCXSYF"/> |
|||
<result property="jdlkfpdx" column="JDLKFPDX"/> |
|||
<result property="khyh" column="KHYH"/> |
|||
<result property="htmc" column="HTMC"/> |
|||
<result property="yhzh" column="YHZH"/> |
|||
<result property="gyfs" column="GYFS"/> |
|||
<result property="gyjgmc" column="GYJGMC"/> |
|||
<result property="jbshbz" column="JBSHBZ"/> |
|||
<result property="zlhlfy" column="ZLHLFY"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
|||
Loading…
Reference in new issue