|
@@ -491,15 +491,15 @@ public class SubmitServiceImpl implements SubmitService {
|
|
promotions = baseMapper.getPromotionByProductId(productId);
|
|
promotions = baseMapper.getPromotionByProductId(productId);
|
|
}
|
|
}
|
|
// 计算单价
|
|
// 计算单价
|
|
- if (promotions != null) {
|
|
|
|
|
|
+ if (null != promotions || null != shopPromotions) {
|
|
// 是否包含活动商品(受订单未支付自动关闭时间影响) 0 否 1 是
|
|
// 是否包含活动商品(受订单未支付自动关闭时间影响) 0 否 1 是
|
|
hasActProductFlag = true;
|
|
hasActProductFlag = true;
|
|
// 关闭阶梯价格,活动优先
|
|
// 关闭阶梯价格,活动优先
|
|
product.setLadderPriceFlag(0);
|
|
product.setLadderPriceFlag(0);
|
|
- if (promotions.getType() == 1 && promotions.getMode() == 1) {
|
|
|
|
|
|
+ product.setActProduct(1);
|
|
|
|
+ if (null != promotions && promotions.getType() == 1 && promotions.getMode() == 1) {
|
|
discountPrice = promotions.getTouchPrice();
|
|
discountPrice = promotions.getTouchPrice();
|
|
}
|
|
}
|
|
- product.setActProduct(1);
|
|
|
|
} else if (1 == product.getLadderPriceFlag()) {
|
|
} else if (1 == product.getLadderPriceFlag()) {
|
|
// 启用了阶梯价格
|
|
// 启用了阶梯价格
|
|
List<LadderPriceVo> ladderPrices = baseMapper.getLadderPriceList(productId);
|
|
List<LadderPriceVo> ladderPrices = baseMapper.getLadderPriceList(productId);
|
|
@@ -1171,17 +1171,28 @@ public class SubmitServiceImpl implements SubmitService {
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
- * 保存订单发票信息
|
|
|
|
|
|
+ * 保存发票信息
|
|
*/
|
|
*/
|
|
if (1 == orderParamBo.getInvoiceType() || 2 == orderParamBo.getInvoiceType()) {
|
|
if (1 == orderParamBo.getInvoiceType() || 2 == orderParamBo.getInvoiceType()) {
|
|
- InvoicePo orderInvoice = orderParamBo.getOrderInvoice();
|
|
|
|
- // 开发票才保存
|
|
|
|
- orderInvoice.setOrderId(mainOrder.getOrderId());
|
|
|
|
- // 一个订单只有一条发票信息,删除老的订单增值税信息
|
|
|
|
- submitMapper.deleteOrderInvoiceByOrderId(mainOrder.getOrderId());
|
|
|
|
- // 保存 订单发票信息
|
|
|
|
- submitMapper.insertOrderInvoice(orderInvoice);
|
|
|
|
- log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>保存订单发票信息(insert[bp_order_invoice])orderId:" + mainOrder.getOrderId());
|
|
|
|
|
|
+ /*
|
|
|
|
+ * 更新订单增值税发票
|
|
|
|
+ */
|
|
|
|
+ InvoicePo orderInvoice = submitMapper.getOrderInvoice(mainOrder.getOrderId());
|
|
|
|
+ if (null != orderInvoice && null != orderInvoice.getId()) {
|
|
|
|
+ // 更新
|
|
|
|
+ BeanUtils.copyProperties(orderParamBo.getOrderInvoice(), orderInvoice);
|
|
|
|
+ orderInvoice.setOrderId(mainOrder.getOrderId());
|
|
|
|
+ submitMapper.updateOrderInvoice(orderInvoice);
|
|
|
|
+ log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>更新订单发票信息(update[bp_order_invoice])orderId:" + mainOrder.getOrderId());
|
|
|
|
+ } else {
|
|
|
|
+ // 新增
|
|
|
|
+ orderInvoice = new InvoicePo();
|
|
|
|
+ BeanUtils.copyProperties(orderParamBo.getOrderInvoice(), orderInvoice);
|
|
|
|
+ orderInvoice.setOrderId(mainOrder.getOrderId());
|
|
|
|
+ // 保存 订单发票信息
|
|
|
|
+ submitMapper.insertOrderInvoice(orderInvoice);
|
|
|
|
+ log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>保存订单发票信息(insert[bp_order_invoice])orderId:" + mainOrder.getOrderId());
|
|
|
|
+ }
|
|
/*
|
|
/*
|
|
* 更新用户增值税发票
|
|
* 更新用户增值税发票
|
|
*/
|
|
*/
|
|
@@ -1193,6 +1204,7 @@ public class SubmitServiceImpl implements SubmitService {
|
|
log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>更新用户增值税发票(update[cm_user_invoiceinfo])userId:" + mainOrder.getUserId());
|
|
log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>更新用户增值税发票(update[cm_user_invoiceinfo])userId:" + mainOrder.getUserId());
|
|
} else {
|
|
} else {
|
|
// 新增
|
|
// 新增
|
|
|
|
+ userInvoice = new InvoiceVo();
|
|
BeanUtils.copyProperties(orderInvoice, userInvoice);
|
|
BeanUtils.copyProperties(orderInvoice, userInvoice);
|
|
baseMapper.insertUserInvoiceByUserId(userInvoice);
|
|
baseMapper.insertUserInvoiceByUserId(userInvoice);
|
|
log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>新增用户增值税发票(insert[cm_user_invoiceinfo])userId:" + mainOrder.getUserId());
|
|
log.info("【提交订单】>>>>>>>>>>>>>>>>>>>>>>>>>>新增用户增值税发票(insert[cm_user_invoiceinfo])userId:" + mainOrder.getUserId());
|