Commit d0d21995 authored by huyuchen's avatar huyuchen

huych-社保自动化相关提交

parent 9ef521e5
...@@ -175,34 +175,45 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -175,34 +175,45 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
.eq(TSocialPreDetail::getRegisterId, registrationPreVo.getExitSocialInfoList() .eq(TSocialPreDetail::getRegisterId, registrationPreVo.getExitSocialInfoList()
.get(0).getRegisterId())); .get(0).getRegisterId()));
//批量新增 //批量新增
for (TSocialPreDetailVo vo :registrationPreVo.getExitSocialInfoList()) { for (TSocialPreDetailVo vo : registrationPreVo.getExitSocialInfoList()) {
TSocialPreDetail preDetal = new TSocialPreDetail(); TSocialPreDetail preDetal = new TSocialPreDetail();
BeanUtils.copyProperties(vo, preDetal); BeanUtils.copyProperties(vo, preDetal);
socialPreDetailService.save(preDetal); socialPreDetailService.save(preDetal);
} }
//批量删除社保待购买列表中的待确认、待派单、派单失败、审核、办理失败的数据 //批量删除社保待购买列表中的待确认、待派单、派单失败、审核、办理失败的数据
baseMapper.delete(Wrappers.<TDispatchInfoPre>query().lambda().in( baseMapper.delete(Wrappers.<TDispatchInfoPre>query().lambda().in(
TDispatchInfoPre::getProcessStatus,Arrays.asList("0", "1", "2", "4","8")) TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4", "8"))
.eq(TDispatchInfoPre::getRegisterId,registrationPreVo.getExitSocialInfoList() .eq(TDispatchInfoPre::getRegisterId, registrationPreVo.getExitSocialInfoList()
.get(0).getRegisterId())); .get(0).getRegisterId()));
} else { } else {
//删除已存在的入职确认信息对应的社保明细 //删除已存在的入职确认信息对应的社保明细
TDispatchInfoPreVo preVo = registrationPreVo.getDispatchInfoPreVo(); TDispatchInfoPreVo preVo = registrationPreVo.getDispatchInfoPreVo();
socialPreDetailService.remove(Wrappers.<TSocialPreDetail>lambdaQuery() socialPreDetailService.remove(Wrappers.<TSocialPreDetail>lambdaQuery()
.eq(TSocialPreDetail::getRegisterId, preVo.getRegisterId())); .eq(TSocialPreDetail::getRegisterId, preVo.getRegisterId()));
if (Common.isNotNull(preVo) && Common.isNotNull(preVo.getId())) { try {
//更新逻辑 if (Common.isNotNull(preVo) && Common.isNotNull(preVo.getId())) {
TDispatchInfoPre pre = new TDispatchInfoPre(); //更新逻辑
BeanUtils.copyProperties(preVo, pre); TDispatchInfoPre pre = new TDispatchInfoPre();
baseMapper.updateById(pre); BeanUtils.copyProperties(preVo, pre);
} //时间格式转化
if (Common.isNotNull(preVo) && Common.isEmpty(preVo.getId())) { if (Common.isNotNull(preVo.getExpectedCollectionTime())) {
try { preVo.setExpectedCollectionTime(DateUtil.parseDate(DateUtil.dateToString(
preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 15:20", DateUtil.DATETIME_PATTERN_MINUTE));
pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime()));
}
if (Common.isNotNull(preVo.getExpectedConfirmTime())) {
preVo.setExpectedConfirmTime(DateUtil.parseDate(DateUtil.dateToString(
preVo.getExpectedCollectionTime(), DateUtil.ISO_EXPANDED_DATE_FORMAT) + " 09:00", DateUtil.DATETIME_PATTERN_MINUTE));
pre.setExpectedConfirmTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedConfirmTime()));
}
baseMapper.updateById(pre);
}
if (Common.isNotNull(preVo) && Common.isEmpty(preVo.getId())) {
//判断是否存在社保待购买信息 //判断是否存在社保待购买信息
TDispatchInfoPre preExit = baseMapper.selectOne(Wrappers.<TDispatchInfoPre>query().lambda() TDispatchInfoPre preExit = baseMapper.selectOne(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getRegisterId, preVo.getRegisterId()) .eq(TDispatchInfoPre::getRegisterId, preVo.getRegisterId())
.eq(TDispatchInfoPre::getEmpIdcard, preVo.getEmpIdcard()) .eq(TDispatchInfoPre::getEmpIdcard, preVo.getEmpIdcard())
.in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4","8")) .in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4", "8"))
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
TDispatchInfoPre pre = new TDispatchInfoPre(); TDispatchInfoPre pre = new TDispatchInfoPre();
BeanUtils.copyProperties(preVo, pre); BeanUtils.copyProperties(preVo, pre);
...@@ -252,10 +263,10 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -252,10 +263,10 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
baseMapper.deleteById(preExit); baseMapper.deleteById(preExit);
} }
baseMapper.insert(pre); baseMapper.insert(pre);
} catch (Exception e) {
log.error("执行异常", e);
return false;
} }
} catch (Exception e) {
log.error("执行异常", e);
return false;
} }
} }
return true; return true;
...@@ -575,13 +586,20 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -575,13 +586,20 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
.atZone(ZoneId.systemDefault()) .atZone(ZoneId.systemDefault())
.toLocalDate(); .toLocalDate();
// 添加年数和月数 // 添加年数和月数
localDate = localDate if (vo.getMonthAfter() == 0 && vo.getYearAfter() == 0) {
.plusYears(vo.getYearAfter()) // 转回Date类型
.plusMonths(vo.getMonthAfter()) return Date.from(localDate.atStartOfDay()
.minusDays(1); .atZone(ZoneId.systemDefault())
// 转回Date类型 .toInstant());
return Date.from(localDate.atStartOfDay() } else {
.atZone(ZoneId.systemDefault()) localDate = localDate
.toInstant()); .plusYears(vo.getYearAfter())
.plusMonths(vo.getMonthAfter())
.minusDays(1);
// 转回Date类型
return Date.from(localDate.atStartOfDay()
.atZone(ZoneId.systemDefault())
.toInstant());
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment