Browse Source

1、修改任务类型字段;2、添加通道deptId;

tags/v1.0.0^2
wanjing 1 year ago
parent
commit
1fcb0b687e
10 changed files with 31 additions and 27 deletions
  1. +5
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/InspectionFile.java
  2. +1
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateFlightStatusService.java
  3. +8
    -6
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/InspectionFileServiceImpl.java
  4. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/handle/QueryInspectionFileHandleByInspectionFileIdService.java
  5. +3
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/query/QueryInspectionFilePageListByWorkOrderIdService.java
  6. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/update/UpdateInspectionFileQuestionTypeService.java
  7. +3
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/export/GenerateReportWordService.java
  8. +3
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionReportService.java
  9. +4
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.java
  10. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionFileHandleVo.java

+ 5
- 5
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/InspectionFile.java View File

@@ -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;
/**
* 详细描述

+ 1
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/update/status/UpdateFlightStatusService.java View File

@@ -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());

+ 8
- 6
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/InspectionFileServiceImpl.java View File

@@ -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);
}

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/handle/QueryInspectionFileHandleByInspectionFileIdService.java View File

@@ -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;
}

+ 3
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/query/QueryInspectionFilePageListByWorkOrderIdService.java View File

@@ -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;
}


+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/update/UpdateInspectionFileQuestionTypeService.java View File

@@ -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);

+ 3
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/export/GenerateReportWordService.java View File

@@ -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);
}

+ 3
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionReportService.java View File

@@ -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;
}

+ 4
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.java View File

@@ -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());
// 问题图片来源

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionFileHandleVo.java View File

@@ -24,7 +24,7 @@ public class InspectionFileHandleVo {
/**
* 问题类型:1坑槽,2积水,3裂缝
*/
private String questionId;
private String questionCode;

/**
* 问题名称:1坑槽,2积水,3裂缝

Loading…
Cancel
Save