推送修改

This commit is contained in:
zhaoqing
2026-06-09 11:40:05 +08:00
parent 02978d8969
commit 5dfe90aa33
3 changed files with 27 additions and 11 deletions
@@ -35,6 +35,7 @@ import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -52,12 +53,16 @@ import java.util.*;
@Slf4j
public class BusinessDocumentOrderApplicationService {
private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData";
private static final String API_NAME_I = "saveBill_i";
private static final String API_NAME_E = "saveBill_e";
private static final String VERIFY = "FuDjK3iuftzwf8kWJ44DDZJ9icZmL9Ee4Valv8Qz6VfsdW60fNEzNSEtrKlUr6OI";
private static final String API_NAME = "billAppModify";
@Value("${gw.push.url}")
private String pushUrl;
@Value("${gw.push.verify-key1}")
private String verifyKey;
@@ -279,12 +284,12 @@ public class BusinessDocumentOrderApplicationService {
// 7. 调用推送接口
try {
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(PUSH_API_URL);
HttpPost httpPost = new HttpPost(pushUrl);
StringEntity postingString = new StringEntity(JSONObject.toJSONString(bodyList), "UTF-8");
httpPost.setEntity(postingString);
httpPost.setHeader("Content-type", "application/json");
httpPost.setHeader("verify", VERIFY);
httpPost.setHeader("verify", verifyKey);
if ("I".equals(order.getIeType())) {
httpPost.setHeader("apiName", API_NAME_I);
} else if ("E".equals(order.getIeType())) {
@@ -406,12 +411,12 @@ public class BusinessDocumentOrderApplicationService {
// 3. 调用推送接口
try {
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(PUSH_API_URL);
HttpPost httpPost = new HttpPost(pushUrl);
StringEntity postingString = new StringEntity(JSONObject.toJSONString(bodyList), "UTF-8");
httpPost.setEntity(postingString);
httpPost.setHeader("Content-type", "application/json");
httpPost.setHeader("verify", VERIFY);
httpPost.setHeader("verify", verifyKey);
httpPost.setHeader("apiName", API_NAME);
CloseableHttpResponse response = httpClient.execute(httpPost);
@@ -20,6 +20,7 @@ import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -30,10 +31,13 @@ import java.util.*;
@Slf4j
public class BusinessPartnerApplicationService {
private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData";
private static final String API_NAME = "saveCorporation";
private static final String VERIFY = "ESLuxAmB6VXCgbqP1eFzxTPVRagkQ62BUkfhElrgQ6XmE/g2reHVflY/SiCSU7JD";
@Value("${gw.push.url}")
private String pushUrl;
@Value("${gw.push.verify-key2}")
private String verifyKey;
@Resource
private UserServiceFeign userServiceFeign;
@@ -115,12 +119,12 @@ public class BusinessPartnerApplicationService {
updatePushStatus(Long.valueOf(businessPartnerDTO.getShipperId()),2,new Date(),pushBy,pushByName);
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(PUSH_API_URL);
HttpPost httpPost = new HttpPost(pushUrl);
StringEntity postingString = new StringEntity(JSONObject.toJSONString(bodyList),"UTF-8");
httpPost.setEntity(postingString);
httpPost.setHeader("Content-type", "application/json");
httpPost.setHeader("apiName", API_NAME);
httpPost.setHeader("verify", VERIFY);
httpPost.setHeader("verify", verifyKey);
try{
CloseableHttpResponse response = httpClient.execute(httpPost);
String responseString = EntityUtils.toString(response.getEntity());