diff --git a/.vscode/settings.json b/.vscode/settings.json index 1b5ba53..144146e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { "java.compile.nullAnalysis.mode": "automatic", - "java.configuration.updateBuildConfiguration": "interactive", + "java.configuration.updateBuildConfiguration": "automatic", "java.debug.settings.onBuildFailureProceed": true } \ No newline at end of file diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml index 4d1c8fc..e91e0e0 100644 --- a/ruoyi-system/pom.xml +++ b/ruoyi-system/pom.xml @@ -56,6 +56,23 @@ 2.11.0 + + + org.apache.poi + poi + 5.2.3 + + + org.apache.poi + poi-ooxml + 5.2.3 + + + org.apache.poi + poi-ooxml-schemas + 4.1.2 + + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppleOrderController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppleOrderController.java index b91a166..6de4f1f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppleOrderController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppleOrderController.java @@ -1453,7 +1453,7 @@ public class AppleOrderController extends BaseController { orderList.add(orderResult); totalAmount = totalAmount.add(new BigDecimal(orderResult.get("allprice").toString())); if (totalAmount.compareTo(BigDecimal.ZERO) > 0) { - String payBeforeId = payBeforeUtil.createPayBefore(user, totalAmount, orderid, null, null, 11L, null, null, null, null, null, Long.valueOf(serviceGoods.getType()),null,null); + String payBeforeId = payBeforeUtil.createPayBefore(user, totalAmount, maincorid, null, null, 5L, null, null, null, null, null, Long.valueOf(serviceGoods.getType()),null,null); Map result1 = new HashMap<>(); result1.put("type", "2"); result1.put("orderid", payBeforeId); @@ -1510,6 +1510,9 @@ public class AppleOrderController extends BaseController { } } if (totalAmount.compareTo(BigDecimal.ZERO) > 0) { + com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject(); + jsonObject.put("name", "订单创建成功"); + OrderUtil.addgoodsorderlog(999L,maincorid,"订单生成","1",jsonObject,2L); String payBeforeId = payBeforeUtil.createPayBefore(user, totalAmount, maincorid, null, null, 5L, null, null, null, null, null,2L,null,null); Map result1 = new HashMap<>(); result1.put("type", "2"); @@ -4296,7 +4299,7 @@ public class AppleOrderController extends BaseController { // List orderLogs = orderLogService.selectOrderLogByOrderId(goodsOrder.getOrderId()); // 6. 查询订单日志 OrderLog logQuery = new OrderLog(); - logQuery.setOid(goodsOrder.getId()); + logQuery.setOrderId(goodsOrder.getMainOrderId()); logQuery.setOrdertype(2L); List logList = orderLogService.selectOrderLogList(logQuery); List> logArr = new ArrayList<>(); @@ -4390,9 +4393,26 @@ public class AppleOrderController extends BaseController { } // // 7. 构建订单状态时间线 // List> timeline = buildOrderTimeline(goodsOrder, orderLogs); - + GoodsOrder goodsOrderDATA = new GoodsOrder(); + goodsOrderDATA.setMainOrderId(goodsOrder.getMainOrderId()); + List goodsOrderList = goodsOrderService.selectGoodsOrderList(goodsOrderDATA); + List> goodsOrderListDATA = new ArrayList<>(); + for (GoodsOrder goodsOrderdata : goodsOrderList) { + ServiceGoods serviceGoods1 = serviceGoodsService.selectServiceGoodsById(goodsOrderdata.getProductId()); + if (serviceGoods != null) { + Map productInfo = new HashMap<>(); + productInfo.put("id", serviceGoods1.getId()); + productInfo.put("title", serviceGoods1.getTitle()); + productInfo.put("sub_title", serviceGoods1.getSubTitle()); + productInfo.put("icon", AppletControllerUtil.buildImageUrl(serviceGoods1.getIcon())); + productInfo.put("price", goodsOrderdata.getTotalPrice() != null ? goodsOrderdata.getTotalPrice().toString() : "0.00"); + productInfo.put("sku",AppletControllerUtil.parseSkuStringToObject(goodsOrderdata.getSku())); + productInfo.put("num", goodsOrderdata.getNum()); + goodsOrderListDATA.add(productInfo); + } + } // 8. 构建商品信息 - Map productInfo = buildProductInfo(goodsOrder, serviceGoods); +// Map productInfo = buildProductInfo(goodsOrder, serviceGoods); // 9. 构建订单信息 Map orderInfo = buildOrderInfo(goodsOrder); @@ -4402,11 +4422,11 @@ public class AppleOrderController extends BaseController { // 10. 构建返回结果 Map result = new HashMap<>(); - result.put("orderId", goodsOrder.getOrderId()); + result.put("orderId", goodsOrder.getMainOrderId()); result.put("shopAddress", shopAddress); result.put("status", goodsOrder.getStatus()); result.put("timeline", logArr); - result.put("product", productInfo); + result.put("product", goodsOrderListDATA); result.put("orderInfo", orderInfo); // 11. 添加退货数据(如果有退货信息) @@ -4489,10 +4509,10 @@ public class AppleOrderController extends BaseController { private Map buildOrderInfo(GoodsOrder goodsOrder) { Map orderInfo = new HashMap<>(); java.text.SimpleDateFormat dateFormat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - UsersPayBefor usersPayBefor = usersPayBeforService.selectUsersPayBeforByOrderId(goodsOrder.getOrderId()); - if (usersPayBefor == null){ - usersPayBefor = usersPayBeforService.selectUsersPayBeforByOrderId(goodsOrder.getMainOrderId()); - } + UsersPayBefor usersPayBefor = usersPayBeforService.selectUsersPayBeforByOrderId(goodsOrder.getMainOrderId()); +// if (usersPayBefor == null){ +// usersPayBefor = usersPayBeforService.selectUsersPayBeforByOrderId(goodsOrder.getMainOrderId()); +// } if (usersPayBefor != null){ orderInfo.put("totalPrice", usersPayBefor.getAllmoney()); orderInfo.put("payPrice", usersPayBefor.getAllmoney()); @@ -4506,7 +4526,7 @@ public class AppleOrderController extends BaseController { } //orderInfo.put("sku", AppletControllerUtil.parseSkuStringToObject(goodsOrder.getSku())); - orderInfo.put("orderId", goodsOrder.getOrderId()); + orderInfo.put("orderId", goodsOrder.getMainOrderId()); orderInfo.put("postage", goodsOrder.getPostage() != null ? goodsOrder.getPostage() : BigDecimal.ZERO); // logMap.put("created_at", log.getCreatedAt() != null ? dateFormat.format(log.getCreatedAt()) : null); orderInfo.put("createdAt", goodsOrder.getCreatedAt() != null ? dateFormat.format(goodsOrder.getCreatedAt()) : null); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppletController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppletController.java index c7283cb..0a20c71 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppletController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppletController.java @@ -671,7 +671,7 @@ public class AppletController extends BaseController { } // 6. 查询商品订单列表 - List orderList = goodsOrderService.selectGoodsOrderList(queryOrder); + List orderList = goodsOrderService.selectGoodsOrdergrouBymAIDList(queryOrder); // 7. 为每个订单填充商品信息 List> resultList = new ArrayList<>(); @@ -680,10 +680,11 @@ public class AppletController extends BaseController { for (GoodsOrder order : orderList) { Map orderData = new HashMap<>(); + // 订单基本信息 orderData.put("id", order.getId()); - orderData.put("order_id", order.getOrderId()); - orderData.put("order_no", order.getOrderId()); // 小程序常用字段 + orderData.put("order_id", order.getMainOrderId()); + orderData.put("order_no", order.getMainOrderId()); // 小程序常用字段 orderData.put("status", order.getStatus()); orderData.put("status_text", getOrderStatusText(order.getStatus())); // 状态文本 orderData.put("total_price", order.getTotalPrice() != null ? order.getTotalPrice().toString() : "0.00"); @@ -707,22 +708,40 @@ public class AppletController extends BaseController { } else { orderData.put("created_at", null); } - - // 查询并添加商品详细信息 - if (order.getProductId() != null) { - ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(order.getProductId()); - if (serviceGoods != null) { + GoodsOrder goodsOrderDATA = new GoodsOrder(); + goodsOrderDATA.setMainOrderId(order.getMainOrderId()); + List goodsOrderList = goodsOrderService.selectGoodsOrderList(goodsOrderDATA); + List> goodsOrderListDATA = new ArrayList<>(); + for (GoodsOrder goodsOrder : goodsOrderList) { + ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(goodsOrder.getProductId()); + if (serviceGoods != null) { Map productInfo = new HashMap<>(); productInfo.put("id", serviceGoods.getId()); productInfo.put("title", serviceGoods.getTitle()); productInfo.put("sub_title", serviceGoods.getSubTitle()); productInfo.put("icon", AppletControllerUtil.buildImageUrl(serviceGoods.getIcon())); - productInfo.put("price", order.getTotalPrice() != null ? order.getTotalPrice().toString() : "0.00"); - productInfo.put("num", order.getNum()); - - orderData.put("product", productInfo); + productInfo.put("price", goodsOrder.getTotalPrice() != null ? goodsOrder.getTotalPrice().toString() : "0.00"); + productInfo.put("sku",AppletControllerUtil.parseSkuStringToObject(goodsOrder.getSku())); + productInfo.put("num", goodsOrder.getNum()); + goodsOrderListDATA.add(productInfo); } } + orderData.put("product", goodsOrderListDATA); +// // 查询并添加商品详细信息 +// if (order.getProductId() != null) { +// ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(order.getProductId()); +// if (serviceGoods != null) { +// Map productInfo = new HashMap<>(); +// productInfo.put("id", serviceGoods.getId()); +// productInfo.put("title", serviceGoods.getTitle()); +// productInfo.put("sub_title", serviceGoods.getSubTitle()); +// productInfo.put("icon", AppletControllerUtil.buildImageUrl(serviceGoods.getIcon())); +// productInfo.put("price", order.getTotalPrice() != null ? order.getTotalPrice().toString() : "0.00"); +// productInfo.put("num", order.getNum()); +// +// orderData.put("product", productInfo); +// } +// } resultList.add(orderData); } // 8. 构建分页信息 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/DiyCityController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/DiyCityController.java index 4dbc3a1..732e8c7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/DiyCityController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/DiyCityController.java @@ -5,6 +5,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.system.ControllerUtil.ScheduledTaskUtil; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -167,8 +169,8 @@ public class DiyCityController extends BaseController { try { // 获取定时任务工具类 - com.ruoyi.system.controllerUtil.ScheduledTaskUtil scheduledTaskUtil = - com.ruoyi.common.utils.spring.SpringUtils.getBean(com.ruoyi.system.controllerUtil.ScheduledTaskUtil.class); + ScheduledTaskUtil scheduledTaskUtil = + com.ruoyi.common.utils.spring.SpringUtils.getBean(ScheduledTaskUtil.class); // 执行手动恢复 String result = scheduledTaskUtil.manualWorkerStatusResume(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/GoodsOrderController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/GoodsOrderController.java index af10acd..5cee1f4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/GoodsOrderController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/GoodsOrderController.java @@ -21,12 +21,23 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * 商品订单Controller @@ -38,6 +49,8 @@ import com.ruoyi.common.core.page.TableDataInfo; @RequestMapping("/system/GoodsOrder") public class GoodsOrderController extends BaseController { + private static final Logger log = LoggerFactory.getLogger(GoodsOrderController.class); + @Autowired private IGoodsOrderService goodsOrderService; @Autowired @@ -58,7 +71,7 @@ public class GoodsOrderController extends BaseController public TableDataInfo list(GoodsOrder goodsOrder) { startPage(); - List list = goodsOrderService.selectGoodsOrderList(goodsOrder); + List list = goodsOrderService.selectGoodsOrdergrouBymAIDList(goodsOrder); for(GoodsOrder goodsOrderdata:list){ ServiceGoods serviceGoods=serviceGoodsService.selectServiceGoodsById(goodsOrderdata.getProductId()); @@ -75,6 +88,90 @@ public class GoodsOrderController extends BaseController } return getDataTable(list); } + @GetMapping("/getByMainOrderId/{mainOrderId}") + public AjaxResult getGoodsOrderByMainOrderId(@PathVariable String mainOrderId) { + try { + GoodsOrder goodsOrderdata = new GoodsOrder(); + goodsOrderdata.setMainOrderId(mainOrderId); + List orders = goodsOrderService.selectGoodsOrderList(goodsOrderdata); + + // 为每个订单补充商品详细信息 + for (GoodsOrder order : orders) { + if (order.getProductId() != null) { + try { + ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(order.getProductId()); + if (serviceGoods != null) { + // 补充商品详细信息 + order.setProductName(serviceGoods.getTitle()); // 商品名称 + // 可以添加更多商品信息字段,比如: + // order.setProductImage(serviceGoods.getImage()); // 商品图片 + // order.setProductCategory(serviceGoods.getCategory()); // 商品分类 + // order.setProductDescription(serviceGoods.getDescription()); // 商品描述 + } + } catch (Exception e) { + // 如果获取商品信息失败,记录日志但不影响订单数据 + log.warn("获取商品信息失败,商品ID: {}, 错误: {}", order.getProductId(), e.getMessage()); + } + } + } + + return AjaxResult.success(orders); + } catch (Exception e) { + log.error("获取主订单数据失败,主订单ID: {}, 错误: {}", mainOrderId, e.getMessage()); + return AjaxResult.error("获取主订单数据失败: " + e.getMessage()); + } + } + + /** + * 根据商品ID获取商品详细信息 + */ + @GetMapping("/getProductInfo/{productId}") + public AjaxResult getProductInfo(@PathVariable Long productId) { + try { + if (productId == null) { + return AjaxResult.error("商品ID不能为空"); + } + + ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(productId); + if (serviceGoods == null) { + return AjaxResult.error("未找到商品信息"); + } + + return AjaxResult.success(serviceGoods); + } catch (Exception e) { + log.error("获取商品信息失败,商品ID: {}, 错误: {}", productId, e.getMessage()); + return AjaxResult.error("获取商品信息失败: " + e.getMessage()); + } + } + + /** + * 批量获取商品信息 + */ + @PostMapping("/getBatchProductInfo") + public AjaxResult getBatchProductInfo(@RequestBody List productIds) { + try { + if (productIds == null || productIds.isEmpty()) { + return AjaxResult.error("商品ID列表不能为空"); + } + + Map productMap = new HashMap<>(); + for (Long productId : productIds) { + try { + ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(productId); + if (serviceGoods != null) { + productMap.put(productId, serviceGoods); + } + } catch (Exception e) { + log.warn("获取商品信息失败,商品ID: {}, 错误: {}", productId, e.getMessage()); + } + } + + return AjaxResult.success(productMap); + } catch (Exception e) { + log.error("批量获取商品信息失败,错误: {}", e.getMessage()); + return AjaxResult.error("批量获取商品信息失败: " + e.getMessage()); + } + } /** * 导出商品订单列表 @@ -320,7 +417,7 @@ public class GoodsOrderController extends BaseController } } catch (Exception e) { - logger.error("处理售后申请失败", e); + log.error("处理售后申请失败", e); return error("操作失败:" + e.getMessage()); } } @@ -394,8 +491,393 @@ public class GoodsOrderController extends BaseController } } catch (Exception e) { - logger.error("订单发货失败", e); + log.error("订单发货失败", e); return error("发货失败:" + e.getMessage()); } } + + /** + * Excel导入批量发货 + */ + @PreAuthorize("@ss.hasPermi('system:GoodsOrder:edit')") + @Log(title = "Excel导入批量发货", businessType = BusinessType.UPDATE) + @PostMapping("/batchShipByExcel") + public AjaxResult batchShipByExcel(@RequestParam("file") MultipartFile file) + { + try { + if (file.isEmpty()) { + return error("请选择要上传的Excel文件"); + } + + String fileName = file.getOriginalFilename(); + if (!fileName.endsWith(".xlsx") && !fileName.endsWith(".xls")) { + return error("请上传Excel格式的文件(.xlsx或.xls)"); + } + + // 读取Excel文件 + List> excelData = readExcelFile(file); + if (excelData == null || excelData.isEmpty()) { + return error("Excel文件内容为空或格式错误"); + } + + // 验证Excel数据格式 + String validationResult = validateExcelData(excelData); + if (!"success".equals(validationResult)) { + return error("Excel数据格式错误:" + validationResult); + } + + // 执行批量发货 + Map result = executeBatchShipping(excelData); + + // 返回详细的结果信息 + return AjaxResult.success("批量发货完成", result); + + } catch (Exception e) { + log.error("Excel导入批量发货失败", e); + return error("批量发货失败:" + e.getMessage()); + } + } + + /** + * 读取Excel文件内容 + */ + private List> readExcelFile(MultipartFile file) throws Exception { + List> dataList = new ArrayList<>(); + + try (InputStream is = file.getInputStream()) { + Workbook workbook; + if (file.getOriginalFilename().endsWith(".xlsx")) { + workbook = new XSSFWorkbook(is); + } else { + workbook = WorkbookFactory.create(is); + } + + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + return dataList; + } + + // 跳过标题行,从第二行开始读取数据 + for (int i = 1; i <= sheet.getLastRowNum(); i++) { + Row row = sheet.getRow(i); + if (row == null) continue; + + Map rowData = new HashMap<>(); + + // 读取订单号 + Cell orderIdCell = row.getCell(0); + if (orderIdCell != null) { + rowData.put("orderId", getCellValue(orderIdCell)); + } + + // 读取快递公司 + Cell deliveryCompanyCell = row.getCell(1); + if (deliveryCompanyCell != null) { + rowData.put("deliveryCompany", getCellValue(deliveryCompanyCell)); + } + + // 读取快递单号 + Cell deliveryNumCell = row.getCell(2); + if (deliveryNumCell != null) { + rowData.put("deliveryNum", getCellValue(deliveryNumCell)); + } + + // 读取发货时间 + Cell sendTimeCell = row.getCell(3); + if (sendTimeCell != null) { + rowData.put("sendTime", getCellValue(sendTimeCell)); + } + + // 只添加有订单号的行 + if (rowData.get("orderId") != null && !rowData.get("orderId").toString().trim().isEmpty()) { + dataList.add(rowData); + } + } + + workbook.close(); + } + + return dataList; + } + + /** + * 获取单元格值 + */ + private String getCellValue(Cell cell) { + if (cell == null) { + return ""; + } + + switch (cell.getCellType()) { + case STRING: + return cell.getStringCellValue(); + case NUMERIC: + if (DateUtil.isCellDateFormatted(cell)) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + return sdf.format(cell.getDateCellValue()); + } else { + return String.valueOf((long) cell.getNumericCellValue()); + } + case BOOLEAN: + return String.valueOf(cell.getBooleanCellValue()); + case FORMULA: + return cell.getCellFormula(); + default: + return ""; + } + } + + /** + * 验证Excel数据格式 + */ + private String validateExcelData(List> excelData) { + if (excelData == null || excelData.isEmpty()) { + return "Excel数据为空"; + } + + for (int i = 0; i < excelData.size(); i++) { + Map row = excelData.get(i); + int rowNum = i + 2; // Excel行号(从2开始,因为第1行是标题) + + // 验证订单号 + Object orderId = row.get("orderId"); + if (orderId == null || orderId.toString().trim().isEmpty()) { + return "第" + rowNum + "行:订单号不能为空"; + } + + // 验证快递公司 + Object deliveryCompany = row.get("deliveryCompany"); + if (deliveryCompany == null || deliveryCompany.toString().trim().isEmpty()) { + return "第" + rowNum + "行:快递公司不能为空"; + } + + // 验证快递单号 + Object deliveryNum = row.get("deliveryNum"); + if (deliveryNum == null || deliveryNum.toString().trim().isEmpty()) { + return "第" + rowNum + "行:快递单号不能为空"; + } + + // 验证发货时间 + Object sendTime = row.get("sendTime"); + if (sendTime == null || sendTime.toString().trim().isEmpty()) { + return "第" + rowNum + "行:发货时间不能为空"; + } + + // 验证发货时间格式 + try { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + sdf.parse(sendTime.toString()); + } catch (Exception e) { + return "第" + rowNum + "行:发货时间格式错误,请使用yyyy-MM-dd格式"; + } + } + + return "success"; + } + + /** + * 执行批量发货 + */ + private Map executeBatchShipping(List> excelData) throws Exception { + Map result = new HashMap<>(); + List successList = new ArrayList<>(); + List failList = new ArrayList<>(); + List skipList = new ArrayList<>(); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + + for (Map row : excelData) { + String orderId = row.get("orderId").toString().trim(); + String deliveryCompany = row.get("deliveryCompany").toString().trim(); + String deliveryNum = row.get("deliveryNum").toString().trim(); + String sendTimeStr = row.get("sendTime").toString().trim(); + + try { + // 根据订单号查询订单 + GoodsOrder queryOrder = new GoodsOrder(); + queryOrder.setOrderId(orderId); + List orders = goodsOrderService.selectGoodsOrderList(queryOrder); + + if (orders == null || orders.isEmpty()) { + failList.add(orderId + ":订单不存在"); + continue; + } + + GoodsOrder order = orders.get(0); + + // 检查订单状态 + if (order.getStatus() != 2L) { + skipList.add(orderId + ":订单状态不是待发货状态(当前状态:" + order.getStatus() + ")"); + continue; + } + + // 根据快递公司名称查找快递公司ID + Long deliveryId = findDeliveryIdByName(deliveryCompany); + if (deliveryId == null) { + failList.add(orderId + ":快递公司'" + deliveryCompany + "'不存在"); + continue; + } + + // 解析发货时间 + Date sendTime; + try { + sendTime = sdf.parse(sendTimeStr); + } catch (Exception e) { + failList.add(orderId + ":发货时间格式错误"); + continue; + } + + // 执行发货 + boolean shipResult = shipSingleOrder(order, deliveryId, deliveryNum, sendTime); + + if (shipResult) { + successList.add(orderId); + } else { + failList.add(orderId + ":发货失败"); + } + + } catch (Exception e) { + log.error("处理订单" + orderId + "发货失败", e); + failList.add(orderId + ":处理异常 - " + e.getMessage()); + } + } + + result.put("total", excelData.size()); + result.put("success", successList.size()); + result.put("fail", failList.size()); + result.put("skip", skipList.size()); + result.put("successList", successList); + result.put("failList", failList); + result.put("skipList", skipList); + + return result; + } + + /** + * 根据快递公司名称查找ID + */ + private Long findDeliveryIdByName(String companyName) { + try { + // 查询所有快递公司 + List deliveries = siteDeliveryService.selectSiteDeliveryList(new SiteDelivery()); + for (SiteDelivery delivery : deliveries) { + if (companyName.equals(delivery.getTitle()) || companyName.equals(delivery.getCode())) { + return delivery.getId(); + } + } + } catch (Exception e) { + log.error("查询快递公司失败", e); + } + return null; + } + + /** + * 发货单个订单 + */ + private boolean shipSingleOrder(GoodsOrder order, Long deliveryId, String deliveryNum, Date sendTime) { + try { + // 更新订单信息 + order.setDeliveryId(deliveryId); + order.setDeliveryNum(deliveryNum); + order.setSendTime(sendTime); + order.setStatus(3L); // 设置为已发货状态 + + // 更新订单 + int result = goodsOrderService.updateGoodsOrder(order); + + if (result > 0) { + // 获取快递公司信息 + SiteDelivery siteDelivery = siteDeliveryService.selectSiteDeliveryById(deliveryId); + String deliveryTitle = siteDelivery != null ? siteDelivery.getTitle() : "未知快递"; + + // 添加发货日志 + JSONObject logData = new JSONObject(); + logData.put("wlgs", deliveryTitle); + logData.put("wldh", deliveryNum); + OrderUtil.addgoodsorderlog( + 999L, + order.getMainOrderId(), + "Excel批量导入发货", + "2", + logData, + 2L + ); + + return true; + } + + return false; + + } catch (Exception e) { + log.error("发货订单" + order.getOrderId() + "失败", e); + return false; + } + } + + /** + * 下载批量发货Excel模板 + */ + @GetMapping("/downloadTemplate") + public void downloadTemplate(HttpServletResponse response) throws Exception { + try { + // 创建CSV内容 + String csvContent = "订单号,快递公司,快递单号,发货时间\n" + + "B00001,顺丰,35434353,2025/8/11\n" + + "B00002,圆通,12345678,2025/8/11"; + + // 设置响应头 + response.setContentType("text/csv;charset=UTF-8"); + response.setCharacterEncoding("UTF-8"); + String fileName = "批量发货模板.csv"; + response.setHeader("Content-Disposition", "attachment;filename=" + + java.net.URLEncoder.encode(fileName, "UTF-8")); + + // 写入CSV内容 + response.getWriter().write(csvContent); + response.getWriter().flush(); + + } catch (Exception e) { + log.error("下载模板失败", e); + response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + response.getWriter().write("下载模板失败:" + e.getMessage()); + } + } + + /** + * 测试模板文件是否正常 + */ + @GetMapping("/testTemplate") + public AjaxResult testTemplate() { + try { + // 获取模板文件的URL + java.net.URL resourceUrl = getClass().getClassLoader().getResource("批量发货模版.xlsx"); + if (resourceUrl == null) { + return error("模板文件不存在"); + } + + // 使用Files.readAllBytes来读取文件内容 + java.nio.file.Path filePath = java.nio.file.Paths.get(resourceUrl.toURI()); + byte[] fileContent = java.nio.file.Files.readAllBytes(filePath); + + if (fileContent.length == 0) { + return error("模板文件为空"); + } + + // 检查文件头,验证是否为有效的XLSX文件 + if (fileContent.length < 4) { + return error("模板文件太小,可能已损坏"); + } + + // XLSX文件应该以PK开头(ZIP格式) + if (fileContent[0] != 0x50 || fileContent[1] != 0x4B) { + return error("模板文件不是有效的XLSX格式(缺少ZIP文件头)"); + } + + return success("模板文件正常,大小:" + fileContent.length + " 字节"); + + } catch (Exception e) { + log.error("测试模板文件失败", e); + return error("测试模板文件失败:" + e.getMessage()); + } + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserSecondaryCardController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserSecondaryCardController.java index 4725e20..af94655 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserSecondaryCardController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserSecondaryCardController.java @@ -7,10 +7,8 @@ import javax.servlet.http.HttpServletResponse; import com.alibaba.fastjson2.JSONArray; import com.ruoyi.system.ControllerUtil.GenerateCustomCode; -import com.ruoyi.system.domain.QuoteMaterial; -import com.ruoyi.system.domain.ServiceCate; -import com.ruoyi.system.service.IServiceCateService; -import com.ruoyi.system.service.IServiceGoodsService; +import com.ruoyi.system.domain.*; +import com.ruoyi.system.service.*; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -25,10 +23,9 @@ import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.system.domain.UserSecondaryCard; -import com.ruoyi.system.service.IUserSecondaryCardService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; +import java.util.Map; /** * 次卡管理Controller @@ -49,6 +46,14 @@ public class UserSecondaryCardController extends BaseController @Autowired private IServiceCateService serviceCateService; + @Autowired + private IUserUseSecondaryCardService userUseSecondaryCardService; + + @Autowired + private IUsersService usersService; + + + /** * 数字转中文工具方法 */ @@ -145,6 +150,22 @@ public class UserSecondaryCardController extends BaseController @PostMapping public AjaxResult add(@RequestBody UserSecondaryCard userSecondaryCard) { + // 数据验证 + if (userSecondaryCard.getAllnum() == null || userSecondaryCard.getAllnum() <= 0) { + return error("总服务数必须大于0"); + } + if (userSecondaryCard.getNum() == null || userSecondaryCard.getNum() <= 0) { + return error("可提供服务数必须大于0"); + } + if (userSecondaryCard.getNum() > userSecondaryCard.getAllnum()) { + return error("可提供服务数不能大于总服务数"); + } + if (userSecondaryCard.getShowMoney() != null && userSecondaryCard.getRealMoney() != null) { + if (userSecondaryCard.getRealMoney().compareTo(userSecondaryCard.getShowMoney()) > 0) { + return error("实付价格不能大于展示价格"); + } + } + userSecondaryCard.setOrderid(GenerateCustomCode.generCreateOrder("CIKA")); userSecondaryCard.setCreattime(new Date()); @@ -163,6 +184,24 @@ public class UserSecondaryCardController extends BaseController @PutMapping public AjaxResult edit(@RequestBody UserSecondaryCard userSecondaryCard) { + // 数据验证 + if (userSecondaryCard.getAllnum() != null && userSecondaryCard.getAllnum() <= 0) { + return error("总服务数必须大于0"); + } + if (userSecondaryCard.getNum() != null && userSecondaryCard.getNum() <= 0) { + return error("可提供服务数必须大于0"); + } + if (userSecondaryCard.getNum() != null && userSecondaryCard.getAllnum() != null) { + if (userSecondaryCard.getNum() > userSecondaryCard.getAllnum()) { + return error("可提供服务数不能大于总服务数"); + } + } + if (userSecondaryCard.getShowMoney() != null && userSecondaryCard.getRealMoney() != null) { + if (userSecondaryCard.getRealMoney().compareTo(userSecondaryCard.getShowMoney()) > 0) { + return error("实付价格不能大于展示价格"); + } + } + // 自动生成introduction字段 String introduction = generateIntroduction(userSecondaryCard.getAllnum(), userSecondaryCard.getNum()); userSecondaryCard.setIntroduction(introduction); @@ -180,4 +219,68 @@ public class UserSecondaryCardController extends BaseController { return toAjax(userSecondaryCardService.deleteUserSecondaryCardByIds(ids)); } + + /** + * 批量更新次卡状态 + */ + @PreAuthorize("@ss.hasPermi('system:UserSecondaryCard:edit')") + @Log(title = "批量更新次卡状态", businessType = BusinessType.UPDATE) + @PutMapping("/batchStatus") + public AjaxResult batchUpdateStatus(@RequestBody Map params) + { + List ids = (List) params.get("ids"); + Integer status = (Integer) params.get("status"); + + if (ids == null || ids.isEmpty()) { + return error("请选择要更新的次卡"); + } + + if (status == null || status < 1 || status > 3) { + return error("状态值无效"); + } + + int result = 0; + for (Long id : ids) { + UserSecondaryCard card = new UserSecondaryCard(); + card.setId(id); + card.setStatus(status.longValue()); + result += userSecondaryCardService.updateUserSecondaryCard(card); + } + + return toAjax(result); + } + + /** + * 批量删除次卡 + */ + @PreAuthorize("@ss.hasPermi('system:UserSecondaryCard:remove')") + @Log(title = "批量删除次卡", businessType = BusinessType.DELETE) + @DeleteMapping("/batchDelete") + public AjaxResult batchDelete(@RequestBody List ids) + { + if (ids == null || ids.isEmpty()) { + return error("请选择要删除的次卡"); + } + + return toAjax(userSecondaryCardService.deleteUserSecondaryCardByIds(ids.toArray(new Long[0]))); + } + + /** + * 查询次卡购买详情 + */ + @PreAuthorize("@ss.hasPermi('system:UserSecondaryCard:query')") + @GetMapping("/purchaseDetails/{id}") + public AjaxResult getPurchaseDetails(@PathVariable("id") String id) + { + List list = userUseSecondaryCardService.selectPurchaseDetailsByCardId(id); + for (UserUseSecondaryCard userUseSecondaryCard : list){ + Users users = usersService.selectUsersById(userUseSecondaryCard.getUid()); + if (users != null) { + userUseSecondaryCard.setRemark(users.getName()); + } + + } + return success(list); + //return success(userUseSecondaryCardService.selectPurchaseDetailsByCardId(id)); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/WorkerMoneyLogController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/WorkerMoneyLogController.java index 67fd9f8..ea3fc59 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/WorkerMoneyLogController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/WorkerMoneyLogController.java @@ -10,7 +10,8 @@ import java.util.Map; import java.math.BigDecimal; import com.ruoyi.common.utils.spring.SpringUtils; -import com.ruoyi.system.controllerUtil.ScheduledTaskUtil; + +import com.ruoyi.system.ControllerUtil.ScheduledTaskUtil; import com.ruoyi.system.domain.Users; import com.ruoyi.system.service.IUsersService; import org.springframework.security.access.prepost.PreAuthorize; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/ScheduledTaskExample.java b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/ScheduledTaskExample.java index 0837519..21fbe93 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/ScheduledTaskExample.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/ScheduledTaskExample.java @@ -2,7 +2,7 @@ package com.ruoyi.system.ControllerUtil; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.spring.SpringUtils; -import com.ruoyi.system.controllerUtil.ScheduledTaskUtil; + import org.springframework.web.bind.annotation.*; import java.util.Map; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/ScheduledTaskUtil.java b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/ScheduledTaskUtil.java index 7140f72..b573cee 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/ScheduledTaskUtil.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/ScheduledTaskUtil.java @@ -1,4 +1,4 @@ -package com.ruoyi.system.controllerUtil; +package com.ruoyi.system.ControllerUtil; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/GoodsOrder.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/GoodsOrder.java index a5092fe..8a1873e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/GoodsOrder.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/GoodsOrder.java @@ -166,6 +166,7 @@ public class GoodsOrder extends BaseEntity private String returnlogisticscode; private String returnjson; private Long returnstatus; + private Long ismany; private Date returntime; private BigDecimal returnmoney; @@ -668,6 +669,14 @@ public class GoodsOrder extends BaseEntity this.returnrealmoney = returnrealmoney; } + public Long getIsmany() { + return ismany; + } + + public void setIsmany(Long ismany) { + this.ismany = ismany; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/GoodsOrderMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/GoodsOrderMapper.java index 1d2f544..c031317 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/GoodsOrderMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/GoodsOrderMapper.java @@ -46,6 +46,14 @@ public interface GoodsOrderMapper */ public List selectGoodsOrderList(GoodsOrder goodsOrder); + /** + * 查询商品订单列表 + * + * @param goodsOrder 商品订单 + * @return 商品订单集合 + */ + public List selectGoodsOrdergrouBymAIDList(GoodsOrder goodsOrder); + /** * 新增商品订单 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserUseSecondaryCardMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserUseSecondaryCardMapper.java index ad269cc..c8a9646 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserUseSecondaryCardMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserUseSecondaryCardMapper.java @@ -63,4 +63,12 @@ public interface UserUseSecondaryCardMapper * @return 结果 */ public int deleteUserUseSecondaryCardByIds(Long[] ids); + + /** + * 根据次卡ID查询购买详情 + * + * @param cardId 次卡ID + * @return 购买详情列表 + */ + public List selectPurchaseDetailsByCardId(String cardId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IGoodsOrderService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IGoodsOrderService.java index 201a26b..763c2f2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IGoodsOrderService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IGoodsOrderService.java @@ -27,6 +27,9 @@ public interface IGoodsOrderService */ public List selectGoodsOrderList(GoodsOrder goodsOrder); + + public List selectGoodsOrdergrouBymAIDList(GoodsOrder goodsOrder); + public GoodsOrder selectGoodsOrderByorderId(String orderId); public int selectCountGoodsOrderByUid(Long uid,Long status); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserUseSecondaryCardService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserUseSecondaryCardService.java index 1954493..a760648 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserUseSecondaryCardService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserUseSecondaryCardService.java @@ -63,4 +63,12 @@ public interface IUserUseSecondaryCardService * @return 结果 */ public int deleteUserUseSecondaryCardById(Long id); + + /** + * 根据次卡ID查询购买详情 + * + * @param cardId 次卡ID + * @return 购买详情列表 + */ + public List selectPurchaseDetailsByCardId(String cardId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/GoodsOrderServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/GoodsOrderServiceImpl.java index 5eccda5..069017d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/GoodsOrderServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/GoodsOrderServiceImpl.java @@ -63,6 +63,18 @@ public class GoodsOrderServiceImpl implements IGoodsOrderService return goodsOrderMapper.selectGoodsOrderList(goodsOrder); } + /** + * 查询商品订单列表 + * + * @param goodsOrder 商品订单 + * @return 商品订单 + */ + @Override + public List selectGoodsOrdergrouBymAIDList(GoodsOrder goodsOrder) + { + return goodsOrderMapper.selectGoodsOrdergrouBymAIDList(goodsOrder); + } + /** * 新增商品订单 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserUseSecondaryCardServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserUseSecondaryCardServiceImpl.java index 7225d30..97b80a2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserUseSecondaryCardServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserUseSecondaryCardServiceImpl.java @@ -97,4 +97,16 @@ public class UserUseSecondaryCardServiceImpl implements IUserUseSecondaryCardSer { return userUseSecondaryCardMapper.deleteUserUseSecondaryCardById(id); } + + /** + * 根据次卡ID查询购买详情 + * + * @param cardId 次卡ID + * @return 购买详情列表 + */ + @Override + public List selectPurchaseDetailsByCardId(String cardId) + { + return userUseSecondaryCardMapper.selectPurchaseDetailsByCardId(cardId); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/GoodsOrderMapper.xml b/ruoyi-system/src/main/resources/mapper/system/GoodsOrderMapper.xml index 7c7a16c..8a89b81 100644 --- a/ruoyi-system/src/main/resources/mapper/system/GoodsOrderMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/GoodsOrderMapper.xml @@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -59,7 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, type, main_order_id,returnshow,returnrealmoney, returnstatus,order_id,returntime,returnmoney,returnfinshtime,returntype,returnreason,returnfiledata,returnlogistics,returnlogisticscode,returnjson, transaction_id,forserviceid,isforservice,isself,coupon_id,shopadresssid, uid, product_id, name, phone, address, num, total_price, good_price, service_price, pay_price, deduction, postage, pay_time, status, delivery_id, delivery_num, send_time, mark, address_id, sku, created_at, updated_at, deleted_at from goods_order + select id, type, main_order_id,returnshow,ismany,returnrealmoney, returnstatus,order_id,returntime,returnmoney,returnfinshtime,returntype,returnreason,returnfiledata,returnlogistics,returnlogisticscode,returnjson, transaction_id,forserviceid,isforservice,isself,coupon_id,shopadresssid, uid, product_id, name, phone, address, num, total_price, good_price, service_price, pay_price, deduction, postage, pay_time, status, delivery_id, delivery_num, send_time, mark, address_id, sku, created_at, updated_at, deleted_at from goods_order + + + + + diff --git a/ruoyi-system/src/main/resources/批量发货模版.xlsx b/ruoyi-system/src/main/resources/批量发货模版.xlsx new file mode 100644 index 0000000..42c2389 Binary files /dev/null and b/ruoyi-system/src/main/resources/批量发货模版.xlsx differ diff --git a/ruoyi-ui/src/api/system/GoodsOrder.js b/ruoyi-ui/src/api/system/GoodsOrder.js index 42f869f..bebc982 100644 --- a/ruoyi-ui/src/api/system/GoodsOrder.js +++ b/ruoyi-ui/src/api/system/GoodsOrder.js @@ -108,3 +108,42 @@ export function getPrePaymentByOrderId(orderId) { method: 'get' }) } + +// 根据主订单ID查询所有子订单 +export function getGoodsOrderByMainOrderId(mainOrderId) { + return request({ + url: '/system/GoodsOrder/getByMainOrderId/' + mainOrderId, + method: 'get' + }) +} + +// 根据商品ID获取商品详细信息 +export function getProductInfo(productId) { + return request({ + url: '/system/GoodsOrder/getProductInfo/' + productId, + method: 'get' + }) +} + +// 批量获取商品信息 +export function getBatchProductInfo(productIds) { + return request({ + url: '/system/GoodsOrder/getBatchProductInfo', + method: 'post', + data: productIds + }) +} + +// Excel导入批量发货 +export function batchShipByExcel(file) { + const formData = new FormData() + formData.append('file', file) + return request({ + url: '/system/GoodsOrder/batchShipByExcel', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }) +} diff --git a/ruoyi-ui/src/api/system/UserSecondaryCard.js b/ruoyi-ui/src/api/system/UserSecondaryCard.js index 2b76e71..ceed33b 100644 --- a/ruoyi-ui/src/api/system/UserSecondaryCard.js +++ b/ruoyi-ui/src/api/system/UserSecondaryCard.js @@ -68,3 +68,11 @@ export function delUserSecondaryCard(id) { method: 'delete' }) } + +// 查询次卡购买详情 +export function getPurchaseDetails(cardId) { + return request({ + url: '/system/UserSecondaryCard/purchaseDetails/' + cardId, + method: 'get' + }) +} diff --git a/ruoyi-ui/src/api/system/WorkerApply.js b/ruoyi-ui/src/api/system/WorkerApply.js index 445d00e..4303491 100644 --- a/ruoyi-ui/src/api/system/WorkerApply.js +++ b/ruoyi-ui/src/api/system/WorkerApply.js @@ -49,6 +49,24 @@ export function delWorkerApply(id) { }) } +// 审核师傅申请记录 +export function auditWorkerApply(data) { + return request({ + url: '/system/WorkerApply/audit', + method: 'post', + data: data + }) +} + +// 批量审核师傅申请记录 +export function batchAuditWorkerApply(data) { + return request({ + url: '/system/WorkerApply/batchAudit', + method: 'post', + data: data + }) +} + // 获取地区列表 export function selectAreaList(pid) { return request({ diff --git a/ruoyi-ui/src/views/system/GoodsOrder/index.vue b/ruoyi-ui/src/views/system/GoodsOrder/index.vue index c815051..06b7d91 100644 --- a/ruoyi-ui/src/views/system/GoodsOrder/index.vue +++ b/ruoyi-ui/src/views/system/GoodsOrder/index.vue @@ -40,6 +40,19 @@ + + + + + + + + + + + + + 搜索 重置 + + {{ showAdvancedSearch ? '收起' : '高级搜索' }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -121,16 +190,173 @@ v-hasPermi="['system:GoodsOrder:remove']" >删除 + + Excel批量发货 + + + 刷新数据 + + + 导出数据 + - + + + + - - - - + + + + + + @@ -206,125 +432,265 @@ @click="handleAfterSale(scope.row)" style="color: #E6A23C;" >售后 + + + 查看详情 - + - - - - - - - - - - - - - - - - - - - - + +
+ + + 主订单信息 + +
+ + + + + + + + + -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - 待支付 - 已支付 - 发货 - 评价 - 已完成 - - - - - - - - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + 商品信息列表 + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + 订单汇总 + +
+ + + + + + + + + + + + + + +
+ + ¥{{ totalSubOrdersPrice.toFixed(2) }} +
+
+ +
+ + ¥{{ form.payPrice ? form.payPrice.toFixed(2) : '0.00' }} +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +