Merge pull request !218 from Admin/sit-Carl
This commit is contained in:
Admin 2022-03-11 13:48:43 +00:00 committed by Gitee
commit 361cfec2b9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -39,12 +39,14 @@ public class CouponService {
}
public String couponGetAll(CouponGetAllEntity couponGetAllEntity) throws Exception{
String productCode = couponGetAllEntity.getProductCodes();
String[] productCode = couponGetAllEntity.getProductCodes().split(",");
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(couponGetAllEntity);
paramMap.remove("productCode");
paramMap.remove("productCodes");
paramMap.put("status",StringUtil.toString(couponGetAllEntity.getStatus()).equals("0")?null:StringUtil.toString(couponGetAllEntity.getStatus()));
paramMap.put("page",StringUtil.toString(couponGetAllEntity.getPage()).equals("0")?null:StringUtil.toString(couponGetAllEntity.getPage()));
paramMap.put("rows",StringUtil.toString(couponGetAllEntity.getRows()).equals("0")?null:StringUtil.toString(couponGetAllEntity.getRows()));
paramMap.replace("usestartDate",paramMap.get("useStartDate"));
paramMap.remove("useStartDate");
MapRemoveNullUtil.removeNullEntry(paramMap);
String result = SmartHttpUtil.sendPostForm(url+"getAll",paramMap,null);
//过滤非官网数据
@ -57,12 +59,14 @@ 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 ||jsonResult.get("productCodes")==null){
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) {
afterFilterArrary.add(jsonResult);
}
}
}
}
}
JSONObject JSONResult = new JSONObject();
JSONResult.put("code",jsonObjectResult.getString("code"));
JSONResult.put("msg",jsonObjectResult.getString("msg"));