add 未收账款统计
This commit is contained in:
+8
-4
@@ -3,10 +3,7 @@ package com.jero.index.contoller;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.DictPoint;
|
||||
import com.jero.index.service.IndexService;
|
||||
import com.jero.index.vo.HistogramVO;
|
||||
import com.jero.index.vo.LineChartListVO;
|
||||
import com.jero.index.vo.LineChartVO;
|
||||
import com.jero.index.vo.PieChartVO;
|
||||
import com.jero.index.vo.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -99,4 +96,11 @@ public class IndexController {
|
||||
return Result.OK(histogramVOS);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "未收账款统计")
|
||||
@GetMapping(value = "/uncollected")
|
||||
public Result<List<UncollectedPieChartVO>> uncollected() {
|
||||
List<UncollectedPieChartVO> UncollectedPieChartVOS = indexService.uncollected();
|
||||
return Result.OK(UncollectedPieChartVOS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.jero.index.vo.*;
|
||||
import com.jero.project.mapper.PayWorkingGroupMapper;
|
||||
import com.jero.project.service.IPayWorkingGroupService;
|
||||
import com.jero.statistics.entity.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -265,4 +266,31 @@ public class IndexService {
|
||||
}
|
||||
return histogramVOList;
|
||||
}
|
||||
|
||||
public List<UncollectedPieChartVO> uncollected() {
|
||||
List<UncollectedPieChartVO> uncollectedPieChartVOList = new ArrayList<>();
|
||||
UncollectedPieChartVO uncollectedPieChartVO1 = setUncollectedPieChartVO("3月内", null, 90);
|
||||
uncollectedPieChartVOList.add(uncollectedPieChartVO1);
|
||||
UncollectedPieChartVO uncollectedPieChartVO2 = setUncollectedPieChartVO("3-6月内", 91, 180);
|
||||
uncollectedPieChartVOList.add(uncollectedPieChartVO2);
|
||||
UncollectedPieChartVO uncollectedPieChartVO3 = setUncollectedPieChartVO("6-12月内", 181, 360);
|
||||
uncollectedPieChartVOList.add(uncollectedPieChartVO3);
|
||||
UncollectedPieChartVO uncollectedPieChartVO4 = setUncollectedPieChartVO("一年以上", 361, null);
|
||||
uncollectedPieChartVOList.add(uncollectedPieChartVO4);
|
||||
return uncollectedPieChartVOList;
|
||||
}
|
||||
|
||||
private UncollectedPieChartVO setUncollectedPieChartVO(String name, Integer start, Integer end){
|
||||
BigDecimal bigDecimal = payWorkingGroupMapper.invoiceAmount(start, end);
|
||||
BigDecimal bigDecimal1 = payWorkingGroupMapper.arrivalAmount(start, end);
|
||||
UncollectedPieChartVO uncollectedPieChartVO = new UncollectedPieChartVO();
|
||||
uncollectedPieChartVO.setName(name);
|
||||
if (bigDecimal.compareTo(bigDecimal1) > 0){
|
||||
BigDecimal subtract = bigDecimal.subtract(bigDecimal1);
|
||||
uncollectedPieChartVO.setMoney(String.valueOf(subtract));
|
||||
}else {
|
||||
uncollectedPieChartVO.setMoney("0");
|
||||
}
|
||||
return uncollectedPieChartVO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ import lombok.Data;
|
||||
public class UncollectedPieChartVO {
|
||||
@ApiModelProperty(value = "分类")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "值")
|
||||
private String value;
|
||||
@ApiModelProperty(value = "金额")
|
||||
private String money;
|
||||
}
|
||||
|
||||
+5
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.statistics.entity.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -244,4 +245,8 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
|
||||
List<AllProjectStatistics> cumulativeListBillMoney();
|
||||
|
||||
List<AllProjectStatistics> cumulativeListComeAllMoney();
|
||||
|
||||
BigDecimal invoiceAmount(@Param("start") Integer start, @Param("end") Integer end);
|
||||
|
||||
BigDecimal arrivalAmount(@Param("start") Integer start, @Param("end") Integer end);
|
||||
}
|
||||
|
||||
+33
@@ -2699,4 +2699,37 @@
|
||||
from v_statistical v
|
||||
group by year
|
||||
</select>
|
||||
|
||||
<select id="invoiceAmount" resultType="java.math.BigDecimal">
|
||||
SELECT sum(invoice_amount)
|
||||
FROM pay_mail_bill
|
||||
<where>
|
||||
<if test="end != null">
|
||||
bill_date >= DATE_SUB(CURDATE(), INTERVAL #{end} DAY)
|
||||
</if>
|
||||
<if test="start != null">
|
||||
AND bill_date <![CDATA[<=]]> DATE_SUB(CURDATE(), INTERVAL #{start} DAY)
|
||||
</if>
|
||||
<if test="start == null">
|
||||
AND bill_date <![CDATA[<=]]> CURDATE()
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="arrivalAmount" resultType="java.math.BigDecimal">
|
||||
SELECT sum(amount_received)
|
||||
FROM pay_payment_record
|
||||
<where>
|
||||
<if test="end != null">
|
||||
payment_date >= DATE_SUB(CURDATE(), INTERVAL #{end} DAY)
|
||||
</if>
|
||||
<if test="start != null">
|
||||
AND payment_date <![CDATA[<=]]> DATE_SUB(CURDATE(), INTERVAL #{start} DAY)
|
||||
</if>
|
||||
<if test="start == null">
|
||||
AND payment_date <![CDATA[<=]]> CURDATE()
|
||||
</if>
|
||||
and payment_status = 'completed'
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user