|
@@ -2708,33 +2708,38 @@ public class SupplyChainController extends BaseController {
|
|
|
public void exportShopList(HttpServletRequest request, HttpServletResponse response, @RequestBody JSONObject requestJson) throws IOException {
|
|
|
|
|
|
try {
|
|
|
+
|
|
|
+
|
|
|
if (Check.isNull(requestJson.getString("orderStartDate")) || Check.isNull(requestJson.getString("orderEndDate"))) {
|
|
|
throw new Exception("请输入开始时间和结束时间");
|
|
|
}
|
|
|
|
|
|
- Long userId = requestJson.getLong("userId");
|
|
|
- if (Check.isNull(userId)) {
|
|
|
- throw new Exception("请输入用户ID");
|
|
|
+ if (Check.isNull(requestJson.getLong("userId"))) {
|
|
|
+ throw new Exception("请输入用户id");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
|
- requestMap.put("start", requestJson.getString("orderStartDate"));
|
|
|
- requestMap.put("end", requestJson.getString("orderEndDate"));
|
|
|
- requestMap.put("fieId", "orderNum");
|
|
|
- requestMap.put("sort", "desc");
|
|
|
|
|
|
- String roleKey = sysUserService.getRoleKeyByUserId(userId);
|
|
|
+ String roleKey = sysUserService.getRoleKeyByUserId(requestJson.getLong("userId"));
|
|
|
if (roleKey.equals("courtship")) {
|
|
|
- List<Long> itemIds = supplyChainService.getItemIdsByUserId(userId);
|
|
|
+ List<Long> itemIds = supplyChainService.getItemIdsByUserId(requestJson.getLong("userId"));
|
|
|
requestMap.put("itemIds", itemIds);
|
|
|
}
|
|
|
|
|
|
if (roleKey.equals("courtshipManager")) {
|
|
|
- Long deptId = deptService.getDeptIdByUserId(userId);
|
|
|
+ Long deptId = deptService.getDeptIdByUserId(requestJson.getLong("userId"));
|
|
|
List<Long> itemIds = supplyChainService.getItemIdsByDeptId(deptId);
|
|
|
requestMap.put("itemIds", itemIds);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ requestMap.put("start", DateUtils.strDateToInt(requestJson.getString("orderStartDate")));
|
|
|
+ requestMap.put("end", DateUtils.strDateToInt(requestJson.getString("orderEndDate")));
|
|
|
+ if (!Check.isNull(requestJson.getLong("sellerId"))) {
|
|
|
+ requestMap.put("sellerId", requestJson.getLong("sellerId"));
|
|
|
+
|
|
|
+ }
|
|
|
+ requestMap.put("fieId", "orderNum");
|
|
|
+ requestMap.put("sort", "desc");
|
|
|
List<JSONObject> list = supplyChainService.shopList(requestMap);
|
|
|
List<List<Object>> exportList = new ArrayList<>();
|
|
|
if (!Check.isNull(list)) {
|
|
@@ -2746,6 +2751,8 @@ public class SupplyChainController extends BaseController {
|
|
|
export.add(date.getString("orderNum"));
|
|
|
export.add(date.getString("validOrderNUm"));
|
|
|
export.add(date.getString("validRadio"));
|
|
|
+ export.add(date.getString("settledOrderNUm"));
|
|
|
+ export.add(date.getString("settledOrderRate"));
|
|
|
export.add(date.getString("payAmount"));
|
|
|
export.add(date.getString("deliveryNum"));
|
|
|
export.add(date.getString("shippingGreen"));
|
|
@@ -2755,7 +2762,7 @@ public class SupplyChainController extends BaseController {
|
|
|
exportList.add(export);
|
|
|
}
|
|
|
}
|
|
|
- String[] headers = {"店铺ID", "店铺名称", "单量", "有效单量", "有效率", "付款金额", "发货数", "发货率", "有效发货数", "未发货数", "有效发货率"};
|
|
|
+ String[] headers = {"店铺ID", "店铺名称", "单量", "有效单量", "有效率", "已结单量", "结算率", "付款金额", "发货数", "发货率", "有效发货数", "未发货数", "有效发货率"};
|
|
|
OutputStream os = response.getOutputStream();
|
|
|
ExportExcelUtils eeu = new ExportExcelUtils();
|
|
|
XSSFWorkbook workbook = new XSSFWorkbook();
|