Commit 7b10b7d8 authored by hongguangwu's avatar hongguangwu

MVP1.7.14-商险相关

parent 35a3b57a
...@@ -147,6 +147,12 @@ public class TEmployeeInsurancePre extends BaseEntity { ...@@ -147,6 +147,12 @@ public class TEmployeeInsurancePre extends BaseEntity {
@Schema(description = "商险ID") @Schema(description = "商险ID")
private String insurancesId; private String insurancesId;
@Schema(description = "发起失败原因")
private String errorInfo;
@Schema(description = "发起失败时间")
private LocalDateTime errorTime;
@TableField(exist = false) @TableField(exist = false)
@Schema(description = "修改类型:1新增;2修改;3删除;4状态346为不可编辑") @Schema(description = "修改类型:1新增;2修改;3删除;4状态346为不可编辑")
private String modelType; private String modelType;
......
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
* 商险定时失败的企微
*
* @author hgw
* @date 2025-08-07 17:49:14
*/
@Data
@TableName("t_employee_insurance_pre_qw")
@Schema(description = "商险定时失败的企微")
public class TEmployeeInsurancePreQw {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
/**
* 前端客服
*/
@ExcelAttribute(name = "前端客服", maxLength = 30)
@Length(max = 30, message = "前端客服不能超过30个字符")
@ExcelProperty("前端客服")
@Schema(description = "前端客服")
private String customerUsername;
/**
* 前端客服登录名
*/
@ExcelAttribute(name = "前端客服登录名", isNotEmpty = true, errorInfo = "前端客服登录名不能为空", maxLength = 30)
@NotBlank(message = "前端客服登录名不能为空")
@Length(max = 30, message = "前端客服登录名不能超过30个字符")
@ExcelProperty("前端客服登录名")
@Schema(description = "前端客服登录名")
private String customerUserLoginname;
/**
* 内容
*/
@ExcelAttribute(name = "内容", isNotEmpty = true, errorInfo = "内容不能为空", maxLength = 200)
@NotBlank(message = "内容不能为空")
@Length(max = 200, message = "内容不能超过200个字符")
@ExcelProperty("内容")
@Schema(description = "内容")
private String description;
/**
* 创建时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间")
@TableField(fill = FieldFill.INSERT)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("创建时间")
@ColumnWidth(18)
private LocalDateTime createTime;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
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 io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
* 商险定时失败的企微的详情
*
* @author hgw
* @date 2025-08-07 17:49:14
*/
@Data
@TableName("t_employee_insurance_pre_qw_detail")
@Schema(description = "商险定时失败的企微的详情")
public class TEmployeeInsurancePreQwDetail {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
/**
* 关联主键(t_employee_insurance_pre_qw表的ID)
*/
@ExcelAttribute(name = "关联主键(t_employee_insurance_pre_qw表的ID)", isNotEmpty = true, errorInfo = "关联主键(t_employee_insurance_pre_qw表的ID)不能为空", maxLength = 36)
@NotBlank(message = "关联主键(t_employee_insurance_pre_qw表的ID)不能为空")
@Length(max = 36, message = "关联主键(t_employee_insurance_pre_qw表的ID)不能超过36个字符")
@ExcelProperty("关联主键(t_employee_insurance_pre_qw表的ID)")
@Schema(description = "关联主键(t_employee_insurance_pre_qw表的ID)")
private String mainId;
/**
* 姓名
*/
@ExcelAttribute(name = "姓名", maxLength = 30)
@Length(max = 30, message = "姓名不能超过30个字符")
@ExcelProperty("姓名")
@Schema(description = "姓名")
private String empName;
/**
* 身份证
*/
@ExcelAttribute(name = "身份证", maxLength = 18)
@Length(max = 18, message = "身份证不能超过18个字符")
@ExcelProperty("身份证")
@Schema(description = "身份证")
private String empIdcard;
/**
* 失败原因
*/
@ExcelAttribute(name = "失败原因", maxLength = 200)
@Length(max = 200, message = "失败原因不能超过200个字符")
@ExcelProperty("失败原因")
@Schema(description = "失败原因")
private String errorInfo;
/**
* 失败时间
*/
@ExcelAttribute(name = "失败时间", isDate = true)
@ExcelProperty("失败时间")
@Schema(description = "失败时间")
private LocalDateTime errorTime;
/**
* 商险待派单ID(t_employee_insurance_pre的ID)
*/
@ExcelAttribute(name = "商险待派单ID(t_employee_insurance_pre的ID)", maxLength = 36)
@Length(max = 36, message = "商险待派单ID(t_employee_insurance_pre的ID)不能超过36个字符")
@ExcelProperty("商险待派单ID(t_employee_insurance_pre的ID)")
@Schema(description = "商险待派单ID(t_employee_insurance_pre的ID)")
private String preId;
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePreQwDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreQwDetailService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 商险定时失败的企微
*
* @author hgw
* @date 2025-08-07 17:49:14
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/temployeeinsurancepreqwdetail")
@Tag(name = "商险定时失败的企微管理")
public class TEmployeeInsurancePreQwDetailController {
private final TEmployeeInsurancePreQwDetailService tEmployeeInsurancePreQwDetailService;
/**
* 简单分页查询
*
* @param page 分页对象
* @param tEmployeeInsurancePreQwDetail 商险定时失败的企微
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TEmployeeInsurancePreQwDetail>> getTEmployeeInsurancePreQwDetailPage(Page<TEmployeeInsurancePreQwDetail> page, TEmployeeInsurancePreQwDetail tEmployeeInsurancePreQwDetail) {
return new R<>(tEmployeeInsurancePreQwDetailService.getTEmployeeInsurancePreQwDetailPage(page, tEmployeeInsurancePreQwDetail));
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePreQwDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 商险定时失败的企微
*
* @author hgw
* @date 2025-08-07 17:49:14
*/
@Mapper
public interface TEmployeeInsurancePreQwDetailMapper extends BaseMapper<TEmployeeInsurancePreQwDetail> {
/**
* 商险定时失败的企微简单分页查询
*
* @param tEmployeeInsurancePreQwDetail 商险定时失败的企微
* @return
*/
IPage<TEmployeeInsurancePreQwDetail> getTEmployeeInsurancePreQwDetailPage(Page<TEmployeeInsurancePreQwDetail> page
, @Param("tEmployeeInsurancePreQwDetail") TEmployeeInsurancePreQwDetail tEmployeeInsurancePreQwDetail);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
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.TEmployeeInsurancePreQw;
import org.apache.ibatis.annotations.Mapper;
/**
* 商险定时失败的企微
*
* @author hgw
* @date 2025-08-07 17:49:14
*/
@Mapper
public interface TEmployeeInsurancePreQwMapper extends BaseMapper<TEmployeeInsurancePreQw> {
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePreQwDetail;
/**
* 商险定时失败的企微
*
* @author hgw
* @date 2025-08-07 17:49:14
*/
public interface TEmployeeInsurancePreQwDetailService extends IService<TEmployeeInsurancePreQwDetail> {
/**
* 商险定时失败的企微简单分页查询
*
* @param tEmployeeInsurancePreQwDetail 商险定时失败的企微
* @return
*/
IPage<TEmployeeInsurancePreQwDetail> getTEmployeeInsurancePreQwDetailPage(Page<TEmployeeInsurancePreQwDetail> page, TEmployeeInsurancePreQwDetail tEmployeeInsurancePreQwDetail);
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
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.TEmployeeInsurancePreQw;
/**
* 商险定时失败的企微
*
* @author hgw
* @date 2025-08-07 17:49:14
*/
public interface TEmployeeInsurancePreQwService extends IService<TEmployeeInsurancePreQw> {
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
package com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePreQwDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsurancePreQwDetailMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreQwDetailService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* 商险定时失败的企微
*
* @author hgw
* @date 2025-08-07 17:49:14
*/
@Log4j2
@Service
public class TEmployeeInsurancePreQwDetailServiceImpl extends ServiceImpl<TEmployeeInsurancePreQwDetailMapper, TEmployeeInsurancePreQwDetail> implements TEmployeeInsurancePreQwDetailService {
/**
* 商险定时失败的企微简单分页查询
*
* @param tEmployeeInsurancePreQwDetail 商险定时失败的企微
* @return
*/
@Override
public IPage<TEmployeeInsurancePreQwDetail> getTEmployeeInsurancePreQwDetailPage(Page<TEmployeeInsurancePreQwDetail> page, TEmployeeInsurancePreQwDetail tEmployeeInsurancePreQwDetail) {
return baseMapper.getTEmployeeInsurancePreQwDetailPage(page, tEmployeeInsurancePreQwDetail);
}
}
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the yifu4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/
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.TEmployeeInsurancePreQw;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsurancePreQwMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreQwService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* 商险定时失败的企微
*
* @author hgw
* @date 2025-08-07 17:49:14
*/
@Log4j2
@Service
public class TEmployeeInsurancePreQwServiceImpl extends ServiceImpl<TEmployeeInsurancePreQwMapper, TEmployeeInsurancePreQw> implements TEmployeeInsurancePreQwService {
}
...@@ -10,6 +10,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -10,6 +10,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.csp.vo.EmployeeRegistrationCustomerUserUpdateVo; 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.archives.entity.TSettleDomain;
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;
...@@ -24,13 +26,9 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.ArchivesDaprUtil; ...@@ -24,13 +26,9 @@ 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.config.WxConfig; import com.yifu.cloud.plus.v1.yifu.insurances.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePre; import com.yifu.cloud.plus.v1.yifu.insurances.entity.*;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsurancePreDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsurancePreMapper; import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsurancePreMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreService; import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.*;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsurancePreDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil; import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*; import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -45,6 +43,7 @@ import org.springframework.web.client.RestTemplate; ...@@ -45,6 +43,7 @@ import org.springframework.web.client.RestTemplate;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
...@@ -80,6 +79,11 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -80,6 +79,11 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
@Autowired @Autowired
private TInsurancePreDetailService preDetailService; private TInsurancePreDetailService preDetailService;
@Autowired
private TEmployeeInsurancePreQwService tEmployeeInsurancePreQwService;
@Autowired
private TEmployeeInsurancePreQwDetailService tEmployeeInsurancePreQwDetailService;
/** /**
* 商险待办任务表简单分页查询 * 商险待办任务表简单分页查询
* *
...@@ -297,12 +301,175 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -297,12 +301,175 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
this.update(updateWrapper); this.update(updateWrapper);
} else { } else {
// 将 autoAddParamList 中的id等信息提取出来,放入一个 Set 中 // 将 autoAddParamList 中的id等信息提取出来,放入一个 Set 中
Set<String> autoAddParamSet = autoAddParamList.stream() Set<String> autoAddParamSet = new HashSet<>();
/*= autoAddParamList.stream()
.map(InsuranceAutoParam::getInsurancePreId) .map(InsuranceAutoParam::getInsurancePreId)
.collect(Collectors.toSet()); .collect(Collectors.toSet());*/
Map<String, String> errorMessageMap = new HashMap<>();
for (InsuranceAutoParam info : autoAddParamList) {
autoAddParamSet.add(info.getInsurancePreId());
errorMessageMap.put(info.getInsurancePreId(), info.getErrorMessage());
}
Map<String, Set<String>> deptNumMap = new HashMap<>();
Map<String, Integer> allNumMap = new HashMap<>();
Map<String, Integer> failNumMap = new HashMap<>();
//Map<String, List<TEmployeeInsurancePreQwDetail>> preDetailQwMap = new HashMap<>();
Map<String, TEmployeeInsurancePreQw> preQwMap = new HashMap<>();
// 派单失败的
//List<TEmployeeInsurancePre> existingList = new ArrayList<>();
// 派单成功的
//List<TEmployeeInsurancePre> nonExistingList = new ArrayList<>();
List<TEmployeeInsurancePre> updateList = new ArrayList<>();
TEmployeeInsurancePre updatePre;
LocalDateTime now = LocalDateTime.now();
String errorrMessage;
Set<String> tempSet;
Integer nums;
String customerUserLoginname;
// 项目、人数、失败人数
TEmployeeInsurancePreQw qw;
TEmployeeInsurancePreQwDetail qwDetail;
List<TEmployeeInsurancePreQwDetail> qwDetalList = new ArrayList<>();
for (TEmployeeInsurancePre pre : insurancePreList) {
customerUserLoginname = pre.getCustomerUserLoginname();
if (Common.isNotNull(customerUserLoginname)) {
tempSet = deptNumMap.get(customerUserLoginname);
if (tempSet == null) {
tempSet = new HashSet<>();
}
tempSet.add(pre.getDeptNo());
deptNumMap.put(customerUserLoginname, tempSet);
}
updatePre = new TEmployeeInsurancePre();
updatePre.setId(pre.getId());
String qwUuId;
if (Common.isNotNull(customerUserLoginname)) {
nums = allNumMap.get(customerUserLoginname);
if (Common.isEmpty(nums)) {
nums = CommonConstants.ZERO_INT;
}
nums++;
allNumMap.put(customerUserLoginname, nums);
}
// 派单失败的
if (autoAddParamSet.contains(pre.getId())) {
errorrMessage = errorMessageMap.get(pre.getId());
if (Common.isNotNull(customerUserLoginname)) {
nums = failNumMap.get(customerUserLoginname);
if (Common.isEmpty(nums)) {
nums = CommonConstants.ZERO_INT;
}
nums++;
failNumMap.put(customerUserLoginname, nums);
// 派单失败,组装需要推送企微的明细
qw = preQwMap.get(customerUserLoginname);
if (qw == null) {
qw = new TEmployeeInsurancePreQw();
qwUuId = String.valueOf(UUID.randomUUID()).replace("-", "");
qw.setId(qwUuId);
qw.setCreateTime(now);
qw.setCustomerUserLoginname(customerUserLoginname);
qw.setCustomerUsername(pre.getCustomerUsername());
} else {
qwUuId = qw.getId();
}
preQwMap.put(customerUserLoginname, qw);
// 派单失败,组装需要推送企微的明细
//qwDetalList = preDetailQwMap.get(customerUserLoginname);
/*if (qwDetalList == null) {
qwDetalList = new ArrayList<>();
}*/
qwDetail = new TEmployeeInsurancePreQwDetail();
qwDetail.setPreId(pre.getId());
qwDetail.setMainId(qwUuId);
qwDetail.setEmpName(pre.getEmployeeName());
qwDetail.setEmpIdcard(pre.getEmpIdcard());
qwDetail.setErrorInfo(errorrMessage);
qwDetail.setErrorTime(now);
qwDetalList.add(qwDetail);
//preDetailQwMap.put(customerUserLoginname, qwDetalList);
}
//existingList.add( pre)
updatePre.setProcessStatus(CommonConstants.TWO_STRING);
updatePre.setErrorTime(now);
updatePre.setErrorInfo(errorrMessage);
updateList.add(updatePre);
} else {
// 派单成功的
//nonExistingList.add(pre)
updatePre.setProcessStatus(CommonConstants.THREE_STRING);
updateList.add(updatePre);
}
}
if (!preQwMap.isEmpty()) {
List<TEmployeeInsurancePreQw> qwList = new ArrayList<>();
int deptNum;
int allNum;
int failNum;
StringBuilder description;
String userLoginNames = null;
for (Map.Entry<String, TEmployeeInsurancePreQw> entry : preQwMap.entrySet()) {
customerUserLoginname = entry.getKey();
if (Common.isNotNull(userLoginNames)) {
userLoginNames += ",";
}
userLoginNames += customerUserLoginname;
qw = entry.getValue();
tempSet = deptNumMap.get(customerUserLoginname);
if (Common.isNotNull(tempSet)) {
deptNum = tempSet.size();
} else {
deptNum = 0;
}
allNum = allNumMap.get(customerUserLoginname);
if (Common.isEmpty(allNum)) {
allNum = 0;
}
failNum = failNumMap.get(customerUserLoginname);
if (Common.isEmpty(failNum)) {
failNum = 0;
}
description = new StringBuilder("项目数:").append(deptNum).append("个;自动化派单人数:")
.append(allNum).append("个,<span style='color:red'>失败人数:").append(failNum).append("个</span><br>请及时至HRO系统处理,以免人员漏保!");
qw.setDescription(description.toString());
qwList.add(qw);
}
if(!qwDetalList.isEmpty()) {
tEmployeeInsurancePreQwDetailService.saveBatch(qwDetalList);
}
// TODO-加一个定时任务再推送企微的flag
if (!qwList.isEmpty()) {
tEmployeeInsurancePreQwService.saveBatch(qwList);
if (Common.isNotNull(userLoginNames)) {
Map<String, String> sysUserMap = getUserQiWeiInfo(userLoginNames);
String qwInfo;
if (sysUserMap != null) {
for (TEmployeeInsurancePreQw sendQw : qwList) {
qwInfo = sysUserMap.get(sendQw.getCustomerUserLoginname());
if (Common.isNotNull(qwInfo)) {
sendMessageToWx(qwInfo, sendQw.getDescription());
}
}
}
}
}
}
if (!updateList.isEmpty()) {
this.updateBatchById(updateList);
}
// 找出 insurancePreList 中在 autoAddParamList 中存在的数据 // 找出 insurancePreList 中在 autoAddParamList 中存在的数据
List<TEmployeeInsurancePre> existingList = insurancePreList.stream() /*List<TEmployeeInsurancePre> existingList = insurancePreList.stream()
.filter(pre -> autoAddParamSet.contains(pre.getId())) .filter(pre -> autoAddParamSet.contains(pre.getId()))
.collect(Collectors.toList()); .collect(Collectors.toList());
...@@ -312,11 +479,11 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -312,11 +479,11 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
.collect(Collectors.toList()); .collect(Collectors.toList());
//派单成功的更新状态为代投保,派单失败更新成派单失败 //派单成功的更新状态为代投保,派单失败更新成派单失败
if (!existingList.isEmpty()){ if (!existingList.isEmpty()){
List<String> onIdList = existingList.stream().map(TEmployeeInsurancePre::getId).collect(Collectors.toList()); List<String> onIdList = existingList.stream().map(TEmployeeInsurancePre::getId).collect(Collectors.toList())
LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>()
updateWrapper.in(TEmployeeInsurancePre::getId,onIdList) updateWrapper.in(TEmployeeInsurancePre::getId,onIdList)
.set(TEmployeeInsurancePre::getProcessStatus, CommonConstants.TWO_STRING); .set(TEmployeeInsurancePre::getProcessStatus, CommonConstants.TWO_STRING)
this.update(updateWrapper); this.update(updateWrapper)
} }
if (!nonExistingList.isEmpty()){ if (!nonExistingList.isEmpty()){
List<String> unIdList = nonExistingList.stream().map(TEmployeeInsurancePre::getId).collect(Collectors.toList()); List<String> unIdList = nonExistingList.stream().map(TEmployeeInsurancePre::getId).collect(Collectors.toList());
...@@ -324,11 +491,65 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur ...@@ -324,11 +491,65 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
updateWrapper.in(TEmployeeInsurancePre::getId,unIdList) updateWrapper.in(TEmployeeInsurancePre::getId,unIdList)
.set(TEmployeeInsurancePre::getProcessStatus, CommonConstants.THREE_STRING); .set(TEmployeeInsurancePre::getProcessStatus, CommonConstants.THREE_STRING);
this.update(updateWrapper); this.update(updateWrapper);
} }*/
} }
return R.ok(autoAddParamList); return R.ok(autoAddParamList);
} }
//发送企业微信待办
private void sendMessageToWx(String useruserWx, String content) {
if (Common.isEmpty(useruserWx) || Common.isEmpty(content)) {
return;
}
StringBuilder sendUser = null;
if (Common.isNotKong(useruserWx)) {
sendUser = new StringBuilder(useruserWx);
}
if (sendUser != null) {
RestTemplate restTemplate = new RestTemplate();
Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>();
textcard.put("title", "<span style='color:red'>商险自动化派单——失败提醒</span>");
textcard.put("url", String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "66" ));
textcard.put("description", content);
requestMap.put("touser", sendUser);
requestMap.put("agentid", wxConfig.getAgentid());
requestMap.put("msgtype", "textcard");
requestMap.put("textcard", textcard);
// 必须加上header说明
if (!wxConfig.sendTextCard(restTemplate, requestMap)) {
wxConfig.sendTextCard(restTemplate, requestMap);
}
}
}
/**
* @param userLoginNames 登录名,逗号拼接
* @Description: 获取客服的企微信息
* @Author: hgw
* @Date: 2025/8/8 17:59
* @return: java.util.Map<java.lang.String, java.lang.String>
**/
private Map<String, String> getUserQiWeiInfo(String userLoginNames) {
Map<String, String> sysUserMap = null;
// 获取项目对应的前端客服用户信息--客服账号需要正常
if (Common.isNotKong(userLoginNames)) {
R<SysUserListVo> res = upmsDaprUtils.getUserIdsByUserNames(userLoginNames);
List<SysUser> users = null;
if (Common.isNotNull(res) && Common.isNotNull(res.getData()) && Common.isNotNull(res.getData().getUserList())) {
users = res.getData().getUserList();
}
if (Common.isNotKong(users)) {
for (SysUser user : users) {
if (Common.isNotNull(user.getWxMessage())) {
sysUserMap.put(user.getUsername(), user.getWxMessage());
}
}
}
}
return sysUserMap;
}
@Override @Override
@Transactional @Transactional
public Boolean saveInsurancePreInfo(EmployeeRegistrationPreVo registrationPreVo) { public Boolean saveInsurancePreInfo(EmployeeRegistrationPreVo registrationPreVo) {
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!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.TEmployeeInsurancePreQwDetailMapper">
<resultMap id="tEmployeeInsurancePreQwDetailMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePreQwDetail">
<id property="id" column="ID"/>
<result property="mainId" column="MAIN_ID"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="errorInfo" column="ERROR_INFO"/>
<result property="errorTime" column="ERROR_TIME"/>
<result property="preId" column="PRE_ID"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.MAIN_ID,
a.EMP_NAME,
a.EMP_IDCARD,
a.ERROR_INFO,
a.ERROR_TIME,
a.PRE_ID
</sql>
<sql id="tEmployeeInsurancePreQwDetail_where">
<if test="tEmployeeInsurancePreQwDetail != null">
<if test="tEmployeeInsurancePreQwDetail.id != null and tEmployeeInsurancePreQwDetail.id.trim() != ''">
AND a.ID = #{tEmployeeInsurancePreQwDetail.id}
</if>
<if test="tEmployeeInsurancePreQwDetail.mainId != null and tEmployeeInsurancePreQwDetail.mainId.trim() != ''">
AND a.MAIN_ID = #{tEmployeeInsurancePreQwDetail.mainId}
</if>
<if test="tEmployeeInsurancePreQwDetail.empName != null and tEmployeeInsurancePreQwDetail.empName.trim() != ''">
AND a.EMP_NAME = #{tEmployeeInsurancePreQwDetail.empName}
</if>
<if test="tEmployeeInsurancePreQwDetail.empIdcard != null and tEmployeeInsurancePreQwDetail.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tEmployeeInsurancePreQwDetail.empIdcard}
</if>
<if test="tEmployeeInsurancePreQwDetail.errorInfo != null and tEmployeeInsurancePreQwDetail.errorInfo.trim() != ''">
AND a.ERROR_INFO = #{tEmployeeInsurancePreQwDetail.errorInfo}
</if>
<if test="tEmployeeInsurancePreQwDetail.errorTime != null">
AND a.ERROR_TIME = #{tEmployeeInsurancePreQwDetail.errorTime}
</if>
<if test="tEmployeeInsurancePreQwDetail.preId != null and tEmployeeInsurancePreQwDetail.preId.trim() != ''">
AND a.PRE_ID = #{tEmployeeInsurancePreQwDetail.preId}
</if>
</if>
</sql>
<!--tEmployeeInsurancePreQwDetail简单分页查询-->
<select id="getTEmployeeInsurancePreQwDetailPage" resultMap="tEmployeeInsurancePreQwDetailMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_employee_insurance_pre_qw_detail a
<where>
1=1
<include refid="tEmployeeInsurancePreQwDetail_where"/>
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~
~ Copyright (c) 2018-2025, lengleng All rights reserved.
~
~ Redistribution and use in source and binary forms, with or without
~ modification, are permitted provided that the following conditions are met:
~
~ Redistributions of source code must retain the above copyright notice,
~ this list of conditions and the following disclaimer.
~ Redistributions in binary form must reproduce the above copyright
~ notice, this list of conditions and the following disclaimer in the
~ documentation and/or other materials provided with the distribution.
~ Neither the name of the yifu4cloud.com developer nor the names of its
~ contributors may be used to endorse or promote products derived from
~ this software without specific prior written permission.
~ Author: lengleng (wangiegie@gmail.com)
~
-->
<!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.TEmployeeInsurancePreQwMapper">
<resultMap id="tEmployeeInsurancePreQwMap"
type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TEmployeeInsurancePreQw">
<id property="id" column="ID"/>
<result property="customerUsername" column="customer_username"/>
<result property="customerUserLoginname" column="customer_user_loginname"/>
<result property="description" column="description"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.customer_username,
a.customer_user_loginname,
a.description
</sql>
<sql id="tEmployeeInsurancePreQw_where">
<if test="tEmployeeInsurancePreQw != null">
<if test="tEmployeeInsurancePreQw.id != null and tEmployeeInsurancePreQw.id.trim() != ''">
AND a.ID = #{tEmployeeInsurancePreQw.id}
</if>
<if test="tEmployeeInsurancePreQw.customerUsername != null and tEmployeeInsurancePreQw.customerUsername.trim() != ''">
AND a.customer_username = #{tEmployeeInsurancePreQw.customerUsername}
</if>
<if test="tEmployeeInsurancePreQw.customerUserLoginname != null and tEmployeeInsurancePreQw.customerUserLoginname.trim() != ''">
AND a.customer_user_loginname = #{tEmployeeInsurancePreQw.customerUserLoginname}
</if>
<if test="tEmployeeInsurancePreQw.description != null and tEmployeeInsurancePreQw.description.trim() != ''">
AND a.description = #{tEmployeeInsurancePreQw.description}
</if>
</if>
</sql>
</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