|  | @@ -1,7 +1,6 @@
 | 
	
		
			
				|  |  |  package com.ruixuan.bytedance.controller;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  | -import com.google.gson.JsonElement;
 | 
	
		
			
				|  |  |  import com.ruixuan.bytedance.service.IBytedancePromoterOrderListService;
 | 
	
		
			
				|  |  |  import com.ruixuan.common.core.controller.BaseController;
 | 
	
		
			
				|  |  |  import com.ruixuan.common.core.page.TableDataInfo;
 | 
	
	
		
			
				|  | @@ -54,8 +53,8 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |              String promoterId = jsonObject.getString("promoter_id");
 | 
	
		
			
				|  |  |              Long start = jsonObject.getLong("start");
 | 
	
		
			
				|  |  |              Long end = jsonObject.getLong("end");
 | 
	
		
			
				|  |  | -            BigDecimal bigDecimal1 = bytedancePromoterOrderListService.getCount(promoterId,start,end);
 | 
	
		
			
				|  |  | -            if(!Check.isNull(bigDecimal1)){
 | 
	
		
			
				|  |  | +            BigDecimal bigDecimal1 = bytedancePromoterOrderListService.getCount(promoterId, start, end);
 | 
	
		
			
				|  |  | +            if (!Check.isNull(bigDecimal1)) {
 | 
	
		
			
				|  |  |                  bigDecimal = bigDecimal.add(bigDecimal1);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -77,13 +76,25 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |                                              @ApiParam("达人ID") @RequestParam(value = "promoterId", required = false) String promoterId) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          Map<String, Object> requestMap = new HashMap<>();
 | 
	
		
			
				|  |  | -        if (!Check.isNull(orderStartDate)) {
 | 
	
		
			
				|  |  | -            Integer start = DateUtils.getIntegerTime(orderStartDate);
 | 
	
		
			
				|  |  | -            requestMap.put("start", start);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if (!Check.isNull(orderEndDate)) {
 | 
	
		
			
				|  |  | -            Integer end = DateUtils.getIntegerTime(orderEndDate);
 | 
	
		
			
				|  |  | -            requestMap.put("end", end);
 | 
	
		
			
				|  |  | +        if (!Check.isNull(orderStartDate) && !Check.isNull(orderEndDate)) {
 | 
	
		
			
				|  |  | +            requestMap.put("start", DateUtils.getIntegerTime(orderStartDate));
 | 
	
		
			
				|  |  | +            requestMap.put("end", DateUtils.getIntegerTime(orderEndDate));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //根据本阶段日期 获取上阶段 开始 和 截至 日期
 | 
	
		
			
				|  |  | +            Map<String, String> map = DateUtils.getStartEndTime(orderStartDate, orderEndDate);
 | 
	
		
			
				|  |  | +            String daysBetween = map.get("daysBetween");
 | 
	
		
			
				|  |  | +            //当前小时
 | 
	
		
			
				|  |  | +            Integer hour = DateUtils.getNowHour() - 1;
 | 
	
		
			
				|  |  | +            //当天 yyyy-MM-dd
 | 
	
		
			
				|  |  | +            String today = DateUtils.getNowDateStr();
 | 
	
		
			
				|  |  | +            if (!(orderStartDate.equals(orderEndDate) && orderStartDate.equals(today))) {
 | 
	
		
			
				|  |  | +                hour = 23;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //下个周期的开始时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeStart", DateUtils.getIntegerTime(map.get("lastTimeStart")));
 | 
	
		
			
				|  |  | +            //下个周期的结束时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeEnd", DateUtils.getIntegerTime(map.get("lastTimeEnd")));
 | 
	
		
			
				|  |  | +            requestMap.put("hour", hour);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if (!Check.isNull(promoterNickName)) {
 | 
	
		
			
				|  |  |              requestMap.put("promoterNickName", promoterNickName);
 | 
	
	
		
			
				|  | @@ -115,13 +126,25 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |                                      @ApiParam("达人ID") @RequestParam(value = "promoterId", required = false) String promoterId
 | 
	
		
			
				|  |  |      ) throws Exception {
 | 
	
		
			
				|  |  |          Map<String, Object> requestMap = new HashMap<>();
 | 
	
		
			
				|  |  | -        if (!Check.isNull(orderStartDate)) {
 | 
	
		
			
				|  |  | -            Integer start = DateUtils.getIntegerTime(orderStartDate);
 | 
	
		
			
				|  |  | -            requestMap.put("start", start);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if (!Check.isNull(orderEndDate)) {
 | 
	
		
			
				|  |  | -            Integer end = DateUtils.getIntegerTime(orderEndDate);
 | 
	
		
			
				|  |  | -            requestMap.put("end", end);
 | 
	
		
			
				|  |  | +        if (!Check.isNull(orderStartDate) && !Check.isNull(orderEndDate)) {
 | 
	
		
			
				|  |  | +            requestMap.put("start", DateUtils.getIntegerTime(orderStartDate));
 | 
	
		
			
				|  |  | +            requestMap.put("end", DateUtils.getIntegerTime(orderEndDate));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //根据本阶段日期 获取上阶段 开始 和 截至 日期
 | 
	
		
			
				|  |  | +            Map<String, String> map = DateUtils.getStartEndTime(orderStartDate, orderEndDate);
 | 
	
		
			
				|  |  | +            String daysBetween = map.get("daysBetween");
 | 
	
		
			
				|  |  | +            //当前小时
 | 
	
		
			
				|  |  | +            Integer hour = DateUtils.getNowHour() - 1;
 | 
	
		
			
				|  |  | +            //当天 yyyy-MM-dd
 | 
	
		
			
				|  |  | +            String today = DateUtils.getNowDateStr();
 | 
	
		
			
				|  |  | +            if (!(orderStartDate.equals(orderEndDate) && orderStartDate.equals(today))) {
 | 
	
		
			
				|  |  | +                hour = 23;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //下个周期的开始时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeStart", DateUtils.getIntegerTime(map.get("lastTimeStart")));
 | 
	
		
			
				|  |  | +            //下个周期的结束时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeEnd", DateUtils.getIntegerTime(map.get("lastTimeEnd")));
 | 
	
		
			
				|  |  | +            requestMap.put("hour", hour);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if (!Check.isNull(promoterNickName)) {
 | 
	
		
			
				|  |  |              requestMap.put("promoterNickName", promoterNickName);
 | 
	
	
		
			
				|  | @@ -137,6 +160,7 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |                  List<Object> export = new ArrayList();
 | 
	
		
			
				|  |  |                  export.add(date.getString("promoterNickName") + "(" + date.getString("promoterId") + ")");
 | 
	
		
			
				|  |  |                  export.add(date.getInteger("orderNum"));
 | 
	
		
			
				|  |  | +                export.add(date.getString("orderNumRatio"));
 | 
	
		
			
				|  |  |                  export.add(date.getInteger("validOrderNUm"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("validRadio"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("payAmount"));
 | 
	
	
		
			
				|  | @@ -147,7 +171,7 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |                  exportList.add(export);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        String[] headers = {"达人名称", "订单数", "有效订单数", "有效订单率", "GVM", "有效GMV", "预估服务费", "二级团预估服务费", "绑定人"};
 | 
	
		
			
				|  |  | +        String[] headers = {"达人名称", "订单数", "订单数环比", "有效订单数", "有效订单率", "GVM", "有效GMV", "预估服务费", "二级团预估服务费", "绑定人"};
 | 
	
		
			
				|  |  |          OutputStream os = response.getOutputStream();
 | 
	
		
			
				|  |  |          ExportExcelUtils eeu = new ExportExcelUtils();
 | 
	
		
			
				|  |  |          XSSFWorkbook workbook = new XSSFWorkbook();
 | 
	
	
		
			
				|  | @@ -317,25 +341,49 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      ) {
 | 
	
		
			
				|  |  |          Map<String, Object> requestMap = new HashMap<>();
 | 
	
		
			
				|  |  | -        if (!Check.isNull(orderStartDate)) {
 | 
	
		
			
				|  |  | -            Integer start = DateUtils.getIntegerTime(orderStartDate);
 | 
	
		
			
				|  |  | -            requestMap.put("start", start);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if (!Check.isNull(orderEndDate)) {
 | 
	
		
			
				|  |  | -            Integer end = DateUtils.getIntegerTime(orderEndDate);
 | 
	
		
			
				|  |  | -            requestMap.put("end", end);
 | 
	
		
			
				|  |  | +        if (!Check.isNull(orderStartDate) && !Check.isNull(orderEndDate)) {
 | 
	
		
			
				|  |  | +            requestMap.put("start", DateUtils.getIntegerTime(orderStartDate));
 | 
	
		
			
				|  |  | +            requestMap.put("end", DateUtils.getIntegerTime(orderEndDate));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //根据本阶段日期 获取上阶段 开始 和 截至 日期
 | 
	
		
			
				|  |  | +            Map<String, String> map = DateUtils.getStartEndTime(orderStartDate, orderEndDate);
 | 
	
		
			
				|  |  | +            String daysBetween = map.get("daysBetween");
 | 
	
		
			
				|  |  | +            //当前小时
 | 
	
		
			
				|  |  | +            Integer hour = DateUtils.getNowHour() - 1;
 | 
	
		
			
				|  |  | +            //当天 yyyy-MM-dd
 | 
	
		
			
				|  |  | +            String today = DateUtils.getNowDateStr();
 | 
	
		
			
				|  |  | +            if (!(orderStartDate.equals(orderEndDate) && orderStartDate.equals(today))) {
 | 
	
		
			
				|  |  | +                hour = 23;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //下个周期的开始时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeStart", DateUtils.getIntegerTime(map.get("lastTimeStart")));
 | 
	
		
			
				|  |  | +            //下个周期的结束时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeEnd", DateUtils.getIntegerTime(map.get("lastTimeEnd")));
 | 
	
		
			
				|  |  | +            requestMap.put("hour", hour);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if (!Check.isNull(collectSampleId)) {
 | 
	
		
			
				|  |  |              requestMap.put("collectSampleId", collectSampleId);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        if (!Check.isNull(bindStartDate)) {
 | 
	
		
			
				|  |  | -            Integer start = DateUtils.getIntegerTime(bindStartDate);
 | 
	
		
			
				|  |  | -            requestMap.put("bindStartDate", start);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if (!Check.isNull(bindEndDate)) {
 | 
	
		
			
				|  |  | -            Integer end = DateUtils.getIntegerTime(bindEndDate);
 | 
	
		
			
				|  |  | -            requestMap.put("bindEndDate", end);
 | 
	
		
			
				|  |  | +        if (!Check.isNull(bindStartDate) && !Check.isNull(bindEndDate)) {
 | 
	
		
			
				|  |  | +            requestMap.put("bindStartDate", DateUtils.getIntegerTime(bindStartDate));
 | 
	
		
			
				|  |  | +            requestMap.put("bindEndDate", DateUtils.getIntegerTime(bindEndDate));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //根据本阶段日期 获取上阶段 开始 和 截至 日期
 | 
	
		
			
				|  |  | +            Map<String, String> map = DateUtils.getStartEndTime(bindStartDate, bindEndDate);
 | 
	
		
			
				|  |  | +            String daysBetween = map.get("daysBetween");
 | 
	
		
			
				|  |  | +            //当前小时
 | 
	
		
			
				|  |  | +            Integer hour = DateUtils.getNowHour() - 1;
 | 
	
		
			
				|  |  | +            //当天 yyyy-MM-dd
 | 
	
		
			
				|  |  | +            String today = DateUtils.getNowDateStr();
 | 
	
		
			
				|  |  | +            if (!(bindStartDate.equals(bindEndDate) && bindStartDate.equals(today))) {
 | 
	
		
			
				|  |  | +                hour = 23;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //下个周期的开始时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeStart", DateUtils.getIntegerTime(map.get("lastTimeStart")));
 | 
	
		
			
				|  |  | +            //下个周期的结束时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeEnd", DateUtils.getIntegerTime(map.get("lastTimeEnd")));
 | 
	
		
			
				|  |  | +            requestMap.put("hour", hour);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          TableDataInfo dataInfo = new TableDataInfo();
 | 
	
	
		
			
				|  | @@ -368,24 +416,47 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |                                     @ApiParam("结束时间") @RequestParam(value = "bindEndDate", required = false) String bindEndDate,
 | 
	
		
			
				|  |  |                                     @ApiParam("用户ID") @RequestParam(value = "collectSampleId", required = false) Long collectSampleId) throws IOException {
 | 
	
		
			
				|  |  |          Map<String, Object> requestMap = new HashMap<>();
 | 
	
		
			
				|  |  | -        if (!Check.isNull(orderStartDate)) {
 | 
	
		
			
				|  |  | -            Integer start = DateUtils.getIntegerTime(orderStartDate);
 | 
	
		
			
				|  |  | -            requestMap.put("start", start);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if (!Check.isNull(orderEndDate)) {
 | 
	
		
			
				|  |  | -            Integer end = DateUtils.getIntegerTime(orderEndDate);
 | 
	
		
			
				|  |  | -            requestMap.put("end", end);
 | 
	
		
			
				|  |  | +        if (!Check.isNull(orderStartDate) && !Check.isNull(orderEndDate)) {
 | 
	
		
			
				|  |  | +            requestMap.put("start", DateUtils.getIntegerTime(orderStartDate));
 | 
	
		
			
				|  |  | +            requestMap.put("end", DateUtils.getIntegerTime(orderEndDate));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //根据本阶段日期 获取上阶段 开始 和 截至 日期
 | 
	
		
			
				|  |  | +            Map<String, String> map = DateUtils.getStartEndTime(orderStartDate, orderEndDate);
 | 
	
		
			
				|  |  | +            String daysBetween = map.get("daysBetween");
 | 
	
		
			
				|  |  | +            //当前小时
 | 
	
		
			
				|  |  | +            Integer hour = DateUtils.getNowHour() - 1;
 | 
	
		
			
				|  |  | +            //当天 yyyy-MM-dd
 | 
	
		
			
				|  |  | +            String today = DateUtils.getNowDateStr();
 | 
	
		
			
				|  |  | +            if (!(orderStartDate.equals(orderEndDate) && orderStartDate.equals(today))) {
 | 
	
		
			
				|  |  | +                hour = 23;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //下个周期的开始时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeStart", DateUtils.getIntegerTime(map.get("lastTimeStart")));
 | 
	
		
			
				|  |  | +            //下个周期的结束时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeEnd", DateUtils.getIntegerTime(map.get("lastTimeEnd")));
 | 
	
		
			
				|  |  | +            requestMap.put("hour", hour);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        if (!Check.isNull(bindStartDate)) {
 | 
	
		
			
				|  |  | -            Integer start = DateUtils.getIntegerTime(bindStartDate);
 | 
	
		
			
				|  |  | -            requestMap.put("bindStartDate", start);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if (!Check.isNull(bindEndDate)) {
 | 
	
		
			
				|  |  | -            Integer end = DateUtils.getIntegerTime(bindEndDate);
 | 
	
		
			
				|  |  | -            requestMap.put("bindEndDate", end);
 | 
	
		
			
				|  |  | +        if (!Check.isNull(bindStartDate) && !Check.isNull(bindEndDate)) {
 | 
	
		
			
				|  |  | +            requestMap.put("bindStartDate", DateUtils.getIntegerTime(bindStartDate));
 | 
	
		
			
				|  |  | +            requestMap.put("bindEndDate", DateUtils.getIntegerTime(bindEndDate));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //根据本阶段日期 获取上阶段 开始 和 截至 日期
 | 
	
		
			
				|  |  | +            Map<String, String> map = DateUtils.getStartEndTime(bindStartDate, bindEndDate);
 | 
	
		
			
				|  |  | +            String daysBetween = map.get("daysBetween");
 | 
	
		
			
				|  |  | +            //当前小时
 | 
	
		
			
				|  |  | +            Integer hour = DateUtils.getNowHour() - 1;
 | 
	
		
			
				|  |  | +            //当天 yyyy-MM-dd
 | 
	
		
			
				|  |  | +            String today = DateUtils.getNowDateStr();
 | 
	
		
			
				|  |  | +            if (!(bindStartDate.equals(bindEndDate) && bindStartDate.equals(today))) {
 | 
	
		
			
				|  |  | +                hour = 23;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //下个周期的开始时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeStart", DateUtils.getIntegerTime(map.get("lastTimeStart")));
 | 
	
		
			
				|  |  | +            //下个周期的结束时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeEnd", DateUtils.getIntegerTime(map.get("lastTimeEnd")));
 | 
	
		
			
				|  |  | +            requestMap.put("hour", hour);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          if (!Check.isNull(collectSampleId)) {
 | 
	
		
			
				|  |  |              requestMap.put("collectSampleId", collectSampleId);
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -416,6 +487,7 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |                  export.add(date.getString("sendPromoterCount"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("sendItemCount"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("orderNum"));
 | 
	
		
			
				|  |  | +                export.add(date.getString("orderNumRatio"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("validOrderNum"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("validOrderRate"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("orderAmount"));
 | 
	
	
		
			
				|  | @@ -425,7 +497,7 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |                  exportList.add(export);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        String[] headers = {"渠道ID", "渠道姓名", "(总)达人数", "(总)领样达人数", "(总)领样率", "(总)未领样数", "发样数", "发样达人数", "发样商品数", "订单数", "有效订单数", "有效订单率", "订单金额", "预估服务费", "结算服务费", "服务费支出"};
 | 
	
		
			
				|  |  | +        String[] headers = {"渠道ID", "渠道姓名", "(总)达人数", "(总)领样达人数", "(总)领样率", "(总)未领样数", "发样数", "发样达人数", "发样商品数", "订单数", "订单数环比", "有效订单数", "有效订单率", "订单金额", "预估服务费", "结算服务费", "服务费支出"};
 | 
	
		
			
				|  |  |          OutputStream os = response.getOutputStream();
 | 
	
		
			
				|  |  |          ExportExcelUtils eeu = new ExportExcelUtils();
 | 
	
		
			
				|  |  |          XSSFWorkbook workbook = new XSSFWorkbook();
 | 
	
	
		
			
				|  | @@ -582,13 +654,25 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      ) {
 | 
	
		
			
				|  |  |          Map<String, Object> requestMap = new HashMap<>();
 | 
	
		
			
				|  |  | -        if (!Check.isNull(orderStartDate)) {
 | 
	
		
			
				|  |  | -            Integer start = DateUtils.getIntegerTime(orderStartDate);
 | 
	
		
			
				|  |  | -            requestMap.put("start", start);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if (!Check.isNull(orderEndDate)) {
 | 
	
		
			
				|  |  | -            Integer end = DateUtils.getIntegerTime(orderEndDate);
 | 
	
		
			
				|  |  | -            requestMap.put("end", end);
 | 
	
		
			
				|  |  | +        if (!Check.isNull(orderStartDate) && !Check.isNull(orderEndDate)) {
 | 
	
		
			
				|  |  | +            requestMap.put("start", DateUtils.getIntegerTime(orderStartDate));
 | 
	
		
			
				|  |  | +            requestMap.put("end", DateUtils.getIntegerTime(orderEndDate));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //根据本阶段日期 获取上阶段 开始 和 截至 日期
 | 
	
		
			
				|  |  | +            Map<String, String> map = DateUtils.getStartEndTime(orderStartDate, orderEndDate);
 | 
	
		
			
				|  |  | +            String daysBetween = map.get("daysBetween");
 | 
	
		
			
				|  |  | +            //当前小时
 | 
	
		
			
				|  |  | +            Integer hour = DateUtils.getNowHour() - 1;
 | 
	
		
			
				|  |  | +            //当天 yyyy-MM-dd
 | 
	
		
			
				|  |  | +            String today = DateUtils.getNowDateStr();
 | 
	
		
			
				|  |  | +            if (!(orderStartDate.equals(orderEndDate) && orderStartDate.equals(today))) {
 | 
	
		
			
				|  |  | +                hour = 23;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //下个周期的开始时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeStart", DateUtils.getIntegerTime(map.get("lastTimeStart")));
 | 
	
		
			
				|  |  | +            //下个周期的结束时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeEnd", DateUtils.getIntegerTime(map.get("lastTimeEnd")));
 | 
	
		
			
				|  |  | +            requestMap.put("hour", hour);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if (!Check.isNull(itemId)) {
 | 
	
		
			
				|  |  |              requestMap.put("itemId", itemId);
 | 
	
	
		
			
				|  | @@ -628,13 +712,25 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |              @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
 | 
	
		
			
				|  |  |              @ApiParam("用户ID") @RequestParam(value = "userId", required = false) String userId) throws IOException {
 | 
	
		
			
				|  |  |          Map<String, Object> requestMap = new HashMap<>();
 | 
	
		
			
				|  |  | -        if (!Check.isNull(orderStartDate)) {
 | 
	
		
			
				|  |  | -            Integer start = DateUtils.getIntegerTime(orderStartDate);
 | 
	
		
			
				|  |  | -            requestMap.put("start", start);
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        if (!Check.isNull(orderEndDate)) {
 | 
	
		
			
				|  |  | -            Integer end = DateUtils.getIntegerTime(orderEndDate);
 | 
	
		
			
				|  |  | -            requestMap.put("end", end);
 | 
	
		
			
				|  |  | +        if (!Check.isNull(orderStartDate) && !Check.isNull(orderEndDate)) {
 | 
	
		
			
				|  |  | +            requestMap.put("start", DateUtils.getIntegerTime(orderStartDate));
 | 
	
		
			
				|  |  | +            requestMap.put("end", DateUtils.getIntegerTime(orderEndDate));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //根据本阶段日期 获取上阶段 开始 和 截至 日期
 | 
	
		
			
				|  |  | +            Map<String, String> map = DateUtils.getStartEndTime(orderStartDate, orderEndDate);
 | 
	
		
			
				|  |  | +            String daysBetween = map.get("daysBetween");
 | 
	
		
			
				|  |  | +            //当前小时
 | 
	
		
			
				|  |  | +            Integer hour = DateUtils.getNowHour() - 1;
 | 
	
		
			
				|  |  | +            //当天 yyyy-MM-dd
 | 
	
		
			
				|  |  | +            String today = DateUtils.getNowDateStr();
 | 
	
		
			
				|  |  | +            if (!(orderStartDate.equals(orderEndDate) && orderStartDate.equals(today))) {
 | 
	
		
			
				|  |  | +                hour = 23;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //下个周期的开始时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeStart", DateUtils.getIntegerTime(map.get("lastTimeStart")));
 | 
	
		
			
				|  |  | +            //下个周期的结束时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeEnd", DateUtils.getIntegerTime(map.get("lastTimeEnd")));
 | 
	
		
			
				|  |  | +            requestMap.put("hour", hour);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          if (!Check.isNull(itemId)) {
 | 
	
		
			
				|  |  |              requestMap.put("itemId", itemId);
 | 
	
	
		
			
				|  | @@ -665,6 +761,7 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |                  export.add(date.getString("imageUrl"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("itemCommissionRate"));
 | 
	
		
			
				|  |  |                  export.add(date.getInteger("orderNum"));
 | 
	
		
			
				|  |  | +                export.add(date.getString("orderNumRatio"));
 | 
	
		
			
				|  |  |                  export.add(date.getInteger("validOrderNUm"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("validRadio"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("regimentalPromotionAmount"));
 | 
	
	
		
			
				|  | @@ -672,7 +769,7 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |                  exportList.add(export);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        String[] headers = {"所属人", "商品ID", "商品名称", "商品封面", "佣金率", "订单数", "有效订单数", "有效订单率", "预估服务费", "二级团长预估服务费"};
 | 
	
		
			
				|  |  | +        String[] headers = {"所属人", "商品ID", "商品名称", "商品封面", "佣金率", "订单数", "订单数环比", "有效订单数", "有效订单率", "预估服务费", "二级团长预估服务费"};
 | 
	
		
			
				|  |  |          OutputStream os = response.getOutputStream();
 | 
	
		
			
				|  |  |          ExportExcelUtils eeu = new ExportExcelUtils();
 | 
	
		
			
				|  |  |          XSSFWorkbook workbook = new XSSFWorkbook();
 | 
	
	
		
			
				|  | @@ -833,17 +930,45 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |      ) {
 | 
	
		
			
				|  |  |          Map<String, Object> requestMap = new HashMap<>();
 | 
	
		
			
				|  |  |          if (!Check.isNull(orderStartDate) && !Check.isNull(orderEndDate)) {
 | 
	
		
			
				|  |  | -            Integer start = DateUtils.getIntegerTime(orderStartDate);
 | 
	
		
			
				|  |  | -            requestMap.put("start", start);
 | 
	
		
			
				|  |  | -            Integer end = DateUtils.getIntegerTime(orderEndDate);
 | 
	
		
			
				|  |  | -            requestMap.put("end", end);
 | 
	
		
			
				|  |  | +            requestMap.put("start", DateUtils.getIntegerTime(orderStartDate));
 | 
	
		
			
				|  |  | +            requestMap.put("end", DateUtils.getIntegerTime(orderEndDate));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //根据本阶段日期 获取上阶段 开始 和 截至 日期
 | 
	
		
			
				|  |  | +            Map<String, String> map = DateUtils.getStartEndTime(orderStartDate, orderEndDate);
 | 
	
		
			
				|  |  | +            String daysBetween = map.get("daysBetween");
 | 
	
		
			
				|  |  | +            //当前小时
 | 
	
		
			
				|  |  | +            Integer hour = DateUtils.getNowHour() - 1;
 | 
	
		
			
				|  |  | +            //当天 yyyy-MM-dd
 | 
	
		
			
				|  |  | +            String today = DateUtils.getNowDateStr();
 | 
	
		
			
				|  |  | +            if (!(orderStartDate.equals(orderEndDate) && orderStartDate.equals(today))) {
 | 
	
		
			
				|  |  | +                hour = 23;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //下个周期的开始时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeStart", DateUtils.getIntegerTime(map.get("lastTimeStart")));
 | 
	
		
			
				|  |  | +            //下个周期的结束时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeEnd", DateUtils.getIntegerTime(map.get("lastTimeEnd")));
 | 
	
		
			
				|  |  | +            requestMap.put("hour", hour);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          if (!Check.isNull(bindStartDate) && !Check.isNull(bindEndDate)) {
 | 
	
		
			
				|  |  | -            Integer start = DateUtils.getIntegerTime(bindStartDate);
 | 
	
		
			
				|  |  | -            requestMap.put("start", start);
 | 
	
		
			
				|  |  | -            Integer end = DateUtils.getIntegerTime(bindEndDate);
 | 
	
		
			
				|  |  | -            requestMap.put("end", end);
 | 
	
		
			
				|  |  | +            requestMap.put("start", DateUtils.getIntegerTime(bindStartDate));
 | 
	
		
			
				|  |  | +            requestMap.put("end", DateUtils.getIntegerTime(bindEndDate));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //根据本阶段日期 获取上阶段 开始 和 截至 日期
 | 
	
		
			
				|  |  | +            Map<String, String> map = DateUtils.getStartEndTime(bindStartDate, bindEndDate);
 | 
	
		
			
				|  |  | +            String daysBetween = map.get("daysBetween");
 | 
	
		
			
				|  |  | +            //当前小时
 | 
	
		
			
				|  |  | +            Integer hour = DateUtils.getNowHour() - 1;
 | 
	
		
			
				|  |  | +            //当天 yyyy-MM-dd
 | 
	
		
			
				|  |  | +            String today = DateUtils.getNowDateStr();
 | 
	
		
			
				|  |  | +            if (!(bindStartDate.equals(bindEndDate) && bindStartDate.equals(today))) {
 | 
	
		
			
				|  |  | +                hour = 23;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //下个周期的开始时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeStart", DateUtils.getIntegerTime(map.get("lastTimeStart")));
 | 
	
		
			
				|  |  | +            //下个周期的结束时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeEnd", DateUtils.getIntegerTime(map.get("lastTimeEnd")));
 | 
	
		
			
				|  |  | +            requestMap.put("hour", hour);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          if (!Check.isNull(userId)) {
 | 
	
	
		
			
				|  | @@ -885,17 +1010,45 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |      ) throws IOException {
 | 
	
		
			
				|  |  |          Map<String, Object> requestMap = new HashMap<>();
 | 
	
		
			
				|  |  |          if (!Check.isNull(orderStartDate) && !Check.isNull(orderEndDate)) {
 | 
	
		
			
				|  |  | -            Integer start = DateUtils.getIntegerTime(orderStartDate);
 | 
	
		
			
				|  |  | -            requestMap.put("start", start);
 | 
	
		
			
				|  |  | -            Integer end = DateUtils.getIntegerTime(orderEndDate);
 | 
	
		
			
				|  |  | -            requestMap.put("end", end);
 | 
	
		
			
				|  |  | +            requestMap.put("start", DateUtils.getIntegerTime(orderStartDate));
 | 
	
		
			
				|  |  | +            requestMap.put("end", DateUtils.getIntegerTime(orderEndDate));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //根据本阶段日期 获取上阶段 开始 和 截至 日期
 | 
	
		
			
				|  |  | +            Map<String, String> map = DateUtils.getStartEndTime(orderStartDate, orderEndDate);
 | 
	
		
			
				|  |  | +            String daysBetween = map.get("daysBetween");
 | 
	
		
			
				|  |  | +            //当前小时
 | 
	
		
			
				|  |  | +            Integer hour = DateUtils.getNowHour() - 1;
 | 
	
		
			
				|  |  | +            //当天 yyyy-MM-dd
 | 
	
		
			
				|  |  | +            String today = DateUtils.getNowDateStr();
 | 
	
		
			
				|  |  | +            if (!(orderStartDate.equals(orderEndDate) && orderStartDate.equals(today))) {
 | 
	
		
			
				|  |  | +                hour = 23;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //下个周期的开始时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeStart", DateUtils.getIntegerTime(map.get("lastTimeStart")));
 | 
	
		
			
				|  |  | +            //下个周期的结束时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeEnd", DateUtils.getIntegerTime(map.get("lastTimeEnd")));
 | 
	
		
			
				|  |  | +            requestMap.put("hour", hour);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          if (!Check.isNull(bindStartDate) && !Check.isNull(bindEndDate)) {
 | 
	
		
			
				|  |  | -            Integer start = DateUtils.getIntegerTime(bindStartDate);
 | 
	
		
			
				|  |  | -            requestMap.put("start", start);
 | 
	
		
			
				|  |  | -            Integer end = DateUtils.getIntegerTime(bindEndDate);
 | 
	
		
			
				|  |  | -            requestMap.put("end", end);
 | 
	
		
			
				|  |  | +            requestMap.put("start", DateUtils.getIntegerTime(bindStartDate));
 | 
	
		
			
				|  |  | +            requestMap.put("end", DateUtils.getIntegerTime(bindEndDate));
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //根据本阶段日期 获取上阶段 开始 和 截至 日期
 | 
	
		
			
				|  |  | +            Map<String, String> map = DateUtils.getStartEndTime(bindStartDate, bindEndDate);
 | 
	
		
			
				|  |  | +            String daysBetween = map.get("daysBetween");
 | 
	
		
			
				|  |  | +            //当前小时
 | 
	
		
			
				|  |  | +            Integer hour = DateUtils.getNowHour() - 1;
 | 
	
		
			
				|  |  | +            //当天 yyyy-MM-dd
 | 
	
		
			
				|  |  | +            String today = DateUtils.getNowDateStr();
 | 
	
		
			
				|  |  | +            if (!(bindStartDate.equals(bindEndDate) && bindStartDate.equals(today))) {
 | 
	
		
			
				|  |  | +                hour = 23;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            //下个周期的开始时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeStart", DateUtils.getIntegerTime(map.get("lastTimeStart")));
 | 
	
		
			
				|  |  | +            //下个周期的结束时间
 | 
	
		
			
				|  |  | +            requestMap.put("lastTimeEnd", DateUtils.getIntegerTime(map.get("lastTimeEnd")));
 | 
	
		
			
				|  |  | +            requestMap.put("hour", hour);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          if (!Check.isNull(userId)) {
 | 
	
	
		
			
				|  | @@ -918,6 +1071,7 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |                  export.add(date.getString("itemCount"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("sendSampleCount"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("orderNum"));
 | 
	
		
			
				|  |  | +                export.add(date.getString("orderNumRatio"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("validOrderNUm"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("validRadio"));
 | 
	
		
			
				|  |  |                  export.add(date.getString("payAmount"));
 | 
	
	
		
			
				|  | @@ -927,7 +1081,7 @@ public class BytedancePromoterOrderListController extends BaseController {
 | 
	
		
			
				|  |  |                  exportList.add(export);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        String[] headers = {"招商", "商品数", "发样数", "订单数", "有效订单数", "有效率", "实付金额", "预估服务费收入", "结算服务费收入", "服务费支出"};
 | 
	
		
			
				|  |  | +        String[] headers = {"招商", "商品数", "发样数", "订单数", "订单数环比", "有效订单数", "有效率", "实付金额", "预估服务费收入", "结算服务费收入", "服务费支出"};
 | 
	
		
			
				|  |  |          OutputStream os = response.getOutputStream();
 | 
	
		
			
				|  |  |          ExportExcelUtils eeu = new ExportExcelUtils();
 | 
	
		
			
				|  |  |          XSSFWorkbook workbook = new XSSFWorkbook();
 |