!224 adding filter coupon logic

Merge pull request !224 from Admin/sit-Carl-V3
This commit is contained in:
Admin 2022-03-14 07:19:27 +00:00 committed by Gitee
commit 63e9493c0e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -59,11 +59,10 @@ public class CouponService {
for(int i = 0;i < jsonArray.size();i ++){ for(int i = 0;i < jsonArray.size();i ++){
JSONObject jsonResult = (JSONObject)jsonArray.get(i); JSONObject jsonResult = (JSONObject)jsonArray.get(i);
if(jsonResult.getString("udf2") != null) { if(jsonResult.getString("udf2") != null) {
//&&compareDate.compareTo(currentDate)>=0 Date compareDate = SmartDateUtil.parseYMD(jsonResult.get("fValidTo").toString());
Date compareDate = SmartDateUtil.parseYMD(jsonResult.get("fValidFrom").toString()); if ("H5".equals(jsonResult.getString("udf2"))&&"".equals(productCode)&&compareDate.compareTo(currentDate)!=-1) {
if ("H5".equals(jsonResult.getString("udf2"))&&"".equals(productCode)&&compareDate.compareTo(currentDate)==-1) {
afterFilterArrary.add(jsonResult); afterFilterArrary.add(jsonResult);
}else if ("H5".equals(jsonResult.getString("udf2"))&&!"".equals(productCode)&&compareDate.compareTo(currentDate)==-1){ }else if ("H5".equals(jsonResult.getString("udf2"))&&!"".equals(productCode)&&compareDate.compareTo(currentDate)!=-1){
for(int g = 0 ;g<productCode.length;g++) { 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) { if ((jsonResult.get("productCodes") != null ? jsonResult.get("productCodes").toString().indexOf(productCode[g]) : "".indexOf(productCode[g])) != -1 || jsonResult.get("productCodes") == null) {
afterFilterArrary.add(jsonResult); afterFilterArrary.add(jsonResult);