|
@@ -191,20 +191,36 @@ public class SupplyChainController extends BaseController {
|
|
|
@ApiParam("商品名称") @RequestParam(value = "itemTitle", required = false) String itemTitle,
|
|
|
@ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
|
|
|
@ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
|
|
|
+ @ApiParam("开始时间") @RequestParam(value = "bindStartDate", required = false) String bindStartDate,
|
|
|
+ @ApiParam("结束时间") @RequestParam(value = "bindEndDate", required = false) String bindEndDate,
|
|
|
@ApiParam("排序字段") @RequestParam(value = "fieId", required = false) String fieId,
|
|
|
@ApiParam("排序方式") @RequestParam(value = "sort", required = false) String sort,
|
|
|
- @ApiParam("用户ID") @RequestParam(value = "userId", required = false) String userId
|
|
|
-
|
|
|
- ) {
|
|
|
+ @ApiParam("用户ID") @RequestParam(value = "userId", required = false) String userId) {
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
|
- if (!Check.isNull(orderStartDate)) {
|
|
|
- Long start = DateUtils.getStartLongTime(orderStartDate);
|
|
|
- requestMap.put("start", start);
|
|
|
+ if (!Check.isNull(orderStartDate) && !Check.isNull(orderEndDate)) {
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate);
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate);
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
}
|
|
|
- if (!Check.isNull(orderEndDate)) {
|
|
|
- Long end = DateUtils.getEndLongTime(orderEndDate);
|
|
|
- requestMap.put("end", end);
|
|
|
+
|
|
|
+ if (!Check.isNull(bindStartDate) && !Check.isNull(bindEndDate)) {
|
|
|
+ if (!Check.isNull(bindStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(bindStartDate);
|
|
|
+ requestMap.put("start", start);
|
|
|
+ requestMap.put("bindStartDate", bindStartDate);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(bindEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(bindEndDate);
|
|
|
+ requestMap.put("end", end);
|
|
|
+ requestMap.put("bindEndDate", bindEndDate);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
if (!Check.isNull(itemId)) {
|
|
|
requestMap.put("itemId", itemId);
|
|
|
}
|
|
@@ -225,11 +241,94 @@ public class SupplyChainController extends BaseController {
|
|
|
return dataInfo;
|
|
|
}
|
|
|
startPage();
|
|
|
- List<JSONObject> list = supplyChainService.itemList(requestMap);
|
|
|
+ List<JSONObject> list = new ArrayList<>();
|
|
|
+ if (!Check.isNull(orderStartDate) && !Check.isNull(orderEndDate)) {
|
|
|
+ list = supplyChainService.itemList(requestMap);
|
|
|
+ } else if (!Check.isNull(bindStartDate) && !Check.isNull(bindEndDate)) {
|
|
|
+ list = supplyChainService.itemBindList(requestMap);
|
|
|
+ }
|
|
|
+
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @RequestMapping(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"))) {
|
|
|
+ Long start = DateUtils.getStartLongTime(requestJson.getString("orderStartDate"));
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(requestJson.getString("orderEndDate"))) {
|
|
|
+ Long end = DateUtils.getEndLongTime(requestJson.getString("orderEndDate"));
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(requestJson.getString("bindStartDate"))) {
|
|
|
+ Long start = DateUtils.getStartLongTime(requestJson.getString("bindStartDate"));
|
|
|
+ requestMap.put("start", start);
|
|
|
+ requestMap.put("bindStartDate", requestJson.getString("bindStartDate"));
|
|
|
+ }
|
|
|
+ if (!Check.isNull(requestJson.getString("bindEndDate"))) {
|
|
|
+ Long end = DateUtils.getEndLongTime(requestJson.getString("bindEndDate"));
|
|
|
+ requestMap.put("end", end);
|
|
|
+ requestMap.put("bindEndDate", requestJson.getString("bindEndDate"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (!Check.isNull(requestJson.getString("promoterNickName"))) {
|
|
|
+ requestMap.put("promoterNickName", requestJson.getString("promoterNickName"));
|
|
|
+ }
|
|
|
+ if (!Check.isNull(requestJson.getLong("promoterId"))) {
|
|
|
+ requestMap.put("promoterId", requestJson.getLong("promoterId"));
|
|
|
+ }
|
|
|
+ if (!Check.isNull(requestJson.getLong("itemId"))) {
|
|
|
+ requestMap.put("itemId", requestJson.getLong("itemId"));
|
|
|
+ }
|
|
|
+ if (!Check.isNull(requestJson.getString("itemTitle"))) {
|
|
|
+ requestMap.put("itemTitle", requestJson.getString("itemTitle"));
|
|
|
+ }
|
|
|
+ if (!Check.isNull(requestJson.getLong("userId"))) {
|
|
|
+ requestMap.put("userId", requestJson.getLong("userId"));
|
|
|
+ }
|
|
|
+ List<JSONObject> list = new ArrayList<>();
|
|
|
+ if(!Check.isNull(requestJson.getString("orderStartDate")) && !Check.isNull(requestJson.getString("orderEndDate"))){
|
|
|
+ list = supplyChainService.exportOrder(requestMap);
|
|
|
+ }else if(!Check.isNull(requestJson.getString("bindStartDate")) && !Check.isNull(requestJson.getString("bindEndDate"))){
|
|
|
+ list = supplyChainService.exportBindOrder(requestMap);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<List<Object>> exportList = new ArrayList<>();
|
|
|
+ if (!Check.isNull(list)) {
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ JSONObject date = list.get(i);
|
|
|
+ List<Object> export = new ArrayList();
|
|
|
+ export.add(date.getString("userName"));
|
|
|
+ export.add(date.getLong("itemId"));
|
|
|
+ export.add(date.getString("itemTitle"));
|
|
|
+ export.add(date.getString("imageUrl"));
|
|
|
+ export.add(date.getString("itemCommissionRate"));
|
|
|
+ export.add(date.getInteger("orderNum"));
|
|
|
+ export.add(date.getInteger("validOrderNUm"));
|
|
|
+ export.add(date.getString("validRadio"));
|
|
|
+ export.add(date.getString("deliveryNum"));
|
|
|
+ export.add(date.getString("deliveryRadio"));
|
|
|
+ export.add(date.getString("notDeliveryNum"));
|
|
|
+ exportList.add(export);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String[] headers = {"所属人", "商品ID", "商品名称", "商品封面", "佣金率", "订单数", "有效订单数", "有效订单率", "发货数", "发货率", "未发货数"};
|
|
|
+ OutputStream os = response.getOutputStream();
|
|
|
+ ExportExcelUtils eeu = new ExportExcelUtils();
|
|
|
+ XSSFWorkbook workbook = new XSSFWorkbook();
|
|
|
+ eeu.exportExcel(workbook, 0, "订单信息", headers, exportList);
|
|
|
+ this.setResponseHeader(response, "订单信息.xls");
|
|
|
+ workbook.write(os);
|
|
|
+ os.flush();
|
|
|
+ os.close();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 根据商品id获取top达人
|
|
|
*
|
|
@@ -822,66 +921,6 @@ public class SupplyChainController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @RequestMapping(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"))) {
|
|
|
- Long start = DateUtils.getStartLongTime(requestJson.getString("orderStartDate"));
|
|
|
- requestMap.put("start", start);
|
|
|
- }
|
|
|
- if (!Check.isNull(requestJson.getString("orderEndDate"))) {
|
|
|
- Long end = DateUtils.getEndLongTime(requestJson.getString("orderEndDate"));
|
|
|
- requestMap.put("end", end);
|
|
|
- }
|
|
|
- if (!Check.isNull(requestJson.getString("promoterNickName"))) {
|
|
|
- requestMap.put("promoterNickName", requestJson.getString("promoterNickName"));
|
|
|
- }
|
|
|
- if (!Check.isNull(requestJson.getLong("promoterId"))) {
|
|
|
- requestMap.put("promoterId", requestJson.getLong("promoterId"));
|
|
|
- }
|
|
|
- if (!Check.isNull(requestJson.getLong("itemId"))) {
|
|
|
- requestMap.put("itemId", requestJson.getLong("itemId"));
|
|
|
- }
|
|
|
- if (!Check.isNull(requestJson.getString("itemTitle"))) {
|
|
|
- requestMap.put("itemTitle", requestJson.getString("itemTitle"));
|
|
|
- }
|
|
|
- if (!Check.isNull(requestJson.getLong("userId"))) {
|
|
|
- requestMap.put("userId", requestJson.getLong("userId"));
|
|
|
- }
|
|
|
-
|
|
|
- List<JSONObject> list = supplyChainService.exportOrder(requestMap);
|
|
|
- List<List<Object>> exportList = new ArrayList<>();
|
|
|
- if (!Check.isNull(list)) {
|
|
|
- for (int i = 0; i < list.size(); i++) {
|
|
|
- JSONObject date = list.get(i);
|
|
|
- List<Object> export = new ArrayList();
|
|
|
- export.add(date.getString("userName"));
|
|
|
- export.add(date.getLong("itemId"));
|
|
|
- export.add(date.getString("itemTitle"));
|
|
|
- export.add(date.getString("imageUrl"));
|
|
|
- export.add(date.getString("itemCommissionRate"));
|
|
|
- export.add(date.getInteger("orderNum"));
|
|
|
- export.add(date.getInteger("validOrderNUm"));
|
|
|
- export.add(date.getString("validRadio"));
|
|
|
- export.add(date.getString("deliveryNum"));
|
|
|
- export.add(date.getString("deliveryRadio"));
|
|
|
- export.add(date.getString("notDeliveryNum"));
|
|
|
- exportList.add(export);
|
|
|
- }
|
|
|
- }
|
|
|
- String[] headers = {"所属人", "商品ID", "商品名称", "商品封面", "佣金率", "订单数", "有效订单数", "有效订单率", "发货数", "发货率", "未发货数"};
|
|
|
- OutputStream os = response.getOutputStream();
|
|
|
- ExportExcelUtils eeu = new ExportExcelUtils();
|
|
|
- XSSFWorkbook workbook = new XSSFWorkbook();
|
|
|
- eeu.exportExcel(workbook, 0, "订单信息", headers, exportList);
|
|
|
- this.setResponseHeader(response, "订单信息.xls");
|
|
|
- workbook.write(os);
|
|
|
- os.flush();
|
|
|
- os.close();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 获取供应链人员列表
|
|
|
*
|