@@ -1,7 +1,9 @@ | |||
package com.tuoheng.admin.controller; | |||
import com.tuoheng.admin.dto.InspectionDto; | |||
import com.tuoheng.admin.entity.FlightData; | |||
import com.tuoheng.admin.query.InspectionFileQuery; | |||
import com.tuoheng.admin.request.inspection.AddInspectionRequest; | |||
import com.tuoheng.admin.request.inspection.EditInspectionRequest; | |||
import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest; | |||
@@ -138,4 +140,15 @@ public class InspectionController { | |||
log.info("进入立即执行任务接口, id={}", id); | |||
return iInspectionService.execute(id); | |||
} | |||
/** | |||
* 根据用户id获取最新的五条任务信息 | |||
* @param query | |||
* @return | |||
*/ | |||
@GetMapping("/getNewInspectionList") | |||
public JsonResult getNewInspectionList(InspectionFileQuery query){ | |||
return iInspectionService.getNewInspectionList(query); | |||
} | |||
} |
@@ -0,0 +1,45 @@ | |||
package com.tuoheng.admin.enums.code.questionType; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/12/5 | |||
*/ | |||
public enum QuestionTypeEnum { | |||
PING_GROOVE_NAME(1, "坑槽"), | |||
PON_DING_NAME(2, "积水"), | |||
CRACK_NAME(3, "裂缝"); | |||
/** | |||
* 编号 | |||
*/ | |||
private int code; | |||
/** | |||
* 类型名称 | |||
*/ | |||
private String msg; | |||
QuestionTypeEnum(int code, String msg){ | |||
this.code = code; | |||
this.msg = msg; | |||
} | |||
public int getCode() { | |||
return code; | |||
} | |||
public void setCode(int code) { | |||
this.code = code; | |||
} | |||
public String getMsg() { | |||
return msg; | |||
} | |||
public void setMsg(String msg) { | |||
this.msg = msg; | |||
} | |||
} |
@@ -10,6 +10,7 @@ import com.tuoheng.admin.entity.QuestionType; | |||
import com.tuoheng.admin.entity.User; | |||
import com.tuoheng.admin.enums.UserTypeEnum; | |||
import com.tuoheng.admin.enums.code.inspectionFile.ListByDeptUserTypeEnum; | |||
import com.tuoheng.admin.enums.code.questionType.QuestionTypeEnum; | |||
import com.tuoheng.admin.mapper.*; | |||
import com.tuoheng.admin.query.InspectionFileQuery; | |||
import com.tuoheng.admin.service.IInspectionFileService; | |||
@@ -163,19 +164,19 @@ public class InspectionFileServiceImpl implements IInspectionFileService { | |||
} | |||
Integer name = questionType.getName(); | |||
//1坑槽 | |||
if(name==1) { | |||
if(name== QuestionTypeEnum.PING_GROOVE_NAME.getCode()) { | |||
pitGrooveNum+=1; | |||
}else if(name==2){ | |||
}else if(name==QuestionTypeEnum.PON_DING_NAME.getCode()){ | |||
//积水 | |||
ponDingNum+=1; | |||
}else if(name==3){ | |||
}else if(name==QuestionTypeEnum.CRACK_NAME.getCode()){ | |||
//裂缝 | |||
crackNum+=1; | |||
} | |||
} | |||
vo.setType(1); | |||
vo1.setType(2); | |||
vo2.setType(3); | |||
vo.setType(QuestionTypeEnum.PING_GROOVE_NAME.getCode()); | |||
vo1.setType(QuestionTypeEnum.PON_DING_NAME.getCode()); | |||
vo2.setType(QuestionTypeEnum.CRACK_NAME.getCode()); | |||
vo.setNum(pitGrooveNum); | |||
vo1.setNum(ponDingNum); | |||
vo2.setNum(crackNum); | |||
@@ -220,19 +221,19 @@ public class InspectionFileServiceImpl implements IInspectionFileService { | |||
} | |||
Integer name = questionType.getName(); | |||
//1坑槽 | |||
if(name==1) { | |||
if(name==QuestionTypeEnum.PING_GROOVE_NAME.getCode()) { | |||
pitGrooveNum+=1; | |||
}else if(name==2){ | |||
}else if(name==QuestionTypeEnum.PON_DING_NAME.getCode()){ | |||
//积水 | |||
ponDingNum+=1; | |||
}else if(name==3){ | |||
}else if(name==QuestionTypeEnum.CRACK_NAME.getCode()){ | |||
//裂缝 | |||
crackNum+=1; | |||
} | |||
} | |||
vo.setType(1); | |||
vo1.setType(2); | |||
vo2.setType(3); | |||
vo.setType(QuestionTypeEnum.PING_GROOVE_NAME.getCode()); | |||
vo1.setType(QuestionTypeEnum.PON_DING_NAME.getCode()); | |||
vo2.setType(QuestionTypeEnum.CRACK_NAME.getCode()); | |||
vo.setNum(pitGrooveNum); | |||
vo1.setNum(ponDingNum); | |||
vo2.setNum(crackNum); |
@@ -3,6 +3,7 @@ package com.tuoheng.admin.service.inspection; | |||
import com.tuoheng.admin.dto.InspectionDto; | |||
import com.tuoheng.admin.entity.FlightData; | |||
import com.tuoheng.admin.entity.Inspection; | |||
import com.tuoheng.admin.query.InspectionFileQuery; | |||
import com.tuoheng.admin.request.inspection.AddInspectionRequest; | |||
import com.tuoheng.admin.request.inspection.EditInspectionRequest; | |||
import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest; | |||
@@ -106,5 +107,11 @@ public interface IInspectionService { | |||
*/ | |||
JsonResult execute(String id); | |||
/** | |||
* 根据用户id获取最新的五条任务信息 | |||
* @param query | |||
* @return | |||
*/ | |||
JsonResult getNewInspectionList(InspectionFileQuery query); | |||
} |
@@ -3,6 +3,7 @@ package com.tuoheng.admin.service.inspection; | |||
import com.tuoheng.admin.dto.InspectionDto; | |||
import com.tuoheng.admin.entity.FlightData; | |||
import com.tuoheng.admin.mapper.InspectionMapper; | |||
import com.tuoheng.admin.query.InspectionFileQuery; | |||
import com.tuoheng.admin.request.inspection.AddInspectionRequest; | |||
import com.tuoheng.admin.request.inspection.EditInspectionRequest; | |||
import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest; | |||
@@ -67,6 +68,9 @@ public class InspectionServiceImpl implements IInspectionService { | |||
@Autowired | |||
private ExecuteInspectionService executeInspectionService; | |||
@Autowired | |||
private QueryNewInspectionListService queryNewInspectionListService; | |||
/** | |||
* 查询巡检任务分页分页列表 | |||
@@ -204,4 +208,14 @@ public class InspectionServiceImpl implements IInspectionService { | |||
return executeInspectionService.execute(id); | |||
} | |||
/** | |||
* 根据用户id获取最新的五条任务信息 | |||
* @param query | |||
* @return | |||
*/ | |||
@Override | |||
public JsonResult getNewInspectionList(InspectionFileQuery query) { | |||
return queryNewInspectionListService.getList(query); | |||
} | |||
} |
@@ -0,0 +1,40 @@ | |||
package com.tuoheng.admin.service.inspection.query; | |||
import com.tuoheng.admin.enums.code.inspectionFile.ListByDeptUserTypeEnum; | |||
import com.tuoheng.admin.mapper.InspectionFileMapper; | |||
import com.tuoheng.admin.mapper.InspectionMapper; | |||
import com.tuoheng.admin.mapper.UserMapper; | |||
import com.tuoheng.admin.query.InspectionFileQuery; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* @Author ChengWang | |||
* @Date 2022/12/2 | |||
*/ | |||
@Service | |||
@Slf4j | |||
public class QueryNewInspectionListService { | |||
@Autowired | |||
private InspectionMapper inspectionMapper; | |||
@Autowired | |||
private UserMapper userMapper; | |||
public JsonResult getList(InspectionFileQuery query) { | |||
if(null == query.getUserId()){ | |||
JsonResult.error(ListByDeptUserTypeEnum.QUERY_IS_FAILED.getCode(),ListByDeptUserTypeEnum.QUERY_IS_FAILED.getMsg()); | |||
} | |||
return null; | |||
} | |||
} |