czt
2025-06-03 4901f0cf60ecc6484d149ca5e9a0083e4b21db21
增加库区鸟瞰图及简介视频上传
已修改7个文件
已添加5个文件
1331 ■■■■ 文件已修改
igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/Dept.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-dzhwk-core/src/main/java/com/fzzy/igds/file/FileService.java 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-dzhwk-view/pom.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Building.view.xml 303 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Company.view.xml 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Dept.view.xml 238 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Granary.view.xml 228 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/pr/FileUploadManage.java 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/controller/WebController.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/manager/WebManager.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-dzhwk-web/src/main/resources/templates/dzhwk/dept-img.html 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-dzhwk-web/src/main/resources/templates/dzhwk/dept-video.html 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/Dept.java
@@ -4,10 +4,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@@ -104,4 +101,34 @@
    @Column(name = "zhgxsj")
    private Date zhgxsj;
    /**
     * --------鸟瞰图信息--------
     **/
    @Column(name = "FILE_ID_", length = 30)
    @PropertyDef(label = "鸟瞰图id")
    private String fileId;
    @Column(name = "FILE_NAME_", length = 50)
    @PropertyDef(label = "鸟瞰图名称")
    private String fileName;
    /**
     * --------宣传视频信息--------
     **/
    @Column(name = "VIDEO_ID_", length = 30)
    @PropertyDef(label = "视频附件id")
    private String videoId;
    @Column(name = "VIDEO_NAME_", length = 50)
    @PropertyDef(label = "视频附件名称")
    private String videoName;
    //全路径
    @Transient
    private String imgFilePath;
    //全路径
    @Transient
    private String videoFilePath;
}
igds-dzhwk-core/src/main/java/com/fzzy/igds/file/FileService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,138 @@
package com.fzzy.igds.file;
import com.fzzy.common.utils.Base64Util;
import com.fzzy.igds.dzhwk.data.DzhwkConfigData;
import com.ruoyi.common.config.FrameworkConfig;
import lombok.extern.slf4j.Slf4j;
import com.ruoyi.common.utils.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.util.Date;
/**
 * @Description ä»“房service层
 * @Author CZT
 * @Date 2024/11/20 19:03
 */
@Slf4j
@Service
public class FileService {
    @Resource
    private DzhwkConfigData configData;
    /**
     * èŽ·å–åº“åŒºè·¯å¾„ä¸‹æ–‡ä»¶
     * @param companyId
     * @return
     */
    public String getDeptFilePath(String companyId) {
        if (StringUtils.isEmpty(companyId)){
            companyId = configData.getCompanyId();
        }
        String basePath = configData.getProfile() + "IMG/"+ companyId + "/SECURITY/";
        File file = new File(basePath);
        if (!file.exists()) {
            file.mkdirs();
        }
        return basePath;
    }
    public String getInoutFilePath(Date date) {
        if (null == date) date = new Date();
        String basePath = configData.getProfile() + "INOUT/" + DateFormatUtils.format(date, "yyyyMM") + "/";
        File file = new File(basePath);
        if (!file.exists()) {
            file.mkdirs();
        }
        return basePath;
    }
    public String getSnapFilePath(Date date) {
        if (null == date) date = new Date();
        String basePath = configData.getProfile() + "SNAP/" + DateFormatUtils.format(date, "yyyyMM") + "/";
        File file = new File(basePath);
        if (!file.exists()) {
            file.mkdirs();
        }
        return basePath;
    }
    public String getSnapFilePath(String dateStr) {
        if (null == dateStr) return null;
        if (dateStr.length() > 6) dateStr = dateStr.substring(0, 6);
        String basePath = configData.getProfile() + "SNAP/" + dateStr + "/";
        File file = new File(basePath);
        if (!file.exists()) {
            file.mkdirs();
        }
        return basePath;
    }
    public String getCommonFilePath(Date date) {
        if (null == date)
            date = new Date();
        String basePath = configData.getProfile() + "COMMON/" + DateFormatUtils.format(date, "yyyyMM") + "/";
        File file = new File(basePath);
        if (!file.exists()) {
            file.mkdirs();
        }
        return basePath;
    }
    public String getSnapPlateFilePath(Date date) {
        if (null == date)
            date = new Date();
        String basePath = configData.getProfile() + "TEMP/" + DateFormatUtils.format(date, "yyyyMM") + "/";
        File file = new File(basePath);
        if (!file.exists()) {
            file.mkdirs();
        }
        return basePath;
    }
    public String getTempFilePath(String companyId) {
        String basePath = configData.getProfile() + "TEMP/";
        if (StringUtils.isNotEmpty(companyId)) {
            basePath += companyId + "/";
        }
        File file = new File(basePath);
        if (!file.exists()) {
            file.mkdirs();
        }
        return basePath;
    }
    public String getConfPath() {
        String basePath = configData.getProfile() + "CONF/";
        File file = new File(basePath);
        if (!file.exists()) {
            file.mkdirs();
        }
        return basePath;
    }
    public void baseImg2Disk(String basePath, String fileName, String imgData) {
        Base64Util.generateImage(imgData, basePath + fileName);
    }
}
igds-dzhwk-view/pom.xml
@@ -74,7 +74,29 @@
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.bstek.dorado</groupId>
            <artifactId>dorado-uploader</artifactId>
            <version>1.0.20</version>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-jcl</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>slf4j-log4j12</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>log4j</artifactId>
                    <groupId>log4j</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>slf4j-jdk14</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Building.view.xml
