Commit 59506756 authored by hongguangwu's avatar hongguangwu

MVP1.7.13-瓜子接口联调

parent f7b07a04
/*
* 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 String 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;
}
......@@ -7,6 +7,10 @@ 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.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;
......@@ -107,7 +111,7 @@ public class GzConfig {
return false;
}
public boolean pushGzEmpInfo(RestTemplate restTemplate, TGzEmpInfo a, String sortedParams) {
public boolean pushGzEmpInfo(RestTemplate restTemplate, TGzEmpInfoPushGzVo a, String sortedParams) {
String gzBankUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/offer/person-info?"+ sortedParams;
// 创建请求头并添加Authorization
HttpHeaders headers = new HttpHeaders();
......@@ -133,7 +137,7 @@ public class GzConfig {
return false;
}
public boolean pushGzEmpContract(RestTemplate restTemplate, TEmpContactInfo a, String sortedParams) {
public boolean pushGzEmpContract(RestTemplate restTemplate, TGzEmpInfoPushGzContractVo a, String sortedParams) {
String gzBankUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/offer/person-contract?"+ sortedParams;
// 创建请求头并添加Authorization
HttpHeaders headers = new HttpHeaders();
......@@ -185,16 +189,49 @@ public class GzConfig {
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("成功");
/**
* @Description: 4.2.3、员工文件信息上传接口
* @Author: hgw
* @Date: 2025/7/10 17:44
* @return: boolean
**/
public String pushGzFile(RestTemplate restTemplate, TGzEmpInfoPushGzFileVo a, String sortedParams) {
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");
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);
// 发送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)) {
fileId = resultObject.getString("data");
System.out.println("成功:fileId="+fileId);
}
}
return true;
return fileId;
}
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.5、员工附件补充接口
* @Author: hgw
* @Date: 2025/7/10 17:50
* @return: boolean
**/
public String pushGzAttach(RestTemplate restTemplate, TGzEmpInfoPushGzAttaVo a, String sortedParams) {
String gzBankUrl = 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");
......@@ -203,7 +240,7 @@ 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();
......@@ -211,12 +248,14 @@ public class GzConfig {
if (result != null && result.contains("code") && result.contains("data")) {
JSONObject resultObject = JSON.parseObject(result);
String code = resultObject.getString("code");
String message = resultObject.getString("message");
if (Common.isNotNull(code) && "S00000".equals(code)) {
System.out.println("成功");
return true;
return "成功";
} else {
return message;
}
}
return false;
return "失败";
}
}
......@@ -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
......@@ -174,7 +183,7 @@ public class TGzController {
// 653497199507262524 李丽
gzEmpId = "1942036120125800449";
}
TGzEmpInfo a = tGzEmpInfoService.getById(gzEmpId);
TGzEmpInfoPushGzVo a = tGzEmpInfoService.getGzEmpInfoToPushGzById(gzEmpId);
return gzConfig.pushGzEmpInfo(restTemplate, a, sortedParams);
}
/**
......@@ -184,47 +193,82 @@ public class TGzController {
* @return: boolean
**/
@GetMapping("/pushGzEmpContract")
public boolean pushGzEmpContract(@RequestParam(required = false) String empContractId) {
public boolean 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);
TGzEmpInfoPushGzContractVo a = tGzEmpInfoService.getGzEmpInfoToPushGzByIdContract(gzEmpId);
return gzConfig.pushGzEmpContract(restTemplate, a, sortedParams);
}
/**
* @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";
}
TGzEmpInfo a = tGzEmpInfoService.getById(empContractId);
return gzConfig.pushGzEmpInfo(restTemplate, a, sortedParams);
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, sortedParams));
} catch (Exception e) {
log.info("瓜子附件推送失败!");
} finally {
if (null != inStream) {
try {
inStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
}
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,52 @@ 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());
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);
TGzEmpInfoPushGzFileVo vo;
TGzEmpInfoPushGzAttaVo attaVo;
TGzEmpInfo tGzEmpInfo = tGzEmpInfoService.getById(gzEmpId);
Map<String, String> returnMap = new HashMap<>();
if (tGzEmpInfo != null && Common.isNotNull(tGzEmpInfo.getBizId())) {
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, sortedParams);
attaVo = new TGzEmpInfoPushGzAttaVo();
attaVo.setBizId(bizId);
attaVo.setFileId(fileId);
attaVo.setAttachType(a.getRelationType());
attaVo.setFileName(a.getAttaName());
returnMap.put(a.getId(), gzConfig.pushGzAttach(restTemplate, attaVo, sortedParams));
} 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;
}
......
......@@ -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);
}
......@@ -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);
}
......@@ -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;
......@@ -57,7 +55,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.*;
......@@ -834,6 +831,40 @@ 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 adress = 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);
List<TGzEmpInfoPushGzVoAtta> atta = baseMapper.getGzEmpInfoToPushGzByIdAtta(gzEmpId);
vo.setAddress(adress);
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) {
// 查找档案、项目档案,无则新建
......
......@@ -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.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 limit 1
</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>
<!--推送瓜子的瓜子档案信息-合同-->
<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,
date_format(a.prc_exp_dt, '%Y-%m-%d') prcExpDt,
date_format(a.probation_dt, '%Y-%m-%d') probationDt,
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>
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