fix 首页 应收账款 开票日期多个会导致查询出重复数据的bug

This commit is contained in:
lijiarao
2023-12-01 15:37:41 +08:00
parent 3fc20ebf8f
commit ae5020fe8e
5 changed files with 102 additions and 9 deletions
@@ -11,6 +11,7 @@ import com.jero.index.vo.*;
import com.jero.project.service.IPayWorkingGroupService;
import com.jero.statistics.entity.AllMoney;
import com.jero.statistics.entity.AllProjectStatistics;
import com.jero.statistics.entity.AllProjectStatisticsOther;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -153,7 +154,7 @@ public class IndexController {
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
String title = "应收账款统计";
mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
mv.addObject(NormalExcelConstants.CLASS, AllProjectStatistics.class);
mv.addObject(NormalExcelConstants.CLASS, AllProjectStatisticsOther.class);
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
ExportParams exportParams=new ExportParams(title, title);
exportParams.setType(ExcelType.XSSF);
@@ -360,7 +360,7 @@ public class IndexService {
}
public HashMap<String, Object> uncollectedList(String type, String departCode, Page<AllProjectStatistics> page, String column, String order) {
IPage<AllProjectStatistics> pageList = new Page<>();
IPage<AllProjectStatisticsOther> pageList = new Page<>();
switch (type) {
case "1":
@@ -377,14 +377,14 @@ public class IndexService {
break;
}
if (pageList.getRecords() != null) {
for (AllProjectStatistics s : pageList.getRecords()) {
for (AllProjectStatisticsOther 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()) {
for (AllProjectStatisticsOther s : pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
@@ -244,7 +244,7 @@ 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, @Param("column") String column, @Param("order") String order);
IPage<AllProjectStatisticsOther> invoiceAmountList(Page<AllProjectStatistics> page, @Param("start") Integer start, @Param("end") Integer end, @Param("departCode") String departCode, @Param("column") String column, @Param("order") String order);
AllMoney invoiceAmountList33(@Param("start") Integer start, @Param("end") Integer end, @Param("departCode") String departCode);
@@ -2421,9 +2421,9 @@
order by allMoney desc
</select>
<select id="invoiceAmountList" resultType="com.jero.statistics.entity.AllProjectStatistics">
<select id="invoiceAmountList" resultType="com.jero.statistics.entity.AllProjectStatisticsOther">
select * from
(SELECT DISTINCT v.projectId,
(SELECT v.projectId,
projectName,
principalName,
chargeCompanyTemporaryName,
@@ -2436,7 +2436,7 @@
paidNoTaxAmount AS comeAllMoney,
invoiceNoTaxAmount AS billMoney,
confirmNoTaxAmount AS confirmAmount,
pmb.bill_date,
group_concat(DATE_FORMAT(pmb.bill_date, '%Y-%m-%d')) as bill_date,
year
FROM v_statistical_all v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id
@@ -2457,7 +2457,9 @@
<!-- 开票未来款 -->
AND (comeAllMoney <![CDATA[<]]> v.invoiceAmount or
(comeAllMoney is null and v.invoiceAmount is not null and v.invoiceAmount != 0))
</where>) p
</where>
group by v.projectId
) p
<if test="column != null and column != ''">
<if test="column == 'allMoney' and order == 'desc'">
order by allMoney desc
@@ -0,0 +1,90 @@
package com.jero.statistics.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.util.Date;
/**
* @author zql
* @date 2021/9/17 18:04
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AllProjectStatisticsOther {
@ApiModelProperty(value = "项目id")
private String projectId;
@Excel(name = "来款项目", width = 15)
@ApiModelProperty(value = "来款项目")
private String projectName;
@Excel(name = "项目负责人", width = 15)
@ApiModelProperty(value = "项目负责人")
private String principalName;
@Excel(name = "科室", width = 15)
@ApiModelProperty(value = "科室")
private String depart;
@Excel(name = "来款单位", width = 15)
@ApiModelProperty(value = "来款单位")
private String chargeCompanyTemporaryName;
@ApiModelProperty(value = "打包")
private Integer pack;
@TableField(exist = false)
@Excel(name = "打包", width = 15)
@ApiModelProperty(value = "打包")
private String packText;
@Excel(name = "开票时间", width = 15)
@ApiModelProperty(value = "开票时间")
private String billDate;
@Excel(name = "年度待确收金额", width = 15)
@ApiModelProperty(value = "合同金额")
private String allMoney;
@Excel(name = "确认收入金额", width = 15)
@ApiModelProperty(value = "确认收入金额")
private String confirmAmount;
@Excel(name = "开票金额", width = 15)
@ApiModelProperty(value = "开票金额")
private String billMoney;
@Excel(name = "到账金额", width = 15)
@ApiModelProperty(value = "到账金额")
private String comeAllMoney;
@ApiModelProperty(value = "来款用途编码")
private String chargeUse;
@Excel(name = "来款用途", width = 15)
@ApiModelProperty(value = "来款用途")
private String ChargeUse_text;
@ApiModelProperty(value = "到账时间")
private String paymentDate;
@Excel(name = "项目年份", width = 15)
@ApiModelProperty(value = "项目年份")
private String year;
public AllProjectStatisticsOther(String allMoney, String confirmAmount, String billMoney, String comeAllMoney, String paymentDate) {
this.allMoney=allMoney;
this.confirmAmount=confirmAmount;
this.billMoney=billMoney;
this.comeAllMoney=comeAllMoney;
this.paymentDate=paymentDate;
}
}