diff --git a/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/controller/RouteController.java b/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/controller/RouteController.java index fea1eb5c..7b7ac10a 100644 --- a/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/controller/RouteController.java +++ b/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/controller/RouteController.java @@ -35,11 +35,11 @@ public class RouteController { routeService.saveOrUpdateEntity(inputObject, outputObject); } - @ApiOperation(id = "queryRouteList", value = "查询路线列表", method = "POST", allUse = "2") + @ApiOperation(id = "queryRouteList", value = "除分页参数还需要holderId(schoolId)查询路线列表", method = "POST", allUse = "2") @ApiImplicitParams(classBean = CommonPageInfo.class) @RequestMapping("/post/RouteController/queryRouteList") public void queryRouteList(InputObject inputObject, OutputObject outputObject) { - routeService.queryPageList(inputObject, outputObject); + routeService.queryPageListBySchoolId(inputObject, outputObject); } @ApiOperation(id = "deleteRouteById", value = "根据id删除路线", method = "DELETE", allUse = "2") @@ -54,7 +54,8 @@ public class RouteController { @ApiOperation(id = "queryRoutesByStartAndEnd", value = "根据起点id--终点id 根据路线长度升序排序", method = "GET", allUse = "2") @ApiImplicitParams({ @ApiImplicitParam(id = "startId", name = "startId", value = "起点id", required = "required"), - @ApiImplicitParam(id = "endId", name = "endId", value = "终点id", required = "required") + @ApiImplicitParam(id = "endId", name = "endId", value = "终点id", required = "required"), + @ApiImplicitParam(id = "schoolId", name = "schoolId", value = "学校id", required = "required"), }) @RequestMapping("/post/RouteController/queryRoutesByStartAndEnd") public void queryRoutesByStartAndEnd(InputObject inputObject, OutputObject outputObject) { diff --git a/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/entity/Routes.java b/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/entity/Routes.java index 014ffb16..d0ae81d3 100644 --- a/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/entity/Routes.java +++ b/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/entity/Routes.java @@ -28,6 +28,10 @@ public class Routes extends OperatorUserInfo { @ApiModelProperty(value = "主键id。为空时新增,不为空时编辑") private String id; + @TableField("school_id") + @ApiModelProperty(value = "学校id",required = "required") + private String schoolId; + @TableField("start_id") @ApiModelProperty(value = "起始地点id",required = "required") private String startId; diff --git a/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/routeenum/RouteTypeEnum.java b/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/routeenum/RouteTypeEnum.java new file mode 100644 index 00000000..8c52682e --- /dev/null +++ b/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/routeenum/RouteTypeEnum.java @@ -0,0 +1,35 @@ +package com.skyeye.school.route.routeenum; + +import com.skyeye.common.base.classenum.SkyeyeEnumClass; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; + + +/** + * @ClassName: RouteTypeEnum + * @Description: 路由类型枚举 + * @author: lqu + * @date: 2023/9/5 17:16 + * @Copyright: 2023 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved. + * 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的 + */ +@Getter +@NoArgsConstructor +@AllArgsConstructor +public enum RouteTypeEnum implements SkyeyeEnumClass { + + ROUTE_TYPE_WALK(1,"步行",true,true), + ROUTE_TYPE_CAR(2,"驾车",true,false), + ROUTE_TYPE_EV(3,"电动车",true,false), + ROUTE_TYPE_RIDE(4,"骑行",true,false); + + private Integer key; + + private String value; + + private Boolean show; + + private Boolean isDefault; +} + diff --git a/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/service/RoutesService.java b/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/service/RoutesService.java index 7bc99fb2..bdd5e9bf 100644 --- a/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/service/RoutesService.java +++ b/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/service/RoutesService.java @@ -17,4 +17,5 @@ public interface RoutesService extends SkyeyeBusinessService { void queryRoutesByStartAndEnd(InputObject inputObject, OutputObject outputObject); + void queryPageListBySchoolId(InputObject inputObject, OutputObject outputObject); } diff --git a/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/service/impl/RouteServiceImpl.java b/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/service/impl/RouteServiceImpl.java index 28ec5339..bbd2adb3 100644 --- a/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/service/impl/RouteServiceImpl.java +++ b/skyeye-school/school-pro/src/main/java/com/skyeye/school/route/service/impl/RouteServiceImpl.java @@ -1,11 +1,15 @@ package com.skyeye.school.route.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; import com.skyeye.annotation.service.SkyeyeService; import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl; +import com.skyeye.common.entity.search.CommonPageInfo; import com.skyeye.common.object.InputObject; import com.skyeye.common.object.OutputObject; import com.skyeye.common.util.mybatisplus.MybatisPlusUtil; +import com.skyeye.eve.service.IAuthUserService; import com.skyeye.rest.wall.user.service.IUserService; import com.skyeye.school.building.entity.TeachBuilding; import com.skyeye.school.building.service.TeachBuildingService; @@ -38,18 +42,11 @@ public class RouteServiceImpl extends SkyeyeBusinessServiceImpl> queryPageDataList(InputObject inputObject) { - List> beans = super.queryPageDataList(inputObject); - userService.setMationForMap(beans, "createId", "createMation"); - return beans; - } + @Autowired + private IAuthUserService iAuthUserService; @Override @Transactional @@ -65,9 +62,11 @@ public class RouteServiceImpl extends SkyeyeBusinessServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq(MybatisPlusUtil.toColumns(Routes::getStartId), startId) .eq(MybatisPlusUtil.toColumns(Routes::getEndId), endId) + .eq(MybatisPlusUtil.toColumns(Routes::getSchoolId),schoolId) .orderByAsc(MybatisPlusUtil.toColumns(Routes::getRouteLength)); List bean = list(queryWrapper); for (Routes routes : bean) { @@ -81,6 +80,20 @@ public class RouteServiceImpl extends SkyeyeBusinessServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(MybatisPlusUtil.toColumns(Routes::getSchoolId), schoolId); + List bean = list(queryWrapper); + iAuthUserService.setName(bean,"createId","createName"); + iAuthUserService.setName(bean,"lastUpdateId","lastUpdateName"); + outputObject.setBeans(bean); + outputObject.settotal(page.getTotal()); + } + @Override public void createPostpose(Routes entity, String userId) { String startName= teachBuildingService.selectById(entity.getStartId()).getName();