|
|
@@ -1,6 +1,7 @@
|
|
|
package shop.alien.store.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
@@ -106,6 +107,13 @@ public class StoreStaffTitleServiceImpl extends ServiceImpl<StoreStaffTitleMappe
|
|
|
throw new IllegalArgumentException("标题名称不能为空");
|
|
|
}
|
|
|
|
|
|
+ // TODO 去重
|
|
|
+ List<StoreStaffTitle> titleName = storeStaffTitleMapper.selectList(new QueryWrapper<StoreStaffTitle>().eq("store_id",storeStaffTitle.getStoreId()).eq("title_name", storeStaffTitle.getTitleName()));
|
|
|
+ if ( !titleName.isEmpty() ) {
|
|
|
+ log.warn("新增员工标题失败,标题名称重复");
|
|
|
+ throw new IllegalArgumentException("标题名称不能重复");
|
|
|
+ }
|
|
|
+
|
|
|
try {
|
|
|
// 自动计算员工数量
|
|
|
int staffCount = calculateStaffCount(storeStaffTitle.getStaffIds());
|