From 96118de3ac74f5468cf5d4ac73d6ea3bec1da010 Mon Sep 17 00:00:00 2001
From: shiyunteng <shiyunteng@example.com>
Date: 星期五, 20 十一月 2026 14:36:25 +0800
Subject: [PATCH] feat:新增销售指标 产品板块 重点工作 专项业务 产品收入和合同统计修改功能 feat:承兑新增承兑编号字段 feat:客商主数据更新名称 专项业务去年同月字段 机动车销售发票地址字段及判断 feat:银行流水更新客户id feat:机动车销售发票新增税务及代码字段 feat:流水更新按钮参数 feat:检索新增标的物运维按钮

---
 platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/controller/BusinessCustomerController.java |   96 ++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 84 insertions(+), 12 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..8a4444e 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
@@ -3,13 +3,18 @@
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ArrayUtil;
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjUtil;
 import cn.hutool.core.util.StrUtil;
 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.BusinessCustomerImportVo;
 import com.by4cloud.platformx.business.vo.BusinessCustomerSelectVo;
+import com.by4cloud.platformx.business.vo.ProductExcelVO;
 import com.by4cloud.platformx.common.core.util.R;
+import com.by4cloud.platformx.common.excel.annotation.RequestExcel;
 import com.by4cloud.platformx.common.log.annotation.SysLog;
 import com.by4cloud.platformx.business.entity.BusinessCustomer;
 import com.by4cloud.platformx.business.service.BusinessCustomerService;
@@ -24,6 +29,7 @@
 import io.swagger.v3.oas.annotations.tags.Tag;
 import io.swagger.v3.oas.annotations.Operation;
 import lombok.RequiredArgsConstructor;
+import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.ArrayList;
@@ -54,6 +60,9 @@
 	@Value("${dept.smjzt}")
 	private String smjzt;
 
+	@Value("${dept.smjhw}")
+	private String smjhw;
+
     /**
      * 鍒嗛〉鏌ヨ
      * @param page 鍒嗛〉瀵硅薄
@@ -65,23 +74,23 @@
     @PreAuthorize("@pms.hasPermission('business_businessCustomer_view')" )
     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)) {
+		if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || 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(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));
@@ -97,14 +106,14 @@
     @PreAuthorize("@pms.hasPermission('business_businessCustomer_view')" )
     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)) {
+		if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || 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(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);
@@ -150,8 +161,43 @@
     @PostMapping
     @PreAuthorize("@pms.hasPermission('business_businessCustomer_add')" )
     public R save(@RequestBody 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() + "", smjhw)) {
+			if (StrUtil.isBlank(businessCustomer.getErpCompanyCode())) {
+				return R.failed("erp瀹㈡埛缂栫爜涓嶈兘涓虹┖");
+			}
+		}
+		if (StrUtil.isNotBlank(businessCustomer.getCreditCode())){
+			businessCustomer.setBipCode(businessCustomer.getCreditCode());
+		}
+		BusinessCustomer customer = null;
+		if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) {
+			List<String> smjList = new ArrayList<>();
+			smjList.add(smj);
+			smjList.add(smjhw);
+			customer = businessCustomerService.getOne(Wrappers.<BusinessCustomer>lambdaQuery()
+					.eq(BusinessCustomer::getCreditCode, businessCustomer.getCreditCode())
+					.in(BusinessCustomer::getCompId, smjList)
+					.last("limit 1"));
+		}else {
+			customer = businessCustomerService.getOne(Wrappers.<BusinessCustomer>lambdaQuery()
+					.eq(BusinessCustomer::getCreditCode, businessCustomer.getCreditCode())
+					.eq(BusinessCustomer::getCompId,SecurityUtils.getUser().getCompId())
+					.last("limit 1"));
+		}
+		if (ObjUtil.isNotNull(customer)){
+			return R.failed("瀹㈡埛宸插瓨鍦�");
+		}
         return R.ok(businessCustomerService.save(businessCustomer));
     }
+
+	@Operation(summary = "鏂板瀹㈠晢淇℃伅-鐭冲伐娉�" , description = "鏂板瀹㈠晢淇℃伅-鐭冲伐娉�" )
+	@SysLog("鏂板瀹㈠晢淇℃伅-鐭冲伐娉�" )
+	@PostMapping("/saveCustomerSgb")
+	public R saveCustomerSgb(@RequestBody BusinessCustomerAddDTO addDTO) {
+		return businessCustomerService.saveCustomerSgb(addDTO);
+	}
 
     /**
      * 淇敼瀹㈠晢淇℃伅
@@ -163,6 +209,9 @@
     @PutMapping
     @PreAuthorize("@pms.hasPermission('business_businessCustomer_edit')" )
     public R updateById(@RequestBody BusinessCustomer businessCustomer) {
+		if (StrUtil.isNotBlank(businessCustomer.getCreditCode())){
+			businessCustomer.setBipCode(businessCustomer.getCreditCode());
+		}
         return R.ok(businessCustomerService.updateById(businessCustomer));
     }
 
@@ -204,6 +253,18 @@
 	}
 
 	/**
+	 * 閫氳繃id鏌ヨ瀹㈠晢淇℃伅
+	 * @param id id
+	 * @return R
+	 */
+	@Operation(summary = "閫氳繃id鏇存柊瀹㈡埛鍚嶇О" , description = "閫氳繃id鏇存柊瀹㈡埛鍚嶇О" )
+	@GetMapping("/syncCustomer/{id}" )
+	public R syncCustomer(@PathVariable("id" ) Long id) {
+		return businessCustomerService.syncCustomer(id);
+	}
+
+
+	/**
 	 * 鍚屾涓绘暟鎹� 浼佷笟鍚嶇О 娉曚汉 涓夊悎涓�鐮� 閾惰淇℃伅
 	 * @return R
 	 */
@@ -211,4 +272,15 @@
 	public R queryMainBC(@PathVariable("companyName")String companyName) {
 		return R.ok(businessCustomerService.queryMainBC(companyName));
 	}
+
+	/**
+	 * 瀵煎叆瀹㈠晢
+	 * @param excelVOList
+	 * @param bindingResult
+	 * @return
+	 */
+	@PostMapping("/importBusinessCustomer")
+	public R importBusinessCustomer(@RequestExcel List<BusinessCustomerImportVo> excelVOList, BindingResult bindingResult) {
+		return businessCustomerService.importBusinessCustomer(excelVOList, bindingResult);
+	}
 }
\ No newline at end of file

--
Gitblit v1.9.1