|
@@ -81,28 +81,28 @@ public class RestaurantServiceImpl implements RestaurantService {
|
|
|
@Override
|
|
|
public ReturnMsg getPaymentAnalysis(IocParam iocParam) {
|
|
|
List<Cake> lists = new ArrayList<>();
|
|
|
- Double offline = cuisineOrderMapper.getTotalPriceByCompanyIdAndDeptId(iocParam,19);
|
|
|
- Double scanningCode =cuisineOrderMapper.getTotalPriceByCompanyIdAndDeptId(iocParam,16);
|
|
|
- Double payCard =cuisineOrderMapper.getTotalPriceByCompanyIdAndDeptId(iocParam,1);
|
|
|
- Double face = cuisineOrderMapper.getTotalPriceByCompanyIdAndDeptId(iocParam,4);
|
|
|
- offline = offline==null?0:offline;
|
|
|
- scanningCode = scanningCode==null?0:scanningCode;
|
|
|
- payCard = payCard==null?0:payCard;
|
|
|
- face = face==null?0:face;
|
|
|
- Cake cake1 = new Cake();
|
|
|
+ // Double offline = cuisineOrderMapper.getTotalPriceByCompanyIdAndDeptId(iocParam,19);
|
|
|
+ Double scanningCode =cuisineOrderMapper.getTotalPriceByCompanyIdAndDeptId(iocParam,13);
|
|
|
+ Double payCard =cuisineOrderMapper.getTotalPriceByCompanyIdAndDeptId(iocParam,2);
|
|
|
+ Double face = cuisineOrderMapper.getTotalPriceByCompanyIdAndDeptId(iocParam,1);
|
|
|
+ // offline = offline==null?0:offline;
|
|
|
+ scanningCode = scanningCode==null?0:new BigDecimal(scanningCode).divide(new BigDecimal("100"),2,RoundingMode.HALF_UP).doubleValue();
|
|
|
+ payCard = payCard==null?0:new BigDecimal(payCard).divide(new BigDecimal("100"),2,RoundingMode.HALF_UP).doubleValue();
|
|
|
+ face = face==null?0:new BigDecimal(face).divide(new BigDecimal("100"),2,RoundingMode.HALF_UP).doubleValue();
|
|
|
+ // Cake cake1 = new Cake();
|
|
|
Cake cake2 = new Cake();
|
|
|
Cake cake3 = new Cake();
|
|
|
Cake cake4 = new Cake();
|
|
|
- cake1.setName("线下");
|
|
|
+ //cake1.setName("线下");
|
|
|
cake2.setName("扫码");
|
|
|
cake3.setName("人脸");
|
|
|
cake4.setName("刷卡");
|
|
|
cake4.setValue(payCard);
|
|
|
cake3.setValue(face);
|
|
|
cake2.setValue(scanningCode);
|
|
|
- cake1.setValue(offline);
|
|
|
+ //cake1.setValue(offline);
|
|
|
lists.add(cake3);
|
|
|
- lists.add(cake1);
|
|
|
+ // lists.add(cake1);
|
|
|
lists.add(cake2);
|
|
|
lists.add(cake4);
|
|
|
return ReturnMsg.ok(lists);
|
|
@@ -128,6 +128,7 @@ public class RestaurantServiceImpl implements RestaurantService {
|
|
|
}
|
|
|
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();
|
|
@@ -221,9 +222,9 @@ public class RestaurantServiceImpl implements RestaurantService {
|
|
|
Double breakfastPrice = cuisineOrderMapper.getAvgPriceByCompanyIdAndDeptId(iocParam1);
|
|
|
Double lunchPrice = cuisineOrderMapper.getAvgPriceByCompanyIdAndDeptId(iocParam2);
|
|
|
Double dinnerPrice = cuisineOrderMapper.getAvgPriceByCompanyIdAndDeptId(iocParam3);
|
|
|
- breakfastPrice = breakfastPrice==null?0:Double.valueOf(decimalFormat.format(breakfastPrice));
|
|
|
- lunchPrice = lunchPrice==null?0:Double.valueOf(decimalFormat.format(lunchPrice));
|
|
|
- dinnerPrice = dinnerPrice==null?0:Double.valueOf(decimalFormat.format(dinnerPrice));
|
|
|
+ breakfastPrice = breakfastPrice==null?0:new BigDecimal(breakfastPrice).divide(new BigDecimal("100"),2,RoundingMode.HALF_UP).doubleValue();
|
|
|
+ lunchPrice = lunchPrice==null?0:new BigDecimal(lunchPrice).divide(new BigDecimal("100"),2,RoundingMode.HALF_UP).doubleValue();
|
|
|
+ dinnerPrice = dinnerPrice==null?0:new BigDecimal(dinnerPrice).divide(new BigDecimal("100"),2,RoundingMode.HALF_UP).doubleValue();
|
|
|
jsonObject.put(param[0],totalBreakfastPerson);
|
|
|
jsonObject.put(param[1],totalLunchPerson);
|
|
|
jsonObject.put(param[2],totalDinnerPerson);
|
|
@@ -284,6 +285,9 @@ public class RestaurantServiceImpl implements RestaurantService {
|
|
|
dinner += order.getOrderPrice();
|
|
|
}
|
|
|
}
|
|
|
+ breakfast = new BigDecimal(breakfast).divide(new BigDecimal("100"),2,RoundingMode.HALF_UP).doubleValue();
|
|
|
+ lunch = new BigDecimal(lunch).divide(new BigDecimal("100"),2,RoundingMode.HALF_UP).doubleValue();
|
|
|
+ dinner = new BigDecimal(dinner).divide(new BigDecimal("100"),2,RoundingMode.HALF_UP).doubleValue();
|
|
|
}
|
|
|
cakeBreakfast.setValue(breakfast);
|
|
|
cakeDinner.setValue(dinner);
|
|
@@ -407,7 +411,7 @@ public class RestaurantServiceImpl implements RestaurantService {
|
|
|
iocTimeRange.setEndDate(labKey[i]+" 23:59:00");
|
|
|
iocParam1.setTimeRange(iocTimeRange);
|
|
|
Double totalPrice = cuisineOrderMapper.getTotalPriceByCompanyIdAndDeptId(iocParam1,null);
|
|
|
- totalPrice = totalPrice == null ? 0 : totalPrice;
|
|
|
+ totalPrice = totalPrice == null ? 0 : new BigDecimal(totalPrice).divide(new BigDecimal("100"),2,RoundingMode.HALF_UP).doubleValue();
|
|
|
totalPrice = Double.valueOf(decimalFormat.format(totalPrice));
|
|
|
Integer totalOrder = cuisineOrderMapper.getTotalOrderByCompanyIdAndDeptId(iocParam1);
|
|
|
jsonObject.put(param[0],totalPrice);
|