dev-discount
胡锐 2 years ago
parent bdb342aefa
commit c87c53f85a
  1. 2
      hai-cweb/src/main/java/com/cweb/controller/HighTestController.java
  2. 8
      hai-cweb/src/main/java/com/cweb/msg/OrderCreateConsumer.java
  3. 13
      hai-service/src/main/java/com/hai/order/model/CreateOrderChildModel.java
  4. 23
      hai-service/src/main/java/com/hai/order/model/CreateOrderModel.java
  5. 4
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

File diff suppressed because one or more lines are too long

@ -1,6 +1,9 @@
package com.cweb.msg; package com.cweb.msg;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.utils.DateUtil; import com.hai.common.utils.DateUtil;
import com.hai.entity.HighOrder; import com.hai.entity.HighOrder;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -26,9 +29,10 @@ public class OrderCreateConsumer implements RocketMQListener<HighOrder> {
@Override @Override
public void onMessage(HighOrder order) { public void onMessage(HighOrder order) {
try { try {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户");
/* System.out.println(JSONObject.toJSONString(order));*/ /* System.out.println(JSONObject.toJSONString(order));*/
System.out.println(DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + " 创建订单:" + order.getOrderNo()); // System.out.println(DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + " 创建订单:" + order.getOrderNo());
/* org.springframework.messaging.Message message = MessageBuilder.withPayload(order).build(); /* org.springframework.messaging.Message message = MessageBuilder.withPayload(order).build();

@ -0,0 +1,13 @@
package com.hai.order.model;
/**
* 创建子订单参数模型
* @className: CreateOrderModel
* @author: HuRui
* @date: 2022/8/16
**/
public class CreateOrderChildModel {
}

@ -0,0 +1,23 @@
package com.hai.order.model;
import java.util.List;
/**
* 创建订单参数模型
* @className: CreateOrderModel
* @author: HuRui
* @date: 2022/8/16
**/
public class CreateOrderModel {
/**
* 用户优惠券关系id
*/
private Long memDiscountId;
/**
* 子订单参数模型
*/
private List<CreateOrderChildModel> childModelList;
}

@ -175,7 +175,7 @@ public class HighOrderServiceImpl implements HighOrderService {
public void insertOrder(HighOrder highOrder) throws Exception { public void insertOrder(HighOrder highOrder) throws Exception {
highOrderMapper.insert(highOrder); highOrderMapper.insert(highOrder);
/* // 使用优惠券 // 使用优惠券
if (highOrder.getMemDiscountId() != null) { if (highOrder.getMemDiscountId() != null) {
HighDiscountUserRel discountUserRel = highDiscountUserRelService.getRelById(highOrder.getMemDiscountId()); HighDiscountUserRel discountUserRel = highDiscountUserRelService.getRelById(highOrder.getMemDiscountId());
discountUserRel.setUseTime(new Date()); // 使用时间 discountUserRel.setUseTime(new Date()); // 使用时间
@ -354,7 +354,7 @@ public class HighOrderServiceImpl implements HighOrderService {
// 订单完成业务处理 // 订单完成业务处理
orderBusinessTransaction(highOrder); orderBusinessTransaction(highOrder);
} }
}*/ }
} }

Loading…
Cancel
Save