Merge pull request !215 from Admin/sit-Carl-V3
This commit is contained in:
Admin 2022-03-11 13:21:34 +00:00 committed by Gitee
commit 37b67e9c49
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -39,9 +39,9 @@ public class CouponService {
} }
public String couponGetAll(CouponGetAllEntity couponGetAllEntity) throws Exception{ public String couponGetAll(CouponGetAllEntity couponGetAllEntity) throws Exception{
String productCode = couponGetAllEntity.getProductCodes(); String[] productCode = couponGetAllEntity.getProductCodes().split(",");
Map<String, String> paramMap = MapRemoveNullUtil.setConditionMap(couponGetAllEntity); 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("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("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.put("rows",StringUtil.toString(couponGetAllEntity.getRows()).equals("0")?null:StringUtil.toString(couponGetAllEntity.getRows()));
@ -57,12 +57,14 @@ 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")!=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); afterFilterArrary.add(jsonResult);
} }
} }
} }
} }
}
JSONObject JSONResult = new JSONObject(); JSONObject JSONResult = new JSONObject();
JSONResult.put("code",jsonObjectResult.getString("code")); JSONResult.put("code",jsonObjectResult.getString("code"));
JSONResult.put("msg",jsonObjectResult.getString("msg")); JSONResult.put("msg",jsonObjectResult.getString("msg"));