Commit 905c6394 by 章家宝

Merge remote-tracking branch 'origin/main' into v1.1.0

2 parents 2b77d448 bbf5444a
...@@ -111,8 +111,20 @@ public class AuctionController { ...@@ -111,8 +111,20 @@ public class AuctionController {
*/ */
@PostMapping("pageRandomAuctionVehicle") @PostMapping("pageRandomAuctionVehicle")
public Page<AuctionVehicle> pageRandomAuctionVehicle(@RequestBody Pagination<AuctionVehicle> pagination, @RequestAttribute(value = LOGIN_ACCOUNT, required = false) Account account) { public Page<AuctionVehicle> pageRandomAuctionVehicle(@RequestBody Pagination<AuctionVehicle> pagination, @RequestAttribute(value = LOGIN_ACCOUNT, required = false) Account account) {
pagination.addFetch(root -> root.fetch(AuctionVehicle_.vehicle, JoinType.LEFT));
String cityCode = (String) pagination.getDataValue("cities"); String cityCode = (String) pagination.getDataValue("cities");
// 已审核的拍卖场次
pagination.addFilter(List.of(Auction.AuctionState.PREVIEW, Auction.AuctionState.AUCTIONING), Operator.in, AuctionVehicle_.auctionState);
// 查询用户所有的标签
List<AccountTag> accountTags = null;
if (Objects.nonNull(account)) {
accountTags = accountService.getAccountTagsByAccount(account);
}
if (CollectionUtils.isEmpty(accountTags)) {
pagination.addFilter(Auction.AccessScope.GLOBAL, AuctionVehicle_.auction, Auction_.accessScope);
pagination.addCondition((root, query, builder) -> { pagination.addCondition((root, query, builder) -> {
// root.fetch(AuctionVehicle_.auction, JoinType.LEFT);
Expression<Double> randomExp = builder.function("RAND", Double.class); // MySQL 用 RAND() Expression<Double> randomExp = builder.function("RAND", Double.class); // MySQL 用 RAND()
if (StringUtils.hasText(cityCode)) { if (StringUtils.hasText(cityCode)) {
CriteriaBuilder.Case<Number> caseExpr = builder.selectCase(); CriteriaBuilder.Case<Number> caseExpr = builder.selectCase();
...@@ -121,10 +133,30 @@ public class AuctionController { ...@@ -121,10 +133,30 @@ public class AuctionController {
} else { } else {
query.orderBy(builder.asc(randomExp)); // 按随机值升序(或降序,效果相同) query.orderBy(builder.asc(randomExp)); // 按随机值升序(或降序,效果相同)
} }
return null; // 无过滤条件,返回所有数据并随机排序 return null; // 无过滤条件,返回所有数据并随机排序
}); });
return pageAuctionVehicle(pagination, account); } else {
List<AccountTag> finalAccountTags = accountTags;
pagination.addCondition((root, query, builder) -> {
// root.fetch(AuctionVehicle_.auction, JoinType.LEFT);
// 关联AccountTag(左连接,确保有角色关联的用户被筛选)
Join auctionJoin = root.join(AuctionVehicle_.auction, JoinType.LEFT);
Join<Auction, AccountTag> tagsJoin = auctionJoin.join(Auction_.accountTags, JoinType.LEFT);
Predicate tagsIn = tagsJoin.in(finalAccountTags);
// query.distinct(true); // 去重
Expression<Double> randomExp = builder.function("RAND", Double.class); // MySQL 用 RAND()
if (StringUtils.hasText(cityCode)) {
CriteriaBuilder.Case<Number> caseExpr = builder.selectCase();
caseExpr.when(builder.like(auctionJoin.get(Auction_.cities), "%" + cityCode + "%"), 1).otherwise(0);
query.orderBy(builder.desc(caseExpr), builder.asc(randomExp)); // 按随机值升序(或降序,效果相同)
} else {
query.orderBy(builder.asc(randomExp)); // 按随机值升序(或降序,效果相同)
}
return builder.or(builder.equal(auctionJoin.get(Auction_.accessScope), Auction.AccessScope.GLOBAL), tagsIn);
});
}
return auctionService.pageAuctionVehicle(pagination);
} }
/** /**
...@@ -156,7 +188,8 @@ public class AuctionController { ...@@ -156,7 +188,8 @@ public class AuctionController {
List<AccountTag> finalAccountTags = accountTags; List<AccountTag> finalAccountTags = accountTags;
pagination.addCondition((root, query, builder) -> { pagination.addCondition((root, query, builder) -> {
// 关联AccountTag(左连接,确保有角色关联的用户被筛选) // 关联AccountTag(左连接,确保有角色关联的用户被筛选)
Join<Auction, AccountTag> tagsJoin = root.join(AuctionVehicle_.auction, JoinType.LEFT).join(Auction_.accountTags, JoinType.LEFT); Join auctionJoin = root.join(AuctionVehicle_.auction, JoinType.LEFT);
Join<Auction, AccountTag> tagsJoin = auctionJoin.join(Auction_.accountTags, JoinType.LEFT);
Predicate tagsIn = tagsJoin.in(finalAccountTags); Predicate tagsIn = tagsJoin.in(finalAccountTags);
query.distinct(true); // 去重 query.distinct(true); // 去重
return builder.or(builder.equal(root.get(AuctionVehicle_.auction).get(Auction_.accessScope), Auction.AccessScope.GLOBAL), tagsIn); return builder.or(builder.equal(root.get(AuctionVehicle_.auction).get(Auction_.accessScope), Auction.AccessScope.GLOBAL), tagsIn);
......
...@@ -200,7 +200,7 @@ public class ContractService { ...@@ -200,7 +200,7 @@ public class ContractService {
return contractDb; return contractDb;
} }
AuctionOrder auctionOrder = auctionOrderDao.findByOrderId(orderId);//订单不存在 AuctionOrder auctionOrder = auctionOrderDao.findByOrderId(orderId);//订单不存在
String contactName = auctionOrder.getVehicle().getBaseInfo().getCarTypeName() + "_" + auctionOrder.getAccount().getMobile(); String contactName = auctionOrder.getVehicle().getBaseInfo().getCarTypeName() + "_" + auctionOrder.getAccount().getAccountName();
if (templateType == ContractTemplate.TemplateType.AUCTION) { if (templateType == ContractTemplate.TemplateType.AUCTION) {
contactName = contactName + "拍卖成交确认合同"; contactName = contactName + "拍卖成交确认合同";
} else if (templateType == ContractTemplate.TemplateType.DELIVERY) { } else if (templateType == ContractTemplate.TemplateType.DELIVERY) {
......
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
<!-- 审核过户资料--> <!-- 审核过户资料-->
<a-button type="link" v-if="record.orderState==='TRANSFERRING'&&record.auditState==='UNAUDITED'" size="small" @click="auditAuctionOrder(record)">审核</a-button> <a-button type="link" v-if="record.orderState==='TRANSFERRING'&&record.auditState==='UNAUDITED'" size="small" @click="auditAuctionOrder(record)">审核</a-button>
<a-button type="link" disabled v-if="record.orderState==='TRANSFERRING'&&!record.auditState" size="small">未提交过户资料</a-button> <a-button type="link" disabled v-if="record.orderState==='TRANSFERRING'&&!record.auditState" size="small">未提交过户资料</a-button>
<router-link v-if="record.orderState!=='COMPLETED'&&record.orderState!=='CANCELED'" :to="{path:'/account/view',query:{accountId:record.account.accountId}}">
<a-button type="link" v-if="record.orderState==='COMPLETED'" size="small" @click="viewTransferring(record)">过户资料</a-button>
<router-link :to="{path:'/account/view',query:{accountId:record.account.accountId}}">
<a-button type="link" size="small">联系买家</a-button> <a-button type="link" size="small">联系买家</a-button>
</router-link> </router-link>
...@@ -60,6 +62,7 @@ import {ExportUtil} from "@/common/ExportUtil"; ...@@ -60,6 +62,7 @@ import {ExportUtil} from "@/common/ExportUtil";
import {Security} from "@/store"; import {Security} from "@/store";
import {Auction} from "lib/src/entity/auction/entity/Auction"; import {Auction} from "lib/src/entity/auction/entity/Auction";
import OrderTransactionAuditBtn from "@/views/auction/order/OrderTransactionAuditBtn.vue"; import OrderTransactionAuditBtn from "@/views/auction/order/OrderTransactionAuditBtn.vue";
import TransferAuctionOrder from "@/views/auction/order/TransferAuctionOrder.vue";
@Component({ @Component({
components: { components: {
...@@ -231,6 +234,21 @@ export default class AuctionOrderPage extends PaginationComponent<AuctionOrder> ...@@ -231,6 +234,21 @@ export default class AuctionOrderPage extends PaginationComponent<AuctionOrder>
}); });
} }
viewTransferring(auctionOrder: AuctionOrder): void {
this.selectedAuctionOrder = auctionOrder;
const modal = ModalService.confirm({
title: '过户资料', component: TransferAuctionOrder, closable: true, appContext: this.$.appContext,
props: {
auctionOrder: auctionOrder
},
emits: {
handleOk: (e) => {
modal.destroy();
}
},
});
}
downloadExcel(): void { downloadExcel(): void {
this.exporting = true; this.exporting = true;
AuctionOrderController.exportAuctionOrder(this.axios, this.pagination.requestParams, {responseType: 'blob'}).then(response => { AuctionOrderController.exportAuctionOrder(this.axios, this.pagination.requestParams, {responseType: 'blob'}).then(response => {
......
<template>
<title-divider title="机动车登记证书"></title-divider>
<a-image-preview-group>
<a-image :width="120" v-for="image in auctionOrder.registrationCertificate" :src="image.url" :key="image.uid"/>
</a-image-preview-group>
<div class="mb-12"></div>
<title-divider title="新的机动车行驶证"></title-divider>
<a-image-preview-group>
<a-image :width="120" v-for="image in auctionOrder.vehicleLicense" :src="image.url" :key="image.uid"/>
</a-image-preview-group>
<a-descriptions v-if="auctionOrder" :column="3" size="small" class="mt-16">
<a-descriptions-item label="新车牌号" name="newPlateNumber">
{{ auctionOrder.newPlateNumber }}
</a-descriptions-item>
</a-descriptions>
</template>
<script lang="ts">
import {Component, Prop, Vue} from "vue-facing-decorator";
import TitleDivider from "@/components/TitleDivider.vue";
import {AuctionOrder} from "lib/src/entity/auction/entity/AuctionOrder";
@Component({
components: {TitleDivider}
})
export default class TransferAuctionOrder extends Vue {
@Prop({required: true})
auctionOrder: AuctionOrder;
created(): void {
}
}
</script>
<style lang="less" scoped>
</style>
...@@ -119,10 +119,10 @@ export default class AuctionSessionPage extends AuctionVehicleFilter { ...@@ -119,10 +119,10 @@ export default class AuctionSessionPage extends AuctionVehicleFilter {
@Hook('onShareAppMessage') @Hook('onShareAppMessage')
onShareAppMessage(res: any) { onShareAppMessage(res: any) {
console.debug('分享来源:', res.from); console.debug('分享来源:', res.from);
const title = `优加车拍 ${this.auction.auctionName}`; const title = `${this.auction.auctionName}`;
return { return {
title: title, title: title,
path: '/module/auction/AuctionSessionPage?actionId='+this.auctionId, path: '/module/auction/AuctionSessionPage?auctionId=' + this.auctionId,
imageUrl: 'https://dj-oss-fastdfs-release.oss-cn-shenzhen.aliyuncs.com/auction/f0e4f6add8afa743af09294e791c2f9b.png', // 分享图片(建议尺寸 5:4,默认使用页面截图) imageUrl: 'https://dj-oss-fastdfs-release.oss-cn-shenzhen.aliyuncs.com/auction/f0e4f6add8afa743af09294e791c2f9b.png', // 分享图片(建议尺寸 5:4,默认使用页面截图)
}; };
} }
......
...@@ -823,7 +823,7 @@ export default class AuctionVehiclePage extends Vue { ...@@ -823,7 +823,7 @@ export default class AuctionVehiclePage extends Vue {
onShareTimeline() { onShareTimeline() {
const title = `【${this.vehicle.ownership.carCityName}】 ${this.vehicle.baseInfo.carSeriesName} ${this.vehicle.baseInfo.carTypeName}`; const title = `【${this.vehicle.ownership.carCityName}】 ${this.vehicle.baseInfo.carSeriesName} ${this.vehicle.baseInfo.carTypeName}`;
return { return {
title: `朋友圈分享:${title}`, title: title,
query: `id=${this.auctionVehicle.aucvehId}`, // 分享参数 query: `id=${this.auctionVehicle.aucvehId}`, // 分享参数
imageUrl: this.vehicle.cover?.url imageUrl: this.vehicle.cover?.url
}; };
......
# 更新日志 0127
# 优化部分用户体验
# 更新日志 0203
# 优化部分用户体验
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!