提交 6bb89d39 authored 作者: wangmenglong's avatar wangmenglong

上下架表示

上级 9cbecd93
......@@ -183,7 +183,7 @@ public class Recruit extends NameObj {
/**
* 行业code
**/
@TableField(exist = false)
@TableField("industry_code")
private String industryCode;
/**
......
......@@ -187,10 +187,16 @@
<scope>compile</scope>
</dependency>
<dependency>
<!--<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>4.38.0.ALL</version>
</dependency>-->
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>4.40.461.ALL</version>
</dependency>
</dependencies>
......
......@@ -7,9 +7,12 @@ import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.AlipayConfig;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.domain.AlipayEbppIndustryJobResumeauthlogininfoGetModel;
import com.alipay.api.internal.util.AlipayEncrypt;
import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.AlipayEbppIndustryJobResumeauthlogininfoGetRequest;
import com.alipay.api.request.AlipaySystemOauthTokenRequest;
import com.alipay.api.response.AlipayEbppIndustryJobResumeauthlogininfoGetResponse;
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
import data.recruit.Person;
import org.springframework.web.bind.annotation.*;
......@@ -122,9 +125,52 @@ public class ApiAliController extends BaseController {
}
/**
* @description: 获取安心工作证
* @author: wangmenglong
* @date; 2023/12/7 10:07
* @param: [req]
* @return: com.github.pagehelper.PageInfo
**/
@PostMapping("/info/get")
public BaseResult infoGet(@RequestBody JSONObject jsonObject)throws Exception{
// 初始化SDK
AlipayClient alipayClient = new DefaultAlipayClient(getAlipayConfig());
// 构造请求参数以调用接口
AlipayEbppIndustryJobResumeauthlogininfoGetRequest request = new AlipayEbppIndustryJobResumeauthlogininfoGetRequest();
AlipayEbppIndustryJobResumeauthlogininfoGetModel model = new AlipayEbppIndustryJobResumeauthlogininfoGetModel();
// 设置业务token
model.setBizToken(jsonObject.getString("biz_token"));
request.setBizModel(model);
// 第三方代调用模式下请设置app_auth_token
// request.putOtherTextParam("app_auth_token", "<-- 请填写应用授权令牌 -->");
AlipayEbppIndustryJobResumeauthlogininfoGetResponse response = alipayClient.execute(request);
System.out.println(response.getBody());
if (response.isSuccess()) {
System.out.println("调用成功");
} else {
System.out.println("调用失败");
// sdk版本是"4.38.0.ALL"及以上,可以参考下面的示例获取诊断链接
// String diagnosisUrl = DiagnosisUtils.getDiagnosisUrl(response);
// System.out.println(diagnosisUrl);
}
return BaseResult.success(response.getBody());
}
public static AlipayConfig getAlipayConfig() {
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com/gateway.do");
//alipayConfig.setServerUrl("https://openapipre.alipay.com/gateway.do"); //测试
alipayConfig.setServerUrl("https://openapi.alipay.com/gateway.do"); //正式
alipayConfig.setAppId(appId);
alipayConfig.setPrivateKey(privateKey);
alipayConfig.setFormat("json");
......
......@@ -348,19 +348,28 @@ public class RecruitServiceImpl extends ServiceImpl<RecruitMapper, Recruit> impl
}
recruit = super.getById(recruit.getId());
recruit.setOrg(orgService.getDetails(recruit.getOrgId()));
switch (recruit.getStatus()){
case "up":
//todo 发送阿里
//sendAli(recruit);
recruit.setStatus("down");
recruit.setLaunch("1");
break;
case "down":
try {
sendAli(recruit);
}catch (Exception e){
e.printStackTrace();
}
recruit.setStatus("up");
break;
default:
//todo 发送阿里
//sendAli(recruit);
try {
sendAli(recruit);
}catch (Exception e){
e.printStackTrace();
}
recruit.setStatus("up");
return false;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论