diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java index 8977e0a3..480c4718 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java @@ -272,6 +272,7 @@ public class HighCouponController { coupon.setDiscountPrice(highCoupon.getDiscountPrice()); coupon.setIsPresent(highCoupon.getIsPresent()); coupon.setBuyPoints(highCoupon.getBuyPoints()); + coupon.setWherePost(highCoupon.getWherePost()); coupon.setOperatorId(userInfoModel.getSecUser().getId()); coupon.setGoodsTypeId(highCoupon.getGoodsTypeId()); coupon.setBrandId(highCoupon.getBrandId()); diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java index b8ea8365..c0d7a89f 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java @@ -145,7 +145,6 @@ public class HighOrderController { // 定义当前卡券是否可以直冲积分 boolean buyPoints = false; - BigDecimal totalPrice = new BigDecimal("0"); BigDecimal totalActualPrice = new BigDecimal("0"); for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) { @@ -162,6 +161,19 @@ public class HighOrderController { } // 查询卡卷信息 HighCoupon coupon = highCouponService.getCouponById(childOrder.getGoodsId()); + + + // 判断是否实物商品 + if (coupon.getWherePost() != null && coupon.getWherePost()) { + if (highOrder.getPostData().getString("address").length() == 0 || highOrder.getPostData().getString("user").length() == 0 || highOrder.getPostData().getString("phone").length() == 0 ) { + log.error("HighOrderController --> addOrder() error!", "请输入收货相关信息"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入收货相关信息"); + } + // 先把String对象转换成Json对象 + highOrder.setRemarks(highOrder.getPostData().toString()); + + } + if (coupon == null) { log.error("HighOrderController --> addOrder() error!", "未找到卡卷信息"); throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_COUPON, ""); diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java index 322a4b6c..b16eb3b1 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java @@ -142,6 +142,7 @@ public interface HighOrderMapperExt { " (select mer.merchant_name from high_merchant mer where EXISTS (select 1 from high_coupon cou where cou.id = a.goods_id and mer.id = cou.merchant_id)) merchantName," + " case a.goods_type when 1 then '卡券' when 2 then '金币充值' when 3 then '加油缴费' end goodsType, " + " a.goods_name goodsName, " + + " b.id orderId, " + " a.goods_type goodsTypeId," + " case a.giveaway_type when 1 then '赠送' when 0 then '购买' end giveawayType," + " b.order_no orderNo," + diff --git a/hai-service/src/main/java/com/hai/entity/HighCoupon.java b/hai-service/src/main/java/com/hai/entity/HighCoupon.java index 41e00dc2..17d60233 100644 --- a/hai-service/src/main/java/com/hai/entity/HighCoupon.java +++ b/hai-service/src/main/java/com/hai/entity/HighCoupon.java @@ -1,5 +1,7 @@ package com.hai.entity; +import com.hai.model.HighCouponModel; + import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; @@ -13,7 +15,7 @@ import java.util.Date; * 代码由工具生成 * **/ -public class HighCoupon implements Serializable { +public class HighCoupon extends HighCouponModel implements Serializable { /** * 主键 */ @@ -582,4 +584,4 @@ public class HighCoupon implements Serializable { sb.append("]"); return sb.toString(); } -} \ No newline at end of file +} diff --git a/hai-service/src/main/java/com/hai/entity/HighOrder.java b/hai-service/src/main/java/com/hai/entity/HighOrder.java index 9be617a3..600c70d3 100644 --- a/hai-service/src/main/java/com/hai/entity/HighOrder.java +++ b/hai-service/src/main/java/com/hai/entity/HighOrder.java @@ -1,5 +1,7 @@ package com.hai.entity; +import com.alibaba.fastjson.JSONObject; + import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; @@ -252,6 +254,16 @@ public class HighOrder implements Serializable { private String agentName; + private JSONObject postData; + + public JSONObject getPostData() { + return postData; + } + + public void setPostData(JSONObject postData) { + this.postData = postData; + } + public String getAgentName() { return agentName; }