Authored by LUOXC

Merge branch 'hotfix-tradbill' into test6.9.16

... ... @@ -10,8 +10,10 @@ import com.yoho.order.model.SellerOrder;
* Created by caoyan on 2018/9/12.
*/
public interface SellerOrderMapper {
List<SellerOrder> selectBySkups(@Param("skupList") List<Integer> skupList);
SellerOrder selectBySkup(@Param("skup") Integer skup);
SellerOrder selectByOrderCode(@Param("orderCode") String orderCode);
}
... ...
... ... @@ -24,14 +24,19 @@
select <include refid="Base_Column_List" />
from seller_order where id = #{id}
</select>
<select id="selectBySkups" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from seller_order where id in
from seller_order where skup in
<foreach collection="skupList" item="skup" open="(" close=")" separator=",">
#{skup}
#{skup}
</foreach>
</select>
<select id="selectBySkup" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
from seller_order where skup = #{skup}
</select>
<select id="selectByOrderCode" resultMap="BaseResultMap">
select <include refid="Base_Column_List" />
... ...
... ... @@ -242,9 +242,8 @@ public class TradeBillsServiceImpl implements ITradeBillsService {
req.setOrderCode2(Optional.of(req.getOrderCode())
.map(e->buyerOrderGoodsMapper.selectByOrderCodeOne(e.toString()))
.map(e->e.getSkup())
.map(e->sellerOrderMapper.selectBySkups(Lists.newArrayList(e)))
.filter(CollectionUtils::isNotEmpty)
.map(e->e.get(0).getOrderCode())
.map(skup->sellerOrderMapper.selectBySkup(skup))
.map(sellerOrder->sellerOrder.getOrderCode())
.map(Long::valueOf)
.orElse(null));
}
... ...