Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
order-group
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
order-group-application
order-group
Commits
625e17f2
Commit
625e17f2
authored
Apr 01, 2021
by
ping.wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FeignClient 服务名修改
parent
501f4433
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
408 additions
and
394 deletions
+408
-394
order-application-service/src/main/java/cn/freemud/service/CallerService.java
+1
-1
order-application-service/src/main/java/cn/freemud/service/StoreService.java
+1
-1
order-application-service/src/main/java/cn/freemud/service/impl/AppOrderServiceImpl.java
+1
-1
order-application-service/src/main/java/cn/freemud/service/impl/CheckMCCafeOrder.java
+2
-2
order-application-service/src/main/java/cn/freemud/service/impl/CouponActivityServiceImpl.java
+4
-4
order-application-service/src/main/java/cn/freemud/service/impl/StoreServiceImpl.java
+29
-29
order-application-service/src/main/java/cn/freemud/service/thirdparty/CardBinClient.java
+4
-1
order-application-service/src/main/java/cn/freemud/service/thirdparty/ComPayClient.java
+3
-1
order-application-service/src/main/java/cn/freemud/service/thirdparty/CouponClient.java
+56
-56
order-application-service/src/main/java/cn/freemud/service/thirdparty/CouponOfflineClient.java
+1
-1
order-application-service/src/main/java/cn/freemud/service/thirdparty/CouponOnlineClient.java
+5
-2
order-application-service/src/main/java/cn/freemud/service/thirdparty/CustomScoreClient.java
+3
-0
order-application-service/src/main/java/cn/freemud/service/thirdparty/CustomerApplicationClient.java
+2
-0
order-application-service/src/main/java/cn/freemud/service/thirdparty/CustomerClient.java
+87
-87
order-application-service/src/main/java/cn/freemud/service/thirdparty/PaymentNewClient.java
+3
-1
order-application-service/src/main/java/cn/freemud/service/thirdparty/RecommendClient.java
+31
-31
order-application-service/src/main/java/cn/freemud/service/thirdparty/ShoppingCartClient.java
+0
-1
order-application-service/src/main/java/cn/freemud/service/thirdparty/StockClient.java
+1
-1
order-application-service/src/main/java/cn/freemud/service/thirdparty/StoreClient.java
+1
-1
order-application-service/src/test/java/cn.freemud/client/CouponClientTest.java
+0
-0
order-application-service/src/test/java/cn.freemud/client/MemberProductClientTest.java
+0
-0
order-application-service/src/test/java/cn.freemud/client/StockClientTest.java
+86
-86
order-application-service/src/test/java/cn.freemud/client/StoreClientTest.java
+87
-87
No files found.
order-application-service/src/main/java/cn/freemud/service/CallerService.java
View file @
625e17f2
...
@@ -15,7 +15,7 @@ import cn.freemud.entities.dto.ecology.SubscribeMessageResponse;
...
@@ -15,7 +15,7 @@ import cn.freemud.entities.dto.ecology.SubscribeMessageResponse;
import
cn.freemud.entities.vo.TakeMealNoticesVO
;
import
cn.freemud.entities.vo.TakeMealNoticesVO
;
import
cn.freemud.enums.MessageEventTypeEnum
;
import
cn.freemud.enums.MessageEventTypeEnum
;
import
cn.freemud.service.impl.CheckOrder
;
import
cn.freemud.service.impl.CheckOrder
;
import
cn.freemud.service.thirdparty.CustomerClient
;
//
import cn.freemud.service.thirdparty.CustomerClient;
import
cn.freemud.service.thirdparty.EcologyAdminApplicationClient
;
import
cn.freemud.service.thirdparty.EcologyAdminApplicationClient
;
import
cn.freemud.utils.DateTimeUtil
;
import
cn.freemud.utils.DateTimeUtil
;
import
cn.freemud.utils.ResponseUtil
;
import
cn.freemud.utils.ResponseUtil
;
...
...
order-application-service/src/main/java/cn/freemud/service/StoreService.java
View file @
625e17f2
...
@@ -25,5 +25,5 @@ import java.util.List;
...
@@ -25,5 +25,5 @@ import java.util.List;
*/
*/
public
interface
StoreService
{
public
interface
StoreService
{
List
<
StoreResponseDto
>
findNearStores
(
NearStoreRequestDto
nearStoreRequestDto
);
//
List<StoreResponseDto> findNearStores(NearStoreRequestDto nearStoreRequestDto);
}
}
order-application-service/src/main/java/cn/freemud/service/impl/AppOrderServiceImpl.java
View file @
625e17f2
...
@@ -18,7 +18,7 @@ import cn.freemud.enums.*;
...
@@ -18,7 +18,7 @@ import cn.freemud.enums.*;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.interceptor.ServiceException
;
import
cn.freemud.redis.RedisCache
;
import
cn.freemud.redis.RedisCache
;
import
cn.freemud.service.AppOrderService
;
import
cn.freemud.service.AppOrderService
;
import
cn.freemud.service.thirdparty.CouponClient
;
//
import cn.freemud.service.thirdparty.CouponClient;
import
cn.freemud.service.thirdparty.CouponOnlineClient
;
import
cn.freemud.service.thirdparty.CouponOnlineClient
;
import
cn.freemud.utils.BeanUtil
;
import
cn.freemud.utils.BeanUtil
;
import
cn.freemud.utils.RedisUtil
;
import
cn.freemud.utils.RedisUtil
;
...
...
order-application-service/src/main/java/cn/freemud/service/impl/CheckMCCafeOrder.java
View file @
625e17f2
...
@@ -103,8 +103,8 @@ public class CheckMCCafeOrder {
...
@@ -103,8 +103,8 @@ public class CheckMCCafeOrder {
private
ShoppingCartClient
shoppingCartClient
;
private
ShoppingCartClient
shoppingCartClient
;
// @Autowired
// @Autowired
// private OrderAdapter orderAdapter;
// private OrderAdapter orderAdapter;
@Autowired
//
@Autowired
private
StoreServiceImpl
storeService
;
//
private StoreServiceImpl storeService;
@Autowired
@Autowired
private
StockClient
stockClient
;
private
StockClient
stockClient
;
@Autowired
@Autowired
...
...
order-application-service/src/main/java/cn/freemud/service/impl/CouponActivityServiceImpl.java
View file @
625e17f2
...
@@ -8,10 +8,10 @@ import cn.freemud.entities.vo.ActivityClassifyCouponBean;
...
@@ -8,10 +8,10 @@ import cn.freemud.entities.vo.ActivityClassifyCouponBean;
import
cn.freemud.entities.vo.ActivityCouponBean
;
import
cn.freemud.entities.vo.ActivityCouponBean
;
import
cn.freemud.enums.*
;
import
cn.freemud.enums.*
;
import
cn.freemud.service.CouponActivityService
;
import
cn.freemud.service.CouponActivityService
;
import
cn.freemud.service.StoreService
;
//
import cn.freemud.service.StoreService;
import
cn.freemud.service.coupon.CouponRelationFactory
;
import
cn.freemud.service.coupon.CouponRelationFactory
;
import
cn.freemud.service.coupon.CouponRelationService
;
import
cn.freemud.service.coupon.CouponRelationService
;
import
cn.freemud.service.thirdparty.CouponClient
;
//
import cn.freemud.service.thirdparty.CouponClient;
import
cn.freemud.service.thirdparty.CouponOfflineClient
;
import
cn.freemud.service.thirdparty.CouponOfflineClient
;
import
cn.freemud.utils.LogUtil
;
import
cn.freemud.utils.LogUtil
;
import
cn.freemud.utils.PropertyConvertUtil
;
import
cn.freemud.utils.PropertyConvertUtil
;
...
@@ -58,8 +58,8 @@ public class CouponActivityServiceImpl implements CouponActivityService {
...
@@ -58,8 +58,8 @@ public class CouponActivityServiceImpl implements CouponActivityService {
private
EmailAlertService
emailAlertService
;
private
EmailAlertService
emailAlertService
;
@Autowired
@Autowired
private
OfflineCouponSdkService
offlineCouponSdkService
;
private
OfflineCouponSdkService
offlineCouponSdkService
;
@Autowired
//
@Autowired
private
StoreServiceImpl
storeService
;
//
private StoreServiceImpl storeService;
@Autowired
@Autowired
private
CouponRelationFactory
couponRelationFactory
;
private
CouponRelationFactory
couponRelationFactory
;
...
...
order-application-service/src/main/java/cn/freemud/service/impl/StoreServiceImpl.java
View file @
625e17f2
...
@@ -41,35 +41,35 @@ public class StoreServiceImpl implements StoreService {
...
@@ -41,35 +41,35 @@ public class StoreServiceImpl implements StoreService {
* @param nearStoreRequestDto
* @param nearStoreRequestDto
* @return
* @return
*/
*/
@Override
//
@Override
public
List
<
StoreResponseDto
>
findNearStores
(
NearStoreRequestDto
nearStoreRequestDto
)
{
//
public List<StoreResponseDto> findNearStores(NearStoreRequestDto nearStoreRequestDto) {
NearStoreRequestDto
requestDto
=
new
NearStoreRequestDto
();
//
NearStoreRequestDto requestDto = new NearStoreRequestDto();
BeanUtil
.
convertBean
(
nearStoreRequestDto
,
requestDto
);
//
BeanUtil.convertBean(nearStoreRequestDto, requestDto);
requestDto
.
setPageNo
(
1
);
//
requestDto.setPageNo(1);
requestDto
.
setPageSize
(
9999
);
//
requestDto.setPageSize(9999);
double
lat
=
Double
.
valueOf
(
requestDto
.
getLatitude
());
//
double lat = Double.valueOf(requestDto.getLatitude());
double
lng
=
Double
.
valueOf
(
requestDto
.
getLongitude
());
//
double lng = Double.valueOf(requestDto.getLongitude());
String
geoHashCode
=
new
GeoHash
().
encode
(
lat
,
lng
);
//
String geoHashCode = new GeoHash().encode(lat, lng);
// 取前6位匹配缓存,精确到0.61公里
//
// 取前6位匹配缓存,精确到0.61公里
String
nearStoreKey
=
"saas:store:info:"
+
requestDto
.
getPartnerId
()
+
":"
+
geoHashCode
.
substring
(
0
,
6
);
//
String nearStoreKey = "saas:store:info:" + requestDto.getPartnerId() + ":" + geoHashCode.substring(0, 6);
List
<
StoreResponseDto
>
storeListResponseDtos
=
redisCache
.
getValue
(
nearStoreKey
);
//
List<StoreResponseDto> storeListResponseDtos = redisCache.getValue(nearStoreKey);
if
(
CollectionUtils
.
isNotEmpty
(
storeListResponseDtos
))
{
//
if (CollectionUtils.isNotEmpty(storeListResponseDtos)) {
return
storeListResponseDtos
;
//
return storeListResponseDtos;
}
//
}
StoreBaseResponseDto
<
StoreListResponseDto
>
response
=
storeClient
.
findNearStores
(
requestDto
);
//
StoreBaseResponseDto<StoreListResponseDto> response = storeClient.findNearStores(requestDto);
if
(!
RESPONSE_SUCCESS_CODE
.
equals
(
response
.
getStatusCode
()))
{
//
if (!RESPONSE_SUCCESS_CODE.equals(response.getStatusCode())) {
LogUtil
.
info
(
"findNearStores_error"
,
gson
.
toJson
(
requestDto
),
gson
.
toJson
(
response
));
//
LogUtil.info("findNearStores_error", gson.toJson(requestDto), gson.toJson(response));
return
Collections
.
emptyList
();
//
return Collections.emptyList();
}
//
}
StoreListResponseDto
storeListResponseDto
=
response
.
getBizVO
();
//
StoreListResponseDto storeListResponseDto = response.getBizVO();
if
(
CollectionUtils
.
isEmpty
(
storeListResponseDto
.
getList
()))
{
//
if (CollectionUtils.isEmpty(storeListResponseDto.getList())) {
return
Collections
.
emptyList
();
//
return Collections.emptyList();
}
//
}
List
<
StoreResponseDto
>
list
=
storeListResponseDto
.
getList
();
//
List<StoreResponseDto> list = storeListResponseDto.getList();
//
redisCache
.
save
(
nearStoreKey
,
list
,
1L
,
TimeUnit
.
MINUTES
);
//
redisCache.save(nearStoreKey, list, 1L, TimeUnit.MINUTES);
return
storeListResponseDto
.
getList
();
//
return storeListResponseDto.getList();
}
//
}
...
...
order-application-service/src/main/java/cn/freemud/service/thirdparty/CardBinClient.java
View file @
625e17f2
...
@@ -9,9 +9,12 @@ import org.springframework.web.bind.annotation.PostMapping;
...
@@ -9,9 +9,12 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
//测试环境:http://115.159.65.101:8082 生产环境:https://onlinecoupon.sandload.cn
//测试环境:http://115.159.65.101:8082 生产环境:https://onlinecoupon.sandload.cn
@FeignClient
(
name
=
"OPEN-STORE-ONLINE-COUPON-SERVICE"
,
url
=
"${saas.c
ardbin
client.feign.url}"
)
@FeignClient
(
name
=
"OPEN-STORE-ONLINE-COUPON-SERVICE"
,
url
=
"${saas.c
oupononline
client.feign.url}"
)
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
CardBinClient
{
public
interface
CardBinClient
{
// TODO: 21-4-1 待合并
/**
/**
* 获取密钥
* 获取密钥
* @param requestDto
* @param requestDto
...
...
order-application-service/src/main/java/cn/freemud/service/thirdparty/ComPayClient.java
View file @
625e17f2
...
@@ -22,10 +22,12 @@ import org.springframework.web.bind.annotation.RequestHeader;
...
@@ -22,10 +22,12 @@ import org.springframework.web.bind.annotation.RequestHeader;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@FeignClient
(
name
=
"payment-center-ap
plication-ap
i"
,
url
=
"${saas.paymentcenter.application.api.feign.url}"
)
@FeignClient
(
name
=
"payment-center-api"
,
url
=
"${saas.paymentcenter.application.api.feign.url}"
)
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
ComPayClient
{
public
interface
ComPayClient
{
// TODO: 21-4-1 待合并
/**
/**
* 统一下单
* 统一下单
*/
*/
...
...
order-application-service/src/main/java/cn/freemud/service/thirdparty/CouponClient.java
View file @
625e17f2
/**
/
//
**
* All rights Reserved, Designed By www.freemud.cn
//
* All rights Reserved, Designed By www.freemud.cn
*
//
*
* @Title: OrderClient
//
* @Title: OrderClient
* @Package cn.freemud.service.thirdparty
//
* @Package cn.freemud.service.thirdparty
* @Description:
//
* @Description:
* @author: liming.guo
//
* @author: liming.guo
* @date: 2018/8/10 16:06
//
* @date: 2018/8/10 16:06
* @version V1.0
//
* @version V1.0
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
//
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
//
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
//
*/
package
cn
.
freemud
.
service
.
thirdparty
;
//
package cn.freemud.service.thirdparty;
//
import
cn.freemud.entities.dto.*
;
//
import cn.freemud.entities.dto.*;
import
org.springframework.cloud.openfeign.FeignClient
;
//
import org.springframework.cloud.openfeign.FeignClient;
import
org.springframework.web.bind.annotation.PostMapping
;
//
import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
//
import org.springframework.web.bind.annotation.RequestMapping;
//
// 测试http://115.159.65.101:8002 线上http://10.51.0.37:8002
//
//
测试http://115.159.65.101:8002 线上http://10.51.0.37:8002
@FeignClient
(
name
=
"COUPON"
,
url
=
"${saas.couponclient.feign.url}"
)
//
@FeignClient(name = "COUPON",url="${saas.couponclient.feign.url}")
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
//
@RequestMapping(produces = {"application/json;charset=UTF-8"})
public
interface
CouponClient
{
//
public interface CouponClient {
//
/**
//
/**
* 领取优惠券
//
* 领取优惠券
*/
//
*/
@PostMapping
(
"/coupon/create"
)
//
@PostMapping("/coupon/create")
CouponBaseResponseDto
create
(
CouponCreateDto
couponCreateDto
);
//
CouponBaseResponseDto create(CouponCreateDto couponCreateDto);
//
/**
//
/**
* 查询用户优惠券列表
//
* 查询用户优惠券列表
*/
//
*/
@PostMapping
(
"/coupon/list"
)
//
@PostMapping("/coupon/list")
CouponListResponseDto
list
(
CouponListDto
couponListDto
);
//
CouponListResponseDto list(CouponListDto couponListDto);
//
/**
//
/**
* 优惠券核销
//
* 优惠券核销
*/
//
*/
@Deprecated
//
@Deprecated
@PostMapping
(
"/coupon/verification"
)
//
@PostMapping("/coupon/verification")
CouponBaseResponseDto
verification
(
CouponVerificationDto
couponVerificationDto
);
//
CouponBaseResponseDto verification(CouponVerificationDto couponVerificationDto);
//
/**
//
/**
* 核销验证接口
//
* 核销验证接口
*/
//
*/
@PostMapping
(
"/check/user/coupon"
)
//
@PostMapping("/check/user/coupon")
CouponBaseResponseDto
verifyCheck
(
VerifyCheckRequestDto
verifyCheckRequestDto
);
//
CouponBaseResponseDto verifyCheck(VerifyCheckRequestDto verifyCheckRequestDto);
//
/**
//
/**
* 核销成功通知接口
//
* 核销成功通知接口
*/
//
*/
@PostMapping
(
"/coupon/verification/notice"
)
//
@PostMapping("/coupon/verification/notice")
CouponBaseResponseDto
verifyNotice
(
VerifyNoticeRequestDto
verifyNoticeRequestDto
);
//
CouponBaseResponseDto verifyNotice(VerifyNoticeRequestDto verifyNoticeRequestDto);
//
}
//
}
order-application-service/src/main/java/cn/freemud/service/thirdparty/CouponOfflineClient.java
View file @
625e17f2
...
@@ -5,7 +5,7 @@ import cn.freemud.entities.dto.CouponCodeVerificationDto;
...
@@ -5,7 +5,7 @@ import cn.freemud.entities.dto.CouponCodeVerificationDto;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
@FeignClient
(
name
=
"
COUPON
"
,
url
=
"${saas.couponofflineclient.feign.url}"
)
@FeignClient
(
name
=
"
OPEN-STORE-OFFLINE-COUPON-SERVICE
"
,
url
=
"${saas.couponofflineclient.feign.url}"
)
public
interface
CouponOfflineClient
{
public
interface
CouponOfflineClient
{
@PostMapping
(
"/api"
)
@PostMapping
(
"/api"
)
...
...
order-application-service/src/main/java/cn/freemud/service/thirdparty/CouponOnlineClient.java
View file @
625e17f2
...
@@ -15,8 +15,12 @@ import org.springframework.web.bind.annotation.RequestParam;
...
@@ -15,8 +15,12 @@ import org.springframework.web.bind.annotation.RequestParam;
import
java.util.Map
;
import
java.util.Map
;
//@IgnoreFeignLogAnnotation
//@IgnoreFeignLogAnnotation
@FeignClient
(
name
=
"
COUPONOLIN
E"
,
url
=
"${saas.coupononlineclient.feign.url}"
,
configuration
=
FormSupportConfig
.
class
)
@FeignClient
(
name
=
"
OPEN-STORE-ONLINE-COUPON-SERVIC
E"
,
url
=
"${saas.coupononlineclient.feign.url}"
,
configuration
=
FormSupportConfig
.
class
)
public
interface
CouponOnlineClient
{
public
interface
CouponOnlineClient
{
// TODO: 21-4-1 待合并
/**
/**
* 查询券详情
* 查询券详情
*/
*/
...
@@ -30,5 +34,4 @@ public interface CouponOnlineClient {
...
@@ -30,5 +34,4 @@ public interface CouponOnlineClient {
*/
*/
@PostMapping
(
value
=
"/coupon/state/invalid/coupons"
)
@PostMapping
(
value
=
"/coupon/state/invalid/coupons"
)
InvalidCouponsResponseDto
invalidCoupons
(
@RequestBody
InvalidCouponsRequestDto
invalidCouponsRequestDto
);
InvalidCouponsResponseDto
invalidCoupons
(
@RequestBody
InvalidCouponsRequestDto
invalidCouponsRequestDto
);
}
}
order-application-service/src/main/java/cn/freemud/service/thirdparty/CustomScoreClient.java
View file @
625e17f2
...
@@ -22,6 +22,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -22,6 +22,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
@FeignClient
(
name
=
"customer-application-service"
,
url
=
"${saas.customScoreClient.feign.url}"
)
@FeignClient
(
name
=
"customer-application-service"
,
url
=
"${saas.customScoreClient.feign.url}"
)
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
CustomScoreClient
{
public
interface
CustomScoreClient
{
// TODO: 21-4-1 带合并
/**
/**
* 用户可用积分
* 用户可用积分
*/
*/
...
...
order-application-service/src/main/java/cn/freemud/service/thirdparty/CustomerApplicationClient.java
View file @
625e17f2
...
@@ -22,6 +22,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -22,6 +22,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
CustomerApplicationClient
{
public
interface
CustomerApplicationClient
{
// TODO: 21-4-1 带合并
@PostMapping
(
value
=
"membercard/purchasePaid"
)
@PostMapping
(
value
=
"membercard/purchasePaid"
)
BaseResponse
purchasePaid
(
PurchasePaidRequestDto
requestDto
);
BaseResponse
purchasePaid
(
PurchasePaidRequestDto
requestDto
);
...
...
order-application-service/src/main/java/cn/freemud/service/thirdparty/CustomerClient.java
View file @
625e17f2
/**
/
//
**
* All rights Reserved, Designed By www.freemud.cn
//
* All rights Reserved, Designed By www.freemud.cn
*
//
*
* @Title: CustomerExtendClient
//
* @Title: CustomerExtendClient
* @Package cn.freemud.service.thirdparty
//
* @Package cn.freemud.service.thirdparty
* @Description:
//
* @Description:
* @author: song.cai
//
* @author: song.cai
* @date: 2019/2/20 16:42
//
* @date: 2019/2/20 16:42
* @version V1.0
//
* @version V1.0
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
//
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
//
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
//
*/
//
package
cn
.
freemud
.
service
.
thirdparty
;
//
package cn.freemud.service.thirdparty;
//
import
cn.freemud.entities.dto.*
;
//
import cn.freemud.entities.dto.*;
import
com.alibaba.fastjson.JSONObject
;
//
import com.alibaba.fastjson.JSONObject;
import
org.springframework.cloud.openfeign.FeignClient
;
//
import org.springframework.cloud.openfeign.FeignClient;
import
org.springframework.web.bind.annotation.PostMapping
;
//
import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
//
import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
//
import org.springframework.web.bind.annotation.RequestMapping;
//
@FeignClient
(
name
=
"CUSTOMER-SERVICE"
,
url
=
"${saas.customerclient.feign.url}"
)
//
@FeignClient(name = "CUSTOMER-SERVICE", url = "${saas.customerclient.feign.url}")
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
//
@RequestMapping(produces = {"application/json;charset=UTF-8"})
public
interface
CustomerClient
{
//
public interface CustomerClient {
/**
//
/**
* 根据聚道注册会员
//
* 根据聚道注册会员
*/
//
*/
@PostMapping
(
value
=
"/customerservice/registerByChannel"
)
//
@PostMapping(value = "/customerservice/registerByChannel")
MemberRegisterResponseDto
registerByChannel
(
@RequestBody
MemberRegisterRequestDto
memberRegisterRequestDto
);
//
MemberRegisterResponseDto registerByChannel(@RequestBody MemberRegisterRequestDto memberRegisterRequestDto);
//
/**
//
/**
* 根据渠道信息查询顾客信息
//
* 根据渠道信息查询顾客信息
*/
//
*/
@PostMapping
(
value
=
"/customerservice/getMemberByChannel"
)
//
@PostMapping(value = "/customerservice/getMemberByChannel")
GetMemberInfoByChannelResponseDto
getMemberInfoByChannel
(
@RequestBody
GetMemberInfoByChannelRequestDto
getMemberInfoByChannelRequestDto
);
//
GetMemberInfoByChannelResponseDto getMemberInfoByChannel(@RequestBody GetMemberInfoByChannelRequestDto getMemberInfoByChannelRequestDto);
//
/**
//
/**
* 修改unionid
//
* 修改unionid
*/
//
*/
@PostMapping
(
value
=
"/customerservice/updateMemberChannel"
)
//
@PostMapping(value = "/customerservice/updateMemberChannel")
JSONObject
updateUserUnionId
(
@RequestBody
UpdateMemUnionIdRequestDto
updateMemUnionIdRequestDto
);
//
JSONObject updateUserUnionId(@RequestBody UpdateMemUnionIdRequestDto updateMemUnionIdRequestDto);
//
/**
//
/**
* 根据会员id获取会员信息
//
* 根据会员id获取会员信息
*/
//
*/
@PostMapping
(
value
=
"/customerservice/getMemberById"
)
//
@PostMapping(value = "/customerservice/getMemberById")
GetMemberInfoByIdResponseDto
getMemberInfoById
(
@RequestBody
GetMemberInfoByIdRequestDto
getMemberInfoByIdRequestDto
);
//
GetMemberInfoByIdResponseDto getMemberInfoById(@RequestBody GetMemberInfoByIdRequestDto getMemberInfoByIdRequestDto);
//
/**
//
/**
* 修改顾客信息
//
* 修改顾客信息
*/
//
*/
@PostMapping
(
value
=
"/customerservice/update"
)
//
@PostMapping(value = "/customerservice/update")
JSONObject
editMemberInfo
(
@RequestBody
EditMemberInfoRequestDto
editMemberInfoRequestDto
);
//
JSONObject editMemberInfo(@RequestBody EditMemberInfoRequestDto editMemberInfoRequestDto);
//
//
/**
//
/**
* 获取用户收货地址列表
//
* 获取用户收货地址列表
*/
//
*/
@PostMapping
(
value
=
"/customerservice/address/getAddressList"
)
//
@PostMapping(value = "/customerservice/address/getAddressList")
GetReceiveAddressListResponseDto
getReceiveAddressList
(
@RequestBody
GetReceiveAddressListDto
getReceiveListDto
);
//
GetReceiveAddressListResponseDto getReceiveAddressList(@RequestBody GetReceiveAddressListDto getReceiveListDto);
//
/**
//
/**
* 新增收货地址
//
* 新增收货地址
*/
//
*/
@PostMapping
(
value
=
"/customerservice/address/add"
)
//
@PostMapping(value = "/customerservice/address/add")
AddReceiveAddressResponseDto
addReceiveAddress
(
@RequestBody
AddReceiveAddressDto
addReceiveDto
);
//
AddReceiveAddressResponseDto addReceiveAddress(@RequestBody AddReceiveAddressDto addReceiveDto);
//
/**
//
/**
* 修改收货地址
//
* 修改收货地址
*/
//
*/
@PostMapping
(
value
=
"/customerservice/address/update"
)
//
@PostMapping(value = "/customerservice/address/update")
UpdateReceiveAddressResponseDto
updateReceiveAddress
(
@RequestBody
UpdateReceiveAddressDto
updateReceiveAddressDto
);
//
UpdateReceiveAddressResponseDto updateReceiveAddress(@RequestBody UpdateReceiveAddressDto updateReceiveAddressDto);
//
/**
//
/**
* 删除收货地址
//
* 删除收货地址
*/
//
*/
@PostMapping
(
value
=
"/customerservice/address/delete"
)
//
@PostMapping(value = "/customerservice/address/delete")
DeleteReceiveAddressResponseDto
deleteReceiveAddress
(
@RequestBody
DeleteReceiveAddressDto
deleteReceiveAddressDto
);
//
DeleteReceiveAddressResponseDto deleteReceiveAddress(@RequestBody DeleteReceiveAddressDto deleteReceiveAddressDto);
//
//
/**
//
/**
* 查询收货地址详情
//
* 查询收货地址详情
*/
//
*/
@PostMapping
(
value
=
"/customerservice/address/get"
)
//
@PostMapping(value = "/customerservice/address/get")
QueryReceiveAddressResponseDto
queryReceiveAddressById
(
@RequestBody
QueryReceiveAddressDto
queryReceiveAddressDto
);
//
QueryReceiveAddressResponseDto queryReceiveAddressById(@RequestBody QueryReceiveAddressDto queryReceiveAddressDto);
}
//
}
order-application-service/src/main/java/cn/freemud/service/thirdparty/PaymentNewClient.java
View file @
625e17f2
...
@@ -19,10 +19,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -19,10 +19,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
*/
@FeignClient
(
name
=
"payment-
service-new
"
,
url
=
"${payment.new.baseUrl}"
)
@FeignClient
(
name
=
"payment-
center-api
"
,
url
=
"${payment.new.baseUrl}"
)
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
PaymentNewClient
{
public
interface
PaymentNewClient
{
// TODO: 21-4-1 待合并
/**
/**
* 扫脸支付
* 扫脸支付
*/
*/
...
...
order-application-service/src/main/java/cn/freemud/service/thirdparty/RecommendClient.java
View file @
625e17f2
package
cn
.
freemud
.
service
.
thirdparty
;
//
package cn.freemud.service.thirdparty;
//
import
cn.freemud.entities.dto.RecommendProductRequestDto
;
//
import cn.freemud.entities.dto.RecommendProductRequestDto;
import
cn.freemud.entities.dto.RecommendProductResponseDto
;
//
import cn.freemud.entities.dto.RecommendProductResponseDto;
import
org.springframework.cloud.openfeign.FeignClient
;
//
import org.springframework.cloud.openfeign.FeignClient;
import
org.springframework.web.bind.annotation.PostMapping
;
//
import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
//
import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
//
import org.springframework.web.bind.annotation.RequestMapping;
//
/**
/
//
**
* All rights Reserved, Designed By www.freemud.cn
//
* All rights Reserved, Designed By www.freemud.cn
*
//
*
* @version V1.0
//
* @version V1.0
* @Title: RecommendClient
//
* @Title: RecommendClient
* @Package cn.freemud.service.thirdparty
//
* @Package cn.freemud.service.thirdparty
* @Description: 简单描述下这个类是做什么用的
//
* @Description: 简单描述下这个类是做什么用的
* @author: zhenghuan.yang
//
* @author: zhenghuan.yang
* @date: 2018/9/27 16:23
//
* @date: 2018/9/27 16:23
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
//
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
//
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
//
*/
//测试:http://115.159.187.179:9966 //生产: http://10.10.3.41:9966
//
//
测试:http://115.159.187.179:9966 //生产: http://10.10.3.41:9966
@FeignClient
(
value
=
"RECOMMEND-SERVICE"
,
url
=
"${saas.recommendclient.feign.url}"
)
//
@FeignClient(value = "RECOMMEND-SERVICE",url="${saas.recommendclient.feign.url}")
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
//
@RequestMapping(produces = {"application/json;charset=UTF-8"})
public
interface
RecommendClient
{
//
public interface RecommendClient {
/**
//
/**
* 商品推荐接口
//
* 商品推荐接口
*/
//
*/
@PostMapping
(
value
=
"/rec/product/recommend"
)
//
@PostMapping(value = "/rec/product/recommend")
RecommendProductResponseDto
recommendProduct
(
@RequestBody
RecommendProductRequestDto
dto
);
//
RecommendProductResponseDto recommendProduct(@RequestBody RecommendProductRequestDto dto);
}
//
}
order-application-service/src/main/java/cn/freemud/service/thirdparty/ShoppingCartClient.java
View file @
625e17f2
...
@@ -24,7 +24,6 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -24,7 +24,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@FeignClient
(
name
=
"SHOPPING-CART-APPLICATION-SERVICE"
,
url
=
"${saas.newshoppingcartclient.feign.url}"
)
@FeignClient
(
name
=
"SHOPPING-CART-APPLICATION-SERVICE"
,
url
=
"${saas.newshoppingcartclient.feign.url}"
)
//@FeignClient(name = "123",url = "http://localhost:9211")
@RequestMapping
(
value
=
"/shoppingCart"
,
produces
=
{
"application/json;charset=UTF-8"
})
@RequestMapping
(
value
=
"/shoppingCart"
,
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
ShoppingCartClient
{
public
interface
ShoppingCartClient
{
...
...
order-application-service/src/main/java/cn/freemud/service/thirdparty/StockClient.java
View file @
625e17f2
...
@@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.PostMapping;
...
@@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@FeignClient
(
name
=
"ims-service"
,
url
=
"http://saastestapi.sandload.cn/ims-service"
)
@FeignClient
(
name
=
"ims-service"
)
@RequestMapping
(
value
=
"/inv"
,
produces
=
{
"application/json;charset=UTF-8"
})
@RequestMapping
(
value
=
"/inv"
,
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
StockClient
{
public
interface
StockClient
{
...
...
order-application-service/src/main/java/cn/freemud/service/thirdparty/StoreClient.java
View file @
625e17f2
...
@@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.PostMapping;
...
@@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@FeignClient
(
name
=
"CONSOLE-API"
,
url
=
"http://172.81.204.212:8715"
)
@FeignClient
(
name
=
"CONSOLE-API"
)
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
@RequestMapping
(
produces
=
{
"application/json;charset=UTF-8"
})
public
interface
StoreClient
{
public
interface
StoreClient
{
...
...
order-application-service/src/test/java/cn.freemud/client/CouponClientTest.java
View file @
625e17f2
This diff is collapsed.
Click to expand it.
order-application-service/src/test/java/cn.freemud/client/MemberProductClientTest.java
View file @
625e17f2
This diff is collapsed.
Click to expand it.
order-application-service/src/test/java/cn.freemud/client/StockClientTest.java
View file @
625e17f2
/**
/
//
**
* All rights Reserved, Designed By www.freemud.cn
//
* All rights Reserved, Designed By www.freemud.cn
*
//
*
* @Title: StockClientTest
//
* @Title: StockClientTest
* @Package cn.freemud.client
//
* @Package cn.freemud.client
* @Description:
//
* @Description:
* @author: ping.wu
//
* @author: ping.wu
* @date: 2019/2/21 11:51
//
* @date: 2019/2/21 11:51
* @version V1.0
//
* @version V1.0
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
//
* @Copyright: 2019 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
//
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
//
*/
package
cn
.
freemud
.
client
;
//
package cn.freemud.client;
//
import
cn.freemud.base.entity.BaseResponse
;
//
import cn.freemud.base.entity.BaseResponse;
import
cn.freemud.entities.dto.GetProductStockRequestDto
;
//
import cn.freemud.entities.dto.GetProductStockRequestDto;
import
cn.freemud.entities.dto.GetProductStockResponseDto
;
//
import cn.freemud.entities.dto.GetProductStockResponseDto;
import
cn.freemud.entities.dto.UpdateProductStockRequestDto
;
//
import cn.freemud.entities.dto.UpdateProductStockRequestDto;
import
cn.freemud.service.thirdparty.StockClient
;
//
import cn.freemud.service.thirdparty.StockClient;
import
lombok.extern.slf4j.Slf4j
;
//
import lombok.extern.slf4j.Slf4j;
import
org.junit.Test
;
//
import org.junit.Test;
import
org.junit.runner.RunWith
;
//
import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
//
import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
//
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import
org.springframework.boot.test.context.SpringBootTest
;
//
import org.springframework.boot.test.context.SpringBootTest;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
//
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
//
import org.springframework.cloud.openfeign.EnableFeignClients;
import
org.springframework.test.context.junit4.SpringRunner
;
//
import org.springframework.test.context.junit4.SpringRunner;
//
import
java.util.ArrayList
;
//
import java.util.ArrayList;
import
java.util.Date
;
//
import java.util.Date;
import
java.util.List
;
//
import java.util.List;
//
@Slf4j
//
@Slf4j
@RunWith
(
SpringRunner
.
class
)
//
@RunWith(SpringRunner.class)
@SpringBootTest
//
@SpringBootTest
@EnableDiscoveryClient
//
@EnableDiscoveryClient
@EnableFeignClients
//
@EnableFeignClients
@EnableAutoConfiguration
//
@EnableAutoConfiguration
public
class
StockClientTest
{
//
public class StockClientTest {
//
@Autowired
//
@Autowired
private
StockClient
stockClient
;
//
private StockClient stockClient;
//
/**
//
/**
* 查询库存
//
* 查询库存
*/
//
*/
@Test
//
@Test
public
void
getAvailableStocksTest
()
{
//
public void getAvailableStocksTest() {
GetProductStockRequestDto
getProductStockRequestDto
=
new
GetProductStockRequestDto
();
//
GetProductStockRequestDto getProductStockRequestDto = new GetProductStockRequestDto();
getProductStockRequestDto
.
setChannel
(
"saas"
);
//
getProductStockRequestDto.setChannel("saas");
getProductStockRequestDto
.
setPartnerId
(
"1864"
);
//
getProductStockRequestDto.setPartnerId("1864");
getProductStockRequestDto
.
setStoreId
(
"1001"
);
//
getProductStockRequestDto.setStoreId("1001");
List
<
Long
>
productIds
=
new
ArrayList
<>();
//
List<Long> productIds = new ArrayList<>();
productIds
.
add
(
134083341913936391L
);
//
productIds.add(134083341913936391L);
getProductStockRequestDto
.
setProductIds
(
productIds
);
//
getProductStockRequestDto.setProductIds(productIds);
//
GetProductStockResponseDto
availableStocks
=
stockClient
.
getAvailableStocks
(
getProductStockRequestDto
);
//
GetProductStockResponseDto availableStocks = stockClient.getAvailableStocks(getProductStockRequestDto);
System
.
out
.
println
(
availableStocks
);
//
System.out.println(availableStocks);
}
//
}
//
@Test
//
@Test
public
void
updateStocksTest
()
{
//
public void updateStocksTest() {
UpdateProductStockRequestDto
requestDto
=
new
UpdateProductStockRequestDto
();
//
UpdateProductStockRequestDto requestDto = new UpdateProductStockRequestDto();
requestDto
.
setChannel
(
"saas"
);
//
requestDto.setChannel("saas");
requestDto
.
setChangeType
(
"2"
);
//
requestDto.setChangeType("2");
requestDto
.
setIsOversold
(
0
);
//
requestDto.setIsOversold(0);
requestDto
.
setPartnerId
(
"1864"
);
//
requestDto.setPartnerId("1864");
requestDto
.
setStoreId
(
"1001"
);
//
requestDto.setStoreId("1001");
requestDto
.
setTransNo
(
"136769237027082010"
);
//
requestDto.setTransNo("136769237027082010");
requestDto
.
setTransTime
(
new
Date
());
//
requestDto.setTransTime(new Date());
//
List
<
UpdateProductStockRequestDto
.
ProductStock
>
productStocks
=
new
ArrayList
<>();
//
List<UpdateProductStockRequestDto.ProductStock> productStocks = new ArrayList<>();
UpdateProductStockRequestDto
.
ProductStock
productStock
=
new
UpdateProductStockRequestDto
.
ProductStock
();
//
UpdateProductStockRequestDto.ProductStock productStock = new UpdateProductStockRequestDto.ProductStock();
productStock
.
setProductId
(
134083341913936391L
);
//
productStock.setProductId(134083341913936391L);
productStock
.
setQty
(
1
);
//
productStock.setQty(1);
productStocks
.
add
(
productStock
);
//
productStocks.add(productStock);
//
requestDto
.
setProductStocks
(
productStocks
);
//
requestDto.setProductStocks(productStocks);
//
BaseResponse
response
=
stockClient
.
updateStocks
(
requestDto
);
//
BaseResponse response = stockClient.updateStocks(requestDto);
//
System
.
out
.
println
(
response
);
//
System.out.println(response);
}
//
}
//
}
//
}
order-application-service/src/test/java/cn.freemud/client/StoreClientTest.java
View file @
625e17f2
package
cn
.
freemud
.
client
;
//
package cn.freemud.client;
//
import
cn.freemud.entities.dto.*
;
//
import cn.freemud.entities.dto.*;
import
cn.freemud.service.thirdparty.StoreClient
;
//
import cn.freemud.service.thirdparty.StoreClient;
import
lombok.extern.slf4j.Slf4j
;
//
import lombok.extern.slf4j.Slf4j;
import
org.junit.Test
;
//
import org.junit.Test;
import
org.junit.runner.RunWith
;
//
import org.junit.runner.RunWith;
import
org.springframework.beans.factory.annotation.Autowired
;
//
import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
//
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import
org.springframework.boot.test.context.SpringBootTest
;
//
import org.springframework.boot.test.context.SpringBootTest;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
//
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
//
import org.springframework.cloud.openfeign.EnableFeignClients;
import
org.springframework.test.context.junit4.SpringRunner
;
//
import org.springframework.test.context.junit4.SpringRunner;
//
import
java.util.List
;
//
import java.util.List;
//
/**
/
//
**
* All rights Reserved, Designed By www.freemud.cn
//
* All rights Reserved, Designed By www.freemud.cn
*
//
*
* @version V1.0
//
* @version V1.0
* @Title: StoreClientTest
//
* @Title: StoreClientTest
* @Package cn.freemud.client
//
* @Package cn.freemud.client
* @Description: 测试
//
* @Description: 测试
* @author: zhenghuan.yang
//
* @author: zhenghuan.yang
* @date: 2018/6/25 15:41
//
* @date: 2018/6/25 15:41
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
//
* @Copyright: 2018 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
//
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
//
*/
@Slf4j
//
@Slf4j
@RunWith
(
SpringRunner
.
class
)
//
@RunWith(SpringRunner.class)
@SpringBootTest
//
@SpringBootTest
@EnableDiscoveryClient
//
@EnableDiscoveryClient
@EnableFeignClients
//
@EnableFeignClients
@EnableAutoConfiguration
//
@EnableAutoConfiguration
public
class
StoreClientTest
{
//
public class StoreClientTest {
@Autowired
//
@Autowired
private
StoreClient
storeClient
;
//
private StoreClient storeClient;
//
/**
//
/**
* 查询附近门店
//
* 查询附近门店
*/
//
*/
@Test
//
@Test
public
void
findNearStores
()
{
//
public void findNearStores() {
NearStoreRequestDto
nearStoreRequestDto
=
new
NearStoreRequestDto
();
//
NearStoreRequestDto nearStoreRequestDto=new NearStoreRequestDto();
nearStoreRequestDto
.
setPartnerId
(
"1832"
);
//
nearStoreRequestDto.setPartnerId("1832");
nearStoreRequestDto
.
setLatitude
(
"31.269248962402344"
);
//
nearStoreRequestDto.setLatitude("31.269248962402344");
nearStoreRequestDto
.
setLongitude
(
"121.37284088134766"
);
//
nearStoreRequestDto.setLongitude("121.37284088134766");
nearStoreRequestDto
.
setActiveFlag
(
"1"
);
//
nearStoreRequestDto.setActiveFlag("1");
nearStoreRequestDto
.
setTypeFlag
(
"3"
);
//
nearStoreRequestDto.setTypeFlag("3");
nearStoreRequestDto
.
setPageNo
(
1
);
//
nearStoreRequestDto.setPageNo(1);
nearStoreRequestDto
.
setPlaceOrderFlag
(
"1"
);
//
nearStoreRequestDto.setPlaceOrderFlag("1");
nearStoreRequestDto
.
setPageSize
(
100
);
//
nearStoreRequestDto.setPageSize(100);
nearStoreRequestDto
.
setDistance
(
"100000"
);
//
nearStoreRequestDto.setDistance("100000");
StoreBaseResponseDto
<
StoreListResponseDto
>
response
=
storeClient
.
findNearStores
(
nearStoreRequestDto
);
//
StoreBaseResponseDto<StoreListResponseDto> response = storeClient.findNearStores(nearStoreRequestDto);
StoreListResponseDto
storeListResponseDto
=
response
.
getBizVO
();
//
StoreListResponseDto storeListResponseDto=response.getBizVO();
List
<
StoreResponseDto
>
list
=
storeListResponseDto
.
getList
();
//
List<StoreResponseDto> list=storeListResponseDto.getList();
log
.
info
(
"storeId "
+
"freeDeliveryPrice "
+
"deliveryPrice "
+
"delivery"
);
//
log.info("storeId " + "freeDeliveryPrice "+"deliveryPrice " +"delivery" );
for
(
StoreResponseDto
store:
list
){
//
for (StoreResponseDto store:list){
String
insert
=
"INSERT INTO open_platform_partner_store_delivery_config (`partner_id`, `store_id`, `delivery_limit_amount`, `delivery_amount`, `default_delivery_range`, `add_range_count`, `add_range_amount`, `gmt_created`, `gmt_modified`) VALUES ('"
+
nearStoreRequestDto
.
getPartnerId
()+
"', '"
+
store
.
getStoreCode
()+
"','"
+
store
.
getFreeDeliveryPrice
()*
100
+
"','"
+
store
.
getDeliveryPrice
()*
100
+
"', '3000', '3000', '250', '2018-12-13 17:08:25', '2018-12-13 18:15:43');"
;
//
String insert="INSERT INTO open_platform_partner_store_delivery_config (`partner_id`, `store_id`, `delivery_limit_amount`, `delivery_amount`, `default_delivery_range`, `add_range_count`, `add_range_amount`, `gmt_created`, `gmt_modified`) VALUES ('"+nearStoreRequestDto.getPartnerId()+"', '"+store.getStoreCode()+"','"+store.getFreeDeliveryPrice()*100+"','"+store.getDeliveryPrice()*100+"', '3000', '3000', '250', '2018-12-13 17:08:25', '2018-12-13 18:15:43');";
System
.
out
.
println
(
insert
);
//
System.out.println(insert);
/* System.out.println(store.getStoreCode()+" "+store.getFreeDeliveryPrice()+" "+store.getDeliveryPrice()+" "+store.getDelivery());*/
//
/* System.out.println(store.getStoreCode()+" "+store.getFreeDeliveryPrice()+" "+store.getDeliveryPrice()+" "+store.getDelivery());*/
}
//
}
}
//
}
/**
//
/**
* 查询单个门店信息
//
* 查询单个门店信息
*/
//
*/
@Test
//
@Test
public
void
getStoreInfo
()
{
//
public void getStoreInfo() {
StoreInfoRequestDto
storeInfoRequestDto
=
new
StoreInfoRequestDto
();
//
StoreInfoRequestDto storeInfoRequestDto=new StoreInfoRequestDto();
storeInfoRequestDto
.
setPartnerId
(
"360bb48b-5316-458a-903e-9a44c7f339b1"
);
//
storeInfoRequestDto.setPartnerId("360bb48b-5316-458a-903e-9a44c7f339b1");
storeInfoRequestDto
.
setStoreCode
(
""
);
//
storeInfoRequestDto.setStoreCode("");
StoreBaseResponseDto
<
StoreResponseDto
>
storeBaseResponseDto
=
storeClient
.
getStoreInfo
(
storeInfoRequestDto
);
//
StoreBaseResponseDto<StoreResponseDto> storeBaseResponseDto = storeClient.getStoreInfo(storeInfoRequestDto);
log
.
info
(
"storeBaseResponseDto==="
+
storeBaseResponseDto
);
//
log.info("storeBaseResponseDto==="+storeBaseResponseDto);
}
//
}
/**
//
/**
* 查询门店轮播图
//
* 查询门店轮播图
*/
//
*/
@Test
//
@Test
public
void
findStoreImages
()
{
//
public void findStoreImages() {
StoreImagesRequestDto
toreImagesRequestDto
=
new
StoreImagesRequestDto
();
//
StoreImagesRequestDto toreImagesRequestDto=new StoreImagesRequestDto();
toreImagesRequestDto
.
setPartnerId
(
"360bb48b-5316-458a-903e-9a44c7f339b1"
);
//
toreImagesRequestDto.setPartnerId("360bb48b-5316-458a-903e-9a44c7f339b1");
toreImagesRequestDto
.
setBusinessId
(
""
);
//
toreImagesRequestDto.setBusinessId("");
toreImagesRequestDto
.
setTypeFlag
(
1
);
//
toreImagesRequestDto.setTypeFlag(1);
StoreBaseResponseDto
<
StoreImageListResponseDto
>
storeBaseResponseDto
=
storeClient
.
findStoreImages
(
toreImagesRequestDto
);
//
StoreBaseResponseDto<StoreImageListResponseDto> storeBaseResponseDto = storeClient.findStoreImages(toreImagesRequestDto);
log
.
info
(
"storeBaseResponseDto==="
+
storeBaseResponseDto
);
//
log.info("storeBaseResponseDto==="+storeBaseResponseDto);
}
//
}
}
//
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment