Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
0676cf3e27
|
@ -2,14 +2,10 @@ package org.dromara.scale.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
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.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
@ -49,7 +45,7 @@ public class SysEvaluationAnswerController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 导出量测回答记录列表
|
* 导出量测回答记录列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("scale:evaluationAnswer:export")
|
@SaCheckPermission("evaluation:answer:export")
|
||||||
@Log(title = "量测回答记录", businessType = BusinessType.EXPORT)
|
@Log(title = "量测回答记录", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(SysEvaluationAnswerBo bo, HttpServletResponse response) {
|
public void export(SysEvaluationAnswerBo bo, HttpServletResponse response) {
|
||||||
|
@ -62,45 +58,45 @@ public class SysEvaluationAnswerController extends BaseController {
|
||||||
*
|
*
|
||||||
* @param id 主键
|
* @param id 主键
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("scale:evaluationAnswer:query")
|
@SaCheckPermission("evaluation:answer:query")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public R<SysEvaluationAnswerVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<SysEvaluationAnswerVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable Long id) {
|
@PathVariable Long id) {
|
||||||
return R.ok(sysEvaluationAnswerService.queryById(id));
|
return R.ok(sysEvaluationAnswerService.queryById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 新增量测回答记录
|
// * 新增量测回答记录
|
||||||
*/
|
// */
|
||||||
@SaCheckPermission("scale:evaluationAnswer:add")
|
// @SaCheckPermission("evaluation:answer:add")
|
||||||
@Log(title = "量测回答记录", businessType = BusinessType.INSERT)
|
// @Log(title = "量测回答记录", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
// @RepeatSubmit()
|
||||||
@PostMapping()
|
// @PostMapping()
|
||||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysEvaluationAnswerBo bo) {
|
// public R<Void> add(@Validated(AddGroup.class) @RequestBody SysEvaluationAnswerBo bo) {
|
||||||
return toAjax(sysEvaluationAnswerService.insertByBo(bo));
|
// return toAjax(sysEvaluationAnswerService.insertByBo(bo));
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 修改量测回答记录
|
// * 修改量测回答记录
|
||||||
*/
|
// */
|
||||||
@SaCheckPermission("scale:evaluationAnswer:edit")
|
// @SaCheckPermission("scale:evaluationAnswer:edit")
|
||||||
@Log(title = "量测回答记录", businessType = BusinessType.UPDATE)
|
// @Log(title = "量测回答记录", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
// @RepeatSubmit()
|
||||||
@PutMapping()
|
// @PutMapping()
|
||||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysEvaluationAnswerBo bo) {
|
// public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysEvaluationAnswerBo bo) {
|
||||||
return toAjax(sysEvaluationAnswerService.updateByBo(bo));
|
// return toAjax(sysEvaluationAnswerService.updateByBo(bo));
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 删除量测回答记录
|
// * 删除量测回答记录
|
||||||
*
|
// *
|
||||||
* @param ids 主键串
|
// * @param ids 主键串
|
||||||
*/
|
// */
|
||||||
@SaCheckPermission("scale:evaluationAnswer:remove")
|
// @SaCheckPermission("scale:evaluationAnswer: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(sysEvaluationAnswerService.deleteWithValidByIds(List.of(ids), true));
|
// return toAjax(sysEvaluationAnswerService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,10 @@ package org.dromara.scale.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
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.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
@ -69,38 +65,38 @@ public class SysEvaluationConclusionController extends BaseController {
|
||||||
return R.ok(sysEvaluationConclusionService.queryById(id));
|
return R.ok(sysEvaluationConclusionService.queryById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 新增量测结果
|
// * 新增量测结果
|
||||||
*/
|
// */
|
||||||
@SaCheckPermission("scale:evaluationConclusion:add")
|
// @SaCheckPermission("scale:evaluationConclusion:add")
|
||||||
@Log(title = "量测结果", businessType = BusinessType.INSERT)
|
// @Log(title = "量测结果", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
// @RepeatSubmit()
|
||||||
@PostMapping()
|
// @PostMapping()
|
||||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysEvaluationConclusionBo bo) {
|
// public R<Void> add(@Validated(AddGroup.class) @RequestBody SysEvaluationConclusionBo bo) {
|
||||||
return toAjax(sysEvaluationConclusionService.insertByBo(bo));
|
// return toAjax(sysEvaluationConclusionService.insertByBo(bo));
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 修改量测结果
|
// * 修改量测结果
|
||||||
*/
|
// */
|
||||||
@SaCheckPermission("scale:evaluationConclusion:edit")
|
// @SaCheckPermission("scale:evaluationConclusion:edit")
|
||||||
@Log(title = "量测结果", businessType = BusinessType.UPDATE)
|
// @Log(title = "量测结果", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
// @RepeatSubmit()
|
||||||
@PutMapping()
|
// @PutMapping()
|
||||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysEvaluationConclusionBo bo) {
|
// public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysEvaluationConclusionBo bo) {
|
||||||
return toAjax(sysEvaluationConclusionService.updateByBo(bo));
|
// return toAjax(sysEvaluationConclusionService.updateByBo(bo));
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 删除量测结果
|
// * 删除量测结果
|
||||||
*
|
// *
|
||||||
* @param ids 主键串
|
// * @param ids 主键串
|
||||||
*/
|
// */
|
||||||
@SaCheckPermission("scale:evaluationConclusion:remove")
|
// @SaCheckPermission("scale:evaluationConclusion: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(sysEvaluationConclusionService.deleteWithValidByIds(List.of(ids), true));
|
// return toAjax(sysEvaluationConclusionService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,10 @@ package org.dromara.scale.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
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.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
@ -32,7 +28,7 @@ import java.util.List;
|
||||||
@Validated
|
@Validated
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/scale/evaluationRecord")
|
@RequestMapping("/evaluation/record")
|
||||||
public class SysEvaluationRecordController extends BaseController {
|
public class SysEvaluationRecordController extends BaseController {
|
||||||
|
|
||||||
private final ISysEvaluationRecordService sysEvaluationRecordService;
|
private final ISysEvaluationRecordService sysEvaluationRecordService;
|
||||||
|
@ -40,7 +36,7 @@ public class SysEvaluationRecordController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 查询量测记录列表
|
* 查询量测记录列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("scale:evaluationRecord:list")
|
@SaCheckPermission("evaluation:record:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<SysEvaluationRecordVo> list(SysEvaluationRecordBo bo, PageQuery pageQuery) {
|
public TableDataInfo<SysEvaluationRecordVo> list(SysEvaluationRecordBo bo, PageQuery pageQuery) {
|
||||||
return sysEvaluationRecordService.queryPageList(bo, pageQuery);
|
return sysEvaluationRecordService.queryPageList(bo, pageQuery);
|
||||||
|
@ -49,7 +45,7 @@ public class SysEvaluationRecordController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 导出量测记录列表
|
* 导出量测记录列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("scale:evaluationRecord:export")
|
@SaCheckPermission("evaluation:record:export")
|
||||||
@Log(title = "量测记录", businessType = BusinessType.EXPORT)
|
@Log(title = "量测记录", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(SysEvaluationRecordBo bo, HttpServletResponse response) {
|
public void export(SysEvaluationRecordBo bo, HttpServletResponse response) {
|
||||||
|
@ -62,45 +58,45 @@ public class SysEvaluationRecordController extends BaseController {
|
||||||
*
|
*
|
||||||
* @param recordId 主键
|
* @param recordId 主键
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("scale:evaluationRecord:query")
|
@SaCheckPermission("evaluation:record:query")
|
||||||
@GetMapping("/{recordId}")
|
@GetMapping("/{recordId}")
|
||||||
public R<SysEvaluationRecordVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<SysEvaluationRecordVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable Long recordId) {
|
@PathVariable Long recordId) {
|
||||||
return R.ok(sysEvaluationRecordService.queryById(recordId));
|
return R.ok(sysEvaluationRecordService.queryById(recordId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 新增量测记录
|
// * 新增量测记录
|
||||||
*/
|
// */
|
||||||
@SaCheckPermission("scale:evaluationRecord:add")
|
// @SaCheckPermission("evaluation:record:add")
|
||||||
@Log(title = "量测记录", businessType = BusinessType.INSERT)
|
// @Log(title = "量测记录", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
// @RepeatSubmit()
|
||||||
@PostMapping()
|
// @PostMapping()
|
||||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysEvaluationRecordBo bo) {
|
// public R<Long> add(@Validated(AddGroup.class) @RequestBody SysEvaluationRecordBo bo) {
|
||||||
return toAjax(sysEvaluationRecordService.insertByBo(bo));
|
// return R.ok(sysEvaluationRecordService.insertByBo(bo));
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 修改量测记录
|
// * 修改量测记录
|
||||||
*/
|
// */
|
||||||
@SaCheckPermission("scale:evaluationRecord:edit")
|
// @SaCheckPermission("scale:evaluationRecord:edit")
|
||||||
@Log(title = "量测记录", businessType = BusinessType.UPDATE)
|
// @Log(title = "量测记录", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
// @RepeatSubmit()
|
||||||
@PutMapping()
|
// @PutMapping()
|
||||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysEvaluationRecordBo bo) {
|
// public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysEvaluationRecordBo bo) {
|
||||||
return toAjax(sysEvaluationRecordService.updateByBo(bo));
|
// return toAjax(sysEvaluationRecordService.updateByBo(bo));
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 删除量测记录
|
// * 删除量测记录
|
||||||
*
|
// *
|
||||||
* @param recordIds 主键串
|
// * @param recordIds 主键串
|
||||||
*/
|
// */
|
||||||
@SaCheckPermission("scale:evaluationRecord:remove")
|
// @SaCheckPermission("scale:evaluationRecord:remove")
|
||||||
@Log(title = "量测记录", businessType = BusinessType.DELETE)
|
// @Log(title = "量测记录", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{recordIds}")
|
// @DeleteMapping("/{recordIds}")
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
// public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
@PathVariable Long[] recordIds) {
|
// @PathVariable Long[] recordIds) {
|
||||||
return toAjax(sysEvaluationRecordService.deleteWithValidByIds(List.of(recordIds), true));
|
// return toAjax(sysEvaluationRecordService.deleteWithValidByIds(List.of(recordIds), true));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
package org.dromara.scale.controller;
|
package org.dromara.scale.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
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.idempotent.annotation.RepeatSubmit;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
@ -24,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 量发布
|
* 量表发布
|
||||||
*
|
*
|
||||||
* @author CJW
|
* @author CJW
|
||||||
* @date 2024-04-07
|
* @date 2024-04-07
|
||||||
|
@ -32,37 +30,37 @@ import java.util.List;
|
||||||
@Validated
|
@Validated
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/scale/scalePublish")
|
@RequestMapping("/scale/publish")
|
||||||
public class SysScalePublishController extends BaseController {
|
public class SysScalePublishController extends BaseController {
|
||||||
|
|
||||||
private final ISysScalePublishService sysScalePublishService;
|
private final ISysScalePublishService sysScalePublishService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询量发布列表
|
* 查询量表发布列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("scale:scalePublish:list")
|
@SaCheckPermission("scale:publish:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<SysScalePublishVo> list(SysScalePublishBo bo, PageQuery pageQuery) {
|
public TableDataInfo<SysScalePublishVo> list(SysScalePublishBo bo, PageQuery pageQuery) {
|
||||||
return sysScalePublishService.queryPageList(bo, pageQuery);
|
return sysScalePublishService.queryPageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 导出量发布列表
|
// * 导出量表发布列表
|
||||||
*/
|
// */
|
||||||
@SaCheckPermission("scale:scalePublish:export")
|
// @SaCheckPermission("scale:publish:export")
|
||||||
@Log(title = "量发布", businessType = BusinessType.EXPORT)
|
// @Log(title = "量发布", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
// @PostMapping("/export")
|
||||||
public void export(SysScalePublishBo bo, HttpServletResponse response) {
|
// public void export(SysScalePublishBo bo, HttpServletResponse response) {
|
||||||
List<SysScalePublishVo> list = sysScalePublishService.queryList(bo);
|
// List<SysScalePublishVo> list = sysScalePublishService.queryList(bo);
|
||||||
ExcelUtil.exportExcel(list, "量发布", SysScalePublishVo.class, response);
|
// ExcelUtil.exportExcel(list, "量表发布", SysScalePublishVo.class, response);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取量发布详细信息
|
* 获取量表发布详细信息
|
||||||
*
|
*
|
||||||
* @param batchNo 主键
|
* @param batchNo 主键
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("scale:scalePublish:query")
|
@SaCheckPermission("scale:publish:query")
|
||||||
@GetMapping("/{batchNo}")
|
@GetMapping("/{batchNo}")
|
||||||
public R<SysScalePublishVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<SysScalePublishVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable Long batchNo) {
|
@PathVariable Long batchNo) {
|
||||||
|
@ -70,9 +68,9 @@ public class SysScalePublishController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增量发布
|
* 新增量表发布
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("scale:scalePublish:add")
|
@SaCheckPermission("scale:publish:add")
|
||||||
@Log(title = "量发布", businessType = BusinessType.INSERT)
|
@Log(title = "量发布", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
|
@ -81,9 +79,9 @@ public class SysScalePublishController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改量发布
|
* 修改量表发布
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("scale:scalePublish:edit")
|
@SaCheckPermission("scale:publish:edit")
|
||||||
@Log(title = "量发布", businessType = BusinessType.UPDATE)
|
@Log(title = "量发布", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
|
@ -92,15 +90,15 @@ public class SysScalePublishController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除量发布
|
* 删除量表发布
|
||||||
*
|
*
|
||||||
* @param batchNos 主键串
|
* @param batchNos 主键串
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("scale:scalePublish:remove")
|
@SaCheckPermission("scale:publish:remove")
|
||||||
@Log(title = "量发布", businessType = BusinessType.DELETE)
|
@Log(title = "量发布", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{batchNos}")
|
@DeleteMapping("/{batchNo}")
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
@PathVariable Long[] batchNos) {
|
@PathVariable Long batchNos) {
|
||||||
return toAjax(sysScalePublishService.deleteWithValidByIds(List.of(batchNos), true));
|
return toAjax(sysScalePublishService.deleteWithValidByIds(List.of(batchNos), true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
package org.dromara.scale.controller.web;
|
||||||
|
|
||||||
|
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.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.scale.domain.bo.SysEvaluationRecordBo;
|
||||||
|
import org.dromara.scale.domain.vo.QuestionAnswerVo;
|
||||||
|
import org.dromara.scale.domain.vo.SysScalePublishVo;
|
||||||
|
import org.dromara.scale.service.ISysEvaluationRecordService;
|
||||||
|
import org.dromara.scale.service.ISysScaleAnswerService;
|
||||||
|
import org.dromara.scale.service.ISysScalePublishService;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>TODO<p>
|
||||||
|
*
|
||||||
|
* @author cjw
|
||||||
|
* @version V1.0.0
|
||||||
|
* @date 2024/4/7 16:44
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/web/scale")
|
||||||
|
public class WebController extends BaseController {
|
||||||
|
|
||||||
|
private final ISysScalePublishService scalePublishService;
|
||||||
|
|
||||||
|
private final ISysEvaluationRecordService evaluationRecordService;
|
||||||
|
|
||||||
|
private final ISysScaleAnswerService scaleAnswerService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询发布量表
|
||||||
|
*/
|
||||||
|
@GetMapping("/publish")
|
||||||
|
public R<SysScalePublishVo> queryPublish() {
|
||||||
|
return R.ok(scalePublishService.queryPublishScale());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询发布量表
|
||||||
|
*/
|
||||||
|
@GetMapping("/answer/{id}")
|
||||||
|
public R<List<QuestionAnswerVo>> queryAnswer(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long id) {
|
||||||
|
return R.ok(scaleAnswerService.queryQuestionAnswerListByScaleId(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增量测记录
|
||||||
|
*/
|
||||||
|
@Log(title = "量测记录", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping("/record")
|
||||||
|
public R<Long> add(@Validated(AddGroup.class) @RequestBody SysEvaluationRecordBo bo) {
|
||||||
|
return R.ok(evaluationRecordService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,12 +1,11 @@
|
||||||
package org.dromara.scale.domain;
|
package org.dromara.scale.domain;
|
||||||
|
|
||||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选项信息对象 sys_scale_answer
|
* 选项信息对象 sys_scale_answer
|
||||||
|
@ -15,9 +14,8 @@ import java.io.Serial;
|
||||||
* @date 2024-03-29
|
* @date 2024-03-29
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@TableName("sys_scale_answer")
|
@TableName("sys_scale_answer")
|
||||||
public class SysScaleAnswer extends BaseEntity {
|
public class SysScaleAnswer {
|
||||||
|
|
||||||
@Serial
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -28,26 +26,16 @@ public class SysScaleAnswer extends BaseEntity {
|
||||||
@TableId(value = "answer_id")
|
@TableId(value = "answer_id")
|
||||||
private Long answerId;
|
private Long answerId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 测评问题id
|
|
||||||
*/
|
|
||||||
private Long questionId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问题题目
|
|
||||||
*/
|
|
||||||
private String questionContent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 因子id
|
|
||||||
*/
|
|
||||||
private Long factorId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测评量表id
|
* 测评量表id
|
||||||
*/
|
*/
|
||||||
private Long scaleId;
|
private Long scaleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测评问题id
|
||||||
|
*/
|
||||||
|
private Long questionId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选项
|
* 选项
|
||||||
*/
|
*/
|
||||||
|
@ -58,5 +46,15 @@ public class SysScaleAnswer extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private BigDecimal score;
|
private BigDecimal score;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 展示类型
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class SysScalePublish {
|
||||||
/**
|
/**
|
||||||
* 创建者
|
* 创建者
|
||||||
*/
|
*/
|
||||||
@TableField(fill = FieldFill.INSERT)
|
//@TableField(fill = FieldFill.INSERT)
|
||||||
private Long createBy;
|
private Long createBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class SysEvaluationRecordBo {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
//@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||||
private Long recordId;
|
private Long recordId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,7 +34,7 @@ public class SysEvaluationRecordBo {
|
||||||
/**
|
/**
|
||||||
* 测评人id
|
* 测评人id
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "测评人id不能为空", groups = { AddGroup.class, EditGroup.class })
|
//@NotNull(message = "测评人id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package org.dromara.scale.domain.bo;
|
package org.dromara.scale.domain.bo;
|
||||||
|
|
||||||
import org.dromara.scale.domain.SysScaleAnswer;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import org.dromara.scale.domain.SysScaleAnswer;
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import jakarta.validation.constraints.*;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,9 +17,8 @@ import java.math.BigDecimal;
|
||||||
* @date 2024-03-29
|
* @date 2024-03-29
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@AutoMapper(target = SysScaleAnswer.class, reverseConvertGenerate = false)
|
@AutoMapper(target = SysScaleAnswer.class, reverseConvertGenerate = false)
|
||||||
public class SysScaleAnswerBo extends BaseEntity {
|
public class SysScaleAnswerBo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测评答案id
|
* 测评答案id
|
||||||
|
@ -27,30 +26,18 @@ public class SysScaleAnswerBo extends BaseEntity {
|
||||||
@NotNull(message = "测评答案id不能为空", groups = {EditGroup.class})
|
@NotNull(message = "测评答案id不能为空", groups = {EditGroup.class})
|
||||||
private Long answerId;
|
private Long answerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 量表id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "量表id不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private Long scaleId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测评问题id
|
* 测评问题id
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "测评问题id不能为空", groups = {AddGroup.class, EditGroup.class})
|
@NotNull(message = "测评问题id不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private Long questionId;
|
private Long questionId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 问题题目
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "问题题目不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private String questionContent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 因子id
|
|
||||||
*/
|
|
||||||
@NotNull(message = "因子id不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private Long factorId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 测评量表id
|
|
||||||
*/
|
|
||||||
@NotNull(message = "测评量表id不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private Long scaleId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选项
|
* 选项
|
||||||
*/
|
*/
|
||||||
|
@ -63,5 +50,16 @@ public class SysScaleAnswerBo extends BaseEntity {
|
||||||
@NotNull(message = "得分不能为空", groups = {AddGroup.class, EditGroup.class})
|
@NotNull(message = "得分不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
private BigDecimal score;
|
private BigDecimal score;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 展示类型
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
@NotNull(message = "排序不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class SysScalePublishBo {
|
||||||
/**
|
/**
|
||||||
* 部门分组id
|
* 部门分组id
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "部门分组id不能为空", groups = { AddGroup.class, EditGroup.class })
|
//@NotNull(message = "部门分组id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,7 +65,7 @@ public class SysScalePublishBo {
|
||||||
/**
|
/**
|
||||||
* 状态 0:正常;1:停用
|
* 状态 0:正常;1:停用
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "状态 0:正常;1:停用不能为空", groups = { AddGroup.class, EditGroup.class })
|
//@NotNull(message = "状态 0:正常;1:停用不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long status;
|
private Long status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package org.dromara.scale.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>TODO<p>
|
||||||
|
*
|
||||||
|
* @author cjw
|
||||||
|
* @version V1.0.0
|
||||||
|
* @date 2024/4/8 10:32
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class QuestionAnswerVo implements Serializable {
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Long questionId;
|
||||||
|
|
||||||
|
private String questionContent;
|
||||||
|
|
||||||
|
private Long questionOrder;
|
||||||
|
|
||||||
|
private List<SysScaleAnswerVo> answerList;
|
||||||
|
}
|
|
@ -1,17 +1,14 @@
|
||||||
package org.dromara.scale.domain.vo;
|
package org.dromara.scale.domain.vo;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import org.dromara.scale.domain.SysScaleAnswer;
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|
||||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.dromara.scale.domain.SysScaleAnswer;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,24 +38,6 @@ public class SysScaleAnswerVo implements Serializable {
|
||||||
@ExcelProperty(value = "测评问题id")
|
@ExcelProperty(value = "测评问题id")
|
||||||
private Long questionId;
|
private Long questionId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 问题题目
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "问题题目")
|
|
||||||
private String questionContent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 因子id
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "因子id")
|
|
||||||
private Long factorId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 测评量表id
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "测评量表id")
|
|
||||||
private Long scaleId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选项
|
* 选项
|
||||||
*/
|
*/
|
||||||
|
@ -71,5 +50,18 @@ public class SysScaleAnswerVo implements Serializable {
|
||||||
@ExcelProperty(value = "得分")
|
@ExcelProperty(value = "得分")
|
||||||
private BigDecimal score;
|
private BigDecimal score;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 展示选择
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import org.dromara.scale.domain.SysScalePublish;
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -80,5 +80,7 @@ public class SysScalePublishVo implements Serializable {
|
||||||
@ExcelProperty(value = "0:不允许,1:允许")
|
@ExcelProperty(value = "0:不允许,1:允许")
|
||||||
private Integer allowQueryResult;
|
private Integer allowQueryResult;
|
||||||
|
|
||||||
|
private List<SysScaleVo> scaleList;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ public interface ISysEvaluationRecordService {
|
||||||
/**
|
/**
|
||||||
* 新增量测记录
|
* 新增量测记录
|
||||||
*/
|
*/
|
||||||
Boolean insertByBo(SysEvaluationRecordBo bo);
|
Long insertByBo(SysEvaluationRecordBo bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改量测记录
|
* 修改量测记录
|
||||||
|
|
|
@ -3,6 +3,7 @@ package org.dromara.scale.service;
|
||||||
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.scale.domain.bo.SysScaleAnswerBo;
|
import org.dromara.scale.domain.bo.SysScaleAnswerBo;
|
||||||
|
import org.dromara.scale.domain.vo.QuestionAnswerVo;
|
||||||
import org.dromara.scale.domain.vo.SysScaleAnswerVo;
|
import org.dromara.scale.domain.vo.SysScaleAnswerVo;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
@ -46,4 +47,6 @@ public interface ISysScaleAnswerService {
|
||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
List<QuestionAnswerVo> queryQuestionAnswerListByScaleId(Long scaleId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,4 +45,6 @@ public interface ISysScalePublishService {
|
||||||
* 校验并批量删除量发布信息
|
* 校验并批量删除量发布信息
|
||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
SysScalePublishVo queryPublishScale();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.core.domain.model.LoginUser;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
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;
|
||||||
|
@ -15,8 +16,11 @@ import org.dromara.scale.service.ISysEvaluationRecordService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static org.dromara.common.satoken.utils.LoginHelper.getLoginUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 量测记录Service业务层处理
|
* 量测记录Service业务层处理
|
||||||
*
|
*
|
||||||
|
@ -69,14 +73,17 @@ public class SysEvaluationRecordServiceImpl implements ISysEvaluationRecordServi
|
||||||
* 新增量测记录
|
* 新增量测记录
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertByBo(SysEvaluationRecordBo bo) {
|
public Long insertByBo(SysEvaluationRecordBo bo) {
|
||||||
|
LoginUser loginUser = getLoginUser();
|
||||||
SysEvaluationRecord add = MapstructUtils.convert(bo, SysEvaluationRecord.class);
|
SysEvaluationRecord add = MapstructUtils.convert(bo, SysEvaluationRecord.class);
|
||||||
|
add.setUserId(loginUser.getUserId());
|
||||||
|
add.setCreateTime(new Date());
|
||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
if (flag) {
|
if (flag) {
|
||||||
bo.setRecordId(add.getRecordId());
|
bo.setRecordId(add.getRecordId());
|
||||||
}
|
}
|
||||||
return flag;
|
return add.getRecordId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,23 +1,26 @@
|
||||||
package org.dromara.scale.service.impl;
|
package org.dromara.scale.service.impl;
|
||||||
|
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
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;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.scale.domain.bo.SysScaleAnswerBo;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.scale.domain.vo.SysScaleAnswerVo;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.scale.domain.SysScaleAnswer;
|
import org.dromara.scale.domain.SysScaleAnswer;
|
||||||
|
import org.dromara.scale.domain.SysScaleQuestion;
|
||||||
|
import org.dromara.scale.domain.bo.SysScaleAnswerBo;
|
||||||
|
import org.dromara.scale.domain.vo.QuestionAnswerVo;
|
||||||
|
import org.dromara.scale.domain.vo.SysScaleAnswerVo;
|
||||||
|
import org.dromara.scale.domain.vo.SysScaleQuestionVo;
|
||||||
import org.dromara.scale.mapper.SysScaleAnswerMapper;
|
import org.dromara.scale.mapper.SysScaleAnswerMapper;
|
||||||
|
import org.dromara.scale.mapper.SysScaleQuestionMapper;
|
||||||
import org.dromara.scale.service.ISysScaleAnswerService;
|
import org.dromara.scale.service.ISysScaleAnswerService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Map;
|
import java.util.stream.Collectors;
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选项信息Service业务层处理
|
* 选项信息Service业务层处理
|
||||||
|
@ -31,6 +34,8 @@ public class SysScaleAnswerServiceImpl implements ISysScaleAnswerService {
|
||||||
|
|
||||||
private final SysScaleAnswerMapper baseMapper;
|
private final SysScaleAnswerMapper baseMapper;
|
||||||
|
|
||||||
|
private final SysScaleQuestionMapper questionMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询选项信息
|
* 查询选项信息
|
||||||
*/
|
*/
|
||||||
|
@ -59,12 +64,9 @@ public class SysScaleAnswerServiceImpl implements ISysScaleAnswerService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private LambdaQueryWrapper<SysScaleAnswer> buildQueryWrapper(SysScaleAnswerBo bo) {
|
private LambdaQueryWrapper<SysScaleAnswer> buildQueryWrapper(SysScaleAnswerBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
//Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<SysScaleAnswer> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<SysScaleAnswer> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq(bo.getQuestionId() != null, SysScaleAnswer::getQuestionId, bo.getQuestionId());
|
lqw.eq(bo.getQuestionId() != null, SysScaleAnswer::getQuestionId, bo.getQuestionId());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getQuestionContent()), SysScaleAnswer::getQuestionContent, bo.getQuestionContent());
|
|
||||||
lqw.eq(bo.getFactorId() != null, SysScaleAnswer::getFactorId, bo.getFactorId());
|
|
||||||
lqw.eq(bo.getScaleId() != null, SysScaleAnswer::getScaleId, bo.getScaleId());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getAnswerOption()), SysScaleAnswer::getAnswerOption, bo.getAnswerOption());
|
lqw.eq(StringUtils.isNotBlank(bo.getAnswerOption()), SysScaleAnswer::getAnswerOption, bo.getAnswerOption());
|
||||||
lqw.eq(bo.getScore() != null, SysScaleAnswer::getScore, bo.getScore());
|
lqw.eq(bo.getScore() != null, SysScaleAnswer::getScore, bo.getScore());
|
||||||
return lqw;
|
return lqw;
|
||||||
|
@ -112,4 +114,31 @@ public class SysScaleAnswerServiceImpl implements ISysScaleAnswerService {
|
||||||
return baseMapper.deleteBatchIds(ids) > 0;
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<QuestionAnswerVo> queryQuestionAnswerListByScaleId(Long scaleId) {
|
||||||
|
LambdaQueryWrapper<SysScaleQuestion> questionLqw = Wrappers.lambdaQuery();
|
||||||
|
questionLqw.eq(SysScaleQuestion::getScaleId, scaleId);
|
||||||
|
questionLqw.orderByAsc(SysScaleQuestion::getQuestionOrder);
|
||||||
|
List<SysScaleQuestionVo> questionVos = questionMapper.selectVoList(questionLqw);
|
||||||
|
LambdaQueryWrapper<SysScaleAnswer> answerLqw = Wrappers.lambdaQuery();
|
||||||
|
answerLqw.eq(SysScaleAnswer::getScaleId, scaleId);
|
||||||
|
List<SysScaleAnswerVo> answerVos = baseMapper.selectVoList(answerLqw);
|
||||||
|
Map<Long, List<SysScaleAnswerVo>> collect = answerVos.stream().collect(
|
||||||
|
Collectors.groupingBy(SysScaleAnswerVo::getQuestionId, Collectors.toList()));
|
||||||
|
List<QuestionAnswerVo> questionAnswerVos = new LinkedList<>();
|
||||||
|
for (SysScaleQuestionVo question : questionVos) {
|
||||||
|
Long questionId = question.getQuestionId();
|
||||||
|
String questionContent = question.getQuestionContent();
|
||||||
|
Long questionOrder = question.getQuestionOrder();
|
||||||
|
List<SysScaleAnswerVo> sysScaleAnswerVos = collect.get(questionId).stream()
|
||||||
|
.sorted(Comparator.comparingInt(SysScaleAnswerVo::getSort)).collect(Collectors.toList());
|
||||||
|
QuestionAnswerVo one = new QuestionAnswerVo();
|
||||||
|
one.setQuestionId(questionId);
|
||||||
|
one.setQuestionContent(questionContent);
|
||||||
|
one.setQuestionOrder(questionOrder);
|
||||||
|
one.setAnswerList(sysScaleAnswerVos);
|
||||||
|
questionAnswerVos.add(one);
|
||||||
|
}
|
||||||
|
return questionAnswerVos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.common.core.domain.model.LoginUser;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
@ -16,8 +17,11 @@ import org.dromara.scale.service.ISysScalePublishService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static org.dromara.common.satoken.utils.LoginHelper.getLoginUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 量发布Service业务层处理
|
* 量发布Service业务层处理
|
||||||
*
|
*
|
||||||
|
@ -76,7 +80,10 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertByBo(SysScalePublishBo bo) {
|
public Boolean insertByBo(SysScalePublishBo bo) {
|
||||||
|
LoginUser loginUser = getLoginUser();
|
||||||
SysScalePublish add = MapstructUtils.convert(bo, SysScalePublish.class);
|
SysScalePublish add = MapstructUtils.convert(bo, SysScalePublish.class);
|
||||||
|
add.setCreateBy(loginUser.getUserId());
|
||||||
|
add.setCreateTime(new Date());
|
||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
if (flag) {
|
if (flag) {
|
||||||
|
@ -112,4 +119,26 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
||||||
}
|
}
|
||||||
return baseMapper.deleteBatchIds(ids) > 0;
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SysScalePublishVo queryPublishScale() {
|
||||||
|
LoginUser loginUser = getLoginUser();
|
||||||
|
Long deptId = loginUser.getDeptId();
|
||||||
|
SysScalePublishVo sysScalePublishVo = null;
|
||||||
|
//先查询有用户组的发布
|
||||||
|
if (deptId != null) {
|
||||||
|
LambdaQueryWrapper<SysScalePublish> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(SysScalePublish::getDeptId, deptId);
|
||||||
|
lqw.eq(SysScalePublish::getStatus, 0);
|
||||||
|
sysScalePublishVo = baseMapper.selectVoOne(lqw);
|
||||||
|
}
|
||||||
|
//如果没用户组或者有用户组的发布为空,则查针对全部的发布
|
||||||
|
if(sysScalePublishVo == null){
|
||||||
|
LambdaQueryWrapper<SysScalePublish> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(SysScalePublish::getDeptId, null);
|
||||||
|
lqw.eq(SysScalePublish::getStatus, 0);
|
||||||
|
sysScalePublishVo = baseMapper.selectVoOne(lqw);
|
||||||
|
}
|
||||||
|
return sysScalePublishVo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ public class SysScaleQuestionServiceImpl implements ISysScaleQuestionService {
|
||||||
for (SysScaleAnswer sysScaleAnswer : scaleAnswerList) {
|
for (SysScaleAnswer sysScaleAnswer : scaleAnswerList) {
|
||||||
sysScaleAnswer.setScaleId(bo.getScaleId());
|
sysScaleAnswer.setScaleId(bo.getScaleId());
|
||||||
sysScaleAnswer.setQuestionId(sysScaleQuestion.getQuestionId());
|
sysScaleAnswer.setQuestionId(sysScaleQuestion.getQuestionId());
|
||||||
sysScaleAnswer.setQuestionContent(sysScaleQuestion.getQuestionContent());
|
//sysScaleAnswer.setQuestionContent(sysScaleQuestion.getQuestionContent());
|
||||||
}
|
}
|
||||||
scaleAnswerMapper.batchInsert(scaleAnswerList);
|
scaleAnswerMapper.batchInsert(scaleAnswerList);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue