|
|
@ -596,7 +596,7 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
return rb.success().setData(dailyReportAppVo); |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<DailyReportAppPagerVo> pageList1(PagerQuery<DailyReportAppPagerQuery> pagerQuery) { |
|
|
|
public PagerVo<DailyReportListVo> pageList1(PagerQuery<DailyReportAppPagerQuery> pagerQuery) { |
|
|
|
DailyReportAppPagerQuery query = pagerQuery.getParams(); |
|
|
|
QueryWrapper<DailyReport> qw = new QueryWrapper<>(); |
|
|
|
if (query != null) { |
|
|
@ -622,7 +622,7 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
dailyReportListVo.setSaleOfStockRatio(ratio); |
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<DailyReportAppPagerVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
PagerVo<DailyReportListVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
|
|
|
|
return p; |
|
|
|
} |
|
|
@ -1747,4 +1747,125 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
return findGCD(b % a, a); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public PagerVo<DailyReportListVo> pageList2(PagerQuery<DailyReportAppPagerQuery> pagerQuery) { |
|
|
|
DailyReportAppPagerQuery query = pagerQuery.getParams(); |
|
|
|
QueryWrapper<DailyReport> qw = new QueryWrapper<>(); |
|
|
|
if (query != null) { |
|
|
|
//查询事业部
|
|
|
|
if (StringUtils.isNotBlank(query.getOrgPath())) { |
|
|
|
List<String> stringList = Arrays.asList(query.getOrgPath().split("/")); |
|
|
|
String busOrgSid = query.getOrgPath().substring(37, 73); |
|
|
|
qw.eq("busOrgSid", busOrgSid); |
|
|
|
} |
|
|
|
} |
|
|
|
IPage<DailyReport> page = PagerUtil.queryToPage(pagerQuery); |
|
|
|
IPage<DailyReportListVo> pagging = baseMapper.pageList2(page, qw); |
|
|
|
List<DailyReportListVo> recordList = pagging.getRecords(); |
|
|
|
recordList.removeAll(Collections.singleton(null)); |
|
|
|
if (!recordList.isEmpty()) { |
|
|
|
for (int i = 0; i < recordList.size(); i++) { |
|
|
|
DailyReportListVo dailyReportListVo = recordList.get(i); |
|
|
|
String ratio = ""; |
|
|
|
if (StringUtils.isBlank(dailyReportListVo.getSaleAllToThree())) { |
|
|
|
ratio = dailyReportListVo.getStock_subtotal() + ":1"; |
|
|
|
} else { |
|
|
|
if ("0".equals(dailyReportListVo.getSaleAllToThree())) { |
|
|
|
ratio = dailyReportListVo.getStock_subtotal() + ":1"; |
|
|
|
} else { |
|
|
|
ratio = new BigDecimal(dailyReportListVo.getStock_total()).divide((new BigDecimal(dailyReportListVo.getSaleAllToThree()).divide(new BigDecimal(3), 4, BigDecimal.ROUND_HALF_UP)), 0, BigDecimal.ROUND_HALF_UP).toString() + ":1"; |
|
|
|
} |
|
|
|
} |
|
|
|
dailyReportListVo.setSaleOfStockRatio(ratio); |
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<DailyReportListVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<ReportVo> getReport2(String date, String orgPath) { |
|
|
|
ResultBean<ReportVo> rb = ResultBean.fireFail(); |
|
|
|
QueryWrapper<DailyReport> qw = new QueryWrapper<>(); |
|
|
|
if (StringUtils.isNotBlank(date)) { |
|
|
|
qw.like("createTime", date); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(orgPath)){ |
|
|
|
List<String> stringList = Arrays.asList(orgPath.split("/")); |
|
|
|
String busOrgSid = orgPath.substring(37, 73); |
|
|
|
qw.eq("busOrgSid", busOrgSid); |
|
|
|
} |
|
|
|
ReportVo reportVo = baseMapper.getReport(qw); |
|
|
|
String ratio = ""; |
|
|
|
if (StringUtils.isBlank(reportVo.getSaleAllToThree())) { |
|
|
|
ratio = reportVo.getStock_subtotal() + ":1"; |
|
|
|
} else { |
|
|
|
if ("0".equals(reportVo.getSaleAllToThree())) { |
|
|
|
ratio = reportVo.getStock_subtotal() + ":1"; |
|
|
|
} else { |
|
|
|
ratio = new BigDecimal(reportVo.getStock_total()).divide((new BigDecimal(reportVo.getSaleAllToThree()).divide(new BigDecimal(3), 4, BigDecimal.ROUND_HALF_UP)), 0, BigDecimal.ROUND_HALF_UP).toString() + ":1"; |
|
|
|
} |
|
|
|
} |
|
|
|
reportVo.setSaleOfStockRatio(ratio); |
|
|
|
return rb.success().setData(reportVo); |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<DailyReportListVo> pageList3(PagerQuery<DailyReportAppPagerQuery> pagerQuery) { |
|
|
|
DailyReportAppPagerQuery query = pagerQuery.getParams(); |
|
|
|
QueryWrapper<DailyReport> qw = new QueryWrapper<>(); |
|
|
|
if (query != null) { |
|
|
|
//查询分公司
|
|
|
|
if (StringUtils.isNotBlank(query.getOrgPath())) { |
|
|
|
List<String> stringList = Arrays.asList(query.getOrgPath().split("/")); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getOrgSidByPath(query.getOrgPath()).getData(); |
|
|
|
qw.eq("useOrgSid",useOrgSid); |
|
|
|
} |
|
|
|
} |
|
|
|
IPage<DailyReport> page = PagerUtil.queryToPage(pagerQuery); |
|
|
|
IPage<DailyReportListVo> pagging = baseMapper.pageList2(page, qw); |
|
|
|
List<DailyReportListVo> recordList = pagging.getRecords(); |
|
|
|
recordList.removeAll(Collections.singleton(null)); |
|
|
|
if (!recordList.isEmpty()) { |
|
|
|
for (int i = 0; i < recordList.size(); i++) { |
|
|
|
DailyReportListVo dailyReportListVo = recordList.get(i); |
|
|
|
String ratio = ""; |
|
|
|
if (StringUtils.isBlank(dailyReportListVo.getSaleAllToThree())) { |
|
|
|
ratio = dailyReportListVo.getStock_subtotal() + ":1"; |
|
|
|
} else { |
|
|
|
if ("0".equals(dailyReportListVo.getSaleAllToThree())) { |
|
|
|
ratio = dailyReportListVo.getStock_subtotal() + ":1"; |
|
|
|
} else { |
|
|
|
ratio = new BigDecimal(dailyReportListVo.getStock_total()).divide((new BigDecimal(dailyReportListVo.getSaleAllToThree()).divide(new BigDecimal(3), 4, BigDecimal.ROUND_HALF_UP)), 0, BigDecimal.ROUND_HALF_UP).toString() + ":1"; |
|
|
|
} |
|
|
|
} |
|
|
|
dailyReportListVo.setSaleOfStockRatio(ratio); |
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<DailyReportListVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<ReportVo> getReport3(String date, String orgPath) { |
|
|
|
ResultBean<ReportVo> rb = ResultBean.fireFail(); |
|
|
|
QueryWrapper<DailyReport> qw = new QueryWrapper<>(); |
|
|
|
if (StringUtils.isNotBlank(date)) { |
|
|
|
qw.like("createTime", date); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(orgPath)){ |
|
|
|
String useOrgSid= sysStaffOrgFeign.getOrgSidByPath(orgPath).getData(); |
|
|
|
qw.eq("useOrgSid",useOrgSid); |
|
|
|
} |
|
|
|
ReportVo reportVo = baseMapper.getReport(qw); |
|
|
|
String ratio = ""; |
|
|
|
if (StringUtils.isBlank(reportVo.getSaleAllToThree())) { |
|
|
|
ratio = reportVo.getStock_subtotal() + ":1"; |
|
|
|
} else { |
|
|
|
if ("0".equals(reportVo.getSaleAllToThree())) { |
|
|
|
ratio = reportVo.getStock_subtotal() + ":1"; |
|
|
|
} else { |
|
|
|
ratio = new BigDecimal(reportVo.getStock_total()).divide((new BigDecimal(reportVo.getSaleAllToThree()).divide(new BigDecimal(3), 4, BigDecimal.ROUND_HALF_UP)), 0, BigDecimal.ROUND_HALF_UP).toString() + ":1"; |
|
|
|
} |
|
|
|
} |
|
|
|
reportVo.setSaleOfStockRatio(ratio); |
|
|
|
return rb.success().setData(reportVo); |
|
|
|
} |
|
|
|
} |
|
|
|