wxz 2 years ago
parent
commit
3e620919d8
  1. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  2. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffImportExcelData.java
  3. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
  4. 35
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  5. 55
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java
  6. 12
      epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDeathDao.xml

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -730,6 +730,14 @@ public class EpmetUserServiceImpl implements EpmetUserService, ResultDataResolve
formDTO.setPageNo(pageIndex); formDTO.setPageNo(pageIndex);
//1.分页查询排好序的工作人员Id列表【原本1/2步可以用一个sql,但涉及2需要按1的顺序排序,sql复杂且效率低,所以拆开】 //1.分页查询排好序的工作人员Id列表【原本1/2步可以用一个sql,但涉及2需要按1的顺序排序,sql复杂且效率低,所以拆开】
LinkedList<String> staffIds = customerStaffDao.selectOrderRole(formDTO); LinkedList<String> staffIds = customerStaffDao.selectOrderRole(formDTO);
if (staffIds!=null && formDTO.getStaffIds()!=null){
formDTO.getStaffIds().forEach(
staffId->{
if (!staffIds.contains(staffId)){
staffIds.add(staffId);
}
});
}
//2.批量查询工作人员信息,按传入顺序排序 //2.批量查询工作人员信息,按传入顺序排序
if(CollectionUtils.isEmpty(staffIds)){ if(CollectionUtils.isEmpty(staffIds)){
return new ArrayList<>(); return new ArrayList<>();

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerStaffImportExcelData.java

@ -29,10 +29,10 @@ public class CustomerStaffImportExcelData {
private String idCard; private String idCard;
@ExcelProperty("村居委员职务") @ExcelProperty("村居委员职务")
private Date viliagePosition; private String viliagePosition;
@ExcelProperty("党组织职务") @ExcelProperty("党组织职务")
private Date partyPosition; private String partyPosition;
@NotBlank(message = "居住地址为必填项") @NotBlank(message = "居住地址为必填项")
@ExcelProperty("居住地址※") @ExcelProperty("居住地址※")

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

@ -774,7 +774,7 @@ public class StaffServiceImpl implements StaffService {
CustomerStaffImportListener listener = new CustomerStaffImportListener(userRemoteService.getLoginUserDetails().getUserId(), userRemoteService.getLoginUserDetails().getCustomerId(), orgType,orgId,this); CustomerStaffImportListener listener = new CustomerStaffImportListener(userRemoteService.getLoginUserDetails().getUserId(), userRemoteService.getLoginUserDetails().getCustomerId(), orgType,orgId,this);
EasyExcel.read(filePath.toFile(), CustomerStaffImportExcelData.class, listener).headRowNumber(2).sheet(0).doRead(); EasyExcel.read(filePath.toFile(), CustomerStaffImportExcelData.class, listener).headRowNumber(1).sheet(0).doRead();
String errorDesFileUrl = null; String errorDesFileUrl = null;

35
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -421,29 +421,30 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
} }
baseDao.insert(staffEntity); baseDao.insert(staffEntity);
CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO();
//工作人员角色关联表 //工作人员角色关联表
fromDTO.getRoles().forEach(role -> { if (fromDTO.getRoles()!=null){
StaffRoleEntity staffRoleEntity = new StaffRoleEntity(); fromDTO.getRoles().forEach(role -> {
staffRoleEntity.setStaffId(userEntity.getId()); StaffRoleEntity staffRoleEntity = new StaffRoleEntity();
staffRoleEntity.setRoleId(role); staffRoleEntity.setStaffId(userEntity.getId());
staffRoleEntity.setOrgId(fromDTO.getAgencyId()); staffRoleEntity.setRoleId(role);
staffRoleEntity.setCustomerId(fromDTO.getCustomerId()); staffRoleEntity.setOrgId(fromDTO.getAgencyId());
staffRoleService.insert(staffRoleEntity); staffRoleEntity.setCustomerId(fromDTO.getCustomerId());
}); staffRoleService.insert(staffRoleEntity);
});
// 角色放缓存
List<RoleKeyValueResultDTO> roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles());
Map m = new HashMap(16);
roleKeyValue.forEach(r -> {
m.put(r.getRoleKey(), r.getRoleName());
});
dto.setRoles(m);
}
// 角色放缓存
CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO();
List<RoleKeyValueResultDTO> roleKeyValue = govStaffRoleDao.selectRoleKeyName(fromDTO.getRoles());
dto.setCustomerId(fromDTO.getCustomerId()); dto.setCustomerId(fromDTO.getCustomerId());
dto.setStaffId(userEntity.getId()); dto.setStaffId(userEntity.getId());
dto.setAgencyId(fromDTO.getAgencyId()); dto.setAgencyId(fromDTO.getAgencyId());
Map m = new HashMap(16);
roleKeyValue.forEach(r -> {
m.put(r.getRoleKey(), r.getRoleName());
});
dto.setRoles(m);
CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId()); CustomerStaffRedis.delStaffInfoFormCache(dto.getCustomerId(), dto.getStaffId());
return new Result<CustomerStaffDTO>().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class)); return new Result<CustomerStaffDTO>().ok(ConvertUtils.sourceToTarget(staffEntity, CustomerStaffDTO.class));
} }

55
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java

