new-dev
胡锐 1 year ago committed by Sum1Dream
parent d5777d22e9
commit 79f5038139
  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. 1
      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 @ResponseBody
@ApiOperation(value = "申请个人加油卡") @ApiOperation(value = "申请个人加油卡")
public ResponseData applyOilCard(HttpServletRequest request) { public ResponseData applyOilCard(HttpServletRequest request) {

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

@ -119,6 +119,13 @@ public interface OrderCreateHandleService {
*/ */
HighChildOrder levelUp(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception; HighChildOrder levelUp(HighOrder order , CreateOrderChildModel createOrderChildModel) throws Exception;
/**
* 加油卡
* @param order
* @param createOrderChildModel
* @return
*/
HighChildOrder oilCard(HighOrder order , CreateOrderChildModel createOrderChildModel);
/** /**
* @Author Sum1Dream * @Author Sum1Dream
* @Name group * @Name group

@ -158,6 +158,9 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
@Resource @Resource
private HighOilCardOrderService highOilCardOrderService; private HighOilCardOrderService highOilCardOrderService;
@Resource
private HighOilCardService oilCardService;
@Resource @Resource
private GroupCodeService groupCodeService; private GroupCodeService groupCodeService;
@ -1146,6 +1149,38 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService {
return childOrder; 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;
}
@Override @Override
public HighChildOrder group(HighOrder order, CreateOrderChildModel createOrderChildModel) throws Exception { public HighChildOrder group(HighOrder order, CreateOrderChildModel createOrderChildModel) throws Exception {

@ -630,6 +630,7 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService {
private void oilCardHandle(String cardNo, HighOrder order) { private void oilCardHandle(String cardNo, HighOrder order) {
oilCardService.recharge(cardNo, order.getOrderNo()); oilCardService.recharge(cardNo, order.getOrderNo());
} }
private void levelUp(HighOrder order) { private void levelUp(HighOrder order) {
HighUserLevel userLevel = new HighUserLevel(); HighUserLevel userLevel = new HighUserLevel();

@ -363,6 +363,12 @@ public class OrderServiceImpl implements OrderService {
order.setProductType(OrderProductType.PRODUCT_TYPE15.getNumber()); order.setProductType(OrderProductType.PRODUCT_TYPE15.getNumber());
order.setSecUserId(childOrder.getId()); order.setSecUserId(childOrder.getId());
order.setTitle("升级会员"); 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 if (child.getGoodsType().equals(OrderChildGoodsType.TYPE17.getNumber())) { } else if (child.getGoodsType().equals(OrderChildGoodsType.TYPE17.getNumber())) {
HighChildOrder childOrder = orderCreateHandleService.group(order , child); HighChildOrder childOrder = orderCreateHandleService.group(order , child);
childOrderList.add(childOrder); childOrderList.add(childOrder);

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

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

Loading…
Cancel
Save