|
|
@@ -19,6 +19,7 @@ package org.springblade.purchase.sales.controller;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.google.protobuf.ServiceException;
|
|
|
import com.trade.purchase.order.enums.OrderTypeEnum;
|
|
|
import io.swagger.annotations.Api;
|
|
|
@@ -32,12 +33,15 @@ import org.springblade.client.entity.CorpsDesc;
|
|
|
import org.springblade.client.feign.ICorpsDescClient;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
+import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
+import org.springblade.purchase.sales.entity.OrderFees;
|
|
|
import org.springblade.purchase.sales.entity.OrderItems;
|
|
|
import org.springblade.purchase.sales.service.*;
|
|
|
import org.springblade.purchase.sales.vo.OrderItemsVO;
|
|
|
+import org.springblade.purchase.sales.vo.OrderStatisticAnalysisVO;
|
|
|
import org.springblade.system.user.entity.User;
|
|
|
import org.springblade.system.user.feign.IUserClient;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
@@ -312,4 +316,48 @@ public class OrderController extends BladeController {
|
|
|
order.setTradeType(OrderTypeEnum.DOMESTIC.getType());
|
|
|
return R.data(orderService.createMarket(order));
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 统计分析
|
|
|
+ * */
|
|
|
+ @GetMapping("/listOrderStatisticAnalysis")
|
|
|
+ @ApiOperationSupport(order = 9)
|
|
|
+ @ApiOperation(value = "统计分析")
|
|
|
+ public R listOrderStatisticAnalysis(Order order, Query query)
|
|
|
+ {
|
|
|
+ Page<OrderStatisticAnalysisVO> iPage = new Page(query.getCurrent(),query.getSize());
|
|
|
+ IPage<OrderStatisticAnalysisVO> orderStatisticAnalysisVOIPage = orderService.listOrderStatisticAnalysis(iPage, AuthUtil.getTenantId(), order.getOrderNo());
|
|
|
+ List<OrderStatisticAnalysisVO> records = orderStatisticAnalysisVOIPage.getRecords();
|
|
|
+ if(CollectionUtils.isNotEmpty(records))
|
|
|
+ {
|
|
|
+ records.forEach(e->{
|
|
|
+ //供应商名称
|
|
|
+ if(e.getCorpId()!=null)
|
|
|
+ {
|
|
|
+ R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(e.getCorpId());
|
|
|
+ if(corpMessage.isSuccess())
|
|
|
+ {
|
|
|
+ e.setCorpName(corpMessage.getData().getCname());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //客户名称
|
|
|
+ if(e.getSaleCorpId()!=null)
|
|
|
+ {
|
|
|
+ R<CorpsDesc> corpsDescClientCorpMessage = corpsDescClient.getCorpMessage(e.getSaleCorpId());
|
|
|
+ if(corpsDescClientCorpMessage.isSuccess())
|
|
|
+ {
|
|
|
+ e.setSaleCorpName(corpsDescClientCorpMessage.getData().getCname());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Long orderId = e.getOrderId();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+ orderStatisticAnalysisVOIPage.setRecords(records);
|
|
|
+ return R.data(orderStatisticAnalysisVOIPage);
|
|
|
+ }
|
|
|
+
|
|
|
}
|