|
|
|
@ -11,13 +11,12 @@ import com.hai.common.security.UserCenter; |
|
|
|
|
import com.hai.common.utils.DateUtil; |
|
|
|
|
import com.hai.common.utils.IDGenerator; |
|
|
|
|
import com.hai.config.*; |
|
|
|
|
import com.hai.dao.OutRechargeOrderMapper; |
|
|
|
|
import com.hai.entity.*; |
|
|
|
|
import com.hai.enum_type.GasClassGroupTaskStatus; |
|
|
|
|
import com.hai.enum_type.JinZhuJiaYouOilNo; |
|
|
|
|
import com.hai.enum_type.MerAccountMarketingType; |
|
|
|
|
import com.hai.enum_type.MerchantStoreSourceType; |
|
|
|
|
import com.hai.enum_type.*; |
|
|
|
|
import com.hai.model.GasPayPriceModel; |
|
|
|
|
import com.hai.model.HighMerchantModel; |
|
|
|
|
import com.hai.model.OutRechargePriceModel; |
|
|
|
|
import com.hai.model.ResponseData; |
|
|
|
|
import com.hai.order.model.CreateOrderChildModel; |
|
|
|
|
import com.hai.order.model.CreateOrderModel; |
|
|
|
@ -61,6 +60,12 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
|
@Resource |
|
|
|
|
private OrderService orderService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private BsConfigService bsConfigService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private SecConfigService secConfigService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighUserService userService; |
|
|
|
|
|
|
|
|
@ -79,12 +84,18 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
|
@Resource |
|
|
|
|
private HighDiscountCouponRelService discountCouponRelService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private OutRechargeOrderMapper outRechargeOrderMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighCouponHandselService highCouponHandselService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighMerchantAccountMarketingService merchantAccountMarketingService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private OutRechargePriceService outRechargePriceService; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private HighGasOrderService gasOrderService; |
|
|
|
|
|
|
|
|
@ -809,7 +820,62 @@ public class OrderCreateHandleServiceImpl implements OrderCreateHandleService { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public HighChildOrder prepaidRecharge(JSONObject object) throws Exception { |
|
|
|
|
return null; |
|
|
|
|
public HighChildOrder mobileRecharge(HighOrder order , JSONObject object) throws Exception { |
|
|
|
|
// 初始化话费订单对象
|
|
|
|
|
OutRechargeOrder outRechargeOrder = new OutRechargeOrder(); |
|
|
|
|
// 查询用户信息
|
|
|
|
|
HighUser user = highUserService.findByUserId(object.getLong("userId")); |
|
|
|
|
// 产品id
|
|
|
|
|
Long goodsId = object.getLong("goodsId"); |
|
|
|
|
// 充值内容
|
|
|
|
|
String rechargeContent = object.getString("rechargeContent"); |
|
|
|
|
|
|
|
|
|
// 查询产品详情
|
|
|
|
|
OutRechargePriceModel outRechargePrice = outRechargePriceService.findById(goodsId, null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 判断充值系统是否关闭
|
|
|
|
|
if (!secConfigService.isConfig("RECHARGE", "1")) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.RECHARGE_CLOSE, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 生成交易子订单
|
|
|
|
|
HighChildOrder childOrder = new HighChildOrder(); |
|
|
|
|
childOrder.setMemId(user.getId()); |
|
|
|
|
childOrder.setMemName(user.getName()); |
|
|
|
|
childOrder.setMemPhone(user.getPhone()); |
|
|
|
|
childOrder.setChildOrderNo(OrderUtil.generateChildOrderNo()); |
|
|
|
|
childOrder.setGoodsType(OrderChildGoodsType.TYPE6.getNumber()); |
|
|
|
|
childOrder.setGoodsId(goodsId); |
|
|
|
|
childOrder.setGoodsName(OperatorEnum.getNameByType(outRechargePrice.getOperatorType()) + "话费充值" + outRechargePrice.getRechargePrice() + "元"); |
|
|
|
|
childOrder.setGoodsSpecName(outRechargePrice.getRechargePrice() + "元"); |
|
|
|
|
childOrder.setGoodsPrice(outRechargePrice.getRechargePrice()); |
|
|
|
|
childOrder.setGoodsActualPrice(outRechargePrice.getPayPrice()); |
|
|
|
|
childOrder.setSaleCount(1); |
|
|
|
|
childOrder.setGiveawayType(false); |
|
|
|
|
childOrder.setChildOrderStatus(OrderChildStatus.STATUS1.getNumber()); |
|
|
|
|
childOrder.setTotalPrice(outRechargePrice.getRechargePrice()); |
|
|
|
|
childOrder.setTotalActualPrice(outRechargePrice.getPayPrice()); |
|
|
|
|
childOrder.setTotalDeductionPrice(childOrder.getTotalPrice().subtract(childOrder.getTotalActualPrice())); |
|
|
|
|
childOrder.setPraiseStatus(0); |
|
|
|
|
childOrder.setCreateTime(new Date()); |
|
|
|
|
|
|
|
|
|
outRechargeOrder.setUserId(user.getId()); |
|
|
|
|
outRechargeOrder.setRechargeContent(rechargeContent); |
|
|
|
|
outRechargeOrder.setCompanyId(outRechargePrice.getCompanyId()); |
|
|
|
|
outRechargeOrder.setUserName(user.getName()); |
|
|
|
|
outRechargeOrder.setRechargeType(outRechargePrice.getRechargeType()); |
|
|
|
|
outRechargeOrder.setUserPhone(user.getPhone()); |
|
|
|
|
outRechargeOrder.setOrderNo(order.getOrderNo()); |
|
|
|
|
outRechargeOrder.setChildOrderNo(childOrder.getChildOrderNo()); |
|
|
|
|
outRechargeOrder.setCreateTimed(new Date()); |
|
|
|
|
outRechargeOrder.setGoodsId(goodsId); |
|
|
|
|
outRechargeOrder.setRechargePrice(outRechargePrice.getRechargePrice()); |
|
|
|
|
outRechargeOrder.setOrderPrice(outRechargePrice.getRechargePrice()); |
|
|
|
|
outRechargeOrder.setType(1); |
|
|
|
|
outRechargeOrder.setOperatorName(OperatorEnum.getNameByType(outRechargePrice.getOperatorType())); |
|
|
|
|
outRechargeOrder.setOperatorType(outRechargePrice.getOperatorType()); |
|
|
|
|
outRechargeOrderMapper.insert(outRechargeOrder); |
|
|
|
|
return childOrder; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|