2025008071805

This commit is contained in:
张潘 2025-08-18 19:38:22 +08:00
parent 16588b6d5b
commit 840e32f7ca
6 changed files with 77 additions and 26 deletions

View File

@ -732,32 +732,44 @@ public class AppletController extends BaseController {
} }
} }
orderData.put("product", goodsOrderListDATA); orderData.put("product", goodsOrderListDATA);
// // 查询并添加商品详细信息
// if (order.getProductId() != null) {
// ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(order.getProductId());
// if (serviceGoods != null) {
// Map<String, Object> 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); resultList.add(orderData);
} }
// 8. 构建分页信息
// 6. 构建分页信息
// PageInfo<ServiceGoods> pageInfo = new PageInfo<>(orderList);
PageInfo<GoodsOrder> pageInfo = new PageInfo<>(orderList); PageInfo<GoodsOrder> pageInfo = new PageInfo<>(orderList);
// 9. 构建返回数据格式简化版本更适合小程序 // 7. 构建返回数据格式
Map<String, Object> responseData = new HashMap<>(); Map<String, Object> responseData = new HashMap<>();
responseData.put("current_page", pageInfo.getPageNum()); responseData.put("current_page", pageInfo.getPageNum());
responseData.put("data", resultList); responseData.put("data", resultList);
responseData.put("total", pageInfo.getTotal()); responseData.put("from", pageInfo.getStartRow());
responseData.put("per_page", pageInfo.getPageSize());
responseData.put("last_page", pageInfo.getPages()); 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<GoodsOrder> pageInfo = new PageInfo<>(orderList);
// // 9. 构建返回数据格式简化版本更适合小程序
// Map<String, Object> 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); return AppletControllerUtil.appletSuccess(responseData);
@ -4691,6 +4703,10 @@ public class AppletController extends BaseController {
if (order.getAddressId() != null) { if (order.getAddressId() != null) {
address = userAddressService.selectUserAddressById(order.getAddressId()); address = userAddressService.selectUserAddressById(order.getAddressId());
} }
// else{
// address.setAddressName();
// address.
// }
// 5. 查询商品信息 // 5. 查询商品信息
ServiceGoods product = null; ServiceGoods product = null;
if (order.getProductId() != null) { if (order.getProductId() != null) {
@ -6298,7 +6314,12 @@ public class AppletController extends BaseController {
} }
BigDecimal reductionPrice = BigDecimal.ZERO; BigDecimal reductionPrice = BigDecimal.ZERO;
String reduction = params.get("reduction").toString(); 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()) { if (reduction != null && !reduction.trim().isEmpty()) {
reductionPrice = new BigDecimal(reduction); reductionPrice = new BigDecimal(reduction);
// totalPrice = totalPrice.subtract(reductionPrice); // totalPrice = totalPrice.subtract(reductionPrice);

View File

@ -143,6 +143,10 @@ public class Order extends BaseEntity
@Excel(name = "备注") @Excel(name = "备注")
private String mark; private String mark;
/** 备注 */
// @Excel(name = "备注")
private String adressjson;
/** 关联地址 */ /** 关联地址 */
// @Excel(name = "关联地址") // @Excel(name = "关联地址")
private Long addressId; private Long addressId;
@ -1036,6 +1040,14 @@ public class Order extends BaseEntity
this.workerdel = workerdel; this.workerdel = workerdel;
} }
public String getAdressjson() {
return adressjson;
}
public void setAdressjson(String adressjson) {
this.adressjson = adressjson;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -24,6 +24,7 @@
<result property="cartid" column="cartid"/> <result property="cartid" column="cartid"/>
<result property="bigtype" column="bigtype"/> <result property="bigtype" column="bigtype"/>
<result property="workerdel" column="workerdel"/> <result property="workerdel" column="workerdel"/>
<result property="adressjson" column="adressjson"/>
<result property="totalPrice" column="total_price"/> <result property="totalPrice" column="total_price"/>
@ -67,6 +68,8 @@
<resultMap type="OrderApple" id="OrderAppleResult"> <resultMap type="OrderApple" id="OrderAppleResult">
<result property="created_at" column="deleted_at"/> <result property="created_at" column="deleted_at"/>
<result property="reamk" column="reamk"/> <result property="reamk" column="reamk"/>
<result property="adressjson" column="adressjson"/>
<result property="id" column="id"/> <result property="id" column="id"/>
<result property="odertype" column="odertype"/> <result property="odertype" column="odertype"/>
<result property="is_comment" column="is_comment"/> <result property="is_comment" column="is_comment"/>
@ -97,6 +100,7 @@
transaction_id, transaction_id,
create_type, create_type,
create_phone, create_phone,
adressjson,
uid, uid,
workerdel, workerdel,
cartid, cartid,
@ -466,6 +470,9 @@
<if test="workerdel != null"> <if test="workerdel != null">
workerdel, workerdel,
</if> </if>
<if test="adressjson != null">
adressjson,
</if>
created_at, created_at,
updated_at updated_at
@ -618,6 +625,9 @@
<if test="workerdel != null"> <if test="workerdel != null">
#{workerdel}, #{workerdel},
</if> </if>
<if test="adressjson != null">
#{adressjson},
</if>
NOW(), NOW(),
NOW() NOW()
@ -775,6 +785,9 @@
<if test="workerdel != null"> <if test="workerdel != null">
workerdel = #{workerdel}, workerdel = #{workerdel},
</if> </if>
<if test="adressjson != null">
adressjson = #{adressjson},
</if>
updated_at = NOW() updated_at = NOW()
</trim> </trim>

View File

@ -103,7 +103,7 @@
<i class="el-icon-loading"></i> 加载中... <i class="el-icon-loading"></i> 加载中...
</div> </div>
<span v-else-if="workerInfo">{{ workerInfo.phone || '未设置' }}</span> <span v-else-if="workerInfo">{{ workerInfo.phone || '未设置' }}</span>
<span v-else>{{ workerInfo.phone || '未设置' }}</span> <span v-else>{{ orderInfo.workerPhone || '未设置' }}</span>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="师傅等级"> <el-descriptions-item label="师傅等级">
<div v-if="loadingWorkerInfo" class="loading-info"> <div v-if="loadingWorkerInfo" class="loading-info">

View File

@ -208,11 +208,14 @@ export default {
handler(val) { handler(val) {
this.visibleInner = val this.visibleInner = val
if (val) { if (val) {
this.$nextTick(() => {
this.loadInspectionOptions() this.loadInspectionOptions()
})
} }
} }
}, },
workerId() { if (this.visibleInner) this.loadInspectionOptions() }, workerId() { if (this.visibleInner) this.loadInspectionOptions() },
orderId() { if (this.visibleInner) this.loadInspectionOptions() },
goodId() { if (this.visibleInner) this.loadInspectionOptions() } goodId() { if (this.visibleInner) this.loadInspectionOptions() }
}, },
computed: { computed: {
@ -239,14 +242,16 @@ export default {
}, },
methods: { methods: {
async loadInspectionOptions() { async loadInspectionOptions() {
if (!this.workerId || !this.goodId) { // goodId goodid
if (!this.goodId && !this.orderId) {
// //
return return
} }
try { try {
this.loadingInspections = true this.loadingInspections = true
const url = `api/worker/basic/project?id=${this.workerId}&goodid=${this.goodId}` const res = await request.get('/api/worker/basic/project', {
const res = await request.get(url) params: { id: this.orderId || undefined, goodid: this.goodId || undefined }
})
if (res && res.code === 200 && res.data && Array.isArray(res.data.basic)) { 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.inspectionOptions = res.data.basic.map((name, idx) => ({ id: idx + 1, name }))
this.selectedInspectionIds = [] this.selectedInspectionIds = []

View File

@ -2075,7 +2075,7 @@
<!-- 项目报价弹窗 --> <!-- 项目报价弹窗 -->
<ProjectQuoteDialog <ProjectQuoteDialog
:visible.sync="projectQuoteVisible" :visible.sync="projectQuoteVisible"
:orderId="currentOrderDetail.orderId" :orderId="currentOrderDetail.id"
:workerId="currentOrderDetail.workerId" :workerId="currentOrderDetail.workerId"
:goodId="currentOrderDetail.productId" :goodId="currentOrderDetail.productId"
@submit="handleProjectQuoteSubmit" @submit="handleProjectQuoteSubmit"