new-dev
胡锐 1 year ago
parent aa18ef7b26
commit a655e83336
  1. 2
      hai-cweb/src/main/java/com/cweb/controller/HighUserCardController.java
  2. 6
      hai-order/src/main/java/com/web/controller/OrderController.java
  3. 7
      hai-service/src/main/java/com/hai/order/service/OrderCreateHandleService.java
  4. 35
      hai-service/src/main/java/com/hai/order/service/impl/OrderCreateHandleServiceImpl.java
  5. 6
      hai-service/src/main/java/com/hai/order/service/impl/OrderPaySuccessServiceImpl.java
  6. 6
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  7. 2
      hai-service/src/main/java/com/hai/service/impl/HighOilCardServiceImpl.java
  8. 2
      hai-service/src/main/java/com/hai/service/impl/HighUserCardServiceImpl.java

@ -372,7 +372,7 @@ public class HighUserCardController {
}
@RequestMapping(value = "/applyOilCard", method = RequestMethod.GET)
@RequestMapping(value = "/applyOilCard", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "申请个人加油卡")
public ResponseData applyOilCard(HttpServletRequest request) {

@ -149,10 +149,10 @@ public class OrderController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请选择收货地址!");
}
} else if (childModel.getGoodsType().equals(OrderChildGoodsType.TYPE14.getNumber())) {
if (childModel.getGoodsSpecName() == null) {
} else if (childModel.getGoodsType().equals(OrderChildGoodsType.TYPE15.getNumber())) {
if (childModel.getGoodsPrice() == null) {
log.error("OrderController -> create() error!","");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入卡号");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请选择规格!");
}
}

@ -119,4 +119,11 @@ public interface OrderCreateHandleService {
*/
HighChildOrder levelUp(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception;
/**
* 加油卡
* @param order
* @param createOrderChildModel
* @return
*/
HighChildOrder oilCard(HighOrder order , CreateOrderChildModel createOrderChildModel);
}

@ -153,6 +153,9 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
@Resource
private HighOilCardOrderService highOilCardOrderService;
@Resource
private HighOilCardService oilCardService;
@Override
public List<HighChildOrder> couponHandle(HighDiscountUserRel discountUserRel, CreateOrderChildModel createOrderChild) throws Exception {
if (createOrderChild.getSaleCount() != 1) {
@ -1137,4 +1140,36 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
return childOrder;
}
@Override
public HighChildOrder oilCard(HighOrder order, CreateOrderChildModel createOrderChildModel) {
// 查询油卡
HighOilCard card = oilCardService.getOilCardByCardNo(createOrderChildModel.getGoodsId().toString());
if (card == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油卡");
}
HighChildOrder childOrder = new HighChildOrder();
childOrder.setOrderNo(order.getOrderNo());
childOrder.setMemId(order.getMemId());
childOrder.setMemName(order.getMemName());
childOrder.setMemPhone(order.getMemPhone());
childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo());
childOrder.setGoodsType(OrderChildGoodsType.TYPE15.getNumber());
childOrder.setGoodsId(card.getId());
childOrder.setGoodsName("油卡充值");
childOrder.setGoodsSpecName(card.getCardNo());
childOrder.setGoodsPrice(createOrderChildModel.getGoodsPrice());
childOrder.setGoodsActualPrice(childOrder.getGoodsPrice());
childOrder.setSaleCount(createOrderChildModel.getSaleCount());
childOrder.setGiveawayType(false);
childOrder.setChildOrderStatus(OrderChildStatus.STATUS1.getNumber());
childOrder.setTotalPrice(childOrder.getGoodsPrice());
childOrder.setTotalActualPrice(childOrder.getGoodsPrice());
childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice()));
childOrder.setPraiseStatus(0);
childOrder.setCreateTime(new Date());
return childOrder;
}
}

@ -620,12 +620,10 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
}
<<<<<<< HEAD
private void oilCardHandle(String cardNo, HighOrder order) {
oilCardService.recharge(cardNo, order.getOrderNo());
}
=======
private void levelUp(HighOrder order) {
HighUserLevel userLevel = new HighUserLevel();
@ -646,6 +644,4 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
}
}
>>>>>>> 7fcdfd2e6935a820db8abb66831c9c85be5d9aae
}

@ -363,6 +363,12 @@ public class OrderServiceImpl implements OrderService {
order.setProductType(OrderProductType.PRODUCT_TYPE15.getNumber());
order.setSecUserId(childOrder.getId());
order.setTitle("升级会员");
} else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE15.getNumber())) {
HighChildOrder childOrder = orderCreateHandleService.oilCard(order , child);
childOrderList.add(childOrder);
order.setProductType(OrderProductType.PRODUCT_TYPE16.getNumber());
order.setTitle("油卡充值");
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知业务类型");
}

@ -107,6 +107,8 @@ public class HighOilCardServiceImpl implements HighOilCardService {
oilCard.setBindStatus(OilCardBindStatusEnum.status1.getStatus());
oilCard.setBindTime(new Date());
oilCard.setGetType(OilCardGetTypeEnum.type2.getCode());
oilCard.setContactName(user.getName());
oilCard.setContactPhone(user.getPhone());
editData(oilCard);
// 绑定用户

@ -65,7 +65,7 @@ public class HighUserCardServiceImpl implements HighUserCardService {
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
@Transactional(propagation= Propagation.REQUIRED)
public void bindCard(Integer type, String cardNo,Long userId) {
HighUserCard userCard = new HighUserCard();
userCard.setType(type);

Loading…
Cancel
Save