|
@@ -105,7 +105,7 @@ public class SupplyChainController extends BaseController {
|
|
|
//下个周期的结束时间
|
|
|
String lastTimeEnd = map.get("lastTimeEnd");
|
|
|
//当前小时
|
|
|
- Integer hour = DateUtils.getNowHour() - 1;
|
|
|
+ Integer hour = DateUtils.getNowHour();
|
|
|
//当天 yyyy-MM-dd
|
|
|
String today = DateUtils.getNowDateStr();
|
|
|
if (!(orderStartDate.equals(orderEndDate) && orderStartDate.equals(today))) {
|
|
@@ -255,7 +255,7 @@ public class SupplyChainController extends BaseController {
|
|
|
//下个周期的结束时间
|
|
|
String lastTimeEnd = map.get("lastTimeEnd");
|
|
|
//当前小时
|
|
|
- Integer hour = DateUtils.getNowHour() - 1;
|
|
|
+ Integer hour = DateUtils.getNowHour();
|
|
|
//当天 yyyy-MM-dd
|
|
|
String today = DateUtils.getNowDateStr();
|
|
|
if (!(orderStartDate.equals(orderEndDate) && orderStartDate.equals(today))) {
|
|
@@ -304,16 +304,34 @@ public class SupplyChainController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @RequestMapping(value = "/exportOrder")
|
|
|
+ @PostMapping("/exportOrder")
|
|
|
+ @ApiOperation(value = "exportOrder")
|
|
|
@ResponseBody
|
|
|
public void exportOrder(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject requestJson) throws Exception {
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
|
- if (!Check.isNull(requestJson.getString("orderStartDate"))) {
|
|
|
+ if (!Check.isNull(requestJson.getString("orderStartDate")) && !Check.isNull(requestJson.getString("orderEndDate"))) {
|
|
|
requestMap.put("start", DateUtils.strDateToInt(requestJson.getString("orderStartDate")));
|
|
|
- }
|
|
|
- if (!Check.isNull(requestJson.getString("orderEndDate"))) {
|
|
|
requestMap.put("end", DateUtils.strDateToInt(requestJson.getString("orderEndDate")));
|
|
|
+
|
|
|
+ //根据本阶段日期 获取上阶段 开始 和 截至 日期
|
|
|
+ Map<String, String> map = DateUtils.getStartEndTime(requestJson.getString("orderStartDate"), requestJson.getString("orderEndDate"));
|
|
|
+ //下个周期的开始时间
|
|
|
+ String lastTimeStart = map.get("lastTimeStart");
|
|
|
+ //下个周期的结束时间
|
|
|
+ String lastTimeEnd = map.get("lastTimeEnd");
|
|
|
+ //当前小时
|
|
|
+ Integer hour = DateUtils.getNowHour();
|
|
|
+ //当天 yyyy-MM-dd
|
|
|
+ String today = DateUtils.getNowDateStr();
|
|
|
+ if (!(requestJson.getString("orderStartDate").equals(requestJson.getString("orderEndDate")) && requestJson.getString("orderStartDate").equals(today))) {
|
|
|
+ hour = 23;
|
|
|
+ }
|
|
|
+ requestMap.put("lastTimeStart", DateUtils.strDateToInt(lastTimeStart));
|
|
|
+ requestMap.put("lastTimeEnd", DateUtils.strDateToInt(lastTimeEnd));
|
|
|
+ requestMap.put("hour", hour);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
if (!Check.isNull(requestJson.getString("bindStartDate"))) {
|
|
|
requestMap.put("start", DateUtils.strDateToInt(requestJson.getString("bindStartDate")));
|
|
|
requestMap.put("bindStartDate", requestJson.getString("bindStartDate"));
|
|
@@ -338,11 +356,14 @@ public class SupplyChainController extends BaseController {
|
|
|
if (!Check.isNull(requestJson.getLong("userId"))) {
|
|
|
requestMap.put("userId", requestJson.getLong("userId"));
|
|
|
}
|
|
|
+ String[] headers = null;
|
|
|
List<JSONObject> list = new ArrayList<>();
|
|
|
if (!Check.isNull(requestJson.getString("orderStartDate")) && !Check.isNull(requestJson.getString("orderEndDate"))) {
|
|
|
list = supplyChainService.exportOrder(requestMap);
|
|
|
+ headers = new String[]{"所属人", "商品ID", "商品名称", "是否预售", "商品封面", "佣金率", "订单数", "订单数环比", "有效订单数", "有效订单率", "发货数", "发货率", "未发货数", "ccr", "小店星级", "店铺物流分", "店铺评分", "店铺服务分", "店铺质量分"};
|
|
|
} else if (!Check.isNull(requestJson.getString("bindStartDate")) && !Check.isNull(requestJson.getString("bindEndDate"))) {
|
|
|
list = supplyChainService.exportBindOrder(requestMap);
|
|
|
+ headers = new String[]{"所属人", "商品ID", "商品名称", "是否预售", "商品封面", "佣金率", "订单数", "有效订单数", "有效订单率", "发货数", "发货率", "未发货数", "ccr", "小店星级", "店铺物流分", "店铺评分", "店铺服务分", "店铺质量分"};
|
|
|
}
|
|
|
|
|
|
List<List<Object>> exportList = new ArrayList<>();
|
|
@@ -357,6 +378,9 @@ public class SupplyChainController extends BaseController {
|
|
|
export.add(date.getString("imageUrl"));
|
|
|
export.add(date.getString("itemCommissionRate"));
|
|
|
export.add(date.getInteger("orderNum"));
|
|
|
+ if (!Check.isNull(requestJson.getString("orderStartDate")) && !Check.isNull(requestJson.getString("orderEndDate"))) {
|
|
|
+ export.add(date.getString("orderNumRoi"));
|
|
|
+ }
|
|
|
export.add(date.getInteger("validOrderNUm"));
|
|
|
export.add(date.getString("validRadio"));
|
|
|
export.add(date.getString("deliveryNum"));
|
|
@@ -371,7 +395,6 @@ public class SupplyChainController extends BaseController {
|
|
|
exportList.add(export);
|
|
|
}
|
|
|
}
|
|
|
- String[] headers = {"所属人", "商品ID", "商品名称", "是否预售", "商品封面", "佣金率", "订单数", "有效订单数", "有效订单率", "发货数", "发货率", "未发货数", "ccr", "小店星级", "店铺物流分", "店铺评分", "店铺服务分", "店铺质量分"};
|
|
|
OutputStream os = response.getOutputStream();
|
|
|
ExportExcelUtils eeu = new ExportExcelUtils();
|
|
|
XSSFWorkbook workbook = new XSSFWorkbook();
|
|
@@ -593,7 +616,7 @@ public class SupplyChainController extends BaseController {
|
|
|
}
|
|
|
JSONObject orderTotal = supplyChainService.getOrderTotal(requestMap);
|
|
|
returnJson.put("orderTotal", orderTotal);
|
|
|
- Integer hour = DateUtils.getNowHour() - 1; // 当前小时
|
|
|
+ Integer hour = DateUtils.getNowHour(); // 当前小时
|
|
|
if (hour >= 0) {
|
|
|
JSONObject ratioJson = new JSONObject();
|
|
|
Long nowStartHourTemp = DateUtils.strDateToInt(orderStartDate); // 当天开始时间戳
|
|
@@ -655,7 +678,7 @@ public class SupplyChainController extends BaseController {
|
|
|
}
|
|
|
JSONObject amountTotal = supplyChainService.getAmountTotal(requestMap);
|
|
|
returnJson.put("amountTotal", amountTotal);
|
|
|
- Integer hour = DateUtils.getNowHour() - 1; // 当前小时
|
|
|
+ Integer hour = DateUtils.getNowHour(); // 当前小时
|
|
|
if (hour >= 0) {
|
|
|
JSONObject amountRatioJson = new JSONObject();
|
|
|
Long nowStartHourTemp = DateUtils.strDateToInt(orderStartDate); // 当天开始时间
|
|
@@ -892,16 +915,32 @@ public class SupplyChainController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/exportPromoterTotal")
|
|
|
+ @PostMapping("/exportPromoterTotal")
|
|
|
+ @ApiOperation(value = "exportPromoterTotal")
|
|
|
@ResponseBody
|
|
|
public void exportPromoterTotal(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject requestJson) throws Exception {
|
|
|
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
|
- if (!Check.isNull(requestJson.getString("orderStartDate"))) {
|
|
|
+ if (!Check.isNull(requestJson.getString("orderStartDate")) && !Check.isNull(requestJson.getString("orderEndDate"))) {
|
|
|
requestMap.put("start", DateUtils.strDateToInt(requestJson.getString("orderStartDate")));
|
|
|
- }
|
|
|
- if (!Check.isNull(requestJson.getString("orderEndDate"))) {
|
|
|
requestMap.put("end", DateUtils.strDateToInt(requestJson.getString("orderEndDate")));
|
|
|
+
|
|
|
+ //根据本阶段日期 获取上阶段 开始 和 截至 日期
|
|
|
+ Map<String, String> map = DateUtils.getStartEndTime(requestJson.getString("orderStartDate"), requestJson.getString("orderEndDate"));
|
|
|
+ //下个周期的开始时间
|
|
|
+ String lastTimeStart = map.get("lastTimeStart");
|
|
|
+ //下个周期的结束时间
|
|
|
+ String lastTimeEnd = map.get("lastTimeEnd");
|
|
|
+ //当前小时
|
|
|
+ Integer hour = DateUtils.getNowHour();
|
|
|
+ //当天 yyyy-MM-dd
|
|
|
+ String today = DateUtils.getNowDateStr();
|
|
|
+ if (!(requestJson.getString("orderStartDate").equals(requestJson.getString("orderEndDate")) && requestJson.getString("orderStartDate").equals(today))) {
|
|
|
+ hour = 23;
|
|
|
+ }
|
|
|
+ requestMap.put("lastTimeStart", DateUtils.strDateToInt(lastTimeStart));
|
|
|
+ requestMap.put("lastTimeEnd", DateUtils.strDateToInt(lastTimeEnd));
|
|
|
+ requestMap.put("hour", hour);
|
|
|
}
|
|
|
if (!Check.isNull(requestJson.getString("promoterNickName"))) {
|
|
|
requestMap.put("promoterNickName", requestJson.getString("promoterNickName"));
|
|
@@ -935,6 +974,7 @@ public class SupplyChainController extends BaseController {
|
|
|
}
|
|
|
|
|
|
export.add(date.getInteger("orderNum"));
|
|
|
+ export.add(date.getString("orderNumRoi"));
|
|
|
export.add(date.getInteger("validOrderNUm"));
|
|
|
export.add(date.getString("validRadio"));
|
|
|
export.add(date.getString("payAmount"));
|
|
@@ -994,9 +1034,9 @@ public class SupplyChainController extends BaseController {
|
|
|
}
|
|
|
String[] headers = {};
|
|
|
if (ownershipId.equals("miaogousi") || ownershipId.equals("yufu")) {
|
|
|
- headers = new String[]{"达人ID", "达人名称", "订单数", "有效订单数", "有效订单率", "GVM", "有效GMV", "发货数", "发货率", "未发货数", "绑定人"};
|
|
|
+ headers = new String[]{"达人ID", "达人名称", "订单数", "订单数环比", "有效订单数", "有效订单率", "GVM", "有效GMV", "发货数", "发货率", "未发货数", "绑定人"};
|
|
|
} else {
|
|
|
- headers = new String[]{"达人名称", "订单数", "有效订单数", "有效订单率", "GVM", "有效GMV", "发货数", "发货率", "未发货数", "绑定人"};
|
|
|
+ headers = new String[]{"达人名称", "订单数", "订单数环比", "有效订单数", "有效订单率", "GVM", "有效GMV", "发货数", "发货率", "未发货数", "绑定人"};
|
|
|
}
|
|
|
OutputStream os = response.getOutputStream();
|
|
|
ExportExcelUtils eeu = new ExportExcelUtils();
|
|
@@ -1238,7 +1278,7 @@ public class SupplyChainController extends BaseController {
|
|
|
//下个周期的结束时间
|
|
|
String lastTimeEnd = map.get("lastTimeEnd");
|
|
|
//当前小时
|
|
|
- Integer hour = DateUtils.getNowHour() - 1;
|
|
|
+ Integer hour = DateUtils.getNowHour();
|
|
|
//当天 yyyy-MM-dd
|
|
|
String today = DateUtils.getNowDateStr();
|
|
|
if (!(orderStartDate.equals(orderEndDate) && orderStartDate.equals(today))) {
|
|
@@ -1282,16 +1322,27 @@ public class SupplyChainController extends BaseController {
|
|
|
@RequestBody JSONObject requestJson
|
|
|
) throws IOException {
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
|
- if (!Check.isNull(requestJson.getString("orderStartDate"))) {
|
|
|
- Long start = DateUtils.getStartLongTime(requestJson.getString("orderStartDate"));
|
|
|
- requestMap.put("start", start);
|
|
|
+ if (!Check.isNull(requestJson.getString("orderStartDate")) && !Check.isNull(requestJson.getString("orderEndDate"))) {
|
|
|
requestMap.put("startDate", requestJson.getString("orderStartDate"));
|
|
|
-
|
|
|
- }
|
|
|
- if (!Check.isNull(requestJson.getString("orderEndDate"))) {
|
|
|
- Long end = DateUtils.getEndLongTime(requestJson.getString("orderEndDate"));
|
|
|
- requestMap.put("end", end);
|
|
|
requestMap.put("endDate", requestJson.getString("orderEndDate") + " 23:59:59");
|
|
|
+
|
|
|
+
|
|
|
+ //根据本阶段日期 获取上阶段 开始 和 截至 日期
|
|
|
+ Map<String, String> map = DateUtils.getStartEndTime(requestJson.getString("orderStartDate"), requestJson.getString("orderStartDate"));
|
|
|
+ //下个周期的开始时间
|
|
|
+ String lastTimeStart = map.get("lastTimeStart");
|
|
|
+ //下个周期的结束时间
|
|
|
+ String lastTimeEnd = map.get("lastTimeEnd");
|
|
|
+ //当前小时
|
|
|
+ Integer hour = DateUtils.getNowHour();
|
|
|
+ //当天 yyyy-MM-dd
|
|
|
+ String today = DateUtils.getNowDateStr();
|
|
|
+ if (!(requestJson.getString("orderStartDate").equals(requestJson.getString("orderStartDate")) && requestJson.getString("orderStartDate").equals(today))) {
|
|
|
+ hour = 23;
|
|
|
+ }
|
|
|
+ requestMap.put("lastTimeStart", DateUtils.strDateToInt(lastTimeStart));
|
|
|
+ requestMap.put("lastTimeEnd", DateUtils.strDateToInt(lastTimeEnd));
|
|
|
+ requestMap.put("hour", hour);
|
|
|
}
|
|
|
|
|
|
if (!Check.isNull(requestJson.getString("bindStartDate"))) {
|
|
@@ -1310,11 +1361,16 @@ public class SupplyChainController extends BaseController {
|
|
|
if (!Check.isNull(requestJson.getString("userId"))) {
|
|
|
requestMap.put("userId", requestJson.getString("userId"));
|
|
|
}
|
|
|
+ String[] headers = null;
|
|
|
List<JSONObject> list = new ArrayList<>();
|
|
|
if (!Check.isNull(requestJson.getString("orderStartDate")) && !Check.isNull(requestJson.getString("orderEndDate"))) {
|
|
|
list = supplyChainService.exportAdminReportList(requestMap);
|
|
|
+ headers = new String[]{"招商", "商品数", "发样数", "订单数", "订单数环比", "有效订单数", "有效率", "发货数", "未发货数", "发货率", "实付金额", "预估服务费收入", "结算服务费收入", "平均服务费率"};
|
|
|
+
|
|
|
} else if (!Check.isNull(requestJson.getString("bindStartDate")) && !Check.isNull(requestJson.getString("bindEndDate"))) {
|
|
|
list = supplyChainService.exportAdminReportListByBind(requestMap);
|
|
|
+ headers = new String[]{"招商", "商品数", "发样数", "订单数", "有效订单数", "有效率", "发货数", "未发货数", "发货率", "实付金额", "预估服务费收入", "结算服务费收入", "平均服务费率"};
|
|
|
+
|
|
|
}
|
|
|
|
|
|
List<List<Object>> exportList = new ArrayList<>();
|
|
@@ -1326,6 +1382,9 @@ public class SupplyChainController extends BaseController {
|
|
|
export.add(date.getString("itemCount"));
|
|
|
export.add(date.getString("sendSampleCount"));
|
|
|
export.add(date.getString("orderNum"));
|
|
|
+ if (!Check.isNull(requestJson.getString("orderStartDate")) && !Check.isNull(requestJson.getString("orderEndDate"))) {
|
|
|
+ export.add(date.getString("orderNumRoi"));
|
|
|
+ }
|
|
|
export.add(date.getString("validOrderNUm"));
|
|
|
export.add(date.getString("validRadio"));
|
|
|
export.add(date.getString("deliveryNum"));
|
|
@@ -1338,7 +1397,6 @@ public class SupplyChainController extends BaseController {
|
|
|
exportList.add(export);
|
|
|
}
|
|
|
}
|
|
|
- String[] headers = {"招商", "商品数", "发样数", "订单数", "有效订单数", "有效率", "发货数", "未发货数", "发货率", "实付金额", "预估服务费收入", "结算服务费收入", "平均服务费率"};
|
|
|
OutputStream os = response.getOutputStream();
|
|
|
ExportExcelUtils eeu = new ExportExcelUtils();
|
|
|
XSSFWorkbook workbook = new XSSFWorkbook();
|