@@ -245,59 +245,53 @@
      </PropertyDef>
    </DataType>
  </Model>
  <View layout="regionPadding:10">
  <View>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="dataProvider">buildingPR#loadData</Property>
      <Property name="dataType">[dtMain]</Property>
    </DataSet>
    <Container layout="regionPadding:10" layoutConstraint="top">
      <Property name="exClassName">bg-color</Property>
      <Property name="height">55</Property>
      <Property name="contentOverflow">hidden</Property>
      <Label layoutConstraint="left">
        <Property name="text">菜单栏:</Property>
      </Label>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">view.get(&quot;#dsMain&quot;).insert();&#xD;
          view.get(&quot;#dialogMain&quot;).show();</ClientEvent>
        <Property name="caption">新增</Property>
        <Property name="exClassName">btn1</Property>
        <Property name="iconClass">fa fa-plus</Property>
      </Button>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">&#xD;
var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
    <Container>
      <Property name="exClassName">c-data</Property>
      <ToolBar>
        <ToolBarLabel>
          <Property name="text">菜单栏:</Property>
          <Property name="exClassName">menu-bar-caption</Property>
        </ToolBarLabel>
        <ToolBarButton>
          <ClientEvent name="onClick">view.get(&quot;#dsMain&quot;).insert();&#xD;
view.get(&quot;#dialogMain&quot;).show();</ClientEvent>
          <Property name="caption">新增</Property>
          <Property name="exClassName">btn1</Property>
          <Property name="iconClass">fa fa-plus</Property>
        </ToolBarButton>
        <ToolBarButton>
          <ClientEvent name="onClick">var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#dialogMain&quot;).show();;&#xD;
}else{&#xD;
    $notify(&quot;请选择需要修改的数据……&quot;);&#xD;
}    </ClientEvent>
        <Property name="caption">编辑</Property>
        <Property name="exClassName">btn2</Property>
        <Property name="iconClass">fa fa-pencil</Property>
      </Button>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">  &#xD;
var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
}</ClientEvent>
          <Property name="caption">编辑</Property>
          <Property name="exClassName">btn2</Property>
          <Property name="iconClass">fa fa-pencil</Property>
        </ToolBarButton>
        <ToolBarButton>
          <ClientEvent name="onClick">var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#ajaxDel&quot;).set(&quot;parameter&quot;,select).execute(function(){&#xD;
        select.remove();&#xD;
    });&#xD;
        select.remove();&#xD;
    });&#xD;
}else{&#xD;
    $notify(&quot;请选择需要删除的数据……&quot;);&#xD;
}&#xD;
</ClientEvent>
        <Property name="caption">删除</Property>
        <Property name="exClassName">btn3</Property>
        <Property name="iconClass">fa fa-trash-o</Property>
      </Button>
    </Container>
    <Container layout="regionPadding:10" layoutConstraint="center">
      <Property name="exClassName">bg-color</Property>
      <DataGrid id="dgMain">
        <ClientEvent name="onDataRowDoubleClick">var dialog= view.get(&quot;#dialogMain&quot;);&#xD;
          dialog.show();</ClientEvent>
}</ClientEvent>
          <Property name="caption">删除</Property>
          <Property name="exClassName">btn3</Property>
          <Property name="iconClass">fa fa-trash-o</Property>
        </ToolBarButton>
      </ToolBar>
      <DataGrid id="dgMain" layoutConstraint="padding:15px 0px 0px 0px">
        <ClientEvent name="onDataRowClick">view.get(&quot;#dgMain&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="readOnly">true</Property>
        <Property name="selectionMode">singleRow</Property>
@@ -345,7 +339,8 @@
        </DataColumn>
      </DataGrid>
    </Container>
    <Dialog id="dialogMain">
    <Dialog id="dialogMain" layout="regionPadding:10">
      <Property name="iconClass">fa fa-pencil-square-o</Property>
      <Property name="closeable">false</Property>
      <Property name="caption">仓房信息</Property>
      <Property name="width">60%</Property>
@@ -373,116 +368,122 @@
        </Button>
      </Buttons>
      <Children>
        <AutoForm>
          <Property name="dataSet">dsMain</Property>
          <Property name="cols">*,*</Property>
          <Property name="labelAlign">right</Property>
          <Property name="labelSeparator">:</Property>
          <Property name="labelWidth">150</Property>
          <AutoFormElement>
            <Property name="name">id</Property>
            <Property name="property">id</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">deptId</Property>
            <Property name="property">deptId</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">name</Property>
            <Property name="property">name</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">storage</Property>
            <Property name="property">storage</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">length</Property>
            <Property name="property">length</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">width</Property>
            <Property name="property">width</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">height</Property>
            <Property name="property">height</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">diameter</Property>
            <Property name="property">diameter</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">volume</Property>
            <Property name="property">volume</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">doorNum</Property>
            <Property name="property">doorNum</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">ground</Property>
            <Property name="property">ground</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">wall</Property>
            <Property name="property">wall</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">roof</Property>
            <Property name="property">roof</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">roofTruss</Property>
            <Property name="property">roofTruss</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">createDate</Property>
            <Property name="property">createDate</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">userDate</Property>
            <Property name="property">userDate</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">lon</Property>
            <Property name="property">lon</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">lat</Property>
            <Property name="property">lat</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">deVolume</Property>
            <Property name="property">deVolume</Property>
            <Editor/>
          </AutoFormElement>
          <Link>
            <Property name="href">http://api.map.baidu.com/lbsapi/getpoint/</Property>
            <Property name="target">_blank</Property>
            <Property name="style">
              <Property name="padding-left">150px</Property>
            </Property>
            <Property name="text">帮助:点击坐标位置拾取</Property>
          </Link>
        </AutoForm>
        <FieldSet layout="padding:5">
          <Property name="caption">基本信息</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsMain</Property>
              <Property name="cols">*,*</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelSeparator">:</Property>
              <Property name="labelWidth">120</Property>
              <AutoFormElement>
                <Property name="name">id</Property>
                <Property name="property">id</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">deptId</Property>
                <Property name="property">deptId</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">name</Property>
                <Property name="property">name</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">storage</Property>
                <Property name="property">storage</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">length</Property>
                <Property name="property">length</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">width</Property>
                <Property name="property">width</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">height</Property>
                <Property name="property">height</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">diameter</Property>
                <Property name="property">diameter</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">volume</Property>
                <Property name="property">volume</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">doorNum</Property>
                <Property name="property">doorNum</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ground</Property>
                <Property name="property">ground</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">wall</Property>
                <Property name="property">wall</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">roof</Property>
                <Property name="property">roof</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">roofTruss</Property>
                <Property name="property">roofTruss</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">createDate</Property>
                <Property name="property">createDate</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">userDate</Property>
                <Property name="property">userDate</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">lon</Property>
                <Property name="property">lon</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">lat</Property>
                <Property name="property">lat</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">deVolume</Property>
                <Property name="property">deVolume</Property>
                <Editor/>
              </AutoFormElement>
              <Link>
                <Property name="href">http://api.map.baidu.com/lbsapi/getpoint/</Property>
                <Property name="target">_blank</Property>
                <Property name="style">
                  <Property name="padding-left">150px</Property>
                </Property>
                <Property name="text">帮助:点击坐标位置拾取</Property>
              </Link>
            </AutoForm>
          </Children>
        </FieldSet>
      </Children>
      <Tools/>
    </Dialog>
igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Company.view.xml
@@ -208,52 +208,46 @@
      </PropertyDef>
    </DataType>
  </Model>
  <View layout="regionPadding:10">
  <View>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="dataProvider">companyPR#getData</Property>
      <Property name="dataType">[dtMain]</Property>
    </DataSet>
    <Container layout="regionPadding:10" layoutConstraint="top">
      <Property name="exClassName">bg-color</Property>
      <Property name="height">55</Property>
      <Property name="contentOverflow">hidden</Property>
      <Label layoutConstraint="left">
        <Property name="text">菜单栏:</Property>
      </Label>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">&#xD;
var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
    <Container>
      <Property name="exClassName">c-data</Property>
      <ToolBar>
        <ToolBarLabel>
          <Property name="text">菜单栏:</Property>
          <Property name="exClassName">menu-bar-caption</Property>
        </ToolBarLabel>
        <ToolBarButton>
          <ClientEvent name="onClick">var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#dialogMain&quot;).show();;&#xD;
}else{&#xD;
    $notify(&quot;请选择需要修改的数据……&quot;);&#xD;
}          </ClientEvent>
        <Property name="caption">详情编辑</Property>
        <Property name="exClassName">btn2</Property>
        <Property name="iconClass">fa fa-pencil</Property>
      </Button>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">  &#xD;
