update 首页收入分类统计,增加部门筛选
This commit is contained in:
+5
-4
@@ -69,15 +69,16 @@ public class IndexController {
|
|||||||
@DictPoint
|
@DictPoint
|
||||||
@ApiOperation(value = "收入分类统计")
|
@ApiOperation(value = "收入分类统计")
|
||||||
@GetMapping(value = "/incomeClassificationStatistics")
|
@GetMapping(value = "/incomeClassificationStatistics")
|
||||||
public Result<List<PieChartVO>> incomeClassificationStatistics(@RequestParam(name="type", defaultValue = "1")Integer type) {
|
public Result<List<PieChartVO>> incomeClassificationStatistics(@RequestParam(name="type", defaultValue = "1")Integer type,
|
||||||
|
@RequestParam(name="departCode",required = false)String departCode) {
|
||||||
if (Objects.equals(type,1)){
|
if (Objects.equals(type,1)){
|
||||||
List<PieChartVO> pieChartVOS = indexService.totalAmountClassificationStatistics("allMoney", type);
|
List<PieChartVO> pieChartVOS = indexService.totalAmountClassificationStatistics("allMoney", type,departCode);
|
||||||
return Result.OK(pieChartVOS);
|
return Result.OK(pieChartVOS);
|
||||||
}else if (Objects.equals(type,2)){
|
}else if (Objects.equals(type,2)){
|
||||||
List<PieChartVO> pieChartVOS = indexService.totalAmountClassificationStatistics("confirmNoTaxAmount", type);
|
List<PieChartVO> pieChartVOS = indexService.totalAmountClassificationStatistics("confirmNoTaxAmount", type, departCode);
|
||||||
return Result.OK(pieChartVOS);
|
return Result.OK(pieChartVOS);
|
||||||
}else if (Objects.equals(type,3)){
|
}else if (Objects.equals(type,3)){
|
||||||
List<PieChartVO> pieChartVOS = indexService.totalAmountClassificationStatistics("allMoney", type);
|
List<PieChartVO> pieChartVOS = indexService.totalAmountClassificationStatistics("allMoney", type, departCode);
|
||||||
return Result.OK(pieChartVOS);
|
return Result.OK(pieChartVOS);
|
||||||
}else {
|
}else {
|
||||||
return Result.OK();
|
return Result.OK();
|
||||||
|
|||||||
@@ -212,13 +212,13 @@ public class IndexService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<PieChartVO> totalAmountClassificationStatistics(String column, Integer type) {
|
public List<PieChartVO> totalAmountClassificationStatistics(String column, Integer type, String departCode) {
|
||||||
String year = String.valueOf(DateUtil.year(new DateTime()));
|
String year = String.valueOf(DateUtil.year(new DateTime()));
|
||||||
List<AmountClassDTO> amountClassDTOS;
|
List<AmountClassDTO> amountClassDTOS;
|
||||||
if (!Objects.equals(type,3)){
|
if (!Objects.equals(type,3)){
|
||||||
amountClassDTOS = payWorkingGroupMapper.amountClass(year,column);
|
amountClassDTOS = payWorkingGroupMapper.amountClass(year,column,departCode);
|
||||||
}else {
|
}else {
|
||||||
amountClassDTOS = payWorkingGroupMapper.amountClass1(year,column);
|
amountClassDTOS = payWorkingGroupMapper.amountClass1(year,column,departCode);
|
||||||
}
|
}
|
||||||
BigDecimal all = amountClassDTOS.stream().map(AmountClassDTO::getMoney).reduce(BigDecimal.ZERO,BigDecimal::add);
|
BigDecimal all = amountClassDTOS.stream().map(AmountClassDTO::getMoney).reduce(BigDecimal.ZERO,BigDecimal::add);
|
||||||
List<PieChartVO> pieChartVOS = new ArrayList<>();
|
List<PieChartVO> pieChartVOS = new ArrayList<>();
|
||||||
|
|||||||
+2
-2
@@ -227,9 +227,9 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
|
|||||||
|
|
||||||
List<AllProjectStatistics> cumulativeListAllMoney();
|
List<AllProjectStatistics> cumulativeListAllMoney();
|
||||||
|
|
||||||
List<AmountClassDTO> amountClass(@Param("year") String year, @Param("column") String column);
|
List<AmountClassDTO> amountClass(@Param("year") String year, @Param("column") String column, @Param("departCode") String departCode);
|
||||||
|
|
||||||
List<AmountClassDTO> amountClass1(@Param("year") String year, @Param("column") String column);
|
List<AmountClassDTO> amountClass1(@Param("year") String year, @Param("column") String column, @Param("departCode") String departCode);
|
||||||
|
|
||||||
List<YearMoneyDTO> getYearMoneyDTO();
|
List<YearMoneyDTO> getYearMoneyDTO();
|
||||||
|
|
||||||
|
|||||||
+6
@@ -2402,6 +2402,9 @@
|
|||||||
FROM v_statistical v
|
FROM v_statistical v
|
||||||
<where>
|
<where>
|
||||||
confirmDate like concat('%',#{year},'%')
|
confirmDate like concat('%',#{year},'%')
|
||||||
|
<if test="departCode != null and departCode != ''">
|
||||||
|
and departCode = #{departCode}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
GROUP BY chargeUse
|
GROUP BY chargeUse
|
||||||
</select>
|
</select>
|
||||||
@@ -2675,6 +2678,9 @@
|
|||||||
order by pp.createTime) v
|
order by pp.createTime) v
|
||||||
<where>
|
<where>
|
||||||
confirmDate like concat('%',#{year},'%')
|
confirmDate like concat('%',#{year},'%')
|
||||||
|
<if test="departCode != null and departCode != ''">
|
||||||
|
and departCode = #{departCode}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
GROUP BY chargeUse
|
GROUP BY chargeUse
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user