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);
//1.分页查询排好序的工作人员Id列表【原本1/2步可以用一个sql,但涉及2需要按1的顺序排序,sql复杂且效率低,所以拆开】
LinkedList<String> staffIds = customerStaffDao.selectOrderRole(formDTO);
if (staffIds!=null && formDTO.getStaffIds()!=null){
formDTO.getStaffIds().forEach(
staffId->{
if (!staffIds.contains(staffId)){
staffIds.add(staffId);
}
});
}
//2.批量查询工作人员信息,按传入顺序排序
if(CollectionUtils.isEmpty(staffIds)){
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;
@ExcelProperty("村居委员职务")
private Date viliagePosition;
private String viliagePosition;
@ExcelProperty("党组织职务")
private Date partyPosition;
private String partyPosition;
@NotBlank(message = "居住地址为必填项")
@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);
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;

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);
CustomerAgencyUserRoleDTO dto = new CustomerAgencyUserRoleDTO();
//工作人员角色关联表
fromDTO.getRoles().forEach(role -> {
StaffRoleEntity staffRoleEntity = new StaffRoleEntity();
staffRoleEntity.setStaffId(userEntity.getId());
staffRoleEntity.setRoleId(role);
staffRoleEntity.setOrgId(fromDTO.getAgencyId());
staffRoleEntity.setCustomerId(fromDTO.getCustomerId());
staffRoleService.insert(staffRoleEntity);
});
if (fromDTO.getRoles()!=null){
fromDTO.getRoles().forEach(role -> {
StaffRoleEntity staffRoleEntity = new StaffRoleEntity();
staffRoleEntity.setStaffId(userEntity.getId());
staffRoleEntity.setRoleId(role);
staffRoleEntity.setOrgId(fromDTO.getAgencyId());
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.setStaffId(userEntity.getId());
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());
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.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.dao.DataSyncRecordDeathDao;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dto.ChangeDeathDTO;
import com.epmet.dto.DataSyncRecordDeathDTO;
import com.epmet.dto.form.dataSync.DataSyncRecordDeathPageFormDTO;
import com.epmet.entity.DataSyncRecordDeathEntity;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.service.DataSyncRecordDeathService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -38,6 +42,8 @@ import java.util.Map;
*/
@Service
public class DataSyncRecordDeathServiceImpl extends BaseServiceImpl<DataSyncRecordDeathDao, DataSyncRecordDeathEntity> implements DataSyncRecordDeathService {
@Autowired
private IcResiUserDao icResiUserDao;
/**
* 列表查询
@ -124,27 +130,48 @@ public class DataSyncRecordDeathServiceImpl extends BaseServiceImpl<DataSyncReco
// 已处理的跳过
continue;
}
entity.setDealStatus(NumConstant.ONE);
try {
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("来源于数据比对-死亡人员数据");
SpringContextUtils.getBean(ChangeDeathServiceImpl.class).save(changeDeathDTO);
entity.setDealStatus(NumConstant.ONE);
Boolean existedFlag=true;
LambdaQueryWrapper<IcResiUserEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(IcResiUserEntity::getIdCard, entity.getIdCard())
.eq(IcResiUserEntity::getCustomerId, entity.getCustomerId())
.eq(IcResiUserEntity::getDelFlag, NumConstant.ZERO_STR)
.select(IcResiUserEntity::getId);
IcResiUserEntity icResiUserEntity = icResiUserDao.selectOne(queryWrapper);
if (null == icResiUserEntity) {
existedFlag = false;
entity.setDealStatus(NumConstant.TWO);
entity.setIcResiUserId(null);
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) {
//0:未处理;1:处理成功;2处理失败
entity.setDealStatus(NumConstant.TWO);
entity.setDealResult("系统内部异常:" + epmetException.getMsg());
epmetException.printStackTrace();
} catch (Exception e) {
//0:未处理;1:处理成功;2处理失败
entity.setDealStatus(NumConstant.TWO);
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
d.id,
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
d.*
FROM
data_sync_record_death d
WHERE

Loading…
Cancel
Save