|
@ -53,10 +53,7 @@ import com.epmet.commons.tools.utils.*; |
|
|
import com.epmet.constant.IcPlatformConstant; |
|
|
import com.epmet.constant.IcPlatformConstant; |
|
|
import com.epmet.constant.IcResiUserConstant; |
|
|
import com.epmet.constant.IcResiUserConstant; |
|
|
import com.epmet.constant.UserConstant; |
|
|
import com.epmet.constant.UserConstant; |
|
|
import com.epmet.dao.IcPartyMemberDao; |
|
|
import com.epmet.dao.*; |
|
|
import com.epmet.dao.IcResiUserDao; |
|
|
|
|
|
import com.epmet.dao.IcVolunteerDao; |
|
|
|
|
|
import com.epmet.dao.UserBaseInfoDao; |
|
|
|
|
|
import com.epmet.dto.*; |
|
|
import com.epmet.dto.*; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; |
|
|
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; |
|
@ -160,6 +157,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private DistributedLock distributedLock; |
|
|
private DistributedLock distributedLock; |
|
|
|
|
|
@Resource |
|
|
|
|
|
private IcUserChangeRecordDao icUserChangeRecordDao; |
|
|
|
|
|
@Resource |
|
|
|
|
|
private IcUserChangeDetailedDao icUserChangeDetailedDao; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -3351,4 +3352,117 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
List<IcResiNonDynamicResultDTO> list = baseDao.selectList(query).stream().map((e) -> ConvertUtils.sourceToTarget(e, IcResiNonDynamicResultDTO.class)).collect(Collectors.toList()); |
|
|
List<IcResiNonDynamicResultDTO> list = baseDao.selectList(query).stream().map((e) -> ConvertUtils.sourceToTarget(e, IcResiNonDynamicResultDTO.class)).collect(Collectors.toList()); |
|
|
return new PageData<IcResiNonDynamicResultDTO>(list, new PageInfo<>(list).getTotal(), pageSize); |
|
|
return new PageData<IcResiNonDynamicResultDTO>(list, new PageInfo<>(list).getTotal(), pageSize); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 更新育龄妇女状态定时任务 |
|
|
|
|
|
* |
|
|
|
|
|
* @Param |
|
|
|
|
|
* @Return |
|
|
|
|
|
* @Author zhaoqifeng |
|
|
|
|
|
* @Date 2022/9/8 15:45 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public void updateYlfn() { |
|
|
|
|
|
//获取育龄妇女配置
|
|
|
|
|
|
Result<List<YlfnValueResultDTO>> value = operCustomizeOpenFeignClient.getYlfnValue(); |
|
|
|
|
|
if(!value.success()) { |
|
|
|
|
|
throw new EpmetException(value.getCode(), value.getMsg()); |
|
|
|
|
|
} |
|
|
|
|
|
value.getData().forEach(item -> { |
|
|
|
|
|
//查询客户下的非育龄妇女的女性居民
|
|
|
|
|
|
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
wrapper.eq(IcResiUserEntity::getCustomerId, item.getCustomerId()); |
|
|
|
|
|
wrapper.eq(IcResiUserEntity::getGender, NumConstant.TWO_STR); |
|
|
|
|
|
wrapper.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR); |
|
|
|
|
|
wrapper.eq(IcResiUserEntity::getIdCardType, NumConstant.ONE_STR); |
|
|
|
|
|
List<IcResiUserEntity> list = baseDao.selectList(wrapper); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(list)) { |
|
|
|
|
|
list.forEach(user -> { |
|
|
|
|
|
IdCardRegexUtils pares = IdCardRegexUtils.parse(user.getIdCard()); |
|
|
|
|
|
if (NumConstant.ONE_STR.equals(pares.getTypeEnum().getType())) { |
|
|
|
|
|
if (!NumConstant.ONE_STR.equals(user.getIsYlfn())) { |
|
|
|
|
|
//将不是育龄妇女的变为育龄妇女
|
|
|
|
|
|
if (pares.getParsedResult().getAge() >= item.getMin() && pares.getParsedResult().getAge() <= item.getMax()) { |
|
|
|
|
|
//更新育龄妇女状态
|
|
|
|
|
|
IcResiUserEntity icResiUserEntity = new IcResiUserEntity(); |
|
|
|
|
|
icResiUserEntity.setId(user.getId()); |
|
|
|
|
|
icResiUserEntity.setIsYlfn(NumConstant.ONE_STR); |
|
|
|
|
|
baseDao.updateById(icResiUserEntity); |
|
|
|
|
|
|
|
|
|
|
|
//添加居民变更记录
|
|
|
|
|
|
IcUserChangeRecordEntity record = new IcUserChangeRecordEntity(); |
|
|
|
|
|
record.setCustomerId(user.getCustomerId()); |
|
|
|
|
|
record.setOperatorId("APP_USER"); |
|
|
|
|
|
record.setOperatorName("系统"); |
|
|
|
|
|
record.setIcUserId(user.getId()); |
|
|
|
|
|
record.setIcUserName(user.getName()); |
|
|
|
|
|
record.setType("category"); |
|
|
|
|
|
record.setTypeName("类别"); |
|
|
|
|
|
record.setBeforeChangeName("否"); |
|
|
|
|
|
record.setAfterChangeName("是"); |
|
|
|
|
|
record.setChangeTime(new Date()); |
|
|
|
|
|
icUserChangeRecordDao.insert(record); |
|
|
|
|
|
//添加变更明细
|
|
|
|
|
|
IcUserChangeDetailedEntity detail = new IcUserChangeDetailedEntity(); |
|
|
|
|
|
detail.setCustomerId(user.getCustomerId()); |
|
|
|
|
|
detail.setIcUserChangeRecordId(record.getId()); |
|
|
|
|
|
detail.setPids(user.getPids()); |
|
|
|
|
|
detail.setAgencyId(user.getAgencyId()); |
|
|
|
|
|
detail.setGridId(user.getGridId()); |
|
|
|
|
|
detail.setNeighborHoodId(user.getVillageId()); |
|
|
|
|
|
detail.setBuildingId(user.getBuildId()); |
|
|
|
|
|
detail.setBuildingUnitId(user.getUnitId()); |
|
|
|
|
|
detail.setHouseId(user.getHomeId()); |
|
|
|
|
|
detail.setIcUserId(user.getId()); |
|
|
|
|
|
detail.setType("category"); |
|
|
|
|
|
detail.setTypeName("类别"); |
|
|
|
|
|
detail.setFieldName("IS_YLFN"); |
|
|
|
|
|
detail.setValue(NumConstant.ONE); |
|
|
|
|
|
icUserChangeDetailedDao.insert(detail); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
//将是育龄妇女的变为非育龄妇女
|
|
|
|
|
|
if (pares.getParsedResult().getAge() < item.getMin() || pares.getParsedResult().getAge() > item.getMax()) { |
|
|
|
|
|
//更新育龄妇女状态
|
|
|
|
|
|
IcResiUserEntity icResiUserEntity = new IcResiUserEntity(); |
|
|
|
|
|
icResiUserEntity.setId(user.getId()); |
|
|
|
|
|
icResiUserEntity.setIsYlfn(NumConstant.ZERO_STR); |
|
|
|
|
|
baseDao.updateById(icResiUserEntity); |
|
|
|
|
|
//添加居民变更记录
|
|
|
|
|
|
IcUserChangeRecordEntity record = new IcUserChangeRecordEntity(); |
|
|
|
|
|
record.setCustomerId(user.getCustomerId()); |
|
|
|
|
|
record.setOperatorId("APP_USER"); |
|
|
|
|
|
record.setOperatorName("系统"); |
|
|
|
|
|
record.setIcUserId(user.getId()); |
|
|
|
|
|
record.setIcUserName(user.getName()); |
|
|
|
|
|
record.setType("category"); |
|
|
|
|
|
record.setTypeName("类别"); |
|
|
|
|
|
record.setBeforeChangeName("是"); |
|
|
|
|
|
record.setAfterChangeName("否"); |
|
|
|
|
|
record.setChangeTime(new Date()); |
|
|
|
|
|
icUserChangeRecordDao.insert(record); |
|
|
|
|
|
//添加变更明细
|
|
|
|
|
|
IcUserChangeDetailedEntity detail = new IcUserChangeDetailedEntity(); |
|
|
|
|
|
detail.setCustomerId(user.getCustomerId()); |
|
|
|
|
|
detail.setIcUserChangeRecordId(record.getId()); |
|
|
|
|
|
detail.setPids(user.getPids()); |
|
|
|
|
|
detail.setAgencyId(user.getAgencyId()); |
|
|
|
|
|
detail.setGridId(user.getGridId()); |
|
|
|
|
|
detail.setNeighborHoodId(user.getVillageId()); |
|
|
|
|
|
detail.setBuildingId(user.getBuildId()); |
|
|
|
|
|
detail.setBuildingUnitId(user.getUnitId()); |
|
|
|
|
|
detail.setHouseId(user.getHomeId()); |
|
|
|
|
|
detail.setIcUserId(user.getId()); |
|
|
|
|
|
detail.setType("category"); |
|
|
|
|
|
detail.setTypeName("类别"); |
|
|
|
|
|
detail.setFieldName("IS_YLFN"); |
|
|
|
|
|
detail.setValue(NumConstant.ONE_NEG); |
|
|
|
|
|
icUserChangeDetailedDao.insert(detail); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|