|
|
@ -333,7 +333,7 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
String row4alll = row4All.toString().contains(".") ? dicimalToFraction(Double.valueOf(row4All.toString())) : (row4All.toString() + ":1"); |
|
|
|
row4.add(row4alll); |
|
|
|
dailyReportAppVo.setRow4(row4);*/ |
|
|
|
List<String> row4 = dailyReportVoList.stream().map(v -> |
|
|
|
/*List<String> row4 = dailyReportVoList.stream().map(v -> |
|
|
|
v.getSaleOfStockRatio() + ":1" |
|
|
|
).collect(Collectors.toList()); |
|
|
|
BigDecimal row4All = dailyReportVoList.stream().map(v -> |
|
|
@ -341,6 +341,38 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
).collect(Collectors.toList()).stream().map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
String row4alll = row4All.toString() + ":1"; |
|
|
|
row4.add(row4alll); |
|
|
|
dailyReportAppVo.setRow4(row4);*/ |
|
|
|
List<String> row4 = dailyReportVoList.stream().map(v -> { |
|
|
|
String saleOfStockRatio = ""; |
|
|
|
try { |
|
|
|
|
|
|
|
Field field = v.getClass().getDeclaredField(String.valueOf(v.getSaleAllToThree())); |
|
|
|
field.setAccessible(true); |
|
|
|
String saleAllToThree = (String) field.get(v);//前三个月销售台数之和
|
|
|
|
Field fieldStockTotal = v.getClass().getDeclaredField(String.valueOf(v.getStock_total())); |
|
|
|
fieldStockTotal.setAccessible(true); |
|
|
|
String stock_total = (String) fieldStockTotal.get(v);//库存总计
|
|
|
|
if(StringUtils.isBlank(saleAllToThree)){ |
|
|
|
saleOfStockRatio =stock_total+":1"; |
|
|
|
}else{ |
|
|
|
saleOfStockRatio = new BigDecimal(stock_total).divide((new BigDecimal(saleAllToThree).divide(new BigDecimal(3),4,BigDecimal.ROUND_HALF_UP)),2,BigDecimal.ROUND_HALF_UP).toString()+":1"; |
|
|
|
} |
|
|
|
return saleOfStockRatio; |
|
|
|
|
|
|
|
} catch (NoSuchFieldException | IllegalAccessException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
return saleOfStockRatio; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
int saleAllToThreeAll = dailyReportVoList.stream().mapToInt(v->v.getSaleAllToThree()).sum(); |
|
|
|
int stock_totalAll = dailyReportVoList.stream().mapToInt(v->v.getStock_total()).sum(); |
|
|
|
String saleOfStockRatioString = ""; |
|
|
|
if(saleAllToThreeAll == 0){ |
|
|
|
saleOfStockRatioString = stock_totalAll+":1"; |
|
|
|
}else{ |
|
|
|
saleOfStockRatioString = new BigDecimal(stock_totalAll).divide((new BigDecimal(saleAllToThreeAll).divide(new BigDecimal(3),4,BigDecimal.ROUND_HALF_UP)),2,BigDecimal.ROUND_HALF_UP).toString()+":1"; |
|
|
|
} |
|
|
|
row4.add(saleOfStockRatioString); |
|
|
|
dailyReportAppVo.setRow4(row4); |
|
|
|
//库存总计
|
|
|
|
List<String> row5 = dailyReportVoList.stream().map(v -> String.valueOf(v.getStock_total())).collect(Collectors.toList()); |
|
|
@ -584,8 +616,16 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
if (!recordList.isEmpty()) { |
|
|
|
for (int i = 0; i < recordList.size(); i++) { |
|
|
|
DailyReportListVo dailyReportListVo = recordList.get(i); |
|
|
|
// String ratio = dailyReportListVo.getSaleOfStockRatio().contains(".") ? dicimalToFraction(Double.valueOf(dailyReportListVo.getSaleOfStockRatio())) : (dailyReportListVo.getSaleOfStockRatio() + ":1");
|
|
|
|
String ratio = dailyReportListVo.getSaleOfStockRatio() + ":1"; |
|
|
|
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_subtotal()).divide((new BigDecimal(dailyReportListVo.getSaleAllToThree()).divide(new BigDecimal(3),4,BigDecimal.ROUND_HALF_UP)),2,BigDecimal.ROUND_HALF_UP).toString()+":1"; |
|
|
|
} |
|
|
|
} |
|
|
|
dailyReportListVo.setSaleOfStockRatio(ratio); |
|
|
|
} |
|
|
|
} |
|
|
@ -601,7 +641,16 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
qw.like("createTime", date); |
|
|
|
} |
|
|
|
ReportVo reportVo = baseMapper.getReport(qw); |
|
|
|
String ratio = reportVo.getSaleOfStockRatio() + ":1"; |
|
|
|
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_subtotal()).divide((new BigDecimal(reportVo.getSaleAllToThree()).divide(new BigDecimal(3),4,BigDecimal.ROUND_HALF_UP)),2,BigDecimal.ROUND_HALF_UP).toString()+":1"; |
|
|
|
} |
|
|
|
} |
|
|
|
reportVo.setSaleOfStockRatio(ratio); |
|
|
|
return rb.success().setData(reportVo); |
|
|
|
} |
|
|
@ -631,7 +680,7 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
String row4alll = row4All.toString().contains(".") ? dicimalToFraction(Double.valueOf(row4All.toString())) : (row4All.toString() + ":1"); |
|
|
|
row4.add(row4alll); |
|
|
|
dailyReportAppVo.setRow4(row4);*/ |
|
|
|
List<String> row4 = dailyReportVoList.stream().map(v -> |
|
|
|
/*List<String> row4 = dailyReportVoList.stream().map(v -> |
|
|
|
v.getSaleOfStockRatio() + ":1" |
|
|
|
).collect(Collectors.toList()); |
|
|
|
BigDecimal row4All = dailyReportVoList.stream().map(v -> |
|
|
@ -639,6 +688,38 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
).collect(Collectors.toList()).stream().map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
String row4alll = row4All.toString() + ":1"; |
|
|
|
row4.add(row4alll); |
|
|
|
dailyReportAppVo.setRow4(row4);*/ |
|
|
|
List<String> row4 = dailyReportVoList.stream().map(v -> { |
|
|
|
String saleOfStockRatio = ""; |
|
|
|
try { |
|
|
|
|
|
|
|
Field field = v.getClass().getDeclaredField(String.valueOf(v.getSaleAllToThree())); |
|
|
|
field.setAccessible(true); |
|
|
|
String saleAllToThree = (String) field.get(v);//前三个月销售台数之和
|
|
|
|
Field fieldStockTotal = v.getClass().getDeclaredField(String.valueOf(v.getStock_total())); |
|
|
|
fieldStockTotal.setAccessible(true); |
|
|
|
String stock_total = (String) fieldStockTotal.get(v);//库存总计
|
|
|
|
if(StringUtils.isBlank(saleAllToThree)){ |
|
|
|
saleOfStockRatio =stock_total+":1"; |
|
|
|
}else{ |
|
|
|
saleOfStockRatio = new BigDecimal(stock_total).divide((new BigDecimal(saleAllToThree).divide(new BigDecimal(3),4,BigDecimal.ROUND_HALF_UP)),2,BigDecimal.ROUND_HALF_UP).toString()+":1"; |
|
|
|
} |
|
|
|
return saleOfStockRatio; |
|
|
|
|
|
|
|
} catch (NoSuchFieldException | IllegalAccessException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
return saleOfStockRatio; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
int saleAllToThreeAll = dailyReportVoList.stream().mapToInt(v->v.getSaleAllToThree()).sum(); |
|
|
|
int stock_totalAll = dailyReportVoList.stream().mapToInt(v->v.getStock_total()).sum(); |
|
|
|
String saleOfStockRatioString = ""; |
|
|
|
if(saleAllToThreeAll == 0){ |
|
|
|
saleOfStockRatioString = stock_totalAll+":1"; |
|
|
|
}else{ |
|
|
|
saleOfStockRatioString = new BigDecimal(stock_totalAll).divide((new BigDecimal(saleAllToThreeAll).divide(new BigDecimal(3),4,BigDecimal.ROUND_HALF_UP)),2,BigDecimal.ROUND_HALF_UP).toString()+":1"; |
|
|
|
} |
|
|
|
row4.add(saleOfStockRatioString); |
|
|
|
dailyReportAppVo.setRow4(row4); |
|
|
|
//库存总计
|
|
|
|
List<String> row5 = dailyReportVoList.stream().map(v -> String.valueOf(v.getStock_total())).collect(Collectors.toList()); |
|
|
@ -893,7 +974,7 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
String row4alll = row4All.toString().contains(".") ? dicimalToFraction(Double.valueOf(row4All.toString())) : (row4All.toString() + ":1"); |
|
|
|
row4.add(row4alll); |
|
|
|
dailyReportAppVo.setRow4(row4);*/ |
|
|
|
List<String> row4 = dailyReportVoList.stream().map(v -> |
|
|
|
/*List<String> row4 = dailyReportVoList.stream().map(v -> |
|
|
|
v.getSaleOfStockRatio() + ":1" |
|
|
|
).collect(Collectors.toList()); |
|
|
|
BigDecimal row4All = dailyReportVoList.stream().map(v -> |
|
|
@ -901,6 +982,38 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
).collect(Collectors.toList()).stream().map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
String row4alll = row4All.toString() + ":1"; |
|
|
|
row4.add(row4alll); |
|
|
|
dailyReportAppVo.setRow4(row4);*/ |
|
|
|
List<String> row4 = dailyReportVoList.stream().map(v -> { |
|
|
|
String saleOfStockRatio = ""; |
|
|
|
try { |
|
|
|
|
|
|
|
Field field = v.getClass().getDeclaredField(String.valueOf(v.getSaleAllToThree())); |
|
|
|
field.setAccessible(true); |
|
|
|
String saleAllToThree = (String) field.get(v);//前三个月销售台数之和
|
|
|
|
Field fieldStockTotal = v.getClass().getDeclaredField(String.valueOf(v.getStock_total())); |
|
|
|
fieldStockTotal.setAccessible(true); |
|
|
|
String stock_total = (String) fieldStockTotal.get(v);//库存总计
|
|
|
|
if(StringUtils.isBlank(saleAllToThree)){ |
|
|
|
saleOfStockRatio =stock_total+":1"; |
|
|
|
}else{ |
|
|
|
saleOfStockRatio = new BigDecimal(stock_total).divide((new BigDecimal(saleAllToThree).divide(new BigDecimal(3),4,BigDecimal.ROUND_HALF_UP)),2,BigDecimal.ROUND_HALF_UP).toString()+":1"; |
|
|
|
} |
|
|
|
return saleOfStockRatio; |
|
|
|
|
|
|
|
} catch (NoSuchFieldException | IllegalAccessException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
return saleOfStockRatio; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
int saleAllToThreeAll = dailyReportVoList.stream().mapToInt(v->v.getSaleAllToThree()).sum(); |
|
|
|
int stock_totalAll = dailyReportVoList.stream().mapToInt(v->v.getStock_total()).sum(); |
|
|
|
String saleOfStockRatioString = ""; |
|
|
|
if(saleAllToThreeAll == 0){ |
|
|
|
saleOfStockRatioString = stock_totalAll+":1"; |
|
|
|
}else{ |
|
|
|
saleOfStockRatioString = new BigDecimal(stock_totalAll).divide((new BigDecimal(saleAllToThreeAll).divide(new BigDecimal(3),4,BigDecimal.ROUND_HALF_UP)),2,BigDecimal.ROUND_HALF_UP).toString()+":1"; |
|
|
|
} |
|
|
|
row4.add(saleOfStockRatioString); |
|
|
|
dailyReportAppVo.setRow4(row4); |
|
|
|
//库存总计
|
|
|
|
List<String> row5 = dailyReportVoList.stream().map(v -> String.valueOf(v.getStock_total())).collect(Collectors.toList()); |
|
|
@ -1181,7 +1294,7 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
String row4alll = row4All.toString().contains(".") ? dicimalToFraction(Double.valueOf(row4All.toString())) : (row4All.toString() + ":1"); |
|
|
|
row4.add(row4alll); |
|
|
|
dailyReportAppVo.setRow4(row4);*/ |
|
|
|
List<String> row4 = dailyReportVoList.stream().map(v -> |
|
|
|
/* List<String> row4 = dailyReportVoList.stream().map(v -> |
|
|
|
v.getSaleOfStockRatio() + ":1" |
|
|
|
).collect(Collectors.toList()); |
|
|
|
BigDecimal row4All = dailyReportVoList.stream().map(v -> |
|
|
@ -1189,7 +1302,40 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
).collect(Collectors.toList()).stream().map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
|
String row4alll = row4All.toString() + ":1"; |
|
|
|
row4.add(row4alll); |
|
|
|
dailyReportAppVo.setRow4(row4);*/ |
|
|
|
List<String> row4 = dailyReportVoList.stream().map(v -> { |
|
|
|
String saleOfStockRatio = ""; |
|
|
|
try { |
|
|
|
|
|
|
|
Field field = v.getClass().getDeclaredField(String.valueOf(v.getSaleAllToThree())); |
|
|
|
field.setAccessible(true); |
|
|
|
String saleAllToThree = (String) field.get(v);//前三个月销售台数之和
|
|
|
|
Field fieldStockTotal = v.getClass().getDeclaredField(String.valueOf(v.getStock_total())); |
|
|
|
fieldStockTotal.setAccessible(true); |
|
|
|
String stock_total = (String) fieldStockTotal.get(v);//库存总计
|
|
|
|
if(StringUtils.isBlank(saleAllToThree)){ |
|
|
|
saleOfStockRatio =stock_total+":1"; |
|
|
|
}else{ |
|
|
|
saleOfStockRatio = new BigDecimal(stock_total).divide((new BigDecimal(saleAllToThree).divide(new BigDecimal(3),4,BigDecimal.ROUND_HALF_UP)),2,BigDecimal.ROUND_HALF_UP).toString()+":1"; |
|
|
|
} |
|
|
|
return saleOfStockRatio; |
|
|
|
|
|
|
|
} catch (NoSuchFieldException | IllegalAccessException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
return saleOfStockRatio; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
int saleAllToThreeAll = dailyReportVoList.stream().mapToInt(v->v.getSaleAllToThree()).sum(); |
|
|
|
int stock_totalAll = dailyReportVoList.stream().mapToInt(v->v.getStock_total()).sum(); |
|
|
|
String saleOfStockRatioString = ""; |
|
|
|
if(saleAllToThreeAll == 0){ |
|
|
|
saleOfStockRatioString = stock_totalAll+":1"; |
|
|
|
}else{ |
|
|
|
saleOfStockRatioString = new BigDecimal(stock_totalAll).divide((new BigDecimal(saleAllToThreeAll).divide(new BigDecimal(3),4,BigDecimal.ROUND_HALF_UP)),2,BigDecimal.ROUND_HALF_UP).toString()+":1"; |
|
|
|
} |
|
|
|
row4.add(saleOfStockRatioString); |
|
|
|
dailyReportAppVo.setRow4(row4); |
|
|
|
|
|
|
|
//库存总计
|
|
|
|
List<String> row5 = dailyReportVoList.stream().map(v -> String.valueOf(v.getStock_total())).collect(Collectors.toList()); |
|
|
|
BigDecimal row5All = row5.stream().map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
@ -1443,7 +1589,6 @@ public class DailyReportService extends MybatisBaseService<DailyReportMapper, Da |
|
|
|
return columnName; |
|
|
|
} |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
// columnNames.add("");
|
|
|
|
parameterVo.setRow(columnNames); |
|
|
|
dynamicRows.add(parameterVo); |
|
|
|
} |
|
|
|