|
@@ -773,27 +773,29 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
DeviceInfoDto.DeviceDataCountVO vo = new DeviceInfoDto.DeviceDataCountVO();
|
|
DeviceInfoDto.DeviceDataCountVO vo = new DeviceInfoDto.DeviceDataCountVO();
|
|
//当天
|
|
//当天
|
|
DeviceDataDto.Vo dayData = deviceDataService.getByDay(deviceId, mercId, DateUtil.format(new Date(), DatePattern.PURE_DATE_PATTERN));
|
|
DeviceDataDto.Vo dayData = deviceDataService.getByDay(deviceId, mercId, DateUtil.format(new Date(), DatePattern.PURE_DATE_PATTERN));
|
|
|
|
+ if (dayData != null) {
|
|
|
|
+ //今日退款成功订单金额
|
|
|
|
+ OrderRefundDto.CountByDateVO countByDateVO = R.feignCheckData(
|
|
|
|
+ refundService.countByDate(new OrderRefundDto.CountByDateDTO()
|
|
|
|
+ .setDate(DateTime.now())
|
|
|
|
+ .setMercId(mercId).setDeviceId(deviceId)));
|
|
|
|
+ Integer hisRefundMoney = countByDateVO.getHisRefundMoney();
|
|
|
|
+ Integer todayRefundMoney = countByDateVO.getTodayRefundMoney();
|
|
|
|
+ //今日销售额 (扣除今日的订单的退款金额)
|
|
|
|
+ dayData.setSalesMoney(dayData.getSalesMoney() - todayRefundMoney);
|
|
|
|
+ dayData.setRefundMoney(hisRefundMoney + todayRefundMoney);
|
|
|
|
+ }
|
|
|
|
|
|
- //今日退款成功订单金额
|
|
|
|
- OrderRefundDto.CountByDateVO countByDateVO = R.feignCheckData(
|
|
|
|
- refundService.countByDate(new OrderRefundDto.CountByDateDTO()
|
|
|
|
- .setDate(DateTime.now())
|
|
|
|
- .setMercId(mercId).setDeviceId(deviceId)));
|
|
|
|
- Integer hisRefundMoney = countByDateVO.getHisRefundMoney();
|
|
|
|
- Integer todayRefundMoney = countByDateVO.getTodayRefundMoney();
|
|
|
|
- //今日销售额 (扣除今日的订单的退款金额)
|
|
|
|
- dayData.setSalesMoney(dayData.getSalesMoney() - todayRefundMoney);
|
|
|
|
- dayData.setRefundMoney(hisRefundMoney + todayRefundMoney);
|
|
|
|
|
|
|
|
//当月
|
|
//当月
|
|
DeviceDataDto.Vo monthData = deviceDataService.getByMonth(deviceId, mercId, DateUtil.format(new Date(), DatePattern.SIMPLE_MONTH_PATTERN));
|
|
DeviceDataDto.Vo monthData = deviceDataService.getByMonth(deviceId, mercId, DateUtil.format(new Date(), DatePattern.SIMPLE_MONTH_PATTERN));
|
|
- OrderRefundDto.CountByMonthVO countByMonthVO = R.feignCheckData(refundService.countByMonth(new OrderRefundDto.CountByMonthDTO().setCurMonthDate(DateTime.now()).setMercId(mercId).setDeviceId(deviceId)));
|
|
|
|
- Integer hisMonthRefundMoney = countByMonthVO.getHisMonthRefundMoney();
|
|
|
|
- Integer monthRefundMoney = countByMonthVO.getMonthRefundMoney();
|
|
|
|
- monthData.setRefundMoney(hisMonthRefundMoney + monthRefundMoney);
|
|
|
|
- monthData.setSalesMoney(monthData.getSalesMoney() - monthRefundMoney);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ if (monthData != null) {
|
|
|
|
+ OrderRefundDto.CountByMonthVO countByMonthVO = R.feignCheckData(refundService.countByMonth(new OrderRefundDto.CountByMonthDTO().setCurMonthDate(DateTime.now()).setMercId(mercId).setDeviceId(deviceId)));
|
|
|
|
+ Integer hisMonthRefundMoney = countByMonthVO.getHisMonthRefundMoney();
|
|
|
|
+ Integer monthRefundMoney = countByMonthVO.getMonthRefundMoney();
|
|
|
|
+ monthData.setRefundMoney(hisMonthRefundMoney + monthRefundMoney);
|
|
|
|
+ monthData.setSalesMoney(monthData.getSalesMoney() - monthRefundMoney);
|
|
|
|
+ }
|
|
vo.setDayBusinessData(copy(DeviceInfoDto.BusinessData.class, dayData));
|
|
vo.setDayBusinessData(copy(DeviceInfoDto.BusinessData.class, dayData));
|
|
vo.setMonthBusinessData(copy(DeviceInfoDto.BusinessData.class, monthData));
|
|
vo.setMonthBusinessData(copy(DeviceInfoDto.BusinessData.class, monthData));
|
|
return vo;
|
|
return vo;
|