Compare commits
2 Commits
bbcf68bdb8
...
f6b0410fda
| Author | SHA1 | Date | |
|---|---|---|---|
| f6b0410fda | |||
| dc65ef8d24 |
@ -58,7 +58,9 @@ VALUES
|
||||
(201201, 1, '单选', '1', 'primary', '', 'prison_question_type', '0', '单选题', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201202, 2, '多选', '2', 'success', '', 'prison_question_type', '0', '多选题', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201203, 3, '填空', '3', 'warning', '', 'prison_question_type', '0', '填空题', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201204, 4, '评分', '4', 'info', '', 'prison_question_type', '0', '评分题', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
(201204, 4, '评分', '4', 'info', '', 'prison_question_type', '0', '评分题', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201205, 5, '日期', '5', 'primary', '', 'prison_question_type', '0', '日期选择题', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201206, 6, '数字', '6', 'success', '', 'prison_question_type', '0', '数字输入题', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 6. 问卷状态 (prison_questionnaire_status)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
@ -86,9 +88,11 @@ VALUES (2014, '消费类型', 'prison_consumption_type', '0', '消费记录类
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(201401, 1, '存款', '1', 'success', '', 'prison_consumption_type', '0', '存款', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201402, 2, '消费', '2', 'primary', '', 'prison_consumption_type', '0', '消费', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201403, 3, '转账', '3', 'warning', '', 'prison_consumption_type', '0', '转账', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
(201401, 1, '购物', '1', 'success', '', 'prison_consumption_type', '0', '购物消费', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201402, 2, '餐饮', '2', 'primary', '', 'prison_consumption_type', '0', '餐饮消费', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201403, 3, '医疗', '3', 'warning', '', 'prison_consumption_type', '0', '医疗消费', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201404, 4, '通讯', '4', 'info', '', 'prison_consumption_type', '0', '通讯消费', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201405, 5, '其他', '5', 'primary', '', 'prison_consumption_type', '0', '其他消费', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 8. 消费状态 (prison_consumption_status)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
@ -105,9 +109,10 @@ VALUES (2016, '评估类型', 'prison_assessment_type', '0', '危险评估类型
|
||||
|
||||
INSERT IGNORE INTO system_dict_data (id, sort, label, value, color_type, css_class, dict_type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
VALUES
|
||||
(201601, 1, '入狱评估', '1', 'primary', '', 'prison_assessment_type', '0', '入狱时评估', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201601, 1, '入监评估', '1', 'primary', '', 'prison_assessment_type', '0', '入监时评估', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201602, 2, '定期评估', '2', 'success', '', 'prison_assessment_type', '0', '定期评估', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201603, 3, '专项评估', '3', 'warning', '', 'prison_assessment_type', '0', '专项评估', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
(201603, 3, '专项评估', '3', 'warning', '', 'prison_assessment_type', '0', '专项评估', 'admin', NOW(), 'admin', NOW(), 0),
|
||||
(201604, 4, '出监评估', '4', 'info', '', 'prison_assessment_type', '0', '出监时评估', 'admin', NOW(), 'admin', NOW(), 0);
|
||||
|
||||
-- 10. 考核等级 (prison_score_level)
|
||||
INSERT IGNORE INTO system_dict_type (id, name, type, status, remark, creator, create_time, updater, update_time, deleted)
|
||||
|
||||
@ -72,6 +72,21 @@
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-junit-jupiter</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@ -0,0 +1,112 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.answer;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.answer.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.answer.AnswerDO;
|
||||
import cn.iocoder.yudao.module.prison.service.answer.AnswerService;
|
||||
|
||||
@Tag(name = "管理后台 - 问卷答题记录")
|
||||
@RestController
|
||||
@RequestMapping("/prison/answer")
|
||||
@Validated
|
||||
public class PrisonAnswerController {
|
||||
|
||||
@Resource
|
||||
private AnswerService answerService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建答题记录")
|
||||
@PreAuthorize("@ss.hasPermission('prison:answer:create')")
|
||||
public CommonResult<Long> createAnswer(@Valid @RequestBody AnswerSaveReqVO createReqVO) {
|
||||
return success(answerService.createAnswer(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新答题记录")
|
||||
@PreAuthorize("@ss.hasPermission('prison:answer:update')")
|
||||
public CommonResult<Boolean> updateAnswer(@Valid @RequestBody AnswerSaveReqVO updateReqVO) {
|
||||
answerService.updateAnswer(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除答题记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:answer:delete')")
|
||||
public CommonResult<Boolean> deleteAnswer(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
answerService.deleteAnswer(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/delete-list")
|
||||
@Operation(summary = "批量删除答题记录")
|
||||
@PreAuthorize("@ss.hasPermission('prison:answer:delete')")
|
||||
public CommonResult<Boolean> deleteAnswerList(@NotEmpty(message = "编号列表不能为空") @RequestBody List<Long> ids) {
|
||||
answerService.deleteAnswerListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得答题记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:answer:query')")
|
||||
public CommonResult<AnswerRespVO> getAnswer(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
AnswerDO answer = answerService.getAnswer(id);
|
||||
return success(BeanUtils.toBean(answer, AnswerRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得答题记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:answer:query')")
|
||||
public CommonResult<PageResult<AnswerRespVO>> getAnswerPage(@Valid AnswerPageReqVO pageReqVO) {
|
||||
PageResult<AnswerDO> pageResult = answerService.getAnswerPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, AnswerRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list-by-assessment-record")
|
||||
@Operation(summary = "根据测评记录ID查询答题列表")
|
||||
@PreAuthorize("@ss.hasPermission('prison:answer:query')")
|
||||
public CommonResult<List<AnswerRespVO>> getAnswersByAssessmentRecordId(
|
||||
@NotNull(message = "测评记录ID不能为空") @RequestParam("assessmentRecordId") Long assessmentRecordId) {
|
||||
List<AnswerDO> list = answerService.getAnswersByAssessmentRecordId(assessmentRecordId);
|
||||
return success(BeanUtils.toBean(list, AnswerRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出答题记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:answer:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportAnswerExcel(@Valid AnswerPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<AnswerDO> list = answerService.getAnswerPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "答题记录.xls", "数据", AnswerRespVO.class,
|
||||
BeanUtils.toBean(list, AnswerRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.answer.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷答题记录分页 Request VO")
|
||||
@Data
|
||||
public class AnswerPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "测评记录ID")
|
||||
private Long assessmentRecordId;
|
||||
|
||||
@Schema(description = "问题ID")
|
||||
private Long questionId;
|
||||
|
||||
@Schema(description = "问卷ID")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "罪犯ID")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "问题类型:1-单选 2-多选 3-填空 4-评分 5-日期 6-数字")
|
||||
private Integer questionType;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.answer.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷答题记录 Response VO")
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AnswerRespVO {
|
||||
|
||||
@Schema(description = "答题记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "测评记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long assessmentRecordId;
|
||||
|
||||
@Schema(description = "问题ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long questionId;
|
||||
|
||||
@Schema(description = "问卷ID", example = "1024")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "罪犯ID", example = "1024")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "问题类型:1-单选 2-多选 3-填空 4-评分 5-日期 6-数字", example = "1")
|
||||
private Integer questionType;
|
||||
|
||||
@Schema(description = "答案内容(填空题、评分题等)")
|
||||
private String answerText;
|
||||
|
||||
@Schema(description = "选项ID列表(JSON数组,如 [1,2,3])")
|
||||
private String optionIds;
|
||||
|
||||
@Schema(description = "得分")
|
||||
private BigDecimal score;
|
||||
|
||||
@Schema(description = "是否正确:null-未评分 false-错误 true-正确")
|
||||
private Boolean isCorrect;
|
||||
|
||||
@Schema(description = "答题时间(秒)")
|
||||
private Integer duration;
|
||||
|
||||
@Schema(description = "创建者", example = "芋艿")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.answer.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷答题记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class AnswerSaveReqVO {
|
||||
|
||||
@Schema(description = "答题记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26045")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "测评记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "测评记录ID不能为空")
|
||||
private Long assessmentRecordId;
|
||||
|
||||
@Schema(description = "问题ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "问题ID不能为空")
|
||||
private Long questionId;
|
||||
|
||||
@Schema(description = "问卷ID")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "罪犯ID不能为空")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "问题类型:1-单选 2-多选 3-填空 4-评分 5-日期 6-数字", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "问题类型不能为空")
|
||||
private Integer questionType;
|
||||
|
||||
@Schema(description = "答案内容(填空题、评分题等)")
|
||||
private String answerText;
|
||||
|
||||
@Schema(description = "选项ID列表(JSON数组,如 [1,2,3])")
|
||||
private String optionIds;
|
||||
|
||||
@Schema(description = "得分")
|
||||
private BigDecimal score;
|
||||
|
||||
@Schema(description = "是否正确:null-未评分 false-错误 true-正确")
|
||||
private Boolean isCorrect;
|
||||
|
||||
@Schema(description = "答题时间(秒)")
|
||||
private Integer duration;
|
||||
|
||||
}
|
||||
@ -12,6 +12,7 @@ import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
@ -110,7 +111,45 @@ public class PrisonAreaController {
|
||||
@RequestParam(value = "level", required = false) Integer level,
|
||||
@RequestParam(value = "status", required = false) Integer status) {
|
||||
List<AreaDO> tree = areaService.getAreaTree(name, type, level, status);
|
||||
return success(BeanUtils.toBean(tree, AreaRespVO.class));
|
||||
return success(convertTreeToRespVO(tree));
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归转换 AreaDO 树形结构到 AreaRespVO
|
||||
*/
|
||||
private List<AreaRespVO> convertTreeToRespVO(List<AreaDO> areas) {
|
||||
if (areas == null || areas.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
List<AreaRespVO> result = new ArrayList<>();
|
||||
for (AreaDO area : areas) {
|
||||
result.add(convertToRespVO(area));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归转换单个 AreaDO 到 AreaRespVO
|
||||
*/
|
||||
private AreaRespVO convertToRespVO(AreaDO area) {
|
||||
AreaRespVO resp = new AreaRespVO();
|
||||
resp.setId(area.getId());
|
||||
resp.setName(area.getName());
|
||||
resp.setCode(area.getCode());
|
||||
resp.setParentId(area.getParentId());
|
||||
resp.setLevel(area.getLevel());
|
||||
resp.setType(area.getType());
|
||||
resp.setCapacity(area.getCapacity());
|
||||
resp.setCurrentCount(area.getCurrentCount());
|
||||
resp.setSort(area.getSort());
|
||||
resp.setStatus(area.getStatus());
|
||||
resp.setRemark(area.getRemark());
|
||||
resp.setCreateTime(area.getCreateTime());
|
||||
// 递归设置子节点
|
||||
if (area.getChildren() != null && !area.getChildren().isEmpty()) {
|
||||
resp.setChildren(convertTreeToRespVO(area.getChildren()));
|
||||
}
|
||||
return resp;
|
||||
}
|
||||
|
||||
@GetMapping("/children")
|
||||
|
||||
@ -5,6 +5,7 @@ import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import cn.idev.excel.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
@ -59,10 +60,10 @@ public class AreaRespVO {
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "子监区列表,仅一级监区返回")
|
||||
@JsonIgnore
|
||||
private List<AreaRespVO> children;
|
||||
|
||||
}
|
||||
@ -1,145 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.assessment.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.assessment.AssessmentAnswerDO;
|
||||
import cn.iocoder.yudao.module.prison.service.assessment.AssessmentAnswerService;
|
||||
|
||||
@Tag(name = "管理后台 - 答卷详情")
|
||||
@RestController
|
||||
@RequestMapping("/prison/assessment-answer")
|
||||
@Validated
|
||||
public class AssessmentAnswerController {
|
||||
|
||||
@Resource
|
||||
private AssessmentAnswerService assessmentAnswerService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建答卷")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-answer:create')")
|
||||
public CommonResult<Long> createAssessmentAnswer(@Valid @RequestBody AssessmentAnswerSaveReqVO createReqVO) {
|
||||
return success(assessmentAnswerService.createAssessmentAnswer(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新答卷")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-answer:update')")
|
||||
public CommonResult<Boolean> updateAssessmentAnswer(@Valid @RequestBody AssessmentAnswerSaveReqVO updateReqVO) {
|
||||
assessmentAnswerService.updateAssessmentAnswer(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除答卷")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-answer:delete')")
|
||||
public CommonResult<Boolean> deleteAssessmentAnswer(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
assessmentAnswerService.deleteAssessmentAnswer(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Operation(summary = "批量删除答卷")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-answer:delete')")
|
||||
public CommonResult<Boolean> deleteAssessmentAnswerList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
assessmentAnswerService.deleteAssessmentAnswerListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得答卷")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-answer:query')")
|
||||
public CommonResult<AssessmentAnswerRespVO> getAssessmentAnswer(@RequestParam("id") Long id) {
|
||||
AssessmentAnswerDO assessmentAnswer = assessmentAnswerService.getAssessmentAnswer(id);
|
||||
return success(BeanUtils.toBean(assessmentAnswer, AssessmentAnswerRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得答卷分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-answer:query')")
|
||||
public CommonResult<PageResult<AssessmentAnswerRespVO>> getAssessmentAnswerPage(@Valid AssessmentAnswerPageReqVO pageReqVO) {
|
||||
PageResult<AssessmentAnswerDO> pageResult = assessmentAnswerService.getAssessmentAnswerPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, AssessmentAnswerRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/start")
|
||||
@Operation(summary = "开始答题")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-answer:create')")
|
||||
public CommonResult<Long> startAnswer(@RequestParam("assessmentRecordId") Long assessmentRecordId,
|
||||
@RequestParam("prisonerId") Long prisonerId) {
|
||||
return success(assessmentAnswerService.startAnswer(assessmentRecordId, prisonerId));
|
||||
}
|
||||
|
||||
@PostMapping("/submit")
|
||||
@Operation(summary = "提交答卷")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-answer:update')")
|
||||
public CommonResult<Boolean> submitAnswer(@Valid @RequestBody AssessmentAnswerSubmitReqVO submitReqVO) {
|
||||
assessmentAnswerService.submitAnswer(submitReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/pending-score-page")
|
||||
@Operation(summary = "获取待评分答卷列表")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-answer:query')")
|
||||
public CommonResult<PageResult<AssessmentAnswerRespVO>> getPendingScorePage(@Valid AssessmentAnswerPageReqVO pageReqVO) {
|
||||
PageResult<AssessmentAnswerDO> pageResult = assessmentAnswerService.getPendingScorePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, AssessmentAnswerRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/manual-score")
|
||||
@Operation(summary = "人工评分")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-answer:update')")
|
||||
public CommonResult<Boolean> manualScore(@Valid @RequestBody AssessmentAnswerManualScoreReqVO scoreReqVO) {
|
||||
assessmentAnswerService.manualScore(scoreReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get-by-prisoner")
|
||||
@Operation(summary = "根据囚犯ID和测评记录ID获取答卷")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-answer:query')")
|
||||
public CommonResult<AssessmentAnswerRespVO> getByPrisonerAndRecord(
|
||||
@RequestParam("prisonerId") Long prisonerId,
|
||||
@RequestParam("assessmentRecordId") Long assessmentRecordId) {
|
||||
AssessmentAnswerDO assessmentAnswer = assessmentAnswerService.getByPrisonerAndRecord(prisonerId, assessmentRecordId);
|
||||
return success(BeanUtils.toBean(assessmentAnswer, AssessmentAnswerRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出答卷 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-answer:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportAssessmentAnswerExcel(@Valid AssessmentAnswerPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<AssessmentAnswerDO> list = assessmentAnswerService.getAssessmentAnswerPage(pageReqVO).getList();
|
||||
ExcelUtils.write(response, "答卷详情.xls", "数据", AssessmentAnswerRespVO.class,
|
||||
BeanUtils.toBean(list, AssessmentAnswerRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,134 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.assessment.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.assessment.AssessmentRecordDO;
|
||||
import cn.iocoder.yudao.module.prison.service.assessment.AssessmentRecordService;
|
||||
|
||||
@Tag(name = "管理后台 - 测评记录")
|
||||
@RestController
|
||||
@RequestMapping("/prison/assessment-record")
|
||||
@Validated
|
||||
public class AssessmentRecordController {
|
||||
|
||||
@Resource
|
||||
private AssessmentRecordService assessmentRecordService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建测评记录")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-record:create')")
|
||||
public CommonResult<Long> createAssessmentRecord(@Valid @RequestBody AssessmentRecordSaveReqVO createReqVO) {
|
||||
return success(assessmentRecordService.createAssessmentRecord(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新测评记录")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-record:update')")
|
||||
public CommonResult<Boolean> updateAssessmentRecord(@Valid @RequestBody AssessmentRecordSaveReqVO updateReqVO) {
|
||||
assessmentRecordService.updateAssessmentRecord(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除测评记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-record:delete')")
|
||||
public CommonResult<Boolean> deleteAssessmentRecord(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
assessmentRecordService.deleteAssessmentRecord(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Operation(summary = "批量删除测评记录")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-record:delete')")
|
||||
public CommonResult<Boolean> deleteAssessmentRecordList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
assessmentRecordService.deleteAssessmentRecordListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得测评记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-record:query')")
|
||||
public CommonResult<AssessmentRecordRespVO> getAssessmentRecord(@RequestParam("id") Long id) {
|
||||
AssessmentRecordDO assessmentRecord = assessmentRecordService.getAssessmentRecord(id);
|
||||
return success(BeanUtils.toBean(assessmentRecord, AssessmentRecordRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得测评记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-record:query')")
|
||||
public CommonResult<PageResult<AssessmentRecordRespVO>> getAssessmentRecordPage(@Valid AssessmentRecordPageReqVO pageReqVO) {
|
||||
PageResult<AssessmentRecordDO> pageResult = assessmentRecordService.getAssessmentRecordPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, AssessmentRecordRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/initiate")
|
||||
@Operation(summary = "发起测评")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-record:create')")
|
||||
public CommonResult<Long> initiateAssessment(@Valid @RequestBody AssessmentRecordSaveReqVO reqVO) {
|
||||
return success(assessmentRecordService.initiateAssessment(reqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/cancel")
|
||||
@Operation(summary = "取消测评")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-record:update')")
|
||||
public CommonResult<Boolean> cancelAssessment(@RequestParam("id") Long id) {
|
||||
assessmentRecordService.cancelAssessment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/start")
|
||||
@Operation(summary = "启动测评")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-record:update')")
|
||||
public CommonResult<Boolean> startAssessment(@RequestParam("id") Long id) {
|
||||
assessmentRecordService.startAssessment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/finish")
|
||||
@Operation(summary = "结束测评")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-record:update')")
|
||||
public CommonResult<Boolean> finishAssessment(@RequestParam("id") Long id) {
|
||||
assessmentRecordService.finishAssessment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出测评记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-record:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportAssessmentRecordExcel(@Valid AssessmentRecordPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<AssessmentRecordDO> list = assessmentRecordService.getAssessmentRecordPage(pageReqVO).getList();
|
||||
ExcelUtils.write(response, "测评记录.xls", "数据", AssessmentRecordRespVO.class,
|
||||
BeanUtils.toBean(list, AssessmentRecordRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,143 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.assessment.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.assessment.AssessmentResultDO;
|
||||
import cn.iocoder.yudao.module.prison.service.assessment.AssessmentResultService;
|
||||
|
||||
@Tag(name = "管理后台 - 测评结果")
|
||||
@RestController
|
||||
@RequestMapping("/prison/assessment-result")
|
||||
@Validated
|
||||
public class AssessmentResultController {
|
||||
|
||||
@Resource
|
||||
private AssessmentResultService assessmentResultService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建测评结果")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-result:create')")
|
||||
public CommonResult<Long> createAssessmentResult(@Valid @RequestBody AssessmentResultSaveReqVO createReqVO) {
|
||||
return success(assessmentResultService.createAssessmentResult(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新测评结果")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-result:update')")
|
||||
public CommonResult<Boolean> updateAssessmentResult(@Valid @RequestBody AssessmentResultSaveReqVO updateReqVO) {
|
||||
assessmentResultService.updateAssessmentResult(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除测评结果")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-result:delete')")
|
||||
public CommonResult<Boolean> deleteAssessmentResult(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
assessmentResultService.deleteAssessmentResult(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Operation(summary = "批量删除测评结果")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-result:delete')")
|
||||
public CommonResult<Boolean> deleteAssessmentResultList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
assessmentResultService.deleteAssessmentResultListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得测评结果")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-result:query')")
|
||||
public CommonResult<AssessmentResultRespVO> getAssessmentResult(@RequestParam("id") Long id) {
|
||||
AssessmentResultDO assessmentResult = assessmentResultService.getAssessmentResult(id);
|
||||
return success(BeanUtils.toBean(assessmentResult, AssessmentResultRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得测评结果分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-result:query')")
|
||||
public CommonResult<PageResult<AssessmentResultRespVO>> getAssessmentResultPage(@Valid AssessmentResultPageReqVO pageReqVO) {
|
||||
PageResult<AssessmentResultDO> pageResult = assessmentResultService.getAssessmentResultPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, AssessmentResultRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list-by-answer")
|
||||
@Operation(summary = "根据答卷ID获取所有结果")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-result:query')")
|
||||
public CommonResult<List<AssessmentResultRespVO>> getResultsByAnswerId(@RequestParam("answerId") Long answerId) {
|
||||
List<AssessmentResultDO> results = assessmentResultService.getResultsByAnswerId(answerId);
|
||||
return success(BeanUtils.toBean(results, AssessmentResultRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list-by-assessment-record")
|
||||
@Operation(summary = "根据测评记录ID获取所有结果")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-result:query')")
|
||||
public CommonResult<List<AssessmentResultRespVO>> getResultsByAssessmentRecordId(@RequestParam("assessmentRecordId") Long assessmentRecordId) {
|
||||
List<AssessmentResultDO> results = assessmentResultService.getResultsByAssessmentRecordId(assessmentRecordId);
|
||||
return success(BeanUtils.toBean(results, AssessmentResultRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/need-manual-review")
|
||||
@Operation(summary = "获取需要人工评阅的结果列表")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-result:query')")
|
||||
public CommonResult<List<AssessmentResultRespVO>> getNeedManualReviewList() {
|
||||
List<AssessmentResultDO> results = assessmentResultService.getNeedManualReviewList();
|
||||
return success(BeanUtils.toBean(results, AssessmentResultRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/manual-review")
|
||||
@Operation(summary = "人工评阅")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-result:update')")
|
||||
public CommonResult<Boolean> manualReview(@Valid @RequestBody AssessmentResultManualReviewReqVO reviewReqVO) {
|
||||
assessmentResultService.manualReview(reviewReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/auto-score")
|
||||
@Operation(summary = "自动评分")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-result:update')")
|
||||
public CommonResult<Boolean> autoScore(@RequestParam("answerId") Long answerId) {
|
||||
assessmentResultService.autoScore(answerId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出测评结果 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-result:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportAssessmentResultExcel(@Valid AssessmentResultPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<AssessmentResultDO> list = assessmentResultService.getAssessmentResultPage(pageReqVO).getList();
|
||||
ExcelUtils.write(response, "测评结果.xls", "数据", AssessmentResultRespVO.class,
|
||||
BeanUtils.toBean(list, AssessmentResultRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,95 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.assessment.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.assessment.AssessmentStatisticsDO;
|
||||
import cn.iocoder.yudao.module.prison.service.assessment.AssessmentStatisticsService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
@Tag(name = "管理后台 - 测评统计")
|
||||
@RestController
|
||||
@RequestMapping("/prison/assessment-statistics")
|
||||
@Validated
|
||||
public class AssessmentStatisticsController {
|
||||
|
||||
@Resource
|
||||
private AssessmentStatisticsService assessmentStatisticsService;
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得测评统计")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-statistics:query')")
|
||||
public CommonResult<AssessmentStatisticsRespVO> getAssessmentStatistics(@RequestParam("id") Long id) {
|
||||
AssessmentStatisticsDO statistics = assessmentStatisticsService.getAssessmentStatistics(id);
|
||||
return success(BeanUtils.toBean(statistics, AssessmentStatisticsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得测评统计分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-statistics:query')")
|
||||
public CommonResult<PageResult<AssessmentStatisticsRespVO>> getAssessmentStatisticsPage(@Valid AssessmentStatisticsPageReqVO pageReqVO) {
|
||||
PageResult<AssessmentStatisticsDO> pageResult = assessmentStatisticsService.getAssessmentStatisticsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, AssessmentStatisticsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/generate")
|
||||
@Operation(summary = "生成测评统计")
|
||||
@Parameter(name = "assessmentRecordId", description = "测评记录ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-statistics:create')")
|
||||
public CommonResult<AssessmentStatisticsRespVO> generateStatistics(@RequestParam("assessmentRecordId") Long assessmentRecordId) {
|
||||
AssessmentStatisticsDO statistics = assessmentStatisticsService.generateStatistics(assessmentRecordId);
|
||||
return success(BeanUtils.toBean(statistics, AssessmentStatisticsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/completion-rate")
|
||||
@Operation(summary = "获取测评完成率")
|
||||
@Parameter(name = "assessmentRecordId", description = "测评记录ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-statistics:query')")
|
||||
public CommonResult<BigDecimal> getCompletionRate(@RequestParam("assessmentRecordId") Long assessmentRecordId) {
|
||||
return success(assessmentStatisticsService.getCompletionRate(assessmentRecordId));
|
||||
}
|
||||
|
||||
@GetMapping("/score-distribution")
|
||||
@Operation(summary = "获取分数分布")
|
||||
@Parameter(name = "assessmentRecordId", description = "测评记录ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-statistics:query')")
|
||||
public CommonResult<Map<String, Integer>> getScoreDistribution(@RequestParam("assessmentRecordId") Long assessmentRecordId) {
|
||||
return success(assessmentStatisticsService.getScoreDistribution(assessmentRecordId));
|
||||
}
|
||||
|
||||
@GetMapping("/risk-distribution")
|
||||
@Operation(summary = "获取风险分布")
|
||||
@Parameter(name = "assessmentRecordId", description = "测评记录ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-statistics:query')")
|
||||
public CommonResult<Map<String, Integer>> getRiskDistribution(@RequestParam("assessmentRecordId") Long assessmentRecordId) {
|
||||
return success(assessmentStatisticsService.getRiskDistribution(assessmentRecordId));
|
||||
}
|
||||
|
||||
@GetMapping("/report")
|
||||
@Operation(summary = "获取测评分析报告")
|
||||
@Parameter(name = "assessmentRecordId", description = "测评记录ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:assessment-statistics:query')")
|
||||
public CommonResult<AssessmentReportRespVO> getAssessmentReport(@RequestParam("assessmentRecordId") Long assessmentRecordId) {
|
||||
return success(assessmentStatisticsService.getAssessmentReport(assessmentRecordId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,47 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 答卷详情分页查询 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AssessmentAnswerPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "关联测评记录ID")
|
||||
private Long assessmentRecordId;
|
||||
|
||||
@Schema(description = "囚犯ID")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "囚犯编号")
|
||||
private String prisonerCode;
|
||||
|
||||
@Schema(description = "囚犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "监区ID")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "监室ID")
|
||||
private Long cellId;
|
||||
|
||||
@Schema(description = "答卷状态:1-待答题 2-答题中 3-已提交 4-已评分 5-已完成")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "开始答题时间")
|
||||
private LocalDateTime[] startTime;
|
||||
|
||||
@Schema(description = "提交时间")
|
||||
private LocalDateTime[] submitTime;
|
||||
|
||||
}
|
||||
@ -1,91 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 答卷详情 Response VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AssessmentAnswerRespVO {
|
||||
|
||||
@Schema(description = "答卷ID", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联测评记录ID")
|
||||
private Long assessmentRecordId;
|
||||
|
||||
@Schema(description = "测评名称")
|
||||
private String assessmentName;
|
||||
|
||||
@Schema(description = "囚犯ID")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "囚犯编号")
|
||||
private String prisonerCode;
|
||||
|
||||
@Schema(description = "囚犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "监区ID")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "监区名称")
|
||||
private String areaName;
|
||||
|
||||
@Schema(description = "监室ID")
|
||||
private Long cellId;
|
||||
|
||||
@Schema(description = "监室名称")
|
||||
private String cellName;
|
||||
|
||||
@Schema(description = "答卷状态:1-待答题 2-答题中 3-已提交 4-已评分 5-已完成")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "开始答题时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "提交时间")
|
||||
private LocalDateTime submitTime;
|
||||
|
||||
@Schema(description = "答题用时(秒)")
|
||||
private Integer duration;
|
||||
|
||||
@Schema(description = "客观题得分")
|
||||
private BigDecimal objectiveScore;
|
||||
|
||||
@Schema(description = "主观题得分")
|
||||
private BigDecimal subjectiveScore;
|
||||
|
||||
@Schema(description = "总分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "是否及格")
|
||||
private Boolean passed;
|
||||
|
||||
@Schema(description = "评语")
|
||||
private String comment;
|
||||
|
||||
@Schema(description = "评卷人ID")
|
||||
private Long scorerId;
|
||||
|
||||
@Schema(description = "评卷人名称")
|
||||
private String scorerName;
|
||||
|
||||
@Schema(description = "评分时间")
|
||||
private LocalDateTime scoreTime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 答卷详情创建/更新 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AssessmentAnswerSaveReqVO {
|
||||
|
||||
@Schema(description = "答卷ID", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联测评记录ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "测评记录不能为空")
|
||||
private Long assessmentRecordId;
|
||||
|
||||
@Schema(description = "囚犯ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "囚犯不能为空")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "囚犯编号")
|
||||
private String prisonerCode;
|
||||
|
||||
@Schema(description = "囚犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "监区ID")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "监区名称")
|
||||
private String areaName;
|
||||
|
||||
@Schema(description = "监室ID")
|
||||
private Long cellId;
|
||||
|
||||
@Schema(description = "监室名称")
|
||||
private String cellName;
|
||||
|
||||
@Schema(description = "答卷状态:1-待答题 2-答题中 3-已提交 4-已评分 5-已完成")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "开始答题时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "提交时间")
|
||||
private LocalDateTime submitTime;
|
||||
|
||||
@Schema(description = "答题用时(秒)")
|
||||
private Integer duration;
|
||||
|
||||
@Schema(description = "客观题得分")
|
||||
private BigDecimal objectiveScore;
|
||||
|
||||
@Schema(description = "主观题得分")
|
||||
private BigDecimal subjectiveScore;
|
||||
|
||||
@Schema(description = "总分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "是否及格")
|
||||
private Boolean passed;
|
||||
|
||||
@Schema(description = "评语")
|
||||
private String comment;
|
||||
|
||||
@Schema(description = "及格分数")
|
||||
private BigDecimal passScore;
|
||||
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 答卷提交 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class AssessmentAnswerSubmitReqVO {
|
||||
|
||||
@Schema(description = "答卷ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "答卷ID不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "答题详情JSON")
|
||||
private String answers;
|
||||
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 测评记录分页查询 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AssessmentRecordPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "测评名称", example = "心理测评")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "关联问卷模板ID")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "测评类型:1-心理测评 2-行为评估 3-满意度调查")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "发起测评的监狱/监区ID")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "测评状态:1-未开始 2-进行中 3-已完成 4-已取消")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "计划开始时间")
|
||||
private LocalDateTime[] planStartTime;
|
||||
|
||||
@Schema(description = "计划结束时间")
|
||||
private LocalDateTime[] planEndTime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -1,81 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 测评记录 Response VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AssessmentRecordRespVO {
|
||||
|
||||
@Schema(description = "测评记录ID", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "测评名称", example = "心理测评")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "关联问卷模板ID")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "问卷模板名称")
|
||||
private String questionnaireName;
|
||||
|
||||
@Schema(description = "测评类型:1-心理测评 2-行为评估 3-满意度调查")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "发起测评的监狱/监区ID")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "发起测评的监狱/监区名称")
|
||||
private String areaName;
|
||||
|
||||
@Schema(description = "发起人ID")
|
||||
private Long initiatorId;
|
||||
|
||||
@Schema(description = "发起人名称")
|
||||
private String initiatorName;
|
||||
|
||||
@Schema(description = "测评状态:1-未开始 2-进行中 3-已完成 4-已取消")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "计划开始时间")
|
||||
private LocalDateTime planStartTime;
|
||||
|
||||
@Schema(description = "计划结束时间")
|
||||
private LocalDateTime planEndTime;
|
||||
|
||||
@Schema(description = "实际开始时间")
|
||||
private LocalDateTime actualStartTime;
|
||||
|
||||
@Schema(description = "实际结束时间")
|
||||
private LocalDateTime actualEndTime;
|
||||
|
||||
@Schema(description = "参与人数")
|
||||
private Integer participantCount;
|
||||
|
||||
@Schema(description = "完成人数")
|
||||
private Integer completedCount;
|
||||
|
||||
@Schema(description = "测评说明")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "是否启用自动评分")
|
||||
private Boolean enableAutoScore;
|
||||
|
||||
@Schema(description = "及格分数")
|
||||
private BigDecimal passScore;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@ -1,65 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 测评记录创建/更新 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AssessmentRecordSaveReqVO {
|
||||
|
||||
@Schema(description = "测评记录ID", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "测评名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "心理测评")
|
||||
@NotNull(message = "测评名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "关联问卷模板ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "问卷模板不能为空")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "测评类型:1-心理测评 2-行为评估 3-满意度调查", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "测评类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "发起测评的监狱/监区ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "监区不能为空")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "发起测评的监狱/监区名称")
|
||||
private String areaName;
|
||||
|
||||
@Schema(description = "发起人ID")
|
||||
private Long initiatorId;
|
||||
|
||||
@Schema(description = "发起人名称")
|
||||
private String initiatorName;
|
||||
|
||||
@Schema(description = "测评状态:1-未开始 2-进行中 3-已完成 4-已取消")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "计划开始时间")
|
||||
private LocalDateTime planStartTime;
|
||||
|
||||
@Schema(description = "计划结束时间")
|
||||
private LocalDateTime planEndTime;
|
||||
|
||||
@Schema(description = "测评说明")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "是否启用自动评分")
|
||||
private Boolean enableAutoScore;
|
||||
|
||||
@Schema(description = "及格分数")
|
||||
private BigDecimal passScore;
|
||||
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 测评分析报告 Response VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class AssessmentReportRespVO {
|
||||
|
||||
@Schema(description = "关联测评记录ID")
|
||||
private Long assessmentRecordId;
|
||||
|
||||
@Schema(description = "测评名称")
|
||||
private String assessmentName;
|
||||
|
||||
@Schema(description = "总参与人数")
|
||||
private Integer totalCount;
|
||||
|
||||
@Schema(description = "已完成人数")
|
||||
private Integer completedCount;
|
||||
|
||||
@Schema(description = "完成率(%)")
|
||||
private BigDecimal completionRate;
|
||||
|
||||
@Schema(description = "平均分")
|
||||
private BigDecimal averageScore;
|
||||
|
||||
@Schema(description = "最高分")
|
||||
private BigDecimal highestScore;
|
||||
|
||||
@Schema(description = "最低分")
|
||||
private BigDecimal lowestScore;
|
||||
|
||||
@Schema(description = "及格人数")
|
||||
private Integer passedCount;
|
||||
|
||||
@Schema(description = "及格率(%)")
|
||||
private BigDecimal passRate;
|
||||
|
||||
@Schema(description = "优秀人数(90分以上)")
|
||||
private Integer excellentCount;
|
||||
|
||||
@Schema(description = "优秀率(%)")
|
||||
private BigDecimal excellentRate;
|
||||
|
||||
@Schema(description = "风险人数(60分以下)")
|
||||
private Integer riskCount;
|
||||
|
||||
@Schema(description = "风险率(%)")
|
||||
private BigDecimal riskRate;
|
||||
|
||||
@Schema(description = "分数分布")
|
||||
private Map<String, Integer> scoreDistribution;
|
||||
|
||||
@Schema(description = "风险分布")
|
||||
private Map<String, Integer> riskDistribution;
|
||||
|
||||
@Schema(description = "分析建议")
|
||||
private String analysisSuggestion;
|
||||
|
||||
@Schema(description = "生成时间")
|
||||
private LocalDateTime generatedTime;
|
||||
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 人工评阅 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class AssessmentResultManualReviewReqVO {
|
||||
|
||||
@Schema(description = "结果ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "结果ID不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "人工评分", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "评分不能为空")
|
||||
private BigDecimal manualScore;
|
||||
|
||||
@Schema(description = "人工评语")
|
||||
private String manualComment;
|
||||
|
||||
@Schema(description = "评阅人ID")
|
||||
private Long reviewerId;
|
||||
|
||||
@Schema(description = "评阅人名称")
|
||||
private String reviewerName;
|
||||
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 测评结果分页查询 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AssessmentResultPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "关联答卷ID")
|
||||
private Long answerId;
|
||||
|
||||
@Schema(description = "关联测评记录ID")
|
||||
private Long assessmentRecordId;
|
||||
|
||||
@Schema(description = "囚犯ID")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "关联题目ID")
|
||||
private Long questionId;
|
||||
|
||||
@Schema(description = "题目类型:1-单选 2-多选 3-判断 4-填空 5-问答")
|
||||
private Integer questionType;
|
||||
|
||||
@Schema(description = "是否正确")
|
||||
private Boolean correct;
|
||||
|
||||
@Schema(description = "是否需要人工评阅")
|
||||
private Boolean needManualReview;
|
||||
|
||||
@Schema(description = "人工评阅状态:1-待评阅 2-已评阅")
|
||||
private Integer manualReviewStatus;
|
||||
|
||||
}
|
||||
@ -1,90 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 测评结果 Response VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AssessmentResultRespVO {
|
||||
|
||||
@Schema(description = "结果ID", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联答卷ID")
|
||||
private Long answerId;
|
||||
|
||||
@Schema(description = "关联测评记录ID")
|
||||
private Long assessmentRecordId;
|
||||
|
||||
@Schema(description = "囚犯ID")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "囚犯编号")
|
||||
private String prisonerCode;
|
||||
|
||||
@Schema(description = "囚犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "关联题目ID")
|
||||
private Long questionId;
|
||||
|
||||
@Schema(description = "题目编号")
|
||||
private String questionCode;
|
||||
|
||||
@Schema(description = "题目内容")
|
||||
private String questionContent;
|
||||
|
||||
@Schema(description = "题目类型:1-单选 2-多选 3-判断 4-填空 5-问答")
|
||||
private Integer questionType;
|
||||
|
||||
@Schema(description = "题目分值")
|
||||
private BigDecimal questionScore;
|
||||
|
||||
@Schema(description = "囚犯答案")
|
||||
private String answer;
|
||||
|
||||
@Schema(description = "正确答案(客观题)")
|
||||
private String correctAnswer;
|
||||
|
||||
@Schema(description = "是否正确")
|
||||
private Boolean correct;
|
||||
|
||||
@Schema(description = "得分")
|
||||
private BigDecimal score;
|
||||
|
||||
@Schema(description = "是否需要人工评阅")
|
||||
private Boolean needManualReview;
|
||||
|
||||
@Schema(description = "人工评阅状态:1-待评阅 2-已评阅")
|
||||
private Integer manualReviewStatus;
|
||||
|
||||
@Schema(description = "人工评分")
|
||||
private BigDecimal manualScore;
|
||||
|
||||
@Schema(description = "人工评语")
|
||||
private String manualComment;
|
||||
|
||||
@Schema(description = "评阅人ID")
|
||||
private Long reviewerId;
|
||||
|
||||
@Schema(description = "评阅人名称")
|
||||
private String reviewerName;
|
||||
|
||||
@Schema(description = "评阅时间")
|
||||
private LocalDateTime reviewTime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@ -1,80 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 测评结果创建/更新 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AssessmentResultSaveReqVO {
|
||||
|
||||
@Schema(description = "结果ID", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联答卷ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "答卷ID不能为空")
|
||||
private Long answerId;
|
||||
|
||||
@Schema(description = "关联测评记录ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "测评记录ID不能为空")
|
||||
private Long assessmentRecordId;
|
||||
|
||||
@Schema(description = "囚犯ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "囚犯ID不能为空")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "囚犯编号")
|
||||
private String prisonerCode;
|
||||
|
||||
@Schema(description = "囚犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "关联题目ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "题目ID不能为空")
|
||||
private Long questionId;
|
||||
|
||||
@Schema(description = "题目编号")
|
||||
private String questionCode;
|
||||
|
||||
@Schema(description = "题目内容")
|
||||
private String questionContent;
|
||||
|
||||
@Schema(description = "题目类型:1-单选 2-多选 3-判断 4-填空 5-问答")
|
||||
private Integer questionType;
|
||||
|
||||
@Schema(description = "题目分值")
|
||||
private BigDecimal questionScore;
|
||||
|
||||
@Schema(description = "囚犯答案")
|
||||
private String answer;
|
||||
|
||||
@Schema(description = "正确答案(客观题)")
|
||||
private String correctAnswer;
|
||||
|
||||
@Schema(description = "是否正确")
|
||||
private Boolean correct;
|
||||
|
||||
@Schema(description = "得分")
|
||||
private BigDecimal score;
|
||||
|
||||
@Schema(description = "是否需要人工评阅")
|
||||
private Boolean needManualReview;
|
||||
|
||||
@Schema(description = "人工评阅状态:1-待评阅 2-已评阅")
|
||||
private Integer manualReviewStatus;
|
||||
|
||||
@Schema(description = "人工评分")
|
||||
private BigDecimal manualScore;
|
||||
|
||||
@Schema(description = "人工评语")
|
||||
private String manualComment;
|
||||
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 测评统计分页查询 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AssessmentStatisticsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "关联测评记录ID")
|
||||
private Long assessmentRecordId;
|
||||
|
||||
@Schema(description = "测评名称")
|
||||
private String assessmentName;
|
||||
|
||||
}
|
||||
@ -1,76 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 测评统计 Response VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class AssessmentStatisticsRespVO {
|
||||
|
||||
@Schema(description = "统计ID", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联测评记录ID")
|
||||
private Long assessmentRecordId;
|
||||
|
||||
@Schema(description = "测评名称")
|
||||
private String assessmentName;
|
||||
|
||||
@Schema(description = "总参与人数")
|
||||
private Integer totalCount;
|
||||
|
||||
@Schema(description = "已完成人数")
|
||||
private Integer completedCount;
|
||||
|
||||
@Schema(description = "完成率")
|
||||
private BigDecimal completionRate;
|
||||
|
||||
@Schema(description = "平均分")
|
||||
private BigDecimal averageScore;
|
||||
|
||||
@Schema(description = "最高分")
|
||||
private BigDecimal highestScore;
|
||||
|
||||
@Schema(description = "最低分")
|
||||
private BigDecimal lowestScore;
|
||||
|
||||
@Schema(description = "及格人数")
|
||||
private Integer passedCount;
|
||||
|
||||
@Schema(description = "及格率")
|
||||
private BigDecimal passRate;
|
||||
|
||||
@Schema(description = "优秀人数(90分以上)")
|
||||
private Integer excellentCount;
|
||||
|
||||
@Schema(description = "优秀率")
|
||||
private BigDecimal excellentRate;
|
||||
|
||||
@Schema(description = "风险人数(60分以下)")
|
||||
private Integer riskCount;
|
||||
|
||||
@Schema(description = "风险率")
|
||||
private BigDecimal riskRate;
|
||||
|
||||
@Schema(description = "风险分布")
|
||||
private Map<String, Integer> riskDistribution;
|
||||
|
||||
@Schema(description = "分数分布")
|
||||
private Map<String, Integer> scoreDistribution;
|
||||
|
||||
@Schema(description = "统计时间")
|
||||
private LocalDateTime statisticsTime;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -87,6 +87,8 @@ public class PrisonCellController {
|
||||
return success(null);
|
||||
}
|
||||
CellRespVO respVO = BeanUtils.toBean(cell, CellRespVO.class);
|
||||
// 显式设置创建时间(因为继承字段可能未正确复制)
|
||||
respVO.setCreateTime(cell.getCreateTime());
|
||||
// 填充监区名称
|
||||
if (cell.getAreaId() != null) {
|
||||
AreaDO area = areaMapper.selectById(cell.getAreaId());
|
||||
@ -104,6 +106,18 @@ public class PrisonCellController {
|
||||
return success(cellService.getCellPage(pageReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得监室列表")
|
||||
public CommonResult<List<CellRespVO>> getCellList(
|
||||
@RequestParam(value = "areaId", required = false) Long areaId,
|
||||
@RequestParam(value = "status", required = false) Integer status) {
|
||||
CellPageReqVO pageReqVO = new CellPageReqVO();
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
pageReqVO.setAreaId(areaId);
|
||||
pageReqVO.setStatus(status);
|
||||
return success(cellService.getCellPage(pageReqVO).getList());
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出监室信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:cell:export')")
|
||||
|
||||
@ -5,6 +5,7 @@ import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 监室信息 Response VO")
|
||||
@ -54,6 +55,7 @@ public class CellRespVO {
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -17,7 +17,6 @@ import java.io.IOException;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
@ -26,10 +25,11 @@ import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.consumption.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.consumption.ConsumptionDO;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.consumption.ConsumptionDetailDO;
|
||||
import cn.iocoder.yudao.module.prison.service.consumption.ConsumptionService;
|
||||
import cn.iocoder.yudao.module.prison.convert.consumption.ConsumptionDetailConvert;
|
||||
|
||||
@Tag(name = "管理后台 - 消费记录")
|
||||
@Tag(name = "管理后台 - 消费订单")
|
||||
@RestController
|
||||
@RequestMapping("/prison/consumption")
|
||||
@Validated
|
||||
@ -39,14 +39,14 @@ public class PrisonConsumptionController {
|
||||
private ConsumptionService consumptionService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建消费记录")
|
||||
@Operation(summary = "创建消费订单")
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:create')")
|
||||
public CommonResult<Long> createConsumption(@Valid @RequestBody ConsumptionSaveReqVO createReqVO) {
|
||||
return success(consumptionService.createConsumption(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新消费记录")
|
||||
@Operation(summary = "更新消费订单")
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:update')")
|
||||
public CommonResult<Boolean> updateConsumption(@Valid @RequestBody ConsumptionSaveReqVO updateReqVO) {
|
||||
consumptionService.updateConsumption(updateReqVO);
|
||||
@ -54,8 +54,8 @@ public class PrisonConsumptionController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除消费记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@Operation(summary = "删除消费订单")
|
||||
@Parameter(name = "id", description = "订单编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:delete')")
|
||||
public CommonResult<Boolean> deleteConsumption(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
consumptionService.deleteConsumption(id);
|
||||
@ -63,42 +63,49 @@ public class PrisonConsumptionController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除消费记录")
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:delete')")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true)
|
||||
@Operation(summary = "批量删除消费订单")
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:delete')")
|
||||
public CommonResult<Boolean> deleteConsumptionList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
consumptionService.deleteConsumptionListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得消费记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@Operation(summary = "获得消费订单详情")
|
||||
@Parameter(name = "id", description = "订单编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:query')")
|
||||
public CommonResult<ConsumptionRespVO> getConsumption(@RequestParam("id") Long id) {
|
||||
ConsumptionDO consumption = consumptionService.getConsumption(id);
|
||||
return success(BeanUtils.toBean(consumption, ConsumptionRespVO.class));
|
||||
return success(consumptionService.getConsumption(id));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得消费记录分页")
|
||||
@Operation(summary = "获得消费订单分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:query')")
|
||||
public CommonResult<PageResult<ConsumptionRespVO>> getConsumptionPage(@Valid ConsumptionPageReqVO pageReqVO) {
|
||||
PageResult<ConsumptionDO> pageResult = consumptionService.getConsumptionPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ConsumptionRespVO.class));
|
||||
return success(consumptionService.getConsumptionPage(pageReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/detail-list")
|
||||
@Operation(summary = "获得消费订单明细列表")
|
||||
@Parameter(name = "consumptionId", description = "消费订单ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:query')")
|
||||
public CommonResult<List<ConsumptionDetailRespVO>> getConsumptionDetailList(
|
||||
@RequestParam("consumptionId") Long consumptionId) {
|
||||
List<ConsumptionDetailDO> detailList = consumptionService.getConsumptionDetailList(consumptionId);
|
||||
return success(ConsumptionDetailConvert.INSTANCE.convertListResp(detailList));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出消费记录 Excel")
|
||||
@Operation(summary = "导出消费订单 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:consumption:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportConsumptionExcel(@Valid ConsumptionPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ConsumptionDO> list = consumptionService.getConsumptionPage(pageReqVO).getList();
|
||||
List<ConsumptionRespVO> list = consumptionService.getConsumptionPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "消费记录.xls", "数据", ConsumptionRespVO.class,
|
||||
BeanUtils.toBean(list, ConsumptionRespVO.class));
|
||||
ExcelUtils.write(response, "消费订单.xls", "数据", ConsumptionRespVO.class, list);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.consumption.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.math.BigDecimal;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 消费订单明细 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ConsumptionDetailRespVO {
|
||||
|
||||
@Schema(description = "明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4042")
|
||||
@ExcelProperty("明细ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "消费订单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@ExcelProperty("消费订单ID")
|
||||
private Long consumptionId;
|
||||
|
||||
@Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "商品编码")
|
||||
@ExcelProperty("商品编码")
|
||||
private String goodsCode;
|
||||
|
||||
@Schema(description = "商品单价", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("商品单价")
|
||||
private BigDecimal goodsPrice;
|
||||
|
||||
@Schema(description = "商品数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("商品数量")
|
||||
private Integer goodsCount;
|
||||
|
||||
@Schema(description = "小计金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("小计金额")
|
||||
private BigDecimal subtotal;
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.consumption.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 消费订单明细新增/修改 Request VO")
|
||||
@Data
|
||||
public class ConsumptionDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "明细ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4042")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "商品名称不能为空")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "商品编码")
|
||||
private String goodsCode;
|
||||
|
||||
@Schema(description = "商品单价", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "商品单价不能为空")
|
||||
private BigDecimal goodsPrice;
|
||||
|
||||
@Schema(description = "商品数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "商品数量不能为空")
|
||||
private Integer goodsCount;
|
||||
|
||||
}
|
||||
@ -7,35 +7,48 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import jakarta.validation.constraints.Max;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 消费记录分页 Request VO")
|
||||
@Schema(description = "管理后台 - 消费订单分页 Request VO")
|
||||
@Data
|
||||
public class ConsumptionPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "罪犯ID", example = "25932")
|
||||
@Min(value = 1, message = "罪犯ID必须为正数")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号")
|
||||
@Size(max = 50, message = "罪犯编号长度不能超过50个字符")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "类型:1-存款 2-消费 3-转账", example = "1")
|
||||
@Schema(description = "罪犯姓名", example = "张三")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "监区ID", example = "1")
|
||||
private Long prisonAreaId;
|
||||
|
||||
@Schema(description = "监室ID", example = "1")
|
||||
private Long prisonCellId;
|
||||
|
||||
@Schema(description = "类型:1-购物 2-餐饮 3-医疗 4-通讯 5-其他", example = "1")
|
||||
@Min(value = 1, message = "类型最小值为1")
|
||||
@Max(value = 5, message = "类型最大值为5")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "金额")
|
||||
private BigDecimal amount;
|
||||
@Schema(description = "订单总金额")
|
||||
@Min(value = 0, message = "订单总金额不能为负数")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Schema(description = "账户余额")
|
||||
@Min(value = 0, message = "账户余额不能为负数")
|
||||
private BigDecimal balance;
|
||||
|
||||
@Schema(description = "商品名称", example = "芋艿")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "商品数量", example = "3906")
|
||||
private Integer goodsCount;
|
||||
|
||||
@Schema(description = "订单号")
|
||||
@Size(max = 64, message = "订单号长度不能超过64个字符")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "交易时间")
|
||||
@ -43,13 +56,16 @@ public class ConsumptionPageReqVO extends PageParam {
|
||||
private LocalDateTime[] tradeTime;
|
||||
|
||||
@Schema(description = "状态:1-成功 2-失败", example = "1")
|
||||
@Min(value = 1, message = "状态最小值为1")
|
||||
@Max(value = 2, message = "状态最大值为2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@Schema(description = "备注")
|
||||
@Size(max = 500, message = "备注长度不能超过500个字符")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
@ -6,15 +6,16 @@ import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 消费记录 Response VO")
|
||||
@Schema(description = "管理后台 - 消费订单 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ConsumptionRespVO {
|
||||
|
||||
@Schema(description = "记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4042")
|
||||
@ExcelProperty("记录ID")
|
||||
@Schema(description = "消费ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4042")
|
||||
@ExcelProperty("消费ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25932")
|
||||
@ -25,44 +26,64 @@ public class ConsumptionRespVO {
|
||||
@ExcelProperty("罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "类型:1-存款 2-消费 3-转账", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("类型:1-存款 2-消费 3-转账")
|
||||
private Integer type;
|
||||
@Schema(description = "罪犯姓名", example = "张三")
|
||||
@ExcelProperty("罪犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("金额")
|
||||
private BigDecimal amount;
|
||||
@Schema(description = "监区ID", example = "1")
|
||||
private Long prisonAreaId;
|
||||
|
||||
@Schema(description = "账户余额")
|
||||
@ExcelProperty("账户余额")
|
||||
private BigDecimal balance;
|
||||
@Schema(description = "监区名称", example = "一监区")
|
||||
@ExcelProperty("监区")
|
||||
private String prisonAreaName;
|
||||
|
||||
@Schema(description = "商品名称", example = "芋艿")
|
||||
@ExcelProperty("商品名称")
|
||||
private String goodsName;
|
||||
@Schema(description = "监室ID", example = "1")
|
||||
private Long prisonCellId;
|
||||
|
||||
@Schema(description = "商品数量", example = "3906")
|
||||
@ExcelProperty("商品数量")
|
||||
private Integer goodsCount;
|
||||
@Schema(description = "监室名称", example = "101监室")
|
||||
@ExcelProperty("监室")
|
||||
private String prisonCellName;
|
||||
|
||||
@Schema(description = "订单号")
|
||||
@ExcelProperty("订单号")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "类型:1-购物 2-餐饮 3-医疗 4-通讯 5-其他", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "订单总金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("订单总金额")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Schema(description = "账户余额(消费后)")
|
||||
@ExcelProperty("账户余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
@Schema(description = "交易时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("交易时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private LocalDateTime tradeTime;
|
||||
|
||||
@Schema(description = "状态:1-成功 2-失败", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("状态:1-成功 2-失败")
|
||||
@ExcelProperty("状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@Schema(description = "备注", example = "订单备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "消费明细列表")
|
||||
private List<ConsumptionDetailRespVO> details;
|
||||
|
||||
}
|
||||
|
||||
@ -8,11 +8,11 @@ import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 消费记录新增/修改 Request VO")
|
||||
@Schema(description = "管理后台 - 消费订单新增/修改 Request VO")
|
||||
@Data
|
||||
public class ConsumptionSaveReqVO {
|
||||
|
||||
@Schema(description = "记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4042")
|
||||
@Schema(description = "消费ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4042")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25932")
|
||||
@ -23,35 +23,32 @@ public class ConsumptionSaveReqVO {
|
||||
@NotEmpty(message = "罪犯编号不能为空")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "类型:1-存款 2-消费 3-转账", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "类型:1-存款 2-消费 3-转账不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "金额不能为空")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "账户余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
@Schema(description = "商品名称", example = "芋艿")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "商品数量", example = "3906")
|
||||
private Integer goodsCount;
|
||||
|
||||
@Schema(description = "订单号")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "类型:1-购物 2-餐饮 3-医疗 4-通讯 5-其他", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "订单总金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "订单总金额不能为空")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Schema(description = "账户余额(消费后)")
|
||||
private BigDecimal balance;
|
||||
|
||||
@Schema(description = "交易时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "交易时间不能为空")
|
||||
private LocalDateTime tradeTime;
|
||||
|
||||
@Schema(description = "状态:1-成功 2-失败", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "状态:1-成功 2-失败不能为空")
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@Schema(description = "备注", example = "订单备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@Schema(description = "消费明细列表")
|
||||
private List<ConsumptionDetailSaveReqVO> details;
|
||||
|
||||
}
|
||||
|
||||
@ -16,8 +16,8 @@ public class ProvinceChartVO {
|
||||
@Schema(description = "省份名称", example = "河南省")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "省份编码", example = "41")
|
||||
private Integer provinceCode;
|
||||
@Schema(description = "省份名称/编码", example = "河南省或上海")
|
||||
private String provinceCode;
|
||||
|
||||
@Schema(description = "人数", example = "156")
|
||||
private Integer count;
|
||||
|
||||
@ -0,0 +1,387 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.evaluationreport.*;
|
||||
import cn.iocoder.yudao.module.prison.service.evaluationreport.EvaluationReportService;
|
||||
|
||||
@Tag(name = "管理后台 - 评估报告")
|
||||
@RestController
|
||||
@RequestMapping("/prison/evaluation-report")
|
||||
@Validated
|
||||
public class EvaluationReportController {
|
||||
|
||||
@Resource
|
||||
private EvaluationReportService evaluationReportService;
|
||||
|
||||
// ========== 模板管理 ==========
|
||||
|
||||
@PostMapping("/template/create")
|
||||
@Operation(summary = "创建评估模板")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:template:create')")
|
||||
public CommonResult<Long> createTemplate(@Valid @RequestBody EvaluationTemplateSaveReqVO createReqVO) {
|
||||
return success(evaluationReportService.createTemplate(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/template/update")
|
||||
@Operation(summary = "更新评估模板")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:template:update')")
|
||||
public CommonResult<Boolean> updateTemplate(@Valid @RequestBody EvaluationTemplateSaveReqVO updateReqVO) {
|
||||
evaluationReportService.updateTemplate(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/template/delete")
|
||||
@Operation(summary = "删除评估模板")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:template:delete')")
|
||||
public CommonResult<Boolean> deleteTemplate(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
evaluationReportService.deleteTemplate(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/template/delete-list")
|
||||
@Operation(summary = "批量删除评估模板")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:template:delete')")
|
||||
public CommonResult<Boolean> deleteTemplateList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
evaluationReportService.deleteTemplateListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/template/get")
|
||||
@Operation(summary = "获得评估模板")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:template:query')")
|
||||
public CommonResult<EvaluationTemplateRespVO> getTemplate(@RequestParam("id") Long id) {
|
||||
EvaluationTemplateDO template = evaluationReportService.getTemplate(id);
|
||||
return success(BeanUtils.toBean(template, EvaluationTemplateRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/template/page")
|
||||
@Operation(summary = "获得评估模板分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:template:query')")
|
||||
public CommonResult<PageResult<EvaluationTemplateRespVO>> getTemplatePage(@Valid EvaluationTemplatePageReqVO pageReqVO) {
|
||||
PageResult<EvaluationTemplateDO> pageResult = evaluationReportService.getTemplatePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, EvaluationTemplateRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/template/list-enabled")
|
||||
@Operation(summary = "获取启用的模板列表")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:template:query')")
|
||||
public CommonResult<List<EvaluationTemplateRespVO>> getEnabledTemplateList() {
|
||||
List<EvaluationTemplateDO> list = evaluationReportService.getEnabledTemplateList();
|
||||
return success(BeanUtils.toBean(list, EvaluationTemplateRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/template/export-excel")
|
||||
@Operation(summary = "导出评估模板 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:template:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportTemplateExcel(@Valid EvaluationTemplatePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<EvaluationTemplateDO> list = evaluationReportService.getTemplatePage(pageReqVO).getList();
|
||||
ExcelUtils.write(response, "评估模板.xlsx", "数据", EvaluationTemplateRespVO.class,
|
||||
BeanUtils.toBean(list, EvaluationTemplateRespVO.class));
|
||||
}
|
||||
|
||||
// ========== 维度配置管理 ==========
|
||||
|
||||
@PostMapping("/dimension/create")
|
||||
@Operation(summary = "创建评估维度")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:dimension:create')")
|
||||
public CommonResult<Long> createDimension(@Valid @RequestBody EvaluationDimensionSaveReqVO createReqVO) {
|
||||
return success(evaluationReportService.createDimension(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/dimension/update")
|
||||
@Operation(summary = "更新评估维度")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:dimension:update')")
|
||||
public CommonResult<Boolean> updateDimension(@Valid @RequestBody EvaluationDimensionSaveReqVO updateReqVO) {
|
||||
evaluationReportService.updateDimension(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/dimension/delete")
|
||||
@Operation(summary = "删除评估维度")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:dimension:delete')")
|
||||
public CommonResult<Boolean> deleteDimension(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
evaluationReportService.deleteDimension(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/dimension/delete-list")
|
||||
@Operation(summary = "批量删除评估维度")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:dimension:delete')")
|
||||
public CommonResult<Boolean> deleteDimensionList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
evaluationReportService.deleteDimensionListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/dimension/get")
|
||||
@Operation(summary = "获得评估维度")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:dimension:query')")
|
||||
public CommonResult<EvaluationDimensionRespVO> getDimension(@RequestParam("id") Long id) {
|
||||
EvaluationDimensionDO dimension = evaluationReportService.getDimension(id);
|
||||
return success(BeanUtils.toBean(dimension, EvaluationDimensionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/dimension/page")
|
||||
@Operation(summary = "获得评估维度分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:dimension:query')")
|
||||
public CommonResult<PageResult<EvaluationDimensionRespVO>> getDimensionPage(@Valid EvaluationDimensionPageReqVO pageReqVO) {
|
||||
PageResult<EvaluationDimensionDO> pageResult = evaluationReportService.getDimensionPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, EvaluationDimensionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/dimension/list-by-template")
|
||||
@Operation(summary = "根据模板ID获取维度列表")
|
||||
@Parameter(name = "templateId", description = "模板ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:dimension:query')")
|
||||
public CommonResult<List<EvaluationDimensionRespVO>> getDimensionsByTemplateId(@RequestParam("templateId") Long templateId) {
|
||||
List<EvaluationDimensionDO> list = evaluationReportService.getDimensionsByTemplateId(templateId);
|
||||
return success(BeanUtils.toBean(list, EvaluationDimensionRespVO.class));
|
||||
}
|
||||
|
||||
// ========== 评估报告管理 ==========
|
||||
|
||||
@PostMapping("/report/create")
|
||||
@Operation(summary = "创建评估报告")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:report:create')")
|
||||
public CommonResult<Long> createReport(@Valid @RequestBody EvaluationReportSaveReqVO createReqVO) {
|
||||
return success(evaluationReportService.createReport(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/report/update")
|
||||
@Operation(summary = "更新评估报告")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:report:update')")
|
||||
public CommonResult<Boolean> updateReport(@Valid @RequestBody EvaluationReportSaveReqVO updateReqVO) {
|
||||
evaluationReportService.updateReport(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/report/delete")
|
||||
@Operation(summary = "删除评估报告")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:report:delete')")
|
||||
public CommonResult<Boolean> deleteReport(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
evaluationReportService.deleteReport(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/report/delete-list")
|
||||
@Operation(summary = "批量删除评估报告")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:report:delete')")
|
||||
public CommonResult<Boolean> deleteReportList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
evaluationReportService.deleteReportListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/report/get")
|
||||
@Operation(summary = "获得评估报告")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:report:query')")
|
||||
public CommonResult<EvaluationReportRespVO> getReport(@RequestParam("id") Long id) {
|
||||
EvaluationReportDO report = evaluationReportService.getReport(id);
|
||||
return success(BeanUtils.toBean(report, EvaluationReportRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/report/page")
|
||||
@Operation(summary = "获得评估报告分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:report:query')")
|
||||
public CommonResult<PageResult<EvaluationReportRespVO>> getReportPage(@Valid EvaluationReportPageReqVO pageReqVO) {
|
||||
PageResult<EvaluationReportDO> pageResult = evaluationReportService.getReportPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, EvaluationReportRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/report/get-by-report-no")
|
||||
@Operation(summary = "根据报告编号获取报告")
|
||||
@Parameter(name = "reportNo", description = "报告编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:report:query')")
|
||||
public CommonResult<EvaluationReportRespVO> getReportByReportNo(@RequestParam("reportNo") String reportNo) {
|
||||
EvaluationReportDO report = evaluationReportService.getReportByReportNo(reportNo);
|
||||
return success(BeanUtils.toBean(report, EvaluationReportRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/report/list-by-prisoner")
|
||||
@Operation(summary = "根据罪犯ID获取报告列表")
|
||||
@Parameter(name = "prisonerId", description = "罪犯ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:report:query')")
|
||||
public CommonResult<List<EvaluationReportRespVO>> getReportsByPrisonerId(@RequestParam("prisonerId") Long prisonerId) {
|
||||
List<EvaluationReportDO> list = evaluationReportService.getReportsByPrisonerId(prisonerId);
|
||||
return success(BeanUtils.toBean(list, EvaluationReportRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/report/submit")
|
||||
@Operation(summary = "提交报告审核")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:report:update')")
|
||||
public CommonResult<Boolean> submitReport(@RequestParam("id") Long id) {
|
||||
evaluationReportService.submitReport(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/report/audit")
|
||||
@Operation(summary = "审核报告")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:report:audit')")
|
||||
public CommonResult<Boolean> auditReport(@Valid @RequestBody EvaluationReportAuditReqVO auditReqVO) {
|
||||
evaluationReportService.auditReport(auditReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/report/void")
|
||||
@Operation(summary = "作废报告")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:report:void')")
|
||||
public CommonResult<Boolean> voidReport(@RequestParam("id") Long id) {
|
||||
evaluationReportService.voidReport(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/report/export-excel")
|
||||
@Operation(summary = "导出评估报告 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:report:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportReportExcel(@Valid EvaluationReportPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<EvaluationReportDO> list = evaluationReportService.getReportPage(pageReqVO).getList();
|
||||
ExcelUtils.write(response, "评估报告.xlsx", "数据", EvaluationReportRespVO.class,
|
||||
BeanUtils.toBean(list, EvaluationReportRespVO.class));
|
||||
}
|
||||
|
||||
// ========== 维度数据管理 ==========
|
||||
|
||||
@PostMapping("/dimension-data/create")
|
||||
@Operation(summary = "创建维度数据")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:dimension-data:create')")
|
||||
public CommonResult<Long> createDimensionData(@Valid @RequestBody EvaluationDimensionDataSaveReqVO createReqVO) {
|
||||
return success(evaluationReportService.createDimensionData(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/dimension-data/update")
|
||||
@Operation(summary = "更新维度数据")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:dimension-data:update')")
|
||||
public CommonResult<Boolean> updateDimensionData(@Valid @RequestBody EvaluationDimensionDataSaveReqVO updateReqVO) {
|
||||
evaluationReportService.updateDimensionData(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/dimension-data/delete")
|
||||
@Operation(summary = "删除维度数据")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:dimension-data:delete')")
|
||||
public CommonResult<Boolean> deleteDimensionData(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
evaluationReportService.deleteDimensionData(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/dimension-data/list-by-report")
|
||||
@Operation(summary = "根据报告ID获取维度数据列表")
|
||||
@Parameter(name = "reportId", description = "报告ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:dimension-data:query')")
|
||||
public CommonResult<List<EvaluationDimensionDataRespVO>> getDimensionDataListByReportId(@RequestParam("reportId") Long reportId) {
|
||||
List<EvaluationDimensionDataDO> list = evaluationReportService.getDimensionDataListByReportId(reportId);
|
||||
return success(BeanUtils.toBean(list, EvaluationDimensionDataRespVO.class));
|
||||
}
|
||||
|
||||
// ========== 快捷评语库管理 ==========
|
||||
|
||||
@PostMapping("/comment/create")
|
||||
@Operation(summary = "创建快捷评语")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:comment:create')")
|
||||
public CommonResult<Long> createComment(@Valid @RequestBody ReportCommentSaveReqVO createReqVO) {
|
||||
return success(evaluationReportService.createComment(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/comment/update")
|
||||
@Operation(summary = "更新快捷评语")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:comment:update')")
|
||||
public CommonResult<Boolean> updateComment(@Valid @RequestBody ReportCommentSaveReqVO updateReqVO) {
|
||||
evaluationReportService.updateComment(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/comment/delete")
|
||||
@Operation(summary = "删除快捷评语")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:comment:delete')")
|
||||
public CommonResult<Boolean> deleteComment(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
evaluationReportService.deleteComment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/comment/delete-list")
|
||||
@Operation(summary = "批量删除快捷评语")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:comment:delete')")
|
||||
public CommonResult<Boolean> deleteCommentList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
evaluationReportService.deleteCommentListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/comment/get")
|
||||
@Operation(summary = "获得快捷评语")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:comment:query')")
|
||||
public CommonResult<ReportCommentRespVO> getComment(@RequestParam("id") Long id) {
|
||||
ReportCommentDO comment = evaluationReportService.getComment(id);
|
||||
return success(BeanUtils.toBean(comment, ReportCommentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/comment/page")
|
||||
@Operation(summary = "获得快捷评语分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:comment:query')")
|
||||
public CommonResult<PageResult<ReportCommentRespVO>> getCommentPage(@Valid ReportCommentPageReqVO pageReqVO) {
|
||||
PageResult<ReportCommentDO> pageResult = evaluationReportService.getCommentPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ReportCommentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/comment/list-by-type-level")
|
||||
@Operation(summary = "根据类型和等级获取评语列表")
|
||||
@Parameter(name = "commentType", description = "评语类型", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:comment:query')")
|
||||
public CommonResult<List<ReportCommentRespVO>> getCommentsByTypeAndLevel(
|
||||
@RequestParam("commentType") Integer commentType,
|
||||
@RequestParam(value = "level", required = false) Integer level) {
|
||||
List<ReportCommentDO> list = evaluationReportService.getCommentsByTypeAndLevel(commentType, level);
|
||||
return success(BeanUtils.toBean(list, ReportCommentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/comment/list-by-dimension")
|
||||
@Operation(summary = "根据维度ID获取评语列表")
|
||||
@Parameter(name = "dimensionId", description = "维度ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:evaluation-report:comment:query')")
|
||||
public CommonResult<List<ReportCommentRespVO>> getCommentsByDimensionId(@RequestParam("dimensionId") Long dimensionId) {
|
||||
List<ReportCommentDO> list = evaluationReportService.getCommentsByDimensionId(dimensionId);
|
||||
return success(BeanUtils.toBean(list, ReportCommentRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 报告维度数据分页 Request VO")
|
||||
@Data
|
||||
public class EvaluationDimensionDataPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "报告ID")
|
||||
private Long reportId;
|
||||
|
||||
@Schema(description = "维度ID")
|
||||
private Long dimensionId;
|
||||
|
||||
@Schema(description = "维度类型")
|
||||
private Integer dimensionType;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 报告维度数据 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class EvaluationDimensionDataRespVO {
|
||||
|
||||
@Schema(description = "数据ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19443")
|
||||
@ExcelProperty("数据ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "报告ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("报告ID")
|
||||
private Long reportId;
|
||||
|
||||
@Schema(description = "维度ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("维度ID")
|
||||
private Long dimensionId;
|
||||
|
||||
@Schema(description = "维度名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("维度名称")
|
||||
private String dimensionName;
|
||||
|
||||
@Schema(description = "维度编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("维度编码")
|
||||
private String dimensionCode;
|
||||
|
||||
@Schema(description = "维度类型:1-心理测评 2-行为表现 3-教育改造 4-劳动表现 5-人际交往 6-自评/他评")
|
||||
@ExcelProperty("维度类型")
|
||||
private Integer dimensionType;
|
||||
|
||||
@Schema(description = "得分", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("得分")
|
||||
private BigDecimal score;
|
||||
|
||||
@Schema(description = "满分")
|
||||
@ExcelProperty("满分")
|
||||
private BigDecimal fullScore;
|
||||
|
||||
@Schema(description = "权重得分")
|
||||
@ExcelProperty("权重得分")
|
||||
private BigDecimal weightedScore;
|
||||
|
||||
@Schema(description = "评级:1-优秀 2-良好 3-一般 4-较差")
|
||||
@ExcelProperty("评级")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "维度结论")
|
||||
@ExcelProperty("维度结论")
|
||||
private String conclusion;
|
||||
|
||||
@Schema(description = "维度评语")
|
||||
@ExcelProperty("维度评语")
|
||||
private String comment;
|
||||
|
||||
@Schema(description = "AI分析内容")
|
||||
private String aiAnalysis;
|
||||
|
||||
@Schema(description = "回答详情(JSON格式)")
|
||||
private String answerDetails;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@ExcelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 报告维度数据新增/修改 Request VO")
|
||||
@Data
|
||||
public class EvaluationDimensionDataSaveReqVO {
|
||||
|
||||
@Schema(description = "数据ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "报告ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报告ID不能为空")
|
||||
private Long reportId;
|
||||
|
||||
@Schema(description = "维度ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "维度ID不能为空")
|
||||
private Long dimensionId;
|
||||
|
||||
@Schema(description = "维度名称")
|
||||
private String dimensionName;
|
||||
|
||||
@Schema(description = "维度编码")
|
||||
private String dimensionCode;
|
||||
|
||||
@Schema(description = "维度类型:1-心理测评 2-行为表现 3-教育改造 4-劳动表现 5-人际交往 6-自评/他评")
|
||||
private Integer dimensionType;
|
||||
|
||||
@Schema(description = "得分", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "得分不能为空")
|
||||
private BigDecimal score;
|
||||
|
||||
@Schema(description = "满分")
|
||||
private BigDecimal fullScore;
|
||||
|
||||
@Schema(description = "权重得分")
|
||||
private BigDecimal weightedScore;
|
||||
|
||||
@Schema(description = "评级:1-优秀 2-良好 3-一般 4-较差")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "维度结论")
|
||||
private String conclusion;
|
||||
|
||||
@Schema(description = "维度评语")
|
||||
private String comment;
|
||||
|
||||
@Schema(description = "AI分析内容")
|
||||
private String aiAnalysis;
|
||||
|
||||
@Schema(description = "回答详情(JSON格式)")
|
||||
private String answerDetails;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@Min(value = 0, message = "排序不能为负数")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 评估维度分页 Request VO")
|
||||
@Data
|
||||
public class EvaluationDimensionPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "模板ID")
|
||||
private Long templateId;
|
||||
|
||||
@Schema(description = "维度名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "维度编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "维度类型:1-心理测评 2-行为表现 3-教育改造 4-劳动表现 5-人际交往 6-自评/他评")
|
||||
private Integer dimensionType;
|
||||
|
||||
@Schema(description = "评估方式:1-问卷测评 2-量表评分 3-行为观察 4-AI分析 5-综合评定")
|
||||
private Integer evaluationMethod;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 评估维度 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class EvaluationDimensionRespVO {
|
||||
|
||||
@Schema(description = "维度ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19443")
|
||||
@ExcelProperty("维度ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "模板ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("模板ID")
|
||||
private Long templateId;
|
||||
|
||||
@Schema(description = "维度名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("维度名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "维度编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("维度编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "维度描述")
|
||||
@ExcelProperty("维度描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "维度类型:1-心理测评 2-行为表现 3-教育改造 4-劳动表现 5-人际交往 6-自评/他评", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("维度类型")
|
||||
private Integer dimensionType;
|
||||
|
||||
@Schema(description = "权重(百分比)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("权重")
|
||||
private BigDecimal weight;
|
||||
|
||||
@Schema(description = "评分规则:1-分值越高越好 2-分值越低越好 3-区间评分", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("评分规则")
|
||||
private Integer scoreRule;
|
||||
|
||||
@Schema(description = "最大分值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("最大分值")
|
||||
private BigDecimal maxScore;
|
||||
|
||||
@Schema(description = "最小分值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("最小分值")
|
||||
private BigDecimal minScore;
|
||||
|
||||
@Schema(description = "及格分值")
|
||||
@ExcelProperty("及格分值")
|
||||
private BigDecimal passScore;
|
||||
|
||||
@Schema(description = "评估方式:1-问卷测评 2-量表评分 3-行为观察 4-AI分析 5-综合评定", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("评估方式")
|
||||
private Integer evaluationMethod;
|
||||
|
||||
@Schema(description = "问题列表(JSON格式)")
|
||||
private String questions;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@ExcelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 评估维度新增/修改 Request VO")
|
||||
@Data
|
||||
public class EvaluationDimensionSaveReqVO {
|
||||
|
||||
@Schema(description = "维度ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "模板ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "模板ID不能为空")
|
||||
private Long templateId;
|
||||
|
||||
@Schema(description = "维度名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "维度名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "维度编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "维度编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "维度描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "维度类型:1-心理测评 2-行为表现 3-教育改造 4-劳动表现 5-人际交往 6-自评/他评", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "维度类型不能为空")
|
||||
private Integer dimensionType;
|
||||
|
||||
@Schema(description = "权重(百分比)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "权重不能为空")
|
||||
private BigDecimal weight;
|
||||
|
||||
@Schema(description = "评分规则:1-分值越高越好 2-分值越低越好 3-区间评分", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "评分规则不能为空")
|
||||
private Integer scoreRule;
|
||||
|
||||
@Schema(description = "最大分值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "最大分值不能为空")
|
||||
private BigDecimal maxScore;
|
||||
|
||||
@Schema(description = "最小分值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "最小分值不能为空")
|
||||
private BigDecimal minScore;
|
||||
|
||||
@Schema(description = "及格分值")
|
||||
private BigDecimal passScore;
|
||||
|
||||
@Schema(description = "评估方式:1-问卷测评 2-量表评分 3-行为观察 4-AI分析 5-综合评定", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "评估方式不能为空")
|
||||
private Integer evaluationMethod;
|
||||
|
||||
@Schema(description = "问题列表(JSON格式)")
|
||||
private String questions;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@Min(value = 0, message = "排序不能为负数")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 评估报告审核 Request VO")
|
||||
@Data
|
||||
public class EvaluationReportAuditReqVO {
|
||||
|
||||
@Schema(description = "报告ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报告ID不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "审核状态:3-已审核 4-已作废", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "审核状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "审核意见")
|
||||
private String auditOpinion;
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 评估报告分页 Request VO")
|
||||
@Data
|
||||
public class EvaluationReportPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "罪犯ID")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "罪犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "模板ID")
|
||||
private Long templateId;
|
||||
|
||||
@Schema(description = "评估类型:1-心理评估 2-危险性评估 3-改造表现评估 4-综合评估")
|
||||
private Integer evaluationType;
|
||||
|
||||
@Schema(description = "评估周期:1-月评 2-季评 3-半年评 4-年终评 5-入监评估 6-出监评估")
|
||||
private Integer evaluationCycle;
|
||||
|
||||
@Schema(description = "评级:1-优秀 2-良好 3-一般 4-较差 5-危险")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "风险等级:1-低风险 2-中风险 3-高风险 4-极高风险")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "报告状态:1-草稿 2-待审核 3-已审核 4-已作废")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "监区ID")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "评估日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] evaluationDate;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,134 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 评估报告 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class EvaluationReportRespVO {
|
||||
|
||||
@Schema(description = "报告ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19443")
|
||||
@ExcelProperty("报告ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "报告编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("报告编号")
|
||||
private String reportNo;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("罪犯ID")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号")
|
||||
@ExcelProperty("罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "罪犯姓名")
|
||||
@ExcelProperty("罪犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "模板ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("模板ID")
|
||||
private Long templateId;
|
||||
|
||||
@Schema(description = "模板名称")
|
||||
@ExcelProperty("模板名称")
|
||||
private String templateName;
|
||||
|
||||
@Schema(description = "评估类型:1-心理评估 2-危险性评估 3-改造表现评估 4-综合评估", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("评估类型")
|
||||
private Integer evaluationType;
|
||||
|
||||
@Schema(description = "评估周期:1-月评 2-季评 3-半年评 4-年终评 5-入监评估 6-出监评估", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("评估周期")
|
||||
private Integer evaluationCycle;
|
||||
|
||||
@Schema(description = "评估日期")
|
||||
@ExcelProperty("评估日期")
|
||||
private LocalDateTime evaluationDate;
|
||||
|
||||
@Schema(description = "评估人员ID")
|
||||
private Long evaluatorId;
|
||||
|
||||
@Schema(description = "评估人员姓名")
|
||||
@ExcelProperty("评估人员")
|
||||
private String evaluatorName;
|
||||
|
||||
@Schema(description = "监区ID")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "监区名称")
|
||||
@ExcelProperty("监区名称")
|
||||
private String areaName;
|
||||
|
||||
@Schema(description = "总分")
|
||||
@ExcelProperty("总分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "评级:1-优秀 2-良好 3-一般 4-较差 5-危险", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("评级")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "风险等级:1-低风险 2-中风险 3-高风险 4-极高风险")
|
||||
@ExcelProperty("风险等级")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "风险得分")
|
||||
@ExcelProperty("风险得分")
|
||||
private BigDecimal riskScore;
|
||||
|
||||
@Schema(description = "AI生成状态:1-待生成 2-生成中 3-已完成 4-生成失败")
|
||||
@ExcelProperty("AI生成状态")
|
||||
private Integer aiStatus;
|
||||
|
||||
@Schema(description = "AI生成内容")
|
||||
private String aiContent;
|
||||
|
||||
@Schema(description = "AI生成报告内容")
|
||||
private String aiReportContent;
|
||||
|
||||
@Schema(description = "报告状态:1-草稿 2-待审核 3-已审核 4-已作废", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("报告状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "审核人ID")
|
||||
private Long auditorId;
|
||||
|
||||
@Schema(description = "审核人姓名")
|
||||
@ExcelProperty("审核人")
|
||||
private String auditorName;
|
||||
|
||||
@Schema(description = "审核时间")
|
||||
@ExcelProperty("审核时间")
|
||||
private LocalDateTime auditTime;
|
||||
|
||||
@Schema(description = "审核意见")
|
||||
@ExcelProperty("审核意见")
|
||||
private String auditOpinion;
|
||||
|
||||
@Schema(description = "报告结论")
|
||||
@ExcelProperty("报告结论")
|
||||
private String conclusion;
|
||||
|
||||
@Schema(description = "改造建议")
|
||||
@ExcelProperty("改造建议")
|
||||
private String suggestions;
|
||||
|
||||
@Schema(description = "报告PDF路径")
|
||||
private String pdfPath;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 评估报告新增/修改 Request VO")
|
||||
@Data
|
||||
public class EvaluationReportSaveReqVO {
|
||||
|
||||
@Schema(description = "报告ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "罪犯ID不能为空")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "罪犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "模板ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "模板ID不能为空")
|
||||
private Long templateId;
|
||||
|
||||
@Schema(description = "模板名称")
|
||||
private String templateName;
|
||||
|
||||
@Schema(description = "评估类型:1-心理评估 2-危险性评估 3-改造表现评估 4-综合评估", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "评估类型不能为空")
|
||||
private Integer evaluationType;
|
||||
|
||||
@Schema(description = "评估周期:1-月评 2-季评 3-半年评 4-年终评 5-入监评估 6-出监评估", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "评估周期不能为空")
|
||||
private Integer evaluationCycle;
|
||||
|
||||
@Schema(description = "评估日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "评估日期不能为空")
|
||||
private LocalDateTime evaluationDate;
|
||||
|
||||
@Schema(description = "评估人员ID")
|
||||
private Long evaluatorId;
|
||||
|
||||
@Schema(description = "评估人员姓名")
|
||||
private String evaluatorName;
|
||||
|
||||
@Schema(description = "监区ID")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "监区名称")
|
||||
private String areaName;
|
||||
|
||||
@Schema(description = "总分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "评级:1-优秀 2-良好 3-一般 4-较差 5-危险")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "风险等级:1-低风险 2-中风险 3-高风险 4-极高风险")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "风险得分")
|
||||
private BigDecimal riskScore;
|
||||
|
||||
@Schema(description = "AI生成状态:1-待生成 2-生成中 3-已完成 4-生成失败")
|
||||
private Integer aiStatus;
|
||||
|
||||
@Schema(description = "AI生成内容")
|
||||
private String aiContent;
|
||||
|
||||
@Schema(description = "AI生成报告内容")
|
||||
private String aiReportContent;
|
||||
|
||||
@Schema(description = "报告状态:1-草稿 2-待审核 3-已审核 4-已作废")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "报告结论")
|
||||
private String conclusion;
|
||||
|
||||
@Schema(description = "改造建议")
|
||||
private String suggestions;
|
||||
|
||||
@Schema(description = "报告PDF路径")
|
||||
private String pdfPath;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 评估模板分页 Request VO")
|
||||
@Data
|
||||
public class EvaluationTemplatePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "模板名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "模板编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "模板类型:1-心理评估 2-危险性评估 3-改造表现评估 4-综合评估")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "评估周期:1-月评 2-季评 3-半年评 4-年终评 5-入监评估 6-出监评估")
|
||||
private Integer evaluationCycle;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否允许AI生成:1-是 2-否")
|
||||
private Integer aiEnabled;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 评估模板 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class EvaluationTemplateRespVO {
|
||||
|
||||
@Schema(description = "模板ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19443")
|
||||
@ExcelProperty("模板ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "模板名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("模板名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("模板编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "模板类型:1-心理评估 2-危险性评估 3-改造表现评估 4-综合评估", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("模板类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "描述")
|
||||
@ExcelProperty("描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "适用人群")
|
||||
@ExcelProperty("适用人群")
|
||||
private String applicableCrowd;
|
||||
|
||||
@Schema(description = "评估周期:1-月评 2-季评 3-半年评 4-年终评 5-入监评估 6-出监评估", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("评估周期")
|
||||
private Integer evaluationCycle;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否允许AI生成:1-是 2-否")
|
||||
@ExcelProperty("允许AI生成")
|
||||
private Integer aiEnabled;
|
||||
|
||||
@Schema(description = "AI提示词")
|
||||
private String aiPrompt;
|
||||
|
||||
@Schema(description = "报告封面图")
|
||||
private String coverImage;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@ExcelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 评估模板新增/修改 Request VO")
|
||||
@Data
|
||||
public class EvaluationTemplateSaveReqVO {
|
||||
|
||||
@Schema(description = "模板ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "模板名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "模板名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "模板编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "模板类型:1-心理评估 2-危险性评估 3-改造表现评估 4-综合评估", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "模板类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "适用人群")
|
||||
private String applicableCrowd;
|
||||
|
||||
@Schema(description = "评估周期:1-月评 2-季评 3-半年评 4-年终评 5-入监评估 6-出监评估", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "评估周期不能为空")
|
||||
private Integer evaluationCycle;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否允许AI生成:1-是 2-否")
|
||||
private Integer aiEnabled;
|
||||
|
||||
@Schema(description = "AI提示词")
|
||||
private String aiPrompt;
|
||||
|
||||
@Schema(description = "报告封面图")
|
||||
private String coverImage;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@Min(value = 0, message = "排序不能为负数")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 快捷评语分页 Request VO")
|
||||
@Data
|
||||
public class ReportCommentPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "评语内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "评语类型:1-心理评语 2-行为表现评语 3-教育改造评语 4-劳动表现评语 5-综合评语 6-风险提示 7-建议措施")
|
||||
private Integer commentType;
|
||||
|
||||
@Schema(description = "适用维度")
|
||||
private Long dimensionId;
|
||||
|
||||
@Schema(description = "评级等级:1-优秀 2-良好 3-一般 4-较差 5-危险")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 快捷评语 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ReportCommentRespVO {
|
||||
|
||||
@Schema(description = "评语ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19443")
|
||||
@ExcelProperty("评语ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "评语内容", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("评语内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "评语类型:1-心理评语 2-行为表现评语 3-教育改造评语 4-劳动表现评语 5-综合评语 6-风险提示 7-建议措施", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("评语类型")
|
||||
private Integer commentType;
|
||||
|
||||
@Schema(description = "适用维度(关联维度表)")
|
||||
@ExcelProperty("维度ID")
|
||||
private Long dimensionId;
|
||||
|
||||
@Schema(description = "维度名称")
|
||||
@ExcelProperty("维度名称")
|
||||
private String dimensionName;
|
||||
|
||||
@Schema(description = "评级等级:1-优秀 2-良好 3-一般 4-较差 5-危险")
|
||||
@ExcelProperty("评级")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "标签(逗号分隔)")
|
||||
@ExcelProperty("标签")
|
||||
private String tags;
|
||||
|
||||
@Schema(description = "使用次数")
|
||||
@ExcelProperty("使用次数")
|
||||
private Integer useCount;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@ExcelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.evaluationreport.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 快捷评语新增/修改 Request VO")
|
||||
@Data
|
||||
public class ReportCommentSaveReqVO {
|
||||
|
||||
@Schema(description = "评语ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "评语内容", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "评语内容不能为空")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "评语类型:1-心理评语 2-行为表现评语 3-教育改造评语 4-劳动表现评语 5-综合评语 6-风险提示 7-建议措施", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "评语类型不能为空")
|
||||
private Integer commentType;
|
||||
|
||||
@Schema(description = "适用维度(关联维度表)")
|
||||
private Long dimensionId;
|
||||
|
||||
@Schema(description = "维度名称")
|
||||
private String dimensionName;
|
||||
|
||||
@Schema(description = "评级等级:1-优秀 2-良好 3-一般 4-较差 5-危险")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "标签(逗号分隔)")
|
||||
private String tags;
|
||||
|
||||
@Schema(description = "状态:1-启用 2-禁用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@Min(value = 0, message = "排序不能为负数")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -98,17 +98,17 @@ public class PrisonerController {
|
||||
if (prisoner == null) {
|
||||
return success(null);
|
||||
}
|
||||
PrisonerRespVO vo = convertToRespVO(prisoner);
|
||||
PrisonerRespVO vo = PrisonerConvert.INSTANCE.convert(prisoner);
|
||||
// 设置监区名称
|
||||
if (prisoner.getPrisonAreaId() != null) {
|
||||
cn.iocoder.yudao.module.prison.dal.dataobject.area.AreaDO area = areaMapper.selectById(prisoner.getPrisonAreaId());
|
||||
AreaDO area = areaMapper.selectById(prisoner.getPrisonAreaId());
|
||||
if (area != null) {
|
||||
vo.setPrisonAreaName(area.getName());
|
||||
}
|
||||
}
|
||||
// 设置监室名称
|
||||
if (prisoner.getPrisonCellId() != null) {
|
||||
cn.iocoder.yudao.module.prison.dal.dataobject.cell.CellDO cell = cellMapper.selectById(prisoner.getPrisonCellId());
|
||||
CellDO cell = cellMapper.selectById(prisoner.getPrisonCellId());
|
||||
if (cell != null) {
|
||||
vo.setPrisonCellName(cell.getName());
|
||||
}
|
||||
@ -116,73 +116,6 @@ public class PrisonerController {
|
||||
return success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 PrisonerDO 转换为 PrisonerRespVO
|
||||
*/
|
||||
private PrisonerRespVO convertToRespVO(PrisonerDO prisoner) {
|
||||
PrisonerRespVO vo = new PrisonerRespVO();
|
||||
vo.setId(prisoner.getId());
|
||||
vo.setPrisonerNo(prisoner.getPrisonerNo());
|
||||
vo.setName(prisoner.getName());
|
||||
vo.setBirthday(prisoner.getBirthday());
|
||||
vo.setIdCard(prisoner.getIdCard());
|
||||
vo.setEthnicity(prisoner.getEthnicity());
|
||||
vo.setNativePlace(prisoner.getNativePlace());
|
||||
if (prisoner.getEducation() != null) {
|
||||
vo.setEducation(prisoner.getEducation().getValue());
|
||||
}
|
||||
vo.setOccupation(prisoner.getOccupation());
|
||||
vo.setAddress(prisoner.getAddress());
|
||||
vo.setCrime(prisoner.getCrime());
|
||||
vo.setSentenceYears(prisoner.getSentenceYears());
|
||||
vo.setSentenceMonths(prisoner.getSentenceMonths());
|
||||
vo.setLifeImprisonment(prisoner.getLifeImprisonment());
|
||||
vo.setDeathSentenceReprieve(prisoner.getDeathSentenceReprieve());
|
||||
vo.setCourtName(prisoner.getCourtName());
|
||||
vo.setJudgmentDate(prisoner.getJudgmentDate());
|
||||
vo.setJudgmentNo(prisoner.getJudgmentNo());
|
||||
vo.setOriginalSentence(prisoner.getOriginalSentence());
|
||||
vo.setImprisonmentDate(prisoner.getImprisonmentDate());
|
||||
vo.setReleaseDate(prisoner.getReleaseDate());
|
||||
vo.setReleaseType(prisoner.getReleaseType());
|
||||
vo.setReleaseReason(prisoner.getReleaseReason());
|
||||
vo.setPhoto(prisoner.getPhoto());
|
||||
vo.setPrisonAreaId(prisoner.getPrisonAreaId());
|
||||
vo.setPrisonCellId(prisoner.getPrisonCellId());
|
||||
if (prisoner.getStatus() != null) {
|
||||
vo.setStatus(prisoner.getStatus().getValue());
|
||||
vo.setStatusName(prisoner.getStatus().getName());
|
||||
}
|
||||
vo.setRemark(prisoner.getRemark());
|
||||
vo.setCreateTime(prisoner.getCreateTime() != null ? prisoner.getCreateTime().toString() : null);
|
||||
|
||||
// 设置性别
|
||||
if (prisoner.getGender() != null) {
|
||||
vo.setGender(prisoner.getGender().getValue());
|
||||
vo.setGenderName(prisoner.getGender().getName());
|
||||
}
|
||||
|
||||
// 设置监管等级
|
||||
if (prisoner.getSupervisionLevel() != null) {
|
||||
vo.setSupervisionLevel(prisoner.getSupervisionLevel().getValue());
|
||||
vo.setSupervisionLevelName(prisoner.getSupervisionLevel().getName());
|
||||
}
|
||||
|
||||
// 设置风险等级
|
||||
if (prisoner.getRiskLevel() != null) {
|
||||
vo.setRiskLevel(prisoner.getRiskLevel().getValue());
|
||||
String[] riskLabels = {"", "低风险", "中风险", "高风险", "极高风险"};
|
||||
Integer value = prisoner.getRiskLevel().getValue();
|
||||
if (value >= 1 && value <= 4) {
|
||||
vo.setRiskLevelName(riskLabels[value]);
|
||||
} else {
|
||||
vo.setRiskLevelName(prisoner.getRiskLevel().getName());
|
||||
}
|
||||
}
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获取服刑人员分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('prison:prisoner:read')")
|
||||
|
||||
@ -23,7 +23,7 @@ public class PrisonerPageReqVO extends PageParam {
|
||||
@Schema(description = "姓名", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别", example = "1")
|
||||
@Schema(description = "性别,参见 GenderEnum 枚举:0-未知 1-男 2-女", example = "1")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description = "身份证号", example = "310101199001011234")
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.prisoner.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ -22,13 +23,14 @@ public class PrisonerRespVO {
|
||||
@Schema(description = "姓名", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别", example = "1")
|
||||
@Schema(description = "性别,参见 GenderEnum 枚举:0-未知 1-男 2-女", example = "1")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description = "性别名称", example = "男")
|
||||
private String genderName;
|
||||
|
||||
@Schema(description = "出生日期", example = "1990-01-01")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate birthday;
|
||||
|
||||
@Schema(description = "身份证号", example = "310101199001011234")
|
||||
@ -71,6 +73,7 @@ public class PrisonerRespVO {
|
||||
private String courtName;
|
||||
|
||||
@Schema(description = "判决日期", example = "2023-01-15")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate judgmentDate;
|
||||
|
||||
@Schema(description = "判决书编号", example = "(2023)沪01刑初123号")
|
||||
@ -80,14 +83,19 @@ public class PrisonerRespVO {
|
||||
private String originalSentence;
|
||||
|
||||
@Schema(description = "入狱日期", example = "2024-01-01")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate imprisonmentDate;
|
||||
|
||||
@Schema(description = "释放日期", example = "2027-07-01")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate releaseDate;
|
||||
|
||||
@Schema(description = "释放类型", example = "1")
|
||||
private Integer releaseType;
|
||||
|
||||
@Schema(description = "释放类型名称", example = "刑满释放")
|
||||
private String releaseTypeName;
|
||||
|
||||
@Schema(description = "释放原因", example = "刑满释放")
|
||||
private String releaseReason;
|
||||
|
||||
@ -109,6 +117,9 @@ public class PrisonerRespVO {
|
||||
@Schema(description = "监区ID", example = "1")
|
||||
private Long prisonAreaId;
|
||||
|
||||
@Schema(description = "分区ID", example = "1")
|
||||
private Long subAreaId;
|
||||
|
||||
@Schema(description = "监区名称", example = "一监区")
|
||||
private String prisonAreaName;
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ public class PrisonerSaveReqVO {
|
||||
@Size(max = 50, message = "姓名长度不能超过50")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别", example = "1", required = true)
|
||||
@Schema(description = "性别,参见 GenderEnum 枚举:0-未知 1-男 2-女", example = "1", required = true)
|
||||
@NotNull(message = "性别不能为空")
|
||||
private Integer gender;
|
||||
|
||||
|
||||
@ -17,7 +17,6 @@ import java.io.IOException;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
@ -28,6 +27,7 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.question.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.question.QuestionDO;
|
||||
import cn.iocoder.yudao.module.prison.service.question.QuestionService;
|
||||
import cn.iocoder.yudao.module.prison.convert.question.QuestionConvert;
|
||||
|
||||
@Tag(name = "管理后台 - 问卷问题")
|
||||
@RestController
|
||||
@ -41,6 +41,7 @@ public class PrisonQuestionController {
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建问卷问题")
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:create')")
|
||||
@ApiAccessLog(operateType = CREATE)
|
||||
public CommonResult<Long> createQuestion(@Valid @RequestBody QuestionSaveReqVO createReqVO) {
|
||||
return success(questionService.createQuestion(createReqVO));
|
||||
}
|
||||
@ -48,6 +49,7 @@ public class PrisonQuestionController {
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新问卷问题")
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:update')")
|
||||
@ApiAccessLog(operateType = UPDATE)
|
||||
public CommonResult<Boolean> updateQuestion(@Valid @RequestBody QuestionSaveReqVO updateReqVO) {
|
||||
questionService.updateQuestion(updateReqVO);
|
||||
return success(true);
|
||||
@ -57,6 +59,7 @@ public class PrisonQuestionController {
|
||||
@Operation(summary = "删除问卷问题")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:delete')")
|
||||
@ApiAccessLog(operateType = DELETE)
|
||||
public CommonResult<Boolean> deleteQuestion(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
questionService.deleteQuestion(id);
|
||||
return success(true);
|
||||
@ -65,7 +68,8 @@ public class PrisonQuestionController {
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除问卷问题")
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:delete')")
|
||||
@ApiAccessLog(operateType = DELETE)
|
||||
public CommonResult<Boolean> deleteQuestionList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
questionService.deleteQuestionListByIds(ids);
|
||||
return success(true);
|
||||
@ -77,7 +81,7 @@ public class PrisonQuestionController {
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:query')")
|
||||
public CommonResult<QuestionRespVO> getQuestion(@RequestParam("id") Long id) {
|
||||
QuestionDO question = questionService.getQuestion(id);
|
||||
return success(BeanUtils.toBean(question, QuestionRespVO.class));
|
||||
return success(QuestionConvert.INSTANCE.convert(question));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ -85,12 +89,13 @@ public class PrisonQuestionController {
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:query')")
|
||||
public CommonResult<PageResult<QuestionRespVO>> getQuestionPage(@Valid QuestionPageReqVO pageReqVO) {
|
||||
PageResult<QuestionDO> pageResult = questionService.getQuestionPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, QuestionRespVO.class));
|
||||
return success(QuestionConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@PostMapping("/batch-update")
|
||||
@Operation(summary = "批量更新问卷问题")
|
||||
@PreAuthorize("@ss.hasPermission('prison:question:update')")
|
||||
@ApiAccessLog(operateType = UPDATE)
|
||||
public CommonResult<Boolean> batchUpdateQuestion(@Valid @RequestBody QuestionBatchUpdateReqVO reqVO) {
|
||||
// 转换为 Service 需要的格式
|
||||
List<QuestionSaveReqVO> updateList = new ArrayList<>();
|
||||
@ -116,7 +121,7 @@ public class PrisonQuestionController {
|
||||
List<QuestionDO> list = questionService.getQuestionPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "问卷问题.xls", "数据", QuestionRespVO.class,
|
||||
BeanUtils.toBean(list, QuestionRespVO.class));
|
||||
QuestionConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
}
|
||||
@ -6,6 +6,7 @@ import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷问题 Response VO")
|
||||
@ -82,6 +83,7 @@ public class QuestionRespVO {
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
||||
@ -17,7 +17,6 @@ import java.io.IOException;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
@ -28,6 +27,7 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.questionnaire.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.questionnaire.QuestionnaireDO;
|
||||
import cn.iocoder.yudao.module.prison.service.questionnaire.QuestionnaireService;
|
||||
import cn.iocoder.yudao.module.prison.convert.questionnaire.QuestionnaireConvert;
|
||||
|
||||
@Tag(name = "管理后台 - 问卷模板")
|
||||
@RestController
|
||||
@ -41,6 +41,7 @@ public class PrisonQuestionnaireController {
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建问卷模板")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire:create')")
|
||||
@ApiAccessLog(operateType = CREATE)
|
||||
public CommonResult<Long> createQuestionnaire(@Valid @RequestBody QuestionnaireSaveReqVO createReqVO) {
|
||||
return success(questionnaireService.createQuestionnaire(createReqVO));
|
||||
}
|
||||
@ -48,6 +49,7 @@ public class PrisonQuestionnaireController {
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新问卷模板")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire:update')")
|
||||
@ApiAccessLog(operateType = UPDATE)
|
||||
public CommonResult<Boolean> updateQuestionnaire(@Valid @RequestBody QuestionnaireSaveReqVO updateReqVO) {
|
||||
questionnaireService.updateQuestionnaire(updateReqVO);
|
||||
return success(true);
|
||||
@ -57,15 +59,17 @@ public class PrisonQuestionnaireController {
|
||||
@Operation(summary = "删除问卷模板")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire:delete')")
|
||||
@ApiAccessLog(operateType = DELETE)
|
||||
public CommonResult<Boolean> deleteQuestionnaire(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
questionnaireService.deleteQuestionnaire(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Parameter(name = "ids", description = "编号列表", required = true)
|
||||
@Operation(summary = "批量删除问卷模板")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire:delete')")
|
||||
@ApiAccessLog(operateType = DELETE)
|
||||
public CommonResult<Boolean> deleteQuestionnaireList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
questionnaireService.deleteQuestionnaireListByIds(ids);
|
||||
return success(true);
|
||||
@ -77,7 +81,7 @@ public class PrisonQuestionnaireController {
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire:query')")
|
||||
public CommonResult<QuestionnaireRespVO> getQuestionnaire(@RequestParam("id") Long id) {
|
||||
QuestionnaireDO questionnaire = questionnaireService.getQuestionnaire(id);
|
||||
return success(BeanUtils.toBean(questionnaire, QuestionnaireRespVO.class));
|
||||
return success(QuestionnaireConvert.INSTANCE.convert(questionnaire));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ -85,7 +89,7 @@ public class PrisonQuestionnaireController {
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire:query')")
|
||||
public CommonResult<PageResult<QuestionnaireRespVO>> getQuestionnairePage(@Valid QuestionnairePageReqVO pageReqVO) {
|
||||
PageResult<QuestionnaireDO> pageResult = questionnaireService.getQuestionnairePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, QuestionnaireRespVO.class));
|
||||
return success(QuestionnaireConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ -98,7 +102,7 @@ public class PrisonQuestionnaireController {
|
||||
List<QuestionnaireDO> list = questionnaireService.getQuestionnairePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "问卷模板.xls", "数据", QuestionnaireRespVO.class,
|
||||
BeanUtils.toBean(list, QuestionnaireRespVO.class));
|
||||
QuestionnaireConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
}
|
||||
@ -6,6 +6,7 @@ import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷模板 Response VO")
|
||||
@ -43,6 +44,7 @@ public class QuestionnaireRespVO {
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
// ==================== 新增字段 ====================
|
||||
|
||||
@ -13,11 +13,11 @@ import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
@ -28,8 +28,9 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.questionnairerecord.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.questionnairerecord.QuestionnaireRecordDO;
|
||||
import cn.iocoder.yudao.module.prison.service.questionnairerecord.QuestionnaireRecordService;
|
||||
import cn.iocoder.yudao.module.prison.convert.questionnairerecord.QuestionnaireRecordConvert;
|
||||
|
||||
@Tag(name = "管理后台 - 问卷答题记录")
|
||||
@Tag(name = "管理后台 - 问卷答题记录/测评记录")
|
||||
@RestController
|
||||
@RequestMapping("/prison/questionnaire-record")
|
||||
@Validated
|
||||
@ -38,6 +39,8 @@ public class PrisonQuestionnaireRecordController {
|
||||
@Resource
|
||||
private QuestionnaireRecordService questionnaireRecordService;
|
||||
|
||||
// ==================== 基础 CRUD ====================
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建问卷答题记录")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:create')")
|
||||
@ -63,9 +66,8 @@ public class PrisonQuestionnaireRecordController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除问卷答题记录")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:delete')")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:delete')")
|
||||
public CommonResult<Boolean> deleteQuestionnaireRecordList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
questionnaireRecordService.deleteQuestionnaireRecordListByIds(ids);
|
||||
return success(true);
|
||||
@ -75,9 +77,9 @@ public class PrisonQuestionnaireRecordController {
|
||||
@Operation(summary = "获得问卷答题记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:query')")
|
||||
public CommonResult<QuestionnaireRecordRespVO> getQuestionnaireRecord(@RequestParam("id") Long id) {
|
||||
public CommonResult<QuestionnaireRecordRespVO> getQuestionnaireRecord(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
QuestionnaireRecordDO questionnaireRecord = questionnaireRecordService.getQuestionnaireRecord(id);
|
||||
return success(BeanUtils.toBean(questionnaireRecord, QuestionnaireRecordRespVO.class));
|
||||
return success(QuestionnaireRecordConvert.INSTANCE.convert(questionnaireRecord));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ -85,7 +87,7 @@ public class PrisonQuestionnaireRecordController {
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:query')")
|
||||
public CommonResult<PageResult<QuestionnaireRecordRespVO>> getQuestionnaireRecordPage(@Valid QuestionnaireRecordPageReqVO pageReqVO) {
|
||||
PageResult<QuestionnaireRecordDO> pageResult = questionnaireRecordService.getQuestionnaireRecordPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, QuestionnaireRecordRespVO.class));
|
||||
return success(QuestionnaireRecordConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ -98,7 +100,90 @@ public class PrisonQuestionnaireRecordController {
|
||||
List<QuestionnaireRecordDO> list = questionnaireRecordService.getQuestionnaireRecordPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "问卷答题记录.xls", "数据", QuestionnaireRecordRespVO.class,
|
||||
BeanUtils.toBean(list, QuestionnaireRecordRespVO.class));
|
||||
QuestionnaireRecordConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
}
|
||||
// ==================== 测评执行相关 ====================
|
||||
|
||||
@PostMapping("/initiate")
|
||||
@Operation(summary = "发起测评")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:initiate')")
|
||||
public CommonResult<Long> initiateAssessment(@Valid @RequestBody AssessmentInitiateReqVO reqVO) {
|
||||
return success(questionnaireRecordService.initiateAssessment(reqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/start")
|
||||
@Operation(summary = "开始测评")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:start')")
|
||||
public CommonResult<Boolean> startAssessment(@NotNull(message = "记录ID不能为空") @RequestParam("id") Long id,
|
||||
@NotNull(message = "罪犯ID不能为空") @RequestParam("prisonerId") Long prisonerId) {
|
||||
questionnaireRecordService.startAssessment(id, prisonerId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/submit")
|
||||
@Operation(summary = "提交答卷")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:submit')")
|
||||
public CommonResult<Boolean> submitAnswer(@Valid @RequestBody AssessmentAnswerSubmitReqVO reqVO) {
|
||||
questionnaireRecordService.submitAnswer(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/finish")
|
||||
@Operation(summary = "结束测评")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:finish')")
|
||||
public CommonResult<Boolean> finishAssessment(@NotNull(message = "记录ID不能为空") @RequestParam("id") Long id) {
|
||||
questionnaireRecordService.finishAssessment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/cancel")
|
||||
@Operation(summary = "取消测评")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:cancel')")
|
||||
public CommonResult<Boolean> cancelAssessment(@NotNull(message = "记录ID不能为空") @RequestParam("id") Long id) {
|
||||
questionnaireRecordService.cancelAssessment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
// ==================== 评分相关 ====================
|
||||
|
||||
@PostMapping("/auto-score")
|
||||
@Operation(summary = "自动评分")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:score')")
|
||||
public CommonResult<Boolean> autoScore(@NotNull(message = "记录ID不能为空") @RequestParam("id") Long id) {
|
||||
questionnaireRecordService.autoScore(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/manual-score")
|
||||
@Operation(summary = "人工评分")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:score')")
|
||||
public CommonResult<Boolean> manualScore(@Valid @RequestBody AssessmentManualScoreReqVO reqVO) {
|
||||
questionnaireRecordService.manualScore(reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
// ==================== 统计相关 ====================
|
||||
|
||||
@GetMapping("/completion-rate")
|
||||
@Operation(summary = "获取完成率")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:query')")
|
||||
public CommonResult<BigDecimal> getCompletionRate(@NotNull(message = "测评记录ID不能为空") @RequestParam("assessmentRecordId") Long assessmentRecordId) {
|
||||
return success(questionnaireRecordService.getCompletionRate(assessmentRecordId));
|
||||
}
|
||||
|
||||
@GetMapping("/score-distribution")
|
||||
@Operation(summary = "获取分数分布")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:query')")
|
||||
public CommonResult<Map<String, Integer>> getScoreDistribution(@NotNull(message = "测评记录ID不能为空") @RequestParam("assessmentRecordId") Long assessmentRecordId) {
|
||||
return success(questionnaireRecordService.getScoreDistribution(assessmentRecordId));
|
||||
}
|
||||
|
||||
@GetMapping("/risk-distribution")
|
||||
@Operation(summary = "获取风险分布")
|
||||
@PreAuthorize("@ss.hasPermission('prison:questionnaire-record:query')")
|
||||
public CommonResult<Map<String, Integer>> getRiskDistribution(@NotNull(message = "测评记录ID不能为空") @RequestParam("assessmentRecordId") Long assessmentRecordId) {
|
||||
return success(questionnaireRecordService.getRiskDistribution(assessmentRecordId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.questionnairerecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 提交答卷 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class AssessmentAnswerSubmitReqVO {
|
||||
|
||||
@Schema(description = "测评记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "测评记录不能为空")
|
||||
private Long recordId;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "罪犯不能为空")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "答案列表")
|
||||
private List<AnswerItem> answers;
|
||||
|
||||
@Data
|
||||
public static class AnswerItem {
|
||||
@Schema(description = "题目ID", example = "1024")
|
||||
private Long questionId;
|
||||
@Schema(description = "答案内容")
|
||||
private String answer;
|
||||
@Schema(description = "选项ID列表(多选用)")
|
||||
private List<Long> optionIds;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.questionnairerecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发起测评 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class AssessmentInitiateReqVO {
|
||||
|
||||
@Schema(description = "问卷ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "问卷不能为空")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "罪犯ID列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "罪犯不能为空")
|
||||
private List<Long> prisonerIds;
|
||||
|
||||
@Schema(description = "测评说明")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "截止日期")
|
||||
private LocalDateTime deadline;
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.assessment.vo;
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.questionnairerecord.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
@ -11,11 +11,11 @@ import java.math.BigDecimal;
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class AssessmentAnswerManualScoreReqVO {
|
||||
public class AssessmentManualScoreReqVO {
|
||||
|
||||
@Schema(description = "答卷ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "答卷ID不能为空")
|
||||
private Long id;
|
||||
@Schema(description = "测评记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "测评记录不能为空")
|
||||
private Long recordId;
|
||||
|
||||
@Schema(description = "主观题得分", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "主观题得分不能为空")
|
||||
@ -24,4 +24,7 @@ public class AssessmentAnswerManualScoreReqVO {
|
||||
@Schema(description = "评语")
|
||||
private String comment;
|
||||
|
||||
@Schema(description = "风险等级:1-高风险 2-中风险 3-低风险")
|
||||
private Integer riskLevel;
|
||||
|
||||
}
|
||||
@ -10,34 +10,51 @@ import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷答题记录分页 Request VO")
|
||||
/**
|
||||
* 管理后台 - 问卷答题记录/测评记录分页 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class QuestionnaireRecordPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "问卷ID", example = "18966")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "问卷名称", example = "心理测评")
|
||||
private String questionnaireName;
|
||||
|
||||
@Schema(description = "罪犯ID", example = "4071")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "得分")
|
||||
private BigDecimal totalScore;
|
||||
@Schema(description = "罪犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "是否及格:1-及格 2-不及格", example = "2")
|
||||
@Schema(description = "状态:1-待测评 2-测评中 3-已完成 4-已过期 5-已取消", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "及格状态:1-及格 2-不及格 3-待评阅", example = "1")
|
||||
private Integer passStatus;
|
||||
|
||||
@Schema(description = "答题时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] answerTime;
|
||||
@Schema(description = "风险等级:1-高风险 2-中风险 3-低风险", example = "3")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "状态:1-已完成 2-已过期", example = "1")
|
||||
private Integer status;
|
||||
@Schema(description = "总分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "测评开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] startTime;
|
||||
|
||||
@Schema(description = "测评截止时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] deadline;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,8 +6,14 @@ import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
/**
|
||||
* 管理后台 - 问卷答题记录/测评记录 Response VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 问卷答题记录 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@ -17,10 +23,18 @@ public class QuestionnaireRecordRespVO {
|
||||
@ExcelProperty("记录ID")
|
||||
private Long id;
|
||||
|
||||
// ==================== 问卷信息 ====================
|
||||
|
||||
@Schema(description = "问卷ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18966")
|
||||
@ExcelProperty("问卷ID")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "问卷名称")
|
||||
@ExcelProperty("问卷名称")
|
||||
private String questionnaireName;
|
||||
|
||||
// ==================== 罪犯信息 ====================
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4071")
|
||||
@ExcelProperty("罪犯ID")
|
||||
private Long prisonerId;
|
||||
@ -29,24 +43,100 @@ public class QuestionnaireRecordRespVO {
|
||||
@ExcelProperty("罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "得分")
|
||||
@ExcelProperty("得分")
|
||||
private BigDecimal totalScore;
|
||||
@Schema(description = "罪犯姓名")
|
||||
@ExcelProperty("罪犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "是否及格:1-及格 2-不及格", example = "2")
|
||||
@ExcelProperty("是否及格:1-及格 2-不及格")
|
||||
private Integer passStatus;
|
||||
// ==================== 测评状态 ====================
|
||||
|
||||
@Schema(description = "答题时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "状态:1-待测评 2-测评中 3-已完成 4-已过期 5-已取消", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("状态")
|
||||
private Integer status;
|
||||
|
||||
// ==================== 测评时间 ====================
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@ExcelProperty("开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "UTC")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
@ExcelProperty("结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "UTC")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "答题时间")
|
||||
@ExcelProperty("答题时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "UTC")
|
||||
private LocalDateTime answerTime;
|
||||
|
||||
@Schema(description = "状态:1-已完成 2-已过期", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("状态:1-已完成 2-已过期")
|
||||
private Integer status;
|
||||
@Schema(description = "截止日期")
|
||||
@ExcelProperty("截止日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "UTC")
|
||||
private LocalDateTime deadline;
|
||||
|
||||
// ==================== 评分信息 ====================
|
||||
|
||||
@Schema(description = "客观题得分")
|
||||
@ExcelProperty("客观题得分")
|
||||
private BigDecimal objectiveScore;
|
||||
|
||||
@Schema(description = "主观题得分")
|
||||
@ExcelProperty("主观题得分")
|
||||
private BigDecimal subjectiveScore;
|
||||
|
||||
@Schema(description = "总分")
|
||||
@ExcelProperty("总分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "及格分数")
|
||||
@ExcelProperty("及格分数")
|
||||
private BigDecimal passScore;
|
||||
|
||||
@Schema(description = "及格状态:1-及格 2-不及格 3-待评阅", example = "2")
|
||||
@ExcelProperty("及格状态")
|
||||
private Integer passStatus;
|
||||
|
||||
@Schema(description = "风险等级:1-高风险 2-中风险 3-低风险", example = "3")
|
||||
@ExcelProperty("风险等级")
|
||||
private Integer riskLevel;
|
||||
|
||||
// ==================== 评阅信息 ====================
|
||||
|
||||
@Schema(description = "评阅人ID")
|
||||
private Long evaluatorId;
|
||||
|
||||
@Schema(description = "评阅人姓名")
|
||||
@ExcelProperty("评阅人")
|
||||
private String evaluatorName;
|
||||
|
||||
@Schema(description = "评阅时间")
|
||||
@ExcelProperty("评阅时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "UTC")
|
||||
private LocalDateTime evaluateTime;
|
||||
|
||||
// ==================== 统计信息 ====================
|
||||
|
||||
@Schema(description = "参与人数")
|
||||
private Integer participantCount;
|
||||
|
||||
@Schema(description = "完成人数")
|
||||
private Integer completedCount;
|
||||
|
||||
@Schema(description = "答题用时(秒)")
|
||||
@ExcelProperty("答题用时")
|
||||
private Integer duration;
|
||||
|
||||
// ==================== 备注 ====================
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
// ==================== 通用字段 ====================
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "UTC")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,37 +8,100 @@ import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 问卷答题记录新增/修改 Request VO")
|
||||
/**
|
||||
* 管理后台 - 问卷答题记录/测评记录新增/修改 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class QuestionnaireRecordSaveReqVO {
|
||||
|
||||
@Schema(description = "记录ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "8596")
|
||||
private Long id;
|
||||
|
||||
// ==================== 问卷信息 ====================
|
||||
|
||||
@Schema(description = "问卷ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18966")
|
||||
@NotNull(message = "问卷ID不能为空")
|
||||
private Long questionnaireId;
|
||||
|
||||
@Schema(description = "问卷名称")
|
||||
private String questionnaireName;
|
||||
|
||||
// ==================== 罪犯信息 ====================
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4071")
|
||||
@NotNull(message = "罪犯ID不能为空")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "罪犯编号不能为空")
|
||||
@Schema(description = "罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "得分")
|
||||
private BigDecimal totalScore;
|
||||
@Schema(description = "罪犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "是否及格:1-及格 2-不及格", example = "2")
|
||||
private Integer passStatus;
|
||||
// ==================== 测评状态 ====================
|
||||
|
||||
@Schema(description = "答题时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "答题时间不能为空")
|
||||
private LocalDateTime answerTime;
|
||||
|
||||
@Schema(description = "状态:1-已完成 2-已过期", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "状态:1-已完成 2-已过期不能为空")
|
||||
@Schema(description = "状态:1-待测评 2-测评中 3-已完成 4-已过期 5-已取消", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
// ==================== 测评时间 ====================
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "截止日期")
|
||||
private LocalDateTime deadline;
|
||||
|
||||
// ==================== 评分信息 ====================
|
||||
|
||||
@Schema(description = "客观题得分")
|
||||
private BigDecimal objectiveScore;
|
||||
|
||||
@Schema(description = "主观题得分")
|
||||
private BigDecimal subjectiveScore;
|
||||
|
||||
@Schema(description = "总分")
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "及格分数")
|
||||
private BigDecimal passScore;
|
||||
|
||||
@Schema(description = "及格状态:1-及格 2-不及格 3-待评阅", example = "2")
|
||||
private Integer passStatus;
|
||||
|
||||
@Schema(description = "风险等级:1-高风险 2-中风险 3-低风险", example = "3")
|
||||
private Integer riskLevel;
|
||||
|
||||
// ==================== 评阅信息 ====================
|
||||
|
||||
@Schema(description = "评阅人ID")
|
||||
private Long evaluatorId;
|
||||
|
||||
@Schema(description = "评阅人姓名")
|
||||
private String evaluatorName;
|
||||
|
||||
@Schema(description = "评阅时间")
|
||||
private LocalDateTime evaluateTime;
|
||||
|
||||
// ==================== 统计信息 ====================
|
||||
|
||||
@Schema(description = "参与人数")
|
||||
private Integer participantCount;
|
||||
|
||||
@Schema(description = "完成人数")
|
||||
private Integer completedCount;
|
||||
|
||||
@Schema(description = "答题用时(秒)")
|
||||
private Integer duration;
|
||||
|
||||
// ==================== 备注 ====================
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.quickcomment;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.quickcomment.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.service.quickcomment.CommentCategoryService;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.quickcomment.CommentCategoryDO;
|
||||
|
||||
@Tag(name = "管理后台 - 快捷评语分类")
|
||||
@RestController
|
||||
@RequestMapping("/prison/quick-comment/category")
|
||||
@Validated
|
||||
public class CommentCategoryController {
|
||||
|
||||
@Resource
|
||||
private CommentCategoryService commentCategoryService;
|
||||
|
||||
@PostMapping("/init")
|
||||
@Operation(summary = "初始化快捷评语分类和评语(预置数据)")
|
||||
@PreAuthorize("@ss.hasPermission('prison:comment-category:create')")
|
||||
public CommonResult<Integer> initCategories() {
|
||||
int count = commentCategoryService.initCategories();
|
||||
return success(count);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "查询分类列表")
|
||||
public CommonResult<List<CommentCategoryDO>> getCategoryList(CommentCategorySaveReqVO reqVO) {
|
||||
return success(commentCategoryService.getCategoryList(reqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得分类详情")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<CommentCategoryDO> getCategory(@RequestParam("id") Long id) {
|
||||
return success(commentCategoryService.getCategory(id));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,115 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.quickcomment;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.quickcomment.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.quickcomment.QuickCommentDO;
|
||||
import cn.iocoder.yudao.module.prison.service.quickcomment.QuickCommentService;
|
||||
|
||||
@Tag(name = "管理后台 - 快捷评语")
|
||||
@RestController
|
||||
@RequestMapping("/prison/quick-comment")
|
||||
@Validated
|
||||
public class QuickCommentController {
|
||||
|
||||
@Resource
|
||||
private QuickCommentService quickCommentService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建快捷评语")
|
||||
@PreAuthorize("@ss.hasPermission('prison:quick-comment:create')")
|
||||
public CommonResult<Long> createQuickComment(@Valid @RequestBody QuickCommentSaveReqVO createReqVO) {
|
||||
return success(quickCommentService.createQuickComment(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新快捷评语")
|
||||
@PreAuthorize("@ss.hasPermission('prison:quick-comment:update')")
|
||||
public CommonResult<Boolean> updateQuickComment(@Valid @RequestBody QuickCommentSaveReqVO updateReqVO) {
|
||||
quickCommentService.updateQuickComment(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除快捷评语")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:quick-comment:delete')")
|
||||
public CommonResult<Boolean> deleteQuickComment(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
quickCommentService.deleteQuickComment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Operation(summary = "批量删除快捷评语")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:quick-comment:delete')")
|
||||
public CommonResult<Boolean> deleteQuickCommentList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
quickCommentService.deleteQuickCommentListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得快捷评语详情")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:quick-comment:query')")
|
||||
public CommonResult<QuickCommentRespVO> getQuickComment(@RequestParam("id") Long id) {
|
||||
QuickCommentDO comment = quickCommentService.getQuickComment(id);
|
||||
if (comment == null) {
|
||||
return success(null);
|
||||
}
|
||||
return success(BeanUtils.toBean(comment, QuickCommentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得快捷评语分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:quick-comment:query')")
|
||||
public CommonResult<PageResult<QuickCommentRespVO>> getQuickCommentPage(@Valid QuickCommentPageReqVO pageReqVO) {
|
||||
return success(quickCommentService.getQuickCommentPage(pageReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/import")
|
||||
@Operation(summary = "导入快捷评语")
|
||||
@PreAuthorize("@ss.hasPermission('prison:quick-comment:import')")
|
||||
public CommonResult<Integer> importComments(@RequestBody Map<String, Object> params) {
|
||||
Long categoryId = Long.valueOf(params.get("categoryId").toString());
|
||||
@SuppressWarnings("unchecked")
|
||||
List<String> contents = (List<String>) params.get("contents");
|
||||
int count = quickCommentService.importComments(categoryId, contents);
|
||||
return success(count);
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
@Operation(summary = "导出快捷评语 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:quick-comment:export')")
|
||||
public void exportQuickCommentExcel(@Valid QuickCommentPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<QuickCommentRespVO> list = quickCommentService.getQuickCommentPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "快捷评语.xls", "数据", QuickCommentRespVO.class, list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.quickcomment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 快捷评语分类分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CommentCategoryPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "分类名称", example = "入监综合评估")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "评估类型:1-入监 2-定期 3-出监 4-减刑 5-专项", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "状态:0-停用 1-启用", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.quickcomment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 快捷评语分类 Response VO")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class CommentCategoryRespVO {
|
||||
|
||||
@Schema(description = "分类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分类名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "评估类型:1-入监 2-定期 3-出监 4-减刑 5-专项")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态:0-停用 1-启用")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.quickcomment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 快捷评语分类新增/修改 Request VO")
|
||||
@Data
|
||||
public class CommentCategorySaveReqVO {
|
||||
|
||||
@Schema(description = "分类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分类名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "分类名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "评估类型:1-入监 2-定期 3-出监 4-减刑 5-专项", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "评估类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态:0-停用 1-启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.quickcomment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
@Schema(description = "管理后台 - 快捷评语分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class QuickCommentPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "分类ID")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "评语内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "状态:0-停用 1-启用")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.quickcomment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
@Schema(description = "管理后台 - 快捷评语 Response VO")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class QuickCommentRespVO {
|
||||
|
||||
@Schema(description = "评语ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分类ID")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "分类名称")
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "评语内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "使用次数")
|
||||
private Integer usageCount;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态:0-停用 1-启用")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.quickcomment.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 快捷评语新增/修改 Request VO")
|
||||
@Data
|
||||
public class QuickCommentSaveReqVO {
|
||||
|
||||
@Schema(description = "评语ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分类ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "分类ID不能为空")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "评语内容", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "评语内容不能为空")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态:0-停用 1-启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.prison.controller.admin.release.vo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@ -45,6 +46,7 @@ public class ReleaseRespVO {
|
||||
private String judgmentNo;
|
||||
|
||||
@Schema(description = "实际释放日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
|
||||
private LocalDate actualReleaseDate;
|
||||
|
||||
@Schema(description = "交接人")
|
||||
|
||||
@ -0,0 +1,102 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.report;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.report.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.report.ReportDO;
|
||||
import cn.iocoder.yudao.module.prison.service.report.ReportService;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.report.vo.ReportConvert;
|
||||
|
||||
@Tag(name = "管理后台 - 评估报告")
|
||||
@RestController
|
||||
@RequestMapping("/prison/report")
|
||||
@Validated
|
||||
public class ReportController {
|
||||
|
||||
@Resource
|
||||
private ReportService reportService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建评估报告")
|
||||
@PreAuthorize("@ss.hasPermission('prison:report:create')")
|
||||
public CommonResult<Long> createReport(@Valid @RequestBody ReportSaveReqVO createReqVO) {
|
||||
return success(reportService.createReport(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新评估报告")
|
||||
@PreAuthorize("@ss.hasPermission('prison:report:update')")
|
||||
public CommonResult<Boolean> updateReport(@Valid @RequestBody ReportSaveReqVO updateReqVO) {
|
||||
reportService.updateReport(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除评估报告")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:report:delete')")
|
||||
public CommonResult<Boolean> deleteReport(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
reportService.deleteReport(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Operation(summary = "批量删除评估报告")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:report:delete')")
|
||||
public CommonResult<Boolean> deleteReportList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
reportService.deleteReportListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得评估报告详情")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:report:query')")
|
||||
public CommonResult<ReportRespVO> getReport(@RequestParam("id") Long id) {
|
||||
return success(ReportConvert.INSTANCE.convert(reportService.getReport(id)));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得评估报告分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:report:query')")
|
||||
public CommonResult<PageResult<ReportRespVO>> getReportPage(@Valid ReportPageReqVO pageReqVO) {
|
||||
PageResult<ReportDO> pageResult = reportService.getReportPage(pageReqVO);
|
||||
return success(ReportConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出评估报告 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:report:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportReportExcel(@Valid ReportPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ReportRespVO> list = ReportConvert.INSTANCE.convertList(reportService.getReportPage(pageReqVO).getList());
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "评估报告.xls", "数据", ReportRespVO.class, list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.report.vo;
|
||||
import java.util.List;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.report.ReportDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface ReportConvert {
|
||||
ReportConvert INSTANCE = Mappers.getMapper(ReportConvert.class);
|
||||
|
||||
ReportDO convert(ReportSaveReqVO bean);
|
||||
|
||||
ReportRespVO convert(ReportDO bean);
|
||||
|
||||
List<ReportRespVO> convertList(List<ReportDO> list);
|
||||
|
||||
PageResult<ReportRespVO> convertPage(PageResult<ReportDO> page);
|
||||
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.report.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
@Schema(description = "管理后台 - 评估报告分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ReportPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "报告编号")
|
||||
private String reportNo;
|
||||
|
||||
@Schema(description = "罪犯ID")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "罪犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "模板ID")
|
||||
private Long templateId;
|
||||
|
||||
@Schema(description = "风险等级:1-低风险 2-中风险 3-高风险 4-极高风险")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "状态:1-草稿 2-待审核 3-已通过 4-已退回")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "报告日期")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDateTime[] reportDate;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,126 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.report.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 评估报告 Response VO")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ReportRespVO {
|
||||
|
||||
@Schema(description = "报告ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "报告编号")
|
||||
private String reportNo;
|
||||
|
||||
@Schema(description = "罪犯ID")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "罪犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "监区ID")
|
||||
private Long prisonAreaId;
|
||||
|
||||
@Schema(description = "监区名称")
|
||||
private String prisonAreaName;
|
||||
|
||||
@Schema(description = "监室ID")
|
||||
private Long prisonCellId;
|
||||
|
||||
@Schema(description = "监室名称")
|
||||
private String prisonCellName;
|
||||
|
||||
@Schema(description = "模板ID")
|
||||
private Long templateId;
|
||||
|
||||
@Schema(description = "模板名称")
|
||||
private String templateName;
|
||||
|
||||
@Schema(description = "报告标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "报告日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
|
||||
private java.time.LocalDate reportDate;
|
||||
|
||||
@Schema(description = "维度内容,JSON格式")
|
||||
private String dimensions;
|
||||
|
||||
@Schema(description = "综合结论")
|
||||
private String conclusion;
|
||||
|
||||
@Schema(description = "改造建议")
|
||||
private String suggestions;
|
||||
|
||||
@Schema(description = "风险等级:1-低风险 2-中风险 3-高风险 4-极高风险")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "附件列表,JSON格式")
|
||||
private String attachments;
|
||||
|
||||
@Schema(description = "状态:1-草稿 2-待审核 3-已通过 4-已退回")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "数字签名")
|
||||
private String signature;
|
||||
|
||||
@Schema(description = "报告指纹")
|
||||
private String fingerprint;
|
||||
|
||||
@Schema(description = "提交人ID")
|
||||
private Long submitterId;
|
||||
|
||||
@Schema(description = "提交人姓名")
|
||||
private String submitterName;
|
||||
|
||||
@Schema(description = "提交时间")
|
||||
private LocalDateTime submitTime;
|
||||
|
||||
@Schema(description = "审核人ID")
|
||||
private Long reviewerId;
|
||||
|
||||
@Schema(description = "审核人姓名")
|
||||
private String reviewerName;
|
||||
|
||||
@Schema(description = "审核时间")
|
||||
private LocalDateTime reviewTime;
|
||||
|
||||
@Schema(description = "审核意见")
|
||||
private String reviewComment;
|
||||
|
||||
@Schema(description = "是否已归档")
|
||||
private Boolean archived;
|
||||
|
||||
@Schema(description = "归档时间")
|
||||
private LocalDateTime archivedTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.report.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 评估报告新增/修改 Request VO")
|
||||
@Data
|
||||
public class ReportSaveReqVO {
|
||||
|
||||
@Schema(description = "报告ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "报告编号")
|
||||
private String reportNo;
|
||||
|
||||
@Schema(description = "罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "罪犯ID不能为空")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "罪犯编号不能为空")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "罪犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "模板ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "模板ID不能为空")
|
||||
private Long templateId;
|
||||
|
||||
@Schema(description = "模板名称")
|
||||
private String templateName;
|
||||
|
||||
@Schema(description = "报告标题", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "报告标题不能为空")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "报告日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报告日期不能为空")
|
||||
private java.time.LocalDate reportDate;
|
||||
|
||||
@Schema(description = "维度内容,JSON格式")
|
||||
private String dimensions;
|
||||
|
||||
@Schema(description = "综合结论")
|
||||
private String conclusion;
|
||||
|
||||
@Schema(description = "改造建议")
|
||||
private String suggestions;
|
||||
|
||||
@Schema(description = "风险等级:1-低风险 2-中风险 3-高风险 4-极高风险")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "附件列表,JSON格式")
|
||||
private String attachments;
|
||||
|
||||
@Schema(description = "状态:1-草稿 2-待审核 3-已通过 4-已退回", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,129 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.reporttemplate;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.reporttemplate.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.reporttemplate.ReportTemplateDO;
|
||||
import cn.iocoder.yudao.module.prison.service.reporttemplate.ReportTemplateService;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.reporttemplate.vo.ReportTemplateConvert;
|
||||
|
||||
@Tag(name = "管理后台 - 评估报告模板")
|
||||
@RestController
|
||||
@RequestMapping("/prison/report-template")
|
||||
@Validated
|
||||
public class ReportTemplateController {
|
||||
|
||||
@Resource
|
||||
private ReportTemplateService reportTemplateService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建评估报告模板")
|
||||
@PreAuthorize("@ss.hasPermission('prison:report-template:create')")
|
||||
public CommonResult<Long> createReportTemplate(@Valid @RequestBody ReportTemplateSaveReqVO createReqVO) {
|
||||
return success(reportTemplateService.createReportTemplate(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新评估报告模板")
|
||||
@PreAuthorize("@ss.hasPermission('prison:report-template:update')")
|
||||
public CommonResult<Boolean> updateReportTemplate(@Valid @RequestBody ReportTemplateSaveReqVO updateReqVO) {
|
||||
reportTemplateService.updateReportTemplate(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除评估报告模板")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:report-template:delete')")
|
||||
public CommonResult<Boolean> deleteReportTemplate(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
reportTemplateService.deleteReportTemplate(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Operation(summary = "批量删除评估报告模板")
|
||||
@Parameter(name = "ids", description = "编号列表", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:report-template:delete')")
|
||||
public CommonResult<Boolean> deleteReportTemplateList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
reportTemplateService.deleteReportTemplateListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得评估报告模板详情")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:report-template:query')")
|
||||
public CommonResult<ReportTemplateRespVO> getReportTemplate(@RequestParam("id") Long id) {
|
||||
return success(ReportTemplateConvert.INSTANCE.convert(reportTemplateService.getReportTemplate(id)));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得评估报告模板分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:report-template:query')")
|
||||
public CommonResult<PageResult<ReportTemplateRespVO>> getReportTemplatePage(@Valid ReportTemplatePageReqVO pageReqVO) {
|
||||
PageResult<ReportTemplateDO> pageResult = reportTemplateService.getReportTemplatePage(pageReqVO);
|
||||
return success(ReportTemplateConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出评估报告模板 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:report-template:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportReportTemplateExcel(@Valid ReportTemplatePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ReportTemplateRespVO> list = ReportTemplateConvert.INSTANCE.convertList(reportTemplateService.getReportTemplatePage(pageReqVO).getList());
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "评估报告模板.xls", "数据", ReportTemplateRespVO.class, list);
|
||||
}
|
||||
|
||||
@PostMapping("/copy")
|
||||
@Operation(summary = "复制评估报告模板")
|
||||
@Parameter(name = "id", description = "模板ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:report-template:create')")
|
||||
public CommonResult<Long> copyReportTemplate(@RequestParam("id") Long id) {
|
||||
return success(reportTemplateService.copyReportTemplate(id));
|
||||
}
|
||||
|
||||
@PutMapping("/update-status")
|
||||
@Operation(summary = "更新评估报告模板状态")
|
||||
@PreAuthorize("@ss.hasPermission('prison:report-template:update')")
|
||||
public CommonResult<Boolean> updateReportTemplateStatus(
|
||||
@RequestParam("id") Long id,
|
||||
@RequestParam("status") Integer status) {
|
||||
reportTemplateService.updateReportTemplateStatus(id, status);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/set-default")
|
||||
@Operation(summary = "设为默认模板")
|
||||
@Parameter(name = "id", description = "模板ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:report-template:update')")
|
||||
public CommonResult<Boolean> setReportTemplateDefault(@RequestParam("id") Long id) {
|
||||
reportTemplateService.setReportTemplateDefault(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.reporttemplate.vo;
|
||||
import java.util.List;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.reporttemplate.ReportTemplateDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface ReportTemplateConvert {
|
||||
ReportTemplateConvert INSTANCE = Mappers.getMapper(ReportTemplateConvert.class);
|
||||
|
||||
ReportTemplateDO convert(ReportTemplateSaveReqVO bean);
|
||||
|
||||
ReportTemplateRespVO convert(ReportTemplateDO bean);
|
||||
|
||||
List<ReportTemplateRespVO> convertList(List<ReportTemplateDO> list);
|
||||
|
||||
PageResult<ReportTemplateRespVO> convertPage(PageResult<ReportTemplateDO> page);
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.reporttemplate.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
@Schema(description = "管理后台 - 评估报告模板分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ReportTemplatePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "模板名称", example = "入监综合评估模板")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "模板类型:1-入监综合评估 2-定期考核报告 3-出监评估 4-减刑假释建议 5-专项评估")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "状态:0-停用 1-启用")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否默认")
|
||||
private Boolean isDefault;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.reporttemplate.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 评估报告模板 Response VO")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ReportTemplateRespVO {
|
||||
|
||||
@Schema(description = "模板ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "模板名称", example = "入监综合评估模板")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "模板类型:1-入监综合评估 2-定期考核报告 3-出监评估 4-减刑假释建议 5-专项评估")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "报告标题格式")
|
||||
private String titleFormat;
|
||||
|
||||
@Schema(description = "评估维度配置,JSON格式")
|
||||
private String dimensions;
|
||||
|
||||
@Schema(description = "AI提示词配置,JSON格式")
|
||||
private String aiPromptConfig;
|
||||
|
||||
@Schema(description = "样式配置,JSON格式")
|
||||
private String styleConfig;
|
||||
|
||||
@Schema(description = "状态:0-停用 1-启用")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否默认")
|
||||
private Boolean isDefault;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.reporttemplate.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 评估报告模板新增/修改 Request VO")
|
||||
@Data
|
||||
public class ReportTemplateSaveReqVO {
|
||||
|
||||
@Schema(description = "模板ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "模板名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "入监综合评估模板")
|
||||
@NotEmpty(message = "模板名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "模板类型:1-入监综合评估 2-定期考核报告 3-出监评估 4-减刑假释建议 5-专项评估", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "模板类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "报告标题格式", example = "{prisoner_name}入监综合评估报告")
|
||||
private String titleFormat;
|
||||
|
||||
@Schema(description = "评估维度配置,JSON格式")
|
||||
private String dimensions;
|
||||
|
||||
@Schema(description = "AI提示词配置,JSON格式")
|
||||
private String aiPromptConfig;
|
||||
|
||||
@Schema(description = "样式配置,JSON格式")
|
||||
private String styleConfig;
|
||||
|
||||
@Schema(description = "状态:0-停用 1-启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否默认")
|
||||
private Boolean isDefault;
|
||||
|
||||
@Schema(description = "备注", example = "用于新入监罪犯的综合评估")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.risk;
|
||||
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.risk.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.risk.RiskDO;
|
||||
import cn.iocoder.yudao.module.prison.service.risk.RiskService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.convert.risk.RiskConvert;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 管理后台 - 风险评估 Controller
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Tag(name = "管理后台 - 风险评估")
|
||||
@RestController
|
||||
@RequestMapping("/prison/risk")
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
public class RiskController {
|
||||
|
||||
private final RiskService riskService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建风险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk:create')")
|
||||
public CommonResult<Long> create(@Valid @RequestBody RiskSaveReqVO createReqVO) {
|
||||
return success(riskService.createRisk(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新风险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk:update')")
|
||||
public CommonResult<Boolean> update(@Valid @RequestBody RiskSaveReqVO updateReqVO) {
|
||||
riskService.updateRisk(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除风险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk:delete')")
|
||||
public CommonResult<Boolean> delete(@RequestParam("id") Long id) {
|
||||
riskService.deleteRisk(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Operation(summary = "批量删除风险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk:delete')")
|
||||
public CommonResult<Boolean> deleteList(@RequestParam("ids") List<Long> ids) {
|
||||
riskService.deleteRiskListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "查询风险评估详情")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk:query')")
|
||||
public CommonResult<RiskRespVO> get(@RequestParam("id") Long id) {
|
||||
RiskDO risk = riskService.getRisk(id);
|
||||
return success(RiskConvert.INSTANCE.convert(risk));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "分页查询风险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk:query')")
|
||||
public CommonResult<PageResult<RiskRespVO>> page(@Valid RiskPageReqVO pageReqVO) {
|
||||
PageResult<RiskDO> pageResult = riskService.getRiskPage(pageReqVO);
|
||||
return success(RiskConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出风险评估 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk:export')")
|
||||
public void exportExcel(@Valid RiskPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws Exception {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RiskDO> list = riskService.getRiskPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "风险评估.xls", "风险评估数据", RiskRespVO.class,
|
||||
RiskConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.risk.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
/**
|
||||
* 管理后台 - 风险评估分页 Request VO
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Schema(description = "管理后台 - 风险评估分页 Request VO")
|
||||
@Data
|
||||
public class RiskPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "关联罪犯ID", example = "12345")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号", example = "ZF2024001")
|
||||
private String prisonerCode;
|
||||
|
||||
@Schema(description = "罪犯姓名", example = "张三")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "评估类型:1-入监评估 2-定期评估 3-专项评估 4-出监评估", example = "1")
|
||||
private Integer assessmentType;
|
||||
|
||||
@Schema(description = "风险等级:1-低风险 2-中风险 3-高风险 4-极高风险", example = "2")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "评估人")
|
||||
private String assessor;
|
||||
|
||||
@Schema(description = "精神状态评估", example = "精神状态正常")
|
||||
private String mentalState;
|
||||
|
||||
@Schema(description = "脱逃风险评估", example = "脱逃风险低")
|
||||
private String escapeRisk;
|
||||
|
||||
@Schema(description = "暴力倾向评估", example = "无暴力倾向")
|
||||
private String violenceRisk;
|
||||
|
||||
@Schema(description = "抗改风险评估", example = "配合改造")
|
||||
private String revoltRisk;
|
||||
|
||||
@Schema(description = "自杀自伤风险评估", example = "无自伤倾向")
|
||||
private String selfHarmRisk;
|
||||
|
||||
@Schema(description = "评估日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate[] assessmentDate;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,105 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.risk.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
/**
|
||||
* 管理后台 - 风险评估 Response VO
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Schema(description = "管理后台 - 风险评估 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class RiskRespVO {
|
||||
|
||||
@Schema(description = "评估ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19443")
|
||||
@ExcelProperty("评估ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12345")
|
||||
@ExcelProperty("罪犯ID")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号", example = "ZF2024001")
|
||||
@ExcelProperty("罪犯编号")
|
||||
private String prisonerCode;
|
||||
|
||||
@Schema(description = "罪犯姓名", example = "张三")
|
||||
@ExcelProperty("罪犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "评估类型:1-入监评估 2-定期评估 3-专项评估 4-出监评估", example = "1")
|
||||
@ExcelProperty("评估类型")
|
||||
private Integer assessmentType;
|
||||
|
||||
@Schema(description = "评估日期")
|
||||
@ExcelProperty("评估日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
|
||||
private LocalDate assessmentDate;
|
||||
|
||||
@Schema(description = "综合风险得分(0-100)", example = "75.5")
|
||||
@ExcelProperty("综合得分")
|
||||
private BigDecimal overallScore;
|
||||
|
||||
@Schema(description = "风险等级:1-低风险 2-中风险 3-高风险 4-极高风险", example = "2")
|
||||
@ExcelProperty("风险等级")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "精神状态评估", example = "精神状态正常")
|
||||
@ExcelProperty("精神状态")
|
||||
private String mentalState;
|
||||
|
||||
@Schema(description = "脱逃风险评估", example = "脱逃风险低")
|
||||
@ExcelProperty("脱逃风险")
|
||||
private String escapeRisk;
|
||||
|
||||
@Schema(description = "暴力倾向评估", example = "无暴力倾向")
|
||||
@ExcelProperty("暴力倾向")
|
||||
private String violenceRisk;
|
||||
|
||||
@Schema(description = "抗改风险评估", example = "配合改造")
|
||||
@ExcelProperty("抗改风险")
|
||||
private String revoltRisk;
|
||||
|
||||
@Schema(description = "自杀自伤风险评估", example = "无自伤倾向")
|
||||
@ExcelProperty("自伤风险")
|
||||
private String selfHarmRisk;
|
||||
|
||||
@Schema(description = "评估建议", example = "建议加强心理辅导")
|
||||
@ExcelProperty("评估建议")
|
||||
private String recommendation;
|
||||
|
||||
@Schema(description = "评估人")
|
||||
@ExcelProperty("评估人")
|
||||
private String assessor;
|
||||
|
||||
@Schema(description = "评估方式:1-心理测评 2-行为观察 3-面谈评估 4-综合评估", example = "4")
|
||||
@ExcelProperty("评估方式")
|
||||
private Integer assessMethod;
|
||||
|
||||
@Schema(description = "评估项目得分(JSON格式存储)")
|
||||
@ExcelProperty("项目得分")
|
||||
private String itemScores;
|
||||
|
||||
@Schema(description = "评估结论", example = "综合评估为中风险")
|
||||
@ExcelProperty("评估结论")
|
||||
private String conclusion;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.risk.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 管理后台 - 风险评估新增/修改 Request VO
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Schema(description = "管理后台 - 风险评估新增/修改 Request VO")
|
||||
@Data
|
||||
public class RiskSaveReqVO {
|
||||
|
||||
@Schema(description = "评估ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19443")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联罪犯ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12345")
|
||||
@NotNull(message = "罪犯ID不能为空")
|
||||
private Long prisonerId;
|
||||
|
||||
@Schema(description = "罪犯编号", example = "ZF2024001")
|
||||
private String prisonerCode;
|
||||
|
||||
@Schema(description = "罪犯姓名", example = "张三")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "评估类型:1-入监评估 2-定期评估 3-专项评估 4-出监评估", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "评估类型不能为空")
|
||||
private Integer assessmentType;
|
||||
|
||||
@Schema(description = "评估日期")
|
||||
private LocalDate assessmentDate;
|
||||
|
||||
@Schema(description = "综合风险得分(0-100)", example = "75.5")
|
||||
private BigDecimal overallScore;
|
||||
|
||||
@Schema(description = "风险等级:1-低风险 2-中风险 3-高风险 4-极高风险", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "风险等级不能为空")
|
||||
private Integer riskLevel;
|
||||
|
||||
@Schema(description = "精神状态评估", example = "精神状态正常")
|
||||
private String mentalState;
|
||||
|
||||
@Schema(description = "脱逃风险评估", example = "脱逃风险低")
|
||||
private String escapeRisk;
|
||||
|
||||
@Schema(description = "暴力倾向评估", example = "无暴力倾向")
|
||||
private String violenceRisk;
|
||||
|
||||
@Schema(description = "抗改风险评估", example = "配合改造")
|
||||
private String revoltRisk;
|
||||
|
||||
@Schema(description = "自杀自伤风险评估", example = "无自伤倾向")
|
||||
private String selfHarmRisk;
|
||||
|
||||
@Schema(description = "评估建议", example = "建议加强心理辅导")
|
||||
private String recommendation;
|
||||
|
||||
@Schema(description = "评估人")
|
||||
private String assessor;
|
||||
|
||||
@Schema(description = "评估方式:1-心理测评 2-行为观察 3-面谈评估 4-综合评估", example = "4")
|
||||
private Integer assessMethod;
|
||||
|
||||
@Schema(description = "评估项目得分(JSON格式存储)", example = "[{\"itemId\":1,\"itemName\":\"项目名称\",\"score\":85,\"weight\":0.2}]")
|
||||
private String itemScores;
|
||||
|
||||
@Schema(description = "评估结论", example = "综合评估为中风险")
|
||||
private String conclusion;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -1,104 +0,0 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.riskassessment;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.riskassessment.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.riskassessment.RiskAssessmentDO;
|
||||
import cn.iocoder.yudao.module.prison.service.riskassessment.RiskAssessmentService;
|
||||
|
||||
@Tag(name = "管理后台 - 危险评估")
|
||||
@RestController
|
||||
@RequestMapping("/prison/risk-assessment")
|
||||
@Validated
|
||||
public class PrisonRiskAssessmentController {
|
||||
|
||||
@Resource
|
||||
private RiskAssessmentService riskAssessmentService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建危险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:create')")
|
||||
public CommonResult<Long> createRiskAssessment(@Valid @RequestBody RiskAssessmentSaveReqVO createReqVO) {
|
||||
return success(riskAssessmentService.createRiskAssessment(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新危险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:update')")
|
||||
public CommonResult<Boolean> updateRiskAssessment(@Valid @RequestBody RiskAssessmentSaveReqVO updateReqVO) {
|
||||
riskAssessmentService.updateRiskAssessment(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除危险评估")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:delete')")
|
||||
public CommonResult<Boolean> deleteRiskAssessment(@NotNull(message = "编号不能为空") @RequestParam("id") Long id) {
|
||||
riskAssessmentService.deleteRiskAssessment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除危险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:delete')")
|
||||
public CommonResult<Boolean> deleteRiskAssessmentList(@NotEmpty(message = "编号列表不能为空") @RequestParam("ids") List<Long> ids) {
|
||||
riskAssessmentService.deleteRiskAssessmentListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得危险评估")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:query')")
|
||||
public CommonResult<RiskAssessmentRespVO> getRiskAssessment(@RequestParam("id") Long id) {
|
||||
RiskAssessmentDO riskAssessment = riskAssessmentService.getRiskAssessment(id);
|
||||
return success(BeanUtils.toBean(riskAssessment, RiskAssessmentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得危险评估分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:query')")
|
||||
public CommonResult<PageResult<RiskAssessmentRespVO>> getRiskAssessmentPage(@Valid RiskAssessmentPageReqVO pageReqVO) {
|
||||
PageResult<RiskAssessmentDO> pageResult = riskAssessmentService.getRiskAssessmentPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RiskAssessmentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出危险评估 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportRiskAssessmentExcel(@Valid RiskAssessmentPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RiskAssessmentDO> list = riskAssessmentService.getRiskAssessmentPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "危险评估.xls", "数据", RiskAssessmentRespVO.class,
|
||||
BeanUtils.toBean(list, RiskAssessmentRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
package cn.iocoder.yudao.module.prison.controller.admin.riskassessment;
|
||||
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.riskassessment.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.service.riskassessment.RiskAssessmentService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 管理后台 - 危险评估 Controller
|
||||
*
|
||||
* @author xlcp
|
||||
*/
|
||||
@Tag(name = "管理后台 - 危险评估")
|
||||
@RestController
|
||||
@RequestMapping("/prison/risk-assessment")
|
||||
@Validated
|
||||
public class RiskAssessmentController {
|
||||
|
||||
@Resource
|
||||
private RiskAssessmentService riskAssessmentService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建危险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:create')")
|
||||
public CommonResult<Long> create(@Valid @RequestBody RiskAssessmentSaveReqVO createReqVO) {
|
||||
return success(riskAssessmentService.createRiskAssessment(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新危险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:update')")
|
||||
public CommonResult<Boolean> update(@Valid @RequestBody RiskAssessmentSaveReqVO updateReqVO) {
|
||||
riskAssessmentService.updateRiskAssessment(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除危险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:delete')")
|
||||
public CommonResult<Boolean> delete(@RequestParam("id") Long id) {
|
||||
riskAssessmentService.deleteRiskAssessment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Operation(summary = "批量删除危险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:delete')")
|
||||
public CommonResult<Boolean> deleteList(@RequestParam("ids") List<Long> ids) {
|
||||
riskAssessmentService.deleteRiskAssessmentListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "查询危险评估详情")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:query')")
|
||||
public CommonResult<RiskAssessmentRespVO> get(@RequestParam("id") Long id) {
|
||||
RiskAssessmentRespVO respVO = riskAssessmentService.getRiskAssessment(id);
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "分页查询危险评估")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:query')")
|
||||
public CommonResult<PageResult<RiskAssessmentRespVO>> page(@Valid RiskAssessmentPageReqVO pageReqVO) {
|
||||
PageResult<RiskAssessmentRespVO> voResult = riskAssessmentService.getRiskAssessmentPage(pageReqVO);
|
||||
return success(voResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出危险评估 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('prison:risk-assessment:export')")
|
||||
public void exportExcel(@Valid RiskAssessmentPageReqVO pageReqVO,
|
||||
HttpServletResponse response) {
|
||||
try {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RiskAssessmentRespVO> list = riskAssessmentService.getRiskAssessmentPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "危险评估.xls", "危险评估数据", RiskAssessmentRespVO.class, list);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("导出失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -21,6 +21,9 @@ public class RiskAssessmentPageReqVO extends PageParam {
|
||||
@Schema(description = "罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "罪犯姓名", example = "张三")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "评估类型:1-入狱评估 2-定期评估 3-专项评估", example = "2")
|
||||
private Integer assessmentType;
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 危险评估 Response VO")
|
||||
@ -26,12 +27,17 @@ public class RiskAssessmentRespVO {
|
||||
@ExcelProperty("罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "罪犯姓名", example = "张三")
|
||||
@ExcelProperty("罪犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "评估类型:1-入狱评估 2-定期评估 3-专项评估", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("评估类型:1-入狱评估 2-定期评估 3-专项评估")
|
||||
private Integer assessmentType;
|
||||
|
||||
@Schema(description = "评估日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("评估日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
|
||||
private LocalDate assessmentDate;
|
||||
|
||||
@Schema(description = "暴力倾向得分")
|
||||
@ -72,6 +78,7 @@ public class RiskAssessmentRespVO {
|
||||
|
||||
@Schema(description = "下次评估日期")
|
||||
@ExcelProperty("下次评估日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
|
||||
private LocalDate nextAssessmentDate;
|
||||
|
||||
@Schema(description = "状态:1-待审核 2-已通过", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ -84,6 +91,7 @@ public class RiskAssessmentRespVO {
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -39,7 +39,7 @@ public class RiskAssessmentSaveReqVO {
|
||||
@Schema(description = "自杀倾向得分")
|
||||
private BigDecimal suicideScore;
|
||||
|
||||
@Schema(description = "综合得分")
|
||||
@Schema(description = "综合得分", hidden = true)
|
||||
private BigDecimal totalScore;
|
||||
|
||||
@Schema(description = "风险等级:1-低风险 2-中风险 3-高风险 4-极高风险", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
|
||||
@ -17,7 +17,6 @@ import java.io.IOException;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
@ -26,7 +25,6 @@ import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.score.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.score.ScoreDO;
|
||||
import cn.iocoder.yudao.module.prison.service.score.ScoreService;
|
||||
|
||||
@Tag(name = "管理后台 - 计分考核")
|
||||
@ -76,16 +74,14 @@ public class PrisonScoreController {
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('prison:score:query')")
|
||||
public CommonResult<ScoreRespVO> getScore(@RequestParam("id") Long id) {
|
||||
ScoreDO score = scoreService.getScore(id);
|
||||
return success(BeanUtils.toBean(score, ScoreRespVO.class));
|
||||
return success(scoreService.getScore(id));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得计分考核分页")
|
||||
@PreAuthorize("@ss.hasPermission('prison:score:query')")
|
||||
public CommonResult<PageResult<ScoreRespVO>> getScorePage(@Valid ScorePageReqVO pageReqVO) {
|
||||
PageResult<ScoreDO> pageResult = scoreService.getScorePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ScoreRespVO.class));
|
||||
return success(scoreService.getScorePage(pageReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@ -95,10 +91,9 @@ public class PrisonScoreController {
|
||||
public void exportScoreExcel(@Valid ScorePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ScoreDO> list = scoreService.getScorePage(pageReqVO).getList();
|
||||
List<ScoreRespVO> list = scoreService.getScorePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "计分考核.xls", "数据", ScoreRespVO.class,
|
||||
BeanUtils.toBean(list, ScoreRespVO.class));
|
||||
ExcelUtils.write(response, "计分考核.xls", "数据", ScoreRespVO.class, list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -20,6 +20,15 @@ public class ScorePageReqVO extends PageParam {
|
||||
@Schema(description = "罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "罪犯姓名", example = "张三")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "监区ID", example = "1")
|
||||
private Long prisonAreaId;
|
||||
|
||||
@Schema(description = "监室ID", example = "1")
|
||||
private Long prisonCellId;
|
||||
|
||||
@Schema(description = "考核年份")
|
||||
private Integer year;
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 计分考核 Response VO")
|
||||
@ -25,6 +26,24 @@ public class ScoreRespVO {
|
||||
@ExcelProperty("罪犯编号")
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "罪犯姓名", example = "张三")
|
||||
@ExcelProperty("罪犯姓名")
|
||||
private String prisonerName;
|
||||
|
||||
@Schema(description = "监区ID", example = "1")
|
||||
private Long prisonAreaId;
|
||||
|
||||
@Schema(description = "监区名称", example = "一监区")
|
||||
@ExcelProperty("监区")
|
||||
private String prisonAreaName;
|
||||
|
||||
@Schema(description = "监室ID", example = "1")
|
||||
private Long prisonCellId;
|
||||
|
||||
@Schema(description = "监室名称", example = "101监室")
|
||||
@ExcelProperty("监室")
|
||||
private String prisonCellName;
|
||||
|
||||
@Schema(description = "考核年份", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("考核年份")
|
||||
private Integer year;
|
||||
@ -71,6 +90,12 @@ public class ScoreRespVO {
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@ -5,6 +5,7 @@ import lombok.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 考核记录明细 Response VO
|
||||
@ -27,6 +28,7 @@ public class ScoreDetailRespVO {
|
||||
private String prisonerNo;
|
||||
|
||||
@Schema(description = "记录日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
|
||||
private LocalDate recordDate;
|
||||
|
||||
@Schema(description = "规则ID")
|
||||
@ -60,6 +62,7 @@ public class ScoreDetailRespVO {
|
||||
private String statusName;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
||||
@ -5,6 +5,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.prison.controller.admin.scorerule.vo.*;
|
||||
import cn.iocoder.yudao.module.prison.dal.dataobject.scorerule.ScoreRuleDO;
|
||||
import cn.iocoder.yudao.module.prison.enums.ScoreRuleCategoryEnum;
|
||||
import cn.iocoder.yudao.module.prison.enums.ScoreRuleStatusEnum;
|
||||
import cn.iocoder.yudao.module.prison.service.scorerule.ScoreRuleService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@ -70,7 +72,7 @@ public class ScoreRuleController {
|
||||
@PreAuthorize("@ss.hasPermission('prison:score-rule:query')")
|
||||
public CommonResult<ScoreRuleRespVO> getScoreRule(@RequestParam("id") Long id) {
|
||||
ScoreRuleDO scoreRule = scoreRuleService.getScoreRule(id);
|
||||
return success(BeanUtils.toBean(scoreRule, ScoreRuleRespVO.class));
|
||||
return success(convertToRespVO(scoreRule));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@ -79,7 +81,7 @@ public class ScoreRuleController {
|
||||
public CommonResult<PageResult<ScoreRuleRespVO>> getScoreRulePage(@Valid ScoreRulePageReqVO pageReqVO) {
|
||||
PageResult<ScoreRuleDO> pageResult = scoreRuleService.getScoreRulePage(pageReqVO);
|
||||
List<ScoreRuleRespVO> list = pageResult.getList().stream()
|
||||
.map(item -> BeanUtils.toBean(item, ScoreRuleRespVO.class))
|
||||
.map(this::convertToRespVO)
|
||||
.collect(Collectors.toList());
|
||||
return success(new PageResult<>(list, pageResult.getTotal()));
|
||||
}
|
||||
@ -91,8 +93,21 @@ public class ScoreRuleController {
|
||||
@RequestParam("category") Integer category) {
|
||||
List<ScoreRuleDO> list = scoreRuleService.getScoreRuleListByCategory(category);
|
||||
return success(list.stream()
|
||||
.map(item -> BeanUtils.toBean(item, ScoreRuleRespVO.class))
|
||||
.map(this::convertToRespVO)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将 DO 转换为 RespVO,并填充枚举名称
|
||||
*/
|
||||
private ScoreRuleRespVO convertToRespVO(ScoreRuleDO scoreRule) {
|
||||
if (scoreRule == null) {
|
||||
return null;
|
||||
}
|
||||
ScoreRuleRespVO respVO = BeanUtils.toBean(scoreRule, ScoreRuleRespVO.class);
|
||||
respVO.setCategoryName(ScoreRuleCategoryEnum.getName(scoreRule.getCategory()));
|
||||
respVO.setStatusName(ScoreRuleStatusEnum.getName(scoreRule.getStatus()));
|
||||
return respVO;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user