|
|
@ -1,12 +1,16 @@ |
|
|
|
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; |
|
|
@ -15,10 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: |
|
|
@ -31,6 +32,8 @@ public class FactoryDaliyReportService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private FactoryDaliyReportMapper factoryDaliyReportMapper; |
|
|
|
@Autowired |
|
|
|
private SysOrganizationFeign sysOrganizationFeign; |
|
|
|
|
|
|
|
public PagerVo<FactoryDaliyReportVo> pageList1(PagerQuery<FactoryDaliyReportQuery> pagerQuery) { |
|
|
|
long startTime = System.currentTimeMillis(); // 记录开始时间
|
|
|
@ -73,4 +76,86 @@ public class FactoryDaliyReportService { |
|
|
|
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; |
|
|
|
} |
|
|
|
} |
|
|
|