变更安全工单、增加题库操作
This commit is contained in:
@ -14,6 +14,11 @@ import java.util.List;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class WgzAppSubmitATestPaperReq implements Serializable {
|
public class WgzAppSubmitATestPaperReq implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目ID
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 务工者唯一标识
|
* 务工者唯一标识
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -51,7 +51,8 @@ public class HseSafetyInspectionController extends BaseController {
|
|||||||
@SaCheckPermission("safety:safetyInspection:list")
|
@SaCheckPermission("safety:safetyInspection:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<HseSafetyInspectionVo> list(HseSafetyInspectionQueryReq req, PageQuery pageQuery) {
|
public TableDataInfo<HseSafetyInspectionVo> list(HseSafetyInspectionQueryReq req, PageQuery pageQuery) {
|
||||||
return safetyInspectionService.queryPageList(req, pageQuery);
|
// return safetyInspectionService.queryPageList(req, pageQuery);
|
||||||
|
return safetyInspectionService.queryPageListWeb(req, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -15,7 +15,10 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.safety.domain.WgzQuestionSave;
|
import org.dromara.safety.domain.WgzQuestionSave;
|
||||||
import org.dromara.safety.domain.bo.WgzQuestionSaveBo;
|
import org.dromara.safety.domain.bo.WgzQuestionSaveBo;
|
||||||
|
import org.dromara.safety.domain.bo.WgzQuestionSavePdfBo;
|
||||||
|
import org.dromara.safety.domain.vo.WgzQuestionSavePdfVo;
|
||||||
import org.dromara.safety.domain.vo.WgzQuestionSaveVo;
|
import org.dromara.safety.domain.vo.WgzQuestionSaveVo;
|
||||||
|
import org.dromara.safety.service.IWgzQuestionSavePdfService;
|
||||||
import org.dromara.safety.service.IWgzQuestionSaveService;
|
import org.dromara.safety.service.IWgzQuestionSaveService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@ -33,57 +36,66 @@ public class WgzQuestionSaveController extends BaseController {
|
|||||||
|
|
||||||
private final IWgzQuestionSaveService iWgzQuestionSaveService;
|
private final IWgzQuestionSaveService iWgzQuestionSaveService;
|
||||||
|
|
||||||
|
private final IWgzQuestionSavePdfService iwgzQuestionSavePdfService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户试卷存储列表
|
* 查询用户试卷存储列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("safety:wgzQuestionSave:list")
|
@SaCheckPermission("safety:wgzQuestionSave:listPdf")
|
||||||
@GetMapping("/list")
|
@GetMapping("/listPdf")
|
||||||
public TableDataInfo<WgzQuestionSaveVo> list(@Validated WgzQuestionSaveBo bo, PageQuery pageQuery) {
|
public TableDataInfo<WgzQuestionSavePdfVo> list(@Validated WgzQuestionSavePdfBo bo, PageQuery pageQuery) {
|
||||||
return iWgzQuestionSaveService.queryPageList(bo,pageQuery);
|
return iwgzQuestionSavePdfService.queryPageList(bo,pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 查询用户试卷存储列表
|
||||||
|
// */
|
||||||
|
// @SaCheckPermission("safety:wgzQuestionSave:list")
|
||||||
|
// @GetMapping("/list")
|
||||||
|
// public TableDataInfo<WgzQuestionSaveVo> list(@Validated WgzQuestionSaveBo bo, PageQuery pageQuery) {
|
||||||
|
// return iWgzQuestionSaveService.queryPageList(bo,pageQuery);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// /**
|
||||||
/**
|
// * 获取用户试卷存储详细信息
|
||||||
* 获取用户试卷存储详细信息
|
// */
|
||||||
*/
|
// @SaCheckPermission("safety:wgzQuestionSave:query")
|
||||||
@SaCheckPermission("safety:wgzQuestionSave:query")
|
// @GetMapping("/{id}")
|
||||||
@GetMapping("/{id}")
|
// public R<WgzQuestionSave> getInfo(@NotNull(message = "主键不能为空")
|
||||||
public R<WgzQuestionSave> getInfo(@NotNull(message = "主键不能为空")
|
// @PathVariable("id") Long id) {
|
||||||
@PathVariable("id") Long id) {
|
// return R.ok(iWgzQuestionSaveService.queryById(id));
|
||||||
return R.ok(iWgzQuestionSaveService.queryById(id));
|
// }
|
||||||
}
|
//
|
||||||
|
// /**
|
||||||
/**
|
// * 新增用户试卷存储
|
||||||
* 新增用户试卷存储
|
// */
|
||||||
*/
|
// @SaCheckPermission("safety:wgzQuestionSave:add")
|
||||||
@SaCheckPermission("safety:wgzQuestionSave:add")
|
// @Log(title = "用户试卷存储", businessType = BusinessType.INSERT)
|
||||||
@Log(title = "用户试卷存储", businessType = BusinessType.INSERT)
|
// @RepeatSubmit()
|
||||||
@RepeatSubmit()
|
// @PostMapping()
|
||||||
@PostMapping()
|
// public R<Void> add(@Validated @RequestBody WgzQuestionSave bo) {
|
||||||
public R<Void> add(@Validated @RequestBody WgzQuestionSave bo) {
|
// return toAjax(iWgzQuestionSaveService.insert(bo) ? 1 : 0);
|
||||||
return toAjax(iWgzQuestionSaveService.insert(bo) ? 1 : 0);
|
// }
|
||||||
}
|
//
|
||||||
|
// /**
|
||||||
/**
|
// * 修改用户试卷存储
|
||||||
* 修改用户试卷存储
|
// */
|
||||||
*/
|
// @SaCheckPermission("safety:wgzQuestionSave:edit")
|
||||||
@SaCheckPermission("safety:wgzQuestionSave:edit")
|
// @Log(title = "用户试卷存储", businessType = BusinessType.UPDATE)
|
||||||
@Log(title = "用户试卷存储", businessType = BusinessType.UPDATE)
|
// @RepeatSubmit()
|
||||||
@RepeatSubmit()
|
// @PutMapping()
|
||||||
@PutMapping()
|
// public R<Void> edit(@Validated @RequestBody WgzQuestionSave bo) {
|
||||||
public R<Void> edit(@Validated @RequestBody WgzQuestionSave bo) {
|
// return toAjax(iWgzQuestionSaveService.update(bo) ? 1 : 0);
|
||||||
return toAjax(iWgzQuestionSaveService.update(bo) ? 1 : 0);
|
// }
|
||||||
}
|
//
|
||||||
|
// /**
|
||||||
/**
|
// * 删除用户试卷存储
|
||||||
* 删除用户试卷存储
|
// */
|
||||||
*/
|
// @SaCheckPermission("safety:wgzQuestionSave:remove")
|
||||||
@SaCheckPermission("safety:wgzQuestionSave:remove")
|
// @Log(title = "用户试卷存储", businessType = BusinessType.DELETE)
|
||||||
@Log(title = "用户试卷存储", businessType = BusinessType.DELETE)
|
// @DeleteMapping("/{ids}")
|
||||||
@DeleteMapping("/{ids}")
|
// public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
// @PathVariable Long[] ids) {
|
||||||
@PathVariable Long[] ids) {
|
// return toAjax(iWgzQuestionSaveService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
||||||
return toAjax(iWgzQuestionSaveService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
// }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,4 +62,6 @@ public class WgzQuestionSave extends BaseEntity {
|
|||||||
/** 备注 */
|
/** 备注 */
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/** 项目ID */
|
||||||
|
private Long projectId;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,4 +53,7 @@ public class WgzQuestionSavePdf extends BaseEntity {
|
|||||||
/** 总得分 */
|
/** 总得分 */
|
||||||
private Double sumScore;
|
private Double sumScore;
|
||||||
|
|
||||||
|
/** 项目ID */
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,12 +20,20 @@ import jakarta.validation.constraints.*;
|
|||||||
@AutoMapper(target = WgzQuestionSavePdf.class, reverseConvertGenerate = false)
|
@AutoMapper(target = WgzQuestionSavePdf.class, reverseConvertGenerate = false)
|
||||||
public class WgzQuestionSavePdfBo extends BaseEntity {
|
public class WgzQuestionSavePdfBo extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键iD
|
* 主键iD
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "主键iD不能为空", groups = { EditGroup.class })
|
@NotNull(message = "主键iD不能为空", groups = { EditGroup.class })
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目ID
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "项目Id", groups = { EditGroup.class })
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1线上 2线下
|
* 1线上 2线下
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package org.dromara.safety.domain.vo;
|
package org.dromara.safety.domain.vo;
|
||||||
|
|
||||||
|
import org.dromara.common.translation.annotation.Translation;
|
||||||
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
import org.dromara.safety.domain.WgzQuestionSavePdf;
|
import org.dromara.safety.domain.WgzQuestionSavePdf;
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
@ -46,12 +48,26 @@ public class WgzQuestionSavePdfVo implements Serializable {
|
|||||||
@ExcelProperty(value = "用户主键ID")
|
@ExcelProperty(value = "用户主键ID")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "用户名")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pdf路径
|
* pdf路径
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "pdf路径")
|
@ExcelProperty(value = "pdf路径(ID)")
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pdf路径
|
||||||
|
*/
|
||||||
|
@Translation(type = TransConstant.OSS_ID_TO_URL, mapper = "pathUrl")
|
||||||
|
@ExcelProperty(value = "pdf路径(URL)")
|
||||||
|
private String pathUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 及格线/总分(格式:60,100)
|
* 及格线/总分(格式:60,100)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -145,7 +145,7 @@ public class HseSafetyInspectionServiceImpl extends ServiceImpl<HseSafetyInspect
|
|||||||
@Override
|
@Override
|
||||||
public TableDataInfo<HseSafetyInspectionVo> queryPageListWeb(HseSafetyInspectionQueryReq req, PageQuery pageQuery) {
|
public TableDataInfo<HseSafetyInspectionVo> queryPageListWeb(HseSafetyInspectionQueryReq req, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<HseSafetyInspection> lqw = this.buildQueryWrapper(req);
|
LambdaQueryWrapper<HseSafetyInspection> lqw = this.buildQueryWrapper(req);
|
||||||
Long userId = LoginHelper.getUserId();
|
// Long userId = LoginHelper.getUserId();
|
||||||
// if (userId != null) {
|
// if (userId != null) {
|
||||||
// BusProjectTeamMember one = projectTeamMemberService.lambdaQuery()
|
// BusProjectTeamMember one = projectTeamMemberService.lambdaQuery()
|
||||||
// .eq(BusProjectTeamMember::getMemberId, userId)
|
// .eq(BusProjectTeamMember::getMemberId, userId)
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.safety.domain.WgzQuestionSavePdf;
|
import org.dromara.safety.domain.WgzQuestionSavePdf;
|
||||||
@ -12,6 +13,8 @@ import org.dromara.safety.domain.bo.WgzQuestionSavePdfBo;
|
|||||||
import org.dromara.safety.domain.vo.WgzQuestionSavePdfVo;
|
import org.dromara.safety.domain.vo.WgzQuestionSavePdfVo;
|
||||||
import org.dromara.safety.mapper.WgzQuestionSavePdfMapper;
|
import org.dromara.safety.mapper.WgzQuestionSavePdfMapper;
|
||||||
import org.dromara.safety.service.IWgzQuestionSavePdfService;
|
import org.dromara.safety.service.IWgzQuestionSavePdfService;
|
||||||
|
import org.dromara.system.domain.vo.SysUserVo;
|
||||||
|
import org.dromara.system.service.ISysUserService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
@ -29,6 +32,9 @@ import java.util.Collection;
|
|||||||
@Service
|
@Service
|
||||||
public class WgzQuestionSavePdfServiceImpl extends ServiceImpl<WgzQuestionSavePdfMapper, WgzQuestionSavePdf> implements IWgzQuestionSavePdfService {
|
public class WgzQuestionSavePdfServiceImpl extends ServiceImpl<WgzQuestionSavePdfMapper, WgzQuestionSavePdf> implements IWgzQuestionSavePdfService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysUserService userService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WgzQuestionSavePdf queryById(Long id){
|
public WgzQuestionSavePdf queryById(Long id){
|
||||||
return getById(id);
|
return getById(id);
|
||||||
@ -38,6 +44,11 @@ public class WgzQuestionSavePdfServiceImpl extends ServiceImpl<WgzQuestionSavePd
|
|||||||
public TableDataInfo<WgzQuestionSavePdfVo> queryPageList(WgzQuestionSavePdfBo bo, PageQuery pageQuery) {
|
public TableDataInfo<WgzQuestionSavePdfVo> queryPageList(WgzQuestionSavePdfBo bo, PageQuery pageQuery) {
|
||||||
LambdaQueryWrapper<WgzQuestionSavePdf> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<WgzQuestionSavePdf> lqw = buildQueryWrapper(bo);
|
||||||
Page<WgzQuestionSavePdfVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
Page<WgzQuestionSavePdfVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
// 根据id获取到用户名
|
||||||
|
result.getRecords().forEach(item -> {
|
||||||
|
SysUserVo sysUserVo = userService.selectUserById(item.getUserId());
|
||||||
|
item.setUserName(sysUserVo.getNickName());
|
||||||
|
});
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -206,6 +206,7 @@ public class WgzQuestionSaveServiceImpl extends ServiceImpl<WgzQuestionSaveMappe
|
|||||||
// 记录这次的及格线和总分
|
// 记录这次的及格线和总分
|
||||||
pass = configuration.getPassingScore().toString() + "," + configuration.getFullMark().toString();
|
pass = configuration.getPassingScore().toString() + "," + configuration.getFullMark().toString();
|
||||||
WgzQuestionSave bqsTwo = new WgzQuestionSave();
|
WgzQuestionSave bqsTwo = new WgzQuestionSave();
|
||||||
|
bqsTwo.setProjectId(req.getProjectId());
|
||||||
bqsTwo.setUserId(req.getUserId());
|
bqsTwo.setUserId(req.getUserId());
|
||||||
bqsTwo.setBankId(data.getBankId());
|
bqsTwo.setBankId(data.getBankId());
|
||||||
bqsTwo.setAnswer(data.getAnswer());
|
bqsTwo.setAnswer(data.getAnswer());
|
||||||
@ -262,6 +263,7 @@ public class WgzQuestionSaveServiceImpl extends ServiceImpl<WgzQuestionSaveMappe
|
|||||||
String xdPath = generateExamPaper(examinationPaper);
|
String xdPath = generateExamPaper(examinationPaper);
|
||||||
res.setPdfStr(xdPath);
|
res.setPdfStr(xdPath);
|
||||||
WgzQuestionSavePdf wgzQuestionSavePdf = new WgzQuestionSavePdf()
|
WgzQuestionSavePdf wgzQuestionSavePdf = new WgzQuestionSavePdf()
|
||||||
|
.setProjectId(req.getProjectId())
|
||||||
.setType("1")
|
.setType("1")
|
||||||
.setUserId(req.getUserId())
|
.setUserId(req.getUserId())
|
||||||
.setPath(xdPath)
|
.setPath(xdPath)
|
||||||
|
|||||||
Reference in New Issue
Block a user