|
@@ -1708,7 +1708,15 @@ public class OrderServiceImpl implements OrderService {
|
|
goodsDto.put("goodsSn",goodsEntity.getGoodsSn());
|
|
goodsDto.put("goodsSn",goodsEntity.getGoodsSn());
|
|
goodsDto.put("productId",goodsEntity.getProductId());
|
|
goodsDto.put("productId",goodsEntity.getProductId());
|
|
goodsDto.put("storeMarketPrice",goodsEntity.getStoreMarketPrice());
|
|
goodsDto.put("storeMarketPrice",goodsEntity.getStoreMarketPrice());
|
|
- goodsDto.put("storeRetailPrice",goodsEntity.getStoreRetailPrice());
|
|
|
|
|
|
+
|
|
|
|
+ if(goodsDto.get("actualPaymentAmount") instanceof Double){
|
|
|
|
+ goodsDto.put("storeRetailPrice",new BigDecimal((Double)goodsDto.get("actualPaymentAmount")));
|
|
|
|
+ }else if(goodsDto.get("actualPaymentAmount") instanceof Integer){
|
|
|
|
+ goodsDto.put("storeRetailPrice",new BigDecimal((Integer)goodsDto.get("actualPaymentAmount")));
|
|
|
|
+ }else if(goodsDto.get("actualPaymentAmount") instanceof Float){
|
|
|
|
+ goodsDto.put("storeRetailPrice",new BigDecimal((Float)goodsDto.get("actualPaymentAmount")));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
//取得规格的信息,判断规格库存
|
|
//取得规格的信息,判断规格库存
|
|
ProductStoreRelaEntity productInfo = productStoreRelaDao
|
|
ProductStoreRelaEntity productInfo = productStoreRelaDao
|
|
@@ -1720,27 +1728,29 @@ public class OrderServiceImpl implements OrderService {
|
|
resultObj.put("errmsg", "库存不足,仅剩余" + productInfo.getStockNum());
|
|
resultObj.put("errmsg", "库存不足,仅剩余" + productInfo.getStockNum());
|
|
return resultObj;
|
|
return resultObj;
|
|
} else {
|
|
} else {
|
|
-
|
|
|
|
// 判断销售价是否低于底线价
|
|
// 判断销售价是否低于底线价
|
|
- BigDecimal bottomLinePrice = new BigDecimal(productInfo.getBottomLinePrice());
|
|
|
|
- if (goodsEntity.getStoreRetailPrice().compareTo(bottomLinePrice) <= -1) {
|
|
|
|
- LOGGER.error("销售价格小于底线价格");
|
|
|
|
-
|
|
|
|
- // 记录该信息,到价格过低日志表中,这里没有活动id
|
|
|
|
- Mall2LowPriceWarningEntity lowPriceWarningEntity = new Mall2LowPriceWarningEntity();
|
|
|
|
- lowPriceWarningEntity.setSalePrice(goodsEntity.getStoreRetailPrice());
|
|
|
|
- lowPriceWarningEntity.setWarningPrice(bottomLinePrice);
|
|
|
|
- lowPriceWarningEntity.setSku(goodsEntity.getGoodsSn());
|
|
|
|
- lowPriceWarningEntity.setWarningType("00");
|
|
|
|
- lowPriceWarningEntity.setStoreId(storeId+"");
|
|
|
|
- lowPriceWarningEntity.setCreateTime(new Date());
|
|
|
|
-
|
|
|
|
- lowPriceWarningDao.save(lowPriceWarningEntity);
|
|
|
|
- resultObj.put("errno", 400);
|
|
|
|
- resultObj.put("errmsg", "商品"+goodsEntity.getName()+"的销售价格小于底线价格");
|
|
|
|
- return resultObj;
|
|
|
|
|
|
+ if(productInfo.getBottomLinePrice() != null){
|
|
|
|
+ BigDecimal bottomLinePrice = new BigDecimal(productInfo.getBottomLinePrice());
|
|
|
|
+ if (goodsEntity.getStoreRetailPrice().compareTo(bottomLinePrice) <= -1) {
|
|
|
|
+ LOGGER.error("销售价格小于底线价格");
|
|
|
|
+
|
|
|
|
+ // 记录该信息,到价格过低日志表中,这里没有活动id
|
|
|
|
+ Mall2LowPriceWarningEntity lowPriceWarningEntity = new Mall2LowPriceWarningEntity();
|
|
|
|
+ lowPriceWarningEntity.setSalePrice(goodsEntity.getStoreRetailPrice());
|
|
|
|
+ lowPriceWarningEntity.setWarningPrice(bottomLinePrice);
|
|
|
|
+ lowPriceWarningEntity.setSku(goodsEntity.getGoodsSn());
|
|
|
|
+ lowPriceWarningEntity.setWarningType("00");
|
|
|
|
+ lowPriceWarningEntity.setStoreId(storeId+"");
|
|
|
|
+ lowPriceWarningEntity.setCreateTime(new Date());
|
|
|
|
+
|
|
|
|
+ lowPriceWarningDao.save(lowPriceWarningEntity);
|
|
|
|
+ resultObj.put("errno", 400);
|
|
|
|
+ resultObj.put("errmsg", "商品"+goodsEntity.getName()+"的销售价格小于底线价格");
|
|
|
|
+ return resultObj;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
productInfo.setStockNum(productInfo.getStockNum() - sellVolume);
|
|
productInfo.setStockNum(productInfo.getStockNum() - sellVolume);
|
|
productInfo.setStoreId(Long.valueOf(storeId));
|
|
productInfo.setStoreId(Long.valueOf(storeId));
|
|
productInfo.addSellVolume();
|
|
productInfo.addSellVolume();
|
|
@@ -1753,10 +1763,20 @@ public class OrderServiceImpl implements OrderService {
|
|
goodsDao.update(goodsEntity);
|
|
goodsDao.update(goodsEntity);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // 实际取的是门店商品的价格,所以借这个字段来存储销售价
|
|
|
|
- goodsEntity.setStoreRetailPrice(productInfo.getRetailPrice());
|
|
|
|
|
|
+ ;
|
|
|
|
+ if(goodsDto.get("actualPaymentAmount") instanceof Double){
|
|
|
|
+ goodsEntity.setStoreRetailPrice(new BigDecimal((Double)goodsDto.get("actualPaymentAmount")));
|
|
|
|
+ }else if(goodsDto.get("actualPaymentAmount") instanceof Integer){
|
|
|
|
+ goodsEntity.setStoreRetailPrice(new BigDecimal((Integer)goodsDto.get("actualPaymentAmount")));
|
|
|
|
+ }else if(goodsDto.get("actualPaymentAmount") instanceof Float){
|
|
|
|
+ goodsEntity.setStoreRetailPrice(new BigDecimal((Float)goodsDto.get("actualPaymentAmount")));
|
|
|
|
+ }
|
|
|
|
+// goodsEntity.setStoreRetailPrice(productInfo.getRetailPrice());
|
|
// 借用这个字段来存储购买数
|
|
// 借用这个字段来存储购买数
|
|
goodsEntity.setGoodsNumber(sellVolume);
|
|
goodsEntity.setGoodsNumber(sellVolume);
|
|
|
|
+
|
|
|
|
+ goodsEntity.setActivity((String) goodsDto.get("activity"));
|
|
|
|
+
|
|
goodsEntities.add(goodsEntity);
|
|
goodsEntities.add(goodsEntity);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1786,51 +1806,8 @@ public class OrderServiceImpl implements OrderService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // 根据活动形式来查询
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // 优惠金额
|
|
|
|
|
|
+// // 优惠金额
|
|
BigDecimal disCountAmount = new BigDecimal(0);
|
|
BigDecimal disCountAmount = new BigDecimal(0);
|
|
- // 活动id
|
|
|
|
- Integer topicId = 0;
|
|
|
|
- // 查询活动类别id
|
|
|
|
- MkStorePromTypeEntity mkStorePromEntity = storePromTypeDao.queryByName("周活动");
|
|
|
|
- // 根据门店id和活动类别查询该门店是否有活动
|
|
|
|
- StoreTopicEntity storeTopic = storeTopicDao.queryByStoreIdAndType(storeId,mkStorePromEntity.getPromTypeId());
|
|
|
|
- // 判断是否启用了活动,如果启用了活动。则去查询活动价
|
|
|
|
- if(storeTopic != null){
|
|
|
|
- for(GoodsEntity goodsEntity :goodsEntities){
|
|
|
|
- // 根据活动id跟商品id,查询该商品的价格
|
|
|
|
- Mk2GoodsTopicPriceEntity goodsTopicPriceEntity =
|
|
|
|
- mk2GoodsTopicPriceDao.queryByTopicIdAndGoodsId(storeTopic.getId(),goodsEntity.getSku());
|
|
|
|
- if (goodsEntity.getStoreRetailPrice().compareTo(goodsTopicPriceEntity.getTopicPrice()) <= -1) {
|
|
|
|
- LOGGER.error("销售价格小于活动价格");
|
|
|
|
-
|
|
|
|
- // 记录该信息,到价格过低日志表中,这里有活动id
|
|
|
|
- Mall2LowPriceWarningEntity lowPriceWarningEntity = new Mall2LowPriceWarningEntity();
|
|
|
|
- lowPriceWarningEntity.setSalePrice(goodsEntity.getStoreRetailPrice());
|
|
|
|
- lowPriceWarningEntity.setWarningPrice(goodsTopicPriceEntity.getTopicPrice());
|
|
|
|
- lowPriceWarningEntity.setActivityId(goodsTopicPriceEntity.getTopicId());
|
|
|
|
- lowPriceWarningEntity.setSku(goodsEntity.getGoodsSn());
|
|
|
|
- lowPriceWarningEntity.setWarningType("00");
|
|
|
|
- lowPriceWarningEntity.setStoreId(storeId+"");
|
|
|
|
- lowPriceWarningEntity.setCreateTime(new Date());
|
|
|
|
-
|
|
|
|
- lowPriceWarningDao.save(lowPriceWarningEntity);
|
|
|
|
- resultObj.put("errno", 400);
|
|
|
|
- resultObj.put("errmsg", "商品"+goodsEntity.getName()+"的销售价格小于活动价格");
|
|
|
|
- return resultObj;
|
|
|
|
- }
|
|
|
|
- goodsEntity.setStoreRetailPrice(goodsTopicPriceEntity.getTopicPrice());
|
|
|
|
- }
|
|
|
|
- topicId = storeTopic.getId();
|
|
|
|
-
|
|
|
|
- }else{
|
|
|
|
- disCountAmount = getDisCountAmout(goodsEntities);
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
// 判断该用户是否是生日
|
|
// 判断该用户是否是生日
|
|
@@ -1854,9 +1831,9 @@ public class OrderServiceImpl implements OrderService {
|
|
String merchOrderSn = "EMATO" + CommonUtil.generateOrderNumber();
|
|
String merchOrderSn = "EMATO" + CommonUtil.generateOrderNumber();
|
|
OrderVo order = setOrderVo(goodsEntities, userEntity,storeId.longValue(), user.getMerchSn(),disCountAmount);
|
|
OrderVo order = setOrderVo(goodsEntities, userEntity,storeId.longValue(), user.getMerchSn(),disCountAmount);
|
|
order.setStore_id(storeId.longValue());
|
|
order.setStore_id(storeId.longValue());
|
|
- if(storeTopic != null){
|
|
|
|
- order.setActivity_id(storeTopic.getId().longValue());
|
|
|
|
- }
|
|
|
|
|
|
+// if(storeTopic != null){
|
|
|
|
+// order.setActivity_id(storeTopic.getId().longValue());
|
|
|
|
+// }
|
|
order.setMerchOrderSn(merchOrderSn);
|
|
order.setMerchOrderSn(merchOrderSn);
|
|
|
|
|
|
//插入订单信息和订单商品
|
|
//插入订单信息和订单商品
|
|
@@ -1903,7 +1880,7 @@ public class OrderServiceImpl implements OrderService {
|
|
// 微信支付
|
|
// 微信支付
|
|
// wxPay(user, parCode, resultObj, order, processRecordEntity, orderWXPayRecordCurrent, store);
|
|
// wxPay(user, parCode, resultObj, order, processRecordEntity, orderWXPayRecordCurrent, store);
|
|
// 支付宝支付
|
|
// 支付宝支付
|
|
- AliPay(user, parCode , order, processRecordEntity, orderWXPayRecordCurrent, store);
|
|
|
|
|
|
+// AliPay(user, parCode , order, processRecordEntity, orderWXPayRecordCurrent, store);
|
|
resultObj.put("shopName",store.getStoreName()); // 根据门店编号查询
|
|
resultObj.put("shopName",store.getStoreName()); // 根据门店编号查询
|
|
resultObj.put("userName",user.getUsername());
|
|
resultObj.put("userName",user.getUsername());
|
|
|
|
|
|
@@ -1928,7 +1905,7 @@ public class OrderServiceImpl implements OrderService {
|
|
saleRecordEntity.setOrderSn(order.getOrder_sn());
|
|
saleRecordEntity.setOrderSn(order.getOrder_sn());
|
|
saleRecordEntity.setSallerId(userId+"");
|
|
saleRecordEntity.setSallerId(userId+"");
|
|
saleRecordEntity.setSalesTime(new Date());
|
|
saleRecordEntity.setSalesTime(new Date());
|
|
- saleRecordEntity.setDiscountId(topicId + "");
|
|
|
|
|
|
+// saleRecordEntity.setDiscountId(topicId + "");
|
|
saleRecordEntity.setCreateTime(new Date());
|
|
saleRecordEntity.setCreateTime(new Date());
|
|
saleRecordDao.save(saleRecordEntity);
|
|
saleRecordDao.save(saleRecordEntity);
|
|
}
|
|
}
|
|
@@ -1988,98 +1965,98 @@ public class OrderServiceImpl implements OrderService {
|
|
return resultObj;
|
|
return resultObj;
|
|
}
|
|
}
|
|
|
|
|
|
- private BigDecimal getDisCountAmout(List<GoodsEntity> goodsEntities) {
|
|
|
|
- BigDecimal disCountAmount;
|
|
|
|
- // TODO 生成订单之前,先查询是否有优惠券或者满减
|
|
|
|
- // TODO 20200610 要修改成全部商品
|
|
|
|
- // 优惠券的集合
|
|
|
|
- List<MkStoreTicketDiscountEntity> mkStoreTicketDiscountEntities = new ArrayList<>();
|
|
|
|
- // 满减的集合
|
|
|
|
- List<MkStoreCampMinusLevelEntity> mkStoreCampMinusEntities = new ArrayList<>();
|
|
|
|
- // 存商品跟金额的关系
|
|
|
|
- Map<Long,BigDecimal> moneyMap = new HashMap<>();
|
|
|
|
- // 商品总价
|
|
|
|
- BigDecimal totalPrice = new BigDecimal(0);
|
|
|
|
-
|
|
|
|
- for(GoodsEntity goodsEntity : goodsEntities){
|
|
|
|
- Long goodsId = goodsEntity.getId();
|
|
|
|
- // 计算该商品的价格
|
|
|
|
- BigDecimal goodsPrice = goodsEntity.getStoreRetailPrice().multiply(new BigDecimal(goodsEntity.getGoodsNumber())).setScale(2, RoundingMode.HALF_UP);
|
|
|
|
- moneyMap.put(goodsId,goodsPrice);
|
|
|
|
- totalPrice = totalPrice.add(goodsPrice);
|
|
|
|
- // 查询该商品id是否有优惠券
|
|
|
|
- List<MkStoreTicketDiscountEntity> mkStoreTicketDiscountEntity = mkStoreTicketDiscountService.queryByGoodsId(goodsId);
|
|
|
|
- if(mkStoreTicketDiscountEntity != null) {
|
|
|
|
- mkStoreTicketDiscountEntities.addAll(mkStoreTicketDiscountEntity);
|
|
|
|
- }
|
|
|
|
- // 查询该商品id是否有满减
|
|
|
|
- List<MkStoreCampMinusLevelEntity> mkStoreCampMinusEntity = mkStoreCampMinusService.queryByGoodsId(goodsId);
|
|
|
|
- if(mkStoreCampMinusEntity != null) {
|
|
|
|
- mkStoreCampMinusEntities.addAll(mkStoreCampMinusEntity);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 满减优惠的金额
|
|
|
|
- BigDecimal campDisCountAmount = new BigDecimal(0);
|
|
|
|
- if(mkStoreCampMinusEntities.size() > 0){
|
|
|
|
- // 上一次所需金额,用于取最大的优惠力度
|
|
|
|
- BigDecimal lastAmount = new BigDecimal(0);
|
|
|
|
- for (int i = 0 ; i < mkStoreCampMinusEntities.size() ; i++){
|
|
|
|
- MkStoreCampMinusLevelEntity mkStoreCampMinusLevelEntity = mkStoreCampMinusEntities.get(i);
|
|
|
|
- // TODO 20200610还有满多少件,跟满多少元打折的,逻辑复杂,下次开发
|
|
|
|
- BigDecimal discCond = mkStoreCampMinusLevelEntity.getYuanMinusCond();
|
|
|
|
- // 判断这次金额是否大于上次金额,如果不大于,直接continue
|
|
|
|
- if(discCond.compareTo(lastAmount) > 0){
|
|
|
|
- // 如果总金额大于所需金额,则可以使用该优惠券,记录该优惠券的角标,金额跟优惠的钱
|
|
|
|
- if(totalPrice.compareTo(discCond) > 0){
|
|
|
|
- // 记录上一次金额
|
|
|
|
- lastAmount = discCond;
|
|
|
|
- campDisCountAmount = mkStoreCampMinusLevelEntity.getYuanMinusPref();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // 优惠券优惠的金额
|
|
|
|
- BigDecimal ticketDisCountAmount = new BigDecimal(0);
|
|
|
|
- if(mkStoreTicketDiscountEntities.size() > 0){
|
|
|
|
- // 上一次所需金额,用于取最大的优惠力度
|
|
|
|
- BigDecimal lastAmount = new BigDecimal(0);
|
|
|
|
- BigDecimal lastRadio = new BigDecimal(0);
|
|
|
|
- for (int i = 0 ; i < mkStoreTicketDiscountEntities.size() ; i++){
|
|
|
|
- MkStoreTicketDiscountEntity mkStoreTicketDiscountEntity = mkStoreTicketDiscountEntities.get(i);
|
|
|
|
- // 代金券所需金额
|
|
|
|
- // TODO 20200610还有折扣券的,逻辑较为复杂,下次在开发
|
|
|
|
-
|
|
|
|
- if("00".equals(mkStoreTicketDiscountEntity.getApplyType())){
|
|
|
|
- BigDecimal discCond = mkStoreTicketDiscountEntity.getVoucherCond();
|
|
|
|
- // 判断这次金额是否大于上次金额,如果不大于,直接continue
|
|
|
|
- if(discCond.compareTo(lastAmount) > 0){
|
|
|
|
- // 如果总金额大于所需金额,则可以使用该优惠券,记录该优惠券的角标,金额跟优惠的钱
|
|
|
|
- if(totalPrice.compareTo(discCond) > 0){
|
|
|
|
- // 记录上一次金额
|
|
|
|
- lastAmount = discCond;
|
|
|
|
- ticketDisCountAmount = mkStoreTicketDiscountEntity.getVoucherMoney();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }else if("01".equals(mkStoreTicketDiscountEntity.getApplyType())){
|
|
|
|
- BigDecimal discCond = mkStoreTicketDiscountEntity.getDiscCond();
|
|
|
|
- if(totalPrice.compareTo(discCond) > 0){
|
|
|
|
- // 打的折扣
|
|
|
|
- lastRadio = mkStoreTicketDiscountEntity.getDiscRatio();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- disCountAmount = ticketDisCountAmount.compareTo(campDisCountAmount) > 0 ? ticketDisCountAmount : campDisCountAmount;
|
|
|
|
- return disCountAmount;
|
|
|
|
- }
|
|
|
|
|
|
+// private BigDecimal getDisCountAmout(List<GoodsEntity> goodsEntities) {
|
|
|
|
+// BigDecimal disCountAmount;
|
|
|
|
+// // TODO 生成订单之前,先查询是否有优惠券或者满减
|
|
|
|
+// // TODO 20200610 要修改成全部商品
|
|
|
|
+// // 优惠券的集合
|
|
|
|
+// List<MkStoreTicketDiscountEntity> mkStoreTicketDiscountEntities = new ArrayList<>();
|
|
|
|
+// // 满减的集合
|
|
|
|
+// List<MkStoreCampMinusLevelEntity> mkStoreCampMinusEntities = new ArrayList<>();
|
|
|
|
+// // 存商品跟金额的关系
|
|
|
|
+// Map<Long,BigDecimal> moneyMap = new HashMap<>();
|
|
|
|
+// // 商品总价
|
|
|
|
+// BigDecimal totalPrice = new BigDecimal(0);
|
|
|
|
+//
|
|
|
|
+// for(GoodsEntity goodsEntity : goodsEntities){
|
|
|
|
+// Long goodsId = goodsEntity.getId();
|
|
|
|
+// // 计算该商品的价格
|
|
|
|
+// BigDecimal goodsPrice = goodsEntity.getStoreRetailPrice().multiply(new BigDecimal(goodsEntity.getGoodsNumber())).setScale(2, RoundingMode.HALF_UP);
|
|
|
|
+// moneyMap.put(goodsId,goodsPrice);
|
|
|
|
+// totalPrice = totalPrice.add(goodsPrice);
|
|
|
|
+// // 查询该商品id是否有优惠券
|
|
|
|
+// List<MkStoreTicketDiscountEntity> mkStoreTicketDiscountEntity = mkStoreTicketDiscountService.queryByGoodsId(goodsId);
|
|
|
|
+// if(mkStoreTicketDiscountEntity != null) {
|
|
|
|
+// mkStoreTicketDiscountEntities.addAll(mkStoreTicketDiscountEntity);
|
|
|
|
+// }
|
|
|
|
+// // 查询该商品id是否有满减
|
|
|
|
+// List<MkStoreCampMinusLevelEntity> mkStoreCampMinusEntity = mkStoreCampMinusService.queryByGoodsId(goodsId);
|
|
|
|
+// if(mkStoreCampMinusEntity != null) {
|
|
|
|
+// mkStoreCampMinusEntities.addAll(mkStoreCampMinusEntity);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// // 满减优惠的金额
|
|
|
|
+// BigDecimal campDisCountAmount = new BigDecimal(0);
|
|
|
|
+// if(mkStoreCampMinusEntities.size() > 0){
|
|
|
|
+// // 上一次所需金额,用于取最大的优惠力度
|
|
|
|
+// BigDecimal lastAmount = new BigDecimal(0);
|
|
|
|
+// for (int i = 0 ; i < mkStoreCampMinusEntities.size() ; i++){
|
|
|
|
+// MkStoreCampMinusLevelEntity mkStoreCampMinusLevelEntity = mkStoreCampMinusEntities.get(i);
|
|
|
|
+// // TODO 20200610还有满多少件,跟满多少元打折的,逻辑复杂,下次开发
|
|
|
|
+// BigDecimal discCond = mkStoreCampMinusLevelEntity.getYuanMinusCond();
|
|
|
|
+// // 判断这次金额是否大于上次金额,如果不大于,直接continue
|
|
|
|
+// if(discCond.compareTo(lastAmount) > 0){
|
|
|
|
+// // 如果总金额大于所需金额,则可以使用该优惠券,记录该优惠券的角标,金额跟优惠的钱
|
|
|
|
+// if(totalPrice.compareTo(discCond) > 0){
|
|
|
|
+// // 记录上一次金额
|
|
|
|
+// lastAmount = discCond;
|
|
|
|
+// campDisCountAmount = mkStoreCampMinusLevelEntity.getYuanMinusPref();
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// // 优惠券优惠的金额
|
|
|
|
+// BigDecimal ticketDisCountAmount = new BigDecimal(0);
|
|
|
|
+// if(mkStoreTicketDiscountEntities.size() > 0){
|
|
|
|
+// // 上一次所需金额,用于取最大的优惠力度
|
|
|
|
+// BigDecimal lastAmount = new BigDecimal(0);
|
|
|
|
+// BigDecimal lastRadio = new BigDecimal(0);
|
|
|
|
+// for (int i = 0 ; i < mkStoreTicketDiscountEntities.size() ; i++){
|
|
|
|
+// MkStoreTicketDiscountEntity mkStoreTicketDiscountEntity = mkStoreTicketDiscountEntities.get(i);
|
|
|
|
+// // 代金券所需金额
|
|
|
|
+// // TODO 20200610还有折扣券的,逻辑较为复杂,下次在开发
|
|
|
|
+//
|
|
|
|
+// if("00".equals(mkStoreTicketDiscountEntity.getApplyType())){
|
|
|
|
+// BigDecimal discCond = mkStoreTicketDiscountEntity.getVoucherCond();
|
|
|
|
+// // 判断这次金额是否大于上次金额,如果不大于,直接continue
|
|
|
|
+// if(discCond.compareTo(lastAmount) > 0){
|
|
|
|
+// // 如果总金额大于所需金额,则可以使用该优惠券,记录该优惠券的角标,金额跟优惠的钱
|
|
|
|
+// if(totalPrice.compareTo(discCond) > 0){
|
|
|
|
+// // 记录上一次金额
|
|
|
|
+// lastAmount = discCond;
|
|
|
|
+// ticketDisCountAmount = mkStoreTicketDiscountEntity.getVoucherMoney();
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }else if("01".equals(mkStoreTicketDiscountEntity.getApplyType())){
|
|
|
|
+// BigDecimal discCond = mkStoreTicketDiscountEntity.getDiscCond();
|
|
|
|
+// if(totalPrice.compareTo(discCond) > 0){
|
|
|
|
+// // 打的折扣
|
|
|
|
+// lastRadio = mkStoreTicketDiscountEntity.getDiscRatio();
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// disCountAmount = ticketDisCountAmount.compareTo(campDisCountAmount) > 0 ? ticketDisCountAmount : campDisCountAmount;
|
|
|
|
+// return disCountAmount;
|
|
|
|
+// }
|
|
|
|
|
|
private void AliPay(SysUserEntity user, String parCode, OrderVo order, OrderProcessRecordEntity processRecordEntity, OrderWXPayRecordEntity orderWXPayRecordCurrent, StoreEntity store) throws Exception {
|
|
private void AliPay(SysUserEntity user, String parCode, OrderVo order, OrderProcessRecordEntity processRecordEntity, OrderWXPayRecordEntity orderWXPayRecordCurrent, StoreEntity store) throws Exception {
|
|
|
|
|
|
@@ -2439,7 +2416,7 @@ public class OrderServiceImpl implements OrderService {
|
|
orderGoodsVo.setOrderBizType(Dict.orderBizType.item_10.getItem());
|
|
orderGoodsVo.setOrderBizType(Dict.orderBizType.item_10.getItem());
|
|
orderGoodsVo.setCreateTime(new Date());
|
|
orderGoodsVo.setCreateTime(new Date());
|
|
orderGoodsVo.setModTime(new Date());
|
|
orderGoodsVo.setModTime(new Date());
|
|
-
|
|
|
|
|
|
+ orderGoodsVo.setActivity(goodsDto.getActivity());
|
|
|
|
|
|
orderGoodsVo.setGoodsRate(goodsDto.getGoodsRate());
|
|
orderGoodsVo.setGoodsRate(goodsDto.getGoodsRate());
|
|
orderGoodsVo.setSku(goodsDto.getSku());
|
|
orderGoodsVo.setSku(goodsDto.getSku());
|