feat:调整查询航线分组查询接口

This commit is contained in:
gyb 2026-02-26 17:33:13 +08:00
parent a7cea1a5fb
commit c0d7b808ad
8 changed files with 25 additions and 43 deletions

View File

@ -43,7 +43,7 @@ public class AirlineFileController extends BaseController {
* @return * @return
*/ */
// @RequiresPermissions("airline:file:edit") // @RequiresPermissions("airline:file:edit")
@Log(title = "修改航线属性", businessType = BusinessType.UPDATE) // @Log(title = "修改航线属性", businessType = BusinessType.UPDATE)
@PutMapping("/edit") @PutMapping("/edit")
@Operation(summary = "编辑航线文件描述信息") @Operation(summary = "编辑航线文件描述信息")
public AjaxResult edit(@RequestBody AirlineFileVO entity) { public AjaxResult edit(@RequestBody AirlineFileVO entity) {
@ -53,14 +53,14 @@ public class AirlineFileController extends BaseController {
/** /**
* 长江口 * 创建航线
* <p> * <p>
* kmz类似zip一般情况下内部包含kml和wpml两个文件 * kmz类似zip一般情况下内部包含kml和wpml两个文件
* *
* @param vo * @param vo
*/ */
// @RequiresPermissions("airline:file:parseAndUpload") // @RequiresPermissions("airline:file:parseAndUpload")
@Log(title = "创建航线", businessType = BusinessType.UPDATE) // @Log(title = "创建航线", businessType = BusinessType.UPDATE)
@PostMapping("/createOrUpdate") @PostMapping("/createOrUpdate")
@Operation(summary = "编辑航线文件内容,生产航点新文件") @Operation(summary = "编辑航线文件内容,生产航点新文件")
public AjaxResult createOrUpdate(@RequestBody AirlineFileVO vo) { public AjaxResult createOrUpdate(@RequestBody AirlineFileVO vo) {

View File

@ -45,7 +45,7 @@ public class AirlineFileGroupController extends BaseController {
@Operation(summary = "获取所有的航线分组") @Operation(summary = "获取所有的航线分组")
public TableDataInfo index(AirlineFileGroupVO airlineFileVO) { public TableDataInfo index(AirlineFileGroupVO airlineFileVO) {
startPage(); startPage();
airlineFileVO.setUserId(SecurityUtils.getUserId()); airlineFileVO.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
AirlineFileGroupDTO dto = AirlineFileGroupControllerConvert.to(airlineFileVO); AirlineFileGroupDTO dto = AirlineFileGroupControllerConvert.to(airlineFileVO);
List<AirlineFileGroupDTO> list = iAirlineFileGroupService.selectGroupList(dto); List<AirlineFileGroupDTO> list = iAirlineFileGroupService.selectGroupList(dto);
List<AirlineFileGroupVO> result = AirlineFileGroupControllerConvert.toApiDomainList(list); List<AirlineFileGroupVO> result = AirlineFileGroupControllerConvert.toApiDomainList(list);
@ -66,11 +66,11 @@ public class AirlineFileGroupController extends BaseController {
* 新增分组 * 新增分组
*/ */
// @RequiresPermissions("airline:group:add") // @RequiresPermissions("airline:group:add")
@Log(title = "新增分组", businessType = BusinessType.INSERT) // @Log(title = "新增分组", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
@Operation(summary = "新增分组") @Operation(summary = "新增分组")
public AjaxResult add(@Validated @RequestBody AirlineFileGroupVO group) { public AjaxResult add(@Validated @RequestBody AirlineFileGroupVO group) {
group.setUserId(SecurityUtils.getUserId()); group.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
AirlineFileGroupDTO dto = AirlineFileGroupControllerConvert.to(group); AirlineFileGroupDTO dto = AirlineFileGroupControllerConvert.to(group);
if (iAirlineFileGroupService.checkGroupNameUnique(dto)) { if (iAirlineFileGroupService.checkGroupNameUnique(dto)) {
return error("新增分组'" + group.getGroupName() + "'失败,分组名称已存在"); return error("新增分组'" + group.getGroupName() + "'失败,分组名称已存在");
@ -82,11 +82,11 @@ public class AirlineFileGroupController extends BaseController {
* 修改分组 * 修改分组
*/ */
// @RequiresPermissions("airline:group:edit") // @RequiresPermissions("airline:group:edit")
@Log(title = "修改分组", businessType = BusinessType.UPDATE) // @Log(title = "修改分组", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
@Operation(summary = "修改分组") @Operation(summary = "修改分组")
public AjaxResult edit(@Validated @RequestBody AirlineFileGroupVO group) { public AjaxResult edit(@Validated @RequestBody AirlineFileGroupVO group) {
group.setUserId(SecurityUtils.getUserId()); group.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
AirlineFileGroupDTO dto = AirlineFileGroupControllerConvert.to(group); AirlineFileGroupDTO dto = AirlineFileGroupControllerConvert.to(group);
if (iAirlineFileGroupService.checkGroupNameUnique(dto)) { if (iAirlineFileGroupService.checkGroupNameUnique(dto)) {
return error("修改分组'" + group.getGroupName() + "'失败,分组名称已存在"); return error("修改分组'" + group.getGroupName() + "'失败,分组名称已存在");
@ -98,7 +98,7 @@ public class AirlineFileGroupController extends BaseController {
* 删除分组前端校验分组下是否有航线弹出确认删除提示如果确认会将分组及航线一起删除 * 删除分组前端校验分组下是否有航线弹出确认删除提示如果确认会将分组及航线一起删除
*/ */
// @RequiresPermissions("airline:group:remove") // @RequiresPermissions("airline:group:remove")
@Log(title = "删除分组", businessType = BusinessType.DELETE) // @Log(title = "删除分组", businessType = BusinessType.DELETE)
@DeleteMapping("/delete/{groupId}") @DeleteMapping("/delete/{groupId}")
@Operation(summary = "删除分组") @Operation(summary = "删除分组")
public AjaxResult removeByQueryParam(@PathVariable("groupId") Long groupId) { public AjaxResult removeByQueryParam(@PathVariable("groupId") Long groupId) {
@ -115,7 +115,7 @@ public class AirlineFileGroupController extends BaseController {
@Operation(summary = "根据用户ID查询所有符合条件的航线") @Operation(summary = "根据用户ID查询所有符合条件的航线")
public TableDataInfo selectAirlineListByUserId(AirlineFileDTO dto) { public TableDataInfo selectAirlineListByUserId(AirlineFileDTO dto) {
startPage(); startPage();
dto.setUserId(SecurityUtils.getUserId()); dto.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
List<AirlineFileDTO> list = iAirlineFileGroupService.selectAirlineListByUserId(dto); List<AirlineFileDTO> list = iAirlineFileGroupService.selectAirlineListByUserId(dto);
return getDataTable(list); return getDataTable(list);
} }

View File

@ -24,10 +24,6 @@ public class AirlineFileGroup extends ExBaseEntity {
* 分组名称 * 分组名称
*/ */
private String groupName; private String groupName;
/**
* 用户ID分组自带用户归属 后期权限都是基于用户ID进行
*/
private Long userId;
/** /**
* 航线数量 * 航线数量
@ -40,7 +36,6 @@ public class AirlineFileGroup extends ExBaseEntity {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("groupId", getGroupId()) .append("groupId", getGroupId())
.append("groupName", getGroupName()) .append("groupName", getGroupName())
.append("userId", getUserId())
.append("airlineCount", getAirlineCount()) .append("airlineCount", getAirlineCount())
.toString(); .toString();
} }

View File

@ -23,10 +23,6 @@ public class AirlineFileGroupEntity extends ExBaseEntity {
* 分组名称 * 分组名称
*/ */
private String groupName; private String groupName;
/**
* 用户ID分组自带用户归属 后期权限都是基于用户ID进行
*/
private Long userId;
/** /**
* 航线数量 * 航线数量
@ -39,7 +35,6 @@ public class AirlineFileGroupEntity extends ExBaseEntity {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("groupId", getGroupId()) .append("groupId", getGroupId())
.append("groupName", getGroupName()) .append("groupName", getGroupName())
.append("userId", getUserId())
.toString(); .toString();
} }
} }

View File

@ -25,10 +25,6 @@ public class AirlineFileGroupDTO extends BaseEntity {
* 分组名称 * 分组名称
*/ */
private String groupName; private String groupName;
/**
* 用户ID分组自带用户归属 后期权限都是基于用户ID进行
*/
private Long userId;
/** /**
@ -46,7 +42,6 @@ public class AirlineFileGroupDTO extends BaseEntity {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("groupId", getGroupId()) .append("groupId", getGroupId())
.append("groupName", getGroupName()) .append("groupName", getGroupName())
.append("userId", getUserId())
.toString(); .toString();
} }
} }

View File

@ -52,7 +52,7 @@ public class AirlineFileServiceGroupImpl implements IAirlineFileGroupService {
// 2删除分组 // 2删除分组
AirlineFileGroup model2 = new AirlineFileGroup(); AirlineFileGroup model2 = new AirlineFileGroup();
model2.setGroupId(groupId); model2.setGroupId(groupId);
model2.setUserId(userId); model2.setCreateBy(String.valueOf(userId));
return iAirlineFileGroupDomain.deletegroup(model2); return iAirlineFileGroupDomain.deletegroup(model2);
} }
@ -99,7 +99,7 @@ public class AirlineFileServiceGroupImpl implements IAirlineFileGroupService {
@Override @Override
public AirlineFileGroupDTO selectAirLineListsByGroupId(Long userId, Long groupId) { public AirlineFileGroupDTO selectAirLineListsByGroupId(Long userId, Long groupId) {
AirlineFileGroupDTO dto = new AirlineFileGroupDTO(); AirlineFileGroupDTO dto = new AirlineFileGroupDTO();
dto.setUserId(userId); dto.setCreateBy(String.valueOf(userId));
dto.setGroupId(groupId); dto.setGroupId(groupId);
List<AirlineFileGroupInfo> airlineFileGroupInfoDTOS = iAirlineFileGroupInfoDomain.selectGroupInfoListById(groupId); List<AirlineFileGroupInfo> airlineFileGroupInfoDTOS = iAirlineFileGroupInfoDomain.selectGroupInfoListById(groupId);
if (!CollectionUtils.isEmpty(airlineFileGroupInfoDTOS)) { if (!CollectionUtils.isEmpty(airlineFileGroupInfoDTOS)) {

View File

@ -20,9 +20,8 @@ CREATE TABLE IF NOT EXISTS airline_file (
-- 创建航线分组表 -- 创建航线分组表
CREATE TABLE IF NOT EXISTS airline_file_group ( CREATE TABLE IF NOT EXISTS airline_file_group (
group_id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID', group_id BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '分组ID',
group_name VARCHAR(255) NOT NULL COMMENT '分组名称', group_name VARCHAR(255) NOT NULL COMMENT '分组名称',
user_id BIGINT(20) NOT NULL COMMENT '用户ID分组自带用户归属。后期权限都是基于用户ID进行',
del_flag BIGINT(20) DEFAULT 0 COMMENT '删除标识0.未删除默认1已删除', del_flag BIGINT(20) DEFAULT 0 COMMENT '删除标识0.未删除默认1已删除',
deleted_by VARCHAR(64) DEFAULT '' COMMENT '删除者', deleted_by VARCHAR(64) DEFAULT '' COMMENT '删除者',
deleted_time DATETIME COMMENT '删除时间', deleted_time DATETIME COMMENT '删除时间',

View File

@ -8,7 +8,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap id="AirlineFileGroupResult" type="com.ruoyi.airline.mapper.entity.AirlineFileGroupEntity"> <resultMap id="AirlineFileGroupResult" type="com.ruoyi.airline.mapper.entity.AirlineFileGroupEntity">
<id property="groupId" column="group_id" /> <id property="groupId" column="group_id" />
<result property="groupName" column="group_name" /> <result property="groupName" column="group_name" />
<result property="userId" column="user_id" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
@ -50,8 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="groupId != null"> <if test="groupId != null">
and group_id != #{groupId} and group_id != #{groupId}
</if> </if>
<if test="userId != null"> <if test="createBy != null and createBy != ''">
and user_id = #{userId} and create_by = #{createBy}
</if> </if>
</select> </select>
@ -62,8 +61,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
deleted_by = #{deletedBy}, deleted_by = #{deletedBy},
deleted_time = now() deleted_time = now()
where group_id = #{groupId} where group_id = #{groupId}
<if test="userId != null"> <if test="createBy != null and createBy != ''">
and user_id = #{userId} and create_by = #{createBy}
</if> </if>
</update> </update>
@ -75,15 +74,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_time = now() update_time = now()
where group_id = #{groupId} where group_id = #{groupId}
and del_flag = 0 and del_flag = 0
<if test="userId != null"> <if test="createBy != null and createBy != ''">
and user_id = #{userId} and create_by = #{createBy}
</if> </if>
</update> </update>
<!-- 插入分组 --> <!-- 插入分组 -->
<insert id="insertGroup" parameterType="com.ruoyi.airline.mapper.entity.AirlineFileGroupEntity"> <insert id="insertGroup" parameterType="com.ruoyi.airline.mapper.entity.AirlineFileGroupEntity">
insert into airline_file_group (group_name, user_id, create_by, create_time, update_by, update_time, del_flag) insert into airline_file_group (group_name, create_by, create_time, update_by, update_time, del_flag)
values (#{groupName}, #{userId}, #{createBy}, now(), #{updateBy}, now(), 0) values (#{groupName}, #{createBy}, now(), #{updateBy}, now(), 0)
</insert> </insert>
<!-- 查询分组列表 --> <!-- 查询分组列表 -->
@ -91,7 +90,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select select
afg.group_id, afg.group_id,
afg.group_name, afg.group_name,
afg.user_id,
afg.create_by, afg.create_by,
afg.create_time, afg.create_time,
afg.update_by, afg.update_by,
@ -112,8 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="groupName != null and groupName != ''"> <if test="groupName != null and groupName != ''">
and afg.group_name like concat('%', #{groupName}, '%') and afg.group_name like concat('%', #{groupName}, '%')
</if> </if>
<if test="userId != null"> <if test="createBy != null and createBy != ''">
and afg.user_id = #{userId} and afg.create_by = #{createBy}
</if> </if>
</where> </where>
</select> </select>
@ -127,8 +125,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join airline_file_group_info afgi on af.id = afgi.airline_id and afgi.del_flag = 0 left join airline_file_group_info afgi on af.id = afgi.airline_id and afgi.del_flag = 0
left join airline_file_group afg on afgi.group_id = afg.group_id and afg.del_flag = 0 left join airline_file_group afg on afgi.group_id = afg.group_id and afg.del_flag = 0
<where> <where>
<if test="userId != null"> <if test="createBy != null and createBy != ''">
and afg.user_id = #{userId} and afg.create_by = #{createBy}
</if> </if>
<if test="name != null and name != ''"> <if test="name != null and name != ''">
and af.name like concat('%', #{name}, '%') and af.name like concat('%', #{name}, '%')