Explorar o código

根据拍卖会id拍品列表查询

linhui.li hai 3 semanas
pai
achega
3b4199ecbc

+ 6 - 0
auc/src/main/java/cn/hobbystocks/auc/web/LotController.java

@@ -85,6 +85,12 @@ public class LotController extends AdminBaseController {
 		if (System.currentTimeMillis()> dbAuction.getEndTime().getTime())
 			return AjaxResult.error("拍卖会已经结束");
 		//拍品结束时间不能小于拍卖会结束时间
+        //拍品开始时间不能大于拍卖会开始时间
+        if (lot.getStartTime().before(dbAuction.getStartTime())){
+            return AjaxResult.error("拍品开始时间不能小于拍卖会开始时间");
+        }
+        if (dbAuction.getEndTime().after(lot.getEndTime()))
+            return AjaxResult.error("拍品结束时间不能大于拍卖会结束时间");
 		lot.setMerchantId(userInfo.getMerchantId());
 		lot.setMerchantName(userInfo.getMerchantName());
 		lot.setMerchantAvatar(userInfo.getMerchantAvatar());

+ 1 - 0
lot/src/main/resources/mapper/LotMapper.xml

@@ -72,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             <if test="lot.name != null  and lot.name != ''"> and name like concat('%', #{lot.name}, '%')</if>
             <if test="lot.pubStatus != null "> and pub_status  = #{lot.pubStatus}</if>
+            <if test="auctionId!=null">and auction_id=#{auctionId}</if>
         </where>
         order by sort desc,id desc
     </select>