32 changed files with 7802 additions and 47 deletions
@ -0,0 +1,33 @@ |
|||||
|
package com.yxt.anrui.reportcenter.api.factoryDailyReport; |
||||
|
|
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2025/5/20 |
||||
|
**/ |
||||
|
@FeignClient( |
||||
|
contextId = "anrui-reportcenter-factoryDailyReport", |
||||
|
name = "anrui-reportcenter", |
||||
|
path = "v1/factoryDailyReport", |
||||
|
fallback = FactoryDaliyReportFeignFallback.class) |
||||
|
public interface FactoryDaliyReportFeign { |
||||
|
@PostMapping("pageList1") |
||||
|
@ResponseBody |
||||
|
ResultBean<FactoryDaliyReportVo> pageList1(@RequestBody PagerQuery<FactoryDaliyReportQuery> pagerQuery); |
||||
|
|
||||
|
@PostMapping("pageList") |
||||
|
@ResponseBody |
||||
|
ResultBean<Map<String, Object>> pageList(@RequestBody PagerQuery<FactoryDaliyReportQuery> pagerQuery); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
@ -0,0 +1,12 @@ |
|||||
|
package com.yxt.anrui.reportcenter.api.factoryDailyReport; |
||||
|
|
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2025/5/20 |
||||
|
**/ |
||||
|
@Component |
||||
|
public class FactoryDaliyReportFeignFallback { |
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
package com.yxt.anrui.reportcenter.api.factoryDailyReport; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2025/5/20 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class FactoryDaliyReportQuery implements Query { |
||||
|
private static final long serialVersionUID = 3416520595744127012L; |
||||
|
|
||||
|
private String orgPath; |
||||
|
//jt-查集团,syb-事业部,空字符串 分公司
|
||||
|
private String type; |
||||
|
} |
@ -0,0 +1,47 @@ |
|||||
|
package com.yxt.anrui.reportcenter.api.factoryDailyReport; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2025/5/20 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class FactoryDaliyReportVo { |
||||
|
|
||||
|
@ApiModelProperty("年份") |
||||
|
private String year; |
||||
|
@ApiModelProperty("预提") |
||||
|
private String estimate; |
||||
|
@ApiModelProperty("上传金额") |
||||
|
private String upload; |
||||
|
@ApiModelProperty("调整") |
||||
|
private String adjust; |
||||
|
@ApiModelProperty("未上传") |
||||
|
private UnUploadVo unUpload; |
||||
|
|
||||
|
@ApiModelProperty("合计") |
||||
|
@JsonIgnore |
||||
|
private String notUploadMoney; |
||||
|
@ApiModelProperty("返利") |
||||
|
@JsonIgnore |
||||
|
private String unuploaded_rebate; |
||||
|
@ApiModelProperty("费用合计") |
||||
|
@JsonIgnore |
||||
|
private String fee; |
||||
|
@ApiModelProperty("支出") |
||||
|
@JsonIgnore |
||||
|
private String expense_payment; |
||||
|
@ApiModelProperty("待支付") |
||||
|
@JsonIgnore |
||||
|
private String pending_payment; |
||||
|
@ApiModelProperty("抵顶") |
||||
|
@JsonIgnore |
||||
|
private String offset_payment; |
||||
|
|
||||
|
private String linkSid; |
||||
|
|
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
package com.yxt.anrui.reportcenter.api.factoryDailyReport; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2025/5/20 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class UnUploadVo { |
||||
|
@ApiModelProperty("合计") |
||||
|
private String total; |
||||
|
@ApiModelProperty("返利") |
||||
|
private String rebate; |
||||
|
@ApiModelProperty("费用合计") |
||||
|
private String fee; |
||||
|
@ApiModelProperty("支出") |
||||
|
private String feeOutlay; |
||||
|
@ApiModelProperty("待支付") |
||||
|
private String feeUnPaid; |
||||
|
@ApiModelProperty("抵顶") |
||||
|
private String feeTopping; |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package com.yxt.anrui.reportcenter.biz.factoryDailyReport; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.anrui.reportcenter.api.factoryDailyReport.FactoryDaliyReportVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2025/5/20 |
||||
|
**/ |
||||
|
@Mapper |
||||
|
public interface FactoryDaliyReportMapper { |
||||
|
List<FactoryDaliyReportVo> selectRecordList(@Param("map") Map<String, Object> map, @Param(Constants.WRAPPER)QueryWrapper<FactoryDaliyReportVo> qw); |
||||
|
|
||||
|
int selectRecordCount(@Param(Constants.WRAPPER)QueryWrapper<FactoryDaliyReportVo> qw); |
||||
|
} |
@ -0,0 +1,137 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.yxt.anrui.reportcenter.biz.factoryDailyReport.FactoryDaliyReportMapper"> |
||||
|
<select id="selectRecordList" resultType="com.yxt.anrui.reportcenter.api.factoryDailyReport.FactoryDaliyReportVo"> |
||||
|
select a.year, |
||||
|
ROUND(SUM(a.estimateRebate), 2) AS estimate, |
||||
|
ROUND(SUM(a.uploadMoney), 2) AS upload, |
||||
|
ROUND(SUM(a.adjustmentMoney), 2) AS adjust, |
||||
|
ROUND(SUM(a.notUploadMoney), 2) AS notUploadMoney, |
||||
|
ROUND(SUM(a.fee), 2) AS fee, |
||||
|
ROUND(SUM(a.expense_payment), 2) AS expense_payment, |
||||
|
ROUND(SUM(a.pending_payment), 2) AS pending_payment, |
||||
|
ROUND(SUM(a.offset_payment), 2) AS offset_payment, |
||||
|
ROUND(SUM(a.remaining_payment), 2) AS remaining_payment, |
||||
|
round(sum(a.unuploaded_rebate),2) as unuploaded_rebate |
||||
|
from ( |
||||
|
select LEFT(palceGenDate, 4) AS year, |
||||
|
sum(estimateRebate) estimateRebate, |
||||
|
sum(uploadMoney) uploadMoney, |
||||
|
sum(adjustmentMoney) adjustmentMoney, |
||||
|
sum(estimateRebate + |
||||
|
IFNULL(CASE WHEN isAdjustment = '是' AND adjustmentState = 1 THEN adjustmentMoney ELSE 0 END, |
||||
|
0) |
||||
|
- IFNULL(uploadMoney, 0) - IFNULL(secondaryUploadMoney, 0)) AS notUploadMoney, |
||||
|
-- 未上传返利金额(核心计算) |
||||
|
SUM(estimateRebate + |
||||
|
IFNULL(CASE WHEN isAdjustment = '是' AND adjustmentState = 1 THEN adjustmentMoney ELSE 0 END, |
||||
|
0) |
||||
|
- (uploadMoney + secondaryUploadMoney) |
||||
|
) AS unuploaded_rebate, |
||||
|
SUM(onceTreatCost + secondTreatCost + tempTreatCost + expectTreatCost + expectSuppCost + |
||||
|
onceSuppCost + |
||||
|
secondSuppCost + tempSuppCost) as fee, |
||||
|
-- 其中费用支出(待支付费用) |
||||
|
SUM(onceTreatCost + secondTreatCost + tempTreatCost) AS expense_payment, |
||||
|
-- 待支付(预计待支付) |
||||
|
SUM(expectTreatCost) AS pending_payment, |
||||
|
-- 抵顶(预计抵顶+实际抵顶) |
||||
|
SUM(expectSuppCost + onceSuppCost + secondSuppCost + tempSuppCost) AS offset_payment, |
||||
|
|
||||
|
-- 剩余(未上传合计-费用支出-待支付-抵顶) |
||||
|
SUM(estimateRebate - (uploadMoney + secondaryUploadMoney) - |
||||
|
(onceTreatCost + secondTreatCost + tempTreatCost) - |
||||
|
expectTreatCost - |
||||
|
(expectSuppCost + onceSuppCost + secondSuppCost + tempSuppCost)) AS remaining_payment |
||||
|
from anrui_scm.scm_veh_rebate |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
GROUP BY LEFT(palceGenDate, 4) |
||||
|
|
||||
|
union all |
||||
|
select LEFT(palceGenDate, 4) AS year, |
||||
|
sum(estimateRebate) estimateRebate, |
||||
|
sum(uploadMoney) uploadMoney, |
||||
|
sum(adjustmentMoney) adjustmentMoney, |
||||
|
sum(estimateRebate + |
||||
|
IFNULL(CASE WHEN isAdjustment = '是' AND adjustmentState = 1 THEN adjustmentMoney ELSE 0 END, |
||||
|
0) |
||||
|
- IFNULL(uploadMoney, 0) - IFNULL(secondaryUploadMoney, 0)) AS notUploadMoney, |
||||
|
-- 未上传返利金额(核心计算) |
||||
|
SUM(estimateRebate + |
||||
|
IFNULL(CASE WHEN isAdjustment = '是' AND adjustmentState = 1 THEN adjustmentMoney ELSE 0 END, |
||||
|
0) |
||||
|
- (uploadMoney + secondaryUploadMoney) |
||||
|
) AS unuploaded_rebate, |
||||
|
SUM(onceTreatCost + secondTreatCost + tempTreatCost + expectTreatCost + expectSuppCost + |
||||
|
onceSuppCost + |
||||
|
secondSuppCost + tempSuppCost) as fee, |
||||
|
-- 其中费用支出(待支付费用) |
||||
|
SUM(onceTreatCost + secondTreatCost + tempTreatCost) AS expense_payment, |
||||
|
-- 待支付(预计待支付) |
||||
|
SUM(expectTreatCost) AS pending_payment, |
||||
|
-- 抵顶(预计抵顶+实际抵顶) |
||||
|
SUM(expectSuppCost + onceSuppCost + secondSuppCost + tempSuppCost) AS offset_payment, |
||||
|
|
||||
|
-- 剩余(未上传合计-费用支出-待支付-抵顶) |
||||
|
SUM(estimateRebate - (uploadMoney + secondaryUploadMoney) - |
||||
|
(onceTreatCost + secondTreatCost + tempTreatCost) - |
||||
|
expectTreatCost - |
||||
|
(expectSuppCost + onceSuppCost + secondSuppCost + tempSuppCost)) AS remaining_payment |
||||
|
from anrui_scm.scm_special_rebate |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
GROUP BY LEFT(palceGenDate, 4) |
||||
|
|
||||
|
union all |
||||
|
select LEFT(collectionDate, 4) AS year, |
||||
|
sum(estimateRebate) estimateRebate, |
||||
|
sum(uploadMoney) uploadMoney, |
||||
|
sum(adjustmentMoney) adjustmentMoney, |
||||
|
sum(estimateRebate + |
||||
|
IFNULL(adjustmentMoney, 0) |
||||
|
- IFNULL(uploadMoney, 0)) AS notUploadMoney, |
||||
|
-- 未上传返利金额(核心计算) |
||||
|
SUM(estimateRebate + |
||||
|
IFNULL(adjustmentMoney, 0) |
||||
|
- (uploadMoney) |
||||
|
) AS unuploaded_rebate, |
||||
|
0 as fee, |
||||
|
0 AS expense_payment, |
||||
|
0 AS pending_payment, |
||||
|
0 AS offset_payment, |
||||
|
-- 剩余(未上传合计-费用支出-待支付-抵顶) |
||||
|
SUM(estimateRebate - (uploadMoney)) AS remaining_payment |
||||
|
from anrui_scm.scm_collection_rebate |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
GROUP BY LEFT(collectionDate, 4) |
||||
|
) a where a.year != '' and a.year is not null |
||||
|
group by a.year |
||||
|
order by a.year desc |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectRecordCount" resultType="int"> |
||||
|
SELECT count(distinct a.year) from( |
||||
|
select LEFT(palceGenDate, 4) AS year from anrui_scm.scm_veh_rebate |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
group by year |
||||
|
union all |
||||
|
select LEFT(palceGenDate, 4) AS year from anrui_scm.scm_special_rebate |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
group by year |
||||
|
union all |
||||
|
select LEFT(collectionDate, 4) AS year from anrui_scm.scm_collection_rebate |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
group by year)a where a.year != '' and a.year is not null |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,41 @@ |
|||||
|
package com.yxt.anrui.reportcenter.biz.factoryDailyReport; |
||||
|
|
||||
|
import com.yxt.anrui.reportcenter.api.factoryDailyReport.FactoryDaliyReportFeign; |
||||
|
import com.yxt.anrui.reportcenter.api.factoryDailyReport.FactoryDaliyReportQuery; |
||||
|
import com.yxt.anrui.reportcenter.api.factoryDailyReport.FactoryDaliyReportVo; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2025/5/20 |
||||
|
**/ |
||||
|
@Api(tags = "厂家返利报表") |
||||
|
@RestController |
||||
|
@RequestMapping("v1/factoryDailyReport") |
||||
|
public class FactoryDaliyReportRest implements FactoryDaliyReportFeign { |
||||
|
|
||||
|
@Autowired |
||||
|
private FactoryDaliyReportService factoryDaliyReportService; |
||||
|
@Override |
||||
|
public ResultBean<FactoryDaliyReportVo> pageList1(PagerQuery<FactoryDaliyReportQuery> pagerQuery) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
PagerVo<FactoryDaliyReportVo> pv = factoryDaliyReportService.pageList1(pagerQuery); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<Map<String, Object>> pageList(PagerQuery<FactoryDaliyReportQuery> pagerQuery) { |
||||
|
ResultBean<Map<String,Object>> rb = ResultBean.fireFail(); |
||||
|
Map<String,Object> map = factoryDaliyReportService.pageList(pagerQuery); |
||||
|
return rb.success().setData(map); |
||||
|
} |
||||
|
} |
@ -0,0 +1,161 @@ |
|||||
|
package com.yxt.anrui.reportcenter.biz.factoryDailyReport; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganization; |
||||
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
||||
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
||||
|
import com.yxt.anrui.reportcenter.api.dailyreport.DailyReport; |
||||
|
import com.yxt.anrui.reportcenter.api.dailyreport.DailyReportAppPagerQuery; |
||||
|
import com.yxt.anrui.reportcenter.api.dailyreport.DailyReportListVo; |
||||
|
import com.yxt.anrui.reportcenter.api.factoryDailyReport.FactoryDaliyReportQuery; |
||||
|
import com.yxt.anrui.reportcenter.api.factoryDailyReport.FactoryDaliyReportVo; |
||||
|
import com.yxt.anrui.reportcenter.api.factoryDailyReport.UnUploadVo; |
||||
|
import com.yxt.anrui.reportcenter.config.DecimalUtil; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.*; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2025/5/20 |
||||
|
**/ |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
public class FactoryDaliyReportService { |
||||
|
|
||||
|
@Autowired |
||||
|
private FactoryDaliyReportMapper factoryDaliyReportMapper; |
||||
|
@Autowired |
||||
|
private SysOrganizationFeign sysOrganizationFeign; |
||||
|
|
||||
|
public PagerVo<FactoryDaliyReportVo> pageList1(PagerQuery<FactoryDaliyReportQuery> pagerQuery) { |
||||
|
long startTime = System.currentTimeMillis(); // 记录开始时间
|
||||
|
PagerVo<FactoryDaliyReportVo> page = new PagerVo<>(); |
||||
|
long pageNum = pagerQuery.getCurrent(); |
||||
|
long pageSize = pagerQuery.getSize(); |
||||
|
FactoryDaliyReportQuery query = pagerQuery.getParams(); |
||||
|
QueryWrapper<FactoryDaliyReportVo> qw = new QueryWrapper<>(); |
||||
|
if (query != null) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
Map<String, Object> map = new HashMap<>(); |
||||
|
map.put("page", (pageNum - 1) * pageSize); |
||||
|
map.put("size", pageSize); |
||||
|
List<FactoryDaliyReportVo> recordList = factoryDaliyReportMapper.selectRecordList(map, qw); |
||||
|
recordList.removeAll(Collections.singleton(null)); |
||||
|
if (!recordList.isEmpty()) { |
||||
|
for (int i = 0; i < recordList.size(); i++) { |
||||
|
FactoryDaliyReportVo factoryDaliyReportVo = recordList.get(i); |
||||
|
UnUploadVo unUploadVo = new UnUploadVo(); |
||||
|
unUploadVo.setTotal(factoryDaliyReportVo.getNotUploadMoney()); |
||||
|
unUploadVo.setFee(factoryDaliyReportVo.getFee()); |
||||
|
unUploadVo.setFeeOutlay(factoryDaliyReportVo.getExpense_payment()); |
||||
|
unUploadVo.setFeeTopping(factoryDaliyReportVo.getOffset_payment()); |
||||
|
unUploadVo.setRebate(factoryDaliyReportVo.getUnuploaded_rebate()); |
||||
|
unUploadVo.setFeeUnPaid(factoryDaliyReportVo.getPending_payment()); |
||||
|
factoryDaliyReportVo.setUnUpload(unUploadVo); |
||||
|
} |
||||
|
} |
||||
|
int count = factoryDaliyReportMapper.selectRecordCount(qw); |
||||
|
page.setRecords(recordList); |
||||
|
page.setCurrent(pageNum); |
||||
|
page.setSize(pageSize); |
||||
|
page.setTotal(count); |
||||
|
long pages = (count + pageSize - 1) / pageSize; |
||||
|
page.setPages(pages); |
||||
|
long endTime = System.currentTimeMillis(); // 记录结束时间
|
||||
|
long duration = endTime - startTime; // 计算耗时
|
||||
|
log.info("集团日报列表接口耗时 {} ms", duration); // 输出日志
|
||||
|
return page; |
||||
|
} |
||||
|
|
||||
|
public Map<String, Object> pageList(PagerQuery<FactoryDaliyReportQuery> pagerQuery) { |
||||
|
Map<String, Object> reportMap = new HashMap<>(); |
||||
|
long pageNum = pagerQuery.getCurrent(); |
||||
|
long pageSize = pagerQuery.getSize(); |
||||
|
FactoryDaliyReportQuery query = pagerQuery.getParams(); |
||||
|
QueryWrapper<FactoryDaliyReportVo> qw = new QueryWrapper<>(); |
||||
|
String orgPath = query.getOrgPath(); |
||||
|
List<String> orgSidList = Arrays.asList(orgPath.split("/")); |
||||
|
String type = query.getType(); |
||||
|
String name = ""; |
||||
|
if (StringUtils.isNotBlank(type)) { |
||||
|
if ("syb".equals(type)) { |
||||
|
// 取事业部(前两级)
|
||||
|
if (orgSidList.size() >= 2) { |
||||
|
String groupSid = orgSidList.get(0); |
||||
|
String sybSid = orgSidList.get(1); |
||||
|
String orgPathPrefix = groupSid + "/" + sybSid; |
||||
|
|
||||
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(sybSid).getData(); |
||||
|
name = sysOrganization.getName(); |
||||
|
reportMap.put("linkSid", sybSid); |
||||
|
qw.like("orgPath", orgPathPrefix); |
||||
|
} |
||||
|
|
||||
|
} else if ("jt".equals(type)) { |
||||
|
name = "集团"; |
||||
|
} |
||||
|
} else { |
||||
|
if (orgSidList.size() >= 3) { |
||||
|
String groupSid = orgSidList.get(0); |
||||
|
String sybSid = orgSidList.get(1); |
||||
|
String fgsSid = orgSidList.get(2); |
||||
|
String orgPathPrefix = groupSid + "/" + sybSid + "/" + fgsSid; |
||||
|
|
||||
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(fgsSid).getData(); |
||||
|
name = sysOrganization.getName(); |
||||
|
reportMap.put("linkSid", fgsSid); |
||||
|
qw.like("orgPath", orgPathPrefix); |
||||
|
} |
||||
|
} |
||||
|
reportMap.put("name", name); |
||||
|
Map<String, Object> map = new HashMap<>(); |
||||
|
map.put("page", (pageNum - 1) * pageSize); |
||||
|
map.put("size", pageSize); |
||||
|
List<FactoryDaliyReportVo> recordList = factoryDaliyReportMapper.selectRecordList(map, qw); |
||||
|
recordList.removeAll(Collections.singleton(null)); |
||||
|
if (!recordList.isEmpty()) { |
||||
|
for (int i = 0; i < recordList.size(); i++) { |
||||
|
FactoryDaliyReportVo factoryDaliyReportVo = recordList.get(i); |
||||
|
factoryDaliyReportVo.setEstimate(DecimalUtil.format(factoryDaliyReportVo.getEstimate())); |
||||
|
factoryDaliyReportVo.setUpload(DecimalUtil.format(factoryDaliyReportVo.getUpload())); |
||||
|
factoryDaliyReportVo.setAdjust(DecimalUtil.format(factoryDaliyReportVo.getAdjust())); |
||||
|
factoryDaliyReportVo.setNotUploadMoney(DecimalUtil.format(factoryDaliyReportVo.getNotUploadMoney())); |
||||
|
factoryDaliyReportVo.setUnuploaded_rebate(DecimalUtil.format(factoryDaliyReportVo.getUnuploaded_rebate())); |
||||
|
factoryDaliyReportVo.setFee(DecimalUtil.format(factoryDaliyReportVo.getFee())); |
||||
|
factoryDaliyReportVo.setExpense_payment(DecimalUtil.format(factoryDaliyReportVo.getExpense_payment())); |
||||
|
factoryDaliyReportVo.setPending_payment(DecimalUtil.format(factoryDaliyReportVo.getPending_payment())); |
||||
|
factoryDaliyReportVo.setOffset_payment(DecimalUtil.format(factoryDaliyReportVo.getOffset_payment())); |
||||
|
UnUploadVo unUploadVo = new UnUploadVo(); |
||||
|
unUploadVo.setTotal(factoryDaliyReportVo.getNotUploadMoney()); |
||||
|
unUploadVo.setFee(factoryDaliyReportVo.getFee()); |
||||
|
unUploadVo.setFeeOutlay(factoryDaliyReportVo.getExpense_payment()); |
||||
|
unUploadVo.setFeeTopping(factoryDaliyReportVo.getOffset_payment()); |
||||
|
unUploadVo.setRebate(factoryDaliyReportVo.getUnuploaded_rebate()); |
||||
|
unUploadVo.setFeeUnPaid(factoryDaliyReportVo.getPending_payment()); |
||||
|
factoryDaliyReportVo.setUnUpload(unUploadVo); |
||||
|
if(StringUtils.isBlank(type)){ |
||||
|
String orgSid = orgSidList.get(2); |
||||
|
factoryDaliyReportVo.setLinkSid(orgSid+"#"+factoryDaliyReportVo.getYear()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
int count = factoryDaliyReportMapper.selectRecordCount(qw); |
||||
|
long pages = (count + pageSize - 1) / pageSize; |
||||
|
reportMap.put("pages", pages); |
||||
|
reportMap.put("total", count); |
||||
|
reportMap.put("size", pageSize); |
||||
|
reportMap.put("current", pageNum); |
||||
|
reportMap.put("records", recordList); |
||||
|
return reportMap; |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.yxt.anrui.reportcenter.config; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.math.RoundingMode; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2025/5/21 |
||||
|
**/ |
||||
|
public class DecimalUtil { |
||||
|
public static String format(Object obj) { |
||||
|
if (obj == null) return "0.00"; |
||||
|
try { |
||||
|
return new BigDecimal(obj.toString()).setScale(2, RoundingMode.HALF_UP).toPlainString(); |
||||
|
} catch (Exception e) { |
||||
|
return "0.00"; |
||||
|
} |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
Loading…
Reference in new issue