mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-02 02:06:38 +08:00
Merge branch 'sit-Carl' into sit-Carl-lin-dev
This commit is contained in:
commit
6f8a8c628d
@ -437,6 +437,7 @@ public class OrderService {
|
|||||||
orderDatilListJson = (JSONArray) resultMap.get("orderDatilListJson");
|
orderDatilListJson = (JSONArray) resultMap.get("orderDatilListJson");
|
||||||
//得到当前能用优惠券的商品总金额
|
//得到当前能用优惠券的商品总金额
|
||||||
BigDecimal total_Coupon = (BigDecimal) resultMap.get("total_Coupon");
|
BigDecimal total_Coupon = (BigDecimal) resultMap.get("total_Coupon");
|
||||||
|
int minCount = (int) resultMap.get("minCount");
|
||||||
|
|
||||||
//校验当前订单金额小于优惠券金额
|
//校验当前订单金额小于优惠券金额
|
||||||
if(jsonObjectData.getString("couponAmount") != null ){
|
if(jsonObjectData.getString("couponAmount") != null ){
|
||||||
@ -445,6 +446,21 @@ public class OrderService {
|
|||||||
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL);
|
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//校验当前指定商品的总数量有没有大于等于minCount
|
||||||
|
if(jsonObjectData.getString("minCount") != null ){
|
||||||
|
int count = Integer.parseInt(jsonObjectData.getString("minCount"));
|
||||||
|
if(minCount < count ){
|
||||||
|
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//校验当前指定商品的总购买数量有没有大于等于minPrice
|
||||||
|
if(jsonObjectData.getString("minPrice") != null ){
|
||||||
|
if(total_Coupon.compareTo(new BigDecimal(jsonObjectData.getString("minPrice"))) == -1){
|
||||||
|
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//设置ordersEntity的参数
|
//设置ordersEntity的参数
|
||||||
addOrdersEntity(jsonObjectData, ordersEntity);
|
addOrdersEntity(jsonObjectData, ordersEntity);
|
||||||
//total_fee = orderService.couponTotal(ordersEntity.getCouponTypeId(), Double.parseDouble(ordersEntity.getCouponAmount()), total_Coupon);
|
//total_fee = orderService.couponTotal(ordersEntity.getCouponTypeId(), Double.parseDouble(ordersEntity.getCouponAmount()), total_Coupon);
|
||||||
@ -548,6 +564,7 @@ public class OrderService {
|
|||||||
orderDatilListJson = (JSONArray) resultMap.get("orderDatilListJson");
|
orderDatilListJson = (JSONArray) resultMap.get("orderDatilListJson");
|
||||||
//得到当前能用优惠券的商品总金额
|
//得到当前能用优惠券的商品总金额
|
||||||
BigDecimal total_Coupon = (BigDecimal) resultMap.get("total_Coupon");
|
BigDecimal total_Coupon = (BigDecimal) resultMap.get("total_Coupon");
|
||||||
|
int minCount = (int) resultMap.get("minCount");
|
||||||
|
|
||||||
//校验当前订单金额小于优惠券金额
|
//校验当前订单金额小于优惠券金额
|
||||||
if(jsonObjectData.getString("couponAmount") != null ){
|
if(jsonObjectData.getString("couponAmount") != null ){
|
||||||
@ -556,6 +573,20 @@ public class OrderService {
|
|||||||
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL);
|
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//校验当前指定商品的总数量有没有大于等于minCount
|
||||||
|
if(jsonObjectData.getString("minCount") != null ){
|
||||||
|
int count = Integer.parseInt(jsonObjectData.getString("minCount"));
|
||||||
|
if(minCount < count ){
|
||||||
|
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//校验当前指定商品的总购买数量有没有大于等于minPrice
|
||||||
|
if(jsonObjectData.getString("minPrice") != null ){
|
||||||
|
if(total_Coupon.compareTo(new BigDecimal(jsonObjectData.getString("minPrice"))) == -1){
|
||||||
|
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//设置ordersEntity的参数
|
//设置ordersEntity的参数
|
||||||
addOrdersEntity(jsonObjectData, ordersEntity);
|
addOrdersEntity(jsonObjectData, ordersEntity);
|
||||||
//total_fee = orderService.couponTotal(ordersEntity.getCouponTypeId(), Double.parseDouble(ordersEntity.getCouponAmount()), total_Coupon);
|
//total_fee = orderService.couponTotal(ordersEntity.getCouponTypeId(), Double.parseDouble(ordersEntity.getCouponAmount()), total_Coupon);
|
||||||
@ -626,6 +657,7 @@ public class OrderService {
|
|||||||
double basePoint = 0 ;
|
double basePoint = 0 ;
|
||||||
String mobile = "";
|
String mobile = "";
|
||||||
int buyCount = 0;
|
int buyCount = 0;
|
||||||
|
int minCount = 0;
|
||||||
|
|
||||||
//判断是否属于指定类
|
//判断是否属于指定类
|
||||||
if(couponJson != null && SmartStringUtil.isNotBlank(couponJson.getString("productCodes"))){
|
if(couponJson != null && SmartStringUtil.isNotBlank(couponJson.getString("productCodes"))){
|
||||||
@ -646,6 +678,7 @@ public class OrderService {
|
|||||||
if(isExist && Arrays.asList(productCodes).contains(goodsObject.get("productCode"))){
|
if(isExist && Arrays.asList(productCodes).contains(goodsObject.get("productCode"))){
|
||||||
//计算商品价格、数量、basepoint相关信息
|
//计算商品价格、数量、basepoint相关信息
|
||||||
total_Coupon = calculationTotal(order, goodsObject, total_Coupon);
|
total_Coupon = calculationTotal(order, goodsObject, total_Coupon);
|
||||||
|
minCount = minCount + order.getBuyCount();
|
||||||
}else{
|
}else{
|
||||||
//计算商品价格、数量、basepoint相关信息
|
//计算商品价格、数量、basepoint相关信息
|
||||||
total_fee = calculationTotal(order, goodsObject, total_fee);
|
total_fee = calculationTotal(order, goodsObject, total_fee);
|
||||||
@ -668,6 +701,7 @@ public class OrderService {
|
|||||||
map.put("ordersEntity", ordersEntity);
|
map.put("ordersEntity", ordersEntity);
|
||||||
map.put("orderDatilListJson", orderDatilListJson);
|
map.put("orderDatilListJson", orderDatilListJson);
|
||||||
map.put("total_Coupon", total_Coupon);
|
map.put("total_Coupon", total_Coupon);
|
||||||
|
map.put("minCount", minCount);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user