1
0
فهرست منبع

Merge branch 'master' of wangchaoqun/kmall-haikong into master

王超群 3 سال پیش
والد
کامیت
052a54d932

+ 3 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/order/OrderController.java

@@ -671,6 +671,9 @@ public class OrderController {
             goodsTax = goodsTax.multiply(new BigDecimal(orderGoodsEntity.getNumber())).setScale(2,RoundingMode.HALF_UP);
             orderGoodsEntity.setTax(goodsTax);
             tax = tax.add(goodsTax).setScale(2,RoundingMode.HALF_UP);
+            // 计算其他优惠 = 总优惠减去积分抵扣优惠
+            BigDecimal otherPrice = orderGoodsEntity.getDiscountedPrice().subtract(orderGoodsEntity.getDeductionPrice());
+            orderGoodsEntity.setOtherDiscountedPrice(otherPrice);
 
 //            BigDecimal goodsTax = orderGoodsEntity.getMarketPrice().divide(new BigDecimal(1).add(orderGoodsEntity.getGoodsRate()),2,RoundingMode.HALF_DOWN).multiply(orderGoodsEntity.getGoodsRate())
 //                    .multiply(new BigDecimal(orderGoodsEntity.getNumber())).setScale(2,RoundingMode.HALF_DOWN);

+ 2 - 1
kmall-admin/src/main/java/com/kmall/admin/dao/mk/MkActivitiesPresentIntegralDao.java

@@ -2,6 +2,7 @@ package com.kmall.admin.dao.mk;
 
 import com.kmall.admin.entity.mk.MkActivitiesPresentIntegralEntity;
 import com.kmall.manager.dao.BaseDao;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -21,7 +22,7 @@ public interface MkActivitiesPresentIntegralDao extends BaseDao<MkActivitiesPres
      * @param mkaTopic
      * @return
      */
-    List<MkActivitiesPresentIntegralEntity> querySkuByNow(String storeId, String currentTime, String mkaTopic);
+    List<MkActivitiesPresentIntegralEntity> querySkuByNow(@Param("storeId") String storeId, @Param("currentTime")String currentTime, @Param("mkaTopic")String mkaTopic);
 
     Integer deleteByMkaId(int mkaId);
 }

+ 14 - 0
kmall-admin/src/main/java/com/kmall/admin/dto/GoodsDetailsDto.java

