From 840e32f7cab5db7e79ea76cbcfc3a5488496998d Mon Sep 17 00:00:00 2001 From: "925116093-qq.com" <925116093@qq.com> Date: Mon, 18 Aug 2025 19:38:22 +0800 Subject: [PATCH] 2025008071805 --- .../system/controller/AppletController.java | 61 +++++++++++++------ .../java/com/ruoyi/system/domain/Order.java | 12 ++++ .../resources/mapper/system/OrderMapper.xml | 13 ++++ .../Order/components/OrderDetailDialog.vue | 2 +- .../Order/components/ProjectQuoteDialog.vue | 13 ++-- ruoyi-ui/src/views/system/Order/index.vue | 2 +- 6 files changed, 77 insertions(+), 26 deletions(-) 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 0967783..5566529 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 @@ -732,32 +732,44 @@ public class AppletController extends BaseController { } } 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. 构建分页信息 + + + + // 6. 构建分页信息 +// PageInfo pageInfo = new PageInfo<>(orderList); PageInfo pageInfo = new PageInfo<>(orderList); - // 9. 构建返回数据格式(简化版本,更适合小程序) + // 7. 构建返回数据格式 Map responseData = new HashMap<>(); responseData.put("current_page", pageInfo.getPageNum()); responseData.put("data", resultList); - responseData.put("total", pageInfo.getTotal()); - responseData.put("per_page", pageInfo.getPageSize()); + responseData.put("from", pageInfo.getStartRow()); responseData.put("last_page", pageInfo.getPages()); + responseData.put("per_page", pageInfo.getPageSize()); + responseData.put("to", pageInfo.getEndRow()); + responseData.put("total", pageInfo.getTotal()); + + // 构建分页链接信息 + String baseUrl = "https://www.huafurenjia.cn/api/goods/order/lst/"; + responseData.put("first_page_url", baseUrl + "?page=1"); + responseData.put("last_page_url", baseUrl + "?page=" + pageInfo.getPages()); + responseData.put("next_page_url", pageInfo.isHasNextPage() ? + baseUrl + "?page=" + pageInfo.getNextPage() : null); + responseData.put("prev_page_url", pageInfo.isHasPreviousPage() ? + baseUrl + "?page=" + pageInfo.getPrePage() : null); + responseData.put("path", baseUrl); + +// +// // 8. 构建分页信息 +// PageInfo pageInfo = new PageInfo<>(orderList); +// // 9. 构建返回数据格式(简化版本,更适合小程序) +// Map responseData = new HashMap<>(); +// responseData.put("current_page", pageInfo.getPageNum()); +// responseData.put("data", resultList); +// responseData.put("total", pageInfo.getTotal()); +// responseData.put("per_page", pageInfo.getPageSize()); +// responseData.put("last_page", pageInfo.getPages()); return AppletControllerUtil.appletSuccess(responseData); @@ -4691,6 +4703,10 @@ public class AppletController extends BaseController { if (order.getAddressId() != null) { address = userAddressService.selectUserAddressById(order.getAddressId()); } +// else{ +// address.setAddressName(); +// address. +// } // 5. 查询商品信息 ServiceGoods product = null; if (order.getProductId() != null) { @@ -6298,7 +6314,12 @@ public class AppletController extends BaseController { } BigDecimal reductionPrice = BigDecimal.ZERO; String reduction = params.get("reduction").toString(); - String reamk = params.get("reamk").toString(); + String reamk = null; + if (params.get("reamk") != null){ + reamk =params.get("reamk").toString(); + } + + if (reduction != null && !reduction.trim().isEmpty()) { reductionPrice = new BigDecimal(reduction); // totalPrice = totalPrice.subtract(reductionPrice); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Order.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Order.java index 73f7ae1..385c0c3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Order.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Order.java @@ -143,6 +143,10 @@ public class Order extends BaseEntity @Excel(name = "备注") private String mark; + /** 备注 */ + // @Excel(name = "备注") + private String adressjson; + /** 关联地址 */ // @Excel(name = "关联地址") private Long addressId; @@ -1036,6 +1040,14 @@ public class Order extends BaseEntity this.workerdel = workerdel; } + public String getAdressjson() { + return adressjson; + } + + public void setAdressjson(String adressjson) { + this.adressjson = adressjson; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml b/ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml index 50f6bf6..a174694 100644 --- a/ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml @@ -24,6 +24,7 @@ + @@ -67,6 +68,8 @@ + + @@ -97,6 +100,7 @@ transaction_id, create_type, create_phone, + adressjson, uid, workerdel, cartid, @@ -466,6 +470,9 @@ workerdel, + + adressjson, + created_at, updated_at @@ -618,6 +625,9 @@ #{workerdel}, + + #{adressjson}, + NOW(), NOW() @@ -775,6 +785,9 @@ workerdel = #{workerdel}, + + adressjson = #{adressjson}, + updated_at = NOW() diff --git a/ruoyi-ui/src/views/system/Order/components/OrderDetailDialog.vue b/ruoyi-ui/src/views/system/Order/components/OrderDetailDialog.vue index b3509d9..8fb0a70 100644 --- a/ruoyi-ui/src/views/system/Order/components/OrderDetailDialog.vue +++ b/ruoyi-ui/src/views/system/Order/components/OrderDetailDialog.vue @@ -103,7 +103,7 @@ 加载中... {{ workerInfo.phone || '未设置' }} - {{ workerInfo.phone || '未设置' }} + {{ orderInfo.workerPhone || '未设置' }}
diff --git a/ruoyi-ui/src/views/system/Order/components/ProjectQuoteDialog.vue b/ruoyi-ui/src/views/system/Order/components/ProjectQuoteDialog.vue index d3c67c7..da23f3d 100644 --- a/ruoyi-ui/src/views/system/Order/components/ProjectQuoteDialog.vue +++ b/ruoyi-ui/src/views/system/Order/components/ProjectQuoteDialog.vue @@ -208,11 +208,14 @@ export default { handler(val) { this.visibleInner = val if (val) { - this.loadInspectionOptions() + this.$nextTick(() => { + this.loadInspectionOptions() + }) } } }, workerId() { if (this.visibleInner) this.loadInspectionOptions() }, + orderId() { if (this.visibleInner) this.loadInspectionOptions() }, goodId() { if (this.visibleInner) this.loadInspectionOptions() } }, computed: { @@ -239,14 +242,16 @@ export default { }, methods: { async loadInspectionOptions() { - if (!this.workerId || !this.goodId) { + // 允许仅凭 goodId 加载(后端支持仅传 goodid 返回基础项目) + if (!this.goodId && !this.orderId) { // 缺少必要参数时不请求 return } try { this.loadingInspections = true - const url = `api/worker/basic/project?id=${this.workerId}&goodid=${this.goodId}` - const res = await request.get(url) + const res = await request.get('/api/worker/basic/project', { + params: { id: this.orderId || undefined, goodid: this.goodId || undefined } + }) if (res && res.code === 200 && res.data && Array.isArray(res.data.basic)) { this.inspectionOptions = res.data.basic.map((name, idx) => ({ id: idx + 1, name })) this.selectedInspectionIds = [] diff --git a/ruoyi-ui/src/views/system/Order/index.vue b/ruoyi-ui/src/views/system/Order/index.vue index e17931b..0a9c01f 100644 --- a/ruoyi-ui/src/views/system/Order/index.vue +++ b/ruoyi-ui/src/views/system/Order/index.vue @@ -2075,7 +2075,7 @@