From 6bbed1ea6b36af4eb0b234bec9d6e42d56f0cd00 Mon Sep 17 00:00:00 2001
From: shiyunteng <shiyunteng@example.com>
Date: 星期三, 30 九月 2026 16:12:49 +0800
Subject: [PATCH] feat:合同新增关联单位  开票可根据甲方或关联单位选择开票单位  收款去掉强制确认 收款只关联合同甲方或关联单位

---
 platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BusinessCustomerController.java |   30 ++++++++++++++++++++++++------
 1 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BusinessCustomerController.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BusinessCustomerController.java
index 3bbda0d..de18800 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BusinessCustomerController.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BusinessCustomerController.java
@@ -7,6 +7,7 @@
 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.BusinessCustomerAddDTO;
 import com.by4cloud.platformx.business.entity.Product;
 import com.by4cloud.platformx.business.vo.BusinessCustomerSelectVo;
 import com.by4cloud.platformx.common.core.util.R;
@@ -54,6 +55,9 @@
 	@Value("${dept.smjzt}")
 	private String smjzt;
 
+	@Value("${dept.smjhw}")
+	private String smjhw;
+
     /**
      * 鍒嗛〉鏌ヨ
      * @param page 鍒嗛〉瀵硅薄
@@ -66,22 +70,24 @@
     public R getBusinessCustomerPage(@ParameterObject Page page, @ParameterObject BusinessCustomer businessCustomer) {
 
 		if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
-				StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) {
+				StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)||
+				StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
 			LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery();
-			wrapper.eq(businessCustomer.getIndustryId()!=null,BusinessCustomer::getIndustryId,businessCustomer.getIndustryId());
-			wrapper.eq(businessCustomer.getAreaId()!=null,BusinessCustomer::getAreaId,businessCustomer.getAreaId());
+			wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getProvince()),BusinessCustomer::getProvince,businessCustomer.getProvince());
+			wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getIndustryId()),BusinessCustomer::getIndustryId,businessCustomer.getIndustryId());
 			wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName());
 			List<String> smjList = new ArrayList<>();
 			smjList.add(smj);
 			smjList.add(smjsc);
 			smjList.add(smjzt);
+			smjList.add(smjhw);
 			wrapper.in(BusinessCustomer::getCompId, smjList);
 			wrapper.orderByDesc(BusinessCustomer::getCreateTime);
 			return R.ok(businessCustomerService.page(page, wrapper));
 		}
         LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery();
-        wrapper.eq(businessCustomer.getIndustryId()!=null,BusinessCustomer::getIndustryId,businessCustomer.getIndustryId());
-        wrapper.eq(businessCustomer.getAreaId()!=null,BusinessCustomer::getAreaId,businessCustomer.getAreaId());
+		wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getProvince()),BusinessCustomer::getProvince,businessCustomer.getProvince());
+		wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getIndustryId()),BusinessCustomer::getIndustryId,businessCustomer.getIndustryId());
         wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName());
 		wrapper.orderByDesc(BusinessCustomer::getCreateTime);
         return R.ok(businessCustomerService.pageByScope(page, wrapper));
@@ -98,13 +104,16 @@
     public R getBusinessCustomerList(@ParameterObject BusinessCustomer businessCustomer) {
 
 		if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) ||
-				StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) {
+				StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)||
+				StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
 			LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery();
 			wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName());
+
 			List<String> smjList = new ArrayList<>();
 			smjList.add(smj);
 			smjList.add(smjsc);
 			smjList.add(smjzt);
+			smjList.add(smjhw);
 			wrapper.in(BusinessCustomer::getCompId, smjList);
 			List<BusinessCustomer> businessCustomerList = businessCustomerService.list(wrapper);
 			if (CollUtil.isNotEmpty(businessCustomerList)){
@@ -117,6 +126,8 @@
 		}
         LambdaQueryWrapper<BusinessCustomer> wrapper = Wrappers.lambdaQuery();
         wrapper.like(StrUtil.isNotEmpty(businessCustomer.getCompanyName()),BusinessCustomer::getCompanyName,businessCustomer.getCompanyName());
+		wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getProvince()),BusinessCustomer::getProvince,businessCustomer.getProvince());
+		wrapper.eq(StrUtil.isNotEmpty(businessCustomer.getIndustryId()),BusinessCustomer::getIndustryId,businessCustomer.getIndustryId());
 		List<BusinessCustomer> businessCustomerList = businessCustomerService.listByScope(wrapper);
 		if (CollUtil.isNotEmpty(businessCustomerList)){
 			List<BusinessCustomerSelectVo> voList = BeanUtil.copyToList(businessCustomerList, BusinessCustomerSelectVo.class);
@@ -153,6 +164,13 @@
         return R.ok(businessCustomerService.save(businessCustomer));
     }
 
+	@Operation(summary = "鏂板瀹㈠晢淇℃伅-鐭冲伐娉�" , description = "鏂板瀹㈠晢淇℃伅-鐭冲伐娉�" )
+	@SysLog("鏂板瀹㈠晢淇℃伅-鐭冲伐娉�" )
+	@PostMapping("/saveCustomerSgb")
+	public R saveCustomerSgb(@RequestBody BusinessCustomerAddDTO addDTO) {
+		return businessCustomerService.saveCustomerSgb(addDTO);
+	}
+
     /**
      * 淇敼瀹㈠晢淇℃伅
      * @param businessCustomer 瀹㈠晢淇℃伅

--
Gitblit v1.9.1