|
|
@@ -10,6 +10,8 @@ import com.fs.common.core.page.TableSupport;
|
|
|
import com.fs.common.enums.BusinessType;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
import com.fs.fastGpt.domain.FastGptPushTokenTotal;
|
|
|
+import com.fs.fastGpt.param.FastGptPushTokenDeptTotalParam;
|
|
|
+import com.fs.fastGpt.vo.FastGptPushTokenDeptTotalVO;
|
|
|
import com.fs.qw.domain.QwPushCount;
|
|
|
import com.fs.qw.service.IQwPushCountService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -189,6 +191,47 @@ public class QwPushCountController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
+ list.add(sumTotal); // 将合计行添加到列表末尾
|
|
|
+
|
|
|
+ // 构造返回结果
|
|
|
+ TableDataInfo rspData = new TableDataInfo();
|
|
|
+ rspData.setCode(HttpStatus.SUCCESS);
|
|
|
+ rspData.setMsg("查询成功");
|
|
|
+ rspData.setRows(list);
|
|
|
+ rspData.setTotal(total);
|
|
|
+ return rspData;
|
|
|
+ }
|
|
|
+ @PreAuthorize("@ss.hasPermi('qw:qwPushCount:tokenListDept')")
|
|
|
+ @GetMapping("/tokenListDept")
|
|
|
+ public TableDataInfo tokenListDept(FastGptPushTokenDeptTotalParam pushTokenInfo) {
|
|
|
+ List<FastGptPushTokenDeptTotalVO> list = qwPushCountService.selectFastGptPushTokenTotalDeptList(pushTokenInfo);
|
|
|
+
|
|
|
+
|
|
|
+ // 计算总和
|
|
|
+ FastGptPushTokenDeptTotalVO sumTotal = new FastGptPushTokenDeptTotalVO();
|
|
|
+ sumTotal.setCompanyName("合计"); // 假设有一个字段用于显示“合计”标签,具体字段名根据实际情况替换
|
|
|
+ Long sum = list.stream().mapToLong(FastGptPushTokenDeptTotalVO::getCount).sum(); // 假设有一个数字字段需要求和,具体字段名根据实际情况替换
|
|
|
+ sumTotal.setCount(sum); // 设置合计值,具体字段名根据实际情况替换
|
|
|
+
|
|
|
+ // 获取分页参数
|
|
|
+ PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
|
+ Integer pageNum = pageDomain.getPageNum();
|
|
|
+ Integer pageSize = pageDomain.getPageSize();
|
|
|
+
|
|
|
+ int total = list.size();
|
|
|
+ // 在内存中进行分页处理
|
|
|
+ if (pageNum != null && pageSize != null) {
|
|
|
+ int fromIndex = (pageNum - 1) * pageSize;
|
|
|
+ int toIndex = Math.min(fromIndex + pageSize, total);
|
|
|
+
|
|
|
+ // 确保索引不越界
|
|
|
+ if (fromIndex < total) {
|
|
|
+ list = list.subList(fromIndex, toIndex);
|
|
|
+ } else {
|
|
|
+ list = new ArrayList<>(); // 返回空列表
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
list.add(sumTotal); // 将合计行添加到列表末尾
|
|
|
|
|
|
// 构造返回结果
|