mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-02 02:06:38 +08:00
解决未到生效时间优惠券显示的问题
This commit is contained in:
parent
f17784ec71
commit
914d64f597
@ -7,6 +7,7 @@ import net.lab1024.smartadmin.module.system.royalcanin.coupon.*;
|
||||
import net.lab1024.smartadmin.util.MapRemoveNullUtil;
|
||||
import net.lab1024.smartadmin.util.SmartDateUtil;
|
||||
import net.lab1024.smartadmin.util.SmartHttpUtil;
|
||||
import net.lab1024.smartadmin.util.SmartStringUtil;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -64,10 +65,10 @@ public class CouponService {
|
||||
Date compareDate = SmartDateUtil.parseYMD(jsonResult.get("fValidTo").toString());
|
||||
//优惠券有效开始时间
|
||||
Date startDate = SmartDateUtil.parseYMD(jsonResult.get("fValidFrom").toString());
|
||||
if ("H5".equals(jsonResult.getString("udf2"))&&"".equals(productCode)) {
|
||||
if ("H5".equals(jsonResult.getString("udf2"))&& SmartStringUtil.isBlank(couponGetAllEntity.getProductCodes())) {
|
||||
afterFilterArrary.add(jsonResult);
|
||||
}else if ("H5".equals(jsonResult.getString("udf2"))&&!"".equals(productCode)&&compareDate.compareTo(currentDate)!=-1
|
||||
&& startDate.compareTo(nowDate) != 1){
|
||||
}else if ("H5".equals(jsonResult.getString("udf2"))&& SmartStringUtil.isNotBlank(couponGetAllEntity.getProductCodes()) &&compareDate.compareTo(currentDate)!=-1
|
||||
&& startDate.compareTo(nowDate) != 1 && compareDate.compareTo(nowDate) != -1){
|
||||
for(int g = 0 ;g<productCode.length;g++) {
|
||||
if ((jsonResult.get("productCodes") != null ? jsonResult.get("productCodes").toString().indexOf(productCode[g]) : "".indexOf(productCode[g])) != -1 || jsonResult.get("productCodes") == null) {
|
||||
afterFilterArrary.add(jsonResult);
|
||||
|
@ -138,14 +138,6 @@ public class OrderController {
|
||||
ordersEntity.setCouponName(jsonObjectData.getString("couponName"));
|
||||
ordersEntity.setCouponId(jsonObjectData.getString("couponId"));
|
||||
ordersEntity.setCouponTypeId(jsonObjectData.getString("couponTypeId"));
|
||||
//通过传优惠券码锁定优惠券
|
||||
CouponCosumeEntity couponCosumeEntity = new CouponCosumeEntity();
|
||||
couponCosumeEntity.setCouponCode(jsonObjectData.getString("couponCode"));
|
||||
String result = couponService.couponCosume(couponCosumeEntity);
|
||||
JSONObject couponJsonResult = JSONObject.parseObject(result);
|
||||
if(!"0".equals(couponJsonResult.getString("code"))){
|
||||
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL);
|
||||
}
|
||||
total_fee = orderService.couponTotal(ordersEntity.getCouponTypeId(), Double.parseDouble(ordersEntity.getCouponAmount()), total_fee);
|
||||
}
|
||||
ordersEntity.setOrderAddress(orderAddress);
|
||||
@ -256,14 +248,6 @@ public class OrderController {
|
||||
ordersEntity.setCouponName(jsonObjectData.getString("couponName"));
|
||||
ordersEntity.setCouponId(jsonObjectData.getString("couponId"));
|
||||
ordersEntity.setCouponTypeId(jsonObjectData.getString("couponTypeId"));
|
||||
//通过传优惠券码锁定优惠券
|
||||
CouponCosumeEntity couponCosumeEntity = new CouponCosumeEntity();
|
||||
couponCosumeEntity.setCouponCode(jsonObjectData.getString("couponCode"));
|
||||
String result = couponService.couponCosume(couponCosumeEntity);
|
||||
JSONObject couponJsonResult = JSONObject.parseObject(result);
|
||||
if(!"0".equals(couponJsonResult.getString("code"))){
|
||||
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL);
|
||||
}
|
||||
total_fee = orderService.couponTotal(ordersEntity.getCouponTypeId(), Double.parseDouble(ordersEntity.getCouponAmount()), total_fee);
|
||||
}
|
||||
ordersEntity.setOrderAddress(orderAddress);
|
||||
@ -373,14 +357,6 @@ public class OrderController {
|
||||
ordersEntity.setCouponName(jsonObjectData.getString("couponName"));
|
||||
ordersEntity.setCouponId(jsonObjectData.getString("couponId"));
|
||||
ordersEntity.setCouponTypeId(jsonObjectData.getString("couponTypeId"));
|
||||
//通过传优惠券码锁定优惠券
|
||||
CouponCosumeEntity couponCosumeEntity = new CouponCosumeEntity();
|
||||
couponCosumeEntity.setCouponCode(jsonObjectData.getString("couponCode"));
|
||||
String result = couponService.couponCosume(couponCosumeEntity);
|
||||
JSONObject couponJsonResult = JSONObject.parseObject(result);
|
||||
if(!"0".equals(couponJsonResult.getString("code"))){
|
||||
return ResponseDTO.wrap(OrderResponseCodeConst.COUPON_USE_FAIL);
|
||||
}
|
||||
total_fee = orderService.couponTotal(ordersEntity.getCouponTypeId(), Double.parseDouble(ordersEntity.getCouponAmount()), total_fee);
|
||||
}
|
||||
ordersEntity.setOrderAddress(orderAddress);
|
||||
|
Loading…
Reference in New Issue
Block a user