var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
     $notify(&quot;请选择需要编辑的数据……&quot;);&#xD;
}</ClientEvent>
          <Property name="caption">详情编辑</Property>
          <Property name="exClassName">btn2</Property>
          <Property name="iconClass">fa fa-pencil</Property>
        </ToolBarButton>
        <ToolBarButton>
          <ClientEvent name="onClick">var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#ajaxDel&quot;).set(&quot;parameter&quot;,select).execute(function(){&#xD;
        select.remove();&#xD;
    });&#xD;
        select.remove();&#xD;
    });&#xD;
}else{&#xD;
    $notify(&quot;请选择需要删除的数据……&quot;);&#xD;
}&#xD;
</ClientEvent>
        <Property name="caption">删除</Property>
        <Property name="exClassName">btn3</Property>
        <Property name="iconClass">fa fa-trash-o</Property>
      </Button>
    </Container>
    <Container layout="regionPadding:10" layoutConstraint="center">
      <Property name="exClassName">bg-color</Property>
      <DataGrid id="dgMain">
        <ClientEvent name="onDataRowDoubleClick">var dialog= view.get(&quot;#dialogMain&quot;);&#xD;
          dialog.show();</ClientEvent>
}&#xD;</ClientEvent>
          <Property name="caption">删除</Property>
          <Property name="exClassName">btn3</Property>
          <Property name="iconClass">fa fa-trash-o</Property>
        </ToolBarButton>
      </ToolBar>
      <DataGrid id="dgMain" layoutConstraint="padding:15px 0px 0px 0px">
        <ClientEvent name="onDataRowClick">view.get(&quot;#dgMain&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="readOnly">true</Property>
        <Property name="selectionMode">singleRow</Property>
@@ -301,7 +295,8 @@
        </DataColumn>
      </DataGrid>
    </Container>
    <Dialog id="dialogMain">
    <Dialog id="dialogMain" layout="regionPadding:10">
      <Property name="iconClass">fa fa-pencil-square-o</Property>
      <Property name="caption">仓储单位信息</Property>
      <Property name="width">1200</Property>
      <Property name="closeable">false</Property>
@@ -328,7 +323,7 @@
        </Button>
      </Buttons>
      <Children>
        <FieldSet layout="padding:15">
        <FieldSet layout="padding:5">
          <Property name="caption">基本信息</Property>
          <Buttons/>
          <Children>
@@ -465,10 +460,7 @@
            </AutoForm>
          </Children>
        </FieldSet>
        <Control>
          <Property name="height">10</Property>
        </Control>
        <FieldSet layout="padding:15">
        <FieldSet layout="padding:5">
          <Property name="caption">上级单位信息</Property>
          <Buttons/>
          <Children>
@@ -496,7 +488,7 @@
            </AutoForm>
          </Children>
        </FieldSet>
        <FieldSet layout="padding:15">
        <FieldSet layout="padding:5">
          <Property name="caption">统计信息</Property>
          <Buttons/>
          <Children>
igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Dept.view.xml
@@ -133,53 +133,96 @@
        <Property name="dataType">DateTime</Property>
        <Property name="label">更新时间</Property>
      </PropertyDef>
      <PropertyDef name="fileId">
        <Property></Property>
        <Property name="label">鸟瞰图id</Property>
      </PropertyDef>
      <PropertyDef name="fileName">
        <Property></Property>
        <Property name="label">鸟瞰图</Property>
      </PropertyDef>
      <PropertyDef name="videoId">
        <Property></Property>
        <Property name="label">视频附件id</Property>
      </PropertyDef>
      <PropertyDef name="videoName">
        <Property></Property>
        <Property name="label">简介视频</Property>
      </PropertyDef>
    </DataType>
  </Model>
  <View layout="regionPadding:10">
  <View>
    <ClientEvent name="onClick">/**&#xD;
      * é¢„览视频&#xD;
      */&#xD;
      showVideo = function(){&#xD;
      var cur = view.get(&quot;#dsMain.data:#&quot;);&#xD;
      var fileName = cur.get(&quot;fileId&quot;);&#xD;
      if(!fileName){&#xD;
      $alert(&quot;没有上传视频信息,无法预览。&quot;);&#xD;
      return;&#xD;
      }&#xD;
      var id = cur.get(&quot;id&quot;);&#xD;
      &#xD;
      view.get(&quot;#iFrameVideo&quot;).set(&quot;path&quot;, &quot;./dzhwk/dept-video?id=&quot; + id);&#xD;
      view.get(&quot;#dialogVideo&quot;).show();&#xD;
      &#xD;
      };
      /**&#xD;
      * é¢„览图片&#xD;
      */&#xD;
      showImg = function(){&#xD;
      var cur = view.get(&quot;#dsMain.data:#&quot;);&#xD;
      var fileName = cur.get(&quot;fileId&quot;);&#xD;
      if(!fileName){&#xD;
      $alert(&quot;没有上传视频信息,无法预览。&quot;);&#xD;
      return;&#xD;
      }&#xD;
      var id = cur.get(&quot;id&quot;);&#xD;
      &#xD;
      view.get(&quot;#iFrameImg&quot;).set(&quot;path&quot;, &quot;./dzhwk/dept-img?id=&quot; + id);&#xD;
      view.get(&quot;#dialogImg&quot;).show();&#xD;
      &#xD;
      };</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="dataProvider">deptPR#getData</Property>
      <Property name="dataType">[dtMain]</Property>
    </DataSet>
    <Container layout="regionPadding:10" layoutConstraint="top">
      <Property name="exClassName">bg-color</Property>
      <Property name="height">55</Property>
      <Property name="contentOverflow">hidden</Property>
      <Label layoutConstraint="left">
        <Property name="text">菜单栏:</Property>
      </Label>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">&#xD;
var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
    <Container>
      <Property name="exClassName">c-data</Property>
      <ToolBar>
        <ToolBarLabel>
          <Property name="text">菜单栏:</Property>
          <Property name="exClassName">menu-bar-caption</Property>
        </ToolBarLabel>
        <ToolBarButton>
          <ClientEvent name="onClick">var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#dialogMain&quot;).show();;&#xD;
}else{&#xD;
    $notify(&quot;请选择需要修改的数据……&quot;);&#xD;
}          </ClientEvent>
        <Property name="caption">详情编辑</Property>
        <Property name="exClassName">btn2</Property>
        <Property name="iconClass">fa fa-pencil</Property>
      </Button>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">  &#xD;
var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
    $notify(&quot;请选择需要编辑的数据……&quot;);&#xD;
}</ClientEvent>
          <Property name="caption">详情编辑</Property>
          <Property name="exClassName">btn2</Property>
          <Property name="iconClass">fa fa-pencil</Property>
        </ToolBarButton>
        <ToolBarButton>
          <ClientEvent name="onClick">var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#ajaxDel&quot;).set(&quot;parameter&quot;,select).execute(function(){&#xD;
        select.remove();&#xD;
    });&#xD;
        select.remove();&#xD;
    });&#xD;
}else{&#xD;
    $notify(&quot;请选择需要删除的数据……&quot;);&#xD;
}</ClientEvent>
        <Property name="caption">删除</Property>
        <Property name="exClassName">btn3</Property>
        <Property name="iconClass">fa fa-trash-o</Property>
      </Button>
    </Container>
    <Container layout="regionPadding:10" layoutConstraint="center">
      <Property name="exClassName">bg-color</Property>
      <DataGrid id="dgMain">
        <ClientEvent name="onDataRowDoubleClick">var dialog= view.get(&quot;#dialogMain&quot;);&#xD;
          dialog.show();</ClientEvent>
          <Property name="caption">删除</Property>
          <Property name="exClassName">btn3</Property>
          <Property name="iconClass">fa fa-trash-o</Property>
        </ToolBarButton>
      </ToolBar>
      <DataGrid id="dgMain" layoutConstraint="padding:15px 0px 0px 0px">
        <ClientEvent name="onDataRowClick">view.get(&quot;#dgMain&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="readOnly">true</Property>
        <Property name="selectionMode">singleRow</Property>
@@ -223,7 +266,8 @@
        </DataColumn>
      </DataGrid>
    </Container>
    <Dialog id="dialogMain">
    <Dialog id="dialogMain" layout="regionPadding:10">
      <Property name="iconClass">fa fa-pencil-square-o</Property>
      <Property name="caption">库区信息</Property>
      <Property name="width">1200</Property>
      <Property name="closeable">false</Property>
@@ -250,7 +294,7 @@
        </Button>
      </Buttons>
      <Children>
        <FieldSet layout="padding:15">
        <FieldSet layout="padding:5">
          <Property name="caption">基本信息</Property>
          <Buttons/>
          <Children>
@@ -357,6 +401,114 @@
            </AutoForm>
          </Children>
        </FieldSet>
        <FieldSet layout="padding:5">
          <Property name="caption">鸟瞰图</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsMain</Property>
              <Property name="cols">*,*</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelSeparator"> : </Property>
              <Property name="labelWidth">120</Property>
              <AutoFormElement>
                <Property name="name">fileName</Property>
                <Property name="property">fileName</Property>
                <Property name="readOnly">true</Property>
                <Property name="editorType">Label</Property>
                <Editor>
                  <TextEditor>
                    <Property name="blankText"> -- ç³»ç»Ÿè‡ªåŠ¨ç”Ÿæˆ --</Property>
                  </TextEditor>
                </Editor>
              </AutoFormElement>
              <Container>
                <Button layoutConstraint="left">
                  <Property name="action">uploadFileImg</Property>
                  <Property name="caption">鸟瞰图上传...</Property>
                  <Property name="exClassName">btn2</Property>
                  <Property name="iconClass">fa fa-cloud-upload</Property>
                </Button>
                <Label layoutConstraint="left">
                  <Property name="width">10px</Property>
                </Label>
                <Button layoutConstraint="left ">
                  <ClientEvent name="onClick">showImg();</ClientEvent>
                  <Property name="caption">鸟瞰图预览</Property>
                  <Property name="exClassName">btn4</Property>
                  <Property name="iconClass">fa fa-picture-o</Property>
                </Button>
              </Container>
            </AutoForm>
          </Children>
        </FieldSet>
        <FieldSet layout="padding:5">
          <Property name="caption">简介视频</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsMain</Property>
              <Property name="cols">*,*</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelSeparator"> : </Property>
              <Property name="labelWidth">120</Property>
              <AutoFormElement>
                <Property name="name">videoName</Property>
                <Property name="property">videoName</Property>
                <Property name="readOnly">true</Property>
                <Property name="editorType">Label</Property>
                <Editor>
                  <TextEditor>
                    <Property name="blankText"> -- ç³»ç»Ÿè‡ªåŠ¨ç”Ÿæˆ --</Property>
                  </TextEditor>
                </Editor>
              </AutoFormElement>
              <Container>
                <Button layoutConstraint="left">
                  <Property name="action">uploadFileVideo</Property>
                  <Property name="caption">视频上传...</Property>
                  <Property name="exClassName">btn2</Property>
                  <Property name="iconClass">fa fa-cloud-upload</Property>
                </Button>
                <Label layoutConstraint="left">
                  <Property name="width">10px</Property>
                </Label>
                <Button layoutConstraint="left ">
                  <ClientEvent name="onClick">showVideo();</ClientEvent>
                  <Property name="caption">视频预览</Property>
                  <Property name="exClassName">btn4</Property>
                  <Property name="iconClass">fa fa-picture-o</Property>
                </Button>
              </Container>
            </AutoForm>
          </Children>
        </FieldSet>
      </Children>
      <Tools/>
    </Dialog>
    <Dialog id="dialogImg">
      <Property name="width">1000</Property>
      <Property name="height">640</Property>
      <Property name="iconClass">fa fa-tasks</Property>
      <Property name="caption">鸟瞰图预览</Property>
      <Buttons/>
      <Children>
        <IFrame id="iFrameImg">
          <Property name="width">100%</Property>
        </IFrame>
      </Children>
      <Tools/>
    </Dialog>
    <Dialog id="dialogVideo">
      <Property name="width">1000</Property>
      <Property name="height">640</Property>
      <Property name="iconClass">fa fa-tasks</Property>
      <Property name="caption">视频预览</Property>
      <Buttons/>
      <Children>
        <IFrame id="iFrameVideo">
          <Property name="width">100%</Property>
        </IFrame>
      </Children>
      <Tools/>
    </Dialog>
@@ -436,5 +588,23 @@
        </DataPilot>
      </Container>
    </CustomDropDown>
    <UploadAction id="uploadFileImg">
      <ClientEvent name="onFileUploaded">var fileId = arg.returnValue;&#xD;
        var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
        data.set(&quot;fileId&quot;,fileId);&#xD;
        data.set(&quot;fileName&quot;,arg.file.name);</ClientEvent>
      <Property name="fileResolver">fileUploadManage#imgFile</Property>
      <Property name="maxFileSize">50MB</Property>
      <Filters/>
    </UploadAction>
    <UploadAction id="uploadFileVideo">
      <ClientEvent name="onFileUploaded">var videoId = arg.returnValue;&#xD;
        var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
        data.set(&quot;videoId&quot;,videoId);&#xD;
        data.set(&quot;videoName&quot;,arg.file.name);</ClientEvent>
      <Property name="fileResolver">fileUploadManage#videoFile</Property>
      <Property name="maxFileSize">500MB</Property>
      <Filters/>
    </UploadAction>
  </View>
</ViewConfig>
igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Granary.view.xml
@@ -110,56 +110,57 @@
      </PropertyDef>
    </DataType>
  </Model>
  <View layout="regionPadding:10">
  <View>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="dataProvider">granaryPR#getGranary</Property>
      <Property name="dataType">[dtMain]</Property>
    </DataSet>
    <Container layout="regionPadding:10" layoutConstraint="top">
      <Property name="exClassName">bg-color</Property>
      <Property name="height">55</Property>
      <Property name="contentOverflow">hidden</Property>
      <Label layoutConstraint="left">
        <Property name="text">菜单栏:</Property>
      </Label>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">view.get(&quot;#dsMain&quot;).insert();&#xD;
    <Container>
      <Property name="exClassName">c-data</Property>
      <ToolBar>
        <ToolBarLabel>
          <Property name="text">菜单栏:</Property>
          <Property name="exClassName">menu-bar-caption</Property>
        </ToolBarLabel>
        <ToolBarButton>
          <ClientEvent name="onClick">view.get(&quot;#dsMain&quot;).insert();&#xD;
view.get(&quot;#dialogMain&quot;).show();</ClientEvent>
        <Property name="caption">新增</Property>
        <Property name="exClassName">btn1</Property>
        <Property name="iconClass">fa fa-plus</Property>
      </Button>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">var dialog= view.get(&quot;#dialogMain&quot;);&#xD;
dialog.show();</ClientEvent>
        <Property name="caption">编辑</Property>
        <Property name="exClassName">btn2</Property>
        <Property name="iconClass">fa fa-pencil</Property>
      </Button>
      <Button layoutConstraint="left">
        <ClientEvent name="onClick">var cur = view.get(&quot;#dsMain.data:#&quot;);&#xD;
if(!cur) return;&#xD;
view.get(&quot;#ajaxDel&quot;).set(&quot;parameter&quot;,cur).execute(function(result){&#xD;
    if(result){&#xD;
        $alert(result);&#xD;
        return;&#xD;
    }else{&#xD;
        cur.remove();&#xD;
    }&#xD;
});</ClientEvent>
        <Property name="caption">删除</Property>
        <Property name="exClassName">btn3</Property>
        <Property name="iconClass">fa fa-trash-o</Property>
      </Button>
    </Container>
    <Container layout="regionPadding:10" layoutConstraint="center">
      <Property name="exClassName">bg-color</Property>
      <DataGrid id="dgMain">
        <ClientEvent name="onDataRowDoubleClick">var dialog= view.get(&quot;#dialogMain&quot;);&#xD;
dialog.show();</ClientEvent>
          <Property name="caption">新增</Property>
          <Property name="exClassName">btn1</Property>
          <Property name="iconClass">fa fa-plus</Property>
        </ToolBarButton>
        <ToolBarButton>
          <ClientEvent name="onClick">var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#dialogMain&quot;).show();;&#xD;
}else{&#xD;
    $notify(&quot;请选择需要修改的数据……&quot;);&#xD;
}</ClientEvent>
          <Property name="caption">编辑</Property>
          <Property name="exClassName">btn2</Property>
          <Property name="iconClass">fa fa-pencil</Property>
        </ToolBarButton>
        <ToolBarButton>
          <ClientEvent name="onClick">var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#ajaxDel&quot;).set(&quot;parameter&quot;,select).execute(function(){&#xD;
        select.remove();&#xD;
    });&#xD;
}else{&#xD;
    $notify(&quot;请选择需要删除的数据……&quot;);&#xD;
}</ClientEvent>
          <Property name="caption">删除</Property>
          <Property name="exClassName">btn3</Property>
          <Property name="iconClass">fa fa-trash-o</Property>
        </ToolBarButton>
      </ToolBar>
      <DataGrid id="dgMain" layoutConstraint="padding:15px 0px 0px 0px">
        <ClientEvent name="onDataRowClick">view.get(&quot;#dgMain&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="readOnly">true</Property>
        <Property name="selectionMode">singleRow</Property>
        <RowSelectorColumn/>
        <RowNumColumn/>
        <DataColumn name="ajdh">
          <Property name="property">ajdh</Property>
@@ -203,7 +204,8 @@
        </DataColumn>
      </DataGrid>
    </Container>
    <Dialog id="dialogMain">
    <Dialog id="dialogMain" layout="regionPadding:10">
      <Property name="iconClass">fa fa-pencil-square-o</Property>
      <Property name="closeable">false</Property>
      <Property name="caption">廒间信息</Property>
      <Property name="width">60%</Property>
@@ -231,73 +233,79 @@
        </Button>
      </Buttons>
      <Children>
        <AutoForm>
          <Property name="dataSet">dsMain</Property>
          <Property name="cols">*,*</Property>
          <Property name="labelAlign">right</Property>
          <Property name="labelSeparator">:</Property>
          <Property name="labelWidth">150</Property>
          <AutoFormElement>
            <Property name="name">ajdh</Property>
            <Property name="property">ajdh</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">deptId</Property>
            <Property name="property">deptId</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">ajmc</Property>
            <Property name="property">ajmc</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">cfbh</Property>
            <Property name="property">cfbh</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">ajcd</Property>
            <Property name="property">ajcd</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">ajkd</Property>
            <Property name="property">ajkd</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">ajgd</Property>
            <Property name="property">ajgd</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">ajsjcr</Property>
            <Property name="property">ajsjcr</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">ajlxdh</Property>
            <Property name="property">ajlxdh</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">ajqyrq</Property>
            <Property name="property">ajqyrq</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">ajzt</Property>
            <Property name="property">ajzt</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">updateTime</Property>
            <Property name="property">updateTime</Property>
            <Editor/>
          </AutoFormElement>
        </AutoForm>
        <FieldSet layout="padding:5">
          <Property name="caption">基本信息</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsMain</Property>
              <Property name="cols">*,*</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelSeparator">:</Property>
              <Property name="labelWidth">150</Property>
              <AutoFormElement>
                <Property name="name">ajdh</Property>
                <Property name="property">ajdh</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">deptId</Property>
                <Property name="property">deptId</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ajmc</Property>
                <Property name="property">ajmc</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">cfbh</Property>
                <Property name="property">cfbh</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ajcd</Property>
                <Property name="property">ajcd</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ajkd</Property>
                <Property name="property">ajkd</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ajgd</Property>
                <Property name="property">ajgd</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ajsjcr</Property>
                <Property name="property">ajsjcr</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ajlxdh</Property>
                <Property name="property">ajlxdh</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ajqyrq</Property>
                <Property name="property">ajqyrq</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ajzt</Property>
                <Property name="property">ajzt</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">updateTime</Property>
                <Property name="property">updateTime</Property>
                <Editor/>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </FieldSet>
      </Children>
      <Tools/>
    </Dialog>
igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/pr/FileUploadManage.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,88 @@
package com.fzzy.igds.sys.pr;
import com.bstek.dorado.uploader.UploadFile;
import com.bstek.dorado.uploader.annotation.FileResolver;
import com.fzzy.igds.file.FileService;
import com.fzzy.igds.util.ContextUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.util.Map;
/**
 * @Description Dorado7 é™„件上传公共管理层
 * @Author CZT
 * @Date 2024/12/28 10:05
 */
@Slf4j
@Component
public class FileUploadManage {
    @Resource
    private FileService fileService;
    /**
     * ä¸Šä¼ åº“区简介视频
     * fileUploadManage#videoFile
     *
     * @param file
     * @param parameter
     * @return
     */
    @FileResolver
    public String videoFile(UploadFile file, Map<String, Object> parameter) {
        String fileId = null;
        try {
            String basePath = fileService.getDeptFilePath(null);
            fileId = "aerial-" + ContextUtil.subDeptId(null)
                    + file.getFileName().substring(
                    file.getFileName().lastIndexOf("."));
            file.transferTo(new File(basePath + fileId));
        } catch (IllegalStateException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return fileId;
    }
    /**
     * ä¸Šä¼ åº“区鸟瞰图
     * fileUploadManage#imgFile
     *
     * @param file
     * @param parameter
     * @return
     */
    @FileResolver
    public String imgFile(UploadFile file, Map<String, Object> parameter) {
        String fileId = null;
        try {
            String basePath = fileService.getDeptFilePath(null);
            fileId = "aerial-" + ContextUtil.subDeptId(null)
                    + file.getFileName().substring(
                    file.getFileName().lastIndexOf("."));
            file.transferTo(new File(basePath + fileId));
        } catch (IllegalStateException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return fileId;
    }
}
igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/controller/WebController.java
@@ -1,6 +1,9 @@
package com.fzzy.igds.dzhwk.controller;
import com.fzzy.igds.dzhwk.data.DzhwkConfigData;
import com.fzzy.igds.dzhwk.domain.Dept;
import com.fzzy.igds.dzhwk.manager.WebManager;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
@@ -23,6 +26,8 @@
    @Resource
    private DzhwkConfigData dzhwkConfigData;
    @Resource
    private WebManager webManager;
    /**
     * é”å±
@@ -262,4 +267,40 @@
        return prefix + "sys";
    }
    /**
     * è§†é¢‘预览页面
     *
     * @return
     */
    @RequestMapping("/dept-video")
    public String deptVideo(@RequestParam(value = "id", required = true) String id,
                            ModelMap view) {
        if(StringUtils.isNotEmpty(id)){
            Dept dept = webManager.getDeptFile(id);
            view.put("videoPath", dept.getVideoFilePath());
        }
        return prefix + "dept-video";
    }
    /**
     * é¸Ÿçž°å›¾é¢„览页面
     *
     * @return
     */
    @RequestMapping("/dept-img")
    public String deptImg(@RequestParam(value = "id", required = true) String id,
                          ModelMap view) {
        if(StringUtils.isNotEmpty(id)){
            Dept dept = webManager.getDeptFile(id);;
            view.put("imgPath", dept.getImgFilePath());
        }
        return prefix + "dept-img";
    }
}
igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/manager/WebManager.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
package com.fzzy.igds.dzhwk.manager;
import com.fzzy.igds.dzhwk.data.DzhwkConfigData;
import com.fzzy.igds.dzhwk.domain.Dept;
import com.fzzy.igds.file.FileService;
import com.fzzy.igds.sys.CoreDeptService;
import com.ruoyi.common.config.FrameworkConfig;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.File;
/**
 * @Description
 * @Author CZT
 * @Date 2025/6/3 16:06
 */
@Slf4j
@Component("WebManager")
public class WebManager {
    @Resource
    private CoreDeptService coreDeptService;
    @Resource
    private FileService fileService;
    @Resource
    private DzhwkConfigData dzhwkConfigData;
    /**
     * æ ¹æ®å•位ID获取单位信息
     *
     * @param deptId
     * @return
     */
    public Dept getDeptFile(String deptId) {
        if (StringUtils.isEmpty(deptId)) {
            return null;
        }
        Dept dept = coreDeptService.getDataById(deptId);
        dept.setImgFilePath("未上传");
        if (StringUtils.isNotEmpty(dept.getFileId())) {
            String imgBathPath = fileService.getDeptFilePath(dept.getCompanyId()) + dept.getFileId();
            File imgFile = new File(imgBathPath);
            if (imgFile.exists()) {
                imgBathPath = imgBathPath.replace(dzhwkConfigData.getProfile(), "/profile/");
                dept.setImgFilePath(imgBathPath);
            }
        }
        dept.setVideoFilePath("未上传");
        if (StringUtils.isNotEmpty(dept.getVideoId())) {
            String imgBathPath = fileService.getDeptFilePath(dept.getCompanyId()) + dept.getVideoId();
            File imgFile = new File(imgBathPath);
            if (imgFile.exists()) {
                imgBathPath = imgBathPath.replace(dzhwkConfigData.getProfile(), "/profile/");
                dept.setVideoFilePath(imgBathPath);
            }
        }
        return dept;
    }
}
igds-dzhwk-web/src/main/resources/templates/dzhwk/dept-img.html
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <title>视频预览</title>
    <link rel="stylesheet" th:href="@{/ajax/libs/layui/css/layui.css}"/>
    <style type="text/css">
        .layui-card-header {
            font-weight: bold;
            background-color: #39aef5;
            color: #FFF;
        }
        .layui-card-body {
            text-align: center;
        }
        thead span {
            font-weight: bold
        }
        .video {
            width: 100%;;
            height: 100%;
        }
    </style>
</head>
<body>
<!-- å¯è¿½è¸ªä¿¡æ¯ -->
<div class="layui-tab-content">
    <div class="layui-fluid" id="recordFilesDiv">
        <div class="layui-col-md12 layui-col-sm12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <img th:src="${imgPath}" style="height: 100%;width: 100%">
                </div>
            </div>
        </div>
    </div>
</div>
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
<script>
</script>
</body>
</html>
igds-dzhwk-web/src/main/resources/templates/dzhwk/dept-video.html
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <title>视频预览</title>
    <link rel="stylesheet" th:href="@{/ajax/libs/layui/css/layui.css}"/>
    <style type="text/css">
        .layui-card-header {
            font-weight: bold;
            background-color: #39aef5;
            color: #FFF;
        }
        .layui-card-body {
            text-align: center;
        }
        thead span {
            font-weight: bold
        }
        .video {
            width: 100%;;
            height: 100%;
        }
    </style>
</head>
<body>
<!-- å¯è¿½è¸ªä¿¡æ¯ -->
<div class="layui-tab-content">
    <div class="layui-fluid" id="recordFilesDiv">
        <div class="layui-col-md12 layui-col-sm12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <video class='video' th:src="${videoPath}" controls='controls'></video>
                </div>
            </div>
        </div>
    </div>
</div>
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/ajax/libs/layui/layui.js}"></script>
<script>
</script>
</body>
</html>