|
|
@@ -29,7 +29,9 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
@@ -59,7 +61,9 @@ public class LotController extends AdminBaseController {
|
|
|
|
|
|
startPage(lot);
|
|
|
List<Lot> lotList = lotService.selectLotList(lot);
|
|
|
+ Map<Long, Auction> auctionMap = new HashMap<>();
|
|
|
lotList.forEach(l -> {
|
|
|
+ fillAuctionFees(l, auctionMap);
|
|
|
l.setDelay(StringUtils.isEmpty(l.getDelayPublish()) ? 0 : 1);
|
|
|
if (Constants.LOT_STATUS_CANCELLED.equals(l.getStatus())) {
|
|
|
List<Bid> bids = bidMapper.selectBidListLimit(l.getId(), 1L);
|
|
|
@@ -72,6 +76,25 @@ public class LotController extends AdminBaseController {
|
|
|
return AjaxResult.successPage(lotList);
|
|
|
}
|
|
|
|
|
|
+ private void fillAuctionFees(Lot lot, Map<Long, Auction> auctionMap) {
|
|
|
+ if (Objects.isNull(lot) || Objects.isNull(lot.getAuctionId())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(lot.getDeposit()) && Objects.nonNull(lot.getServiceTariff())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Auction auction = auctionMap.computeIfAbsent(lot.getAuctionId(), auctionService::selectAuctionById);
|
|
|
+ if (Objects.isNull(auction)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (Objects.isNull(lot.getDeposit())) {
|
|
|
+ lot.setDeposit(auction.getDeposit());
|
|
|
+ }
|
|
|
+ if (Objects.isNull(lot.getServiceTariff())) {
|
|
|
+ lot.setServiceTariff(auction.getServiceTariff());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 新增保存拍品
|
|
|
*/
|