Commit 1923a975 authored by shiyu's avatar shiyu

拍卖订单生成2

parent f96542e3
...@@ -351,30 +351,31 @@ public class DistributionOrderServiceImpl implements DistributionOrderService { ...@@ -351,30 +351,31 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
aliSmsSender.sendSms(auctionRecord.getUserId(), msg); aliSmsSender.sendSms(auctionRecord.getUserId(), msg);
} }
//给中拍用户对应分销商发消息 //给中拍用户对应分销商发消息
String lastOpenId = sendMsgService.getOpenIdByUserId(distributionOrder.getSellerId()); if (distributionOrder.getSellerId() != null && distributionOrder.getSellerId() != CommConsts.SYSTEM_ACCOUNT) {
if (com.xxdxxs.utils.StringUtils.hasLength(lastOpenId)) { String lastOpenId = sendMsgService.getOpenIdByUserId(distributionOrder.getSellerId());
AuctionOfferNoticeMsg auctionOfferNoticeMsg = new AuctionOfferNoticeMsg(); if (com.xxdxxs.utils.StringUtils.hasLength(lastOpenId)) {
auctionOfferNoticeMsg.setCurrentPrice(PriceUtil.convertPriceFenToYuan(auctionRecord.getPrice())); AuctionOfferNoticeMsg auctionOfferNoticeMsg = new AuctionOfferNoticeMsg();
auctionOfferNoticeMsg.setOpenId(lastOpenId); auctionOfferNoticeMsg.setCurrentPrice(PriceUtil.convertPriceFenToYuan(auctionRecord.getPrice()));
auctionOfferNoticeMsg.setItemId(supplierItem.getId()); auctionOfferNoticeMsg.setOpenId(lastOpenId);
auctionOfferNoticeMsg.setItemName(supplierItem.getName()); auctionOfferNoticeMsg.setItemId(supplierItem.getId());
auctionOfferNoticeMsg.setCurrentPrice(PriceUtil.convertPriceFenToYuan(distributionOrder.getAmount())); auctionOfferNoticeMsg.setItemName(supplierItem.getName());
auctionOfferNoticeMsg.setAuctionEndTime(auctionConfig.getRealEndTime()); auctionOfferNoticeMsg.setCurrentPrice(PriceUtil.convertPriceFenToYuan(distributionOrder.getAmount()));
auctionOfferNoticeMsg.setProfit(PriceUtil.convertDoubleToString(Math.floor(profit))); auctionOfferNoticeMsg.setAuctionEndTime(auctionConfig.getRealEndTime());
Result result = sendMsgService.auctionSuccessForDistributorsMsg(auctionOfferNoticeMsg); auctionOfferNoticeMsg.setProfit(PriceUtil.convertDoubleToString(Math.floor(profit)));
if (!result.getSuccess()) { Result result = sendMsgService.auctionSuccessForDistributorsMsg(auctionOfferNoticeMsg);
if (!result.getSuccess()) {
String url = wxAppletApi.getUrlLink(AUCTION_MSG_URL,"itemId=" + supplierItem.getId() + "&shareRecordId=");
String msg = "您分销的拍品" + supplierItem.getName() + "已成拍,成交价是" + PriceUtil.convertPriceFenToYuan(distributionOrder.getAmount()) +
"元,您预计获得利润" + PriceUtil.convertDoubleToString(Math.floor(profit)) + "元。请前往"+ url + "查看";
aliSmsSender.sendSms(distributionOrder.getSellerId(), msg);
}
} else {
String url = wxAppletApi.getUrlLink(AUCTION_MSG_URL,"itemId=" + supplierItem.getId() + "&shareRecordId="); String url = wxAppletApi.getUrlLink(AUCTION_MSG_URL,"itemId=" + supplierItem.getId() + "&shareRecordId=");
String msg = "您分销的拍品" + supplierItem.getName() + "已成拍,成交价是" + PriceUtil.convertPriceFenToYuan(distributionOrder.getAmount()) + String msg = "您分销的拍品" + supplierItem.getName() + "已成拍,成交价是" + PriceUtil.convertPriceFenToYuan(distributionOrder.getAmount()) +
"元,您预计获得利润" + PriceUtil.convertDoubleToString(Math.floor(profit)) + "元。请前往"+ url + "查看"; "元,您预计获得利润" + PriceUtil.convertDoubleToString(Math.floor(profit)) + "元。请前往"+ url + "查看";
aliSmsSender.sendSms(distributionOrder.getSellerId(), msg); aliSmsSender.sendSms(distributionOrder.getSellerId(), msg);
} }
} else {
String url = wxAppletApi.getUrlLink(AUCTION_MSG_URL,"itemId=" + supplierItem.getId() + "&shareRecordId=");
String msg = "您分销的拍品" + supplierItem.getName() + "已成拍,成交价是" + PriceUtil.convertPriceFenToYuan(distributionOrder.getAmount()) +
"元,您预计获得利润" + PriceUtil.convertDoubleToString(Math.floor(profit)) + "元。请前往"+ url + "查看";
aliSmsSender.sendSms(distributionOrder.getSellerId(), msg);
} }
return Result.success(map); return Result.success(map);
} else { } else {
return Result.failed("稍后再试"); return Result.failed("稍后再试");
......
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