Commit fc509837a1de3040a16d77d948aa3f3eef7ba11c

Authored by YunaiV
2 parents 66d68256 e52d7d33

Merge branch 'master' of https://github.com/YunaiV/ruoyi-vue-pro into feature/tenant_op

 Conflicts:
	yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java
Showing 13 changed files with 16 additions and 15 deletions
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java
@@ -47,12 +47,12 @@ public interface BaseMapperX<T> extends BaseMapper<T> { @@ -47,12 +47,12 @@ public interface BaseMapperX<T> extends BaseMapper<T> {
47 return selectCount(new QueryWrapper<T>()); 47 return selectCount(new QueryWrapper<T>());
48 } 48 }
49 49
50 - default Integer selectCount(String field, Object value) {  
51 - return selectCount(new QueryWrapper<T>().eq(field, value)).intValue(); 50 + default Long selectCount(String field, Object value) {
  51 + return selectCount(new QueryWrapper<T>().eq(field, value));
52 } 52 }
53 53
54 - default Integer selectCount(SFunction<T, ?> field, Object value) {  
55 - return selectCount(new LambdaQueryWrapper<T>().eq(field, value)).intValue(); 54 + default Long selectCount(SFunction<T, ?> field, Object value) {
  55 + return selectCount(new LambdaQueryWrapper<T>().eq(field, value));
56 } 56 }
57 57
58 default List<T> selectList() { 58 default List<T> selectList() {
yudao-module-infra/yudao-module-infra-impl/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileMapper.java
@@ -23,7 +23,7 @@ public interface FileMapper extends BaseMapperX&lt;FileDO&gt; { @@ -23,7 +23,7 @@ public interface FileMapper extends BaseMapperX&lt;FileDO&gt; {
23 .orderByDesc("create_time")); 23 .orderByDesc("create_time"));
24 } 24 }
25 25
26 - default Integer selectCountById(String id) { 26 + default Long selectCountById(String id) {
27 return selectCount(FileDO::getId, id); 27 return selectCount(FileDO::getId, id);
28 } 28 }
29 29
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dept/DeptMapper.java
@@ -24,7 +24,7 @@ public interface DeptMapper extends BaseMapperX&lt;DeptDO&gt; { @@ -24,7 +24,7 @@ public interface DeptMapper extends BaseMapperX&lt;DeptDO&gt; {
24 .eq(DeptDO::getName, name)); 24 .eq(DeptDO::getName, name));
25 } 25 }
26 26
27 - default Integer selectCountByParentId(Long parentId) { 27 + default Long selectCountByParentId(Long parentId) {
28 return selectCount(DeptDO::getParentId, parentId); 28 return selectCount(DeptDO::getParentId, parentId);
29 } 29 }
30 30
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/dict/DictDataMapper.java
@@ -28,7 +28,7 @@ public interface DictDataMapper extends BaseMapperX&lt;DictDataDO&gt; { @@ -28,7 +28,7 @@ public interface DictDataMapper extends BaseMapperX&lt;DictDataDO&gt; {
28 .in(DictDataDO::getValue, values)); 28 .in(DictDataDO::getValue, values));
29 } 29 }
30 30
31 - default int selectCountByDictType(String dictType) { 31 + default long selectCountByDictType(String dictType) {
32 return selectCount(DictDataDO::getDictType, dictType); 32 return selectCount(DictDataDO::getDictType, dictType);
33 } 33 }
34 34
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/permission/MenuMapper.java
@@ -19,7 +19,7 @@ public interface MenuMapper extends BaseMapperX&lt;MenuDO&gt; { @@ -19,7 +19,7 @@ public interface MenuMapper extends BaseMapperX&lt;MenuDO&gt; {
19 .eq(MenuDO::getName, name)); 19 .eq(MenuDO::getName, name));
20 } 20 }
21 21
22 - default Integer selectCountByParentId(Long parentId) { 22 + default Long selectCountByParentId(Long parentId) {
23 return selectCount(MenuDO::getParentId, parentId); 23 return selectCount(MenuDO::getParentId, parentId);
24 } 24 }
25 25
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsTemplateMapper.java
@@ -46,7 +46,7 @@ public interface SmsTemplateMapper extends BaseMapperX&lt;SmsTemplateDO&gt; { @@ -46,7 +46,7 @@ public interface SmsTemplateMapper extends BaseMapperX&lt;SmsTemplateDO&gt; {
46 .orderByDesc(SmsTemplateDO::getId)); 46 .orderByDesc(SmsTemplateDO::getId));
47 } 47 }
48 48
49 - default Integer selectCountByChannelId(Long channelId) { 49 + default Long selectCountByChannelId(Long channelId) {
50 return selectCount(SmsTemplateDO::getChannelId, channelId); 50 return selectCount(SmsTemplateDO::getChannelId, channelId);
51 } 51 }
52 52
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataService.java
@@ -82,7 +82,7 @@ public interface DictDataService extends DictDataFrameworkService { @@ -82,7 +82,7 @@ public interface DictDataService extends DictDataFrameworkService {
82 * @param dictType 字典类型 82 * @param dictType 字典类型
83 * @return 数据数量 83 * @return 数据数量
84 */ 84 */
85 - int countByDictType(String dictType); 85 + long countByDictType(String dictType);
86 86
87 /** 87 /**
88 * 校验字典数据们是否有效。如下情况,视为无效: 88 * 校验字典数据们是否有效。如下情况,视为无效:
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/dict/DictDataServiceImpl.java
@@ -208,7 +208,7 @@ public class DictDataServiceImpl implements DictDataService { @@ -208,7 +208,7 @@ public class DictDataServiceImpl implements DictDataService {
208 } 208 }
209 209
210 @Override 210 @Override
211 - public int countByDictType(String dictType) { 211 + public long countByDictType(String dictType) {
212 return dictDataMapper.selectCountByDictType(dictType); 212 return dictDataMapper.selectCountByDictType(dictType);
213 } 213 }
214 214
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java
@@ -167,6 +167,7 @@ public class MenuServiceImpl implements MenuService { @@ -167,6 +167,7 @@ public class MenuServiceImpl implements MenuService {
167 * @param menuId 菜单编号 167 * @param menuId 菜单编号
168 */ 168 */
169 @Transactional(rollbackFor = Exception.class) 169 @Transactional(rollbackFor = Exception.class)
  170 + @Override
170 public void deleteMenu(Long menuId) { 171 public void deleteMenu(Long menuId) {
171 // 校验是否还有子菜单 172 // 校验是否还有子菜单
172 if (menuMapper.selectCountByParentId(menuId) > 0) { 173 if (menuMapper.selectCountByParentId(menuId) > 0) {
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateService.java
@@ -110,6 +110,6 @@ public interface SmsTemplateService { @@ -110,6 +110,6 @@ public interface SmsTemplateService {
110 * @param channelId 短信渠道编号 110 * @param channelId 短信渠道编号
111 * @return 数量 111 * @return 数量
112 */ 112 */
113 - Integer countByChannelId(Long channelId); 113 + Long countByChannelId(Long channelId);
114 114
115 } 115 }
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceImpl.java
@@ -216,7 +216,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService { @@ -216,7 +216,7 @@ public class SmsTemplateServiceImpl implements SmsTemplateService {
216 } 216 }
217 217
218 @Override 218 @Override
219 - public Integer countByChannelId(Long channelId) { 219 + public Long countByChannelId(Long channelId) {
220 return smsTemplateMapper.selectCountByChannelId(channelId); 220 return smsTemplateMapper.selectCountByChannelId(channelId);
221 } 221 }
222 222
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/dict/DictTypeServiceTest.java
@@ -177,7 +177,7 @@ public class DictTypeServiceTest extends BaseDbUnitTest { @@ -177,7 +177,7 @@ public class DictTypeServiceTest extends BaseDbUnitTest {
177 // 准备参数 177 // 准备参数
178 Long id = dbDictType.getId(); 178 Long id = dbDictType.getId();
179 // mock 方法 179 // mock 方法
180 - when(dictDataService.countByDictType(eq(dbDictType.getType()))).thenReturn(1); 180 + when(dictDataService.countByDictType(eq(dbDictType.getType()))).thenReturn(1L);
181 181
182 // 调用, 并断言异常 182 // 调用, 并断言异常
183 assertServiceException(() -> dictTypeService.deleteDictType(id), DICT_TYPE_HAS_CHILDREN); 183 assertServiceException(() -> dictTypeService.deleteDictType(id), DICT_TYPE_HAS_CHILDREN);
yudao-module-system/yudao-module-system-impl/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceTest.java
@@ -147,7 +147,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest { @@ -147,7 +147,7 @@ public class SmsChannelServiceTest extends BaseDbUnitTest {
147 // 准备参数 147 // 准备参数
148 Long id = dbSmsChannel.getId(); 148 Long id = dbSmsChannel.getId();
149 // mock 方法 149 // mock 方法
150 - when(smsTemplateService.countByChannelId(eq(id))).thenReturn(10); 150 + when(smsTemplateService.countByChannelId(eq(id))).thenReturn(10L);
151 151
152 // 调用, 并断言异常 152 // 调用, 并断言异常
153 assertServiceException(() -> smsChannelService.deleteSmsChannel(id), SMS_CHANNEL_HAS_CHILDREN); 153 assertServiceException(() -> smsChannelService.deleteSmsChannel(id), SMS_CHANNEL_HAS_CHILDREN);