|
@@ -8,7 +8,7 @@ import com.caimei365.order.mapper.SubmitMapper;
|
|
|
import com.caimei365.order.model.ResponseJson;
|
|
|
import com.caimei365.order.model.po.*;
|
|
|
import com.caimei365.order.model.dto.SubmitDto;
|
|
|
-import com.caimei365.order.model.bo.OrderUserBo;
|
|
|
+import com.caimei365.order.model.bo.OrderParamBo;
|
|
|
import com.caimei365.order.model.vo.*;
|
|
|
import com.caimei365.order.service.SubmitService;
|
|
|
import com.caimei365.order.utils.CodeUtil;
|
|
@@ -17,6 +17,7 @@ import com.caimei365.order.utils.MathUtil;
|
|
|
import com.google.common.util.concurrent.AtomicDouble;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
@@ -134,19 +135,18 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
log.info("******************** 【自主订单】提交订单参数:"+ submitDto);
|
|
|
}
|
|
|
// 机构用户
|
|
|
- OrderUserBo orderUserBo = submitMapper.getOrderUserBoById(clubUserId);
|
|
|
- orderUserBo.setOrderSource(submitDto.getOrderSource());
|
|
|
- orderUserBo.setOrderInfo(orderInfo);
|
|
|
- orderUserBo.setOrderInvoice(orderInvoice);
|
|
|
+ OrderParamBo orderParamBo = submitMapper.getOrderUserBoById(clubUserId);
|
|
|
+ orderParamBo.setOrderSource(submitDto.getOrderSource());
|
|
|
+ orderParamBo.setOrderInfo(orderInfo);
|
|
|
// 余额支付标识,0不使用,1使用
|
|
|
Integer balancePayFlag = (Integer) payInfo.get("balancePayFlag");
|
|
|
// 判断用户可用余额是否wei0
|
|
|
- if (1 == balancePayFlag && null != orderUserBo.getAbleUserMoney() && MathUtil.compare(orderUserBo.getAbleUserMoney(), BigDecimal.ZERO) == 0) {
|
|
|
+ if (1 == balancePayFlag && null != orderParamBo.getAbleUserMoney() && MathUtil.compare(orderParamBo.getAbleUserMoney(), BigDecimal.ZERO) == 0) {
|
|
|
return ResponseJson.error("用户可用余额为0.00元!", null);
|
|
|
}
|
|
|
- orderUserBo.setBalancePayFlag(balancePayFlag);
|
|
|
+ orderParamBo.setBalancePayFlag(balancePayFlag);
|
|
|
Double orderShouldPayFee = (Double) payInfo.get("orderShouldPayFee");
|
|
|
- orderUserBo.setOrderShouldPayFee(orderShouldPayFee);
|
|
|
+ orderParamBo.setOrderShouldPayFee(orderShouldPayFee);
|
|
|
// 运费标志:0包邮 -1到付 1遵循运费规则
|
|
|
Integer postageFlag = (Integer) payInfo.get("postageFlag");
|
|
|
// 运费
|
|
@@ -154,8 +154,8 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
if (null == postageFlag || null == postage) {
|
|
|
return ResponseJson.error("运费数据异常!", null);
|
|
|
}
|
|
|
- orderUserBo.setPostageFlag(postageFlag);
|
|
|
- orderUserBo.setPostage(postage);
|
|
|
+ orderParamBo.setPostageFlag(postageFlag);
|
|
|
+ orderParamBo.setPostage(postage);
|
|
|
// 采美豆抵扣运费,1:100,到付默认30元,抵扣3000豆
|
|
|
Integer userBeans = (Integer) payInfo.get("userBeans");
|
|
|
if (null != userBeans && userBeans > 0) {
|
|
@@ -166,30 +166,69 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
offsetBeans = 3000;
|
|
|
}
|
|
|
// 与前端传入采美豆数量比较
|
|
|
- if (null == orderUserBo.getUserBeans() || !userBeans.equals(offsetBeans)){
|
|
|
+ if (null == orderParamBo.getUserBeans() || !userBeans.equals(offsetBeans)){
|
|
|
return ResponseJson.error("采美豆数据异常!", null);
|
|
|
}
|
|
|
- if (MathUtil.compare(offsetBeans, orderUserBo.getUserBeans())>0) {
|
|
|
- return ResponseJson.error("用户剩余采美豆不足!", null);
|
|
|
+ if (orderParamBo.getUserBeans()<=0) {
|
|
|
+ return ResponseJson.error("用户没有剩余采美豆!", null);
|
|
|
}
|
|
|
} else {
|
|
|
userBeans = 0;
|
|
|
}
|
|
|
- orderUserBo.setOffsetBeans(userBeans);
|
|
|
+ orderParamBo.setOffsetBeans(userBeans);
|
|
|
// 发票类型 0不开发票 1普通发票 2增值税发票
|
|
|
Integer invoiceType = (Integer) orderInvoice.get("type");
|
|
|
if (null == invoiceType) {
|
|
|
return ResponseJson.error("发票类型不能为空!", null);
|
|
|
}
|
|
|
- orderUserBo.setInvoiceType(invoiceType);
|
|
|
+ orderParamBo.setInvoiceType(invoiceType);
|
|
|
+ if (1== invoiceType || 2 == invoiceType) {
|
|
|
+ InvoicePo invoice = new InvoicePo();
|
|
|
+ String invoiceTitle = (String) orderInvoice.get("invoiceTitle");
|
|
|
+ if (StringUtils.isNotEmpty(invoiceTitle)){
|
|
|
+ return ResponseJson.error("发票抬头信息不正确!", null);
|
|
|
+ }
|
|
|
+ String corporationTaxNum = (String) orderInvoice.get("corporationTaxNum");
|
|
|
+ if (StringUtils.isNotEmpty(corporationTaxNum)){
|
|
|
+ return ResponseJson.error("纳税人识别号信息不正确!", null);
|
|
|
+ }
|
|
|
+ invoice.setType(invoiceType);
|
|
|
+ invoice.setInvoiceTitle(invoiceTitle);
|
|
|
+ invoice.setCorporationTaxNum(corporationTaxNum);
|
|
|
+ if (1== invoiceType) {
|
|
|
+ // 普通发票:发票类型、发票内容(商品明细)、抬头(公司名称)、纳税人识别号[普通发票的公司]
|
|
|
+ String invoiceContent = (String) orderInvoice.get("invoiceContent");
|
|
|
+ Integer invoiceTitleType = (Integer) orderInvoice.get("invoiceTitleType");
|
|
|
+ if (StringUtils.isNotEmpty(invoiceContent) || null == invoiceTitleType) {
|
|
|
+ return ResponseJson.error("发票信息不完整!", null);
|
|
|
+ }
|
|
|
+ invoice.setInvoiceContent(invoiceContent);
|
|
|
+ invoice.setInvoiceTitleType(invoiceTitleType);
|
|
|
+ }
|
|
|
+ if (2== invoiceType) {
|
|
|
+ // 增值税发票:发票类型、发票、抬头(公司名称)、纳税人识别号、注册地址、注册电话、开户银行、开户银行账户
|
|
|
+ String registeredAddress = (String) orderInvoice.get("registeredAddress");
|
|
|
+ String registeredPhone = (String) orderInvoice.get("registeredPhone");
|
|
|
+ String openBank = (String) orderInvoice.get("openBank");
|
|
|
+ String bankAccountNo = (String) orderInvoice.get("bankAccountNo");
|
|
|
+ if (StringUtils.isNotEmpty(registeredAddress) || StringUtils.isNotEmpty(registeredPhone) || StringUtils.isNotEmpty(openBank) || StringUtils.isNotEmpty(bankAccountNo)) {
|
|
|
+ return ResponseJson.error("发票信息不完整!", null);
|
|
|
+ }
|
|
|
+ invoice.setRegisteredAddress(registeredAddress);
|
|
|
+ invoice.setRegisteredPhone(registeredPhone);
|
|
|
+ invoice.setOpenBank(openBank);
|
|
|
+ invoice.setBankAccountNo(bankAccountNo);
|
|
|
+ }
|
|
|
+ orderParamBo.setOrderInvoice(invoice);
|
|
|
+ }
|
|
|
// 返佣订单标识 0非返佣订单,1返佣订单
|
|
|
Integer rebateFlag = (Integer) payInfo.get("rebateFlag");
|
|
|
- orderUserBo.setRebateFlag(rebateFlag);
|
|
|
+ orderParamBo.setRebateFlag(rebateFlag);
|
|
|
// 售后条款id
|
|
|
Integer clauseId = (Integer) payInfo.get("clauseId");
|
|
|
- orderUserBo.setClauseId(clauseId);
|
|
|
+ orderParamBo.setClauseId(clauseId);
|
|
|
// 购买类型:(1自主下单, 3协销下单)
|
|
|
- orderUserBo.setCartType(submitDto.getCartType());
|
|
|
+ orderParamBo.setCartType(submitDto.getCartType());
|
|
|
// 下单人
|
|
|
Integer buyUserId = null;
|
|
|
if (1 == submitDto.getCartType()){
|
|
@@ -213,31 +252,31 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
} else {
|
|
|
return ResponseJson.error("购买类型不正确!", null);
|
|
|
}
|
|
|
- orderUserBo.setBuyUserId(buyUserId);
|
|
|
- orderUserBo.setAddressId(submitDto.getAddressId());
|
|
|
+ orderParamBo.setBuyUserId(buyUserId);
|
|
|
+ orderParamBo.setAddressId(submitDto.getAddressId());
|
|
|
/*
|
|
|
* 保存订单
|
|
|
*/
|
|
|
- return saveOrder(orderUserBo);
|
|
|
+ return saveOrder(orderParamBo);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- private ResponseJson<Map<String, Object>> saveOrder(OrderUserBo orderUserBo) {
|
|
|
+ private ResponseJson<Map<String, Object>> saveOrder(OrderParamBo orderParamBo) {
|
|
|
log.info("******************** 提交订单逻辑处理 start *******************");
|
|
|
/*
|
|
|
* 初始化主订单
|
|
|
*/
|
|
|
OrderPo mainOrder = new OrderPo();
|
|
|
// 订单来源
|
|
|
- mainOrder.setOrderSource(orderUserBo.getOrderSource());
|
|
|
+ mainOrder.setOrderSource(orderParamBo.getOrderSource());
|
|
|
// 订单号
|
|
|
- String orderNo = CodeUtil.generateOrderNo(orderUserBo.getOrderSource());
|
|
|
+ String orderNo = CodeUtil.generateOrderNo(orderParamBo.getOrderSource());
|
|
|
mainOrder.setOrderNo(orderNo);
|
|
|
// 用户Id
|
|
|
- mainOrder.setUserId(orderUserBo.getUserId());
|
|
|
- mainOrder.setClubId(orderUserBo.getClubId());
|
|
|
- mainOrder.setBuyUserId(orderUserBo.getBuyUserId());
|
|
|
+ mainOrder.setUserId(orderParamBo.getUserId());
|
|
|
+ mainOrder.setClubId(orderParamBo.getClubId());
|
|
|
+ mainOrder.setBuyUserId(orderParamBo.getBuyUserId());
|
|
|
// 订单提交时间
|
|
|
Date date = new Date();
|
|
|
String curDateStr = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date);
|
|
@@ -245,7 +284,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
mainOrder.setUpdateDate(curDateStr);
|
|
|
// 订单状态 0 有效 其它无效
|
|
|
mainOrder.setDelFlag(0);
|
|
|
- if (3 == orderUserBo.getCartType()) {
|
|
|
+ if (3 == orderParamBo.getCartType()) {
|
|
|
// 协销订单
|
|
|
mainOrder.setOrderType(0);
|
|
|
// 3:协销帮会所下单
|
|
@@ -261,7 +300,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
mainOrder.setConfirmFlag(2);
|
|
|
}
|
|
|
// 抵扣采美豆数量
|
|
|
- mainOrder.setUserBeans(orderUserBo.getOffsetBeans());
|
|
|
+ mainOrder.setUserBeans(orderParamBo.getOffsetBeans());
|
|
|
// 默认可以线上支付:0可以 1不可以
|
|
|
mainOrder.setOnlinePayFlag(0);
|
|
|
// 默认订单可以拆分:1可拆分 0不可拆分
|
|
@@ -281,7 +320,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
// 未确认付款供应商
|
|
|
mainOrder.setAffirmPaymentFlag(0);
|
|
|
// 是否开发票
|
|
|
- mainOrder.setInvoiceFlag(orderUserBo.getInvoiceType());
|
|
|
+ mainOrder.setInvoiceFlag(orderParamBo.getInvoiceType());
|
|
|
|
|
|
/*
|
|
|
* 整理订单商品信息
|
|
@@ -317,7 +356,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
|
|
|
// 子订单订单列表
|
|
|
List<OrderShopPo> shopOrderList = new ArrayList<>();
|
|
|
- JSONArray orderInfo = orderUserBo.getOrderInfo();
|
|
|
+ JSONArray orderInfo = orderParamBo.getOrderInfo();
|
|
|
for (Object infoObject: orderInfo) {
|
|
|
JSONObject shopInfo = (JSONObject) infoObject;
|
|
|
Integer shopId = (Integer) shopInfo.get("shopId");
|
|
@@ -339,11 +378,11 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
shopOrder.setShopName(shopName);
|
|
|
shopOrder.setNote(shopNote);
|
|
|
// 用户Id
|
|
|
- shopOrder.setUserId(orderUserBo.getUserId());
|
|
|
- shopOrder.setClubId(orderUserBo.getClubId());
|
|
|
- if (3 == orderUserBo.getCartType()) {
|
|
|
+ shopOrder.setUserId(orderParamBo.getUserId());
|
|
|
+ shopOrder.setClubId(orderParamBo.getClubId());
|
|
|
+ if (3 == orderParamBo.getCartType()) {
|
|
|
// 协销订单
|
|
|
- shopOrder.setSpId(orderUserBo.getBuyUserId());
|
|
|
+ shopOrder.setSpId(orderParamBo.getBuyUserId());
|
|
|
}
|
|
|
// 商品总数量
|
|
|
AtomicInteger shopProductCount = new AtomicInteger(0);
|
|
@@ -360,8 +399,6 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
|
|
|
// 店铺促销活动状态
|
|
|
PromotionsVo shopPromotions = baseMapper.getPromotionByShopId(shopId);
|
|
|
- // 商品信息ids
|
|
|
- List<Integer> shopProductIds = new ArrayList<>();
|
|
|
// 商品费
|
|
|
AtomicDouble shopProductFee = new AtomicDouble(0);
|
|
|
// 遍历所有商品
|
|
@@ -378,7 +415,6 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
if (null == productNum || productNum == 0) {
|
|
|
return ResponseJson.error("商品购买数量异常!", null);
|
|
|
}
|
|
|
- shopProductIds.add(productId);
|
|
|
// 统计商品总数量
|
|
|
productCount.updateAndGet(v -> v + productNum);
|
|
|
// 赠品数
|
|
@@ -470,7 +506,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
product.setActProduct(2);
|
|
|
} else {
|
|
|
// 复购价
|
|
|
- Double repurchase = baseMapper.getRepurchasePrice(productId, orderUserBo.getUserId());
|
|
|
+ Double repurchase = baseMapper.getRepurchasePrice(productId, orderParamBo.getUserId());
|
|
|
if (null != repurchase && repurchase > 0) {
|
|
|
discountPrice = repurchase;
|
|
|
}
|
|
@@ -727,24 +763,24 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
/*
|
|
|
* 计算运费
|
|
|
*/
|
|
|
- if (3 != orderUserBo.getCartType()){
|
|
|
+ if (3 != orderParamBo.getCartType()){
|
|
|
// 机构用户 计算商品运费
|
|
|
- Integer townId = baseMapper.getTownIdByAddressId(orderUserBo.getAddressId());
|
|
|
- Map<String, Object> postageMap = productService.computePostage(orderUserBo.getUserId(), townId, productIdList);
|
|
|
+ Integer townId = baseMapper.getTownIdByAddressId(orderParamBo.getAddressId());
|
|
|
+ Map<String, Object> postageMap = productService.computePostage(orderParamBo.getUserId(), townId, productIdList);
|
|
|
// 运费标志:0包邮 -1到付 1遵循运费规则
|
|
|
Integer postageFlag = (Integer) postageMap.get("postageFlag");
|
|
|
Double postage = (Double) postageMap.get("postage");
|
|
|
- if (!orderUserBo.getPostageFlag().equals(postageFlag) || MathUtil.compare(orderUserBo.getPostage(), postage) != 0) {
|
|
|
+ if (!orderParamBo.getPostageFlag().equals(postageFlag) || MathUtil.compare(orderParamBo.getPostage(), postage) != 0) {
|
|
|
return ResponseJson.error("订单邮费不正确!", null);
|
|
|
}
|
|
|
}
|
|
|
// 设置运费
|
|
|
- mainOrder.setPostage(orderUserBo.getPostage());
|
|
|
+ mainOrder.setPostage(orderParamBo.getPostage());
|
|
|
// 订单总额 = 商品费 + 运费
|
|
|
- payTotalFee.set(MathUtil.add(productTotalFee.get(), orderUserBo.getPostage()).doubleValue());
|
|
|
+ payTotalFee.set(MathUtil.add(productTotalFee.get(), orderParamBo.getPostage()).doubleValue());
|
|
|
// 运费标志:0包邮 -1到付 1遵循运费规则
|
|
|
- mainOrder.setPostageFlag(orderUserBo.getPostageFlag());
|
|
|
- if (1 == orderUserBo.getPostageFlag() && orderUserBo.getOffsetBeans() > 0) {
|
|
|
+ mainOrder.setPostageFlag(orderParamBo.getPostageFlag());
|
|
|
+ if (1 == orderParamBo.getPostageFlag() && orderParamBo.getOffsetBeans() > 0) {
|
|
|
// 采美豆抵扣运费,订单总额 = 商品费
|
|
|
payTotalFee.set(productTotalFee.get());
|
|
|
}
|
|
@@ -755,7 +791,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
// 订单总额(商品金额+运费)
|
|
|
mainOrder.setPayTotalFee(payTotalFee.get());
|
|
|
// 订单状态
|
|
|
- if (3 == orderUserBo.getCartType()) {
|
|
|
+ if (3 == orderParamBo.getCartType()) {
|
|
|
// 协销 状态为 待确认
|
|
|
mainOrder.setStatus(0);
|
|
|
} else {
|
|
@@ -767,39 +803,39 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
// 是否完成支付(默认不是,只有余额抵扣才算)
|
|
|
boolean isPaySuccessFlag = false;
|
|
|
// 余额支付标识,0不使用,1使用
|
|
|
- if (1 == orderUserBo.getBalancePayFlag()) {
|
|
|
+ if (1 == orderParamBo.getBalancePayFlag()) {
|
|
|
// 抵扣后用户剩余可用余额
|
|
|
- Double lastAbleUserMoney = orderUserBo.getAbleUserMoney();
|
|
|
+ Double lastAbleUserMoney = orderParamBo.getAbleUserMoney();
|
|
|
// 抵扣后账户余额
|
|
|
- Double lastUserMoney = orderUserBo.getUserMoney();
|
|
|
+ Double lastUserMoney = orderParamBo.getUserMoney();
|
|
|
// 部分抵扣
|
|
|
- if (MathUtil.compare(payTotalFee.get(), orderUserBo.getAbleUserMoney()) > 0) {
|
|
|
- balancePayFee.set(orderUserBo.getAbleUserMoney());
|
|
|
+ if (MathUtil.compare(payTotalFee.get(), orderParamBo.getAbleUserMoney()) > 0) {
|
|
|
+ balancePayFee.set(orderParamBo.getAbleUserMoney());
|
|
|
payableAmount.set(MathUtil.sub(payTotalFee.get(), balancePayFee.get()).doubleValue());
|
|
|
// 余额抵扣用完
|
|
|
lastAbleUserMoney = 0d;
|
|
|
- if (3 != orderUserBo.getCartType()) {
|
|
|
+ if (3 != orderParamBo.getCartType()) {
|
|
|
// 部收款待发货
|
|
|
mainOrder.setStatus(21);
|
|
|
- lastUserMoney = MathUtil.sub(orderUserBo.getUserMoney(), balancePayFee.get()).doubleValue();
|
|
|
+ lastUserMoney = MathUtil.sub(orderParamBo.getUserMoney(), balancePayFee.get()).doubleValue();
|
|
|
}
|
|
|
mainOrder.setReceiptStatus(2);
|
|
|
} else {
|
|
|
// 全部用余额抵扣, 直接变成支付完成
|
|
|
balancePayFee.set(payTotalFee.get());
|
|
|
payableAmount.set(0d);
|
|
|
- lastAbleUserMoney = MathUtil.sub(orderUserBo.getAbleUserMoney(), balancePayFee.get()).doubleValue();
|
|
|
- if (3 != orderUserBo.getCartType()) {
|
|
|
+ lastAbleUserMoney = MathUtil.sub(orderParamBo.getAbleUserMoney(), balancePayFee.get()).doubleValue();
|
|
|
+ if (3 != orderParamBo.getCartType()) {
|
|
|
// 已收款待发货
|
|
|
mainOrder.setStatus(31);
|
|
|
- lastUserMoney = MathUtil.sub(orderUserBo.getUserMoney(), balancePayFee.get()).doubleValue();
|
|
|
+ lastUserMoney = MathUtil.sub(orderParamBo.getUserMoney(), balancePayFee.get()).doubleValue();
|
|
|
}
|
|
|
mainOrder.setReceiptStatus(3);
|
|
|
mainOrder.setPayFlag(1);
|
|
|
isPaySuccessFlag = true;
|
|
|
}
|
|
|
// 抵扣后更新用户余额
|
|
|
- submitMapper.updateUserMoney(lastUserMoney, lastAbleUserMoney, orderUserBo.getUserId());
|
|
|
+ submitMapper.updateUserMoney(lastUserMoney, lastAbleUserMoney, orderParamBo.getUserId());
|
|
|
log.info("【提交订单】>>>>>更新用户余额,抵扣后剩余:[userMoney:" + lastUserMoney + "] ,ableUserMoney:" + lastAbleUserMoney);
|
|
|
// 支付时间
|
|
|
mainOrder.setPayTime(curDateStr);
|
|
@@ -810,13 +846,13 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
mainOrder.setPayableAmount(payableAmount.get());
|
|
|
|
|
|
// 是否返佣订单
|
|
|
- Integer rebateFlag = (null == orderUserBo.getRebateFlag() ? 0 : orderUserBo.getRebateFlag());
|
|
|
+ Integer rebateFlag = (null == orderParamBo.getRebateFlag() ? 0 : orderParamBo.getRebateFlag());
|
|
|
mainOrder.setRebateFlag(rebateFlag);
|
|
|
|
|
|
// 判断前端传入orderShouldPayFee订单应付金额,和后台计算应付金额对比
|
|
|
- log.info("【提交订单】>>>>>后台计算payableAmount:" + payableAmount.get() + " ,前端传入orderShouldPayFee:" + orderUserBo.getOrderShouldPayFee());
|
|
|
+ log.info("【提交订单】>>>>>后台计算payableAmount:" + payableAmount.get() + " ,前端传入orderShouldPayFee:" + orderParamBo.getOrderShouldPayFee());
|
|
|
// compare return[-1:v1<v2, 0:v1=v2, 1:v1>v2]
|
|
|
- int compare = MathUtil.compare(orderUserBo.getOrderShouldPayFee(), payableAmount.get());
|
|
|
+ int compare = MathUtil.compare(orderParamBo.getOrderShouldPayFee(), payableAmount.get());
|
|
|
if (compare != 0) {
|
|
|
// 设置手动回滚事务
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
@@ -824,7 +860,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
}
|
|
|
|
|
|
// 售后条款
|
|
|
- Integer clauseId = orderUserBo.getClauseId();
|
|
|
+ Integer clauseId = orderParamBo.getClauseId();
|
|
|
String clauseName = null;
|
|
|
if (null != clauseId) {
|
|
|
clauseName = submitMapper.getClauseNameById(clauseId);
|
|
@@ -849,7 +885,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
promotionList.forEach(promotions -> {
|
|
|
promotions.setOrderId(mainOrder.getOrderId());
|
|
|
submitMapper.insertOrderPromotions(promotions);
|
|
|
- log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>新增订单促销活动(insert[cm_promotions_order])id:" + promotions.getId());
|
|
|
+ log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>新增订单促销活动(insert[cm_promotions_order])id:" + promotions.getId() + ",orderId:" + mainOrder.getOrderId());
|
|
|
});
|
|
|
|
|
|
/*
|
|
@@ -887,7 +923,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
* 保存子订单
|
|
|
*/
|
|
|
submitMapper.insertShopOrder(shopOrder);
|
|
|
- log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>新增子订单(insert[cm_shop_order])shopOrderId::" + shopOrder.getShopOrderId());
|
|
|
+ log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>新增子订单(insert[cm_shop_order])shopOrderId:" + shopOrder.getShopOrderId() + ",orderId:" + mainOrder.getOrderId());
|
|
|
// 收集子订单Id字符串
|
|
|
if (StringUtils.isEmpty(shopOrderIds.get())) {
|
|
|
shopOrderIds.set(shopOrder.getShopOrderId().toString());
|
|
@@ -921,20 +957,36 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
* 保存 订单商品
|
|
|
*/
|
|
|
submitMapper.insertOrderProduct(orderProduct);
|
|
|
- log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>保存订单商品(insert[cm_order_product])OrderProductId:" + orderProduct.getOrderProductId());
|
|
|
-
|
|
|
+ log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>保存订单商品(insert[cm_order_product])OrderProductId:" + orderProduct.getOrderProductId() + ",orderId:" + mainOrder.getOrderId());
|
|
|
+ /*
|
|
|
+ * 保存 订单阶梯价格
|
|
|
+ */
|
|
|
if (orderProduct.getLadderPriceFlag() == 1) {
|
|
|
// 使用阶梯价格的订单商品保存下单时的阶梯价格列表
|
|
|
orderProduct.getLadderPrices().forEach(ladderPriceVo -> {
|
|
|
ladderPriceVo.setOrderProductId(orderProduct.getOrderProductId());
|
|
|
ladderPriceVo.setCreateDate(date);
|
|
|
- /*
|
|
|
- * 保存 订单阶梯价格
|
|
|
- */
|
|
|
submitMapper.insertLadderPrices(ladderPriceVo);
|
|
|
- log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>保存订单阶梯价格(insert[order_product_ladder_price])id:" + ladderPriceVo.getId());
|
|
|
+ log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>保存订单阶梯价格(insert[order_product_ladder_price])id:" + ladderPriceVo.getId() + ",orderId:" + mainOrder.getOrderId());
|
|
|
});
|
|
|
}
|
|
|
+ /*
|
|
|
+ * 机构用户 写入价格库
|
|
|
+ */
|
|
|
+ if (3 != orderParamBo.getCartType()) {
|
|
|
+ // 非二手订单, 非活动商品,非阶梯价商品,非运费商品,非赠品 才可以写入复购价
|
|
|
+ boolean flag = ((!secondHandOrderFlag) && orderProduct.getActProduct() == 0 && orderProduct.getShopId() != 998 && orderProduct.getPrice() > 0);
|
|
|
+ // 不是二手订单才可以写入价格库
|
|
|
+ if (flag) {
|
|
|
+ // 查询当前商品复购价
|
|
|
+ //PurchasePricePo purchase = submitMapper.getPurchasePricePo(orderParamBo.getUserId(), orderProduct.getProductId());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -969,9 +1021,9 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
postageOrder.setOrderTime(mainOrder.getOrderTime());
|
|
|
postageOrder.setCanRefundAmount(0d);
|
|
|
postageOrder.setClubId(mainOrder.getClubId());
|
|
|
- if (3 == orderUserBo.getCartType()) {
|
|
|
+ if (3 == orderParamBo.getCartType()) {
|
|
|
// 协销订单
|
|
|
- postageOrder.setSpId(orderUserBo.getBuyUserId());
|
|
|
+ postageOrder.setSpId(orderParamBo.getBuyUserId());
|
|
|
}
|
|
|
// 订单默认可拆分
|
|
|
postageOrder.setSplitFlag(1);
|
|
@@ -979,7 +1031,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
* 保存运费子订单
|
|
|
*/
|
|
|
submitMapper.insertShopOrder(postageOrder);
|
|
|
- log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>新增子订单(运费商品)(insert[cm_shop_order])shopOrderId::" + postageOrder.getShopOrderId());
|
|
|
+ log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>新增子订单(运费商品)(insert[cm_shop_order])shopOrderId::" + postageOrder.getShopOrderId() + ",orderId:" + mainOrder.getOrderId());
|
|
|
// 收集子订单Id字符串
|
|
|
if (StringUtils.isEmpty(shopOrderIds.get())) {
|
|
|
shopOrderIds.set(postageOrder.getShopOrderId().toString());
|
|
@@ -1017,7 +1069,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
* 保存 订单运费商品
|
|
|
*/
|
|
|
submitMapper.insertOrderProduct(postageProduct);
|
|
|
- log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>保存订单运费商品(insert[cm_order_product])OrderProductId:" + postageProduct.getOrderProductId());
|
|
|
+ log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>保存订单运费商品(insert[cm_order_product])OrderProductId:" + postageProduct.getOrderProductId() + ",orderId:" + mainOrder.getOrderId());
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -1033,67 +1085,139 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- * 发票信息
|
|
|
+ * 保存 订单收货用户信息
|
|
|
*/
|
|
|
- boolean hasInvoiceFlag = false;
|
|
|
- InvoicePo invoice = new InvoicePo();
|
|
|
- // 发票类型 0不开发票 1普通发票 2增值税发票
|
|
|
- if (1== orderUserBo.getInvoiceType() || 2 == orderUserBo.getInvoiceType()){
|
|
|
- JSONObject orderInvoice = orderUserBo.getOrderInvoice();
|
|
|
- Integer invoiceType = (Integer) orderInvoice.get("type");
|
|
|
- String invoiceTitle = (String) orderInvoice.get("invoiceTitle");
|
|
|
- if (StringUtils.isNotEmpty(invoiceTitle)){
|
|
|
- return ResponseJson.error("发票抬头信息不正确!", null);
|
|
|
- }
|
|
|
- String corporationTaxNum = (String) orderInvoice.get("corporationTaxNum");
|
|
|
- if (StringUtils.isNotEmpty(corporationTaxNum)){
|
|
|
- return ResponseJson.error("纳税人识别号信息不正确!", null);
|
|
|
- }
|
|
|
- invoice.setType(invoiceType);
|
|
|
- invoice.setInvoiceTitle(invoiceTitle);
|
|
|
- invoice.setCorporationTaxNum(corporationTaxNum);
|
|
|
- if (1== orderUserBo.getInvoiceType()) {
|
|
|
- // 普通发票:发票类型、发票内容(商品明细)、抬头(公司名称)、纳税人识别号[普通发票的公司]
|
|
|
- String invoiceContent = (String) orderInvoice.get("invoiceContent");
|
|
|
- Integer invoiceTitleType = (Integer) orderInvoice.get("invoiceTitleType");
|
|
|
- if (StringUtils.isNotEmpty(invoiceContent) || null == invoiceTitleType) {
|
|
|
- return ResponseJson.error("发票信息不完整!", null);
|
|
|
- }
|
|
|
- invoice.setInvoiceContent(invoiceContent);
|
|
|
- invoice.setInvoiceTitleType(invoiceTitleType);
|
|
|
- hasInvoiceFlag = true;
|
|
|
- }
|
|
|
- if (2== orderUserBo.getInvoiceType()) {
|
|
|
- // 增值税发票:发票类型、发票、抬头(公司名称)、纳税人识别号、注册地址、注册电话、开户银行、开户银行账户
|
|
|
- String registeredAddress = (String) orderInvoice.get("registeredAddress");
|
|
|
- String registeredPhone = (String) orderInvoice.get("registeredPhone");
|
|
|
- String openBank = (String) orderInvoice.get("openBank");
|
|
|
- String bankAccountNo = (String) orderInvoice.get("bankAccountNo");
|
|
|
- if (StringUtils.isNotEmpty(registeredAddress) || StringUtils.isNotEmpty(registeredPhone) || StringUtils.isNotEmpty(openBank) || StringUtils.isNotEmpty(bankAccountNo)) {
|
|
|
- return ResponseJson.error("发票信息不完整!", null);
|
|
|
- }
|
|
|
- invoice.setRegisteredAddress(registeredAddress);
|
|
|
- invoice.setRegisteredPhone(registeredPhone);
|
|
|
- invoice.setOpenBank(openBank);
|
|
|
- invoice.setBankAccountNo(bankAccountNo);
|
|
|
- hasInvoiceFlag = true;
|
|
|
+ AddressVo address = submitMapper.getAddressDetailById(orderParamBo.getAddressId());
|
|
|
+ if (null != address) {
|
|
|
+ String userName = baseMapper.getUserNameByUserId(mainOrder.getUserId());
|
|
|
+ //保存地址信息
|
|
|
+ OrderUserInfoPo userInfo = new OrderUserInfoPo();
|
|
|
+ userInfo.setOrderId(mainOrder.getOrderId());
|
|
|
+ userInfo.setClubId(mainOrder.getClubId());
|
|
|
+ userInfo.setUserId(mainOrder.getUserId());
|
|
|
+ userInfo.setUserName(userName);
|
|
|
+ userInfo.setName(address.getName());
|
|
|
+ userInfo.setMobile(address.getMobile());
|
|
|
+ userInfo.setTownId(address.getTownId());
|
|
|
+ userInfo.setProvince(address.getProvince());
|
|
|
+ userInfo.setCity(address.getCity());
|
|
|
+ userInfo.setTown(address.getTown());
|
|
|
+ userInfo.setAddress(address.getAddress());
|
|
|
+ // 保存 订单收货用户信息
|
|
|
+ submitMapper.insertOrderUserInfo(userInfo);
|
|
|
+ log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>保存订单用户地址(insert[bp_order_userinfo])orderId:" + mainOrder.getOrderId());
|
|
|
+ } else {
|
|
|
+ //设置手动回滚事务
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return ResponseJson.error("订单地址异常!", null);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ *保存余额到余额收支记录
|
|
|
+ */
|
|
|
+ // 余额支付标识,0不使用,1使用
|
|
|
+ if (1 == orderParamBo.getBalancePayFlag() && MathUtil.compare(balancePayFee.get(), 0) > 0) {
|
|
|
+ // 余额支付标识,0不使用,1使用
|
|
|
+ //保存余额到余额收支记录
|
|
|
+ BalanceRecordPo balanceRecord = new BalanceRecordPo();
|
|
|
+ balanceRecord.setUserId(mainOrder.getUserId());
|
|
|
+ balanceRecord.setType(2);
|
|
|
+ balanceRecord.setBalanceType(1);
|
|
|
+ balanceRecord.setAddDate(new Date());
|
|
|
+ balanceRecord.setAmount(balancePayFee.get());
|
|
|
+ balanceRecord.setOrderId(mainOrder.getOrderId());
|
|
|
+ balanceRecord.setRemark("机构自主订单");
|
|
|
+ balanceRecord.setDelFlag(0);
|
|
|
+ // 保存 余额收支记录
|
|
|
+ submitMapper.insertBalanceRecord(balanceRecord);
|
|
|
+ log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>新增用户余额收支记录(insert[cm_user_balance_record])orderId:" + mainOrder.getOrderId());
|
|
|
+
|
|
|
+ //保存余额到收款记录(自主订单)
|
|
|
+ if (3 != orderParamBo.getCartType()) {
|
|
|
+ // 识别款项表
|
|
|
+ DiscernReceiptPo discernReceipt = new DiscernReceiptPo();
|
|
|
+ discernReceipt.setPayWay(3);
|
|
|
+ discernReceipt.setPayType(16);
|
|
|
+ discernReceipt.setReceiptType(1);
|
|
|
+ discernReceipt.setReceiptStatus(3);
|
|
|
+ discernReceipt.setReceiptAmount(balancePayFee.get());
|
|
|
+ discernReceipt.setConfirmType(4);
|
|
|
+ discernReceipt.setReceiptDate(curDateStr);
|
|
|
+ discernReceipt.setConfirmDate(curDateStr);
|
|
|
+ discernReceipt.setReviewDate(curDateStr);
|
|
|
+ discernReceipt.setUpdateDate(curDateStr);
|
|
|
+ discernReceipt.setDelFlag(0);
|
|
|
+ // 保存 收款记录
|
|
|
+ submitMapper.insertDiscernReceipt(discernReceipt);
|
|
|
+ log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>保存识别款项(insert[cm_discern_receipt])id:" + discernReceipt.getId() + ",orderId:" + mainOrder.getOrderId());
|
|
|
+ // 收款项和订单关系表
|
|
|
+ OrderReceiptRelationPo relation = new OrderReceiptRelationPo();
|
|
|
+ relation.setReceiptId(discernReceipt.getId());
|
|
|
+ relation.setOrderId(mainOrder.getOrderId());
|
|
|
+ relation.setAssociateAmount(balancePayFee.get());
|
|
|
+ relation.setRelationType(2);
|
|
|
+ relation.setDelFlag(0);
|
|
|
+ // 保存 收款项和订单关系
|
|
|
+ submitMapper.insertOrderReceiptRelation(relation);
|
|
|
+ log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>收款项和订单关系(insert[cm_receipt_order_relation])id:" + relation.getId() + ",orderId:" + mainOrder.getOrderId());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/*
|
|
|
* 保存订单发票信息
|
|
|
*/
|
|
|
- if (hasInvoiceFlag) {
|
|
|
+ if (1 == orderParamBo.getInvoiceType() || 2 == orderParamBo.getInvoiceType()) {
|
|
|
+ InvoicePo orderInvoice = orderParamBo.getOrderInvoice();
|
|
|
// 开发票才保存
|
|
|
- invoice.setOrderId(mainOrder.getOrderId());
|
|
|
+ orderInvoice.setOrderId(mainOrder.getOrderId());
|
|
|
// 一个订单只有一条发票信息,删除老的订单增值税信息
|
|
|
submitMapper.deleteOrderInvoiceByOrderId(mainOrder.getOrderId());
|
|
|
// 保存 订单发票信息
|
|
|
- submitMapper.insertOrderInvoice(invoice);
|
|
|
+ submitMapper.insertOrderInvoice(orderInvoice);
|
|
|
log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>保存订单发票信息(insert[bp_order_invoice])orderId:" + mainOrder.getOrderId());
|
|
|
-
|
|
|
+ /*
|
|
|
+ * 更新用户增值税发票
|
|
|
+ */
|
|
|
+ InvoiceVo userInvoice = baseMapper.getUserInvoice(mainOrder.getUserId());
|
|
|
+ if (null != userInvoice.getId()) {
|
|
|
+ // 更新
|
|
|
+ BeanUtils.copyProperties(orderInvoice, userInvoice);
|
|
|
+ baseMapper.updateUserInvoiceByUserId(userInvoice);
|
|
|
+ log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>更新用户增值税发票(update[cm_user_invoiceinfo])userId:" + mainOrder.getUserId());
|
|
|
+ } else {
|
|
|
+ // 新增
|
|
|
+ BeanUtils.copyProperties(orderInvoice, userInvoice);
|
|
|
+ baseMapper.insertUserInvoiceByUserId(userInvoice);
|
|
|
+ log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>新增用户增值税发票(insert[cm_user_invoiceinfo])userId:" + mainOrder.getUserId());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
+ * 保存采美豆使用记录
|
|
|
+ */
|
|
|
+ if (orderParamBo.getOffsetBeans() > 0) {
|
|
|
+ UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
|
|
|
+ beansHistory.setUserId(mainOrder.getUserId());
|
|
|
+ beansHistory.setOrderId(mainOrder.getOrderId());
|
|
|
+ beansHistory.setBeansType(10);
|
|
|
+ beansHistory.setType(2);
|
|
|
+ beansHistory.setNum(orderParamBo.getOffsetBeans());
|
|
|
+ beansHistory.setPushStatus(0);
|
|
|
+ beansHistory.setAddTime(date);
|
|
|
+ beansHistory.setDelFlag(0);
|
|
|
+ // 保存 采美豆使用记录
|
|
|
+ submitMapper.insertBeansHistory(beansHistory);
|
|
|
+ // 更新用户剩余采美豆数量
|
|
|
+ int beans = orderParamBo.getUserBeans() - orderParamBo.getOffsetBeans();
|
|
|
+ submitMapper.updateUserBeans(orderParamBo.getUserId(), beans);
|
|
|
+ log.info("【提交订单】>>>>>更新用户余额,抵扣后剩余:[userBeans:" + beans + "]");
|
|
|
+ }
|
|
|
|
|
|
+ /*
|
|
|
+ * 删除购物车
|
|
|
+ */
|
|
|
+ // productIdList
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1101,80 +1225,6 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
|
|
|
|
|
|
|
|
|
-//
|
|
|
-// /*
|
|
|
-// * 保存 订单用户地址
|
|
|
-// */
|
|
|
-// if (null != address) {
|
|
|
-// //保存地址信息
|
|
|
-// UserinfoVo userInfo = new UserinfoVo();
|
|
|
-// userInfo.setOrderId(mainOrder.getOrderId());
|
|
|
-// userInfo.setClubId(user.getClubId().longValue());
|
|
|
-// userInfo.setUserId(user.getUserId().longValue());
|
|
|
-// userInfo.setName(user.getName() == null ? user.getUserName() : user.getName());
|
|
|
-// userInfo.setShouHuoRen(address.getShouHuoRen());
|
|
|
-// userInfo.setMobile(address.getMobile());
|
|
|
-// userInfo.setPostalCode(address.getPhone());
|
|
|
-// userInfo.setPostalCode(address.getPostalCode());
|
|
|
-// userInfo.setTownId(address.getTownId());
|
|
|
-// userInfo.setProvince(address.getProvince());
|
|
|
-// userInfo.setCity(address.getCity());
|
|
|
-// userInfo.setTown(address.getTown());
|
|
|
-// userInfo.setAddress(address.getAddress());
|
|
|
-// orderSubmitDao.insertUserInfo(userInfo);
|
|
|
-// log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>保存订单用户地址(insert[bp_order_userinfo])orderId:" + mainOrder.getOrderId());
|
|
|
-// } else {
|
|
|
-// //设置手动回滚事务
|
|
|
-// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
-// return JsonModel.newInstance().error("订单地址异常");
|
|
|
-// }
|
|
|
-//
|
|
|
-// /*
|
|
|
-// *保存余额到余额收支记录
|
|
|
-// */
|
|
|
-// if (1 == balancePayFlag && MathUtil.compare(balancePayFee, 0) > 0) {
|
|
|
-// // 余额支付标识,0不使用,1使用
|
|
|
-// saveBalanceRecord(balancePayFee, mainOrder.getOrderId().intValue(), user.getUserId());
|
|
|
-// //保存余额到收款记录
|
|
|
-// if (cartType != 3) {
|
|
|
-// saveDiscernReceipt(balancePayFee, mainOrder.getOrderId().intValue());
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-
|
|
|
-//
|
|
|
-// /*
|
|
|
-// * pc商城提交订单,保存更新用户增值税发票
|
|
|
-// */
|
|
|
-// if ("1".equals(orderSource) && "2".equals(invoice.getType())) {
|
|
|
-// InvoiceVo userInvoiceVo = new InvoiceVo();
|
|
|
-// BeanUtils.copyProperties(invoice, userInvoiceVo);
|
|
|
-// userInvoiceVo.setUserId(clubUserId.longValue());
|
|
|
-// String userInvoiceId = String.valueOf(orderInvoice.get("id"));
|
|
|
-// if (org.apache.commons.lang.StringUtils.isBlank(userInvoiceId)) {
|
|
|
-// personalCenterDao.invoice(userInvoiceVo);
|
|
|
-// } else {
|
|
|
-// userInvoiceVo.setId(Long.valueOf(userInvoiceId));
|
|
|
-// personalCenterDao.updateInvoice(userInvoiceVo);
|
|
|
-// }
|
|
|
-// log.info("pc商城提交订单,保存更新用户增值税发票>>>>>>>userId: " + clubUserId);
|
|
|
-// }
|
|
|
-//
|
|
|
-// //保存采美豆使用记录
|
|
|
-// if (userBeans > 0) {
|
|
|
-// UserBeansHistoryPo beansHistory = new UserBeansHistoryPo();
|
|
|
-// beansHistory.setUserId(user.getUserId());
|
|
|
-// beansHistory.setOrderId(mainOrder.getOrderId().intValue());
|
|
|
-// beansHistory.setBeansType(10);
|
|
|
-// beansHistory.setType(2);
|
|
|
-// beansHistory.setNum(userBeans);
|
|
|
-// beansHistory.setPushStatus(0);
|
|
|
-// beansHistory.setAddTime(date);
|
|
|
-// payDao.insertBeansHistory(beansHistory);
|
|
|
-// int beans = user.getUserBeans() - userBeans;
|
|
|
-// payDao.updateUserBeans(user.getUserId().longValue(), beans);
|
|
|
-// }
|
|
|
-//
|
|
|
// log.info("******************** 提交订单逻辑处理 end *******************");
|
|
|
// /*
|
|
|
// * 构造返回参数
|
|
@@ -1199,10 +1249,10 @@ public class SubmitServiceImpl implements SubmitService {
|
|
|
// "您可关注采美公众号或者访问采美微信小程序和网站查看并支付订单。平台公众号:微信搜索“采美365网”; 微信小程序:微信搜索“采美采购商城”;网址:www.caimei365.com/t/" + shortLink;
|
|
|
// boolean sendSms = orderPushService.getSendSms(3, user.getBindMobile(), content);
|
|
|
// if (!sendSms) {
|
|
|
-// log.info("下单推送失败,orderId>>>>" + mainOrder.getOrderId());
|
|
|
+// log.info("下单推送失败,orderId>>>>" + mainOrder.getOrderId());
|
|
|
// }
|
|
|
// }
|
|
|
-//
|
|
|
+
|
|
|
// if (isPaySuccessFlag) {
|
|
|
// // 余额抵扣成功
|
|
|
// // 1提交成功[且支付完成]
|