Commit cc688308 authored by hongguangwu's avatar hongguangwu

Merge branch 'develop'

parents a860d87d c831c013
......@@ -66,14 +66,14 @@ public class TGzOfferInfo extends BaseEntity {
/**
* Offer状态
* (3:待发送Offer,4:待接受Offer,5:拒绝Offer,7:接受offer,9:候选人填写信息,10:取消offer,
* (3:待发送Offer,4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,
* 12:候选人信息审核,13:待签署,8:合同审核通过,99:已归档,98:信息待收集,97:候选人审核通过)
*/
@ExcelAttribute(name = "Offer状态(3:待发送Offer,4:待接受Offer,5:拒绝Offer,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)", isNotEmpty = true, errorInfo = "Offer状态(3:待发送Offer,4:待接受Offer,5:拒绝Offer,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)不能为空", maxLength = 2)
@NotBlank(message = "Offer状态(3:待发送Offer,4:待接受Offer,5:拒绝Offer,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)不能为空")
@Length(max = 2, message = "Offer状态(3:待发送Offer,4:待接受Offer,5:拒绝Offer,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)不能超过2个字符")
@ExcelProperty("Offer状态(3:待发送Offer,4:待接受Offer,5:拒绝Offer,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)")
@Schema(description = "Offer状态(3:待发送Offer,4:待接受Offer,5:拒绝Offer,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)")
@ExcelAttribute(name = "Offer状态(3:待发送Offer,4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)", isNotEmpty = true, errorInfo = "Offer状态(3:待发送Offer,4:待接受Offer,5:拒绝Offer,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)不能为空", maxLength = 2)
@NotBlank(message = "Offer状态(3:待发送Offer,4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)不能为空")
@Length(max = 2, message = "Offer状态(3:待发送Offer,4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)不能超过2个字符")
@ExcelProperty("Offer状态(3:待发送Offer,4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)")
@Schema(description = "Offer状态(3:待发送Offer,4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)")
private String offerStatus;
/**
* Offer短信通知状态( 0:已发送;1:未发送)
......
/*
* 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.archives.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.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
/**
* 瓜子系统交互任务跟进表
*
* @author cyx
* @date 2025-07-09 17:03:50
*/
@Data
@TableName("t_gz_push_entry")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "瓜子系统交互任务跟进表")
public class TGzPushEntry extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String id;
/**
* 流程ID(瓜子推过来的主键)
*/
@ExcelAttribute(name = "流程ID(瓜子推过来的主键)", isNotEmpty = true, errorInfo = "流程ID(瓜子推过来的主键)不能为空", maxLength = 32)
@NotBlank(message = "流程ID(瓜子推过来的主键)不能为空")
@Length(max = 32, message = "流程ID(瓜子推过来的主键)不能超过32个字符")
@ExcelProperty("流程ID(瓜子推过来的主键)")
@Schema(description = "流程ID(瓜子推过来的主键)")
private String bizId;
/**
* 交互任务类型(4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,97:档案信息推送,13:待签署,8:合同信息推送,99:合同附件推送)
*/
@ExcelAttribute(name = "交互任务类型(4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,97:档案信息推送,13:待签署,8:合同信息推送,99:合同附件推送)", isNotEmpty = true, errorInfo = "交互任务类型(4:待接受Offer,5:拒绝Offer,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,97:档案信息推送,13:待签署,8:合同信息推送,99:合同附件推送)不能为空", maxLength = 2)
@NotBlank(message = "交互任务类型(4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,97:档案信息推送,13:待签署,8:合同信息推送,99:合同附件推送)不能为空")
@Length(max = 2, message = "交互任务类型(4:待接受Offer,5:拒绝Offer,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,97:档案信息推送,13:待签署,8:合同信息推送,99:合同附件推送)不能超过2个字符")
@ExcelProperty("交互任务类型(4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,97:档案信息推送,13:待签署,8:合同信息推送,99:合同附件推送)")
@Schema(description = "交互任务类型(4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,97:档案信息推送,13:待签署,8:合同信息推送,99:合同附件推送)")
private String taskType;
/**
* 推送状态(0:推送成功1:推送失败2:待推送3 推送中)
*/
@ExcelAttribute(name = "推送状态(0:推送成功1:推送失败2:待推送)", isNotEmpty = true, errorInfo = "推送状态(0:推送成功1:推送失败2:待推送)不能为空", maxLength = 1)
@NotBlank(message = "推送状态(0:推送成功1:推送失败2:待推送)不能为空")
@Length(max = 1, message = "推送状态(0:推送成功1:推送失败2:待推送)不能超过1个字符")
@ExcelProperty("推送状态(0:推送成功1:推送失败2:待推送)")
@Schema(description = "推送状态(0:推送成功1:推送失败2:待推送3 推送中)")
private String pushStatus;
/**
* 推送时间
*/
@ExcelAttribute(name = "推送时间", isDate = true)
@ExcelProperty("推送时间")
@Schema(description = "推送时间")
private LocalDateTime pushTime;
/**
* 失败原因
*/
@ExcelAttribute(name = "失败原因", maxLength = 512)
@Length(max = 512, message = "失败原因不能超过512个字符")
@ExcelProperty("失败原因")
@Schema(description = "失败原因")
private String failReason;
/**
* 推送报文,JSON格式的字符串
*/
@ExcelAttribute(name = "推送报文,JSON格式的字符串")
@ExcelProperty("推送报文,JSON格式的字符串")
@Schema(description = "推送报文,JSON格式的字符串")
private String pushData;
/**
* 对方响应的报文,JSON格式的字符串
*/
@ExcelAttribute(name = "对方响应的报文,JSON格式的字符串")
@ExcelProperty("对方响应的报文,JSON格式的字符串")
@Schema(description = "对方响应的报文,JSON格式的字符串")
private String responseData;
/**
* 删除标记
*/
@ExcelAttribute(name = "删除标记", maxLength = 1)
@Length(max = 1, message = "删除标记不能超过1个字符")
@ExcelProperty("删除标记")
@Schema(description = "删除标记")
private String delFlag;
/**
* 姓名
*/
@ExcelAttribute(name = "姓名", maxLength = 50)
@Length(max = 50, message = "姓名不能超过50个字符")
@ExcelProperty("姓名")
@Schema(description = "姓名")
private String name;
/**
* 证件号码
*/
@ExcelAttribute(name = "证件号码", maxLength = 50)
@Length(max = 50, message = "证件号码不能超过50个字符")
@ExcelProperty("证件号码")
@Schema(description = "证件号码")
private String nationalId;
}
/*
* 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.archives.vo;
import lombok.Data;
/**
* 瓜子档案表_推送瓜子附件(名称类型等信息,不是上传文件哦!)
*
* @author hgw
* @date 2025-7-10 10:19:40
*/
@Data
public class TGzEmpInfoPushGzAttaVo {
// 4.2.5、员工附件补充接口
private String bizId;
// 附件类型:参考字典
private String attachType;
// 文件ID
private String fileId;
// 文件名称,带后缀
private String fileName;
}
/*
* 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.archives.vo;
import lombok.Data;
/**
* 瓜子档案表_推送瓜子合同
*
* @author hgw
* @date 2025-7-10 10:19:40
*/
@Data
public class TGzEmpInfoPushGzContractVo {
private String bizId;
private String contractNum;
private String sginatureMethod;
private String contractType;
private String sginatureType;
private String sginatureDt;
private String contractBeginDt;
private String contractEndDt;
private String contrctExpEndDt;
private String probation;
private String prcExpDt;
private String probationDt;
private String neeProviderId;
private String workLocation;
private String fileId;
private String fileName;
}
/*
* 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.archives.vo;
import lombok.Data;
import java.util.List;
/**
* 瓜子档案表_推送瓜子附件(文件大内容)
*
* @author hgw
* @date 2025-7-10 10:19:40
*/
@Data
public class TGzEmpInfoPushGzFileVo {
// 4.2.3、员工文件信息上传接口
private String bizId;
// 文件名称带后缀
private String fileName;
// 文件数据 Base64
private String fileData;
}
/*
* 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.archives.vo;
import lombok.Data;
import java.util.List;
/**
* 瓜子档案表_推送瓜子的字段
*
* @author hgw
* @date 2025-7-10 10:19:40
*/
@Data
public class TGzEmpInfoPushGzVo {
private String bizId;
private String name;
private String birthdate;
private String sex;
private String startDate;
private String country;
private String ethnicGrpCd;
private String nativePlace;
private String blooeType;
private String constel;
private String phone;
private String email;
private String marStatus;
private String politicalSta;
private String insuranceSta;
private String driverType;
private String driverLicenExp;
private String nationalId;
private String nationalIdType;
private String nidStartDate;
private String nidExpiryDate;
private String persistFlag;
private String hukouType;
private String hukouProvince;
private String hukouCity;
private String hukouCounty;
private String hukouDetail;
private TGzEmpInfoPushGzVoAdress address;
private TGzEmpInfoPushGzVoBank bankAccount;
private List<TGzEmpInfoPushGzVoFamily> family;
private List<TGzEmpInfoPushGzVoContact> emergContact;
private List<TGzEmpInfoPushGzVoWork> workExp;
private List<TGzEmpInfoPushGzVoEducation> eduExp;
private List<TGzEmpInfoPushGzVoSkill> skill;
private List<TGzEmpInfoPushGzVoAtta> attach;
}
/*
* 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.archives.vo;
import lombok.Data;
/**
* 瓜子档案表_推送瓜子的字段
*
* @author hgw
* @date 2025-7-10 10:19:40
*/
@Data
public class TGzEmpInfoPushGzVoAdress {
private String addressType;
private String stateId;
private String cityId;
private String countyId;
private String address;
}
/*
* 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.archives.vo;
import lombok.Data;
/**
* 瓜子档案表_推送瓜子的字段
*
* @author hgw
* @date 2025-7-10 10:19:40
*/
@Data
public class TGzEmpInfoPushGzVoAtta {
private String attachType;
private String fileId;
private String fileName;
}
/*
* 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.archives.vo;
import lombok.Data;
/**
* 瓜子档案表_推送瓜子的字段
*
* @author hgw
* @date 2025-7-10 10:19:40
*/
@Data
public class TGzEmpInfoPushGzVoBank {
private String accountType;
private String bankCd;
private String cnapsId;
private String bankName;
private String accountEcId;
private String accountName;
private String country;
}
/*
* 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.archives.vo;
import lombok.Data;
/**
* 瓜子档案表_推送瓜子的字段
*
* @author hgw
* @date 2025-7-10 10:19:40
*/
@Data
public class TGzEmpInfoPushGzVoContact {
private String emergRelation;
private String emergName;
private String phone;
private String address;
private String primaryNid;
}
/*
* 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.archives.vo;
import lombok.Data;
/**
* 瓜子档案表_推送瓜子的字段
*
* @author hgw
* @date 2025-7-10 10:19:40
*/
@Data
public class TGzEmpInfoPushGzVoEducation {
private String eduType;
private String eduDergee;
private String eduQual;
private String school;
private String startDate;
private String endDate;
private String graduateType;
private String major;
private String highEduDegreeFlag;
private String highEduQualFlag;
private String firstDegreeFlag;
}
/*
* 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.archives.vo;
import lombok.Data;
/**
* 瓜子档案表_推送瓜子的字段
*
* @author hgw
* @date 2025-7-10 10:19:40
*/
@Data
public class TGzEmpInfoPushGzVoFamily {
private String famMemRelation;
private String name;
private String phone;
private String address;
private String company;
private String gzEmeFlag;
private String jobCode;
}
/*
* 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.archives.vo;
import lombok.Data;
/**
* 瓜子档案表_推送瓜子的字段
*
* @author hgw
* @date 2025-7-10 10:19:40
*/
@Data
public class TGzEmpInfoPushGzVoSkill {
private Integer orderId;
private String skillName;
private String skillDate;
private String skillOrg;
private String skillLevel;
}
/*
* 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.archives.vo;
import lombok.Data;
/**
* 瓜子档案表_推送瓜子的字段
*
* @author hgw
* @date 2025-7-10 10:19:40
*/
@Data
public class TGzEmpInfoPushGzVoWork {
private String employer;
private String startDate;
private String endDate;
private String deptDescr;
private String endingTitle;
private String adminName;
private String phone;
private String email;
private String comment;
}
......@@ -36,48 +36,19 @@ import java.math.BigDecimal;
@ColumnWidth(15)
public class TGzOfferInfoExportDetailVo implements Serializable {
@ExcelProperty("流程ID")
private String bizId;
@ExcelProperty("人员类别编码")
private String emplType;
// 2025-7-24 16:18:55 新顺序:
// 人员类别名称 姓名 姓名拼音 证件类型描述 证件号码 性别 个人手机号 个人邮箱 预计入职日期 部门名称 职务描述 直接上级姓名 工作地点描述 社保缴纳地
@ExcelProperty("人员类别名称")
private String emplTypeDescr;
/**
* 外签类型:A: 洼地外签/ B:属地外签
*/
@ExcelAttribute(name = "外签类型", isDataId = true, dataType = ExcelAttributeConstants.GZ_OUT_SGIN_TYPE)
@ExcelProperty("外签类型")
private String outSginType;
/**
* 合同公司主体:公司信息表
*/
@ExcelProperty("合同公司主体")
private String company;
@ExcelProperty("姓名")
private String name;
@ExcelProperty("姓名拼音")
private String nameAc;
@ExcelProperty("姓氏拼音")
private String lastNameAc;
@ExcelProperty("名字拼音")
private String firstNameAc;
@ExcelProperty("国籍编码")
private String country;
@ExcelProperty("国籍描述")
private String countryDescr;
@ExcelProperty("证件类型编码")
private String nationalIdType;
@ExcelProperty("证件类型描述")
private String nationalIdTypeDescr;
@ExcelProperty("证件号码")
private String nationalId;
@ExcelAttribute(name = "性别", isDataId = true, dataType = ExcelAttributeConstants.GZ_SEX)
@ExcelProperty("性别")
private String sex;
......@@ -85,18 +56,21 @@ public class TGzOfferInfoExportDetailVo implements Serializable {
private String phone;
@ExcelProperty("个人邮箱")
private String email;
@ExcelProperty("直接上级姓名")
private String supervisorName;
@ExcelProperty("职务描述")
private String jobcodeDescr;
@ExcelProperty("工作地点")
private String workLocation;
@ExcelProperty("工作地点描述")
private String workLocationDescr;
@ExcelProperty("预计入职日期")
private String expEntryDate;
@ExcelProperty("部门名称")
private String deptName;
@ExcelProperty("职务描述")
private String jobcodeDescr;
@ExcelProperty("直接上级姓名")
private String supervisorName;
@ExcelProperty("工作地点描述")
private String workLocationDescr;
@ExcelProperty("社保缴纳地")
private String socialInsuranceLocationDescr;
// 基本工资 绩效工资 年终奖月数 流程ID 人员类别编码 外签类型 合同公司主体 姓氏拼音 名字拼音 国籍编码 国籍描述 证件类型编码 工作地点 社保缴纳地编码
/**
* 基本工资,两位小数
*/
......@@ -109,10 +83,38 @@ public class TGzOfferInfoExportDetailVo implements Serializable {
private BigDecimal perfomPay;
@ExcelProperty("年终奖月数")
private Integer yearBonusMonth;
@ExcelProperty("流程ID")
private String bizId;
@ExcelProperty("人员类别编码")
private String emplType;
/**
* 外签类型:A: 洼地外签/ B:属地外签
*/
@ExcelAttribute(name = "外签类型", isDataId = true, dataType = ExcelAttributeConstants.GZ_OUT_SGIN_TYPE)
@ExcelProperty("外签类型")
private String outSginType;
/**
* 合同公司主体:公司信息表
*/
@ExcelProperty("合同公司主体")
private String company;
@ExcelProperty("姓氏拼音")
private String lastNameAc;
@ExcelProperty("名字拼音")
private String firstNameAc;
@ExcelProperty("国籍编码")
private String country;
@ExcelProperty("国籍描述")
private String countryDescr;
@ExcelProperty("证件类型编码")
private String nationalIdType;
@ExcelProperty("工作地点")
private String workLocation;
@ExcelProperty("社保缴纳地编码")
private String socialInsuranceLocation;
@ExcelProperty("社保缴纳地")
private String socialInsuranceLocationDescr;
// 社保基数 公积金基数 是否转正后缴纳公积金 申请人邮箱 接收瓜子Offer时间 Offer短信通知状态 Offer状态
@ExcelProperty("社保基数")
private BigDecimal socialInsuranceBase;
@ExcelProperty("公积金基数")
......@@ -134,4 +136,5 @@ public class TGzOfferInfoExportDetailVo implements Serializable {
@ExcelProperty("Offer状态")
private String offerStatus;
}
/*
* 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.archives.vo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzPushEntry;
import lombok.Data;
/**
* 瓜子系统交互任务跟进表
*
* @author cyx
* @date 2025-07-09 17:03:50
*/
@Data
public class TGzPushEntrySearchVo extends TGzPushEntry {
/**
* 查询使用:推送时间开始
*/
private String createTimeStart;
/**
* 查询使用:推送时间结束
*/
private String createTimeEnd;
/**
* 查询使用:推送状态数组
*/
private String[] pushStatusArray;
}
......@@ -7,6 +7,11 @@ import com.google.gson.Gson;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContactInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzEmpInfo;
import com.yifu.cloud.plus.v1.yifu.archives.utils.GZSign;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzAttaVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzContractVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzFileVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
......@@ -21,6 +26,7 @@ import org.springframework.http.MediaType;
import org.springframework.web.client.RestTemplate;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -69,11 +75,6 @@ public class GzConfig {
String cnapsId;
for (int i=0;i<dataArray.size(); i++) {
dataObject = (JSONObject)dataArray.get(i);
bankCd = dataObject.getString("bankCd");
cnapsId = dataObject.getString("cnapsId");
// TODO - 继续解析参数并存储 —— 根据 cnapsId 字段,选择新增还是修改
// System.out.println("bankCd=" + bankCd)
// System.out.println("cnapsId=" + cnapsId)
}
return true;
}
......@@ -81,8 +82,15 @@ public class GzConfig {
return false;
}
public boolean updateGzOfferStatus(RestTemplate restTemplate, Map<String, Object> params, String sortedParams) {
String gzBankUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/offer/update-status?"+ sortedParams;
public Map<String,String> updateGzOfferStatus(RestTemplate restTemplate, Map<String, Object> params) {
// 签名
Map<String, Object> authParams = new HashMap<>();
authParams.put("appsecret", this.getAppsecret());
authParams.put("tid", this.getTid());
GZSign.addSignature(authParams, this.getAppkey(), this.getAppsecret());
String sortedParams = GZSign.getEncodeString(authParams);
String gzUpdateStatusUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/offer/update-status?"+ sortedParams;
// 创建请求头并添加Authorization
HttpHeaders headers = new HttpHeaders();
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
......@@ -92,23 +100,36 @@ public class GzConfig {
Gson gson = new Gson();
// 创建HttpEntity,包含headers(GET请求没有body,所以为null)
HttpEntity<String> entity = new HttpEntity<>(gson.toJson(params), headers);
// 发送GET请求
String result = restTemplate.exchange(gzBankUrl, HttpMethod.POST, entity, String.class).getBody();
Map<String,String> returnMap = new HashMap<>();
returnMap.put("pushData", gson.toJson(params));
// 发送POST请求
String result = restTemplate.exchange(gzUpdateStatusUrl, HttpMethod.POST, entity, String.class).getBody();
returnMap.put("responseData", result);
System.out.println(result);
if (result != null && result.contains("code") && result.contains("data")) {
JSONObject resultObject = JSON.parseObject(result);
String code = resultObject.getString("code");
if (Common.isNotNull(code) && "S00000".equals(code)) {
System.out.println("成功");
return true;
if (Common.isNotNull(code)) {
returnMap.put("responseCode", code);
}
String message = resultObject.getString("message");
if (Common.isNotNull(message)) {
returnMap.put("responseMessage", message);
}
return false;
}
return returnMap;
}
public boolean pushGzEmpInfo(RestTemplate restTemplate, TGzEmpInfo a, String sortedParams) {
String gzBankUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/offer/person-info?"+ sortedParams;
public Map<String,String> pushGzEmpInfo(RestTemplate restTemplate, TGzEmpInfoPushGzVo a) {
// 签名
Map<String, Object> params = new HashMap<>();
params.put("appsecret", this.getAppsecret());
params.put("tid", this.getTid());
GZSign.addSignature(params, this.getAppkey(), this.getAppsecret());
String sortedParams = GZSign.getEncodeString(params);
String gzEmpInfoUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/offer/person-info?"+ sortedParams;
// 创建请求头并添加Authorization
HttpHeaders headers = new HttpHeaders();
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
......@@ -118,23 +139,35 @@ public class GzConfig {
Gson gson = new Gson();
// 创建HttpEntity,包含headers(GET请求没有body,所以为null)
HttpEntity<String> entity = new HttpEntity<>(gson.toJson(a), headers);
// 发送GET请求
String result = restTemplate.exchange(gzBankUrl, HttpMethod.POST, entity, String.class).getBody();
Map<String,String> returnMap = new HashMap<>();
returnMap.put("pushData", gson.toJson(a));
// 发送POST请求
String result = restTemplate.exchange(gzEmpInfoUrl, HttpMethod.POST, entity, String.class).getBody();
returnMap.put("responseData", result);
System.out.println(result);
if (result != null && result.contains("code") && result.contains("data")) {
JSONObject resultObject = JSON.parseObject(result);
String code = resultObject.getString("code");
if (Common.isNotNull(code) && "S00000".equals(code)) {
System.out.println("成功");
return true;
if (Common.isNotNull(code)) {
returnMap.put("responseCode", code);
}
String message = resultObject.getString("message");
if (Common.isNotNull(message)) {
returnMap.put("responseMessage", message);
}
return false;
}
return returnMap;
}
public boolean pushGzEmpContract(RestTemplate restTemplate, TEmpContactInfo a, String sortedParams) {
String gzBankUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/offer/person-contract?"+ sortedParams;
public Map<String,String> pushGzEmpContract(RestTemplate restTemplate, TGzEmpInfoPushGzContractVo a) {
Map<String, Object> authParams = new HashMap<>();
authParams.put("appsecret", this.getAppsecret());
authParams.put("tid", this.getTid());
GZSign.addSignature(authParams, this.getAppkey(), this.getAppsecret());
String sortedParams = GZSign.getEncodeString(authParams);
String gzContractUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/offer/person-contract?"+ sortedParams;
// 创建请求头并添加Authorization
HttpHeaders headers = new HttpHeaders();
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
......@@ -144,19 +177,25 @@ public class GzConfig {
Gson gson = new Gson();
// 创建HttpEntity,包含headers(GET请求没有body,所以为null)
HttpEntity<String> entity = new HttpEntity<>(gson.toJson(a), headers);
// 发送GET请求
String result = restTemplate.exchange(gzBankUrl, HttpMethod.POST, entity, String.class).getBody();
Map<String,String> returnMap = new HashMap<>();
returnMap.put("pushData", gson.toJson(a));
// 发送POST请求
String result = restTemplate.exchange(gzContractUrl, HttpMethod.POST, entity, String.class).getBody();
returnMap.put("responseData", result);
System.out.println(result);
if (result != null && result.contains("code") && result.contains("data")) {
JSONObject resultObject = JSON.parseObject(result);
String code = resultObject.getString("code");
if (Common.isNotNull(code) && "S00000".equals(code)) {
System.out.println("成功");
return true;
if (Common.isNotNull(code)) {
returnMap.put("responseCode", code);
}
String message = resultObject.getString("message");
if (Common.isNotNull(message)) {
returnMap.put("responseMessage", message);
}
return false;
}
return returnMap;
}
public boolean pushGzEmpContractFile(RestTemplate restTemplate, TEmpContactInfo a, String sortedParams) {
......@@ -173,28 +212,32 @@ public class GzConfig {
// 发送GET请求
String result = restTemplate.exchange(gzBankUrl, HttpMethod.POST, entity, String.class).getBody();
System.out.println(result);
if (result != null && result.contains("code") && result.contains("data")) {
JSONObject resultObject = JSON.parseObject(result);
String code = resultObject.getString("code");
if (Common.isNotNull(code) && "S00000".equals(code)) {
System.out.println("成功");
return true;
}
}
return false;
}
public boolean pushGzFileList(RestTemplate restTemplate, List<Map<String, Object>> aList, String sortedParams) {
for (Map<String, Object> a : aList) {
if (pushGzFileOne(restTemplate, a, sortedParams)) {
System.out.println("成功");
}
}
return true;
}
public boolean pushGzFileOne(RestTemplate restTemplate, Map<String, Object> params, String sortedParams) {
String gzBankUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/offer/person-contract?"+ sortedParams;
/**
* @Description: 4.2.3、员工文件信息上传接口
* @Author: hgw
* @Date: 2025/7/10 17:44
* @return: boolean
**/
public String pushGzFile(RestTemplate restTemplate, TGzEmpInfoPushGzFileVo a) {
Map<String, Object> authParams = new HashMap<>();
authParams.put("appsecret", this.getAppsecret());
authParams.put("tid", this.getTid());
GZSign.addSignature(authParams, this.getAppkey(), this.getAppsecret());
String sortedParams = GZSign.getEncodeString(authParams);
String fileId = null;
String gzBankUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/file/upload?"+ sortedParams;
// 创建请求头并添加Authorization
HttpHeaders headers = new HttpHeaders();
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
......@@ -203,20 +246,65 @@ public class GzConfig {
headers.set("Authorization", "00000000"); // 设置Authorization头
Gson gson = new Gson();
// 创建HttpEntity,包含headers(GET请求没有body,所以为null)
HttpEntity<String> entity = new HttpEntity<>(gson.toJson(params), headers);
HttpEntity<String> entity = new HttpEntity<>(gson.toJson(a), headers);
// 发送GET请求
String result = restTemplate.exchange(gzBankUrl, HttpMethod.POST, entity, String.class).getBody();
System.out.println(result);
if (result != null && result.contains("code") && result.contains("data")) {
JSONObject resultObject = JSON.parseObject(result);
String code = resultObject.getString("code");
if (Common.isNotNull(code) && "S00000".equals(code)) {
System.out.println("成功");
return true;
fileId = resultObject.getString("data");
}
}
return false;
return fileId;
}
/**
* @Description: 4.2.5、员工附件补充接口
* @Author: hgw
* @Date: 2025/7/10 17:50
* @return: boolean
**/
public Map<String,String> pushGzAttach(RestTemplate restTemplate, TGzEmpInfoPushGzAttaVo a) {
Map<String, Object> authParams = new HashMap<>();
authParams.put("appsecret", this.getAppsecret());
authParams.put("tid", this.getTid());
GZSign.addSignature(authParams, this.getAppkey(), this.getAppsecret());
String sortedParams = GZSign.getEncodeString(authParams);
String gzAttachUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/offer/attach?"+ sortedParams;
// 创建请求头并添加Authorization
HttpHeaders headers = new HttpHeaders();
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
headers.setContentType(type);
headers.add("Accept", MediaType.APPLICATION_JSON.toString());
headers.set("Authorization", "00000000"); // 设置Authorization头
Gson gson = new Gson();
// 创建HttpEntity,包含headers(GET请求没有body,所以为null)
HttpEntity<String> entity = new HttpEntity<>(gson.toJson(a), headers);
Map<String,String> returnMap = new HashMap<>();
returnMap.put("pushData", gson.toJson(a));
// 发送POST请求
String result = restTemplate.exchange(gzAttachUrl, HttpMethod.POST, entity, String.class).getBody();
returnMap.put("responseData", result);
if (result != null && result.contains("code") && result.contains("data")) {
JSONObject resultObject = JSON.parseObject(result);
String code = resultObject.getString("code");
if (Common.isNotNull(code)) {
returnMap.put("responseCode", code);
}
String message = resultObject.getString("message");
if (Common.isNotNull(message)) {
returnMap.put("responseMessage", message);
}
}
return returnMap;
}
}
......@@ -28,19 +28,25 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TGzEmpInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TGzOfferInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.utils.GZSign;
import com.yifu.cloud.plus.v1.yifu.archives.utils.ReturnGz;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzAttaVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzContractVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzFileVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 瓜子交互控制器
......@@ -65,6 +71,9 @@ public class TGzController {
private RestTemplate restTemplate = new RestTemplate();
@Autowired
private OSSUtil ossUtil;
/**
* @Description: 接收瓜子推送过来的Offer信息
* @Author: hgw
......@@ -139,7 +148,7 @@ public class TGzController {
* @return: boolean
**/
@GetMapping("/updateGzOfferStatus")
public boolean updateGzOfferStatus(@RequestParam String bizId, @RequestParam Integer status
public Map<String,String> updateGzOfferStatus(@RequestParam String bizId, @RequestParam Integer status
, @RequestParam(required = false) String phone, @RequestParam(required = false) String email
, @RequestParam(required = false) String entryDate) {
Map<String, Object> params = new HashMap<>();
......@@ -154,7 +163,7 @@ public class TGzController {
params.put("email", email);
params.put("entryDate", entryDate);
return gzConfig.updateGzOfferStatus(restTemplate, params, sortedParams);
return gzConfig.updateGzOfferStatus(restTemplate, params);
}
/**
......@@ -164,7 +173,7 @@ public class TGzController {
* @return: boolean
**/
@GetMapping("/pushGzEmpInfo")
public boolean pushGzEmpInfo(@RequestParam(required = false) String gzEmpId) {
public Map<String,String> pushGzEmpInfo(@RequestParam(required = false) String gzEmpId) {
Map<String, Object> params = new HashMap<>();
params.put("appsecret", gzConfig.getAppsecret());
params.put("tid", gzConfig.getTid());
......@@ -174,8 +183,8 @@ public class TGzController {
// 653497199507262524 李丽
gzEmpId = "1942036120125800449";
}
TGzEmpInfo a = tGzEmpInfoService.getById(gzEmpId);
return gzConfig.pushGzEmpInfo(restTemplate, a, sortedParams);
TGzEmpInfoPushGzVo a = tGzEmpInfoService.getGzEmpInfoToPushGzById(gzEmpId);
return gzConfig.pushGzEmpInfo(restTemplate, a);
}
/**
* @Description: 3、合同信息回推接口;
......@@ -184,47 +193,82 @@ public class TGzController {
* @return: boolean
**/
@GetMapping("/pushGzEmpContract")
public boolean pushGzEmpContract(@RequestParam(required = false) String empContractId) {
public Map<String,String> pushGzEmpContract(@RequestParam(required = false) String gzEmpId) {
Map<String, Object> params = new HashMap<>();
params.put("appsecret", gzConfig.getAppsecret());
params.put("tid", gzConfig.getTid());
GZSign.addSignature(params, gzConfig.getAppkey(), gzConfig.getAppsecret());
String sortedParams = GZSign.getEncodeString(params);
if (Common.isEmpty(empContractId)) {
if (Common.isEmpty(gzEmpId)) {
// 653497199507262524 李丽
empContractId = "1942036120125800449";
gzEmpId = "1942036120125800449";
}
TEmpContactInfo a = tEmpContactInfoService.getById(empContractId);
return gzConfig.pushGzEmpContract(restTemplate, a, sortedParams);
TGzEmpInfoPushGzContractVo a = tGzEmpInfoService.getGzEmpInfoToPushGzByIdContract(gzEmpId);
return gzConfig.pushGzEmpContract(restTemplate, a);
}
/**
* @Description: 4、合同附件推送接口;
* @Description: 4.2.3、员工文件信息上传接口
* @Author: hgw
* @Date: 2025-7-11 11:11:11
* @return: boolean
**/
@GetMapping("/pushGzEmpContractFile")
public boolean pushGzEmpContractFile(@RequestParam(required = false) String empContractId) {
@GetMapping("/pushGzEmpInfoFile")
public Map<String, String> pushGzEmpInfoFile(@RequestParam(required = false) String gzEmpId) {
Map<String, Object> params = new HashMap<>();
params.put("appsecret", gzConfig.getAppsecret());
params.put("tid", gzConfig.getTid());
GZSign.addSignature(params, gzConfig.getAppkey(), gzConfig.getAppsecret());
String sortedParams = GZSign.getEncodeString(params);
if (Common.isEmpty(empContractId)) {
if (Common.isEmpty(gzEmpId)) {
// 653497199507262524 李丽
empContractId = "1942036120125800449";
gzEmpId = "1942036120125800449";
}
List<TAttaInfo> aList = tAttaInfoService.getTAttaInfoListByDoMainId(gzEmpId);
TGzEmpInfoPushGzFileVo vo;
TGzEmpInfo tGzEmpInfo = tGzEmpInfoService.getById(gzEmpId);
Map<String, String> returnMap = new HashMap<>();
if (tGzEmpInfo != null && Common.isNotNull(tGzEmpInfo.getBizId())) {
String bizId = tGzEmpInfo.getBizId();
URL url;
InputStream inStream = null;
String base64String;
for (TAttaInfo a : aList) {
// 证件正面
if (Common.isNotNull(a.getRelationType()) && "NID_A".equals(a.getRelationType()) && Common.isNotNull(a.getAttaSrc())) {
url = ossUtil.getObjectUrl(null, a.getAttaSrc());
try {
inStream = url.openStream();
base64String = Base64.getEncoder().encodeToString(IOUtils.toByteArray(inStream));
vo = new TGzEmpInfoPushGzFileVo();
vo.setBizId(bizId);
vo.setFileName(a.getAttaName());
// 文件数据 Base64
vo.setFileData(base64String);
returnMap.put(a.getId(), gzConfig.pushGzFile(restTemplate, vo));
} catch (Exception e) {
log.info("瓜子附件推送失败!");
} finally {
if (null != inStream) {
try {
inStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
TGzEmpInfo a = tGzEmpInfoService.getById(empContractId);
return gzConfig.pushGzEmpInfo(restTemplate, a, sortedParams);
}
}
}
return returnMap;
}
/**
* @Description: 5:员工文件信息上传接口
* @Description: 4.2.5、员工附件补充接口
* @Author: hgw
* @Date: 2025-7-11 11:11:11
* @return: boolean
**/
@GetMapping("/pushGzEmpInfoFile")
public boolean pushGzEmpInfoFile(@RequestParam(required = false) String gzEmpId) {
@GetMapping("/pushGzEmpInfoAtta")
public Map<String, String> pushGzEmpInfoAtta(@RequestParam(required = false) String gzEmpId) {
Map<String, Object> params = new HashMap<>();
params.put("appsecret", gzConfig.getAppsecret());
params.put("tid", gzConfig.getTid());
......@@ -235,22 +279,55 @@ public class TGzController {
gzEmpId = "1942036120125800449";
}
List<TAttaInfo> aList = tAttaInfoService.getTAttaInfoListByDoMainId(gzEmpId);
List<Map<String, Object>> attaMapList = new ArrayList<>();
Map<String, Object> attaMap;
TGzEmpInfo tGzEmpInfo;
for (TAttaInfo a : aList) {
tGzEmpInfo = tGzEmpInfoService.getById(a.getDomainId());
TGzEmpInfoPushGzFileVo vo;
TGzEmpInfoPushGzAttaVo attaVo;
TGzEmpInfo tGzEmpInfo = tGzEmpInfoService.getById(gzEmpId);
Map<String, String> returnMap = new HashMap<>();
if (tGzEmpInfo != null && Common.isNotNull(tGzEmpInfo.getBizId())) {
attaMap = new HashMap<>();
attaMap.put("bizId", tGzEmpInfo.getBizId());
// TODO-文件名称带后缀
attaMap.put("fileName", a.getAttaName());
// TODO-文件数据 Base64
attaMap.put("fileData", null);
attaMapList.add(attaMap);
String bizId = tGzEmpInfo.getBizId();
String fileId;
URL url;
InputStream inStream = null;
String base64String;
// 先上传附件,再推送atta与类型
for (TAttaInfo a : aList) {
// 获取合同附件
if (Common.isNotNull(a.getRelationType()) && "CONTRACT".equals(a.getRelationType()) && Common.isNotNull(a.getAttaSrc())) {
url = ossUtil.getObjectUrl(null, a.getAttaSrc());
try {
inStream = url.openStream();
base64String = Base64.getEncoder().encodeToString(IOUtils.toByteArray(inStream));
vo = new TGzEmpInfoPushGzFileVo();
vo.setBizId(bizId);
vo.setFileName(a.getAttaName());
// 文件数据 Base64
vo.setFileData(base64String);
fileId = gzConfig.pushGzFile(restTemplate, vo);
attaVo = new TGzEmpInfoPushGzAttaVo();
attaVo.setBizId(bizId);
attaVo.setFileId(fileId);
attaVo.setAttachType(a.getRelationType());
attaVo.setFileName(a.getAttaName());
gzConfig.pushGzAttach(restTemplate, attaVo);
//returnMap.put(a.getId(), gzConfig.pushGzAttach(restTemplate, attaVo));
} catch (Exception e) {
log.info("瓜子附件推送失败!");
} finally {
if (null != inStream) {
try {
inStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
}
return gzConfig.pushGzFileList(restTemplate, attaMapList, sortedParams);
return returnMap;
}
......
/*
* 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.archives.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.archives.entity.TGzPushEntry;
import com.yifu.cloud.plus.v1.yifu.archives.service.TGzPushEntryService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzPushEntrySearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
/**
* 瓜子系统交互任务跟进表
*
* @author cyx
* @date 2025-07-09 17:03:50
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/tgzpushentry" )
@Tag(name = "瓜子系统交互任务跟进表管理")
public class TGzPushEntryController {
private final TGzPushEntryService tGzPushEntryService;
/**
* 简单分页查询
* @param page 分页对象
* @param tGzPushEntry 瓜子系统交互任务跟进表
* @return
*/
@Operation(description = "简单分页查询")
@GetMapping("/page")
public R<IPage<TGzPushEntrySearchVo>> getTGzPushEntryPage(Page<TGzPushEntry> page, TGzPushEntrySearchVo tGzPushEntry) {
return new R<>(tGzPushEntryService.getTGzPushEntryPage(page,tGzPushEntry));
}
/**
* 任务推送重试
* @param tGzPushEntry 瓜子系统交互任务跟进表
* @return R
*/
@Operation(summary = "任务推送重试")
@SysLog("任务推送重试" )
@PostMapping("/retry")
public R<String> retryPushEntry(@RequestBody TGzPushEntry tGzPushEntry) {
return tGzPushEntryService.retryPushEntry(tGzPushEntry);
}
}
......@@ -83,4 +83,18 @@ public interface TGzEmpInfoMapper extends BaseMapper<TGzEmpInfo> {
int getTGzEmpInfoCountSkill(@Param("tGzEmpInfo") TGzEmpInfoSearchVo tGzEmpInfo);
List<TGzEmpInfoExportSkill> getTGzEmpInfoListSkill(@Param("tGzEmpInfo") TGzEmpInfoSearchVo tGzEmpInfo);
// 推送瓜子档案信息给瓜子
TGzEmpInfoPushGzVo getGzEmpInfoToPushGzById(@Param("gzEmpId") String gzEmpId);
TGzEmpInfoPushGzVoAdress getGzEmpInfoToPushGzByIdAdress(@Param("gzEmpId") String gzEmpId);
TGzEmpInfoPushGzVoBank getGzEmpInfoToPushGzByIdBank(@Param("gzEmpId") String gzEmpId);
List<TGzEmpInfoPushGzVoFamily> getGzEmpInfoToPushGzByIdFamily(@Param("gzEmpId") String gzEmpId);
List<TGzEmpInfoPushGzVoContact> getGzEmpInfoToPushGzByIdContact(@Param("gzEmpId") String gzEmpId);
List<TGzEmpInfoPushGzVoWork> getGzEmpInfoToPushGzByIdWork(@Param("gzEmpId") String gzEmpId);
List<TGzEmpInfoPushGzVoEducation> getGzEmpInfoToPushGzByIdEducation(@Param("gzEmpId") String gzEmpId);
List<TGzEmpInfoPushGzVoSkill> getGzEmpInfoToPushGzByIdSkill(@Param("gzEmpId") String gzEmpId);
List<TGzEmpInfoPushGzVoAtta> getGzEmpInfoToPushGzByIdAtta(@Param("gzEmpId") String gzEmpId);
// 推送瓜子档案里的合同
TGzEmpInfoPushGzContractVo getGzEmpInfoToPushGzByIdContract(@Param("gzEmpId") String gzEmpId);
}
/*
* 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.archives.mapper;
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.archives.entity.TGzPushEntry;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzPushEntrySearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 瓜子系统交互任务跟进表
*
* @author cyx
* @date 2025-07-09 17:03:50
*/
@Mapper
public interface TGzPushEntryMapper extends BaseMapper<TGzPushEntry> {
/**
* 瓜子系统交互任务跟进表简单分页查询
*
* @param tGzPushEntry 瓜子系统交互任务跟进表
* @return
*/
IPage<TGzPushEntrySearchVo> getTGzPushEntryPage(Page<TGzPushEntry> page, @Param("tGzPushEntry") TGzPushEntrySearchVo tGzPushEntry);
}
......@@ -37,4 +37,13 @@ public interface TGzContractService {
*/
void saveContractInfoToGzEmpInfo(TEmployeeContractInfo contractInfo, Integer offerId, String workLocation, String workLocationDescr);
/**
* 存合同附件到瓜子档案里
* chenyx
*
* @param offerId offerId
* @param contractId 合同ID
*/
void saveContractAtta(Integer offerId, String contractId);
}
......@@ -23,6 +23,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzEmpInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzOfferInfo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzContractVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoSearchVo;
......@@ -75,4 +77,21 @@ public interface TGzEmpInfoService extends IService<TGzEmpInfo> {
**/
R<String> saveEmpInfoByGz(TGzOfferInfo offerInfo);
/**
* @param gzEmpId
* @Description: 推送给瓜子的档案信息
* @Author: hgw
* @Date: 2025/7/10 15:33
* @return: com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVo
**/
TGzEmpInfoPushGzVo getGzEmpInfoToPushGzById(String gzEmpId);
/**
* @param gzEmpId
* @Description: 推送给瓜子的合同信息
* @Author: hgw
* @Date: 2025/7/10 17:33
* @return: com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVo
**/
TGzEmpInfoPushGzContractVo getGzEmpInfoToPushGzByIdContract(String gzEmpId);
}
/*
* 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.archives.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzPushEntry;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzPushEntrySearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
/**
* 瓜子系统交互任务跟进表
*
* @author cyx
* @date 2025-07-09 17:03:50
*/
public interface TGzPushEntryService extends IService<TGzPushEntry> {
/**
* 瓜子系统交互任务跟进表简单分页查询
* @param tGzPushEntry 瓜子系统交互任务跟进表
* @return
*/
IPage<TGzPushEntrySearchVo> getTGzPushEntryPage(Page<TGzPushEntry> page, TGzPushEntrySearchVo tGzPushEntry);
/**
* 任务推送重试
* @param tGzPushEntry 瓜子系统交互任务跟进表
* @return R
*/
R<String> retryPushEntry(TGzPushEntry tGzPushEntry);
/**
* 新增推送任务(异步)
* @param tGzPushEntry 瓜子系统交互任务跟进表
*/
void addPushEntry(TGzPushEntry tGzPushEntry);
}
/*
* 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.archives.service;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzPushEntry;
/**
* 瓜子系统交互任务处理异步任务类
*
* @author chenyuxi
* @date 2025-07-11
* @since 1.7.13
*/
public interface TGzPushHandleService {
/**
* 处理异步的推送任务
* @param tGzPushEntry 瓜子系统交互任务跟进表
*/
void handlePushEntry(TGzPushEntry tGzPushEntry);
}
......@@ -186,7 +186,7 @@ public class LGuaziOfferRecordServiceImpl extends ServiceImpl<LGuaziOfferRecordM
statusMap.put("3","待发送Offer");
statusMap.put("4","待接受Offer");
statusMap.put("5","拒绝Offer");
statusMap.put("7","接受offer");
statusMap.put("6","接受offer");
statusMap.put("9","候选人填写信息");
statusMap.put("10","取消offer");
statusMap.put("12","候选人信息审核");
......
......@@ -285,7 +285,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
.eq(TEmployeeContractInfo::getInUse,CommonConstants.ZERO_STRING)
.eq(TEmployeeContractInfo::getContractType,CommonConstants.ONE_STRING)
.eq(TEmployeeContractInfo::getWorkFlag,CommonConstants.ZERO_STRING)
.ne(TEmployeeContractInfo::getSituation,"续签")
.ne(TEmployeeContractInfo::getSituation,"作废")
.ne(TEmployeeContractInfo::getSituation,"终止")
.le(TEmployeeContractInfo::getContractEnd,DateUtil.dateIncreaseByDay(
DateUtil.dateIncreaseByMonth(DateUtil.getCurrentDateTime(),
......
......@@ -112,6 +112,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private final TGzContractService tGzContractService;
private final TGzPushEntryService tGzPushEntryService;
private final TGzEmpInfoMapper tGzEmpInfoMapper;
/**
* 员工合同信息表简单分页查询
*
......@@ -2277,7 +2281,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
//更新瓜子offer状态
public void updateGzOfferStatus(TEmployeeContractInfo contractInfo,String preStatus,String updStatus, String userId, String nickname) {
private void updateGzOfferStatus(TEmployeeContractInfo contractInfo,String preStatus,String updStatus, String userId, String nickname) {
if(Common.isEmpty(contractInfo)){
return;
}
......@@ -2287,6 +2291,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
.eq(TGzOfferInfo::getDelFlag,CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(gzOfferInfo)) {
// updStatus == 13:待签署 更新 入职日期为合同开始时间
if(CommonConstants.THIRTEEN_STRING.equals(updStatus)){
gzOfferInfo.setExpEntryDate(contractInfo.getContractStart());
}
gzOfferInfo.setOfferStatus(updStatus);
gzOfferInfo.setUpdateBy(userId);
gzOfferInfo.setUpdateTime(LocalDateTime.now());
......@@ -2297,10 +2305,36 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tGzContractService.saveContractInfoToGzEmpInfo(contractInfo, gzOfferInfo.getId(), gzOfferInfo.getWorkLocation(),gzOfferInfo.getWorkLocationDescr());
}
// 1.7.13: updStatus == 99:存合同附件到瓜子档案里
if(CommonConstants.NINETY_NINE.equals(updStatus)){
// 查档案ID
TGzEmpInfo gzEmpInfo = tGzEmpInfoMapper.getInfoByOfferId(gzOfferInfo.getId());
if(Common.isNotNull(gzEmpInfo)){
// 获取合同归档附件
List<TAttaInfo> contractAttas = tAttaInfoService.list(Wrappers.<TAttaInfo>query().lambda().eq(TAttaInfo::getDomainId,contractInfo.getId()));
if (Common.isNotNull(contractAttas)) {
for (TAttaInfo attaInfo : contractAttas) {
// 附件赋值
TAttaInfo gzContractAtta = new TAttaInfo();
BeanUtils.copyProperties(attaInfo, gzContractAtta);
gzContractAtta.setDomainId(gzEmpInfo.getId());
gzContractAtta.setRelationType("CONTRACT");
gzContractAtta.setId(null);
gzContractAtta.setCreateBy(userId);
gzContractAtta.setCreateName(nickname);
gzContractAtta.setCreateTime(LocalDateTime.now());
tAttaInfoService.save(gzContractAtta);
}
}
}
}
// 瓜子状态变更增加操作日志
// 13:待签署,8:合同审核通过,99:已归档
// 9:发起合同申请10:合同审核通过;11:合同归档;
String recordFrom = "";
switch (updStatus) {
case "13":
recordFrom = "9";
......@@ -2313,6 +2347,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
break;
}
// 1.7.13: 推送瓜子
TGzPushEntry tGzPushEntry = new TGzPushEntry();
tGzPushEntry.setCreateBy(userId);
tGzPushEntry.setCreateName(nickname);
tGzPushEntry.setBizId(gzOfferInfo.getBizId());
tGzPushEntry.setTaskType(updStatus);
tGzPushEntry.setName(gzOfferInfo.getName());
tGzPushEntry.setNationalId(gzOfferInfo.getNationalId());
tGzPushEntryService.addPushEntry(tGzPushEntry);
LGuaziOfferRecordVo lGuaziOfferRecordVo = new LGuaziOfferRecordVo();
// 存变更前后的状态到 状态数组里
List<String> changeStatusList = new ArrayList<>();
......
......@@ -141,6 +141,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
private final TGzContractService tGzContractService;
private final TGzPushEntryService tGzPushEntryService;
@Autowired
private OSSUtil ossUtil;
......@@ -2636,6 +2638,15 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
// 合同审核通过 生成瓜子档案里的合同信息
tGzContractService.saveContractInfoToGzEmpInfo(c, gzOfferInfo.getId(), gzOfferInfo.getWorkLocation(),gzOfferInfo.getWorkLocationDescr());
// 1.7.13: 合同审核通过:推送瓜子 合同信息
TGzPushEntry tGzPushEntry = new TGzPushEntry();
tGzPushEntry.setCreateBy(vo.getCreateBy());
tGzPushEntry.setCreateName(vo.getCreateName());
tGzPushEntry.setBizId(gzOfferInfo.getBizId());
tGzPushEntry.setTaskType(CommonConstants.EIGHT_STRING);
tGzPushEntry.setName(gzOfferInfo.getName());
tGzPushEntry.setNationalId(gzOfferInfo.getNationalId());
tGzPushEntryService.addPushEntry(tGzPushEntry);
// 瓜子状态变更增加操作日志
LGuaziOfferRecordVo lGuaziOfferRecordVo = new LGuaziOfferRecordVo();
......@@ -2770,14 +2781,26 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
.eq(TGzOfferInfo::getDelFlag,CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(gzOfferInfo)) {
// 13:待签署 更新 入职日期为合同开始时间
gzOfferInfo.setExpEntryDate(contract.getContractStart());
gzOfferInfo.setOfferStatus(CommonConstants.THIRTEEN_STRING);
gzOfferInfoMapper.updateById(gzOfferInfo);
// 1.7.13: 合同提交申请:推送瓜子 更新状态
TGzPushEntry tGzPushEntry = new TGzPushEntry();
tGzPushEntry.setCreateBy(contract.getCreateBy());
tGzPushEntry.setCreateName(contract.getCreateName());
tGzPushEntry.setBizId(gzOfferInfo.getBizId());
tGzPushEntry.setTaskType(CommonConstants.THIRTEEN_STRING);
tGzPushEntry.setName(gzOfferInfo.getName());
tGzPushEntry.setNationalId(gzOfferInfo.getNationalId());
tGzPushEntryService.addPushEntry(tGzPushEntry);
// 瓜子状态变更增加操作日志
LGuaziOfferRecordVo lGuaziOfferRecordVo = new LGuaziOfferRecordVo();
// 存变更前后的状态到 状态数组里
List<String> changeStatusList = new ArrayList<>();
changeStatusList.add(gzOfferInfo.getOfferStatus());
changeStatusList.add("97");
changeStatusList.add(CommonConstants.THIRTEEN_STRING);
if(changeStatusList.size() > 0){
......@@ -2832,36 +2855,29 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
employeeInfo.setContactAddress(empAdd.getContactAddress());
if (empAdd.getHignEducation().equals("文盲")) {
employeeInfo.setHignEducation("1");
}
if (empAdd.getHignEducation().equals("小学")) {
}else if (empAdd.getHignEducation().equals("小学")) {
employeeInfo.setHignEducation("2");
}
if (empAdd.getHignEducation().equals("初中")) {
}else if (empAdd.getHignEducation().equals("初中")) {
employeeInfo.setHignEducation("3");
}
if (empAdd.getHignEducation().equals("高中")) {
}else if (empAdd.getHignEducation().equals("高中")) {
employeeInfo.setHignEducation("4");
}
if (empAdd.getHignEducation().equals("大专")) {
}else if (empAdd.getHignEducation().equals("大专")) {
employeeInfo.setHignEducation("5");
}
if (empAdd.getHignEducation().equals("本科")) {
}else if (empAdd.getHignEducation().equals("本科")) {
employeeInfo.setHignEducation("6");
}
if (empAdd.getHignEducation().equals("硕士")) {
}else if (empAdd.getHignEducation().equals("硕士")) {
employeeInfo.setHignEducation("7");
}
if (empAdd.getHignEducation().equals("博士")) {
}else if (empAdd.getHignEducation().equals("博士")) {
employeeInfo.setHignEducation("8");
}
if (empAdd.getHignEducation().equals("技工")) {
}else if (empAdd.getHignEducation().equals("技工")) {
employeeInfo.setHignEducation("9");
}
if (empAdd.getHignEducation().equals("职高")) {
}else if (empAdd.getHignEducation().equals("职高")) {
employeeInfo.setHignEducation("10");
}
if (empAdd.getHignEducation().equals("中专")) {
}else if (empAdd.getHignEducation().equals("中专")) {
employeeInfo.setHignEducation("11");
}else {
//优化 如果非设定的最高学历 直接默认空
employeeInfo.setHignEducation(null);
}
if ("5".equals(employeeInfo.getHignEducation())
|| "6".equals(employeeInfo.getHignEducation())
......
......@@ -16,19 +16,25 @@
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TAttaInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzEmpInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TGzEmpInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TAttaInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TGzContractService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
/**
* 瓜子合同提取方法
......@@ -43,6 +49,8 @@ public class TGzContractServiceImpl implements TGzContractService {
private final TGzEmpInfoMapper tGzEmpInfoMapper;
private final TAttaInfoService tAttaInfoService;
/**
* 生成瓜子档案里的合同信息
* chenyx
......@@ -57,7 +65,10 @@ public class TGzContractServiceImpl implements TGzContractService {
TGzEmpInfo gzEmpInfo = tGzEmpInfoMapper.getInfoByOfferId(offerId);
if (Common.isNotNull(gzEmpInfo)) {
// 确认 用合同编号(用户在页面上填写的)
gzEmpInfo.setContractNum(contractInfo.getContractNo());
// gzEmpInfo.setContractNum(contractInfo.getContractNo());
// 1.7.13: 换成用合同申请号
gzEmpInfo.setContractNum(contractInfo.getApplyNo());
// 客服申请处选择“标准合同”传“外签-劳动合同 ”;“实习协议”传“外签-实习协议 ”
if ("标准合同".equals(contractInfo.getContractName())) {
gzEmpInfo.setContractType("1E");
......@@ -107,4 +118,33 @@ public class TGzContractServiceImpl implements TGzContractService {
}
}
/**
* 存合同附件到瓜子档案里
* chenyx
*
* @param offerId offerId
* @param contractId 合同ID
*/
@Override
public void saveContractAtta(Integer offerId, String contractId) {
TGzEmpInfo gzEmpInfo = tGzEmpInfoMapper.getInfoByOfferId(offerId);
if(Common.isNotNull(gzEmpInfo)){
// 获取合同归档附件
List<TAttaInfo> contractAttas = tAttaInfoService.list(Wrappers.<TAttaInfo>query().lambda().eq(TAttaInfo::getDomainId, contractId));
if (Common.isNotNull(contractAttas)) {
for (TAttaInfo attaInfo : contractAttas) {
// 附件赋值
TAttaInfo gzContractAtta = new TAttaInfo();
BeanUtils.copyProperties(attaInfo, gzContractAtta);
gzContractAtta.setDomainId(gzEmpInfo.getId());
gzContractAtta.setRelationType("CONTRACT");
gzContractAtta.setId(null);
gzContractAtta.setCreateBy("1");
gzContractAtta.setCreateName("系统");
gzContractAtta.setCreateTime(LocalDateTime.now());
tAttaInfoService.save(gzContractAtta);
}
}
}
}
}
......@@ -28,9 +28,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.AreaMap;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.*;
import com.yifu.cloud.plus.v1.yifu.archives.service.LGuaziOfferRecordService;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.service.TPreEmpDeclarationService;
import com.yifu.cloud.plus.v1.yifu.archives.util.IdCardUtil;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
......@@ -45,6 +43,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.security.core.GrantedAuthority;
......@@ -57,7 +56,6 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URL;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
......@@ -116,6 +114,8 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI
// 员工家庭信息表
private final TEmpFamilyService tEmpFamilyService;
private final TGzPushEntryService tGzPushEntryService;
/**
* 瓜子档案表简单分页查询
......@@ -510,6 +510,26 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI
// 记录状态变更的offer操作日志 记录来源: 6:(系统触发)C端采集提交
this.saveOfferStatusRecord(gzOfferInfo.getId(),CommonConstants.SIX_STRING,
CommonConstants.NINE_STRING,gzOfferInfo.getOfferStatus(),"0","系统触发");
// 1.7.13: 同一个流程ID推送过12:候选人信息审核,之前没推送过这个状态的,才触发推送
TGzPushEntry findFailInfo = tGzPushEntryService.getOne(Wrappers.<TGzPushEntry>query().lambda()
.eq(TGzPushEntry::getBizId, gzOfferInfo.getBizId())
.eq(TGzPushEntry::getTaskType, "12")
.eq(TGzPushEntry::getDelFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(findFailInfo)) {
// 推送状态给瓜子
if(!CommonConstants.ZERO_STRING.equals(gzOfferInfo.getBizId())){
TGzPushEntry tGzPushEntry = new TGzPushEntry();
tGzPushEntry.setCreateBy(user.getId());
tGzPushEntry.setCreateName(user.getNickname());
tGzPushEntry.setBizId(gzOfferInfo.getBizId());
tGzPushEntry.setTaskType("12");
tGzPushEntry.setName(gzOfferInfo.getName());
tGzPushEntry.setNationalId(gzOfferInfo.getNationalId());
tGzPushEntryService.addPushEntry(tGzPushEntry);
}
}
}
String gzEmpId = tGzEmpInfoVo.getId();
......@@ -834,6 +854,51 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI
return R.ok();
}
/**
* @param gzEmpId
* @Description: 推送给瓜子的档案信息
* @Author: hgw
* @Date: 2025/7/10 15:33
* @return: com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVo
**/
@Override
public TGzEmpInfoPushGzVo getGzEmpInfoToPushGzById(String gzEmpId) {
TGzEmpInfoPushGzVo vo = baseMapper.getGzEmpInfoToPushGzById(gzEmpId);
TGzEmpInfoPushGzVoAdress address = baseMapper.getGzEmpInfoToPushGzByIdAdress(gzEmpId);
TGzEmpInfoPushGzVoBank bank = baseMapper.getGzEmpInfoToPushGzByIdBank(gzEmpId);
List<TGzEmpInfoPushGzVoFamily> family = baseMapper.getGzEmpInfoToPushGzByIdFamily(gzEmpId);
List<TGzEmpInfoPushGzVoContact> contact = baseMapper.getGzEmpInfoToPushGzByIdContact(gzEmpId);
List<TGzEmpInfoPushGzVoWork> work = baseMapper.getGzEmpInfoToPushGzByIdWork(gzEmpId);
List<TGzEmpInfoPushGzVoEducation> education = baseMapper.getGzEmpInfoToPushGzByIdEducation(gzEmpId);
List<TGzEmpInfoPushGzVoSkill> skill = baseMapper.getGzEmpInfoToPushGzByIdSkill(gzEmpId);
String[] directlyCityArr = {"110000", "120000", "310000", "500000"};
// 特殊处理: 是4个直辖市的,市编码和省编码一致
if (ArrayUtils.contains(directlyCityArr, vo.getHukouProvince())) {
vo.setHukouCity(vo.getHukouProvince());
}
if (ArrayUtils.contains(directlyCityArr, address.getStateId())) {
address.setCityId(address.getStateId());
}
//List<TGzEmpInfoPushGzVoAtta> atta = baseMapper.getGzEmpInfoToPushGzByIdAtta(gzEmpId);
vo.setAddress(address);
vo.setBankAccount(bank);
vo.setFamily(family);
vo.setEmergContact(contact);
vo.setWorkExp(work);
vo.setEduExp(education);
vo.setSkill(skill);
//vo.setAttach(atta);
return vo;
}
@Override
public TGzEmpInfoPushGzContractVo getGzEmpInfoToPushGzByIdContract(String gzEmpId) {
return baseMapper.getGzEmpInfoToPushGzByIdContract(gzEmpId);
}
private TEmployeeInfo saveEmployeeInfo(TGzEmpInfo gzEmpInfo, YifuUser user, String empIdCard
, Map<String, Map<String,String>> dictMap, String firstWorkFlag, TGzEmpEducation education) {
// 查找档案、项目档案,无则新建
......
......@@ -31,9 +31,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzOfferInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TRegisteWarningEmployee;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.EmployeeRegistrationPreMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TGzOfferInfoMapper;
......@@ -51,6 +49,7 @@ import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.ArrayUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -86,9 +85,6 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
// 瓜子合同信息提取方法————因为循环调用了
private final TGzContractService tGzContractService;
@Autowired
private UpmsDaprUtils upmsDaprUtils;
// 禁止手动变更的状态:3:待发送Offer,9:候选人填写信息,12:候选人信息审核,13:待签署,8:合同审核通过,99:已归档,97:候选人审核通过
private final String[] forbidStatusArr = {"3", "9", "12", "13", "8","99","97"};
......@@ -100,6 +96,8 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
private final TGzEmpInfoService tGzEmpInfoService;
private final TGzPushEntryService tGzPushEntryService;
/**
* 瓜子offer信息接收表简单分页查询
* @param tGzOfferInfo 瓜子offer信息接收表
......@@ -242,6 +240,18 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
this.saveOfferStatusRecord(tGzOfferInfo.getId(),CommonConstants.ONE_STRING,
findInfo.getOfferStatus(),tGzOfferInfo.getOfferStatus(),user.getId(),user.getNickname());
// 1.7.13:推送状态给瓜子
if(!CommonConstants.ZERO_STRING.equals(findInfo.getBizId())){
TGzPushEntry tGzPushEntry = new TGzPushEntry();
tGzPushEntry.setCreateBy(user.getId());
tGzPushEntry.setCreateName(user.getNickname());
tGzPushEntry.setBizId(findInfo.getBizId());
tGzPushEntry.setTaskType(tGzOfferInfo.getOfferStatus());
tGzPushEntry.setName(findInfo.getName());
tGzPushEntry.setNationalId(findInfo.getNationalId());
tGzPushEntryService.addPushEntry(tGzPushEntry);
}
return R.ok(CommonConstants.RESULT_DATA_SUCESS);
}
......@@ -285,6 +295,18 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
return saveEmpInfoR;
}
// 1.7.13:推送档案信息给瓜子
if(!CommonConstants.ZERO_STRING.equals(findInfo.getBizId())){
TGzPushEntry tGzPushEntry = new TGzPushEntry();
tGzPushEntry.setCreateBy(user.getId());
tGzPushEntry.setCreateName(user.getNickname());
tGzPushEntry.setBizId(findInfo.getBizId());
tGzPushEntry.setTaskType("97");
tGzPushEntry.setName(findInfo.getName());
tGzPushEntry.setNationalId(findInfo.getNationalId());
tGzPushEntryService.addPushEntry(tGzPushEntry);
}
// 2、检查 该项目该人员是否有在途或审核通过或已归档的状态为“可用”的合同,
// 若有则根据当前状态更新Offer状态,合同未审核通过:存【13:待签署】;合同审核通过:存【8:合同审核通过】;合同已归档:存【99:已归档】,
// 存合同信息;
......@@ -304,6 +326,12 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
this.saveOfferStatusRecord(findInfo.getId(),CommonConstants.SEVEN_STRING,
findInfo.getOfferStatus(),tGzOfferInfo.getOfferStatus(),user.getId(),user.getNickname());
// 1.7.13 变更到合同相关的状态,推合同信息给瓜子
if(CommonConstants.THIRTEEN_STRING.equals(tGzOfferInfo.getOfferStatus())
|| CommonConstants.EIGHT_STRING.equals(tGzOfferInfo.getOfferStatus()) || "99".equals(tGzOfferInfo.getOfferStatus())){
this.pushContractData(findInfo, user, tGzOfferInfo.getOfferStatus());
}
return R.ok(CommonConstants.RESULT_DATA_SUCESS);
}
......@@ -324,11 +352,14 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
.eq(TEmployeeContractInfo::getEmpIdcard, nationalId)
.last(CommonConstants.LAST_ONE_SQL));
if(Common.isNotNull(contractInfo)){
// 合同已归档
// 合同已归档,多存一个合同归档附件
if(CommonConstants.ZERO_STRING.equals(contractInfo.getIsFile())
&& CommonConstants.ZERO_STRING.equals(contractInfo.getInUse())){
// 生成瓜子档案里的合同信息
tGzContractService.saveContractInfoToGzEmpInfo(contractInfo, offerId, workLocation, workLocationDescr);
// 1.7.13: 存合同附件
tGzContractService.saveContractAtta(offerId, contractInfo.getId());
return "99";
}
// 合同审核通过
......@@ -340,6 +371,12 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
}
// 合同已提交待审核
if(CommonConstants.ONE_INTEGER.equals(contractInfo.getAuditStatus())){
// 1.7.13: 待签署 更新 入职日期为合同开始时间
LambdaUpdateWrapper<TGzOfferInfo> updateOfferWrapper = new LambdaUpdateWrapper<>();
updateOfferWrapper.eq(TGzOfferInfo::getId, offerId)
.set(TGzOfferInfo::getExpEntryDate, contractInfo.getContractStart());
this.update(null, updateOfferWrapper);
return CommonConstants.THIRTEEN_STRING;
}
}
......@@ -347,6 +384,64 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
return changeStatus;
}
/**
* 1.7.13 推合同信息
* @param findInfo offer信息
* @param user 登录用户
* @param offerStatus offer状态
*/
private void pushContractData(TGzOfferInfo findInfo,YifuUser user, String offerStatus){
if(!CommonConstants.ZERO_STRING.equals(findInfo.getBizId())){
// 推送 瓜子状态 待签署
TGzPushEntry tGzPushEntry = new TGzPushEntry();
tGzPushEntry.setCreateBy(user.getId());
tGzPushEntry.setCreateName(user.getNickname());
tGzPushEntry.setBizId(findInfo.getBizId());
tGzPushEntry.setTaskType(CommonConstants.THIRTEEN_STRING);
tGzPushEntry.setName(findInfo.getName());
tGzPushEntry.setNationalId(findInfo.getNationalId());
// 推合同信息
TGzPushEntry tGzPushEntry1 = new TGzPushEntry();
tGzPushEntry1.setCreateBy(user.getId());
tGzPushEntry1.setCreateName(user.getNickname());
tGzPushEntry1.setBizId(findInfo.getBizId());
tGzPushEntry1.setTaskType(CommonConstants.EIGHT_STRING);
tGzPushEntry1.setName(findInfo.getName());
tGzPushEntry1.setNationalId(findInfo.getNationalId());
// 推合同附件信息
TGzPushEntry tGzPushEntry2 = new TGzPushEntry();
tGzPushEntry2.setCreateBy(user.getId());
tGzPushEntry2.setCreateName(user.getNickname());
tGzPushEntry2.setBizId(findInfo.getBizId());
tGzPushEntry2.setTaskType("99");
tGzPushEntry2.setName(findInfo.getName());
tGzPushEntry2.setNationalId(findInfo.getNationalId());
// offer状态是待签署,只推状态
if(CommonConstants.THIRTEEN_STRING.equals(offerStatus)){
tGzPushEntryService.addPushEntry(tGzPushEntry);
}
// offer状态是合同审核通过 ,推待签署状态 + 推合同信息
if(CommonConstants.EIGHT_STRING.equals(offerStatus)){
// 先推 瓜子状态 待签署
tGzPushEntryService.addPushEntry(tGzPushEntry);
// 推合同信息
tGzPushEntryService.addPushEntry(tGzPushEntry1);
}
// offer状态是已归档 ,推待签署状态 + 推合同信息 + 推合同附件
if("99".equals(offerStatus)){
// 先推 瓜子状态 待签署
tGzPushEntryService.addPushEntry(tGzPushEntry);
// 推合同信息
tGzPushEntryService.addPushEntry(tGzPushEntry1);
// 推合同附件信息
tGzPushEntryService.addPushEntry(tGzPushEntry2);
}
}
}
/**
* 获取当前状态下,允许更新的状态列表
*
......@@ -363,13 +458,13 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
}
// 4:待接受Offer
if (CommonConstants.FOUR_STRING.equals(orgStatus)) {
// 可更新为:5:拒绝Offer、7:接受offer、10:取消offer
// 可更新为:5:拒绝Offer、7->6:接受offer、10:取消offer
allowUpdateStatusList.add(CommonConstants.FIVE_STRING);
allowUpdateStatusList.add(CommonConstants.SEVEN_STRING);
allowUpdateStatusList.add(CommonConstants.SIX_STRING);
allowUpdateStatusList.add(CommonConstants.TEN_STRING);
}
// 7:接受Offer
if (CommonConstants.SEVEN_STRING.equals(orgStatus)) {
// 7->6:接受Offer
if (CommonConstants.SIX_STRING.equals(orgStatus)) {
// 可更新为:98:信息待收集、10:取消offer
allowUpdateStatusList.add("98");
allowUpdateStatusList.add(CommonConstants.TEN_STRING);
......@@ -605,6 +700,18 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
// 更新前状态是 98:信息待收集,短信发送成功后,记录状态变更
if("98".equals(sendVo.getOfferStatus())){
changeOfferIds.add(sendVo.getId());
// 1.7.13:推送状态[候选人填写信息]给瓜子
if(!CommonConstants.ZERO_STRING.equals(sendVo.getBizId())){
TGzPushEntry tGzPushEntry = new TGzPushEntry();
tGzPushEntry.setCreateBy(user.getId());
tGzPushEntry.setCreateName(user.getNickname());
tGzPushEntry.setBizId(sendVo.getBizId());
tGzPushEntry.setTaskType("9");
tGzPushEntry.setName(sendVo.getName());
tGzPushEntry.setNationalId(sendVo.getNationalId());
tGzPushEntryService.addPushEntry(tGzPushEntry);
}
}
// 记录发送短信成功的offerId 到集合
successOfferIds.add(sendVo.getId());
......@@ -1016,6 +1123,18 @@ public class TGzOfferInfoServiceImpl extends ServiceImpl<TGzOfferInfoMapper, TGz
// 记录状态变更的offer操作日志 记录来源: 手动更新状态
this.saveOfferStatusRecord(findInfo.getId(),CommonConstants.ONE_STRING,
findInfo.getOfferStatus(),tGzOfferInfo.getOfferStatus(),user.getId(),user.getNickname());
// 1.7.13:推送状态给瓜子
if(!CommonConstants.ZERO_STRING.equals(findInfo.getBizId())){
TGzPushEntry tGzPushEntry = new TGzPushEntry();
tGzPushEntry.setCreateBy(user.getId());
tGzPushEntry.setCreateName(user.getNickname());
tGzPushEntry.setBizId(findInfo.getBizId());
tGzPushEntry.setTaskType(tGzOfferInfo.getOfferStatus());
tGzPushEntry.setName(findInfo.getName());
tGzPushEntry.setNationalId(findInfo.getNationalId());
tGzPushEntryService.addPushEntry(tGzPushEntry);
}
}
if(Common.isEmpty(updateFailOfferList)){
......
/*
* 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.archives.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzPushEntry;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TGzPushEntryMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TGzPushEntryService;
import com.yifu.cloud.plus.v1.yifu.archives.utils.DoJointTask;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzPushEntrySearchVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.time.LocalDateTime;
/**
* 瓜子系统交互任务跟进表
*
* @author cyx
* @date 2025-07-09 17:03:50
*/
@Log4j2
@Service
@RequiredArgsConstructor
public class TGzPushEntryServiceImpl extends ServiceImpl<TGzPushEntryMapper, TGzPushEntry> implements TGzPushEntryService {
@Autowired
@Lazy
private DoJointTask doJointTask;
// 任务类型是改状态的: 4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署
private final String[] taskTypeArr = {"4", "5", "6", "9", "10", "12", "13", "97", "8", "99"};
/**
* 瓜子系统交互任务跟进表简单分页查询
*
* @param tGzPushEntry 瓜子系统交互任务跟进表
* @return
*/
@Override
public IPage<TGzPushEntrySearchVo> getTGzPushEntryPage(Page<TGzPushEntry> page, TGzPushEntrySearchVo tGzPushEntry) {
return baseMapper.getTGzPushEntryPage(page, tGzPushEntry);
}
/**
* 任务推送重试
*
* @param tGzPushEntry 瓜子系统交互任务跟进表
* @return R
*/
@Override
public R<String> retryPushEntry(TGzPushEntry tGzPushEntry) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed(CommonConstants.PLEASE_LOG_IN);
}
if (Common.isEmpty(tGzPushEntry.getId())) {
return R.failed(CommonConstants.PARAM_IS_NOT_EMPTY);
}
// 获取推送失败的数据信息
TGzPushEntry findInfo = this.getOne(Wrappers.<TGzPushEntry>query().lambda()
.eq(TGzPushEntry::getId, tGzPushEntry.getId())
.eq(TGzPushEntry::getPushStatus, CommonConstants.ONE_STRING)
.eq(TGzPushEntry::getDelFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(findInfo)) {
return R.failed(CommonConstants.ERROR_NO_DOMAIN);
}
// 先改为推送中
findInfo.setPushTime(LocalDateTime.now());
findInfo.setPushStatus(CommonConstants.THREE_STRING);
findInfo.setFailReason("");
findInfo.setUpdateBy(user.getId());
findInfo.setUpdateTime(LocalDateTime.now());
this.updateById(tGzPushEntry);
// 改为异步处理
doJointTask.handleGzPushEntry(findInfo);
return R.ok("已发起重新推送,正在后台推送中...稍后请刷新页面查看结果");
}
/**
* 新增推送任务
*
* @param tGzPushEntry 瓜子系统交互任务跟进表
*/
@Override
public void addPushEntry(TGzPushEntry tGzPushEntry) {
// 流程是0的,不推送
if(CommonConstants.ZERO_STRING.equals(tGzPushEntry.getBizId())){
return;
}
// 仅存指定状态的任务
if (!ArrayUtils.contains(taskTypeArr, tGzPushEntry.getTaskType())) {
return;
}
// offer状态是 7 的,改为推送 6
if(CommonConstants.SEVEN_STRING.equals(tGzPushEntry.getTaskType())){
tGzPushEntry.setTaskType(CommonConstants.SIX_STRING);
}
// 新建任务,先存为"待推送"
tGzPushEntry.setPushStatus(CommonConstants.TWO_STRING);
tGzPushEntry.setCreateTime(LocalDateTime.now());
tGzPushEntry.setDelFlag(CommonConstants.NOT_DELETE_FLAG);
this.save(tGzPushEntry);
// 除了本次任务,获取是否有【推送失败、待推送、推送中】的任务,有的话本次不推送,存为“待推送”就结束
TGzPushEntry findBizFailInfo = this.getOne(Wrappers.<TGzPushEntry>query().lambda()
.eq(TGzPushEntry::getBizId, tGzPushEntry.getBizId())
.ne(TGzPushEntry::getId, tGzPushEntry.getId())
.in(TGzPushEntry::getPushStatus, CommonConstants.ONE_STRING, CommonConstants.TWO_STRING, CommonConstants.THREE_STRING)
.eq(TGzPushEntry::getDelFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(findBizFailInfo)) {
return;
}
tGzPushEntry.setUpdateBy(tGzPushEntry.getCreateBy());
// 改为异步处理
doJointTask.handleGzPushEntry(tGzPushEntry);
}
}
/*
* 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.archives.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yifu.cloud.plus.v1.yifu.archives.config.GzConfig;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TGzEmpInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TGzOfferInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.time.LocalDateTime;
import java.util.*;
/**
* 瓜子系统交互任务处理异步任务类
*
* @author chenyuxi
* @date 2025-07-11
* @since 1.7.13
*/
@Log4j2
@Service
@RequiredArgsConstructor
public class TGzPushHandleServiceImpl implements TGzPushHandleService {
private final TGzPushEntryService tGzPushEntryService;
private final TGzEmpInfoMapper tGzEmpInfoMapper;
private final TGzOfferInfoMapper tGzOfferInfoMapper;
private final TGzEmpInfoService tGzEmpInfoService;
private final TAttaInfoService tAttaInfoService;
@Autowired
private GzConfig gzConfig;
@Autowired
private OSSUtil ossUtil;
private RestTemplate restTemplate = new RestTemplate();
// 任务类型是改状态的: 4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署
private final String[] taskTypeArr = {"4", "5", "6", "9", "10", "12", "13"};
/**
* 处理异步的推送任务
*
* @param tGzPushEntry 瓜子系统交互任务跟进表
*/
@Override
public void handlePushEntry(TGzPushEntry tGzPushEntry) {
// 先改为推送中
tGzPushEntry.setFailReason("");
tGzPushEntry.setPushTime(LocalDateTime.now());
tGzPushEntry.setPushStatus(CommonConstants.THREE_STRING);
tGzPushEntry.setUpdateTime(LocalDateTime.now());
tGzPushEntryService.updateById(tGzPushEntry);
// 判断推送任务: 如果任务类型是改状态的,直接获取任务记录里的数据推送
if (ArrayUtils.contains(taskTypeArr, tGzPushEntry.getTaskType())) {
// 状态推送任务
this.pushStatusTask(tGzPushEntry);
} else {
// 97:档案信息推送,8:合同信息推送,99:合同附件推送
if("97".equals(tGzPushEntry.getTaskType())){
this.pushEmpTask(tGzPushEntry);
}
if("8".equals(tGzPushEntry.getTaskType())){
this.pushContractTask(tGzPushEntry);
}
if("99".equals(tGzPushEntry.getTaskType())){
this.pushContractAttaTask(tGzPushEntry);
}
}
tGzPushEntry.setUpdateTime(LocalDateTime.now());
tGzPushEntryService.updateById(tGzPushEntry);
// 如果推送结果是成功,再获取【同一个流程ID最早一个未推送状态的数据】进行推送,
// 推送成功更新数据,继续获取【同一个流程ID最早一个未推送状态的数据】
if(CommonConstants.ZERO_STRING.equals(tGzPushEntry.getPushStatus())){
this.pushWaitEntry(tGzPushEntry);
}
}
/**
* 判断是否继续推 待推送
*
* @param tGzPushEntry 瓜子系统交互任务跟进表
* @return R
*/
private void pushWaitEntry(TGzPushEntry tGzPushEntry) {
// 获取下一个待推送的数据
TGzPushEntry findWaitInfo = tGzPushEntryService.getOne(Wrappers.<TGzPushEntry>query().lambda()
.eq(TGzPushEntry::getBizId, tGzPushEntry.getBizId())
.eq(TGzPushEntry::getPushStatus, CommonConstants.TWO_STRING)
.eq(TGzPushEntry::getDelFlag, CommonConstants.ZERO_STRING)
.orderByAsc(TGzPushEntry::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(findWaitInfo)) {
return;
}
// 先改为推送中
findWaitInfo.setFailReason("");
findWaitInfo.setPushTime(LocalDateTime.now());
findWaitInfo.setPushStatus(CommonConstants.THREE_STRING);
findWaitInfo.setUpdateTime(LocalDateTime.now());
tGzPushEntryService.updateById(findWaitInfo);
// 如果任务类型是改状态的,直接获取任务记录里的数据推送
if (ArrayUtils.contains(taskTypeArr, findWaitInfo.getTaskType())) {
// 更新推送信息
this.pushStatusTask(findWaitInfo);
} else {
// 如果任务类型是:推数据,重新获取档案里的数据推送
// 97:档案信息推送,8:合同信息推送,99:合同附件推送
if("97".equals(findWaitInfo.getTaskType())){
this.pushEmpTask(findWaitInfo);
}
if("8".equals(findWaitInfo.getTaskType())){
this.pushContractTask(findWaitInfo);
}
if("99".equals(findWaitInfo.getTaskType())){
this.pushContractAttaTask(findWaitInfo);
}
}
findWaitInfo.setUpdateBy(tGzPushEntry.getUpdateBy());
findWaitInfo.setUpdateTime(LocalDateTime.now());
tGzPushEntryService.updateById(findWaitInfo);
// 推送成功更新数据,继续获取【同一个流程ID最早一个未推送状态的数据】
if(CommonConstants.ZERO_STRING.equals(findWaitInfo.getPushStatus())){
this.pushWaitEntry(findWaitInfo);
}
}
/**
* 对接瓜子-进行状态任务推送
*
* @param pushInfo 瓜子系统交互任务跟进表
*/
private void pushStatusTask(TGzPushEntry pushInfo) {
// 赋值传参
Map<String, Object> params = new HashMap<>();
params.put("bizId", pushInfo.getBizId());
params.put("status", pushInfo.getTaskType());
// 获取offer的信息,拿邮箱和手机号
TGzOfferInfo findOffer = tGzOfferInfoMapper.selectOne(Wrappers.<TGzOfferInfo>query().lambda()
.eq(TGzOfferInfo::getBizId, pushInfo.getBizId())
.eq(TGzOfferInfo::getDelFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if(Common.isNotNull(findOffer)){
params.put("phone", findOffer.getPhone());
params.put("email", findOffer.getEmail());
}
// taskType == 13:待签署 推入职日期
if(CommonConstants.THIRTEEN_STRING.equals(pushInfo.getTaskType())){
params.put("entryDate", DateUtil.dateToString(findOffer.getExpEntryDate(),DateUtil.ISO_EXPANDED_DATE_FORMAT));
}
// 调瓜子接口
Map<String,String> returnMap = gzConfig.updateGzOfferStatus(restTemplate, params);
// 公共处理瓜子返回的信息
this.handlePushReturnCommon(pushInfo, returnMap);
}
/**
* 对接瓜子-档案推送
*
* @param pushInfo 瓜子系统交互任务跟进表
*/
private void pushEmpTask(TGzPushEntry pushInfo) {
// 根据流程ID获取档案信息
TGzEmpInfo findEmpInfo = this.getEmpInfoCommon(pushInfo.getBizId());
if (Common.isNotNull(findEmpInfo)) {
// 调瓜子接口:获取档案附件,先上传档案附件给瓜子,再推档案信息
// 1、获取档案附件
List<TGzEmpInfoPushGzVoAtta> gzEmpAttaList = new ArrayList<>();
List<TAttaInfo> aList = tAttaInfoService.list(Wrappers.<TAttaInfo>query().lambda()
.eq(TAttaInfo::getDomainId, findEmpInfo.getId())
.notIn(TAttaInfo::getRelationType, "41","42","43","CONTRACT"));
if(Common.isNotNull(aList)){
TGzEmpInfoPushGzFileVo vo;
TGzEmpInfoPushGzVoAtta attaVo;
String bizId = pushInfo.getBizId();
String fileId;
URL url;
InputStream inStream = null;
String base64String;
for (TAttaInfo a : aList) {
// 2、上传档案附件给瓜子
if (Common.isNotNull(a.getAttaSrc())) {
url = ossUtil.getObjectUrl(null, a.getAttaSrc());
try {
inStream = url.openStream();
base64String = Base64.getEncoder().encodeToString(IOUtils.toByteArray(inStream));
vo = new TGzEmpInfoPushGzFileVo();
vo.setBizId(bizId);
vo.setFileName(a.getAttaName());
// 文件数据 Base64
vo.setFileData(base64String);
// 调瓜子上传附件接口,得到瓜子存储附件的ID
fileId = gzConfig.pushGzFile(restTemplate, vo);
// 组装档案附件列表
attaVo = new TGzEmpInfoPushGzVoAtta();
attaVo.setFileId(fileId);
attaVo.setAttachType(a.getRelationType());
attaVo.setFileName(a.getAttaName());
gzEmpAttaList.add(attaVo);
} catch (Exception e) {
log.error("瓜子档案附件推送失败!", e);
} finally {
if (null != inStream) {
try {
inStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
}
// 3、获取档案信息
TGzEmpInfoPushGzVo gzPushEmpInfo = tGzEmpInfoService.getGzEmpInfoToPushGzById(findEmpInfo.getId());
gzPushEmpInfo.setAttach(gzEmpAttaList);
// 4、推送瓜子档案
Map<String,String> returnMap = gzConfig.pushGzEmpInfo(restTemplate, gzPushEmpInfo);
// 公共处理瓜子返回的信息
this.handlePushReturnCommon(pushInfo, returnMap);
// 改档案里的【档案推送状态】为 已推送
if(CommonConstants.GZ_SUCCESS_CODE.equals(returnMap.get("responseCode"))){
LambdaUpdateWrapper<TGzEmpInfo> updateEmpWrapper = new LambdaUpdateWrapper<>();
updateEmpWrapper.eq(TGzEmpInfo::getBizId, pushInfo.getBizId())
.set(TGzEmpInfo::getEmpPushStatus, CommonConstants.ONE_STRING);
tGzEmpInfoService.update(null, updateEmpWrapper);
}
}
}
/**
* 对接瓜子-合同信息推送
*
* @param pushInfo 瓜子系统交互任务跟进表
*/
private void pushContractTask(TGzPushEntry pushInfo) {
// 根据流程ID获取档案信息
TGzEmpInfo findEmpInfo = this.getEmpInfoCommon(pushInfo.getBizId());
if (Common.isNotNull(findEmpInfo)) {
// 调瓜子接口
TGzEmpInfoPushGzContractVo gzPushContractInfo = tGzEmpInfoService.getGzEmpInfoToPushGzByIdContract(findEmpInfo.getId());
Map<String,String> returnMap = gzConfig.pushGzEmpContract(restTemplate, gzPushContractInfo);
// 公共处理瓜子返回的信息
this.handlePushReturnCommon(pushInfo, returnMap);
// 改档案里的【合同信息推送状态】状态为 已推送
if(CommonConstants.GZ_SUCCESS_CODE.equals(returnMap.get("responseCode"))){
LambdaUpdateWrapper<TGzEmpInfo> updateEmpWrapper = new LambdaUpdateWrapper<>();
updateEmpWrapper.eq(TGzEmpInfo::getBizId, pushInfo.getBizId())
.set(TGzEmpInfo::getContractPushStatus, CommonConstants.ONE_STRING);
tGzEmpInfoService.update(null, updateEmpWrapper);
}
}
}
/**
* 根据流程ID获取瓜子档案信息
*
* @param bizId 瓜子流程ID
*/
private TGzEmpInfo getEmpInfoCommon(String bizId) {
return tGzEmpInfoMapper.selectOne(Wrappers.<TGzEmpInfo>query().lambda()
.eq(TGzEmpInfo::getBizId, bizId)
.eq(TGzEmpInfo::getDelFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
}
/**
* 对接瓜子-合同附件推送
*
* @param pushInfo 瓜子系统交互任务跟进表
*/
private void pushContractAttaTask(TGzPushEntry pushInfo) {
// 根据流程ID获取档案信息
TGzEmpInfo findEmpInfo = this.getEmpInfoCommon(pushInfo.getBizId());
if (Common.isEmpty(findEmpInfo)) {
return;
}
// 调瓜子接口
// 1、获取合同归档附件
TAttaInfo contractAttaInfo = tAttaInfoService.getOne(Wrappers.<TAttaInfo>query().lambda()
.eq(TAttaInfo::getDomainId, findEmpInfo.getId())
.eq(TAttaInfo::getRelationType, "CONTRACT")
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isEmpty(contractAttaInfo)) {
return;
}
// 先上传附件,再推送atta与类型
if (Common.isNotNull(contractAttaInfo.getAttaSrc())) {
TGzEmpInfoPushGzFileVo pushGzFileVo;
TGzEmpInfoPushGzAttaVo attaVo;
String bizId = pushInfo.getBizId();
String fileId;
URL url;
InputStream inStream = null;
String base64String;
// 获取合同附件
url = ossUtil.getObjectUrl(null, contractAttaInfo.getAttaSrc());
try {
inStream = url.openStream();
base64String = Base64.getEncoder().encodeToString(IOUtils.toByteArray(inStream));
pushGzFileVo = new TGzEmpInfoPushGzFileVo();
pushGzFileVo.setBizId(bizId);
pushGzFileVo.setFileName(contractAttaInfo.getAttaName());
// 文件数据 Base64
pushGzFileVo.setFileData(base64String);
// 2、先推合同附件文件给瓜子,得到瓜子存储附件的ID
fileId = gzConfig.pushGzFile(restTemplate, pushGzFileVo);
// 3、带着瓜子存储附件的ID 存合同附件
attaVo = new TGzEmpInfoPushGzAttaVo();
attaVo.setBizId(bizId);
attaVo.setFileId(fileId);
attaVo.setAttachType(contractAttaInfo.getRelationType());
attaVo.setFileName(contractAttaInfo.getAttaName());
Map<String,String> returnMap = gzConfig.pushGzAttach(restTemplate, attaVo);
// 公共处理瓜子返回的信息
this.handlePushReturnCommon(pushInfo, returnMap);
// 改档案里的【合同附件推送状态】为 已推送
if(CommonConstants.GZ_SUCCESS_CODE.equals(returnMap.get("responseCode"))){
LambdaUpdateWrapper<TGzEmpInfo> updateEmpWrapper = new LambdaUpdateWrapper<>();
updateEmpWrapper.eq(TGzEmpInfo::getBizId, pushInfo.getBizId())
.set(TGzEmpInfo::getContractAttaPushStatus, CommonConstants.ONE_STRING);
tGzEmpInfoService.update(null, updateEmpWrapper);
}
} catch (Exception e) {
log.error("瓜子附件推送失败!");
pushInfo.setPushStatus(CommonConstants.ONE_STRING);
pushInfo.setFailReason("瓜子合同附件推送异常!");
} finally {
if (null != inStream) {
try {
inStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
/**
* 对接瓜子-公共处理瓜子返回的信息
*
* @param pushInfo 瓜子系统交互任务信息
* @param returnMap 瓜子响应信息
*/
private void handlePushReturnCommon(TGzPushEntry pushInfo, Map<String,String> returnMap){
// 存推送报文
pushInfo.setPushData(returnMap.get("pushData"));
// 存响应结果
pushInfo.setResponseData(returnMap.get("responseData"));
// 默认推送成功
pushInfo.setPushStatus(CommonConstants.ZERO_STRING);
if(!CommonConstants.GZ_SUCCESS_CODE.equals(returnMap.get("responseCode"))){
pushInfo.setPushStatus(CommonConstants.ONE_STRING);
pushInfo.setFailReason(returnMap.get("responseMessage"));
}
pushInfo.setPushTime(LocalDateTime.now());
}
}
......@@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yifu.cloud.plus.v1.yifu.archives.entity.FddContractAttachInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzPushEntry;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeLogService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TGzPushHandleService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectNewOldVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
......@@ -39,6 +41,9 @@ public class DoJointTask {
@Autowired
private TEmployeeLogService tEmployeeLogService;
@Autowired
private TGzPushHandleService tGzPushHandleService;
/**
* @Description: 合同-批量更换负责人
* @Author: huyc
......@@ -144,4 +149,20 @@ public class DoJointTask {
}
log.info("档案-更新项目档案操作记录结束");
}
/**
* 处理推送给瓜子的交互任务
* @author chenyuxi
* @date 2025-07-11
* @since 1.7.13
**/
@Async
public void handleGzPushEntry(TGzPushEntry tGzPushEntry) {
try {
tGzPushHandleService.handlePushEntry(tGzPushEntry);
} catch (Exception e) {
log.error("处理推送给瓜子的交互任务错误", e);
}
log.info("处理推送给瓜子的交互任务结束");
}
}
......@@ -36,10 +36,10 @@ wx:
#瓜子配置
gz:
appkey: hr_eny00002_test
appsecret: hr_eny00002_test_20250620
tid: c2da1d84e9bd4a30b6be5ecd209096fb
appUrl: https://eim-busin-api-test-jwtys.guazi.com
appkey: hr_eny00002
appsecret: f30274f7b386469cb45a4e302b4b816b
tid: 189061502af84752b1842e9c1ecd03d7
appUrl: https://eimapi.guazi.com
......@@ -652,4 +652,169 @@
</if>
</select>
<!--推送瓜子的瓜子档案信息-->
<select id="getGzEmpInfoToPushGzById" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVo">
SELECT
a.biz_id AS bizId,
a.name AS name,
DATE_FORMAT(a.birthdate,'%Y-%m-%d') AS birthdate,
a.sex AS sex,
DATE_FORMAT(a.start_date,'%Y-%m-%d') AS startDate,
a.country AS country,
a.ethnic_grp_cd AS ethnicGrpCd,
a.native_place AS nativePlace,
a.blood_type AS blooeType,
a.constel,
a.phone AS phone,
a.mail AS email,
a.mar_status AS marStatus,
a.political_sta AS politicalSta,
a.insurance_sta AS insuranceSta,
a.driver_type AS driverType,
DATE_FORMAT(a.driver_licen_exp,'%Y-%m-%d') AS driverLicenExp,
a.national_id AS nationalId,
a.national_id_type AS nationalIdType,
DATE_FORMAT(a.nid_start_date,'%Y-%m-%d') AS nidStartDate,
DATE_FORMAT(a.nid_expiry_date,'%Y-%m-%d') AS nidExpiryDate,
a.persist_flag AS persistFlag,
a.hukou_type AS hukouType,
a.hukou_province AS hukouProvince,
a.hukou_city AS hukouCity,
a.hukou_county AS hukouCounty,
a.hukou_detail AS hukouDetail
FROM t_gz_emp_info a
where a.del_flag = '0' and a.id = #{gzEmpId}
ORDER BY a.create_time desc limit 1
</select>
<!--推送瓜子的瓜子档案信息Adress-->
<select id="getGzEmpInfoToPushGzByIdAdress" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVoAdress">
SELECT
a.address_type AS addressType,
a.state_id AS stateId,
a.city_id AS cityId,
a.county_id AS countyId,
a.address AS address
FROM t_gz_emp_info a
where a.del_flag = '0' and a.id = #{gzEmpId}
ORDER BY a.create_time desc limit 1
</select>
<!--推送瓜子的瓜子档案信息Bank-->
<select id="getGzEmpInfoToPushGzByIdBank" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVoBank">
SELECT
a.account_type AS accountType,
a.bank_cd AS bankCd,
a.cnaps_id AS cnapsId,
a.bank_name AS bankName,
a.account_ec_id AS accountEcId,
a.account_name AS accountName,
a.account_country AS country
FROM t_gz_emp_info a
where a.del_flag = '0' and a.id = #{gzEmpId}
ORDER BY a.create_time desc limit 1
</select>
<!--推送瓜子的瓜子档案信息Family-->
<select id="getGzEmpInfoToPushGzByIdFamily" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVoFamily">
SELECT
b.family_relation famMemRelation,
b.family_name name,
b.family_phone phone,
b.family_address address,
b.family_company company,
b.gz_eme_flag gzEmeFlag,
b.job_code jobCode
FROM t_gz_emp_family b left join t_gz_emp_info a on a.id=b.emp_id
where a.del_flag = '0' and b.del_flag = '0' and a.id = #{gzEmpId}
</select>
<!--推送瓜子的瓜子档案信息Family-->
<select id="getGzEmpInfoToPushGzByIdContact" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVoContact">
SELECT
b.emerg_name emergName,
b.emerg_relation emergRelation,
b.emerg_phone phone,
b.emerg_address address,
b.primary_nid primaryNid
FROM t_gz_emp_contact_info b left join t_gz_emp_info a on a.id=b.emp_id
where a.del_flag = '0' and b.del_flag = '0' and a.id = #{gzEmpId}
</select>
<!--推送瓜子的瓜子档案信息Work-->
<select id="getGzEmpInfoToPushGzByIdWork" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVoWork">
SELECT
b.work_unit employer,
date_format(b.work_start_date, '%Y-%m-%d') startDate,
date_format(b.work_end_date, '%Y-%m-%d') endDate,
b.work_dept deptDescr,
b.work_job endingTitle,
b.certifier_name adminName,
b.certifier_phone phone,
'' email,
'' comment
FROM t_gz_emp_work b left join t_gz_emp_info a on a.id=b.emp_id
where a.del_flag = '0' and b.del_flag = '0' and a.id = #{gzEmpId}
ORDER BY b.create_time desc
</select>
<!--推送瓜子的瓜子档案信息Education-->
<select id="getGzEmpInfoToPushGzByIdEducation" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVoEducation">
SELECT
b.edu_qual eduQual,
b.edu_degree eduDergee,
b.edu_type eduType,
b.school school,
date_format(b.edu_start_date, '%Y-%m-%d') startDate,
date_format(b.edu_end_date, '%Y-%m-%d') endDate,
b.gradution_type graduateType,
b.major,
b.high_edu_qual_flag highEduQualFlag,
b.high_edu_degree_flag highEduDegreeFlag,
b.first_degree_flag firstDegreeFlag
FROM t_gz_emp_education b left join t_gz_emp_info a on a.id=b.emp_id
where a.del_flag = '0' and b.del_flag = '0' and a.id = #{gzEmpId}
</select>
<!--推送瓜子的瓜子档案信息Skill-->
<select id="getGzEmpInfoToPushGzByIdSkill" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVoSkill">
SELECT
@row_num := @row_num + 1 AS orderId,
b.skill_name skillName,
date_format(b.skill_date, '%Y-%m-%d') skillDate,
b.skill_org skillOrg,
b.skill_level skillLevel
FROM t_gz_emp_skill b left join t_gz_emp_info a on a.id=b.emp_id,(SELECT @row_num := 0) AS t
where a.del_flag = '0' and b.del_flag = '0' and a.id = #{gzEmpId} and b.skill_date is not null and b.skill_name != ''
</select>
<!--推送瓜子的瓜子档案信息Atta-->
<select id="getGzEmpInfoToPushGzByIdAtta" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzVoAtta">
SELECT
a.RELATION_TYPE attachType,
a.id fileId,
a.ATTA_NAME fileName
FROM t_atta_info a
where a.RELATION_TYPE not in ('41','42','43') and a.domain_id = #{gzEmpId}
</select>
<!--推送瓜子的瓜子档案信息-合同 注意:2025年7月17号,瓜子接口变更了,取值时:试用期预计结束日期 和 预计转正日期,调换了-->
<select id="getGzEmpInfoToPushGzByIdContract" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzContractVo">
SELECT
a.biz_id bizId,
a.contract_num contractNum,
a.sginature_method sginatureMethod,
a.contract_type contractType,
a.sginature_type sginatureType,
date_format(a.sginature_dt, '%Y-%m-%d') sginatureDt,
date_format(a.contract_begin_dt, '%Y-%m-%d') contractBeginDt,
date_format(a.contract_end_dt, '%Y-%m-%d') contractEndDt,
date_format(a.contract_exp_end_dt, '%Y-%m-%d') contrctExpEndDt,
a.probation probation,
if(a.probation='0','1900-01-01',date_format(a.prc_exp_dt, '%Y-%m-%d')) probationDt,
if(a.probation='0','1900-01-01',date_format(a.probation_dt, '%Y-%m-%d')) prcExpDt,
a.nee_provider_id neeProviderId,
a.work_location workLocation,
'' fileId,
'' fileName
FROM t_gz_emp_info a
where a.del_flag = '0' and a.id = #{gzEmpId}
ORDER BY a.create_time desc limit 1
</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.archives.mapper.TGzPushEntryMapper">
<resultMap id="tGzPushEntryMap" type="com.yifu.cloud.plus.v1.yifu.archives.vo.TGzPushEntrySearchVo">
<id property="id" column="id"/>
<result property="bizId" column="biz_id"/>
<result property="taskType" column="task_type"/>
<result property="pushStatus" column="push_status"/>
<result property="pushTime" column="push_time"/>
<result property="failReason" column="fail_reason"/>
<result property="pushData" column="push_data"/>
<result property="responseData" column="response_data"/>
<result property="delFlag" column="del_flag"/>
<result property="name" column="name"/>
<result property="nationalId" column="national_id"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="createName" column="create_name"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="Base_Column_List">
a.id,
a.biz_id,
a.task_type,
a.push_status,
a.push_time,
a.fail_reason,
a.push_data,
a.response_data,
a.del_flag,
a.name,
a.national_id,
a.create_time,
a.create_by,
a.create_name,
a.update_by,
a.update_time
</sql>
<sql id="tGzPushEntry_where">
<if test="tGzPushEntry != null">
<if test="tGzPushEntry.id != null and tGzPushEntry.id.trim() != ''">
AND a.id = #{tGzPushEntry.id}
</if>
<if test="tGzPushEntry.bizId != null and tGzPushEntry.bizId.trim() != ''">
AND a.biz_id = #{tGzPushEntry.bizId}
</if>
<if test="tGzPushEntry.taskType != null and tGzPushEntry.taskType.trim() != ''">
AND a.task_type = #{tGzPushEntry.taskType}
</if>
<if test="tGzPushEntry.pushStatus != null and tGzPushEntry.pushStatus.trim() != ''">
AND a.push_status = #{tGzPushEntry.pushStatus}
</if>
<if test="tGzPushEntry.pushStatusArray != null and tGzPushEntry.pushStatusArray.length > 0">
AND a.push_status in
<foreach item="item" index="index" collection="tGzPushEntry.pushStatusArray" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
<if test="tGzPushEntry.pushTime != null">
AND a.push_time = #{tGzPushEntry.pushTime}
</if>
<!--查询推送时间-->
<if test="tGzPushEntry.createTimeStart != null ">
AND a.push_time &gt;= #{tGzPushEntry.createTimeStart}
</if>
<if test="tGzPushEntry.createTimeEnd != null ">
AND a.push_time &lt;= #{tGzPushEntry.createTimeEnd}
</if>
<if test="tGzPushEntry.failReason != null and tGzPushEntry.failReason.trim() != ''">
AND a.fail_reason = #{tGzPushEntry.failReason}
</if>
<if test="tGzPushEntry.pushData != null and tGzPushEntry.pushData.trim() != ''">
AND a.push_data = #{tGzPushEntry.pushData}
</if>
<if test="tGzPushEntry.responseData != null and tGzPushEntry.responseData.trim() != ''">
AND a.response_data = #{tGzPushEntry.responseData}
</if>
<if test="tGzPushEntry.delFlag != null and tGzPushEntry.delFlag.trim() != ''">
AND a.del_flag = #{tGzPushEntry.delFlag}
</if>
<if test="tGzPushEntry.name != null and tGzPushEntry.name.trim() != ''">
AND a.name like concat('%',#{tGzPushEntry.name},'%')
</if>
<if test="tGzPushEntry.nationalId != null and tGzPushEntry.nationalId.trim() != ''">
AND a.national_id like concat('%',#{tGzPushEntry.nationalId},'%')
</if>
<if test="tGzPushEntry.createTime != null">
AND a.create_time = #{tGzPushEntry.createTime}
</if>
<if test="tGzPushEntry.createBy != null and tGzPushEntry.createBy.trim() != ''">
AND a.create_by = #{tGzPushEntry.createBy}
</if>
<if test="tGzPushEntry.createName != null and tGzPushEntry.createName.trim() != ''">
AND a.create_name = #{tGzPushEntry.createName}
</if>
<if test="tGzPushEntry.updateBy != null and tGzPushEntry.updateBy.trim() != ''">
AND a.update_by = #{tGzPushEntry.updateBy}
</if>
<if test="tGzPushEntry.updateTime != null">
AND a.update_time = #{tGzPushEntry.updateTime}
</if>
</if>
</sql>
<!--tGzPushEntry简单分页查询-->
<select id="getTGzPushEntryPage" resultMap="tGzPushEntryMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_gz_push_entry a
<where>
a.del_flag = '0'
<include refid="tGzPushEntry_where"/>
</where>
ORDER by a.biz_id asc,a.create_time asc,a.id asc
</select>
</mapper>
......@@ -677,4 +677,7 @@ public interface CommonConstants {
String NINETY_NINE = "99";
String GZ_NEE_PROVIDER_ID = "V59";
// 瓜子推送成功标识
String GZ_SUCCESS_CODE = "S00000";
}
/*
* 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.ekp.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.mybatis.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.Date;
/**
* 预警配置表
*
* @author fxj
* @date 2025-07-21 09:49:56
*/
@Data
@TableName("ekp_alert_table")
@Schema(description = "预警配置表")
public class EkpAlertTable {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String fdId;
/**
* 预警科目ID
*/
@ExcelAttribute(name = "预警科目ID", maxLength = 1000)
@Length(max = 1000, message = "预警科目ID不能超过1000个字符")
@ExcelProperty("预警科目ID")
@Schema(description = "预警科目ID")
private String fdAlertSubject;
/**
* 预警科目
*/
@ExcelAttribute(name = "预警科目", maxLength = 1000)
@Length(max = 1000, message = "预警科目不能超过1000个字符")
@ExcelProperty("预警科目")
@Schema(description = "预警科目")
private String fdAlertSubjectText;
/**
* 有效日期始
*/
@ExcelAttribute(name = "有效日期始", isDate = true)
@ExcelProperty("有效日期始")
@Schema(description = "有效日期始")
private Date fdEffectiveStartDate;
/**
* 有效日期止
*/
@ExcelAttribute(name = "有效日期止", isDate = true)
@ExcelProperty("有效日期止")
@Schema(description = "有效日期止")
private Date fdEffectiveEndDate;
/**
* 检测方式
*/
@ExcelAttribute(name = "检测方式", maxLength = 200)
@Length(max = 200, message = "检测方式不能超过200个字符")
@ExcelProperty("检测方式")
@Schema(description = "检测方式")
private String fdDetectionMethod;
/**
* 阈值(%)
*/
@ExcelAttribute(name = "阈值")
@ExcelProperty("阈值")
@Schema(description = "阈值")
private Integer fdThresholdValue;
/**
* 是否有效:是 否
*/
@ExcelAttribute(name = "是否有效", maxLength = 200)
@Length(max = 200, message = "是否有效不能超过200个字符")
@ExcelProperty("是否有效")
@Schema(description = "是否有效")
private String fdIsActive;
/**
* 预警内容
*/
@ExcelAttribute(name = "预警内容")
@ExcelProperty("预警内容")
@Schema(description = "预警内容")
private String fdAlertMessage;
/**
* 检测方式-每日时间
*/
@ExcelAttribute(name = "检测方式-每日", isDate = true)
@ExcelProperty("检测方式-每日")
@Schema(description = "检测方式-每日")
private Date fdEverydayTime;
/**
* 检测方式-每月:每月时间(日)
*/
@ExcelAttribute(name = "检测方式", maxLength = 20)
@Length(max = 20, message = "检测方式不能超过20个字符")
@ExcelProperty("检测方式")
@Schema(description = "检测方式")
private String fdChecktype;
/**
* 检测方式-每月:1.每月 2.每日
*/
@ExcelAttribute(name = "检测方式-每月")
@ExcelProperty("检测方式-每月")
@Schema(description = "检测方式-每月")
private Integer fdMonthday;
}
/*
* 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.ekp.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 java.util.Date;
/**
* EKP预算预警表
*
* @author fxj
* @date 2025-07-15 11:53:01
*/
@Data
@TableName("ekp_budget_warning_info")
@Schema(description = "EKP预算预警表")
public class EkpBudgetWarningInfo{
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ExcelProperty("主键")
@Schema(description = "主键")
private String fdId;
/**
* 预警内容
*/
@ExcelAttribute(name = "预警内容", maxLength = 300)
@Length(max = 300, message = "预警内容不能超过300个字符")
@ExcelProperty("预警内容")
@Schema(description = "预警内容")
private String fdContent;
/**
* 预警时间
*/
@ExcelAttribute(name = "预警时间", isDate = true)
@ExcelProperty("预警时间")
@Schema(description = "预警时间")
private Date fdCreateTime;
/**
* 科目
*/
@ExcelAttribute(name = "科目", maxLength = 50)
@Length(max = 50, message = "科目不能超过50个字符")
@ExcelProperty("科目")
@Schema(description = "科目")
private String fdSubject;
/**
* 阅读状态:0未读 1已读
*/
@ExcelAttribute(name = "阅读状态:0未读 1已读", maxLength = 10)
@Length(max = 10, message = "阅读状态:0未读 1已读不能超过10个字符")
@ExcelProperty("阅读状态:0未读 1已读")
@Schema(description = "阅读状态:0未读 1已读")
private String fdReadStatus;
/**
* 接受人姓名
*/
@ExcelAttribute(name = "接受人姓名", maxLength = 50)
@Length(max = 50, message = "接受人姓名不能超过50个字符")
@ExcelProperty("接受人姓名")
@Schema(description = "接受人姓名")
private String fdRecipientName;
/**
* 接收人账号
*/
@ExcelAttribute(name = "接收人账号", maxLength = 50)
@Length(max = 50, message = "接收人账号不能超过50个字符")
@ExcelProperty("接收人账号")
@Schema(description = "接收人账号")
private String fdRecipientAccount;
/**
* 接收人ID(EKP-ID)
*/
@ExcelAttribute(name = "接收人ID(EKP-ID)", maxLength = 36)
@Length(max = 36, message = "接收人ID(EKP-ID)不能超过36个字符")
@ExcelProperty("接收人ID(EKP-ID)")
@Schema(description = "接收人ID(EKP-ID)")
private String fdRecipientId;
}
/*
* 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.ekp.vo;
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 java.util.Date;
/**
* 预警配置表
*
* @author fxj
* @date 2025-07-21 09:49:56
*/
@Data
@Schema(description = "预警配置表")
public class BudgetWarningVo {
/**
* 科目
*/
@Schema(description = "科目")
private String km;
/**
* 提醒时间
*/
@Schema(description = "提醒时间")
private String at;
/**
* 余额
*/
@Schema(description = "余额")
private Double ye;
/**
* 比率
*/
@Schema(description = "比率")
private Double bl;
/**
* 二级成本中心
*/
@Schema(description = "二级成本中心")
private String cbzx;
/**
* 二级成本中心-提醒人
*/
@Schema(description = "二级成本中心-提醒人")
private String txr;
/**
* 阀值-剩余
*/
@Schema(description = "阀值-剩余")
private Integer fz;
}
package com.yifu.cloud.plus.v1.ekp.config;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.AuthenticationServiceException;
import org.springframework.web.client.RestTemplate;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* @Author: huyc
* @Date: 2023/7/28
* @Description:
* @return: 企业微信配置
**/
@Configuration
@Data
@Slf4j
public class WxConfig {
@Value("${wx.corpid}")
private String corpid;
@Value("${wx.corpsecret}")
private String corpsecret;
@Value("${wx.agentid}")
private String agentid;
@Value("${wx.authUrl}")
private String authUrl;
@Value("${wx.domainName}")
private String domainName;
@Autowired
private RedisTemplate redisTemplate;
//未授权
private String accossTokenInvliad = "40014";
/**
* @param
* @Author: huyc
* @Date: 2023/7/28
* @Description: 获取微信accos_token
* @return: java.lang.String
**/
public String getAccessToken(RestTemplate restTemplate) {
if (Common.isNotNull(agentid)) {
return this.getToken(restTemplate, CacheConstants.WX_ACCOSS_TOKEN.concat(agentid), corpsecret);
}
return this.getToken(restTemplate, CacheConstants.WX_ACCOSS_TOKEN, corpsecret);
}
public String getAccessToken(RestTemplate restTemplate,String corpsecret)throws AuthenticationServiceException {
if(Common.isEmpty(corpsecret)){
throw new AuthenticationServiceException("未找到对应的corpsecret请联系管理员配置");
}
return this.getToken(restTemplate, CacheConstants.WX_ACCOSS_TOKEN.concat(agentid), corpsecret);
}
/**
* @param restTemplate
* @param tokenKey
* @param corpsecretKey
* @Description: 获取token
* @Author: huyc
* @Date: 2023/7/28 14:46
* @return: java.lang.String
**/
public String getToken(RestTemplate restTemplate,String tokenKey, String corpsecretKey) {
Object wxToken = redisTemplate.opsForValue().get(tokenKey);
if (null != wxToken) {
return String.valueOf(wxToken);
}
String requestTokenUrl = String.format(SecurityConstants.WX_GET_ACCOSS_TOKEN, corpid, corpsecretKey);
String result = restTemplate.getForObject(requestTokenUrl, String.class);
if (Common.isEmpty(result)) {
throw new CheckedException("微信授权失败");
}
String token = JSON.parseObject(result).getString("access_token");
if (Common.isEmpty(token)) {
log.info(result);
throw new CheckedException("获取微信token失败");
}
redisTemplate.opsForValue().set(tokenKey, token);
redisTemplate.expire(tokenKey, 3600, TimeUnit.SECONDS);
return token;
}
/**
* @param
* @Author: huyc
* @Date: 2023/7/28 14:43
* @Description: 移除微信accossToken
* @return: java.lang.String
**/
public void removeAccessToken() {
redisTemplate.delete(CacheConstants.WX_ACCOSS_TOKEN);
}
/**
* @param restTemplate
* @param requestMap 请求内容
* @Author: huyc
* @Date: 2023/7/28 14:48
* @Description: 发送卡片消息
* @return: java.lang.String
**/
public boolean sendTextCard(RestTemplate restTemplate, Map<String, Object> requestMap) {
// 必须加上header说明
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
Gson gson = new Gson();
log.debug("发企业微信===请求:{}", gson.toJson(requestMap));
HttpEntity<String> requestEntity = new HttpEntity<>(gson.toJson(requestMap), headers);
String accessToken = getAccessToken(restTemplate);
ResponseEntity<String> responseEntity = restTemplate.postForEntity(String.format(SecurityConstants.WX_SEND_MESSAGE, accessToken), requestEntity, String.class);
log.debug("发企业微信===返回:{}",JSON.toJSONString(responseEntity));
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(responseEntity));
JSONObject jsonBody = jsonObject.getJSONObject("body");
if (jsonBody != null) {
String errcode = jsonBody.getString("errcode");
if (accossTokenInvliad.equals(errcode)) {
//删除accossToken缓存
removeAccessToken();
return false;
}
if (!CommonConstants.ZERO_STRING.equals(errcode)) { //非正常,则打印错误日志
log.info(jsonObject.toJSONString());
}
} else {
log.info(jsonObject.toJSONString());
}
return true;
}
/**
* 功能描述: 获取微信accos_token
* @Author: huyc
* @Date: 2023/7/28 14:50
* @return: java.lang.String
*/
public String getAppAccessToken(RestTemplate restTemplate) {
return this.getToken(restTemplate, CacheConstants.WX_ACCOSS_TOKEN, corpsecret);
}
}
/*
* 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.ekp.controller;
import com.yifu.cloud.plus.v1.ekp.service.EkpAlertTableService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpIncomePushInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpIncomeParamRisk;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 预警配置表
*
* @author fxj
* @date 2025-07-21 09:49:56
*/
@RestController
@RequiredArgsConstructor
@RequestMapping("/ekpalerttable")
@Tag(name = "预警配置表管理")
public class EkpAlertTableController {
private final EkpAlertTableService ekpAlertTableService;
/**
* @return
* @Author fxj
* @Description 定时任务推送 预算超额预警信息 按日推送
* @Date 10:03 2025/7/21
* @Param
**/
@Inner
@PostMapping("/inner/pushBudgetAlertInfoTomanager")
public void pushRiskInfoToEkp() {
ekpAlertTableService.pushBudgetAlertInfoTomanager(1);
}
/**
* @return
* @Author fxj
* @Description 定时任务推送 预算超额预警信息 按月推送
* @Date 10:03 2025/7/21
* @Param
**/
@Inner
@PostMapping("/inner/pushBudgetAlertInfoTomanagerMonth")
public void pushBudgetAlertInfoTomanagerMonth() {
ekpAlertTableService.pushBudgetAlertInfoTomanager(0);
}
}
/*
* 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.ekp.mapper;
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.ekp.entity.EkpAlertTable;
import com.yifu.cloud.plus.v1.ekp.vo.BudgetWarningVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 预警配置表
*
* @author fxj
* @date 2025-07-21 09:49:56
*/
@Mapper
public interface EkpAlertTableMapper extends BaseMapper<EkpAlertTable> {
/**
* 预警配置表简单分页查询
*
* @param ekpAlertTable 预警配置表
* @return
*/
IPage<EkpAlertTable> getEkpAlertTablePage(Page<EkpAlertTable> page, @Param("ekpAlertTable") EkpAlertTable ekpAlertTable);
List<BudgetWarningVo> getBudgetWarningVos(@Param("km") String km);
List<EkpAlertTable> getEkpAlertTableList(int type);
}
/*
* 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.ekp.mapper;
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.ekp.entity.EkpBudgetWarningInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* EKP预算预警表
*
* @author fxj
* @date 2025-07-15 11:53:01
*/
@Mapper
public interface EkpBudgetWarningInfoMapper extends BaseMapper<EkpBudgetWarningInfo> {
/**
* EKP预算预警表简单分页查询
*
* @param ekpBudgetWarningInfo EKP预算预警表
* @return
*/
IPage<EkpBudgetWarningInfo> getEkpBudgetWarningInfoPage(Page<EkpBudgetWarningInfo> page, @Param("ekpBudgetWarningInfo") EkpBudgetWarningInfo ekpBudgetWarningInfo);
}
......@@ -58,4 +58,11 @@ public interface EkpSocialInfoMapper extends BaseMapper<EkpSocialInfo> {
List<Map<String,String>> getAccountList();
EkpDeptContractInfoVo selectContractInfoByDetptNo(@Param("deptNo") String deptNo);
/**
* 获取所有工行卡bin信息
* @param
* @return
*/
List<String> getAllIcbcCardBinInfo();
}
/*
* 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.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpAlertTable;
/**
* 预警配置表
*
* @author fxj
* @date 2025-07-21 09:49:56
*/
public interface EkpAlertTableService extends IService<EkpAlertTable> {
void pushBudgetAlertInfoTomanager(int type);
}
/*
* 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.ekp.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.ekp.config.WxConfig;
import com.yifu.cloud.plus.v1.ekp.entity.EkpAlertTable;
import com.yifu.cloud.plus.v1.ekp.entity.EkpBudgetWarningInfo;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpAlertTableMapper;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpBudgetWarningInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpAlertTableService;
import com.yifu.cloud.plus.v1.ekp.vo.BudgetWarningVo;
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.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
/**
* 预警配置表
*
* @author fxj
* @date 2025-07-21 09:49:56
*/
@Log4j2
@Service
public class EkpAlertTableServiceImpl extends ServiceImpl<EkpAlertTableMapper, EkpAlertTable> implements EkpAlertTableService {
@Autowired
private WxConfig wxConfig;
@Autowired
private UpmsDaprUtils upmsDaprUtils;
@Autowired
private EkpBudgetWarningInfoMapper warningInfoMapper;
/**
* @Author fxj
* @Description 推送企业微信消息
* @Date 15:29 2025/7/21
**/
private void pushInsuranceAlertToWx(List<BudgetWarningVo> vos) {
try {
if (Common.isNotKong(vos)){
// 科目+二级成本中心 作为key 创建预警信息map
Map<String, BudgetWarningVo> pushMap = new HashMap<>();
// 科目+二级成本中心 作为key 创建用户信息map
Map<String, List<SysUser>> sysUserMap = new HashMap<>();
Map<String, List<String>> sysUserEkpMap = new HashMap<>();
// 遍历预警信息列表,按科目+二级成本中心初始化Map
for (BudgetWarningVo vo : vos) {
// 创建组合键
String key = vo.getKm() + "_" + vo.getCbzx();
// 将预警信息放入Map中
pushMap.put(key, vo);
sysUserMap.putAll(getMapInfo(vo));
sysUserEkpMap.putAll(getMapInfoEkp(vo));
}
//开始推送信息到企业微信
if (Common.isNotKong(pushMap) && Common.isNotNull(sysUserEkpMap)){
List<SysUser> users;
List<String> userIds;
BudgetWarningVo config;
String content;
for (Map.Entry<String, BudgetWarningVo> entry : pushMap.entrySet()){
users = sysUserMap.get(entry.getKey());
userIds = sysUserEkpMap.get(entry.getKey());
config = pushMap.get(entry.getKey());
if (Common.isNotKong(config)){
content = String.format("系统告警:%s 当前您所属的成本中心:%s下的%s预算余额剩余%s元,已不足%s%%,请关注预算使用情况。如有需要,可尽快追加预算,以免影响人员报销。",
config.getAt(),
config.getCbzx(),
config.getKm(),
config.getYe(),
config.getFz(),
config.getFz());
// 处理推送信息保存
hanlderWarning(users, config, content,userIds);
}
}
}
}
} catch (Exception e){
log.error("推送预算预警信息到企业微信异常",e);
}
}
private void hanlderWarning(List<SysUser> users, BudgetWarningVo config, String content, List<String> userIds) {
EkpBudgetWarningInfo warningInfo;
HashMap<String,SysUser> userWxMap = new HashMap<>();
if (Common.isNotKong(users)){
for (SysUser user : users){
userWxMap.put(user.getUsername(),user);
}
}
if (Common.isNotKong(userIds)){
SysUser userTemp;
for (String userId : userIds){
String[] temp = userId.split("_");
if (temp.length > 1){
userTemp =userWxMap.get(temp[0]);
sendMessageToWx(null== userTemp?null:userTemp.getWxMessage(), content);
warningInfo = new EkpBudgetWarningInfo();
warningInfo.setFdContent(content);
warningInfo.setFdReadStatus(CommonConstants.ZERO_STRING);
warningInfo.setFdCreateTime(new Date());
warningInfo.setFdSubject(config.getKm());
warningInfo.setFdRecipientName(null== userTemp?null:userTemp.getNickname());
warningInfo.setFdRecipientAccount(null== userTemp?temp[0]:userTemp.getUsername());
warningInfo.setFdRecipientId(temp[1]);
warningInfoMapper.insert(warningInfo);
}
}
}
}
/**
* @Author fxj
* @Description 初始化 账号对应的用户信息
* @Date 19:49 2025/4/23
**/
private Map<String, List<SysUser>> getMapInfo(BudgetWarningVo vo) {
Map<String, List<SysUser>> sysUserMap = new HashMap<>();
if (Common.isNotKong(vo) && Common.isNotKong(vo.getTxr())) {
if (vo.getTxr().length() > CommonConstants.ZERO_INT) {
R<SysUserListVo> res = upmsDaprUtils.getUserIdsByUserNames(getLoginNames(vo.getTxr()));
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)) {
sysUserMap.put(vo.getKm() + "_" +vo.getCbzx(), users);
}
}
}
return sysUserMap;
}
private Map<String, List<String>> getMapInfoEkp(BudgetWarningVo vo) {
Map<String, List<String>> map = new HashMap<>();
if (Common.isNotKong(vo) && Common.isNotKong(vo.getTxr())) {
List<String> loginNames = Arrays.stream(vo.getTxr().split(","))
.filter(loginName -> !loginName.isEmpty())
.collect(Collectors.toList());
if (Common.isNotNull(loginNames)) {
map.put(vo.getKm() + "_" +vo.getCbzx(), loginNames);
}
}
return map;
}
private String getLoginNames(String txr) {
//txr格式 loginName_id 获取到所有的loginName
if (Common.isEmpty(txr)) {
return txr;
}
return Arrays.stream(txr.split(","))
.map(part -> part.split("_")[0])
.filter(loginName -> !loginName.isEmpty())
.collect(Collectors.joining( ","));
}
//发送企业微信待办
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", "预算预警");
// 传参77 企微详情提升“请至EKP系统处理!”
textcard.put("url", String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", "77" ));
textcard.put("description", content.toString());
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);
}
}
}
/**
* @Author fxj
* @Description
* @Date 16:39 2025/7/21
* @Param type 0 按月 1 按日
* @return
**/
@Override
public void pushBudgetAlertInfoTomanager(int type) {
try {
// 1. 获取当前时间
LocalDateTime now = LocalDateTime.now();
// 2. 查询所有有效的预警配置
List<EkpAlertTable> alertSubjects = baseMapper.getEkpAlertTableList(type);
// 3. 处理每个预警配置
List<BudgetWarningVo> budgetWarningVos = new ArrayList<>();
for (EkpAlertTable config : alertSubjects) {
// 4. 判断是否满足执行条件
if (shouldTriggerAlert(config,now,type)){
// 5. 获取实际数据并判断是否达到阈值,符合条件则返回预警信息
budgetWarningVos.addAll(isBudgetExceeded(config));
}
}
if (Common.isNotNull(budgetWarningVos)) {
// 6. 发送预警信息 + 记录预警信息
pushInsuranceAlertToWx(budgetWarningVos);
}
} catch (Exception e) {
log.error("执行预算预警任务时发生异常:", e);
}
}
/**
* @param config 预警配置
* @return 是否超额
*/
private List<BudgetWarningVo> isBudgetExceeded(EkpAlertTable config) {
List<BudgetWarningVo> resList = new ArrayList<>();
if (null == config || null == config.getFdThresholdValue() || null == config.getFdAlertSubjectText()) {
return resList;
}
//通过传参 科目获取需要预警的预算数据
List<BudgetWarningVo> list = baseMapper.getBudgetWarningVos(config.getFdAlertSubjectText());
if (Common.isNotKong(list)) {
for (BudgetWarningVo vo : list) {
//大于阀值且二级成本中心审核人不为空
if (vo.getBl() >= Double.valueOf(config.getFdThresholdValue()) && Common.isNotNull(vo.getTxr())) {
vo.setFz(100-(null==config.getFdThresholdValue()?0:config.getFdThresholdValue().intValue()));
resList.add(vo);
}
}
}
return resList;
}
/**
* 检查预警是否应该触发
*
* @param config 预警配置
* @param currentDateTime 当前时间
* @return 是否应该触发预警
*/
private boolean shouldTriggerAlert(EkpAlertTable config, LocalDateTime currentDateTime,int type) {
if (!"自动".equals(config.getFdDetectionMethod())){
return false;
}
if (type == 1){
// 处理按日配置
if ("每日".equals(config.getFdChecktype())) {
Date dailyTime = config.getFdEverydayTime(); // 获取每日执行时间
if (dailyTime != null) {
// 如果当前时间的小时 正好等于配置的时间的小时返回true
return currentDateTime.getHour() == dailyTime.getHours();
}
}
}{
// 处理按日配置
if ("每月".equals(config.getFdChecktype())) {
if (null != config.getFdMonthday()) {
// 当前日等于配置的日 返回 true
return currentDateTime.getDayOfMonth() == config.getFdMonthday().intValue();
}
}
}
return false;
}
}
......@@ -546,8 +546,26 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
R<EkpBankCodeSet> bankInfoQuery;
EkpBankCodeConfiglVo bankVo;
// 组装
//工行的卡号bin list
List<String> binList = baseMapper.getAllIcbcCardBinInfo();
for (EkpBankExcelVo excelVo : list) {
if (Common.isEmpty(excelVo.getFdRecipientBankCode())) {
//工行的卡号通过bin来判断,如果是工行的卡号,则不需要行名行号
// 检查长度是否足够
boolean flag = false;
if (Common.isNotNull(binList) && !binList.isEmpty() && excelVo.getFdPayeeAccount().length() >= 5) {
for (String bin : binList) {
if ((bin.length() == 5 && excelVo.getFdPayeeAccount().substring(0, 5).equals(bin)) ||
(bin.length() == 6 && excelVo.getFdPayeeAccount().length() >= 6 &&
excelVo.getFdPayeeAccount().substring(0, 6).equals(bin))) {
excelVo.setFdRecipientBankCode(null);
excelVo.setFdRecipientBank(null);
flag = true;
break;
}
}
}
if (!flag) {
// 查询行号
bankInfoQuery = icbcTransactionFlowQueryService.querybankinfo(excelVo.getFdPayeeAccount());
if (bankInfoQuery != null && bankInfoQuery.getCode() == CommonConstants.SUCCESS && bankInfoQuery.getData() != null) {
......@@ -563,6 +581,7 @@ public class IcbcTransactionFlowIssueServiceImpl extends ServiceImpl<EkpSocialIn
}
}
}
}
String batchNo = "WX" + new Date().getTime();
String cur = ekpBankGrantDetailService.getWxNoByWxNo(batchNo);
if (Common.isNotNull(cur)) {
......
......@@ -46,3 +46,10 @@ entry:
entryDocStatus: 20
entryLoginName: admin
entryDocSubject: 入账明细推送ekp接口
wx:
corpid: wwbcb090af0dfe50e5
corpsecret: 16kqEL_eU-ARwYyqLgEBWHgxm8gXVnkzv_eJMLy9NpU
agentid: 1000010
authUrl: https://test-wx.worfu.com/yifu-auth/method/oauth/wxLogin
domainName: https://test-wx.worfu.com
\ No newline at end of file
......@@ -46,3 +46,10 @@ entry:
entryDocStatus: 20
entryLoginName: admin
entryDocSubject: 入账明细推送ekp接口
wx:
corpid: wwbcb090af0dfe50e5
corpsecret: R0nKkvsY-oF41fuQvUXZ-kFG3_g_Ce0bpZt6mByx524
agentid: 1000009
authUrl: https://wx.worfu.com/yifu-auth/method/oauth/wxLogin
domainName: https://wx.worfu.com
\ No newline at end of file
......@@ -112,3 +112,10 @@ entry:
entryDocStatus: 20
entryLoginName: admin
entryDocSubject: 入账明细推送ekp接口
wx:
corpid: wwbcb090af0dfe50e5
corpsecret: 16kqEL_eU-ARwYyqLgEBWHgxm8gXVnkzv_eJMLy9NpU
agentid: 1000010
authUrl: https://test-wx.worfu.com/yifu-auth/method/oauth/wxLogin
domainName: https://test-wx.worfu.com
\ No newline at end of file
<?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.ekp.mapper.EkpAlertTableMapper">
<resultMap id="budgetWarningMap" type="com.yifu.cloud.plus.v1.ekp.vo.BudgetWarningVo">
<id property="km" column="km"/>
<result property="at" column="at"/>
<result property="ye" column="ye"/>
<result property="bl" column="bl"/>
<result property="cbzx" column="cbzx"/>
<result property="txr" column="txr"/>
</resultMap>
<resultMap id="ekpAlertTableMap" type="com.yifu.cloud.plus.v1.ekp.entity.EkpAlertTable">
<id property="fdId" column="fd_id"/>
<result property="fdAlertSubject" column="fd_alert_subject"/>
<result property="fdAlertSubjectText" column="fd_alert_subject_text"/>
<result property="fdEffectiveStartDate" column="fd_effective_start_date"/>
<result property="fdEffectiveEndDate" column="fd_effective_end_date"/>
<result property="fdDetectionMethod" column="fd_detection_method"/>
<result property="fdThresholdValue" column="fd_threshold_value"/>
<result property="fdIsActive" column="fd_is_active"/>
<result property="fdAlertMessage" column="fd_alert_message"/>
<result property="fdEverydayTime" column="fd_everyday_time"/>
<result property="fdChecktype" column="fd_checktype"/>
<result property="fdMonthday" column="fd_monthday"/>
</resultMap>
<sql id="Base_Column_List">
a.fd_id,
a.fd_alert_subject,
a.fd_alert_subject_text,
a.fd_effective_start_date,
a.fd_effective_end_date,
a.fd_detection_method,
a.fd_threshold_value,
a.fd_is_active,
a.fd_alert_message,
a.fd_everyday_time,
a.fd_checktype,
a.fd_monthday
</sql>
<sql id="ekpAlertTable_where">
<if test="ekpAlertTable != null">
<if test="ekpAlertTable.fdId != null and ekpAlertTable.fdId.trim() != ''">
AND a.fd_id = #{ekpAlertTable.fdId}
</if>
<if test="ekpAlertTable.fdAlertSubject != null and ekpAlertTable.fdAlertSubject.trim() != ''">
AND a.fd_alert_subject = #{ekpAlertTable.fdAlertSubject}
</if>
<if test="ekpAlertTable.fdAlertSubjectText != null and ekpAlertTable.fdAlertSubjectText.trim() != ''">
AND a.fd_alert_subject_text = #{ekpAlertTable.fdAlertSubjectText}
</if>
<if test="ekpAlertTable.fdEffectiveStartDate != null">
AND a.fd_effective_start_date = #{ekpAlertTable.fdEffectiveStartDate}
</if>
<if test="ekpAlertTable.fdEffectiveEndDate != null">
AND a.fd_effective_end_date = #{ekpAlertTable.fdEffectiveEndDate}
</if>
<if test="ekpAlertTable.fdDetectionMethod != null and ekpAlertTable.fdDetectionMethod.trim() != ''">
AND a.fd_detection_method = #{ekpAlertTable.fdDetectionMethod}
</if>
<if test="ekpAlertTable.fdThresholdValue != null">
AND a.fd_threshold_value = #{ekpAlertTable.fdThresholdValue}
</if>
<if test="ekpAlertTable.fdIsActive != null and ekpAlertTable.fdIsActive.trim() != ''">
AND a.fd_is_active = #{ekpAlertTable.fdIsActive}
</if>
<if test="ekpAlertTable.fdAlertMessage != null and ekpAlertTable.fdAlertMessage.trim() != ''">
AND a.fd_alert_message = #{ekpAlertTable.fdAlertMessage}
</if>
<if test="ekpAlertTable.fdEverydayTime != null">
AND a.fd_everyday_time = #{ekpAlertTable.fdEverydayTime}
</if>
<if test="ekpAlertTable.fdChecktype != null and ekpAlertTable.fdChecktype.trim() != ''">
AND a.fd_checktype = #{ekpAlertTable.fdChecktype}
</if>
<if test="ekpAlertTable.fdMonthday != null">
AND a.fd_monthday = #{ekpAlertTable.fdMonthday}
</if>
</if>
</sql>
<!--ekpAlertTable简单分页查询-->
<select id="getEkpAlertTablePage" resultMap="ekpAlertTableMap">
SELECT
<include refid="Base_Column_List"/>
FROM ekp_alert_table a
<where>
1=1
<include refid="ekpAlertTable_where"/>
</where>
</select>
<select id="getBudgetWarningVos" resultMap="budgetWarningMap">
select
a.fd_ke_mu as 'km',
DATE_FORMAT(NOW(),"%Y-%m-%d %H:%i") as 'at',
ROUND((sum(a.fd_money) - sum(ifnull(b.fd_money,0))),2) as 'ye'
,ROUND(sum(ifnull(b.fd_money,0))/sum(a.fd_money)*100,2) as 'bl',
a.fd_cheng_ben_two as 'cbzx',c.txr
from (select sum(a.fd_money) fd_money,a.fd_cheng_ben_two,a.fd_ke_mu,a.fd_fee_type,a.fd_id from view_xing_zheng_yu_suan_all a where a.fd_date_month like concat(DATE_FORMAT(now(),'%Y-'),'%') GROUP BY a.fd_ke_mu,a.fd_cheng_ben_two) a
left join (
select
ifnull(sum(a.fd_money),0) fd_money,fd_ke_mu,fd_cheng_ben_two
from view_xing_zheng_yu_suan a where DATE_FORMAT(a.fd_date,'%Y') = DATE_FORMAT(now(),'%Y')
GROUP BY fd_ke_mu,fd_cheng_ben_two
) b on b.fd_ke_mu = a.fd_ke_mu and b.fd_cheng_ben_two = a.fd_cheng_ben_two
LEFT JOIN (
select GROUP_CONCAT(DISTINCT CONCAT(d.fd_login_name,"_",d.fd_id)) as 'txr',cb.fd_3c290891cded14 from ekp_3cf9b7112e544ba9fe18 cb
LEFT JOIN ekporg_18ca06406b8e5d35104b t on t.fd_parent_id=cb.fd_id
LEFT JOIN sys_org_person d on t.sys_org_person_id=d.fd_id
GROUP BY cb.fd_id
) c on c.fd_3c290891cded14 = a.fd_cheng_ben_two
where a.fd_ke_mu = #{km}
GROUP BY a.fd_ke_mu,a.fd_cheng_ben_two ORDER BY a.fd_id
</select>
<select id="getEkpAlertTableList" resultMap="ekpAlertTableMap">
SELECT
<include refid="Base_Column_List"/>
FROM ekp_alert_table a
<where>
1=1
AND a.fd_effective_start_date <![CDATA[ <= ]]> NOW()
AND a.fd_effective_end_date >= NOW()
AND a.fd_is_active = '是'
<if test="type ==0 ">
AND fd_checktype = '每月'
</if>
<if test="type ==1 ">
AND fd_checktype = '每日'
</if>
</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.ekp.mapper.EkpBudgetWarningInfoMapper">
<resultMap id="ekpBudgetWarningInfoMap" type="com.yifu.cloud.plus.v1.ekp.entity.EkpBudgetWarningInfo">
<id property="fdId" column="fd_id"/>
<result property="fdContent" column="fd_content"/>
<result property="fdCreateTime" column="fd_create_time"/>
<result property="fdSubject" column="fd_subject"/>
<result property="fdReadStatus" column="fd_read_status"/>
<result property="fdRecipientName" column="fd_recipient_name"/>
<result property="fdRecipientAccount" column="fd_recipient_account"/>
<result property="fdRecipientId" column="fd_recipient_id"/>
</resultMap>
<sql id="Base_Column_List">
a.fd_id,
a.fd_content,
a.fd_create_time,
a.fd_subject,
a.fd_read_status,
a.fd_recipient_name,
a.fd_recipient_account,
a.fd_recipient_id
</sql>
<sql id="ekpBudgetWarningInfo_where">
<if test="ekpBudgetWarningInfo != null">
<if test="ekpBudgetWarningInfo.fdId != null and ekpBudgetWarningInfo.fdId.trim() != ''">
AND a.fd_id = #{ekpBudgetWarningInfo.fdId}
</if>
<if test="ekpBudgetWarningInfo.fdContent != null and ekpBudgetWarningInfo.fdContent.trim() != ''">
AND a.fd_content = #{ekpBudgetWarningInfo.fdContent}
</if>
<if test="ekpBudgetWarningInfo.fdCreateTime != null">
AND a.fd_create_time = #{ekpBudgetWarningInfo.fdCreateTime}
</if>
<if test="ekpBudgetWarningInfo.fdSubject != null and ekpBudgetWarningInfo.fdSubject.trim() != ''">
AND a.fd_subject = #{ekpBudgetWarningInfo.fdSubject}
</if>
<if test="ekpBudgetWarningInfo.fdReadStatus != null and ekpBudgetWarningInfo.fdReadStatus.trim() != ''">
AND a.fd_read_status = #{ekpBudgetWarningInfo.fdReadStatus}
</if>
<if test="ekpBudgetWarningInfo.fdRecipientName != null and ekpBudgetWarningInfo.fdRecipientName.trim() != ''">
AND a.fd_recipient_name = #{ekpBudgetWarningInfo.fdRecipientName}
</if>
<if test="ekpBudgetWarningInfo.fdRecipientAccount != null and ekpBudgetWarningInfo.fdRecipientAccount.trim() != ''">
AND a.fd_recipient_account = #{ekpBudgetWarningInfo.fdRecipientAccount}
</if>
<if test="ekpBudgetWarningInfo.fdRecipientId != null and ekpBudgetWarningInfo.fdRecipientId.trim() != ''">
AND a.fd_recipient_id = #{ekpBudgetWarningInfo.fdRecipientId}
</if>
</if>
</sql>
<!--ekpBudgetWarningInfo简单分页查询-->
<select id="getEkpBudgetWarningInfoPage" resultMap="ekpBudgetWarningInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM ekp_budget_warning_info a
<where>
1=1
<include refid="ekpBudgetWarningInfo_where"/>
</where>
</select>
</mapper>
......@@ -148,4 +148,10 @@
where a.fd_3a37fe508071fe = #{deptNo}
limit 1
</select>
<select id="getAllIcbcCardBinInfo" resultType="java.lang.String">
select
bank_code
from ekp_icbc_code_config
</select>
</mapper>
......@@ -29,6 +29,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TEmployeeInsuran
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.ScheduleService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TEmployeeInsurancePreService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
......@@ -226,6 +227,8 @@ public class TEmployeeInsurancePreServiceImpl extends ServiceImpl<TEmployeeInsur
addParam.setRemark(CommonConstants.EMPTY_STRING);
addParam.setInsurancePreId(insurancePre.getId());
addParam.setCustomerUserName(insurancePre.getCustomerUsername());
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)));
batchAddParamList.add(addParam);
}
if (CommonConstants.FOUR_INT == insurancePre.getBuyType()) {
......
......@@ -3310,9 +3310,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
//自动化派单的取自动化派单的起止日期
if (Common.isEmpty(param.getPolicyStart()) && Common.isEmpty(param.getPolicyEnd())) {
param.setPolicyStart(limitOne.getPolicyStart());
param.setPolicyEnd(limitOne.getPolicyEnd());
}
}
// 保险公司-险种-购买标准 是否存在
TInsuranceCompany insuranceCompany = tInsuranceCompanyService.getOne(Wrappers.<TInsuranceCompany>query().lambda()
......
......@@ -72,4 +72,25 @@ public class EkpTask {
HttpDaprUtil.invokeMethodPost(daprEkpProperties.getAppUrl(),daprEkpProperties.getAppId(),"/icbcIssue/inner/getPdfFile","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时生成生成昨日的回单文件-定时任务结束------------");
}
/**
* @Author fxj
* @Description 每日预算预警信息
* @Date 16:49 2025/7/21
**/
public void pushBudgetAlertInfoTomanager() {
log.info("------------定时生成每日预算预警信息-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprEkpProperties.getAppUrl(),daprEkpProperties.getAppId(),"/ekpalerttable/inner/pushBudgetAlertInfoTomanager","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时生成生每日预算预警信息-定时任务结束------------");
}
/**
* @Author fxj
* @Description 每月预算预警信息
* @Date 16:49 2025/7/21
**/
public void pushBudgetAlertInfoTomanagerMonth() {
log.info("------------定时生成每月预算预警信息-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprEkpProperties.getAppUrl(),daprEkpProperties.getAppId(),"/ekpalerttable/inner/pushBudgetAlertInfoTomanagerMonth","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时生成每月预算预警信息-定时任务结束------------");
}
}
\ No newline at end of file
......@@ -276,5 +276,15 @@ public class SocialTask {
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),"/tsocialsoldier/inner/doInnerGetPaymentThree","", Object.class, SecurityConstants.FROM_IN);
log.info("------------7每月6号3点定时任务获取社保士兵实缴3张表-定时任务结束------------");
}
/**
* @Author fxj
* @Description 定时任务每月1日3点定时更新跨月的继续办理的数据为终止办理
* @Date 10:45 2025/7/14
**/
public void doChangeHandleStatusToEnd() {
log.info("------------定时任务每月1日3点定时更新跨月的继续办理的数据为终止办理-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl(),daprProperties.getAppId(),
"/tsocialfriend/inner/doChangeHandleStatusToEnd","", Object.class, SecurityConstants.FROM_IN);
log.info("------------定时任务每月1日3点定时更新跨月的继续办理的数据为终止办理-定时任务结束------------");
}
}
......@@ -52,4 +52,12 @@ public class updateUserTask {
HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(),daprUpmsProperties.getAppId(),"/dept/inner/updateDept","", SysDept.class, SecurityConstants.FROM_IN);
log.info("------------更新部门-定时任务结束------------");
}
public void everyDayPushGzBankBranck() {
log.info("-------------每日1:30 拉取瓜子支行信息-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprUpmsProperties.getAppUrl(), daprUpmsProperties.getAppId(),
"/sysguazibankbranch/inner/pushBankBranck", "", Object.class,
SecurityConstants.FROM_IN);
log.info("-------------每日1.30 拉取瓜子支行信息-定时任务结束------------");
}
}
......@@ -57,11 +57,11 @@ public class TAttaInfo extends BaseEntity {
@Schema(description = "资源类型")
private String attaType;
/**
* 1户配置的章;2:派单审核附件,税友单个使用
* 1户配置的章;2:派单审核附件,税友单个使用,社保3医保附件
*/
@NotBlank(message = "关系类型不能为空")
@Length(max = 2, message = "关系类型不能超过2个字符")
@Schema(description = "关系类型(1户配置的章;2:派单审核附件,税友单个使用)")
@Schema(description = "关系类型(1户配置的章;2:派单审核附件,税友单个使用,社保;3医保附件)")
private String relationType;
/**
* 实体id和关系类型共同确定附件所属(9、10、21、22、23、24、25存项目档案id,0、2、26存附属表id)
......
......@@ -1011,11 +1011,20 @@ public class TSocialInfo extends BaseEntity {
* 医保起缴日期顺延到次月
* 2025-3-13 17:22:35 hgw
*/
@ExcelAttribute(name = "医保起缴日期顺延到次月", isDate = true)
@Schema(description = "医保起缴日期顺延到次月" )
@ExcelAttribute(name = "医保顺延时间", isDate = true)
@Schema(description = "医保顺延时间" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医保起缴日期顺延到次月" )
@ExcelProperty("医保顺延时间" )
private Date ysdSocialStartDateNext;
/**
* 社保起缴日期顺延到次月
* 2025-7-11 11:42:01 hgw
*/
@ExcelAttribute(name = "社保顺延时间", isDate = true)
@Schema(description = "社保顺延时间" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保顺延时间" )
private Date ygsSocialStartDateNext;
/**
* 养工失反馈-原反馈
*/
......
......@@ -83,8 +83,10 @@ public class SociaFriendYgsAddVo implements Serializable {
// 企业职工社会保险增员花名册 qyzgshbxzyhmc
private String qyzgshbxzyhmc;
// 单个附件list
private List<String> imgList;
// 单个附件list_社保
private List<String> imgListYgs;
// 单个附件list——医保
private List<String> imgListYsd;
// 自动生成解除劳动证明
private String autoLeaveDoc;
// 当前行政经办区——2025-3-31 10:23:02 盛宇与税友沟通,可以默认安徽省,暂时不用这个字段了,后面有特殊要求再加
......
......@@ -179,4 +179,13 @@ public class SocialHandleSearchVo extends TDispatchInfo {
@ExcelIgnore
private String[] socialHandleStatusArr;
/**
* @Author fxj
* @Description 社保反馈文件下载标识
* @Date 12:28 2025/7/17
**/
@ExcelProperty("社保反馈文件下载标识" )
@ExcelIgnore
private String backFileFlag;
}
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttributeConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* @Author hgw
* @Description 社保士兵自动办理导出
* @Date 2024-5-13 10:56:51
* @Param
* @return
**/
@Data
public class SocialSoldierBackVo implements Serializable {
/**
* 派单ID
*/
@ExcelAttribute(name = "派单ID")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("派单ID")
private String dispatchId;
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工姓名")
private String empName;
/**
* 员工身份证
*/
@ExcelAttribute(name = "员工身份证", errorInfo = "员工身份证不能为空", maxLength = 20, needExport = true)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("员工身份证")
private String empIdcard;
@ExcelAttribute(name = "养老工伤失业-办理状态", readConverterExp = "0=无,1=待办理,2=自动办理中,3=继续办理,4=中止办理,5=人工处理,6=成功,7=提交成功", needExport = true)
@Schema(description = "养老工伤失业-办理状态")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("养老工伤失业-办理状态")
private String ygsHandleStatus;
@ExcelAttribute(name = "医保生育大病-办理状态", readConverterExp = "0=无,1=待办理,2=自动办理中,3=继续办理,4=中止办理,5=人工处理,6=成功,7=提交成功", needExport = true)
@Schema(description = "医保生育大病-办理状态")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医保生育大病-办理状态")
private String ysdHandleStatus;
@ExcelAttribute(name = "社保明细ID")
@Schema(description = "社保明细ID")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保明细ID")
private String socialId;
/**
* 社保户
*/
@ExcelAttribute(name = "社保户", needExport = true)
@Schema(description = "社保户")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保户")
private String socialHouseholdName;
}
......@@ -525,5 +525,23 @@ public class SocialSoldierExportVo implements Serializable {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医保请求ID")
private String ysdRequestId;
/**
* 医保起缴日期顺延到次月
* 2025-3-13 17:22:35 hgw
*/
@ExcelAttribute(name = "医保顺延时间", isDate = true)
@Schema(description = "医保顺延时间" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医保顺延时间" )
private String ysdSocialStartDateNext;
/**
* 社保起缴日期顺延到次月
* 2025-7-11 11:42:01 hgw
*/
@ExcelAttribute(name = "社保顺延时间", isDate = true)
@Schema(description = "社保顺延时间" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保顺延时间" )
private String ygsSocialStartDateNext;
}
......@@ -25,6 +25,7 @@ import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.Date;
/**
* 社保士兵列表查询
......@@ -111,5 +112,34 @@ public class TSocialSoldierPageVo extends TDispatchInfo {
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医保请求ID" )
private String ysdRequestId;
/**
* 医保起缴日期顺延到次月
* 2025-3-13 17:22:35 hgw
*/
@ExcelAttribute(name = "医保顺延时间", isDate = true)
@Schema(description = "医保顺延时间" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("医保顺延时间" )
private Date ysdSocialStartDateNext;
/**
* 社保起缴日期顺延到次月
* 2025-7-11 11:42:01 hgw
*/
@ExcelAttribute(name = "社保顺延时间", isDate = true)
@Schema(description = "社保顺延时间" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保顺延时间" )
private Date ygsSocialStartDateNext;
/**
* @Author fxj
* @Description 社保反馈文件下载标识
* @Date 12:28 2025/7/17
**/
@ExcelAttribute(name = "社保反馈文件下载标识", maxLength = 20)
@Schema(description = "社保反馈文件下载标识" )
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("社保反馈文件下载标识" )
private String backFileFlag;
}
......@@ -9,9 +9,12 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
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.vo.FriendResult;
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.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
......@@ -19,13 +22,12 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.http.*;
import org.springframework.security.core.parameters.P;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
import java.net.URL;
import java.security.SignatureException;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.TreeMap;
import java.util.*;
import static com.alibaba.fastjson.serializer.SerializerFeature.*;
......@@ -64,6 +66,12 @@ public class SocialFriendConfig {
// url拉结果数据
@Value("${socialFriend.urlUpload}")
private String urlUpload;
// url人员维度网厅源文件下载(个人审核查询证明)
@Value("${socialFriend.urlDownloadEmployeeAsync}")
private String urlDownloadEmployeeAsync;
@Value("${socialFriend.urlDownloadEmployeeFeedback}")
// URL人员维度网厅源文件下载反馈
private String urlDownloadEmployeeFeedback;
private static final String APP_KEY = "appKey";
......@@ -71,10 +79,11 @@ public class SocialFriendConfig {
private static final String X_REQ_NONCE = "xReqNonce";
private static final String VERSION = "version";
private static final SerializerFeature[] features = new SerializerFeature[] {
private static final SerializerFeature[] features = new SerializerFeature[]{
WriteMapNullValue, WriteNullNumberAsZero, WriteNullListAsEmpty,
WriteNullStringAsEmpty,WriteDateUseDateFormat
WriteNullStringAsEmpty, WriteDateUseDateFormat
};
/**
* @param : listVo 同一类(户、增减)的前100个
* @param : vo 第一个,存账密等信息
......@@ -158,9 +167,13 @@ public class SocialFriendConfig {
if (Common.isNotNull(vo.getQyzgshbxzyhmc())) {
JSONArray qyzgshbxzyhmclbArr = new JSONArray();
qyzgshbxzyhmclbArr.add(vo.getQyzgshbxzyhmc());
if (vo.getImgList() != null && !vo.getImgList().isEmpty()) {
if (type < 3 && vo.getImgListYgs() != null && !vo.getImgListYgs().isEmpty()) {
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr.addAll(vo.getImgListYgs());
}
if (type > 2 && vo.getImgListYsd() != null && !vo.getImgListYsd().isEmpty()) {
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr.addAll(vo.getImgList());
qyzgshbxzyhmclbArr.addAll(vo.getImgListYsd());
}
if (type == 2 || type == 4) {
json.put(fileName, vo.getQyzgshbxzyhmc());
......@@ -170,8 +183,13 @@ public class SocialFriendConfig {
} else if (Common.isNotNull(vo.getQyzgjbylbxcbdjb())) {
JSONArray qyzgshbxzyhmclbArr = new JSONArray();
qyzgshbxzyhmclbArr.add(vo.getQyzgjbylbxcbdjb());
if (vo.getImgList() != null && !vo.getImgList().isEmpty()) {
qyzgshbxzyhmclbArr.addAll(vo.getImgList());
if (type < 3 && vo.getImgListYgs() != null && !vo.getImgListYgs().isEmpty()) {
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr.addAll(vo.getImgListYgs());
}
if (type > 2 && vo.getImgListYsd() != null && !vo.getImgListYsd().isEmpty()) {
// 税友新附件接口说用原来的:那就一批任务里面用一份文件就可以了 还是原来的那个字段 2025-5-16 16:57:00 王赣松
qyzgshbxzyhmclbArr.addAll(vo.getImgListYsd());
}
if (type == 2 || type == 4) {
json.put(fileName, vo.getQyzgjbylbxcbdjb());
......@@ -286,7 +304,7 @@ public class SocialFriendConfig {
}
}
} else {
backLog.setSocialId(appAddUrl+"返回dataResultList为空");
backLog.setSocialId(appAddUrl + "返回dataResultList为空");
}
return urlStr;
}
......@@ -426,9 +444,9 @@ public class SocialFriendConfig {
// 单位就业起始时间 社保必填;yyyy-MM-dd
tszdxx.put("dwjyqssj", startDate);
// 安徽非必填!社保个人身份材料 取文件上传后获取的文件路径。图片总大小不超过1M, 材料仅支持图片格式,支持上传jpeg/jpg/png格式。
if (vo.getImgList() != null && !vo.getImgList().isEmpty()) {
if (vo.getImgListYgs() != null && !vo.getImgListYgs().isEmpty()) {
// 税友接口只允许一张
tszdxx.put("sbzycl", vo.getImgList().get(0));
tszdxx.put("sbzycl", vo.getImgListYgs().get(0));
}
// 用工形式 社保必填 // 盛宇文档对应,只有3种
......@@ -438,9 +456,9 @@ public class SocialFriendConfig {
// 人员类型 默认:在职职工
tszdxx.put("rylx", "在职职工");
// 医保个人身份材料 安徽非必填! 无
if (vo.getImgList() != null && !vo.getImgList().isEmpty()) {
if (vo.getImgListYsd() != null && !vo.getImgListYsd().isEmpty()) {
ybzyclArr = new JSONArray();
ybzyclArr.addAll(vo.getImgList());
ybzyclArr.addAll(vo.getImgListYsd());
tszdxx.put("ybzycl", ybzyclArr);
}
// 职业工种 社保必填 默认“办事人员和有关人员”
......@@ -499,6 +517,7 @@ public class SocialFriendConfig {
JSONObject tszdxx;
String blxm = "社保";
String[] arr = {qyzgjbylbxcbdjb};
JSONArray ybjyclArr;
if (type > 2) {
blxm = "医保";
}
......@@ -539,9 +558,23 @@ public class SocialFriendConfig {
if (type > 2) {
// 职工基本医疗保险参保登记表
tszdxx.put("zgjbylbxcbdjb", arr);
tszdxx.put("ybjycl", vo.getAutoLeaveDoc());
ybjyclArr = new JSONArray();
if (Common.isNotNull(vo.getAutoLeaveDoc())) {
ybjyclArr.add(vo.getAutoLeaveDoc());
}
if (vo.getImgListYsd() != null && !vo.getImgListYsd().isEmpty()) {
ybjyclArr.addAll(vo.getImgListYsd());
}
tszdxx.put("ybjycl", ybjyclArr);
} else {
if (Common.isNotNull(vo.getAutoLeaveDoc())) {
tszdxx.put("shjycl", vo.getAutoLeaveDoc());
} else {
if (vo.getImgListYgs() != null && !vo.getImgListYgs().isEmpty()) {
// 税友接口只允许一张
tszdxx.put("shjycl", vo.getImgListYgs().get(0));
}
}
}
cbrymdOne.put("tszdxx", tszdxx);
cbrymdArr.add(cbrymdOne);
......@@ -638,7 +671,7 @@ public class SocialFriendConfig {
JSONObject blxmjglb;
String zt;
String cwxx;
for (int i=0; i<ryywbljglbArr.size(); i++) {
for (int i = 0; i < ryywbljglbArr.size(); i++) {
ryywbljglb = (JSONObject) ryywbljglbArr.get(i);
result = new FriendResult();
// 身份证
......@@ -733,4 +766,190 @@ public class SocialFriendConfig {
return birthStr;
}
/**
* @return
* @Author fxj
* @Description
* @Date 14:33 2025/7/15
* @Param type 0 社保 1 医保
* @Param subType 0 增员 1 减员
**/
public HashMap<String, String> getDownloadEmployeeAsync(RestTemplate restTemplate, SysHouseHoldInfo houseHold,
SocialSoldierBackVo backVo) {
HashMap<String, String> result = new HashMap<>();
try {
// 构建请求头
HttpHeaders headers = buildCommonHeaders(null);
// 构建请求体 JSON
JSONObject requestBody = buildDownloadRequestJson(houseHold, backVo);
HttpEntity<String> formEntity = new HttpEntity<>(requestBody.toJSONString(), headers);
// 发起异步下载请求
String downloadEmployeeAsyncUrl = urlPre + urlDownloadEmployeeAsync;
String dataResultList = restTemplate.postForObject(downloadEmployeeAsyncUrl, formEntity, String.class);
if (Common.isNotNull(dataResultList)) {
JSONObject response = JSON.parseObject(dataResultList);
JSONObject head = JSON.parseObject(response.getString("head"));
if ("Y".equals(head.getString("status"))) {
String requestId = JSON.parseObject(response.getString("body")).getString("requestId");
result.put(backVo.getSocialId(), requestId);
/*if (Common.isNotNull(requestId)) {
urls.addAll(getDownloadFeedbackUrls(restTemplate, requestId));
}*/
}
}
} catch (Exception e) {
log.error("获取税友人员审核查询证明文件失败", e);
}
return result;
}
// 构建公共请求头
private HttpHeaders buildCommonHeaders(String requestId) throws SignatureException {
String version = "1.0.0";
String timestamp = String.valueOf(new Date().getTime());
String xReqNonce = "1";
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.add("accept", MediaType.ALL_VALUE);
headers.add(APP_KEY, appKey);
headers.add(TIMESTAMP, timestamp);
headers.add(X_REQ_NONCE, xReqNonce);
headers.add(VERSION, version);
String signature = SocialFriendSign.qianMing(getMapParam(appKey, appSecret, xReqNonce, version, timestamp, requestId));
headers.add("signature", signature);
return headers;
}
// 构建请求参数 JSON
private JSONObject buildDownloadRequestJson(SysHouseHoldInfo vo, SocialSoldierBackVo exportVo) {
JSONObject json = new JSONObject();
/*json.put("bizNo", "211429621163811844098020250715-172343");
json.put("qymc", "安徽皖信人力资源管理有限公司0");
json.put("nsrsbh", "91340152570242449C");
json.put("areaid", "340100");*/
json.put("bizNo", exportVo.getSocialId());
json.put("qymc", vo.getName());
json.put("nsrsbh", vo.getUnitCreditCode());
json.put("areaid", vo.getAreaCode());
JSONArray ywblzhlbArr = new JSONArray();
JSONObject jsonYwblzhlbYgs = new JSONObject();
jsonYwblzhlbYgs.put("mm", vo.getSocialPassword());
jsonYwblzhlbYgs.put("blxm", "社保");
jsonYwblzhlbYgs.put("dwbh", vo.getCustomerNo());
jsonYwblzhlbYgs.put("zh", vo.getSocialAccount());
jsonYwblzhlbYgs.put("mmlx", "4");
ywblzhlbArr.add(jsonYwblzhlbYgs);
json.put("ywblzhlb", ywblzhlbArr);
JSONArray rylbArr = new JSONArray();
JSONObject rylbContent = new JSONObject();
rylbContent.put("xm", exportVo.getEmpName());
rylbContent.put("zzlx", "居民身份证");
rylbContent.put("zzhm", exportVo.getEmpIdcard());
rylbContent.put("blxmlb", new String[]{});
JSONObject tszdxx = new JSONObject();
tszdxx.put("jblx", "增员");
rylbContent.put("tszdxx", tszdxx);
rylbArr.add(rylbContent);
json.put("rylb", rylbArr);
json.put("ywlx", "个人审核查询证明");
JSONArray blxmbArr = new JSONArray();
JSONObject blxm = new JSONObject();
blxm.put("blxm", "社保");
blxmbArr.add(blxm);
json.put("blxmlb", blxmbArr);
return json;
}
// 获取反馈 URL 列表
public List<String> getDownloadFeedbackUrls(RestTemplate restTemplate, String requestId) {
List<String> urls = new ArrayList<>();
String downloadEmployeeFeedbackUrl = urlPre + urlDownloadEmployeeFeedback + "?requestId=" + requestId;
int retryCount = 0;
final int maxRetries = 2;
final long delayMillis = 2000; // 2 seconds
try {
// 构建请求头
HttpHeaders headers = buildCommonHeaders(requestId);
// 构建请求体
HttpEntity<String> formEntity = new HttpEntity<>(headers);
while (retryCount <= maxRetries) {
ResponseEntity<String> response = restTemplate.exchange(
downloadEmployeeFeedbackUrl, HttpMethod.GET, formEntity, String.class);
// 处理返回值
if (response != null && response.getStatusCodeValue() == 200) {
JSONObject dataObject = JSON.parseObject(response.getBody());
String head = dataObject.getString("head");
if (Common.isNotNull(head)) {
JSONObject headObject = JSON.parseObject(head);
if ("Y".equals(headObject.getString("status"))) {
JSONObject bodyObject = JSON.parseObject(dataObject.getString("body"));
String ryywbljglb = bodyObject.getString("ryywbljglb");
JSONArray ryywbljglbArr = JSON.parseArray(ryywbljglb);
if (ryywbljglbArr != null && !ryywbljglbArr.isEmpty()){
for (Object itemObj : ryywbljglbArr) {
JSONObject ryywbljglbItem = (JSONObject) itemObj;
JSONArray blxmjglbArr = JSON.parseArray(ryywbljglbItem.getString("blxmjglb"));
if (blxmjglbArr != null && !blxmjglbArr.isEmpty()){
for (Object blxmjglbObj : blxmjglbArr) {
JSONObject blxmjglbItem = (JSONObject) blxmjglbObj;
JSONArray jgmxlbArr = JSON.parseArray(blxmjglbItem.getString("jgmxlb"));
if (jgmxlbArr != null && !jgmxlbArr.isEmpty()){
for (Object jgmxlbObj : jgmxlbArr) {
JSONObject jgmxlbItem = (JSONObject) jgmxlbObj;
JSONArray wjdzlb = jgmxlbItem.getJSONArray("wjdzlb");
if (wjdzlb != null && !wjdzlb.isEmpty()) {
urls.addAll(wjdzlb.toJavaList(String.class));
}
}
}
}
}
}
}
}
}
}
// 如果成功获取到数据,则跳出循环
if (!urls.isEmpty()) {
break;
}
// 如果没有获取到数据,等待一段时间后重试
if (retryCount < maxRetries) {
Thread.sleep(delayMillis);
retryCount++;
} else {
break;
}
}
} catch (Exception e) {
log.error("获取税友人员审核查询证明文件反馈链接失败", e);
}
return urls;
}
}
......@@ -947,4 +947,28 @@ public class TDispatchInfoController {
return tDispatchInfoService.doExportRoster(socialId,type,unitCreditCode);
}
/**
* @Author fxj
* @Description
* @Date 15:20 2025/7/15
**/
@PostMapping("/doExportSocialSoldierAllBackFile")
@Operation(description = "自动化办理查询导出反馈文件")
@SysLog("自动化办理查询导出反馈文件")
public void doExportSocialSoldierAllBackFile(HttpServletResponse response, HttpServletRequest request,
@RequestBody SocialHandleSearchVo searchVo) {
tDispatchInfoService.doExportSocialSoldierAllBackFile(response,searchVo,searchVo.getIdStr());
}
/**
* @Author fxj
* @Description
* @Date 15:20 2025/7/15
**/
@PostMapping("/doExportSocialSoldierBackFileById")
@Operation(description = "自动化办理查询导出反馈文件单个")
@SysLog("自动化办理查询导出反馈文件单个")
public R<String> doExportSocialSoldierBackFileById(@RequestBody SocialHandleSearchVo searchVo) {
return tDispatchInfoService.doExportSocialSoldierBackFileById(searchVo.getIdStr());
}
}
......@@ -166,4 +166,18 @@ public class TSocialFriendController {
}
}
/**
* @Author fxj
* @Description 定时任务每月1日3点定时更新跨月的继续办理的数据为终止办理
* @Date 10:40 2025/7/14
* @Param
* @return
**/
@Operation(description = "定时任务每月1日3点定时更新跨月的继续办理的数据为终止办理")
@PostMapping("/inner/doChangeHandleStatusToEnd")
@SysLog("定时任务每月1日3点定时更新跨月的继续办理的数据为终止办理")
@Inner
public void doChangeHandleStatusToEnd() {
tSocialFriendService.changeSocialHandndleStatus();
}
}
......@@ -70,4 +70,14 @@ public interface SysHouseHoldInfoMapper extends BaseMapper<SysHouseHoldInfo> {
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo>
**/
List<SysHouseHoldInfo> getAttaSrcByAutoDoc();
/**
* @Author fxj
* @Description 获取启用自动化的户信息
* @Date 9:35 2025/7/17
* @Param
* @return
**/
List<SysHouseHoldInfo> getHouseInfoAutoDoc();
}
......@@ -306,4 +306,14 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> {
List<String> getSingleFlagMap(@Param("idsList")List<String> idsList);
// 获取自动生成减员离职证明的派单ID
List<String> getAutoDocFlagMap(@Param("idsList")List<String> idsList);
/**
* @Author fxj
* @Description 自动化办理查询导出反馈文件
* @Date 15:29 2025/7/15
**/
List<SocialSoldierBackVo> getSocialSoldierAllListBackFile(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo,
@Param("idsStr") List<String> idsStr);
int updateBackFileFlag(@Param("idsStr") List<String> idsStr);
}
......@@ -53,6 +53,9 @@ public interface TSocialInfoMapper extends BaseMapper<TSocialInfo> {
List<TSocialInfo> getSocialFriendYgsAll();
List<TSocialInfo> getSocialFriendYsdAll();
List<TSocialInfo> getSocialFriendYgsAllTask();
List<TSocialInfo> getSocialFriendYsdAllTask();
/**
* @param
* @Description: 获取所有需要社保局审核的社保
......
......@@ -187,4 +187,8 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
List<SocialHandleExportVo> getRecordRosterList(SocialHandleSearchVo searchVo, String idStr);
R<URL> doExportRoster(String socialId, String type,String unitCreditCode);
void doExportSocialSoldierAllBackFile(HttpServletResponse response, SocialHandleSearchVo searchVo, String idStr);
R<String> doExportSocialSoldierBackFileById(String idStr);
}
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.social.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import org.springframework.transaction.annotation.Transactional;
/**
* 社保士兵
......@@ -37,4 +38,6 @@ public interface TSocialFriendService extends IService<TSocialInfo> {
**/
R<String> getInfoByRequestId();
@Transactional
void changeSocialHandndleStatus();
}
......@@ -70,6 +70,9 @@ public interface TSocialInfoService extends IService<TSocialInfo> {
List<TSocialInfo> getSocialFriendYgsAll();
List<TSocialInfo> getSocialFriendYsdAll();
List<TSocialInfo> getSocialFriendYgsAllTask();
List<TSocialInfo> getSocialFriendYsdAllTask();
/**
* @Description: 获取所有需要审核结果的社保
* @Author: hgw
......
......@@ -375,7 +375,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
private void setImgList(SociaFriendYgsAddVo vo) {
URL url;
InputStream inStream = null;
List<String> imgList = new ArrayList<>();
List<String> imgListYgs = new ArrayList<>();
List<String> imgListYsd = new ArrayList<>();
List<TAttaInfo> attaInfoList = attaInfoMapper.getTAttaInfoListByDoMainId(vo.getDispatchId());
if (attaInfoList != null && !attaInfoList.isEmpty()) {
String base64String;
......@@ -396,7 +397,11 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
imgUrl = socialFriendConfig.uploadPng(restTemplate, attaInfo.getAttaName(), base64String, backLog);
tSocialFriendBackLogService.save(backLog);
if (Common.isNotNull(imgUrl)){
imgList.add(imgUrl);
if (Common.isEmpty(attaInfo.getRelationType()) || CommonConstants.TWO_STRING.equals(attaInfo.getRelationType())) {
imgListYgs.add(imgUrl);
} else {
imgListYsd.add(imgUrl);
}
}
} catch (Exception e){
log.info("税友单个图片上传失败!");
......@@ -412,7 +417,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
}
}
}
vo.setImgList(imgList);
vo.setImgListYgs(imgListYgs);
vo.setImgListYsd(imgListYsd);
}
}
......@@ -450,6 +456,8 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
TSocialFriendReduceSet reduceSet;
// 是否为生成解除劳动合同书 且是 派减
boolean isAutoLeaveDoc;
// 是否为单个推送(派单审核时定性的)
boolean isSingle;
for (int index = 0 ; index < ysdAddlist.size(); index++) {
vo = ysdAddlist.get(index);
......@@ -503,9 +511,10 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
&& !vo.getSocialHouseholdName().equals(ysdAddlist.get(index+1).getSocialHouseholdName())) {
nextFlag = true;
}
isSingle = Common.isNotNull(vo.getIsSingle()) && CommonConstants.ONE_STRING.equals(vo.getIsSingle());
isAutoLeaveDoc = templateUrl != null && type == 4 && Common.isNotNull(vo.getIsAutoLeaveDoc())
&& CommonConstants.ONE_STRING.equals(vo.getIsAutoLeaveDoc());
if (isAutoLeaveDoc || nextFlag || i % 10 == 0 || index >= ysdAddlist.size()-1) {
if (isAutoLeaveDoc || isSingle || nextFlag || i % 10 == 0 || index >= ysdAddlist.size()-1) {
// 房工接口,获取 企业职工基本医疗保险参保登记表 url
urlR = doExportRoster(vo.getSocialId(), String.valueOf(type), vo.getUnitCreditCode(), listVo);
if (urlR != null && urlR.getCode() == 200 && Common.isNotNull(urlR.getData())) {
......@@ -515,6 +524,10 @@ public class TSocialFriendPushServiceImpl extends ServiceImpl<TSocialFriendMappe
if (isAutoLeaveDoc) {
this.doSetAutoDoc(zhangMap, templateUrl, vo, CommonConstants.NINE_INTEGER);
}
if (isSingle && Common.isNotNull(vo.getDispatchId())) {
// 获取单个附件并推送税友,返回 imgList 到Vo里
this.setImgList(vo);
}
i=0;
nextFlag = false;
requestId = socialFriendConfig.pushFriendByInfo(restTemplate, vo, listVo, type, thisTime, backLogList);
......
......@@ -34,6 +34,7 @@ import lombok.extern.log4j.Log4j2;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import java.util.*;
......@@ -239,6 +240,22 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
// failConfig.getReplay() 1 继续办理 2 中止办理 3 人工办理
// setYgsHandleStatus 3继续办理、4终止办理、5人工处理
if (CommonConstants.ONE_STRING.equals(failConfig.getReplay())) {
// 社保起缴月顺延:
if ("工伤保险允许重复参保".equals(failConfig.getReasonKey())) {
Date nextDate;
Date nextMonth = DateUtil.addMonthByDate(new Date(), CommonConstants.ONE_INT);
if (Common.isNotNull(socialInfo.getYgsSocialStartDateNext())) {
nextDate = DateUtil.addMonthByDateToOne(socialInfo.getYgsSocialStartDateNext(), CommonConstants.ONE_INT);
if (nextDate.before(nextMonth)) {
updateSocial.setYgsSocialStartDateNext(nextDate);
}
} else if (Common.isNotNull(socialInfo.getSocialStartDate())) {
nextDate = DateUtil.addMonthByDateToOne(socialInfo.getSocialStartDate(), CommonConstants.ONE_INT);
if (nextDate.before(nextMonth)) {
updateSocial.setYgsSocialStartDateNext(nextDate);
}
}
}
ygsHandleStatus = CommonConstants.THREE_STRING;
// 新增流程进展明细
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
......@@ -513,5 +530,65 @@ public class TSocialFriendServiceImpl extends ServiceImpl<TSocialFriendMapper, T
auditInfo.setSocialId(social.getId());
tAuditInfoService.save(auditInfo);
}
/**
* @Author fxj
* @Description 获取 医生大、养工伤 数据 跨月的继续办理更新为中止办理
* @Date 9:43 2025/7/14
* @Param
* @return
**/
@Transactional
@Override
public void changeSocialHandndleStatus() {
List<TSocialInfo> ygsList = tSocialInfoService.getSocialFriendYgsAllTask();
String handleStatus = CommonConstants.TWO_STRING;
List<String> ygsFailList = new ArrayList<>();
List<String> ysdFailList = new ArrayList<>();
String handleRemark = "中止办理(系统定时任务更新跨月继续办理为中止办理)";
String ygsHandleStatus = CommonConstants.FOUR_STRING;;
TSocialInfo updateSocial;
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
.createAuthorityList(dbAuthsSet.toArray(new String[0]));
YifuUser user = new YifuUser("1", null, "", "admin", "管理员", "",
"", "", false, false, false,
false, "", authorities, "", null,
null, "", null);
String typeSub = CommonConstants.ZERO_STRING;
if (ygsList != null && !ygsList.isEmpty()){
for (TSocialInfo socialInfo : ygsList) {
ygsFailList.add(socialInfo.getDispatchId());
updateSocial = new TSocialInfo();
updateSocial.setId(socialInfo.getId());
updateSocial.setYgsHandleStatus(ygsHandleStatus);
// 处理社保办理成功或失败,
if (Common.isNotNull(updateSocial.getId())) {
tSocialInfoService.updateById(updateSocial);
}
}
}
List<TSocialInfo> ysdList = tSocialInfoService.getSocialFriendYsdAllTask();
if (ysdList != null && !ysdList.isEmpty()) {
for (TSocialInfo socialInfo : ysdList) {
ysdFailList.add(socialInfo.getDispatchId());
updateSocial = new TSocialInfo();
updateSocial.setId(socialInfo.getId());
updateSocial.setYsdHandleStatus(ygsHandleStatus);
// 处理社保办理成功或失败,
if (Common.isNotNull(updateSocial.getId())) {
tSocialInfoService.updateById(updateSocial);
}
}
}
String socialType;
// 处理社保办理成功后的状态同步-失败
if (!ygsFailList.isEmpty()) {
socialType = "1,4,3";
this.doSocialAndDispatch(ygsFailList, typeSub, handleStatus, handleRemark, socialType, handleRemark, user);
}
if (!ysdFailList.isEmpty()) {
socialType = "2,5,6";
this.doSocialAndDispatch(ysdFailList, typeSub, handleStatus, handleRemark, socialType, handleRemark, user);
}
}
}
......@@ -706,5 +706,26 @@ public class TSocialInfoServiceImpl extends ServiceImpl<TSocialInfoMapper, TSoci
}
}
}
/**
* @Author fxj
* @Description 获取养工失跨月继续办理的数据
* @Date 9:50 2025/7/14
* @Param
* @return
**/
@Override
public List<TSocialInfo> getSocialFriendYgsAllTask() {
return baseMapper.getSocialFriendYgsAllTask();
}
/**
* @Author fxj
* @Description 获取医生大跨月继续办理的数据
* @Date 9:49 2025/7/14
* @Param
* @return
**/
@Override
public List<TSocialInfo> getSocialFriendYsdAllTask() {
return baseMapper.getSocialFriendYsdAllTask();
}
}
......@@ -70,6 +70,8 @@ socialFriend:
urlGetInfoAdd : /gateway/socins/hrss/employee/v2/getRegisterFeedback
urlPushReduce : /gateway/socins/hrss/employee/v2/stop
urlGetInfoReduce : /gateway/socins/hrss/employee/v2/getStopFeedback
urlDownloadEmployeeAsync: /gateway/pts/hrss/sourceFile/downloadEmployeeAsync
urlDownloadEmployeeFeedback: /gateway/pts/hrss/sourceFile/downloadEmployeeFeedback
urlUpload : /gateway/file/upload
#测试
appKey : 89357285571962202409230949030
......
......@@ -63,6 +63,8 @@ socialFriend:
urlGetInfoAdd: /gateway/socins/hrss/employee/v2/getRegisterFeedback
urlPushReduce: /gateway/socins/hrss/employee/v2/stop
urlGetInfoReduce: /gateway/socins/hrss/employee/v2/getStopFeedback
urlDownloadEmployeeAsync: /gateway/pts/hrss/sourceFile/downloadEmployeeAsync
urlDownloadEmployeeFeedback: /gateway/pts/hrss/sourceFile/downloadEmployeeFeedback
urlUpload : /gateway/file/upload
appKey : 3082B14EE2114C2D93B3A222DD925C26=
appSecret : VmURqoxqmoKnNLXzAWynqQ==
\ No newline at end of file
......@@ -62,6 +62,8 @@ socialFriend:
urlGetInfoAdd: /gateway/socins/hrss/employee/v2/getRegisterFeedback
urlPushReduce: /gateway/socins/hrss/employee/v2/stop
urlGetInfoReduce: /gateway/socins/hrss/employee/v2/getStopFeedback
urlDownloadEmployeeAsync: /gateway/pts/hrss/sourceFile/downloadEmployeeAsync
urlDownloadEmployeeFeedback: /gateway/pts/hrss/sourceFile/downloadEmployeeFeedback
urlUpload : /gateway/file/upload
appKey : 89357285571962202409230949030
appSecret : V52dkvxtFUgIvzlfNE9G8g==
\ No newline at end of file
......@@ -235,4 +235,13 @@
FROM t_atta_info a join sys_house_hold_info h on h.id=a.DOMAIN_ID
where a.RELATION_TYPE = '1' and h.IS_AUTO_LEAVE_DOC = '1'
</select>
<select id="getHouseInfoAutoDoc" resultMap="sysHouseHoldInfoMap" >
SELECT
<include refid="Base_Column_List"/>
,AREA_CODE
FROM sys_house_hold_info a
where a.AUTO_STATUS = '0'
</select>
</mapper>
......@@ -83,6 +83,7 @@
<include refid="Base_Column_List"/>
FROM t_atta_info a
where a.domain_id = #{domainId}
order by a.relation_type
</select>
<select id="getKeenAtta" resultMap="tAttaInfoMap">
......
......@@ -356,7 +356,16 @@
<result property="firstPayTime" column="FIRST_PAY_TIME"/>
<result property="graduationTime" column="GRADUATION_TIME"/>
</resultMap>
<!-- 社保反馈文件下载专用 -->
<resultMap id="socialSoldierBackMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierBackVo">
<result property="dispatchId" column="id"/>
<result property="socialId" column="social_id"/>
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="ygsHandleStatus" column="ygs_Handle_Status"/>
<result property="ysdHandleStatus" column="ysd_Handle_Status"/>
<result property="socialHouseholdName" column="SOCIAL_HOUSEHOLD_NAME"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
a.EMP_ID,
......@@ -1139,6 +1148,8 @@
<result property="ysdRemark" column="YSD_REMARK"/>
<result property="ygsRequestId" column="YGS_REQUEST_ID"/>
<result property="ysdRequestId" column="YSD_REQUEST_ID"/>
<result property="ygsSocialStartDateNext" column="YGS_SOCIAL_START_DATE_NEXT"/>
<result property="ysdSocialStartDateNext" column="YSD_SOCIAL_START_DATE_NEXT"/>
</resultMap>
......@@ -1355,6 +1366,8 @@
,s.YGS_REMARK
,s.YSD_REMARK
,s.YGS_REQUEST_ID,s.YSD_REQUEST_ID
,if(a.type ='0',DATE_FORMAT(YGS_SOCIAL_START_DATE_NEXT,"%Y-%m-%d"),null) YGS_SOCIAL_START_DATE_NEXT
,if(a.type ='0',DATE_FORMAT(YSD_SOCIAL_START_DATE_NEXT,"%Y-%m-%d"),null) YSD_SOCIAL_START_DATE_NEXT
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID
......@@ -1425,6 +1438,8 @@
,if(a.type ='0' and s.add_ysd_Handle_Status != '0', s.add_YSD_REMARK, s.YSD_REMARK) YSD_REMARK
,if(a.type ='0' and s.add_ygs_Handle_Status != '0', s.add_YGS_REQUEST_ID, s.YGS_REQUEST_ID) YGS_REQUEST_ID
,if(a.type ='0' and s.add_ysd_Handle_Status != '0', s.add_YSD_REQUEST_ID, s.YSD_REQUEST_ID) YSD_REQUEST_ID
,if(a.type ='0',DATE_FORMAT(YGS_SOCIAL_START_DATE_NEXT,"%Y-%m-%d"),null) YGS_SOCIAL_START_DATE_NEXT
,if(a.type ='0',DATE_FORMAT(YSD_SOCIAL_START_DATE_NEXT,"%Y-%m-%d"),null) YSD_SOCIAL_START_DATE_NEXT
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID
......@@ -1506,6 +1521,9 @@
<result property="ysdRemarkOld" column="YSD_REMARK_OLD"/>
<result property="ygsRequestId" column="YGS_REQUEST_ID"/>
<result property="ysdRequestId" column="YSD_REQUEST_ID"/>
<result property="ygsSocialStartDateNext" column="YGS_SOCIAL_START_DATE_NEXT"/>
<result property="ysdSocialStartDateNext" column="YSD_SOCIAL_START_DATE_NEXT"/>
<result property="backFileFlag" column="BACK_FILE_FLAG"/>
</resultMap>
<!-- hgw 2024-5-10 10:42:33 社保士兵列表查询 -->
......@@ -1592,6 +1610,11 @@
,a.SOCIAL_HOUSEHOLD_NAME,s.YGS_HANDLE_STATUS,s.YSD_HANDLE_STATUS
,s.YGS_REMARK,s.YSD_REMARK,s.YGS_REMARK_OLD,s.YSD_REMARK_OLD
,s.YGS_REQUEST_ID,s.YSD_REQUEST_ID
,if(a.type ='0',YGS_SOCIAL_START_DATE_NEXT,null) YGS_SOCIAL_START_DATE_NEXT
,if(a.type ='0',YSD_SOCIAL_START_DATE_NEXT,null) YSD_SOCIAL_START_DATE_NEXT
,a.BACK_FILE_FLAG
,a.IS_SINGLE
,a.IS_AUTO_LEAVE_DOC
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID
......@@ -1689,6 +1712,9 @@
,if(a.type ='0' and s.add_ysd_Handle_Status != '0', s.add_YSD_REMARK, s.YSD_REMARK) YSD_REMARK
,if(a.type ='0' and s.add_ygs_Handle_Status != '0', s.add_YGS_REQUEST_ID, s.YGS_REQUEST_ID) YGS_REQUEST_ID
,if(a.type ='0' and s.add_ysd_Handle_Status != '0', s.add_YSD_REQUEST_ID, s.YSD_REQUEST_ID) YSD_REQUEST_ID
,if(a.type ='0',YGS_SOCIAL_START_DATE_NEXT,null) YGS_SOCIAL_START_DATE_NEXT
,if(a.type ='0',YSD_SOCIAL_START_DATE_NEXT,null) YSD_SOCIAL_START_DATE_NEXT
,a.BACK_FILE_FLAG
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID
......@@ -2124,9 +2150,16 @@
<include refid="where_getSocialRecordRoster_base"/>
<if test="tDispatchInfo != null">
<if test="tDispatchInfo.backFileFlag != null and tDispatchInfo.backFileFlag.trim() != '' and tDispatchInfo.backFileFlag.trim() != '--'">
AND a.BACK_FILE_FLAG = #{tDispatchInfo.backFileFlag} AND a.type ='0'
</if>
<if test='tDispatchInfo.backFileFlag != null and tDispatchInfo.backFileFlag.trim() == "--"'>
AND a.type ='1'
</if>
<if test="tDispatchInfo.ygsHandleStatus != null and tDispatchInfo.ygsHandleStatus.trim() != ''">
AND s.YGS_HANDLE_STATUS = #{tDispatchInfo.ygsHandleStatus}
</if>
<if test="tDispatchInfo.ysdHandleStatus != null and tDispatchInfo.ysdHandleStatus.trim() != ''">
AND s.YSD_HANDLE_STATUS = #{tDispatchInfo.ysdHandleStatus}
</if>
......@@ -2813,4 +2846,42 @@
#{item}
</foreach>
</select>
<!--tDispatchInfo 自动化办理查询导出反馈文件-->
<select id="getSocialSoldierAllListBackFile" resultMap="socialSoldierBackMap">
SELECT
a.id,
a.social_id,
a.EMP_NAME,
a.EMP_IDCARD
,s.ygs_Handle_Status
,s.ysd_Handle_Status
,a.SOCIAL_HOUSEHOLD_NAME
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
<where>
a.DELETE_FLAG = '0'
AND a.social_id is not null
and a.AUTO_FLAG = '0'
and a.type = '0'
<!-- 税友反馈接口目前只支持社保附件下载,必须是办理成功的 -->
and s.ygs_Handle_Status = '6'
<if test="idsStr != null and idsStr.size > 0">
AND a.ID in
<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
#{items}
</foreach>
</if>
</where>
order by a.AUDIT_TIME desc
</select>
<update id="updateBackFileFlag">
update t_dispatch_info a set a.BACK_FILE_FLAG = '已下载'
WHERE 1=2
<if test="idsStr != null and idsStr.size > 0">
or a.ID in
<foreach item="items" index="index" collection="idsStr" open="(" separator="," close=")">
#{items}
</foreach>
</if>
</update>
</mapper>
......@@ -105,8 +105,8 @@
<!-- 税友养工失增加模板-->
<select id="getSocialSoldierYgsAddVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SociaFriendYgsAddVo">
<include refid="getSocialSoldierBaseOne"/>
,if(s.PENSION_START is not null,DATE_FORMAT(s.PENSION_START,"%Y-%m-%d"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y-%m-%d")) socialStartDate
,if(s.PENSION_START is not null,DATE_FORMAT(s.PENSION_START,"%Y%m"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y%m")) socialStartMonth
,if(YGS_SOCIAL_START_DATE_NEXT is not null,DATE_FORMAT(s.YGS_SOCIAL_START_DATE_NEXT,"%Y-%m-%d"), if(s.PENSION_START is not null,DATE_FORMAT(s.PENSION_START,"%Y-%m-%d"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y-%m-%d"))) socialStartDate
,if(YGS_SOCIAL_START_DATE_NEXT is not null,DATE_FORMAT(s.YGS_SOCIAL_START_DATE_NEXT,"%Y%m"), if(s.PENSION_START is not null,DATE_FORMAT(s.PENSION_START,"%Y%m"),DATE_FORMAT(s.SOCIAL_START_DATE,"%Y%m"))) socialStartMonth
<include refid="getSocialSoldierBaseTwo"/>
and a.type = '0' and s.YGS_HANDLE_STATUS in ('0','1','3')
and (
......
......@@ -749,4 +749,48 @@ if((sd.id is not null and NOW() <![CDATA[ <= ]]> sd.SOCIAL_END_DATE) or ( sd.id
where a.YGS_ADD_ID = #{addId} or a.YSD_ADD_ID = #{addId}
</select>
<!-- 获取所有需要自动办理的养工失:跨约继续办理更新为中止办理 -->
<select id="getSocialFriendYgsAllTask" resultMap="tSocialInfoMap">
SELECT
a.ID,
a.EMP_NAME,
a.SOCIAL_HOUSEHOLD_NAME,
a.EMP_IDCARD,
a.YGS_REQUEST_ID,
a.HANDLE_STATUS,
a.YGS_HANDLE_STATUS,
SUBSTRING_INDEX(GROUP_CONCAT(d.id ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_ID,
SUBSTRING_INDEX(GROUP_CONCAT(d.type ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_TYPE
FROM t_social_info a
left join t_dispatch_info d on d.SOCIAL_ID = a.id
where a.YGS_REQUEST_ID is not null and a.YGS_REQUEST_ID != '' and a.YGS_REQUEST_ID != '-' and d.AUTO_FLAG='0'
and DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and a.YGS_HANDLE_STATUS ='3'
group by a.id
order by a.YGS_REQUEST_ID asc
</select>
<!-- 获取所有需要自动办理的医生大:跨约继续办理更新为中止办理 -->
<select id="getSocialFriendYsdAllTask" resultMap="tSocialInfoMap">
SELECT
a.ID,
a.EMP_NAME,
a.SOCIAL_HOUSEHOLD_NAME,
a.EMP_IDCARD,
a.YSD_REQUEST_ID,
a.HANDLE_STATUS,
a.YSD_HANDLE_STATUS,
a.SOCIAL_START_DATE,
a.YSD_SOCIAL_START_DATE_NEXT,
SUBSTRING_INDEX(GROUP_CONCAT(d.id ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_ID,
SUBSTRING_INDEX(GROUP_CONCAT(d.type ORDER BY d.CREATE_TIME desc),',',1) as DISPATCH_TYPE
FROM t_social_info a
left join t_dispatch_info d on d.SOCIAL_ID = a.id
where a.YSD_REQUEST_ID is not null and a.YSD_REQUEST_ID != '' and a.YSD_REQUEST_ID != '-' and d.AUTO_FLAG='0'
and DATE_FORMAT(d.AUDIT_TIME,'%Y%m') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 MONTH),'%Y%m')
and a.YSD_HANDLE_STATUS = '3'
group by a.id
order by a.YSD_REQUEST_ID asc
</select>
</mapper>
......@@ -97,5 +97,8 @@ public class SysGuaziBankBranch extends BaseEntity {
@Schema(description = "所在市编码")
private String cityId;
@Schema(description = "生效状态(A有效,I失效)")
private String effStatus;
}
package com.yifu.cloud.plus.v1.yifu.admin.config;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.web.client.RestTemplate;
/**
* @Author: hgw
* @Date: 2025-6-23 10:41:07
* @Description:
* @return: 瓜子配置
**/
@Configuration
@Data
@Slf4j
public class GzConfig {
@Value("${gz.appkey}")
private String appkey;
@Value("${gz.appsecret}")
private String appsecret;
@Value("${gz.tid}")
private String tid;
@Value("${gz.appUrl}")
private String appUrl;
private static final String APP_KEY = "appKey";
private static final String TIMESTAMP = "timestamp";
private static final String X_REQ_NONCE = "xReqNonce";
private static final String VERSION = "version";
public String getGzBankInfo(RestTemplate restTemplate, String sortedParams) {
String gzBankUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/base/bank-branch?"+ sortedParams;
// 创建请求头并添加Authorization
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", "00000000"); // 设置Authorization头
// 创建HttpEntity,包含headers(GET请求没有body,所以为null)
HttpEntity<String> entity = new HttpEntity<>(null, headers);
// 发送GET请求
return restTemplate.exchange(gzBankUrl, HttpMethod.GET, entity, String.class).getBody();
}
}
......@@ -20,10 +20,12 @@ package com.yifu.cloud.plus.v1.yifu.admin.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysGuaziBankBranch;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysGuaziBankBranchService;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
......@@ -60,4 +62,41 @@ public class SysGuaziBankBranchController {
return new R<>(sysGuaziBankBranchService.getSysGuaziBankBranchPage(page, sysGuaziBankBranch));
}
/**
* 拉取瓜子支行信息
* @return R
*/
@SysLog("拉取瓜子支行信息")
@PostMapping("/pushBankBranck")
public R pushBankBranckTest() {
// String startDay = "2020-01-01";
// String startTime = startDay+" 00:00:00";
// String endDay = "2025-07-12";
// String endTime = endDay+" 00:00:00";
// Integer pageNum = 173;
String startDay = DateUtil.addDay(-1);
String startTime = startDay+" 00:00:00";
String endDay = DateUtil.addDay(0);
String endTime = endDay+" 00:00:00";
Integer pageNum = 1;
return sysGuaziBankBranchService.pushBankBranck(startTime, endTime, pageNum);
}
/**
* 拉取瓜子支行信息
* @return R
*/
@SysLog("拉取瓜子支行信息")
@PostMapping("/inner/pushBankBranck")
@Inner
public R pushBankBranck() {
String startDay = DateUtil.addDay(-1);
String startTime = startDay+" 00:00:00";
String endDay = DateUtil.addDay(0);
String endTime = endDay+" 00:00:00";
Integer pageNum = 1;
return sysGuaziBankBranchService.pushBankBranck(startTime, endTime, pageNum);
}
}
......@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysGuaziBankBranch;
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;
/**
......@@ -38,4 +39,10 @@ public interface SysGuaziBankBranchService extends IService<SysGuaziBankBranch>
*/
IPage<SysGuaziBankBranch> getSysGuaziBankBranchPage(Page<SysGuaziBankBranch> page, SysGuaziBankBranch sysGuaziBankBranch);
/**
* 拉取瓜子支行信息
* @return R
*/
R pushBankBranck(String startTime, String endTime, Integer pageNum);
}
......@@ -16,16 +16,41 @@
*/
package com.yifu.cloud.plus.v1.yifu.admin.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysGuaziBankBranch;
import com.yifu.cloud.plus.v1.yifu.admin.config.GzConfig;
import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysGuaziBankBranchMapper;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysGuaziBankBranchService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.codec.binary.Base64;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.client.RestTemplate;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
/**
* 瓜子银行支行信息
......@@ -37,6 +62,18 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Service
@RequiredArgsConstructor
public class SysGuaziBankBranchServiceImpl extends ServiceImpl<SysGuaziBankBranchMapper, SysGuaziBankBranch> implements SysGuaziBankBranchService {
private static final String STRING = "abcdefghijklmnopqrstuvwxyz";
private static final String APP_KEY = "appkey";
private static final String EXPIRES = "expires";
private static final String NONCE = "nonce";
private static final String SIGNATURE = "signature";
@Autowired
private GzConfig gzConfig;
private RestTemplate restTemplate = new RestTemplate();
/**
* 瓜子银行支行信息简单分页查询
*
......@@ -48,4 +85,254 @@ public class SysGuaziBankBranchServiceImpl extends ServiceImpl<SysGuaziBankBranc
return baseMapper.getSysGuaziBankBranchPage(page, sysGuaziBankBranch);
}
/**
* 拉取瓜子支行信息
*
* @param startTime
* @param endTime
* @return R
*/
@Override
public R pushBankBranck(String startTime, String endTime, Integer pageNum) {
Map<String, Object> params = new HashMap<>();
params.put("pageNum", pageNum);
params.put("pageSize", 10000);
params.put("startTime", startTime);
params.put("endTime", endTime);
params.put("appsecret", gzConfig.getAppsecret());
params.put("tid", gzConfig.getTid());
addSignature(params, gzConfig.getAppkey(), gzConfig.getAppsecret());
params.remove("startTime", startTime);
params.remove("endTime", endTime);
String sortedParams = getEncodeString(params);
sortedParams += "&startTime=" + startTime + "&endTime=" + endTime;
// 调取瓜子接口,拿到支行数据
String result = gzConfig.getGzBankInfo(restTemplate, sortedParams);
if (result != null && result.contains("code") && result.contains("data")) {
JSONObject resultObject = JSON.parseObject(result);
String code = resultObject.getString("code");
if (Common.isNotNull(code) && "S00000".equals(code)) {
JSONArray dataArray = (JSONArray) resultObject.get("data");
if(dataArray.size() == 0){
return R.ok("当天暂为拉取到新数据");
}
JSONObject dataObject;
Integer cnapsId;
// 获取已存在数据库的支行信息
Set<Integer> checkCnapsIdSet = new HashSet<>();
Set<Integer> haveCnapsIdSet = new HashSet<>();
for (int i=0;i<dataArray.size(); i++) {
dataObject = (JSONObject)dataArray.get(i);
cnapsId = dataObject.getInteger("cnapsId");
checkCnapsIdSet.add(cnapsId);
}
LambdaQueryWrapper<SysGuaziBankBranch> findQuery = Wrappers.<SysGuaziBankBranch>lambdaQuery()
.in(SysGuaziBankBranch::getCnapsId, checkCnapsIdSet);
List<SysGuaziBankBranch> findCnapsIdList = this.list(findQuery);
if(Common.isNotNull(findCnapsIdList)){
haveCnapsIdSet = findCnapsIdList.stream().map(SysGuaziBankBranch::getCnapsId).collect(Collectors.toSet());
}
String bankCd;
String cnapsNum;
String bankDescr;
String stateId;
String cityId;
String effStatus;
SysGuaziBankBranch saveOne;
List<SysGuaziBankBranch> saveList = new ArrayList<>();
// 开始处理支行数据
for (int i=0;i<dataArray.size(); i++) {
dataObject = (JSONObject)dataArray.get(i);
bankCd = dataObject.getString("bankCd");
cnapsId = dataObject.getInteger("cnapsId");
cnapsNum = dataObject.getString("cnapsNum");
bankDescr = dataObject.getString("bankDescr");
stateId = dataObject.getString("stateId");
cityId = dataObject.getString("cityId");
effStatus = dataObject.getString("effStatus");
// cnapsId 已存在就更新,否则新增
if(Common.isNotNull(haveCnapsIdSet) && haveCnapsIdSet.contains(cnapsId)){
LambdaUpdateWrapper<SysGuaziBankBranch> updateInfoWrapper = new LambdaUpdateWrapper<>();
updateInfoWrapper.eq(SysGuaziBankBranch::getCnapsId, cnapsId)
.set(SysGuaziBankBranch::getBankCd, bankCd)
.set(SysGuaziBankBranch::getCnapsNum, cnapsNum)
.set(SysGuaziBankBranch::getBankDescr, bankDescr)
.set(SysGuaziBankBranch::getStateId, stateId)
.set(SysGuaziBankBranch::getCityId, cityId)
.set(SysGuaziBankBranch::getEffStatus, effStatus)
.set(SysGuaziBankBranch::getUpdateBy, "1")
.set(SysGuaziBankBranch::getUpdateTime, LocalDateTime.now());
this.update(null, updateInfoWrapper);
} else {
saveOne = new SysGuaziBankBranch();
saveOne.setBankCd(bankCd);
saveOne.setCnapsId(cnapsId);
saveOne.setCnapsNum(cnapsNum);
saveOne.setBankDescr(bankDescr);
saveOne.setCityId(cityId);
saveOne.setStateId(stateId);
saveOne.setEffStatus(effStatus);
saveOne.setCreateBy("1");
saveOne.setCreateName("系统");
saveOne.setCreateTime(LocalDateTime.now());
saveList.add(saveOne);
}
}
if(Common.isNotNull(saveList)){
this.saveBatch(saveList);
}
// 一页更新完,再调下一页
this.pushBankBranck(startTime, endTime, pageNum+1);
return R.ok();
}
}
return R.failed("瓜子接口响应异常");
}
/**
* 生成签名并且将签名加到参数表中
*
* @param params 业务参数列表信息
* @param appKey
* @param appSecret
* @return
*/
private static Map<String, Object> addSignature(Map<String, Object> params, String appKey, String appSecret) {
String sign = generateSignature(params, appKey, appSecret);
params.put(SIGNATURE, sign);
return params;
}
/**
* 根据参数计算签名值
*
* @param params
* @return
*/
private static String generateSignature(Map<String, Object> params, String appKey, String appSecret) {
if (params == null ) {
return null;
}
params.put(APP_KEY, appKey);
params.put(EXPIRES, getCurrentSecond());
params.put(NONCE, generateRandomStr(6));
String sortedParams = getEncodeString(params);
return generateSignature(sortedParams, appSecret);
}
/**
* 生成签名 取5-15共10位返回
*
* @param params
* @param appSecret
* @return
*/
private static String generateSignature(String params, String appSecret) {
String result = md5(sha256HMACEncode(params, appSecret)).substring(5, 15);
return result;
}
private static String md5(String value) {
try {
MessageDigest md = MessageDigest.getInstance("md5");
byte[] e = md.digest(value.getBytes());
return byteToHexString(e);
} catch (NoSuchAlgorithmException e) {
}
return null;
}
private static String byteToHexString(byte[] salt) {
StringBuffer hexString = new StringBuffer();
for (int i = 0; i < salt.length; i++) {
String hex = Integer.toHexString(salt[i] & 0xFF);
if (hex.length() == 1) {
hex = '0' + hex;
}
hexString.append(hex.toLowerCase());
}
return hexString.toString();
}
/**
* sha256取hash Base64编码
*
* @param params
* @param secret
* @return
*/
private static String sha256HMACEncode(String params, String secret) {
String result = "";
try {
Mac sha256HMAC = Mac.getInstance("HmacSHA256");
SecretKeySpec secretKey = new SecretKeySpec(secret.getBytes(), "HmacSHA256");
sha256HMAC.init(secretKey);
byte[] sha256HMACBytes = sha256HMAC.doFinal(params.getBytes());
String hash = Base64.encodeBase64String(sha256HMACBytes);
return hash;
} catch (Exception e) {
}
return result;
}
// 获取当前时间秒数+60S
private static String getCurrentSecond() {
return (System.currentTimeMillis() / 1000 + 60) + "";
}
// 获取len个随机字符串
private static String generateRandomStr(int len) {
StringBuffer sb = new StringBuffer();
int count = len <= STRING.length() ? len : STRING.length();
Random random = new Random();
for (int i = 0; i < count; i++) {
sb.append(STRING.charAt(random.nextInt(STRING.length() - 1)));
}
return sb.toString();
}
// 通过参数集合map 组装成需要签名的字符串id=123&name=456
public static String getEncodeString(Map<String, Object> params) {
if (params == null || params.size() == 0) {
return "";
}
Iterator<String> it = params.keySet().iterator();
ArrayList<String> al = new ArrayList<String>();
while (it.hasNext()) {
al.add(it.next());
}
// 字母升序排列
Collections.sort(al);
StringBuffer sb = new StringBuffer();
for (int i = 0; i < al.size(); i++) {
try {
String key = al.get(i);
sb.append(URLEncoder.encode(key == null ? "" : key.toString(), "UTF-8"));
sb.append("=");
String item = null;
Object value = params.get(key);
item = URLEncoder.encode(value == null ? "" : value.toString(), "UTF-8");
sb.append(item);
} catch (UnsupportedEncodingException e) {
} catch (NullPointerException e) {
}
sb.append("&");
}
String result = sb.toString();
return result.substring(0, result.length() - 1);
}
}
......@@ -16,7 +16,12 @@ spring:
password: yf_zsk
url: jdbc:mysql://192.168.1.65:43306/yifu_upms?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
#瓜子配置
gz:
appkey: hr_eny00002_test
appsecret: hr_eny00002_test_20250620
tid: c2da1d84e9bd4a30b6be5ecd209096fb
appUrl: https://eim-busin-api-test-jwtys.guazi.com
......@@ -28,5 +28,10 @@ spring:
max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
#瓜子配置
gz:
appkey: hr_eny00002
appsecret: f30274f7b386469cb45a4e302b4b816b
tid: 189061502af84752b1842e9c1ecd03d7
appUrl: https://eimapi.guazi.com
......@@ -27,3 +27,10 @@ spring:
maximum-pool-size: 12 # 连接池最大连接数,默认是10
auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
#瓜子配置
gz:
appkey: hr_eny00002_test
appsecret: hr_eny00002_test_20250620
tid: c2da1d84e9bd4a30b6be5ecd209096fb
appUrl: https://eim-busin-api-test-jwtys.guazi.com
......@@ -31,6 +31,7 @@
<result property="bankDescr" column="bank_descr"/>
<result property="stateId" column="state_id"/>
<result property="cityId" column="city_id"/>
<result property="effStatus" column="eff_status"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="createName" column="create_name"/>
......@@ -45,6 +46,7 @@
a.bank_descr,
a.state_id,
a.city_id,
a.eff_status,
a.create_time,
a.create_by,
a.create_name,
......@@ -97,7 +99,7 @@
<include refid="Base_Column_List"/>
FROM sys_guazi_bank_branch a
<where>
1=1
a.eff_status = 'A'
<include refid="sysGuaziBankBranch_where"/>
</where>
order by a.id
......
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