staging
This commit is contained in:
parent
7beaad5d14
commit
05d3849c58
|
|
@ -1,5 +1,6 @@
|
|||
package cn.iocoder.yudao.module.haoka.api;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.haoka.dal.dataobject.superiorapi.SuperiorApiDevConfigDO;
|
||||
import cn.iocoder.yudao.module.haoka.service.superiorapi.SuperiorApiDevConfigService;
|
||||
|
|
@ -18,20 +19,18 @@ public abstract class ApiConfigService {
|
|||
@Resource
|
||||
protected SuperiorApiDevConfigService superiorApiDevConfigService;
|
||||
|
||||
abstract public ApiFrom getApiFrom();
|
||||
|
||||
public Map<String, String> getDevConfig() {
|
||||
ApiFrom apiFrom = getApiFrom();
|
||||
public Map<String, String> getDevConfig(Long haokaSuperiorApiId) {
|
||||
Assert.notNull(haokaSuperiorApiId);
|
||||
List<SuperiorApiDevConfigDO> list = superiorApiDevConfigService.list(
|
||||
new LambdaQueryWrapperX<SuperiorApiDevConfigDO>()
|
||||
.eqIfPresent(SuperiorApiDevConfigDO::getHaokaSuperiorApiId, apiFrom.getId())
|
||||
.eqIfPresent(SuperiorApiDevConfigDO::getHaokaSuperiorApiId, haokaSuperiorApiId)
|
||||
|
||||
);
|
||||
return list.stream().collect(Collectors.toMap(SuperiorApiDevConfigDO::getCode, SuperiorApiDevConfigDO::getValue));
|
||||
}
|
||||
|
||||
public String getConfigValue(String key) {
|
||||
return getDevConfig().get(key);
|
||||
public String getConfigValue(Long haokaSuperiorApiId, String key) {
|
||||
return getDevConfig(haokaSuperiorApiId).get(key);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ public class ApiGuangZhouDXService extends ApiConfigService {
|
|||
public static final String Path_createOrder = "";
|
||||
|
||||
|
||||
public String createOrder( final SuperiorApiLogSaveReqVO logVO , GdOrderCreateRequestParam param) throws Exception {
|
||||
logVO.setHaokaSuperiorApiId(getApiFrom().getId());
|
||||
public String createOrder( final SuperiorApiLogSaveReqVO logVO , Long haokaSuperiorApiId ,GdOrderCreateRequestParam param) throws Exception {
|
||||
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
||||
|
||||
Map<String, String> devConfig = getDevConfig();
|
||||
Map<String, String> devConfig = getDevConfig(haokaSuperiorApiId);
|
||||
String urlPrefix = devConfig.get(Key_urlPrefix);
|
||||
String publicKey = devConfig.get(Key_publicKey);
|
||||
String url = urlPrefix + Path_createOrder;
|
||||
|
|
@ -31,9 +31,9 @@ public class ApiGuangZhouDXService extends ApiConfigService {
|
|||
}
|
||||
|
||||
|
||||
public String queryOrder(final SuperiorApiLogSaveReqVO logVO, GdOrderQueryRequestParam param) throws Exception {
|
||||
logVO.setHaokaSuperiorApiId(getApiFrom().getId());
|
||||
Map<String, String> devConfig = getDevConfig();
|
||||
public String queryOrder(final SuperiorApiLogSaveReqVO logVO, Long haokaSuperiorApiId , GdOrderQueryRequestParam param) throws Exception {
|
||||
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
||||
Map<String, String> devConfig = getDevConfig(haokaSuperiorApiId);
|
||||
String urlPrefix = devConfig.get(Key_urlPrefix);
|
||||
String publicKey = devConfig.get(Key_publicKey);
|
||||
|
||||
|
|
@ -41,9 +41,4 @@ public class ApiGuangZhouDXService extends ApiConfigService {
|
|||
return order.getBody();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiFrom getApiFrom() {
|
||||
return ApiFrom.GuangZhouDX;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ public class ApiHaiNanDXService extends ApiConfigService {
|
|||
public static final String Key_xAppId="xAppId";
|
||||
public static final String Key_xAppKey="xAppKey";
|
||||
|
||||
private HaiNanDianXinApi.HaiNanDianXinApiConfig getConfig() {
|
||||
Map<String, String> devConfig = this.getDevConfig();
|
||||
private HaiNanDianXinApi.HaiNanDianXinApiConfig getConfig(Long haokaSuperiorApiId) {
|
||||
Map<String, String> devConfig = this.getDevConfig(haokaSuperiorApiId);
|
||||
|
||||
String url = devConfig.get(Key_url);
|
||||
String appCode = devConfig.get(Key_appCode);
|
||||
|
|
@ -43,8 +43,8 @@ public class ApiHaiNanDXService extends ApiConfigService {
|
|||
}
|
||||
|
||||
public HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.QryNbrListResponse>
|
||||
qryNbrList(final SuperiorApiLogSaveReqVO logVO, HaiNanDianXinApi.QryNbrListRequest param) throws UnirestException {
|
||||
return HaiNanDianXinApi.qryNbrList(logVO, this.getConfig(), param);
|
||||
qryNbrList(final SuperiorApiLogSaveReqVO logVO,Long haokaSuperiorApiId, HaiNanDianXinApi.QryNbrListRequest param) throws UnirestException {
|
||||
return HaiNanDianXinApi.qryNbrList(logVO, this.getConfig(haokaSuperiorApiId), param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -56,24 +56,24 @@ public class ApiHaiNanDXService extends ApiConfigService {
|
|||
* @throws UnirestException 请求异常
|
||||
*/
|
||||
public HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.QryReceiveAddrResponse>
|
||||
qryReceiveAddr(final SuperiorApiLogSaveReqVO logVO, HaiNanDianXinApi.QryReceiveAddrRequest param) throws UnirestException {
|
||||
return HaiNanDianXinApi.qryReceiveAddr(logVO, this.getConfig(), param);
|
||||
qryReceiveAddr(final SuperiorApiLogSaveReqVO logVO,Long haokaSuperiorApiId, HaiNanDianXinApi.QryReceiveAddrRequest param) throws UnirestException {
|
||||
return HaiNanDianXinApi.qryReceiveAddr(logVO, this.getConfig(haokaSuperiorApiId), param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 防诈校验接口查询
|
||||
*/
|
||||
public HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.FraudCheckResponse>
|
||||
fraudCheck(final SuperiorApiLogSaveReqVO logVO, HaiNanDianXinApi.FraudCheckRequest param) throws UnirestException {
|
||||
return HaiNanDianXinApi.fraudCheck(logVO, this.getConfig(), param);
|
||||
fraudCheck(final SuperiorApiLogSaveReqVO logVO, Long haokaSuperiorApiId,HaiNanDianXinApi.FraudCheckRequest param) throws UnirestException {
|
||||
return HaiNanDianXinApi.fraudCheck(logVO, this.getConfig(haokaSuperiorApiId), param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单信息查询
|
||||
*/
|
||||
public HaiNanDianXinApi.HaiNanResponseInfo<String>
|
||||
queryOrderInfo(final SuperiorApiLogSaveReqVO logVO, HaiNanDianXinApi.QueryOrderInfoRequest param) throws UnirestException {
|
||||
return HaiNanDianXinApi.queryOrderInfo(logVO, this.getConfig(), param);
|
||||
queryOrderInfo(final SuperiorApiLogSaveReqVO logVO, Long haokaSuperiorApiId,HaiNanDianXinApi.QueryOrderInfoRequest param) throws UnirestException {
|
||||
return HaiNanDianXinApi.queryOrderInfo(logVO, this.getConfig(haokaSuperiorApiId), param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -82,8 +82,8 @@ public class ApiHaiNanDXService extends ApiConfigService {
|
|||
* @throws UnirestException 请求异常
|
||||
*/
|
||||
public HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.GetLogisticsTrajectoryResponse>
|
||||
getLogisticsTrajectory(final SuperiorApiLogSaveReqVO logVO, HaiNanDianXinApi.GetLogisticsTrajectoryRequest param) throws UnirestException {
|
||||
return HaiNanDianXinApi.getLogisticsTrajectory(logVO, this.getConfig(), param);
|
||||
getLogisticsTrajectory(final SuperiorApiLogSaveReqVO logVO, Long haokaSuperiorApiId, HaiNanDianXinApi.GetLogisticsTrajectoryRequest param) throws UnirestException {
|
||||
return HaiNanDianXinApi.getLogisticsTrajectory(logVO, this.getConfig(haokaSuperiorApiId), param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -93,12 +93,7 @@ public class ApiHaiNanDXService extends ApiConfigService {
|
|||
* @throws UnirestException 请求异常
|
||||
*/
|
||||
public HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.SynOrderInfoResponse>
|
||||
synOrderInfo(final SuperiorApiLogSaveReqVO logVO, HaiNanDianXinApi.SynOrderInfoRequest param) throws UnirestException {
|
||||
return HaiNanDianXinApi.synOrderInfo(logVO, this.getConfig(), param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiFrom getApiFrom() {
|
||||
return ApiFrom.HaiNanDX;
|
||||
synOrderInfo(final SuperiorApiLogSaveReqVO logVO,Long haokaSuperiorApiId, HaiNanDianXinApi.SynOrderInfoRequest param) throws UnirestException {
|
||||
return HaiNanDianXinApi.synOrderInfo(logVO, this.getConfig(haokaSuperiorApiId), param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ public class ApiHuNanDXService extends ApiConfigService {
|
|||
*
|
||||
* @return 配置信息对象 {@link HaiNanDxInfo.ConfigInfo}
|
||||
*/
|
||||
private HaiNanDxInfo.ConfigInfo getConfig() {
|
||||
Map<String, String> devConfig = getDevConfig();
|
||||
private HaiNanDxInfo.ConfigInfo getConfig(Long haokaSuperiorApiId) {
|
||||
Map<String, String> devConfig = getDevConfig(haokaSuperiorApiId);
|
||||
return new HaiNanDxInfo.ConfigInfo(
|
||||
devConfig.get(Key_accessToken),
|
||||
devConfig.get(Key_secret),
|
||||
|
|
@ -41,8 +41,8 @@ public class ApiHuNanDXService extends ApiConfigService {
|
|||
* @throws Exception 如果调用接口时发生异常
|
||||
*/
|
||||
public HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.InternetCardQualificationResp>
|
||||
checkInternetCardQualification(final SuperiorApiLogSaveReqVO logVO, HaiNanDxInfo.InternetCardQualificationParam param) throws Exception {
|
||||
return HuNanDXApi.checkInternetCardQualification(logVO,getConfig(), param);
|
||||
checkInternetCardQualification(final SuperiorApiLogSaveReqVO logVO,Long haokaSuperiorApiId, HaiNanDxInfo.InternetCardQualificationParam param) throws Exception {
|
||||
return HuNanDXApi.checkInternetCardQualification(logVO,getConfig(haokaSuperiorApiId), param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -53,8 +53,8 @@ public class ApiHuNanDXService extends ApiConfigService {
|
|||
* @throws Exception 如果调用接口时发生异常
|
||||
*/
|
||||
public HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.SyncOrderResp>
|
||||
syncOrder(final SuperiorApiLogSaveReqVO logVO,HaiNanDxInfo.SyncOrderParam param) throws Exception {
|
||||
return HuNanDXApi.syncOrder( logVO,getConfig(), param);
|
||||
syncOrder(final SuperiorApiLogSaveReqVO logVO,Long haokaSuperiorApiId,HaiNanDxInfo.SyncOrderParam param) throws Exception {
|
||||
return HuNanDXApi.syncOrder( logVO,getConfig(haokaSuperiorApiId), param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -65,8 +65,8 @@ public class ApiHuNanDXService extends ApiConfigService {
|
|||
* @throws Exception 如果调用接口时发生异常
|
||||
*/
|
||||
public HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.QueryOrderResp>
|
||||
queryOrder(final SuperiorApiLogSaveReqVO logVO,HaiNanDxInfo.QueryOrderParam param) throws Exception {
|
||||
return HuNanDXApi.queryOrder( logVO,getConfig(), param);
|
||||
queryOrder(final SuperiorApiLogSaveReqVO logVO,Long haokaSuperiorApiId,HaiNanDxInfo.QueryOrderParam param) throws Exception {
|
||||
return HuNanDXApi.queryOrder( logVO,getConfig( haokaSuperiorApiId ), param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -77,8 +77,8 @@ public class ApiHuNanDXService extends ApiConfigService {
|
|||
* @throws Exception 如果调用接口时发生异常
|
||||
*/
|
||||
public HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.SendSmsCodeResp>
|
||||
sendSmsCode(final SuperiorApiLogSaveReqVO logVO,HaiNanDxInfo.SendSmsCodeParam param) throws Exception {
|
||||
return HuNanDXApi.sendSmsCode( logVO,getConfig(), param);
|
||||
sendSmsCode(final SuperiorApiLogSaveReqVO logVO,Long haokaSuperiorApiId,HaiNanDxInfo.SendSmsCodeParam param) throws Exception {
|
||||
return HuNanDXApi.sendSmsCode( logVO,getConfig(haokaSuperiorApiId), param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -89,8 +89,8 @@ public class ApiHuNanDXService extends ApiConfigService {
|
|||
* @throws Exception 如果调用接口时发生异常
|
||||
*/
|
||||
public HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.VerifySmsCodeResp>
|
||||
verifySmsCode(final SuperiorApiLogSaveReqVO logVO,HaiNanDxInfo.VerifySmsCodeParam param) throws Exception {
|
||||
return HuNanDXApi.verifySmsCode( logVO,getConfig(), param);
|
||||
verifySmsCode(final SuperiorApiLogSaveReqVO logVO,Long haokaSuperiorApiId,HaiNanDxInfo.VerifySmsCodeParam param) throws Exception {
|
||||
return HuNanDXApi.verifySmsCode( logVO,getConfig(haokaSuperiorApiId), param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -101,8 +101,8 @@ public class ApiHuNanDXService extends ApiConfigService {
|
|||
* @throws Exception 如果调用接口时发生异常
|
||||
*/
|
||||
public HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.QueryPhoneNumberResp>
|
||||
queryPhoneNumber(final SuperiorApiLogSaveReqVO logVO, HaiNanDxInfo.NeedSignQueryParam<HaiNanDxInfo.QueryPhoneNumberParam> param) throws Exception {
|
||||
return HuNanDXApi.queryPhoneNumber( logVO, getConfig(), param);
|
||||
queryPhoneNumber(final SuperiorApiLogSaveReqVO logVO,Long haokaSuperiorApiId, HaiNanDxInfo.NeedSignQueryParam<HaiNanDxInfo.QueryPhoneNumberParam> param) throws Exception {
|
||||
return HuNanDXApi.queryPhoneNumber( logVO, getConfig(haokaSuperiorApiId), param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -113,8 +113,8 @@ public class ApiHuNanDXService extends ApiConfigService {
|
|||
* @throws Exception 如果调用接口时发生异常
|
||||
*/
|
||||
public HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.PossessPhoneNumberResp>
|
||||
possessPhoneNumber(final SuperiorApiLogSaveReqVO logVO,HaiNanDxInfo.NeedSignQueryParam<HaiNanDxInfo.PossessPhoneNumberParam> param) throws Exception {
|
||||
return HuNanDXApi.possessPhoneNumber( logVO,getConfig(), param);
|
||||
possessPhoneNumber(final SuperiorApiLogSaveReqVO logVO,Long haokaSuperiorApiId,HaiNanDxInfo.NeedSignQueryParam<HaiNanDxInfo.PossessPhoneNumberParam> param) throws Exception {
|
||||
return HuNanDXApi.possessPhoneNumber( logVO,getConfig(haokaSuperiorApiId), param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -125,12 +125,8 @@ public class ApiHuNanDXService extends ApiConfigService {
|
|||
* @throws Exception 如果调用接口时发生异常
|
||||
*/
|
||||
public HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.BlackListCheckResp>
|
||||
checkBlackList(final SuperiorApiLogSaveReqVO logVO,HaiNanDxInfo.BlackListCheckParam param) throws Exception {
|
||||
return HuNanDXApi.checkBlackList( logVO, getConfig(), param);
|
||||
checkBlackList(final SuperiorApiLogSaveReqVO logVO,Long haokaSuperiorApiId,HaiNanDxInfo.BlackListCheckParam param) throws Exception {
|
||||
return HuNanDXApi.checkBlackList( logVO, getConfig(haokaSuperiorApiId), param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiFrom getApiFrom() {
|
||||
return ApiFrom.HuNanDX;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ import java.util.Map;
|
|||
@Service
|
||||
public class ApiLianTongService extends ApiConfigService {
|
||||
|
||||
public ZopClient lianTongZopClient() {
|
||||
Map<String, String> devConfig = this.getDevConfig();
|
||||
public ZopClient lianTongZopClient(Long haokaSuperiorApiId) {
|
||||
Map<String, String> devConfig = this.getDevConfig(haokaSuperiorApiId);
|
||||
return this.lianTongZopClient(devConfig);
|
||||
}
|
||||
|
||||
|
|
@ -26,13 +26,13 @@ public class ApiLianTongService extends ApiConfigService {
|
|||
return LianTongApiUtil.getClient(reqUrl, appCode, hmac, aes);
|
||||
}
|
||||
|
||||
public KingNumSelectResponse lianTongSelectNumber(KingNumSelectRequest kingNumSelectRequest) {
|
||||
ZopClient zopClient = this.lianTongZopClient();
|
||||
public KingNumSelectResponse lianTongSelectNumber(Long haokaSuperiorApiId,KingNumSelectRequest kingNumSelectRequest) {
|
||||
ZopClient zopClient = this.lianTongZopClient(haokaSuperiorApiId);
|
||||
return zopClient.execute(kingNumSelectRequest);
|
||||
}
|
||||
|
||||
public KingResourceUploadResponse lianTongUploadRequest(KingResourceUploadRequest request){
|
||||
ZopClient zopClient = this.lianTongZopClient();
|
||||
public KingResourceUploadResponse lianTongUploadRequest(Long haokaSuperiorApiId,KingResourceUploadRequest request){
|
||||
ZopClient zopClient = this.lianTongZopClient(haokaSuperiorApiId);
|
||||
return zopClient.execute(request);
|
||||
}
|
||||
|
||||
|
|
@ -42,8 +42,8 @@ public class ApiLianTongService extends ApiConfigService {
|
|||
* @param request request
|
||||
* @return KingNumStateChangeResponse
|
||||
*/
|
||||
public KingNumStateChangeResponse lianTongZhanHao(KingNumStateChangeRequest request) {
|
||||
ZopClient zopClient = this.lianTongZopClient();
|
||||
public KingNumStateChangeResponse lianTongZhanHao(Long haokaSuperiorApiId,KingNumStateChangeRequest request) {
|
||||
ZopClient zopClient = this.lianTongZopClient(haokaSuperiorApiId);
|
||||
return zopClient.execute(request);
|
||||
}
|
||||
|
||||
|
|
@ -55,8 +55,8 @@ public class ApiLianTongService extends ApiConfigService {
|
|||
* @param request 请求参数
|
||||
* @return KingPostInfoResponse
|
||||
*/
|
||||
public KingPostInfoResponse lianTongPostInfoQuery(KingPostInfoRequest request) {
|
||||
ZopClient zopClient = this.lianTongZopClient();
|
||||
public KingPostInfoResponse lianTongPostInfoQuery(Long haokaSuperiorApiId,KingPostInfoRequest request) {
|
||||
ZopClient zopClient = this.lianTongZopClient(haokaSuperiorApiId);
|
||||
return zopClient.execute(request);
|
||||
}
|
||||
|
||||
|
|
@ -66,8 +66,8 @@ public class ApiLianTongService extends ApiConfigService {
|
|||
* @param request request
|
||||
* @return KingIdentityCustV2Response
|
||||
*/
|
||||
public KingIdentityCustV2Response lianTongSubmitUserInfo(KingIdentityCustV2Request request) {
|
||||
ZopClient zopClient = this.lianTongZopClient();
|
||||
public KingIdentityCustV2Response lianTongSubmitUserInfo(Long haokaSuperiorApiId,KingIdentityCustV2Request request) {
|
||||
ZopClient zopClient = this.lianTongZopClient(haokaSuperiorApiId);
|
||||
return zopClient.execute(request);
|
||||
}
|
||||
|
||||
|
|
@ -80,8 +80,8 @@ public class ApiLianTongService extends ApiConfigService {
|
|||
* @param request 请求参数
|
||||
* @return KingPreOrderSyncResponse
|
||||
*/
|
||||
public KingPreOrderSyncResponse lianTongPreOrderSync(KingPreOrderSyncRequest request) {
|
||||
ZopClient zopClient = this.lianTongZopClient();
|
||||
public KingPreOrderSyncResponse lianTongPreOrderSync(Long haokaSuperiorApiId,KingPreOrderSyncRequest request) {
|
||||
ZopClient zopClient = this.lianTongZopClient(haokaSuperiorApiId);
|
||||
return zopClient.execute(request);
|
||||
}
|
||||
|
||||
|
|
@ -107,8 +107,8 @@ public class ApiLianTongService extends ApiConfigService {
|
|||
* uuid Y String V256 流水号
|
||||
* body N JSONString V500 {\"mallOrderId\":\"369705189376\",\"orderNo\":\"7019042323299970\",\"preNumber\":\"17600271211\",\"shortUrl\":\"https://url.cn/5t6aZM\"}(shortUrl:非必返回参数,证件信息大于十六岁会返回该参数。)
|
||||
*/
|
||||
public KingOrderSyncResponse lianTongOrderSyncV2(KingOrderSyncV2Request request) {
|
||||
ZopClient zopClient = this.lianTongZopClient();
|
||||
public KingOrderSyncResponse lianTongOrderSyncV2(Long haokaSuperiorApiId,KingOrderSyncV2Request request) {
|
||||
ZopClient zopClient = this.lianTongZopClient(haokaSuperiorApiId);
|
||||
// request.setGoodsId(GOODS_ID);
|
||||
// request.setProvinceCode(PROVINCE_CODE);
|
||||
// request.setCityCode(CITY_CODE);
|
||||
|
|
@ -122,8 +122,8 @@ public class ApiLianTongService extends ApiConfigService {
|
|||
/**
|
||||
* @param type 消息类型:3-下单消息;4-订单状态变更消息
|
||||
*/
|
||||
public KingMessageGetResponse lianTongMessageGet(String type) {
|
||||
Map<String, String> devConfig = this.getDevConfig();
|
||||
public KingMessageGetResponse lianTongMessageGet(Long haokaSuperiorApiId,String type) {
|
||||
Map<String, String> devConfig = this.getDevConfig(haokaSuperiorApiId);
|
||||
String msgChannel = devConfig.get(LianTongApiUtil.KEY_msgChannel);
|
||||
|
||||
KingMessageGetRequest request = new KingMessageGetRequest();
|
||||
|
|
@ -138,11 +138,11 @@ public class ApiLianTongService extends ApiConfigService {
|
|||
* @param megIds 消息id,支持传多个,逗号分隔,如:5418052422792399,3018052422792357,1518061322813443
|
||||
* @param type 消息类型:3-下单消息;4-订单状态变更消息
|
||||
*/
|
||||
public KingMessageDelResponse lianTongMessageDel(String type, String megIds) {
|
||||
public KingMessageDelResponse lianTongMessageDel(Long haokaSuperiorApiId,String type, String megIds) {
|
||||
KingMessageDelRequest request = new KingMessageDelRequest();
|
||||
request.setType(type);
|
||||
request.setMsgId(megIds);
|
||||
ZopClient zopClient = this.lianTongZopClient();
|
||||
ZopClient zopClient = this.lianTongZopClient(haokaSuperiorApiId);
|
||||
return zopClient.execute(request);
|
||||
}
|
||||
|
||||
|
|
@ -154,13 +154,10 @@ public class ApiLianTongService extends ApiConfigService {
|
|||
* @param request 请求参数
|
||||
* @return KingNumSelectResponse
|
||||
*/
|
||||
public KingNumSelectResponse lianTongTokenSelectNumber(KingNumTokenSelectRequest request) {
|
||||
ZopClient zopClient = this.lianTongZopClient();
|
||||
public KingNumSelectResponse lianTongTokenSelectNumber(Long haokaSuperiorApiId,KingNumTokenSelectRequest request) {
|
||||
ZopClient zopClient = this.lianTongZopClient(haokaSuperiorApiId);
|
||||
return zopClient.execute(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiFrom getApiFrom() {
|
||||
return ApiFrom.LianTong;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -252,6 +252,7 @@ public class HaiNanDianXinApi {
|
|||
@Data
|
||||
public static class QryNbrListRequest {
|
||||
private String goodsId; // 商品编码
|
||||
private Long haokaSuperiorApiId;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -151,6 +151,7 @@ public class HaiNanDxInfo {
|
|||
// 接口7、号码查询:qry.nmall.phoneNumberlList
|
||||
@Data
|
||||
public static class QueryPhoneNumberParam {
|
||||
private Long haokaSuperiorApiId;
|
||||
private String poolId; // 号池ID
|
||||
private String pageSize; // 每页记录数
|
||||
private String isMain; // 主副卡标识
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.haoka.api.liantong.model.request;
|
|||
import cn.iocoder.yudao.module.haoka.api.liantong.base.annotation.FieldValidate;
|
||||
import cn.iocoder.yudao.module.haoka.api.liantong.model.ZopRequest;
|
||||
import cn.iocoder.yudao.module.haoka.api.liantong.model.response.KingNumSelectResponse;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 选号服务精简版本接口请求类
|
||||
|
|
@ -10,6 +11,7 @@ import cn.iocoder.yudao.module.haoka.api.liantong.model.response.KingNumSelectRe
|
|||
* @author yandq
|
||||
* @since 2022-04-06
|
||||
*/
|
||||
@Data
|
||||
public class KingNumSelectRequest implements ZopRequest<KingNumSelectResponse> {
|
||||
|
||||
@Override
|
||||
|
|
@ -32,6 +34,9 @@ public class KingNumSelectRequest implements ZopRequest<KingNumSelectResponse> {
|
|||
*/
|
||||
@FieldValidate(notNull = true, fixLen = 12, matches = "^\\d{12}$")
|
||||
private String goodsId;
|
||||
|
||||
private Long haokaSuperiorApiId;
|
||||
|
||||
/**
|
||||
* 省份编码 ,如 北京:11
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ public class KingResourceUploadRequest implements ZopRequest<KingResourceUploadR
|
|||
*/
|
||||
@FieldValidate(notNull = true, fixLen = 12, matches = "^\\d{12}$")
|
||||
private String goodsId;
|
||||
|
||||
Long haokaSuperiorApiId;
|
||||
/**
|
||||
* 触点编码:联通业务需求方指定分配,17位固定格式,如 08-1234-av23-89o6
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -24,51 +24,51 @@ public class HaokaApiHaiNanDXController {
|
|||
@Resource
|
||||
private ApiHaiNanDXService apiHaiNanDXService;
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/qryReceiveAddr")
|
||||
@Operation(summary = "海南电信-收货地址查询接口")
|
||||
public CommonResult<HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.QryReceiveAddrResponse>>
|
||||
qryReceiveAddr(@RequestBody HaiNanDianXinApi.QryReceiveAddrRequest param) throws UnirestException {
|
||||
return success(apiHaiNanDXService.qryReceiveAddr(new SuperiorApiLogSaveReqVO(), param));
|
||||
}
|
||||
// @PermitAll
|
||||
// @PostMapping("/qryReceiveAddr")
|
||||
// @Operation(summary = "海南电信-收货地址查询接口")
|
||||
// public CommonResult<HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.QryReceiveAddrResponse>>
|
||||
// qryReceiveAddr(@RequestBody HaiNanDianXinApi.QryReceiveAddrRequest param) throws UnirestException {
|
||||
// return success(apiHaiNanDXService.qryReceiveAddr(new SuperiorApiLogSaveReqVO(), param));
|
||||
// }
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/qryNbrList")
|
||||
@Operation(summary = "海南电信-选号接口")
|
||||
public CommonResult<HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.QryNbrListResponse>>
|
||||
lianTongSelectNumber(@RequestBody HaiNanDianXinApi.QryNbrListRequest param) throws UnirestException {
|
||||
return success(apiHaiNanDXService.qryNbrList(new SuperiorApiLogSaveReqVO(), param));
|
||||
return success(apiHaiNanDXService.qryNbrList(new SuperiorApiLogSaveReqVO(),param.getHaokaSuperiorApiId() ,param));
|
||||
}
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/fraudCheck")
|
||||
@Operation(summary = "海南电信-防诈校验接口")
|
||||
public CommonResult<HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.FraudCheckResponse>>
|
||||
fraudCheck(@RequestBody HaiNanDianXinApi.FraudCheckRequest param) throws UnirestException {
|
||||
return success(apiHaiNanDXService.fraudCheck(new SuperiorApiLogSaveReqVO(), param));
|
||||
}
|
||||
// @PermitAll
|
||||
// @PostMapping("/fraudCheck")
|
||||
// @Operation(summary = "海南电信-防诈校验接口")
|
||||
// public CommonResult<HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.FraudCheckResponse>>
|
||||
// fraudCheck(@RequestBody HaiNanDianXinApi.FraudCheckRequest param) throws UnirestException {
|
||||
// return success(apiHaiNanDXService.fraudCheck(new SuperiorApiLogSaveReqVO(), param));
|
||||
// }
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/queryOrderInfo")
|
||||
@Operation(summary = "海南电信-订单信息查询接口")
|
||||
public CommonResult<HaiNanDianXinApi.HaiNanResponseInfo<String>>
|
||||
queryOrderInfo(@RequestBody HaiNanDianXinApi.QueryOrderInfoRequest param) throws UnirestException {
|
||||
return success(apiHaiNanDXService.queryOrderInfo(new SuperiorApiLogSaveReqVO(), param));
|
||||
}
|
||||
// @PermitAll
|
||||
// @PostMapping("/queryOrderInfo")
|
||||
// @Operation(summary = "海南电信-订单信息查询接口")
|
||||
// public CommonResult<HaiNanDianXinApi.HaiNanResponseInfo<String>>
|
||||
// queryOrderInfo(@RequestBody HaiNanDianXinApi.QueryOrderInfoRequest param) throws UnirestException {
|
||||
// return success(apiHaiNanDXService.queryOrderInfo(new SuperiorApiLogSaveReqVO(), param));
|
||||
// }
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/getLogisticsTrajectory")
|
||||
@Operation(summary = "海南电信-物流轨迹查询接口")
|
||||
public CommonResult<HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.GetLogisticsTrajectoryResponse>>
|
||||
getLogisticsTrajectory(@RequestBody HaiNanDianXinApi.GetLogisticsTrajectoryRequest param) throws UnirestException {
|
||||
return success(apiHaiNanDXService.getLogisticsTrajectory(new SuperiorApiLogSaveReqVO(), param));
|
||||
}
|
||||
// @PermitAll
|
||||
// @PostMapping("/getLogisticsTrajectory")
|
||||
// @Operation(summary = "海南电信-物流轨迹查询接口")
|
||||
// public CommonResult<HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.GetLogisticsTrajectoryResponse>>
|
||||
// getLogisticsTrajectory(@RequestBody HaiNanDianXinApi.GetLogisticsTrajectoryRequest param) throws UnirestException {
|
||||
// return success(apiHaiNanDXService.getLogisticsTrajectory(new SuperiorApiLogSaveReqVO(), param));
|
||||
// }
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/synOrderInfo")
|
||||
@Operation(summary = "海南电信-号卡订单收敛接口")
|
||||
public CommonResult<HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.SynOrderInfoResponse>>
|
||||
synOrderInfo(@RequestBody HaiNanDianXinApi.SynOrderInfoRequest param) throws UnirestException {
|
||||
return success(apiHaiNanDXService.synOrderInfo(new SuperiorApiLogSaveReqVO(), param));
|
||||
}
|
||||
// @PermitAll
|
||||
// @PostMapping("/synOrderInfo")
|
||||
// @Operation(summary = "海南电信-号卡订单收敛接口")
|
||||
// public CommonResult<HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.SynOrderInfoResponse>>
|
||||
// synOrderInfo(@RequestBody HaiNanDianXinApi.SynOrderInfoRequest param) throws UnirestException {
|
||||
// return success(apiHaiNanDXService.synOrderInfo(new SuperiorApiLogSaveReqVO(), param));
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class HaokaApiLianTongController {
|
|||
@PostMapping("/select-number")
|
||||
@Operation(summary = "联通选号接口")
|
||||
public CommonResult<KingNumSelectResponse> lianTongSelectNumber(@RequestBody KingNumSelectRequest kingNumSelectRequest) {
|
||||
KingNumSelectResponse zopResponse = haokaAllSuperiorApiService.lianTongSelectNumber(kingNumSelectRequest);
|
||||
KingNumSelectResponse zopResponse = haokaAllSuperiorApiService.lianTongSelectNumber(kingNumSelectRequest.getHaokaSuperiorApiId(),kingNumSelectRequest);
|
||||
return success(zopResponse);
|
||||
}
|
||||
|
||||
|
|
@ -42,75 +42,75 @@ public class HaokaApiLianTongController {
|
|||
@PostMapping("/upload-request")
|
||||
@Operation(summary = "资源上传接口")
|
||||
public CommonResult<KingResourceUploadResponse> lianTongUploadRequest(@RequestBody KingResourceUploadRequest request) {
|
||||
return success(haokaAllSuperiorApiService.lianTongUploadRequest(request));
|
||||
return success(haokaAllSuperiorApiService.lianTongUploadRequest(request.getHaokaSuperiorApiId(), request));
|
||||
}
|
||||
|
||||
@PermitAll
|
||||
// @PermitAll
|
||||
//
|
||||
// @PostMapping("/zhan-hao")
|
||||
// @Operation(summary = "联通占号接口")
|
||||
// public CommonResult<KingNumStateChangeResponse> lianTongZhanHao(@RequestBody KingNumStateChangeRequest request) {
|
||||
// KingNumStateChangeResponse response = haokaAllSuperiorApiService.lianTongZhanHao(request);
|
||||
// return success(response);
|
||||
// }
|
||||
|
||||
@PostMapping("/zhan-hao")
|
||||
@Operation(summary = "联通占号接口")
|
||||
public CommonResult<KingNumStateChangeResponse> lianTongZhanHao(@RequestBody KingNumStateChangeRequest request) {
|
||||
KingNumStateChangeResponse response = haokaAllSuperiorApiService.lianTongZhanHao(request);
|
||||
return success(response);
|
||||
}
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/submit-user-info")
|
||||
@Operation(summary = "联通资料提交接口")
|
||||
public CommonResult<KingIdentityCustV2Response> lianTongSubmitUserInfo(@RequestBody KingIdentityCustV2Request request) {
|
||||
KingIdentityCustV2Response response = haokaAllSuperiorApiService.lianTongSubmitUserInfo(request);
|
||||
return success(response);
|
||||
}
|
||||
|
||||
@PostMapping("/order-sync-v2")
|
||||
@Operation(summary = "联通订单同步接口")
|
||||
public CommonResult<KingOrderSyncResponse> lianTongOrderSyncV2(@RequestBody KingOrderSyncV2Request request) {
|
||||
KingOrderSyncResponse response = haokaAllSuperiorApiService.lianTongOrderSyncV2(request);
|
||||
return success(response);
|
||||
}
|
||||
|
||||
@GetMapping("/message-get")
|
||||
@Operation(summary = "联通消息获取接口")
|
||||
public CommonResult<KingMessageGetResponse> lianTongMessageGet(@RequestParam String type) {
|
||||
KingMessageGetResponse response = haokaAllSuperiorApiService.lianTongMessageGet(type);
|
||||
return success(response);
|
||||
}
|
||||
|
||||
@PostMapping("/message-del")
|
||||
@Operation(summary = "联通消息删除接口")
|
||||
public CommonResult<KingMessageDelResponse> lianTongMessageDel(@RequestParam String type, @RequestParam String megIds) {
|
||||
KingMessageDelResponse response = haokaAllSuperiorApiService.lianTongMessageDel(type, megIds);
|
||||
return success(response);
|
||||
}
|
||||
|
||||
@PostMapping("/pre-order-sync")
|
||||
@Operation(summary = "联通意向单同步接口")
|
||||
public CommonResult<KingPreOrderSyncResponse> lianTongPreOrderSync(@RequestBody KingPreOrderSyncRequest request) {
|
||||
KingPreOrderSyncResponse response = haokaAllSuperiorApiService.lianTongPreOrderSync(request);
|
||||
return success(response);
|
||||
}
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/post-info-query")
|
||||
@Operation(summary = "联通收货地址和号码信息查询接口")
|
||||
public CommonResult<KingPostInfoResponse> lianTongPostInfoQuery(@RequestBody KingPostInfoRequest request) {
|
||||
KingPostInfoResponse response = haokaAllSuperiorApiService.lianTongPostInfoQuery(request);
|
||||
return success(response);
|
||||
}
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/token-select-number")
|
||||
@Operation(summary = "联通token选号接口")
|
||||
public CommonResult<KingNumSelectResponse> lianTongTokenSelectNumber(@RequestBody KingNumTokenSelectRequest request) {
|
||||
KingNumSelectResponse response = haokaAllSuperiorApiService.lianTongTokenSelectNumber(request);
|
||||
return success(response);
|
||||
}
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/select-area")
|
||||
@Operation(summary = "联通-地址-归属地查询")
|
||||
public CommonResult<List<LianTongAreaVo>> lianTongAreaInfo(@RequestParam(required = false, defaultValue = "1") String code) {
|
||||
LianTongArea area = LianTongAreaUtils.getArea(code);
|
||||
return success(BeanUtils.toBean(area.getChildren(), LianTongAreaVo.class));
|
||||
}
|
||||
// @PermitAll
|
||||
// @PostMapping("/submit-user-info")
|
||||
// @Operation(summary = "联通资料提交接口")
|
||||
// public CommonResult<KingIdentityCustV2Response> lianTongSubmitUserInfo(@RequestBody KingIdentityCustV2Request request) {
|
||||
// KingIdentityCustV2Response response = haokaAllSuperiorApiService.lianTongSubmitUserInfo(request);
|
||||
// return success(response);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/order-sync-v2")
|
||||
// @Operation(summary = "联通订单同步接口")
|
||||
// public CommonResult<KingOrderSyncResponse> lianTongOrderSyncV2(@RequestBody KingOrderSyncV2Request request) {
|
||||
// KingOrderSyncResponse response = haokaAllSuperiorApiService.lianTongOrderSyncV2(request);
|
||||
// return success(response);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/message-get")
|
||||
// @Operation(summary = "联通消息获取接口")
|
||||
// public CommonResult<KingMessageGetResponse> lianTongMessageGet(@RequestParam String type) {
|
||||
// KingMessageGetResponse response = haokaAllSuperiorApiService.lianTongMessageGet(type);
|
||||
// return success(response);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/message-del")
|
||||
// @Operation(summary = "联通消息删除接口")
|
||||
// public CommonResult<KingMessageDelResponse> lianTongMessageDel(@RequestParam String type, @RequestParam String megIds) {
|
||||
// KingMessageDelResponse response = haokaAllSuperiorApiService.lianTongMessageDel(type, megIds);
|
||||
// return success(response);
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/pre-order-sync")
|
||||
// @Operation(summary = "联通意向单同步接口")
|
||||
// public CommonResult<KingPreOrderSyncResponse> lianTongPreOrderSync(@RequestBody KingPreOrderSyncRequest request) {
|
||||
// KingPreOrderSyncResponse response = haokaAllSuperiorApiService.lianTongPreOrderSync(request);
|
||||
// return success(response);
|
||||
// }
|
||||
//
|
||||
// @PermitAll
|
||||
// @PostMapping("/post-info-query")
|
||||
// @Operation(summary = "联通收货地址和号码信息查询接口")
|
||||
// public CommonResult<KingPostInfoResponse> lianTongPostInfoQuery(@RequestBody KingPostInfoRequest request) {
|
||||
// KingPostInfoResponse response = haokaAllSuperiorApiService.lianTongPostInfoQuery(request);
|
||||
// return success(response);
|
||||
// }
|
||||
//
|
||||
// @PermitAll
|
||||
// @PostMapping("/token-select-number")
|
||||
// @Operation(summary = "联通token选号接口")
|
||||
// public CommonResult<KingNumSelectResponse> lianTongTokenSelectNumber(@RequestBody KingNumTokenSelectRequest request) {
|
||||
// KingNumSelectResponse response = haokaAllSuperiorApiService.lianTongTokenSelectNumber(request);
|
||||
// return success(response);
|
||||
// }
|
||||
//
|
||||
// @PermitAll
|
||||
// @PostMapping("/select-area")
|
||||
// @Operation(summary = "联通-地址-归属地查询")
|
||||
// public CommonResult<List<LianTongAreaVo>> lianTongAreaInfo(@RequestParam(required = false, defaultValue = "1") String code) {
|
||||
// LianTongArea area = LianTongAreaUtils.getArea(code);
|
||||
// return success(BeanUtils.toBean(area.getChildren(), LianTongAreaVo.class));
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,15 +24,15 @@ public class HaokaGuangZhouDXController {
|
|||
@Resource
|
||||
private ApiGuangZhouDXService apiGuangZhouDXService;
|
||||
|
||||
@PostMapping("/createOrder")
|
||||
@Operation(summary = "广州电信-创建订单接口")
|
||||
public CommonResult<String> createOrder(@RequestBody GdOrderCreateRequestParam param) throws Exception {
|
||||
return success(apiGuangZhouDXService.createOrder(null, param));
|
||||
}
|
||||
// @PostMapping("/createOrder")
|
||||
// @Operation(summary = "广州电信-创建订单接口")
|
||||
// public CommonResult<String> createOrder(@RequestBody GdOrderCreateRequestParam param) throws Exception {
|
||||
// return success(apiGuangZhouDXService.createOrder(null, param));
|
||||
// }
|
||||
|
||||
@PostMapping("/queryOrder")
|
||||
@Operation(summary = "广州电信-查询订单接口")
|
||||
public CommonResult<String> queryOrder(@RequestBody GdOrderQueryRequestParam param) throws Exception {
|
||||
return success(apiGuangZhouDXService.queryOrder(null,param));
|
||||
}
|
||||
// @PostMapping("/queryOrder")
|
||||
// @Operation(summary = "广州电信-查询订单接口")
|
||||
// public CommonResult<String> queryOrder(@RequestBody GdOrderQueryRequestParam param) throws Exception {
|
||||
// return success(apiGuangZhouDXService.queryOrder(null,param));
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,60 +25,60 @@ public class HaokaHuNanDXController {
|
|||
@Resource
|
||||
private ApiHuNanDXService apiHuNanDXService;
|
||||
|
||||
@PostMapping("/checkInternetCardQualification")
|
||||
@Operation(summary = "湖南电信-校验互联网卡下单资格")
|
||||
public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.InternetCardQualificationResp>>
|
||||
checkInternetCardQualification(@RequestBody HaiNanDxInfo.InternetCardQualificationParam param) throws Exception {
|
||||
return success(apiHuNanDXService.checkInternetCardQualification(new SuperiorApiLogSaveReqVO(), param));
|
||||
}
|
||||
// @PostMapping("/checkInternetCardQualification")
|
||||
// @Operation(summary = "湖南电信-校验互联网卡下单资格")
|
||||
// public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.InternetCardQualificationResp>>
|
||||
// checkInternetCardQualification(@RequestBody HaiNanDxInfo.InternetCardQualificationParam param) throws Exception {
|
||||
// return success(apiHuNanDXService.checkInternetCardQualification(new SuperiorApiLogSaveReqVO(), param));
|
||||
// }
|
||||
//
|
||||
// @PostMapping("/syncOrder")
|
||||
// @Operation(summary = "湖南电信-同步订单信息")
|
||||
// public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.SyncOrderResp>>
|
||||
// syncOrder(@RequestBody HaiNanDxInfo.SyncOrderParam param) throws Exception {
|
||||
// return success(apiHuNanDXService.syncOrder(new SuperiorApiLogSaveReqVO(), param));
|
||||
// }
|
||||
|
||||
@PostMapping("/syncOrder")
|
||||
@Operation(summary = "湖南电信-同步订单信息")
|
||||
public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.SyncOrderResp>>
|
||||
syncOrder(@RequestBody HaiNanDxInfo.SyncOrderParam param) throws Exception {
|
||||
return success(apiHuNanDXService.syncOrder(new SuperiorApiLogSaveReqVO(), param));
|
||||
}
|
||||
// @PostMapping("/queryOrder")
|
||||
// @Operation(summary = "湖南电信-查询订单详情")
|
||||
// public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.QueryOrderResp>>
|
||||
// queryOrder(@RequestBody HaiNanDxInfo.QueryOrderParam param) throws Exception {
|
||||
// return success(apiHuNanDXService.queryOrder(new SuperiorApiLogSaveReqVO(), param));
|
||||
// }
|
||||
|
||||
@PostMapping("/queryOrder")
|
||||
@Operation(summary = "湖南电信-查询订单详情")
|
||||
public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.QueryOrderResp>>
|
||||
queryOrder(@RequestBody HaiNanDxInfo.QueryOrderParam param) throws Exception {
|
||||
return success(apiHuNanDXService.queryOrder(new SuperiorApiLogSaveReqVO(), param));
|
||||
}
|
||||
// @PostMapping("/sendSmsCode")
|
||||
// @Operation(summary = "湖南电信-发送短信验证码")
|
||||
// public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.SendSmsCodeResp>>
|
||||
// sendSmsCode(@RequestBody HaiNanDxInfo.SendSmsCodeParam param) throws Exception {
|
||||
// return success(apiHuNanDXService.sendSmsCode(new SuperiorApiLogSaveReqVO(), param));
|
||||
// }
|
||||
|
||||
@PostMapping("/sendSmsCode")
|
||||
@Operation(summary = "湖南电信-发送短信验证码")
|
||||
public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.SendSmsCodeResp>>
|
||||
sendSmsCode(@RequestBody HaiNanDxInfo.SendSmsCodeParam param) throws Exception {
|
||||
return success(apiHuNanDXService.sendSmsCode(new SuperiorApiLogSaveReqVO(), param));
|
||||
}
|
||||
|
||||
@PostMapping("/verifySmsCode")
|
||||
@Operation(summary = "湖南电信-验证短信验证码")
|
||||
public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.VerifySmsCodeResp>>
|
||||
verifySmsCode(@RequestBody HaiNanDxInfo.VerifySmsCodeParam param) throws Exception {
|
||||
return success(apiHuNanDXService.verifySmsCode(new SuperiorApiLogSaveReqVO(), param));
|
||||
}
|
||||
// @PostMapping("/verifySmsCode")
|
||||
// @Operation(summary = "湖南电信-验证短信验证码")
|
||||
// public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.VerifySmsCodeResp>>
|
||||
// verifySmsCode(@RequestBody HaiNanDxInfo.VerifySmsCodeParam param) throws Exception {
|
||||
// return success(apiHuNanDXService.verifySmsCode(new SuperiorApiLogSaveReqVO(), param));
|
||||
// }
|
||||
|
||||
@PermitAll
|
||||
@PostMapping("/queryPhoneNumber")
|
||||
@Operation(summary = "湖南电信-查询号码")
|
||||
public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.QueryPhoneNumberResp>>
|
||||
queryPhoneNumber(@RequestBody HaiNanDxInfo.NeedSignQueryParam<HaiNanDxInfo.QueryPhoneNumberParam> param) throws Exception {
|
||||
return success(apiHuNanDXService.queryPhoneNumber(new SuperiorApiLogSaveReqVO(),param));
|
||||
return success(apiHuNanDXService.queryPhoneNumber(new SuperiorApiLogSaveReqVO(),param.getData().getHaokaSuperiorApiId(), param));
|
||||
}
|
||||
|
||||
@PostMapping("/possessPhoneNumber")
|
||||
@Operation(summary = "湖南电信-占用号码")
|
||||
public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.PossessPhoneNumberResp>>
|
||||
possessPhoneNumber(@RequestBody HaiNanDxInfo.NeedSignQueryParam<HaiNanDxInfo.PossessPhoneNumberParam> param) throws Exception {
|
||||
return success(apiHuNanDXService.possessPhoneNumber(new SuperiorApiLogSaveReqVO(),param));
|
||||
}
|
||||
// @PostMapping("/possessPhoneNumber")
|
||||
// @Operation(summary = "湖南电信-占用号码")
|
||||
// public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.PossessPhoneNumberResp>>
|
||||
// possessPhoneNumber(@RequestBody HaiNanDxInfo.NeedSignQueryParam<HaiNanDxInfo.PossessPhoneNumberParam> param) throws Exception {
|
||||
// return success(apiHuNanDXService.possessPhoneNumber(new SuperiorApiLogSaveReqVO(),param));
|
||||
// }
|
||||
|
||||
@PostMapping("/checkBlackList")
|
||||
@Operation(summary = "湖南电信-检查黑名单")
|
||||
public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.BlackListCheckResp>>
|
||||
checkBlackList(@RequestBody HaiNanDxInfo.BlackListCheckParam param) throws Exception {
|
||||
return success(apiHuNanDXService.checkBlackList(new SuperiorApiLogSaveReqVO(),param));
|
||||
}
|
||||
// @PostMapping("/checkBlackList")
|
||||
// @Operation(summary = "湖南电信-检查黑名单")
|
||||
// public CommonResult<HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.BlackListCheckResp>>
|
||||
// checkBlackList(@RequestBody HaiNanDxInfo.BlackListCheckParam param) throws Exception {
|
||||
// return success(apiHuNanDXService.checkBlackList(new SuperiorApiLogSaveReqVO(),param));
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,4 +59,5 @@ public class SuperiorApiRespVO {
|
|||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
private Long apiFrom;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package cn.iocoder.yudao.module.haoka.controller.admin.superiorapi.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.haoka.api.ApiFrom;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
|
|
@ -44,5 +45,5 @@ public class SuperiorApiSaveReqVO {
|
|||
|
||||
@Schema(description = "是否已配置产品")
|
||||
private Boolean isSkuConfined;
|
||||
|
||||
}
|
||||
private ApiFrom apiFromInfo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,4 +75,5 @@ public class SuperiorApiDO extends BaseDO {
|
|||
*/
|
||||
private Long deptId;
|
||||
|
||||
private Long apiFrom;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
package cn.iocoder.yudao.module.haoka.schedule;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.framework.tenant.core.service.TenantFrameworkService;
|
||||
import cn.iocoder.yudao.module.haoka.api.ApiFrom;
|
||||
import cn.iocoder.yudao.module.haoka.api.ApiLianTongService;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.orders.vo.OrdersPageReqVO;
|
||||
import cn.iocoder.yudao.module.haoka.dal.dataobject.orders.OrdersDO;
|
||||
import cn.iocoder.yudao.module.haoka.service.api.ApiDealStrategyService;
|
||||
import cn.iocoder.yudao.module.haoka.service.api.models.ApiDealResp;
|
||||
import cn.iocoder.yudao.module.haoka.service.api.models.OrderApiQueryResp;
|
||||
import cn.iocoder.yudao.module.haoka.service.orders.OrdersService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class HaokaLianTongUpdateOrderSchedule {
|
||||
|
||||
@Resource
|
||||
private OrdersService ordersService;
|
||||
|
||||
@Autowired
|
||||
@Qualifier(ApiFrom.ApiDealStrategyImpl)
|
||||
private ApiDealStrategyService apiDealStrategyService;
|
||||
|
||||
@Resource
|
||||
private TenantFrameworkService tenantFrameworkService;
|
||||
|
||||
@Resource
|
||||
private ApiLianTongService apiLianTongService;
|
||||
|
||||
@Scheduled(cron = "0 */10 * * * ?")
|
||||
public void updateOrder() {
|
||||
String type = new String();
|
||||
|
||||
log.info("开始-----------更新订单开始--------------------");
|
||||
tenantFrameworkService.getTenantIds().forEach((tenantId) -> {
|
||||
log.info("开始-----------更新订单开始---------tenantId-----------{}",tenantId);
|
||||
OrdersPageReqVO pageReqVO = new OrdersPageReqVO();
|
||||
|
||||
TenantContextHolder.setTenantId(tenantId);
|
||||
int pageNo = 0;
|
||||
int pageSize = 100;
|
||||
Long total = 100L;
|
||||
|
||||
while ((long) pageNo * pageSize < total) {
|
||||
pageNo += 1;
|
||||
pageReqVO.setPageNo(pageNo);
|
||||
pageReqVO.setPageSize(pageSize);
|
||||
|
||||
// 需要更新的订单过滤 todo
|
||||
// pageReqVO.setStatus(Lists.asList(1));
|
||||
|
||||
PageResult<OrdersDO> ordersPage = ordersService.getOrdersPage(pageReqVO);
|
||||
total = ordersPage.getTotal();
|
||||
for (OrdersDO ordersDO : ordersPage.getList()) {
|
||||
updateOrderInfo(ordersDO);
|
||||
}
|
||||
}
|
||||
});
|
||||
log.info("结束-----------更新订单结束--------------------");
|
||||
}
|
||||
|
||||
|
||||
private void updateOrderInfo(final OrdersDO ordersDO) {
|
||||
log.info("更新前--:{}", JSON.toJSONString(ordersDO));
|
||||
ApiDealResp<OrderApiQueryResp> updateOrderInfo = apiDealStrategyService.getUpdateOrderInfo(ordersDO);
|
||||
// todo 上游更新
|
||||
ordersService.updateById(ordersDO);
|
||||
log.info("更新后--:{}", JSON.toJSONString(ordersDO));
|
||||
}
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ public class ApiDealServiceImpl implements ApiDealStrategyService {
|
|||
}
|
||||
|
||||
|
||||
ApiDealStrategy apiDealStrategy = this.getApiDealStrategy(apiFrom);
|
||||
ApiDealStrategy apiDealStrategy = this.getApiDealStrategy(onSaleProductPreOrder.getSuperiorApiRespVO().getApiFrom());
|
||||
if (apiDealStrategy == null) {
|
||||
String msg = "NoneService";
|
||||
logVO.setSuccess(false);
|
||||
|
|
@ -96,7 +96,7 @@ public class ApiDealServiceImpl implements ApiDealStrategyService {
|
|||
logVO.setErrorInfo(msg);
|
||||
return ApiDealResp.failed(msg);
|
||||
}
|
||||
ApiDealStrategy apiDealStrategy = this.getApiDealStrategy(apiFrom);
|
||||
ApiDealStrategy apiDealStrategy = this.getApiDealStrategy(onSaleProductPreOrder.getSuperiorApiRespVO().getApiFrom());
|
||||
if (apiDealStrategy == null) {
|
||||
logVO.setSuccess(false);
|
||||
String noneService = "NoneService";
|
||||
|
|
@ -180,7 +180,7 @@ public class ApiDealServiceImpl implements ApiDealStrategyService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ApiDealStrategy getApiDealStrategy(ApiFrom apiFrom) {
|
||||
return strategyMap.get(apiFrom.getApiDealStrategy());
|
||||
public ApiDealStrategy getApiDealStrategy(Long apiFrom) {
|
||||
return strategyMap.get(ApiFrom.fromId(apiFrom));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@ package cn.iocoder.yudao.module.haoka.service.api;
|
|||
import cn.iocoder.yudao.module.haoka.api.ApiFrom;
|
||||
|
||||
public interface ApiDealStrategyService extends ApiDealStrategy{
|
||||
ApiDealStrategy getApiDealStrategy(ApiFrom apiFrom);
|
||||
ApiDealStrategy getApiDealStrategy(Long apiFrom);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.haoka.api.liantong.area.LianTongArea;
|
|||
import cn.iocoder.yudao.module.haoka.api.liantong.area.LianTongAreaUtils;
|
||||
import cn.iocoder.yudao.module.haoka.api.liantong.util.StringUtils;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSaleProductPreOrderRespVO;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapi.vo.SuperiorApiRespVO;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapilog.vo.SuperiorApiLogSaveReqVO;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.SuperiorProductConfigRespVO;
|
||||
import cn.iocoder.yudao.module.haoka.service.api.*;
|
||||
|
|
@ -38,11 +39,13 @@ public class GuangZhouDxApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) throws Exception {
|
||||
logVO.setHaokaSuperiorApiId(apiGuangZhouDXService.getApiFrom().getId());
|
||||
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
if (preProduct == null) {
|
||||
return ApiDealResp.failed("商品下架或者不存在");
|
||||
}
|
||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
||||
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
||||
final SuperiorProductConfigRespVO skuConfigVO = preProduct.getSuperiorProductConfigRespVO();
|
||||
final GdOrderCreateRequestParam createParam = new GdOrderCreateRequestParam();
|
||||
|
||||
|
|
@ -86,7 +89,7 @@ public class GuangZhouDxApiDealStrategy implements ApiDealStrategy {
|
|||
liftingInfo.setLiftingStaffNumber(configs.getString("ApiPrefix_liftingStaffNumber"));
|
||||
}
|
||||
|
||||
String supplierOrderId = apiGuangZhouDXService.createOrder(logVO, createParam);
|
||||
String supplierOrderId = apiGuangZhouDXService.createOrder(logVO, haokaSuperiorApiId,createParam);
|
||||
|
||||
OrderApiCreateResp orderApiCreateResp = new OrderApiCreateResp();
|
||||
orderApiCreateResp.setSupplierOrderId(supplierOrderId);
|
||||
|
|
@ -97,9 +100,14 @@ public class GuangZhouDxApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiQueryParam param) throws Exception {
|
||||
logVO.setHaokaSuperiorApiId(apiGuangZhouDXService.getApiFrom().getId());
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
if (preProduct == null) {
|
||||
return ApiDealResp.failed("商品下架或者不存在");
|
||||
}
|
||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
||||
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
||||
GdOrderQueryRequestParam queryParam = new GdOrderQueryRequestParam();
|
||||
String responseInfo = apiGuangZhouDXService.queryOrder(logVO, queryParam);
|
||||
String responseInfo = apiGuangZhouDXService.queryOrder(logVO,haokaSuperiorApiId, queryParam);
|
||||
|
||||
if (responseInfo == null) {
|
||||
logVO.setSuccess(false);
|
||||
|
|
|
|||
|
|
@ -42,8 +42,12 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) {
|
||||
logVO.setHaokaSuperiorApiId(apiHaiNanDXService.getApiFrom().getId());
|
||||
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
|
||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
||||
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
||||
|
||||
if (preProduct == null) {
|
||||
return ApiDealResp.failed("商品下架或者不存在");
|
||||
}
|
||||
|
|
@ -100,7 +104,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
try {
|
||||
logVO.setParam(JSON.toJSONString(createParam));
|
||||
HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.SynOrderInfoResponse> responseInfo
|
||||
= apiHaiNanDXService.synOrderInfo(logVO, createParam);
|
||||
= apiHaiNanDXService.synOrderInfo(logVO, haokaSuperiorApiId,createParam);
|
||||
HaiNanDianXinApi.SynOrderInfoResponse data = responseInfo.getData();
|
||||
if (data == null) {
|
||||
return ApiDealResp.failed(responseInfo.getErrMsg());
|
||||
|
|
@ -117,14 +121,16 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiQueryParam param) {
|
||||
logVO.setHaokaSuperiorApiId(apiHaiNanDXService.getApiFrom().getId());
|
||||
try {
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
|
||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
||||
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
||||
try {
|
||||
HaiNanDianXinApi.QueryOrderInfoRequest queryParam = new HaiNanDianXinApi.QueryOrderInfoRequest();
|
||||
queryParam.setQueryType("1");
|
||||
queryParam.setOrderCode(param.getSupplierOrderId());
|
||||
|
||||
HaiNanDianXinApi.HaiNanResponseInfo<String> responseInfo = apiHaiNanDXService.queryOrderInfo(logVO, queryParam);
|
||||
HaiNanDianXinApi.HaiNanResponseInfo<String> responseInfo = apiHaiNanDXService.queryOrderInfo(logVO, haokaSuperiorApiId,queryParam);
|
||||
|
||||
String data = responseInfo.getData();
|
||||
if (data == null) {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.haoka.api.hunandianxin.HaiNanDxInfo;
|
|||
import cn.iocoder.yudao.module.haoka.api.liantong.util.StringUtils;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.address.vo.AddressVo;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSaleProductPreOrderRespVO;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapi.vo.SuperiorApiRespVO;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorapilog.vo.SuperiorApiLogSaveReqVO;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.superiorproductconfig.vo.SuperiorProductConfigRespVO;
|
||||
import cn.iocoder.yudao.module.haoka.service.address.HaoKaAddressService;
|
||||
|
|
@ -40,6 +41,8 @@ public class HuNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
@Override
|
||||
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) throws Exception {
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
||||
|
||||
if (preProduct == null) {
|
||||
return ApiDealResp.failed("商品下架或者不存在");
|
||||
}
|
||||
|
|
@ -51,9 +54,9 @@ public class HuNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
// 1、提交资料 lianTongSubmitUserInfo
|
||||
// 2、提交预订单 得到token lianTongPreOrderSync
|
||||
// 3、用 token提交正式订单 lianTongOrderSyncV2
|
||||
|
||||
|
||||
HaiNanDianXinApi.SynOrderInfoRequest createParam = new HaiNanDianXinApi.SynOrderInfoRequest();
|
||||
//
|
||||
//
|
||||
// HaiNanDianXinApi.SynOrderInfoRequest createParam = new HaiNanDianXinApi.SynOrderInfoRequest();
|
||||
|
||||
|
||||
AddressVo addressDistrict = getAddress(param.getAddressDistrictCode());
|
||||
|
|
@ -106,7 +109,7 @@ public class HuNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
}
|
||||
|
||||
HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.InternetCardQualificationResp> checked = apiHuNanDXService.checkInternetCardQualification(logVO, cardQualificationParam);
|
||||
HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.InternetCardQualificationResp> checked = apiHuNanDXService.checkInternetCardQualification(logVO, haokaSuperiorApiId,cardQualificationParam);
|
||||
|
||||
if (!"00000".equals(checked.getRes_code())) {
|
||||
logVO.setResponse(JSON.toJSONString(checked));
|
||||
|
|
@ -134,7 +137,7 @@ public class HuNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
{
|
||||
needSignQueryParam.setData(possessParam);
|
||||
needSignQueryParam.setApiName("num.accept.possessNumber2To3");
|
||||
HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.PossessPhoneNumberResp> possessResponse = apiHuNanDXService.possessPhoneNumber(logVO, needSignQueryParam);
|
||||
HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.PossessPhoneNumberResp> possessResponse = apiHuNanDXService.possessPhoneNumber(logVO,haokaSuperiorApiId, needSignQueryParam);
|
||||
if (!"00000".equals(possessResponse.getRes_code())) {
|
||||
logVO.setResponse(JSON.toJSONString(possessResponse));
|
||||
return ApiDealResp.failed(checked.getRes_message());
|
||||
|
|
@ -154,7 +157,7 @@ public class HuNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
{
|
||||
needSignQueryParam.setData(possessParam);
|
||||
needSignQueryParam.setApiName("num.accept.possessNumber3To5");
|
||||
HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.PossessPhoneNumberResp> possessResponse = apiHuNanDXService.possessPhoneNumber(logVO, needSignQueryParam);
|
||||
HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.PossessPhoneNumberResp> possessResponse = apiHuNanDXService.possessPhoneNumber(logVO, haokaSuperiorApiId,needSignQueryParam);
|
||||
if (!"00000".equals(possessResponse.getRes_code())) {
|
||||
logVO.setResponse(JSON.toJSONString(possessResponse));
|
||||
return ApiDealResp.failed(checked.getRes_message());
|
||||
|
|
@ -173,7 +176,7 @@ public class HuNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
// 下单
|
||||
|
||||
|
||||
HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.SyncOrderResp> responseInfo = apiHuNanDXService.syncOrder(logVO, orderParam);
|
||||
HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.SyncOrderResp> responseInfo = apiHuNanDXService.syncOrder(logVO,haokaSuperiorApiId, orderParam);
|
||||
|
||||
if (!"00000".equals(responseInfo.getRes_code())) {
|
||||
logVO.setResponse(JSON.toJSONString(responseInfo));
|
||||
|
|
@ -200,11 +203,12 @@ public class HuNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiQueryParam param) {
|
||||
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
||||
try {
|
||||
HaiNanDxInfo.QueryOrderParam queryParam = new HaiNanDxInfo.QueryOrderParam();
|
||||
queryParam.setOutId(param.getId().toString());
|
||||
HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.QueryOrderResp> responseInfo = apiHuNanDXService.queryOrder(logVO, queryParam);
|
||||
HaiNanDxInfo.ResponseInfo<HaiNanDxInfo.QueryOrderResp> responseInfo = apiHuNanDXService.queryOrder(logVO,haokaSuperiorApiId, queryParam);
|
||||
logVO.setResponse(JSON.toJSONString(responseInfo));
|
||||
if (responseInfo.getResult() == null) {
|
||||
return ApiDealResp.failed(responseInfo.getRes_message());
|
||||
|
|
|
|||
|
|
@ -42,8 +42,14 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiCreateResp> createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) {
|
||||
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
if (preProduct == null) {
|
||||
return ApiDealResp.failed("商品下架或者不存在");
|
||||
}
|
||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
||||
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
||||
|
||||
|
||||
final SuperiorProductConfigRespVO skuConfigVO = preProduct.getSuperiorProductConfigRespVO();
|
||||
|
||||
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
|
||||
|
|
@ -81,13 +87,13 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
|||
JSONObject configs = JSON.parseObject(config);
|
||||
{
|
||||
String string = configs.getString("ApiPrefix_provinceCode");
|
||||
if (StringUtils.isNotEmpty(string)){
|
||||
if (StringUtils.isNotEmpty(string)) {
|
||||
ziLiao.setProvince(string);
|
||||
}
|
||||
}
|
||||
{
|
||||
String string = configs.getString("ApiPrefix_cityCode");
|
||||
if (StringUtils.isNotEmpty(string)){
|
||||
if (StringUtils.isNotEmpty(string)) {
|
||||
ziLiao.setCity(configs.getString("ApiPrefix_cityCode"));
|
||||
}
|
||||
}
|
||||
|
|
@ -96,7 +102,7 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
logVO.setParam(JSON.toJSONString(ziLiao));
|
||||
KingIdentityCustV2Response ziLiaoResponse
|
||||
= apiLianTongService.lianTongSubmitUserInfo(ziLiao);
|
||||
= apiLianTongService.lianTongSubmitUserInfo(haokaSuperiorApiId, ziLiao);
|
||||
logVO.setResponse(JSON.toJSONString(ziLiaoResponse));
|
||||
|
||||
String rspCode = ziLiaoResponse.getaDesc();
|
||||
|
|
@ -116,7 +122,7 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
|||
preOrder.setPostDistrictCode(receiveAddress.getDistrictCode());
|
||||
preOrder.setPostAddr(param.getAddress());
|
||||
|
||||
String channel = apiLianTongService.getConfigValue(LianTongApiUtil.KEY_channel);
|
||||
String channel = apiLianTongService.getConfigValue(haokaSuperiorApiId, LianTongApiUtil.KEY_channel);
|
||||
preOrder.setChannel(channel);
|
||||
preOrder.setCreateTime(format);
|
||||
preOrder.setUpdateTime(format);
|
||||
|
|
@ -126,9 +132,9 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
|||
if (skuConfigVO != null && StringUtils.isNotEmpty(skuConfigVO.getConfig())) {
|
||||
String config = skuConfigVO.getConfig();
|
||||
JSONObject configs = JSON.parseObject(config);
|
||||
preOrder.setResourceId (configs.getString("ApiPrefix_resourceId"));
|
||||
preOrder.setFirstMonthFee (configs.getString("ApiPrefix_firstMonthFee"));
|
||||
preOrder.setPageUrl (configs.getString("ApiPrefix_pageUrl"));
|
||||
preOrder.setResourceId(configs.getString("ApiPrefix_resourceId"));
|
||||
preOrder.setFirstMonthFee(configs.getString("ApiPrefix_firstMonthFee"));
|
||||
preOrder.setPageUrl(configs.getString("ApiPrefix_pageUrl"));
|
||||
preOrder.setReferrerCode(configs.getString("ApiPrefix_referrerCode"));
|
||||
preOrder.setChannel(configs.getString("ApiPrefix_channel"));
|
||||
preOrder.setOrderTotalFee("0");
|
||||
|
|
@ -136,7 +142,7 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
|
||||
logVO.setParam(JSON.toJSONString(preOrder));
|
||||
KingPreOrderSyncResponse preOrderResponse = apiLianTongService.lianTongPreOrderSync(preOrder);
|
||||
KingPreOrderSyncResponse preOrderResponse = apiLianTongService.lianTongPreOrderSync(haokaSuperiorApiId, preOrder);
|
||||
logVO.setResponse(JSON.toJSONString(preOrderResponse));
|
||||
|
||||
if (!"0000".equals(preOrderResponse.getRspCode())) {
|
||||
|
|
@ -157,7 +163,7 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
|||
syncV2.setGoodsId(preProduct.getSuperiorProductConfigRespVO().getSuperiorCode());
|
||||
|
||||
String body = preOrderResponse.getBody();
|
||||
if (StringUtils.isNotEmpty(body)){
|
||||
if (StringUtils.isNotEmpty(body)) {
|
||||
JSONObject jsonObject = JSON.parseObject(body);
|
||||
syncV2.setToken(jsonObject.getString("token"));
|
||||
}
|
||||
|
|
@ -167,14 +173,14 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
|||
JSONObject configs = JSON.parseObject(config);
|
||||
{
|
||||
String string = configs.getString("ApiPrefix_provinceCode");
|
||||
if (StringUtils.isNotEmpty(string)){
|
||||
if (StringUtils.isNotEmpty(string)) {
|
||||
syncV2.setProvinceCode(string);
|
||||
|
||||
}
|
||||
}
|
||||
{
|
||||
String string = configs.getString("ApiPrefix_cityCode");
|
||||
if (StringUtils.isNotEmpty(string)){
|
||||
if (StringUtils.isNotEmpty(string)) {
|
||||
syncV2.setCityCode(string);
|
||||
}
|
||||
}
|
||||
|
|
@ -183,7 +189,7 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
|
||||
logVO.setParam(JSON.toJSONString(syncV2));
|
||||
KingOrderSyncResponse response = apiLianTongService.lianTongOrderSyncV2(syncV2);
|
||||
KingOrderSyncResponse response = apiLianTongService.lianTongOrderSyncV2(haokaSuperiorApiId, syncV2);
|
||||
logVO.setResponse(JSON.toJSONString(response));
|
||||
if (!"0000".equals(response.getRspCode())) {
|
||||
return ApiDealResp.failed(response.getRspDesc());
|
||||
|
|
@ -196,7 +202,13 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiQueryParam param) {
|
||||
logVO.setHaokaSuperiorApiId(apiLianTongService.getApiFrom().getId());
|
||||
OnSaleProductPreOrderRespVO preProduct = onSaleProductService.getOnSaleProductPreOrder(param.getProductId());
|
||||
if (preProduct == null) {
|
||||
return ApiDealResp.failed("商品下架或者不存在");
|
||||
}
|
||||
Long haokaSuperiorApiId = preProduct.getSuperiorApiRespVO().getId();
|
||||
logVO.setHaokaSuperiorApiId(haokaSuperiorApiId);
|
||||
|
||||
return ApiDealResp.ontSupport("联通不支持查询订单接口,须参照回调接口");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,14 +131,17 @@ public class OnSaleProductServiceImpl implements OnSaleProductService {
|
|||
|
||||
if (!list.isEmpty()) {
|
||||
SuperiorProductConfigDO first = list.get(0);
|
||||
Long haokaSuperiorApiId = first.getHaokaSuperiorApiId();
|
||||
ApiFrom apiFrom = ApiFrom.fromId(haokaSuperiorApiId);
|
||||
bean.setApiFrom(apiFrom);
|
||||
|
||||
bean.setSuperiorProductConfigRespVO(BeanUtils.toBean(first, SuperiorProductConfigRespVO.class));
|
||||
|
||||
SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(first.getHaokaSuperiorApiId());
|
||||
|
||||
bean.setSuperiorApiRespVO(BeanUtils.toBean(superiorApi, SuperiorApiRespVO.class));
|
||||
|
||||
|
||||
|
||||
ApiFrom apiFrom = ApiFrom.fromId(superiorApi.getApiFrom());
|
||||
bean.setApiFrom(apiFrom);
|
||||
}
|
||||
return bean;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package cn.iocoder.yudao.module.haoka.service.superiorapi;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.haoka.utils.SnowflakeId;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
|
|
@ -44,10 +45,34 @@ public class SuperiorApiServiceImpl extends ServiceImpl<SuperiorApiMapper,Super
|
|||
private SuperiorProductConfigMapper superiorProductConfigMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createSuperiorApi(SuperiorApiSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SuperiorApiDO superiorApi = BeanUtils.toBean(createReqVO, SuperiorApiDO.class);
|
||||
superiorApi.setApiFrom(createReqVO.getApiFromInfo().getId());
|
||||
superiorApi.setId(SnowflakeId.generate());
|
||||
superiorApiMapper.insert(superiorApi);
|
||||
|
||||
|
||||
List<SuperiorApiDevConfigDO> superiorApiDevConfigDOS = superiorApiDevConfigMapper
|
||||
.selectList(new LambdaQueryWrapperX<SuperiorApiDevConfigDO>()
|
||||
.eqIfPresent(SuperiorApiDevConfigDO::getHaokaSuperiorApiId, superiorApi.getApiFrom()));
|
||||
for (SuperiorApiDevConfigDO devConfigDO : superiorApiDevConfigDOS) {
|
||||
devConfigDO.setId(SnowflakeId.generate());
|
||||
devConfigDO.setHaokaSuperiorApiId(superiorApi.getId());
|
||||
superiorApiDevConfigMapper.insert(devConfigDO);
|
||||
}
|
||||
|
||||
List<SuperiorApiSkuConfigDO> skuConfigDOS = superiorApiSkuConfigMapper
|
||||
.selectList(new LambdaQueryWrapperX<SuperiorApiSkuConfigDO>()
|
||||
.eqIfPresent(SuperiorApiSkuConfigDO::getHaokaSuperiorApiId, superiorApi.getApiFrom()));
|
||||
for (SuperiorApiSkuConfigDO skuConfigDO : skuConfigDOS) {
|
||||
skuConfigDO.setId(SnowflakeId.generate());
|
||||
skuConfigDO.setHaokaSuperiorApiId(superiorApi.getId());
|
||||
superiorApiSkuConfigMapper.insert(skuConfigDO);
|
||||
}
|
||||
|
||||
|
||||
// 返回
|
||||
return superiorApi.getId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
alter table haoka_superior_api
|
||||
ADD COLUMN `api_from` bigint(20) NULL DEFAULT 0 COMMENT '接口来源:对接联调的ID';
|
||||
Loading…
Reference in New Issue