feat:调整查询航线分组查询接口
This commit is contained in:
parent
a7cea1a5fb
commit
c0d7b808ad
|
|
@ -43,7 +43,7 @@ public class AirlineFileController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
// @RequiresPermissions("airline:file:edit")
|
||||
@Log(title = "修改航线属性", businessType = BusinessType.UPDATE)
|
||||
// @Log(title = "修改航线属性", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/edit")
|
||||
@Operation(summary = "编辑航线文件描述信息")
|
||||
public AjaxResult edit(@RequestBody AirlineFileVO entity) {
|
||||
|
|
@ -53,14 +53,14 @@ public class AirlineFileController extends BaseController {
|
|||
|
||||
|
||||
/**
|
||||
* 长江口
|
||||
* 创建航线
|
||||
* <p>
|
||||
* kmz类似zip,一般情况下内部包含kml和wpml两个文件
|
||||
*
|
||||
* @param vo
|
||||
*/
|
||||
// @RequiresPermissions("airline:file:parseAndUpload")
|
||||
@Log(title = "创建航线", businessType = BusinessType.UPDATE)
|
||||
// @Log(title = "创建航线", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/createOrUpdate")
|
||||
@Operation(summary = "编辑航线文件内容,生产航点新文件")
|
||||
public AjaxResult createOrUpdate(@RequestBody AirlineFileVO vo) {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class AirlineFileGroupController extends BaseController {
|
|||
@Operation(summary = "获取所有的航线分组")
|
||||
public TableDataInfo index(AirlineFileGroupVO airlineFileVO) {
|
||||
startPage();
|
||||
airlineFileVO.setUserId(SecurityUtils.getUserId());
|
||||
airlineFileVO.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
|
||||
AirlineFileGroupDTO dto = AirlineFileGroupControllerConvert.to(airlineFileVO);
|
||||
List<AirlineFileGroupDTO> list = iAirlineFileGroupService.selectGroupList(dto);
|
||||
List<AirlineFileGroupVO> result = AirlineFileGroupControllerConvert.toApiDomainList(list);
|
||||
|
|
@ -66,11 +66,11 @@ public class AirlineFileGroupController extends BaseController {
|
|||
* 新增分组
|
||||
*/
|
||||
// @RequiresPermissions("airline:group:add")
|
||||
@Log(title = "新增分组", businessType = BusinessType.INSERT)
|
||||
// @Log(title = "新增分组", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@Operation(summary = "新增分组")
|
||||
public AjaxResult add(@Validated @RequestBody AirlineFileGroupVO group) {
|
||||
group.setUserId(SecurityUtils.getUserId());
|
||||
group.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
|
||||
AirlineFileGroupDTO dto = AirlineFileGroupControllerConvert.to(group);
|
||||
if (iAirlineFileGroupService.checkGroupNameUnique(dto)) {
|
||||
return error("新增分组'" + group.getGroupName() + "'失败,分组名称已存在");
|
||||
|
|
@ -82,11 +82,11 @@ public class AirlineFileGroupController extends BaseController {
|
|||
* 修改分组
|
||||
*/
|
||||
// @RequiresPermissions("airline:group:edit")
|
||||
@Log(title = "修改分组", businessType = BusinessType.UPDATE)
|
||||
// @Log(title = "修改分组", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
@Operation(summary = "修改分组")
|
||||
public AjaxResult edit(@Validated @RequestBody AirlineFileGroupVO group) {
|
||||
group.setUserId(SecurityUtils.getUserId());
|
||||
group.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
|
||||
AirlineFileGroupDTO dto = AirlineFileGroupControllerConvert.to(group);
|
||||
if (iAirlineFileGroupService.checkGroupNameUnique(dto)) {
|
||||
return error("修改分组'" + group.getGroupName() + "'失败,分组名称已存在");
|
||||
|
|
@ -98,7 +98,7 @@ public class AirlineFileGroupController extends BaseController {
|
|||
* 删除分组,前端校验分组下是否有航线弹出确认删除提示,如果确认会将分组及航线一起删除。
|
||||
*/
|
||||
// @RequiresPermissions("airline:group:remove")
|
||||
@Log(title = "删除分组", businessType = BusinessType.DELETE)
|
||||
// @Log(title = "删除分组", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/delete/{groupId}")
|
||||
@Operation(summary = "删除分组")
|
||||
public AjaxResult removeByQueryParam(@PathVariable("groupId") Long groupId) {
|
||||
|
|
@ -115,7 +115,7 @@ public class AirlineFileGroupController extends BaseController {
|
|||
@Operation(summary = "根据用户ID查询所有符合条件的航线")
|
||||
public TableDataInfo selectAirlineListByUserId(AirlineFileDTO dto) {
|
||||
startPage();
|
||||
dto.setUserId(SecurityUtils.getUserId());
|
||||
dto.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
|
||||
List<AirlineFileDTO> list = iAirlineFileGroupService.selectAirlineListByUserId(dto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,10 +24,6 @@ public class AirlineFileGroup extends ExBaseEntity {
|
|||
* 分组名称
|
||||
*/
|
||||
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)
|
||||
.append("groupId", getGroupId())
|
||||
.append("groupName", getGroupName())
|
||||
.append("userId", getUserId())
|
||||
.append("airlineCount", getAirlineCount())
|
||||
.toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,10 +23,6 @@ public class AirlineFileGroupEntity extends ExBaseEntity {
|
|||
* 分组名称
|
||||
*/
|
||||
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)
|
||||
.append("groupId", getGroupId())
|
||||
.append("groupName", getGroupName())
|
||||
.append("userId", getUserId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,10 +25,6 @@ public class AirlineFileGroupDTO extends BaseEntity {
|
|||
* 分组名称
|
||||
*/
|
||||
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)
|
||||
.append("groupId", getGroupId())
|
||||
.append("groupName", getGroupName())
|
||||
.append("userId", getUserId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class AirlineFileServiceGroupImpl implements IAirlineFileGroupService {
|
|||
// 2、删除分组
|
||||
AirlineFileGroup model2 = new AirlineFileGroup();
|
||||
model2.setGroupId(groupId);
|
||||
model2.setUserId(userId);
|
||||
model2.setCreateBy(String.valueOf(userId));
|
||||
return iAirlineFileGroupDomain.deletegroup(model2);
|
||||
|
||||
}
|
||||
|
|
@ -99,7 +99,7 @@ public class AirlineFileServiceGroupImpl implements IAirlineFileGroupService {
|
|||
@Override
|
||||
public AirlineFileGroupDTO selectAirLineListsByGroupId(Long userId, Long groupId) {
|
||||
AirlineFileGroupDTO dto = new AirlineFileGroupDTO();
|
||||
dto.setUserId(userId);
|
||||
dto.setCreateBy(String.valueOf(userId));
|
||||
dto.setGroupId(groupId);
|
||||
List<AirlineFileGroupInfo> airlineFileGroupInfoDTOS = iAirlineFileGroupInfoDomain.selectGroupInfoListById(groupId);
|
||||
if (!CollectionUtils.isEmpty(airlineFileGroupInfoDTOS)) {
|
||||
|
|
|
|||
|
|
@ -20,9 +20,8 @@ CREATE TABLE IF NOT EXISTS airline_file (
|
|||
|
||||
-- 创建航线分组表
|
||||
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 '分组名称',
|
||||
user_id BIGINT(20) NOT NULL COMMENT '用户ID,分组自带用户归属。后期权限都是基于用户ID进行',
|
||||
del_flag BIGINT(20) DEFAULT 0 COMMENT '删除标识,0.未删除(默认);1,已删除',
|
||||
deleted_by VARCHAR(64) DEFAULT '' COMMENT '删除者',
|
||||
deleted_time DATETIME COMMENT '删除时间',
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap id="AirlineFileGroupResult" type="com.ruoyi.airline.mapper.entity.AirlineFileGroupEntity">
|
||||
<id property="groupId" column="group_id" />
|
||||
<result property="groupName" column="group_name" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
|
|
@ -50,8 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="groupId != null">
|
||||
and group_id != #{groupId}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
|
@ -62,8 +61,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
deleted_by = #{deletedBy},
|
||||
deleted_time = now()
|
||||
where group_id = #{groupId}
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
|
|
@ -75,15 +74,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update_time = now()
|
||||
where group_id = #{groupId}
|
||||
and del_flag = 0
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and create_by = #{createBy}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
<!-- 插入分组 -->
|
||||
<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)
|
||||
values (#{groupName}, #{userId}, #{createBy}, now(), #{updateBy}, now(), 0)
|
||||
insert into airline_file_group (group_name, create_by, create_time, update_by, update_time, del_flag)
|
||||
values (#{groupName}, #{createBy}, now(), #{updateBy}, now(), 0)
|
||||
</insert>
|
||||
|
||||
<!-- 查询分组列表 -->
|
||||
|
|
@ -91,7 +90,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select
|
||||
afg.group_id,
|
||||
afg.group_name,
|
||||
afg.user_id,
|
||||
afg.create_by,
|
||||
afg.create_time,
|
||||
afg.update_by,
|
||||
|
|
@ -112,8 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="groupName != null and groupName != ''">
|
||||
and afg.group_name like concat('%', #{groupName}, '%')
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and afg.user_id = #{userId}
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and afg.create_by = #{createBy}
|
||||
</if>
|
||||
</where>
|
||||
</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 afg on afgi.group_id = afg.group_id and afg.del_flag = 0
|
||||
<where>
|
||||
<if test="userId != null">
|
||||
and afg.user_id = #{userId}
|
||||
<if test="createBy != null and createBy != ''">
|
||||
and afg.create_by = #{createBy}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and af.name like concat('%', #{name}, '%')
|
||||
|
|
|
|||
Loading…
Reference in New Issue