Commit 8b2e7eef authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/develop' into develop

parents 3a4e539f 2401eb35
......@@ -2167,6 +2167,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
contract.setAuditStatus(CommonConstants.ONE_INT);
contract.setApplyNo(contractServicer.getCode(false));
contract.setInUse(CommonConstants.ONE_STRING);
contract.setIsObsolete(CommonConstants.ZERO_ONE);
contractServicer.save(contract);
contractAdd.setId(contract.getId());
contractAdd.setEmpNo(contract.getEmpNo());
......
......@@ -716,17 +716,26 @@
x.CONTRACT_END,
x.CONTRACT_TERM,
x.CONTRACT_SUB_NAME,
x.ID as "CONTRACT_ID"
x.ID as "CONTRACT_ID",
x.EMP_IDCARD
FROM
t_employee_contract_info x
WHERE
x.DELETE_FLAG = '0'
AND x.AUDIT_STATUS = '2'
AND x.AUDIT_STATUS != '3'
AND x.IS_OBSOLETE = '0'
AND x.IN_USE = '0'
<if test="checkVo != null">
<if test="checkVo.idCards != null">
AND x.EMP_IDCARD in
<foreach item="idStr" index="index" collection="checkVo.idCards" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
</if>
GROUP BY
x.SETTLE_DOMAIN
) b on c.DEPT_ID= b.SETTLE_DOMAIN
x.SETTLE_DOMAIN,x.EMP_IDCARD
) b on c.DEPT_ID= b.SETTLE_DOMAIN and b.EMP_IDCARD=a.EMP_IDCARD
</select>
......
......@@ -468,4 +468,12 @@ public interface ErrorCodes {
* 派增异常: 对应项目编码已停止合作
*/
String EMP_DISPATCH_SETTLEDOMAIN_STOP = "emp.dispatch.settleDomain.stop";
/**
* 派减异常: 无对应项目编码的社保信息
*/
String EMP_DISPATCH_REDUCE_SOCIAL_DEPARTNO_ERROR = "emp.dispatch.reduce.social.depart.no.error";
/**
* 派减异常: 无对应项目编码的公积金信息
*/
String EMP_DISPATCH_REDUCE_FUND_DEPARTNO_ERROR = "emp.dispatch.reduce.fund.depart.no.error";
}
......@@ -177,6 +177,10 @@ emp.dispatch.emp.not.empty=\u6D3E\u589E\u5F02\u5E38\uFF1A \u7CFB\u7EDF\u65E0\u5B
emp.dispatch.settleDomain.stop=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u5DF2\u505C\u6B62\u5408\u4F5C
emp.dispatch.reduce.social.depart.no.error=\u6D3E\u51CF\u5F02\u5E38\uFF1A \u65E0\u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u7684\u793E\u4FDD\u4FE1\u606F
emp.dispatch.reduce.fund.depart.no.error=\u6D3E\u51CF\u5F02\u5E38\uFF1A \u65E0\u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u7684\u516C\u79EF\u91D1\u4FE1\u606F
......
package com.yifu.cloud.plus.v1.yifu.common.dapr.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* @author licancan
* @description 商险模块dapr属性
* @date 2022-08-03 10:25:48
*/
@Data
@Component
@PropertySource("classpath:daprConfig.properties")
@ConfigurationProperties(value = "dapr.insurances", ignoreInvalidFields = false)
public class DaprInsurancesProperties {
/**
* dapr sidercar url 如:http://localhost:3511/v1.0/invoke/
*/
String appUrl;
/**
* app_id 如:"yifu_insurances_sider"
*/
String appId;
}
......@@ -12,3 +12,6 @@ dapr.check.appId=yifu-check
dapr.archives.appUrl=http://yifu-archives.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.archives.appId=yifu-archives
dapr.insurances.appUrl=http://yifu-insurances.qas-mvp.svc.cluster.local:3511/v1.0/invoke/
dapr.insurances.appId=yifu-insurances
......@@ -7,6 +7,7 @@ import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
......@@ -75,11 +76,14 @@ public class LocalDateUtil {
*/
public static LocalDate parseLocalDate(String strDate){
try {
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(NORM_DATE_PATTERN, Locale.CHINA);
LocalDate localDate = LocalDate.parse(strDate, dateTimeFormatter);
return localDate;
if (isDate(strDate,NORM_DATE_PATTERN)){
DateFormat dateFormat = new SimpleDateFormat(NORM_DATE_PATTERN);
Date date = dateFormat.parse(strDate);
return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
}
return null;
}catch (Exception e){
e.printStackTrace();
System.out.println("字符串格式的日期转LocalDate失败");
return null;
}
}
......@@ -337,6 +341,6 @@ public class LocalDateUtil {
}
public static void main(String[] args) {
System.out.println(isOverdueDate("2022-08-03"));
System.out.println(parseLocalDate("2022-8-3"));
}
}
......@@ -47,10 +47,9 @@ public class TInsuranceDetailController {
* @param
* @return void
*/
@Operation(summary = "每日定时刷新商险到期数据", description = "每日定时刷新商险到期数据")
@SysLog("每日定时刷新商险到期数据")
@Inner
@GetMapping("/inner/updateOverdueByTask")
@PostMapping("/inner/updateOverdueByTask")
public void updateOverdueByTask() {
tInsuranceDetailService.updateOverdueByTask();
}
......
......@@ -3195,6 +3195,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
//排除投保退回的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FOUR_INT);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
......@@ -3455,6 +3457,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FOUR_INT);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
......@@ -3674,6 +3677,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail :: getPolicyEnd,LocalDateUtil.parseLocalDate(policyEnd));
//排除已减员的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
//排除投保退回的数据
queryWrapper.ne(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FOUR_INT);
List<TInsuranceDetail> list = list(queryWrapper);
if (list.size()>1){
param.setErrorMessage(InsurancesConstants.MULTIPLE_RECORDS_UNDER_WARRANTY);
......
package com.yifu.cloud.plus.v1.job.compont;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprInsurancesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @author licancan
* @description 商险模块到期定时任务
* @date 2022-08-03 10:39:14
*/
@Component(value = "updateOverdueTask")
@Slf4j
@EnableConfigurationProperties(DaprInsurancesProperties.class)
public class UpdateOverdueTask {
@Resource
private DaprInsurancesProperties daprInsurancesProperties;
/**
* 更新商险到期定时任务
*
* @author licancan
* @param
* @return void
*/
public void updateOverdueTask() throws Exception {
log.info("-------------更新商险到期-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprInsurancesProperties.getAppUrl(),daprInsurancesProperties.getAppId(),"/insuranceDetail/inner/updateOverdueByTask","", Void.class, SecurityConstants.FROM_IN);
log.info("------------更新商险到期-定时任务结束------------");
}
}
......@@ -40,6 +40,13 @@ import java.util.Date;
@Data
public class TDispatchReduceVo extends RowIndex implements Serializable {
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", maxLength = 50, isNotEmpty = true)
@Schema(description = "项目编码" )
@ExcelProperty("项目编码" )
private String departNo;
/**
* 员工姓名
*/
......
......@@ -347,7 +347,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
fundSet = fundHoldMap.get(excel.getProvidentHousehold());
socialSet = socialHoldMap.get(excel.getSocialHousehold());
socialFund = getSocialFund(socialFundMap,excel);
setInfoVo = getSetInfoVo(projectVoMap,excel);
setInfoVo = getSetInfoVo(projectVoMap,excel.getSettleDomainCode());
if (Common.isNotNull(empVoMap)) {
empVo = empVoMap.get(excel.getEmpIdcard());
}
......@@ -413,8 +413,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
Common.clear(fundHoldMap);
Common.clear(excelVOTemp);
}
private ProjectSetInfoVo getSetInfoVo(Map<String, ProjectSetInfoVo> projectVoMap, TDispatchImportVo excel) {
return Common.isEmpty(projectVoMap)?null:projectVoMap.get(excel.getSettleDomainCode());
private ProjectSetInfoVo getSetInfoVo(Map<String, ProjectSetInfoVo> projectVoMap, String code) {
return Common.isEmpty(projectVoMap)?null:projectVoMap.get(code);
}
private TSocialFundInfo getSocialFund(Map<String, TSocialFundInfo> socialFundMap, TDispatchImportVo excel) {
......@@ -1992,20 +1992,29 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
Map<String,String> excelVOTemp = new HashMap<>();
// 个性化校验逻辑
List<String> idcards = new ArrayList<>();
// 通过身份证和项目编码获取档案&项目档案&最新合同
Map<String, DispatchEmpVo> empVoMap = getDispatchEmpVo(idcards, null);
List<String> codes = new ArrayList<>();
// 初始化参数
initIdcard(excelVOList, idcards);
initIdcard(excelVOList, idcards,codes);
// 通过身份证和项目编码获取档案&项目档案&最新合同
Map<String, DispatchEmpVo> empVoMap = getDispatchEmpVo(idcards, codes);
// 通过身份证查询社保&公积金&社保公积金查询信息: 身份证维度唯一
Map<String, TSocialFundInfo> socialFundMap = getSocialFundMap(idcards);
// 获取项目编码数据 以供校验
Map<String, ProjectSetInfoVo> projectVoMap = getProjectVoMap(codes);
DispatchEmpVo empVo = null;
TDispatchInfo dispatch;
TDispatchReduceVo excel;
TSocialFundInfo socialFund;
ProjectSetInfoVo setInfoVo = null;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i);
setInfoVo = getSetInfoVo(projectVoMap,excel.getDepartNo());
socialFund = socialFundMap.get(excel.getEmpIdcard());
if (Common.isEmpty(setInfoVo)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_PROJECT_NOT_FOUND)));
continue;
}
if (Common.isEmpty(socialFund)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_FUND_NOT_EMPTY)));
continue;
......@@ -2019,8 +2028,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
excelVOTemp.put(excel.getEmpIdcard(),excel.getEmpIdcard());
// 初始化派单 和 社保公积金查询信息
dispatch = gettDispatchInfo(empVo, excel, socialFund);
dispatch = gettDispatchInfo(empVo, excel, socialFund,setInfoVo);
try {
dispatch.setApplyNo(getApplyCode());
dispatch.setStatus(CommonConstants.ONE_STRING);
baseMapper.insert(dispatch);
socialFundMapper.updateById(socialFund);
......@@ -2033,7 +2043,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
private TDispatchInfo gettDispatchInfo(DispatchEmpVo empVo, TDispatchReduceVo excel, TSocialFundInfo socialFund) {
private TDispatchInfo gettDispatchInfo(DispatchEmpVo empVo, TDispatchReduceVo excel, TSocialFundInfo socialFund, ProjectSetInfoVo setInfoVo) {
TDispatchInfo dispatch;
dispatch = new TDispatchInfo();
dispatch.setEmpId(socialFund.getEmpId());
......@@ -2046,6 +2056,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setDeleteFlag(CommonConstants.ZERO_STRING);
dispatch.setReduceReason(excel.getReasonType());
dispatch.setTrustRemark(excel.getTrustRemark());
if (Common.isNotNull(setInfoVo)){
dispatch.setSettleDomain(setInfoVo.getId());
dispatch.setSettleDomainName(setInfoVo.getDepartName());
dispatch.setSettleDomainCode(setInfoVo.getDepartNo());
dispatch.setBelongUnit(setInfoVo.getCustomerId());
dispatch.setBelongUnitName(setInfoVo.getCustomerName());
}
StringBuffer temp = new StringBuffer();
if (Common.isNotNull(excel.getSocialReduceDate())){
dispatch.setSocialHandleStatus(CommonConstants.ZERO_STRING);
......@@ -2102,7 +2119,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setEmpMobile(empVo.getEmpPhone());
dispatch.setEmpNational(empVo.getEmpNational());
dispatch.setEmpId(empVo.getId());
dispatch.setEmpNo(empVo.getEmpCode());
dispatch.setEmpNo(empVo.getEmpNo());
// 封装合同信息 如果有合同取值实际合同信息
dispatch.setContractStart(empVo.getContractStart());
dispatch.setContractEnd(empVo.getContractEnd());
......@@ -2132,25 +2149,40 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_FUND_NOT_EMPTY)));
return true;
}
// 项目编码校验
//社保状态:派增(0待审核、1待办理、2办理中 3办理成功、4部分办理失败 5 办理失败)、派减(6待审核 7待办理 8办理成功 9 办理失败)
if (Common.isNotNull(excel.getSocialReduceDate())
&& !socialFund.getSocialStatus().equals(CommonConstants.THREE_STRING)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_REDUCE_SOCIAL_STATUS_ERROR)));
return true;
if (Common.isNotNull(excel.getSocialReduceDate())){
if (!socialFund.getSocialStatus().equals(CommonConstants.THREE_STRING)
&& !socialFund.getSocialStatus().equals(CommonConstants.NINE_STRING)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_REDUCE_SOCIAL_STATUS_ERROR)));
return true;
}
if (!excel.getDepartNo().equals(socialFund.getSettleDomainCode())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_REDUCE_SOCIAL_DEPARTNO_ERROR)));
return true;
}
}
//公积金状态:派增(0待审核、1待办理、3办理成功、4办理失败)、派减(5待审核 6待办理 7 办理成功 8 办理失败)
if (Common.isNotNull(excel.getFundReduceDate())
&& !socialFund.getFundStatus().equals(CommonConstants.THREE_STRING)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_REDUCE_FUND_STATUS_ERROR)));
return true;
if (Common.isNotNull(excel.getFundReduceDate())){
if (!socialFund.getFundStatus().equals(CommonConstants.THREE_STRING)
&& !socialFund.getFundStatus().equals(CommonConstants.EIGHT_STRING)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_REDUCE_FUND_STATUS_ERROR)));
return true;
}
if (!excel.getDepartNo().equals(socialFund.getSettleDomainCodeFund())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_REDUCE_FUND_DEPARTNO_ERROR)));
return true;
}
}
return false;
}
private void initIdcard(List<TDispatchReduceVo> excelVOList, List<String> idcards) {
private void initIdcard(List<TDispatchReduceVo> excelVOList, List<String> idcards, List<String> codes) {
if (Common.isNotNull(excelVOList)) {
for (TDispatchReduceVo vo : excelVOList) {
idcards.add(vo.getEmpIdcard());
codes.add(vo.getDepartNo());
}
}
}
......@@ -2367,6 +2399,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (CommonConstants.dingleDigitStrArray[1].equals(dis.getType())){
// 审核通过
if (CommonConstants.ZERO_INT == flag.intValue()) {
providentFund.setReduceCan(CommonConstants.ONE_STRING);
sf.setFundReduceStatus(CommonConstants.ONE_STRING);
sf.setFundStatus(CommonConstants.EIGHT_STRING);
// 审核不通过
......@@ -2769,14 +2802,25 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
//派减判断
} else if (CommonConstants.ONE_STRING.equals(dis.getType())) {
if ( !((Common.isNotNull(socialInfo)
&& (CommonConstants.ZERO_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.FOUR_STRING.equals(socialInfo.getHandleStatus())))
|| (Common.isEmpty(providentFund)
&& (Common.isEmpty(providentFund)
|| CommonConstants.ZERO_STRING.equals(providentFund.getHandleStatus()))))
) {
//办理成功或失败 更新为办理完结 2020-05-26
if (Common.isNotNull(dis.getSocialHandleStatus())
&& Common.isNotNull(dis.getFundHandleStatus())
&& (CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus()))
&& ((CommonConstants.ONE_STRING.equals(dis.getFundHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getFundHandleStatus())))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
if (Common.isEmpty(dis.getSocialHandleStatus())
&& ((CommonConstants.ONE_STRING.equals(dis.getFundHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getFundHandleStatus())))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
if ((Common.isEmpty(dis.getFundHandleStatus())
&& CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus()))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
}
......
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