Browse Source

已确认已忽略问题接口

tags/v1.0.0^2
chengwang 1 year ago
parent
commit
86da3c500e
3 changed files with 108 additions and 7 deletions
  1. +21
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/controller/InspectionFileController.java
  2. +4
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/IInspectionFileService.java
  3. +83
    -7
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileServiceImpl.java

+ 21
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/controller/InspectionFileController.java View File

@@ -27,12 +27,33 @@ public class InspectionFileController {
* @param query
* @return
*/
@GetMapping("/unconfirmedQuestion")
public JsonResult unconfirmedQuestion(InspectionFileQuery query){
return iInspectionFileService.unconfirmedQuestion(query);
}

/**
* 已确认问题
* @param query
* @return
*/
@GetMapping("/confirmedQuestion")
public JsonResult confirmedQuestion(InspectionFileQuery query){
return iInspectionFileService.confirmedQuestion(query);
}

/**
* 已忽略问题
* @param query
* @return
*/
@GetMapping("/ignoredQuestion")
public JsonResult ignoredQuestion(InspectionFileQuery query){
return iInspectionFileService.ignoredQuestion(query);
}





}

+ 4
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/IInspectionFileService.java View File

@@ -8,5 +8,9 @@ import com.tuoheng.miniprogram.entity.query.InspectionFileQuery;
* @Date 2022/11/23
*/
public interface IInspectionFileService {
JsonResult unconfirmedQuestion(InspectionFileQuery query);

JsonResult confirmedQuestion(InspectionFileQuery query);

JsonResult ignoredQuestion(InspectionFileQuery query);
}

+ 83
- 7
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/InspectionFileServiceImpl.java View File

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

Loading…
Cancel
Save