Commit 214c3da1 authored by hongguangwu's avatar hongguangwu

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

parents 170dfc75 cb40f4e1
...@@ -100,6 +100,9 @@ public class EmployeeRegistrationPre extends BaseEntity { ...@@ -100,6 +100,9 @@ public class EmployeeRegistrationPre extends BaseEntity {
@Schema(description = "档案所在地-市编号") @Schema(description = "档案所在地-市编号")
private String cityCode; private String cityCode;
@Schema(description = "商险是否已购买 0 是 1 否")
private String insuranceIsBuy;
@Schema(description = "档案所在地-县编号") @Schema(description = "档案所在地-县编号")
@TableField(updateStrategy = FieldStrategy.IGNORED) @TableField(updateStrategy = FieldStrategy.IGNORED)
private String townCode; private String townCode;
......
...@@ -116,6 +116,9 @@ public class EmployeeRegistrationPreVo implements Serializable { ...@@ -116,6 +116,9 @@ public class EmployeeRegistrationPreVo implements Serializable {
@Schema(description = "更新人") @Schema(description = "更新人")
private String updateBy; private String updateBy;
@Schema(description = "商险是否已购买 0 是 1 否")
private String insuranceIsBuy;
@Schema(description = "身份证合集") @Schema(description = "身份证合集")
private List<String> idcardList; private List<String> idcardList;
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="customerUsernameNew" column="customer_username_new"/> <result property="customerUsernameNew" column="customer_username_new"/>
<result property="insuranceIsBuy" column="insurance_is_buy"/>
</resultMap> </resultMap>
<resultMap id="employeeRegistrationPreExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreExportVo"> <resultMap id="employeeRegistrationPreExportMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreExportVo">
...@@ -113,7 +114,7 @@ ...@@ -113,7 +114,7 @@
a.update_time, a.update_time,
a.contract_sub_name, a.contract_sub_name,
a.customer_username_new, a.customer_username_new,
province_code,city_code,town_code province_code,city_code,town_code,insurance_is_buy
</sql> </sql>
<sql id="employeeRegistrationPre_where"> <sql id="employeeRegistrationPre_where">
<if test="employeeRegistrationPre != null"> <if test="employeeRegistrationPre != null">
......
...@@ -104,6 +104,10 @@ public class InsurancesConstants { ...@@ -104,6 +104,10 @@ public class InsurancesConstants {
* 投保记录已存在 * 投保记录已存在
*/ */
public static final String DATA_IS_EXIST = "投保记录已存在"; public static final String DATA_IS_EXIST = "投保记录已存在";
/**
* 本次派单前系统已有该人员在途/在保数据
*/
public static final String DIS_PERSON_DATA_IS_EXIST = "本次派单前系统已有该人员在途/在保数据";
/** /**
* 投保记录不存在 * 投保记录不存在
*/ */
......
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.Date;
/**
* 入职确认信息已购买商险明细
*
* @author huych
* @date 2025-08-05 15:08:42
*/
@Data
@TableName("t_insurance_pre_detail")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "入职确认信息已购买商险明细")
public class TInsurancePreDetail extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
/**
* 姓名
*/
@ExcelAttribute(name = "姓名", maxLength = 32)
@Length(max = 32, message = "姓名不能超过32个字符")
@ExcelProperty("姓名")
@Schema(description = "姓名")
private String empName;
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号不能为空", maxLength = 32)
@NotBlank(message = "身份证号不能为空")
@Length(max = 32, message = "身份证号不能超过32个字符")
@ExcelProperty("身份证号")
@Schema(description = "身份证号")
private String empIdcardNo;
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", maxLength = 30)
@Length(max = 30, message = "项目编码不能超过30个字符")
@ExcelProperty("项目编码")
@Schema(description = "项目编码")
private String deptNo;
/**
* 投保岗位
*/
@ExcelAttribute(name = "投保岗位", maxLength = 32)
@Length(max = 32, message = "投保岗位不能超过32个字符")
@ExcelProperty("投保岗位")
@Schema(description = "投保岗位")
private String post;
/**
* 保险公司名称
*/
@ExcelAttribute(name = "保险公司名称", maxLength = 60)
@Length(max = 60, message = "保险公司名称不能超过60个字符")
@ExcelProperty("保险公司名称")
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@ExcelAttribute(name = "险种名称", maxLength = 50)
@Length(max = 50, message = "险种名称不能超过50个字符")
@ExcelProperty("险种名称")
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 购买标准
*/
@ExcelAttribute(name = "购买标准", maxLength = 32)
@Length(max = 32, message = "购买标准不能超过32个字符")
@ExcelProperty("购买标准")
@Schema(description = "购买标准")
private String buyStandard;
/**
* 保单开始时间
*/
@ExcelAttribute(name = "保单开始时间", isDate = true)
@ExcelProperty("保单开始时间")
@Schema(description = "保单开始时间")
private Date policyStart;
/**
* 保单结束时间
*/
@ExcelAttribute(name = "保单结束时间", isDate = true)
@ExcelProperty("保单结束时间")
@Schema(description = "保单结束时间")
private Date policyEnd;
/**
* 保单生效日期
*/
@ExcelAttribute(name = "保单生效日期", isDate = true)
@ExcelProperty("保单生效日期")
@Schema(description = "保单生效日期")
private Date policyEffect;
/**
* 购买类型, 1新增、3批增、4替换
*/
@ExcelAttribute(name = "购买类型, 1新增、3批增、4替换")
@ExcelProperty("购买类型, 1新增、3批增、4替换")
@Schema(description = "购买类型, 1新增、3批增、4替换")
private Integer buyType;
/**
* 投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
@ExcelAttribute(name = "投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
@ExcelProperty("投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
@Schema(description = "投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
private Integer buyHandleStatus;
/**
* 结算主体名称
*/
@ExcelAttribute(name = "结算主体名称", maxLength = 50)
@Length(max = 50, message = "结算主体名称不能超过50个字符")
@ExcelProperty("结算主体名称")
@Schema(description = "结算主体名称")
private String deptName;
/**
* 客户名称
*/
@ExcelAttribute(name = "客户名称", maxLength = 50)
@Length(max = 50, message = "客户名称不能超过50个字符")
@ExcelProperty("客户名称")
@Schema(description = "客户名称")
private String unitName;
/**
* 客户编码
*/
@ExcelAttribute(name = "客户编码", maxLength = 32)
@Length(max = 32, message = "客户编码不能超过32个字符")
@ExcelProperty("客户编码")
@Schema(description = "客户编码")
private String unitNo;
/**
* 是否地市自购0是 1 否
*/
@ExcelAttribute(name = "是否地市自购0是 1 否", maxLength = 1)
@Length(max = 1, message = "是否地市自购0是 1 否不能超过1个字符")
@ExcelProperty("是否地市自购0是 1 否")
@Schema(description = "是否地市自购0是 1 否")
private String isAdress;
/**
* 入离职登记id
*/
@ExcelAttribute(name = "入离职登记id", maxLength = 32)
@Length(max = 32, message = "入离职登记id不能超过32个字符")
@ExcelProperty("入离职登记id")
@Schema(description = "入离职登记id")
private String registerId;
}
...@@ -7,6 +7,7 @@ import lombok.Data; ...@@ -7,6 +7,7 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
/** /**
* @author licancan * @author licancan
...@@ -214,4 +215,12 @@ public class InsuranceAddParam implements Serializable { ...@@ -214,4 +215,12 @@ public class InsuranceAddParam implements Serializable {
*/ */
@Schema(description = "是否地市自购") @Schema(description = "是否地市自购")
private String isAdress; private String isAdress;
/**
* 是否已有参保明细标识 1是 空否
*/
@Schema(description = "是否已有参保明细标识")
private String isExit;
private List<InsuredListVo> inProgressList;
} }
...@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema; ...@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* @author huyc * @author huyc
...@@ -156,4 +157,12 @@ public class InsuranceAutoParam implements Serializable { ...@@ -156,4 +157,12 @@ public class InsuranceAutoParam implements Serializable {
*/ */
@Schema(description = "前端客服姓名") @Schema(description = "前端客服姓名")
private String customerUserName; private String customerUserName;
/**
* 是否已有参保明细标识 1是 空否
*/
@Schema(description = "是否已有参保明细标识")
private String isExit;
private List<InsuredListVo> inProgressList;
} }
...@@ -8,6 +8,7 @@ import lombok.Data; ...@@ -8,6 +8,7 @@ import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List;
/** /**
* @author licancan * @author licancan
...@@ -221,4 +222,12 @@ public class InsuranceBatchParam implements Serializable { ...@@ -221,4 +222,12 @@ public class InsuranceBatchParam implements Serializable {
*/ */
@Schema(description = "是否地市自购") @Schema(description = "是否地市自购")
private String isAdress; private String isAdress;
/**
* 是否已有参保明细标识 1是 空否
*/
@Schema(description = "是否已有参保明细标识")
private String isExit;
private List<InsuredListVo> inProgressList;
} }
...@@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.media.Schema; ...@@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.List;
/** /**
* @author licancan * @author licancan
...@@ -151,11 +152,18 @@ public class InsuranceReplaceParam implements Serializable { ...@@ -151,11 +152,18 @@ public class InsuranceReplaceParam implements Serializable {
@Schema(description = "是否地市自购") @Schema(description = "是否地市自购")
private String isAdress; private String isAdress;
/** /**
* 备注 * 备注
*/ */
@Schema(description = "备注") @Schema(description = "备注")
private String remark; private String remark;
/**
* 是否已有参保明细标识 1是 空否
*/
@Schema(description = "是否已有参保明细标识")
private String isExit;
private List<InsuredListVo> inProgressList;
} }
...@@ -230,6 +230,13 @@ public class InsuredListVo implements Serializable { ...@@ -230,6 +230,13 @@ public class InsuredListVo implements Serializable {
@ExcelIgnore @ExcelIgnore
private Integer insuranceCity; private Integer insuranceCity;
/**
* 投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
@Schema(description = "投保办理状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
@ExcelIgnore
private Integer buyHandleStatus;
/** /**
* 商险购买地市 * 商险购买地市
*/ */
......
...@@ -163,7 +163,7 @@ public class TEmployeeInsurancePreController { ...@@ -163,7 +163,7 @@ public class TEmployeeInsurancePreController {
@Operation(description = "商险派单信息单个/批量派单") @Operation(description = "商险派单信息单个/批量派单")
@PostMapping("/batchDispatcherInsurance") @PostMapping("/batchDispatcherInsurance")
public R batchDispatcherInsurance(@RequestBody List<String> idList) { public R batchDispatcherInsurance(@RequestBody List<String> idList) {
return tEmployeeInsurancePreService.batchDispatcherInsurance(idList); return tEmployeeInsurancePreService.batchDispatcherInsurance(idList, null);
} }
/** /**
......
...@@ -874,4 +874,15 @@ public class TInsuranceDetailController { ...@@ -874,4 +874,15 @@ public class TInsuranceDetailController {
return R.ok(tInsuranceDetailService.policyPageToAutoSelect(page, param, mId)); return R.ok(tInsuranceDetailService.policyPageToAutoSelect(page, param, mId));
} }
/**
* 查询在用或者在途的商险数据
* @param empIdcard 身份证号
* @return
*/
@Operation(description = "查询在用或者在途的商险数据")
@GetMapping("/getOnProcessInsurancesInfo")
public R<List<InsuredListVo>> getInProcessInsurancesInfo(@RequestParam String empIdcard) {
return R.ok(tInsuranceDetailService.getOnProcessInsurancesInfo(empIdcard));
}
} }
...@@ -334,5 +334,9 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> { ...@@ -334,5 +334,9 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
*/ */
IPage<InsuredListVo> policyPageToAutoSelect(Page<InsuredListVo> page, @Param("param") InsuredParam param); IPage<InsuredListVo> policyPageToAutoSelect(Page<InsuredListVo> page, @Param("param") InsuredParam param);
/**
* 派单前系统已有在途/在保数据的人员明细
*/
List<InsuredListVo> getOnProcessInsuredList(@Param("empIdCard") String empIdCard);
} }
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import org.apache.ibatis.annotations.Mapper;
/**
* 入职确认信息已购买商险明细
*
* @author huych
* @date 2025-08-05 15:08:42
*/
@Mapper
public interface TInsurancePreDetailMapper extends BaseMapper<TInsurancePreDetail> {
}
...@@ -59,9 +59,10 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc ...@@ -59,9 +59,10 @@ public interface TEmployeeInsurancePreService extends IService<TEmployeeInsuranc
/** /**
* 商险派单信息批量派单 * 商险派单信息批量派单
* @param idList id集合 * @param idList id集合
* @param sameFlag 是否要做重复人员明细校验的标识 1 不需要 空需要
* @return * @return
*/ */
R batchDispatcherInsurance(List<String> idList); R batchDispatcherInsurance(List<String> idList,String sameFlag);
/** /**
* 新增商险待购买信息 * 新增商险待购买信息
......
...@@ -575,5 +575,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> { ...@@ -575,5 +575,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
*/ */
IPage<InsuredListVo> policyPageToAutoSelect(Page<InsuredListVo> page, InsuredParam param, String mId); IPage<InsuredListVo> policyPageToAutoSelect(Page<InsuredListVo> page, InsuredParam param, String mId);
List<InsuredListVo> getOnProcessInsurancesInfo(String empIdCard);
} }
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
/**
* 入职确认信息已购买商险明细
*
* @author huych
* @date 2025-08-05 15:08:42
*/
public interface TInsurancePreDetailService extends IService<TInsurancePreDetail> {
}
...@@ -53,7 +53,7 @@ public class ScheduleServiceImpl implements ScheduleService { ...@@ -53,7 +53,7 @@ public class ScheduleServiceImpl implements ScheduleService {
transactionTemplate.execute(status -> { transactionTemplate.execute(status -> {
List<String> idList = new ArrayList<>(); List<String> idList = new ArrayList<>();
idList.add(aId); idList.add(aId);
insurancePreService.batchDispatcherInsurance(idList); insurancePreService.batchDispatcherInsurance(idList,CommonConstants.ONE_STRING);
return null; return null;
}); });
} }
......
...@@ -179,7 +179,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -179,7 +179,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
} }
@Override @Override
public R batchDispatcherInsurance(List<String> idList) { public R batchDispatcherInsurance(List<String> idList, String sameFlag) {
List<TEmployeeInsurancePre> insurancePreList = baseMapper.selectList(Wrappers.<TEmployeeInsurancePre>query() List<TEmployeeInsurancePre> insurancePreList = baseMapper.selectList(Wrappers.<TEmployeeInsurancePre>query()
.lambda().in(TEmployeeInsurancePre::getId, idList) .lambda().in(TEmployeeInsurancePre::getId, idList)
.in(TEmployeeInsurancePre::getProcessStatus, CommonConstants.processInsurancesStatus)); .in(TEmployeeInsurancePre::getProcessStatus, CommonConstants.processInsurancesStatus));
...@@ -209,6 +209,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -209,6 +209,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
addParam.setRemark(CommonConstants.EMPTY_STRING); addParam.setRemark(CommonConstants.EMPTY_STRING);
addParam.setInsurancePreId(insurancePre.getId()); addParam.setInsurancePreId(insurancePre.getId());
addParam.setCustomerUserName(insurancePre.getCustomerUsername()); addParam.setCustomerUserName(insurancePre.getCustomerUsername());
addParam.setIsExit(sameFlag);
addParamList.add(addParam); addParamList.add(addParam);
} }
if (CommonConstants.THREE_INT == insurancePre.getBuyType()) { if (CommonConstants.THREE_INT == insurancePre.getBuyType()) {
...@@ -229,6 +230,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -229,6 +230,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
addParam.setCustomerUserName(insurancePre.getCustomerUsername()); addParam.setCustomerUserName(insurancePre.getCustomerUsername());
addParam.setPolicyStart(LocalDateUtil.parseLocalDate(DateUtil.dateToString(insurancePre.getPolicyStart(),DateUtil.ISO_EXPANDED_DATE_FORMAT))); addParam.setPolicyStart(LocalDateUtil.parseLocalDate(DateUtil.dateToString(insurancePre.getPolicyStart(),DateUtil.ISO_EXPANDED_DATE_FORMAT)));
addParam.setPolicyEnd(LocalDateUtil.parseLocalDate(DateUtil.dateToString(insurancePre.getPolicyEnd(),DateUtil.ISO_EXPANDED_DATE_FORMAT))); addParam.setPolicyEnd(LocalDateUtil.parseLocalDate(DateUtil.dateToString(insurancePre.getPolicyEnd(),DateUtil.ISO_EXPANDED_DATE_FORMAT)));
addParam.setIsExit(sameFlag);
batchAddParamList.add(addParam); batchAddParamList.add(addParam);
} }
if (CommonConstants.FOUR_INT == insurancePre.getBuyType()) { if (CommonConstants.FOUR_INT == insurancePre.getBuyType()) {
...@@ -248,6 +250,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -248,6 +250,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
addParam.setRemark(CommonConstants.EMPTY_STRING); addParam.setRemark(CommonConstants.EMPTY_STRING);
addParam.setInsurancePreId(insurancePre.getId()); addParam.setInsurancePreId(insurancePre.getId());
addParam.setCustomerUserName(insurancePre.getCustomerUsername()); addParam.setCustomerUserName(insurancePre.getCustomerUsername());
addParam.setIsExit(sameFlag);
replaceAddParamList.add(addParam); replaceAddParamList.add(addParam);
} }
} }
...@@ -433,7 +436,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -433,7 +436,7 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
.set(TEmployeeInsurancePre::getProcessStatus, CommonConstants.ONE_STRING); .set(TEmployeeInsurancePre::getProcessStatus, CommonConstants.ONE_STRING);
this.update(updateWrapper); this.update(updateWrapper);
try { try {
this.batchDispatcherInsurance(unConfirmList); this.batchDispatcherInsurance(unConfirmList,CommonConstants.ONE_STRING);
} catch (Exception e) { } catch (Exception e) {
log.error("执行异常", e); log.error("执行异常", e);
} }
...@@ -495,6 +498,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -495,6 +498,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setErrorMessage(addParam.getErrorMessage()); autoParam.setErrorMessage(addParam.getErrorMessage());
autoParam.setInsurancePreId(addParam.getInsurancePreId()); autoParam.setInsurancePreId(addParam.getInsurancePreId());
autoParam.setCustomerUserName(addParam.getCustomerUserName()); autoParam.setCustomerUserName(addParam.getCustomerUserName());
autoParam.setIsExit(addParam.getIsExit());
autoParam.setInProgressList(addParam.getInProgressList());
return autoParam; return autoParam;
} }
...@@ -516,6 +521,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -516,6 +521,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setErrorMessage(batchParam.getErrorMessage()); autoParam.setErrorMessage(batchParam.getErrorMessage());
autoParam.setInsurancePreId(batchParam.getInsurancePreId()); autoParam.setInsurancePreId(batchParam.getInsurancePreId());
autoParam.setCustomerUserName(batchParam.getCustomerUserName()); autoParam.setCustomerUserName(batchParam.getCustomerUserName());
autoParam.setIsExit(batchParam.getIsExit());
autoParam.setInProgressList(batchParam.getInProgressList());
return autoParam; return autoParam;
} }
...@@ -537,6 +544,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -537,6 +544,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
autoParam.setErrorMessage(replaceParam.getErrorMessage()); autoParam.setErrorMessage(replaceParam.getErrorMessage());
autoParam.setInsurancePreId(replaceParam.getInsurancePreId()); autoParam.setInsurancePreId(replaceParam.getInsurancePreId());
autoParam.setCustomerUserName(replaceParam.getCustomerUserName()); autoParam.setCustomerUserName(replaceParam.getCustomerUserName());
autoParam.setIsExit(replaceParam.getIsExit());
autoParam.setInProgressList(replaceParam.getInProgressList());
return autoParam; return autoParam;
} }
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsurancePreDetailMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsurancePreDetailService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* 入职确认信息已购买商险明细
*
* @author huych
* @date 2025-08-05 15:08:42
*/
@Log4j2
@Service
public class TInsurancePreDetailServiceImpl extends ServiceImpl<TInsurancePreDetailMapper, TInsurancePreDetail> implements TInsurancePreDetailService {
}
...@@ -593,6 +593,36 @@ ...@@ -593,6 +593,36 @@
</foreach> </foreach>
</update> </update>
<!-- 派单人员系统已有参保明细查询-->
<select id="getOnProcessInsuredList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
select
a.id as id,
a.EMP_NAME as empName,
a.EMP_IDCARD_NO as empIdcardNo,
a.BUY_TYPE as buyType,
a.DEPT_NO as deptNo,
a.DEPT_NAME as projectName,
a.POST as post,
a.POLICY_START as policyStart,
a.POLICY_END as policyEnd,
a.POLICY_EFFECT as policyEffect,
a.INSURANCE_COMPANY_NAME as insuranceCompanyName,
a.INSURANCE_TYPE_NAME as insuranceTypeName,
a.BUY_STANDARD as buyStandard,
a.BUY_HANDLE_STATUS as buyHandleStatus,
a.CREATE_TIME as createTime,
a.CREATE_NAME as createName,
a.UNIT_NAME as unitName,
a.UNIT_NO as unitNo,
a.IS_ADRESS as isAdress
from
t_insurance_detail a
where
a.DELETE_FLAG = 0
and (a.BUY_HANDLE_STATUS = 2 or (a.BUY_HANDLE_STATUS = 3 and a.isEffect = 0 and a.isOverdue = 0))
AND EMP_IDCARD_NO = #{empIdCard}
</select>
<!-- ***********************减员办理******************************** --> <!-- ***********************减员办理******************************** -->
<!-- 已投保列表分页查询--> <!-- 已投保列表分页查询-->
<select id="getInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo"> <select id="getInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredListVo">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TInsurancePreDetailMapper">
<resultMap id="tInsurancePreDetailMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail">
<id property="id" column="ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcardNo" column="EMP_IDCARD_NO"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="post" column="POST"/>
<result property="insuranceCompanyName" column="INSURANCE_COMPANY_NAME"/>
<result property="insuranceTypeName" column="INSURANCE_TYPE_NAME"/>
<result property="buyStandard" column="BUY_STANDARD"/>
<result property="policyStart" column="POLICY_START"/>
<result property="policyEnd" column="POLICY_END"/>
<result property="policyEffect" column="POLICY_EFFECT"/>
<result property="buyType" column="BUY_TYPE"/>
<result property="buyHandleStatus" column="BUY_HANDLE_STATUS"/>
<result property="createBy" column="CREATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="deptName" column="DEPT_NAME"/>
<result property="unitName" column="UNIT_NAME"/>
<result property="unitNo" column="UNIT_NO"/>
<result property="isAdress" column="IS_ADRESS"/>
<result property="registerId" column="REGISTER_ID"/>
</resultMap>
</mapper>
...@@ -65,7 +65,7 @@ public class TSocialFriendBackLog { ...@@ -65,7 +65,7 @@ public class TSocialFriendBackLog {
/** /**
* @Description: 类型1社保增 2社保减 3医保增 4医保减 5推送的日志 6社保图片路径7医保图片路径 * @Description: 类型1社保增 2社保减 3医保增 4医保减 5推送的日志 6社保图片路径7医保图片路径
* 8社保解除劳动合同9医保解除劳动合同11社保增拉取 12社保减拉取 13医保增拉取 14医保减拉取16社保单个图片17医保单个图片 * 8社保解除劳动合同9医保解除劳动合同11社保增拉取 12社保减拉取 13医保增拉取 14医保减拉取16社保单个图片17医保单个图片 18 反馈附件下载
* @Author: hgw * @Author: hgw
* @Date: 2025/5/27 10:15 * @Date: 2025/5/27 10:15
**/ **/
...@@ -89,4 +89,13 @@ public class TSocialFriendBackLog { ...@@ -89,4 +89,13 @@ public class TSocialFriendBackLog {
@Schema(description = "创建时间") @Schema(description = "创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
/**
* 任务状态
*/
@ExcelAttribute(name = "任务状态")
@ExcelProperty("任务状态")
@Schema(description = "任务状态")
private String status;
} }
...@@ -75,4 +75,15 @@ public class SocialSoldierBackVo implements Serializable { ...@@ -75,4 +75,15 @@ public class SocialSoldierBackVo implements Serializable {
private String socialHouseholdName; private String socialHouseholdName;
/**
* 请求ID
*/
@ExcelAttribute(name = "请求ID", needExport = true)
@Schema(description = "请求ID")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("请求ID")
private String requestId;
} }
...@@ -11,10 +11,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil; ...@@ -11,10 +11,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendBackLog; import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialFriendBackLog;
import com.yifu.cloud.plus.v1.yifu.social.vo.FriendResult; import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import com.yifu.cloud.plus.v1.yifu.social.vo.SociaFriendYgsAddVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierBackVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierExportVo;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -777,7 +774,6 @@ public class SocialFriendConfig { ...@@ -777,7 +774,6 @@ public class SocialFriendConfig {
public HashMap<String, String> getDownloadEmployeeAsync(RestTemplate restTemplate, SysHouseHoldInfo houseHold, public HashMap<String, String> getDownloadEmployeeAsync(RestTemplate restTemplate, SysHouseHoldInfo houseHold,
SocialSoldierBackVo backVo) { SocialSoldierBackVo backVo) {
HashMap<String, String> result = new HashMap<>(); HashMap<String, String> result = new HashMap<>();
try { try {
// 构建请求头 // 构建请求头
HttpHeaders headers = buildCommonHeaders(null); HttpHeaders headers = buildCommonHeaders(null);
...@@ -797,9 +793,6 @@ public class SocialFriendConfig { ...@@ -797,9 +793,6 @@ public class SocialFriendConfig {
if ("Y".equals(head.getString("status"))) { if ("Y".equals(head.getString("status"))) {
String requestId = JSON.parseObject(response.getString("body")).getString("requestId"); String requestId = JSON.parseObject(response.getString("body")).getString("requestId");
result.put(backVo.getSocialId(), requestId); result.put(backVo.getSocialId(), requestId);
/*if (Common.isNotNull(requestId)) {
urls.addAll(getDownloadFeedbackUrls(restTemplate, requestId));
}*/
} }
} }
...@@ -834,11 +827,7 @@ public class SocialFriendConfig { ...@@ -834,11 +827,7 @@ public class SocialFriendConfig {
private JSONObject buildDownloadRequestJson(SysHouseHoldInfo vo, SocialSoldierBackVo exportVo) { private JSONObject buildDownloadRequestJson(SysHouseHoldInfo vo, SocialSoldierBackVo exportVo) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
/*json.put("bizNo", "211429621163811844098020250715-172343"); json.put("bizNo", exportVo.getSocialId() + DateUtil.getThisTime());
json.put("qymc", "安徽皖信人力资源管理有限公司0");
json.put("nsrsbh", "91340152570242449C");
json.put("areaid", "340100");*/
json.put("bizNo", exportVo.getSocialId());
json.put("qymc", vo.getName()); json.put("qymc", vo.getName());
json.put("nsrsbh", vo.getUnitCreditCode()); json.put("nsrsbh", vo.getUnitCreditCode());
json.put("areaid", vo.getAreaCode()); json.put("areaid", vo.getAreaCode());
...@@ -877,18 +866,26 @@ public class SocialFriendConfig { ...@@ -877,18 +866,26 @@ public class SocialFriendConfig {
} }
// 获取反馈 URL 列表 // 获取反馈 URL 列表
public List<String> getDownloadFeedbackUrls(RestTemplate restTemplate, String requestId) { public FeedBackUrlVo getDownloadFeedbackUrls(RestTemplate restTemplate, String requestId, List<TSocialFriendBackLog> backLogList, String socialId) {
FeedBackUrlVo result = new FeedBackUrlVo();
List<String> urls = new ArrayList<>(); List<String> urls = new ArrayList<>();
if (null == backLogList){
backLogList = new ArrayList<>();
}
String downloadEmployeeFeedbackUrl = urlPre + urlDownloadEmployeeFeedback + "?requestId=" + requestId; String downloadEmployeeFeedbackUrl = urlPre + urlDownloadEmployeeFeedback + "?requestId=" + requestId;
int retryCount = 0; int retryCount = 0;
final int maxRetries = 2; final int maxRetries = 4;
final long delayMillis = 2000; // 2 seconds final long delayMillis = 2000; // 2 seconds
TSocialFriendBackLog backLog;
JSONObject dataObject = null;
String msg = "";
String zt= "0";
try { try {
// 构建请求头 // 构建请求头
HttpHeaders headers = buildCommonHeaders(requestId); HttpHeaders headers = buildCommonHeaders(requestId);
// 构建请求体 // 构建请求体
HttpEntity<String> formEntity = new HttpEntity<>(headers); HttpEntity<String> formEntity = new HttpEntity<>(headers);
//具体的项目办理状态:1-处理中,2-处理成功,3-处理失败 如果是处理中继续重试2次,处理成功则返回反馈URL
while (retryCount <= maxRetries) { while (retryCount <= maxRetries) {
ResponseEntity<String> response = restTemplate.exchange( ResponseEntity<String> response = restTemplate.exchange(
...@@ -896,13 +893,16 @@ public class SocialFriendConfig { ...@@ -896,13 +893,16 @@ public class SocialFriendConfig {
// 处理返回值 // 处理返回值
if (response != null && response.getStatusCodeValue() == 200) { if (response != null && response.getStatusCodeValue() == 200) {
JSONObject dataObject = JSON.parseObject(response.getBody()); dataObject = JSON.parseObject(response.getBody());
String head = dataObject.getString("head"); String head = dataObject.getString("head");
if (Common.isNotNull(head)) { if (Common.isNotNull(head)) {
JSONObject headObject = JSON.parseObject(head); JSONObject headObject = JSON.parseObject(head);
if ("Y".equals(headObject.getString("status"))) { if ("Y".equals(headObject.getString("status"))) {
JSONObject bodyObject = JSON.parseObject(dataObject.getString("body")); JSONObject bodyObject = JSON.parseObject(dataObject.getString("body"));
//1:处理中 2:成功 3:失败
zt = bodyObject.getString("zt");
if ("2".equals(zt)){
String ryywbljglb = bodyObject.getString("ryywbljglb"); String ryywbljglb = bodyObject.getString("ryywbljglb");
JSONArray ryywbljglbArr = JSON.parseArray(ryywbljglb); JSONArray ryywbljglbArr = JSON.parseArray(ryywbljglb);
if (ryywbljglbArr != null && !ryywbljglbArr.isEmpty()){ if (ryywbljglbArr != null && !ryywbljglbArr.isEmpty()){
...@@ -912,6 +912,9 @@ public class SocialFriendConfig { ...@@ -912,6 +912,9 @@ public class SocialFriendConfig {
if (blxmjglbArr != null && !blxmjglbArr.isEmpty()){ if (blxmjglbArr != null && !blxmjglbArr.isEmpty()){
for (Object blxmjglbObj : blxmjglbArr) { for (Object blxmjglbObj : blxmjglbArr) {
JSONObject blxmjglbItem = (JSONObject) blxmjglbObj; JSONObject blxmjglbItem = (JSONObject) blxmjglbObj;
//具体的项目办理状态:1-处理中,2-处理成功,3-处理失败
zt = blxmjglbItem.getString("zt");
if ("2".equals(zt)){
JSONArray jgmxlbArr = JSON.parseArray(blxmjglbItem.getString("jgmxlb")); JSONArray jgmxlbArr = JSON.parseArray(blxmjglbItem.getString("jgmxlb"));
if (jgmxlbArr != null && !jgmxlbArr.isEmpty()){ if (jgmxlbArr != null && !jgmxlbArr.isEmpty()){
for (Object jgmxlbObj : jgmxlbArr) { for (Object jgmxlbObj : jgmxlbArr) {
...@@ -923,12 +926,19 @@ public class SocialFriendConfig { ...@@ -923,12 +926,19 @@ public class SocialFriendConfig {
} }
} }
} }
}else {
msg = bodyObject.getString("cwxx");
}
}
} }
} }
} }
}else {
msg = bodyObject.getString("cwxx");
} }
} }
} }
// 先记录每次的反馈请求
} }
// 如果成功获取到数据,则跳出循环 // 如果成功获取到数据,则跳出循环
...@@ -936,9 +946,9 @@ public class SocialFriendConfig { ...@@ -936,9 +946,9 @@ public class SocialFriendConfig {
break; break;
} }
// 如果没有获取到数据,等待一段时间后重试 // 如果没有获取到数据,等待一段时间后重试 (处理中重试)
if (retryCount < maxRetries) { if (retryCount < maxRetries && zt.equals("1")) {
Thread.sleep(delayMillis); Thread.sleep(delayMillis*retryCount);
retryCount++; retryCount++;
} else { } else {
break; break;
...@@ -947,8 +957,19 @@ public class SocialFriendConfig { ...@@ -947,8 +957,19 @@ public class SocialFriendConfig {
} catch (Exception e) { } catch (Exception e) {
log.error("获取税友人员审核查询证明文件反馈链接失败", e); log.error("获取税友人员审核查询证明文件反馈链接失败", e);
} }
backLog = new TSocialFriendBackLog();
return urls; backLog.setId(socialId);
backLog.setRequestId(requestId);
backLog.setSocialId(socialId);
backLog.setStatus(zt);
backLog.setType(18);
backLog.setLogInfo(null==dataObject?"":dataObject.toJSONString());
backLog.setCreateTime(LocalDateTime.now());
backLogList.add(backLog);
result.setUrls(urls);
result.setRequestId(requestId);
result.setMsg(msg);
return result;
} }
......
...@@ -171,6 +171,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -171,6 +171,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private final RestTemplate restTemplate; private final RestTemplate restTemplate;
private final SocialFriendConfig socialFriendConfig; private final SocialFriendConfig socialFriendConfig;
@Autowired
private TSocialFriendBackLogService socialFriendBackLogService;
/** /**
* 派单信息记录表简单分页查询 * 派单信息记录表简单分页查询
* *
...@@ -8442,7 +8445,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -8442,7 +8445,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
list = baseMapper.getSocialSoldierAllListBackFile(searchVo, Common.getList(idStr)); list = baseMapper.getSocialSoldierAllListBackFile(searchVo, Common.getList(idStr));
} }
// 收集所有需要下载的 URL // 收集所有需要下载的 URL
Map<String, List<String>> urlMap = new HashMap<>(); Map<String, FeedBackUrlVo> urlMap = new HashMap<>();
Map<String, SocialSoldierBackVo> socialMap = new HashMap<>(); Map<String, SocialSoldierBackVo> socialMap = new HashMap<>();
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
// 获取社保户信息 // 获取社保户信息
...@@ -8456,6 +8459,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -8456,6 +8459,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
HashMap<String,String> requestIdMap = new HashMap<>(); HashMap<String,String> requestIdMap = new HashMap<>();
// 获取URL前先获取下载反馈的requestId // 获取URL前先获取下载反馈的requestId
for (SocialSoldierBackVo item : list) { for (SocialSoldierBackVo item : list) {
//查询到24内有处理中或请求成功的数据直接用历史数据区请求
if (StringUtils.isNotBlank(item.getRequestId())){
requestIdMap.put(item.getSocialId(),item.getRequestId());
continue;
}
String householdName = item.getSocialHouseholdName(); String householdName = item.getSocialHouseholdName();
if (StringUtils.isNotBlank(householdName)) { if (StringUtils.isNotBlank(householdName)) {
SysHouseHoldInfo holdInfo = holdInfoMap.get(householdName); SysHouseHoldInfo holdInfo = holdInfoMap.get(householdName);
...@@ -8468,11 +8476,18 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -8468,11 +8476,18 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (CollectionUtils.isNotEmpty(requestIdMap)) { if (CollectionUtils.isNotEmpty(requestIdMap)) {
// 循环 requestIdMap // 循环 requestIdMap
List<String> urls; List<String> urls;
//请求反馈日志
List<TSocialFriendBackLog> backLogList = new ArrayList<>();
FeedBackUrlVo backUrlVo = null;
for (Map.Entry<String, String> entry : requestIdMap.entrySet()){ for (Map.Entry<String, String> entry : requestIdMap.entrySet()){
urls =socialFriendConfig.getDownloadFeedbackUrls(restTemplate,entry.getValue()); backUrlVo =socialFriendConfig.getDownloadFeedbackUrls(restTemplate,entry.getValue(),backLogList,entry.getKey());
if (!CollectionUtils.isEmpty(urls)){ if (Common.isNotNull(backUrlVo)){
urlMap.put(entry.getKey(), urls); urlMap.put(entry.getKey(), backUrlVo);
}
} }
// 记录反馈文件下载失败信息
if (Common.isNotNull(backLogList)){
socialFriendBackLogService.saveOrUpdateBatch(backLogList);
} }
} }
if (CollectionUtils.isEmpty(urlMap)){ if (CollectionUtils.isEmpty(urlMap)){
...@@ -8496,9 +8511,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -8496,9 +8511,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
SocialSoldierBackVo socialVo; SocialSoldierBackVo socialVo;
List<String> urlList; List<String> urlList;
HttpGet httpGet; HttpGet httpGet;
for (Map.Entry<String, List<String>> entry : urlMap.entrySet()) { FeedBackUrlVo backUrlVo = null;
for (Map.Entry<String, FeedBackUrlVo> entry : urlMap.entrySet()) {
String socialId = entry.getKey(); String socialId = entry.getKey();
urlList = entry.getValue(); backUrlVo = entry.getValue();
if (null == backUrlVo)continue;
urlList = backUrlVo.getUrls();
if (CollectionUtils.isEmpty(urlList)) continue; if (CollectionUtils.isEmpty(urlList)) continue;
socialVo = socialMap.get(socialId); socialVo = socialMap.get(socialId);
...@@ -8544,14 +8562,16 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -8544,14 +8562,16 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
} }
private void updateBackFileFlage(Map<String, SocialSoldierBackVo> socialMap, Map<String, List<String>> urlMap) { private void updateBackFileFlage(Map<String, SocialSoldierBackVo> socialMap, Map<String, FeedBackUrlVo> urlMap) {
if (null != urlMap && !urlMap.isEmpty()){ if (null != urlMap && !urlMap.isEmpty()){
SocialSoldierBackVo socialVo; SocialSoldierBackVo socialVo;
List<String> dispatchIds = new ArrayList<>(); List<String> dispatchIds = new ArrayList<>();
for (Map.Entry<String, List<String>> entry : urlMap.entrySet()) { FeedBackUrlVo backUrlVo = null;
for (Map.Entry<String, FeedBackUrlVo> entry : urlMap.entrySet()) {
String socialId = entry.getKey(); String socialId = entry.getKey();
socialVo = socialMap.get(socialId); socialVo = socialMap.get(socialId);
if (null != socialVo && null != entry.getValue() && !entry.getValue().isEmpty()) { backUrlVo = entry.getValue();
if (null != socialVo && null != backUrlVo && !backUrlVo.getUrls().isEmpty()) {
dispatchIds.add(socialVo.getDispatchId()); dispatchIds.add(socialVo.getDispatchId());
} }
} }
...@@ -8603,6 +8623,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -8603,6 +8623,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
HashMap<String,String> requestIdMap = new HashMap<>(); HashMap<String,String> requestIdMap = new HashMap<>();
// 获取URL前先获取下载反馈的requestId // 获取URL前先获取下载反馈的requestId
for (SocialSoldierBackVo item : list) { for (SocialSoldierBackVo item : list) {
//查询到24内有处理中或请求成功的数据直接用历史数据区请求
if (StringUtils.isNotBlank(item.getRequestId())){
requestIdMap.put(item.getSocialId(),item.getRequestId());
continue;
}
String householdName = item.getSocialHouseholdName(); String householdName = item.getSocialHouseholdName();
if (StringUtils.isNotBlank(householdName)) { if (StringUtils.isNotBlank(householdName)) {
SysHouseHoldInfo holdInfo = holdInfoMap.get(householdName); SysHouseHoldInfo holdInfo = holdInfoMap.get(householdName);
...@@ -8613,8 +8638,16 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -8613,8 +8638,16 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
// 通过requestId 获取反馈的URL 因为对方是异步请求 // 通过requestId 获取反馈的URL 因为对方是异步请求
List<String> urls = null; List<String> urls = null;
//请求反馈日志
List<TSocialFriendBackLog> backLogList = new ArrayList<>();
FeedBackUrlVo backUrlVo = null;
if (CollectionUtils.isNotEmpty(requestIdMap)) { if (CollectionUtils.isNotEmpty(requestIdMap)) {
urls = socialFriendConfig.getDownloadFeedbackUrls(restTemplate,requestIdMap.get(list.get(0).getSocialId())); backUrlVo = socialFriendConfig.getDownloadFeedbackUrls(restTemplate,requestIdMap.get(list.get(0).getSocialId()),backLogList,list.get(0).getSocialId());
urls = null==backUrlVo?null:backUrlVo.getUrls();
}
// 记录反馈文件下载失败信息
if (Common.isNotNull(backLogList)){
socialFriendBackLogService.saveOrUpdateBatch(backLogList);
} }
if (Common.isNotNull(urls)){ if (Common.isNotNull(urls)){
// 更新反馈文件状态 // 更新反馈文件状态
...@@ -8623,6 +8656,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -8623,6 +8656,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
baseMapper.updateBackFileFlag(dispatchIds); baseMapper.updateBackFileFlag(dispatchIds);
return R.ok(urls.get(0)); return R.ok(urls.get(0));
} }
if (Common.isNotNull(backUrlVo) && Common.isNotNull(backUrlVo.getMsg())){
return R.failed("下载失败:"+backUrlVo.getMsg() +" (requestId:"+backUrlVo.getRequestId()+")");
}
} }
return R.failed("未找到反馈文件"); return R.failed("未找到反馈文件");
} }
......
package com.yifu.cloud.plus.v1.yifu.social.vo;
import lombok.Data;
import java.util.List;
/**
* @Author fxj
* @Date 2025/8/5
* @Description
* @Version 1.0
*/
@Data
public class FeedBackUrlVo {
//反馈文件数组
private List<String> urls;
private String requestId;
private String msg;
}
...@@ -365,6 +365,8 @@ ...@@ -365,6 +365,8 @@
<result property="ygsHandleStatus" column="ygs_Handle_Status"/> <result property="ygsHandleStatus" column="ygs_Handle_Status"/>
<result property="ysdHandleStatus" column="ysd_Handle_Status"/> <result property="ysdHandleStatus" column="ysd_Handle_Status"/>
<result property="socialHouseholdName" column="SOCIAL_HOUSEHOLD_NAME"/> <result property="socialHouseholdName" column="SOCIAL_HOUSEHOLD_NAME"/>
<result property="requestId" column="REQUEST_ID"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.ID, a.ID,
...@@ -2855,9 +2857,10 @@ ...@@ -2855,9 +2857,10 @@
a.EMP_IDCARD a.EMP_IDCARD
,s.ygs_Handle_Status ,s.ygs_Handle_Status
,s.ysd_Handle_Status ,s.ysd_Handle_Status
,a.SOCIAL_HOUSEHOLD_NAME ,a.SOCIAL_HOUSEHOLD_NAME,c.REQUEST_ID
FROM t_dispatch_info a FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id left join t_social_info s on a.SOCIAL_ID = s.id
LEFT JOIN (SELECT b.id,b.REQUEST_ID from t_social_friend_back_log b WHERE b.TYPE='18' and b.`STATUS` in ('1','2') and b.CREATE_TIME > DATE_SUB(NOW(), INTERVAL 24 HOUR)) c ON c.id=a.SOCIAL_ID
<where> <where>
a.DELETE_FLAG = '0' a.DELETE_FLAG = '0'
AND a.social_id is not null AND a.social_id is not null
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
<result property="logInfo" column="LOG_INFO"/> <result property="logInfo" column="LOG_INFO"/>
<result property="type" column="TYPE"/> <result property="type" column="TYPE"/>
<result property="createTime" column="CREATE_TIME"/> <result property="createTime" column="CREATE_TIME"/>
<result property="status" column="STATUS"/>
</resultMap> </resultMap>
</mapper> </mapper>
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