|
|
@@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import com.trade.purchase.order.enums.OrderTypeEnum;
|
|
|
+import com.trade.purchase.order.vo.OrderDTO;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.springblade.client.feign.IGoodsDescClient;
|
|
|
+import org.springblade.client.vo.GoodsDescVO;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
@@ -19,13 +22,13 @@ import org.springblade.purchase.sales.entity.Order;
|
|
|
import org.springblade.purchase.sales.entity.OrderItems;
|
|
|
import org.springblade.purchase.sales.service.IOrderItemsService;
|
|
|
import org.springblade.purchase.sales.service.IOrderService;
|
|
|
+import org.springblade.purchase.sales.vo.OrderItemBillNoVO;
|
|
|
import org.springblade.purchase.sales.vo.OrderItemsVO;
|
|
|
import org.springblade.purchase.sales.vo.OrderVO;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -41,6 +44,8 @@ public class EntranceOrderController extends BladeController {
|
|
|
|
|
|
private final IOrderItemsService itemsService;
|
|
|
|
|
|
+ private IGoodsDescClient goodsDescClient;//获取商品信息
|
|
|
+
|
|
|
/**
|
|
|
* 详情
|
|
|
*/
|
|
|
@@ -152,27 +157,26 @@ public class EntranceOrderController extends BladeController {
|
|
|
@GetMapping("/findContractNoByBillNo")
|
|
|
@ApiOperationSupport(order = 6)
|
|
|
@ApiOperation(value = "通过提单号查询合同号", notes = "传入提单号")
|
|
|
- public List<Order> findContractNoByBillNo(@ApiParam(value = "billNo", required = true) @RequestParam String billNo)
|
|
|
+ public List<?> findContractNoByBillNo(@ApiParam(value = "billNo", required = true) @RequestParam String billNo,@ApiParam(value = "billType", required = true) @RequestParam String billType)
|
|
|
{
|
|
|
- LambdaQueryWrapper<OrderItems> itemsLambdaQueryWrapper=new LambdaQueryWrapper<>();
|
|
|
- itemsLambdaQueryWrapper.eq(OrderItems::getBillNo,billNo.trim());
|
|
|
- List<OrderItems> orderItems = itemsService.list(itemsLambdaQueryWrapper);
|
|
|
- if(CollectionUtils.isEmpty(orderItems))
|
|
|
- {
|
|
|
- throw new SecurityException("无此提单号的记录");
|
|
|
- }
|
|
|
- List<Long> pids = orderItems.stream().map(OrderItems::getPid).distinct().collect(Collectors.toList());
|
|
|
- if(CollectionUtils.isEmpty(pids))
|
|
|
+ List<OrderItemBillNoVO> contractNoByBillNo = orderService.findContractNoByBillNo(billNo, billType);
|
|
|
+ if(CollectionUtils.isNotEmpty(contractNoByBillNo))
|
|
|
{
|
|
|
- return Collections.EMPTY_LIST;
|
|
|
+ contractNoByBillNo.forEach(e->{
|
|
|
+ List<Map<String,Object>> list=new ArrayList<>();
|
|
|
+ Map<String,Object>map=new HashMap<>();
|
|
|
+ R<GoodsDescVO> goodsDescVOR = goodsDescClient.selectGoodsMessage(e.getItemId());
|
|
|
+ map.put("id",goodsDescVOR.getData().getId());
|
|
|
+ map.put("cname",goodsDescVOR.getData().getCname());
|
|
|
+ list.add(map);
|
|
|
+ e.setItemName(list);
|
|
|
+ });
|
|
|
+ return contractNoByBillNo;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LambdaQueryWrapper<Order> orderLambdaQueryWrapper=new LambdaQueryWrapper<>();
|
|
|
- orderLambdaQueryWrapper.in(Order::getId,pids);
|
|
|
- return orderService.list(orderLambdaQueryWrapper);
|
|
|
+ return Collections.EMPTY_LIST;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
/**
|
|
|
* 发货单获取订单明细
|