Authored by mali

二手获取支付时间bug

@@ -28,5 +28,5 @@ public interface BuyerOrderGoodsMapper { @@ -28,5 +28,5 @@ public interface BuyerOrderGoodsMapper {
28 28
29 List<BuyerOrderGoods> selectByOrderCodes(@Param("orderCodes") List<Long> orderCodes); 29 List<BuyerOrderGoods> selectByOrderCodes(@Param("orderCodes") List<Long> orderCodes);
30 30
31 - 31 + List<BuyerOrderGoods> selectOrderBySkups(@Param("skup") Integer skup);
32 } 32 }
@@ -178,4 +178,10 @@ @@ -178,4 +178,10 @@
178 </foreach> 178 </foreach>
179 </select> 179 </select>
180 180
  181 + <select id="selectOrderBySkups" resultMap="BaseResultMap">
  182 + select
  183 + <include refid="Base_Column_List" />
  184 + from buyer_order_goods
  185 + where skup = #{skup,jdbcType=INTEGER} order by id ASC
  186 + </select>
181 </mapper> 187 </mapper>
@@ -204,13 +204,12 @@ public class OrdersPayService { @@ -204,13 +204,12 @@ public class OrdersPayService {
204 204
205 205
206 public OrdersPay getOrderPayBySkup(Integer skup){ 206 public OrdersPay getOrderPayBySkup(Integer skup){
207 - ArrayList<Integer> skupList = Lists.newArrayList(skup);  
208 - List<BuyerOrderGoods> bogs= buyerOrderGoodsMapper.selectBySkups(skupList); 207 + List<BuyerOrderGoods> bogs= buyerOrderGoodsMapper.selectOrderBySkups(skup);
209 if(CollectionUtils.isEmpty(bogs)){ 208 if(CollectionUtils.isEmpty(bogs)){
210 logger.warn("getOrderPayBySkup empty list ,skup {}",skup); 209 logger.warn("getOrderPayBySkup empty list ,skup {}",skup);
211 return null; 210 return null;
212 } 211 }
213 - BuyerOrderGoods bog = bogs.get(0); 212 + BuyerOrderGoods bog = bogs.get(bogs.size() - 1);
214 return ordersPayMapper.selectOrdersPay(bog.getOrderCode(), bog.getUid()); 213 return ordersPayMapper.selectOrdersPay(bog.getOrderCode(), bog.getUid());
215 } 214 }
216 215