@@ -29,10 +29,7 @@ import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import java.util.stream.Collectors;
/**
@@ -147,7 +144,7 @@ public class ChannelGoodsController extends BaseApiController {
int totalVerQuantity = value.stream().mapToInt(ChannelGoods::getVerifyQty).sum();
int remainTotalQuantity = value.stream().mapToInt(ChannelGoodsVO::getRemainQty).sum();
List<ChannelGoodsVO> NoSettleGoods = value.stream().filter(g -> ChannelGoodsSettleStatusTypeEnum.NO.equals(g.getStatus())).collect(Collectors.toList());
- int deepQuantity = NoSettleGoods.stream().mapToInt(ChannelGoods::getRemainQty).min().getAsInt();
+ int deepQuantity = NoSettleGoods.stream().mapToInt(ChannelGoods::getRemainQty).min().orElse(0);
channelGoodsVO.setTotalQuantity(totalQuantity);
channelGoodsVO.setTotalVerQuantity(totalVerQuantity);
channelGoodsVO.setRemainTotalQuantity(remainTotalQuantity);
@@ -7,7 +7,6 @@ import com.qs.mp.channel.domain.ChannelGoodsOrder;
import com.qs.mp.channel.domain.ChannelGoodsSettleOrder;
import com.qs.mp.channel.domain.ChannelGoodsSettleOrderItem;
import com.qs.mp.channel.domain.param.OrderPayParam;
-import com.qs.mp.channel.domain.vo.ChannelGoodsSettleItem;
import com.qs.mp.channel.domain.vo.ChannelGoodsSettleOrderItemVO;
import com.qs.mp.channel.domain.vo.ChannelSettleVO;
import com.qs.mp.channel.service.IChannelGoodsSettleOrderItemService;
@@ -91,6 +90,7 @@ public class ChannelGoodsSettleController extends BaseApiController {
.eq("t1.channel_id", channelId)
.eq("t1.order_id", orderId));
channelSettleVO.setItems(items);
+ channelSettleVO.setPurchaseOrderId(items.get(0).getPurchaseOrderId());
return AjaxResult.success(channelSettleVO);
}
@@ -18,4 +18,7 @@ public class ChannelGoodsSettleOrderItemVO extends ChannelGoodsSettleOrderItem {
@ApiModelProperty("商品id")
private Long goodsId;
+
+ @ApiModelProperty("采购订单id")
+ private String purchaseOrderId;
@@ -24,7 +24,7 @@
item_id, channel_id, order_id, channel_goods_id, title, pic_url, goods_num, created_time, updated_time, purchase_cost, verify_qty, remain_qty, settle_qty
</sql>
<select id="listSettleOrderItemVO" resultType="com.qs.mp.channel.domain.vo.ChannelGoodsSettleOrderItemVO">
- select t1.*,t2.properties,t2.goods_id
+ select t1.*,t2.properties,t2.goods_id,t2.order_id as purchaseOrderId
from mp_channel_goods_settle_order_item t1
left join mp_channel_goods t2 on t1.channel_goods_id = t2.id
${ew.customSqlSegment}