| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * LED节目表 |
| | | * |
| | | * @TableName led_program_file |
| | | */ |
| | | @TableName(value ="led_program_file") |
| | | @TableName(value = "led_program_file") |
| | | @Data |
| | | public class LEDProgramFile implements Serializable { |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | private Long clientId; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String userName; |
| | | |
| | |
| | | private String fileUrl; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | private String screenShot; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | private String md5; |
| | | |
| | |
| | | private Integer kind; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | private LocalDateTime createTime; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * led熙讯文件表 |
| | | * |
| | | * @TableName led_s_file |
| | | */ |
| | | @TableName(value ="led_s_file") |
| | | @TableName(value = "led_s_file") |
| | | @Data |
| | | public class LedSFile implements Serializable { |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long fileId; |
| | | |
| | | /** |
| | | * 客户ID |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 上级客户ID |
| | | */ |
| | | private Long cilentId; |
| | | |
| | |
| | | private Integer width; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | private LocalDateTime createTime; |
| | | |
| | |
| | | <mapper namespace="com.sandu.ximon.dao.mapper.LEDProgramFileMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LEDProgramFile"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="userId" column="user_id" jdbcType="BIGINT"/> |
| | | <result property="userName" column="user_name" jdbcType="VARCHAR"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="size" column="size" jdbcType="VARCHAR"/> |
| | | <result property="fileType" column="file_type" jdbcType="VARCHAR"/> |
| | | <result property="fileUrl" column="file_url" jdbcType="VARCHAR"/> |
| | | <result property="screenShot" column="screen_shot" jdbcType="VARCHAR"/> |
| | | <result property="md5" column="md5" jdbcType="VARCHAR"/> |
| | | <result property="kind" column="kind" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="userId" column="user_id" jdbcType="BIGINT"/> |
| | | <result property="clientId" column="client_id" jdbcType="BIGINT"/> |
| | | <result property="userName" column="user_name" jdbcType="VARCHAR"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="size" column="size" jdbcType="VARCHAR"/> |
| | | <result property="fileType" column="file_type" jdbcType="VARCHAR"/> |
| | | <result property="fileUrl" column="file_url" jdbcType="VARCHAR"/> |
| | | <result property="screenShot" column="screen_shot" jdbcType="VARCHAR"/> |
| | | <result property="md5" column="md5" jdbcType="VARCHAR"/> |
| | | <result property="kind" column="kind" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,user_id,user_name, |
| | | name,size,file_type, |
| | | file_url,screen_shot,md5, |
| | | kind,create_time |
| | | </sql> |
| | | </mapper> |
| | |
| | | |
| | | <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LedSFile"> |
| | | <id property="fileId" column="file_id" jdbcType="BIGINT"/> |
| | | <result property="userId" column="user_id" jdbcType="BIGINT"/> |
| | | <result property="cilentId" column="cilent_id" jdbcType="BIGINT"/> |
| | | <result property="userName" column="user_name" jdbcType="VARCHAR"/> |
| | | <result property="originName" column="origin_name" jdbcType="VARCHAR"/> |
| | |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | file_id |
| | | ,cilent_id,user_name, |
| | | origin_name,file_url,file_type, |
| | | file_size,height,width, |
| | | create_time |
| | | </sql> |
| | | </mapper> |
| | |
| | | if (!permissionConfig.check(MenuEnum.LED_FILE_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | |
| | | LambdaQueryWrapper<LEDProgramFile> wrapper = ledProgramFileService.listFile(); |
| | | if(null!=keyword){ |
| | | wrapper.like(LEDProgramFile::getName,keyword); |
| | | if (!keyword.isEmpty()) { |
| | | wrapper.like(LEDProgramFile::getName, keyword); |
| | | } |
| | | |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | return ResponseUtil.successPage(ledProgramFileService.list(wrapper)); |
| | | } |
| | | |
| | |
| | | if (!permissionConfig.check(MenuEnum.LED_FILE_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | LambdaQueryWrapper<LedSFile> wrapper = ledProgramFileService.listFile(); |
| | | if (null != keyword) { |
| | | if (!keyword.isEmpty()) { |
| | | wrapper.like(LedSFile::getOriginName, keyword); |
| | | } |
| | | |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | return ResponseUtil.success(ledProgramFileService.list(wrapper)); |
| | | } |
| | | |
| | | @PostMapping("/uploading/{dateType}") |
| | | public ResponseVO<Object> uploadingFile(@RequestParam("file") MultipartFile file,@PathVariable Integer dateType) { |
| | | public ResponseVO<Object> uploadingFile(@RequestParam("file") MultipartFile file, @PathVariable Integer dateType) { |
| | | FileUploadDto fileUploadDto = aliOssFileService.uploadFile(file); |
| | | if("mp4".equals(fileUploadDto.getFileType())){ |
| | | fileUploadDto.setScreenShot(fileUploadDto.getFileUrl()+"?x-oss-process=video/snapshot,t_10000,m_fast"); |
| | | if ("mp4".equals(fileUploadDto.getFileType())) { |
| | | fileUploadDto.setScreenShot(fileUploadDto.getFileUrl() + "?x-oss-process=video/snapshot,t_10000,m_fast"); |
| | | } |
| | | FileOperationRecord fileOperationRecord = new FileOperationRecord(); |
| | | // if("mp4".equals(fileUploadDto.getFileType())){ |
| | |
| | | public LambdaQueryWrapper<LEDProgramFile> listFile() { |
| | | LambdaQueryWrapper<LEDProgramFile> ledProgramFileLambdaQueryWrapper = Wrappers.lambdaQuery(LEDProgramFile.class); |
| | | if (SecurityUtils.getClientId() != null) { |
| | | return ledProgramFileLambdaQueryWrapper.eq(LEDProgramFile::getUserId, SecurityUtils.getUserId()); |
| | | return ledProgramFileLambdaQueryWrapper.eq(LEDProgramFile::getUserId, SecurityUtils.getUserId()).or(w -> { |
| | | w.eq(LEDProgramFile::getClientId, SecurityUtils.getUserId()); |
| | | }); |
| | | } else { |
| | | return ledProgramFileLambdaQueryWrapper; |
| | | } |
| | |
| | | |
| | | public boolean addProgramFile(MultipartFile file) { |
| | | FileUploadDto fileUploadDto = aliOssFileService.uploadFile(file); |
| | | if("mp4".equals(fileUploadDto.getFileType())){ |
| | | fileUploadDto.setScreenShot(fileUploadDto.getFileUrl()+"?x-oss-process=video/snapshot,t_10000,m_fast"); |
| | | if ("mp4".equals(fileUploadDto.getFileType())) { |
| | | fileUploadDto.setScreenShot(fileUploadDto.getFileUrl() + "?x-oss-process=video/snapshot,t_10000,m_fast"); |
| | | } |
| | | FileOperationRecord fileOperationRecord=new FileOperationRecord(); |
| | | if("mp4".equals(fileUploadDto.getFileType())){ |
| | | fileOperationRecord.setScreenShot(fileUploadDto.getFileUrl()+"?x-oss-process=video/snapshot,t_10000,m_fast"); |
| | | FileOperationRecord fileOperationRecord = new FileOperationRecord(); |
| | | if ("mp4".equals(fileUploadDto.getFileType())) { |
| | | fileOperationRecord.setScreenShot(fileUploadDto.getFileUrl() + "?x-oss-process=video/snapshot,t_10000,m_fast"); |
| | | } |
| | | BeanUtils.copyProperties(fileUploadDto, fileOperationRecord); |
| | | fileOperationRecordService.save(fileOperationRecord); |
| | |
| | | return removeById(id); |
| | | } |
| | | |
| | | public LambdaQueryWrapper<LedSFile> listFile(){ |
| | | public LambdaQueryWrapper<LedSFile> listFile() { |
| | | LambdaQueryWrapper<LedSFile> ledProgramFileLambdaQueryWrapper = Wrappers.lambdaQuery(LedSFile.class); |
| | | if(SecurityUtils.getClientId()!=null){ |
| | | return ledProgramFileLambdaQueryWrapper.eq(LedSFile::getCilentId,SecurityUtils.getUserId()); |
| | | }else { |
| | | if (SecurityUtils.getClientId() != null) { |
| | | return ledProgramFileLambdaQueryWrapper.eq(LedSFile::getCilentId, SecurityUtils.getUserId()).or(w -> { |
| | | w.eq(LedSFile::getUserId, SecurityUtils.getUserId()); |
| | | }); |
| | | } else { |
| | | return ledProgramFileLambdaQueryWrapper; |
| | | } |
| | | |