| | |
| | | @GetMapping("/source/delete/{ids}") |
| | | @RequiresPermissions("source:delete") |
| | | public FebsResponse delSource(@PathVariable String ids) { |
| | | List<String> idList = StrUtil.split(ids, ','); |
| | | return null; |
| | | this.videoMasterSourceService.delSource(ids); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface VideoMasterSourceMapper extends BaseMapper<VideoMasterSourceEntity> { |
| | | |
| | | IPage<VideoMasterSourceEntity> selectInPage(@Param("record") VideoMasterSourceEntity source, Page<VideoMasterSourceEntity> page); |
| | | |
| | | int updateDelFlag(@Param("delFlag") int delFlag, @Param("list") List<String> ids); |
| | | } |
| | |
| | | IPage<VideoMasterSourceEntity> findInPage(VideoMasterSourceEntity source, QueryRequest queryRequest); |
| | | |
| | | void modifySourceById(VideoMasterSourceEntity source); |
| | | |
| | | void delSource(String ids); |
| | | } |
| | |
| | | import cc.mrbird.febs.video.mapper.VideoMasterItemsMapper; |
| | | import cc.mrbird.febs.video.mapper.VideoMasterSourceMapper; |
| | | import cc.mrbird.febs.video.service.IVideoMasterSourceService; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | this.videoMasterItemsMapper.updateVideoUrlBySourceId(source.getUrl(), source.getId()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void delSource(String ids) { |
| | | List<String> idList = StrUtil.split(ids, ','); |
| | | this.baseMapper.updateDelFlag(AppContants.FLAG_INT_Y, idList); |
| | | } |
| | | } |
| | |
| | | <select id="selectInPage" resultType="cc.mrbird.febs.video.entity.VideoMasterSourceEntity"> |
| | | select * from video_master_source |
| | | <where> |
| | | 1=1 |
| | | 1=1 and is_del=2 |
| | | <if test="record.name != null and record.name != ''"> |
| | | and name like concat('%', #{record.name}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <update id="updateDelFlag"> |
| | | update video_master_source |
| | | set is_del=#{delFlag} |
| | | where id in |
| | | <foreach collection="list" item="item" index="index" separator="," close=")" open="("> |
| | | #{item} |
| | | </foreach> |
| | | </update> |
| | | </mapper> |
| | |
| | | layEvent = obj.event; |
| | | if (layEvent === 'del') { |
| | | febs.modal.confirm('删除资源', '确定删除该资源?', function () { |
| | | deleteUsers(data.userId); |
| | | deleteUsers(data.id); |
| | | }); |
| | | } |
| | | if (layEvent === 'edit') { |
| | |
| | | }; |
| | | } |
| | | |
| | | function deleteUsers(userIds) { |
| | | var currentUserId = currentUser.userId + ''; |
| | | if (('' + userIds).split(',').indexOf(currentUserId) !== -1) { |
| | | febs.alert.warn('所选资源包含当前登录资源,无法删除'); |
| | | return; |
| | | } |
| | | febs.get(ctx + 'user/delete/' + userIds, null, function () { |
| | | function deleteUsers(ids) { |
| | | febs.get(ctx + 'video/source/delete/' + ids, null, function () { |
| | | febs.alert.success('删除资源成功'); |
| | | $query.click(); |
| | | }); |