mirror of https://gitee.com/stylefeng/roses
【app】更新应用管理
parent
acecbfffb4
commit
6aa8fbc291
|
@ -38,6 +38,18 @@ public class SysAppController {
|
|||
return new SuccessResponseData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除系统应用
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/3/25 14:54
|
||||
*/
|
||||
@PostResource(name = "删除系统应用", path = "/sysApp/delete")
|
||||
public ResponseData delete(@RequestBody @Validated(SysAppRequest.delete.class) SysAppRequest sysAppParam) {
|
||||
sysAppService.del(sysAppParam);
|
||||
return new SuccessResponseData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑系统应用
|
||||
*
|
||||
|
@ -50,6 +62,39 @@ public class SysAppController {
|
|||
return new SuccessResponseData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看系统应用
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/3/26 9:49
|
||||
*/
|
||||
@GetResource(name = "查看系统应用", path = "/sysApp/detail")
|
||||
public ResponseData detail(@Validated(SysAppRequest.detail.class) SysAppRequest sysAppParam) {
|
||||
return new SuccessResponseData(sysAppService.detail(sysAppParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统应用列表
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/4/19 14:55
|
||||
*/
|
||||
@GetResource(name = "系统应用列表", path = "/sysApp/list")
|
||||
public ResponseData list(SysAppRequest sysAppParam) {
|
||||
return new SuccessResponseData(sysAppService.findList(sysAppParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询系统应用
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/3/20 21:23
|
||||
*/
|
||||
@GetResource(name = "查询系统应用", path = "/sysApp/page")
|
||||
public ResponseData page(SysAppRequest sysAppParam) {
|
||||
return new SuccessResponseData(sysAppService.findPage(sysAppParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将应用设为默认应用,用户进入系统会默认进这个应用的菜单
|
||||
*
|
||||
|
@ -74,49 +119,4 @@ public class SysAppController {
|
|||
return new SuccessResponseData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除系统应用
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/3/25 14:54
|
||||
*/
|
||||
@PostResource(name = "删除系统应用", path = "/sysApp/delete")
|
||||
public ResponseData delete(@RequestBody @Validated(SysAppRequest.delete.class) SysAppRequest sysAppParam) {
|
||||
sysAppService.delete(sysAppParam);
|
||||
return new SuccessResponseData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看系统应用
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/3/26 9:49
|
||||
*/
|
||||
@GetResource(name = "查看系统应用", path = "/sysApp/detail")
|
||||
public ResponseData detail(@Validated(SysAppRequest.detail.class) SysAppRequest sysAppParam) {
|
||||
return new SuccessResponseData(sysAppService.detail(sysAppParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询系统应用
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/3/20 21:23
|
||||
*/
|
||||
@GetResource(name = "查询系统应用", path = "/sysApp/page")
|
||||
public ResponseData page(SysAppRequest sysAppParam) {
|
||||
return new SuccessResponseData(sysAppService.page(sysAppParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统应用列表
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/4/19 14:55
|
||||
*/
|
||||
@GetResource(name = "系统应用列表", path = "/sysApp/list")
|
||||
public ResponseData list(SysAppRequest sysAppParam) {
|
||||
return new SuccessResponseData(sysAppService.list(sysAppParam));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -48,6 +48,15 @@ public interface SysAppService extends IService<SysApp> {
|
|||
*/
|
||||
void add(SysAppRequest sysAppParam);
|
||||
|
||||
/**
|
||||
* 删除系统应用
|
||||
*
|
||||
* @param sysAppParam 删除参数
|
||||
* @author fengshuonan
|
||||
* @date 2020/3/25 14:57
|
||||
*/
|
||||
void del(SysAppRequest sysAppParam);
|
||||
|
||||
/**
|
||||
* 编辑系统应用
|
||||
*
|
||||
|
@ -57,6 +66,36 @@ public interface SysAppService extends IService<SysApp> {
|
|||
*/
|
||||
void edit(SysAppRequest sysAppParam);
|
||||
|
||||
/**
|
||||
* 查看系统应用
|
||||
*
|
||||
* @param sysAppParam 查看参数
|
||||
* @return 系统应用
|
||||
* @author fengshuonan
|
||||
* @date 2020/3/26 9:50
|
||||
*/
|
||||
SysApp detail(SysAppRequest sysAppParam);
|
||||
|
||||
/**
|
||||
* 系统应用列表
|
||||
*
|
||||
* @param sysAppParam 查询参数
|
||||
* @return 系统应用列表
|
||||
* @author fengshuonan
|
||||
* @date 2020/4/19 14:56
|
||||
*/
|
||||
List<SysApp> findList(SysAppRequest sysAppParam);
|
||||
|
||||
/**
|
||||
* 查询系统应用
|
||||
*
|
||||
* @param sysAppParam 查询参数
|
||||
* @return 查询分页结果
|
||||
* @author fengshuonan
|
||||
* @date 2020/3/24 20:55
|
||||
*/
|
||||
PageResult<SysApp> findPage(SysAppRequest sysAppParam);
|
||||
|
||||
/**
|
||||
* 将应用设为默认应用,用户进入系统会默认进这个应用的菜单
|
||||
*
|
||||
|
@ -75,43 +114,4 @@ public interface SysAppService extends IService<SysApp> {
|
|||
*/
|
||||
void updateStatus(SysAppRequest sysAppParam);
|
||||
|
||||
/**
|
||||
* 删除系统应用
|
||||
*
|
||||
* @param sysAppParam 删除参数
|
||||
* @author fengshuonan
|
||||
* @date 2020/3/25 14:57
|
||||
*/
|
||||
void delete(SysAppRequest sysAppParam);
|
||||
|
||||
/**
|
||||
* 查看系统应用
|
||||
*
|
||||
* @param sysAppParam 查看参数
|
||||
* @return 系统应用
|
||||
* @author fengshuonan
|
||||
* @date 2020/3/26 9:50
|
||||
*/
|
||||
SysApp detail(SysAppRequest sysAppParam);
|
||||
|
||||
/**
|
||||
* 查询系统应用
|
||||
*
|
||||
* @param sysAppParam 查询参数
|
||||
* @return 查询分页结果
|
||||
* @author fengshuonan
|
||||
* @date 2020/3/24 20:55
|
||||
*/
|
||||
PageResult<SysApp> page(SysAppRequest sysAppParam);
|
||||
|
||||
/**
|
||||
* 系统应用列表
|
||||
*
|
||||
* @param sysAppParam 查询参数
|
||||
* @return 系统应用列表
|
||||
* @author fengshuonan
|
||||
* @date 2020/4/19 14:56
|
||||
*/
|
||||
List<SysApp> list(SysAppRequest sysAppParam);
|
||||
|
||||
}
|
||||
|
|
|
@ -59,6 +59,23 @@ public class SysAppServiceImpl extends ServiceImpl<SysAppMapper, SysApp> impleme
|
|||
this.save(sysApp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void del(SysAppRequest sysAppRequest) {
|
||||
SysApp sysApp = this.querySysApp(sysAppRequest);
|
||||
String code = sysApp.getAppCode();
|
||||
|
||||
// 该应用下有菜单,则不能删除
|
||||
boolean hasMenu = menuApi.hasMenu(code);
|
||||
if (hasMenu) {
|
||||
throw new ServiceException(AppExceptionEnum.APP_CANNOT_DELETE);
|
||||
}
|
||||
|
||||
// 逻辑删除
|
||||
sysApp.setDelFlag(YesOrNotEnum.Y.getCode());
|
||||
|
||||
this.updateById(sysApp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(SysAppRequest sysAppRequest) {
|
||||
|
||||
|
@ -77,6 +94,24 @@ public class SysAppServiceImpl extends ServiceImpl<SysAppMapper, SysApp> impleme
|
|||
this.updateById(sysApp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysApp detail(SysAppRequest sysAppRequest) {
|
||||
return this.querySysApp(sysAppRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysApp> findList(SysAppRequest sysAppRequest) {
|
||||
LambdaQueryWrapper<SysApp> wrapper = createWrapper(sysAppRequest);
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SysApp> findPage(SysAppRequest sysAppRequest) {
|
||||
LambdaQueryWrapper<SysApp> wrapper = createWrapper(sysAppRequest);
|
||||
Page<SysApp> page = this.page(PageFactory.defaultPage(), wrapper);
|
||||
return PageResultFactory.createPageResult(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateActiveFlag(SysAppRequest sysAppRequest) {
|
||||
|
@ -107,41 +142,6 @@ public class SysAppServiceImpl extends ServiceImpl<SysAppMapper, SysApp> impleme
|
|||
this.updateById(currentApp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(SysAppRequest sysAppRequest) {
|
||||
SysApp sysApp = this.querySysApp(sysAppRequest);
|
||||
String code = sysApp.getAppCode();
|
||||
|
||||
// 该应用下有菜单,则不能删除
|
||||
boolean hasMenu = menuApi.hasMenu(code);
|
||||
if (hasMenu) {
|
||||
throw new ServiceException(AppExceptionEnum.APP_CANNOT_DELETE);
|
||||
}
|
||||
|
||||
// 逻辑删除
|
||||
sysApp.setDelFlag(YesOrNotEnum.Y.getCode());
|
||||
|
||||
this.updateById(sysApp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysApp detail(SysAppRequest sysAppRequest) {
|
||||
return this.querySysApp(sysAppRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SysApp> page(SysAppRequest sysAppRequest) {
|
||||
LambdaQueryWrapper<SysApp> wrapper = createWrapper(sysAppRequest);
|
||||
Page<SysApp> page = this.page(PageFactory.defaultPage(), wrapper);
|
||||
return PageResultFactory.createPageResult(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysApp> list(SysAppRequest sysAppRequest) {
|
||||
LambdaQueryWrapper<SysApp> wrapper = createWrapper(sysAppRequest);
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<SimpleDict> getAppsByAppCodes(Set<String> appCodes) {
|
||||
HashSet<SimpleDict> simpleDicts = new HashSet<>();
|
||||
|
|
Loading…
Reference in New Issue