Authored by sailing-PC\sailing

fix again

... ... @@ -36,5 +36,5 @@ public interface SellerOrderMapper {
* @param uid
* @return
*/
Integer selectOrderNumByUid(@Param("uid") int uid);
Integer selectOrderNumByUid(@Param("uid") int uid, @Param("statusList")Collection<Integer> statusList);
}
\ No newline at end of file
... ...
... ... @@ -219,5 +219,9 @@
<select id="selectOrderNumByUid" resultType="java.lang.Integer">
select count(*) from seller_order where uid = #{uid,jdbcType=INTEGER} and is_del = 1
and status in
<foreach collection="statusList" item="status" open="(" close=")" separator=",">
#{status,jdbcType=INTEGER}
</foreach>
</select>
</mapper>
\ No newline at end of file
... ...
... ... @@ -36,7 +36,7 @@ public enum SellerOrderListType {
),
ORDER_SUCCESS(5, "交易完成",
Arrays.asList(OrderStatus.WAITING_RECEIVE.getCode())
Arrays.asList(OrderStatus.WAITING_RECEIVE.getCode(),OrderStatus.DONE.getCode())
),
ORDER_FAILED(6, "交易失败",
... ...
... ... @@ -504,7 +504,7 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
*/
public OrderSummaryResp selectOrderNumByUid(int uid) {
//todo add cache
Integer num = sellerOrderMapper.selectOrderNumByUid(uid);
Integer num = sellerOrderMapper.selectOrderNumByUid(uid, Arrays.asList(SellerOrderStatus.HAS_PAYED.getCode()));
List<SellerOrderListType> types = Arrays.asList(SellerOrderListType.WAITING_SEND, SellerOrderListType.WAITING_PAY);
List<Integer> statusList = types.parallelStream().flatMap(solt -> solt.getStatus().parallelStream()).collect(Collectors.toList());
Integer buyerOrderNum = buyerOrderMapper.selectCntBySellerUid(uid, statusList);
... ...