diff --git a/blockchain-server/blockchain-server-otc/src/main/java/com/blockchain/server/otc/dto/ad/PublishAdParamDTO.java b/blockchain-server/blockchain-server-otc/src/main/java/com/blockchain/server/otc/dto/ad/PublishAdParamDTO.java index 797e9ae..2474997 100644 --- a/blockchain-server/blockchain-server-otc/src/main/java/com/blockchain/server/otc/dto/ad/PublishAdParamDTO.java +++ b/blockchain-server/blockchain-server-otc/src/main/java/com/blockchain/server/otc/dto/ad/PublishAdParamDTO.java @@ -17,4 +17,5 @@ public class PublishAdParamDTO extends BaseDTO { private BigDecimal minLimit; private String[] payType; private String remark; + private Boolean isTeacher; } diff --git a/blockchain-server/blockchain-server-otc/src/main/java/com/blockchain/server/otc/service/impl/AdServiceImpl.java b/blockchain-server/blockchain-server-otc/src/main/java/com/blockchain/server/otc/service/impl/AdServiceImpl.java index 421a9cc..fea7b63 100644 --- a/blockchain-server/blockchain-server-otc/src/main/java/com/blockchain/server/otc/service/impl/AdServiceImpl.java +++ b/blockchain-server/blockchain-server-otc/src/main/java/com/blockchain/server/otc/service/impl/AdServiceImpl.java @@ -15,6 +15,7 @@ import com.blockchain.server.otc.mapper.AdMapper; import com.blockchain.server.otc.service.*; import com.codingapi.tx.annotation.ITxTransaction; import com.codingapi.tx.annotation.TxTransaction; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -75,16 +76,22 @@ public class AdServiceImpl implements AdService, ITxTransaction { public void publishSellAd(PublishAdParamDTO param) { //发布广告参数校验方法 Coin coin = publishAdVerify(param); - //检查市商否能发布更多广告 - checkMarketAdCount(param.getUserId(), CommonConstans.SELL, coin.getCoinName(), coin.getUnitName()); - //检查卖家是否绑定支付方式 - checkPublishPaysIsBinging(param); - //判断是否开启广告手续费 - BigDecimal chargeRatio = checkAdServiceCharge(coin.getCoinServiceCharge(), param.getUserId()); - //新建广告数据,返回广告流水号 - String adNumber = insertAd(param, CommonConstans.SELL, chargeRatio); - //更新钱包并记录资金变动 - publishSellAdHandleWallet(param, adNumber, chargeRatio); + String adNumber; + if (BooleanUtils.isFalse(param.getIsTeacher())) { + //检查市商否能发布更多广告 + checkMarketAdCount(param.getUserId(), CommonConstans.SELL, coin.getCoinName(), coin.getUnitName()); + //检查卖家是否绑定支付方式 + checkPublishPaysIsBinging(param); + //判断是否开启广告手续费 + BigDecimal chargeRatio = checkAdServiceCharge(coin.getCoinServiceCharge(), param.getUserId()); + //新建广告数据,返回广告流水号 + adNumber = insertAd(param, CommonConstans.SELL, chargeRatio); + //更新钱包并记录资金变动 + publishSellAdHandleWallet(param, adNumber, chargeRatio); + } else { + //新建广告数据,返回广告流水号 + adNumber = insertAd(param, CommonConstans.SELL, BigDecimal.ZERO); + } //新增用户交易数据表 dealStatsService.insertIsNotExist(param.getUserId()); //记录用户操作 @@ -216,7 +223,9 @@ public class AdServiceImpl implements AdService, ITxTransaction { //检查发布参数 checkPublishParam(param); //判断用户是否可以发布广告 - marketUserService.checkMarketUser(param.getUserId()); + if (!BooleanUtils.isTrue(param.getIsTeacher())) { + marketUserService.checkMarketUser(param.getUserId()); + } //检查密码 walletService.isPassword(param.getPass()); //检查币对