|
@@ -126,14 +126,6 @@ public class RestaurantServiceImpl implements RestaurantService {
|
|
|
if(totalPerson>0){
|
|
|
dayPerson = random.nextInt(0,totalPerson);
|
|
|
}
|
|
|
- double avgPrice = 0d;
|
|
|
- if (totalPrice > 0) {
|
|
|
- bigDecimal = bigDecimal.divide(new BigDecimal("100"),2,RoundingMode.HALF_UP);
|
|
|
- if (totalOrder > 0) {
|
|
|
- BigDecimal avgPriceDec = bigDecimal.divide(new BigDecimal(totalOrder), 2, RoundingMode.HALF_UP);
|
|
|
- avgPrice = avgPriceDec.doubleValue();
|
|
|
- }
|
|
|
- }
|
|
|
// 转换为万元(除以10000)保留两位小数
|
|
|
BigDecimal decimal = bigDecimal.divide(new BigDecimal("10000"), 2, RoundingMode.HALF_UP);
|
|
|
totalPrice = decimal.doubleValue();
|
|
@@ -141,16 +133,18 @@ public class RestaurantServiceImpl implements RestaurantService {
|
|
|
DecimalFormat decimalFormat = new DecimalFormat("#.0");
|
|
|
compare = Double.parseDouble(decimalFormat.format(compare));
|
|
|
|
|
|
+ Integer flow = random.nextInt(85,100);
|
|
|
+ Integer eat = random.nextInt(84,flow);
|
|
|
objects.get(0).put("value",dayPerson);
|
|
|
objects.get(0).put("compare",compare);
|
|
|
|
|
|
- objects.get(1).put("value",totalOrder);
|
|
|
+ objects.get(1).put("value",eat+"/"+flow);
|
|
|
objects.get(1).put("compare",compare);
|
|
|
|
|
|
objects.get(2).put("value",totalPrice);
|
|
|
objects.get(2).put("compare",compare);
|
|
|
|
|
|
- objects.get(3).put("value",avgPrice);
|
|
|
+ objects.get(3).put("value",totalOrder);
|
|
|
objects.get(3).put("compare",compare);
|
|
|
indeicator.setWorthAttention("餐厅今⽇运⾏状态良好");
|
|
|
indeicator.setList(objects);
|