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
@Override
public R batchSendMessage(List<SendMessageUpdateVo> voList,String type) {
if (Common.isNotNull(voList) && voList.size() >200) {
return R.failed("短信批量发送单次最多两百条");
}
//获取短信待发放和信息待填写的数据
List<String> errorList = new ArrayList<>();
if (CommonConstants.ONE_STRING.equals(type)) {
......
......@@ -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.SecurityConstants;
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.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties;
......@@ -156,6 +155,16 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
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
public void saveModifyAndUpdateInsurance(String empPreId, EmployeeRegistrationPre oldInfo
, EmployeeRegistrationPre newInfo, YifuUser user, Map<String, TEmployeeInsurancePre> oldMap) {
......@@ -321,7 +330,7 @@ public class TEmployeePreLogServiceImpl extends ServiceImpl<TEmployeePreLogMappe
if (Common.isNotNull(newInsurance.getId())) {
oldInsurance = oldMap.get(newInsurance.getId());
if (oldInsurance != null) {
differenceInsuranceKey = HrEquator.comparisonValue(oldInsurance, newInsurance);
differenceInsuranceKey = HrEquator.comparisonValueIgnoreField(oldInsurance, newInsurance,PRE_IGNORE_FIELD);
}
if (Common.isNotNull(differenceInsuranceKey) || oldInsurance == null) {
detailInsuranceLog = new TEmployeePreLogDetail();
......
......@@ -203,7 +203,7 @@ public class TEmployeeProjectBelongDeptServiceImpl extends ServiceImpl<TEmployee
dept.setId(vo.getProjectId());
dept.setEmpDeptid(vo.getDepartId().toString());
dept.setEmpDeptname(vo.getDepartName());
this.save(dept);
this.saveOrUpdate(dept);
} else {
this.removeById(vo.getProjectId());
}
......
......@@ -186,7 +186,7 @@
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
<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"/>
</where>
order by a.CREATE_TIME desc
......
......@@ -666,6 +666,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
TEmployeeInsuranceWorkDayVo dayVo = new TEmployeeInsuranceWorkDayVo();
dayVo.setType(CommonConstants.TWO_STRING);
dayVo.setRegistDate(registration.getJoinLeaveDate());
if (insurancePreVo.getBuyType() ==1) {
dayVo.setAddOrBatch(CommonConstants.ONE_STRING);
}
dataR = socialDaprUtils.getBeforeOrAfterWorkDay(dayVo);
if (Common.isNotNull(dataR) && Common.isNotNull(dataR.getData())
&& Common.isNotNull(dataR.getData().getRegistDate())
......
......@@ -330,29 +330,30 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
List<TEmployeeInsurancePreVo> employeeInsurancePreVos = registrationPreVo.getEmployeeInsurancePreVos();
TEmployeeInsurancePre preExit;
if (null != employeeInsurancePreVos && !employeeInsurancePreVos.isEmpty()) {
for (TEmployeeInsurancePreVo preVo : employeeInsurancePreVos) {
//判断是否存在商险待购买信息
preExit = baseMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda()
.eq(TEmployeeInsurancePre::getRegisterId, preVo.getRegisterId())
.eq(TEmployeeInsurancePre::getEmpIdcard, preVo.getEmpIdcard())
.eq(TEmployeeInsurancePre::getBuyStandard, preVo.getBuyStandard())
.eq(TEmployeeInsurancePre::getInsuranceTypeName, preVo.getInsuranceTypeName())
.eq(TEmployeeInsurancePre::getInsuranceCompanyName, preVo.getInsuranceCompanyName())
.eq(TEmployeeInsurancePre::getPolicyStart, preVo.getPolicyStart())
.eq(TEmployeeInsurancePre::getPolicyEnd, preVo.getPolicyEnd())
.last(CommonConstants.LAST_ONE_SQL));
TEmployeeInsurancePre pre = new TEmployeeInsurancePre();
BeanUtils.copyProperties(preVo, pre);
if (Common.isNotNull(preVo.getExpectedCollectionTime())) {
pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime()));
}
if (Common.isNotNull(preExit)) {
pre.setId(preExit.getId());
baseMapper.deleteById(preExit);
baseMapper.insert(pre);
} else {
baseMapper.insert(pre);
//暂时不需要,先注释,后续可能会需要
try {
for (TEmployeeInsurancePreVo preVo : employeeInsurancePreVos) {
//判断是否存在商险待购买信息
preExit = baseMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda()
.eq(TEmployeeInsurancePre::getRegisterId, preVo.getRegisterId())
.eq(TEmployeeInsurancePre::getEmpIdcard, preVo.getEmpIdcard())
.eq(TEmployeeInsurancePre::getBuyStandard, preVo.getBuyStandard())
.eq(TEmployeeInsurancePre::getInsuranceTypeName, preVo.getInsuranceTypeName())
.eq(TEmployeeInsurancePre::getInsuranceCompanyName, preVo.getInsuranceCompanyName())
.eq(TEmployeeInsurancePre::getPolicyStart, DateUtil.parseDate(DateUtil.dateToString(preVo.getPolicyStart()), DateUtil.ISO_EXPANDED_DATE_FORMAT))
.eq(TEmployeeInsurancePre::getPolicyEnd, DateUtil.parseDate(DateUtil.dateToString(preVo.getPolicyEnd()), DateUtil.ISO_EXPANDED_DATE_FORMAT))
.last(CommonConstants.LAST_ONE_SQL));
TEmployeeInsurancePre pre = new TEmployeeInsurancePre();
BeanUtils.copyProperties(preVo, pre);
if (Common.isNotNull(preVo.getExpectedCollectionTime())) {
pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime()));
}
if (Common.isNotNull(preExit)) {
pre.setId(preExit.getId());
baseMapper.deleteById(preExit);
baseMapper.insert(pre);
} else {
baseMapper.insert(pre);
//暂时不需要,先注释,后续可能会需要
// if (Common.isNotNull(pre.getExpectedCollectionTime())) {
// // 事务提交后触发调度
// TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
......@@ -367,7 +368,11 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
// }
// });
// }
}
}
}catch (Exception e){
log.error("执行异常" ,e);
return null;
}
}
return true;
......@@ -395,11 +400,13 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
@Override
public void updateInsurancePreCustomerName(EmployeeRegistrationCustomerUserUpdateVo updateVo) {
LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeInsurancePre::getDeptNo,updateVo.getDeptNo())
.set(TEmployeeInsurancePre::getCustomerUsername, updateVo.getCustomerUserName())
.set(TEmployeeInsurancePre::getCustomerUserLoginname, updateVo.getCustomerUserLoginName());
this.update(updateWrapper);
if (Common.isNotNull(updateVo)) {
LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeInsurancePre::getDeptNo, updateVo.getDeptNo())
.set(TEmployeeInsurancePre::getCustomerUsername, updateVo.getCustomerUserName())
.set(TEmployeeInsurancePre::getCustomerUserLoginname, updateVo.getCustomerUserLoginName());
this.update(updateWrapper);
}
}
@Override
......@@ -422,6 +429,12 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
//获取所有待派单的数据
List<String> unConfirmList = baseMapper.getAllUnDisData();
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 {
this.batchDispatcherInsurance(unConfirmList);
} catch (Exception e) {
......
......@@ -327,6 +327,6 @@
SELECT
id
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>
</mapper>
......@@ -85,4 +85,17 @@ public class UpdateOverdueTask {
"/temployeeinsurancepre/inner/pushWxConfrimMessage","", Void.class, SecurityConstants.FROM_IN);
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 {
@Schema(description = "类型 1 前一个工作日 2 后一个工作日")
private String type;
@Schema(description = "类型 1 新增 2 其他")
private String addOrBatch;
}
......@@ -309,7 +309,14 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo
for (THolidayInfo h:holidayInfos){
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();
newVo.setRegistDate(DateUtil.addDayByDate(vo.getRegistDate(), CommonConstants.ONE_INT_NEGATE));
......@@ -328,8 +335,18 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo
// 如果日期前一个工作日日期小于等于今天
if (currentTime.isBefore(LocalTime.of(15, 20)) || currentTime.equals(LocalTime.of(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 {
// 如果当前时间在15:20之后
TEmployeeInsuranceWorkDayVo afterVo = new TEmployeeInsuranceWorkDayVo();
......@@ -346,6 +363,12 @@ public class THolidayInfoServiceImpl extends ServiceImpl<THolidayInfoMapper, THo
//预计生效日期
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;
}
......
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