|
@@ -3,6 +3,7 @@ package com.fjhx.form.service.impl;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.fjhx.common.utils.Assert;
|
|
import com.fjhx.common.utils.excel.util.ExcelUtil;
|
|
import com.fjhx.common.utils.excel.util.ExcelUtil;
|
|
import com.fjhx.form.entity.*;
|
|
import com.fjhx.form.entity.*;
|
|
import com.fjhx.form.mapper.ReportMapper;
|
|
import com.fjhx.form.mapper.ReportMapper;
|
|
@@ -261,4 +262,24 @@ public class ReportServiceImpl implements ReportService {
|
|
|
|
|
|
ExcelUtil.export(httpServletResponse, records, OrderSummaryBo.class);
|
|
ExcelUtil.export(httpServletResponse, records, OrderSummaryBo.class);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ * 应收余额核对
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public List<ReceivableCheckBo> receivableCheck(ReceivableCheckSelectDto dto) {
|
|
|
|
+ Assert.notEmpty(dto.getCheckDate(), "核对日期不能为空!");
|
|
|
|
+ IWrapper<Object> wrapper = IWrapper.getWrapper();
|
|
|
|
+ wrapper.keyword(dto.getKeyword(), new SqlField("cu.name"), new SqlField("cu.short_name"));
|
|
|
|
+ wrapper.eq("cu.user_id", dto.getSaleUserId());
|
|
|
|
+ List<ReceivableCheckBo> list = reportMapper.receivableCheck(dto, wrapper);
|
|
|
|
+ UserUtil.assignmentNickName(list, ReceivableCheckBo::getSaleUserId, ReceivableCheckBo::setSaleUserName);
|
|
|
|
+
|
|
|
|
+ BigDecimal reduce = list.stream().map(ReceivableCheckBo::getReceivableAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
+ ReceivableCheckBo sumBo = new ReceivableCheckBo();
|
|
|
|
+ sumBo.setSaleUserName("总计");
|
|
|
|
+ sumBo.setReceivableAmount(reduce);
|
|
|
|
+ list.add(sumBo);
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
}
|
|
}
|