fix
This commit is contained in:
@@ -143,9 +143,13 @@ public class SysTenantEntity extends BaseEntity<SysTenantEntity> {
|
|||||||
*/
|
*/
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
|
||||||
|
// 充值成功通知模板id
|
||||||
private String czcgtzTemplateId;
|
private String czcgtzTemplateId;
|
||||||
|
// 下单通知模板id
|
||||||
private String xdcgtzTemplateId;
|
private String xdcgtzTemplateId;
|
||||||
|
// 收到新订单通知模板id
|
||||||
private String sdxddtzTemplateId;
|
private String sdxddtzTemplateId;
|
||||||
|
// 认证申请审核通知模板id
|
||||||
private String rzsqshtxTemplateId;
|
private String rzsqshtxTemplateId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ public class WxCustomController {
|
|||||||
}
|
}
|
||||||
String orderId = IdUtils.getUuid();
|
String orderId = IdUtils.getUuid();
|
||||||
// 记录订单信息
|
// 记录订单信息
|
||||||
playOrderInfoService.createOrderInfo(orderId, playOrderInfoService.getOrderNo(), "3", "2", "2", "0", "1", "", "0", BigDecimal.ZERO, "", "", "0", new BigDecimal(vo.getMoney()), new BigDecimal(vo.getMoney()), BigDecimal.ZERO, userId, vo.getClerkId(), vo.getWeiChatCode(), new ArrayList<>(),vo.getRemark());
|
playOrderInfoService.createOrderInfo(orderId, playOrderInfoService.getOrderNo(), "3", "2", "2", "0", "1", "", "0", BigDecimal.ZERO, "", "", "0", new BigDecimal(vo.getMoney()), new BigDecimal(vo.getMoney()), BigDecimal.ZERO, userId, vo.getClerkId(), vo.getWeiChatCode(), new ArrayList<>(), vo.getRemark());
|
||||||
//
|
//
|
||||||
// playOrderInfoService.createRewardOrder(orderId, new BigDecimal(vo.getMoney()), new BigDecimal(vo.getMoney()), userId, clerkUserInfo.getId(), vo.getRemark(), vo.getWeiChatCode());
|
// playOrderInfoService.createRewardOrder(orderId, new BigDecimal(vo.getMoney()), new BigDecimal(vo.getMoney()), userId, clerkUserInfo.getId(), vo.getRemark(), vo.getWeiChatCode());
|
||||||
// 顾客减少余额
|
// 顾客减少余额
|
||||||
@@ -241,7 +241,7 @@ public class WxCustomController {
|
|||||||
// 陪聊增加余额
|
// 陪聊增加余额
|
||||||
// clerkUserInfoService.updateAccountBalanceById(clerkUserInfo.getId(), clerkUserInfo.getAccountBalance(), clerkUserInfo.getAccountBalance().add(money), "2", "赠送礼物", money, orderId);
|
// clerkUserInfoService.updateAccountBalanceById(clerkUserInfo.getId(), clerkUserInfo.getAccountBalance(), clerkUserInfo.getAccountBalance().add(money), "2", "赠送礼物", money, orderId);
|
||||||
// 修改顾客和礼物消息
|
// 修改顾客和礼物消息
|
||||||
PlayCustomGiftInfoEntity customGiftInfoEntity = playCustomGiftInfoService.selectByGiftIdAndCustomId( vo.getGiftId(),userId);
|
PlayCustomGiftInfoEntity customGiftInfoEntity = playCustomGiftInfoService.selectByGiftIdAndCustomId(vo.getGiftId(), userId);
|
||||||
if (customGiftInfoEntity == null) {
|
if (customGiftInfoEntity == null) {
|
||||||
customGiftInfoEntity = new PlayCustomGiftInfoEntity();
|
customGiftInfoEntity = new PlayCustomGiftInfoEntity();
|
||||||
customGiftInfoEntity.setGiffId(vo.getGiftId());
|
customGiftInfoEntity.setGiffId(vo.getGiftId());
|
||||||
@@ -308,6 +308,7 @@ public class WxCustomController {
|
|||||||
customUserInfoService.updateAccountBalanceById(customUserInfo.getId(), customUserInfo.getAccountBalance(), customUserInfo.getAccountBalance().subtract(money), "1", "下单-指定单", money, BigDecimal.ZERO, orderId);
|
customUserInfoService.updateAccountBalanceById(customUserInfo.getId(), customUserInfo.getAccountBalance(), customUserInfo.getAccountBalance().subtract(money), "1", "下单-指定单", money, BigDecimal.ZERO, orderId);
|
||||||
//发送通知给店员
|
//发送通知给店员
|
||||||
wxCustomMpService.sendCreateOrderMessage(clerkUserInfo.getTenantId(), clerkUserInfo.getOpenid(), clerkUserInfo.getNickname(), orderNo, orderId, DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"), money.toString(), commodityInfo.getCommodityName());
|
wxCustomMpService.sendCreateOrderMessage(clerkUserInfo.getTenantId(), clerkUserInfo.getOpenid(), clerkUserInfo.getNickname(), orderNo, orderId, DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"), money.toString(), commodityInfo.getCommodityName());
|
||||||
|
wxCustomMpService.sendNewOrderMessageForClerk(clerkUserInfo, orderNo, commodityInfo.getCommodityName(), money);
|
||||||
return R.ok("成功");
|
return R.ok("成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -153,6 +154,7 @@ public class WxCustomMpService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过微信公众号发送消息
|
* 通过微信公众号发送消息
|
||||||
*
|
*
|
||||||
@@ -216,4 +218,31 @@ public class WxCustomMpService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 发送新订单通知给店员
|
||||||
|
public void sendNewOrderMessageForClerk(PlayClerkUserInfoEntity clerkUserInfo, String orderNo, String commodityName, BigDecimal money) {
|
||||||
|
String touser = clerkUserInfo.getOpenid();
|
||||||
|
SysTenantEntity tenant = tenantService.selectSysTenantByTenantId(clerkUserInfo.getTenantId());
|
||||||
|
String tenantKey = tenant.getTenantKey();
|
||||||
|
String url = "http://" + tenantKey + ".july.hucs.top/user/";
|
||||||
|
String template_id = tenant.getSdxddtzTemplateId();
|
||||||
|
|
||||||
|
WxMpTemplateMessage templateMessage = new WxMpTemplateMessage();
|
||||||
|
templateMessage.setTemplateId(template_id);
|
||||||
|
templateMessage.setToUser(touser);
|
||||||
|
templateMessage.setUrl(url);
|
||||||
|
List<WxMpTemplateData> data = new ArrayList<>();
|
||||||
|
data.add(new WxMpTemplateData("thing6", commodityName));
|
||||||
|
data.add(new WxMpTemplateData("time5", DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
|
||||||
|
data.add(new WxMpTemplateData("time7", DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")));
|
||||||
|
data.add(new WxMpTemplateData("character_string2", orderNo));
|
||||||
|
data.add(new WxMpTemplateData("amount8", money.toString()));
|
||||||
|
templateMessage.setData(data);
|
||||||
|
try {
|
||||||
|
proxyWxMpService().getTemplateMsgService().sendTemplateMsg(templateMessage);
|
||||||
|
} catch (WxErrorException e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user