学校空间与教务空间接口分离,其他优化

This commit is contained in:
cjw 2024-07-22 10:21:43 +08:00
parent fb1870328e
commit ba6fa6dc98
10 changed files with 65 additions and 4 deletions

View File

@ -44,6 +44,15 @@ public class SysOssTextbookController extends BaseController {
return sysOssTextbookService.queryPageList(bo, pageQuery);
}
/**
* 查询列表
*/
@SaCheckPermission("file:textbook:pageList")
@GetMapping("/school/pageList")
public TableDataInfo<SysOssTextbookVo> schoolList(SysOssTextbookBo bo, PageQuery pageQuery) {
return sysOssTextbookService.queryPageList4School(bo, pageQuery);
}
/**
* 待审核查询列表
*/

View File

@ -179,7 +179,7 @@ public class PortalController extends BaseController {
public TableDataInfo<SysOssTextbookVo> textbookList(HttpServletRequest request, SysOssTextbookBo bo, PageQuery pageQuery) {
String tenantId = ServletUtils.getHeader(request, "Tenantid");
TenantHelper.setDynamic(tenantId);
return ossTextbookService.queryPageList(bo, pageQuery);
return ossTextbookService.queryPageList4School(bo, pageQuery);
}
@GetMapping("/textbook/{id}")

View File

@ -20,8 +20,14 @@ import org.dromara.system.domain.vo.SysOssTextbookVo;
*/
@Mapper
public interface SysOssTextbookMapper extends BaseMapperPlus<SysOssTextbook, SysOssTextbookVo> {
@DataPermission({
@DataColumn(key = "deptName", value = "ot.create_dept")
})
Page<SysOssTextbookVo> selectPageList(@Param("page") Page<SysOssTextbook> page,
@Param(Constants.WRAPPER) Wrapper<SysOssTextbook> queryWrapper);
Page<SysOssTextbookVo> selectPageList4School(@Param("page") Page<SysOssTextbook> page,
@Param(Constants.WRAPPER) Wrapper<SysOssTextbook> queryWrapper);
@DataPermission({
@DataColumn(key = "userName", value = "ot.create_by")

View File

@ -35,6 +35,7 @@ public interface ISysOssTextbookService {
* @return 请填写功能名称分页列表
*/
TableDataInfo<SysOssTextbookVo> queryPageList(SysOssTextbookBo bo, PageQuery pageQuery);
TableDataInfo<SysOssTextbookVo> queryPageList4School(SysOssTextbookBo bo, PageQuery pageQuery);
/**
* 待审核查询列表

View File

@ -80,6 +80,7 @@ public class SysCatalogPersonServiceImpl implements ISysCatalogPersonService {
lqw.eq(bo.getOrderNum() != null, SysCatalogPerson::getOrderNum, bo.getOrderNum());
lqw.eq(SysCatalogPerson::getCreateBy, bo.getCreateBy());
lqw.eq(SysCatalogPerson::getDelFlag, 0);
lqw.orderByAsc(SysCatalogPerson::getOrderNum);
return lqw;
}

View File

@ -92,7 +92,8 @@ public class SysCatalogResourceServiceImpl implements ISysCatalogResourceService
public List<SysCatalogResourceVo> queryPageList(SysCatalogResourceBo bo) {
List<SysCatalogResourceVo> list = baseMapper.selectVoList(new LambdaQueryWrapper<SysCatalogResource>()
.eq(SysCatalogResource::getParentId, bo.getCatalogId())
.eq(SysCatalogResource::getDelFlag, 0));
.eq(SysCatalogResource::getDelFlag, 0)
.orderByAsc(SysCatalogResource::getOrderNum));
for (SysCatalogResourceVo one : list) {
long num = baseMapper.countOssNum(one.getCatalogId());
one.setResourceNum(num);
@ -127,6 +128,7 @@ public class SysCatalogResourceServiceImpl implements ISysCatalogResourceService
lqw.like(bo.getParentId() != null, SysCatalogResource::getAncestors, bo.getParentId());
lqw.eq(bo.getType() != null, SysCatalogResource::getType, bo.getType());
lqw.eq(SysCatalogResource::getDelFlag, 0);
lqw.orderByAsc(SysCatalogResource::getOrderNum);
return lqw;
}

View File

@ -75,7 +75,8 @@ public class SysCatalogTextbookServiceImpl implements ISysCatalogTextbookService
public List<SysCatalogTextbookVo> queryPageList(SysCatalogTextbookBo bo) {
List<SysCatalogTextbookVo> list = baseMapper.selectVoList(new LambdaQueryWrapper<SysCatalogTextbook>()
.eq(SysCatalogTextbook::getParentId, bo.getCatalogId())
.eq(SysCatalogTextbook::getDelFlag, 0));
.eq(SysCatalogTextbook::getDelFlag, 0)
.orderByAsc(SysCatalogTextbook::getOrderNum));
for (SysCatalogTextbookVo one : list) {
long num = baseMapper.countOssNum(one.getCatalogId());
one.setResourceNum(num);
@ -90,6 +91,7 @@ public class SysCatalogTextbookServiceImpl implements ISysCatalogTextbookService
lqw.like(bo.getParentId() != null, SysCatalogTextbook::getAncestors, bo.getParentId());
lqw.le(bo.getType() != null, SysCatalogTextbook::getType, bo.getType());
lqw.eq(SysCatalogTextbook::getDelFlag, 0);
lqw.orderByAsc(SysCatalogTextbook::getOrderNum);
return lqw;
}

View File

@ -82,6 +82,14 @@ public class SysOssTextbookServiceImpl implements ISysOssTextbookService {
return TableDataInfo.build(result);
}
@Override
public TableDataInfo<SysOssTextbookVo> queryPageList4School(SysOssTextbookBo bo, PageQuery pageQuery) {
bo.setStatus(1);
bo.setOssType(2);
Page<SysOssTextbookVo> result = baseMapper.selectPageList4School(pageQuery.build(), this.buildQueryWrapper4School(bo));
return TableDataInfo.build(result);
}
@Override
public TableDataInfo<SysOssTextbookVo> queryAwaitPageList(SysOssTextbookBo bo, PageQuery pageQuery) {
QueryWrapper<SysOssTextbook> wrapper = Wrappers.query();
@ -117,6 +125,31 @@ public class SysOssTextbookServiceImpl implements ISysOssTextbookService {
}
private Wrapper<SysOssTextbook> buildQueryWrapper(SysOssTextbookBo bo) {
QueryWrapper<SysOssTextbook> wrapper = Wrappers.query();
wrapper.eq("ot.del_flag", 0)
.eq(ObjectUtil.isNotNull(bo.getType()), "ot.type", bo.getType())
.eq(ObjectUtil.isNotNull(bo.getStatus()), "ot.status", bo.getStatus())
.eq(StringUtils.isNotEmpty(bo.getFileSuffix()), "ot.file_suffix", bo.getFileSuffix())
.eq(ObjectUtil.isNotNull(bo.getCreateBy()), "ot.create_by", bo.getCreateBy())
.eq(ObjectUtil.isNotNull(bo.getOssType()), "ot.oss_type", bo.getOssType())
.like(StringUtils.isNotEmpty(bo.getFileName()), "ot.file_name", bo.getFileName())
.and(ObjectUtil.isNotNull(bo.getCatalogId()), w -> {
List<SysCatalogTextbook> list = catalogService.selectList(new LambdaQueryWrapper<SysCatalogTextbook>()
.select(SysCatalogTextbook::getCatalogId)
.apply(DataBaseHelper.findInSet(bo.getCatalogId(), "ancestors")));
List<Long> ids = StreamUtils.toList(list, SysCatalogTextbook::getCatalogId);
ids.add(bo.getCatalogId());
w.in("ot.catalog_id", ids);
})
.and(ObjectUtil.isNotNull(bo.getFormatSuffix()), w -> {
Integer format = bo.getFormatSuffix();
List<String> list = processFormatSuffixQuery(format);
w.in(ArrayUtil.isEmpty(list), "ot.file_suffix", list);
});
return wrapper;
}
private Wrapper<SysOssTextbook> buildQueryWrapper4School(SysOssTextbookBo bo) {
QueryWrapper<SysOssTextbook> wrapper = Wrappers.query();
wrapper.eq("ot.del_flag", 0)
.eq(ObjectUtil.isNotNull(bo.getType()), "ot.type", bo.getType())

View File

@ -140,7 +140,7 @@ public class SysTeacherServiceImpl implements ISysTeacherService {
}
} else {
if (ObjectUtil.isNotNull(sysTeacherVo)) {
if (ObjectUtil.equals(sysTeacherVo.getTeacherId().toString(), entity.getTeacherId().toString())) {
if (!ObjectUtil.equals(sysTeacherVo.getTeacherId().toString(), entity.getTeacherId().toString())) {
throw new ServiceException("存在相同手机号,请确认后再新增");
}
}

View File

@ -10,6 +10,13 @@
${ew.getCustomSqlSegment}
</select>
<select id="selectPageList4School">
select ot.*, o.volume
from sys_oss_textbook ot
left join sys_oss o on o.oss_id = ot.oss_id
${ew.getCustomSqlSegment}
</select>
<select id="selectPageAwaitList" resultType="org.dromara.system.domain.vo.SysOssTextbookVo">
select ot.*, o.volume
from sys_oss_textbook ot