ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckResult.java
@@ -48,5 +48,9 @@ @TableField("check_time") private LocalDateTime checkTime; @ApiModelProperty("是否发布") @TableField("publish") private Integer publish; } ycl-pojo/src/main/java/com/ycl/platform/domain/form/CheckResultForm.java
@@ -51,6 +51,9 @@ @ApiModelProperty("考核时间") private LocalDateTime checkTime; @ApiModelProperty("是否发布") private Integer publish; public static CheckResult getEntityByForm(@NonNull CheckResultForm form, CheckResult entity) { if(entity == null) { entity = new CheckResult(); ycl-pojo/src/main/java/com/ycl/platform/domain/vo/CheckResultVO.java
@@ -50,6 +50,9 @@ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime checkTime; /** 是否发布 */ private Integer publish; public static CheckResultVO getVoByEntity(@NonNull CheckResult entity, CheckResultVO vo) { if(vo == null) { vo = new CheckResultVO(); ycl-server/src/main/java/com/ycl/platform/controller/CheckResultController.java
@@ -50,6 +50,12 @@ return checkResultService.removeById(id); } @PutMapping("/publish/{id}") @ApiOperation(value = "ID发布", notes = "ID发布") public Result publishById(@PathVariable("id") String id) { return checkResultService.publishById(id); } @DeleteMapping("/batch") @ApiOperation(value = "批量删除", notes = "批量删除") public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { ycl-server/src/main/java/com/ycl/platform/service/CheckResultService.java
@@ -70,4 +70,12 @@ * @return */ Result manualScore(ManualScoreForm form); /** * id发布 * @param id * @return */ Result publishById(String id); } ycl-server/src/main/java/com/ycl/platform/service/impl/CheckResultServiceImpl.java
@@ -1,5 +1,6 @@ package com.ycl.platform.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ycl.exception.ServiceException; import com.ycl.platform.domain.entity.CheckResult; import com.ycl.platform.domain.form.ManualScoreForm; @@ -151,4 +152,15 @@ baseMapper.updateById(checkResult); return Result.ok(); } @Override public Result publishById(String id) { CheckResult checkResult = new CheckResult(); checkResult.setId(Integer.valueOf(id)); checkResult.setPublish(1); if(baseMapper.updateById(checkResult) > 0) { return Result.ok("发布成功"); } return Result.error("发布失败"); } } ycl-server/src/main/resources/mapper/zgyw/CheckResultMapper.xml
@@ -15,6 +15,7 @@ <result column="check_time" property="checkTime" /> <result column="frequency" property="frequency" /> <result column="examine_range" property="examineRange" /> <result column="publish" property="publish" /> </resultMap> <select id="page" resultMap="BaseResultMap"> @@ -27,7 +28,8 @@ tcr.check_time, tcr.check_score, tcr.system_score, tcr.manual_score tcr.manual_score, tcr.publish FROM t_check_result tcr INNER JOIN t_check_publish tcp ON tcr.check_publish_id = tcp.id