|
@@ -33,13 +33,13 @@ import com.fjhx.tenant.service.dict.DictTenantDataService;
|
|
|
import com.ruoyi.common.core.domain.BaseSelectDto;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
+import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@@ -476,4 +476,26 @@ public class AccountRunningWaterServiceImpl extends ServiceImpl<AccountRunningWa
|
|
|
Assert.eqTrue(update, "余额操作失败,请重试!!!");
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, List<AccountRunningWaterVo>> getTotal() {
|
|
|
+ Map<String, List<AccountRunningWaterVo>> map = new HashMap<>();
|
|
|
+ map.put("income", new ArrayList<>());
|
|
|
+ map.put("expenditure", new ArrayList<>());
|
|
|
+
|
|
|
+ List<AccountRunningWaterVo> totalList = baseMapper.getTotal(IWrapper.<AccountRunningWater>getWrapper()
|
|
|
+ .groupBy("arw.currency")
|
|
|
+ .groupBy("arw.`status`")
|
|
|
+ );
|
|
|
+ if (ObjectUtil.isEmpty(totalList)) {
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ List<AccountRunningWaterVo> income = totalList.stream().filter(item -> Objects.equals(item.getStatus(), "10")).collect(Collectors.toList());
|
|
|
+ List<AccountRunningWaterVo> expenditure = totalList.stream().filter(item -> Objects.equals(item.getStatus(), "20")).collect(Collectors.toList());
|
|
|
+
|
|
|
+ map.put("income", income);
|
|
|
+ map.put("expenditure", expenditure);
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
}
|