Commit 29a19c7d authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.7.9' into MVP1.7.9

parents 435ef5be d3b8657b
...@@ -886,6 +886,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -886,6 +886,9 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
@Override @Override
public R batchSendMessage(List<SendMessageUpdateVo> voList,String type) { public R batchSendMessage(List<SendMessageUpdateVo> voList,String type) {
if (Common.isNotNull(voList) && voList.size() >200) {
return R.failed("短信批量发送单次最多两百条");
}
//获取短信待发放和信息待填写的数据 //获取短信待发放和信息待填写的数据
List<String> errorList = new ArrayList<>(); List<String> errorList = new ArrayList<>();
if (CommonConstants.ONE_STRING.equals(type)) { if (CommonConstants.ONE_STRING.equals(type)) {
......
...@@ -34,7 +34,6 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeePreLogSearchVo; ...@@ -34,7 +34,6 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeePreLogSearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator; import com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties; import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties;
...@@ -156,6 +155,16 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -156,6 +155,16 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
IGNORE_FIELD.add("isAddress"); IGNORE_FIELD.add("isAddress");
} }
private static final List<String> PRE_IGNORE_FIELD = new ArrayList<>();
static {
IGNORE_FIELD.add("createTime");
IGNORE_FIELD.add("deptId");
IGNORE_FIELD.add("dataSource");
IGNORE_FIELD.add("createBy");
IGNORE_FIELD.add("createName");
IGNORE_FIELD.add("updateBy");
}
@Override @Override
public void saveModifyAndUpdateInsurance(String empPreId, EmployeeRegistrationPre oldInfo public void saveModifyAndUpdateInsurance(String empPreId, EmployeeRegistrationPre oldInfo
, EmployeeRegistrationPre newInfo, YifuUser user, Map<String, TEmployeeInsurancePre> oldMap) { , EmployeeRegistrationPre newInfo, YifuUser user, Map<String, TEmployeeInsurancePre> oldMap) {
...@@ -321,7 +330,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe ...@@ -321,7 +330,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
if (Common.isNotNull(newInsurance.getId())) { if (Common.isNotNull(newInsurance.getId())) {
oldInsurance = oldMap.get(newInsurance.getId()); oldInsurance = oldMap.get(newInsurance.getId());
if (oldInsurance != null) { if (oldInsurance != null) {
differenceInsuranceKey = HrEquator.comparisonValue(oldInsurance, newInsurance); differenceInsuranceKey = HrEquator.comparisonValueIgnoreField(oldInsurance, newInsurance,PRE_IGNORE_FIELD);
} }
if (Common.isNotNull(differenceInsuranceKey) || oldInsurance == null) { if (Common.isNotNull(differenceInsuranceKey) || oldInsurance == null) {
detailInsuranceLog = new TEmployeePreLogDetail(); detailInsuranceLog = new TEmployeePreLogDetail();
......
...@@ -203,7 +203,7 @@ public class TEmployeeProjectBelongDeptServiceImpl extends ServiceImpl<TEmployee ...@@ -203,7 +203,7 @@ public class TEmployeeProjectBelongDeptServiceImpl extends ServiceImpl<TEmployee
dept.setId(vo.getProjectId()); dept.setId(vo.getProjectId());
dept.setEmpDeptid(vo.getDepartId().toString()); dept.setEmpDeptid(vo.getDepartId().toString());
dept.setEmpDeptname(vo.getDepartName()); dept.setEmpDeptname(vo.getDepartName());
this.save(dept); this.saveOrUpdate(dept);
} else { } else {
this.removeById(vo.getProjectId()); this.removeById(vo.getProjectId());
} }
......
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
inner join t_employee_info b on a.EMP_ID = b.id inner join t_employee_info b on a.EMP_ID = b.id
inner join t_settle_domain c on a.DEPT_NO = c.DEPART_NO inner join t_settle_domain c on a.DEPT_NO = c.DEPART_NO
<where> <where>
a.delete_flag = '0' and a.IS_COMPLETE = '1' a.delete_flag = '0' and a.IS_COMPLETE = '1' and a.project_status = 0
<include refid="employeeRegistrationPre_where"/> <include refid="employeeRegistrationPre_where"/>
</where> </where>
order by a.CREATE_TIME desc order by a.CREATE_TIME desc
......
...@@ -666,6 +666,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -666,6 +666,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
TEmployeeInsuranceWorkDayVo dayVo = new TEmployeeInsuranceWorkDayVo(); TEmployeeInsuranceWorkDayVo dayVo = new TEmployeeInsuranceWorkDayVo();
dayVo.setType(CommonConstants.TWO_STRING); dayVo.setType(CommonConstants.TWO_STRING);
dayVo.setRegistDate(registration.getJoinLeaveDate()); dayVo.setRegistDate(registration.getJoinLeaveDate());
if (insurancePreVo.getBuyType() ==1) {
dayVo.setAddOrBatch(CommonConstants.ONE_STRING);
}
dataR = socialDaprUtils.getBeforeOrAfterWorkDay(dayVo); dataR = socialDaprUtils.getBeforeOrAfterWorkDay(dayVo);
if (Common.isNotNull(dataR) && Common.isNotNull(dataR.getData()) if (Common.isNotNull(dataR) && Common.isNotNull(dataR.getData())
&& Common.isNotNull(dataR.getData().getRegistDate()) && Common.isNotNull(dataR.getData().getRegistDate())
......
...@@ -330,29 +330,30 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -330,29 +330,30 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
List<TEmployeeInsurancePreVo> employeeInsurancePreVos = registrationPreVo.getEmployeeInsurancePreVos(); List<TEmployeeInsurancePreVo> employeeInsurancePreVos = registrationPreVo.getEmployeeInsurancePreVos();
TEmployeeInsurancePre preExit; TEmployeeInsurancePre preExit;
if (null != employeeInsurancePreVos && !employeeInsurancePreVos.isEmpty()) { if (null != employeeInsurancePreVos && !employeeInsurancePreVos.isEmpty()) {
for (TEmployeeInsurancePreVo preVo : employeeInsurancePreVos) { try {
//判断是否存在商险待购买信息 for (TEmployeeInsurancePreVo preVo : employeeInsurancePreVos) {
preExit = baseMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda() //判断是否存在商险待购买信息
.eq(TEmployeeInsurancePre::getRegisterId, preVo.getRegisterId()) preExit = baseMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda()
.eq(TEmployeeInsurancePre::getEmpIdcard, preVo.getEmpIdcard()) .eq(TEmployeeInsurancePre::getRegisterId, preVo.getRegisterId())
.eq(TEmployeeInsurancePre::getBuyStandard, preVo.getBuyStandard()) .eq(TEmployeeInsurancePre::getEmpIdcard, preVo.getEmpIdcard())
.eq(TEmployeeInsurancePre::getInsuranceTypeName, preVo.getInsuranceTypeName()) .eq(TEmployeeInsurancePre::getBuyStandard, preVo.getBuyStandard())
.eq(TEmployeeInsurancePre::getInsuranceCompanyName, preVo.getInsuranceCompanyName()) .eq(TEmployeeInsurancePre::getInsuranceTypeName, preVo.getInsuranceTypeName())
.eq(TEmployeeInsurancePre::getPolicyStart, preVo.getPolicyStart()) .eq(TEmployeeInsurancePre::getInsuranceCompanyName, preVo.getInsuranceCompanyName())
.eq(TEmployeeInsurancePre::getPolicyEnd, preVo.getPolicyEnd()) .eq(TEmployeeInsurancePre::getPolicyStart, DateUtil.parseDate(DateUtil.dateToString(preVo.getPolicyStart()), DateUtil.ISO_EXPANDED_DATE_FORMAT))
.last(CommonConstants.LAST_ONE_SQL)); .eq(TEmployeeInsurancePre::getPolicyEnd, DateUtil.parseDate(DateUtil.dateToString(preVo.getPolicyEnd()), DateUtil.ISO_EXPANDED_DATE_FORMAT))
TEmployeeInsurancePre pre = new TEmployeeInsurancePre(); .last(CommonConstants.LAST_ONE_SQL));
BeanUtils.copyProperties(preVo, pre); TEmployeeInsurancePre pre = new TEmployeeInsurancePre();
if (Common.isNotNull(preVo.getExpectedCollectionTime())) { BeanUtils.copyProperties(preVo, pre);
pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime())); if (Common.isNotNull(preVo.getExpectedCollectionTime())) {
} pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime()));
if (Common.isNotNull(preExit)) { }
pre.setId(preExit.getId()); if (Common.isNotNull(preExit)) {
baseMapper.deleteById(preExit); pre.setId(preExit.getId());
baseMapper.insert(pre); baseMapper.deleteById(preExit);
} else { baseMapper.insert(pre);
baseMapper.insert(pre); } else {
//暂时不需要,先注释,后续可能会需要 baseMapper.insert(pre);
//暂时不需要,先注释,后续可能会需要
// if (Common.isNotNull(pre.getExpectedCollectionTime())) { // if (Common.isNotNull(pre.getExpectedCollectionTime())) {
// // 事务提交后触发调度 // // 事务提交后触发调度
// TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { // TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
...@@ -367,7 +368,11 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -367,7 +368,11 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
// } // }
// }); // });
// } // }
}
} }
}catch (Exception e){
log.error("执行异常" ,e);
return null;
} }
} }
return true; return true;
...@@ -395,11 +400,13 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -395,11 +400,13 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
@Override @Override
public void updateInsurancePreCustomerName(EmployeeRegistrationCustomerUserUpdateVo updateVo) { public void updateInsurancePreCustomerName(EmployeeRegistrationCustomerUserUpdateVo updateVo) {
LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>(); if (Common.isNotNull(updateVo)) {
updateWrapper.eq(TEmployeeInsurancePre::getDeptNo,updateVo.getDeptNo()) LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>();
.set(TEmployeeInsurancePre::getCustomerUsername, updateVo.getCustomerUserName()) updateWrapper.eq(TEmployeeInsurancePre::getDeptNo, updateVo.getDeptNo())
.set(TEmployeeInsurancePre::getCustomerUserLoginname, updateVo.getCustomerUserLoginName()); .set(TEmployeeInsurancePre::getCustomerUsername, updateVo.getCustomerUserName())
this.update(updateWrapper); .set(TEmployeeInsurancePre::getCustomerUserLoginname, updateVo.getCustomerUserLoginName());
this.update(updateWrapper);
}
} }
@Override @Override
...@@ -422,6 +429,12 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -422,6 +429,12 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
//获取所有待派单的数据 //获取所有待派单的数据
List<String> unConfirmList = baseMapper.getAllUnDisData(); List<String> unConfirmList = baseMapper.getAllUnDisData();
if (null != unConfirmList && !unConfirmList.isEmpty()) { if (null != unConfirmList && !unConfirmList.isEmpty()) {
//更新成已确认
LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(TEmployeeInsurancePre::getId, unConfirmList)
.eq(TEmployeeInsurancePre::getProcessStatus, CommonConstants.ZERO_STRING)
.set(TEmployeeInsurancePre::getProcessStatus, CommonConstants.ONE_STRING);
this.update(updateWrapper);
try { try {
this.batchDispatcherInsurance(unConfirmList); this.batchDispatcherInsurance(unConfirmList);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -327,6 +327,6 @@ ...@@ -327,6 +327,6 @@
SELECT SELECT
id id
FROM t_employee_insurance_pre a FROM t_employee_insurance_pre a
where a.process_status in ('1','2','5') and DATE_FORMAT(a.expected_collection_time,"%Y-%m-%d") <![CDATA[ <= ]]> CURDATE() where a.process_status in ('0','1','2','5') and DATE_FORMAT(a.expected_collection_time,"%Y-%m-%d") <![CDATA[ <= ]]> CURDATE()
</select> </select>
</mapper> </mapper>
...@@ -85,4 +85,17 @@ public class UpdateOverdueTask { ...@@ -85,4 +85,17 @@ public class UpdateOverdueTask {
"/temployeeinsurancepre/inner/pushWxConfrimMessage","", Void.class, SecurityConstants.FROM_IN); "/temployeeinsurancepre/inner/pushWxConfrimMessage","", Void.class, SecurityConstants.FROM_IN);
log.info("-------------每天九点推送商险待确认信息-定时任务开始------------"); log.info("-------------每天九点推送商险待确认信息-定时任务开始------------");
} }
/**
* 每天刷新商险到期提醒信息
* @author huych
* @param
* @return void
*/
public void pushDisConfrimInsurances() {
log.info("-------------每天三点二十推送商险待确认信息------------");
HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(), daprInsurancesProperties.getAppId(),
"/temployeeinsurancepre/inner/pushDisConfrimInsurances","", Void.class, SecurityConstants.FROM_IN);
log.info("-------------每天三点二十推送商险待确认信息-定时任务开始------------");
}
} }
...@@ -27,4 +27,7 @@ public class TEmployeeInsuranceWorkDayVo implements Serializable { ...@@ -27,4 +27,7 @@ public class TEmployeeInsuranceWorkDayVo implements Serializable {
@Schema(description = "类型 1 前一个工作日 2 后一个工作日") @Schema(description = "类型 1 前一个工作日 2 后一个工作日")
private String type; private String type;
@Schema(description = "类型 1 新增 2 其他")
private String addOrBatch;
} }
...@@ -309,7 +309,14 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo ...@@ -309,7 +309,14 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo
for (THolidayInfo h:holidayInfos){ for (THolidayInfo h:holidayInfos){
holidayMap.put(h.getDate(),h.getDay()); holidayMap.put(h.getDate(),h.getDay());
} }
} else {
vo.setPriDisDate(vo.getRegistDate());
return vo;
} }
LocalDate preRegistDate = vo.getRegistDate().toInstant()
.atZone(java.time.ZoneId.systemDefault())
.toLocalDate();
//查找入职日期的前一个工作日 //查找入职日期的前一个工作日
TEmployeeInsuranceWorkDayVo newVo = new TEmployeeInsuranceWorkDayVo(); TEmployeeInsuranceWorkDayVo newVo = new TEmployeeInsuranceWorkDayVo();
newVo.setRegistDate(DateUtil.addDayByDate(vo.getRegistDate(), CommonConstants.ONE_INT_NEGATE)); newVo.setRegistDate(DateUtil.addDayByDate(vo.getRegistDate(), CommonConstants.ONE_INT_NEGATE));
...@@ -328,8 +335,18 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo ...@@ -328,8 +335,18 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo
// 如果日期前一个工作日日期小于等于今天 // 如果日期前一个工作日日期小于等于今天
if (currentTime.isBefore(LocalTime.of(15, 20)) || currentTime.equals(LocalTime.of(15, 20))) { if (currentTime.isBefore(LocalTime.of(15, 20)) || currentTime.equals(LocalTime.of(15, 20))) {
// 如果当前时间在15:20之前 // 如果当前时间在15:20之前
vo.setPriDisDate(LocalDateTimeUtils.convertLDToDate(today)); //判断当前时间是否为非工作日,如果是的话,预派时间需要为下个工作日
vo.setRegistDate(DateUtil.addDayByDate(vo.getPriDisDate(), CommonConstants.ONE_INT)); if (null != holidayMap.get(LocalDateTimeUtils.convertLDToDate(today))) {
TEmployeeInsuranceWorkDayVo newVoUnWork = new TEmployeeInsuranceWorkDayVo();
newVoUnWork.setRegistDate(LocalDateTimeUtils.convertLDToDate(today));
newVoUnWork.setType(CommonConstants.TWO_STRING);
getWorkDay(holidayMap, newVoUnWork);
vo.setPriDisDate(newVoUnWork.getRegistDate());
vo.setRegistDate(DateUtil.addDayByDate(vo.getPriDisDate(), CommonConstants.ONE_INT));
} else {
vo.setPriDisDate(LocalDateTimeUtils.convertLDToDate(today));
vo.setRegistDate(DateUtil.addDayByDate(vo.getPriDisDate(), CommonConstants.ONE_INT));
}
} else { } else {
// 如果当前时间在15:20之后 // 如果当前时间在15:20之后
TEmployeeInsuranceWorkDayVo afterVo = new TEmployeeInsuranceWorkDayVo(); TEmployeeInsuranceWorkDayVo afterVo = new TEmployeeInsuranceWorkDayVo();
...@@ -346,6 +363,12 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo ...@@ -346,6 +363,12 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo
//预计生效日期 //预计生效日期
vo.setRegistDate(DateUtil.addDayByDate(newVo.getRegistDate(), CommonConstants.ONE_INT)); vo.setRegistDate(DateUtil.addDayByDate(newVo.getRegistDate(), CommonConstants.ONE_INT));
} }
if (Common.isNotNull(vo.getAddOrBatch()) && CommonConstants.ONE_STRING.equals(vo.getAddOrBatch())
&& vo.getRegistDate().toInstant().atZone(java.time.ZoneId.systemDefault())
.toLocalDate().isBefore(preRegistDate)) {
//针对新增如果保单开始日期小于入职日期那么保单开始日期等于入职日期
vo.setRegistDate(LocalDateTimeUtils.convertLDToDate(preRegistDate));
}
return vo; return vo;
} }
......
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