filter in-stock of seller order goods num
Showing
4 changed files
with
17 additions
and
6 deletions
@@ -46,7 +46,9 @@ public interface SellerOrderGoodsMapper { | @@ -46,7 +46,9 @@ public interface SellerOrderGoodsMapper { | ||
46 | */ | 46 | */ |
47 | int selectCntByUidStatusGBBNList(@Param("uid")int uid, @Param("statusList") List<Integer> statusList); | 47 | int selectCntByUidStatusGBBNList(@Param("uid")int uid, @Param("statusList") List<Integer> statusList); |
48 | 48 | ||
49 | - int selectCntByUidStatusList(@Param("uid")int uid, @Param("statusList") List<Integer> statusList); | 49 | + int selectCntByUidStatusList(@Param("uid")int uid, |
50 | + @Param("statusList") List<Integer> statusList, | ||
51 | + @Param("orderTypes")List<Integer> orderTypes); | ||
50 | 52 | ||
51 | 53 | ||
52 | FastDeliveryGetShelfDetailResp selectMultiInfoBySkup(@Param("uid")int uid, | 54 | FastDeliveryGetShelfDetailResp selectMultiInfoBySkup(@Param("uid")int uid, |
@@ -144,10 +144,17 @@ | @@ -144,10 +144,17 @@ | ||
144 | #{status, jdbcType=TINYINT} | 144 | #{status, jdbcType=TINYINT} |
145 | </foreach> | 145 | </foreach> |
146 | </if> | 146 | </if> |
147 | + <if test="orderTypes != null"> | ||
148 | + and attributes in | ||
149 | + <foreach collection="orderTypes" item="attributes" open="(" close=")" separator=","> | ||
150 | + #{attributes} | ||
151 | + </foreach> | ||
152 | + </if> | ||
147 | </sql> | 153 | </sql> |
148 | 154 | ||
149 | <select id="selectCntByUidStatusList" resultType="java.lang.Integer"> | 155 | <select id="selectCntByUidStatusList" resultType="java.lang.Integer"> |
150 | - select count(*) from seller_order_goods where <include refid="sql_where_4_select_UidStatusList"/> | 156 | + select count(*) from seller_order_goods where |
157 | + <include refid="sql_where_4_select_UidStatusList"/> | ||
151 | </select> | 158 | </select> |
152 | 159 | ||
153 | <select id="selectCntByUid" resultType="java.lang.Integer"> | 160 | <select id="selectCntByUid" resultType="java.lang.Integer"> |
@@ -111,8 +111,9 @@ public class SellerOrderViewService { | @@ -111,8 +111,9 @@ public class SellerOrderViewService { | ||
111 | 111 | ||
112 | Integer cnt = orderCacheService.getOrderSummary(uid, TabType.SELL, businessClient); | 112 | Integer cnt = orderCacheService.getOrderSummary(uid, TabType.SELL, businessClient); |
113 | if (cnt == null) { | 113 | if (cnt == null) { |
114 | - | ||
115 | - Integer num = sellerOrderGoodsMapper.selectCntByUidStatusList(uid, Arrays.asList(SkupStatus.CAN_SELL.getCode())); | 114 | + final BusinessClientEnum bce = OrderAssist.findBusinessClient(businessClient); |
115 | + List<Integer> orderTypes = OrderAssist.matchOrderTypesByBusinessClient(bce); | ||
116 | + Integer num = sellerOrderGoodsMapper.selectCntByUidStatusList(uid, Arrays.asList(SkupStatus.CAN_SELL.getCode()), orderTypes); | ||
116 | List<SellerOrderListType> types = Arrays.asList(SellerOrderListType.SEND_OUT, SellerOrderListType.WAITING_PAY); | 117 | List<SellerOrderListType> types = Arrays.asList(SellerOrderListType.SEND_OUT, SellerOrderListType.WAITING_PAY); |
117 | List<Integer> statusList = types.parallelStream().flatMap(solt -> solt.getStatus().parallelStream()).collect(Collectors.toList()); | 118 | List<Integer> statusList = types.parallelStream().flatMap(solt -> solt.getStatus().parallelStream()).collect(Collectors.toList()); |
118 | Integer buyerOrderNum = buyerOrderMapper.selectCntBySellerUid(uid, statusList); | 119 | Integer buyerOrderNum = buyerOrderMapper.selectCntBySellerUid(uid, statusList); |
@@ -140,9 +141,10 @@ public class SellerOrderViewService { | @@ -140,9 +141,10 @@ public class SellerOrderViewService { | ||
140 | final String actor = TabType.SELL.getValue(); | 141 | final String actor = TabType.SELL.getValue(); |
141 | //not hit in cache | 142 | //not hit in cache |
142 | if (CollectionUtils.isEmpty(list)) { | 143 | if (CollectionUtils.isEmpty(list)) { |
144 | + List<Integer> orderTypes = OrderAssist.matchOrderTypesByBusinessClient(bce); | ||
143 | list = new ArrayList<>(8); | 145 | list = new ArrayList<>(8); |
144 | SellerOrderListType insale = SellerOrderListType.IN_SALE; | 146 | SellerOrderListType insale = SellerOrderListType.IN_SALE; |
145 | - int num = sellerOrderGoodsMapper.selectCntByUidStatusList(uid, Arrays.asList(SkupStatus.CAN_SELL.getCode())); | 147 | + int num = sellerOrderGoodsMapper.selectCntByUidStatusList(uid, Arrays.asList(SkupStatus.CAN_SELL.getCode()), orderTypes); |
146 | OrderSummaryResp sellerGoodsSummary = new OrderSummaryResp(actor, insale.getType(), num); | 148 | OrderSummaryResp sellerGoodsSummary = new OrderSummaryResp(actor, insale.getType(), num); |
147 | list.add(sellerGoodsSummary); | 149 | list.add(sellerGoodsSummary); |
148 | // | 150 | // |
@@ -64,7 +64,7 @@ public class SkupService { | @@ -64,7 +64,7 @@ public class SkupService { | ||
64 | */ | 64 | */ |
65 | public int getCanSellSkupBySellerUid(Integer uid){ | 65 | public int getCanSellSkupBySellerUid(Integer uid){ |
66 | logger.info("in seller order getCanSellSkupBySellerUid count uid {} ", uid); | 66 | logger.info("in seller order getCanSellSkupBySellerUid count uid {} ", uid); |
67 | - Integer total = sellerOrderGoodsMapper.selectCntByUidStatusList(uid, Arrays.asList(SkupStatus.CAN_SELL.getCode())); | 67 | + Integer total = sellerOrderGoodsMapper.selectCntByUidStatusList(uid, Arrays.asList(SkupStatus.CAN_SELL.getCode()), null); |
68 | logger.info("in seller order getCanSellSkupBySellerUid count uid {}, total {} ", uid, total); | 68 | logger.info("in seller order getCanSellSkupBySellerUid count uid {}, total {} ", uid, total); |
69 | return total; | 69 | return total; |
70 | } | 70 | } |
-
Please register or login to post a comment