区分附件图片格式和视频格式

This commit is contained in:
lujiang 2024-08-14 15:18:02 +08:00
parent e7632446b2
commit ef2fdb2e50
3 changed files with 8 additions and 3 deletions

View File

@ -63,7 +63,10 @@ public class RepairAttachController extends BaseController {
}
if (nodeId == 0) return R.error("无效参数");
if ((nodeId == 9 || nodeId == 13) && repairId == null) return R.error("无效参数");
return processAttache(file, repairId, nodeId, IRepairAttachService.FILE_IMG);
String ext = FileUploadUtils.getExtension(file);
String type = IRepairAttachService.FILE_IMG;
if (StringUtils.isNotBlank(ext) && ext.toLowerCase().equals("mp4")) type = IRepairAttachService.FILE_VIDEO;
return processAttache(file, repairId, nodeId, type);
}

View File

@ -14,7 +14,9 @@ public interface IRepairAttachService {
String FILE_VOICE = "voice";
String FILE_IMG = "img/video";
String FILE_IMG = "img";
String FILE_VIDEO = "video";
/**
* 新增附件

View File

@ -56,7 +56,7 @@
</select>
<select id="getRepairFirstImg" parameterType="Long" resultType="String">
select url from ics_repair_attach where repair_id=#{repairId} and node_id=1 and delete_flag=0 and ext1='img/video' order by id limit 1
select url from ics_repair_attach where repair_id=#{repairId} and node_id=1 and delete_flag=0 and ext1='img' order by id limit 1
</select>
<insert id="insertRepairAttach" parameterType="com.ics.admin.domain.RepairAttach">