|
@ -7,7 +7,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
import com.epmet.bean.PersonHelpTypeBean; |
|
|
import com.epmet.bean.PersonHelpTypeBean; |
|
|
import com.epmet.commons.tools.constant.ServiceConstant; |
|
|
import com.epmet.commons.tools.constant.ServiceConstant; |
|
|
|
|
|
import com.epmet.commons.tools.dto.result.OptionResultDTO; |
|
|
import com.epmet.commons.tools.enums.BizTypeEnum; |
|
|
import com.epmet.commons.tools.enums.BizTypeEnum; |
|
|
|
|
|
import com.epmet.commons.tools.enums.GenderEnum; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
|
import com.epmet.commons.tools.exception.ExceptionUtils; |
|
@ -29,6 +31,7 @@ import com.epmet.dto.result.ImportTaskCommonResultDTO; |
|
|
import com.epmet.dto.result.LingShanSpecialCrowdListResultDTO; |
|
|
import com.epmet.dto.result.LingShanSpecialCrowdListResultDTO; |
|
|
import com.epmet.dto.result.UploadImgResultDTO; |
|
|
import com.epmet.dto.result.UploadImgResultDTO; |
|
|
import com.epmet.dto.result.lingshan.LingShanHelpCrowdListRstDTO; |
|
|
import com.epmet.dto.result.lingshan.LingShanHelpCrowdListRstDTO; |
|
|
|
|
|
import com.epmet.dto.result.lingshan.LingshanHelpCrowdDetailRstDTO; |
|
|
import com.epmet.entity.*; |
|
|
import com.epmet.entity.*; |
|
|
import com.epmet.enums.LingShanHelpCrowdCommonEnums; |
|
|
import com.epmet.enums.LingShanHelpCrowdCommonEnums; |
|
|
import com.epmet.enums.LingShanHelpCrowdTypeEnum; |
|
|
import com.epmet.enums.LingShanHelpCrowdTypeEnum; |
|
@ -36,6 +39,7 @@ import com.epmet.enums.LingShanSpecialCrowdTypeEnums; |
|
|
import com.epmet.excel.data.*; |
|
|
import com.epmet.excel.data.*; |
|
|
import com.epmet.excel.handler.*; |
|
|
import com.epmet.excel.handler.*; |
|
|
import com.epmet.exceptions.ReadExcelHeaderOnlyException; |
|
|
import com.epmet.exceptions.ReadExcelHeaderOnlyException; |
|
|
|
|
|
import com.epmet.feign.EpmetAdminOpenFeignClient; |
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
import com.epmet.feign.OssFeignClient; |
|
|
import com.epmet.feign.OssFeignClient; |
|
|
import com.epmet.remote.EpmetUserRemoteService; |
|
|
import com.epmet.remote.EpmetUserRemoteService; |
|
@ -110,6 +114,9 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R |
|
|
@Autowired |
|
|
@Autowired |
|
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
|
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private EpmetAdminOpenFeignClient adminOpenFeignClient; |
|
|
|
|
|
|
|
|
private String[] COPY_IGNORED_FIELDS = { "id", "customerId", "resiId", "idCard", "createdTime", "createdBy" }; |
|
|
private String[] COPY_IGNORED_FIELDS = { "id", "customerId", "resiId", "idCard", "createdTime", "createdBy" }; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -288,12 +295,12 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R |
|
|
// 有错误数据需要提示
|
|
|
// 有错误数据需要提示
|
|
|
String resultDescFilePath = uploadResultDescFilePath(errorDatas, listener.getTemplateFileName()); |
|
|
String resultDescFilePath = uploadResultDescFilePath(errorDatas, listener.getTemplateFileName()); |
|
|
ImportTaskUtils.finishImportTask(taskId, |
|
|
ImportTaskUtils.finishImportTask(taskId, |
|
|
ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, resultDescFilePath, "失败,请导出文件查看详细信息", |
|
|
ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL, resultDescFilePath, "失败,请下载文件查看详细信息", |
|
|
listener.getSuccessedItemsQty(), listener.getFailedItemsQty()); |
|
|
listener.getSuccessedItemsQty(), listener.getFailedItemsQty()); |
|
|
} else { |
|
|
} else { |
|
|
// 全部成功
|
|
|
// 全部成功
|
|
|
ImportTaskUtils.finishImportTask(taskId, |
|
|
ImportTaskUtils.finishImportTask(taskId, |
|
|
ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS, null, "成功"); |
|
|
ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS, null, "成功", listener.getSuccessedItemsQty(), listener.getFailedItemsQty()); |
|
|
} |
|
|
} |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
log.error("【灵山街道-导入重点帮扶人群】失败,错误信息:" + ExceptionUtils.getErrorStackTrace(e)); |
|
|
log.error("【灵山街道-导入重点帮扶人群】失败,错误信息:" + ExceptionUtils.getErrorStackTrace(e)); |
|
@ -771,4 +778,108 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R |
|
|
helpCrowdResiMergeDao.delete(qm); |
|
|
helpCrowdResiMergeDao.delete(qm); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public LingshanHelpCrowdDetailRstDTO getDetailByResiId(String resiId) { |
|
|
|
|
|
|
|
|
|
|
|
// --------------先查询居民,设置基础信息----------------
|
|
|
|
|
|
IcResiUserEntity resi = icResiUserDao.selectById(resiId); |
|
|
|
|
|
|
|
|
|
|
|
if (resi == null) { |
|
|
|
|
|
log.warn("【灵山-重点帮扶人员】管理:查看详情->未找到居民信息,居民ID:" + resiId); |
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "未找到居民信息"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 准备一些字典
|
|
|
|
|
|
List<OptionResultDTO> nationDict = getResultDataOrThrowsException(adminOpenFeignClient.getNationOption(), ServiceConstant.EPMET_ADMIN_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), null, "找不到【民族】字典"); |
|
|
|
|
|
|
|
|
|
|
|
LingshanHelpCrowdDetailRstDTO rst = new LingshanHelpCrowdDetailRstDTO(); |
|
|
|
|
|
rst.setName(resi.getName()); |
|
|
|
|
|
rst.setGender(resi.getGender()); |
|
|
|
|
|
rst.setGenderZh(GenderEnum.getName(resi.getGender())); |
|
|
|
|
|
|
|
|
|
|
|
// 民族
|
|
|
|
|
|
String nationCode; |
|
|
|
|
|
if (StringUtils.isNotBlank(nationCode = resi.getMz())) { |
|
|
|
|
|
for (OptionResultDTO n : nationDict) { |
|
|
|
|
|
if (nationCode.equals(n.getValue())) { |
|
|
|
|
|
rst.setNation(n.getLabel()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
rst.setBirthday(resi.getBirthday()); |
|
|
|
|
|
rst.setDomicilePlace(resi.getHjszd()); |
|
|
|
|
|
rst.setMobile(resi.getMobile()); |
|
|
|
|
|
rst.setAddress(getAddressOfResi(resi.getGridId(), resi.getHomeId())); |
|
|
|
|
|
rst.setIdCard(resi.getIdCard()); |
|
|
|
|
|
rst.setHeadPhoto(resi.getHeadPhoto()); |
|
|
|
|
|
|
|
|
|
|
|
// -------------- 开始查询各类的详细信息-----------------
|
|
|
|
|
|
// 有哪些分类
|
|
|
|
|
|
LambdaQueryWrapper<LingshanHelpCrowdResiMergeEntity> qMerge = new LambdaQueryWrapper<>(); |
|
|
|
|
|
qMerge.eq(LingshanHelpCrowdResiMergeEntity::getResiId, resiId); |
|
|
|
|
|
Set<String> types = helpCrowdResiMergeDao.selectList(qMerge).stream().map(LingshanHelpCrowdResiMergeEntity::getCrowdType).collect(Collectors.toSet()); |
|
|
|
|
|
|
|
|
|
|
|
LingshanHelpCrowdDetailRstDTO.HelpCrowdDetails helpCrowdDetails = rst.getHelpCrowdDetails(); |
|
|
|
|
|
|
|
|
|
|
|
if (types.contains(LingShanHelpCrowdTypeEnum.TEKUN.getType())) { |
|
|
|
|
|
LambdaQueryWrapper<LingshanHelpCrowdTekunEntity> qTk = new LambdaQueryWrapper<>(); |
|
|
|
|
|
qTk.eq(LingshanHelpCrowdTekunEntity::getResiId, resiId); |
|
|
|
|
|
LingshanHelpCrowdTekunEntity etk = lingshanHelpCrowdTekunDao.selectOne(qTk); |
|
|
|
|
|
helpCrowdDetails.setTekun(ConvertUtils.sourceToTarget(etk, LingshanHelpCrowdDetailRstDTO.Tekun.class)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (types.contains(LingShanHelpCrowdTypeEnum.CANJI.getType())) { |
|
|
|
|
|
LambdaQueryWrapper<LingshanHelpCrowdCanjiEntity> qcj = new LambdaQueryWrapper<>(); |
|
|
|
|
|
qcj.eq(LingshanHelpCrowdCanjiEntity::getResiId, resiId); |
|
|
|
|
|
LingshanHelpCrowdCanjiEntity ecj = lingshanHelpCrowdCanjiDao.selectOne(qcj); |
|
|
|
|
|
helpCrowdDetails.setCanji(ConvertUtils.sourceToTarget(ecj, LingshanHelpCrowdDetailRstDTO.Canji.class)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (types.contains(LingShanHelpCrowdTypeEnum.DABING.getType())) { |
|
|
|
|
|
LambdaQueryWrapper<LingshanHelpCrowdDabingEntity> qdb = new LambdaQueryWrapper<>(); |
|
|
|
|
|
qdb.eq(LingshanHelpCrowdDabingEntity::getResiId, resiId); |
|
|
|
|
|
LingshanHelpCrowdDabingEntity ecj = lingshanHelpCrowdDabingDao.selectOne(qdb); |
|
|
|
|
|
helpCrowdDetails.setDabing(ConvertUtils.sourceToTarget(ecj, LingshanHelpCrowdDetailRstDTO.Dabing.class)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (types.contains(LingShanHelpCrowdTypeEnum.DIBAO.getType())) { |
|
|
|
|
|
LambdaQueryWrapper<LingshanHelpCrowdDibaoEntity> qDibao = new LambdaQueryWrapper<>(); |
|
|
|
|
|
qDibao.eq(LingshanHelpCrowdDibaoEntity::getResiId, resiId); |
|
|
|
|
|
LingshanHelpCrowdDibaoEntity eDibao = lingshanHelpCrowdDibaoDao.selectOne(qDibao); |
|
|
|
|
|
helpCrowdDetails.setDibao(ConvertUtils.sourceToTarget(eDibao, LingshanHelpCrowdDetailRstDTO.Dibao.class)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (types.contains(LingShanHelpCrowdTypeEnum.KONGCHAO.getType())) { |
|
|
|
|
|
LambdaQueryWrapper<LingshanHelpCrowdKongchaoEntity> qKongchao = new LambdaQueryWrapper<>(); |
|
|
|
|
|
qKongchao.eq(LingshanHelpCrowdKongchaoEntity::getResiId, resiId); |
|
|
|
|
|
LingshanHelpCrowdKongchaoEntity eKongchao = lingshanHelpCrowdKongchaoDao.selectOne(qKongchao); |
|
|
|
|
|
helpCrowdDetails.setKongchao(ConvertUtils.sourceToTarget(eKongchao, LingshanHelpCrowdDetailRstDTO.Kongchao.class)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (types.contains(LingShanHelpCrowdTypeEnum.DUJU.getType())) { |
|
|
|
|
|
LambdaQueryWrapper<LingshanHelpCrowdDujuEntity> qDuju = new LambdaQueryWrapper<>(); |
|
|
|
|
|
qDuju.eq(LingshanHelpCrowdDujuEntity::getResiId, resiId); |
|
|
|
|
|
LingshanHelpCrowdDujuEntity eDuju = lingshanHelpCrowdDujuDao.selectOne(qDuju); |
|
|
|
|
|
helpCrowdDetails.setDuju(ConvertUtils.sourceToTarget(eDuju, LingshanHelpCrowdDetailRstDTO.Duju.class)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (types.contains(LingShanHelpCrowdTypeEnum.LIUSHOU.getType())) { |
|
|
|
|
|
LambdaQueryWrapper<LingshanHelpCrowdLiushouEntity> qliushou = new LambdaQueryWrapper<>(); |
|
|
|
|
|
qliushou.eq(LingshanHelpCrowdLiushouEntity::getResiId, resiId); |
|
|
|
|
|
LingshanHelpCrowdLiushouEntity eLiushou = lingshanHelpCrowdLiushouDao.selectOne(qliushou); |
|
|
|
|
|
helpCrowdDetails.setLiushou(ConvertUtils.sourceToTarget(eLiushou, LingshanHelpCrowdDetailRstDTO.Liushou.class)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (types.contains(LingShanHelpCrowdTypeEnum.GAOLING.getType())) { |
|
|
|
|
|
LambdaQueryWrapper<LingshanHelpCrowdGaolingEntity> qGaoling = new LambdaQueryWrapper<>(); |
|
|
|
|
|
qGaoling.eq(LingshanHelpCrowdGaolingEntity::getResiId, resiId); |
|
|
|
|
|
LingshanHelpCrowdGaolingEntity eGaoling = lingshanHelpCrowdGaolingDao.selectOne(qGaoling); |
|
|
|
|
|
helpCrowdDetails.setGaoling(ConvertUtils.sourceToTarget(eGaoling, LingshanHelpCrowdDetailRstDTO.Gaoling.class)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return rst; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|