Commit 071dbd33 authored by chenyuxi's avatar chenyuxi

feat: 瓜子交互任务

parent b8d58f64
......@@ -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:未发送)
......
......@@ -60,13 +60,13 @@ public class TGzPushEntry extends BaseEntity {
@Schema(description = "流程ID(瓜子推过来的主键)")
private String bizId;
/**
* 交互任务类型(4:待接受Offer,5:拒绝Offer,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,97:档案信息推送,13:待签署,8:合同信息推送,99:合同附件推送)
* 交互任务类型(4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,97:档案信息推送,13:待签署,8:合同信息推送,99:合同附件推送)
*/
@ExcelAttribute(name = "交互任务类型(4:待接受Offer,5:拒绝Offer,7:接受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,7:接受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,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,97:档案信息推送,13:待签署,8:合同信息推送,99:合同附件推送)")
@Schema(description = "交互任务类型(4:待接受Offer,5:拒绝Offer,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,97:档案信息推送,13:待签署,8:合同信息推送,99:合同附件推送)")
@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:待推送)
......
......@@ -7,6 +7,7 @@ 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;
......@@ -25,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;
......@@ -85,8 +87,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");
......@@ -96,23 +105,37 @@ 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, TGzEmpInfoPushGzVo 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");
......@@ -122,23 +145,36 @@ 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, TGzEmpInfoPushGzContractVo 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");
......@@ -148,19 +184,26 @@ 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) {
......@@ -196,7 +239,13 @@ public class GzConfig {
* @Date: 2025/7/10 17:44
* @return: boolean
**/
public String pushGzFile(RestTemplate restTemplate, TGzEmpInfoPushGzFileVo a, String sortedParams) {
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
......@@ -230,8 +279,14 @@ public class GzConfig {
* @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;
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");
......@@ -241,21 +296,27 @@ 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(gzAttachUrl, 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)) {
returnMap.put("responseCode", code);
}
String message = resultObject.getString("message");
if (Common.isNotNull(code) && "S00000".equals(code)) {
return "成功";
} else {
return message;
if (Common.isNotNull(message)) {
returnMap.put("responseMessage", message);
}
}
return "失败";
return returnMap;
}
}
......@@ -148,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<>();
......@@ -163,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);
}
/**
......@@ -173,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());
......@@ -184,7 +184,7 @@ public class TGzController {
gzEmpId = "1942036120125800449";
}
TGzEmpInfoPushGzVo a = tGzEmpInfoService.getGzEmpInfoToPushGzById(gzEmpId);
return gzConfig.pushGzEmpInfo(restTemplate, a, sortedParams);
return gzConfig.pushGzEmpInfo(restTemplate, a);
}
/**
* @Description: 3、合同信息回推接口;
......@@ -193,7 +193,7 @@ public class TGzController {
* @return: boolean
**/
@GetMapping("/pushGzEmpContract")
public boolean pushGzEmpContract(@RequestParam(required = false) String gzEmpId) {
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());
......@@ -204,7 +204,7 @@ public class TGzController {
gzEmpId = "1942036120125800449";
}
TGzEmpInfoPushGzContractVo a = tGzEmpInfoService.getGzEmpInfoToPushGzByIdContract(gzEmpId);
return gzConfig.pushGzEmpContract(restTemplate, a, sortedParams);
return gzConfig.pushGzEmpContract(restTemplate, a);
}
/**
* @Description: 4.2.3、员工文件信息上传接口
......@@ -244,7 +244,7 @@ public class TGzController {
vo.setFileName(a.getAttaName());
// 文件数据 Base64
vo.setFileData(base64String);
returnMap.put(a.getId(), gzConfig.pushGzFile(restTemplate, vo, sortedParams));
returnMap.put(a.getId(), gzConfig.pushGzFile(restTemplate, vo));
} catch (Exception e) {
log.info("瓜子附件推送失败!");
} finally {
......@@ -302,14 +302,17 @@ public class TGzController {
vo.setFileName(a.getAttaName());
// 文件数据 Base64
vo.setFileData(base64String);
fileId = gzConfig.pushGzFile(restTemplate, vo, sortedParams);
fileId = gzConfig.pushGzFile(restTemplate, vo);
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));
gzConfig.pushGzAttach(restTemplate, attaVo);
//returnMap.put(a.getId(), gzConfig.pushGzAttach(restTemplate, attaVo));
} catch (Exception e) {
log.info("瓜子附件推送失败!");
} finally {
......
......@@ -27,6 +27,7 @@ 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;
/**
......@@ -54,4 +55,16 @@ public class TGzPushEntryController {
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);
}
}
......@@ -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);
}
......@@ -22,6 +22,7 @@ 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;
/**
* 瓜子系统交互任务跟进表
......@@ -36,4 +37,19 @@ public interface TGzPushEntryService extends IService<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);
}
......@@ -112,6 +112,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private final TGzContractService tGzContractService;
private final TGzPushEntryService tGzPushEntryService;
private final TGzEmpInfoMapper tGzEmpInfoMapper;
/**
* 员工合同信息表简单分页查询
*
......@@ -2297,10 +2301,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 +2343,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();
......@@ -2773,6 +2784,16 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
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();
// 存变更前后的状态到 状态数组里
......
......@@ -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
......@@ -107,4 +115,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);
}
}
}
}
}
......@@ -43,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;
......@@ -113,6 +114,8 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI
// 员工家庭信息表
private final TEmpFamilyService tEmpFamilyService;
private final TGzPushEntryService tGzPushEntryService;
/**
* 瓜子档案表简单分页查询
......@@ -507,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();
......@@ -841,22 +864,33 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI
@Override
public TGzEmpInfoPushGzVo getGzEmpInfoToPushGzById(String gzEmpId) {
TGzEmpInfoPushGzVo vo = baseMapper.getGzEmpInfoToPushGzById(gzEmpId);
TGzEmpInfoPushGzVoAdress adress = baseMapper.getGzEmpInfoToPushGzByIdAdress(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);
List<TGzEmpInfoPushGzVoAtta> atta = baseMapper.getGzEmpInfoToPushGzByIdAtta(gzEmpId);
vo.setAddress(adress);
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);
//vo.setAttach(atta);
return vo;
}
......
......@@ -16,17 +16,28 @@
*/
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.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;
/**
* 瓜子系统交互任务跟进表
*
......@@ -37,13 +48,86 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Service
@RequiredArgsConstructor
public class TGzPushEntryServiceImpl extends ServiceImpl<TGzPushEntryMapper, TGzPushEntry> implements TGzPushEntryService {
@Autowired
@Lazy
private DoJointTask doJointTask;
/**
* 瓜子系统交互任务跟进表简单分页查询
*
* @param tGzPushEntry 瓜子系统交互任务跟进表
* @return
*/
@Override
public IPage<TGzPushEntrySearchVo> getTGzPushEntryPage(Page<TGzPushEntry> page, TGzPushEntrySearchVo tGzPushEntry){
return baseMapper.getTGzPushEntryPage(page,tGzPushEntry);
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.setUpdateBy(user.getId());
// 改为异步处理
doJointTask.handleGzPushEntry(findInfo);
return R.ok("已发起重新推送,正在后台推送中...稍后请刷新页面查看结果");
}
/**
* 新增推送任务
*
* @param tGzPushEntry 瓜子系统交互任务跟进表
*/
@Override
public void addPushEntry(TGzPushEntry tGzPushEntry) {
// 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)
.eq(TGzPushEntry::getDelFlag, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(findBizFailInfo)) {
return;
}
tGzPushEntry.setUpdateBy(tGzPushEntry.getCreateBy());
// 改为异步处理
doJointTask.handleGzPushEntry(tGzPushEntry);
}
}
......@@ -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("处理推送给瓜子的交互任务结束");
}
}
......@@ -677,4 +677,7 @@ public interface CommonConstants {
String NINETY_NINE = "99";
String GZ_NEE_PROVIDER_ID = "V59";
// 瓜子推送成功标识
String GZ_SUCCESS_CODE = "S00000";
}
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