新增题库配置、题库、用户试卷存储后端增删改查接口
This commit is contained in:
@ -104,7 +104,7 @@ public class AuthController {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
scheduledExecutorService.schedule(() -> {
|
||||
SseMessageDto dto = new SseMessageDto();
|
||||
dto.setMessage("欢迎登录RuoYi-Vue-Plus后台管理系统");
|
||||
dto.setMessage("欢迎登录新能源项目管理系统");
|
||||
dto.setUserIds(List.of(userId));
|
||||
SseMessageUtils.publishMessage(dto);
|
||||
}, 5, TimeUnit.SECONDS);
|
||||
|
@ -86,7 +86,7 @@ public interface IBusMachineryDetailService extends IService<BusMachineryDetail>
|
||||
* @param req 机械详情查询条件
|
||||
* @return 机械详情查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusMachineryDetail> buildQuery(MachineryDetailQueryReq req);
|
||||
LambdaQueryWrapper<BusMachineryDetail> buildQueryWrapper(MachineryDetailQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取机械详情分页对象视图
|
||||
|
@ -86,7 +86,7 @@ public interface IBusMachineryService extends IService<BusMachinery> {
|
||||
* @param req 机械查询条件
|
||||
* @return 机械查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusMachinery> buildQuery(MachineryQueryReq req);
|
||||
LambdaQueryWrapper<BusMachinery> buildQueryWrapper(MachineryQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取机械分页对象视图
|
||||
|
@ -2,7 +2,6 @@ package org.dromara.machinery.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import jakarta.annotation.Resource;
|
||||
@ -78,7 +77,7 @@ public class BusMachineryDetailServiceImpl extends ServiceImpl<BusMachineryDetai
|
||||
@Override
|
||||
public TableDataInfo<BusMachineryDetailVo> queryPageList(MachineryDetailQueryReq req, PageQuery pageQuery) {
|
||||
// 查询数据库
|
||||
Page<BusMachineryDetail> result = this.page(pageQuery.build(), this.buildQuery(req));
|
||||
Page<BusMachineryDetail> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
@ -90,7 +89,7 @@ public class BusMachineryDetailServiceImpl extends ServiceImpl<BusMachineryDetai
|
||||
*/
|
||||
@Override
|
||||
public List<BusMachineryDetailVo> queryList(MachineryDetailQueryReq req) {
|
||||
LambdaQueryWrapper<BusMachineryDetail> lqw = this.buildQuery(req);
|
||||
LambdaQueryWrapper<BusMachineryDetail> lqw = this.buildQueryWrapper(req);
|
||||
List<BusMachineryDetail> list = this.list(lqw);
|
||||
return list.stream().map(this::getVo).toList();
|
||||
}
|
||||
@ -215,7 +214,7 @@ public class BusMachineryDetailServiceImpl extends ServiceImpl<BusMachineryDetai
|
||||
* @return 机械详情查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusMachineryDetail> buildQuery(MachineryDetailQueryReq req) {
|
||||
public LambdaQueryWrapper<BusMachineryDetail> buildQueryWrapper(MachineryDetailQueryReq req) {
|
||||
LambdaQueryWrapper<BusMachineryDetail> lqw = new LambdaQueryWrapper<>();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
|
@ -74,7 +74,7 @@ public class BusMachineryServiceImpl extends ServiceImpl<BusMachineryMapper, Bus
|
||||
@Override
|
||||
public TableDataInfo<BusMachineryVo> queryPageList(MachineryQueryReq req, PageQuery pageQuery) {
|
||||
// 查询数据库
|
||||
Page<BusMachinery> result = this.page(pageQuery.build(), this.buildQuery(req));
|
||||
Page<BusMachinery> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ public class BusMachineryServiceImpl extends ServiceImpl<BusMachineryMapper, Bus
|
||||
*/
|
||||
@Override
|
||||
public List<BusMachineryVo> queryList(MachineryQueryReq req) {
|
||||
LambdaQueryWrapper<BusMachinery> lqw = this.buildQuery(req);
|
||||
LambdaQueryWrapper<BusMachinery> lqw = this.buildQueryWrapper(req);
|
||||
List<BusMachinery> list = this.list(lqw);
|
||||
return list.stream().map(this::getVo).toList();
|
||||
}
|
||||
@ -210,7 +210,7 @@ public class BusMachineryServiceImpl extends ServiceImpl<BusMachineryMapper, Bus
|
||||
* @return 机械查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusMachinery> buildQuery(MachineryQueryReq req) {
|
||||
public LambdaQueryWrapper<BusMachinery> buildQueryWrapper(MachineryQueryReq req) {
|
||||
LambdaQueryWrapper<BusMachinery> lqw = new LambdaQueryWrapper<>();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
|
@ -78,7 +78,7 @@ public interface IBusCompanyService extends IService<BusCompany> {
|
||||
* @param req 查询条件
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusCompany> buildQuery(CompanyQueryReq req);
|
||||
LambdaQueryWrapper<BusCompany> buildQueryWrapper(CompanyQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取公司分页对象视图
|
||||
|
@ -86,7 +86,7 @@ public interface IBusMaterialsInventoryService extends IService<BusMaterialsInve
|
||||
* @param req 查询条件
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusMaterialsInventory> buildQuery(MaterialsInventoryQueryReq req);
|
||||
LambdaQueryWrapper<BusMaterialsInventory> buildQueryWrapper(MaterialsInventoryQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取材料出/入库分页对象视图
|
||||
|
@ -86,7 +86,7 @@ public interface IBusMaterialsService extends IService<BusMaterials> {
|
||||
* @param req 查询条件
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusMaterials> buildQuery(MaterialsQueryReq req);
|
||||
LambdaQueryWrapper<BusMaterials> buildQueryWrapper(MaterialsQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取材料分页对象视图
|
||||
|
@ -70,7 +70,7 @@ public class BusCompanyServiceImpl extends ServiceImpl<BusCompanyMapper, BusComp
|
||||
@Override
|
||||
public TableDataInfo<BusCompanyVo> queryPageList(CompanyQueryReq req, PageQuery pageQuery) {
|
||||
// 查询数据库
|
||||
Page<BusCompany> result = this.page(pageQuery.build(), this.buildQuery(req));
|
||||
Page<BusCompany> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getCompanyVoPage(result));
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ public class BusCompanyServiceImpl extends ServiceImpl<BusCompanyMapper, BusComp
|
||||
*/
|
||||
@Override
|
||||
public List<BusCompanyVo> queryList(CompanyQueryReq req) {
|
||||
LambdaQueryWrapper<BusCompany> lqw = this.buildQuery(req);
|
||||
LambdaQueryWrapper<BusCompany> lqw = this.buildQueryWrapper(req);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ public class BusCompanyServiceImpl extends ServiceImpl<BusCompanyMapper, BusComp
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusCompany> buildQuery(CompanyQueryReq req) {
|
||||
public LambdaQueryWrapper<BusCompany> buildQueryWrapper(CompanyQueryReq req) {
|
||||
LambdaQueryWrapper<BusCompany> lqw = new LambdaQueryWrapper<>();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
|
@ -73,7 +73,7 @@ public class BusMaterialsInventoryServiceImpl extends ServiceImpl<BusMaterialsIn
|
||||
@Override
|
||||
public TableDataInfo<BusMaterialsInventoryVo> queryPageList(MaterialsInventoryQueryReq req, PageQuery pageQuery) {
|
||||
// 查询数据库
|
||||
Page<BusMaterialsInventory> result = this.page(pageQuery.build(), this.buildQuery(req));
|
||||
Page<BusMaterialsInventory> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ public class BusMaterialsInventoryServiceImpl extends ServiceImpl<BusMaterialsIn
|
||||
*/
|
||||
@Override
|
||||
public List<BusMaterialsInventoryVo> queryList(MaterialsInventoryQueryReq req) {
|
||||
LambdaQueryWrapper<BusMaterialsInventory> lqw = this.buildQuery(req);
|
||||
LambdaQueryWrapper<BusMaterialsInventory> lqw = this.buildQueryWrapper(req);
|
||||
List<BusMaterialsInventory> list = this.list(lqw);
|
||||
return list.stream().map(this::getVo).toList();
|
||||
}
|
||||
@ -212,7 +212,7 @@ public class BusMaterialsInventoryServiceImpl extends ServiceImpl<BusMaterialsIn
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusMaterialsInventory> buildQuery(MaterialsInventoryQueryReq req) {
|
||||
public LambdaQueryWrapper<BusMaterialsInventory> buildQueryWrapper(MaterialsInventoryQueryReq req) {
|
||||
LambdaQueryWrapper<BusMaterialsInventory> lqw = new LambdaQueryWrapper<>();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
|
@ -86,7 +86,7 @@ public class BusMaterialsServiceImpl extends ServiceImpl<BusMaterialsMapper, Bus
|
||||
@Override
|
||||
public TableDataInfo<BusMaterialsVo> queryPageList(MaterialsQueryReq req, PageQuery pageQuery) {
|
||||
// 查询数据库
|
||||
Page<BusMaterials> result = this.page(pageQuery.build(), this.buildQuery(req));
|
||||
Page<BusMaterials> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getMaterialsVoPage(result));
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ public class BusMaterialsServiceImpl extends ServiceImpl<BusMaterialsMapper, Bus
|
||||
*/
|
||||
@Override
|
||||
public List<BusMaterialsVo> queryList(MaterialsQueryReq req) {
|
||||
LambdaQueryWrapper<BusMaterials> lqw = this.buildQuery(req);
|
||||
LambdaQueryWrapper<BusMaterials> lqw = this.buildQueryWrapper(req);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
@ -247,7 +247,7 @@ public class BusMaterialsServiceImpl extends ServiceImpl<BusMaterialsMapper, Bus
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusMaterials> buildQuery(MaterialsQueryReq req) {
|
||||
public LambdaQueryWrapper<BusMaterials> buildQueryWrapper(MaterialsQueryReq req) {
|
||||
LambdaQueryWrapper<BusMaterials> lqw = new LambdaQueryWrapper<>();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
|
@ -86,7 +86,7 @@ public interface IBusConstructionUserService extends IService<BusConstructionUse
|
||||
* @param req 查询条件
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusConstructionUser> buildQuery(ConstructionUserQueryReq req);
|
||||
LambdaQueryWrapper<BusConstructionUser> buildQueryWrapper(ConstructionUserQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取施工人员分页对象视图
|
||||
|
@ -86,7 +86,7 @@ public interface IBusContractorService extends IService<BusContractor> {
|
||||
* @param req 分包公司查询条件
|
||||
* @return 分包公司查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusContractor> buildQuery(ContractorQueryReq req);
|
||||
LambdaQueryWrapper<BusContractor> buildQueryWrapper(ContractorQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取分包公司分页对象视图
|
||||
|
@ -86,7 +86,7 @@ public interface IBusProjectService extends IService<BusProject> {
|
||||
* @param req 查询条件
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusProject> buildQuery(ProjectQueryReq req);
|
||||
LambdaQueryWrapper<BusProject> buildQueryWrapper(ProjectQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取项目分页对象视图
|
||||
|
@ -86,7 +86,7 @@ public interface IBusProjectTeamMemberService extends IService<BusProjectTeamMem
|
||||
* @param req 项目班组成员查询条件
|
||||
* @return 项目班组成员查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusProjectTeamMember> buildQuery(ProjectTeamMemberQueryReq req);
|
||||
LambdaQueryWrapper<BusProjectTeamMember> buildQueryWrapper(ProjectTeamMemberQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取项目班组成员分页对象视图
|
||||
|
@ -95,7 +95,7 @@ public interface IBusProjectTeamService extends IService<BusProjectTeam> {
|
||||
* @param req 项目班组查询条件
|
||||
* @return 项目班组查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusProjectTeam> buildQuery(ProjectTeamQueryReq req);
|
||||
LambdaQueryWrapper<BusProjectTeam> buildQueryWrapper(ProjectTeamQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取项目班组分页对象视图
|
||||
|
@ -114,7 +114,7 @@ public interface IBusUserProjectRelevancyService extends IService<BusUserProject
|
||||
* @param req 查询条件
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusUserProjectRelevancy> buildQuery(UserProjectRelevancyQueryReq req);
|
||||
LambdaQueryWrapper<BusUserProjectRelevancy> buildQueryWrapper(UserProjectRelevancyQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取系统用户与项目关联分页视图
|
||||
|
@ -88,7 +88,7 @@ public class BusConstructionUserServiceImpl extends ServiceImpl<BusConstructionU
|
||||
@Override
|
||||
public TableDataInfo<BusConstructionUserVo> queryPageList(ConstructionUserQueryReq req, PageQuery pageQuery) {
|
||||
// 查询数据库
|
||||
Page<BusConstructionUser> result = this.page(pageQuery.build(), this.buildQuery(req));
|
||||
Page<BusConstructionUser> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(getVoPage(result));
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ public class BusConstructionUserServiceImpl extends ServiceImpl<BusConstructionU
|
||||
*/
|
||||
@Override
|
||||
public List<BusConstructionUserVo> queryList(ConstructionUserQueryReq req) {
|
||||
LambdaQueryWrapper<BusConstructionUser> lqw = this.buildQuery(req);
|
||||
LambdaQueryWrapper<BusConstructionUser> lqw = this.buildQueryWrapper(req);
|
||||
List<BusConstructionUser> list = this.list(lqw);
|
||||
return list.stream().map(this::getVo).toList();
|
||||
}
|
||||
@ -242,7 +242,7 @@ public class BusConstructionUserServiceImpl extends ServiceImpl<BusConstructionU
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusConstructionUser> buildQuery(ConstructionUserQueryReq req) {
|
||||
public LambdaQueryWrapper<BusConstructionUser> buildQueryWrapper(ConstructionUserQueryReq req) {
|
||||
LambdaQueryWrapper<BusConstructionUser> lqw = Wrappers.lambdaQuery();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
|
@ -71,7 +71,7 @@ public class BusContractorServiceImpl extends ServiceImpl<BusContractorMapper, B
|
||||
@Override
|
||||
public TableDataInfo<BusContractorVo> queryPageList(ContractorQueryReq req, PageQuery pageQuery) {
|
||||
// 查询数据库
|
||||
Page<BusContractor> result = this.page(pageQuery.build(), this.buildQuery(req));
|
||||
Page<BusContractor> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ public class BusContractorServiceImpl extends ServiceImpl<BusContractorMapper, B
|
||||
*/
|
||||
@Override
|
||||
public List<BusContractorVo> queryList(ContractorQueryReq req) {
|
||||
LambdaQueryWrapper<BusContractor> lqw = this.buildQuery(req);
|
||||
LambdaQueryWrapper<BusContractor> lqw = this.buildQueryWrapper(req);
|
||||
List<BusContractor> list = this.list(lqw);
|
||||
return list.stream().map(this::getVo).toList();
|
||||
}
|
||||
@ -223,7 +223,7 @@ public class BusContractorServiceImpl extends ServiceImpl<BusContractorMapper, B
|
||||
* @return 分包公司查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusContractor> buildQuery(ContractorQueryReq req) {
|
||||
public LambdaQueryWrapper<BusContractor> buildQueryWrapper(ContractorQueryReq req) {
|
||||
LambdaQueryWrapper<BusContractor> lqw = new LambdaQueryWrapper<>();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
|
@ -71,7 +71,7 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
|
||||
@Override
|
||||
public TableDataInfo<BusProjectVo> queryPageList(ProjectQueryReq req, PageQuery pageQuery) {
|
||||
// 查询数据库
|
||||
Page<BusProject> result = this.page(pageQuery.build(), this.buildQuery(req));
|
||||
Page<BusProject> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
|
||||
*/
|
||||
@Override
|
||||
public List<BusProjectVo> queryList(ProjectQueryReq req) {
|
||||
LambdaQueryWrapper<BusProject> lqw = this.buildQuery(req);
|
||||
LambdaQueryWrapper<BusProject> lqw = this.buildQueryWrapper(req);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ public class BusProjectServiceImpl extends ServiceImpl<BusProjectMapper, BusProj
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusProject> buildQuery(ProjectQueryReq req) {
|
||||
public LambdaQueryWrapper<BusProject> buildQueryWrapper(ProjectQueryReq req) {
|
||||
LambdaQueryWrapper<BusProject> lqw = new LambdaQueryWrapper<>();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
|
@ -81,7 +81,7 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
|
||||
@Override
|
||||
public TableDataInfo<BusProjectTeamMemberVo> queryPageList(ProjectTeamMemberQueryReq req, PageQuery pageQuery) {
|
||||
// 查询数据库
|
||||
Page<BusProjectTeamMember> result = this.page(pageQuery.build(), this.buildQuery(req));
|
||||
Page<BusProjectTeamMember> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
|
||||
*/
|
||||
@Override
|
||||
public List<BusProjectTeamMemberVo> queryList(ProjectTeamMemberQueryReq req) {
|
||||
LambdaQueryWrapper<BusProjectTeamMember> lqw = this.buildQuery(req);
|
||||
LambdaQueryWrapper<BusProjectTeamMember> lqw = this.buildQueryWrapper(req);
|
||||
List<BusProjectTeamMember> list = this.list(lqw);
|
||||
return list.stream().map(this::getVo).toList();
|
||||
}
|
||||
@ -262,7 +262,7 @@ public class BusProjectTeamMemberServiceImpl extends ServiceImpl<BusProjectTeamM
|
||||
* @return 项目班组成员查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusProjectTeamMember> buildQuery(ProjectTeamMemberQueryReq req) {
|
||||
public LambdaQueryWrapper<BusProjectTeamMember> buildQueryWrapper(ProjectTeamMemberQueryReq req) {
|
||||
LambdaQueryWrapper<BusProjectTeamMember> lqw = new LambdaQueryWrapper<>();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
|
@ -84,7 +84,7 @@ public class BusProjectTeamServiceImpl extends ServiceImpl<BusProjectTeamMapper,
|
||||
@Override
|
||||
public TableDataInfo<BusProjectTeamVo> queryPageList(ProjectTeamQueryReq req, PageQuery pageQuery) {
|
||||
// 查询数据库
|
||||
Page<BusProjectTeam> result = this.page(pageQuery.build(), this.buildQuery(req));
|
||||
Page<BusProjectTeam> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ public class BusProjectTeamServiceImpl extends ServiceImpl<BusProjectTeamMapper,
|
||||
*/
|
||||
@Override
|
||||
public List<BusProjectTeamVo> queryList(ProjectTeamQueryReq req) {
|
||||
LambdaQueryWrapper<BusProjectTeam> lqw = this.buildQuery(req);
|
||||
LambdaQueryWrapper<BusProjectTeam> lqw = this.buildQueryWrapper(req);
|
||||
List<BusProjectTeam> list = this.list(lqw);
|
||||
return list.stream().map(this::getVo).toList();
|
||||
}
|
||||
@ -262,7 +262,7 @@ public class BusProjectTeamServiceImpl extends ServiceImpl<BusProjectTeamMapper,
|
||||
* @return 项目班组查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusProjectTeam> buildQuery(ProjectTeamQueryReq req) {
|
||||
public LambdaQueryWrapper<BusProjectTeam> buildQueryWrapper(ProjectTeamQueryReq req) {
|
||||
LambdaQueryWrapper<BusProjectTeam> lqw = new LambdaQueryWrapper<>();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
|
@ -77,7 +77,7 @@ public class BusUserProjectRelevancyServiceImpl extends ServiceImpl<BusUserProje
|
||||
@Override
|
||||
public TableDataInfo<BusUserProjectRelevancyVo> queryPageList(UserProjectRelevancyQueryReq req, PageQuery pageQuery) {
|
||||
// 查询数据库
|
||||
Page<BusUserProjectRelevancy> result = this.page(pageQuery.build(), this.buildQuery(req));
|
||||
Page<BusUserProjectRelevancy> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ public class BusUserProjectRelevancyServiceImpl extends ServiceImpl<BusUserProje
|
||||
*/
|
||||
@Override
|
||||
public List<BusUserProjectRelevancyVo> queryList(UserProjectRelevancyQueryReq req) {
|
||||
LambdaQueryWrapper<BusUserProjectRelevancy> queryWrapper = this.buildQuery(req);
|
||||
LambdaQueryWrapper<BusUserProjectRelevancy> queryWrapper = this.buildQueryWrapper(req);
|
||||
return baseMapper.selectVoList(queryWrapper);
|
||||
}
|
||||
|
||||
@ -241,7 +241,7 @@ public class BusUserProjectRelevancyServiceImpl extends ServiceImpl<BusUserProje
|
||||
PageQuery pageQuery) {
|
||||
// 添加查询条件
|
||||
req.setUserId(userId);
|
||||
LambdaQueryWrapper<BusUserProjectRelevancy> queryWrapper = this.buildQuery(req);
|
||||
LambdaQueryWrapper<BusUserProjectRelevancy> queryWrapper = this.buildQueryWrapper(req);
|
||||
// 查询数据库
|
||||
Page<BusUserProjectRelevancy> result = this.page(pageQuery.build(), queryWrapper);
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
@ -313,7 +313,7 @@ public class BusUserProjectRelevancyServiceImpl extends ServiceImpl<BusUserProje
|
||||
* @return 查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusUserProjectRelevancy> buildQuery(UserProjectRelevancyQueryReq req) {
|
||||
public LambdaQueryWrapper<BusUserProjectRelevancy> buildQueryWrapper(UserProjectRelevancyQueryReq req) {
|
||||
LambdaQueryWrapper<BusUserProjectRelevancy> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (req == null) {
|
||||
return queryWrapper;
|
||||
|
@ -0,0 +1,108 @@
|
||||
package org.dromara.safety.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.safety.domain.req.questionbank.QuestionBankCreateReq;
|
||||
import org.dromara.safety.domain.req.questionbank.QuestionBankQueryReq;
|
||||
import org.dromara.safety.domain.req.questionbank.QuestionBankUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusQuestionBankVo;
|
||||
import org.dromara.safety.service.IBusQuestionBankService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 题库
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/safety/questionBank")
|
||||
public class BusQuestionBankController extends BaseController {
|
||||
|
||||
private final IBusQuestionBankService busQuestionBankService;
|
||||
|
||||
/**
|
||||
* 查询题库列表
|
||||
*/
|
||||
@SaCheckPermission("safety:questionBank:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusQuestionBankVo> list(QuestionBankQueryReq req, PageQuery pageQuery) {
|
||||
return busQuestionBankService.queryPageList(req, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出题库列表
|
||||
*/
|
||||
@SaCheckPermission("safety:questionBank:export")
|
||||
@Log(title = "题库", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(QuestionBankQueryReq req, HttpServletResponse response) {
|
||||
List<BusQuestionBankVo> list = busQuestionBankService.queryList(req);
|
||||
ExcelUtil.exportExcel(list, "题库", BusQuestionBankVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取题库详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("safety:questionBank:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusQuestionBankVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busQuestionBankService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增题库
|
||||
*/
|
||||
@SaCheckPermission("safety:questionBank:add")
|
||||
@Log(title = "题库", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Long> add(@Validated(AddGroup.class) @RequestBody QuestionBankCreateReq req) {
|
||||
return R.ok(busQuestionBankService.insertByBo(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改题库
|
||||
*/
|
||||
@SaCheckPermission("safety:questionBank:edit")
|
||||
@Log(title = "题库", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody QuestionBankUpdateReq req) {
|
||||
return toAjax(busQuestionBankService.updateByBo(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除题库
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("safety:questionBank:remove")
|
||||
@Log(title = "题库", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busQuestionBankService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package org.dromara.safety.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.safety.domain.req.questionuseranswer.QuestionUserAnswerCreateReq;
|
||||
import org.dromara.safety.domain.req.questionuseranswer.QuestionUserAnswerQueryReq;
|
||||
import org.dromara.safety.domain.req.questionuseranswer.QuestionUserAnswerUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusQuestionUserAnswerVo;
|
||||
import org.dromara.safety.service.IBusQuestionUserAnswerService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户试卷存储
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/safety/questionUserAnswer")
|
||||
public class BusQuestionUserAnswerController extends BaseController {
|
||||
|
||||
private final IBusQuestionUserAnswerService busQuestionUserAnswerService;
|
||||
|
||||
/**
|
||||
* 查询用户试卷存储列表
|
||||
*/
|
||||
@SaCheckPermission("safety:questionUserAnswer:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusQuestionUserAnswerVo> list(QuestionUserAnswerQueryReq req, PageQuery pageQuery) {
|
||||
return busQuestionUserAnswerService.queryPageList(req, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出用户试卷存储列表
|
||||
*/
|
||||
@SaCheckPermission("safety:questionUserAnswer:export")
|
||||
@Log(title = "用户试卷存储", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(QuestionUserAnswerQueryReq req, HttpServletResponse response) {
|
||||
List<BusQuestionUserAnswerVo> list = busQuestionUserAnswerService.queryList(req);
|
||||
ExcelUtil.exportExcel(list, "用户试卷存储", BusQuestionUserAnswerVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户试卷存储详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("safety:questionUserAnswer:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusQuestionUserAnswerVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busQuestionUserAnswerService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户试卷存储
|
||||
*/
|
||||
@SaCheckPermission("safety:questionUserAnswer:add")
|
||||
@Log(title = "用户试卷存储", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Long> add(@Validated(AddGroup.class) @RequestBody QuestionUserAnswerCreateReq req) {
|
||||
return R.ok(busQuestionUserAnswerService.insertByBo(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户试卷存储
|
||||
*/
|
||||
@SaCheckPermission("safety:questionUserAnswer:edit")
|
||||
@Log(title = "用户试卷存储", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody QuestionUserAnswerUpdateReq req) {
|
||||
return toAjax(busQuestionUserAnswerService.updateByBo(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户试卷存储
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("safety:questionUserAnswer:remove")
|
||||
@Log(title = "用户试卷存储", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busQuestionUserAnswerService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package org.dromara.safety.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.safety.domain.req.questionsconfig.QuestionsConfigCreateReq;
|
||||
import org.dromara.safety.domain.req.questionsconfig.QuestionsConfigQueryReq;
|
||||
import org.dromara.safety.domain.req.questionsconfig.QuestionsConfigUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusQuestionsConfigVo;
|
||||
import org.dromara.safety.service.IBusQuestionsConfigService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 题库配置
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/safety/questionsConfig")
|
||||
public class BusQuestionsConfigController extends BaseController {
|
||||
|
||||
private final IBusQuestionsConfigService busQuestionsConfigService;
|
||||
|
||||
/**
|
||||
* 查询题库配置列表
|
||||
*/
|
||||
@SaCheckPermission("safety:questionsConfig:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BusQuestionsConfigVo> list(QuestionsConfigQueryReq req, PageQuery pageQuery) {
|
||||
return busQuestionsConfigService.queryPageList(req, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出题库配置列表
|
||||
*/
|
||||
@SaCheckPermission("safety:questionsConfig:export")
|
||||
@Log(title = "题库配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(QuestionsConfigQueryReq req, HttpServletResponse response) {
|
||||
List<BusQuestionsConfigVo> list = busQuestionsConfigService.queryList(req);
|
||||
ExcelUtil.exportExcel(list, "题库配置", BusQuestionsConfigVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取题库配置详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("safety:questionsConfig:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<BusQuestionsConfigVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(busQuestionsConfigService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增题库配置
|
||||
*/
|
||||
@SaCheckPermission("safety:questionsConfig:add")
|
||||
@Log(title = "题库配置", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Long> add(@Validated(AddGroup.class) @RequestBody QuestionsConfigCreateReq req) {
|
||||
return R.ok(busQuestionsConfigService.insertByBo(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改题库配置
|
||||
*/
|
||||
@SaCheckPermission("safety:questionsConfig:edit")
|
||||
@Log(title = "题库配置", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody QuestionsConfigUpdateReq req) {
|
||||
return toAjax(busQuestionsConfigService.updateByBo(req));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除题库配置
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("safety:questionsConfig:remove")
|
||||
@Log(title = "题库配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(busQuestionsConfigService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package org.dromara.safety.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 题库对象 bus_question_bank
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_question_bank")
|
||||
public class BusQuestionBank extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 题目类别
|
||||
*/
|
||||
private String categoryType;
|
||||
|
||||
/**
|
||||
* 题目类型
|
||||
*/
|
||||
private String questionType;
|
||||
|
||||
/**
|
||||
* 题目内容
|
||||
*/
|
||||
private String questionContent;
|
||||
|
||||
/**
|
||||
* 选项(以JSON数组形式存储)
|
||||
*/
|
||||
private String options;
|
||||
|
||||
/**
|
||||
* 正确答案
|
||||
*/
|
||||
private String correctAnswer;
|
||||
|
||||
/**
|
||||
* 创建人设备类型
|
||||
*/
|
||||
private String wxOrPc;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
private Date deletedAt;
|
||||
|
||||
/**
|
||||
* 是否删除(0正常 1删除)
|
||||
*/
|
||||
private Long isDelete;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package org.dromara.safety.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户试卷存储对象 bus_question_user_answer
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_question_user_answer")
|
||||
public class BusQuestionUserAnswer extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 题库id列表
|
||||
*/
|
||||
private String bankId;
|
||||
|
||||
/**
|
||||
* 答案列表
|
||||
*/
|
||||
private String answer;
|
||||
|
||||
/**
|
||||
* 得分
|
||||
*/
|
||||
private Long score;
|
||||
|
||||
/**
|
||||
* 用时时间(时间戳/秒)
|
||||
*/
|
||||
private Long takeTime;
|
||||
|
||||
/**
|
||||
* 及格线/总分(格式:60,100)
|
||||
*/
|
||||
private String pass;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
private String file;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
private Date deletedAt;
|
||||
|
||||
/**
|
||||
* 是否删除(0正常 1删除)
|
||||
*/
|
||||
private Long isDelete;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package org.dromara.safety.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 题库配置对象 bus_questions_config
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("bus_questions_config")
|
||||
public class BusQuestionsConfig extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 单选题(单位/道)
|
||||
*/
|
||||
private Long singleChoice;
|
||||
|
||||
/**
|
||||
* 单选分数
|
||||
*/
|
||||
private Long singleScore;
|
||||
|
||||
/**
|
||||
* 多选题(单位/道)
|
||||
*/
|
||||
private Long multipleChoice;
|
||||
|
||||
/**
|
||||
* 多选分数
|
||||
*/
|
||||
private Long multipleScore;
|
||||
|
||||
/**
|
||||
* 判断题(单位/道)
|
||||
*/
|
||||
private Long estimate;
|
||||
|
||||
/**
|
||||
* 判断分数
|
||||
*/
|
||||
private Long estimateScore;
|
||||
|
||||
/**
|
||||
* 满分
|
||||
*/
|
||||
private Long fullMark;
|
||||
|
||||
/**
|
||||
* 及格线
|
||||
*/
|
||||
private Long passScore;
|
||||
|
||||
/**
|
||||
* 答题最大时间(单位/分钟)
|
||||
*/
|
||||
private Long answerTime;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package org.dromara.safety.domain.bo;
|
||||
|
||||
import org.dromara.safety.domain.BusQuestionBank;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 题库业务对象 bus_question_bank
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusQuestionBank.class, reverseConvertGenerate = false)
|
||||
public class BusQuestionBankBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 题目类别
|
||||
*/
|
||||
@NotBlank(message = "题目类别不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String categoryType;
|
||||
|
||||
/**
|
||||
* 题目类型
|
||||
*/
|
||||
@NotBlank(message = "题目类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String questionType;
|
||||
|
||||
/**
|
||||
* 题目内容
|
||||
*/
|
||||
@NotBlank(message = "题目内容不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String questionContent;
|
||||
|
||||
/**
|
||||
* 选项(以JSON数组形式存储)
|
||||
*/
|
||||
@NotBlank(message = "选项(以JSON数组形式存储)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String options;
|
||||
|
||||
/**
|
||||
* 正确答案
|
||||
*/
|
||||
@NotBlank(message = "正确答案不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String correctAnswer;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package org.dromara.safety.domain.bo;
|
||||
|
||||
import org.dromara.safety.domain.BusQuestionUserAnswer;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 用户试卷存储业务对象 bus_question_user_answer
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusQuestionUserAnswer.class, reverseConvertGenerate = false)
|
||||
public class BusQuestionUserAnswerBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 题库id列表
|
||||
*/
|
||||
private Long bankId;
|
||||
|
||||
/**
|
||||
* 答案列表
|
||||
*/
|
||||
private String answer;
|
||||
|
||||
/**
|
||||
* 得分
|
||||
*/
|
||||
private Long score;
|
||||
|
||||
/**
|
||||
* 用时时间(时间戳/秒)
|
||||
*/
|
||||
private Long takeTime;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package org.dromara.safety.domain.bo;
|
||||
|
||||
import org.dromara.safety.domain.BusQuestionsConfig;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 题库配置业务对象 bus_questions_config
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = BusQuestionsConfig.class, reverseConvertGenerate = false)
|
||||
public class BusQuestionsConfigBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@NotNull(message = "主键id不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 单选题(单位/道)
|
||||
*/
|
||||
@NotNull(message = "单选题(单位/道)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long singleChoice;
|
||||
|
||||
/**
|
||||
* 单选分数
|
||||
*/
|
||||
@NotNull(message = "单选分数不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long singleScore;
|
||||
|
||||
/**
|
||||
* 多选题(单位/道)
|
||||
*/
|
||||
@NotNull(message = "多选题(单位/道)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long multipleChoice;
|
||||
|
||||
/**
|
||||
* 多选分数
|
||||
*/
|
||||
@NotNull(message = "多选分数不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long multipleScore;
|
||||
|
||||
/**
|
||||
* 判断题(单位/道)
|
||||
*/
|
||||
@NotNull(message = "判断题(单位/道)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long estimate;
|
||||
|
||||
/**
|
||||
* 判断分数
|
||||
*/
|
||||
@NotNull(message = "判断分数不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long estimateScore;
|
||||
|
||||
/**
|
||||
* 满分
|
||||
*/
|
||||
@NotNull(message = "满分不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long fullMark;
|
||||
|
||||
/**
|
||||
* 及格线
|
||||
*/
|
||||
@NotNull(message = "及格线不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long passScore;
|
||||
|
||||
/**
|
||||
* 答题最大时间(单位/分钟)
|
||||
*/
|
||||
@NotNull(message = "答题最大时间(单位/分钟)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long answerTime;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package org.dromara.safety.domain.req.questionbank;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/3/24 17:32
|
||||
*/
|
||||
@Data
|
||||
public class QuestionBankCreateReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 9014952417764490638L;
|
||||
|
||||
/**
|
||||
* 题目类别
|
||||
*/
|
||||
private String categoryType;
|
||||
|
||||
/**
|
||||
* 题目类型
|
||||
*/
|
||||
private String questionType;
|
||||
|
||||
/**
|
||||
* 题目内容
|
||||
*/
|
||||
private String questionContent;
|
||||
|
||||
/**
|
||||
* 选项(以JSON数组形式存储)
|
||||
*/
|
||||
private List<String> optionList;
|
||||
|
||||
/**
|
||||
* 正确答案
|
||||
*/
|
||||
private String correctAnswer;
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package org.dromara.safety.domain.req.questionbank;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/3/24 17:33
|
||||
*/
|
||||
@Data
|
||||
public class QuestionBankQueryReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -8924454189341614745L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 题目类别
|
||||
*/
|
||||
private String categoryType;
|
||||
|
||||
/**
|
||||
* 题目类型
|
||||
*/
|
||||
private String questionType;
|
||||
|
||||
/**
|
||||
* 题目内容
|
||||
*/
|
||||
private String questionContent;
|
||||
|
||||
/**
|
||||
* 选项(以JSON数组形式存储)
|
||||
*/
|
||||
private List<String> optionList;
|
||||
|
||||
/**
|
||||
* 正确答案
|
||||
*/
|
||||
private String correctAnswer;
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package org.dromara.safety.domain.req.questionbank;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/3/24 17:33
|
||||
*/
|
||||
@Data
|
||||
public class QuestionBankUpdateReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 4537637385171186219L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 题目类别
|
||||
*/
|
||||
private String categoryType;
|
||||
|
||||
/**
|
||||
* 题目类型
|
||||
*/
|
||||
private String questionType;
|
||||
|
||||
/**
|
||||
* 题目内容
|
||||
*/
|
||||
private String questionContent;
|
||||
|
||||
/**
|
||||
* 选项(以JSON数组形式存储)
|
||||
*/
|
||||
private List<String> optionList;
|
||||
|
||||
/**
|
||||
* 正确答案
|
||||
*/
|
||||
private String correctAnswer;
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package org.dromara.safety.domain.req.questionsconfig;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/3/24 17:34
|
||||
*/
|
||||
@Data
|
||||
public class QuestionsConfigCreateReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -6430325731025840429L;
|
||||
|
||||
/**
|
||||
* 单选题(单位/道)
|
||||
*/
|
||||
private Long singleChoice;
|
||||
|
||||
/**
|
||||
* 单选分数
|
||||
*/
|
||||
private Long singleScore;
|
||||
|
||||
/**
|
||||
* 多选题(单位/道)
|
||||
*/
|
||||
private Long multipleChoice;
|
||||
|
||||
/**
|
||||
* 多选分数
|
||||
*/
|
||||
private Long multipleScore;
|
||||
|
||||
/**
|
||||
* 判断题(单位/道)
|
||||
*/
|
||||
private Long estimate;
|
||||
|
||||
/**
|
||||
* 判断分数
|
||||
*/
|
||||
private Long estimateScore;
|
||||
|
||||
/**
|
||||
* 满分
|
||||
*/
|
||||
private Long fullMark;
|
||||
|
||||
/**
|
||||
* 及格线
|
||||
*/
|
||||
private Long passScore;
|
||||
|
||||
/**
|
||||
* 答题最大时间(单位/分钟)
|
||||
*/
|
||||
private Long answerTime;
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package org.dromara.safety.domain.req.questionsconfig;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/3/24 17:34
|
||||
*/
|
||||
@Data
|
||||
public class QuestionsConfigQueryReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 8187034953273515023L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 单选题(单位/道)
|
||||
*/
|
||||
private Long singleChoice;
|
||||
|
||||
/**
|
||||
* 单选分数
|
||||
*/
|
||||
private Long singleScore;
|
||||
|
||||
/**
|
||||
* 多选题(单位/道)
|
||||
*/
|
||||
private Long multipleChoice;
|
||||
|
||||
/**
|
||||
* 多选分数
|
||||
*/
|
||||
private Long multipleScore;
|
||||
|
||||
/**
|
||||
* 判断题(单位/道)
|
||||
*/
|
||||
private Long estimate;
|
||||
|
||||
/**
|
||||
* 判断分数
|
||||
*/
|
||||
private Long estimateScore;
|
||||
|
||||
/**
|
||||
* 满分
|
||||
*/
|
||||
private Long fullMark;
|
||||
|
||||
/**
|
||||
* 及格线
|
||||
*/
|
||||
private Long passScore;
|
||||
|
||||
/**
|
||||
* 答题最大时间(单位/分钟)
|
||||
*/
|
||||
private Long answerTime;
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package org.dromara.safety.domain.req.questionsconfig;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/3/24 17:34
|
||||
*/
|
||||
@Data
|
||||
public class QuestionsConfigUpdateReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 6861554491377407420L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 单选题(单位/道)
|
||||
*/
|
||||
private Long singleChoice;
|
||||
|
||||
/**
|
||||
* 单选分数
|
||||
*/
|
||||
private Long singleScore;
|
||||
|
||||
/**
|
||||
* 多选题(单位/道)
|
||||
*/
|
||||
private Long multipleChoice;
|
||||
|
||||
/**
|
||||
* 多选分数
|
||||
*/
|
||||
private Long multipleScore;
|
||||
|
||||
/**
|
||||
* 判断题(单位/道)
|
||||
*/
|
||||
private Long estimate;
|
||||
|
||||
/**
|
||||
* 判断分数
|
||||
*/
|
||||
private Long estimateScore;
|
||||
|
||||
/**
|
||||
* 满分
|
||||
*/
|
||||
private Long fullMark;
|
||||
|
||||
/**
|
||||
* 及格线
|
||||
*/
|
||||
private Long passScore;
|
||||
|
||||
/**
|
||||
* 答题最大时间(单位/分钟)
|
||||
*/
|
||||
private Long answerTime;
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package org.dromara.safety.domain.req.questionuseranswer;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/3/24 17:35
|
||||
*/
|
||||
@Data
|
||||
public class QuestionUserAnswerCreateReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -8893028317840090277L;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 题库id列表
|
||||
*/
|
||||
private List<Long> bankIdList;
|
||||
|
||||
/**
|
||||
* 答案列表
|
||||
*/
|
||||
private List<String> answerList;
|
||||
|
||||
/**
|
||||
* 得分
|
||||
*/
|
||||
private Long score;
|
||||
|
||||
/**
|
||||
* 用时时间(时间戳/秒)
|
||||
*/
|
||||
private Long takeTime;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
private String file;
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package org.dromara.safety.domain.req.questionuseranswer;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/3/24 17:35
|
||||
*/
|
||||
@Data
|
||||
public class QuestionUserAnswerQueryReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -7056242109124074218L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 题库id列表
|
||||
*/
|
||||
private List<Long> bankIdList;
|
||||
|
||||
/**
|
||||
* 答案列表
|
||||
*/
|
||||
private List<String> answerList;
|
||||
|
||||
/**
|
||||
* 得分
|
||||
*/
|
||||
private Long score;
|
||||
|
||||
/**
|
||||
* 用时时间(时间戳/秒)
|
||||
*/
|
||||
private Long takeTime;
|
||||
|
||||
/**
|
||||
* 及格线/总分(格式:60,100)
|
||||
*/
|
||||
private String pass;
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package org.dromara.safety.domain.req.questionuseranswer;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lcj
|
||||
* @date 2025/3/24 17:35
|
||||
*/
|
||||
@Data
|
||||
public class QuestionUserAnswerUpdateReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -588982799152215348L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 题库id列表
|
||||
*/
|
||||
private List<Long> bankIdList;
|
||||
|
||||
/**
|
||||
* 答案列表
|
||||
*/
|
||||
private List<String> answerList;
|
||||
|
||||
/**
|
||||
* 得分
|
||||
*/
|
||||
private Long score;
|
||||
|
||||
/**
|
||||
* 用时时间(时间戳/秒)
|
||||
*/
|
||||
private Long takeTime;
|
||||
|
||||
/**
|
||||
* 及格线/总分(格式:60,100)
|
||||
*/
|
||||
private String pass;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
private String file;
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.dromara.safety.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.safety.domain.BusQuestionBank;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 题库视图对象 bus_question_bank
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusQuestionBank.class)
|
||||
public class BusQuestionBankVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 题目类别
|
||||
*/
|
||||
@ExcelProperty(value = "题目类别", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "safety_question_category_type")
|
||||
private String categoryType;
|
||||
|
||||
/**
|
||||
* 题目类型
|
||||
*/
|
||||
@ExcelProperty(value = "题目类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "safety_question_type")
|
||||
private String questionType;
|
||||
|
||||
/**
|
||||
* 题目内容
|
||||
*/
|
||||
@ExcelProperty(value = "题目内容")
|
||||
private String questionContent;
|
||||
|
||||
/**
|
||||
* 选项(以JSON数组形式存储)
|
||||
*/
|
||||
@ExcelProperty(value = "选项", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "以=JSON数组形式存储")
|
||||
private List<String> optionList;
|
||||
|
||||
/**
|
||||
* 正确答案
|
||||
*/
|
||||
@ExcelProperty(value = "正确答案")
|
||||
private String correctAnswer;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package org.dromara.safety.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.safety.domain.BusQuestionUserAnswer;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 用户试卷存储视图对象 bus_question_user_answer
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusQuestionUserAnswer.class)
|
||||
public class BusQuestionUserAnswerVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
@ExcelProperty(value = "项目id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@ExcelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 题库id列表
|
||||
*/
|
||||
@ExcelProperty(value = "题库id列表")
|
||||
private List<Long> bankIdList;
|
||||
|
||||
/**
|
||||
* 答案列表
|
||||
*/
|
||||
@ExcelProperty(value = "答案列表")
|
||||
private List<String> answerList;
|
||||
|
||||
/**
|
||||
* 得分
|
||||
*/
|
||||
@ExcelProperty(value = "得分")
|
||||
private Long score;
|
||||
|
||||
/**
|
||||
* 用时时间(时间戳/秒)
|
||||
*/
|
||||
@ExcelProperty(value = "用时时间", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "时=间戳/秒")
|
||||
private Long takeTime;
|
||||
|
||||
/**
|
||||
* 及格线/总分(格式:60,100)
|
||||
*/
|
||||
@ExcelProperty(value = "及格线/总分")
|
||||
private String pass;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
@ExcelProperty(value = "文件地址")
|
||||
private String file;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package org.dromara.safety.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import org.dromara.safety.domain.BusQuestionsConfig;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* 题库配置视图对象 bus_questions_config
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = BusQuestionsConfig.class)
|
||||
public class BusQuestionsConfigVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 单选题(单位/道)
|
||||
*/
|
||||
@ExcelProperty(value = "单选题", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位/道")
|
||||
private Long singleChoice;
|
||||
|
||||
/**
|
||||
* 单选分数
|
||||
*/
|
||||
@ExcelProperty(value = "单选分数")
|
||||
private Long singleScore;
|
||||
|
||||
/**
|
||||
* 多选题(单位/道)
|
||||
*/
|
||||
@ExcelProperty(value = "多选题", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位/道")
|
||||
private Long multipleChoice;
|
||||
|
||||
/**
|
||||
* 多选分数
|
||||
*/
|
||||
@ExcelProperty(value = "多选分数")
|
||||
private Long multipleScore;
|
||||
|
||||
/**
|
||||
* 判断题(单位/道)
|
||||
*/
|
||||
@ExcelProperty(value = "判断题", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位/道")
|
||||
private Long estimate;
|
||||
|
||||
/**
|
||||
* 判断分数
|
||||
*/
|
||||
@ExcelProperty(value = "判断分数")
|
||||
private Long estimateScore;
|
||||
|
||||
/**
|
||||
* 满分
|
||||
*/
|
||||
@ExcelProperty(value = "满分")
|
||||
private Long fullMark;
|
||||
|
||||
/**
|
||||
* 及格线
|
||||
*/
|
||||
@ExcelProperty(value = "及格线")
|
||||
private Long passScore;
|
||||
|
||||
/**
|
||||
* 答题最大时间(单位/分钟)
|
||||
*/
|
||||
@ExcelProperty(value = "答题最大时间", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "单=位/分钟")
|
||||
private Long answerTime;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.safety.mapper;
|
||||
|
||||
import org.dromara.safety.domain.BusQuestionBank;
|
||||
import org.dromara.safety.domain.vo.BusQuestionBankVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 题库Mapper接口
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
public interface BusQuestionBankMapper extends BaseMapperPlus<BusQuestionBank, BusQuestionBankVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.safety.mapper;
|
||||
|
||||
import org.dromara.safety.domain.BusQuestionUserAnswer;
|
||||
import org.dromara.safety.domain.vo.BusQuestionUserAnswerVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 用户试卷存储Mapper接口
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
public interface BusQuestionUserAnswerMapper extends BaseMapperPlus<BusQuestionUserAnswer, BusQuestionUserAnswerVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.safety.mapper;
|
||||
|
||||
import org.dromara.safety.domain.BusQuestionsConfig;
|
||||
import org.dromara.safety.domain.vo.BusQuestionsConfigVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 题库配置Mapper接口
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
public interface BusQuestionsConfigMapper extends BaseMapperPlus<BusQuestionsConfig, BusQuestionsConfigVo> {
|
||||
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package org.dromara.safety.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.safety.domain.BusQuestionBank;
|
||||
import org.dromara.safety.domain.req.questionbank.QuestionBankCreateReq;
|
||||
import org.dromara.safety.domain.req.questionbank.QuestionBankQueryReq;
|
||||
import org.dromara.safety.domain.req.questionbank.QuestionBankUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusQuestionBankVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 题库Service接口
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
public interface IBusQuestionBankService extends IService<BusQuestionBank> {
|
||||
|
||||
/**
|
||||
* 查询题库
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 题库
|
||||
*/
|
||||
BusQuestionBankVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询题库列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 题库分页列表
|
||||
*/
|
||||
TableDataInfo<BusQuestionBankVo> queryPageList(QuestionBankQueryReq req, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的题库列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 题库列表
|
||||
*/
|
||||
List<BusQuestionBankVo> queryList(QuestionBankQueryReq req);
|
||||
|
||||
/**
|
||||
* 新增题库
|
||||
*
|
||||
* @param req 题库
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Long insertByBo(QuestionBankCreateReq req);
|
||||
|
||||
/**
|
||||
* 修改题库
|
||||
*
|
||||
* @param req 题库
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(QuestionBankUpdateReq req);
|
||||
|
||||
/**
|
||||
* 校验并批量删除题库信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 获取题库视图对象
|
||||
*
|
||||
* @param questionBank 题库对象
|
||||
* @return 题库视图对象
|
||||
*/
|
||||
BusQuestionBankVo getVo(BusQuestionBank questionBank);
|
||||
|
||||
/**
|
||||
* 获取题库查询条件封装
|
||||
*
|
||||
* @param req 题库查询条件
|
||||
* @return 题库查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusQuestionBank> buildQueryWrapper(QuestionBankQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取题库分页对象视图
|
||||
*
|
||||
* @param questionBankPage 题库分页对象
|
||||
* @return 题库分页对象视图
|
||||
*/
|
||||
Page<BusQuestionBankVo> getVoPage(Page<BusQuestionBank> questionBankPage);
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package org.dromara.safety.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.safety.domain.BusQuestionUserAnswer;
|
||||
import org.dromara.safety.domain.req.questionuseranswer.QuestionUserAnswerCreateReq;
|
||||
import org.dromara.safety.domain.req.questionuseranswer.QuestionUserAnswerQueryReq;
|
||||
import org.dromara.safety.domain.req.questionuseranswer.QuestionUserAnswerUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusQuestionUserAnswerVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户试卷存储Service接口
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
public interface IBusQuestionUserAnswerService extends IService<BusQuestionUserAnswer> {
|
||||
|
||||
/**
|
||||
* 查询用户试卷存储
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 用户试卷存储
|
||||
*/
|
||||
BusQuestionUserAnswerVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询用户试卷存储列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 用户试卷存储分页列表
|
||||
*/
|
||||
TableDataInfo<BusQuestionUserAnswerVo> queryPageList(QuestionUserAnswerQueryReq req, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的用户试卷存储列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 用户试卷存储列表
|
||||
*/
|
||||
List<BusQuestionUserAnswerVo> queryList(QuestionUserAnswerQueryReq req);
|
||||
|
||||
/**
|
||||
* 新增用户试卷存储
|
||||
*
|
||||
* @param req 用户试卷存储
|
||||
* @return 新增用户试卷存储id
|
||||
*/
|
||||
Long insertByBo(QuestionUserAnswerCreateReq req);
|
||||
|
||||
/**
|
||||
* 修改用户试卷存储
|
||||
*
|
||||
* @param req 用户试卷存储
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(QuestionUserAnswerUpdateReq req);
|
||||
|
||||
/**
|
||||
* 校验并批量删除用户试卷存储信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 获取用户试卷存储视图对象
|
||||
*
|
||||
* @param questionUserAnswer 用户试卷存储对象
|
||||
* @return 用户试卷存储视图对象
|
||||
*/
|
||||
BusQuestionUserAnswerVo getVo(BusQuestionUserAnswer questionUserAnswer);
|
||||
|
||||
/**
|
||||
* 获取用户试卷存储查询条件封装
|
||||
*
|
||||
* @param req 用户试卷存储查询条件
|
||||
* @return 用户试卷存储查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusQuestionUserAnswer> buildQueryWrapper(QuestionUserAnswerQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取用户试卷存储分页对象视图
|
||||
*
|
||||
* @param questionUserAnswerPage 用户试卷存储分页对象
|
||||
* @return 用户试卷存储分页对象视图
|
||||
*/
|
||||
Page<BusQuestionUserAnswerVo> getVoPage(Page<BusQuestionUserAnswer> questionUserAnswerPage);
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package org.dromara.safety.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.safety.domain.BusQuestionsConfig;
|
||||
import org.dromara.safety.domain.req.questionsconfig.QuestionsConfigCreateReq;
|
||||
import org.dromara.safety.domain.req.questionsconfig.QuestionsConfigQueryReq;
|
||||
import org.dromara.safety.domain.req.questionsconfig.QuestionsConfigUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusQuestionsConfigVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 题库配置Service接口
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
public interface IBusQuestionsConfigService extends IService<BusQuestionsConfig> {
|
||||
|
||||
/**
|
||||
* 查询题库配置
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 题库配置
|
||||
*/
|
||||
BusQuestionsConfigVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询题库配置列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 题库配置分页列表
|
||||
*/
|
||||
TableDataInfo<BusQuestionsConfigVo> queryPageList(QuestionsConfigQueryReq req, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的题库配置列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 题库配置列表
|
||||
*/
|
||||
List<BusQuestionsConfigVo> queryList(QuestionsConfigQueryReq req);
|
||||
|
||||
/**
|
||||
* 新增题库配置
|
||||
*
|
||||
* @param req 题库配置
|
||||
* @return 新增配置id
|
||||
*/
|
||||
Long insertByBo(QuestionsConfigCreateReq req);
|
||||
|
||||
/**
|
||||
* 修改题库配置
|
||||
*
|
||||
* @param req 题库配置
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(QuestionsConfigUpdateReq req);
|
||||
|
||||
/**
|
||||
* 校验并批量删除题库配置信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* 获取题库配置视图对象
|
||||
*
|
||||
* @param questionsConfig 题库配置对象
|
||||
* @return 题库配置视图对象
|
||||
*/
|
||||
BusQuestionsConfigVo getVo(BusQuestionsConfig questionsConfig);
|
||||
|
||||
/**
|
||||
* 获取题库配置查询条件封装
|
||||
*
|
||||
* @param req 题库配置查询条件
|
||||
* @return 题库配置查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusQuestionsConfig> buildQueryWrapper(QuestionsConfigQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取题库配置分页对象视图
|
||||
*
|
||||
* @param questionsConfigPage 题库配置分页对象
|
||||
* @return 题库配置分页对象视图
|
||||
*/
|
||||
Page<BusQuestionsConfigVo> getVoPage(Page<BusQuestionsConfig> questionsConfigPage);
|
||||
}
|
@ -86,7 +86,7 @@ public interface IBusSafetyInspectionService extends IService<BusSafetyInspectio
|
||||
* @param req 安全巡检工单查询条件
|
||||
* @return 安全巡检工单查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusSafetyInspection> buildQuery(SafetyInspectionQueryReq req);
|
||||
LambdaQueryWrapper<BusSafetyInspection> buildQueryWrapper(SafetyInspectionQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取安全巡检工单分页对象视图
|
||||
|
@ -86,7 +86,7 @@ public interface IBusSafetyLogService extends IService<BusSafetyLog> {
|
||||
* @param req 安全日志查询条件
|
||||
* @return 安全日志查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusSafetyLog> buildQuery(SafetyLogQueryReq req);
|
||||
LambdaQueryWrapper<BusSafetyLog> buildQueryWrapper(SafetyLogQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取安全日志分页对象视图
|
||||
|
@ -86,7 +86,7 @@ public interface IBusSafetyWeeklyReportService extends IService<BusSafetyWeeklyR
|
||||
* @param req 安全周报查询条件
|
||||
* @return 安全周报查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusSafetyWeeklyReport> buildQuery(SafetyWeeklyReportQueryReq req);
|
||||
LambdaQueryWrapper<BusSafetyWeeklyReport> buildQueryWrapper(SafetyWeeklyReportQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取安全周报分页对象视图
|
||||
|
@ -86,7 +86,7 @@ public interface IBusTeamMeetingService extends IService<BusTeamMeeting> {
|
||||
* @param req 站班会查询条件
|
||||
* @return 站班会查询条件封装
|
||||
*/
|
||||
LambdaQueryWrapper<BusTeamMeeting> buildQuery(TeamMeetingQueryReq req);
|
||||
LambdaQueryWrapper<BusTeamMeeting> buildQueryWrapper(TeamMeetingQueryReq req);
|
||||
|
||||
/**
|
||||
* 获取站班会分页对象视图
|
||||
|
@ -0,0 +1,219 @@
|
||||
package org.dromara.safety.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.ObjectUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.safety.domain.BusQuestionBank;
|
||||
import org.dromara.safety.domain.req.questionbank.QuestionBankCreateReq;
|
||||
import org.dromara.safety.domain.req.questionbank.QuestionBankQueryReq;
|
||||
import org.dromara.safety.domain.req.questionbank.QuestionBankUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusQuestionBankVo;
|
||||
import org.dromara.safety.mapper.BusQuestionBankMapper;
|
||||
import org.dromara.safety.service.IBusQuestionBankService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 题库Service业务层处理
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Service
|
||||
public class BusQuestionBankServiceImpl extends ServiceImpl<BusQuestionBankMapper, BusQuestionBank>
|
||||
implements IBusQuestionBankService {
|
||||
|
||||
/**
|
||||
* 查询题库
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 题库
|
||||
*/
|
||||
@Override
|
||||
public BusQuestionBankVo queryById(Long id) {
|
||||
BusQuestionBank questionBank = this.getById(id);
|
||||
if (questionBank == null) {
|
||||
throw new ServiceException("题库信息不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
return this.getVo(questionBank);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询题库列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 题库分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusQuestionBankVo> queryPageList(QuestionBankQueryReq req, PageQuery pageQuery) {
|
||||
Page<BusQuestionBank> result = this.page(pageQuery.build(), buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的题库列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 题库列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusQuestionBankVo> queryList(QuestionBankQueryReq req) {
|
||||
LambdaQueryWrapper<BusQuestionBank> lqw = buildQueryWrapper(req);
|
||||
return this.list(lqw).stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增题库
|
||||
*
|
||||
* @param req 题库
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Long insertByBo(QuestionBankCreateReq req) {
|
||||
// 将实体类和 DTO 进行转换
|
||||
BusQuestionBank questionBank = new BusQuestionBank();
|
||||
BeanUtils.copyProperties(req, questionBank);
|
||||
// 数据校验
|
||||
validEntityBeforeSave(questionBank, true);
|
||||
// 写入数据库
|
||||
boolean save = this.save(questionBank);
|
||||
if (!save) {
|
||||
throw new ServiceException("新增题库失败,数据库异常", HttpStatus.ERROR);
|
||||
}
|
||||
// 返回新写入的数据
|
||||
return questionBank.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改题库
|
||||
*
|
||||
* @param req 题库
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(QuestionBankUpdateReq req) {
|
||||
// 将实体类和 DTO 进行转换
|
||||
BusQuestionBank questionBank = new BusQuestionBank();
|
||||
BeanUtils.copyProperties(req, questionBank);
|
||||
// 数据校验
|
||||
validEntityBeforeSave(questionBank, false);
|
||||
// 判断是否存在
|
||||
BusQuestionBank oldQuestionBank = this.getById(questionBank.getId());
|
||||
if (oldQuestionBank == null) {
|
||||
throw new ServiceException("修改题库失败,数据不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
// 操作数据库
|
||||
return this.updateById(questionBank);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusQuestionBank entity, Boolean create) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除题库信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return this.removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取题库视图对象
|
||||
*
|
||||
* @param questionBank 题库对象
|
||||
* @return 题库视图对象
|
||||
*/
|
||||
@Override
|
||||
public BusQuestionBankVo getVo(BusQuestionBank questionBank) {
|
||||
// 对象转封装类
|
||||
BusQuestionBankVo questionBankVo = new BusQuestionBankVo();
|
||||
if (questionBank == null) {
|
||||
return questionBankVo;
|
||||
}
|
||||
BeanUtils.copyProperties(questionBank, questionBankVo);
|
||||
return questionBankVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取题库查询条件封装
|
||||
*
|
||||
* @param req 题库查询条件
|
||||
* @return 题库查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusQuestionBank> buildQueryWrapper(QuestionBankQueryReq req) {
|
||||
LambdaQueryWrapper<BusQuestionBank> lqw = new LambdaQueryWrapper<>();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
}
|
||||
Long id = req.getId();
|
||||
String categoryType = req.getCategoryType();
|
||||
String questionType = req.getQuestionType();
|
||||
String questionContent = req.getQuestionContent();
|
||||
List<String> optionList = req.getOptionList();
|
||||
String correctAnswer = req.getCorrectAnswer();
|
||||
// JSON 数组查询
|
||||
if (CollUtil.isNotEmpty(optionList)) {
|
||||
for (String option : optionList) {
|
||||
lqw.like(BusQuestionBank::getOptions, "\"" + option + "\"");
|
||||
}
|
||||
}
|
||||
// 模糊查询
|
||||
lqw.like(StringUtils.isNotBlank(questionContent), BusQuestionBank::getQuestionContent, questionContent);
|
||||
lqw.like(StringUtils.isNotBlank(correctAnswer), BusQuestionBank::getCorrectAnswer, correctAnswer);
|
||||
// 精准查询
|
||||
lqw.eq(ObjectUtils.isNotEmpty(id), BusQuestionBank::getId, id);
|
||||
lqw.eq(StringUtils.isNotBlank(categoryType), BusQuestionBank::getCategoryType, categoryType);
|
||||
lqw.eq(StringUtils.isNotBlank(questionType), BusQuestionBank::getQuestionType, questionType);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取题库分页对象视图
|
||||
*
|
||||
* @param questionBankPage 题库分页对象
|
||||
* @return 题库分页对象视图
|
||||
*/
|
||||
@Override
|
||||
public Page<BusQuestionBankVo> getVoPage(Page<BusQuestionBank> questionBankPage) {
|
||||
// 获取分页数据
|
||||
List<BusQuestionBank> questionBankList = questionBankPage.getRecords();
|
||||
// 添加分页信息
|
||||
Page<BusQuestionBankVo> questionBankVoPage = new Page<>(
|
||||
questionBankPage.getCurrent(),
|
||||
questionBankPage.getSize(),
|
||||
questionBankPage.getTotal()
|
||||
);
|
||||
if (CollUtil.isEmpty(questionBankList)) {
|
||||
return questionBankVoPage;
|
||||
}
|
||||
// 对象列表 => 封装对象列表
|
||||
List<BusQuestionBankVo> questionBankVoList = questionBankList.stream().map(this::getVo).toList();
|
||||
questionBankVoPage.setRecords(questionBankVoList);
|
||||
return questionBankVoPage;
|
||||
}
|
||||
}
|
@ -0,0 +1,257 @@
|
||||
package org.dromara.safety.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.ObjectUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.safety.domain.BusQuestionUserAnswer;
|
||||
import org.dromara.safety.domain.req.questionuseranswer.QuestionUserAnswerCreateReq;
|
||||
import org.dromara.safety.domain.req.questionuseranswer.QuestionUserAnswerQueryReq;
|
||||
import org.dromara.safety.domain.req.questionuseranswer.QuestionUserAnswerUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusQuestionUserAnswerVo;
|
||||
import org.dromara.safety.mapper.BusQuestionUserAnswerMapper;
|
||||
import org.dromara.safety.service.IBusQuestionUserAnswerService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户试卷存储Service业务层处理
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Service
|
||||
public class BusQuestionUserAnswerServiceImpl extends ServiceImpl<BusQuestionUserAnswerMapper, BusQuestionUserAnswer>
|
||||
implements IBusQuestionUserAnswerService {
|
||||
|
||||
/**
|
||||
* 查询用户试卷存储
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 用户试卷存储
|
||||
*/
|
||||
@Override
|
||||
public BusQuestionUserAnswerVo queryById(Long id) {
|
||||
BusQuestionUserAnswer questionUserAnswer = this.getById(id);
|
||||
if (questionUserAnswer == null) {
|
||||
throw new ServiceException("用户试卷存储信息不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
return this.getVo(questionUserAnswer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询用户试卷存储列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 用户试卷存储分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusQuestionUserAnswerVo> queryPageList(QuestionUserAnswerQueryReq req, PageQuery pageQuery) {
|
||||
Page<BusQuestionUserAnswer> result = this.page(pageQuery.build(), buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的用户试卷存储列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 用户试卷存储列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusQuestionUserAnswerVo> queryList(QuestionUserAnswerQueryReq req) {
|
||||
LambdaQueryWrapper<BusQuestionUserAnswer> lqw = buildQueryWrapper(req);
|
||||
return this.list(lqw).stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增用户试卷存储
|
||||
*
|
||||
* @param req 用户试卷存储
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Long insertByBo(QuestionUserAnswerCreateReq req) {
|
||||
// 将实体类和 DTO 进行转换
|
||||
BusQuestionUserAnswer questionUserAnswer = new BusQuestionUserAnswer();
|
||||
BeanUtils.copyProperties(req, questionUserAnswer);
|
||||
List<Long> bankIdList = req.getBankIdList();
|
||||
if (CollUtil.isNotEmpty(bankIdList)) {
|
||||
String bankIdStr = JSONUtil.toJsonStr(bankIdList);
|
||||
questionUserAnswer.setBankId(bankIdStr);
|
||||
}
|
||||
List<String> answerList = req.getAnswerList();
|
||||
if (CollUtil.isNotEmpty(answerList)) {
|
||||
String answerStr = JSONUtil.toJsonStr(answerList);
|
||||
questionUserAnswer.setAnswer(answerStr);
|
||||
}
|
||||
// 数据校验
|
||||
validEntityBeforeSave(questionUserAnswer, true);
|
||||
// 写入数据库
|
||||
boolean save = this.save(questionUserAnswer);
|
||||
if (!save) {
|
||||
throw new ServiceException("新增用户试卷存储失败,数据库异常", HttpStatus.ERROR);
|
||||
}
|
||||
// 返回新写入的数据
|
||||
return questionUserAnswer.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户试卷存储
|
||||
*
|
||||
* @param req 用户试卷存储
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(QuestionUserAnswerUpdateReq req) {
|
||||
// 将实体类和 DTO 进行转换
|
||||
BusQuestionUserAnswer questionUserAnswer = new BusQuestionUserAnswer();
|
||||
BeanUtils.copyProperties(req, questionUserAnswer);
|
||||
List<Long> bankIdList = req.getBankIdList();
|
||||
if (CollUtil.isNotEmpty(bankIdList)) {
|
||||
String bankIdStr = JSONUtil.toJsonStr(bankIdList);
|
||||
questionUserAnswer.setBankId(bankIdStr);
|
||||
}
|
||||
List<String> answerList = req.getAnswerList();
|
||||
if (CollUtil.isNotEmpty(answerList)) {
|
||||
String answerStr = JSONUtil.toJsonStr(answerList);
|
||||
questionUserAnswer.setAnswer(answerStr);
|
||||
}
|
||||
// 数据校验
|
||||
validEntityBeforeSave(questionUserAnswer, false);
|
||||
// 判断是否存在
|
||||
BusQuestionUserAnswer oldQuestionUserAnswer = this.getById(questionUserAnswer.getId());
|
||||
if (oldQuestionUserAnswer == null) {
|
||||
throw new ServiceException("修改用户试卷存储失败,数据不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
// 操作数据库
|
||||
return this.updateById(questionUserAnswer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusQuestionUserAnswer entity, Boolean create) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除用户试卷存储信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return this.removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户试卷存储视图对象
|
||||
*
|
||||
* @param questionUserAnswer 用户试卷存储对象
|
||||
* @return 用户试卷存储视图对象
|
||||
*/
|
||||
@Override
|
||||
public BusQuestionUserAnswerVo getVo(BusQuestionUserAnswer questionUserAnswer) {
|
||||
// 对象转封装类
|
||||
BusQuestionUserAnswerVo questionUserAnswerVo = new BusQuestionUserAnswerVo();
|
||||
if (questionUserAnswer == null) {
|
||||
return questionUserAnswerVo;
|
||||
}
|
||||
BeanUtils.copyProperties(questionUserAnswer, questionUserAnswerVo);
|
||||
String bankId = questionUserAnswer.getBankId();
|
||||
if (StringUtils.isNotBlank(bankId)) {
|
||||
questionUserAnswerVo.setBankIdList(JSONUtil.toList(bankId, Long.class));
|
||||
}
|
||||
String answer = questionUserAnswer.getAnswer();
|
||||
if (StringUtils.isNotBlank(answer)) {
|
||||
questionUserAnswerVo.setAnswerList(JSONUtil.toList(answer, String.class));
|
||||
}
|
||||
return questionUserAnswerVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户试卷存储查询条件封装
|
||||
*
|
||||
* @param req 用户试卷存储查询条件
|
||||
* @return 用户试卷存储查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusQuestionUserAnswer> buildQueryWrapper(QuestionUserAnswerQueryReq req) {
|
||||
LambdaQueryWrapper<BusQuestionUserAnswer> lqw = new LambdaQueryWrapper<>();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
}
|
||||
Long id = req.getId();
|
||||
Long projectId = req.getProjectId();
|
||||
Long userId = req.getUserId();
|
||||
List<Long> bankIdList = req.getBankIdList();
|
||||
List<String> answerList = req.getAnswerList();
|
||||
Long score = req.getScore();
|
||||
Long takeTime = req.getTakeTime();
|
||||
String pass = req.getPass();
|
||||
// JSON 数组查询
|
||||
if (CollUtil.isNotEmpty(bankIdList)) {
|
||||
for (Long bankId : bankIdList) {
|
||||
lqw.like(BusQuestionUserAnswer::getBankId, "\"" + bankId + "\"");
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(answerList)) {
|
||||
for (String answer : answerList) {
|
||||
lqw.like(BusQuestionUserAnswer::getAnswer, "\"" + answer + "\"");
|
||||
}
|
||||
}
|
||||
// 模糊查询
|
||||
lqw.like(StringUtils.isNotBlank(pass), BusQuestionUserAnswer::getPass, pass);
|
||||
// 精准查询
|
||||
lqw.eq(ObjectUtils.isNotEmpty(id), BusQuestionUserAnswer::getId, id);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(projectId), BusQuestionUserAnswer::getProjectId, projectId);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(userId), BusQuestionUserAnswer::getUserId, userId);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(score), BusQuestionUserAnswer::getScore, score);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(takeTime), BusQuestionUserAnswer::getTakeTime, takeTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户试卷存储分页对象视图
|
||||
*
|
||||
* @param questionUserAnswerPage 用户试卷存储分页对象
|
||||
* @return 用户试卷存储分页对象视图
|
||||
*/
|
||||
@Override
|
||||
public Page<BusQuestionUserAnswerVo> getVoPage(Page<BusQuestionUserAnswer> questionUserAnswerPage) {
|
||||
// 获取分页数据
|
||||
List<BusQuestionUserAnswer> questionUserAnswerList = questionUserAnswerPage.getRecords();
|
||||
// 添加分页信息
|
||||
Page<BusQuestionUserAnswerVo> questionUserAnswerVoPage = new Page<>(
|
||||
questionUserAnswerPage.getCurrent(),
|
||||
questionUserAnswerPage.getSize(),
|
||||
questionUserAnswerPage.getTotal()
|
||||
);
|
||||
if (CollUtil.isEmpty(questionUserAnswerList)) {
|
||||
return questionUserAnswerVoPage;
|
||||
}
|
||||
// 对象列表 => 封装对象列表
|
||||
List<BusQuestionUserAnswerVo> questionUserAnswerVoList = questionUserAnswerList.stream().map(this::getVo).toList();
|
||||
questionUserAnswerVoPage.setRecords(questionUserAnswerVoList);
|
||||
return questionUserAnswerVoPage;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,223 @@
|
||||
package org.dromara.safety.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.dromara.common.core.constant.HttpStatus;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.ObjectUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.safety.domain.BusQuestionsConfig;
|
||||
import org.dromara.safety.domain.req.questionsconfig.QuestionsConfigCreateReq;
|
||||
import org.dromara.safety.domain.req.questionsconfig.QuestionsConfigQueryReq;
|
||||
import org.dromara.safety.domain.req.questionsconfig.QuestionsConfigUpdateReq;
|
||||
import org.dromara.safety.domain.vo.BusQuestionsConfigVo;
|
||||
import org.dromara.safety.mapper.BusQuestionsConfigMapper;
|
||||
import org.dromara.safety.service.IBusQuestionsConfigService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 题库配置Service业务层处理
|
||||
*
|
||||
* @author lcj
|
||||
* @date 2025-03-24
|
||||
*/
|
||||
@Service
|
||||
public class BusQuestionsConfigServiceImpl extends ServiceImpl<BusQuestionsConfigMapper, BusQuestionsConfig>
|
||||
implements IBusQuestionsConfigService {
|
||||
|
||||
/**
|
||||
* 查询题库配置
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 题库配置
|
||||
*/
|
||||
@Override
|
||||
public BusQuestionsConfigVo queryById(Long id) {
|
||||
BusQuestionsConfig questionsConfig = this.getById(id);
|
||||
if (questionsConfig == null) {
|
||||
throw new ServiceException("题库配置信息不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
return this.getVo(questionsConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询题库配置列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 题库配置分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusQuestionsConfigVo> queryPageList(QuestionsConfigQueryReq req, PageQuery pageQuery) {
|
||||
Page<BusQuestionsConfig> result = this.page(pageQuery.build(), buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的题库配置列表
|
||||
*
|
||||
* @param req 查询条件
|
||||
* @return 题库配置列表
|
||||
*/
|
||||
@Override
|
||||
public List<BusQuestionsConfigVo> queryList(QuestionsConfigQueryReq req) {
|
||||
LambdaQueryWrapper<BusQuestionsConfig> lqw = buildQueryWrapper(req);
|
||||
return this.list(lqw).stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增题库配置
|
||||
*
|
||||
* @param req 题库配置
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Long insertByBo(QuestionsConfigCreateReq req) {
|
||||
// 将实体类和 DTO 进行转换
|
||||
BusQuestionsConfig questionsConfig = new BusQuestionsConfig();
|
||||
BeanUtils.copyProperties(req, questionsConfig);
|
||||
// 数据校验
|
||||
validEntityBeforeSave(questionsConfig, true);
|
||||
// 写入数据库
|
||||
boolean save = this.save(questionsConfig);
|
||||
if (!save) {
|
||||
throw new ServiceException("新增题库配置失败,数据库异常", HttpStatus.ERROR);
|
||||
}
|
||||
// 返回新写入的数据
|
||||
return questionsConfig.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改题库配置
|
||||
*
|
||||
* @param req 题库配置
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(QuestionsConfigUpdateReq req) {
|
||||
// 将实体类和 DTO 进行转换
|
||||
BusQuestionsConfig questionsConfig = new BusQuestionsConfig();
|
||||
BeanUtils.copyProperties(req, questionsConfig);
|
||||
// 数据校验
|
||||
validEntityBeforeSave(questionsConfig, false);
|
||||
// 判断是否存在
|
||||
BusQuestionsConfig oldQuestionsConfig = this.getById(questionsConfig.getId());
|
||||
if (oldQuestionsConfig == null) {
|
||||
throw new ServiceException("修改题库配置失败,数据不存在", HttpStatus.NOT_FOUND);
|
||||
}
|
||||
// 操作数据库
|
||||
return this.updateById(questionsConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BusQuestionsConfig entity, Boolean create) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
if (create) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除题库配置信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return this.removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取题库配置视图对象
|
||||
*
|
||||
* @param questionsConfig 题库配置对象
|
||||
* @return 题库配置视图对象
|
||||
*/
|
||||
@Override
|
||||
public BusQuestionsConfigVo getVo(BusQuestionsConfig questionsConfig) {
|
||||
// 对象转封装类
|
||||
BusQuestionsConfigVo questionsConfigVo = new BusQuestionsConfigVo();
|
||||
if (questionsConfig == null) {
|
||||
return questionsConfigVo;
|
||||
}
|
||||
BeanUtils.copyProperties(questionsConfig, questionsConfigVo);
|
||||
return questionsConfigVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取题库配置查询条件封装
|
||||
*
|
||||
* @param req 题库配置查询条件
|
||||
* @return 题库配置查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusQuestionsConfig> buildQueryWrapper(QuestionsConfigQueryReq req) {
|
||||
LambdaQueryWrapper<BusQuestionsConfig> lqw = new LambdaQueryWrapper<>();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
}
|
||||
Long id = req.getId();
|
||||
Long singleChoice = req.getSingleChoice();
|
||||
Long singleScore = req.getSingleScore();
|
||||
Long multipleChoice = req.getMultipleChoice();
|
||||
Long multipleScore = req.getMultipleScore();
|
||||
Long estimate = req.getEstimate();
|
||||
Long estimateScore = req.getEstimateScore();
|
||||
Long fullMark = req.getFullMark();
|
||||
Long passScore = req.getPassScore();
|
||||
Long answerTime = req.getAnswerTime();
|
||||
// 精准查询
|
||||
lqw.eq(ObjectUtils.isNotEmpty(id), BusQuestionsConfig::getId, id);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(singleChoice), BusQuestionsConfig::getSingleChoice, singleChoice);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(singleScore), BusQuestionsConfig::getSingleScore, singleScore);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(multipleChoice), BusQuestionsConfig::getMultipleChoice, multipleChoice);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(multipleScore), BusQuestionsConfig::getMultipleScore, multipleScore);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(estimate), BusQuestionsConfig::getEstimate, estimate);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(estimateScore), BusQuestionsConfig::getEstimateScore, estimateScore);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(fullMark), BusQuestionsConfig::getFullMark, fullMark);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(passScore), BusQuestionsConfig::getPassScore, passScore);
|
||||
lqw.eq(ObjectUtils.isNotEmpty(answerTime), BusQuestionsConfig::getAnswerTime, answerTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取题库配置分页对象视图
|
||||
*
|
||||
* @param questionsConfigPage 题库配置分页对象
|
||||
* @return 题库配置分页对象视图
|
||||
*/
|
||||
@Override
|
||||
public Page<BusQuestionsConfigVo> getVoPage(Page<BusQuestionsConfig> questionsConfigPage) {
|
||||
// 获取分页数据
|
||||
List<BusQuestionsConfig> questionsConfigList = questionsConfigPage.getRecords();
|
||||
// 添加分页信息
|
||||
Page<BusQuestionsConfigVo> questionsConfigVoPage = new Page<>(
|
||||
questionsConfigPage.getCurrent(),
|
||||
questionsConfigPage.getSize(),
|
||||
questionsConfigPage.getTotal()
|
||||
);
|
||||
if (CollUtil.isEmpty(questionsConfigList)) {
|
||||
return questionsConfigVoPage;
|
||||
}
|
||||
// 对象列表 => 封装对象列表
|
||||
List<BusQuestionsConfigVo> questionsConfigVoList = questionsConfigList.stream().map(this::getVo).toList();
|
||||
questionsConfigVoPage.setRecords(questionsConfigVoList);
|
||||
return questionsConfigVoPage;
|
||||
}
|
||||
}
|
@ -75,7 +75,7 @@ public class BusSafetyInspectionServiceImpl extends ServiceImpl<BusSafetyInspect
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusSafetyInspectionVo> queryPageList(SafetyInspectionQueryReq req, PageQuery pageQuery) {
|
||||
Page<BusSafetyInspection> result = this.page(pageQuery.build(), buildQuery(req));
|
||||
Page<BusSafetyInspection> result = this.page(pageQuery.build(), buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ public class BusSafetyInspectionServiceImpl extends ServiceImpl<BusSafetyInspect
|
||||
*/
|
||||
@Override
|
||||
public List<BusSafetyInspectionVo> queryList(SafetyInspectionQueryReq req) {
|
||||
List<BusSafetyInspection> safetyInspection = this.list(this.buildQuery(req));
|
||||
List<BusSafetyInspection> safetyInspection = this.list(this.buildQueryWrapper(req));
|
||||
return safetyInspection.stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
@ -238,7 +238,7 @@ public class BusSafetyInspectionServiceImpl extends ServiceImpl<BusSafetyInspect
|
||||
* @return 安全巡检工单查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusSafetyInspection> buildQuery(SafetyInspectionQueryReq req) {
|
||||
public LambdaQueryWrapper<BusSafetyInspection> buildQueryWrapper(SafetyInspectionQueryReq req) {
|
||||
LambdaQueryWrapper<BusSafetyInspection> lqw = Wrappers.lambdaQuery();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
|
@ -70,7 +70,7 @@ public class BusSafetyLogServiceImpl extends ServiceImpl<BusSafetyLogMapper, Bus
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusSafetyLogVo> queryPageList(SafetyLogQueryReq req, PageQuery pageQuery) {
|
||||
Page<BusSafetyLog> result = this.page(pageQuery.build(), this.buildQuery(req));
|
||||
Page<BusSafetyLog> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ public class BusSafetyLogServiceImpl extends ServiceImpl<BusSafetyLogMapper, Bus
|
||||
*/
|
||||
@Override
|
||||
public List<BusSafetyLogVo> queryList(SafetyLogQueryReq req) {
|
||||
List<BusSafetyLog> safetyLogList = this.list(this.buildQuery(req));
|
||||
List<BusSafetyLog> safetyLogList = this.list(this.buildQueryWrapper(req));
|
||||
return safetyLogList.stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
@ -192,7 +192,7 @@ public class BusSafetyLogServiceImpl extends ServiceImpl<BusSafetyLogMapper, Bus
|
||||
* @return 安全日志查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusSafetyLog> buildQuery(SafetyLogQueryReq req) {
|
||||
public LambdaQueryWrapper<BusSafetyLog> buildQueryWrapper(SafetyLogQueryReq req) {
|
||||
LambdaQueryWrapper<BusSafetyLog> lqw = Wrappers.lambdaQuery();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
|
@ -69,7 +69,7 @@ public class BusSafetyWeeklyReportServiceImpl extends ServiceImpl<BusSafetyWeekl
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusSafetyWeeklyReportVo> queryPageList(SafetyWeeklyReportQueryReq req, PageQuery pageQuery) {
|
||||
Page<BusSafetyWeeklyReport> result = this.page(pageQuery.build(), this.buildQuery(req));
|
||||
Page<BusSafetyWeeklyReport> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ public class BusSafetyWeeklyReportServiceImpl extends ServiceImpl<BusSafetyWeekl
|
||||
*/
|
||||
@Override
|
||||
public List<BusSafetyWeeklyReportVo> queryList(SafetyWeeklyReportQueryReq req) {
|
||||
List<BusSafetyWeeklyReport> safetyWeeklyReportList = this.list(this.buildQuery(req));
|
||||
List<BusSafetyWeeklyReport> safetyWeeklyReportList = this.list(this.buildQueryWrapper(req));
|
||||
return safetyWeeklyReportList.stream().map(this::getVo).toList();
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ public class BusSafetyWeeklyReportServiceImpl extends ServiceImpl<BusSafetyWeekl
|
||||
* @return 安全周报查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusSafetyWeeklyReport> buildQuery(SafetyWeeklyReportQueryReq req) {
|
||||
public LambdaQueryWrapper<BusSafetyWeeklyReport> buildQueryWrapper(SafetyWeeklyReportQueryReq req) {
|
||||
LambdaQueryWrapper<BusSafetyWeeklyReport> lqw = Wrappers.lambdaQuery();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
|
@ -87,7 +87,7 @@ public class BusTeamMeetingServiceImpl extends ServiceImpl<BusTeamMeetingMapper,
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BusTeamMeetingVo> queryPageList(TeamMeetingQueryReq req, PageQuery pageQuery) {
|
||||
Page<BusTeamMeeting> result = this.page(pageQuery.build(), this.buildQuery(req));
|
||||
Page<BusTeamMeeting> result = this.page(pageQuery.build(), this.buildQueryWrapper(req));
|
||||
return TableDataInfo.build(this.getVoPage(result));
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ public class BusTeamMeetingServiceImpl extends ServiceImpl<BusTeamMeetingMapper,
|
||||
*/
|
||||
@Override
|
||||
public List<BusTeamMeetingVo> queryList(TeamMeetingQueryReq req) {
|
||||
List<BusTeamMeeting> list = this.list(this.buildQuery(req));
|
||||
List<BusTeamMeeting> list = this.list(this.buildQueryWrapper(req));
|
||||
// 对象列表 => 封装对象列表
|
||||
return list.stream().map(this::getVo).toList();
|
||||
}
|
||||
@ -268,7 +268,7 @@ public class BusTeamMeetingServiceImpl extends ServiceImpl<BusTeamMeetingMapper,
|
||||
* @return 站班会查询条件封装
|
||||
*/
|
||||
@Override
|
||||
public LambdaQueryWrapper<BusTeamMeeting> buildQuery(TeamMeetingQueryReq req) {
|
||||
public LambdaQueryWrapper<BusTeamMeeting> buildQueryWrapper(TeamMeetingQueryReq req) {
|
||||
LambdaQueryWrapper<BusTeamMeeting> lqw = Wrappers.lambdaQuery();
|
||||
if (req == null) {
|
||||
return lqw;
|
||||
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.safety.mapper.BusQuestionBankMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.safety.mapper.BusQuestionUserAnswerMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.safety.mapper.BusQuestionsConfigMapper">
|
||||
|
||||
</mapper>
|
@ -357,3 +357,63 @@ values(1902609955433758726, '安全周报删除', 1902609955433758722, '4', '#'
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1902609955433758727, '安全周报导出', 1902609955433758722, '5', '#', '', 1, 0, 'F', '0', '0', 'safety:safetyWeeklyReport:export', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108398346084354, '题库配置', '1902191175640604673', '1', 'questionsConfig', 'safety/questionsConfig/index', 1, 0, 'C', '0', '0', 'safety:questionsConfig:list', '#', 103, 1, sysdate(), null, null, '题库配置菜单');
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108398346084355, '题库配置查询', 1904108398346084354, '1', '#', '', 1, 0, 'F', '0', '0', 'safety:questionsConfig:query', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108398346084356, '题库配置新增', 1904108398346084354, '2', '#', '', 1, 0, 'F', '0', '0', 'safety:questionsConfig:add', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108398346084357, '题库配置修改', 1904108398346084354, '3', '#', '', 1, 0, 'F', '0', '0', 'safety:questionsConfig:edit', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108398346084358, '题库配置删除', 1904108398346084354, '4', '#', '', 1, 0, 'F', '0', '0', 'safety:questionsConfig:remove', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108398346084359, '题库配置导出', 1904108398346084354, '5', '#', '', 1, 0, 'F', '0', '0', 'safety:questionsConfig:export', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108398077648898, '题库', '1902191175640604673', '1', 'questionBank', 'safety/questionBank/index', 1, 0, 'C', '0', '0', 'safety:questionBank:list', '#', 103, 1, sysdate(), null, null, '题库菜单');
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108398077648899, '题库查询', 1904108398077648898, '1', '#', '', 1, 0, 'F', '0', '0', 'safety:questionBank:query', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108398077648900, '题库新增', 1904108398077648898, '2', '#', '', 1, 0, 'F', '0', '0', 'safety:questionBank:add', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108398077648901, '题库修改', 1904108398077648898, '3', '#', '', 1, 0, 'F', '0', '0', 'safety:questionBank:edit', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108398077648902, '题库删除', 1904108398077648898, '4', '#', '', 1, 0, 'F', '0', '0', 'safety:questionBank:remove', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108398077648903, '题库导出', 1904108398077648898, '5', '#', '', 1, 0, 'F', '0', '0', 'safety:questionBank:export', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108397817602050, '用户试卷存储', '1902191175640604673', '1', 'questionUserAnswer', 'safety/questionUserAnswer/index', 1, 0, 'C', '0', '0', 'safety:questionUserAnswer:list', '#', 103, 1, sysdate(), null, null, '用户试卷存储菜单');
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108397817602051, '用户试卷存储查询', 1904108397817602050, '1', '#', '', 1, 0, 'F', '0', '0', 'safety:questionUserAnswer:query', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108397817602052, '用户试卷存储新增', 1904108397817602050, '2', '#', '', 1, 0, 'F', '0', '0', 'safety:questionUserAnswer:add', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108397817602053, '用户试卷存储修改', 1904108397817602050, '3', '#', '', 1, 0, 'F', '0', '0', 'safety:questionUserAnswer:edit', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108397817602054, '用户试卷存储删除', 1904108397817602050, '4', '#', '', 1, 0, 'F', '0', '0', 'safety:questionUserAnswer:remove', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1904108397817602055, '用户试卷存储导出', 1904108397817602050, '5', '#', '', 1, 0, 'F', '0', '0', 'safety:questionUserAnswer:export', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
@ -388,3 +388,59 @@ CREATE TABLE `bus_safety_weekly_report`
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_project_id` (`project_id` ASC) USING BTREE comment '项目id'
|
||||
) comment = '安全周报' collate = utf8mb4_unicode_ci;
|
||||
|
||||
DROP TABLE IF EXISTS `bus_questions_config`;
|
||||
CREATE TABLE `bus_questions_config`
|
||||
(
|
||||
`id` bigint not null auto_increment comment '主键id',
|
||||
`single_choice` int default 0 not null comment '单选题(单位/道)',
|
||||
`single_score` float not null comment '单选分数',
|
||||
`multiple_choice` int default 0 not null comment '多选题(单位/道)',
|
||||
`multiple_score` float not null comment '多选分数',
|
||||
`estimate` int default 0 not null comment '判断题(单位/道)',
|
||||
`estimate_score` float not null comment '判断分数',
|
||||
`full_mark` float not null comment '满分',
|
||||
`pass_score` float not null comment '及格线',
|
||||
`answer_time` int not null comment '答题最大时间(单位/分钟)',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) comment = '题库配置' collate = utf8mb4_unicode_ci;
|
||||
|
||||
DROP TABLE IF EXISTS `bus_question_bank`;
|
||||
CREATE TABLE `bus_question_bank`
|
||||
(
|
||||
`id` bigint not null auto_increment comment '主键id',
|
||||
`category_type` char(1) null comment '题目类别',
|
||||
`question_type` char(1) null comment '题目类型',
|
||||
`question_content` varchar(255) null comment '题目内容',
|
||||
`options` text null comment '选项(以JSON数组形式存储)',
|
||||
`correct_answer` varchar(255) null comment '正确答案',
|
||||
`wx_or_pc` varchar(20) null comment '创建人设备类型',
|
||||
`create_by` varchar(64) null comment '创建者',
|
||||
`update_by` varchar(64) null comment '更新者',
|
||||
`create_time` datetime default CURRENT_TIMESTAMP null comment '创建时间',
|
||||
`update_time` datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
|
||||
`deleted_at` datetime null comment '删除时间',
|
||||
`is_delete` tinyint(4) default 0 not null comment '是否删除(0正常 1删除)',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) comment = '题库' collate = utf8mb4_unicode_ci;
|
||||
|
||||
DROP TABLE IF EXISTS `bus_question_user_answer`;
|
||||
CREATE TABLE `bus_question_user_answer`
|
||||
(
|
||||
`id` bigint not null auto_increment comment '主键id',
|
||||
`project_id` bigint null comment '项目id',
|
||||
`user_id` bigint null comment '用户id',
|
||||
`bank_id` bigint null comment '题库id列表',
|
||||
`answer` varchar(10) null comment '答案列表',
|
||||
`score` float null comment '得分',
|
||||
`take_time` bigint null comment '用时时间(时间戳/秒)',
|
||||
`pass` varchar(10) null comment '及格线/总分(格式:60,100)',
|
||||
`file` varchar(255) null comment '文件地址',
|
||||
`create_by` varchar(64) null comment '创建者',
|
||||
`update_by` varchar(64) null comment '更新者',
|
||||
`create_time` datetime default CURRENT_TIMESTAMP null comment '创建时间',
|
||||
`update_time` datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
|
||||
`deleted_at` datetime null comment '删除时间',
|
||||
`is_delete` tinyint(4) default 0 not null comment '是否删除(0正常 1删除)',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) comment = '用户试卷存储' COLLATE = utf8mb4_unicode_ci;
|
||||
|
Reference in New Issue
Block a user