Browse Source

Merge branch 'develop' of gitadmin/tuoheng_telecomumale into release

tags/v1.0.0^2
wanjing 1 year ago
parent
commit
20fca11496
4 changed files with 16 additions and 7 deletions
  1. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/code/inspectionfilehandle/InspectionFileProcessingCodeEnum.java
  2. +10
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/processing/InspectionFileProcessingService.java
  3. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/export/ExportInspectionHandleReportService.java
  4. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/export/ExportInspectionReportService.java

+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/code/inspectionfilehandle/InspectionFileProcessingCodeEnum.java View File

WORK_ORDER_ID_IS_NULL(1250101, "工单id为空"), WORK_ORDER_ID_IS_NULL(1250101, "工单id为空"),
WORK_ORDER_IS_NOT_EXIST(1250102, "工单不存在"), WORK_ORDER_IS_NOT_EXIST(1250102, "工单不存在"),
INSPECTION_FILE_ID_IS_NULL(1250103, "任务问题id为空"), INSPECTION_FILE_ID_IS_NULL(1250103, "任务问题id为空"),
INSPECTION_FILE_IS_NOT_EXIST(1250104, "任务问题不存在");
INSPECTION_FILE_IS_NOT_EXIST(1250104, "任务问题不存在"),
INSPECTION_FILE_Handle_IS_EXIST(1250105, "该问题已处理");


/** /**
* 错误码 * 错误码

+ 10
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/processing/InspectionFileProcessingService.java View File

package com.tuoheng.admin.service.inspectionfile.processing; package com.tuoheng.admin.service.inspectionfile.processing;


import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.*; import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.InspectionFileStatusEnum; import com.tuoheng.admin.enums.InspectionFileStatusEnum;
WorkOrder workOrder = workOrderMapper.selectOne(new LambdaQueryWrapper<WorkOrder>() WorkOrder workOrder = workOrderMapper.selectOne(new LambdaQueryWrapper<WorkOrder>()
.eq(WorkOrder::getId, request.getWorkOrderId()) .eq(WorkOrder::getId, request.getWorkOrderId())
.eq(WorkOrder::getMark, MarkEnum.VALID.getCode())); .eq(WorkOrder::getMark, MarkEnum.VALID.getCode()));
if (null == workOrder) {
if (ObjectUtil.isEmpty(workOrder)) {
return JsonResult.error(InspectionFileProcessingCodeEnum.WORK_ORDER_IS_NOT_EXIST.getCode(), InspectionFileProcessingCodeEnum.WORK_ORDER_IS_NOT_EXIST.getMsg()); return JsonResult.error(InspectionFileProcessingCodeEnum.WORK_ORDER_IS_NOT_EXIST.getCode(), InspectionFileProcessingCodeEnum.WORK_ORDER_IS_NOT_EXIST.getMsg());
} }
// 判断任务问题id是否为空 // 判断任务问题id是否为空
InspectionFile inspectionFile = inspectionFileMapper.selectOne(new LambdaQueryWrapper<InspectionFile>() InspectionFile inspectionFile = inspectionFileMapper.selectOne(new LambdaQueryWrapper<InspectionFile>()
.eq(InspectionFile::getId, request.getInspectionFileId()) .eq(InspectionFile::getId, request.getInspectionFileId())
.eq(InspectionFile::getMark, MarkEnum.VALID.getCode())); .eq(InspectionFile::getMark, MarkEnum.VALID.getCode()));
if (null == inspectionFile) {
if (ObjectUtil.isEmpty(inspectionFile)) {
log.info("任务问题不存在,inspectionFileId:{}", request.getInspectionFileId()); log.info("任务问题不存在,inspectionFileId:{}", request.getInspectionFileId());
return JsonResult.error(InspectionFileProcessingCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getCode(), InspectionFileProcessingCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getMsg()); return JsonResult.error(InspectionFileProcessingCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getCode(), InspectionFileProcessingCodeEnum.INSPECTION_FILE_IS_NOT_EXIST.getMsg());
} }
InspectionFileHandle inspectionFileHandle = inspectionFileHandleMapper.selectOne(new LambdaQueryWrapper<InspectionFileHandle>()
.eq(InspectionFileHandle::getInspectionFileId, request.getInspectionFileId())
.eq(InspectionFileHandle::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtil.isNotEmpty(inspectionFileHandle)) {
log.info("该问题已处理,不能重复提交,inspectionFileHandleId:{}", inspectionFileHandle.getId());
return JsonResult.error(InspectionFileProcessingCodeEnum.INSPECTION_FILE_Handle_IS_EXIST.getCode(), InspectionFileProcessingCodeEnum.INSPECTION_FILE_Handle_IS_EXIST.getMsg());
}
return JsonResult.success(inspectionFile); return JsonResult.success(inspectionFile);
} }



+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/export/ExportInspectionHandleReportService.java View File



// 生成word // 生成word
String areaName = this.getAreaName(); String areaName = this.getAreaName();
String titleName = areaName + "航道巡检处理报告";
String titleName = areaName + "城管巡检处理报告";
File f = new File(filePath); File f = new File(filePath);
if (!f.exists() || f.length() < 1000) { if (!f.exists() || f.length() < 1000) {
result = generateReportWordService.buildWord(filePath, titleName, report, inspectionFileList, inspectionFileHandleList); result = generateReportWordService.buildWord(filePath, titleName, report, inspectionFileList, inspectionFileHandleList);
} }


// 下载 // 下载
String fileName = this.getAreaName() + "航道巡检处理报告【" + report.getReportCode() + "】.doc";
String fileName = this.getAreaName() + "城管巡检处理报告【" + report.getReportCode() + "】.doc";
DownloadUtil.download(response, filePath, fileName); DownloadUtil.download(response, filePath, fileName);


return JsonResult.success(); return JsonResult.success();

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/export/ExportInspectionReportService.java View File



// 生成word // 生成word
String areaName = this.getAreaName(); String areaName = this.getAreaName();
String titleName = areaName + "航道巡检报告";
String titleName = areaName + "城管巡检报告";
File f = new File(filePath); File f = new File(filePath);
if (!f.exists() || f.length() < 1000) { if (!f.exists() || f.length() < 1000) {
result = generateReportWordService.buildWord(filePath, titleName, report, inspectionFileList, null); result = generateReportWordService.buildWord(filePath, titleName, report, inspectionFileList, null);
} }


// 下载 // 下载
String fileName = this.getAreaName() + "航道巡检报告【" + report.getReportCode() + "】.doc";
String fileName = this.getAreaName() + "城管巡检报告【" + report.getReportCode() + "】.doc";
DownloadUtil.download(response, filePath, fileName); DownloadUtil.download(response, filePath, fileName);


return JsonResult.success(); return JsonResult.success();

Loading…
Cancel
Save