adding generateOrder error msg logic

This commit is contained in:
376654749@qq.com 2022-03-11 15:29:14 +08:00
parent fc878707a0
commit ac5c91d901
2 changed files with 4 additions and 4 deletions

View File

@ -51,17 +51,17 @@ public class CouponConfigService {
com.alibaba.fastjson.JSONArray afterFilterArrary = new JSONArray(); com.alibaba.fastjson.JSONArray afterFilterArrary = new JSONArray();
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&& !"0".equals(jsonResult.getString("leftAllotment"))) {
Date compareDate = SmartDateUtil.parseYMD(jsonResult.get("fPublishTo").toString()); Date compareDate = SmartDateUtil.parseYMD(jsonResult.get("fPublishTo").toString());
if ("H5".equals(jsonResult.getString("udf2"))&&"".equals(storeCode)&&!"".equals(productCode)) { if ("H5".equals(jsonResult.getString("udf2"))&&"".equals(storeCode)&&!"".equals(productCode)) {
for(int g = 0 ;g<productCode.length;g++) { 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); afterFilterArrary.add(jsonResult);
} }
} }
}else if ("H5".equals(jsonResult.getString("udf2"))&&!"".equals(storeCode)&&!"".equals(productCode)){ }else if ("H5".equals(jsonResult.getString("udf2"))&&!"".equals(storeCode)&&!"".equals(productCode)){
for(int g = 0 ;g<productCode.length;g++) { 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); afterFilterArrary.add(jsonResult);
} }
} }

View File

@ -57,7 +57,7 @@ public class CouponService {
if ("H5".equals(jsonResult.getString("udf2"))&&"".equals(productCode)) { if ("H5".equals(jsonResult.getString("udf2"))&&"".equals(productCode)) {
afterFilterArrary.add(jsonResult); afterFilterArrary.add(jsonResult);
}else if ("H5".equals(jsonResult.getString("udf2"))&&!"".equals(productCode)){ }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); afterFilterArrary.add(jsonResult);
} }
} }