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