完成用户提交预约订单

dev-discount
胡锐 3 years ago
parent b9a995aa40
commit 61b203c4ca
  1. 16
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  2. 133
      hai-cweb/src/main/java/com/cweb/controller/HighOrderPreController.java
  3. 26
      hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java
  4. 17
      hai-service/src/main/java/com/hai/dao/HighCouponMapper.java
  5. 14
      hai-service/src/main/java/com/hai/dao/HighCouponSqlProvider.java
  6. 18
      hai-service/src/main/java/com/hai/entity/HighCoupon.java
  7. 60
      hai-service/src/main/java/com/hai/entity/HighCouponExample.java
  8. 2
      hai-service/src/main/java/com/hai/service/HighOrderPreService.java
  9. 20
      hai-service/src/main/java/com/hai/service/impl/HighOrderPreServiceImpl.java
  10. 48
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  11. 24
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java

@ -121,6 +121,22 @@ public class HighOrderController {
log.error("HighOrderController --> addOrder() error!", "未找到卡卷信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, "");
}
if (coupon.getReserveStatus() == true) {
if (childOrder.getStoreId() == null) {
log.error("HighOrderController --> addOrder() error!", "未选择门店");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未选择门店");
}
// 查询门店信息
HighMerchantStoreModel merchantStore = highMerchantStoreService.getMerchantStoreById(childOrder.getStoreId());
if (merchantStore == null) {
log.error("HighOrderController --> addOrder() error!", "未选择门店");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到门店信息");
}
if (!merchantStore.getMerchantId().equals(coupon.getMerchantId())) {
log.error("HighOrderController --> addOrder() error!", "卡券无法在此门店消费");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "卡券无法在此门店消费");
}
}
// 支付类型:1.微信支付 2.金币支付
if(coupon.getPayType() == 2) {
highOrder.setPayModel(1); // 支付模式:1 金币,2 第三方平台,3 混合

@ -0,0 +1,133 @@
package com.cweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.DateUtil;
import com.hai.common.utils.IDGenerator;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.config.TuanYouConfig;
import com.hai.entity.*;
import com.hai.model.HighMerchantStoreModel;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DeadlockLoserDataAccessException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Auther: 胡锐
* @Description:
* @Date: 2021/3/26 23:08
*/
@Controller
@RequestMapping(value = "/orderPre")
@Api(value = "预约订单接口")
public class HighOrderPreController {
private static Logger log = LoggerFactory.getLogger(HighOrderPreController.class);
@Autowired
private UserCenter userCenter;
@Resource
private HighOrderPreService highOrderPreService;
@RequestMapping(value = "/getUserOrderPreList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取用户预约订单")
public ResponseData getUserOrderPreList(@RequestParam(name = "status", required = false) Integer status,
@RequestParam(name = "orderNo", required = false) String orderNo,
@RequestParam(name = "orderPreNo", required = false) String preOrderNo,
@RequestParam(name = "goodsName", required = false) String goodsName,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize,
HttpServletRequest request) {
try {
// 用户
SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
Map<String,Object> map = new HashMap<>();
map.put("preUserId", userInfoModel.getHighUser().getId());
map.put("status", status);
map.put("orderNo", orderNo);
map.put("preOrderNo", preOrderNo);
map.put("goodsName", goodsName);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highOrderPreService.getListOrderPre(map)));
} catch (Exception e) {
log.error("HighOrderController --> getUserPreOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getOrderPreById", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id查询预约订单详情")
public ResponseData getOrderPreById(@RequestParam(name = "orderPreId", required = true) Long orderPreId) {
try {
return ResponseMsgUtil.success(highOrderPreService.findByOrderId(orderPreId));
} catch (Exception e) {
log.error("HighOrderController --> getOrderById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/orderComplete", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "订单完成")
public ResponseData orderComplete(@RequestBody JSONObject body) {
try {
if (body == null || body.getLong("preOrderId") == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 查询预约订单详情
HighOrderPre orderPre = highOrderPreService.findByOrderId(body.getLong("preOrderId"));
if (orderPre == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到预约订单");
}
if (orderPre.getStatus() != 2) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, "");
}
orderPre.setStatus(3);
orderPre.setUpdateTime(new Date());
highOrderPreService.updateOrderPre(orderPre);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighOrderController --> orderComplete() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -45,6 +45,9 @@ public class UnionPayController {
@Resource
private HighOrderService highOrderService;
@Resource
private HighOrderPreService highOrderPreService;
@Resource
private HighGasOrderPushMapper highGasOrderPushMapper;
@ -134,6 +137,29 @@ public class UnionPayController {
highChildOrder.setChildOrdeStatus(2); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
HighCoupon coupon = highCouponService.getCouponById(highChildOrder.getGoodsId());
// 是否预约
if (coupon.getReserveStatus() == true) {
HighOrderPre orderPre = new HighOrderPre();
orderPre.setCompanyId(coupon.getCompanyId());
orderPre.setMerchantId(coupon.getMerchantId());
orderPre.setMerchantStoreId(highChildOrder.getStoreId());
orderPre.setPreOrderNo(System.currentTimeMillis()+"");
orderPre.setOrderId(order.getId());
orderPre.setOrderNo(order.getOrderNo());
orderPre.setChildOrderId(highChildOrder.getId());
orderPre.setPayRealPrice(order.getPayRealPrice());
orderPre.setGoodsType(1);
orderPre.setGoodsName(coupon.getCouponName());
orderPre.setGoodsId(coupon.getId());
orderPre.setPreUserId(order.getMemId());
orderPre.setPreUserName(order.getMemName());
orderPre.setPreUserPhone(order.getMemPhone());
orderPre.setPreUserRemark(order.getRemarks());
orderPre.setStatus(1);
highOrderPreService.insertOrderPre(orderPre);
}
// 贵州中石化
if (coupon.getCouponSource() == 4) {
// 获取token

@ -52,7 +52,8 @@ public interface HighCouponMapper extends HighCouponMapperExt {
"pay_type, ext_1, ext_2, ",
"ext_3, `status`, display_area, ",
"coupon_source, distributor, ",
"goods_type_id, brand_id)",
"goods_type_id, brand_id, ",
"reserve_status)",
"values (#{companyId,jdbcType=BIGINT}, #{merchantId,jdbcType=BIGINT}, ",
"#{couponKey,jdbcType=VARCHAR}, #{couponName,jdbcType=VARCHAR}, ",
"#{couponPrice,jdbcType=DECIMAL}, #{couponImg,jdbcType=VARCHAR}, ",
@ -66,7 +67,8 @@ public interface HighCouponMapper extends HighCouponMapperExt {
"#{payType,jdbcType=INTEGER}, #{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, ",
"#{ext3,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{displayArea,jdbcType=INTEGER}, ",
"#{couponSource,jdbcType=INTEGER}, #{distributor,jdbcType=INTEGER}, ",
"#{goodsTypeId,jdbcType=INTEGER}, #{brandId,jdbcType=INTEGER})"
"#{goodsTypeId,jdbcType=INTEGER}, #{brandId,jdbcType=INTEGER}, ",
"#{reserveStatus,jdbcType=BIT})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(HighCoupon record);
@ -107,7 +109,8 @@ public interface HighCouponMapper extends HighCouponMapperExt {
@Result(column="coupon_source", property="couponSource", jdbcType=JdbcType.INTEGER),
@Result(column="distributor", property="distributor", jdbcType=JdbcType.INTEGER),
@Result(column="goods_type_id", property="goodsTypeId", jdbcType=JdbcType.INTEGER),
@Result(column="brand_id", property="brandId", jdbcType=JdbcType.INTEGER)
@Result(column="brand_id", property="brandId", jdbcType=JdbcType.INTEGER),
@Result(column="reserve_status", property="reserveStatus", jdbcType=JdbcType.BIT)
})
List<HighCoupon> selectByExample(HighCouponExample example);
@ -117,7 +120,7 @@ public interface HighCouponMapper extends HighCouponMapperExt {
"coupon_carousel_img, coupon_desc, coupon_type, sales_end_time, recycle_day, ",
"limit_number, sales_price, discount_price, sales_count, is_present, create_time, ",
"update_time, operator_id, operator_name, pay_type, ext_1, ext_2, ext_3, `status`, ",
"display_area, coupon_source, distributor, goods_type_id, brand_id",
"display_area, coupon_source, distributor, goods_type_id, brand_id, reserve_status",
"from high_coupon",
"where id = #{id,jdbcType=BIGINT}"
})
@ -152,7 +155,8 @@ public interface HighCouponMapper extends HighCouponMapperExt {
@Result(column="coupon_source", property="couponSource", jdbcType=JdbcType.INTEGER),
@Result(column="distributor", property="distributor", jdbcType=JdbcType.INTEGER),
@Result(column="goods_type_id", property="goodsTypeId", jdbcType=JdbcType.INTEGER),
@Result(column="brand_id", property="brandId", jdbcType=JdbcType.INTEGER)
@Result(column="brand_id", property="brandId", jdbcType=JdbcType.INTEGER),
@Result(column="reserve_status", property="reserveStatus", jdbcType=JdbcType.BIT)
})
HighCoupon selectByPrimaryKey(Long id);
@ -196,7 +200,8 @@ public interface HighCouponMapper extends HighCouponMapperExt {
"coupon_source = #{couponSource,jdbcType=INTEGER},",
"distributor = #{distributor,jdbcType=INTEGER},",
"goods_type_id = #{goodsTypeId,jdbcType=INTEGER},",
"brand_id = #{brandId,jdbcType=INTEGER}",
"brand_id = #{brandId,jdbcType=INTEGER},",
"reserve_status = #{reserveStatus,jdbcType=BIT}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(HighCoupon record);

@ -148,6 +148,10 @@ public class HighCouponSqlProvider {
sql.VALUES("brand_id", "#{brandId,jdbcType=INTEGER}");
}
if (record.getReserveStatus() != null) {
sql.VALUES("reserve_status", "#{reserveStatus,jdbcType=BIT}");
}
return sql.toString();
}
@ -188,6 +192,7 @@ public class HighCouponSqlProvider {
sql.SELECT("distributor");
sql.SELECT("goods_type_id");
sql.SELECT("brand_id");
sql.SELECT("reserve_status");
sql.FROM("high_coupon");
applyWhere(sql, example, false);
@ -329,6 +334,10 @@ public class HighCouponSqlProvider {
sql.SET("brand_id = #{record.brandId,jdbcType=INTEGER}");
}
if (record.getReserveStatus() != null) {
sql.SET("reserve_status = #{record.reserveStatus,jdbcType=BIT}");
}
applyWhere(sql, example, true);
return sql.toString();
}
@ -368,6 +377,7 @@ public class HighCouponSqlProvider {
sql.SET("distributor = #{record.distributor,jdbcType=INTEGER}");
sql.SET("goods_type_id = #{record.goodsTypeId,jdbcType=INTEGER}");
sql.SET("brand_id = #{record.brandId,jdbcType=INTEGER}");
sql.SET("reserve_status = #{record.reserveStatus,jdbcType=BIT}");
HighCouponExample example = (HighCouponExample) parameter.get("example");
applyWhere(sql, example, true);
@ -498,6 +508,10 @@ public class HighCouponSqlProvider {
sql.SET("brand_id = #{brandId,jdbcType=INTEGER}");
}
if (record.getReserveStatus() != null) {
sql.SET("reserve_status = #{reserveStatus,jdbcType=BIT}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();

@ -162,6 +162,11 @@ public class HighCoupon extends HighCouponModel implements Serializable {
*/
private Integer brandId;
/**
* 是否预约产品 0 1
*/
private Boolean reserveStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -412,6 +417,14 @@ public class HighCoupon extends HighCouponModel implements Serializable {
this.brandId = brandId;
}
public Boolean getReserveStatus() {
return reserveStatus;
}
public void setReserveStatus(Boolean reserveStatus) {
this.reserveStatus = reserveStatus;
}
@Override
public boolean equals(Object that) {
if (this == that) {
@ -454,7 +467,8 @@ public class HighCoupon extends HighCouponModel implements Serializable {
&& (this.getCouponSource() == null ? other.getCouponSource() == null : this.getCouponSource().equals(other.getCouponSource()))
&& (this.getDistributor() == null ? other.getDistributor() == null : this.getDistributor().equals(other.getDistributor()))
&& (this.getGoodsTypeId() == null ? other.getGoodsTypeId() == null : this.getGoodsTypeId().equals(other.getGoodsTypeId()))
&& (this.getBrandId() == null ? other.getBrandId() == null : this.getBrandId().equals(other.getBrandId()));
&& (this.getBrandId() == null ? other.getBrandId() == null : this.getBrandId().equals(other.getBrandId()))
&& (this.getReserveStatus() == null ? other.getReserveStatus() == null : this.getReserveStatus().equals(other.getReserveStatus()));
}
@Override
@ -492,6 +506,7 @@ public class HighCoupon extends HighCouponModel implements Serializable {
result = prime * result + ((getDistributor() == null) ? 0 : getDistributor().hashCode());
result = prime * result + ((getGoodsTypeId() == null) ? 0 : getGoodsTypeId().hashCode());
result = prime * result + ((getBrandId() == null) ? 0 : getBrandId().hashCode());
result = prime * result + ((getReserveStatus() == null) ? 0 : getReserveStatus().hashCode());
return result;
}
@ -532,6 +547,7 @@ public class HighCoupon extends HighCouponModel implements Serializable {
sb.append(", distributor=").append(distributor);
sb.append(", goodsTypeId=").append(goodsTypeId);
sb.append(", brandId=").append(brandId);
sb.append(", reserveStatus=").append(reserveStatus);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

@ -2075,6 +2075,66 @@ public class HighCouponExample {
addCriterion("brand_id not between", value1, value2, "brandId");
return (Criteria) this;
}
public Criteria andReserveStatusIsNull() {
addCriterion("reserve_status is null");
return (Criteria) this;
}
public Criteria andReserveStatusIsNotNull() {
addCriterion("reserve_status is not null");
return (Criteria) this;
}
public Criteria andReserveStatusEqualTo(Boolean value) {
addCriterion("reserve_status =", value, "reserveStatus");
return (Criteria) this;
}
public Criteria andReserveStatusNotEqualTo(Boolean value) {
addCriterion("reserve_status <>", value, "reserveStatus");
return (Criteria) this;
}
public Criteria andReserveStatusGreaterThan(Boolean value) {
addCriterion("reserve_status >", value, "reserveStatus");
return (Criteria) this;
}
public Criteria andReserveStatusGreaterThanOrEqualTo(Boolean value) {
addCriterion("reserve_status >=", value, "reserveStatus");
return (Criteria) this;
}
public Criteria andReserveStatusLessThan(Boolean value) {
addCriterion("reserve_status <", value, "reserveStatus");
return (Criteria) this;
}
public Criteria andReserveStatusLessThanOrEqualTo(Boolean value) {
addCriterion("reserve_status <=", value, "reserveStatus");
return (Criteria) this;
}
public Criteria andReserveStatusIn(List<Boolean> values) {
addCriterion("reserve_status in", values, "reserveStatus");
return (Criteria) this;
}
public Criteria andReserveStatusNotIn(List<Boolean> values) {
addCriterion("reserve_status not in", values, "reserveStatus");
return (Criteria) this;
}
public Criteria andReserveStatusBetween(Boolean value1, Boolean value2) {
addCriterion("reserve_status between", value1, value2, "reserveStatus");
return (Criteria) this;
}
public Criteria andReserveStatusNotBetween(Boolean value1, Boolean value2) {
addCriterion("reserve_status not between", value1, value2, "reserveStatus");
return (Criteria) this;
}
}
/**

@ -13,7 +13,7 @@ public interface HighOrderPreService {
* @Param [map]
* @return java.util.List<com.hai.entity.HighOrderPre>
**/
List<HighOrderPre> getListOrderPre(Map<String , String> map);
List<HighOrderPre> getListOrderPre(Map<String , Object> map);
/**
* @Author Sum1Dream

@ -11,6 +11,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -21,10 +22,14 @@ public class HighOrderPreServiceImpl implements HighOrderPreService {
private HighOrderPreMapper highOrderPreMapper;
@Override
public List<HighOrderPre> getListOrderPre(Map<String, String> map) {
public List<HighOrderPre> getListOrderPre(Map<String, Object> map) {
HighOrderPreExample example = new HighOrderPreExample();
HighOrderPreExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "preUserId") != null) {
criteria.andPreUserIdEqualTo(MapUtils.getLong(map, "preUserId"));
}
if (MapUtils.getInteger(map, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map, "status"));
}
@ -37,6 +42,10 @@ public class HighOrderPreServiceImpl implements HighOrderPreService {
criteria.andOrderNoLike("%" + MapUtils.getString(map, "orderNo") + "%");
}
if (MapUtils.getString(map, "preOrderNo") != null) {
criteria.andPreOrderNoLike("%" + MapUtils.getString(map, "preOrderNo") + "%");
}
if (MapUtils.getString(map, "goodsName") != null) {
criteria.andGoodsNameLike("%" + MapUtils.getString(map, "goodsName") + "%");
}
@ -45,10 +54,11 @@ public class HighOrderPreServiceImpl implements HighOrderPreService {
criteria.andPreUserPhoneEqualTo(MapUtils.getString(map, "userPhone"));
}
if (StringUtils.isNotBlank(map.get("createTimeS")) && StringUtils.isNotBlank(map.get("createTimeE"))) {
if (StringUtils.isNotBlank(MapUtils.getString(map,"createTimeS"))
&& StringUtils.isNotBlank(MapUtils.getString(map,"createTimeE"))) {
criteria.andCreateTimeBetween(
DateUtil.format(map.get("createTimeS") , "yyyy-MM-dd HH:mm:ss") ,
DateUtil.format(map.get("createTimeE") , "yyyy-MM-dd HH:mm:ss"));
DateUtil.format(MapUtils.getString(map,"createTimeS") , "yyyy-MM-dd HH:mm:ss") ,
DateUtil.format(MapUtils.getString(map,"createTimeE") , "yyyy-MM-dd HH:mm:ss"));
}
return highOrderPreMapper.selectByExample(example);
}
@ -65,6 +75,8 @@ public class HighOrderPreServiceImpl implements HighOrderPreService {
@Override
public void insertOrderPre(HighOrderPre highOrderPre) {
highOrderPre.setCreateTime(new Date());
highOrderPre.setUpdateTime(new Date());
highOrderPreMapper.insert(highOrderPre);
}

@ -80,6 +80,9 @@ public class HighOrderServiceImpl implements HighOrderService {
@Resource
private HighOrderService highOrderService;
@Resource
private HighOrderPreService highOrderPreService;
@Resource
private HighActivityInfoService highActivityInfoService;
@ -199,6 +202,28 @@ public class HighOrderServiceImpl implements HighOrderService {
if (highChildOrder.getGoodsType() == 1) {
// 查询卡券
HighCoupon coupon = highCouponService.getCouponDetail(highChildOrder.getGoodsId());
// 是否预约
if (coupon.getReserveStatus() == true) {
HighOrderPre orderPre = new HighOrderPre();
orderPre.setCompanyId(coupon.getCompanyId());
orderPre.setMerchantId(coupon.getMerchantId());
orderPre.setMerchantStoreId(highChildOrder.getStoreId());
orderPre.setPreOrderNo(System.currentTimeMillis()+"");
orderPre.setOrderId(highOrder.getId());
orderPre.setOrderNo(highOrder.getOrderNo());
orderPre.setChildOrderId(highChildOrder.getId());
orderPre.setPayRealPrice(highOrder.getPayRealPrice());
orderPre.setGoodsType(1);
orderPre.setGoodsName(coupon.getCouponName());
orderPre.setGoodsId(coupon.getId());
orderPre.setPreUserId(highOrder.getMemId());
orderPre.setPreUserName(highOrder.getMemName());
orderPre.setPreUserPhone(highOrder.getMemPhone());
orderPre.setPreUserRemark(highOrder.getRemarks());
orderPre.setStatus(1);
highOrderPreService.insertOrderPre(orderPre);
}
// 贵州高速
if (coupon.getCouponSource() == 4) {
// 获取token
@ -392,6 +417,29 @@ public class HighOrderServiceImpl implements HighOrderService {
highChildOrder.setChildOrdeStatus(2); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
HighCoupon coupon = highCouponService.getCouponById(highChildOrder.getGoodsId());
// 是否预约
if (coupon.getReserveStatus() == true) {
HighOrderPre orderPre = new HighOrderPre();
orderPre.setCompanyId(coupon.getCompanyId());
orderPre.setMerchantId(coupon.getMerchantId());
orderPre.setMerchantStoreId(highChildOrder.getStoreId());
orderPre.setPreOrderNo(System.currentTimeMillis()+"");
orderPre.setOrderId(order.getId());
orderPre.setOrderNo(order.getOrderNo());
orderPre.setChildOrderId(highChildOrder.getId());
orderPre.setPayRealPrice(order.getPayRealPrice());
orderPre.setGoodsType(1);
orderPre.setGoodsName(coupon.getCouponName());
orderPre.setGoodsId(coupon.getId());
orderPre.setPreUserId(order.getMemId());
orderPre.setPreUserName(order.getMemName());
orderPre.setPreUserPhone(order.getMemPhone());
orderPre.setPreUserRemark(order.getRemarks());
orderPre.setStatus(1);
highOrderPreService.insertOrderPre(orderPre);
}
// 贵州中石化
if (coupon.getCouponSource() == 4) {
// 获取token

@ -59,6 +59,9 @@ public class GoodsOrderServiceImpl implements PayService {
@Resource
private HighOrderService highOrderService;
@Resource
private HighOrderPreService highOrderPreService;
@Resource
private HighGasOrderPushMapper highGasOrderPushMapper;
@ -126,6 +129,27 @@ public class GoodsOrderServiceImpl implements PayService {
highChildOrder.setChildOrdeStatus(2); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
HighCoupon coupon = highCouponService.getCouponById(highChildOrder.getGoodsId());
// 是否预约
if (coupon.getReserveStatus() == true) {
HighOrderPre orderPre = new HighOrderPre();
orderPre.setCompanyId(coupon.getCompanyId());
orderPre.setMerchantId(coupon.getMerchantId());
orderPre.setMerchantStoreId(highChildOrder.getStoreId());
orderPre.setPreOrderNo(System.currentTimeMillis()+"");
orderPre.setOrderId(order.getId());
orderPre.setOrderNo(order.getOrderNo());
orderPre.setChildOrderId(highChildOrder.getId());
orderPre.setPayRealPrice(order.getPayRealPrice());
orderPre.setGoodsType(1);
orderPre.setGoodsName(coupon.getCouponName());
orderPre.setGoodsId(coupon.getId());
orderPre.setPreUserId(order.getMemId());
orderPre.setPreUserName(order.getMemName());
orderPre.setPreUserPhone(order.getMemPhone());
orderPre.setPreUserRemark(order.getRemarks());
orderPre.setStatus(1);
highOrderPreService.insertOrderPre(orderPre);
}
// 贵州中石化
if (coupon.getCouponSource() == 4) {
// 获取token

Loading…
Cancel
Save