学校空间与教务空间接口分离,其他优化
This commit is contained in:
parent
fb1870328e
commit
ba6fa6dc98
|
@ -44,6 +44,15 @@ public class SysOssTextbookController extends BaseController {
|
||||||
return sysOssTextbookService.queryPageList(bo, pageQuery);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 待审核查询列表
|
* 待审核查询列表
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -179,7 +179,7 @@ public class PortalController extends BaseController {
|
||||||
public TableDataInfo<SysOssTextbookVo> textbookList(HttpServletRequest request, SysOssTextbookBo bo, PageQuery pageQuery) {
|
public TableDataInfo<SysOssTextbookVo> textbookList(HttpServletRequest request, SysOssTextbookBo bo, PageQuery pageQuery) {
|
||||||
String tenantId = ServletUtils.getHeader(request, "Tenantid");
|
String tenantId = ServletUtils.getHeader(request, "Tenantid");
|
||||||
TenantHelper.setDynamic(tenantId);
|
TenantHelper.setDynamic(tenantId);
|
||||||
return ossTextbookService.queryPageList(bo, pageQuery);
|
return ossTextbookService.queryPageList4School(bo, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/textbook/{id}")
|
@GetMapping("/textbook/{id}")
|
||||||
|
|
|
@ -20,8 +20,14 @@ import org.dromara.system.domain.vo.SysOssTextbookVo;
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface SysOssTextbookMapper extends BaseMapperPlus<SysOssTextbook, SysOssTextbookVo> {
|
public interface SysOssTextbookMapper extends BaseMapperPlus<SysOssTextbook, SysOssTextbookVo> {
|
||||||
|
|
||||||
|
@DataPermission({
|
||||||
|
@DataColumn(key = "deptName", value = "ot.create_dept")
|
||||||
|
})
|
||||||
Page<SysOssTextbookVo> selectPageList(@Param("page") Page<SysOssTextbook> page,
|
Page<SysOssTextbookVo> selectPageList(@Param("page") Page<SysOssTextbook> page,
|
||||||
@Param(Constants.WRAPPER) Wrapper<SysOssTextbook> queryWrapper);
|
@Param(Constants.WRAPPER) Wrapper<SysOssTextbook> queryWrapper);
|
||||||
|
Page<SysOssTextbookVo> selectPageList4School(@Param("page") Page<SysOssTextbook> page,
|
||||||
|
@Param(Constants.WRAPPER) Wrapper<SysOssTextbook> queryWrapper);
|
||||||
|
|
||||||
@DataPermission({
|
@DataPermission({
|
||||||
@DataColumn(key = "userName", value = "ot.create_by")
|
@DataColumn(key = "userName", value = "ot.create_by")
|
||||||
|
|
|
@ -35,6 +35,7 @@ public interface ISysOssTextbookService {
|
||||||
* @return 【请填写功能名称】分页列表
|
* @return 【请填写功能名称】分页列表
|
||||||
*/
|
*/
|
||||||
TableDataInfo<SysOssTextbookVo> queryPageList(SysOssTextbookBo bo, PageQuery pageQuery);
|
TableDataInfo<SysOssTextbookVo> queryPageList(SysOssTextbookBo bo, PageQuery pageQuery);
|
||||||
|
TableDataInfo<SysOssTextbookVo> queryPageList4School(SysOssTextbookBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 待审核查询列表
|
* 待审核查询列表
|
||||||
|
|
|
@ -80,6 +80,7 @@ public class SysCatalogPersonServiceImpl implements ISysCatalogPersonService {
|
||||||
lqw.eq(bo.getOrderNum() != null, SysCatalogPerson::getOrderNum, bo.getOrderNum());
|
lqw.eq(bo.getOrderNum() != null, SysCatalogPerson::getOrderNum, bo.getOrderNum());
|
||||||
lqw.eq(SysCatalogPerson::getCreateBy, bo.getCreateBy());
|
lqw.eq(SysCatalogPerson::getCreateBy, bo.getCreateBy());
|
||||||
lqw.eq(SysCatalogPerson::getDelFlag, 0);
|
lqw.eq(SysCatalogPerson::getDelFlag, 0);
|
||||||
|
lqw.orderByAsc(SysCatalogPerson::getOrderNum);
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,8 @@ public class SysCatalogResourceServiceImpl implements ISysCatalogResourceService
|
||||||
public List<SysCatalogResourceVo> queryPageList(SysCatalogResourceBo bo) {
|
public List<SysCatalogResourceVo> queryPageList(SysCatalogResourceBo bo) {
|
||||||
List<SysCatalogResourceVo> list = baseMapper.selectVoList(new LambdaQueryWrapper<SysCatalogResource>()
|
List<SysCatalogResourceVo> list = baseMapper.selectVoList(new LambdaQueryWrapper<SysCatalogResource>()
|
||||||
.eq(SysCatalogResource::getParentId, bo.getCatalogId())
|
.eq(SysCatalogResource::getParentId, bo.getCatalogId())
|
||||||
.eq(SysCatalogResource::getDelFlag, 0));
|
.eq(SysCatalogResource::getDelFlag, 0)
|
||||||
|
.orderByAsc(SysCatalogResource::getOrderNum));
|
||||||
for (SysCatalogResourceVo one : list) {
|
for (SysCatalogResourceVo one : list) {
|
||||||
long num = baseMapper.countOssNum(one.getCatalogId());
|
long num = baseMapper.countOssNum(one.getCatalogId());
|
||||||
one.setResourceNum(num);
|
one.setResourceNum(num);
|
||||||
|
@ -127,6 +128,7 @@ public class SysCatalogResourceServiceImpl implements ISysCatalogResourceService
|
||||||
lqw.like(bo.getParentId() != null, SysCatalogResource::getAncestors, bo.getParentId());
|
lqw.like(bo.getParentId() != null, SysCatalogResource::getAncestors, bo.getParentId());
|
||||||
lqw.eq(bo.getType() != null, SysCatalogResource::getType, bo.getType());
|
lqw.eq(bo.getType() != null, SysCatalogResource::getType, bo.getType());
|
||||||
lqw.eq(SysCatalogResource::getDelFlag, 0);
|
lqw.eq(SysCatalogResource::getDelFlag, 0);
|
||||||
|
lqw.orderByAsc(SysCatalogResource::getOrderNum);
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,8 @@ public class SysCatalogTextbookServiceImpl implements ISysCatalogTextbookService
|
||||||
public List<SysCatalogTextbookVo> queryPageList(SysCatalogTextbookBo bo) {
|
public List<SysCatalogTextbookVo> queryPageList(SysCatalogTextbookBo bo) {
|
||||||
List<SysCatalogTextbookVo> list = baseMapper.selectVoList(new LambdaQueryWrapper<SysCatalogTextbook>()
|
List<SysCatalogTextbookVo> list = baseMapper.selectVoList(new LambdaQueryWrapper<SysCatalogTextbook>()
|
||||||
.eq(SysCatalogTextbook::getParentId, bo.getCatalogId())
|
.eq(SysCatalogTextbook::getParentId, bo.getCatalogId())
|
||||||
.eq(SysCatalogTextbook::getDelFlag, 0));
|
.eq(SysCatalogTextbook::getDelFlag, 0)
|
||||||
|
.orderByAsc(SysCatalogTextbook::getOrderNum));
|
||||||
for (SysCatalogTextbookVo one : list) {
|
for (SysCatalogTextbookVo one : list) {
|
||||||
long num = baseMapper.countOssNum(one.getCatalogId());
|
long num = baseMapper.countOssNum(one.getCatalogId());
|
||||||
one.setResourceNum(num);
|
one.setResourceNum(num);
|
||||||
|
@ -90,6 +91,7 @@ public class SysCatalogTextbookServiceImpl implements ISysCatalogTextbookService
|
||||||
lqw.like(bo.getParentId() != null, SysCatalogTextbook::getAncestors, bo.getParentId());
|
lqw.like(bo.getParentId() != null, SysCatalogTextbook::getAncestors, bo.getParentId());
|
||||||
lqw.le(bo.getType() != null, SysCatalogTextbook::getType, bo.getType());
|
lqw.le(bo.getType() != null, SysCatalogTextbook::getType, bo.getType());
|
||||||
lqw.eq(SysCatalogTextbook::getDelFlag, 0);
|
lqw.eq(SysCatalogTextbook::getDelFlag, 0);
|
||||||
|
lqw.orderByAsc(SysCatalogTextbook::getOrderNum);
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,14 @@ public class SysOssTextbookServiceImpl implements ISysOssTextbookService {
|
||||||
return TableDataInfo.build(result);
|
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
|
@Override
|
||||||
public TableDataInfo<SysOssTextbookVo> queryAwaitPageList(SysOssTextbookBo bo, PageQuery pageQuery) {
|
public TableDataInfo<SysOssTextbookVo> queryAwaitPageList(SysOssTextbookBo bo, PageQuery pageQuery) {
|
||||||
QueryWrapper<SysOssTextbook> wrapper = Wrappers.query();
|
QueryWrapper<SysOssTextbook> wrapper = Wrappers.query();
|
||||||
|
@ -117,6 +125,31 @@ public class SysOssTextbookServiceImpl implements ISysOssTextbookService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Wrapper<SysOssTextbook> buildQueryWrapper(SysOssTextbookBo bo) {
|
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();
|
QueryWrapper<SysOssTextbook> wrapper = Wrappers.query();
|
||||||
wrapper.eq("ot.del_flag", 0)
|
wrapper.eq("ot.del_flag", 0)
|
||||||
.eq(ObjectUtil.isNotNull(bo.getType()), "ot.type", bo.getType())
|
.eq(ObjectUtil.isNotNull(bo.getType()), "ot.type", bo.getType())
|
||||||
|
|
|
@ -140,7 +140,7 @@ public class SysTeacherServiceImpl implements ISysTeacherService {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ObjectUtil.isNotNull(sysTeacherVo)) {
|
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("存在相同手机号,请确认后再新增");
|
throw new ServiceException("存在相同手机号,请确认后再新增");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,13 @@
|
||||||
${ew.getCustomSqlSegment}
|
${ew.getCustomSqlSegment}
|
||||||
</select>
|
</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 id="selectPageAwaitList" resultType="org.dromara.system.domain.vo.SysOssTextbookVo">
|
||||||
select ot.*, o.volume
|
select ot.*, o.volume
|
||||||
from sys_oss_textbook ot
|
from sys_oss_textbook ot
|
||||||
|
|
Loading…
Reference in New Issue