|
@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.IOException;
|
|
|
import java.io.OutputStream;
|
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -649,7 +650,7 @@ public class SupplyChainController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- String[] headers = {"达人ID", "达人名称", "订单数", "有效订单数", "有效订单率", "发货数", "发货率","未发货数"};
|
|
|
+ String[] headers = {"达人ID", "达人名称", "订单数", "有效订单数", "有效订单率", "发货数", "发货率", "未发货数"};
|
|
|
OutputStream os = response.getOutputStream();
|
|
|
ExportExcelUtils eeu = new ExportExcelUtils();
|
|
|
XSSFWorkbook workbook = new XSSFWorkbook();
|
|
@@ -779,23 +780,6 @@ public class SupplyChainController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- //发送响应流方法
|
|
|
- public void setResponseHeader(HttpServletResponse response, String fileName) {
|
|
|
- try {
|
|
|
- try {
|
|
|
- fileName = new String(fileName.getBytes(), "ISO8859-1");
|
|
|
- } catch (UnsupportedEncodingException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- response.setContentType("application/octet-stream;charset=ISO8859-1");
|
|
|
- response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
|
|
|
- response.addHeader("Pargam", "no-cache");
|
|
|
- response.addHeader("Cache-Control", "no-cache");
|
|
|
- } catch (Exception ex) {
|
|
|
- ex.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 获取供应链人员列表
|
|
|
*
|
|
@@ -1012,6 +996,73 @@ public class SupplyChainController extends BaseController {
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 认领商品列表导出
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/exportUserItemDetail")
|
|
|
+ @ApiOperation(value = "认领商品列表")
|
|
|
+ @ResponseBody
|
|
|
+ public void exportUserItemDetail(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject requestJson) throws IOException {
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+
|
|
|
+ if (!Check.isNull(requestJson.getLong("userId"))) {
|
|
|
+ requestMap.put("userId", requestJson.getLong("userId"));
|
|
|
+ }
|
|
|
+ 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.getLong("itemId"))) {
|
|
|
+ requestMap.put("itemId", requestJson.getLong("itemId"));
|
|
|
+ }
|
|
|
+ if (!Check.isNull(requestJson.getString("itemTitle"))) {
|
|
|
+ requestMap.put("itemTitle", requestJson.getString("itemTitle"));
|
|
|
+ }
|
|
|
+
|
|
|
+ List<JSONObject> list = supplyChainService.exportUserItemDetail(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("reservePrice"));
|
|
|
+ export.add(date.getString("itemCommissionRate"));
|
|
|
+ export.add(date.getString("orderNum"));
|
|
|
+ export.add(date.getString("validOrderNUm"));
|
|
|
+ export.add(date.getString("validRadio"));
|
|
|
+ export.add(date.getString("invalidOrderNUm"));
|
|
|
+ export.add(date.getString("deliveryNum"));
|
|
|
+ export.add(date.getString("deliveryRadio"));
|
|
|
+ export.add(date.getString("notDeliveryNum"));
|
|
|
+ export.add(date.getString("payAmount"));
|
|
|
+ export.add(date.getString("regimentalPromotionRate"));
|
|
|
+ export.add(date.getString("regimentalPromotionAmount"));
|
|
|
+ export.add(date.getString("imageUrl"));
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@GetMapping("/userItemTotal")
|
|
|
@ApiOperation(value = "认领商品列表汇总")
|
|
@@ -1142,4 +1193,23 @@ public class SupplyChainController extends BaseController {
|
|
|
List<JSONObject> list = supplyChainService.indexStatistics(requestMap);
|
|
|
return list;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ //发送响应流方法
|
|
|
+ public void setResponseHeader(HttpServletResponse response, String fileName) {
|
|
|
+ try {
|
|
|
+ try {
|
|
|
+ fileName = new String(fileName.getBytes(), "ISO8859-1");
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ response.setContentType("application/octet-stream;charset=ISO8859-1");
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
|
|
|
+ response.addHeader("Pargam", "no-cache");
|
|
|
+ response.addHeader("Cache-Control", "no-cache");
|
|
|
+ } catch (Exception ex) {
|
|
|
+ ex.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|