|
|
@@ -24,6 +24,8 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.springblade.client.entity.CorpsDesc;
|
|
|
+import org.springblade.client.feign.ICorpsDescClient;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
@@ -37,6 +39,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.validation.Valid;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 进口采购订单表 控制器
|
|
|
@@ -60,6 +63,8 @@ public class PurchaseOrderController extends BladeController {
|
|
|
|
|
|
private final String ERROR_MSG = "缺少查询信息";
|
|
|
|
|
|
+ private ICorpsDescClient corpsDescClient;//获取客户信息
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 详情
|
|
|
@@ -79,6 +84,8 @@ public class PurchaseOrderController extends BladeController {
|
|
|
@ApiOperation(value = "采购订单表列表(内贸 外贸 出口)", notes = "传入order")
|
|
|
public R<IPage<Order>> list( @RequestParam(name = "current", defaultValue = "1") Integer current,
|
|
|
@RequestParam(name = "size", defaultValue = "10") Integer size,
|
|
|
+ @RequestParam(value = "strCorpName",required = false) String strCorpName,//供应商名称
|
|
|
+ @RequestParam(value = "strPurchaserName",required = false) String strPurchaserName,//采购商名称
|
|
|
@RequestParam(value = "businesStartDate",required = false) String businesStartDate,//订单开始时间
|
|
|
@RequestParam(value = "businesEndDate",required = false) String businesEndDate,//订单结束时间
|
|
|
@RequestParam(value = "accountsCollectionStartDate",required = false) String accountsCollectionStartDate,//付款开始时间
|
|
|
@@ -94,6 +101,27 @@ public class PurchaseOrderController extends BladeController {
|
|
|
{
|
|
|
|
|
|
QueryWrapper<Order> queryWrapper = Condition.getQueryWrapper(order);
|
|
|
+ //供应商
|
|
|
+ if(StringUtils.isNotBlank(strCorpName))
|
|
|
+ {
|
|
|
+ List<CorpsDesc> corpsDescs = corpsDescClient.listCorpByName(strCorpName);
|
|
|
+ if(CollectionUtils.isNotEmpty(corpsDescs))
|
|
|
+ {
|
|
|
+ List<Long> corpIds = corpsDescs.stream().map(CorpsDesc::getId).collect(Collectors.toList());
|
|
|
+ queryWrapper.in("corp_id",corpIds);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //采购商
|
|
|
+ if(StringUtils.isBlank(strPurchaserName))
|
|
|
+ {
|
|
|
+ List<CorpsDesc> corpsDescs = corpsDescClient.listCorpByName(strPurchaserName);
|
|
|
+ if(CollectionUtils.isNotEmpty(corpsDescs))
|
|
|
+ {
|
|
|
+ List<Long> purchaserIds = corpsDescs.stream().map(CorpsDesc::getId).collect(Collectors.toList());
|
|
|
+ queryWrapper.in("purchaser_id",purchaserIds);
|
|
|
+ }
|
|
|
+ }
|
|
|
queryWrapper.eq("tenant_id",AuthUtil.getTenantId());
|
|
|
queryWrapper.eq("bill_type",OrderTypeEnum.PURCHASE.getType());
|
|
|
queryWrapper.eq("trade_type",order.getTradeType());
|
|
|
@@ -108,6 +136,24 @@ public class PurchaseOrderController extends BladeController {
|
|
|
if(CollectionUtils.isNotEmpty(records))
|
|
|
{
|
|
|
records.forEach(e->{
|
|
|
+ //获取供应商中文名
|
|
|
+ if (e.getCorpId() != null){
|
|
|
+ R<CorpsDesc> corpMessage1 = corpsDescClient.getCorpMessage(e.getCorpId());
|
|
|
+ if(corpMessage1.getData()!=null)
|
|
|
+ {
|
|
|
+ e.setStrCorpName(corpMessage1.getData().getCname());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //获取采购商中文名
|
|
|
+ if (e.getPurchaserId() != null){
|
|
|
+ R<CorpsDesc> corpMessage2 = corpsDescClient.getCorpMessage(e.getPurchaserId());
|
|
|
+ if(corpMessage2.getData()!=null)
|
|
|
+ {
|
|
|
+ e.setStrPurchaserName(corpMessage2.getData().getCname());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Boolean flag=orderItemsService.count(new LambdaQueryWrapper<OrderItems>().eq(OrderItems::getPid,e.getId()))>0?true:false;
|
|
|
e.setHasItem(flag);
|
|
|
});
|