|
|
@@ -132,10 +132,10 @@ public class WxServiceImpl implements WxService {
|
|
|
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
@Override
|
|
|
- public Result balanceOrder(Long userId, Long parentId, Integer orderType, Long addressId) {
|
|
|
+ public Result balanceOrder(Long userId, Long parentId, Integer orderType, Long addressId, Long activityId) {
|
|
|
reentrantReadWriteLock.writeLock().lock();
|
|
|
try{
|
|
|
- return balanceOrders(userId,parentId,orderType,addressId);
|
|
|
+ return balanceOrders(userId, parentId, orderType, addressId, activityId);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
log.error("下单异常:"+e.getMessage(),e);
|
|
|
@@ -151,12 +151,13 @@ public class WxServiceImpl implements WxService {
|
|
|
* @param parentId
|
|
|
* @param orderType
|
|
|
* @param addressId
|
|
|
+ * @param activityId 活动id
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public Result balanceOrders(Long userId, Long parentId, Integer orderType, Long addressId){
|
|
|
+ public Result balanceOrders(Long userId, Long parentId, Integer orderType, Long addressId, Long activityId){
|
|
|
// 获取订单信息
|
|
|
- TbOrder tbOrder = appOrderService.prepareOrder(userId, parentId, orderType, addressId);
|
|
|
+ TbOrder tbOrder = appOrderService.prepareOrder(userId, parentId, orderType, addressId, activityId);
|
|
|
|
|
|
// 扣除用户余额
|
|
|
BigDecimal payMoney = tbOrder.getPayMoney();
|
|
|
@@ -259,10 +260,11 @@ public class WxServiceImpl implements WxService {
|
|
|
* @param type 支付方式
|
|
|
* @param addressId 用户地址id
|
|
|
* @param orderType 订单类型 1到店、2外卖
|
|
|
+ * @param activityId 活动id
|
|
|
*/
|
|
|
@Override
|
|
|
- public Result payOrder(Long userId, Long parentId, Integer type, Long addressId, Integer orderType) throws Exception {
|
|
|
- TbOrder tbOrder = appOrderService.prepareOrder(userId, parentId, orderType, addressId);
|
|
|
+ public Result payOrder(Long userId, Long parentId, Integer type, Long addressId, Integer orderType, Long activityId) throws Exception {
|
|
|
+ TbOrder tbOrder = appOrderService.prepareOrder(userId, parentId, orderType, addressId, activityId);
|
|
|
|
|
|
// 设置支付方式 1表示微信支付、4或5表示支付宝支付
|
|
|
tbOrder.setPayType(1);
|