| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.mzl.flower.config.exception.ValidationException; |
| | | import com.mzl.flower.dto.request.report.QueryAppSupplierDTO; |
| | | import com.mzl.flower.dto.request.report.QueryOrderDTO; |
| | | import com.mzl.flower.dto.request.report.QueryPartnerOrderDTO; |
| | | import com.mzl.flower.dto.request.report.QuerySupplierDTO; |
| | |
| | | import com.mzl.flower.service.report.OrderReportService; |
| | | import com.mzl.flower.utils.ExcelExportUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.hpsf.Decimal; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | |
| | | |
| | | String[] rowsName = new String[]{"序号","下单日期", "销售额", "花农底价", "平台区间加价", "平台加价", "平台区域加价" |
| | | , "合伙人加价", "合伙人区间加价", "会员折扣","优惠券","降级扣款","缺货扣款","补货扣款","售后扣合伙人款","售后扣花农款", |
| | | "售后扣平台款","总包干费","实际销售扎数","利润","结算状态",}; |
| | | "售后扣平台款","总包干费","总销售扎数","实际销售扎数","利润","结算状态",}; |
| | | List<Object[]> dataList = new ArrayList<>(); |
| | | int sn = 1; |
| | | for (OrderReportResultVO o : list) { |
| | |
| | | objs[a++] = o.getOrderFeeSupplier(); // 售后扣花农款 |
| | | objs[a++] = o.getOrderFeePlatform(); //售后扣平台款 |
| | | objs[a++] = o.getPartnerTotalFeeAmount(); // 总包干费 |
| | | objs[a++] = o.getOrderNum(); // 总销售扎数 |
| | | objs[a++] = o.getRealSaleNum(); // 实际销售扎数 |
| | | objs[a++] = o.getProfitFeeAmount(); //利润 |
| | | objs[a++] = o.getSettleStatus(); // 结算状态 |
| | |
| | | log.error(e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public AppSupplierStatisticsVO getAppSupplierStatistics(QueryAppSupplierDTO dto) { |
| | | |
| | | |
| | | |
| | | // 总成交:花农售卖全部的底价合计, |
| | | // 本月成交:本月售卖的底价合计, |
| | | // 上月成交:上月售卖的底价合计, |
| | | // 今日成交:今日售卖的底价合计, |
| | | // 近30天成交扎数:最近30天扎数合计(已有), |
| | | // 今日成交扎数(已有) |
| | | // 缺货(本月):本月质检缺货,并且web端审核通过的数量合计, |
| | | // 缺货(上月):上月质检缺货,并且web端审核通过的数量合计, |
| | | // 降级(本月):本月质检降级,并且web端审核通过的数量合计, |
| | | // 降级(上月):上月质检降级,并且web端审核通过的数量合计, |
| | | // 补货(本月):本月质检补货,并且web端审核通过的数量合计, |
| | | // 补货(上月):上月质检补货,并且web端审核通过的数量合计, |
| | | |
| | | // 当天的开始时间 |
| | | dto.setStartDateTime(getCurDayStartTime()); |
| | | // 当天的结束时间 |
| | | dto.setEndDateTime(getCurDayEndTime()); |
| | | |
| | | return orderReportMapper.getAppSupplierAmountStatistics(dto); |
| | | } |
| | | |
| | | // 计算 startDate 的前一天 17:00:00 |
| | | public static LocalDateTime calculateStartTime(LocalDateTime startDateTime) { |
| | | // 获取 LocalDate 部分 |
| | |
| | | return endOfDay; |
| | | } |
| | | |
| | | // 获取当天的开始时间 |
| | | public static LocalDateTime getCurDayStartTime() { |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalTime cutoffTime = LocalTime.of(17, 0); |
| | | |
| | | if (now.toLocalTime().isAfter(cutoffTime)) { |
| | | // 当前时间大于17:00 |
| | | return LocalDateTime.of(now.toLocalDate(), cutoffTime); |
| | | } else { |
| | | // 当前时间小于等于17:00 |
| | | return LocalDateTime.of(now.minusDays(1).toLocalDate(), cutoffTime); |
| | | } |
| | | } |
| | | |
| | | // 获取当天的结束时间 |
| | | public static LocalDateTime getCurDayEndTime() { |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalTime cutoffTime = LocalTime.of(17, 0); |
| | | |
| | | if (now.toLocalTime().isAfter(cutoffTime)) { |
| | | // 当前时间大于17:00,结束时间为明天17:00 |
| | | return LocalDateTime.of(now.plusDays(1).toLocalDate(), cutoffTime); |
| | | } else { |
| | | // 当前时间小于等于17:00,结束时间为当天17:00 |
| | | return LocalDateTime.of(now.toLocalDate(), cutoffTime); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |