Commit 7c9cee9a authored by hongguangwu's avatar hongguangwu

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

parents a314bfe9 992eaa83
...@@ -341,7 +341,7 @@ public class TEmployeeContractPreController { ...@@ -341,7 +341,7 @@ public class TEmployeeContractPreController {
* @return R * @return R
*/ */
@Operation(summary = "通过id查询", description = "通过id查询") @Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/getInfoByRegistId " ) @GetMapping("/getInfoByRegistId" )
public R<TEmployeeContractPre> getInfoByRegistId(@RequestParam("registId" ) String registId) { public R<TEmployeeContractPre> getInfoByRegistId(@RequestParam("registId" ) String registId) {
return tEmployeeContractPreService.getInfoByRegistId(registId); return tEmployeeContractPreService.getInfoByRegistId(registId);
} }
......
...@@ -237,7 +237,7 @@ public class TSettleDomainController { ...@@ -237,7 +237,7 @@ public class TSettleDomainController {
TSettleDomainListVo listVo = new TSettleDomainListVo(); TSettleDomainListVo listVo = new TSettleDomainListVo();
listVo.setListSelectVO(list); listVo.setListSelectVO(list);
if (Common.isNotNull(list)){ if (Common.isNotNull(list)){
listVo.setMapSelectVo(list.stream().collect(Collectors.toMap(TSettleDomain::getDepartNo, k->k))); listVo.setMapSelectVo(list.stream().collect(Collectors.toMap(TSettleDomain::getDepartNo, k->k, (existing, replacement) -> existing)));
} }
return listVo; return listVo;
} }
...@@ -255,7 +255,7 @@ public class TSettleDomainController { ...@@ -255,7 +255,7 @@ public class TSettleDomainController {
TSettleDomainListVo listVo = new TSettleDomainListVo(); TSettleDomainListVo listVo = new TSettleDomainListVo();
listVo.setListSelectVO(list); listVo.setListSelectVO(list);
if (Common.isNotNull(list)){ if (Common.isNotNull(list)){
listVo.setMapSelectVo(list.stream().collect(Collectors.toMap(TSettleDomain::getId, k->k))); listVo.setMapSelectVo(list.stream().collect(Collectors.toMap(TSettleDomain::getId, k->k, (existing, replacement) -> existing)));
} }
return listVo; return listVo;
} }
......
...@@ -272,23 +272,59 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -272,23 +272,59 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
receiveVo.setEmpIdcard(updatePre.getEmpIdcard()); receiveVo.setEmpIdcard(updatePre.getEmpIdcard());
receiveVo.setReason(employeeRegistrationPre.getReason()); receiveVo.setReason(employeeRegistrationPre.getReason());
receiveVo.setEmployeeId(user.getId()); receiveVo.setEmployeeId(user.getId());
StringBuilder sb = new StringBuilder();
try { try {
//调用csp服务更新状态和新增操作记录 //调用csp服务更新状态和新增操作记录
cspDaprUtils.updateRegistByPreInfo(receiveVo); cspDaprUtils.updateRegistByPreInfo(receiveVo);
//处理合同待办信息 //处理社保待办信息
contractPreMapper.delete(Wrappers.<TEmployeeContractPre>query().lambda() R<Boolean> booleanR = socialDaprUtils.deleteUnProcessSocialPreInfo(updatePre.getId());
.eq(TEmployeeContractPre::getRegisterId, updatePre.getId())); if (null != booleanR && booleanR.getData().booleanValue()){
sb.append("社保");
}
//处理公积金待办信息
booleanR = socialDaprUtils.deleteUnProcessFundPreInfo(updatePre.getId());
if (null != booleanR && booleanR.getData().booleanValue()){
if (sb.length() == 0){
sb.append("公积金");
}else {
sb.append("/公积金");
}
}
//处理商险待办信息 //处理商险待办信息
BaseSearchVO insuranceSearchVo = new BaseSearchVO(); BaseSearchVO insuranceSearchVo = new BaseSearchVO();
insuranceSearchVo.setRegisterId(updatePre.getId()); insuranceSearchVo.setRegisterId(updatePre.getId());
insuranceDaprUtil.getInsurancesStatus(insuranceSearchVo); booleanR = insuranceDaprUtil.delInsurancePreByRegisterId(insuranceSearchVo);
//处理社保待办信息 if (null != booleanR && booleanR.getData().booleanValue()){
socialDaprUtils.deleteUnProcessSocialPreInfo(updatePre.getId()); if (sb.length() == 0){
//处理公积金待办信息 sb.append("商险");
socialDaprUtils.deleteUnProcessFundPreInfo(updatePre.getId()); }else {
sb.append("/商险");
}
}
//处理合同待办信息
int res = contractPreMapper.delete(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRegisterId, updatePre.getId()));
if (res > 0){
if (sb.length() == 0){
sb.append("合同");
}else {
sb.append("/合同");
}
}
} catch (Exception e) { } catch (Exception e) {
log.error("调用csp服务更新数据异常", e); log.error("调用csp服务更新数据异常", e);
} }
//增加操作日期
TEmployeePreLog log = new TEmployeePreLog();
log.setCreateTime(LocalDateTime.now());
log.setCreateName(user.getNickname());
log.setUpdateTime(LocalDateTime.now());
log.setPreId(employeeRegistrationPre.getId());
log.setDiffTitle("联动删除的待办:"+sb);
log.setMenuInfo("入职建档");
tEmployeePreLogService.save(log);
return R.ok(); return R.ok();
} }
......
...@@ -1250,6 +1250,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -1250,6 +1250,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
return R.failed(CommonConstants.PARAM_INFO_ERROR); return R.failed(CommonConstants.PARAM_INFO_ERROR);
} }
return R.ok(baseMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda() return R.ok(baseMapper.selectOne(Wrappers.<TEmployeeContractPre>query().lambda()
.notIn(TEmployeeContractPre::getProcessStatus, Arrays.asList("0","1","3","5","7","10","11"))
.eq(TEmployeeContractPre::getRegisterId, registId) .eq(TEmployeeContractPre::getRegisterId, registId)
.last(CommonConstants.LAST_ONE_SQL))); .last(CommonConstants.LAST_ONE_SQL)));
} }
......
...@@ -422,7 +422,7 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T ...@@ -422,7 +422,7 @@ public class TSettleDomainServiceImpl extends ServiceImpl<TSettleDomainMapper, T
List<TSettleDomain> voList = baseMapper.getSettleInfoByCodes(codes); List<TSettleDomain> voList = baseMapper.getSettleInfoByCodes(codes);
TSettleDomainListVo setMap = new TSettleDomainListVo(); TSettleDomainListVo setMap = new TSettleDomainListVo();
if (Common.isNotNull(voList)){ if (Common.isNotNull(voList)){
setMap.setMapVO(voList.stream().collect(Collectors.toMap(TSettleDomain::getDepartNo, k->k))); setMap.setMapVO(voList.stream().collect(Collectors.toMap(TSettleDomain::getDepartNo, k->k, (existing, replacement) -> existing)));
} }
return setMap; return setMap;
} }
......
...@@ -970,7 +970,7 @@ ...@@ -970,7 +970,7 @@
b.CONTRACT_START,b.CONTRACT_END,b.CONTRACT_TERM,b.CONTRACT_SUB_NAME,b.CONTRACT_ID, b.CONTRACT_START,b.CONTRACT_END,b.CONTRACT_TERM,b.CONTRACT_SUB_NAME,b.CONTRACT_ID,
c.UNIT_NAME, c.UNIT_NAME,
c.UNIT_NO,c.DEPT_ID,c.DEPT_NAME,c.DEPT_NO,c.POST,c.EMP_NO,c.PROJECT_STATUS,c.EMP_NATRUE,c.TRY_PERIOD c.UNIT_NO,c.DEPT_ID,c.DEPT_NAME,c.DEPT_NO,c.POST,c.EMP_NO,c.PROJECT_STATUS,c.EMP_NATRUE,ifnull(c.TRY_PERIOD,b.TRY_PERIOD) TRY_PERIOD
,a.SCHOOL ,a.SCHOOL
from ( from (
select e.ID,e.EMP_CODE,e.EMP_NAME,e.EMP_IDCARD,e.EMP_NATIONAL,e.EMP_PHONE,e.ID_PROVINCE,e.ID_CITY, select e.ID,e.EMP_CODE,e.EMP_NAME,e.EMP_IDCARD,e.EMP_NATIONAL,e.EMP_PHONE,e.ID_PROVINCE,e.ID_CITY,
...@@ -1012,7 +1012,7 @@ ...@@ -1012,7 +1012,7 @@
x.CONTRACT_TERM, x.CONTRACT_TERM,
x.CONTRACT_SUB_NAME, x.CONTRACT_SUB_NAME,
x.ID as "CONTRACT_ID", x.ID as "CONTRACT_ID",
x.EMP_IDCARD x.EMP_IDCARD,x.TRY_PERIOD
FROM FROM
t_employee_contract_info x t_employee_contract_info x
WHERE WHERE
......
...@@ -644,7 +644,7 @@ public interface CommonConstants { ...@@ -644,7 +644,7 @@ public interface CommonConstants {
List<String> processStatus = Stream.of("0","1").collect(Collectors.toList()); List<String> processStatus = Stream.of("0","1").collect(Collectors.toList());
List<String> insuranceAutoProcessStatus = Stream.of("0","1","2","5","7").collect(Collectors.toList()); List<String> insuranceAutoProcessStatus = Stream.of("0","1","2","5").collect(Collectors.toList());
List<String> processPreStatus = Stream.of("1").collect(Collectors.toList()); List<String> processPreStatus = Stream.of("1").collect(Collectors.toList());
......
...@@ -348,8 +348,8 @@ public class SocialDaprUtils { ...@@ -348,8 +348,8 @@ public class SocialDaprUtils {
* @Param * @Param
* @return * @return
**/ **/
public void deleteUnProcessSocialPreInfo(String id){ public R<Boolean> deleteUnProcessSocialPreInfo(String id){
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl() return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl()
, daprProperties.getAppId(),"/tdispatchinfopre/deleteUnProcessSocialPreInfo" , id , daprProperties.getAppId(),"/tdispatchinfopre/deleteUnProcessSocialPreInfo" , id
, Object.class, SecurityConstants.FROM_IN); , Object.class, SecurityConstants.FROM_IN);
} }
......
...@@ -2398,6 +2398,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -2398,6 +2398,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (Common.isEmpty(registrationNow)) { if (Common.isEmpty(registrationNow)) {
return R.failed(RegistConstants.NO_DATA_TO_HANDLE); return R.failed(RegistConstants.NO_DATA_TO_HANDLE);
} }
if (!CommonConstants.ONE_STRING.equals(registrationNow.getProcessStatus())){
return R.failed("状态非未处理状态,请刷新确认后操作!");
}
registrationNow.setProcessStatus(CommonConstants.THREE_STRING); registrationNow.setProcessStatus(CommonConstants.THREE_STRING);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.BACK_RECEIVE, LocalDateTime.now(), logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.BACK_RECEIVE, LocalDateTime.now(),
user.getNickname(), registration.getLeaveReason()); user.getNickname(), registration.getLeaveReason());
......
...@@ -439,6 +439,12 @@ public class TInsuranceDetail extends BaseEntity { ...@@ -439,6 +439,12 @@ public class TInsuranceDetail extends BaseEntity {
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
private LocalDate preHandleTime; private LocalDate preHandleTime;
/**
* 差额settleId
*/
@TableField(exist = false)
@Schema(description = "差额settleId")
private String balanceId;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -196,4 +196,10 @@ public class EkpInteractiveParam implements Serializable { ...@@ -196,4 +196,10 @@ public class EkpInteractiveParam implements Serializable {
*/ */
@Schema(description = "是否见费出单") @Schema(description = "是否见费出单")
private String isJfcd; private String isJfcd;
/**
* 差额settleId
*/
@Schema(description = "差额settleId")
private String balanceId;
} }
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle; import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
...@@ -192,4 +193,11 @@ public class InsuranceExportListOneVO implements Serializable { ...@@ -192,4 +193,11 @@ public class InsuranceExportListOneVO implements Serializable {
*/ */
@Schema(description = "客户名称") @Schema(description = "客户名称")
private String unitName; private String unitName;
/**
* 默认结算信息id
*/
@ExcelIgnore
@Schema(description = "默认结算信息id")
private String defaultSettleId;
} }
package com.yifu.cloud.plus.v1.yifu.insurances.vo; package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.HeadFontStyle; import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
...@@ -204,4 +207,11 @@ public class InsuranceExportListVO implements Serializable { ...@@ -204,4 +207,11 @@ public class InsuranceExportListVO implements Serializable {
@ExcelProperty(value = "派单备注") @ExcelProperty(value = "派单备注")
private String remarkDispatch; private String remarkDispatch;
/**
* 默认结算信息id
*/
@ExcelIgnore
@Schema(description = "默认结算信息id")
private String defaultSettleId;
} }
...@@ -337,7 +337,7 @@ public class TEmployeeInsurancePreController { ...@@ -337,7 +337,7 @@ public class TEmployeeInsurancePreController {
* @return R * @return R
*/ */
@Operation(summary = "通过id查询", description = "通过id查询") @Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/getInfoByRegistId " ) @GetMapping("/getInfoByRegistId" )
public R<TEmployeeInsurancePre> getInfoByRegistId(@RequestParam("registId" ) String registId) { public R<TEmployeeInsurancePre> getInfoByRegistId(@RequestParam("registId" ) String registId) {
return tEmployeeInsurancePreService.getInfoByRegistId(registId); return tEmployeeInsurancePreService.getInfoByRegistId(registId);
} }
......
...@@ -1026,7 +1026,7 @@ public class TInsuranceDetailController { ...@@ -1026,7 +1026,7 @@ public class TInsuranceDetailController {
**/ **/
@Operation(summary = "手动拉取缴费状态", description = "手动拉取缴费状态") @Operation(summary = "手动拉取缴费状态", description = "手动拉取缴费状态")
@PostMapping("/pullPaymentStatus") @PostMapping("/pullPaymentStatus")
public R pullPaymentStatus(@RequestParam String idStr) { public R pullPaymentStatus() {
return tInsuranceDetailService.pullPaymentStatus(idStr); return tInsuranceDetailService.pullPaymentStatus(null);
} }
} }
...@@ -23,6 +23,18 @@ public interface TBusinessOperateService extends IService<TBusinessOperate> { ...@@ -23,6 +23,18 @@ public interface TBusinessOperateService extends IService<TBusinessOperate> {
*/ */
<T> TBusinessOperate saveModificationRecord(String businessId, T oldInfo, T newInfo, String remark); <T> TBusinessOperate saveModificationRecord(String businessId, T oldInfo, T newInfo, String remark);
/**
* 保存修改记录
*
* @author licancan
* @param businessId 业务表主键
* @param oldInfo 老的实体类
* @param newInfo 新的实体类
* @param remark 备注
* @return {@link TBusinessOperate}
*/
<T> TBusinessOperate saveModificationRecord(String businessId, T oldInfo, T newInfo, String remark,String userName);
/** /**
* 根据业务主键获取操作记录 * 根据业务主键获取操作记录
* *
......
...@@ -67,6 +67,31 @@ public class TBusinessOperateServiceImpl extends ServiceImpl<TBusinessOperateMap ...@@ -67,6 +67,31 @@ public class TBusinessOperateServiceImpl extends ServiceImpl<TBusinessOperateMap
return null; return null;
} }
@Override
public <T> TBusinessOperate saveModificationRecord(String businessId, T oldInfo, T newInfo, String remark,String userName) {
try{
//比较记录不影响业务逻辑,用try套住
//比较差异
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
//如果有差异保存差异
if(!Common.isEmpty(differenceKey)){
TBusinessOperate operate = new TBusinessOperate();
operate.setBusinessId(businessId);
operate.setCreateTime(LocalDateTime.now());
operate.setOldInfo(JSON.toJSONString(oldInfo,features));
operate.setNewInfo(JSON.toJSONString(newInfo,features));
operate.setDifferenceInfo(differenceKey);
operate.setRemark(remark);
operate.setCreateName(userName);
baseMapper.insert(operate);
return operate;
}
}catch (Exception e){
log.error(JSON.toJSON(oldInfo)+"插入修改记录报错>>>",e);
}
return null;
}
/** /**
* 根据业务主键获取操作记录 * 根据业务主键获取操作记录
* *
......
...@@ -12,6 +12,7 @@ import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo; ...@@ -12,6 +12,7 @@ import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser; import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysUser;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo; import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUserListVo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre; import com.yifu.cloud.plus.v1.yifu.archives.entity.EmployeeRegistrationPre;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPre;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainRegistListVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TSettleDomainRegistListVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
...@@ -1007,6 +1008,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -1007,6 +1008,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
return R.failed(CommonConstants.PARAM_INFO_ERROR); return R.failed(CommonConstants.PARAM_INFO_ERROR);
} }
return R.ok(baseMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda() return R.ok(baseMapper.selectOne(Wrappers.<TEmployeeInsurancePre>query().lambda()
.notIn(TEmployeeInsurancePre::getProcessStatus, Arrays.asList("0","1","2","5"))
.eq(TEmployeeInsurancePre::getRegisterId, registId).last(CommonConstants.LAST_ONE_SQL))); .eq(TEmployeeInsurancePre::getRegisterId, registId).last(CommonConstants.LAST_ONE_SQL)));
} }
} }
...@@ -1185,9 +1185,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1185,9 +1185,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//计费方式(0:按天,1:按月) //计费方式(0:按天,1:按月)
if (null != insuranceDetailVO.getBillingType()){ if (null != insuranceDetailVO.getBillingType()){
if (CommonConstants.ZERO_INT == insuranceDetailVO.getBillingType().intValue()){ if (CommonConstants.ZERO_INT == insuranceDetailVO.getBillingType().intValue()){
insuranceDetailVO.setPurchaseCycle(insuranceDetailVO.getPurchaseCycle() + "天"); insuranceDetailVO.setBuyCycle(insuranceDetailVO.getPurchaseCycle());
}else if (CommonConstants.ONE_INT == insuranceDetailVO.getBillingType().intValue()){ }else if (CommonConstants.ONE_INT == insuranceDetailVO.getBillingType().intValue()){
insuranceDetailVO.setPurchaseCycle(insuranceDetailVO.getPurchaseCycle() + "个月"); insuranceDetailVO.setBuyCycle(insuranceDetailVO.getPurchaseCycle());
} }
} }
...@@ -1378,9 +1378,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1378,9 +1378,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//update状态由「待投保」置为「投保中」 //update状态由「待投保」置为「投保中」
detail.setBuyHandleStatus(CommonConstants.TWO_INT); detail.setBuyHandleStatus(CommonConstants.TWO_INT);
if (record.getBuyType() == CommonConstants.ONE_INT){ if (record.getBuyType() == CommonConstants.ONE_INT){
// if 投保类型 == 新增,then 更新保单生效日期为:T+1,无需考虑节假日 // “投保类型”为“新增”的 若保单开始日期等于导出办理日期+1日,则为导出办理日期+1日; 若小于导入办理日期+1日,则也按照导出办理日期+1日算 若大于导出办理日期+1日,则等于保单开始日期;
if (null != record.getPolicyStart() && record.getPolicyStart().isAfter(LocalDate.now().plusDays(CommonConstants.ONE_INT))){
detail.setPolicyEffect(record.getPolicyStart());
}else {
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
}
}else {
//批增和替换的生效日期就等于导出办理日期+1日
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT)); detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
} }
detail.setDefaultSettleId(record.getDefaultSettleId());
detail.setHandledBy(user.getId()); detail.setHandledBy(user.getId());
detail.setHandledTime(LocalDateTime.now()); detail.setHandledTime(LocalDateTime.now());
detail.setUpdateBy(user.getId()); detail.setUpdateBy(user.getId());
...@@ -1697,6 +1705,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1697,6 +1705,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listVO.setErrorMessage(InsurancesConstants.REDUCE_ROLLBACK_REDUCE_IS_NOT_ALLOW); listVO.setErrorMessage(InsurancesConstants.REDUCE_ROLLBACK_REDUCE_IS_NOT_ALLOW);
errorList.add(listVO); errorList.add(listVO);
}else{ }else{
//判断是否已支出或支出中
EkpSettleStatusVo vo = ekpSettleService.getSettleStatusFromEkpInsuranceDetail(detail.getId());
if (vo != null && (vo.getPayStatus().equals("已结算")
|| vo.getPayStatus().equals("结算中"))) {
InsuranceListVO listVO = new InsuranceListVO();
BeanCopyUtils.copyProperties(detail,listVO);
listVO.setProjectName(detail.getDeptName());
listVO.setErrorMessage(InsurancesConstants.REDUCE_ROLLBACK_PAY_IS_NOT_ALLOW);
errorList.add(listVO);
continue;
}
//判断是否是替换类型的退回,如果是,需要将被替换者激活,替换者有效状态为空 //判断是否是替换类型的退回,如果是,需要将被替换者激活,替换者有效状态为空
if(detail.getBuyType() == CommonConstants.FOUR_INT){ if(detail.getBuyType() == CommonConstants.FOUR_INT){
//替换者有效状态为空 //替换者有效状态为空
...@@ -1736,15 +1755,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1736,15 +1755,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
sourceIdCardList.add(detail.getEmpIdcardNo()); sourceIdCardList.add(detail.getEmpIdcardNo());
replaceIdList.add(detail.getId()); replaceIdList.add(detail.getId());
} }
//判断是否已支出或支出中
EkpSettleStatusVo vo = ekpSettleService.getSettleStatusFromEkpInsuranceDetail(detail.getId());
if (vo != null && (vo.getPayStatus().equals("已结算")
|| vo.getPayStatus().equals("结算中"))) {
InsuranceListVO listVO = new InsuranceListVO();
BeanCopyUtils.copyProperties(detail,listVO);
listVO.setProjectName(detail.getDeptName());
listVO.setErrorMessage(InsurancesConstants.REDUCE_ROLLBACK_PAY_IS_NOT_ALLOW);
}
} }
//批量更新商险和替换表 //批量更新商险和替换表
if (!updList.isEmpty()) { if (!updList.isEmpty()) {
...@@ -1811,12 +1822,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1811,12 +1822,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//如果是见费出单,投保中,推送作废 2026-01-22 v1.7.19 //如果是见费出单,投保中,推送作废 2026-01-22 v1.7.19
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){ if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){
//红冲预估推送 //红冲预估推送
detail.setDefaultSettleId(burden.getId());
pushResult = pushEstimate(detail, CommonConstants.THREE_INT); pushResult = pushEstimate(detail, CommonConstants.THREE_INT);
//已投保 需要处理实缴和差额数据 (已支出或支出中禁止退保) //已投保 需要处理实缴和差额数据 (已支出或支出中禁止退保)
if (CommonConstants.THREE_INT == detail.getBuyHandleStatus()){ //直接删除实缴及实缴与预估的差额
//直接删除实缴及实缴与预估的差额 ekpSettleService.deleteEkpInsuranceDetailAsso(detail.getId());
ekpSettleService.deleteEkpInsuranceDetailAsso(detail.getId());
}
} else { } else {
//预估已推送,实缴未推送 //预估已推送,实缴未推送
if(isEstimatePush == CommonConstants.ONE_INT && isActualPush == CommonConstants.ZERO_INT){ if(isEstimatePush == CommonConstants.ONE_INT && isActualPush == CommonConstants.ZERO_INT){
...@@ -1880,14 +1890,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -1880,14 +1890,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
operateList.add(e); operateList.add(e);
} }
}); });
//如果是见费出单,投保中,推送作废 2026-01-22 v1.7.19 updateEmployeeInsurancePreById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.FIVE_STRING);
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){ updateEmployeeInsurancePreRenewById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.FIVE_STRING, true);
updateEmployeeInsurancePreById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.SEVEN_STRING);
updateEmployeeInsurancePreRenewById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.SEVEN_STRING, true);
}else {
updateEmployeeInsurancePreById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.FIVE_STRING);
updateEmployeeInsurancePreRenewById(detail,Stream.of("3","4","6").collect(Collectors.toList()),CommonConstants.FIVE_STRING, true);
}
} }
//更新状态 //更新状态
...@@ -2043,59 +2047,89 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2043,59 +2047,89 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
} }
//根据结算类型判断是否需要计算预估保费 //根据结算类型判断是否需要计算预估保费
//预估 (是否见费出单为的不用生成预估,因为之前已经生成了) //预估 (是否见费出单为的不用生成预估,因为之前已经生成了)
if (detail.getSettleType() == CommonConstants.ZERO_INT && CommonConstants.ONE_STRING.equals(detail.getIsJfcd())){ if (detail.getSettleType() == CommonConstants.ZERO_INT ){
if (CommonConstants.ONE_INT == detail.getBillingType()){ if (CommonConstants.ONE_STRING.equals(detail.getIsJfcd())){
// 按月查费率 if (CommonConstants.ONE_INT == detail.getBillingType()){
// 预估保费 = 费率 * 购买标准 + 5元 // 按月查费率
BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard()) // 预估保费 = 费率 * 购买标准 + 5元
.multiply(detail.getRate()) BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard())
.add(BigDecimal.valueOf(5.00)) .multiply(detail.getRate())
.setScale(2,BigDecimal.ROUND_HALF_UP); .add(BigDecimal.valueOf(5.00))
detail.setEstimatePremium(estimatePremium); .setScale(2,BigDecimal.ROUND_HALF_UP);
if (detail.getBuyType() == CommonConstants.THREE_INT){ detail.setEstimatePremium(estimatePremium);
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT)); if (detail.getBuyType() == CommonConstants.THREE_INT){
} detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
//记录状态均置为「已投保」 }
detail.setBuyHandleStatus(CommonConstants.THREE_INT); //记录状态均置为「已投保」
detail.setSignFlag(CommonConstants.ONE_INT); detail.setBuyHandleStatus(CommonConstants.THREE_INT);
//记录的有效状态,置为「有效」 detail.setSignFlag(CommonConstants.ONE_INT);
detail.setIsEffect(CommonConstants.ZERO_INT); //记录的有效状态,置为「有效」
detail.setIsOverdue(CommonConstants.ZERO_INT); detail.setIsEffect(CommonConstants.ZERO_INT);
detail.setIsUse(CommonConstants.ZERO_INT); detail.setIsOverdue(CommonConstants.ZERO_INT);
detail.setUpdateTime(LocalDateTime.now()); detail.setIsUse(CommonConstants.ZERO_INT);
detail.setUpdateBy(user.getId()); detail.setUpdateTime(LocalDateTime.now());
//保费存储 detail.setUpdateBy(user.getId());
TInsuranceSettle settle = new TInsuranceSettle(); //保费存储
settle.setInsDetailId(detail.getId()); TInsuranceSettle settle = new TInsuranceSettle();
settle.setSettleType(detail.getSettleType()); settle.setInsDetailId(detail.getId());
settle.setSettleHandleStatus(CommonConstants.ONE_STRING); settle.setSettleType(detail.getSettleType());
settle.setCreateTime(LocalDateTime.now()); settle.setSettleHandleStatus(CommonConstants.ONE_STRING);
settle.setEstimatePushTime(LocalDateTime.now()); settle.setCreateTime(LocalDateTime.now());
settle.setEstimatePremium(estimatePremium); settle.setEstimatePushTime(LocalDateTime.now());
//调完ekp接口才会是1 settle.setEstimatePremium(estimatePremium);
settle.setIsEstimatePush(CommonConstants.ZERO_INT); //调完ekp接口才会是1
settle.setId(RandomStringUtils.randomNumeric(19)); settle.setIsEstimatePush(CommonConstants.ZERO_INT);
settleList.add(settle); settle.setId(RandomStringUtils.randomNumeric(19));
detail.setDefaultSettleId(settle.getId()); settleList.add(settle);
successTwo.add(detail); detail.setDefaultSettleId(settle.getId());
updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING); successTwo.add(detail);
updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING, false); updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING);
//生成收入数据 updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING, false);
createInsuranceInfo(detail,settleDomain); //生成收入数据
}else { createInsuranceInfo(detail,settleDomain);
//按天 }else {
//计算起止时间的天数 //按天
long day = LocalDateUtil.betweenDay(detail.getPolicyStart().toString(), detail.getPolicyEnd().toString()); //计算起止时间的天数
if (detail.getBuyType() == CommonConstants.THREE_INT){ long day = LocalDateUtil.betweenDay(detail.getPolicyStart().toString(), detail.getPolicyEnd().toString());
detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT)); if (detail.getBuyType() == CommonConstants.THREE_INT){
day = LocalDateUtil.betweenDay(detail.getPolicyEffect().toString(), detail.getPolicyEnd().toString()); detail.setPolicyEffect(LocalDate.now().plusDays(CommonConstants.ONE_INT));
day = LocalDateUtil.betweenDay(detail.getPolicyEffect().toString(), detail.getPolicyEnd().toString());
}
//预估保费 = (购买标准 / 365) * 天数 + 5元
BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard())
.multiply(new BigDecimal(day))
.divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP)
.add(BigDecimal.valueOf(5.00));
detail.setEstimatePremium(estimatePremium);
//记录状态均置为「已投保」
detail.setBuyHandleStatus(CommonConstants.THREE_INT);
detail.setSignFlag(CommonConstants.ONE_INT);
//记录的有效状态,置为「有效」
detail.setIsEffect(CommonConstants.ZERO_INT);
detail.setIsOverdue(CommonConstants.ZERO_INT);
detail.setIsUse(CommonConstants.ZERO_INT);
detail.setUpdateTime(LocalDateTime.now());
detail.setUpdateBy(user.getId());
//保费存储
TInsuranceSettle settle = new TInsuranceSettle();
settle.setInsDetailId(detail.getId());
settle.setSettleType(detail.getSettleType());
settle.setSettleHandleStatus(CommonConstants.ONE_STRING);
settle.setEstimatePremium(estimatePremium);
//调完ekp接口才会是1
settle.setIsEstimatePush(CommonConstants.ONE_INT);
settle.setEstimatePushTime(LocalDateTime.now());
settle.setCreateTime(LocalDateTime.now());
settle.setId(RandomStringUtils.randomNumeric(19));
settleList.add(settle);
detail.setDefaultSettleId(settle.getId());
successTwo.add(detail);
updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING);
updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING, false);
//生成收入数据
createInsuranceInfo(detail,settleDomain);
} }
//预估保费 = (购买标准 / 365) * 天数 + 5元 }else if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd())){
BigDecimal estimatePremium = new BigDecimal(detail.getBuyStandard())
.multiply(new BigDecimal(day))
.divide(new BigDecimal("365"),CommonConstants.TWO_INT,BigDecimal.ROUND_HALF_UP)
.add(BigDecimal.valueOf(5.00));
detail.setEstimatePremium(estimatePremium);
//记录状态均置为「已投保」 //记录状态均置为「已投保」
detail.setBuyHandleStatus(CommonConstants.THREE_INT); detail.setBuyHandleStatus(CommonConstants.THREE_INT);
detail.setSignFlag(CommonConstants.ONE_INT); detail.setSignFlag(CommonConstants.ONE_INT);
...@@ -2105,24 +2139,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2105,24 +2139,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setIsUse(CommonConstants.ZERO_INT); detail.setIsUse(CommonConstants.ZERO_INT);
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
detail.setUpdateBy(user.getId()); detail.setUpdateBy(user.getId());
//保费存储
TInsuranceSettle settle = new TInsuranceSettle();
settle.setInsDetailId(detail.getId());
settle.setSettleType(detail.getSettleType());
settle.setSettleHandleStatus(CommonConstants.ONE_STRING);
settle.setEstimatePremium(estimatePremium);
//调完ekp接口才会是1
settle.setIsEstimatePush(CommonConstants.ONE_INT);
settle.setEstimatePushTime(LocalDateTime.now());
settle.setCreateTime(LocalDateTime.now());
settle.setId(RandomStringUtils.randomNumeric(19));
settleList.add(settle);
detail.setDefaultSettleId(settle.getId());
successTwo.add(detail); successTwo.add(detail);
updateEmployeeInsurancePreById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING);
updateEmployeeInsurancePreRenewById(detail, Stream.of("4").collect(Collectors.toList()),CommonConstants.SIX_STRING, false);
//生成收入数据
createInsuranceInfo(detail,settleDomain);
} }
} }
//实缴 //实缴
...@@ -2438,7 +2455,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2438,7 +2455,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if(StringUtils.isNotBlank(detail.getDefaultSettleId()) && detail.getSettleType() == CommonConstants.ZERO_INT){ if(StringUtils.isNotBlank(detail.getDefaultSettleId()) && detail.getSettleType() == CommonConstants.ZERO_INT){
settle = tInsuranceSettleService.getById(detail.getDefaultSettleId()); settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
//如果未推送则推送预估新增 //如果未推送则推送预估新增
if(CommonConstants.ZERO_INT == settle.getIsEstimatePush()){ if(null != settle && CommonConstants.ZERO_INT == settle.getIsEstimatePush()){
doJointInsuranceTask.asynchronousEkpInfo(detail,settle,CommonConstants.ONE_INT); doJointInsuranceTask.asynchronousEkpInfo(detail,settle,CommonConstants.ONE_INT);
} }
} }
...@@ -2543,10 +2560,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2543,10 +2560,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settleNew.setEstimatePremium(detail.getEstimatePremium()); settleNew.setEstimatePremium(detail.getEstimatePremium());
//调完ekp接口才会是1 //调完ekp接口才会是1
settleNew.setCreateTime(LocalDateTime.now()); settleNew.setCreateTime(LocalDateTime.now());
tInsuranceSettleService.save(settleNew); if (bigDecimalAct.compareTo(detail.getEstimatePremium()) != 0){
//调EKP新增实际保费 tInsuranceSettleService.save(settleNew);
detail.setActualPremium(bigDecimalAct); detail.setBalanceId(settleNew.getId());
doJointInsuranceTask.asynchronousEkpInfo(detail,settleNew,CommonConstants.SEVEN_INT); doJointInsuranceTask.asynchronousEkpInfo(detail,settleNew,CommonConstants.SEVEN_INT);
}
} }
} }
...@@ -9709,6 +9727,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -9709,6 +9727,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
updateWrapper.eq(TEmployeeInsurancePre::getInsurancesId,detail.getId()); updateWrapper.eq(TEmployeeInsurancePre::getInsurancesId,detail.getId());
updateWrapper.set(TEmployeeInsurancePre::getProcessStatus,CommonConstants.ONE_STRING); updateWrapper.set(TEmployeeInsurancePre::getProcessStatus,CommonConstants.ONE_STRING);
employeeInsurancePreMapper.update(null,updateWrapper); employeeInsurancePreMapper.update(null,updateWrapper);
LambdaUpdateWrapper<TInsurancePreRenewDetail> updateNewWrapper = new LambdaUpdateWrapper<>();
updateNewWrapper.eq(TInsurancePreRenewDetail::getInsurancesIdNew,detail.getId());
updateNewWrapper.set(TInsurancePreRenewDetail::getProcessStatus,CommonConstants.ONE_STRING);
tInsurancePreRenewDetailMapper.update(null,updateNewWrapper);
} catch (Exception e) { } catch (Exception e) {
return R.failed("撤回异常:"+e.getMessage()); return R.failed("撤回异常:"+e.getMessage());
} }
...@@ -9764,7 +9787,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -9764,7 +9787,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
detail.setPaymentStatus(CommonConstants.ONE_STRING); detail.setPaymentStatus(CommonConstants.ONE_STRING);
detail.setUpdateBy("05501879fed711eca3540242ac110010"); detail.setUpdateBy("05501879fed711eca3540242ac110010");
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单已收或垫付同步更新投保状态为待投保"); tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单已收或垫付同步更新投保状态为待投保","EKP系统");
updateList.add(detail); updateList.add(detail);
ids.add(detailId); ids.add(detailId);
} }
...@@ -9824,7 +9847,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -9824,7 +9847,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setUpdateBy("05501879fed711eca3540242ac110010"); detail.setUpdateBy("05501879fed711eca3540242ac110010");
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(detail); baseMapper.updateById(detail);
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单退单或撤销匹配同步更新投保状态为待缴费"); tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单退单或撤销匹配同步更新投保状态为待缴费","EKP系统");
insuranceIds.add(id); insuranceIds.add(id);
} }
} }
......
...@@ -248,8 +248,8 @@ public class DoJointInsuranceTask { ...@@ -248,8 +248,8 @@ public class DoJointInsuranceTask {
if (Common.isNotNull(viewVo.getId())) { if (Common.isNotNull(viewVo.getId())) {
insuranceId = viewVo.getId().substring(0, 19); insuranceId = viewVo.getId().substring(0, 19);
detail = insuranceDetailMapper.selectById(insuranceId); detail = insuranceDetailMapper.selectById(insuranceId);
log.error("更新状态商险ID:"+detail.getId() +"|"+insuranceId);
if (Common.isNotNull(detail)) { if (Common.isNotNull(detail)) {
log.error("更新状态商险ID:"+detail.getId() +"|"+insuranceId);
TInsuranceDetail detailOld = new TInsuranceDetail(); TInsuranceDetail detailOld = new TInsuranceDetail();
BeanCopyUtils.copyProperties(detail,detailOld); BeanCopyUtils.copyProperties(detail,detailOld);
//判断订单类型是预估还是实缴 //判断订单类型是预估还是实缴
...@@ -268,16 +268,14 @@ public class DoJointInsuranceTask { ...@@ -268,16 +268,14 @@ public class DoJointInsuranceTask {
detail.setIncomeCollectFlag(viewVo.getIncomeCollectFlag()); detail.setIncomeCollectFlag(viewVo.getIncomeCollectFlag());
// 这里就是EKP 同步已收及垫付后同步HRO的特殊处理 // 这里就是EKP 同步已收及垫付后同步HRO的特殊处理
if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd()) && "0".equals(vo.getPaymentStatsus())){ if (CommonConstants.ZERO_STRING.equals(detail.getIsJfcd()) && "0".equals(vo.getPaymentStatsus())){
if (CommonConstants.ZERO_STRING.equals(detail.getPaymentStatus()) if (CommonConstants.SIX_INT == detail.getBuyHandleStatus().intValue()){
&&("0".equals(viewVo.getIncomeCollectFlag())
|| "2".equals(viewVo.getIncomeCollectFlag()))){
detail.setBuyHandleStatus(CommonConstants.ONE_INT); detail.setBuyHandleStatus(CommonConstants.ONE_INT);
detail.setPaymentStatus(CommonConstants.ONE_STRING); detail.setPaymentStatus(CommonConstants.ONE_STRING);
detail.setPaymentTime(DateUtil.formatDatePatten(new Date(),DateUtil.DATETIME_PATTERN_SECOND)); detail.setPaymentTime(DateUtil.formatDatePatten(new Date(),DateUtil.DATETIME_PATTERN_SECOND));
detail.setUpdateBy("05501879fed711eca3540242ac110010"); detail.setUpdateBy("05501879fed711eca3540242ac110010");
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
//添加日期 //添加日期
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单已收或垫付同步更新投保状态为待投保"); tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单已收或垫付同步更新投保状态为待投保","EKP系统");
//更新自动化 //更新自动化
LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeInsurancePre::getInsurancesId,detail.getId()); updateWrapper.eq(TEmployeeInsurancePre::getInsurancesId,detail.getId());
...@@ -289,15 +287,6 @@ public class DoJointInsuranceTask { ...@@ -289,15 +287,6 @@ public class DoJointInsuranceTask {
.set(TInsurancePreRenewDetail::getProcessStatus,CommonConstants.SEVEN_STRING); .set(TInsurancePreRenewDetail::getProcessStatus,CommonConstants.SEVEN_STRING);
tInsurancePreRenewDetailMapper.update(null, updateReNewInfoWrapper); tInsurancePreRenewDetailMapper.update(null, updateReNewInfoWrapper);
} }
if (CommonConstants.ONE_STRING.equals(detail.getPaymentStatus())
&& "1".equals(viewVo.getIncomeCollectFlag())){
detail.setBuyHandleStatus(CommonConstants.SIX_INT);
detail.setPaymentStatus(CommonConstants.ZERO_STRING);
detail.setPaymentTime(CommonConstants.EMPTY_STRING);
detail.setUpdateBy("05501879fed711eca3540242ac110010");
detail.setUpdateTime(LocalDateTime.now());
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单退单或撤销匹配同步更新投保状态为待缴费");
}
} }
} else { } else {
detail.setPaySettleFlag(viewVo.getPaySettleFlag()); detail.setPaySettleFlag(viewVo.getPaySettleFlag());
...@@ -650,7 +639,7 @@ public class DoJointInsuranceTask { ...@@ -650,7 +639,7 @@ public class DoJointInsuranceTask {
ys = 0L; ys = 0L;
} }
}else { }else {
if (!"".equals(param.getIsJfcd())){ if (!"0".equals(param.getIsJfcd())){
//1、针对非提前缴费也非预估模式也未启用BPO结算模式的项目下,商险只存在实缴费用,实缴费用中应收等于应支——此类费用“实缴费用”需已收才能支出 //1、针对非提前缴费也非预估模式也未启用BPO结算模式的项目下,商险只存在实缴费用,实缴费用中应收等于应支——此类费用“实缴费用”需已收才能支出
if (InsurancesConstants.ACTUAL_SETTLE_BILL.equals(param.getSettleType()) if (InsurancesConstants.ACTUAL_SETTLE_BILL.equals(param.getSettleType())
&& "无".equals(pushParam.getFd_3af9d1441ef7b6())){ && "无".equals(pushParam.getFd_3af9d1441ef7b6())){
...@@ -670,7 +659,7 @@ public class DoJointInsuranceTask { ...@@ -670,7 +659,7 @@ public class DoJointInsuranceTask {
ys = BigDecimalUtils.safeSubtract(param.getActualPremium(),param.getEstimatePremium()).doubleValue(); ys = BigDecimalUtils.safeSubtract(param.getActualPremium(),param.getEstimatePremium()).doubleValue();
} }
} }
} else if ("".equals(param.getIsJfcd())){ } else if ("0".equals(param.getIsJfcd())){
//3、针对提前缴费的项目,无论是否为预估模式,商险存在预估费用,预估费用中应收有值为按照规则计算得出的,应支为0;存在实缴费用,实缴费用应收为0,应支等于导入的实缴金额; //3、针对提前缴费的项目,无论是否为预估模式,商险存在预估费用,预估费用中应收有值为按照规则计算得出的,应支为0;存在实缴费用,实缴费用应收为0,应支等于导入的实缴金额;
// 存在差额费用,差额费用应收有值,等于“实缴的应支金额-预估的应收金额——此类实缴支出会判断是否存在提前缴费的标识,若存在,则支出可以选择的到, // 存在差额费用,差额费用应收有值,等于“实缴的应支金额-预估的应收金额——此类实缴支出会判断是否存在提前缴费的标识,若存在,则支出可以选择的到,
// 选择后即可支出(差额明细逻辑:导入后根据预估明细和实缴明细,生成“单据类型”为“差额”的商险明细数据(只有应收金额没有应支,应收金额=实缴的应支-预估的应收,若>0, // 选择后即可支出(差额明细逻辑:导入后根据预估明细和实缴明细,生成“单据类型”为“差额”的商险明细数据(只有应收金额没有应支,应收金额=实缴的应支-预估的应收,若>0,
...@@ -692,6 +681,9 @@ public class DoJointInsuranceTask { ...@@ -692,6 +681,9 @@ public class DoJointInsuranceTask {
pushParam.setFd_3adfe6e3911ffe(0.00); pushParam.setFd_3adfe6e3911ffe(0.00);
//是否全部结算 //是否全部结算
pushParam.setFd_3b13b2ecc164aa("是"); pushParam.setFd_3b13b2ecc164aa("是");
//实际保费设置为0.0
pushParam.setFd_3adfe6610c0d2c(0.00);
} }
} }
...@@ -748,6 +740,7 @@ public class DoJointInsuranceTask { ...@@ -748,6 +740,7 @@ public class DoJointInsuranceTask {
if (Common.isNotNull(list) && !list.isEmpty()) { if (Common.isNotNull(list) && !list.isEmpty()) {
for (EkpInsurancesInfo info: list) { for (EkpInsurancesInfo info: list) {
initValueUpdate(info, deptInfoVo, param); initValueUpdate(info, deptInfoVo, param);
} }
} }
//更新实缴单据应收金额 //更新实缴单据应收金额
...@@ -760,6 +753,10 @@ public class DoJointInsuranceTask { ...@@ -760,6 +753,10 @@ public class DoJointInsuranceTask {
info.setFd_3adfe6e30f2a3c("是".equals(param.getBpoFlag()) ? 0 : BigDecimalUtils.safeSubtract(false,param.getActualPremium(),param.getEstimatePremium()).doubleValue()); info.setFd_3adfe6e30f2a3c("是".equals(param.getBpoFlag()) ? 0 : BigDecimalUtils.safeSubtract(false,param.getActualPremium(),param.getEstimatePremium()).doubleValue());
//应支 //应支
info.setFd_3adfe6e3911ffe(param.getActualPremium().doubleValue()); info.setFd_3adfe6e3911ffe(param.getActualPremium().doubleValue());
if ("0".equals(param.getIsJfcd())){
//见费出单 实缴的应收为0
info.setFd_3adfe6e30f2a3c(0.00);
}
insurancesInfoMapper.updateById(info); insurancesInfoMapper.updateById(info);
} }
} }
...@@ -963,7 +960,11 @@ public class DoJointInsuranceTask { ...@@ -963,7 +960,11 @@ public class DoJointInsuranceTask {
if (null != param.getDetailId() && null != param.getDefaultSettleId()) { if (null != param.getDetailId() && null != param.getDefaultSettleId()) {
pushParam.setFd_3b0a5743acab7e(param.getDetailId() + CommonConstants.DOWN_LINE_STRING + param.getDefaultSettleId()); pushParam.setFd_3b0a5743acab7e(param.getDetailId() + CommonConstants.DOWN_LINE_STRING + param.getDefaultSettleId());
} else { } else {
pushParam.setFd_3b0a5743acab7e(CommonConstants.EMPTY_STRING); if (InsurancesConstants.BALANCE_SETTLE_BILL.equals(param.getSettleType())){
pushParam.setFd_3b0a5743acab7e(param.getDetailId() + CommonConstants.DOWN_LINE_STRING + (null==param.getBalanceId()?"":param.getBalanceId()));
}else {
pushParam.setFd_3b0a5743acab7e(CommonConstants.EMPTY_STRING);
}
} }
//单据类型 //单据类型
pushParam.setFd_3adfe6af71a1cc(null != param.getSettleType() ? param.getSettleType() : CommonConstants.EMPTY_STRING); pushParam.setFd_3adfe6af71a1cc(null != param.getSettleType() ? param.getSettleType() : CommonConstants.EMPTY_STRING);
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
from from
ekp_insurances_info ekp_insurances_info
where where
fd_3b0a5743acab7e = #{id} and fd_3adfe6af71a1cc = '实缴' limit 1 fd_3b0a5743acab7e like CONCAT(#{id},'%') and fd_3adfe6af71a1cc = '实缴' limit 1
</select> </select>
<select id="getSettleStatusFromEkpAsso" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSettleStatusVo"> <select id="getSettleStatusFromEkpAsso" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.EkpSettleStatusVo">
...@@ -100,18 +100,18 @@ ...@@ -100,18 +100,18 @@
ekp_insurances_info ekp_insurances_info
where where
fd_3adfe6af71a1cc = '差额' and fd_jfcd='是' and fd_3adfe6af71a1cc = '差额' and fd_jfcd='是' and
fd_3b0a5743acab7e like concact(#{id},'%') fd_3b0a5743acab7e like CONCAT(#{id},'%')
</select> </select>
<delete id="deleteEkpInsuranceDetail"> <delete id="deleteEkpInsuranceDetail">
delete from ekp_insurances_info where fd_3b0a5743acab7e=#{id} and fd_jfcd='是' and fd_3adfe6af71a1cc = '预估' delete from ekp_insurances_info where fd_3b0a5743acab7e=#{id} and fd_jfcd='是' and fd_3adfe6af71a1cc = '预估'
</delete> </delete>
<delete id="deleteEkpInsuranceDetailAsso"> <delete id="deleteEkpInsuranceDetailAsso">
delete from ekp_insurances_info where fd_3b0a5743acab7e like concat(#{id},'%') and fd_jfcd='是' and (fd_3adfe6af71a1cc = '差额' or fd_3adfe6af71a1cc = '实缴') delete from ekp_insurances_info where fd_3b0a5743acab7e like CONCAT(#{id},'%') and fd_jfcd='是' and (fd_3adfe6af71a1cc = '差额' or fd_3adfe6af71a1cc = '实缴')
</delete> </delete>
<delete id="callBackBalance"> <delete id="callBackBalance">
delete from ekp_insurances_info where fd_3b0a5743acab7e like concat(#{id},'%') and fd_jfcd='是' and fd_3adfe6af71a1cc = '差额' delete from ekp_insurances_info where fd_3b0a5743acab7e like CONCAT(#{id},'%') and fd_jfcd='是' and fd_3adfe6af71a1cc = '差额'
</delete> </delete>
<select id="getDeptSettle" resultMap="BaseDeptResultMap"> <select id="getDeptSettle" resultMap="BaseDeptResultMap">
select select
......
...@@ -294,6 +294,7 @@ ...@@ -294,6 +294,7 @@
WHEN a.process_status ='4' THEN "投保中" WHEN a.process_status ='4' THEN "投保中"
WHEN a.process_status ='5' THEN "投保退回" WHEN a.process_status ='5' THEN "投保退回"
WHEN a.process_status ='6' THEN "已完成" WHEN a.process_status ='6' THEN "已完成"
WHEN a.process_status ='7' THEN "待缴费"
ELSE a.process_status END as process_status, ELSE a.process_status END as process_status,
a.customer_username, a.customer_username,
concat(DATE_FORMAT(a.policy_start,'%Y-%m-%d'),'-',DATE_FORMAT(a.policy_end,'%Y-%m-%d')) as policy_start_end, concat(DATE_FORMAT(a.policy_start,'%Y-%m-%d'),'-',DATE_FORMAT(a.policy_end,'%Y-%m-%d')) as policy_start_end,
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
a.PAYMENT_STATUS as paymentStatus, a.PAYMENT_STATUS as paymentStatus,
a.PAYMENT_TIME as paymentTime, a.PAYMENT_TIME as paymentTime,
a.IS_JFCD as isJfcd, a.IS_JFCD as isJfcd,
a.PURCHASE_CYCLE as purchaseCycle, IF(a.BILLING_TYPE='0',CONCAT(a.PURCHASE_CYCLE,'天'),CONCAT(a.PURCHASE_CYCLE,'个月')) as purchaseCycle,
a.BILLING_TYPE as billingType, a.BILLING_TYPE as billingType,
a.PRE_HANDLE_TIME as preHandleTime, a.PRE_HANDLE_TIME as preHandleTime,
a.ESTIMATE_PREMIUM as estimatePremium a.ESTIMATE_PREMIUM as estimatePremium
...@@ -241,7 +241,8 @@ ...@@ -241,7 +241,8 @@
a.PAYMENT_STATUS as paymentStatus, a.PAYMENT_STATUS as paymentStatus,
a.PAYMENT_TIME as paymentTime, a.PAYMENT_TIME as paymentTime,
a.IS_JFCD as isJfcd, a.IS_JFCD as isJfcd,
a.PURCHASE_CYCLE as purchaseCycle, <!-- a.PURCHASE_CYCLE as purchaseCycle, -->
IF(a.BILLING_TYPE='0',CONCAT(a.PURCHASE_CYCLE,'天'),CONCAT(a.PURCHASE_CYCLE,'个月')) as purchaseCycle,
a.PRE_HANDLE_TIME as preHandleTime, a.PRE_HANDLE_TIME as preHandleTime,
a.ESTIMATE_PREMIUM as estimatePremium, a.ESTIMATE_PREMIUM as estimatePremium,
a.BILLING_TYPE as billingType a.BILLING_TYPE as billingType
...@@ -435,7 +436,8 @@ ...@@ -435,7 +436,8 @@
a.REFUND_ID as refundId, a.REFUND_ID as refundId,
a.EXPIRE_REMARK, a.EXPIRE_REMARK,
a.EXPIRE_IGNORE_FLAG, a.EXPIRE_IGNORE_FLAG,
a.IS_ADRESS as isAdress,PAYMENT_STATUS,PAYMENT_TIME,IS_JFCD,PURCHASE_CYCLE,PRE_HANDLE_TIME a.IS_ADRESS as isAdress,a.PAYMENT_STATUS,a.PAYMENT_TIME,a.IS_JFCD,
IF(a.BILLING_TYPE='0',CONCAT(a.PURCHASE_CYCLE,'天'),CONCAT(a.PURCHASE_CYCLE,'个月')) PURCHASE_CYCLE,a.PRE_HANDLE_TIME
from t_insurance_detail a from t_insurance_detail a
left join t_insurance_settle tis on a.DEFAULT_SETTLE_ID = tis.ID left join t_insurance_settle tis on a.DEFAULT_SETTLE_ID = tis.ID
where a.ID = #{id} where a.ID = #{id}
...@@ -468,7 +470,7 @@ ...@@ -468,7 +470,7 @@
a.CREATE_NAME as createName, a.CREATE_NAME as createName,
a.POLICY_NO as policyNo, a.POLICY_NO as policyNo,
a.REMARK as remark, a.REMARK as remark,
a.IS_ADRESS as isAdress a.IS_ADRESS as isAdress,a.DEFAULT_SETTLE_ID as defaultSettleId
from t_insurance_detail a from t_insurance_detail a
where a.DELETE_FLAG = 0 and a.id in where a.DELETE_FLAG = 0 and a.id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")"> <foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
...@@ -503,7 +505,7 @@ ...@@ -503,7 +505,7 @@
a.CREATE_NAME as createName, a.CREATE_NAME as createName,
a.POLICY_NO as policyNo, a.POLICY_NO as policyNo,
a.REMARK as remark, a.REMARK as remark,
a.IS_ADRESS as isAdress a.IS_ADRESS as isAdress,a.DEFAULT_SETTLE_ID as defaultSettleId
from t_insurance_detail a from t_insurance_detail a
where a.DELETE_FLAG = 0 and a.BUY_HANDLE_STATUS = #{param.buyHandleStatus} where a.DELETE_FLAG = 0 and a.BUY_HANDLE_STATUS = #{param.buyHandleStatus}
<if test="param.empName != null and param.empName.trim() != ''"> <if test="param.empName != null and param.empName.trim() != ''">
...@@ -569,7 +571,7 @@ ...@@ -569,7 +571,7 @@
a.SETTLE_TYPE as settleType, a.SETTLE_TYPE as settleType,
a.CREATE_NAME as createName, a.CREATE_NAME as createName,
a.POLICY_NO as policyNo, a.POLICY_NO as policyNo,
a.REMARK as remark,a.UNIT_NAME as unitName a.REMARK as remark,a.UNIT_NAME as unitName,a.DEFAULT_SETTLE_ID as defaultSettleId
from t_insurance_detail a from t_insurance_detail a
where a.DELETE_FLAG = 0 and a.id in where a.DELETE_FLAG = 0 and a.id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")"> <foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
...@@ -601,7 +603,7 @@ ...@@ -601,7 +603,7 @@
a.SETTLE_TYPE as settleType, a.SETTLE_TYPE as settleType,
a.CREATE_NAME as createName, a.CREATE_NAME as createName,
a.POLICY_NO as policyNo, a.POLICY_NO as policyNo,
a.REMARK as remark,a.UNIT_NAME as unitName a.REMARK as remark,a.UNIT_NAME as unitName,a.DEFAULT_SETTLE_ID as defaultSettleId
from t_insurance_detail a from t_insurance_detail a
where a.DELETE_FLAG = 0 and a.BUY_HANDLE_STATUS = #{param.buyHandleStatus} where a.DELETE_FLAG = 0 and a.BUY_HANDLE_STATUS = #{param.buyHandleStatus}
<if test="param.empName != null and param.empName.trim() != ''"> <if test="param.empName != null and param.empName.trim() != ''">
......
...@@ -426,7 +426,7 @@ ...@@ -426,7 +426,7 @@
,'临期' isOverdue,a.HAVE_WORK_DAY,'否' EXPIRE_IGNORE_FLAG,a.CREATE_NAME,a.ALERTER ,'临期' isOverdue,a.HAVE_WORK_DAY,'否' EXPIRE_IGNORE_FLAG,a.CREATE_NAME,a.ALERTER
,DATE_FORMAT(b.expected_collection_time,'%Y-%m-%d %H:%i') expected_collection_time ,DATE_FORMAT(b.expected_collection_time,'%Y-%m-%d %H:%i') expected_collection_time
,case b.process_status when '0' then '待确认' when '1' then '待派单' when '2' then '派单失败' ,case b.process_status when '0' then '待确认' when '1' then '待派单' when '2' then '派单失败'
when '3' then '待投保' when '4' then '投保中' when '5' then '投保退回' when '6' then '已投保' else '-' end process_status when '3' then '待投保' when '4' then '投保中' when '5' then '投保退回' when '6' then '已投保' when '7' then '待缴费' else '-' end process_status
,b.CUSTOMER_USERNAME ,b.CUSTOMER_USERNAME
FROM t_insurance_alert a FROM t_insurance_alert a
JOIN t_insurance_pre_renew_detail b ON a.INSURANCES_PRE_RENEW_DETAIL_ID = b.ID JOIN t_insurance_pre_renew_detail b ON a.INSURANCES_PRE_RENEW_DETAIL_ID = b.ID
......
...@@ -359,8 +359,8 @@ public class TDispatchInfoPreController { ...@@ -359,8 +359,8 @@ public class TDispatchInfoPreController {
@Operation(description = "删除非流程中的社保待购买数据") @Operation(description = "删除非流程中的社保待购买数据")
@Inner @Inner
@PostMapping("/deleteUnProcessSocialPreInfo") @PostMapping("/deleteUnProcessSocialPreInfo")
public void deleteUnProcessSocialPreInfo(@RequestBody String id) { public Boolean deleteUnProcessSocialPreInfo(@RequestBody String id) {
tDispatchInfoPreService.deleteUnProcessSocialPreInfo(id); return tDispatchInfoPreService.deleteUnProcessSocialPreInfo(id);
} }
/** /**
...@@ -373,8 +373,8 @@ public class TDispatchInfoPreController { ...@@ -373,8 +373,8 @@ public class TDispatchInfoPreController {
@Operation(description = "删除非流程中的公积金待购买数据") @Operation(description = "删除非流程中的公积金待购买数据")
@Inner @Inner
@PostMapping("/deleteUnProcessFundPreInfo") @PostMapping("/deleteUnProcessFundPreInfo")
public void deleteUnProcessFundPreInfo(@RequestBody String id) { public Boolean deleteUnProcessFundPreInfo(@RequestBody String id) {
tDispatchInfoPreService.deleteUnProcessFundPreInfo(id); return tDispatchInfoPreService.deleteUnProcessFundPreInfo(id);
} }
...@@ -410,7 +410,7 @@ public class TDispatchInfoPreController { ...@@ -410,7 +410,7 @@ public class TDispatchInfoPreController {
* @return R * @return R
*/ */
@Operation(summary = "通过id查询", description = "通过id查询") @Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/getInfoByRegistId " ) @GetMapping("/getInfoByRegistId" )
public R<TDispatchInfoPre> getInfoByRegistId(@RequestParam("registId" ) String registId, @RequestParam("type" ) String type) { public R<TDispatchInfoPre> getInfoByRegistId(@RequestParam("registId" ) String registId, @RequestParam("type" ) String type) {
return tDispatchInfoPreService.getInfoByRegistId(registId,type); return tDispatchInfoPreService.getInfoByRegistId(registId,type);
} }
......
...@@ -77,9 +77,9 @@ public interface TDispatchInfoPreService extends IService<TDispatchInfoPre> { ...@@ -77,9 +77,9 @@ public interface TDispatchInfoPreService extends IService<TDispatchInfoPre> {
EmployeePreSocialListVo getSocialPreInfoStatus(String id); EmployeePreSocialListVo getSocialPreInfoStatus(String id);
void deleteUnProcessSocialPreInfo(String id); Boolean deleteUnProcessSocialPreInfo(String id);
void deleteUnProcessFundPreInfo(String id); Boolean deleteUnProcessFundPreInfo(String id);
/** /**
* 社保待购买信息单个/批量发起签署任务 * 社保待购买信息单个/批量发起签署任务
......
...@@ -69,7 +69,7 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> { ...@@ -69,7 +69,7 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
@ShardingTransactionType(TransactionType.BASE) @ShardingTransactionType(TransactionType.BASE)
void importTDispatchInfo(List<TDispatchImportVo> excelVOList, void importTDispatchInfo(List<TDispatchImportVo> excelVOList,
List<ErrorMessage> errorMessageList, List<ErrorMessage> errorMessageList,
YifuUser user, String orderId, Map<String, String> idCardMap); YifuUser user, String orderId, Map<String, String> idCardMap,String autoFlag);
R<List<ErrorMessage>> importReduceDiy(InputStream inputStream, String orderId,String flag); R<List<ErrorMessage>> importReduceDiy(InputStream inputStream, String orderId,String flag);
......
...@@ -21,6 +21,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; ...@@ -21,6 +21,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre;
import com.yifu.cloud.plus.v1.yifu.social.config.WxConfig; import com.yifu.cloud.plus.v1.yifu.social.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfoPre; import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfoPre;
import com.yifu.cloud.plus.v1.yifu.social.entity.TFundPreDetail; import com.yifu.cloud.plus.v1.yifu.social.entity.TFundPreDetail;
...@@ -449,27 +450,22 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -449,27 +450,22 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
} }
@Override @Override
public void deleteUnProcessSocialPreInfo(String id) { public Boolean deleteUnProcessSocialPreInfo(String id) {
//删除未处理的社保待购买信息 //删除未处理的社保待购买信息
this.remove(Wrappers.<TDispatchInfoPre>query().lambda() return this.remove(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getTypeSub,CommonConstants.ZERO_STRING) .eq(TDispatchInfoPre::getTypeSub,CommonConstants.ZERO_STRING)
.in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4","8")) .in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4","8"))
.eq(TDispatchInfoPre::getRegisterId, id)); .eq(TDispatchInfoPre::getRegisterId, id));
socialPreDetailService.remove(Wrappers.<TSocialPreDetail>query().lambda()
.eq(TSocialPreDetail::getRegisterId, id));
} }
@Override @Override
public void deleteUnProcessFundPreInfo(String id) { public Boolean deleteUnProcessFundPreInfo(String id) {
//删除未处理的公积金待购买信息 //删除未处理的公积金待购买信息
this.remove(Wrappers.<TDispatchInfoPre>query().lambda() return this.remove(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getTypeSub,CommonConstants.ONE_STRING) .eq(TDispatchInfoPre::getTypeSub,CommonConstants.ONE_STRING)
.in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4","8")) .in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4","8"))
.eq(TDispatchInfoPre::getRegisterId, id)); .eq(TDispatchInfoPre::getRegisterId, id));
socialPreDetailService.remove(Wrappers.<TSocialPreDetail>query().lambda()
.eq(TSocialPreDetail::getRegisterId, id));
} }
@Override @Override
...@@ -511,7 +507,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -511,7 +507,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
if (Common.isNotNull(disList)) { if (Common.isNotNull(disList)) {
//调用批量派单接口100条处理一次,同原合同派单保持一致 //调用批量派单接口100条处理一次,同原合同派单保持一致
List<ErrorMessage> errorMessageList = new ArrayList<>(); List<ErrorMessage> errorMessageList = new ArrayList<>();
dispatchInfoService.importTDispatchInfo(disList, errorMessageList,user, null, new HashMap<>()); dispatchInfoService.importTDispatchInfo(disList, errorMessageList,user, null, new HashMap<>(),CommonConstants.ZERO_STRING);
if (!errorMessageList.stream().allMatch(message -> message.getMessage().equals(CommonConstants.SAVE_SUCCESS))) { if (!errorMessageList.stream().allMatch(message -> message.getMessage().equals(CommonConstants.SAVE_SUCCESS))) {
List<ErrorMessage> relErrorMessageList = errorMessageList.stream().filter(message -> !message.getMessage().equals(CommonConstants.SAVE_SUCCESS)).collect(Collectors.toList()); List<ErrorMessage> relErrorMessageList = errorMessageList.stream().filter(message -> !message.getMessage().equals(CommonConstants.SAVE_SUCCESS)).collect(Collectors.toList());
errorMessageListAll.addAll(relErrorMessageList); errorMessageListAll.addAll(relErrorMessageList);
...@@ -816,7 +812,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -816,7 +812,7 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
if (Common.isNotNull(disList)) { if (Common.isNotNull(disList)) {
//调用批量派单接口100条处理一次,同原合同派单保持一致 //调用批量派单接口100条处理一次,同原合同派单保持一致
List<ErrorMessage> errorMessageList = new ArrayList<>(); List<ErrorMessage> errorMessageList = new ArrayList<>();
dispatchInfoService.importTDispatchInfo(disList, errorMessageList,user, null, new HashMap<>()); dispatchInfoService.importTDispatchInfo(disList, errorMessageList,user, null, new HashMap<>(),null);
if (!errorMessageList.stream().allMatch(message -> message.getMessage().equals(CommonConstants.SAVE_SUCCESS))) { if (!errorMessageList.stream().allMatch(message -> message.getMessage().equals(CommonConstants.SAVE_SUCCESS))) {
List<ErrorMessage> relErrorMessageList = errorMessageList.stream().filter(message -> !message.getMessage().equals(CommonConstants.SAVE_SUCCESS)).collect(Collectors.toList()); List<ErrorMessage> relErrorMessageList = errorMessageList.stream().filter(message -> !message.getMessage().equals(CommonConstants.SAVE_SUCCESS)).collect(Collectors.toList());
errorMessageListAll.addAll(relErrorMessageList); errorMessageListAll.addAll(relErrorMessageList);
...@@ -1067,6 +1063,9 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -1067,6 +1063,9 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
if (Common.isEmpty(registId) || Common.isEmpty(type)) { if (Common.isEmpty(registId) || Common.isEmpty(type)) {
return R.failed(CommonConstants.PARAM_INFO_ERROR); return R.failed(CommonConstants.PARAM_INFO_ERROR);
} }
return R.ok(baseMapper.selectOne(Wrappers.<TDispatchInfoPre>query().lambda().eq(TDispatchInfoPre::getTypeSub,type).eq(TDispatchInfoPre::getRegisterId, registId).last(CommonConstants.LAST_ONE_SQL))); return R.ok(baseMapper.selectOne(Wrappers.<TDispatchInfoPre>query().lambda()
.notIn(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4", "8"))
.eq(TDispatchInfoPre::getTypeSub,type)
.eq(TDispatchInfoPre::getRegisterId, registId).last(CommonConstants.LAST_ONE_SQL)));
} }
} }
...@@ -458,7 +458,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -458,7 +458,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
*/ */
private void saveData() { private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size()); log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTDispatchInfo(cachedDataList, errorMessageList, user, orderId, idCardMap); importTDispatchInfo(cachedDataList, errorMessageList, user, orderId, idCardMap,null);
log.info("存储数据库成功!"); log.info("存储数据库成功!");
} }
}).sheet().doRead(); }).sheet().doRead();
...@@ -475,7 +475,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -475,7 +475,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
public void importTDispatchInfo(List<TDispatchImportVo> excelVOList, public void importTDispatchInfo(List<TDispatchImportVo> excelVOList,
List<ErrorMessage> errorMessageList, List<ErrorMessage> errorMessageList,
YifuUser user, String orderId, YifuUser user, String orderId,
Map<String, String> idCardMap) { Map<String, String> idCardMap,String autoFlag) {
if (!Common.isNotNull(excelVOList)) { if (!Common.isNotNull(excelVOList)) {
return; return;
} }
...@@ -624,7 +624,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -624,7 +624,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
continue; continue;
} }
// 数据合法情况 // 数据合法情况
if (validImport(errorMessageList, excel, setInfoVo, socialFund, empVo, socialSet, fundSet)) { if (validImport(errorMessageList, excel, setInfoVo, socialFund, empVo, socialSet, fundSet,autoFlag)) {
excelVOTemp.put(excel.getRowIndex().toString(), excel.getEmpIdcard()); excelVOTemp.put(excel.getRowIndex().toString(), excel.getEmpIdcard());
continue; continue;
} }
...@@ -2390,11 +2390,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2390,11 +2390,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return empVoMap; return empVoMap;
} }
//autoFalg "0" 为自动化
private boolean validImport(List<ErrorMessage> errorMessageList, private boolean validImport(List<ErrorMessage> errorMessageList,
TDispatchImportVo excel, TDispatchImportVo excel,
ProjectSetInfoVo setInfoVo, ProjectSetInfoVo setInfoVo,
TSocialFundInfo socialFund, TSocialFundInfo socialFund,
DispatchEmpVo empVo, SysBaseSetInfo socialSet, SysBaseSetInfo fundSet) { DispatchEmpVo empVo, SysBaseSetInfo socialSet, SysBaseSetInfo fundSet,String autoFlag) {
if (Common.isNotNull(excel.getSocialHousehold()) && Common.isEmpty(excel.getPaymentType())) { if (Common.isNotNull(excel.getSocialHousehold()) && Common.isEmpty(excel.getPaymentType())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_NOT_EMPTY))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_NOT_EMPTY)));
return true; return true;
...@@ -2515,10 +2516,15 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2515,10 +2516,15 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return true; return true;
} }
//档案试用期必填 20241128 fxj 1.7.2 //档案试用期必填 20241128 fxj 1.7.2
if (Common.isEmpty(empVo.getTryPeriod()) && Common.isEmpty(excel.getTryPeriod())) { if (Common.isEmpty(empVo.getTryPeriod())
&& Common.isEmpty(excel.getTryPeriod())
&& CommonConstants.ZERO_STRING.equals(empVo.getTryPeriod()) && !CommonConstants.ZERO_STRING.equals(autoFlag)) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_TRYPERIOD_NOT_EMPTY))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_TRYPERIOD_NOT_EMPTY)));
return true; return true;
} }
if (CommonConstants.ZERO_STRING.equals(autoFlag) && Common.isEmpty(excel.getTryPeriod())){
excel.setTryPeriod(empVo.getTryPeriod());
}
// fxj 2024-08-30 有档案 学历或户口性质为空 派单必填 学历或客户性质 // fxj 2024-08-30 有档案 学历或户口性质为空 派单必填 学历或客户性质
if (Common.isEmpty(empVo.getHignEducation()) && Common.isEmpty(excel.getEducationName())) { if (Common.isEmpty(empVo.getHignEducation()) && Common.isEmpty(excel.getEducationName())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_EDUCATION_NOT_EMPTY))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_EMP_EDUCATION_NOT_EMPTY)));
...@@ -6824,7 +6830,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -6824,7 +6830,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
initAreaMap(areaMap, areaIdMap, areaListR); initAreaMap(areaMap, areaIdMap, areaListR);
} }
// 档案地市没问题 开始派单处理 // 档案地市没问题 开始派单处理
this.importTDispatchInfo(importVoList, errorMessageList, user, null, new HashMap<>()); this.importTDispatchInfo(importVoList, errorMessageList, user, null, new HashMap<>(),null);
if (errorMessageList.isEmpty() || CommonConstants.GREEN.equals(errorMessageList.get(0).getColor())) { if (errorMessageList.isEmpty() || CommonConstants.GREEN.equals(errorMessageList.get(0).getColor())) {
return R.ok(); return R.ok();
} else { } else {
......
...@@ -382,7 +382,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -382,7 +382,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
} }
// 档案地市没问题 开始派单处理 // 档案地市没问题 开始派单处理
if (errorMessageList.size() == CommonConstants.ZERO_INT) { if (errorMessageList.size() == CommonConstants.ZERO_INT) {
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user, null, new HashMap<>()); dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user, null, new HashMap<>(),null);
} }
// 处理派增结果 // 处理派增结果
errorMessage = handleDispatchAddRes(preInfo, errorMessageList); errorMessage = handleDispatchAddRes(preInfo, errorMessageList);
...@@ -2535,7 +2535,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap ...@@ -2535,7 +2535,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
} }
// 档案地市没问题 开始派单处理 // 档案地市没问题 开始派单处理
if (!Common.isNotNull(errorMessageList)){ if (!Common.isNotNull(errorMessageList)){
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user, null, new HashMap<>()); dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user, null, new HashMap<>(),null);
} }
// 处理派增结果 // 处理派增结果
handleDispatchAddRes(pre, errorMessageList); handleDispatchAddRes(pre, errorMessageList);
......
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