|
|
@@ -1,6 +1,7 @@
|
|
|
package com.dk.mdm.service.report;
|
|
|
|
|
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.dk.common.model.pojo.PageList;
|
|
|
@@ -529,23 +530,54 @@ public class ReportService {
|
|
|
if (param.get("pageSize") == null || param.get("currentPage") == null) {
|
|
|
return ResponseResultUtil.error(ResponseCodeEnum.OPERATE_FAIL, "请检查分页参数!");
|
|
|
}
|
|
|
- // 获取资金日记账
|
|
|
- List<Map<String, Object>> list = reportMapper.getFundReport(param);
|
|
|
- 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())
|
|
|
- .toJavaList(Map.class) : new ArrayList();
|
|
|
+
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
+ List<Object> objects = new ArrayList<>();
|
|
|
+ if (param.get("macIds") instanceof ArrayList<?>) {
|
|
|
+ for (Object o : (List<?>) param.get("macIds")) {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
|
|
|
// 定义返回值
|
|
|
PageList data = new PageList<>();
|
|
|
+ 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())
|
|
|
+ .toJavaList(Map.class) : new ArrayList();
|
|
|
data.setPageSize((int) param.get("pageSize")).setCurrentPage((int) param.get("currentPage"))
|
|
|
.setTotal(Long.parseLong(jObject.get("pageTotal").toString()))
|
|
|
.setList(dataList);
|
|
|
-
|
|
|
if ("查询成功".equals(jObject.get("message").toString())) {
|
|
|
return ResponseResultUtil.success(data);
|
|
|
} else {
|
|
|
return ResponseResultUtil.error(666, jObject.get("message").toString());
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|