From 4901f0cf60ecc6484d149ca5e9a0083e4b21db21 Mon Sep 17 00:00:00 2001 From: czt <czt18638530771@163.com> Date: 星期二, 03 六月 2025 17:09:17 +0800 Subject: [PATCH] 增加库区鸟瞰图及简介视频上传 --- igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Dept.view.xml | 238 ++++++++- igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/pr/FileUploadManage.java | 88 +++ igds-dzhwk-web/src/main/resources/templates/dzhwk/dept-img.html | 50 ++ igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Company.view.xml | 74 +- igds-dzhwk-core/src/main/java/com/fzzy/igds/file/FileService.java | 138 ++++++ igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/controller/WebController.java | 41 + igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/Dept.java | 35 + igds-dzhwk-view/pom.xml | 24 + igds-dzhwk-web/src/main/resources/templates/dzhwk/dept-video.html | 50 ++ igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/manager/WebManager.java | 62 ++ igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Building.view.xml | 303 ++++++------ igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Granary.view.xml | 228 +++++---- 12 files changed, 990 insertions(+), 341 deletions(-) diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/Dept.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/Dept.java index c3686cd..ee78c1f 100644 --- a/igds-dzhwk-core/src/main/java/com/fzzy/igds/dzhwk/domain/Dept.java +++ b/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 = "楦熺灠鍥緄d") + private String fileId; + + @Column(name = "FILE_NAME_", length = 50) + @PropertyDef(label = "楦熺灠鍥惧悕绉�") + private String fileName; + + /** + * --------瀹d紶瑙嗛淇℃伅-------- + **/ + @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; } \ No newline at end of file diff --git a/igds-dzhwk-core/src/main/java/com/fzzy/igds/file/FileService.java b/igds-dzhwk-core/src/main/java/com/fzzy/igds/file/FileService.java new file mode 100644 index 0000000..feb0e60 --- /dev/null +++ b/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); + } + +} \ No newline at end of file diff --git a/igds-dzhwk-view/pom.xml b/igds-dzhwk-view/pom.xml index 8fa01f4..f011312 100644 --- a/igds-dzhwk-view/pom.xml +++ b/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> diff --git a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Building.view.xml b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Building.view.xml index 54c09f2..8c34524 100644 --- a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Building.view.xml +++ b/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("#dsMain").insert();
 - view.get("#dialogMain").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 select = view.get("#dgMain").get("selection");
 + <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("#dsMain").insert();
 +view.get("#dialogMain").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("#dgMain").get("selection");
 if(select){
 view.get("#dialogMain").show();;
 }else{
 $notify("璇烽�夋嫨闇�瑕佷慨鏀圭殑鏁版嵁鈥︹��");
 -} </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 select = view.get("#dgMain").get("selection");
 +}</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("#dgMain").get("selection");
 if(select){
 view.get("#ajaxDel").set("parameter",select).execute(function(){
 - select.remove();
 - });
 + select.remove();
 + });
 }else{
 $notify("璇烽�夋嫨闇�瑕佸垹闄ょ殑鏁版嵁鈥︹��");
 -}
 -</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("#dialogMain");
 - 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("#dgMain").set("selection",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> diff --git a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Company.view.xml b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Company.view.xml index 4de6ea9..9ad9aac 100644 --- a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Company.view.xml +++ b/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">
 -var select = view.get("#dgMain").get("selection");
 + <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("#dgMain").get("selection");
 if(select){
 view.get("#dialogMain").show();;
 }else{
 - $notify("璇烽�夋嫨闇�瑕佷慨鏀圭殑鏁版嵁鈥︹��");
 -} </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 select = view.get("#dgMain").get("selection");
 + $notify("璇烽�夋嫨闇�瑕佺紪杈戠殑鏁版嵁鈥︹��");
 +}</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("#dgMain").get("selection");
 if(select){
 view.get("#ajaxDel").set("parameter",select).execute(function(){
 - select.remove();
 - });
 + select.remove();
 + });
 }else{
 $notify("璇烽�夋嫨闇�瑕佸垹闄ょ殑鏁版嵁鈥︹��");
 -}
 -</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("#dialogMain");
 - 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("#dgMain").set("selection",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> diff --git a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Dept.view.xml b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Dept.view.xml index 12d68e0..e48f9ab 100644 --- a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Dept.view.xml +++ b/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">楦熺灠鍥緄d</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">/**
 + * 棰勮瑙嗛
 + */
 + showVideo = function(){
 + var cur = view.get("#dsMain.data:#");
 + var fileName = cur.get("fileId");
 + if(!fileName){
 + $alert("娌℃湁涓婁紶瑙嗛淇℃伅锛屾棤娉曢瑙堛��");
 + return;
 + }
 + var id = cur.get("id");
 + 
 + view.get("#iFrameVideo").set("path", "./dzhwk/dept-video?id=" + id);
 + view.get("#dialogVideo").show();
 + 
 + }; + /**
 + * 棰勮鍥剧墖
 + */
 + showImg = function(){
 + var cur = view.get("#dsMain.data:#");
 + var fileName = cur.get("fileId");
 + if(!fileName){
 + $alert("娌℃湁涓婁紶瑙嗛淇℃伅锛屾棤娉曢瑙堛��");
 + return;
 + }
 + var id = cur.get("id");
 + 
 + view.get("#iFrameImg").set("path", "./dzhwk/dept-img?id=" + id);
 + view.get("#dialogImg").show();
 + 
 + };</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">
 -var select = view.get("#dgMain").get("selection");
 + <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("#dgMain").get("selection");
 if(select){
 view.get("#dialogMain").show();;
 }else{
 - $notify("璇烽�夋嫨闇�瑕佷慨鏀圭殑鏁版嵁鈥︹��");
 -} </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 select = view.get("#dgMain").get("selection");
 + $notify("璇烽�夋嫨闇�瑕佺紪杈戠殑鏁版嵁鈥︹��");
 +}</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("#dgMain").get("selection");
 if(select){
 view.get("#ajaxDel").set("parameter",select).execute(function(){
 - select.remove();
 - });
 + select.remove();
 + });
 }else{
 $notify("璇烽�夋嫨闇�瑕佸垹闄ょ殑鏁版嵁鈥︹��");
 }</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("#dialogMain");
 - 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("#dgMain").set("selection",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;
 + var data = view.get("#dsMain.data:#");
 + data.set("fileId",fileId);
 + data.set("fileName",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;
 + var data = view.get("#dsMain.data:#");
 + data.set("videoId",videoId);
 + data.set("videoName",arg.file.name);</ClientEvent> + <Property name="fileResolver">fileUploadManage#videoFile</Property> + <Property name="maxFileSize">500MB</Property> + <Filters/> + </UploadAction> </View> </ViewConfig> diff --git a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Granary.view.xml b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Granary.view.xml index 7f72b5c..f052593 100644 --- a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/Granary.view.xml +++ b/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("#dsMain").insert();
 + <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("#dsMain").insert();
 view.get("#dialogMain").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("#dialogMain");
 -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("#dsMain.data:#");
 -if(!cur) return;
 -view.get("#ajaxDel").set("parameter",cur).execute(function(result){
 - if(result){
 - $alert(result);
 - return;
 - }else{
 - cur.remove();
 - }
 -});</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("#dialogMain");
 -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("#dgMain").get("selection");
 +if(select){
 + view.get("#dialogMain").show();;
 +}else{
 + $notify("璇烽�夋嫨闇�瑕佷慨鏀圭殑鏁版嵁鈥︹��");
 +}</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("#dgMain").get("selection");
 +if(select){
 + view.get("#ajaxDel").set("parameter",select).execute(function(){
 + select.remove();
 + });
 +}else{
 + $notify("璇烽�夋嫨闇�瑕佸垹闄ょ殑鏁版嵁鈥︹��");
 +}</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("#dgMain").set("selection",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> diff --git a/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/pr/FileUploadManage.java b/igds-dzhwk-view/src/main/java/com/fzzy/igds/sys/pr/FileUploadManage.java new file mode 100644 index 0000000..0e814dd --- /dev/null +++ b/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; + } + +} diff --git a/igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/controller/WebController.java b/igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/controller/WebController.java index 0558441..a84f9ea 100644 --- a/igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/controller/WebController.java +++ b/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"; + } } diff --git a/igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/manager/WebManager.java b/igds-dzhwk-web/src/main/java/com/fzzy/igds/dzhwk/manager/WebManager.java new file mode 100644 index 0000000..eb2ead8 --- /dev/null +++ b/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; + } +} diff --git a/igds-dzhwk-web/src/main/resources/templates/dzhwk/dept-img.html b/igds-dzhwk-web/src/main/resources/templates/dzhwk/dept-img.html new file mode 100644 index 0000000..40ea30b --- /dev/null +++ b/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> diff --git a/igds-dzhwk-web/src/main/resources/templates/dzhwk/dept-video.html b/igds-dzhwk-web/src/main/resources/templates/dzhwk/dept-video.html new file mode 100644 index 0000000..1487f41 --- /dev/null +++ b/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> -- Gitblit v1.9.3