【app】更新应用管理

pull/3/head
fengshuonan 2021-02-01 18:52:32 +08:00
parent acecbfffb4
commit 6aa8fbc291
3 changed files with 119 additions and 119 deletions

View File

@ -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));
}
}

View File

@ -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);
}

View File

@ -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<>();