Browse Source

fixed 后台角色管理

fushengqian 1 year ago
parent
commit
3cda564f8d

+ 2 - 2
fuint-application/src/main/java/com/fuint/common/service/impl/DutyServiceImpl.java

@@ -165,7 +165,7 @@ public class DutyServiceImpl extends ServiceImpl<TDutyMapper, TDuty> implements
      */
      */
     @Override
     @Override
     public TDuty findByName(Integer merchantId, String name) {
     public TDuty findByName(Integer merchantId, String name) {
-        return this.tDutyMapper.findByName(name);
+        return this.tDutyMapper.findByName(merchantId, name);
     }
     }
 
 
     /**
     /**
@@ -188,7 +188,7 @@ public class DutyServiceImpl extends ServiceImpl<TDutyMapper, TDuty> implements
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     @OperationServiceLog(description = "新增后台角色")
     @OperationServiceLog(description = "新增后台角色")
     public void saveDuty(TDuty duty, List<TSource> sources) throws BusinessCheckException {
     public void saveDuty(TDuty duty, List<TSource> sources) throws BusinessCheckException {
-        TDuty existsDuty = tDutyMapper.findByName(duty.getDutyName());
+        TDuty existsDuty = tDutyMapper.findByName(duty.getMerchantId(), duty.getDutyName());
         if (existsDuty != null) {
         if (existsDuty != null) {
             throw new BusinessCheckException("角色名称已经存在.");
             throw new BusinessCheckException("角色名称已经存在.");
         }
         }

+ 1 - 1
fuint-repository/src/main/java/com/fuint/repository/mapper/TDutyMapper.java

@@ -17,7 +17,7 @@ public interface TDutyMapper extends BaseMapper<TDuty> {
 
 
     List<TDuty> findByIdIn(@Param("ids") List<Integer> ids);
     List<TDuty> findByIdIn(@Param("ids") List<Integer> ids);
 
 
-    TDuty findByName(@Param("name") String name);
+    TDuty findByName(@Param("merchantId") Integer merchantId, @Param("name") String name);
 
 
     List<Long> getRoleIdsByAccountId(@Param("accountId") Integer accountId);
     List<Long> getRoleIdsByAccountId(@Param("accountId") Integer accountId);
 }
 }