fit:增加批量删除分组航线功能
This commit is contained in:
parent
ea0a741933
commit
7e426b3bc7
|
|
@ -48,7 +48,7 @@ public class AirlineFileController extends BaseController {
|
||||||
@Operation(summary = "编辑航线文件描述信息")
|
@Operation(summary = "编辑航线文件描述信息")
|
||||||
public AjaxResult edit(@RequestBody AirlineFileVO entity) {
|
public AjaxResult edit(@RequestBody AirlineFileVO entity) {
|
||||||
AirlineFileDTO dto = AirlineFileControllerConvert.to(entity);
|
AirlineFileDTO dto = AirlineFileControllerConvert.to(entity);
|
||||||
return success(airlineFileService.save(dto));
|
return success(airlineFileService.update(dto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ruoyi.airline.controller;
|
package com.ruoyi.airline.controller;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
|
||||||
import com.ruoyi.airline.api.domain.AirlineFileGroupInfoVO;
|
import com.ruoyi.airline.api.domain.AirlineFileGroupInfoVO;
|
||||||
import com.ruoyi.airline.controller.convert.AirlineFileGroupInfoControllerConvert;
|
import com.ruoyi.airline.controller.convert.AirlineFileGroupInfoControllerConvert;
|
||||||
import com.ruoyi.airline.service.api.IAirlineFileGroupInfoService;
|
import com.ruoyi.airline.service.api.IAirlineFileGroupInfoService;
|
||||||
|
|
@ -127,6 +128,28 @@ public class AirlineFileGroupInfoController extends BaseController {
|
||||||
throw new BaseException("删除失败");
|
throw new BaseException("删除失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 批量删除分组详情
|
||||||
|
* @param airLineIds
|
||||||
|
* @return
|
||||||
|
* @throws BaseException
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/batchDelete/{groupId}")
|
||||||
|
@Operation(summary = "批量删除分组详情")
|
||||||
|
public AjaxResult delete(@RequestBody List<Long> airLineIds, @PathVariable("groupId") Long groupId) throws BaseException {
|
||||||
|
if (groupId == null) {
|
||||||
|
throw new BaseException("分组ID不能为空");
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isEmpty(airLineIds)) {
|
||||||
|
throw new BaseException("没有需要删除的航线");
|
||||||
|
}
|
||||||
|
Long result = iAirlineFileGroupInfoService.deleteGroupInfoBatch(airLineIds, groupId);
|
||||||
|
if (result > 0) {
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
|
throw new BaseException("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 移动分组详情到新分组
|
* 移动分组详情到新分组
|
||||||
* @param vo
|
* @param vo
|
||||||
|
|
|
||||||
|
|
@ -41,4 +41,13 @@ public interface IAirlineFileGroupInfoDomain {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
Long moveGroupInfo(Long oldGroupId, Long newGroupId, Long airlineId);
|
Long moveGroupInfo(Long oldGroupId, Long newGroupId, Long airlineId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除分组详情
|
||||||
|
*
|
||||||
|
* @param airLineIds 航线ID列表
|
||||||
|
* @param groupId 分组ID
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
Long deleteGroupInfoBatch(List<Long> airLineIds, Long groupId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,4 +58,9 @@ public class AirlineFileGroupInfoDomainImpl implements IAirlineFileGroupInfoDoma
|
||||||
public Long moveGroupInfo(Long oldGroupId, Long newGroupId, Long airlineId) {
|
public Long moveGroupInfo(Long oldGroupId, Long newGroupId, Long airlineId) {
|
||||||
return airlineFileGroupInfoMapper.updateGroupId(oldGroupId, newGroupId, airlineId);
|
return airlineFileGroupInfoMapper.updateGroupId(oldGroupId, newGroupId, airlineId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long deleteGroupInfoBatch(List<Long> airLineIds, Long groupId) {
|
||||||
|
return airlineFileGroupInfoMapper.deleteGroupInfoBatch(airLineIds, groupId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,4 +36,13 @@ public interface AirlineFileGroupInfoMapper {
|
||||||
* @return 影响的行数
|
* @return 影响的行数
|
||||||
*/
|
*/
|
||||||
Long updateGroupId(Long oldGroupId, Long newGroupId, Long airlineId);
|
Long updateGroupId(Long oldGroupId, Long newGroupId, Long airlineId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除分组详情
|
||||||
|
*
|
||||||
|
* @param airLineIds 航线ID列表
|
||||||
|
* @param groupId 分组ID
|
||||||
|
* @return 影响的行数
|
||||||
|
*/
|
||||||
|
Long deleteGroupInfoBatch(List<Long> airLineIds, Long groupId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,4 +26,13 @@ public interface IAirlineFileGroupInfoService {
|
||||||
* @throws BaseException
|
* @throws BaseException
|
||||||
*/
|
*/
|
||||||
Long moveGroupInfo(AirlineFileGroupInfoDTO dto, Long groupId) throws BaseException;
|
Long moveGroupInfo(AirlineFileGroupInfoDTO dto, Long groupId) throws BaseException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除分组详情
|
||||||
|
* @param airLineIds 航线ID列表
|
||||||
|
* @param groupId 分组ID
|
||||||
|
* @return
|
||||||
|
* @throws BaseException
|
||||||
|
*/
|
||||||
|
Long deleteGroupInfoBatch(List<Long> airLineIds, Long groupId) throws BaseException;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,4 +101,14 @@ public class AirlineFileServiceGroupInfoImpl implements IAirlineFileGroupInfoSer
|
||||||
return iAirlineFileGroupInfoDomain.moveGroupInfo(dto.getGroupId(), groupId, dto.getAirlineId());
|
return iAirlineFileGroupInfoDomain.moveGroupInfo(dto.getGroupId(), groupId, dto.getAirlineId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long deleteGroupInfoBatch(List<Long> airLineIds, Long groupId) throws BaseException {
|
||||||
|
// 检查参数
|
||||||
|
if (groupId == null || airLineIds == null || airLineIds.isEmpty()) {
|
||||||
|
throw new BaseException("分组ID和航线ID列表不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用domain层批量删除方法
|
||||||
|
return iAirlineFileGroupInfoDomain.deleteGroupInfoBatch(airLineIds, groupId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -75,4 +75,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and group_id = #{oldGroupId}
|
and group_id = #{oldGroupId}
|
||||||
and airline_id = #{airlineId}
|
and airline_id = #{airlineId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!-- 批量删除分组详情(软删除) -->
|
||||||
|
<update id="deleteGroupInfoBatch">
|
||||||
|
update airline_file_group_info
|
||||||
|
set del_flag = 1,
|
||||||
|
deleted_time = now()
|
||||||
|
where del_flag = 0
|
||||||
|
and group_id = #{groupId}
|
||||||
|
and airline_id in
|
||||||
|
<foreach item="airlineId" collection="airLineIds" open="(" separator="," close=")">
|
||||||
|
#{airlineId}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -55,4 +55,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and afgi.group_id = #{groupId}
|
and afgi.group_id = #{groupId}
|
||||||
and af.name like concat(#{name}, '%')
|
and af.name like concat(#{name}, '%')
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 更新航线文件 -->
|
||||||
|
<update id="update" parameterType="com.ruoyi.airline.mapper.entity.AirlineFileEntity">
|
||||||
|
update airline_file
|
||||||
|
set name = #{name},
|
||||||
|
air_vendor = #{airVendor},
|
||||||
|
air_type = #{airType},
|
||||||
|
file_name = #{fileName},
|
||||||
|
file_url = #{fileUrl},
|
||||||
|
type = #{type},
|
||||||
|
source = #{source},
|
||||||
|
status = #{status},
|
||||||
|
file_md5 = #{fileMd5},
|
||||||
|
update_by = #{updateBy},
|
||||||
|
update_time = now(),
|
||||||
|
remark = #{remark}
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue