Browse Source

【重点帮扶】:导入、保存的时候,增加针对居民信息更新的回调

master
wxz 2 years ago
parent
commit
186110e97b
  1. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdCanjiExcelImportListener.java
  2. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDabingExcelImportListener.java
  3. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDibaoExcelImportListener.java
  4. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDujuExcelImportListener.java
  5. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdGaolingExcelImportListener.java
  6. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdKongchaoExcelImportListener.java
  7. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdLiushouExcelImportListener.java
  8. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdTekunExcelImportListener.java
  9. 32
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/AbstractLingshanHelpCrowdCallbackProcessor.java
  10. 32
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdCanjiCallbackProcessor.java
  11. 35
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdDabingCallbackProcessor.java
  12. 28
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdDibaoCallbackProcessor.java
  13. 22
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdDujuCallbackProcessor.java
  14. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdGaolingCallbackProcessor.java
  15. 28
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdKongchaoCallbackProcessor.java
  16. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdLiushouCallbackProcessor.java
  17. 42
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdResiBaseInfoCallbackProcessor.java
  18. 18
      epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdTekunCallbackProcessor.java
  19. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanHelpCrowdService.java
  20. 117
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanHelpCrowdServiceImpl.java

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdCanjiExcelImportListener.java

@ -11,7 +11,7 @@ public class LingShanHelpCrowdCanjiExcelImportListener
extends AbstractLingShanHelpCrowdExcelImportListener<LingshanHelpCrowdCanjiExcelData, LingshanHelpCrowdCanjiEntity> {
@Override
void saveBatchCallback(List<LingshanHelpCrowdCanjiEntity> entities) {
lingShanHelpCrowdService.save(entities, new LingshanHelpCrowdCanjiEntity());
lingShanHelpCrowdService.save(entities, new LingshanHelpCrowdCanjiEntity(), null);
}
@Override

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDabingExcelImportListener.java

@ -13,7 +13,7 @@ public class LingShanHelpCrowdDabingExcelImportListener
extends AbstractLingShanHelpCrowdExcelImportListener<LingshanHelpCrowdDabingExcelData, LingshanHelpCrowdDabingEntity> {
@Override
void saveBatchCallback(List<LingshanHelpCrowdDabingEntity> entities) {
lingShanHelpCrowdService.save(entities, entities.get(0));
lingShanHelpCrowdService.save(entities, entities.get(0), null);
}
@Override

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDibaoExcelImportListener.java

@ -13,7 +13,7 @@ public class LingShanHelpCrowdDibaoExcelImportListener
extends AbstractLingShanHelpCrowdExcelImportListener<LingshanHelpCrowdDibaoExcelData, LingshanHelpCrowdDibaoEntity> {
@Override
void saveBatchCallback(List<LingshanHelpCrowdDibaoEntity> entities) {
lingShanHelpCrowdService.save(entities, entities.get(0));
lingShanHelpCrowdService.save(entities, entities.get(0), null);
}
@Override

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdDujuExcelImportListener.java

@ -12,7 +12,7 @@ public class LingShanHelpCrowdDujuExcelImportListener
@Override
void saveBatchCallback(List<LingshanHelpCrowdDujuEntity> entities) {
lingShanHelpCrowdService.save(entities, entities.get(0));
lingShanHelpCrowdService.save(entities, entities.get(0), null);
}
@Override

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdGaolingExcelImportListener.java

@ -12,7 +12,7 @@ public class LingShanHelpCrowdGaolingExcelImportListener
@Override
void saveBatchCallback(List<LingshanHelpCrowdGaolingEntity> entities) {
lingShanHelpCrowdService.save(entities, entities.get(0));
lingShanHelpCrowdService.save(entities, entities.get(0), null);
}
@Override

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdKongchaoExcelImportListener.java

@ -12,7 +12,7 @@ public class LingShanHelpCrowdKongchaoExcelImportListener
@Override
void saveBatchCallback(List<LingshanHelpCrowdKongchaoEntity> entities) {
lingShanHelpCrowdService.save(entities, entities.get(0));
lingShanHelpCrowdService.save(entities, entities.get(0), null);
}
@Override

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdLiushouExcelImportListener.java

@ -12,7 +12,7 @@ public class LingShanHelpCrowdLiushouExcelImportListener
@Override
void saveBatchCallback(List<LingshanHelpCrowdLiushouEntity> entities) {
lingShanHelpCrowdService.save(entities, entities.get(0));
lingShanHelpCrowdService.save(entities, entities.get(0), null);
}
@Override

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/LingShanHelpCrowdTekunExcelImportListener.java

@ -12,7 +12,7 @@ public class LingShanHelpCrowdTekunExcelImportListener
@Override
void saveBatchCallback(List<LingshanHelpCrowdTekunEntity> entities) {
lingShanHelpCrowdService.save(entities, entities.get(0));
lingShanHelpCrowdService.save(entities, entities.get(0),null);
}
@Override

32
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/AbstractLingshanHelpCrowdCallbackProcessor.java

@ -0,0 +1,32 @@
package com.epmet.processor;
import com.epmet.dto.form.lingshan.LingshanHelpCrowdSaveFormDTO;
import com.epmet.entity.LingshanHelpCrowdBaseEntity;
/**
* @Description 灵山特殊人群扩展点
* @Author wangxianzhang
* @Time 2023/6/5 2:48 PM
*/
public abstract class AbstractLingshanHelpCrowdCallbackProcessor<T extends LingshanHelpCrowdBaseEntity> {
public abstract Class<T> getEntityClass();
/**
* @Description: 保存居民信息时候回调
* @param :
* @Return void
* @Author: wangxianzhang
* @Date: 2023/6/5 3:27 PM
*/
public void onSaveResiBaseInfo(String resiId, LingshanHelpCrowdSaveFormDTO form) {}
/**
* @Description: 保存的时候执行
* @Return void
* @Author: wangxianzhang
* @Date: 2023/6/5 2:49 PM
*/
public void onSaveSpecialCrowdDetail(T entity) {};
}

32
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdCanjiCallbackProcessor.java

@ -0,0 +1,32 @@
package com.epmet.processor;
import com.epmet.dao.IcResiUserDao;
import com.epmet.entity.LingshanHelpCrowdCanjiEntity;
import com.epmet.enums.IcResiUserTableEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
@Component
public class LingshanHelpCrowdCanjiCallbackProcessor extends AbstractLingshanHelpCrowdCallbackProcessor<LingshanHelpCrowdCanjiEntity> {
@Autowired
private IcResiUserDao icResiUserDao;
@Override
public Class<LingshanHelpCrowdCanjiEntity> getEntityClass() {
return LingshanHelpCrowdCanjiEntity.class;
}
@Override
public void onSaveSpecialCrowdDetail(LingshanHelpCrowdCanjiEntity entity) {
// 更新残疾信息
HashMap<String, String> map = new HashMap<>();
map.put("IS_CJ", "1");
map.put("CJLB", entity.getCjlb());
map.put("CJZK", entity.getCjzk());
map.put("CJZH", entity.getCjzh());
icResiUserDao.updateTableSelective(IcResiUserTableEnum.IC_RESI_USER.getTableName(), entity.getResiId(), map);
}
}

35
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdDabingCallbackProcessor.java

@ -0,0 +1,35 @@
package com.epmet.processor;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.IcResiUserDao;
import com.epmet.entity.LingshanHelpCrowdDabingEntity;
import com.epmet.enums.IcResiUserTableEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
@Component
public class LingshanHelpCrowdDabingCallbackProcessor extends AbstractLingshanHelpCrowdCallbackProcessor<LingshanHelpCrowdDabingEntity> {
@Autowired
private IcResiUserDao icResiUserDao;
@Override
public Class<LingshanHelpCrowdDabingEntity> getEntityClass() {
return LingshanHelpCrowdDabingEntity.class;
}
@Override
public void onSaveSpecialCrowdDetail(LingshanHelpCrowdDabingEntity entity) {
HashMap<String, String> map = new HashMap<>();
map.put("IS_DB", "1");
// map.put("SHDB", entity.getShbz()); // 因为excel模板里,用的不是字典,是手动输入,所以不能对应的居民信息的所患病种
String hbsj = DateUtils.format(entity.getHbsj(), DateUtils.DATE_TIME_PATTERN);
if (hbsj != null) {
map.put("DBSJ", hbsj);
}
icResiUserDao.updateTableSelective(IcResiUserTableEnum.IC_RESI_USER.getTableName(), entity.getResiId(), map);
}
}

28
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdDibaoCallbackProcessor.java

@ -0,0 +1,28 @@
package com.epmet.processor;
import com.epmet.dao.IcResiUserDao;
import com.epmet.entity.LingshanHelpCrowdDibaoEntity;
import com.epmet.enums.IcResiUserTableEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
@Component
public class LingshanHelpCrowdDibaoCallbackProcessor extends AbstractLingshanHelpCrowdCallbackProcessor<LingshanHelpCrowdDibaoEntity> {
@Autowired
private IcResiUserDao icResiUserDao;
@Override
public Class<LingshanHelpCrowdDibaoEntity> getEntityClass() {
return LingshanHelpCrowdDibaoEntity.class;
}
@Override
public void onSaveSpecialCrowdDetail(LingshanHelpCrowdDibaoEntity form) {
HashMap<String, String> map = new HashMap<>();
map.put("IS_DB", "1");
icResiUserDao.updateTableSelective(IcResiUserTableEnum.IC_RESI_USER.getTableName(), form.getResiId(), map);
}
}

22
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdDujuCallbackProcessor.java

@ -0,0 +1,22 @@
package com.epmet.processor;
import com.epmet.dao.IcResiUserDao;
import com.epmet.entity.LingshanHelpCrowdDujuEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class LingshanHelpCrowdDujuCallbackProcessor extends AbstractLingshanHelpCrowdCallbackProcessor<LingshanHelpCrowdDujuEntity> {
@Autowired
private IcResiUserDao icResiUserDao;
@Override
public Class<LingshanHelpCrowdDujuEntity> getEntityClass() {
return LingshanHelpCrowdDujuEntity.class;
}
@Override
public void onSaveSpecialCrowdDetail(LingshanHelpCrowdDujuEntity form) {
}
}

18
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdGaolingCallbackProcessor.java

@ -0,0 +1,18 @@
package com.epmet.processor;
import com.epmet.entity.LingshanHelpCrowdGaolingEntity;
import org.springframework.stereotype.Component;
@Component
public class LingshanHelpCrowdGaolingCallbackProcessor extends AbstractLingshanHelpCrowdCallbackProcessor<LingshanHelpCrowdGaolingEntity> {
@Override
public Class<LingshanHelpCrowdGaolingEntity> getEntityClass() {
return LingshanHelpCrowdGaolingEntity.class;
}
@Override
public void onSaveSpecialCrowdDetail(LingshanHelpCrowdGaolingEntity form) {
}
}

28
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdKongchaoCallbackProcessor.java

@ -0,0 +1,28 @@
package com.epmet.processor;
import com.epmet.dao.IcResiUserDao;
import com.epmet.entity.LingshanHelpCrowdKongchaoEntity;
import com.epmet.enums.IcResiUserTableEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
@Component
public class LingshanHelpCrowdKongchaoCallbackProcessor extends AbstractLingshanHelpCrowdCallbackProcessor<LingshanHelpCrowdKongchaoEntity> {
@Autowired
private IcResiUserDao icResiUserDao;
@Override
public Class<LingshanHelpCrowdKongchaoEntity> getEntityClass() {
return LingshanHelpCrowdKongchaoEntity.class;
}
@Override
public void onSaveSpecialCrowdDetail(LingshanHelpCrowdKongchaoEntity form) {
HashMap<String, String> map = new HashMap<>();
map.put("IS_KC", "1");
icResiUserDao.updateTableSelective(IcResiUserTableEnum.IC_RESI_USER.getTableName(), form.getResiId(), map);
}
}

19
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdLiushouCallbackProcessor.java

@ -0,0 +1,19 @@
package com.epmet.processor;
import com.epmet.entity.LingshanHelpCrowdLiushouEntity;
import org.springframework.stereotype.Component;
@Component
public class LingshanHelpCrowdLiushouCallbackProcessor extends AbstractLingshanHelpCrowdCallbackProcessor<LingshanHelpCrowdLiushouEntity> {
@Override
public Class<LingshanHelpCrowdLiushouEntity> getEntityClass() {
return LingshanHelpCrowdLiushouEntity.class;
}
@Override
public void onSaveSpecialCrowdDetail(LingshanHelpCrowdLiushouEntity form) {
}
}

42
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdResiBaseInfoCallbackProcessor.java

@ -0,0 +1,42 @@
package com.epmet.processor;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dto.form.lingshan.LingshanHelpCrowdSaveFormDTO;
import com.epmet.entity.LingshanHelpCrowdBaseEntity;
import com.epmet.enums.IcResiUserTableEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
@Component
public class LingshanHelpCrowdResiBaseInfoCallbackProcessor extends AbstractLingshanHelpCrowdCallbackProcessor<LingshanHelpCrowdBaseEntity> {
@Autowired
private IcResiUserDao icResiUserDao;
@Override
public Class getEntityClass() {
return LingshanHelpCrowdBaseEntity.class;
}
/**
* @Description: 保存居民基础信息的时候回调
* @param resiId:
* @param form:
* @Return void
* @Author: wangxianzhang
* @Date: 2023/6/5 4:33 PM
*/
@Override
public void onSaveResiBaseInfo(String resiId, LingshanHelpCrowdSaveFormDTO form) {
String headPhoto = form.getHeadPhoto();
if (StringUtils.isNotBlank(headPhoto)) {
// 设置了头像,就更新头像
HashMap<String, String> map = new HashMap<>();
map.put("HEAD_PHOTO", headPhoto);
icResiUserDao.updateTableSelective(IcResiUserTableEnum.IC_RESI_USER.getTableName(), resiId, map);
}
}
}

18
epmet-user/epmet-user-server/src/main/java/com/epmet/processor/LingshanHelpCrowdTekunCallbackProcessor.java

@ -0,0 +1,18 @@
package com.epmet.processor;
import com.epmet.entity.LingshanHelpCrowdTekunEntity;
import org.springframework.stereotype.Component;
@Component
public class LingshanHelpCrowdTekunCallbackProcessor extends AbstractLingshanHelpCrowdCallbackProcessor<LingshanHelpCrowdTekunEntity> {
@Override
public Class<LingshanHelpCrowdTekunEntity> getEntityClass() {
return LingshanHelpCrowdTekunEntity.class;
}
@Override
public void onSaveSpecialCrowdDetail(LingshanHelpCrowdTekunEntity form) {
}
}

16
epmet-user/epmet-user-server/src/main/java/com/epmet/service/LingShanHelpCrowdService.java

@ -43,21 +43,21 @@ public interface LingShanHelpCrowdService {
String importHelpCrowd(String crowdType, String toString, String originalFilename);
void save(List<LingshanHelpCrowdCanjiEntity> entities, LingshanHelpCrowdCanjiEntity t);
void save(List<LingshanHelpCrowdCanjiEntity> entities, LingshanHelpCrowdCanjiEntity t, String headPhoto);
void save(List<LingshanHelpCrowdDabingEntity> entities, LingshanHelpCrowdDabingEntity t);
void save(List<LingshanHelpCrowdDabingEntity> entities, LingshanHelpCrowdDabingEntity t, String headPhoto);
void save(List<LingshanHelpCrowdDibaoEntity> entities, LingshanHelpCrowdDibaoEntity lingshanHelpCrowdDibaoEntity);
void save(List<LingshanHelpCrowdDibaoEntity> entities, LingshanHelpCrowdDibaoEntity lingshanHelpCrowdDibaoEntity, String headPhoto);
void save(List<LingshanHelpCrowdDujuEntity> entities, LingshanHelpCrowdDujuEntity lingshanHelpCrowdDujuEntity);
void save(List<LingshanHelpCrowdDujuEntity> entities, LingshanHelpCrowdDujuEntity lingshanHelpCrowdDujuEntity, String headPhoto);
void save(List<LingshanHelpCrowdGaolingEntity> entities, LingshanHelpCrowdGaolingEntity lingshanHelpCrowdGaolingEntity);
void save(List<LingshanHelpCrowdGaolingEntity> entities, LingshanHelpCrowdGaolingEntity lingshanHelpCrowdGaolingEntity, String headPhoto);
void save(List<LingshanHelpCrowdKongchaoEntity> entities, LingshanHelpCrowdKongchaoEntity lingshanHelpCrowdKongchaoEntity);
void save(List<LingshanHelpCrowdKongchaoEntity> entities, LingshanHelpCrowdKongchaoEntity lingshanHelpCrowdKongchaoEntity, String headPhoto);
void save(List<LingshanHelpCrowdLiushouEntity> entities, LingshanHelpCrowdLiushouEntity lingshanHelpCrowdLiushouEntity);
void save(List<LingshanHelpCrowdLiushouEntity> entities, LingshanHelpCrowdLiushouEntity lingshanHelpCrowdLiushouEntity, String headPhoto);
void save(List<LingshanHelpCrowdTekunEntity> entities, LingshanHelpCrowdTekunEntity lingshanHelpCrowdTekunEntity);
void save(List<LingshanHelpCrowdTekunEntity> entities, LingshanHelpCrowdTekunEntity lingshanHelpCrowdTekunEntity, String headPhoto);
PageData<LingShanHelpCrowdListRstDTO> listHelpCrowd(Integer pageNo, Integer pageSize, String idCard, String mobile, String name, String helpType, String orgType, String orgId);

117
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/LingShanHelpCrowdServiceImpl.java

@ -4,7 +4,6 @@ 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.dto.result.OptionResultDTO;
@ -30,15 +29,14 @@ import com.epmet.dto.result.lingshan.LingShanHelpCrowdScreenQtyOfSubOrgRstDTO;
import com.epmet.dto.result.lingshan.LingShanHelpCrowdStatusByCateRstDTO;
import com.epmet.dto.result.lingshan.LingshanHelpCrowdDetailRstDTO;
import com.epmet.entity.*;
import com.epmet.enums.LingShanHelpCrowdCommonEnums;
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.EpmetAdminOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.processor.AbstractLingshanHelpCrowdCallbackProcessor;
import com.epmet.remote.EpmetUserRemoteService;
import com.epmet.service.LingShanHelpCrowdService;
import com.epmet.utils.ImportTaskUtils;
@ -46,7 +44,6 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
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.commons.lang3.StringUtils;
@ -115,8 +112,18 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
@Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient;
private Map<Class, AbstractLingshanHelpCrowdCallbackProcessor> processorMap;
private String[] COPY_IGNORED_FIELDS = { "id", "customerId", "resiId", "idCard", "createdTime", "createdBy" };
@Autowired
public LingShanHelpCrowdServiceImpl(List<AbstractLingshanHelpCrowdCallbackProcessor> processors) {
processorMap = processors
.stream()
.collect(Collectors.toMap(p -> p.getEntityClass(), Function.identity()));
}
@Override
public String validate(LingShanHelpCrowdBaseExcelData row) {
String idCard = row.getIdCard();
@ -357,7 +364,7 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
@Override
public void save(List<LingshanHelpCrowdCanjiEntity> entities, LingshanHelpCrowdCanjiEntity t) {
public void save(List<LingshanHelpCrowdCanjiEntity> entities, LingshanHelpCrowdCanjiEntity t, String headPhoto) {
for (LingshanHelpCrowdCanjiEntity entity : entities) {
LambdaQueryWrapper<LingshanHelpCrowdCanjiEntity> q = new LambdaQueryWrapper<>();
q.eq(LingshanHelpCrowdCanjiEntity::getResiId, entity.getResiId());
@ -367,17 +374,19 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
// 如果信息已存在
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS);
lingshanHelpCrowdCanjiDao.updateById(existsOne);
continue;
} else {
// 如果信息不存在
// entity.setId(IdWorker.getIdStr());
lingshanHelpCrowdCanjiDao.insert(entity);
}
// 如果信息不存在
// entity.setId(IdWorker.getIdStr());
lingshanHelpCrowdCanjiDao.insert(entity);
// 钩子
processorMap.get(entity.getClass()).onSaveSpecialCrowdDetail(entity);
}
}
@Override
public void save(List<LingshanHelpCrowdDabingEntity> entities, LingshanHelpCrowdDabingEntity t) {
public void save(List<LingshanHelpCrowdDabingEntity> entities, LingshanHelpCrowdDabingEntity t, String headPhoto) {
for (LingshanHelpCrowdDabingEntity entity : entities) {
LambdaQueryWrapper<LingshanHelpCrowdDabingEntity> q = new LambdaQueryWrapper<>();
q.eq(LingshanHelpCrowdDabingEntity::getResiId, entity.getResiId());
@ -386,16 +395,18 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
if ((existsOne = lingshanHelpCrowdDabingDao.selectOne(q)) != null) {
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS);
lingshanHelpCrowdDabingDao.updateById(existsOne);
continue;
} else {
// entity.setId(IdWorker.getIdStr());
lingshanHelpCrowdDabingDao.insert(entity);
}
// entity.setId(IdWorker.getIdStr());
lingshanHelpCrowdDabingDao.insert(entity);
// 钩子
processorMap.get(entity.getClass()).onSaveSpecialCrowdDetail(entity);
}
}
@Override
public void save(List<LingshanHelpCrowdDibaoEntity> entities, LingshanHelpCrowdDibaoEntity lingshanHelpCrowdDibaoEntity) {
public void save(List<LingshanHelpCrowdDibaoEntity> entities, LingshanHelpCrowdDibaoEntity lingshanHelpCrowdDibaoEntity, String headPhoto) {
for (LingshanHelpCrowdDibaoEntity entity : entities) {
LambdaQueryWrapper<LingshanHelpCrowdDibaoEntity> q = new LambdaQueryWrapper<>();
q.eq(LingshanHelpCrowdDibaoEntity::getResiId, entity.getResiId());
@ -404,17 +415,19 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
if ((existsOne = lingshanHelpCrowdDibaoDao.selectOne(q)) != null) {
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS);
lingshanHelpCrowdDibaoDao.updateById(existsOne);
continue;
}
} else {
// entity.setId(IdWorker.getIdStr());
// entity.setId(IdWorker.getIdStr());
lingshanHelpCrowdDibaoDao.insert(entity);
}
lingshanHelpCrowdDibaoDao.insert(entity);
// 钩子
processorMap.get(entity.getClass()).onSaveSpecialCrowdDetail(entity);
}
}
@Override
public void save(List<LingshanHelpCrowdDujuEntity> entities, LingshanHelpCrowdDujuEntity lingshanHelpCrowdDujuEntity) {
public void save(List<LingshanHelpCrowdDujuEntity> entities, LingshanHelpCrowdDujuEntity lingshanHelpCrowdDujuEntity, String headPhoto) {
for (LingshanHelpCrowdDujuEntity entity : entities) {
LambdaQueryWrapper<LingshanHelpCrowdDujuEntity> q = new LambdaQueryWrapper<>();
q.eq(LingshanHelpCrowdDujuEntity::getResiId, entity.getResiId());
@ -423,18 +436,21 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
if ((existsOne = lingshanHelpCrowdDujuDao.selectOne(q)) != null) {
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS);
lingshanHelpCrowdDujuDao.updateById(existsOne);
continue;
}
} else {
// entity.setId(IdWorker.getIdStr());
// entity.setId(IdWorker.getIdStr());
lingshanHelpCrowdDujuDao.insert(entity);
lingshanHelpCrowdDujuDao.insert(entity);
}
// 钩子
processorMap.get(entity.getClass()).onSaveSpecialCrowdDetail(entity);
}
}
@Override
public void save(List<LingshanHelpCrowdGaolingEntity> entities, LingshanHelpCrowdGaolingEntity lingshanHelpCrowdGaolingEntity) {
public void save(List<LingshanHelpCrowdGaolingEntity> entities, LingshanHelpCrowdGaolingEntity lingshanHelpCrowdGaolingEntity, String headPhoto) {
for (LingshanHelpCrowdGaolingEntity entity : entities) {
LambdaQueryWrapper<LingshanHelpCrowdGaolingEntity> q = new LambdaQueryWrapper<>();
q.eq(LingshanHelpCrowdGaolingEntity::getResiId, entity.getResiId());
@ -443,15 +459,18 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
if ((existsOne = lingshanHelpCrowdGaolingDao.selectOne(q)) != null) {
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS);
lingshanHelpCrowdGaolingDao.updateById(existsOne);
continue;
} else {
lingshanHelpCrowdGaolingDao.insert(entity);
}
lingshanHelpCrowdGaolingDao.insert(entity);
// 钩子
processorMap.get(entity.getClass()).onSaveSpecialCrowdDetail(entity);
}
}
@Override
public void save(List<LingshanHelpCrowdKongchaoEntity> entities, LingshanHelpCrowdKongchaoEntity lingshanHelpCrowdKongchaoEntity) {
public void save(List<LingshanHelpCrowdKongchaoEntity> entities, LingshanHelpCrowdKongchaoEntity lingshanHelpCrowdKongchaoEntity, String headPhoto) {
for (LingshanHelpCrowdKongchaoEntity entity : entities) {
LambdaQueryWrapper<LingshanHelpCrowdKongchaoEntity> q = new LambdaQueryWrapper<>();
q.eq(LingshanHelpCrowdKongchaoEntity::getResiId, entity.getResiId());
@ -460,15 +479,18 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
if ((existsOne = lingshanHelpCrowdKongchaoDao.selectOne(q)) != null) {
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS);
lingshanHelpCrowdKongchaoDao.updateById(existsOne);
continue;
} else {
lingshanHelpCrowdKongchaoDao.insert(entity);
}
lingshanHelpCrowdKongchaoDao.insert(entity);
// 钩子
processorMap.get(entity.getClass()).onSaveSpecialCrowdDetail(entity);
}
}
@Override
public void save(List<LingshanHelpCrowdLiushouEntity> entities, LingshanHelpCrowdLiushouEntity lingshanHelpCrowdLiushouEntity) {
public void save(List<LingshanHelpCrowdLiushouEntity> entities, LingshanHelpCrowdLiushouEntity lingshanHelpCrowdLiushouEntity, String headPhoto) {
for (LingshanHelpCrowdLiushouEntity entity : entities) {
LambdaQueryWrapper<LingshanHelpCrowdLiushouEntity> q = new LambdaQueryWrapper<>();
q.eq(LingshanHelpCrowdLiushouEntity::getResiId, entity.getResiId());
@ -477,15 +499,18 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
if ((existsOne = lingshanHelpCrowdLiushouDao.selectOne(q)) != null) {
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS);
lingshanHelpCrowdLiushouDao.updateById(existsOne);
continue;
} else {
lingshanHelpCrowdLiushouDao.insert(entity);
}
lingshanHelpCrowdLiushouDao.insert(entity);
// 钩子
processorMap.get(entity.getClass()).onSaveSpecialCrowdDetail(entity);
}
}
@Override
public void save(List<LingshanHelpCrowdTekunEntity> entities, LingshanHelpCrowdTekunEntity lingshanHelpCrowdTekunEntity) {
public void save(List<LingshanHelpCrowdTekunEntity> entities, LingshanHelpCrowdTekunEntity lingshanHelpCrowdTekunEntity, String headPhoto) {
for (LingshanHelpCrowdTekunEntity entity : entities) {
LambdaQueryWrapper<LingshanHelpCrowdTekunEntity> q = new LambdaQueryWrapper<>();
@ -495,10 +520,13 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
if ((existsOne = lingshanHelpCrowdTekunDao.selectOne(q)) != null) {
BeanUtils.copyProperties(entity, existsOne, COPY_IGNORED_FIELDS);
lingshanHelpCrowdTekunDao.updateById(existsOne);
continue;
} else {
lingshanHelpCrowdTekunDao.insert(entity);
}
lingshanHelpCrowdTekunDao.insert(entity);
// 钩子
processorMap.get(entity.getClass()).onSaveSpecialCrowdDetail(entity);
}
}
@ -592,7 +620,7 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
canjiEntity.setResiId(resiId);
canjiEntity.setOrgIdPath(orgIdPath);
canjiEntity.setIdCard(idCard);
save(Arrays.asList(canjiEntity), canjiEntity);
save(Arrays.asList(canjiEntity), canjiEntity, headPhoto);
} else {
// 说明这个类别被取消了,就得删除
deleteByResiId(resiId, LingshanHelpCrowdCanjiEntity.class);
@ -605,7 +633,7 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
dujuEntity.setResiId(resiId);
dujuEntity.setOrgIdPath(orgIdPath);
dujuEntity.setIdCard(idCard);
save(Arrays.asList(dujuEntity), dujuEntity);
save(Arrays.asList(dujuEntity), dujuEntity, headPhoto);
} else {
deleteByResiId(resiId, LingshanHelpCrowdDujuEntity.class);
}
@ -617,7 +645,7 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
dibaoEntity.setResiId(resiId);
dibaoEntity.setOrgIdPath(orgIdPath);
dibaoEntity.setIdCard(idCard);
save(Arrays.asList(dibaoEntity), dibaoEntity);
save(Arrays.asList(dibaoEntity), dibaoEntity, headPhoto);
} else {
deleteByResiId(resiId, LingshanHelpCrowdDibaoEntity.class);
}
@ -629,7 +657,7 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
dabingEntity.setResiId(resiId);
dabingEntity.setOrgIdPath(orgIdPath);
dabingEntity.setIdCard(idCard);
save(Arrays.asList(dabingEntity), dabingEntity);
save(Arrays.asList(dabingEntity), dabingEntity, headPhoto);
} else {
deleteByResiId(resiId, LingshanHelpCrowdDabingEntity.class);
}
@ -641,7 +669,7 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
gaolingEntity.setResiId(resiId);
gaolingEntity.setOrgIdPath(orgIdPath);
gaolingEntity.setIdCard(idCard);
save(Arrays.asList(gaolingEntity), gaolingEntity);
save(Arrays.asList(gaolingEntity), gaolingEntity, headPhoto);
} else {
deleteByResiId(resiId, LingshanHelpCrowdGaolingEntity.class);
}
@ -653,7 +681,7 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
kongchaoEntity.setResiId(resiId);
kongchaoEntity.setOrgIdPath(orgIdPath);
kongchaoEntity.setIdCard(idCard);
save(Arrays.asList(kongchaoEntity), kongchaoEntity);
save(Arrays.asList(kongchaoEntity), kongchaoEntity, headPhoto);
} else {
deleteByResiId(resiId, LingshanHelpCrowdKongchaoEntity.class);
}
@ -665,7 +693,7 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
liushouEntity.setResiId(resiId);
liushouEntity.setOrgIdPath(orgIdPath);
liushouEntity.setIdCard(idCard);
save(Arrays.asList(liushouEntity), liushouEntity);
save(Arrays.asList(liushouEntity), liushouEntity, headPhoto);
} else {
deleteByResiId(resiId, LingshanHelpCrowdLiushouEntity.class);
}
@ -677,13 +705,16 @@ public class LingShanHelpCrowdServiceImpl implements LingShanHelpCrowdService, R
tekunEntity.setResiId(resiId);
tekunEntity.setOrgIdPath(orgIdPath);
tekunEntity.setIdCard(idCard);
save(Arrays.asList(tekunEntity), tekunEntity);
save(Arrays.asList(tekunEntity), tekunEntity, headPhoto);
} else {
deleteByResiId(resiId, LingshanHelpCrowdTekunEntity.class);
}
// 保存类别,hard=true:没有传递过来,但是数据库中有的类别,将会被删除,说明工作人员是要取消改居民这个类别的数据
savePersonAndTypes(types, true);
// 保存居民基础信息回调
processorMap.get(LingshanHelpCrowdBaseEntity.class).onSaveResiBaseInfo(resiId, form);
}
/**

Loading…
Cancel
Save