@@ -95,6 +95,12 @@ public class GoodsDetailsDto {
     private BigDecimal deductionPrice;
 
     /**
+     * 其他优惠金额
+     */
+    private BigDecimal otherDiscountedPrice = new BigDecimal(0);
+
+
+    /**
      * 仓库编码
      */
     private String warehouseSn;
@@ -114,6 +120,14 @@ public class GoodsDetailsDto {
      */
     private String inventoryType;
 
+    public BigDecimal getOtherDiscountedPrice() {
+        return otherDiscountedPrice;
+    }
+
+    public void setOtherDiscountedPrice(BigDecimal otherDiscountedPrice) {
+        this.otherDiscountedPrice = otherDiscountedPrice;
+    }
+
     public BigDecimal getRmarketPrice() {
         return rmarketPrice;
     }

+ 12 - 0
kmall-admin/src/main/java/com/kmall/admin/entity/OrderGoodsEntity.java

@@ -87,6 +87,18 @@ public class OrderGoodsEntity implements Serializable {
 	 */
 	private BigDecimal deductionPrice;
 
+	/**
+	 * 其他优惠金额
+	 */
+	private BigDecimal otherDiscountedPrice = new BigDecimal(0);
+
+	public BigDecimal getOtherDiscountedPrice() {
+		return otherDiscountedPrice;
+	}
+
+	public void setOtherDiscountedPrice(BigDecimal otherDiscountedPrice) {
+		this.otherDiscountedPrice = otherDiscountedPrice;
+	}
 
 	public BigDecimal getDeductionPrice() {
 		return deductionPrice;

+ 17 - 1
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java

@@ -4588,6 +4588,8 @@ public class OrderServiceImpl implements OrderService {
                             goodsDetailsDto.setActivity(Constants.ActivityTopicEnum.LSCX.getTopicName());
                             // 优惠价格 应该用优惠后的特价价格 乘以 数量
                             goodsDetailsDto.setDiscountedPrice((retailPrice.subtract(activityPrice)).multiply(new BigDecimal(goodsDetailsDto.getSellVolume())));
+                            // 不涉及到积分时  其他优惠就是优惠金额
+                            goodsDetailsDto.setOtherDiscountedPrice(goodsDetailsDto.getDiscountedPrice());
                             goodsDetailsDto.setDeductionPrice(null);
                             activityFlag.set(false);
                             promotionActivityFlag.set(true);
@@ -4630,6 +4632,8 @@ public class OrderServiceImpl implements OrderService {
                                     goodsDetailsDto.setActivity(Constants.ActivityTopicEnum.MZ.getTopicName());
                                     goodsDetailsDto.setGiftNumber(mkActivitiesFullGiftEntity.getGiftNumber());
                                     goodsDetailsDto.setDiscountedPrice(goodsEntity.getRetailPrice());
+                                    // 不涉及到积分时  其他优惠就是优惠金额
+                                    goodsDetailsDto.setOtherDiscountedPrice(goodsDetailsDto.getDiscountedPrice());
                                     goodsDetailsDto.setDeductionPrice(null);
                                     // 添加进商品详情列表
                                     goodsDetailsDtos.add(goodsDetailsDto);
@@ -4663,6 +4667,8 @@ public class OrderServiceImpl implements OrderService {
                                     goodsDetailsDto.setActivity(Constants.ActivityTopicEnum.MZ.getTopicName());
                                     goodsDetailsDto.setGiftNumber(mkActivitiesFullGiftEntity.getGiftNumber());
                                     goodsDetailsDto.setDiscountedPrice(goodsEntity.getRetailPrice());
+                                    // 不涉及到积分时  其他优惠就是优惠金额
+                                    goodsDetailsDto.setOtherDiscountedPrice(goodsDetailsDto.getDiscountedPrice());
                                     goodsDetailsDto.setDeductionPrice(null);
                                     // 添加进商品详情列表
                                     goodsDetailsDtos.add(goodsDetailsDto);
@@ -4720,6 +4726,8 @@ public class OrderServiceImpl implements OrderService {
                                     goodsDetailsDto.setGoodstaxes(String.valueOf(tax.multiply(new BigDecimal(goodsDetailsDto.getSellVolume()))));
                                     goodsDetailsDto.setActivity(Constants.ActivityTopicEnum.YHQ.getTopicName());
                                     goodsDetailsDto.setDiscountedPrice(retailPrice.subtract(discountAfterPrice));
+                                    // 不涉及到积分时  其他优惠就是优惠金额
+                                    goodsDetailsDto.setOtherDiscountedPrice(goodsDetailsDto.getDiscountedPrice());
                                     goodsDetailsDto.setDeductionPrice(null);
                                     goodsDetailsDtos.add(goodsDetailsDto);
                                     activityFlag.set(false);
@@ -4749,6 +4757,8 @@ public class OrderServiceImpl implements OrderService {
                                     goodsDetailsDto.setGoodstaxes(String.valueOf(tax.multiply(new BigDecimal(goodsDetailsDto.getSellVolume()))));
                                     goodsDetailsDto.setActivity(Constants.ActivityTopicEnum.YHQ.getTopicName());
                                     goodsDetailsDto.setDiscountedPrice(retailPrice.subtract(discountAfterPrice));
+                                    // 不涉及到积分时  其他优惠就是优惠金额
+                                    goodsDetailsDto.setOtherDiscountedPrice(goodsDetailsDto.getDiscountedPrice());
                                     goodsDetailsDto.setDeductionPrice(null);
                                     goodsDetailsDtos.add(goodsDetailsDto);
                                     activityFlag.set(false);
@@ -4779,6 +4789,8 @@ public class OrderServiceImpl implements OrderService {
                                         goodsDetailsDto.setGoodstaxes(String.valueOf(tax.multiply(new BigDecimal(goodsDetailsDto.getSellVolume()))));
                                         goodsDetailsDto.setActivity(Constants.ActivityTopicEnum.YHQ.getTopicName());
                                         goodsDetailsDto.setDiscountedPrice(retailPrice.subtract(discountAfterPrice));
+                                        // 不涉及到积分时  其他优惠就是优惠金额
+                                        goodsDetailsDto.setOtherDiscountedPrice(goodsDetailsDto.getDiscountedPrice());
                                         goodsDetailsDto.setDeductionPrice(null);
                                         goodsDetailsDtos.add(goodsDetailsDto);
                                         activityFlag.set(false);
@@ -4806,7 +4818,8 @@ public class OrderServiceImpl implements OrderService {
             queryGoodsVo.setTotalPrice(good.getActualPaymentAmount().multiply(BigDecimal.valueOf(good.getSellVolume())));
             orderTotalPrice = orderTotalPrice.add(good.getRetailPrice().multiply(BigDecimal.valueOf(good.getSellVolume())));// 订单总金额 改为用零售价*数量
             // 订单总价 总价减去 优惠活动的优惠价格 后续积分优惠 也从总金额中减去(打补丁操作
-            // 这块设计有问题 :后续积分优惠金额  由总金额减去积分抵扣金额 但没有处理其他活动的优惠金额  补丁内容:如果这里有参加其他活动的商品 优惠金额要在这里减去)
+            // 这块设计有问题 :后续积分优惠金额  由总金额减去积分抵扣金额 但没有处理其他活动的优惠金额
+            // 补丁内容:如果这里有参加其他活动的商品 优惠金额要在这里减去)
             orderTotalPrice = orderTotalPrice.subtract(good.getDiscountedPrice());
             goodsVos.add(queryGoodsVo);
         }
@@ -5099,6 +5112,9 @@ public class OrderServiceImpl implements OrderService {
                     }
                     // 设置总优惠金额
                     goodsDetailsDto.setDiscountedPrice(discountedPrice);
+                    // 设置其他优惠金额
+                    BigDecimal otherPrice = discountedPrice.subtract(goodsDetailsDto.getDeductionPrice());
+                    goodsDetailsDto.setOtherDiscountedPrice(otherPrice);
                     LOGGER.info("--------------------------------------------------------");
                     LOGGER.info("【计算优惠价】sku:【{}】,条码:【{}】积分抵扣{}元,抵扣积分{}分", sku, prodBarcode, goodsDetailsDto.getDiscountedPrice(), shareScore.intValue());
                     LOGGER.info("--------------------------------------------------------");

+ 1 - 1
kmall-admin/src/main/webapp/WEB-INF/page/sale/sale.html

@@ -190,7 +190,7 @@
                                 <td><h3>{{item.name}}</h3></td>
                                 <td> {{item.retailPrice}}</td>
                                 <td> {{item.deductionPrice}}</td>
-                                <td> {{item.discountedPrice - item.deductionPrice}}</td>
+                                <td> {{item.otherDiscountedPrice}}</td>
                                 <td> {{item.goodstaxes}}</td>
                                 <td> {{item.actualPaymentAmount}}</td>
                                 <td>

+ 1 - 1
kmall-admin/src/main/webapp/WEB-INF/page/shop/offilineOrderList.html

@@ -217,7 +217,7 @@
                         </td>
                         <td align="center">¥{{item.number * item.marketPrice}}</td>
                         <td align="center">¥{{item.deductionPrice}}</td>
-                        <td align="center">¥{{item.discountedPrice - item.deductionPrice}}</td>
+                        <td align="center">¥{{item.otherDiscountedPrice}}</td>
                         <td align="center">¥{{item.actualPaymentAmount}}</td>
                         <td align="center">¥{{item.actualPaymentAmount}}</td>
                         <td align="center">¥{{item.tax}}</td>