|
@@ -586,47 +586,27 @@ public class ReportService {
|
|
|
return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
|
|
return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- List<Map<String, Object>> list = new ArrayList<>();
|
|
|
|
|
List<Object> objects = new ArrayList<>();
|
|
List<Object> objects = new ArrayList<>();
|
|
|
if (param.get("macIds") instanceof ArrayList<?>) {
|
|
if (param.get("macIds") instanceof ArrayList<?>) {
|
|
|
for (Object o : (List<?>) param.get("macIds")) {
|
|
for (Object o : (List<?>) param.get("macIds")) {
|
|
|
objects.add(String.class.cast(o));
|
|
objects.add(String.class.cast(o));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- if (param.get("macIds") != null && objects.size() > 0){
|
|
|
|
|
- String json = JSON.toJSONString(param.get("macIds"));
|
|
|
|
|
- JSONArray jsonArray = JSONArray.parseArray(json);
|
|
|
|
|
- for (Object o : jsonArray.stream().toArray()) {
|
|
|
|
|
- param.put("macId", o);
|
|
|
|
|
- // 获取资金日记账
|
|
|
|
|
- if (list.isEmpty()) {
|
|
|
|
|
- list = reportMapper.getFundReport(param);
|
|
|
|
|
- }else {
|
|
|
|
|
- List<Map<String, Object>> fundReport = reportMapper.getFundReport(param);
|
|
|
|
|
- JSONObject jObject = JSONObject.parseObject(list.get(0).get("f_get_fund_report").toString());
|
|
|
|
|
- JSONObject jObjectNew = JSONObject.parseObject(fundReport.get(0).get("f_get_fund_report").toString());
|
|
|
|
|
- List dataList = jObject.get("data") != null ? JSONObject.parseArray(jObject.get("data").toString())
|
|
|
|
|
- .toJavaList(Map.class) : new ArrayList();
|
|
|
|
|
- List dataNewList = jObjectNew.get("data") != null ? JSONObject.parseArray(jObjectNew.get("data").toString())
|
|
|
|
|
- .toJavaList(Map.class) : new ArrayList();
|
|
|
|
|
- dataList.addAll(dataNewList);
|
|
|
|
|
- jObject.put("data", dataList);
|
|
|
|
|
- list.get(0).put("f_get_fund_report", jObject);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }else {
|
|
|
|
|
- // 获取资金日记账
|
|
|
|
|
- list = reportMapper.getFundReport(param);
|
|
|
|
|
|
|
+ if (objects.isEmpty()){
|
|
|
|
|
+ param.remove("macIds");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 定义返回值
|
|
|
|
|
- PageList data = new PageList<>();
|
|
|
|
|
|
|
+ // 获取资金日记账
|
|
|
|
|
+ List<Map<String, Object>> list = reportMapper.getFundReport(param);
|
|
|
JSONObject jObject = JSONObject.parseObject(list.get(0).get("f_get_fund_report").toString());
|
|
JSONObject jObject = JSONObject.parseObject(list.get(0).get("f_get_fund_report").toString());
|
|
|
List dataList = jObject.get("data") != null ? JSONObject.parseArray(jObject.get("data").toString())
|
|
List dataList = jObject.get("data") != null ? JSONObject.parseArray(jObject.get("data").toString())
|
|
|
.toJavaList(Map.class) : new ArrayList();
|
|
.toJavaList(Map.class) : new ArrayList();
|
|
|
|
|
+
|
|
|
|
|
+ // 定义返回值
|
|
|
|
|
+ PageList data = new PageList<>();
|
|
|
data.setPageSize((int) param.get("pageSize")).setCurrentPage((int) param.get("currentPage"))
|
|
data.setPageSize((int) param.get("pageSize")).setCurrentPage((int) param.get("currentPage"))
|
|
|
.setTotal(Long.parseLong(jObject.get("pageTotal").toString()))
|
|
.setTotal(Long.parseLong(jObject.get("pageTotal").toString()))
|
|
|
.setList(dataList);
|
|
.setList(dataList);
|
|
|
|
|
+
|
|
|
if ("查询成功".equals(jObject.get("message").toString())) {
|
|
if ("查询成功".equals(jObject.get("message").toString())) {
|
|
|
return ResponseResultUtil.success(data);
|
|
return ResponseResultUtil.success(data);
|
|
|
} else {
|
|
} else {
|