|
|
@ -86,7 +86,6 @@ public class DfRecordService extends BaseService<DfRecordMapper, DfRecord> { |
|
|
|
if (record == null) { |
|
|
|
throw new DfException("巡查记录不能为空"); |
|
|
|
} |
|
|
|
record.setStatus(getStatus(dto)); |
|
|
|
int rsp = getBaseMapper().insert(record); |
|
|
|
if (rsp <= 0) { |
|
|
|
throw new DfException("新增巡查记录失败"); |
|
|
@ -113,18 +112,6 @@ public class DfRecordService extends BaseService<DfRecordMapper, DfRecord> { |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
private String getStatus(DfRecordDetailDto dto) { |
|
|
|
if (CollectionUtil.isNotEmpty(dto.getItems())) { |
|
|
|
if (dto.getItems().stream().anyMatch(o -> o.getHandleImages().isEmpty())) { |
|
|
|
return RecordStatus.CHECKING.getValue().toString(); |
|
|
|
} else { |
|
|
|
return RecordStatus.FINISHED.getValue().toString(); |
|
|
|
} |
|
|
|
} |
|
|
|
return RecordStatus.CHECKING.getValue().toString(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public DfRecordDetailDto getDetailById(String id) { |
|
|
|
DfRecord record = this.getBaseMapper().selectById(id); |
|
|
|
if (record != null) { |
|
|
|