Merge branch 'master' of http://gitea.zianxin.com/zianxin-tec/biz-api-cloud
This commit is contained in:
commit
81c5decc76
2 files changed
+8
-8
No files matched your search
+1
-1
@@ -232,7 +232,7 @@ public class SmErpSpuController {
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_export')" )
|
||||
@PreAuthorize("@pms.hasPermission('supermarket_supermarketSpu_import')" )
|
||||
public R importErpSpu(@RequestExcel List<SmErpSpuImportDto> dtos, BindingResult bindingResult) {
|
||||
List<SmErpSpuImportDto> collect = dtos.stream().filter(smErpSpuImportDto -> smErpSpuImportDto.getProductCode() != null).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(collect)) {
|
||||
|
||||
+7
-7
@@ -799,13 +799,13 @@ public class SmErpSpuServiceImpl extends ServiceImpl<SmErpSpuMapper, SmErpSpuEnt
|
||||
Long deptId,Long merchantId) {
|
||||
try {
|
||||
// 查询现有分类
|
||||
SmErpCategoryEntity existCategory = smErpCategoryMapper.selectOne(
|
||||
List<SmErpCategoryEntity> existCategory = smErpCategoryMapper.selectListByScope(
|
||||
new LambdaQueryWrapper<SmErpCategoryEntity>()
|
||||
.eq(SmErpCategoryEntity::getName, categoryName)
|
||||
.eq(SmErpCategoryEntity::getName, categoryName),DataScope.of()
|
||||
);
|
||||
|
||||
if (existCategory != null) {
|
||||
return existCategory.getId();
|
||||
if (CollectionUtils.isNotEmpty(existCategory)) {
|
||||
return existCategory.get(0).getId();
|
||||
}
|
||||
|
||||
// 创建新分类
|
||||
@@ -824,11 +824,11 @@ public class SmErpSpuServiceImpl extends ServiceImpl<SmErpSpuMapper, SmErpSpuEnt
|
||||
|
||||
} catch (DuplicateKeyException e) {
|
||||
// 处理并发创建冲突
|
||||
SmErpCategoryEntity conflictCategory = smErpCategoryMapper.selectOne(
|
||||
List<SmErpCategoryEntity> conflictCategory = smErpCategoryMapper.selectListByScope(
|
||||
new LambdaQueryWrapper<SmErpCategoryEntity>()
|
||||
.eq(SmErpCategoryEntity::getName, categoryName)
|
||||
.eq(SmErpCategoryEntity::getName, categoryName),DataScope.of()
|
||||
);
|
||||
return conflictCategory != null ? conflictCategory.getId() : null;
|
||||
return conflictCategory != null ? conflictCategory.get(0).getId() : null;
|
||||
|
||||
} catch (Exception e) {
|
||||
errorReasons.add("分类处理异常: " + e.getMessage());
|
||||
|
||||
Reference in new issue
Block a user