|
|
@@ -192,10 +192,10 @@ public class CouponServiceImpl implements CouponService {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if (CouponAuditStateEnum.AUDIT_PASS.getType() != couponDO.getAuditState()) {
|
|
|
+ if (!CouponAuditStateEnum.AUDIT_PASS.getType().equals(couponDO.getAuditState())) {
|
|
|
throw exception(COUPON_NOT_AUDIT_PASS);
|
|
|
}
|
|
|
- if(CommonStatusEnum.ENABLE.getStatus() != couponDO.getState()) {
|
|
|
+ if(!CommonStatusEnum.ENABLE.getStatus().equals(couponDO.getState())) {
|
|
|
throw exception(COUPON_NOT_ENABLE);
|
|
|
}
|
|
|
//2.检查派发规则
|
|
|
@@ -272,14 +272,14 @@ public class CouponServiceImpl implements CouponService {
|
|
|
Boolean flag = basic.compareTo(reqVo.getOrderAmount()) <= 0;
|
|
|
//满足门槛金额
|
|
|
if (flag) {
|
|
|
- if (couponDO.getRelationType() == CouponProductTypeEnum.ALL.getType()) {
|
|
|
+ if (couponDO.getRelationType().equals(CouponProductTypeEnum.ALL.getType())) {
|
|
|
return true;
|
|
|
- } else if (couponDO.getRelationType() == CouponProductTypeEnum.CATEGORY.getType()) {
|
|
|
+ } else if (couponDO.getRelationType().equals(CouponProductTypeEnum.CATEGORY.getType())) {
|
|
|
if(finalType == null) {
|
|
|
return false;
|
|
|
}
|
|
|
return finalType.equals(couponDO.getRelationId());
|
|
|
- } else if (couponDO.getRelationType() == CouponProductTypeEnum.CUSTOM.getType()) {
|
|
|
+ } else if (couponDO.getRelationType().equals(CouponProductTypeEnum.CUSTOM.getType())) {
|
|
|
boolean flag1 = couponDO.getRelationChildId().equals(reqVo.getSpuId());
|
|
|
if (flag1) {
|
|
|
List<String> list1 = Arrays.asList(couponDO.getRelationSkuId().split(","));
|
|
|
@@ -342,15 +342,15 @@ public class CouponServiceImpl implements CouponService {
|
|
|
List<CouponProductDo> couponProductDoList = longListMap.get(couponDO.getId());
|
|
|
List<CouponProductDo> filterList = couponProductDoList.stream().filter(couponProductDo -> {
|
|
|
Integer relationType = couponProductDo.getType();
|
|
|
- if (relationType == CouponProductTypeEnum.ALL.getType()) {
|
|
|
+ if (relationType.equals(CouponProductTypeEnum.ALL.getType())) {
|
|
|
return true;
|
|
|
- } else if (relationType == CouponProductTypeEnum.CATEGORY.getType()) {
|
|
|
+ } else if (relationType.equals(CouponProductTypeEnum.CATEGORY.getType())) {
|
|
|
if(finalType == null) {
|
|
|
return false;
|
|
|
}
|
|
|
- return finalType.equals(couponProductDo.getRelationId()) || finalType == couponProductDo.getRelationId();
|
|
|
- } else if (relationType == CouponProductTypeEnum.CUSTOM.getType()) {
|
|
|
- return couponProductDo.getRelationChildId().equals(spuId) || couponProductDo.getRelationChildId() == spuId;
|
|
|
+ return finalType.equals(couponProductDo.getRelationId()) || finalType.equals(couponProductDo.getRelationId());
|
|
|
+ } else if (relationType.equals(CouponProductTypeEnum.CUSTOM.getType())) {
|
|
|
+ return couponProductDo.getRelationChildId().equals(spuId) || couponProductDo.getRelationChildId().equals(spuId);
|
|
|
}
|
|
|
return false;
|
|
|
}).collect(Collectors.toList());
|