Commit 0c5e8488 by 刘宇峰

创建订单时异步子订单处理、修复商品差价范围查询

1 parent fb762e15
...@@ -15,6 +15,7 @@ import com.glsx.plat.common.utils.DateUtils; ...@@ -15,6 +15,7 @@ import com.glsx.plat.common.utils.DateUtils;
import com.glsx.plat.common.utils.SnowFlake; import com.glsx.plat.common.utils.SnowFlake;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example; import tk.mybatis.mapper.entity.Example;
...@@ -104,9 +105,9 @@ public class OrderChildService { ...@@ -104,9 +105,9 @@ public class OrderChildService {
* @author huangch * @author huangch
* @date 2023/4/12 15:00 * @date 2023/4/12 15:00
*/ */
// @Async @Async
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public List<OrderChild> createOrderChild(String tparOrderCode, String parentOrderCode) { public List<OrderChildOrderDetailItem> createOrderChild(String tparOrderCode, String parentOrderCode) {
QueryOrderDetailResponse orderDetail = cloudCraneService.queryOrderDetail(QueryOrderDetailRequest.builder().parentOrderCode(parentOrderCode).build()); QueryOrderDetailResponse orderDetail = cloudCraneService.queryOrderDetail(QueryOrderDetailRequest.builder().parentOrderCode(parentOrderCode).build());
...@@ -165,7 +166,7 @@ public class OrderChildService { ...@@ -165,7 +166,7 @@ public class OrderChildService {
} }
orderChildMapper.insertList(orderChildList); orderChildMapper.insertList(orderChildList);
orderChildGoodsMapper.insertList(orderChildGoodsList); orderChildGoodsMapper.insertList(orderChildGoodsList);
return orderChildList; return orderDetail.getChildOrderList();
} }
public void updateOrderChildByExample(List<OrderChild> orderClidList) { public void updateOrderChildByExample(List<OrderChild> orderClidList) {
......
...@@ -138,16 +138,19 @@ ...@@ -138,16 +138,19 @@
and sg.sell_price &gt;= #{startSellPrice} and sg.sell_price &gt;= #{startSellPrice}
</if> </if>
<if test="endSellPrice != null"> <if test="endSellPrice != null">
and sg.sell_price &lt; #{endSellPrice} and sg.sell_price &lt;= #{endSellPrice}
</if> </if>
<if test="startMarketPrice != null"> <if test="startMarketPrice != null">
and sg.market_price &gt;= #{startMarketPrice} and sg.market_price &gt;= #{startMarketPrice}
</if> </if>
<if test="endMarketPrice != null"> <if test="endMarketPrice != null">
and sg.market_price &lt; #{endMarketPrice} and sg.market_price &lt;= #{endMarketPrice}
</if> </if>
<if test="startDiffPrice != null and endDiffPrice != null"> <if test="startDiffPrice != null">
and (sg.market_price-sg.sell_price) between #{startDiffPrice} and #{endDiffPrice} and (sg.market_price-sg.sell_price) &gt;= #{startDiffPrice}
</if>
<if test="endDiffPrice != null">
and (sg.market_price-sg.sell_price) &lt;= #{endDiffPrice}
</if> </if>
<if test="shelvesStatus != null"> <if test="shelvesStatus != null">
and sg.shelves_status = #{shelvesStatus} and sg.shelves_status = #{shelvesStatus}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!