@ -14,16 +14,20 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.dao.DataSyncRecordDeathDao; import com.epmet.dao.DataSyncRecordDeathDao;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dto.ChangeDeathDTO; import com.epmet.dto.ChangeDeathDTO;
import com.epmet.dto.DataSyncRecordDeathDTO; import com.epmet.dto.DataSyncRecordDeathDTO;
import com.epmet.dto.form.dataSync.DataSyncRecordDeathPageFormDTO; import com.epmet.dto.form.dataSync.DataSyncRecordDeathPageFormDTO;
import com.epmet.entity.DataSyncRecordDeathEntity; import com.epmet.entity.DataSyncRecordDeathEntity;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.service.DataSyncRecordDeathService; import com.epmet.service.DataSyncRecordDeathService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -38,6 +42,8 @@ import java.util.Map;
*/ */
@Service @Service
public class DataSyncRecordDeathServiceImpl extends BaseServiceImpl<DataSyncRecordDeathDao, DataSyncRecordDeathEntity> implements DataSyncRecordDeathService { public class DataSyncRecordDeathServiceImpl extends BaseServiceImpl<DataSyncRecordDeathDao, DataSyncRecordDeathEntity> implements DataSyncRecordDeathService {
@Autowired
private IcResiUserDao icResiUserDao;
/** /**
* 列表查询 * 列表查询
@ -124,27 +130,48 @@ public class DataSyncRecordDeathServiceImpl extends BaseServiceImpl<DataSyncReco
// 已处理的跳过 // 已处理的跳过
continue; continue;
} }
entity.setDealStatus(NumConstant.ONE);
try { try {
ChangeDeathDTO changeDeathDTO = new ChangeDeathDTO(); Boolean existedFlag=true;
changeDeathDTO.setStaffId(userId); LambdaQueryWrapper<IcResiUserEntity> queryWrapper = new LambdaQueryWrapper<>();
changeDeathDTO.setUserId(entity.getIcResiUserId()); queryWrapper.eq(IcResiUserEntity::getIdCard, entity.getIdCard())
changeDeathDTO.setGridId(entity.getGridId()); .eq(IcResiUserEntity::getCustomerId, entity.getCustomerId())
changeDeathDTO.setName(entity.getName()); .eq(IcResiUserEntity::getDelFlag, NumConstant.ZERO_STR)
changeDeathDTO.setIdCard(entity.getIdCard()); .select(IcResiUserEntity::getId);
// 手机号没有值 IcResiUserEntity icResiUserEntity = icResiUserDao.selectOne(queryWrapper);
changeDeathDTO.setMobile(StrConstant.EPMETY_STR); if (null == icResiUserEntity) {
changeDeathDTO.setDeathDate(DateUtils.stringToDate(entity.getDeathDate(), "yyyy-MM-dd")); existedFlag = false;
changeDeathDTO.setJoinReason("来源于数据比对-死亡人员数据"); entity.setDealStatus(NumConstant.TWO);
SpringContextUtils.getBean(ChangeDeathServiceImpl.class).save(changeDeathDTO); entity.setIcResiUserId(null);
entity.setDealStatus(NumConstant.ONE); entity.setDealResult("居民信息表不存在此居民");
}else{
entity.setIcResiUserId(icResiUserEntity.getId());
}
if(existedFlag){
ChangeDeathDTO changeDeathDTO = new ChangeDeathDTO();
changeDeathDTO.setStaffId(userId);
changeDeathDTO.setUserId(entity.getIcResiUserId());
changeDeathDTO.setGridId(entity.getGridId());
changeDeathDTO.setName(entity.getName());
changeDeathDTO.setIdCard(entity.getIdCard());
// 手机号没有值
changeDeathDTO.setMobile(StrConstant.EPMETY_STR);
changeDeathDTO.setDeathDate(DateUtils.stringToDate(entity.getDeathDate(), "yyyy-MM-dd"));
changeDeathDTO.setJoinReason("来源于数据比对-死亡人员数据");
Result result=SpringContextUtils.getBean(ChangeDeathServiceImpl.class).save(changeDeathDTO);
if(!result.success()){
entity.setDealStatus(NumConstant.TWO);
entity.setDealResult("同步死亡人员返回失败");
}
}
} catch (EpmetException epmetException) { } catch (EpmetException epmetException) {
//0:未处理;1:处理成功;2处理失败
entity.setDealStatus(NumConstant.TWO); entity.setDealStatus(NumConstant.TWO);
entity.setDealResult("系统内部异常:" + epmetException.getMsg()); entity.setDealResult("系统内部异常:" + epmetException.getMsg());
epmetException.printStackTrace(); epmetException.printStackTrace();
} catch (Exception e) { } catch (Exception e) {
//0:未处理;1:处理成功;2处理失败
entity.setDealStatus(NumConstant.TWO); entity.setDealStatus(NumConstant.TWO);
entity.setDealResult("未知错误"); entity.setDealResult("未知错误");

12
epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDeathDao.xml

@ -32,17 +32,7 @@
<select id="pageSelect" parameterType="map" resultType="com.epmet.dto.DataSyncRecordDeathDTO"> <select id="pageSelect" parameterType="map" resultType="com.epmet.dto.DataSyncRecordDeathDTO">
SELECT SELECT
d.id, d.*
d.`NAME`,
d.ID_CARD,
d.DEATH_DATE,
d.AGE,
d.ADDRESS,
d.IC_RESI_USER_ID,
d.GRID_ID,
d.AGENCY_ID,
d.CREMATION_TIME,
d.ORGAN_NAME
FROM FROM
data_sync_record_death d data_sync_record_death d
WHERE WHERE

Loading…
Cancel
Save