@@ -1,21 +1,11 @@ | |||
package com.tuoheng.admin.controller; | |||
import com.alibaba.fastjson.JSON; | |||
import com.tuoheng.admin.request.dept.AddDeptRequest; | |||
import com.tuoheng.admin.request.dept.EditDeptRequest; | |||
import com.tuoheng.admin.request.dept.QueryDeptChildPageListRequest; | |||
import com.tuoheng.admin.service.airport.AirportService; | |||
import com.tuoheng.admin.service.dept.IDeptService; | |||
import com.tuoheng.admin.vo.AirLineVO; | |||
import com.tuoheng.admin.vo.AirPortVO; | |||
import com.tuoheng.admin.service.airport.AirPortService; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.web.bind.annotation.*; | |||
import java.util.List; | |||
import java.util.Map; | |||
/** | |||
* 机场前端控制器 | |||
* | |||
@@ -26,17 +16,17 @@ import java.util.Map; | |||
@Slf4j | |||
@RestController | |||
@RequestMapping("/airport") | |||
public class AirportController { | |||
public class AirPortController { | |||
@Autowired | |||
AirportService airportService; | |||
private AirPortService airPortService; | |||
/** | |||
* 获取巡检机场 | |||
*/ | |||
@GetMapping("/airport") | |||
public JsonResult getAirportList() { | |||
return airportService.getAirportList(); | |||
public JsonResult getAirPortList() { | |||
return airPortService.getAirportList(); | |||
} | |||
/** | |||
@@ -46,7 +36,7 @@ public class AirportController { | |||
*/ | |||
@GetMapping("/airport/line/{droneId}") | |||
public JsonResult getAirLineList(@PathVariable("droneId") Integer droneId) { | |||
return airportService.getAirLineList(droneId); | |||
return airPortService.getAirLineList(droneId); | |||
} | |||
} |
@@ -78,7 +78,7 @@ public class DeptController { | |||
* 删除部门 | |||
*/ | |||
@DeleteMapping("/{id}") | |||
public JsonResult delete(@PathVariable String id) { | |||
public JsonResult delete(@PathVariable("id") String id) { | |||
log.info("进入删除部门接口"); | |||
return deptService.deleteById(id); | |||
} |
@@ -48,6 +48,16 @@ public class SectionController { | |||
return sectionService.getListByDeptId(deptId); | |||
} | |||
/** | |||
* 根据公路id获取该公路下路段信息列表 | |||
* @param roadId | |||
* @return | |||
*/ | |||
@GetMapping("/list/by/road/{roadId}") | |||
public JsonResult getListByRoadId(@PathVariable("roadId") String roadId) { | |||
return sectionService.getListByRoadId(roadId); | |||
} | |||
/** | |||
* 根据id获取路段详情 | |||
* @param sectionId |
@@ -0,0 +1,95 @@ | |||
package com.tuoheng.admin.entity; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import com.tuoheng.common.core.common.BaseEntity; | |||
import lombok.Data; | |||
import java.math.BigDecimal; | |||
import java.util.Date; | |||
/** | |||
* 巡检任务问题表 | |||
* | |||
* @team tuoheng | |||
* @author wanjing | |||
* @date 2022-11-23 | |||
*/ | |||
@Data | |||
public class InspectionFile extends BaseEntity { | |||
private static final long serialVersionUID = 1L; | |||
/** 租户ID */ | |||
private String tenantId; | |||
/** 图片编号 */ | |||
private String fileCode; | |||
/** 巡检任务ID */ | |||
private String inspectionId; | |||
/** 附件类型:1图片 2视频 */ | |||
private Integer fileType; | |||
/** 文件名称 */ | |||
private String fileName; | |||
/** 缩略图 */ | |||
private String fileThumbnail; | |||
/** 原图 */ | |||
private String fileOriginal; | |||
/** 标记图 */ | |||
private String fileImage; | |||
/** 文件大小 */ | |||
private BigDecimal fileSize; | |||
/** 纬度(原始图片纬度) */ | |||
private String latitude; | |||
/** 经度(原始图片经度) */ | |||
private String longitude; | |||
/** 位置信息 */ | |||
private String location; | |||
/** 高德地图经度 */ | |||
private String gaodeLongitude; | |||
/** 高德地图纬度 */ | |||
private String gaodeLatitude; | |||
/** 高德地图地址 */ | |||
private String gaodeAddress; | |||
/** 问题类型二级分类ID */ | |||
private String questionId; | |||
/** 图片来源:1AI 2后台 3视频 */ | |||
private Integer source; | |||
/** 问题名称 */ | |||
private String questionName; | |||
/** 巡检内容 */ | |||
private String content; | |||
/** 详细描述 */ | |||
private String questionDesc; | |||
/** 状态:5待确认 10已忽略 15已确认 20已生成工单 25问题已处理 */ | |||
private Integer status; | |||
/** 审核人 */ | |||
private String checkUser; | |||
/** 审核时间 */ | |||
@JsonFormat(pattern = "yyyy-MM-dd") | |||
private Date checkTime; | |||
/** 有效标记 */ | |||
private Integer mark; | |||
} |
@@ -0,0 +1,49 @@ | |||
package com.tuoheng.admin.entity; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import com.tuoheng.common.core.common.BaseEntity; | |||
import lombok.Data; | |||
import java.util.Date; | |||
/** | |||
* 巡检问题处理结果对象 | |||
* | |||
* @team tuoheng | |||
* @author wanjing | |||
* @date 2022-11-23 | |||
*/ | |||
@Data | |||
public class InspectionFileHandle extends BaseEntity { | |||
private static final long serialVersionUID = 1L; | |||
/** 租户ID */ | |||
private String tenantId; | |||
/** 巡检问题文件ID */ | |||
private String inspectionFileId; | |||
/** 处理人 */ | |||
private String handlerUser; | |||
/** 处理后图片(多个图片逗号“,”分隔) */ | |||
private String handlerImage; | |||
/** 处理结果 */ | |||
private String handlerResult; | |||
/** 处理完成时间 */ | |||
@JsonFormat(pattern = "yyyy-MM-dd") | |||
private Date handlerTime; | |||
/** 创建人 */ | |||
private String createUser; | |||
/** 更新人 */ | |||
private String updateUser; | |||
/** 有效标记 */ | |||
private Integer mark; | |||
} |
@@ -0,0 +1,29 @@ | |||
package com.tuoheng.admin.enums; | |||
import lombok.Getter; | |||
/** | |||
* 巡检方式类型 | |||
* | |||
* @author wanjing | |||
* @team tuoheng | |||
* @date 2022-11-23 | |||
*/ | |||
public enum InspectionWayEnum { | |||
DRONE(1,"无人机"), | |||
AIRPORT(2,"机场巡逻"), | |||
MABNNEDFLIGHT(3,"飞手值飞"); | |||
InspectionWayEnum(int code, String description){ | |||
this.code = code; | |||
this.description = description; | |||
} | |||
@Getter | |||
private int code; | |||
@Getter | |||
private String description; | |||
} |
@@ -1,4 +1,4 @@ | |||
package com.tuoheng.admin.enums; | |||
package com.tuoheng.admin.enums.code; | |||
public enum AriportCodeEnum { | |||
@@ -1,4 +1,4 @@ | |||
package com.tuoheng.admin.enums.dept; | |||
package com.tuoheng.admin.enums.code.dept; | |||
/** | |||
* 添加部门信息返回码 |
@@ -1,4 +1,4 @@ | |||
package com.tuoheng.admin.enums.dept; | |||
package com.tuoheng.admin.enums.code.dept; | |||
/** | |||
* 删除部门信息返回码 | |||
@@ -14,8 +14,8 @@ public enum DeleteDeptCodeEnum { | |||
DELETE_DEPT_IS_FAILED(1200500, "删除部门失败"), | |||
DEPT_ID_IS_NULL(1200501, "部门id为空"), | |||
DEPT_IS_NOT_EXIST(1200502, "部门不存在"), | |||
DEPT_IEXIST_USER(1200503, "该级部下存在用户"), | |||
DEPT_IEXIST_CHILDREN_DEPT(1200504, "该级部下存在子部门"); | |||
DEPT_IEXIST_USER(1200503, "该级部已绑定用户"), | |||
DEPT_IEXIST_CHILDREN_DEPT(1200504, "该级部下有子部门"); | |||
/** | |||
* 错误码 |
@@ -1,4 +1,4 @@ | |||
package com.tuoheng.admin.enums.dept; | |||
package com.tuoheng.admin.enums.code.dept; | |||
/** | |||
* 修改部门信息返回码 |
@@ -1,4 +1,4 @@ | |||
package com.tuoheng.admin.enums.dept; | |||
package com.tuoheng.admin.enums.code.dept; | |||
/** | |||
* 获取子部门列表返回码 |
@@ -1,4 +1,4 @@ | |||
package com.tuoheng.admin.enums.dept; | |||
package com.tuoheng.admin.enums.code.dept; | |||
/** | |||
* 获取部门信息返回码 |
@@ -1,4 +1,4 @@ | |||
package com.tuoheng.admin.enums.dept; | |||
package com.tuoheng.admin.enums.code.dept; | |||
/** | |||
* 获取部门列表返回码 |
@@ -0,0 +1,49 @@ | |||
package com.tuoheng.admin.enums.code.inspection; | |||
/** | |||
* 查询巡检任务分页列表返回码 | |||
* 模块代码:21(公路管理) | |||
* 接口代码:03 (根据部门id获取该部门下公路列表) | |||
* | |||
* @author wanjing | |||
* @team tuoheng | |||
* @date 2022-11-24 | |||
*/ | |||
public enum QueryInspectionPageListCodeEnum { | |||
QUERY_IS_FAILED(1210300, "获取数据失败"), | |||
DEPT_ID_IS_NULL(1210301, "部门id为空"), | |||
DEPT_IS_NOT_EXIST(1210302, "部门不存在"); | |||
/** | |||
* 错误码 | |||
*/ | |||
private int code; | |||
/** | |||
* 错误信息 | |||
*/ | |||
private String msg; | |||
QueryInspectionPageListCodeEnum(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; | |||
} | |||
} |
@@ -1,4 +1,4 @@ | |||
package com.tuoheng.admin.enums.road; | |||
package com.tuoheng.admin.enums.code.road; | |||
/** | |||
* 根据部门id获取该部门下公路列表返回码 |
@@ -1,4 +1,4 @@ | |||
package com.tuoheng.admin.enums.section; | |||
package com.tuoheng.admin.enums.code.section; | |||
/** | |||
* 根据部门id获取该部门下公路列表返回码 | |||
@@ -12,9 +12,9 @@ package com.tuoheng.admin.enums.section; | |||
public enum QuerySectionListByDeptIdCodeEnum { | |||
QUERY_IS_FAILED(1220300, "获取数据失败"), | |||
DEPT_ID_IS_NULL(1220201, "部门id为空"), | |||
DEPT_IS_NOT_EXIST(1220202, "部门不存在"), | |||
SECTION_LIST_IS_NULL(1220203, "路段列表为空");; | |||
DEPT_ID_IS_NULL(1220301, "部门id为空"), | |||
DEPT_IS_NOT_EXIST(1220302, "部门不存在"), | |||
SECTION_LIST_IS_NULL(1220303, "路段列表为空"); | |||
/** | |||
* 错误码 |
@@ -0,0 +1,50 @@ | |||
package com.tuoheng.admin.enums.code.section; | |||
/** | |||
* 根据公路id获取该公路下公路列表返回码 | |||
* 模块代码:22(路段管理) | |||
* 接口代码:04 (根据公路d获取该公路下公路列表) | |||
* | |||
* @author wanjing | |||
* @team tuoheng | |||
* @date 2022-11-24 | |||
*/ | |||
public enum QuerySectionListByRoadIdCodeEnum { | |||
QUERY_IS_FAILED(1220400, "获取数据失败"), | |||
ROAD_ID_IS_NULL(1220401, "公路id为空"), | |||
ROAD_IS_NOT_EXIST(1220402, "公路不存在"), | |||
SECTION_LIST_IS_NULL(1220403, "路段列表为空"); | |||
/** | |||
* 错误码 | |||
*/ | |||
private int code; | |||
/** | |||
* 错误信息 | |||
*/ | |||
private String msg; | |||
QuerySectionListByRoadIdCodeEnum(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; | |||
} | |||
} |
@@ -0,0 +1,12 @@ | |||
package com.tuoheng.admin.mapper; | |||
/** | |||
* 巡检问题处理结果Mapper接口 | |||
* | |||
* @team tuoheng | |||
* @author wanjing | |||
* @date 2022-11-23 | |||
*/ | |||
public interface InspectionFileHandleMapper { | |||
} |
@@ -0,0 +1,12 @@ | |||
package com.tuoheng.admin.mapper; | |||
/** | |||
* 【请填写功能名称】Mapper接口 | |||
* | |||
* @team tuoheng | |||
* @author wanjing | |||
* @date 2022-11-23 | |||
*/ | |||
public interface InspectionFileMapper { | |||
} |
@@ -2,6 +2,7 @@ package com.tuoheng.admin.mapper; | |||
import java.util.List; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.tuoheng.admin.entity.Inspection; | |||
import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest; | |||
@@ -29,7 +30,7 @@ public interface InspectionMapper { | |||
* @param request 巡检任务查询实体 | |||
* @return 巡检任务集合 | |||
*/ | |||
Page<Inspection> selectPageList(@Param("page") Page<Inspection> page, @Param("request") QueryInspectionPageListRequest request); | |||
Page<Inspection> selectPageList(@Param("page") IPage page, @Param("request") QueryInspectionPageListRequest request); | |||
/** | |||
* 查询巡检任务列表 | |||
@@ -39,14 +40,6 @@ public interface InspectionMapper { | |||
*/ | |||
List<Inspection> selectList(QueryInspectionPageListRequest request); | |||
/** | |||
* 新增巡检任务 | |||
* | |||
* @param inspection 巡检任务 | |||
* @return 结果 | |||
*/ | |||
int insert(Inspection inspection); | |||
/** | |||
* 修改巡检任务 | |||
* |
@@ -0,0 +1,91 @@ | |||
package com.tuoheng.admin.request.inspection; | |||
import com.tuoheng.common.core.common.BaseQuery; | |||
import lombok.Data; | |||
/** | |||
* 新增任务请求参数 | |||
* | |||
* @author wanjing | |||
* @team tuoheng | |||
* @date 2022-11-24 | |||
*/ | |||
@Data | |||
public class AddInspectionRequest extends BaseQuery { | |||
/** | |||
* 用户ID | |||
*/ | |||
private Integer userId; | |||
/** | |||
* 租户id | |||
*/ | |||
private Integer tenantId; | |||
/** | |||
* 任务编号 | |||
*/ | |||
private String code; | |||
/** | |||
* 任务名称 | |||
*/ | |||
private String name; | |||
/** | |||
* 巡检机场id | |||
*/ | |||
private Integer airportId; | |||
/** | |||
* 巡检机场名称 | |||
*/ | |||
private Integer airportName; | |||
/** | |||
* 巡检线路Id | |||
*/ | |||
private Integer inspectionLine; | |||
/** | |||
* 巡检线路名称 | |||
*/ | |||
private Integer inspectionLineName; | |||
/** | |||
* 巡检任务类型: 1 临时巡检(目前只有该一种类型) | |||
*/ | |||
private Integer type; | |||
/** | |||
* 巡检方式类型: 1 无人机 2机场巡逻 3 飞手值飞 | |||
*/ | |||
private Integer inspectionType; | |||
/** | |||
* 部门Id | |||
*/ | |||
private String deptId; | |||
/** | |||
* 公路Id | |||
*/ | |||
private String roadId; | |||
/** | |||
* 公路名称 | |||
*/ | |||
private String roadName; | |||
/** | |||
* 路段Id | |||
*/ | |||
private String sectionId; | |||
/** | |||
* 路段名称 | |||
*/ | |||
private String sectionName; | |||
} |
@@ -23,6 +23,11 @@ public class QueryInspectionPageListRequest extends BaseQuery { | |||
*/ | |||
private Integer tenantId; | |||
/** | |||
* 关键字,匹配任务编号和任务名称 | |||
*/ | |||
private String key; | |||
/** | |||
* 任务编号 | |||
*/ | |||
@@ -54,13 +59,13 @@ public class QueryInspectionPageListRequest extends BaseQuery { | |||
private Integer status; | |||
/** | |||
* 巡检方式类型: 1 无人机 2机场 | |||
* 巡检方式类型: 1 无人机 2机场巡逻 3 飞手值飞 | |||
*/ | |||
private Integer inspectionType; | |||
/** | |||
* 部门Id | |||
*/ | |||
private Integer deptId; | |||
private String deptId; | |||
} |
@@ -16,6 +16,8 @@ public interface ISectionService extends IBaseService<Section> { | |||
JsonResult getListByDeptId(String deptId); | |||
JsonResult getListByRoadId(String roadId); | |||
JsonResult editInfo(Section entity); | |||
JsonResult getSectionInfo(String sectionId); |
@@ -2,7 +2,7 @@ package com.tuoheng.admin.service.airport; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
public interface AirportService { | |||
public interface AirPortService { | |||
JsonResult getAirportList(); | |||
@@ -2,7 +2,7 @@ package com.tuoheng.admin.service.airport; | |||
import cn.hutool.core.util.ObjectUtil; | |||
import com.tuoheng.admin.entity.Tenant; | |||
import com.tuoheng.admin.enums.AriportCodeEnum; | |||
import com.tuoheng.admin.enums.code.AriportCodeEnum; | |||
import com.tuoheng.admin.mapper.TenantMapper; | |||
import com.tuoheng.admin.utils.ShiroUtils; | |||
import com.tuoheng.admin.vo.AirLineVO; | |||
@@ -16,7 +16,7 @@ import org.springframework.stereotype.Service; | |||
import java.util.Objects; | |||
@Service | |||
public class AirportServiceImpl implements AirportService { | |||
public class AirPortServiceImpl implements AirPortService { | |||
@Autowired | |||
private TenantMapper tenantMapper; |
@@ -2,7 +2,7 @@ package com.tuoheng.admin.service.dept.add; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.entity.*; | |||
import com.tuoheng.admin.enums.dept.AddDeptCodeEnum; | |||
import com.tuoheng.admin.enums.code.dept.AddDeptCodeEnum; | |||
import com.tuoheng.admin.mapper.DeptMapper; | |||
import com.tuoheng.admin.mapper.RoadDeptMapper; | |||
import com.tuoheng.admin.mapper.SectionDeptMapper; |
@@ -1,14 +1,12 @@ | |||
package com.tuoheng.admin.service.dept.delete; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.dto.RoadSectionDto; | |||
import com.tuoheng.admin.entity.*; | |||
import com.tuoheng.admin.enums.dept.DeleteDeptCodeEnum; | |||
import com.tuoheng.admin.enums.code.dept.DeleteDeptCodeEnum; | |||
import com.tuoheng.admin.mapper.DeptMapper; | |||
import com.tuoheng.admin.mapper.RoadDeptMapper; | |||
import com.tuoheng.admin.mapper.SectionDeptMapper; | |||
import com.tuoheng.admin.mapper.UserMapper; | |||
import com.tuoheng.admin.request.dept.EditDeptRequest; | |||
import com.tuoheng.admin.utils.ShiroUtils; | |||
import com.tuoheng.common.core.utils.DateUtils; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
@@ -16,13 +14,9 @@ import com.tuoheng.common.core.utils.StringUtils; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import org.springframework.util.CollectionUtils; | |||
import java.util.ArrayList; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.stream.Collectors; | |||
/** | |||
* 删除部门业务层处理 |
@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.tuoheng.admin.entity.Dept; | |||
import com.tuoheng.admin.enums.dept.QueryDeptChildListCodeEnum; | |||
import com.tuoheng.admin.enums.code.dept.QueryDeptChildListCodeEnum; | |||
import com.tuoheng.admin.mapper.DeptMapper; | |||
import com.tuoheng.admin.request.dept.QueryDeptChildPageListRequest; | |||
import com.tuoheng.admin.utils.ShiroUtils; |
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.conver.DeptConverMapper; | |||
import com.tuoheng.admin.dto.RoadSectionDto; | |||
import com.tuoheng.admin.entity.*; | |||
import com.tuoheng.admin.enums.dept.QueryDeptInfoCodeEnum; | |||
import com.tuoheng.admin.enums.code.dept.QueryDeptInfoCodeEnum; | |||
import com.tuoheng.admin.mapper.*; | |||
import com.tuoheng.admin.utils.ShiroUtils; | |||
import com.tuoheng.admin.vo.DeptInfoVo; | |||
@@ -35,6 +35,9 @@ public class QueryDeptInfoService { | |||
@Autowired | |||
private DeptMapper deptMapper; | |||
@Autowired | |||
private UserMapper userMapper; | |||
@Autowired | |||
private RoadInformationMapper roadInformationMapper; | |||
@@ -47,12 +50,12 @@ public class QueryDeptInfoService { | |||
@Autowired | |||
private SectionDeptMapper sectionDeptMapper; | |||
public JsonResult getDeptInfo(String id) { | |||
log.info("进入获取部门信息业务"); | |||
public JsonResult getDeptInfo(String deptId) { | |||
log.info("进入获取部门信息业务, deptId:{}", deptId); | |||
String tenantId = ShiroUtils.getTenantId(); | |||
// 校验 | |||
JsonResult result = this.check(tenantId, id); | |||
JsonResult result = this.check(tenantId, deptId); | |||
if (0 != result.getCode()) { | |||
log.info("获取部门信息业务:校验失败:{}", result.getMsg()); | |||
return result; | |||
@@ -61,31 +64,21 @@ public class QueryDeptInfoService { | |||
// 在校验中,判断部门是否存在时,若部门存在,直接将部门信息返回,减少数据库查询次数 | |||
Dept dept = (Dept) result.getData(); | |||
// 获取该部门下公路列表 | |||
List<RoadInformation> roadInformationList = this.getRoadInformationList(tenantId, id); | |||
if (CollectionUtil.isEmpty(roadInformationList)) { | |||
// 不会出现此场景,在代码层面考虑健壮性,加此判断 | |||
// 根据业务需求,添加部门时,必须添加公路和路段信息 | |||
// 若公路数据为空,说明肯定也没也路段信息,不用继续往下判断,因此直接返回 | |||
log.info("获取部门信息业务:公路信息为空"); | |||
return JsonResult.success(dept); | |||
} | |||
// 获取该部门下路段列表 | |||
List<Section> sectionList = this.getSectionList(tenantId, id); | |||
if (CollectionUtil.isEmpty(sectionList)) { | |||
// 不会出现此场景,在代码层面考虑健壮性,加此判断 | |||
// 若路段信息为空,不用继续往下判断,因此直接返回 | |||
log.info("获取部门信息业务:路段信息为空"); | |||
return JsonResult.success(dept); | |||
} | |||
// 处理公路与路段的对应关系 | |||
List<RoadSectionDto> roadSectionDtoList = this.getRoadSectionDtoList(roadInformationList, sectionList); | |||
List<RoadSectionDto> roadSectionDtoList = this.getRoadSectionDtoList(tenantId, deptId); | |||
// 拼装返回数据实体 | |||
Dept parent = this.getParentDept(tenantId, dept.getPid()); | |||
Integer userCount = this.getUserCount(tenantId, deptId); | |||
Integer childDeptCount = this.getChildDeptCount(tenantId, deptId); | |||
DeptInfoVo deptInfoVo = DeptConverMapper.INSTANCE.fromDeptToDeptVo(dept); | |||
deptInfoVo.setRoadSectionDtoList(roadSectionDtoList); | |||
deptInfoVo.setUserCount(userCount); | |||
deptInfoVo.setChildDeptCount(childDeptCount); | |||
if (null != parent) { | |||
deptInfoVo.setPname(parent.getName()); | |||
} | |||
return JsonResult.success(deptInfoVo); | |||
} | |||
@@ -112,6 +105,83 @@ public class QueryDeptInfoService { | |||
return JsonResult.success(dept); | |||
} | |||
/** | |||
* 获取父部门信息 | |||
*/ | |||
private Dept getParentDept(String tenantId, String pid) { | |||
Dept dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>() | |||
.eq(Dept::getTenantId, tenantId) | |||
.eq(Dept::getId, pid) | |||
.eq(Dept::getMark, 1)); | |||
return dept; | |||
} | |||
/** | |||
* 获取部门下用户数 | |||
*/ | |||
private Integer getUserCount(String tenantId, String deptId) { | |||
Integer count = userMapper.selectCount(new LambdaQueryWrapper<User>() | |||
.eq(User::getTenantId, tenantId) | |||
.eq(User::getDeptId, deptId) | |||
.eq(User::getMark, 1)); | |||
return count; | |||
} | |||
/** | |||
* 获取部门下子部门数 | |||
*/ | |||
private Integer getChildDeptCount(String tenantId, String deptId) { | |||
Integer count = deptMapper.selectCount(new LambdaQueryWrapper<Dept>() | |||
.eq(Dept::getTenantId, tenantId) | |||
.eq(Dept::getPid, deptId) | |||
.eq(Dept::getMark, 1)); | |||
return count; | |||
} | |||
/** | |||
* 拼装数据 | |||
* @param tenantId | |||
* @param id | |||
* @return | |||
*/ | |||
private List<RoadSectionDto> getRoadSectionDtoList(String tenantId, String id) { | |||
// 获取该部门下公路列表 | |||
List<RoadInformation> roadInformationList = this.getRoadInformationList(tenantId, id); | |||
if (CollectionUtil.isEmpty(roadInformationList)) { | |||
// 不会出现此场景,在代码层面考虑健壮性,加此判断 | |||
// 根据业务需求,添加部门时,必须添加公路和路段信息 | |||
// 若公路数据为空,说明肯定也没也路段信息,不用继续往下判断,因此直接返回 | |||
log.info("获取部门信息业务:公路信息为空"); | |||
return null; | |||
} | |||
// 获取该部门下路段列表 | |||
List<Section> sectionList = this.getSectionList(tenantId, id); | |||
if (CollectionUtil.isEmpty(sectionList)) { | |||
// 不会出现此场景,在代码层面考虑健壮性,加此判断 | |||
// 若路段信息为空,不用继续往下判断,因此直接返回 | |||
log.info("获取部门信息业务:路段信息为空"); | |||
return null; | |||
} | |||
List<RoadSectionDto> roadSectionDtoList = new ArrayList<>(); | |||
RoadSectionDto roadSectionDto; | |||
List<Section> sectionListTmp; | |||
for (RoadInformation roadInformation : roadInformationList) { | |||
roadSectionDto = new RoadSectionDto(); | |||
sectionListTmp = new ArrayList<>(); | |||
for (Section section : sectionList) { | |||
if (section.getRoadId().equals(roadInformation.getId())) { | |||
sectionListTmp.add(section); | |||
} | |||
} | |||
roadSectionDto.setRoad(roadInformation); | |||
roadSectionDto.setSectionList(sectionListTmp); | |||
roadSectionDtoList.add(roadSectionDto); | |||
} | |||
return roadSectionDtoList; | |||
} | |||
/** | |||
* 查询该部门下公路信息列表 | |||
* @param tenantId | |||
@@ -153,29 +223,4 @@ public class QueryDeptInfoService { | |||
List<Section> sectionList = sectionMapper.getListByMap(map); | |||
return sectionList; | |||
} | |||
/** | |||
* 拼装数据 | |||
* @param roadInformationList | |||
* @param sectionList | |||
* @return | |||
*/ | |||
private List<RoadSectionDto> getRoadSectionDtoList(List<RoadInformation> roadInformationList, List<Section> sectionList) { | |||
List<RoadSectionDto> roadSectionDtoList = new ArrayList<>(); | |||
RoadSectionDto roadSectionDto; | |||
List<Section> sectionListTmp; | |||
for (RoadInformation roadInformation : roadInformationList) { | |||
roadSectionDto = new RoadSectionDto(); | |||
sectionListTmp = new ArrayList<>(); | |||
for (Section section : sectionList) { | |||
if (section.getRoadId().equals(roadInformation.getId())) { | |||
sectionListTmp.add(section); | |||
} | |||
} | |||
roadSectionDto.setRoad(roadInformation); | |||
roadSectionDto.setSectionList(sectionListTmp); | |||
roadSectionDtoList.add(roadSectionDto); | |||
} | |||
return roadSectionDtoList; | |||
} | |||
} |
@@ -4,7 +4,7 @@ import cn.hutool.core.collection.CollectionUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.conver.DeptConverMapper; | |||
import com.tuoheng.admin.entity.Dept; | |||
import com.tuoheng.admin.enums.dept.QueryDeptTreeListCodeEnum; | |||
import com.tuoheng.admin.enums.code.dept.QueryDeptTreeListCodeEnum; | |||
import com.tuoheng.admin.mapper.DeptMapper; | |||
import com.tuoheng.admin.vo.DeptTreeVo; | |||
import com.tuoheng.common.core.utils.JsonResult; |
@@ -3,13 +3,10 @@ package com.tuoheng.admin.service.dept.update; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.dto.RoadSectionDto; | |||
import com.tuoheng.admin.entity.*; | |||
import com.tuoheng.admin.enums.dept.AddDeptCodeEnum; | |||
import com.tuoheng.admin.enums.dept.DeleteDeptCodeEnum; | |||
import com.tuoheng.admin.enums.dept.EditDeptCodeEnum; | |||
import com.tuoheng.admin.enums.code.dept.EditDeptCodeEnum; | |||
import com.tuoheng.admin.mapper.DeptMapper; | |||
import com.tuoheng.admin.mapper.RoadDeptMapper; | |||
import com.tuoheng.admin.mapper.SectionDeptMapper; | |||
import com.tuoheng.admin.request.dept.AddDeptRequest; | |||
import com.tuoheng.admin.request.dept.EditDeptRequest; | |||
import com.tuoheng.admin.utils.ShiroUtils; | |||
import com.tuoheng.common.core.utils.DateUtils; |
@@ -15,6 +15,7 @@ import com.tuoheng.admin.mapper.SectionMapper; | |||
import com.tuoheng.admin.query.SectionQuery; | |||
import com.tuoheng.admin.service.ISectionService; | |||
import com.tuoheng.admin.service.section.query.QuerySectionListByDeptIdService; | |||
import com.tuoheng.admin.service.section.query.QuerySectionListByRoadIdService; | |||
import com.tuoheng.admin.vo.SectionInfoVo; | |||
import com.tuoheng.common.core.common.BaseServiceImpl; | |||
import com.tuoheng.common.core.enums.ServiceExceptionEnum; | |||
@@ -49,6 +50,9 @@ public class SectionServiceImpl extends BaseServiceImpl<SectionMapper, Section> | |||
@Autowired | |||
private QuerySectionListByDeptIdService querySectionListByDeptIdService; | |||
@Autowired | |||
private QuerySectionListByRoadIdService querySectionListByRoadIdService; | |||
@Override | |||
public JsonResult queryPage(SectionQuery query) { | |||
if(null==query.getLimit() && null == query.getPage()){ | |||
@@ -104,7 +108,17 @@ public class SectionServiceImpl extends BaseServiceImpl<SectionMapper, Section> | |||
*/ | |||
@Override | |||
public JsonResult getListByDeptId(String deptId) { | |||
return querySectionListByDeptIdService.getRoadList(deptId); | |||
return querySectionListByDeptIdService.getList(deptId); | |||
} | |||
/** | |||
* 根据公路id获取该公路下路段信息列表 | |||
* @param roadId | |||
* @return | |||
*/ | |||
@Override | |||
public JsonResult getListByRoadId(String roadId) { | |||
return querySectionListByRoadIdService.getList(roadId); | |||
} | |||
@Override |
@@ -26,7 +26,7 @@ public class InspectionServiceImpl implements IInspectionService { | |||
QueryInspectionPageListService queryInspectionPageListService; | |||
/** | |||
* 查询巡检任务分页列表 | |||
* 查询巡检任务分页分页列表 | |||
* | |||
* @param queryInspectionRequest 巡检任务查询实体 | |||
* @return | |||
@@ -81,8 +81,6 @@ public class InspectionServiceImpl implements IInspectionService { | |||
*/ | |||
@Override | |||
public JsonResult insert(Inspection inspection) { | |||
inspectionMapper.insert(inspection); | |||
return JsonResult.success(); | |||
} | |||
@@ -0,0 +1,87 @@ | |||
package com.tuoheng.admin.service.inspection.add; | |||
import com.tuoheng.admin.entity.Dept; | |||
import com.tuoheng.admin.enums.code.dept.AddDeptCodeEnum; | |||
import com.tuoheng.admin.mapper.DeptMapper; | |||
import com.tuoheng.admin.mapper.RoadDeptMapper; | |||
import com.tuoheng.admin.mapper.SectionDeptMapper; | |||
import com.tuoheng.admin.request.dept.AddDeptRequest; | |||
import com.tuoheng.admin.request.inspection.AddInspectionRequest; | |||
import com.tuoheng.admin.utils.ShiroUtils; | |||
import com.tuoheng.common.core.utils.DateUtils; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.common.core.utils.StringUtils; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
/** | |||
* 添加任务业务层处理 | |||
* | |||
* @author wanjing | |||
* @team tuoheng | |||
* @date 2022-11-23 | |||
*/ | |||
@Slf4j | |||
@Service | |||
public class AddinspectionService { | |||
@Autowired | |||
private DeptMapper deptMapper; | |||
@Autowired | |||
private RoadDeptMapper roadDeptMapper; | |||
@Autowired | |||
private SectionDeptMapper sectionDeptMapper; | |||
/** | |||
* 添加任务 | |||
* | |||
* @return | |||
*/ | |||
public JsonResult add(AddInspectionRequest addInspectionRequest) { | |||
log.info("进入添加任务业务接口"); | |||
String tenantId = ShiroUtils.getTenantId(); | |||
JsonResult result = this.check(tenantId, addInspectionRequest); | |||
if (0 != result.getCode()) { | |||
log.info("添加任务业务接口:校验失败:{}", result.getMsg()); | |||
return result; | |||
} | |||
String code = DateUtils.generateCode("XJRW"); | |||
addInspectionRequest.setCode(code); | |||
Integer rowId = 0; | |||
log.info("添加任务, 返回结果: deptId={}", rowId); | |||
if (rowId <= 0) { | |||
log.info("添加任务业务接口:添加任务失败:{}", result.getMsg()); | |||
return JsonResult.error(AddDeptCodeEnum.ADD_DEPT_IS_FAILED.getCode(), AddDeptCodeEnum.ADD_DEPT_IS_FAILED.getMsg()); | |||
} | |||
log.info("添加任务业务接口:添加任务成功:{}"); | |||
return JsonResult.success(); | |||
} | |||
/** | |||
* 检查参数 | |||
* @param tenantId | |||
* @param addInspectionRequest | |||
* @return | |||
*/ | |||
private JsonResult check(String tenantId, AddInspectionRequest addInspectionRequest) { | |||
if (null == addInspectionRequest.getDeptId()) { | |||
return JsonResult.error(AddDeptCodeEnum.DEPT_PID_IS_NULL.getCode(), AddDeptCodeEnum.DEPT_PID_IS_NULL.getMsg()); | |||
} | |||
if (StringUtils.isEmpty(addInspectionRequest.getName())) { | |||
return JsonResult.error(AddDeptCodeEnum.DEPT_NAME_IS_NULL.getCode(), AddDeptCodeEnum.DEPT_NAME_IS_NULL.getMsg()); | |||
} | |||
return JsonResult.success(); | |||
} | |||
} |
@@ -1,15 +1,25 @@ | |||
package com.tuoheng.admin.service.inspection.query; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||
import com.tuoheng.admin.entity.Dept; | |||
import com.tuoheng.admin.entity.Inspection; | |||
import com.tuoheng.admin.enums.InspectionWayEnum; | |||
import com.tuoheng.admin.enums.code.dept.EditDeptCodeEnum; | |||
import com.tuoheng.admin.enums.code.inspection.QueryInspectionPageListCodeEnum; | |||
import com.tuoheng.admin.mapper.DeptMapper; | |||
import com.tuoheng.admin.mapper.InspectionMapper; | |||
import com.tuoheng.admin.request.inspection.QueryInspectionPageListRequest; | |||
import com.tuoheng.admin.utils.ShiroUtils; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.common.core.utils.StringUtils; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.util.List; | |||
/** | |||
* 查询巡检任务分页列表业务层处理 | |||
* | |||
@@ -21,6 +31,8 @@ import org.springframework.stereotype.Service; | |||
@Service | |||
public class QueryInspectionPageListService { | |||
@Autowired | |||
private DeptMapper deptMapper; | |||
@Autowired | |||
private InspectionMapper inspectionMapper; | |||
@@ -34,8 +46,25 @@ public class QueryInspectionPageListService { | |||
return result; | |||
} | |||
Page<Inspection> page = new Page(queryInspectionRequest.getPage(), queryInspectionRequest.getLimit()); | |||
Page<Inspection> pageList = inspectionMapper.selectPageList(page, queryInspectionRequest); | |||
if (InspectionWayEnum.MABNNEDFLIGHT.getCode() == queryInspectionRequest.getInspectionType()) { | |||
queryInspectionRequest.setAirportId(0); | |||
queryInspectionRequest.setInspectionLine(0); | |||
} | |||
// 获取本部门及子孙部门id列表 | |||
List<String> deptIdList = deptMapper.selectAllChildListById(queryInspectionRequest.getDeptId()); | |||
// 设置分页参数 | |||
IPage<Inspection> page = new Page<>(queryInspectionRequest.getPage(), queryInspectionRequest.getLimit()); | |||
// 查询结果 | |||
IPage<Inspection> pageData = inspectionMapper.selectPageList(page, queryInspectionRequest); | |||
// | |||
// Page<Inspection> page = new Page(queryInspectionRequest.getPage(), queryInspectionRequest.getLimit()); | |||
// Page<Inspection> pageList = inspectionMapper.selectPageList2(page, queryInspectionRequest); | |||
// 查询所有有效的子部门数据 | |||
// IPage<Inspection> page = new Page<>(queryInspectionRequest.getPage(), queryInspectionRequest.getLimit()); | |||
@@ -62,11 +91,19 @@ public class QueryInspectionPageListService { | |||
* @return | |||
*/ | |||
private JsonResult check(String tenantId, QueryInspectionPageListRequest queryInspectionRequest) { | |||
// 判断id是否为空 | |||
// if (StringUtils.isEmpty(id)) { | |||
// return JsonResult.error(QueryDeptChildListCodeEnum.DEPT_ID_IS_NULL.getCode(), QueryDeptChildListCodeEnum.DEPT_ID_IS_NULL.getMsg()); | |||
// } | |||
// 判断部门id是否为空 | |||
if (StringUtils.isEmpty(queryInspectionRequest.getDeptId())) { | |||
return JsonResult.error(QueryInspectionPageListCodeEnum.DEPT_ID_IS_NULL.getCode(), QueryInspectionPageListCodeEnum.DEPT_ID_IS_NULL.getMsg()); | |||
} | |||
// 判断部门是否存在 | |||
Dept dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>() | |||
.eq(Dept::getTenantId, tenantId) | |||
.eq(Dept::getId, queryInspectionRequest.getDeptId()) | |||
.eq(Dept::getMark, 1)); | |||
if (null == dept) { | |||
return JsonResult.error(QueryInspectionPageListCodeEnum.DEPT_IS_NOT_EXIST.getCode(), QueryInspectionPageListCodeEnum.DEPT_IS_NOT_EXIST.getMsg()); | |||
} | |||
return JsonResult.success(); | |||
} |
@@ -5,8 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.entity.Dept; | |||
import com.tuoheng.admin.entity.RoadDept; | |||
import com.tuoheng.admin.entity.RoadInformation; | |||
import com.tuoheng.admin.enums.dept.QueryDeptChildListCodeEnum; | |||
import com.tuoheng.admin.enums.road.QueryRoadListByDeptIdCodeEnum; | |||
import com.tuoheng.admin.enums.code.road.QueryRoadListByDeptIdCodeEnum; | |||
import com.tuoheng.admin.mapper.DeptMapper; | |||
import com.tuoheng.admin.mapper.RoadDeptMapper; | |||
import com.tuoheng.admin.mapper.RoadInformationMapper; |
@@ -2,21 +2,16 @@ package com.tuoheng.admin.service.section.query; | |||
import cn.hutool.core.collection.CollectionUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.conver.DeptConverMapper; | |||
import com.tuoheng.admin.dto.RoadSectionDto; | |||
import com.tuoheng.admin.entity.*; | |||
import com.tuoheng.admin.enums.road.QueryRoadListByDeptIdCodeEnum; | |||
import com.tuoheng.admin.enums.section.QuerySectionListByDeptIdCodeEnum; | |||
import com.tuoheng.admin.enums.code.section.QuerySectionListByDeptIdCodeEnum; | |||
import com.tuoheng.admin.mapper.*; | |||
import com.tuoheng.admin.utils.ShiroUtils; | |||
import com.tuoheng.admin.vo.DeptInfoVo; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.common.core.utils.StringUtils; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.util.ArrayList; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
@@ -48,7 +43,7 @@ public class QuerySectionListByDeptIdService { | |||
@Autowired | |||
private SectionDeptMapper sectionDeptMapper; | |||
public JsonResult getRoadList(String id) { | |||
public JsonResult getList(String id) { | |||
log.info("进入根据部门Id查询路段列表业务"); | |||
String tenantId = ShiroUtils.getTenantId(); | |||
@@ -0,0 +1,105 @@ | |||
package com.tuoheng.admin.service.section.query; | |||
import cn.hutool.core.collection.CollectionUtil; | |||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |||
import com.tuoheng.admin.entity.Dept; | |||
import com.tuoheng.admin.entity.RoadInformation; | |||
import com.tuoheng.admin.entity.Section; | |||
import com.tuoheng.admin.entity.SectionDept; | |||
import com.tuoheng.admin.enums.code.section.QuerySectionListByDeptIdCodeEnum; | |||
import com.tuoheng.admin.enums.code.section.QuerySectionListByRoadIdCodeEnum; | |||
import com.tuoheng.admin.mapper.*; | |||
import com.tuoheng.admin.utils.ShiroUtils; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.common.core.utils.StringUtils; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
import java.util.stream.Collectors; | |||
/** | |||
* 根据公路id获取该公路下路段信息列表 | |||
* | |||
* @author wanjing | |||
* @team tuoheng | |||
* @date 2022-11-24 | |||
*/ | |||
@Slf4j | |||
@Service | |||
public class QuerySectionListByRoadIdService { | |||
@Autowired | |||
private RoadInformationMapper roadInformationMapper; | |||
@Autowired | |||
private SectionMapper sectionMapper; | |||
@Autowired | |||
private RoadDeptMapper roadDeptMapper; | |||
@Autowired | |||
private SectionDeptMapper sectionDeptMapper; | |||
public JsonResult getList(String roadId) { | |||
log.info("根据公路id获取该公路下路段信息列表业务"); | |||
String tenantId = ShiroUtils.getTenantId(); | |||
// 校验 | |||
JsonResult result = this.check(tenantId, roadId); | |||
if (0 != result.getCode()) { | |||
log.info("根据公路id获取该公路下路段信息列表业务:校验失败:{}", result.getMsg()); | |||
return result; | |||
} | |||
// 获取该公路下路段列表 | |||
List<Section> sectionList = this.getSectionList(tenantId, roadId); | |||
if (CollectionUtil.isEmpty(sectionList)) { | |||
log.info("根据公路id获取该公路下路段信息列表业务:路段信息为空"); | |||
return JsonResult.error(QuerySectionListByRoadIdCodeEnum.SECTION_LIST_IS_NULL.getCode(), QuerySectionListByRoadIdCodeEnum.SECTION_LIST_IS_NULL.getMsg()); | |||
} | |||
return JsonResult.success(sectionList); | |||
} | |||
/** | |||
* 检查参数 | |||
* | |||
* @param tenantId | |||
* @param roadId | |||
* @return | |||
*/ | |||
private JsonResult check(String tenantId, String roadId) { | |||
if (StringUtils.isEmpty(roadId)) { | |||
return JsonResult.error(QuerySectionListByRoadIdCodeEnum.ROAD_ID_IS_NULL.getCode(), QuerySectionListByRoadIdCodeEnum.ROAD_ID_IS_NULL.getMsg()); | |||
} | |||
// 判断部门是否存在 | |||
RoadInformation roadInformation = roadInformationMapper.selectOne(new LambdaQueryWrapper<RoadInformation>() | |||
.eq(RoadInformation::getTenantId, tenantId) | |||
.eq(RoadInformation::getId, roadId) | |||
.eq(RoadInformation::getMark, 1)); | |||
if (null == roadInformation) { | |||
return JsonResult.error(QuerySectionListByRoadIdCodeEnum.ROAD_IS_NOT_EXIST.getCode(), QuerySectionListByRoadIdCodeEnum.ROAD_IS_NOT_EXIST.getMsg()); | |||
} | |||
return JsonResult.success(roadInformation); | |||
} | |||
/** | |||
* 查询该公路下路段信息列表 | |||
* | |||
* @param tenantId | |||
* @param roadId | |||
* @return | |||
*/ | |||
private List<Section> getSectionList(String tenantId, String roadId) { | |||
List<Section> sectionList = sectionMapper.selectList(new LambdaQueryWrapper<Section>() | |||
.eq(Section::getTenantId, tenantId) | |||
.eq(Section::getRoadId, roadId) | |||
.eq(Section::getMark, 1)); | |||
return sectionList; | |||
} | |||
} |
@@ -37,10 +37,24 @@ public class DeptInfoVo { | |||
*/ | |||
private String pid; | |||
/** | |||
* 上级部门名称 | |||
*/ | |||
private String pname; | |||
/** | |||
* 公路,路段数据 | |||
*/ | |||
private List<RoadSectionDto> roadSectionDtoList; | |||
/** | |||
* 用户数 | |||
*/ | |||
private Integer userCount; | |||
/** | |||
* 子部门数 | |||
*/ | |||
private Integer childDeptCount; | |||
} |
@@ -0,0 +1,85 @@ | |||
package com.tuoheng.admin.vo; | |||
import com.tuoheng.common.core.common.BaseQuery; | |||
import lombok.Data; | |||
/** | |||
* 查询巡检任务列表视图Vo | |||
* | |||
* @author wanjing | |||
* @team tuoheng | |||
* @date 2022-11-17 | |||
*/ | |||
@Data | |||
public class QueryInspectionPageListVo { | |||
/** | |||
* 任务编号 | |||
*/ | |||
private String code; | |||
/** | |||
* 任务名称 | |||
*/ | |||
private String name; | |||
/** | |||
* 巡检机场id | |||
*/ | |||
private Integer airportId; | |||
/** | |||
* 巡检机场名称 | |||
*/ | |||
private String airportName; | |||
/** | |||
* 巡检线路Id | |||
*/ | |||
private Integer inspectionLine; | |||
/** | |||
* 巡检线路名称 | |||
*/ | |||
private String inspectionLineName; | |||
/** | |||
* 巡检任务类型: 1 临时巡检(目前只有该一种类型) | |||
*/ | |||
private Integer type; | |||
/** | |||
* 任务状态 | |||
*/ | |||
private Integer status; | |||
/** | |||
* 巡检方式类型: 1 无人机 2机场巡逻 3 飞手值飞 | |||
*/ | |||
private Integer inspectionType; | |||
/** | |||
* 部门Id | |||
*/ | |||
private String deptId; | |||
/** | |||
* 部门名称 | |||
*/ | |||
private String deptName; | |||
/** | |||
* 已确认问题 | |||
*/ | |||
// List<> | |||
/** | |||
* 发现问题 | |||
*/ | |||
/** | |||
* 巡检时间 | |||
*/ | |||
} |
@@ -0,0 +1,26 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<!DOCTYPE mapper | |||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.tuoheng.admin.mapper.InspectionFileHandleMapper"> | |||
<resultMap type="com.tuoheng.admin.entity.InspectionFileHandle" id="InspectionFileHandleResult"> | |||
<result property="id" column="id" /> | |||
<result property="tenantId" column="tenant_id" /> | |||
<result property="inspectionFileId" column="inspection_file_id" /> | |||
<result property="handlerUser" column="handler_user" /> | |||
<result property="handlerImage" column="handler_image" /> | |||
<result property="handlerResult" column="handler_result" /> | |||
<result property="handlerTime" column="handler_time" /> | |||
<result property="createUser" column="create_user" /> | |||
<result property="createTime" column="create_time" /> | |||
<result property="updateUser" column="update_user" /> | |||
<result property="updateTime" column="update_time" /> | |||
<result property="mark" column="mark" /> | |||
</resultMap> | |||
<sql id="selectThInspectionFileHandleVo"> | |||
select id, tenant_id, inspection_file_id, handler_user, handler_image, handler_result, handler_time, create_user, create_time, update_user, update_time, mark from th_inspection_file_handle | |||
</sql> | |||
</mapper> |
@@ -0,0 +1,44 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<!DOCTYPE mapper | |||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.tuoheng.admin.mapper.InspectionFileMapper"> | |||
<resultMap type="com.tuoheng.admin.entity.InspectionFile" id="InspectionFileResult"> | |||
<result property="id" column="id" /> | |||
<result property="tenantId" column="tenant_id" /> | |||
<result property="fileCode" column="file_code" /> | |||
<result property="inspectionId" column="inspection_id" /> | |||
<result property="fileType" column="file_type" /> | |||
<result property="fileName" column="file_name" /> | |||
<result property="fileThumbnail" column="file_thumbnail" /> | |||
<result property="fileOriginal" column="file_original" /> | |||
<result property="fileImage" column="file_image" /> | |||
<result property="fileSize" column="file_size" /> | |||
<result property="latitude" column="latitude" /> | |||
<result property="longitude" column="longitude" /> | |||
<result property="location" column="location" /> | |||
<result property="gaodeLongitude" column="gaode_longitude" /> | |||
<result property="gaodeLatitude" column="gaode_latitude" /> | |||
<result property="gaodeAddress" column="gaode_address" /> | |||
<result property="questionId" column="question_id" /> | |||
<result property="source" column="source" /> | |||
<result property="questionName" column="question_name" /> | |||
<result property="content" column="content" /> | |||
<result property="questionDesc" column="question_desc" /> | |||
<result property="status" column="status" /> | |||
<result property="checkUser" column="check_user" /> | |||
<result property="checkTime" column="check_time" /> | |||
<result property="createUser" column="create_user" /> | |||
<result property="createTime" column="create_time" /> | |||
<result property="updateUser" column="update_user" /> | |||
<result property="updateTime" column="update_time" /> | |||
<result property="mark" column="mark" /> | |||
</resultMap> | |||
<sql id="selectThInspectionFileVo"> | |||
select id, tenant_id, file_code, inspection_id, file_type, file_name, file_thumbnail, file_original, file_image, file_size, latitude, longitude, location, gaode_longitude, gaode_latitude, gaode_address, question_id, source, question_name, content, question_desc, status, check_user, check_time, create_user, create_time, update_user, update_time, mark from th_inspection_file | |||
</sql> | |||
</mapper> |
@@ -76,8 +76,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
<include refid="selectInspectionVo"/> | |||
<where> | |||
<if test="1 == 1"> and mark = 1 </if> | |||
<if test="code != null and code != ''"> and code like concat('%', #{code}, '%')</if> | |||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> | |||
<if test="request.key != null and request.key != ''"> and ((code like concat('%', #{request.code}, '%')) or (name like concat('%', #{request.name}, '%'))) </if> | |||
<if test="request.airportId != null and request.airportId != 0"> and airport_id = #{request.inspectionLine} </if> | |||
<if test="request.inspectionLine != null and request.inspectionLine != 0"> and inspection_line = #{request.inspectionLine} </if> | |||
<if test="request.type != null and request.type != 0"> and type = #{request.type} </if> | |||
<if test="request.status != null and request.status != 0"> and status = #{request.status} </if> | |||
<if test="request.inspectionType != null and request.inspectionType != 0"> and inspection_type = #{request.inspectionType} </if> | |||
<!-- <if test="request.name != null and request.name != ''">--> | |||
<!-- and dept_id in--> | |||
<!-- <foreach item="id" collection="array" open="(" separator="," close=")">--> | |||
<!-- #{id}--> | |||
<!-- </foreach>--> | |||
<!-- </if>--> | |||
</where> | |||
</select> | |||
@@ -138,123 +148,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
</where> | |||
</select> | |||
<insert id="insert" parameterType="com.tuoheng.admin.entity.Inspection" | |||
keyColumn="id" keyProperty="id" useGeneratedKeys="true"> | |||
insert into th_inspection | |||
<trim prefix="(" suffix=")" suffixOverrides=","> | |||
<if test="id != null">id,</if> | |||
<if test="tenantId != null and tenantId != ''">tenant_id,</if> | |||
<if test="deptId != null and deptId != ''">dept_id,</if> | |||
<if test="code != null">code,</if> | |||
<if test="name != null">name,</if> | |||
<if test="type != null">type,</if> | |||
<if test="roadId != null and roadId != ''">road_id,</if> | |||
<if test="roadName != null">road_name,</if> | |||
<if test="sectionId != null and sectionId != ''">section_id,</if> | |||
<if test="sectionName != null">section_name,</if> | |||
<if test="inspectionType != null">inspection_type,</if> | |||
<if test="airportId != null">airport_id,</if> | |||
<if test="airportName != null">airport_name,</if> | |||
<if test="inspectionLine != null">inspection_line,</if> | |||
<if test="inspectionLineName != null">inspection_line_name,</if> | |||
<if test="equipmentId != null">equipment_id,</if> | |||
<if test="equipmentName != null">equipment_name,</if> | |||
<if test="equipmentMountId != null">equipment_mount_id,</if> | |||
<if test="equipmentMountName != null">equipment_mount_name,</if> | |||
<if test="cloudBoxId != null">cloud_box_id,</if> | |||
<if test="cloudBoxName != null">cloud_box_name,</if> | |||
<if test="boxSn != null">box_sn,</if> | |||
<if test="flightHand != null">flight_hand,</if> | |||
<if test="flightHandName != null">flight_hand_name,</if> | |||
<if test="inspectionTime != null">inspection_time,</if> | |||
<if test="executionStartTime != null">execution_start_time,</if> | |||
<if test="executionEndTime != null">execution_end_time,</if> | |||
<if test="isLive != null">is_live,</if> | |||
<if test="isTaken != null">is_taken,</if> | |||
<if test="isTilt != null">is_tilt,</if> | |||
<if test="videoUrl != null">video_url,</if> | |||
<if test="aiVideoUrl != null">ai_video_url,</if> | |||
<if test="reportUrl != null">report_url,</if> | |||
<if test="srtUrl != null">srt_url,</if> | |||
<if test="status != null">status,</if> | |||
<if test="analyseStatus != null">analyse_status,</if> | |||
<if test="progressbar != null">progressbar,</if> | |||
<if test="note != null">note,</if> | |||
<if test="weather != null">weather,</if> | |||
<if test="flyHeight != null">fly_height,</if> | |||
<if test="srtName != null">srt_name,</if> | |||
<if test="heartbeatTime != null">heartbeat_time,</if> | |||
<if test="executionStatus != null">execution_status,</if> | |||
<if test="startLongitude != null">start_longitude,</if> | |||
<if test="startLatitude != null">start_latitude,</if> | |||
<if test="endLongitude != null">end_longitude,</if> | |||
<if test="endLatitude != null">end_latitude,</if> | |||
<if test="mobile != null">mobile,</if> | |||
<if test="patrolLocation != null">patrol_location,</if> | |||
<if test="createUser != null">create_user,</if> | |||
<if test="createTime != null">create_time,</if> | |||
<if test="updateUser != null">update_user,</if> | |||
<if test="updateTime != null">update_time,</if> | |||
<if test="mark != null">mark,</if> | |||
</trim> | |||
<trim prefix="values (" suffix=")" suffixOverrides=","> | |||
<if test="id != null">#{id},</if> | |||
<if test="tenantId != null and tenantId != ''">#{tenantId},</if> | |||
<if test="deptId != null and deptId != ''">#{deptId},</if> | |||
<if test="code != null">#{code},</if> | |||
<if test="name != null">#{name},</if> | |||
<if test="type != null">#{type},</if> | |||
<if test="roadId != null and roadId != ''">#{roadId},</if> | |||
<if test="roadName != null">#{roadName},</if> | |||
<if test="sectionId != null and sectionId != ''">#{sectionId},</if> | |||
<if test="sectionName != null">#{sectionName},</if> | |||
<if test="inspectionType != null">#{inspectionType},</if> | |||
<if test="airportId != null">#{airportId},</if> | |||
<if test="airportName != null">#{airportName},</if> | |||
<if test="inspectionLine != null">#{inspectionLine},</if> | |||
<if test="inspectionLineName != null">#{inspectionLineName},</if> | |||
<if test="equipmentId != null">#{equipmentId},</if> | |||
<if test="equipmentName != null">#{equipmentName},</if> | |||
<if test="equipmentMountId != null">#{equipmentMountId},</if> | |||
<if test="equipmentMountName != null">#{equipmentMountName},</if> | |||
<if test="cloudBoxId != null">#{cloudBoxId},</if> | |||
<if test="cloudBoxName != null">#{cloudBoxName},</if> | |||
<if test="boxSn != null">#{boxSn},</if> | |||
<if test="flightHand != null">#{flightHand},</if> | |||
<if test="flightHandName != null">#{flightHandName},</if> | |||
<if test="inspectionTime != null">#{inspectionTime},</if> | |||
<if test="executionStartTime != null">#{executionStartTime},</if> | |||
<if test="executionEndTime != null">#{executionEndTime},</if> | |||
<if test="isLive != null">#{isLive},</if> | |||
<if test="isTaken != null">#{isTaken},</if> | |||
<if test="isTilt != null">#{isTilt},</if> | |||
<if test="videoUrl != null">#{videoUrl},</if> | |||
<if test="aiVideoUrl != null">#{aiVideoUrl},</if> | |||
<if test="reportUrl != null">#{reportUrl},</if> | |||
<if test="srtUrl != null">#{srtUrl},</if> | |||
<if test="status != null">#{status},</if> | |||
<if test="analyseStatus != null">#{analyseStatus},</if> | |||
<if test="progressbar != null">#{progressbar},</if> | |||
<if test="note != null">#{note},</if> | |||
<if test="weather != null">#{weather},</if> | |||
<if test="flyHeight != null">#{flyHeight},</if> | |||
<if test="srtName != null">#{srtName},</if> | |||
<if test="heartbeatTime != null">#{heartbeatTime},</if> | |||
<if test="executionStatus != null">#{executionStatus},</if> | |||
<if test="startLongitude != null">#{startLongitude},</if> | |||
<if test="startLatitude != null">#{startLatitude},</if> | |||
<if test="endLongitude != null">#{endLongitude},</if> | |||
<if test="endLatitude != null">#{endLatitude},</if> | |||
<if test="mobile != null">#{mobile},</if> | |||
<if test="patrolLocation != null">#{patrolLocation},</if> | |||
<if test="createUser != null">#{createUser},</if> | |||
<if test="createTime != null">#{createTime},</if> | |||
<if test="updateUser != null">#{updateUser},</if> | |||
<if test="updateTime != null">#{updateTime},</if> | |||
<if test="mark != null">#{mark},</if> | |||
</trim> | |||
</insert> | |||
<update id="update" parameterType="com.tuoheng.admin.entity.Inspection"> | |||
update th_inspection | |||
<trim prefix="SET" suffixOverrides=","> |
@@ -0,0 +1,42 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<!DOCTYPE mapper | |||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
<mapper namespace="com.tuoheng.admin.mapper.TenantMapper"> | |||
<resultMap type="com.tuoheng.admin.entity.Tenant" id="TenantResult"> | |||
<result property="id" column="id" /> | |||
<result property="name" column="name" /> | |||
<result property="code" column="code" /> | |||
<result property="username" column="username" /> | |||
<result property="logo" column="logo" /> | |||
<result property="portraitUrl" column="portrait_url" /> | |||
<result property="pid" column="pid" /> | |||
<result property="type" column="type" /> | |||
<result property="phone" column="phone" /> | |||
<result property="email" column="email" /> | |||
<result property="provinceCode" column="province_code" /> | |||
<result property="provinceName" column="province_name" /> | |||
<result property="cityCode" column="city_code" /> | |||
<result property="cityName" column="city_name" /> | |||
<result property="districtCode" column="district_code" /> | |||
<result property="districtName" column="district_name" /> | |||
<result property="platformName" column="platform_name" /> | |||
<result property="airportUrl" column="airport_url" /> | |||
<result property="address" column="address" /> | |||
<result property="intro" column="intro" /> | |||
<result property="status" column="status" /> | |||
<result property="note" column="note" /> | |||
<result property="sort" column="sort" /> | |||
<result property="createUser" column="create_user" /> | |||
<result property="createTime" column="create_time" /> | |||
<result property="updateUser" column="update_user" /> | |||
<result property="updateTime" column="update_time" /> | |||
<result property="mark" column="mark" /> | |||
</resultMap> | |||
<sql id="selectThTenantVo"> | |||
select id, name, code, username, logo, portrait_url, pid, type, phone, email, province_code, province_name, city_code, city_name, district_code, district_name, platform_name, airport_url, address, intro, status, note, sort, create_user, create_time, update_user, update_time, mark from th_tenant | |||
</sql> | |||
</mapper> |