From c5ea85558fea4d82b5368073c598a30f905c4bdc Mon Sep 17 00:00:00 2001
From: shiyunteng <shiyunteng@example.com>
Date: 星期五, 23 十月 2026 17:11:49 +0800
Subject: [PATCH] feat:新增统计标注功能

---
 platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BankStatementController.java |   69 ++++++++++++++++++++++++++++------
 1 files changed, 57 insertions(+), 12 deletions(-)

diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BankStatementController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BankStatementController.java
index 7ea0713..95fc84d 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BankStatementController.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BankStatementController.java
@@ -6,11 +6,17 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.by4cloud.platformx.business.dto.BankStatementQueryDTO;
 import com.by4cloud.platformx.business.dto.BankStatementUpdateDTO;
+import com.by4cloud.platformx.business.dto.BipQueryDTO;
+import com.by4cloud.platformx.business.dto.SyncPaymentRecepitDTO;
 import com.by4cloud.platformx.business.entity.BankStatement;
+import com.by4cloud.platformx.business.entity.BusinessCustomer;
 import com.by4cloud.platformx.common.core.util.R;
 import com.by4cloud.platformx.common.log.annotation.SysLog;
 import com.by4cloud.platformx.business.service.BankStatementService;
+import com.by4cloud.platformx.common.security.util.SecurityUtils;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.security.access.prepost.PreAuthorize;
 import com.by4cloud.platformx.common.excel.annotation.ResponseExcel;
 import io.swagger.v3.oas.annotations.security.SecurityRequirement;
@@ -21,6 +27,7 @@
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
 
@@ -39,20 +46,41 @@
 
     private final  BankStatementService bankStatementService;
 
+	@Value("${dept.smj}")
+	private String smj;
+
+	@Value("${dept.smjhw}")
+	private String smjhw;
+
     /**
      * 鍒嗛〉鏌ヨ
      * @param page 鍒嗛〉瀵硅薄
-     * @param bankStatement 閾惰娴佹按
+     * @param queryDTO 閾惰娴佹按
      * @return
      */
     @Operation(summary = "鍒嗛〉鏌ヨ" , description = "鍒嗛〉鏌ヨ" )
     @GetMapping("/page" )
     @PreAuthorize("@pms.hasPermission('business_bankStatement_view')" )
-    public R getBankStatementPage(@ParameterObject Page page, @ParameterObject BankStatement bankStatement) {
+    public R getBankStatementPage(@ParameterObject Page page, @ParameterObject BankStatementQueryDTO queryDTO) {
+		if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
+			LambdaQueryWrapper<BankStatement> wrapper = Wrappers.lambdaQuery();
+			wrapper.like(StrUtil.isNotBlank(queryDTO.getPayBankAccName()),BankStatement::getPayBankAccName,queryDTO.getPayBankAccName());
+			wrapper.like(StrUtil.isNotBlank(queryDTO.getReceiveBankAccName()),BankStatement::getReceiveBankAccName,queryDTO.getReceiveBankAccName());
+			wrapper.ge(StrUtil.isNotBlank(queryDTO.getStartDate()),BankStatement::getTranDate,queryDTO.getStartDate()+" 00:00:00");
+			wrapper.le(StrUtil.isNotBlank(queryDTO.getEndDate()),BankStatement::getTranDate,queryDTO.getEndDate()+" 23:59:59");
+			wrapper.orderByDesc(BankStatement::getTranDate);
+			List<String> smjList = new ArrayList<>();
+			smjList.add(smj);
+			smjList.add(smjhw);
+			wrapper.in(BankStatement::getCompId, smjList);
+			return R.ok(bankStatementService.page(page, wrapper));
+		}
         LambdaQueryWrapper<BankStatement> wrapper = Wrappers.lambdaQuery();
-		wrapper.like(StrUtil.isNotBlank(bankStatement.getPayBankAccName()),BankStatement::getPayBankAccName,bankStatement.getPayBankAccName());
-		wrapper.like(StrUtil.isNotBlank(bankStatement.getReceiveBankAccName()),BankStatement::getReceiveBankAccName,bankStatement.getReceiveBankAccName());
-        wrapper.orderByDesc(BankStatement::getCreateTime);
+		wrapper.like(StrUtil.isNotBlank(queryDTO.getPayBankAccName()),BankStatement::getPayBankAccName,queryDTO.getPayBankAccName());
+		wrapper.like(StrUtil.isNotBlank(queryDTO.getReceiveBankAccName()),BankStatement::getReceiveBankAccName,queryDTO.getReceiveBankAccName());
+		wrapper.ge(StrUtil.isNotBlank(queryDTO.getStartDate()),BankStatement::getTranDate,queryDTO.getStartDate()+" 00:00:00");
+		wrapper.le(StrUtil.isNotBlank(queryDTO.getEndDate()),BankStatement::getTranDate,queryDTO.getEndDate()+" 23:59:59");
+		wrapper.orderByDesc(BankStatement::getTranDate);
 		return R.ok(bankStatementService.pageByScope(page, wrapper));
     }
 
@@ -176,15 +204,32 @@
 		return bankStatementService.backAll(id);
 	}
 
-
 	/**
-	 * 閫氳繃id鎺ㄩ�乥ip
-	 * @param itemId id
+	 * 鐢熸垚鏀舵鍗曢淇℃伅骞舵帹閫�
+	 * @param updateDTO
 	 * @return R
 	 */
-	@Operation(summary = "閫氳繃id鍒犻櫎閾惰娴佹按鍘嗗彶纭" , description = "閫氳繃id鍒犻櫎閾惰娴佹按鍘嗗彶纭" )
-	@GetMapping("/pushBip/{itemId}" )
-	public R pushBip(@PathVariable("itemId" ) Long itemId) {
-		return bankStatementService.pushBip(itemId);
+	@Operation(summary = "鐢熸垚鏀舵鍗曢淇℃伅骞舵帹閫�" , description = "鐢熸垚鏀舵鍗曢淇℃伅骞舵帹閫�" )
+	@PostMapping("/saveAndPush" )
+	public R saveAndPush(@RequestBody BankStatementUpdateDTO updateDTO) {
+		return bankStatementService.saveAndPush(updateDTO);
 	}
+
+	/**
+	 * 鍒嗛〉鏌ヨ
+	 * @param page 鍒嗛〉瀵硅薄
+	 * @param queryDTO 閾惰娴佹按
+	 * @return
+	 */
+	@Operation(summary = "鍒嗛〉鏌ヨ" , description = "鍒嗛〉鏌ヨ" )
+	@GetMapping("/pageBip" )
+	public R pageBip(@ParameterObject Page page, @ParameterObject BipQueryDTO queryDTO) {
+		return R.ok(bankStatementService.pageBip(page, queryDTO));
+	}
+
+	@GetMapping("/pullBankData" )
+	public R pullBankData(@ParameterObject SyncPaymentRecepitDTO queryDTO) {
+		return bankStatementService.pullBankData(queryDTO);
+	}
+
 }
\ No newline at end of file

--
Gitblit v1.9.1