add 首页新增应收账款统计列表查询
This commit is contained in:
+26
@@ -1,18 +1,29 @@
|
||||
package com.jero.index.contoller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.DictPoint;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.index.service.IndexService;
|
||||
import com.jero.index.vo.*;
|
||||
import com.jero.project.service.IPayWorkingGroupService;
|
||||
import com.jero.statistics.entity.AllMoney;
|
||||
import com.jero.statistics.entity.AllProjectStatistics;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -104,4 +115,19 @@ public class IndexController {
|
||||
return Result.OK(uncollectedPieChartVOS);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "应收账款统计列表")
|
||||
@GetMapping(value = "/uncollectedList")
|
||||
public Result<?> uncollectedList(
|
||||
@RequestParam(name="type",defaultValue = "1")String type,
|
||||
@RequestParam(name="departCode",required = false)String departCode,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
|
||||
Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize);
|
||||
HashMap<String, Object> hashMap = indexService.uncollectedList(type,departCode,page);
|
||||
|
||||
return Result.OK(hashMap);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,16 +12,15 @@ 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.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -359,4 +358,62 @@ public class IndexService {
|
||||
//}
|
||||
return uncollectedPieChartVO;
|
||||
}
|
||||
|
||||
public HashMap<String, Object> uncollectedList(String type, String departCode, Page<AllProjectStatistics> page) {
|
||||
IPage<AllProjectStatistics> pageList = new Page<>();
|
||||
|
||||
switch (type) {
|
||||
case "1":
|
||||
pageList = payWorkingGroupMapper.invoiceAmountList(page, null, 90, departCode);
|
||||
break;
|
||||
case "2":
|
||||
pageList = payWorkingGroupMapper.invoiceAmountList(page, 91, 180, departCode);
|
||||
break;
|
||||
case "3":
|
||||
pageList = payWorkingGroupMapper.invoiceAmountList(page, 181, 360, departCode);
|
||||
break;
|
||||
case "4":
|
||||
pageList = payWorkingGroupMapper.invoiceAmountList(page, 361, null, departCode);
|
||||
break;
|
||||
}
|
||||
if (pageList.getRecords() != null) {
|
||||
for (AllProjectStatistics s : pageList.getRecords()) {
|
||||
String key = String.valueOf(s.getChargeUse());
|
||||
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
|
||||
s.setChargeUse_text(payment_charge_use);
|
||||
}
|
||||
}
|
||||
//处理为空数据为0
|
||||
for (AllProjectStatistics s : pageList.getRecords()) {
|
||||
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
|
||||
s.setAllMoney("0.00");
|
||||
}
|
||||
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
|
||||
s.setComeAllMoney("0.00");
|
||||
}
|
||||
|
||||
}
|
||||
AllMoney allMoney = new AllMoney();
|
||||
switch (type) {
|
||||
case "1":
|
||||
allMoney = payWorkingGroupMapper.invoiceAmountList33(null, 90, departCode);
|
||||
break;
|
||||
case "2":
|
||||
allMoney = payWorkingGroupMapper.invoiceAmountList33(91, 180, departCode);
|
||||
break;
|
||||
case "3":
|
||||
allMoney = payWorkingGroupMapper.invoiceAmountList33(181, 360, departCode);
|
||||
break;
|
||||
case "4":
|
||||
allMoney = payWorkingGroupMapper.invoiceAmountList33(361, null, departCode);
|
||||
break;
|
||||
}
|
||||
HashMap<String, Object> hashMap = new HashMap<>();
|
||||
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
|
||||
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
|
||||
hashMap.put("sumOfBillMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getBillMoney());
|
||||
hashMap.put("sumOfConfirmAmount", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getConfirmAmount());
|
||||
hashMap.put("pageList", pageList);
|
||||
return hashMap;
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -244,6 +244,9 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
|
||||
|
||||
BigDecimal invoiceAmount(@Param("start") Integer start, @Param("end") Integer end, @Param("departCode") String departCode);
|
||||
|
||||
IPage<AllProjectStatistics> invoiceAmountList(Page<AllProjectStatistics> page, @Param("start") Integer start, @Param("end") Integer end, @Param("departCode") String departCode);
|
||||
|
||||
AllMoney invoiceAmountList33(@Param("start") Integer start, @Param("end") Integer end, @Param("departCode") String departCode);
|
||||
|
||||
List<DepartStatistics> overallDepartmentStatistics(@Param("year") String year);
|
||||
|
||||
|
||||
+72
-1
@@ -2357,7 +2357,7 @@
|
||||
select
|
||||
IFNULL(sum(money),0) from
|
||||
(
|
||||
SELECT distinct v.projectId, billMoney - ifnull(comeAllMoney,0) money
|
||||
SELECT distinct v.projectId, invoiceNoTaxAmount - ifnull( paidNoTaxAmount, 0) money
|
||||
FROM v_statistical v
|
||||
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id
|
||||
left join pay_mail_bill pmb on pmb.id = pmbp.bill_id
|
||||
@@ -2411,4 +2411,75 @@
|
||||
where sd.org_code != 'A05'
|
||||
order by allMoney desc
|
||||
</select>
|
||||
|
||||
<select id="invoiceAmountList" resultType="com.jero.statistics.entity.AllProjectStatistics">
|
||||
SELECT DISTINCT v.projectId,
|
||||
projectName,
|
||||
principalName,
|
||||
chargeCompanyTemporaryName,
|
||||
chargeUse,
|
||||
depart,
|
||||
createTime,
|
||||
packText,
|
||||
pack,
|
||||
allMoney,
|
||||
paidNoTaxAmount AS comeAllMoney,
|
||||
invoiceNoTaxAmount AS billMoney,
|
||||
confirmNoTaxAmount AS confirmAmount
|
||||
FROM v_statistical v
|
||||
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id
|
||||
left join pay_mail_bill pmb on pmb.id = pmbp.bill_id
|
||||
<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>
|
||||
<if test="departCode != null and departCode != ''">
|
||||
and departCode = #{departCode}
|
||||
</if>
|
||||
<!-- 开票未来款 -->
|
||||
AND (comeAllMoney <![CDATA[<]]> billMoney or
|
||||
(comeAllMoney is null and billMoney is not null and billMoney != 0))
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="invoiceAmountList33" resultType="com.jero.statistics.entity.AllMoney">
|
||||
select
|
||||
sum(allMoney) as allMoney,
|
||||
sum(paidNoTaxAmount) as comeAllMoney,
|
||||
sum(invoiceNoTaxAmount) as billMoney,
|
||||
sum(confirmNoTaxAmount) as confirmAmount
|
||||
from (
|
||||
select DISTINCT v.projectId,
|
||||
allMoney,
|
||||
paidNoTaxAmount,
|
||||
invoiceNoTaxAmount,
|
||||
confirmNoTaxAmount
|
||||
FROM v_statistical v
|
||||
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id
|
||||
left join pay_mail_bill pmb on pmb.id = pmbp.bill_id
|
||||
<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>
|
||||
<if test="departCode != null and departCode != ''">
|
||||
and departCode = #{departCode}
|
||||
</if>
|
||||
<!-- 开票未来款 -->
|
||||
AND (comeAllMoney <![CDATA[<]]> billMoney or
|
||||
(comeAllMoney is null and billMoney is not null and billMoney != 0))
|
||||
</where>
|
||||
) a
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user