Commit 071dbd33 authored by chenyuxi's avatar chenyuxi

feat: 瓜子交互任务

parent b8d58f64
...@@ -66,14 +66,14 @@ public class TGzOfferInfo extends BaseEntity { ...@@ -66,14 +66,14 @@ public class TGzOfferInfo extends BaseEntity {
/** /**
* Offer状态 * 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:候选人审核通过) * 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) @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,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)不能为空") @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,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)不能超过2个字符") @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,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,13:待签署,8:合同审核通过。99:已归档)") @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,7:接受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; private String offerStatus;
/** /**
* Offer短信通知状态( 0:已发送;1:未发送) * Offer短信通知状态( 0:已发送;1:未发送)
......
...@@ -60,13 +60,13 @@ public class TGzPushEntry extends BaseEntity { ...@@ -60,13 +60,13 @@ public class TGzPushEntry extends BaseEntity {
@Schema(description = "流程ID(瓜子推过来的主键)") @Schema(description = "流程ID(瓜子推过来的主键)")
private String bizId; 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) @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,7:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,97:档案信息推送,13:待签署,8:合同信息推送,99:合同附件推送)不能为空") @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个字符") @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:合同附件推送)") @ExcelProperty("交互任务类型(4:待接受Offer,5:拒绝Offer,6:接受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:合同附件推送)") @Schema(description = "交互任务类型(4:待接受Offer,5:拒绝Offer,6:接受offer,9:候选人填写信息,10:取消offer,12:候选人信息审核,97:档案信息推送,13:待签署,8:合同信息推送,99:合同附件推送)")
private String taskType; private String taskType;
/** /**
* 推送状态(0:推送成功1:推送失败2:待推送) * 推送状态(0:推送成功1:推送失败2:待推送)
......
...@@ -7,6 +7,7 @@ import com.google.gson.Gson; ...@@ -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.TAttaInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmpContactInfo; 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.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.TGzEmpInfoPushGzAttaVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzEmpInfoPushGzContractVo; 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.TGzEmpInfoPushGzFileVo;
...@@ -25,6 +26,7 @@ import org.springframework.http.MediaType; ...@@ -25,6 +26,7 @@ import org.springframework.http.MediaType;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -85,8 +87,15 @@ public class GzConfig { ...@@ -85,8 +87,15 @@ public class GzConfig {
return false; return false;
} }
public boolean updateGzOfferStatus(RestTemplate restTemplate, Map<String, Object> params, String sortedParams) { public Map<String,String> updateGzOfferStatus(RestTemplate restTemplate, Map<String, Object> params) {
String gzBankUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/offer/update-status?"+ sortedParams; // 签名
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 // 创建请求头并添加Authorization
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
...@@ -96,23 +105,37 @@ public class GzConfig { ...@@ -96,23 +105,37 @@ public class GzConfig {
Gson gson = new Gson(); Gson gson = new Gson();
// 创建HttpEntity,包含headers(GET请求没有body,所以为null) // 创建HttpEntity,包含headers(GET请求没有body,所以为null)
HttpEntity<String> entity = new HttpEntity<>(gson.toJson(params), headers); HttpEntity<String> entity = new HttpEntity<>(gson.toJson(params), headers);
// 发送GET请求 Map<String,String> returnMap = new HashMap<>();
String result = restTemplate.exchange(gzBankUrl, HttpMethod.POST, entity, String.class).getBody(); 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); System.out.println(result);
if (result != null && result.contains("code") && result.contains("data")) { if (result != null && result.contains("code") && result.contains("data")) {
JSONObject resultObject = JSON.parseObject(result); JSONObject resultObject = JSON.parseObject(result);
String code = resultObject.getString("code"); String code = resultObject.getString("code");
if (Common.isNotNull(code) && "S00000".equals(code)) { if (Common.isNotNull(code)) {
System.out.println("成功"); returnMap.put("responseCode", code);
return true;
} }
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) { public Map<String,String> pushGzEmpInfo(RestTemplate restTemplate, TGzEmpInfoPushGzVo a) {
String gzBankUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/offer/person-info?"+ sortedParams; // 签名
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 // 创建请求头并添加Authorization
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
...@@ -122,23 +145,36 @@ public class GzConfig { ...@@ -122,23 +145,36 @@ public class GzConfig {
Gson gson = new Gson(); Gson gson = new Gson();
// 创建HttpEntity,包含headers(GET请求没有body,所以为null) // 创建HttpEntity,包含headers(GET请求没有body,所以为null)
HttpEntity<String> entity = new HttpEntity<>(gson.toJson(a), headers); HttpEntity<String> entity = new HttpEntity<>(gson.toJson(a), headers);
// 发送GET请求 Map<String,String> returnMap = new HashMap<>();
String result = restTemplate.exchange(gzBankUrl, HttpMethod.POST, entity, String.class).getBody(); 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); System.out.println(result);
if (result != null && result.contains("code") && result.contains("data")) { if (result != null && result.contains("code") && result.contains("data")) {
JSONObject resultObject = JSON.parseObject(result); JSONObject resultObject = JSON.parseObject(result);
String code = resultObject.getString("code"); String code = resultObject.getString("code");
if (Common.isNotNull(code) && "S00000".equals(code)) { if (Common.isNotNull(code)) {
System.out.println("成功"); returnMap.put("responseCode", code);
return true;
} }
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) { public Map<String,String> pushGzEmpContract(RestTemplate restTemplate, TGzEmpInfoPushGzContractVo a) {
String gzBankUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/offer/person-contract?"+ sortedParams; 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 // 创建请求头并添加Authorization
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
...@@ -148,19 +184,26 @@ public class GzConfig { ...@@ -148,19 +184,26 @@ public class GzConfig {
Gson gson = new Gson(); Gson gson = new Gson();
// 创建HttpEntity,包含headers(GET请求没有body,所以为null) // 创建HttpEntity,包含headers(GET请求没有body,所以为null)
HttpEntity<String> entity = new HttpEntity<>(gson.toJson(a), headers); HttpEntity<String> entity = new HttpEntity<>(gson.toJson(a), headers);
// 发送GET请求 Map<String,String> returnMap = new HashMap<>();
String result = restTemplate.exchange(gzBankUrl, HttpMethod.POST, entity, String.class).getBody(); 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); System.out.println(result);
if (result != null && result.contains("code") && result.contains("data")) { if (result != null && result.contains("code") && result.contains("data")) {
JSONObject resultObject = JSON.parseObject(result); JSONObject resultObject = JSON.parseObject(result);
String code = resultObject.getString("code"); String code = resultObject.getString("code");
if (Common.isNotNull(code) && "S00000".equals(code)) { if (Common.isNotNull(code)) {
System.out.println("成功"); returnMap.put("responseCode", code);
return true;
} }
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) { public boolean pushGzEmpContractFile(RestTemplate restTemplate, TEmpContactInfo a, String sortedParams) {
...@@ -196,7 +239,13 @@ public class GzConfig { ...@@ -196,7 +239,13 @@ public class GzConfig {
* @Date: 2025/7/10 17:44 * @Date: 2025/7/10 17:44
* @return: boolean * @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 fileId = null;
String gzBankUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/file/upload?"+ sortedParams; String gzBankUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/file/upload?"+ sortedParams;
// 创建请求头并添加Authorization // 创建请求头并添加Authorization
...@@ -230,8 +279,14 @@ public class GzConfig { ...@@ -230,8 +279,14 @@ public class GzConfig {
* @Date: 2025/7/10 17:50 * @Date: 2025/7/10 17:50
* @return: boolean * @return: boolean
**/ **/
public String pushGzAttach(RestTemplate restTemplate, TGzEmpInfoPushGzAttaVo a, String sortedParams) { public Map<String,String> pushGzAttach(RestTemplate restTemplate, TGzEmpInfoPushGzAttaVo a) {
String gzBankUrl = appUrl + "/eim-hr-induction/api/hr/induction/open/offer/attach?"+ sortedParams; 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 // 创建请求头并添加Authorization
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
...@@ -241,21 +296,27 @@ public class GzConfig { ...@@ -241,21 +296,27 @@ public class GzConfig {
Gson gson = new Gson(); Gson gson = new Gson();
// 创建HttpEntity,包含headers(GET请求没有body,所以为null) // 创建HttpEntity,包含headers(GET请求没有body,所以为null)
HttpEntity<String> entity = new HttpEntity<>(gson.toJson(a), headers); HttpEntity<String> entity = new HttpEntity<>(gson.toJson(a), headers);
// 发送GET请求 Map<String,String> returnMap = new HashMap<>();
String result = restTemplate.exchange(gzBankUrl, HttpMethod.POST, entity, String.class).getBody(); 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); System.out.println(result);
if (result != null && result.contains("code") && result.contains("data")) { if (result != null && result.contains("code") && result.contains("data")) {
JSONObject resultObject = JSON.parseObject(result); JSONObject resultObject = JSON.parseObject(result);
String code = resultObject.getString("code"); String code = resultObject.getString("code");
if (Common.isNotNull(code)) {
returnMap.put("responseCode", code);
}
String message = resultObject.getString("message"); String message = resultObject.getString("message");
if (Common.isNotNull(code) && "S00000".equals(code)) { if (Common.isNotNull(message)) {
return "成功"; returnMap.put("responseMessage", message);
} else {
return message;
} }
} }
return "失败"; return returnMap;
} }
} }
...@@ -148,7 +148,7 @@ public class TGzController { ...@@ -148,7 +148,7 @@ public class TGzController {
* @return: boolean * @return: boolean
**/ **/
@GetMapping("/updateGzOfferStatus") @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 phone, @RequestParam(required = false) String email
, @RequestParam(required = false) String entryDate) { , @RequestParam(required = false) String entryDate) {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
...@@ -163,7 +163,7 @@ public class TGzController { ...@@ -163,7 +163,7 @@ public class TGzController {
params.put("email", email); params.put("email", email);
params.put("entryDate", entryDate); params.put("entryDate", entryDate);
return gzConfig.updateGzOfferStatus(restTemplate, params, sortedParams); return gzConfig.updateGzOfferStatus(restTemplate, params);
} }
/** /**
...@@ -173,7 +173,7 @@ public class TGzController { ...@@ -173,7 +173,7 @@ public class TGzController {
* @return: boolean * @return: boolean
**/ **/
@GetMapping("/pushGzEmpInfo") @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<>(); Map<String, Object> params = new HashMap<>();
params.put("appsecret", gzConfig.getAppsecret()); params.put("appsecret", gzConfig.getAppsecret());
params.put("tid", gzConfig.getTid()); params.put("tid", gzConfig.getTid());
...@@ -184,7 +184,7 @@ public class TGzController { ...@@ -184,7 +184,7 @@ public class TGzController {
gzEmpId = "1942036120125800449"; gzEmpId = "1942036120125800449";
} }
TGzEmpInfoPushGzVo a = tGzEmpInfoService.getGzEmpInfoToPushGzById(gzEmpId); TGzEmpInfoPushGzVo a = tGzEmpInfoService.getGzEmpInfoToPushGzById(gzEmpId);
return gzConfig.pushGzEmpInfo(restTemplate, a, sortedParams); return gzConfig.pushGzEmpInfo(restTemplate, a);
} }
/** /**
* @Description: 3、合同信息回推接口; * @Description: 3、合同信息回推接口;
...@@ -193,7 +193,7 @@ public class TGzController { ...@@ -193,7 +193,7 @@ public class TGzController {
* @return: boolean * @return: boolean
**/ **/
@GetMapping("/pushGzEmpContract") @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<>(); Map<String, Object> params = new HashMap<>();
params.put("appsecret", gzConfig.getAppsecret()); params.put("appsecret", gzConfig.getAppsecret());
params.put("tid", gzConfig.getTid()); params.put("tid", gzConfig.getTid());
...@@ -204,7 +204,7 @@ public class TGzController { ...@@ -204,7 +204,7 @@ public class TGzController {
gzEmpId = "1942036120125800449"; gzEmpId = "1942036120125800449";
} }
TGzEmpInfoPushGzContractVo a = tGzEmpInfoService.getGzEmpInfoToPushGzByIdContract(gzEmpId); TGzEmpInfoPushGzContractVo a = tGzEmpInfoService.getGzEmpInfoToPushGzByIdContract(gzEmpId);
return gzConfig.pushGzEmpContract(restTemplate, a, sortedParams); return gzConfig.pushGzEmpContract(restTemplate, a);
} }
/** /**
* @Description: 4.2.3、员工文件信息上传接口 * @Description: 4.2.3、员工文件信息上传接口
...@@ -244,7 +244,7 @@ public class TGzController { ...@@ -244,7 +244,7 @@ public class TGzController {
vo.setFileName(a.getAttaName()); vo.setFileName(a.getAttaName());
// 文件数据 Base64 // 文件数据 Base64
vo.setFileData(base64String); vo.setFileData(base64String);
returnMap.put(a.getId(), gzConfig.pushGzFile(restTemplate, vo, sortedParams)); returnMap.put(a.getId(), gzConfig.pushGzFile(restTemplate, vo));
} catch (Exception e) { } catch (Exception e) {
log.info("瓜子附件推送失败!"); log.info("瓜子附件推送失败!");
} finally { } finally {
...@@ -302,14 +302,17 @@ public class TGzController { ...@@ -302,14 +302,17 @@ public class TGzController {
vo.setFileName(a.getAttaName()); vo.setFileName(a.getAttaName());
// 文件数据 Base64 // 文件数据 Base64
vo.setFileData(base64String); vo.setFileData(base64String);
fileId = gzConfig.pushGzFile(restTemplate, vo, sortedParams); fileId = gzConfig.pushGzFile(restTemplate, vo);
attaVo = new TGzEmpInfoPushGzAttaVo(); attaVo = new TGzEmpInfoPushGzAttaVo();
attaVo.setBizId(bizId); attaVo.setBizId(bizId);
attaVo.setFileId(fileId); attaVo.setFileId(fileId);
attaVo.setAttachType(a.getRelationType()); attaVo.setAttachType(a.getRelationType());
attaVo.setFileName(a.getAttaName()); 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) { } catch (Exception e) {
log.info("瓜子附件推送失败!"); log.info("瓜子附件推送失败!");
} finally { } finally {
......
...@@ -27,6 +27,7 @@ import io.swagger.v3.oas.annotations.Operation; ...@@ -27,6 +27,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
/** /**
...@@ -54,4 +55,16 @@ public class TGzPushEntryController { ...@@ -54,4 +55,16 @@ public class TGzPushEntryController {
public R<IPage<TGzPushEntrySearchVo>> getTGzPushEntryPage(Page<TGzPushEntry> page, TGzPushEntrySearchVo tGzPushEntry) { public R<IPage<TGzPushEntrySearchVo>> getTGzPushEntryPage(Page<TGzPushEntry> page, TGzPushEntrySearchVo tGzPushEntry) {
return new R<>(tGzPushEntryService.getTGzPushEntryPage(page,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 { ...@@ -37,4 +37,13 @@ public interface TGzContractService {
*/ */
void saveContractInfoToGzEmpInfo(TEmployeeContractInfo contractInfo, Integer offerId, String workLocation, String workLocationDescr); 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; ...@@ -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.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.archives.vo.TGzPushEntrySearchVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
/** /**
* 瓜子系统交互任务跟进表 * 瓜子系统交互任务跟进表
...@@ -36,4 +37,19 @@ public interface TGzPushEntryService extends IService<TGzPushEntry> { ...@@ -36,4 +37,19 @@ public interface TGzPushEntryService extends IService<TGzPushEntry> {
* @return * @return
*/ */
IPage<TGzPushEntrySearchVo> getTGzPushEntryPage(Page<TGzPushEntry> page, TGzPushEntrySearchVo tGzPushEntry); 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 ...@@ -112,6 +112,10 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
private final TGzContractService tGzContractService; private final TGzContractService tGzContractService;
private final TGzPushEntryService tGzPushEntryService;
private final TGzEmpInfoMapper tGzEmpInfoMapper;
/** /**
* 员工合同信息表简单分页查询 * 员工合同信息表简单分页查询
* *
...@@ -2297,10 +2301,36 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -2297,10 +2301,36 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tGzContractService.saveContractInfoToGzEmpInfo(contractInfo, gzOfferInfo.getId(), gzOfferInfo.getWorkLocation(),gzOfferInfo.getWorkLocationDescr()); 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:已归档 // 13:待签署,8:合同审核通过,99:已归档
// 9:发起合同申请10:合同审核通过;11:合同归档; // 9:发起合同申请10:合同审核通过;11:合同归档;
String recordFrom = ""; String recordFrom = "";
switch (updStatus) { switch (updStatus) {
case "13": case "13":
recordFrom = "9"; recordFrom = "9";
...@@ -2313,6 +2343,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr ...@@ -2313,6 +2343,16 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
break; 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(); LGuaziOfferRecordVo lGuaziOfferRecordVo = new LGuaziOfferRecordVo();
// 存变更前后的状态到 状态数组里 // 存变更前后的状态到 状态数组里
List<String> changeStatusList = new ArrayList<>(); List<String> changeStatusList = new ArrayList<>();
......
...@@ -141,6 +141,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -141,6 +141,8 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
private final TGzContractService tGzContractService; private final TGzContractService tGzContractService;
private final TGzPushEntryService tGzPushEntryService;
@Autowired @Autowired
private OSSUtil ossUtil; private OSSUtil ossUtil;
...@@ -2636,6 +2638,15 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -2636,6 +2638,15 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
// 合同审核通过 生成瓜子档案里的合同信息 // 合同审核通过 生成瓜子档案里的合同信息
tGzContractService.saveContractInfoToGzEmpInfo(c, gzOfferInfo.getId(), gzOfferInfo.getWorkLocation(),gzOfferInfo.getWorkLocationDescr()); 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(); LGuaziOfferRecordVo lGuaziOfferRecordVo = new LGuaziOfferRecordVo();
...@@ -2773,6 +2784,16 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -2773,6 +2784,16 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
gzOfferInfo.setOfferStatus(CommonConstants.THIRTEEN_STRING); gzOfferInfo.setOfferStatus(CommonConstants.THIRTEEN_STRING);
gzOfferInfoMapper.updateById(gzOfferInfo); 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(); LGuaziOfferRecordVo lGuaziOfferRecordVo = new LGuaziOfferRecordVo();
// 存变更前后的状态到 状态数组里 // 存变更前后的状态到 状态数组里
......
...@@ -16,19 +16,25 @@ ...@@ -16,19 +16,25 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.archives.service.impl; 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.TEmployeeContractInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzEmpInfo; 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.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.archives.service.TGzContractService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; 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.Common;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 瓜子合同提取方法 * 瓜子合同提取方法
...@@ -43,6 +49,8 @@ public class TGzContractServiceImpl implements TGzContractService { ...@@ -43,6 +49,8 @@ public class TGzContractServiceImpl implements TGzContractService {
private final TGzEmpInfoMapper tGzEmpInfoMapper; private final TGzEmpInfoMapper tGzEmpInfoMapper;
private final TAttaInfoService tAttaInfoService;
/** /**
* 生成瓜子档案里的合同信息 * 生成瓜子档案里的合同信息
* chenyx * chenyx
...@@ -107,4 +115,33 @@ public class TGzContractServiceImpl implements TGzContractService { ...@@ -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; ...@@ -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 com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.GrantedAuthority;
...@@ -113,6 +114,8 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI ...@@ -113,6 +114,8 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI
// 员工家庭信息表 // 员工家庭信息表
private final TEmpFamilyService tEmpFamilyService; private final TEmpFamilyService tEmpFamilyService;
private final TGzPushEntryService tGzPushEntryService;
/** /**
* 瓜子档案表简单分页查询 * 瓜子档案表简单分页查询
...@@ -507,6 +510,26 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI ...@@ -507,6 +510,26 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI
// 记录状态变更的offer操作日志 记录来源: 6:(系统触发)C端采集提交 // 记录状态变更的offer操作日志 记录来源: 6:(系统触发)C端采集提交
this.saveOfferStatusRecord(gzOfferInfo.getId(),CommonConstants.SIX_STRING, this.saveOfferStatusRecord(gzOfferInfo.getId(),CommonConstants.SIX_STRING,
CommonConstants.NINE_STRING,gzOfferInfo.getOfferStatus(),"0","系统触发"); 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(); String gzEmpId = tGzEmpInfoVo.getId();
...@@ -841,22 +864,33 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI ...@@ -841,22 +864,33 @@ public class TGzEmpInfoServiceImpl extends ServiceImpl<TGzEmpInfoMapper, TGzEmpI
@Override @Override
public TGzEmpInfoPushGzVo getGzEmpInfoToPushGzById(String gzEmpId) { public TGzEmpInfoPushGzVo getGzEmpInfoToPushGzById(String gzEmpId) {
TGzEmpInfoPushGzVo vo = baseMapper.getGzEmpInfoToPushGzById(gzEmpId); TGzEmpInfoPushGzVo vo = baseMapper.getGzEmpInfoToPushGzById(gzEmpId);
TGzEmpInfoPushGzVoAdress adress = baseMapper.getGzEmpInfoToPushGzByIdAdress(gzEmpId); TGzEmpInfoPushGzVoAdress address = baseMapper.getGzEmpInfoToPushGzByIdAdress(gzEmpId);
TGzEmpInfoPushGzVoBank bank = baseMapper.getGzEmpInfoToPushGzByIdBank(gzEmpId); TGzEmpInfoPushGzVoBank bank = baseMapper.getGzEmpInfoToPushGzByIdBank(gzEmpId);
List<TGzEmpInfoPushGzVoFamily> family = baseMapper.getGzEmpInfoToPushGzByIdFamily(gzEmpId); List<TGzEmpInfoPushGzVoFamily> family = baseMapper.getGzEmpInfoToPushGzByIdFamily(gzEmpId);
List<TGzEmpInfoPushGzVoContact> contact = baseMapper.getGzEmpInfoToPushGzByIdContact(gzEmpId); List<TGzEmpInfoPushGzVoContact> contact = baseMapper.getGzEmpInfoToPushGzByIdContact(gzEmpId);
List<TGzEmpInfoPushGzVoWork> work = baseMapper.getGzEmpInfoToPushGzByIdWork(gzEmpId); List<TGzEmpInfoPushGzVoWork> work = baseMapper.getGzEmpInfoToPushGzByIdWork(gzEmpId);
List<TGzEmpInfoPushGzVoEducation> education = baseMapper.getGzEmpInfoToPushGzByIdEducation(gzEmpId); List<TGzEmpInfoPushGzVoEducation> education = baseMapper.getGzEmpInfoToPushGzByIdEducation(gzEmpId);
List<TGzEmpInfoPushGzVoSkill> skill = baseMapper.getGzEmpInfoToPushGzByIdSkill(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.setBankAccount(bank);
vo.setFamily(family); vo.setFamily(family);
vo.setEmergContact(contact); vo.setEmergContact(contact);
vo.setWorkExp(work); vo.setWorkExp(work);
vo.setEduExp(education); vo.setEduExp(education);
vo.setSkill(skill); vo.setSkill(skill);
vo.setAttach(atta); //vo.setAttach(atta);
return vo; return vo;
} }
......
...@@ -16,17 +16,28 @@ ...@@ -16,17 +16,28 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.archives.service.impl; 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TGzPushEntry; 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.mapper.TGzPushEntryMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TGzPushEntryService; 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.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzPushEntrySearchVo; import com.yifu.cloud.plus.v1.yifu.archives.vo.TGzPushEntrySearchVo;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.time.LocalDateTime;
/** /**
* 瓜子系统交互任务跟进表 * 瓜子系统交互任务跟进表
* *
...@@ -37,13 +48,86 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -37,13 +48,86 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class TGzPushEntryServiceImpl extends ServiceImpl<TGzPushEntryMapper, TGzPushEntry> implements TGzPushEntryService { public class TGzPushEntryServiceImpl extends ServiceImpl<TGzPushEntryMapper, TGzPushEntry> implements TGzPushEntryService {
@Autowired
@Lazy
private DoJointTask doJointTask;
/** /**
* 瓜子系统交互任务跟进表简单分页查询 * 瓜子系统交互任务跟进表简单分页查询
*
* @param tGzPushEntry 瓜子系统交互任务跟进表 * @param tGzPushEntry 瓜子系统交互任务跟进表
* @return * @return
*/ */
@Override @Override
public IPage<TGzPushEntrySearchVo> getTGzPushEntryPage(Page<TGzPushEntry> page, TGzPushEntrySearchVo tGzPushEntry){ public IPage<TGzPushEntrySearchVo> getTGzPushEntryPage(Page<TGzPushEntry> page, TGzPushEntrySearchVo tGzPushEntry) {
return baseMapper.getTGzPushEntryPage(page,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; ...@@ -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.FddContractAttachInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo; 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.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.mapper.TEmployeeProjectMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeInfoService; 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.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.archives.vo.EmployeeProjectNewOldVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; 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.Common;
...@@ -39,6 +41,9 @@ public class DoJointTask { ...@@ -39,6 +41,9 @@ public class DoJointTask {
@Autowired @Autowired
private TEmployeeLogService tEmployeeLogService; private TEmployeeLogService tEmployeeLogService;
@Autowired
private TGzPushHandleService tGzPushHandleService;
/** /**
* @Description: 合同-批量更换负责人 * @Description: 合同-批量更换负责人
* @Author: huyc * @Author: huyc
...@@ -144,4 +149,20 @@ public class DoJointTask { ...@@ -144,4 +149,20 @@ public class DoJointTask {
} }
log.info("档案-更新项目档案操作记录结束"); 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 { ...@@ -677,4 +677,7 @@ public interface CommonConstants {
String NINETY_NINE = "99"; String NINETY_NINE = "99";
String GZ_NEE_PROVIDER_ID = "V59"; 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