|
|
@@ -47,11 +47,45 @@ public class InspectionFileServiceImpl implements IInspectionFileService { |
|
|
|
@Autowired |
|
|
|
private RoadInformationMapper roadInformationMapper; |
|
|
|
|
|
|
|
/** |
|
|
|
*待确认问题 status状态为5 |
|
|
|
* @param query |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public JsonResult unconfirmedQuestion(InspectionFileQuery query) { |
|
|
|
if(null==query.getLimit() && null == query.getPage()){ |
|
|
|
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); |
|
|
|
} |
|
|
|
if(StringUtils.isEmpty(query.getInspectionId())){ |
|
|
|
return JsonResult.error("任务id为空"); |
|
|
|
} |
|
|
|
//获取当前登录人 |
|
|
|
// String username = SecurityUserUtils.username(); |
|
|
|
// User user = userMapper.selectOne(Wrappers.<User>lambdaQuery() |
|
|
|
// .eq(User::getUsername, username) |
|
|
|
// .eq(User::getMark,1)); |
|
|
|
//查询当前对应的任务 |
|
|
|
Inspection inspection = inspectionMapper.selectOne(Wrappers.<Inspection>lambdaQuery() |
|
|
|
.eq(Inspection::getId, query.getInspectionId()) |
|
|
|
.eq(Inspection::getMark, 1)); |
|
|
|
if(ObjectUtil.isNull(inspection)){ |
|
|
|
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); |
|
|
|
} |
|
|
|
//设置分页 |
|
|
|
IPage<InspectionFile> page = new Page<>(query.getPage(),query.getLimit()); |
|
|
|
//获取分页数据 |
|
|
|
IPage<InspectionFile> result = inspectionFileMapper.selectPage(page, Wrappers.<InspectionFile>lambdaQuery() |
|
|
|
.eq(InspectionFile::getInspectionId, query.getInspectionId()) |
|
|
|
.eq(InspectionFile::getMark, 1) |
|
|
|
.eq(InspectionFile::getStatus, 5)); |
|
|
|
IPage<InspectionFileInfoVo> pageData = getInspectionFileInfoVoIPage(inspection, result); |
|
|
|
|
|
|
|
|
|
|
|
return JsonResult.success(pageData); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
*待确认问题 status状态为5 |
|
|
|
* 已确认问题 status状态为15 |
|
|
|
* @param query |
|
|
|
* @return |
|
|
|
*/ |
|
|
@@ -81,9 +115,54 @@ public class InspectionFileServiceImpl implements IInspectionFileService { |
|
|
|
IPage<InspectionFile> result = inspectionFileMapper.selectPage(page, Wrappers.<InspectionFile>lambdaQuery() |
|
|
|
.eq(InspectionFile::getInspectionId, query.getInspectionId()) |
|
|
|
.eq(InspectionFile::getMark, 1) |
|
|
|
.eq(InspectionFile::getStatus, 5)); |
|
|
|
.eq(InspectionFile::getStatus, 15)); |
|
|
|
IPage<InspectionFileInfoVo> pageData = getInspectionFileInfoVoIPage(inspection, result); |
|
|
|
|
|
|
|
return JsonResult.success(pageData); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 已忽略问题 |
|
|
|
* @param query |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public JsonResult ignoredQuestion(InspectionFileQuery query) { |
|
|
|
if(null==query.getLimit() && null == query.getPage()){ |
|
|
|
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); |
|
|
|
} |
|
|
|
if(StringUtils.isEmpty(query.getInspectionId())){ |
|
|
|
return JsonResult.error("任务id为空"); |
|
|
|
} |
|
|
|
//获取当前登录人 |
|
|
|
// String username = SecurityUserUtils.username(); |
|
|
|
// User user = userMapper.selectOne(Wrappers.<User>lambdaQuery() |
|
|
|
// .eq(User::getUsername, username) |
|
|
|
// .eq(User::getMark,1)); |
|
|
|
//查询当前对应的任务 |
|
|
|
Inspection inspection = inspectionMapper.selectOne(Wrappers.<Inspection>lambdaQuery() |
|
|
|
.eq(Inspection::getId, query.getInspectionId()) |
|
|
|
.eq(Inspection::getMark, 1)); |
|
|
|
if(ObjectUtil.isNull(inspection)){ |
|
|
|
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); |
|
|
|
} |
|
|
|
//设置分页 |
|
|
|
IPage<InspectionFile> page = new Page<>(query.getPage(),query.getLimit()); |
|
|
|
//获取分页数据 |
|
|
|
IPage<InspectionFile> result = inspectionFileMapper.selectPage(page, Wrappers.<InspectionFile>lambdaQuery() |
|
|
|
.eq(InspectionFile::getInspectionId, query.getInspectionId()) |
|
|
|
.eq(InspectionFile::getMark, 1) |
|
|
|
.eq(InspectionFile::getStatus, 10)); |
|
|
|
IPage<InspectionFileInfoVo> pageData = getInspectionFileInfoVoIPage(inspection, result); |
|
|
|
|
|
|
|
return JsonResult.success(pageData); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private IPage<InspectionFileInfoVo> getInspectionFileInfoVoIPage(Inspection inspection, IPage<InspectionFile> result) { |
|
|
|
//数据转换 |
|
|
|
IPage<InspectionFileInfoVo> pageData = result.convert(t -> { |
|
|
|
return result.convert(t -> { |
|
|
|
InspectionFileInfoVo vo = Convert.convert(InspectionFileInfoVo.class, t); |
|
|
|
//查询其他属性 |
|
|
|
//公路代号 |
|
|
@@ -107,8 +186,5 @@ public class InspectionFileServiceImpl implements IInspectionFileService { |
|
|
|
|
|
|
|
return vo; |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return JsonResult.success(pageData); |
|
|
|
} |
|
|
|
} |