feat(import): 批量导入功能增加公司ID参数支持
- 为所有批量导入接口增加可选的companyId参数 - 在导入过程中将companyId设置到实体对象中 - 修复客户导入时的租户ID冲突处理逻辑 - 添加数据完整性验证异常处理机制 - 实现字符串字段的标准化处理功能 - 优化重复数据检测和更新逻辑
This commit is contained in:
@@ -135,7 +135,8 @@ public class CreditCompetitorController extends BaseController {
|
||||
@PreAuthorize("hasAuthority('credit:creditCompetitor:save')")
|
||||
@Operation(summary = "批量导入竞争对手")
|
||||
@PostMapping("/import")
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file) {
|
||||
public ApiResult<List<String>> importBatch(@RequestParam("file") MultipartFile file,
|
||||
@RequestParam(value = "companyId", required = false) Integer companyId) {
|
||||
List<String> errorMessages = new ArrayList<>();
|
||||
int successCount = 0;
|
||||
|
||||
@@ -159,6 +160,9 @@ public class CreditCompetitorController extends BaseController {
|
||||
try {
|
||||
CreditCompetitor item = convertImportParamToEntity(param);
|
||||
|
||||
if (item.getCompanyId() == null && companyId != null) {
|
||||
item.setCompanyId(companyId);
|
||||
}
|
||||
if (item.getUserId() == null && currentUserId != null) {
|
||||
item.setUserId(currentUserId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user