mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-02 02:06:38 +08:00
!209 adding filter coupon logic
Merge pull request !209 from Admin/sit-Carl-V3
This commit is contained in:
commit
676e305ee9
@ -51,17 +51,17 @@ public class CouponConfigService {
|
||||
com.alibaba.fastjson.JSONArray afterFilterArrary = new JSONArray();
|
||||
for(int i = 0;i < jsonArray.size();i ++){
|
||||
JSONObject jsonResult = (JSONObject)jsonArray.get(i);
|
||||
if(jsonResult.getString("udf2") != null) {
|
||||
if(jsonResult.getString("udf2") != null&& !"0".equals(jsonResult.getString("leftAllotment"))) {
|
||||
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").toString().indexOf(productCode[g]) != -1&&compareDate.compareTo(currentDate)>=0) {
|
||||
if ((jsonResult.get("productCodes")!=null?jsonResult.get("productCodes").toString().indexOf(productCode[g]):"".indexOf(productCode[g])) != -1&&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").toString().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 && couponConfigFindAllEntity.getStoreCode().equals(jsonResult.get("storeCodes")!=null ?jsonResult.get("storeCodes").toString():"")&&compareDate.compareTo(currentDate)>=0) {
|
||||
afterFilterArrary.add(jsonResult);
|
||||
}
|
||||
}
|
||||
|
@ -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").toString().indexOf(productCode) != -1){
|
||||
if ((jsonResult.get("productCodes")!=null?jsonResult.get("productCodes").toString().indexOf(productCode):"".indexOf(productCode)) != -1){
|
||||
afterFilterArrary.add(jsonResult);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user