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