Commit 6d2f4fb9 by yancanhua

Merge branch 'v1.2.0' into v1.3.0

2 parents 62f24604 d3b9fadf
Showing 22 changed files with 116 additions and 13 deletions
......@@ -6,7 +6,6 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.glsx.usedcar.export.converter.ListConverter;
import com.glsx.usedcar.export.converter.VehicleStateConverter;
import com.glsx.usedcar.module.vehicle.entity.*;
import jakarta.persistence.Column;
import lombok.Data;
import java.time.LocalDate;
......@@ -214,6 +213,15 @@ public class VehicleBean {
@ColumnWidth(12)
private double reservePrice;
@ExcelProperty("是否开启固定佣金模式")
@ColumnWidth(18)
private String fixedCommissionSwitch;
@ExcelProperty("固定佣金")
@ColumnWidth(15)
private double fixedCommission;
@ExcelProperty("创建时间")
@ColumnWidth(15)
private LocalDateTime createTime;
......@@ -245,6 +253,8 @@ public class VehicleBean {
this.vehicleState = vehicle.getVehicleState();
this.startingBidPrice = vehicle.getStartingBidPrice();
this.reservePrice = vehicle.getReservePrice();
this.fixedCommissionSwitch = vehicle.getFixedCommissionSwitch() == null || vehicle.getFixedCommissionSwitch() == 0 ? "否" : "是";
this.fixedCommission = vehicle.getFixedCommission() == null ? 0 : vehicle.getFixedCommission();
BaseInfo baseInfo = vehicle.getBaseInfo();
......
......@@ -6,7 +6,7 @@
<link rel="icon" href="/favicon/favicon.ico" type="image/x-icon">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>专电优拍</title>
<script type="module" crossorigin src="https://aus.test.glsx.com.cn/assets/index-TuVIvskA.js"></script>
<script type="module" crossorigin src="https://aus.test.glsx.com.cn/assets/index-DaSGXT16.js"></script>
<link rel="stylesheet" crossorigin href="https://aus.test.glsx.com.cn/assets/index-CAAxcolk.css">
<!-- <script type="module" crossorigin src="https://aus.glsx.com.cn/assets/index-pxQEYXWe.js"></script>
<link rel="stylesheet" crossorigin href="https://aus.glsx.com.cn/assets/index-CAAxcolk.css"> -->
......
package com.glsx.usedcar.web.api.auction;
import com.alibaba.fastjson.JSON;
import com.glsx.usedcar.module.account.entity.Account;
import com.glsx.usedcar.module.account.entity.AccountTag;
import com.glsx.usedcar.module.account.service.AccountService;
......@@ -260,6 +261,7 @@ public class AuctionController {
public BaseResp<RealCalcCommissionPriceResp> realCalcCommissionPrice(@RequestBody @Valid RealCalcCommissionPriceReq req, @RequestAttribute(value = LOGIN_ACCOUNT, required = false) Account account) {
double result = auctionOrderService.realCalcCommissionPrice(req.getAucvehId(), account);
RealCalcCommissionPriceResp resp = RealCalcCommissionPriceResp.builder().commissionPrice(result).build();
log.info("实时计算当前拍卖车辆的佣金{} {}", req.getAucvehId(), JSON.toJSONString(resp));
return BaseResp.success(resp);
}
......
......@@ -66,6 +66,18 @@ public class AppraisePrice extends AuditingEntity implements Serializable {
private double referencePrice;
/**
* 固定佣金开关 0: 关闭 1: 开启
*/
@Column(nullable = true)
private Integer fixedCommissionSwitch;
/**
* 固定佣金
*/
@Column(nullable = true)
private Double fixedCommission;
/**
* 评估备注
*/
@Column(nullable = true, length = 255)
......
......@@ -54,6 +54,10 @@ public class AppraiseService extends AbstractAuctionService {
if (appraisePriceDao.existsByVehicleAndAuditState(appeal.getVehicle(), AuditState.UNAUDITED)) {
throw new FieldException("startingBidPrice", appeal.getStartingBidPrice(), "该车辆已有未审核的评估申请,请勿重复提交。");
}
int fixedCommissionSwitch = appeal.getFixedCommissionSwitch() == null ? 0 : appeal.getFixedCommissionSwitch();
Double fixedCommission = fixedCommissionSwitch == 1 ? appeal.getFixedCommission() : null;
appeal.setFixedCommission(fixedCommission);
appeal.setFixedCommissionSwitch(fixedCommissionSwitch);
Vehicle vehicle = vehicleDao.findById(appeal.getVehicle().getVehicleId()).orElseThrow();
appeal.setVehicle(vehicle);
BaseInfo baseInfo = vehicle.getBaseInfo();
......@@ -68,7 +72,9 @@ public class AppraiseService extends AbstractAuctionService {
NoticeField.APPRAISE_TIME, DateTimeUtils.DATE_TIME_NO_SECOND_FORMATTER.format(save.getCreateTime()),
NoticeField.RESERVE_PRICE, save.getReservePrice(),
NoticeField.STARTING_BID_PRICE, save.getStartingBidPrice(),
NoticeField.REFERENCE_PRICE, save.getReferencePrice()
NoticeField.REFERENCE_PRICE, save.getReferencePrice(),
NoticeField.FIXED_COMMISSION_SWITCH, save.getFixedCommissionSwitch() == 1 ? "是" : "否",
NoticeField.FIXED_COMMISSION, fixedCommission == null ? "无" : fixedCommission
));
return save;
}
......@@ -82,11 +88,14 @@ public class AppraiseService extends AbstractAuctionService {
if (vehicle.getVehicleState() == Vehicle.VehicleState.AUCTIONING) {
throw new FieldException("vehicleState", vehicle.getVehicleState(), "该车辆已在拍卖中,不能评估定价。");
}
int fixedCommissionSwitch = appraisePrice.getFixedCommissionSwitch() == null ? 0 : appraisePrice.getFixedCommissionSwitch();
double fixedCommission = fixedCommissionSwitch == 1 ? appraisePrice.getFixedCommission() : 0;
vehicle.setStartingBidPrice(appraisePrice.getStartingBidPrice());
vehicle.setReferencePrice(appraisePrice.getReferencePrice());
vehicle.setReservePrice(appraisePrice.getReservePrice());
vehicle.setAppraisalRemark(appraisePrice.getAppraisalRemark());
vehicle.setFixedCommissionSwitch(fixedCommissionSwitch);
vehicle.setFixedCommission(fixedCommission);
// 车辆状态变更为已定价
if (vehicle.getVehicleState() == Vehicle.VehicleState.TO_BE_PRICED) {
vehicle.setVehicleState(Vehicle.VehicleState.PRICED);
......
package com.glsx.usedcar.module.auction.service;
import com.alibaba.fastjson.JSON;
import com.glsx.usedcar.gsc.GscApiInvoker;
import com.glsx.usedcar.gsc.GscInvoker;
import com.glsx.usedcar.module.account.dao.AccountDao;
......@@ -20,6 +21,7 @@ import com.glsx.usedcar.module.vehicle.entity.Vehicle;
import com.glsx.usedcar.resp.BaseResp;
import com.glsx.usedcar.util.CoderGenerator;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.hibernate.ObjectNotFoundException;
import org.springframework.context.MessageSource;
......@@ -42,6 +44,7 @@ import java.util.*;
*
* @since 2025-10-13 12:18:11
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class AuctionOrderService extends AbstractAuctionService {
......@@ -341,6 +344,11 @@ public class AuctionOrderService extends AbstractAuctionService {
* @return
*/
private double calculateCommissionPrice(LocalDateTime now, Bid bid) {
AuctionVehicle auctionVehicle = bid.getAuctionVehicle();
Integer fixedCommissionSwitch = auctionVehicle.getVehicle().getFixedCommissionSwitch();
if (fixedCommissionSwitch == 1) {
return auctionVehicle.getVehicle().getFixedCommission();
}
Account account = bid.getAccount();
LocalDate today = now.toLocalDate();
double bidPrice = bid.getBidPrice();
......@@ -386,6 +394,7 @@ public class AuctionOrderService extends AbstractAuctionService {
double startingBidPrice = vehicle.getStartingBidPrice();
bid = new Bid();
bid.setBidPrice(startingBidPrice);
bid.setAuctionVehicle(auctionVehicle);
}
bid.setAccount(account);
return calculateCommissionPrice(LocalDateTime.now(), bid);
......@@ -410,6 +419,7 @@ public class AuctionOrderService extends AbstractAuctionService {
bid.setBidPrice(vehicle.getStartingBidPrice());
bid.setAccount(account);
bid.setCreateTime(LocalDateTime.now());
bid.setAuctionVehicle(auctionVehicle);
}
int bidResult = 0;
if (hasBid && bid.getBidPrice() >= vehicle.getReservePrice()) {
......@@ -425,6 +435,7 @@ public class AuctionOrderService extends AbstractAuctionService {
.price(price)
.bidResult(bidResult)
.build();
log.info("拍卖结束,获取拍卖结果{} {}", aucvehId, JSON.toJSONString(resp));
return BaseResp.success(resp);
}
}
\ No newline at end of file
package com.glsx.usedcar.module.auction.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.glsx.usedcar.module.auction.dao.AuctionDao;
import com.glsx.usedcar.module.auction.dao.AuctionVehicleDao;
import com.glsx.usedcar.module.auction.entity.*;
......@@ -328,6 +329,7 @@ public class LightAuctionPoollingBidService {
.reservePriceType(reservePriceType)
.bidPriceType(bidPriceType)
.build();
log.info("请求剩余时间和价格 {} {}", aucvehId, JSON.toJSONString(vo));
return BaseResp.success(vo);
} catch (Exception e) {
log.error("获取车辆竞拍时间价格异常", e);
......@@ -520,6 +522,7 @@ public class LightAuctionPoollingBidService {
}
result.setAucvehId(nextId);
result.setRemainSecond(remainSecond);
log.info("获取下一辆车拍卖信息:{}", JSON.toJSONString(result));
return result;
}
......
......@@ -21,6 +21,10 @@ public interface NoticeField {
String REFERENCE_PRICE = "{{基础参考价}}";
String FIXED_COMMISSION = "{{固定佣金}}";
String FIXED_COMMISSION_SWITCH = "{{固定佣金开关}}";
/***************2. 待办 - 拍场审批***************/
String AUCTION_NAME = "{{拍场名称}}";
......
......@@ -213,6 +213,18 @@ public class Vehicle extends AuditingEntity implements Serializable {
private double referencePrice;
/**
* 固定佣金开关 0: 关闭 1: 开启
*/
@Column(nullable = true)
private Integer fixedCommissionSwitch;
/**
* 固定佣金
*/
@Column(nullable = true)
private Double fixedCommission;
/**
* 评估备注
*/
@Column(nullable = true, length = 255)
......
......@@ -277,9 +277,10 @@ export default class AuctionForm extends FormComponent<Auction> {
},
{title: '车辆VIN码', dataIndex: ['vehicle', 'baseInfo', "vin"], key: 'vin', width: 170, resizable: true, ellipsis: true, sorter: false},
{title: '车牌号', dataIndex: ['vehicle', 'baseInfo', "licensePlate"], key: 'licensePlate', width: 130, resizable: true, ellipsis: true, sorter: false},
{title: '所属门店', dataIndex: ['vehicle', 'venue', 'venueName'], key: 'venueName', align: 'right', width: 130, resizable: true, ellipsis: true, sorter: false},
{title: '起拍价', dataIndex: ['vehicle', 'startingBidPrice'], key: 'startingBidPrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: false},
{title: '保留价', dataIndex: ['vehicle', 'reservePrice'], key: 'reservePrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: false},
{title: '所属门店', dataIndex: ['vehicle', 'venue', 'venueName'], key: 'venueName', align: 'center', width: 130, resizable: true, ellipsis: true, sorter: false},
{title: '起拍价', dataIndex: ['vehicle', 'startingBidPrice'], key: 'startingBidPrice', align: 'center', width: 100, resizable: true, ellipsis: true, sorter: false},
{title: '保留价', dataIndex: ['vehicle', 'reservePrice'], key: 'reservePrice', align: 'center', width: 100, resizable: true, ellipsis: true, sorter: false},
{title: '佣金金额', dataIndex: ['vehicle', 'fixedCommission'], key: 'fixedCommission', align: 'center', width: 100, resizable: true, ellipsis: true, sorter: false},
{title: '预展时间', dataIndex: 'previewStartTime', key: 'previewStartTime', align: 'center', fixed: 'right', width: 240, resizable: false, ellipsis: true, sorter: false},
{title: '起拍时间', dataIndex: 'auctionStartTime', key: 'auctionStartTime', align: 'center', fixed: 'right', width: 240, resizable: false, ellipsis: true, sorter: false},
{title: '拍卖结束时间', dataIndex: 'auctionEndTime', key: 'auctionEndTime', align: 'center', fixed: 'right', width: 240, resizable: false, ellipsis: true, sorter: false},
......
......@@ -85,6 +85,7 @@ export default class ViewAuction extends PaginationComponent<AuctionVehicle> {
{title: '最高价', dataIndex: 'highestPrice', key: 'highestPrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '起拍价', dataIndex: ['vehicle', 'startingBidPrice'], key: 'startingBidPrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '保留价', dataIndex: ['vehicle', 'reservePrice'], key: 'reservePrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '车辆佣金', dataIndex: ['vehicle', 'fixedCommission'], key: 'fixedCommission', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '参考价', dataIndex: ['vehicle', 'referencePrice'], key: 'referencePrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '拍卖状态', dataIndex: 'auctionState', key: 'auctionState', align: 'center', fixed: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
];
......
......@@ -107,6 +107,7 @@ export default class AuctionVehiclePage extends PaginationComponent<AuctionVehic
{title: '最高价', dataIndex: 'highestPrice', key: 'highestPrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '起拍价', dataIndex: ['vehicle', 'startingBidPrice'], key: 'startingBidPrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '保留价', dataIndex: ['vehicle', 'reservePrice'], key: 'reservePrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '佣金金额', dataIndex: ['vehicle', 'fixedCommission'], key: 'fixedCommission', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '参考价', dataIndex: ['vehicle', 'referencePrice'], key: 'referencePrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '拍卖状态', dataIndex: 'auctionState', key: 'auctionState', align: 'center', fixed: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '操作', key: 'action', width: 260, align: 'center', fixed: 'right'},
......
......@@ -19,6 +19,9 @@
<a-descriptions-item label="保留价" name="referencePrice">
¥{{ appraisePrice.reservePrice }}元
</a-descriptions-item>
<a-descriptions-item label="车辆佣金" name="referencePrice">
¥{{ appraisePrice.fixedCommission || '-' }}元
</a-descriptions-item>
</a-descriptions>
<a-divider>审批记录</a-divider>
<approve-history-timeline approve-type="APPRAISE_PRICE" :approve-id="appraisePrice.appraiseId" :create-time="appraisePrice.createTime"
......
......@@ -18,6 +18,12 @@
:rules="[{ required: true, message: '请输入保留价!' },{validator: verifyReservePrice,message: '保留价必须不小于起拍价'}]">
<a-input-number v-model:value="formState.reservePrice" addon-after="元" :min="0" :max="99999999" :maxlength="8" placeholder="请输入保留价"/>
</a-form-item>
<a-form-item label="自定义佣金" name="fixedCommissionSwitch">
<a-switch v-model:checked="formState.fixedCommissionSwitch" />
</a-form-item>
<a-form-item v-if="formState.fixedCommissionSwitch" label="固定佣金" name="fixedCommission" :rules="[{ required: true, message: '请输入金额' }]">
<a-input-number v-model:value="formState.fixedCommission" addon-after="元" :min="0" :max="100000" :maxlength="6" placeholder="请输入金额"/>
</a-form-item>
<a-form-item label="评估备注" name="appraisalRemark" :rules="[{max: 120, message: '最多不能超过120个字符!' },]">
<a-textarea v-model:value="formState.appraisalRemark" rows="6" placeholder="请输入评估备注"/>
</a-form-item>
......@@ -54,6 +60,9 @@ export default class AppraisePriceForm extends EnhanceFormComponent<AppraisePric
});
this.formState = reactive<AppraisePrice>(new AppraisePrice());
this.formState.referencePrice = 0;
this.formState.fixedCommissionSwitch = this.formState.fixedCommissionSwitch == 1 ? true : false;
this.formState.fixedCommission = this.formState.fixedCommission || 0;
PriceRuleController.getReferencePriceByVehicleId(this.axios, this.vehicle.vehicleId).then(res => {
this.formState.referencePrice = res.data;
// if (this.formState.referencePrice <= 0) {
......@@ -101,7 +110,7 @@ export default class AppraisePriceForm extends EnhanceFormComponent<AppraisePric
onValidSuccess(formValue: AppraisePrice): void {
formValue.vehicle = this.vehicle;
AppraiseController.addAppraisePrice(this.axios, formValue).then(res => {
AppraiseController.addAppraisePrice(this.axios, { ...formValue, fixedCommissionSwitch: formValue.fixedCommissionSwitch ? 1 : 0 }).then(res => {
message.success('提交成功');
this.$emit('handleOk', res.data);
}).finally(() => this.submitted = false);
......
......@@ -76,6 +76,7 @@ export default class AppraiseVehiclePage extends PaginationComponent<AppraisePri
title: "定价方案", children: [
{title: '申请起拍价', dataIndex: 'startingBidPrice', key: 'startingBidPrice', align: 'right', width: 110, resizable: true, ellipsis: true, sorter: true},
{title: '申请保留价', dataIndex: 'reservePrice', key: 'reservePrice', align: 'right', width: 110, resizable: true, ellipsis: true, sorter: true},
{title: '佣金金额', dataIndex: 'fixedCommission', key: 'fixedCommission', align: 'right', width: 110, resizable: true, ellipsis: true, sorter: true},
]
},
{
......
......@@ -12,6 +12,10 @@
<audit-state-tag :audit-state="record.auditState"></audit-state-tag>
</template>
<template v-if="column.key === 'fixedCommission'">
{{ record.fixedCommission || '-' }}
</template>
</template>
<!--库存车辆列表end-->
</a-table>
......@@ -54,6 +58,7 @@ export default class AppraiseVehicleTable extends Vue {
}
},
{title: '评估人', dataIndex: ['user', 'realName'], key: 'realName', width: 120, resizable: true, ellipsis: true, sorter: true},
{title: '佣金金额', dataIndex: 'fixedCommission', key: 'fixedCommission', width: 130, resizable: true, ellipsis: true, sorter: true},
{title: '评估备注', dataIndex: 'appraisalRemark', key: 'appraisalRemark', resizable: true, ellipsis: true, sorter: true},
{title: '提交时间', dataIndex: 'createTime', key: 'createTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: true},
{title: '评估时间', dataIndex: 'updateTime', key: 'updateTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: true},
......
......@@ -76,6 +76,7 @@ export default class AuctionVehiclePage extends PaginationComponent<Vehicle> {
vehicleBaseInfoColumns,
{title: '起拍价', dataIndex: 'startingBidPrice', key: 'startingBidPrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '保留价', dataIndex: 'reservePrice', key: 'reservePrice', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '佣金金额', dataIndex: 'fixedCommission', key: 'fixedCommission', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '状态', dataIndex: 'vehicleState', key: 'vehicleState', align: 'center', fixed: 'right', width: 100, resizable: true, ellipsis: true, sorter: true},
{title: '操作', key: 'action', width: 100, align: 'center', fixed: 'right'},
];
......
......@@ -62,6 +62,11 @@ export default class VehiclePicker extends PaginationComponent<Vehicle> {
return '¥' + text;
}
},
{title: '佣金金额', dataIndex: 'fixedCommission', key: 'fixedCommission', align: 'right', width: 100, resizable: true, ellipsis: true, sorter: true,
customRender: ({text, record, index, column}) => {
return text ? '¥' + text : '-';
}
},
];
/**
......
......@@ -41,7 +41,7 @@
<image :src="item.url" mode="aspectFill" class="car-image"/>
</swiper-item>
</swiper>
<!-- <view class="auction-rule" @click="navigateToAgreement($event)">拍卖规则</view> -->
<view class="auction-rule" @click="navigateToAgreement('commission')">佣金规则</view>
<view class="favorite-count" v-if="favoriteCount>0">有{{ favoriteCount }}位用户收藏了这台车</view>
<view class="image-count">{{ currentImageIndex + 1 }}/{{ albums.length }}</view>
</view>
......
......@@ -285,10 +285,11 @@ export default class roundBidBottom extends Vue {
if (!data.checkResult) {
this.pageState = 'NOTOPUP';
} else {
if ((this.auctionVehicle.vehicle.vehicleState || this.auctionVehicle.auctionState) == 'PREVIEW') { //预展中
const vehicleStateData = this.auctionVehicle.vehicle.vehicleState || this.auctionVehicle.auctionState;
if (vehicleStateData == 'PREVIEW' || vehicleStateData == 'WAIT_AUCTION') { //预展中
this.pageState = 'PREVIEW';
this.getAuctionVehicleDetail();
} else if ((this.auctionVehicle.vehicle.vehicleState || this.auctionVehicle.auctionState) == 'AUCTIONING') { //竞拍中
} else if (vehicleStateData == 'AUCTIONING') { //竞拍中
this.pageState = 'AUCTIONING';
this.getBidRemainSecData();
} else { //竞拍已结束SOLD
......@@ -304,7 +305,7 @@ export default class roundBidBottom extends Vue {
const that = this;
AuctionController.getAuctionVehicleDetailById(this.axios, this.auctionVehicle.aucvehId).then(res => {
const data = res.data || {};
if (data.auctionState == 'PREVIEW') { //预展中
if (data.auctionState == 'PREVIEW' || data.auctionState == 'WAIT_AUCTION') { //预展中
this.pageState = 'PREVIEW';
const pages = getCurrentPages();
const currentPage = pages[pages.length - 1];
......
<template>
<view class="page-content">
<view class="content-container">
<view v-if="agreementKey =='commission'">
<web-view src="https://img02.glsx.com.cn/aus/images/yongjinxieyi.html"></web-view>
</view>
<view v-else class="content-container">
<rich-text class="content-text" :nodes="htmlContent"></rich-text>
</view>
</view>
......
......@@ -43,5 +43,14 @@ export class AppraisePrice extends AuditingEntity {
// region 前端扩展定义属性及方法区
// endregion
/**
* 固定佣金开关
*/
fixedCommissionSwitch: number;
/**
* 固定佣金
*/
fixedCommission: number;
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!