xucaiqin 2 هفته پیش
والد
کامیت
1d1f07e7f1

+ 1 - 0
sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/RemoteContractService.java

@@ -74,6 +74,7 @@ public interface RemoteContractService {
      * @return
      */
     TradeContractGoodsDto queryTradeContractNew(Long entId, Long goodsId, LocalDateTime time);
+    List<Long> queryNewSignGoods(Long entId,  LocalDateTime time);
 
     /**
      * 查询签约的商品

+ 5 - 2
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dao/KwcContractTradeMapper.java

@@ -59,8 +59,11 @@ public interface KwcContractTradeMapper extends BaseMapper<KwcContractTrade> {
      * @param goodsId
      * @return
      */
-    TradeContractGoodsDto queryNewSignPrice(@Param("entId") Long entId, @Param("goodsId") Long goodsId, @Param("time")LocalDateTime time);
-    List<Long> querySignTradeContract(@Param("entId") Long entId,  @Param("time")LocalDateTime time);
+    TradeContractGoodsDto queryNewSignPrice(@Param("entId") Long entId, @Param("goodsId") Long goodsId, @Param("time") LocalDateTime time);
+
+    List<Long> queryNewSignGoods(@Param("entId") Long entId, @Param("time") LocalDateTime time);
+
+    List<Long> querySignTradeContract(@Param("entId") Long entId, @Param("time") LocalDateTime time);
 
     List<Long> selectByContract(@Param("contractId") Long contractId);
 }

+ 4 - 0
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dubbo/RemoteContractServiceImpl.java

@@ -280,6 +280,10 @@ public class RemoteContractServiceImpl implements RemoteContractService {
     public TradeContractGoodsDto queryTradeContractNew(Long entId, Long goodsId, LocalDateTime time) {
         return kwcContractTradeMapper.queryNewSignPrice(entId, goodsId, time);
     }
+   @Override
+    public List<Long> queryNewSignGoods(Long entId, LocalDateTime time) {
+        return kwcContractTradeMapper.queryNewSignGoods(entId,  time);
+    }
 
     @Override
     public List<Long> querySignTradeContract(Long entId, LocalDateTime time) {

+ 15 - 0
sckw-modules/sckw-contract/src/main/resources/mapper/KwcContractTradeMapper.xml

@@ -301,6 +301,21 @@
             limit 1
         </where>
     </select>
+    <select id="queryNewSignGoods" resultType="java.lang.Long">
+        select distinct b.goods_id
+        from kwc_contract_trade a
+                 left join kwc_contract_trade_goods b on a.id = b.contract_id and b.del_flag = 0
+                 left join kwc_contract_trade_unit c on a.id = c.contract_id and c.del_flag = 0
+        <where>
+            a.del_flag = 0
+              and a.status = 0
+              and c.unit_type = 2
+              and a.start_time &lt; #{time}
+              and (a.end_time &gt; #{time} OR a.end_time IS NULL)
+              and c.ent_id = #{entId}
+        </where>
+    </select>
+
     <select id="querySignTradeContract" resultType="java.lang.Long">
         select distinct b.goods_id
         from kwc_contract_trade a

+ 1 - 1
sckw-modules/sckw-product/src/main/java/com/sckw/product/service/KwpGoodsService.java

@@ -1026,7 +1026,7 @@ public class KwpGoodsService {
         Long entId = LoginUserHolder.getEntId();
         if (Objects.nonNull(entId)) {
             if (Objects.nonNull(params.getSign())) {//查询签约或未签约商品
-                List<Long> longs = tradeOrderInfoService.querySignGoods(LoginUserHolder.getEntId());
+                List<Long> longs = remoteContractService.queryNewSignGoods(entId, LocalDateTime.now());
                 if (Objects.equals(params.getSign(), 1)) {
                     if (CollUtil.isNotEmpty(longs)) {
                         wrapper.in(KwpGoods::getId, longs);