!211 adding filter coupon logic

Merge pull request !211 from Admin/sit-Carl-V3
This commit is contained in:
Admin 2022-03-11 09:10:15 +00:00 committed by Gitee
commit a19ac8abbd
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 3 additions and 3 deletions

View File

@ -55,13 +55,13 @@ public class CouponConfigService {
Date compareDate = SmartDateUtil.parseYMD(jsonResult.get("fPublishTo").toString());
if ("H5".equals(jsonResult.getString("udf2"))&&"".equals(storeCode)&&!"".equals(productCode)) {
for(int g = 0 ;g<productCode.length;g++) {
if ((jsonResult.get("productCodes")!=null?jsonResult.get("productCodes").toString().indexOf(productCode[g]):"".indexOf(productCode[g])) != -1&&compareDate.compareTo(currentDate)>=0) {
if (((jsonResult.get("productCodes")!=null?jsonResult.get("productCodes").toString().indexOf(productCode[g]):"".indexOf(productCode[g])) != -1||jsonResult.get("productCodes")==null)&&compareDate.compareTo(currentDate)>=0) {
afterFilterArrary.add(jsonResult);
}
}
}else if ("H5".equals(jsonResult.getString("udf2"))&&!"".equals(storeCode)&&!"".equals(productCode)){
for(int g = 0 ;g<productCode.length;g++) {
if ((jsonResult.get("productCodes")!=null?jsonResult.get("productCodes").toString().indexOf(productCode[g]):"".indexOf(productCode[g])) != -1 && couponConfigFindAllEntity.getStoreCode().equals(jsonResult.get("storeCodes")!=null ?jsonResult.get("storeCodes").toString():"")&&compareDate.compareTo(currentDate)>=0) {
if (((jsonResult.get("productCodes")!=null?jsonResult.get("productCodes").toString().indexOf(productCode[g]):"".indexOf(productCode[g])) != -1 ||jsonResult.get("productCodes")==null)&& couponConfigFindAllEntity.getStoreCode().equals(jsonResult.get("storeCodes")!=null ?jsonResult.get("storeCodes").toString():"")&&compareDate.compareTo(currentDate)>=0) {
afterFilterArrary.add(jsonResult);
}
}

View File

@ -57,7 +57,7 @@ public class CouponService {
if ("H5".equals(jsonResult.getString("udf2"))&&"".equals(productCode)) {
afterFilterArrary.add(jsonResult);
}else if ("H5".equals(jsonResult.getString("udf2"))&&!"".equals(productCode)){
if ((jsonResult.get("productCodes")!=null?jsonResult.get("productCodes").toString().indexOf(productCode):"".indexOf(productCode)) != -1){
if ((jsonResult.get("productCodes")!=null?jsonResult.get("productCodes").toString().indexOf(productCode):"".indexOf(productCode)) != -1 ||jsonResult.get("productCodes")==null){
afterFilterArrary.add(jsonResult);
}
}