@@ -101,14 +101,14 @@ public class InspectionFile extends BaseEntity { | |||
private String gaodeAddress; | |||
/** | |||
* 问题类型二级分类ID | |||
* 图片来源:1AI 2后台 3视频 | |||
*/ | |||
private String questionId; | |||
private Integer source; | |||
/** | |||
* 图片来源:1AI 2后台 3视频 | |||
* 问题类型二级分类ID | |||
*/ | |||
private Integer source; | |||
private String questionCode; | |||
/** | |||
* 问题名称 | |||
@@ -118,7 +118,7 @@ public class InspectionFile extends BaseEntity { | |||
/** | |||
* 巡检内容 | |||
*/ | |||
private String content; | |||
private String questionContent; | |||
/** | |||
* 详细描述 |
@@ -149,6 +149,7 @@ public class UpdateFlightStatusService { | |||
private LiveChannel buildLiveChannel(Inspection inspection, DspCallbackVo dspCallbackVo) { | |||
LiveChannel liveChannel = new LiveChannel(); | |||
liveChannel.setTenantId(inspection.getTenantId()); | |||
liveChannel.setDeptId(inspection.getDeptId()); | |||
liveChannel.setInspectionId(inspection.getId()); | |||
liveChannel.setChannelCode("0"); | |||
liveChannel.setPushUrl(dspCallbackVo.getPushUrl()); |
@@ -146,8 +146,10 @@ public class InspectionFileServiceImpl implements IInspectionFileService { | |||
} | |||
vo.setName(inspection.getName()); | |||
//问题类型 | |||
if (StringUtils.isNotEmpty(x.getQuestionId())) { | |||
QuestionType questionType = questionTypeMapper.selectById(x.getQuestionId()); | |||
if (StringUtils.isNotEmpty(x.getQuestionCode())) { | |||
QuestionType questionType = questionTypeMapper.selectOne(new LambdaQueryWrapper<QuestionType>() | |||
.eq(QuestionType::getMark, 1) | |||
.eq(QuestionType::getCode, x.getQuestionCode())); | |||
if (null != questionType) { | |||
vo.setCode(questionType.getCode()); | |||
vo.setContent(questionType.getContent()); | |||
@@ -212,13 +214,13 @@ public class InspectionFileServiceImpl implements IInspectionFileService { | |||
JsonResult.error(ListByDeptUserTypeEnum.INSPECTION_TYPE_LIST_IS_NULL.getCode(),ListByDeptUserTypeEnum.INSPECTION_TYPE_LIST_IS_NULL.getMsg()); | |||
} | |||
for (InspectionFile inspectionFile : inspectionFileList) { | |||
if(StringUtils.isEmpty(inspectionFile.getQuestionId())){ | |||
if(StringUtils.isEmpty(inspectionFile.getQuestionCode())){ | |||
JsonResult.error(ListByDeptUserTypeEnum.QUESTION_ID_IS_NULL.getCode(),ListByDeptUserTypeEnum.QUESTION_ID_IS_NULL.getMsg()); | |||
} | |||
//查找问题类型 | |||
QuestionType questionType = questionTypeMapper.selectOne(Wrappers.<QuestionType>lambdaQuery() | |||
.eq(QuestionType::getMark, 1) | |||
.eq(QuestionType::getId, inspectionFile.getQuestionId())); | |||
.eq(QuestionType::getCode, inspectionFile.getQuestionCode())); | |||
if(ObjectUtil.isNull(questionType)){ | |||
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); | |||
} | |||
@@ -282,13 +284,13 @@ public class InspectionFileServiceImpl implements IInspectionFileService { | |||
JsonResult.error(ListByDeptUserTypeEnum.INSPECTION_TYPE_LIST_IS_NULL.getCode(),ListByDeptUserTypeEnum.INSPECTION_TYPE_LIST_IS_NULL.getMsg()); | |||
} | |||
for (InspectionFile inspectionFile : inspectionFileList) { | |||
if(StringUtils.isEmpty(inspectionFile.getQuestionId())){ | |||
if(StringUtils.isEmpty(inspectionFile.getQuestionCode())){ | |||
JsonResult.error(ListByDeptUserTypeEnum.QUESTION_ID_IS_NULL.getCode(),ListByDeptUserTypeEnum.QUESTION_ID_IS_NULL.getMsg()); | |||
} | |||
//查找问题类型 | |||
QuestionType questionType = questionTypeMapper.selectOne(Wrappers.<QuestionType>lambdaQuery() | |||
.eq(QuestionType::getMark, 1) | |||
.eq(QuestionType::getId, inspectionFile.getQuestionId())); | |||
.eq(QuestionType::getCode, inspectionFile.getQuestionCode())); | |||
if(ObjectUtil.isNull(questionType)){ | |||
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); | |||
} |
@@ -111,13 +111,13 @@ public class QueryInspectionFileHandleByInspectionFileIdService { | |||
} | |||
QuestionType questionType = questionTypeMapper.selectOne(new LambdaQueryWrapper<QuestionType>() | |||
.eq(QuestionType::getId, inspectionFile.getQuestionId()) | |||
.eq(QuestionType::getCode, inspectionFile.getQuestionCode()) | |||
.eq(QuestionType::getMark, 1)); | |||
if (null != questionType) { | |||
inspectionFileHandleVo.setQuestionName(questionType.getName()); | |||
inspectionFileHandleVo.setQuestionContent(questionType.getContent()); | |||
} | |||
inspectionFileHandleVo.setQuestionId(inspectionFile.getQuestionId()); | |||
inspectionFileHandleVo.setQuestionCode(inspectionFile.getQuestionCode()); | |||
inspectionFileHandleVo.setFileThumbnail(CommonConfig.imageURL + inspectionFile.getFileThumbnail()); | |||
return inspectionFileHandleVo; | |||
} |
@@ -154,9 +154,9 @@ public class QueryInspectionFilePageListByWorkOrderIdService { | |||
inspectionFileHandleVo.setLocation(inspectionFile.getLocation()); | |||
inspectionFileHandleVo.setFileThumbnail(CommonConfig.imageURL + inspectionFile.getFileThumbnail()); | |||
questionType = questionTypeMap.get(inspectionFile.getQuestionId()); | |||
questionType = questionTypeMap.get(inspectionFile.getQuestionCode()); | |||
if (null != questionType) { | |||
inspectionFileHandleVo.setQuestionId(questionType.getId()); | |||
inspectionFileHandleVo.setQuestionCode(questionType.getCode()); | |||
inspectionFileHandleVo.setQuestionName(questionType.getName()); | |||
inspectionFileHandleVo.setQuestionContent(questionType.getContent()); | |||
} | |||
@@ -200,7 +200,7 @@ public class QueryInspectionFilePageListByWorkOrderIdService { | |||
private Map<String, QuestionType> getQuestionTypeMap() { | |||
List<QuestionType> questionTypeList = questionTypeMapper.selectList(new LambdaQueryWrapper<QuestionType>() | |||
.eq(QuestionType::getMark, 1)); | |||
Map<String, QuestionType> questionTypeMap = questionTypeList.stream().collect(Collectors.toMap(QuestionType::getId, Function.identity())); | |||
Map<String, QuestionType> questionTypeMap = questionTypeList.stream().collect(Collectors.toMap(QuestionType::getCode, Function.identity())); | |||
return questionTypeMap; | |||
} | |||
@@ -48,7 +48,7 @@ public class UpdateInspectionFileQuestionTypeService { | |||
QuestionType questionType = (QuestionType) result.getData(); | |||
InspectionFile inspectionFile = new InspectionFile(); | |||
inspectionFile.setId(id); | |||
inspectionFile.setQuestionId(questionType.getId()); | |||
inspectionFile.setQuestionCode(questionType.getCode()); | |||
inspectionFile.setUpdateUser(userId); | |||
inspectionFile.setUpdateTime(DateUtils.now()); | |||
Integer rowId = inspectionFileMapper.updateById(inspectionFile); |
@@ -214,7 +214,7 @@ public class GenerateReportWordService { | |||
Cell questionTypeCell; | |||
for (int i = 0; i < questionTypeList.size(); i++) { | |||
questionType = questionTypeList.get(i); | |||
String count = this.getCount(report.getInspectionId(), questionType.getId()); | |||
String count = this.getCount(report.getInspectionId(), questionType.getCode()); | |||
questionTypeContentCell = this.getCell(font, questionType.getContent()); | |||
questionTypeCell = this.getCell(font, count); | |||
table.addCell(questionTypeContentCell); | |||
@@ -231,10 +231,10 @@ public class GenerateReportWordService { | |||
return cell; | |||
} | |||
private String getCount(String inspectionId, String questionTypeId) { | |||
private String getCount(String inspectionId, String questionCode) { | |||
Integer count = inspectionFileMapper.selectCount(new LambdaQueryWrapper<InspectionFile>() | |||
.eq(InspectionFile::getInspectionId, inspectionId) | |||
.eq(InspectionFile::getQuestionId, questionTypeId) | |||
.eq(InspectionFile::getQuestionCode, questionCode) | |||
.eq(InspectionFile::getMark, 1)); | |||
return Integer.toString(count); | |||
} |
@@ -133,7 +133,7 @@ public class QueryInspectionReportService { | |||
for (int i = 0; i < questionTypeList.size(); i++) { | |||
inspectionResultVo = new InspectionResultVo(); | |||
questionType = questionTypeList.get(i); | |||
Integer count = this.getCount(report.getInspectionId(), questionType.getId()); | |||
Integer count = this.getCount(report.getInspectionId(), questionType.getCode()); | |||
inspectionResultVo.setQuestionTypeContent(questionType.getContent()); | |||
inspectionResultVo.setCount(count); | |||
inspectionResultVoList.add(inspectionResultVo); | |||
@@ -141,10 +141,10 @@ public class QueryInspectionReportService { | |||
return inspectionResultVoList; | |||
} | |||
private Integer getCount(String inspectionId, String questionTypeId) { | |||
private Integer getCount(String inspectionId, String questionCode) { | |||
Integer count = inspectionFileMapper.selectCount(new LambdaQueryWrapper<InspectionFile>() | |||
.eq(InspectionFile::getInspectionId, inspectionId) | |||
.eq(InspectionFile::getQuestionId, questionTypeId) | |||
.eq(InspectionFile::getQuestionCode, questionCode) | |||
.eq(InspectionFile::getMark, 1)); | |||
return count; | |||
} |
@@ -160,7 +160,9 @@ public class DspCallbackServiceImpl implements IDspCallbackService { | |||
// 对象属性拷贝 | |||
BeanUtils.copyProperties(questionFile, inspectionFile); | |||
//问题编号 | |||
inspectionFile.setQuestionId(questionFile.getQuestionCode()); | |||
inspectionFile.setQuestionCode(questionFile.getQuestionCode()); | |||
// 问题名称 | |||
inspectionFile.setQuestionContent(questionFile.getQuestionName()); | |||
inspectionFile.setTenantId(inspection.getTenantId()); | |||
inspectionFile.setInspectionId(inspectionId); | |||
// 文件类型 | |||
@@ -183,8 +185,7 @@ public class DspCallbackServiceImpl implements IDspCallbackService { | |||
fileMarkerUrl = fileMarkerUrl.replaceAll(CommonConfig.imageURL, ""); | |||
} | |||
inspectionFile.setFileImage(fileMarkerUrl); | |||
// 问题名称 | |||
inspectionFile.setQuestionName(questionFile.getQuestionName()); | |||
// 问题图片审核状态 | |||
inspectionFile.setStatus(QuestionEnum.NOTREVIEWED.getCode()); | |||
// 问题图片来源 |
@@ -24,7 +24,7 @@ public class InspectionFileHandleVo { | |||
/** | |||
* 问题类型:1坑槽,2积水,3裂缝 | |||
*/ | |||
private String questionId; | |||
private String questionCode; | |||
/** | |||
* 问题名称:1坑槽,2积水,3裂缝 |