Commit dfaabfeb authored by shiyu's avatar shiyu

出价,正式环境需要判断是否是商家

parent ead6730f
......@@ -106,6 +106,9 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
@Reference
ShopReadService shopReadService;
@Value("${spring.profiles.active}")
private String env;
@Override
@Transactional
public Result createAuctionRecord(AuctionRecordRequestDto dto) {
......@@ -114,12 +117,15 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
RLock lock = redissonClient.getLock(itemIdKey);
try {
if (lock.tryLock(0, 10, TimeUnit.SECONDS)) {
//玩物得志商家不能出价
CloudServerResponse<ShopDTO> cloudServerResponse = shopReadService.getShopByUserId(dto.getUserId(), new ShopQueryOption());
if (cloudServerResponse.isSuccess()) {
ShopDTO shopDTO = cloudServerResponse.getResult();
if (shopDTO != null && !ObjectUtils.isEmpty(shopDTO.getShopId()) && shopDTO.getType() == 4) {
return Result.failed("被风控系统识别不能出价");
//正式环境需要判断是否是商家
if (!"dev".equals(env)) {
//玩物得志商家不能出价
CloudServerResponse<ShopDTO> cloudServerResponse = shopReadService.getShopByUserId(dto.getUserId(), new ShopQueryOption());
if (cloudServerResponse.isSuccess()) {
ShopDTO shopDTO = cloudServerResponse.getResult();
if (shopDTO != null && !ObjectUtils.isEmpty(shopDTO.getShopId()) && shopDTO.getType() == 4) {
return Result.failed("被风控系统识别不能出价");
}
}
}
Date now = new Date();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment