Commit a5522abd authored by shiyu's avatar shiyu

预估价模板消息3

parent b5395452
......@@ -479,18 +479,21 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
supplierItem.setId(dto.getId());
supplierItem.setOfficialEstimatedPrice(PriceUtil.convertPriceFromStr(dto.getOfficialEstimatedPrice()));
supplierItemDao.update(supplierItem);
//发送模板消息,通知用户估价完成
SupplierItem item = supplierItemDao.findById(dto.getId());
String buyerOpenId = sendMsgService.getOpenIdByUserId(item.getCreatorId());
if (com.xxdxxs.utils.StringUtils.hasLength(buyerOpenId)) {
ExchangeNoticeMsg exchangeNoticeMsg = new ExchangeNoticeMsg();
exchangeNoticeMsg.setItemId(item.getId());
exchangeNoticeMsg.setItemName(item.getName());
exchangeNoticeMsg.setOpenId(buyerOpenId);
exchangeNoticeMsg.setOfficialEstimatedPrice(PriceUtil.convertPriceFenToYuan(item.getOfficialEstimatedPrice()));
sendMsgService.sendOfficialEstimatedPriceMsg(exchangeNoticeMsg);
} else {
logger.info(">>>>> 买家openid为空, 发送消息失败 <<<<<");
if (CommConsts.SYSTEM_ACCOUNT.longValue() != item.getCreatorId() && CommConsts.SELF_SUPPORT_ACCOUNT.longValue() != item.getCreatorId()) {
String buyerOpenId = sendMsgService.getOpenIdByUserId(item.getCreatorId());
if (com.xxdxxs.utils.StringUtils.hasLength(buyerOpenId)) {
ExchangeNoticeMsg exchangeNoticeMsg = new ExchangeNoticeMsg();
exchangeNoticeMsg.setItemId(item.getId());
exchangeNoticeMsg.setItemName(item.getName());
exchangeNoticeMsg.setOpenId(buyerOpenId);
exchangeNoticeMsg.setOfficialEstimatedPrice(PriceUtil.convertPriceFenToYuan(item.getOfficialEstimatedPrice()));
sendMsgService.sendOfficialEstimatedPriceMsg(exchangeNoticeMsg);
} else {
logger.info(">>>>> 买家openid为空, 发送消息失败 <<<<<");
}
}
return Result.success();
} catch (Exception e) {
......
......@@ -545,7 +545,6 @@ public class SendMsgServiceImpl implements SendMsgService {
@Override
public String getOpenIdByUserId(long userId) {
//先查询寄售单用户信息
User user = userDao.queryById(userId);
String unionId = user.getWeixinUnionid();
OfficialAccountSubscribeRecord officialAccountSubscribeRecord = officialAccountSubscribeRecordDao.findOne(unionId);
......
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