Kaynağa Gözat

'问题管理数据源调整'

master
daixiantong 4 yıl önce
ebeveyn
işleme
4cbf11f999
2 değiştirilmiş dosya ile 49 ekleme ve 50 silme
  1. +49
    -4
      src/main/java/com/taauav/admin/service/impl/TauvInspectFileServiceImpl.java
  2. +0
    -46
      src/main/java/com/taauav/admin/service/impl/TauvReportServiceImpl.java

+ 49
- 4
src/main/java/com/taauav/admin/service/impl/TauvInspectFileServiceImpl.java Dosyayı Görüntüle

@@ -3,14 +3,11 @@ package com.taauav.admin.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.taauav.admin.mapper.*;
import com.taauav.admin.vo.TauvInspectFileDataVo;
import com.taauav.common.bean.Response;
import com.taauav.admin.dto.TauvInspectDriverPicDTO;
import com.taauav.admin.entity.*;
import com.taauav.admin.mapper.TauvInspectDriverMapper;
import com.taauav.admin.mapper.TauvInspectFileMapper;
import com.taauav.admin.mapper.TauvQuestionOptionsMapper;
import com.taauav.admin.mapper.TauvReportMapper;
import com.taauav.admin.service.*;
import com.taauav.common.service.impl.BaseServiceImpl;
import com.taauav.common.util.*;
@@ -62,6 +59,8 @@ public class TauvInspectFileServiceImpl extends BaseServiceImpl<TauvInspectFileM
private TauvQuestionOptionsMapper questionOptionsMapper;
@Autowired
private ISysCityService cityService;
@Autowired
private TauvInspectQuestionMapper inspectQuestionMapper;

/**
* 根据条件获取分页数据
@@ -786,6 +785,9 @@ public class TauvInspectFileServiceImpl extends BaseServiceImpl<TauvInspectFileM
report.setCreateTime(DateUtil.now());
report.setCreateUser(ShiroUtils.getAdminId());
reportMapper.insert(report);

// 问题数据入库
dealQuestionData(info);
return response.success("操作成功");
}

@@ -1167,4 +1169,47 @@ public class TauvInspectFileServiceImpl extends BaseServiceImpl<TauvInspectFileM
List<TauvInspectFile> inspectFileList = inspectFileMapper.selectList(queryWrapper);
return inspectFileList;
}

/**
* 问题管理数据处理
*
* @param inspectDriver
*/
private void dealQuestionData(TauvInspectDriver inspectDriver) {
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("mark", 1);
wrapper.eq("inspect_driver_id", inspectDriver.getId());
List<TauvInspectQuestion> questionList = inspectQuestionMapper.selectList(wrapper);
if (questionList.isEmpty()) {
wrapper.eq("is_review", 1);
wrapper.eq("is_effective", 1);
wrapper.eq("status", 1);
List<TauvInspectFile> fileList = list(wrapper);
if (fileList.size() > 0) {
for (TauvInspectFile item : fileList) {
TauvInspectQuestion question = new TauvInspectQuestion();
question.setInspectDriverId(inspectDriver.getId());
question.setInspectFileId(item.getId());
question.setQuestionNo(createQuestionNo());
question.setQuestionId(item.getQuestionId());
question.setCreateUser(ShiroUtils.getAdminId());
question.setCreateTime(DateUtil.now());
inspectQuestionMapper.insert(question);
}
}
}
}

/**
* 创建问题编号
*
* @return
*/
private String createQuestionNo() {
Calendar date = Calendar.getInstance();
String year = String.valueOf(date.get(Calendar.YEAR)).substring(2);
String month = String.format("%02d", date.get(Calendar.MONTH) + 1);
String code = "10" + year + month + (int) ((Math.random() * 9 + 1) * 100000);
return code;
}
}

+ 0
- 46
src/main/java/com/taauav/admin/service/impl/TauvReportServiceImpl.java Dosyayı Görüntüle

@@ -69,8 +69,6 @@ public class TauvReportServiceImpl extends BaseServiceImpl<TauvReportMapper, Tau
@Autowired
private TauvWaterWarnMapper waterWarnMapper;
@Autowired
private TauvInspectQuestionMapper inspectQuestionMapper;
@Autowired
private TauvInspectPhotoMapper inspectPhotoMapper;

/**
@@ -729,8 +727,6 @@ public class TauvReportServiceImpl extends BaseServiceImpl<TauvReportMapper, Tau
waterWarn.setCreateTime(DateUtil.now());
waterWarnMapper.insert(waterWarn);
}
// 问题数据入库
dealQuestionData(inspectDriverInfo);
// 正摄图数据入库
dealPhotoData(inspectDriverId);
} else if (status == 4) {
@@ -994,48 +990,6 @@ public class TauvReportServiceImpl extends BaseServiceImpl<TauvReportMapper, Tau
return code;
}

/**
* 问题管理数据处理
* @param inspectDriver
*/
private void dealQuestionData(TauvInspectDriver inspectDriver) {
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("mark", 1);
wrapper.eq("inspect_driver_id", inspectDriver.getId());
List<TauvInspectQuestion> questionList = inspectQuestionMapper.selectList(wrapper);
if (questionList.isEmpty()) {
wrapper.eq("is_review", 1);
wrapper.eq("is_effective", 1);
wrapper.eq("status", 1);
List<TauvInspectFile> fileList = iTauvInspectFileService.list(wrapper);
if (fileList.size() > 0) {
for (TauvInspectFile item : fileList) {
TauvInspectQuestion question = new TauvInspectQuestion();
question.setInspectDriverId(inspectDriver.getId());
question.setInspectFileId(item.getId());
question.setQuestionNo(createQuestionNo());
question.setQuestionId(item.getQuestionId());
question.setCreateUser(ShiroUtils.getAdminId());
question.setCreateTime(DateUtil.now());
inspectQuestionMapper.insert(question);
}
}
}
}

/**
* 创建问题编号
*
* @return
*/
private String createQuestionNo() {
Calendar date = Calendar.getInstance();
String year = String.valueOf(date.get(Calendar.YEAR)).substring(2);
String month = String.format("%02d", date.get(Calendar.MONTH) + 1);
String code = "10" + year + month + (int) ((Math.random() * 9 + 1) * 100000);
return code;
}

/**
* 处理正摄图数据
* @param inspectDriverId

Yükleniyor…
İptal
Kaydet