//营业时间返回数组
String businessDate = merchantInfoResp.getBusinessDate();
Object obj = JSON.parse(businessDate);
if (obj instanceof JSONArray) {
merchantInfoResp.setBusinessDateDesc(JSON.parseArray(JSON.toJSONString(obj), Integer.class));
} else {
//营业日期判断
if (StringUtils.isNotBlank(businessDate)) {
List<Integer> list = convertBusinessConvert(Arrays.stream(businessDate.split("")).map(Integer::valueOf).collect(Collectors.toList()));
merchantInfoResp.setBusinessDateDesc(list);
} else {
merchantInfoResp.setBusinessDateDesc(Collections.emptyList());
}
}
private List<Integer> convertBusinessConvert(List<Integer> businessDates) {
List<Integer> list = new ArrayList<>();
for (int i = 0; i < businessDates.size(); i++) {
if (businessDates.get(i).equals(0)) {
continue;
} else {
list.add(i + 1);
}
}
return list;
}