diff --git a/src/main/java/com/biutag/supervision/controller/mobileSupervision/PhotoController.java b/src/main/java/com/biutag/supervision/controller/mobileSupervision/PhotoController.java index 54e25c8..3a55ff9 100644 --- a/src/main/java/com/biutag/supervision/controller/mobileSupervision/PhotoController.java +++ b/src/main/java/com/biutag/supervision/controller/mobileSupervision/PhotoController.java @@ -66,6 +66,7 @@ public class PhotoController { String filePath = fileService.upload(is, is.available(), StrUtil.isNotBlank(extName)? extName : "png"); SupPhoto photo = new SupPhoto(); photo.setFilePath(filePath); + photo.setFileName(file.getOriginalFilename()); photo.setCreateTime(LocalDateTime.now()); photo.setDate(LocalDate.now().toString()); UserAuth user = UserContextHolder.getCurrentUser(); @@ -76,4 +77,10 @@ public class PhotoController { return Result.success(photo); } + @DeleteMapping("{id}") + public Result del(@PathVariable Integer id) { + photoService.removeById(id); + return Result.success(); + } + } diff --git a/src/main/java/com/biutag/supervision/controller/mobileSupervision/TaskProblemController.java b/src/main/java/com/biutag/supervision/controller/mobileSupervision/TaskProblemController.java index 1f6e3bf..2def810 100644 --- a/src/main/java/com/biutag/supervision/controller/mobileSupervision/TaskProblemController.java +++ b/src/main/java/com/biutag/supervision/controller/mobileSupervision/TaskProblemController.java @@ -2,6 +2,8 @@ package com.biutag.supervision.controller.mobileSupervision; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson2.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.dto.TaskProblemDto; @@ -27,7 +29,9 @@ public class TaskProblemController { @GetMapping public Result> page(TaskProblemQueryParam queryParam) { - Page page = taskProblemService.page(Page.of(queryParam.getCurrent(), queryParam.getSize())); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.orderByDesc(SupTaskProblem::getCreateTime); + Page page = taskProblemService.page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); page.getRecords().forEach(item -> { if (StrUtil.isNotBlank(item.getPeoples())) { item.setPeoples(JSON.parseArray(item.getPeoples(), SupTaskPerson.class).stream().map(SupTaskPerson::getName).collect(Collectors.joining("、"))); diff --git a/src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java b/src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java index c174d0b..bf41bb7 100644 --- a/src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java +++ b/src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java @@ -68,9 +68,6 @@ public class TestingAlcoholController { return Result.success(taskTestingAlcoholService.getDetailFun(taskId)); } - - - @GetMapping("getPersonNumber") public Result> getPersonNumber(TestingAlcoholFilter condition) { List departIds = departService.getAllNodeIds(condition.getDepartId()); diff --git a/src/main/java/com/biutag/supervision/pojo/dto/SupRiskPersonalSupRecordDto.java b/src/main/java/com/biutag/supervision/pojo/dto/SupRiskPersonalSupRecordDto.java index c95e4d9..8cb814b 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/SupRiskPersonalSupRecordDto.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/SupRiskPersonalSupRecordDto.java @@ -33,10 +33,9 @@ public class SupRiskPersonalSupRecordDto { private String supDesc; //督察时间 - @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss") private LocalDateTime supTime; - // 检测照片 private List files = new ArrayList<>(); diff --git a/src/main/java/com/biutag/supervision/service/SupTaskProblemService.java b/src/main/java/com/biutag/supervision/service/SupTaskProblemService.java index 79785a9..bb03265 100644 --- a/src/main/java/com/biutag/supervision/service/SupTaskProblemService.java +++ b/src/main/java/com/biutag/supervision/service/SupTaskProblemService.java @@ -1,6 +1,7 @@ package com.biutag.supervision.service; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.biutag.supervision.constants.enums.DistributionStateEnum; @@ -8,9 +9,11 @@ import com.biutag.supervision.constants.enums.TaskStatusEnum; import com.biutag.supervision.constants.enums.TaskTypeEnum; import com.biutag.supervision.mapper.SupTaskProblemMapper; import com.biutag.supervision.pojo.dto.TaskProblemDto; +import com.biutag.supervision.pojo.entity.SupPhoto; import com.biutag.supervision.pojo.entity.SupTask; import com.biutag.supervision.pojo.entity.SupTaskProblem; import com.biutag.supervision.pojo.entity.SupTaskSelfexaminationContent; +import com.biutag.supervision.pojo.vo.FileVo; import com.biutag.supervision.util.JSON; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; @@ -29,6 +32,8 @@ public class SupTaskProblemService extends ServiceImpl().eq(SupPhoto::getId, file.getId()).set(SupPhoto::getIsUse, true)); + } + } + } return save(problem); }