5 files modified
31 ■■■■ changed files
src/main/java/cc/mrbird/febs/ai/controller/fileUpload/FileUploadController.java 18 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/ai/controller/productPoint/AiProductPointController.java 7 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/ai/fileUpload/index.html 2 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/ai/productPoint/add.html 2 ●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/ai/productPoint/info.html 2 ●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/ai/controller/fileUpload/FileUploadController.java
@@ -84,7 +84,7 @@
            }
            // 生成唯一文件名
            String uniqueFileName ="("+UUID.randomUUID().toString()+")-"+  fileName;
            String uniqueFileName =UUID.randomUUID().toString()+":"+  fileName;
            Path targetFilePath = uploadPath.resolve(uniqueFileName);
            // 构建公司专属分片目录
@@ -347,7 +347,14 @@
                if (Files.isRegularFile(path)) {
                    try {
                        FileInfo fileInfo = new FileInfo();
                        fileInfo.setFileName(path.getFileName().toString());
                        String totalName = path.getFileName().toString();
                        String[] s = totalName.split(":");
                        if (s.length > 1){
                            fileInfo.setFileSysName(s[1]);
                        }else{
                            fileInfo.setFileSysName(totalName);
                        }
                        fileInfo.setFileName(totalName);
                        fileInfo.setFileSize(Files.size(path));
                        fileInfo.setUploadTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(Files.getLastModifiedTime(path).toMillis())));
                        fileList.add(fileInfo);
@@ -397,8 +404,15 @@
     */
    public static class FileInfo {
        private String fileName;
        private String fileSysName;
        private long fileSize;
        private String uploadTime;
        public String getFileSysName() {
            return fileSysName;
        }
        public void setFileSysName(String fileSysName) {
            this.fileSysName = fileSysName;
        }
        public String getFileName() {
            return fileName;
src/main/java/cc/mrbird/febs/ai/controller/productPoint/AiProductPointController.java
@@ -94,6 +94,13 @@
                if (Files.isRegularFile(path)) {
                    try {
                        FileUploadController.FileInfo fileInfo = new FileUploadController.FileInfo();
                        String totalName = path.getFileName().toString();
                        String[] s = totalName.split(":");
                        if (s.length > 1){
                            fileInfo.setFileSysName(s[1]);
                        }else{
                            fileInfo.setFileSysName(totalName);
                        }
                        fileInfo.setFileName(path.getFileName().toString());
                        list.add(fileInfo);
                    } catch (Exception e) {
src/main/resources/templates/febs/views/modules/ai/fileUpload/index.html
@@ -72,6 +72,7 @@
                                        <table class="layui-table" id="fileList">
                                            <thead>
                                            <tr>
                                                <th>系统文件名</th>
                                                <th>文件名</th>
                                                <th>大小</th>
                                                <th>上传时间</th>
@@ -610,6 +611,7 @@
                                            <input type="radio" name="fileRadio" value="${item.fileName}">
                                            ${item.fileName}
                                        </td>
                                        <td>${item.fileSysName}</td>
                                        <td>${formatFileSize(item.fileSize)}</td>
                                        <td>${item.uploadTime}</td>
                                        <td>
src/main/resources/templates/febs/views/modules/ai/productPoint/add.html
@@ -231,7 +231,7 @@
        $.get(ctx + 'admin/productPoint/fileList/parent', function (data) {
            for (var k in data)
            {
                $(".video-add-productCategory").append("<option value='" + data[k].fileName + "'>" + data[k].fileName + "</option>");
                $(".video-add-productCategory").append("<option value='" + data[k].fileName + "'>" + data[k].fileSysName + "</option>");
            }
            layui.use('form', function () {
                var form = layui.form;
src/main/resources/templates/febs/views/modules/ai/productPoint/info.html
@@ -239,7 +239,7 @@
        $.get(ctx + 'admin/productPoint/fileList/parent', function (data) {
            for (var k in data)
            {
                $(".video-add-productCategory").append("<option value='" + data[k].fileName + "'>" + data[k].fileName + "</option>");
                $(".video-add-productCategory").append("<option value='" + data[k].fileName + "'>" + data[k].fileSysName + "</option>");
            }
            layui.use('form', function () {
                var form = layui.form;