|
|
|
|
@ -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<SupTaskProblemMapper, Sup
|
|
|
|
|
|
|
|
|
|
private final SupDepartService departService; |
|
|
|
|
|
|
|
|
|
private final SupPhotoService photoService; |
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public boolean save(TaskProblemDto dto) { |
|
|
|
|
SupTaskProblem problem = new SupTaskProblem(); |
|
|
|
|
@ -61,7 +66,14 @@ public class SupTaskProblemService extends ServiceImpl<SupTaskProblemMapper, Sup
|
|
|
|
|
// 问题随拍
|
|
|
|
|
problem.setTaskType(TaskTypeEnum.problem_shooting.name()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 更新照片
|
|
|
|
|
if (CollectionUtil.isNotEmpty(dto.getFiles())) { |
|
|
|
|
for (FileVo file : dto.getFiles()) { |
|
|
|
|
if (StrUtil.isNotBlank(file.getId())) { |
|
|
|
|
photoService.update(new LambdaUpdateWrapper<SupPhoto>().eq(SupPhoto::getId, file.getId()).set(SupPhoto::getIsUse, true)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return save(problem); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|