Browse Source

Merge branch '20210916' of http://47.110.88.109/gogs/guozi_sys/daxt into origin/20210916

15050590500 3 years ago
parent
commit
9eadd5d40d
78 changed files with 2886 additions and 1324 deletions
  1. 10 1
      README.md
  2. 5 3
      pom.xml
  3. 6 0
      src/main/java/com/gz/GuihuaArchivesApplication.java
  4. 1 1
      src/main/java/com/gz/common/DataGlobalVariable.java
  5. 22 5
      src/main/java/com/gz/config/FileUploadConfig.java
  6. 10 16
      src/main/java/com/gz/controller/archive/SecondaryArchiveController.java
  7. 28 9
      src/main/java/com/gz/controller/system/AdminController.java
  8. 5 0
      src/main/java/com/gz/controller/system/DictController.java
  9. 0 1
      src/main/java/com/gz/controller/system/FileController.java
  10. 0 4
      src/main/java/com/gz/core/UUIDBaseDTO.java
  11. 9 0
      src/main/java/com/gz/dto/archive/ArchiveDTO.java
  12. 5 0
      src/main/java/com/gz/job/MountArchiveFileJob.java
  13. 0 10
      src/main/java/com/gz/mapper/statistics/SelectStatisticsMapper.java
  14. 10 0
      src/main/java/com/gz/mapper/system/AdminMapper.java
  15. 3 0
      src/main/java/com/gz/mapper/system/MenuRoleMapper.java
  16. 2 0
      src/main/java/com/gz/rvo/statistics/ArchiveStatisticsRVO.java
  17. 2 0
      src/main/java/com/gz/rvo/statistics/ArchiveYearStatisticsRVO.java
  18. 1 1
      src/main/java/com/gz/scheduled/ScanArchiveFileScheduled.java
  19. 2 1
      src/main/java/com/gz/service/archive/SecondaryArchiveService.java
  20. 48 10
      src/main/java/com/gz/service/archive/impl/ArchiveFileServiceImpl.java
  21. 12 7
      src/main/java/com/gz/service/archive/impl/ArchiveServiceImpl.java
  22. 4 3
      src/main/java/com/gz/service/archive/impl/SecondaryArchiveServiceImpl.java
  23. 152 0
      src/main/java/com/gz/service/statistics/impl/SelectStatisticsServiceImpl.java
  24. 1 1
      src/main/java/com/gz/service/system/AdminService.java
  25. 7 0
      src/main/java/com/gz/service/system/DictService.java
  26. 1 0
      src/main/java/com/gz/service/system/FileService.java
  27. 10 0
      src/main/java/com/gz/service/system/RoleService.java
  28. 15 7
      src/main/java/com/gz/service/system/impl/AdminServiceImpl.java
  29. 6 0
      src/main/java/com/gz/service/system/impl/DictServiceImpl.java
  30. 7 0
      src/main/java/com/gz/service/system/impl/FileServiceImpl.java
  31. 18 7
      src/main/java/com/gz/service/system/impl/RoleServiceImpl.java
  32. 1 0
      src/main/java/com/gz/utils/UnitUtils.java
  33. 84 0
      src/main/java/com/gz/utils/WatermarkUtils.java
  34. 3 0
      src/main/java/com/gz/vo/archive/SearchArchiveVO.java
  35. 2 0
      src/main/java/com/gz/vo/statistics/StatisticsVO.java
  36. 6 0
      src/main/java/com/gz/vo/system/AdminVO.java
  37. 1 0
      src/main/resources/application-dev.yml
  38. 2 1
      src/main/resources/application-prod.yml
  39. 1 1
      src/main/resources/application.yml
  40. 17 1
      src/main/resources/mapper/adminMapper.xml
  41. 86 86
      src/main/resources/mapper/archiveMapper.xml
  42. 32 28
      src/main/resources/mapper/selectStatisticsMapper.xml
  43. 42 33
      src/main/resources/static/css/public.css
  44. 2 0
      src/main/resources/static/js/jquery-3.6.0.min.js
  45. 511 0
      src/main/resources/static/js/jquery.media.js
  46. 357 333
      src/main/resources/static/js/lay-module/layuimini/miniMenu.js
  47. 1 1
      src/main/resources/static/js/lay-module/layuimini/miniTab.js
  48. 8 0
      src/main/resources/static/js/lay-module/utils/base64.min.js
  49. 7 0
      src/main/resources/static/js/utils.js
  50. 13 16
      src/main/resources/static/page/admin/edit.html
  51. 10 12
      src/main/resources/static/page/admin/list.html
  52. 59 41
      src/main/resources/static/page/archive/edit.html
  53. 10 10
      src/main/resources/static/page/archive/editSecondary.html
  54. 167 0
      src/main/resources/static/page/archive/editSecondaryNew.html
  55. 4 5
      src/main/resources/static/page/archive/fileList.html
  56. 29 24
      src/main/resources/static/page/archive/list.html
  57. 5 10
      src/main/resources/static/page/archive/secondaryList.html
  58. 123 41
      src/main/resources/static/page/archive/show.html
  59. 4 3
      src/main/resources/static/page/archive/upload.html
  60. 30 29
      src/main/resources/static/page/archives-tree/edit.html
  61. 2 6
      src/main/resources/static/page/archives-tree/list.html
  62. 6 4
      src/main/resources/static/page/auditList/audit.html
  63. 1 3
      src/main/resources/static/page/auditList/list.html
  64. 25 7
      src/main/resources/static/page/borrow/list.html
  65. 25 19
      src/main/resources/static/page/borrow/reserve.html
  66. 7 7
      src/main/resources/static/page/dept/edit.html
  67. 28 22
      src/main/resources/static/page/dept/list.html
  68. 2 4
      src/main/resources/static/page/myBorrow/list.html
  69. 3 3
      src/main/resources/static/page/myBorrow/ruditResult.html
  70. 18 19
      src/main/resources/static/page/role/edit.html
  71. 56 29
      src/main/resources/static/page/role/editRole.html
  72. 63 59
      src/main/resources/static/page/role/list.html
  73. 158 125
      src/main/resources/static/page/statistics/archiveStatistics.html
  74. 190 119
      src/main/resources/static/page/statistics/archiveYearStatistics.html
  75. 163 126
      src/main/resources/static/page/statistics/borrowStatistics.html
  76. 4 10
      src/test/java/com/gz/ConverOldSystemData.java
  77. 56 0
      src/test/java/com/gz/HandleSource.java
  78. 60 0
      src/test/java/com/gz/WatermarkPdf.java

+ 10 - 1
README.md

@@ -15,7 +15,7 @@ ______
 > 配置:16h32g 500g Centos7.8
 > + ip: `66.1.21.157`
 > + 用户名: `root`
-> + 密码: ` Jda!2t456`
+> + 密码: `Jda!2t456`
 
 #### mysql部署说明:
 
@@ -110,3 +110,12 @@ ______
 > + 附件:南京NO.2018G46地块(奥特佳项目)规划设计方案
 > + 关于对建邺区江东中路377号南京金融城一期项目地下室进行确认的复函
 > + 卷内目录档号Excel处理公式:`=CONCAT(A2,"-",IF(COUNTIF(G2,"*-*"),TEXT(LEFT(G2,FIND("-",G2)-1),"0000"),TEXT(G2,"0000")))`
+
+> Excel卷内目录档号公式   `=A2&"-"&TEXT(IF(ISNUMBER(FIND("-",G2,1)),LEFT(G2,FIND("-",G2,1) - 1),G2),"0000")`
+
+
+## 6.数据挂接
+* 2019年文书档案
+> 已挂接完成
+* 2020年文书档案
+> 挂接中:

+ 5 - 3
pom.xml

@@ -149,20 +149,22 @@
             <artifactId>bboss-elasticsearch-spring-boot-starter</artifactId>
             <version>${bboss.elasticsearch.version}</version>
         </dependency>
-
         <dependency>
             <groupId>com.itextpdf</groupId>
             <artifactId>itextpdf</artifactId>
             <version>5.5.13</version>
         </dependency>
-
+        <dependency>
+            <groupId>org.apache.pdfbox</groupId>
+            <artifactId>pdfbox</artifactId>
+            <version>2.0.12</version>
+        </dependency>
         <dependency>
             <groupId>com.lowagie</groupId>
             <artifactId>itext</artifactId>
             <version>4.2.1</version>
         </dependency>
     </dependencies>
-
     <build>
         <plugins>
             <plugin>

+ 6 - 0
src/main/java/com/gz/GuihuaArchivesApplication.java

@@ -1,13 +1,19 @@
 package com.gz;
 
+import com.gz.scheduled.ScanArchiveFileScheduled;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Import;
 import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 @EnableScheduling
 @SpringBootApplication
+@Import(value = {
+        ScanArchiveFileScheduled.class
+})
 public class GuihuaArchivesApplication {
 
     public static void main(String[] args) {

+ 1 - 1
src/main/java/com/gz/common/DataGlobalVariable.java

@@ -86,7 +86,7 @@ public class DataGlobalVariable {
     /** ---------------------统计相关 ------------------------*/
     public static final String STATISTICS_ML_CODE_KEY_FOMAT = "STATISTICS_CODE_%s";
     /** 统计缓存时间*/
-    public static final Long CACHE_EXPIRES = 30L;
+    public static final Long CACHE_EXPIRES = 5L;
 
     /** 缓存时间单位*/
     public static final TimeUnit TIME_UNIT = TimeUnit.MINUTES;

+ 22 - 5
src/main/java/com/gz/config/FileUploadConfig.java

@@ -12,27 +12,44 @@ import org.springframework.context.annotation.Configuration;
 @Configuration
 public class FileUploadConfig {
 
-    /** 文档附件根目录地址*/
+    /**
+     * 文档附件根目录地址
+     */
     public static String ARCHIVE_FILE_ROOT_DIRECTORY;
 
-    /** 附件根目录地址*/
+    /**
+     * 附件根目录地址
+     */
     public static String FILE_ROOT_DIRECTORY;
 
-    /** 附件上传目录 归档年份/全宗号-保管期限(归档年度)-文件格式   文件格式只有 PDF和TF*/
+    /**
+     * 生成的水印文件根目录地址
+     */
+    public static String WATERMARK_ARCHIVE_FILE_ROOT_DIRECTORY;
+
+    /**
+     * 附件上传目录 归档年份/全宗号-保管期限(归档年度)-文件格式   文件格式只有 PDF和TF
+     */
     public static final String ARCHIVE_UPLOAD_PATH_PDF_FOMAT = "/%s/%s-%s(%s)-%s";
 
     public static final String ARCHIVE_UPLOAD_PATH_TIF_FOMAT = "/%s/%s-%s(%s)-%s/%s";
 
     @Value("${upload-file.archive-file-root-directory}")
     public void setArchiveFileRootDirectory(String uploadFileRootDirectory) {
-        log.info("文档附件根目录地址:{}",uploadFileRootDirectory);
+        log.info("文档附件根目录地址:{}", uploadFileRootDirectory);
         ARCHIVE_FILE_ROOT_DIRECTORY = uploadFileRootDirectory;
     }
 
 
     @Value("${upload-file.file-root-directory}")
     public void setFileRootDirectory(String uploadFileRootDirectory) {
-        log.info("其他附件根目录地址:{}",uploadFileRootDirectory);
+        log.info("其他附件根目录地址:{}", uploadFileRootDirectory);
         FILE_ROOT_DIRECTORY = uploadFileRootDirectory;
     }
+
+    @Value("${upload-file.watermark-archive-file-root-directory}")
+    public void setWatermarkArchiveFileRootDirectory(String watermarkArchiveFileRootDirectory) {
+        log.info("其他附件根目录地址:{}", watermarkArchiveFileRootDirectory);
+        WATERMARK_ARCHIVE_FILE_ROOT_DIRECTORY = watermarkArchiveFileRootDirectory;
+    }
 }

+ 10 - 16
src/main/java/com/gz/controller/archive/SecondaryArchiveController.java

@@ -8,6 +8,7 @@ import com.gz.vo.PageVO;
 import com.gz.vo.archive.SecondaryArchiveInsertVO;
 import com.gz.vo.archive.SecondaryArchiveVO;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import java.util.List;
@@ -28,9 +29,12 @@ public class SecondaryArchiveController {
      * @author LiuChangLan
      * @since 2020/9/4 14:46
      */
-    @PostMapping("insert")
-    Integer insert(SecondaryArchiveInsertVO dto) throws Exception{
-        return service.insert(dto);
+    @PostMapping("save")
+    Integer insert(SecondaryArchiveDTO dto,@RequestParam("uploadFile") MultipartFile uploadFile) throws Exception {
+        if(null != dto.getId()){
+            return service.update(dto);
+        }
+        return service.insert(dto,uploadFile);
     }
 
     /**
@@ -39,27 +43,17 @@ public class SecondaryArchiveController {
      * @since 2020/9/4 14:46
      */
     @DeleteMapping("delete")
-    Integer delete(Integer id){
+    Integer delete(Integer id) {
         return service.delete(id);
     }
 
     /**
-     * @description 改
-     * @author LiuChangLan
-     * @since 2020/9/4 14:46
-     */
-    @PostMapping("update")
-    Integer update(@RequestBody SecondaryArchiveDTO dto){
-        return service.update(dto);
-    }
-
-    /**
      * @description 分页查询
      * @author LiuChangLan
      * @since 2020/9/4 14:46
      */
     @GetMapping("selectByPage")
-    PageInfo<SecondaryArchiveDTO> selectByPage(SecondaryArchiveVO vo){
+    PageInfo<SecondaryArchiveDTO> selectByPage(SecondaryArchiveVO vo) {
         return service.selectByPage(vo);
     }
 
@@ -81,7 +75,7 @@ public class SecondaryArchiveController {
      * @since 2021/3/9 15:35
      */
     @GetMapping("selectByArchiveId")
-    List<SecondaryArchiveDTO> selectByArchiveId(Integer archiveId){
+    List<SecondaryArchiveDTO> selectByArchiveId(Integer archiveId) {
         return service.selectByArchiveId(archiveId);
     }
 }

+ 28 - 9
src/main/java/com/gz/controller/system/AdminController.java

@@ -1,15 +1,18 @@
 package com.gz.controller.system;
 
+import com.alibaba.fastjson.JSON;
 import com.github.pagehelper.PageInfo;
 import com.gz.core.annotation.TraceLog;
 import com.gz.dto.system.AdminDTO;
 import com.gz.rvo.system.AdminRVO;
 import com.gz.service.system.AdminService;
 import com.gz.vo.system.AdminVO;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author LiuchangLan
@@ -22,23 +25,33 @@ public class AdminController {
     @Resource
     private AdminService adminService;
 
-    @PostMapping("insert")
+    @PostMapping("addOrUpdate")
     @TraceLog(module = "管理员管理",business = "新增管理员")
-    public Integer insert(@RequestBody AdminDTO adminDTO){
-        return adminService.insert(adminDTO);
+    public Integer addOrUpdate(@RequestBody AdminDTO adminDTO){
+        if(StringUtils.isNotBlank(adminDTO.getId())){
+            return adminService.update(adminDTO);
+        }else{
+            return adminService.insert(adminDTO);
+        }
     }
 
+//    @PostMapping("insert")
+//    @TraceLog(module = "管理员管理",business = "新增管理员")
+//    public Integer insert(@RequestBody AdminDTO adminDTO){
+//        return adminService.insert(adminDTO);
+//    }
+
     @DeleteMapping("delete")
     @TraceLog(module = "管理员管理",business = "删除管理员")
-    public Integer delete( Integer id){
+    public Integer delete(String id){
         return adminService.delete(id);
     }
 
-    @PostMapping("update")
-    @TraceLog(module = "管理员管理",business = "修改管理员")
-    public Integer update(@RequestBody AdminDTO adminDTO){
-        return adminService.update(adminDTO);
-    }
+//    @PostMapping("update")
+//    @TraceLog(module = "管理员管理",business = "修改管理员")
+//    public Integer update(@RequestBody AdminDTO adminDTO){
+//        return adminService.update(adminDTO);
+//    }
 
     @GetMapping("select")
     @TraceLog(module = "管理员管理",business = "查询管理员列表")
@@ -74,4 +87,10 @@ public class AdminController {
         return adminService.selectByPrimaryKeyDept(id);
     }
 
+    @PostMapping("synchronize")
+    Map<String,Object> synchronize(@RequestBody String s){
+        Map mapTypes = JSON.parseObject(s);
+        return adminService.synchronize(mapTypes);
+    }
+
 }

+ 5 - 0
src/main/java/com/gz/controller/system/DictController.java

@@ -129,4 +129,9 @@ public class DictController {
     List<Map> selectMiJiRole(Integer roleId){
         return dictService.selectMiJiRole(roleId);
     }
+
+    @GetMapping("selectDeptQx")
+    Integer selectDeptQx(Integer roleId){
+        return dictService.selectDeptQx(roleId);
+    }
 }

+ 0 - 1
src/main/java/com/gz/controller/system/FileController.java

@@ -2,7 +2,6 @@ package com.gz.controller.system;
 
 import com.gz.core.exception.BusinessException;
 import com.gz.dto.system.FileDTO;
-import com.gz.rvo.system.FileUploadRVO;
 import com.gz.service.system.FileService;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;

+ 0 - 4
src/main/java/com/gz/core/UUIDBaseDTO.java

@@ -1,15 +1,11 @@
 package com.gz.core;
 
-import cn.hutool.core.date.DateUtil;
-import com.gz.utils.JwtUtils;
 import com.gz.utils.UUIdGenId;
 import lombok.Data;
 import tk.mybatis.mapper.annotation.KeySql;
 import tk.mybatis.mapper.annotation.LogicDelete;
 
-import javax.annotation.sql.DataSourceDefinitions;
 import javax.persistence.Column;
-import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 
 /**

+ 9 - 0
src/main/java/com/gz/dto/archive/ArchiveDTO.java

@@ -116,4 +116,13 @@ public class ArchiveDTO extends BaseDTO {
 
     // 现地籍号
     private String xdjh;
+
+    // 来源
+    private String ly;
+
+    // 标签
+    private String bq;
+
+    // 行政区划
+    private String xzqh;
 }

+ 5 - 0
src/main/java/com/gz/job/MountArchiveFileJob.java

@@ -176,4 +176,9 @@ public class MountArchiveFileJob {
         }
         log.info("发送完成");
     }
+
+    public static void main(String[] args) {
+
+        System.out.println(ReUtil.isMatch(MountArchiveFileConfig.ZY_DH_RE, "5179-001-ZY·BH-Y-01802-0037"));
+    }
 }

+ 0 - 10
src/main/java/com/gz/mapper/statistics/SelectStatisticsMapper.java

@@ -5,24 +5,14 @@ import com.gz.rvo.statistics.ArchiveStatisticsRVO;
 import com.gz.rvo.statistics.ArchiveYearStatisticsRVO;
 import com.gz.rvo.statistics.BorrowStatisticsRVO;
 import com.gz.vo.statistics.StatisticsVO;
-import org.apache.ibatis.annotations.CacheNamespace;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-import org.springframework.cache.annotation.CacheConfig;
-import org.springframework.cache.annotation.Cacheable;
 
 import java.util.List;
 
-@CacheConfig(cacheNames = "SelectStatisticsMapper")
-@CacheNamespace
 public interface SelectStatisticsMapper{
 
-    @Cacheable(key ="#p0")
     List<ArchiveStatisticsRVO> selectArchiveStatistics(StatisticsVO vo);
 
-    @Cacheable(key ="#p0")
     List<ArchiveYearStatisticsRVO> selectArchiveYearStatistics(StatisticsVO vo);
 
-    @Cacheable(key ="#p0")
     List<BorrowStatisticsRVO> selectBorrowStatistics(StatisticsVO vo);
 }

+ 10 - 0
src/main/java/com/gz/mapper/system/AdminMapper.java

@@ -3,6 +3,7 @@ package com.gz.mapper.system;
 import com.gz.dto.system.AdminDTO;
 import com.gz.rvo.system.AdminRVO;
 import com.gz.vo.system.AdminVO;
+import org.apache.ibatis.annotations.Param;
 import tk.mybatis.mapper.common.Mapper;
 
 import java.util.List;
@@ -16,4 +17,13 @@ public interface AdminMapper extends Mapper<AdminDTO> {
     AdminRVO selectByPrimaryKeyDept(String id);
 
     List<AdminDTO> selectByPage(AdminVO vo);
+
+    /**
+     * 删除用户
+     * @param id
+     * @return
+     */
+    int deleteById(@Param("id") String id);
+
+    List<AdminDTO> selectList(AdminVO vo);
 }

+ 3 - 0
src/main/java/com/gz/mapper/system/MenuRoleMapper.java

@@ -2,6 +2,7 @@ package com.gz.mapper.system;
 
 import com.gz.dto.system.MenuRoleDTO;
 import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import tk.mybatis.mapper.common.Mapper;
 
@@ -13,4 +14,6 @@ import tk.mybatis.mapper.common.Mapper;
 public interface MenuRoleMapper extends Mapper<MenuRoleDTO> {
     @Delete("delete from tab_menu_role where role_id = #{roleId}")
     Integer deleteByRoleId(Integer roleId);
+    @Select("select menu_id from tab_menu_role where role_id=#{id} and role_type=4 ")
+    Integer selectDeptQx(@Param("id") Integer id);
 }

+ 2 - 0
src/main/java/com/gz/rvo/statistics/ArchiveStatisticsRVO.java

@@ -16,4 +16,6 @@ public class ArchiveStatisticsRVO {
     private Integer parentId;
     //磁盘占用的大小
     private String space;
+    //占用磁盘的总大小
+    private String sumSpace;
 }

+ 2 - 0
src/main/java/com/gz/rvo/statistics/ArchiveYearStatisticsRVO.java

@@ -13,6 +13,8 @@ public class ArchiveYearStatisticsRVO {
     private Integer fileCount;
     //占用磁盘大小
     private String space;
+    //累计占用磁盘大小
+    private String sumSpace;
 
 
 }

+ 1 - 1
src/main/java/com/gz/scheduled/ScanArchiveFileScheduled.java

@@ -5,10 +5,10 @@ import cn.hutool.core.util.StrUtil;
 import com.gz.config.MountArchiveFileConfig;
 import com.gz.core.exception.BusinessException;
 import lombok.extern.slf4j.Slf4j;
+import org.frameworkset.spi.annotations.Component;
 import org.springframework.context.annotation.Profile;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
 import java.io.File;

+ 2 - 1
src/main/java/com/gz/service/archive/SecondaryArchiveService.java

@@ -7,6 +7,7 @@ import com.gz.vo.PageVO;
 import com.gz.vo.archive.SecondaryArchiveInsertVO;
 import com.gz.vo.archive.SecondaryArchiveVO;
 import com.sun.javafx.image.IntPixelGetter;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
 
@@ -16,7 +17,7 @@ public interface SecondaryArchiveService {
      * @author LiuChangLan
      * @since 2020/9/4 14:46
      */
-    Integer insert(SecondaryArchiveInsertVO dto) throws Exception;
+    Integer insert(SecondaryArchiveDTO dto, MultipartFile uploadFile) throws Exception;
 
     /**
      * @description 删

+ 48 - 10
src/main/java/com/gz/service/archive/impl/ArchiveFileServiceImpl.java

@@ -1,6 +1,7 @@
 package com.gz.service.archive.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.IdUtil;
 import com.alibaba.fastjson.JSON;
 import com.github.pagehelper.PageHelper;
@@ -15,26 +16,30 @@ import com.gz.dto.system.MenuRoleDTO;
 import com.gz.mapper.archive.ArchiveFileMapper;
 import com.gz.mapper.archive.ArchiveMapper;
 import com.gz.mapper.system.MenuRoleMapper;
+import com.gz.mapper.system.RoleMapper;
 import com.gz.rvo.archive.ArchiveFileRVO;
 import com.gz.rvo.archive.ArchiveRVO;
 import com.gz.service.archive.ArchiveFileService;
+import com.gz.service.system.RoleService;
 import com.gz.utils.JwtUtils;
+import com.gz.utils.WatermarkUtils;
 import com.gz.vo.archive.SearchArchiveFileVO;
 import com.gz.vo.rabbitmq.OcrEtlVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.amqp.rabbit.core.RabbitTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
-import sun.text.resources.cldr.yav.FormatData_yav;
 
 import javax.annotation.Resource;
 import java.io.File;
 import java.io.IOException;
+import java.lang.reflect.Executable;
 import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
 /**
  * @author LiuchangLan
@@ -55,6 +60,9 @@ public class ArchiveFileServiceImpl implements ArchiveFileService {
     @Resource
     private MenuRoleMapper menuRoleMapper;
 
+    @Resource
+    private RoleService roleService;
+
 
     @Value("${rabbitmq.data-exchange}")
     private String dataExchangeName;
@@ -66,9 +74,11 @@ public class ArchiveFileServiceImpl implements ArchiveFileService {
     private String serverFileUrlPrefix;
 
 
+    ExecutorService archiveWatermarkHandleThreadPool = Executors.newCachedThreadPool();
+
     @Override
     @Transactional
-    public ArchiveFileDTO upload(MultipartFile file, Integer archiveId, Integer fileType,Integer secondaryArchiveId) throws BusinessException, IOException {
+    public ArchiveFileDTO upload(MultipartFile file, Integer archiveId, Integer fileType, Integer secondaryArchiveId) throws BusinessException, IOException {
         if (file.isEmpty()) {
             throw new BusinessException(CustomExceptionEnum.File_NOT_EXISTS);
         }
@@ -87,18 +97,18 @@ public class ArchiveFileServiceImpl implements ArchiveFileService {
             switch (fileFormat) {
                 case "PDF":
 //                serverFileUploadPath = String.format(FileUploadConfig.ARCHIVE_UPLOAD_PATH_PDF_FOMAT, archiveDTO.getGdnd(), archiveDTO.getQzh(), archiveDTO.getBgqx(), archiveDTO.getGdnd(), fileFormat);
-                    serverFileUploadPath = "/" + archiveDTO.getQzh() + "/" + archiveDTO.getGdnd() + "/" + archiveDTO.getMl() + "/" + archiveDTO.getBgqx() + "/" + archiveDTO.getDh() + "/pdf";
+                    serverFileUploadPath = "/" + archiveDTO.getQzh() + "/" + archiveDTO.getGdnd() + "/" + archiveDTO.getMl() + "/" + archiveDTO.getBgqx() + "/" + archiveDTO.getDh() + "/pdf/";
                     // pdf文件名为档号
-                    if (secondaryArchiveId != null){
-                        fn = String.format("%s_%s.%s", archiveDTO.getDh(),secondaryArchiveId, fileFormat.toLowerCase());
-                    }else {
+                    if (secondaryArchiveId != null) {
+                        fn = String.format("%s_%s.%s", archiveDTO.getDh(), secondaryArchiveId, fileFormat.toLowerCase());
+                    } else {
                         fn = String.format("%s.%s", archiveDTO.getDh(), fileFormat.toLowerCase());
                     }
                     break;
                 case "TIF":
                     // tif文件名为页码 无法通过后台生成 读取上传文件的名称
                     fn = fileName;
-                    serverFileUploadPath = "/" + archiveDTO.getQzh() + "/" + archiveDTO.getGdnd() + "/" + archiveDTO.getMl() + "/" + archiveDTO.getBgqx() + "/" + archiveDTO.getDh() + "/tif";
+                    serverFileUploadPath = "/" + archiveDTO.getQzh() + "/" + archiveDTO.getGdnd() + "/" + archiveDTO.getMl() + "/" + archiveDTO.getBgqx() + "/" + archiveDTO.getDh() + "/tif/";
                     break;
                 default:
                     // 其他文件直接抛错
@@ -106,7 +116,7 @@ public class ArchiveFileServiceImpl implements ArchiveFileService {
             }
         } else {
             // 附件
-            serverFileUploadPath = "/" + archiveDTO.getQzh() + "/" + archiveDTO.getGdnd() + "/" + archiveDTO.getMl() + "/" + archiveDTO.getBgqx() + "/" + archiveDTO.getDh() + "/other";
+            serverFileUploadPath = "/" + archiveDTO.getQzh() + "/" + archiveDTO.getGdnd() + "/" + archiveDTO.getMl() + "/" + archiveDTO.getBgqx() + "/" + archiveDTO.getDh() + "/other/";
             fn = String.format("%s.%s", IdUtil.simpleUUID(), fileFormat.toLowerCase());
         }
 
@@ -174,6 +184,34 @@ public class ArchiveFileServiceImpl implements ArchiveFileService {
         if (menuRoleMapper.select(param).stream().filter(i -> i.getMenuId() == 2).count() <= 0) {
             throw new BusinessException(CustomExceptionEnum.NO_ROLE);
         }
-        return archiveFileMapper.selectFileAndJnml(vo);
+        List<ArchiveFileRVO> archiveFileRVOS = archiveFileMapper.selectFileAndJnml(vo);
+        // 是否需要水印
+        if (roleService.selectArchiveRole(JwtUtils.getCurrentUserJwtPayload().getRoleId(), 3)) {
+            archiveFileRVOS.forEach(this::converHasWatermarkPdf);
+        }
+
+        return archiveFileRVOS;
+    }
+
+    public void converHasWatermarkPdf(ArchiveFileDTO sourceFile) {
+        // 需要生成水印的pdf文件
+        String sourcePdfFile = FileUploadConfig.ARCHIVE_FILE_ROOT_DIRECTORY + sourceFile.getFilePath() + sourceFile.getFileName();
+        // 水印生成位置文件
+        String watermarkFilePathStr = FileUploadConfig.WATERMARK_ARCHIVE_FILE_ROOT_DIRECTORY + "/"
+                + JwtUtils.getCurrentUserJwtPayload().getId()
+                + sourceFile.getFilePath();
+        File watermarkFilePath = FileUtil.file(watermarkFilePathStr);
+        if (!watermarkFilePath.exists()) {
+            // 目录不存在,创建目录
+            watermarkFilePath.mkdirs();
+        }
+        // 水印文件夹不存在生成水印后的文件
+        if (!FileUtil.file(watermarkFilePath + sourceFile.getFileName()).exists()) {
+            String adminName = JwtUtils.getCurrentUserJwtPayload().getAdminName();
+            // 使用线程池后台进行生成 不影响正常响应速度
+//            archiveWatermarkHandleThreadPool.execute(() -> WatermarkUtils.generateWatermarkPdf(sourcePdfFile, watermarkFilePathStr + sourceFile.getFileName(), adminName));
+            WatermarkUtils.generateWatermarkPdf(sourcePdfFile, watermarkFilePathStr + sourceFile.getFileName(), adminName);
+        }
+        sourceFile.setFilePath(JwtUtils.getCurrentUserJwtPayload().getId() + sourceFile.getFilePath());
     }
 }

+ 12 - 7
src/main/java/com/gz/service/archive/impl/ArchiveServiceImpl.java

@@ -4,7 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.exceptions.ExceptionUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.poi.excel.ExcelReader;
 import cn.hutool.poi.excel.ExcelUtil;
@@ -16,16 +15,17 @@ import com.gz.core.exception.BusinessException;
 import com.gz.core.exception.CustomExceptionEnum;
 import com.gz.dto.archive.ArchiveDTO;
 import com.gz.dto.archive.SecondaryArchiveDTO;
-import com.gz.dto.archive.SecondaryArchiveDTO;
 import com.gz.dto.system.ArchivesTreeDTO;
 import com.gz.dto.system.MenuRoleDTO;
 import com.gz.mapper.archive.ArchiveMapper;
 import com.gz.mapper.archive.SecondaryArchiveMapper;
+import com.gz.mapper.system.DeptMapper;
 import com.gz.mapper.system.MenuRoleMapper;
 import com.gz.rvo.archive.ArchiveRVO;
 import com.gz.rvo.borrow.ArchiveBorrowListRVO;
 import com.gz.service.archive.ArchiveService;
 import com.gz.service.system.ArchivesTreeService;
+import com.gz.service.system.DeptService;
 import com.gz.utils.ExcelUtils;
 import com.gz.utils.JwtUtils;
 import com.gz.utils.ObjectUtils;
@@ -87,10 +87,13 @@ public class ArchiveServiceImpl implements ArchiveService {
     @Resource
     private MenuRoleMapper menuRoleMapper;
 
+    @Resource
+    private DeptMapper deptMapper;
 
     @Override
     public Integer insert(InsertArchiveVO vo) throws Exception {
         vo.setCreated(JwtUtils.getCurrentUserJwtPayload().getId());
+        vo.setLy(JwtUtils.getCurrentUserJwtPayload().getDeptId());
         return mapper.insertSelective(vo);
     }
 
@@ -167,9 +170,9 @@ public class ArchiveServiceImpl implements ArchiveService {
                 // 正常检索
                 searchSql = getSql("com.gz.mapper.archive.ArchiveMapper.searchList", vo);
                 vo.setDeptId(null);
-                Integer i= mapper.getMenuId(vo.getRoleId());
-                if(i.equals(1)){
-                        vo.setDeptId(JwtUtils.getCurrentUserJwtPayload().getDeptId());
+                Integer i = mapper.getMenuId(vo.getRoleId());
+                if (i.equals(1)) {
+                    vo.setDeptId(JwtUtils.getCurrentUserJwtPayload().getDeptId());
                 }
                 result = new PageInfo<>(mapper.searchList(vo));
             }
@@ -191,7 +194,6 @@ public class ArchiveServiceImpl implements ArchiveService {
         for (int i = 0; i < parameterMappings.size(); i++) {
             sql = sql.replaceFirst("\\?", String.format("'%s'", stringObjectMap.get(parameterMappings.get(i).getProperty())));
         }
-//        log.info("获取运行的sql:{}",sql);
         return sql;
     }
 
@@ -263,11 +265,13 @@ public class ArchiveServiceImpl implements ArchiveService {
 
         switch (vo.getMl()) {
             case "WS":
+                // todo 2021年12月10日15:16:18 文书档案档号末尾规则改为4位
+                jh = String.format("%04d", vo.getJh());
                 return String.format(DataGlobalVariable.WS_DH_FOMAT, vo.getQzh(), vo.getGdnd(), vo.getBgqx(), jh);
             case "KU":
                 return String.format(DataGlobalVariable.KU_DH_FOMAT, vo.getQzh(), vo.getMlh(), vo.getGdnd(), vo.getHsdwdh(), vo.getBgqx(), jh);
             case "KJ":
-                return String.format(DataGlobalVariable.KJ_DH_FOMAT, vo.getQzh(), vo.getMlh(), vo.getMl(), vo.getBgqx(), vo.getXmdh(), jh);
+                return String.format(DataGlobalVariable.KJ_DH_FOMAT, vo.getQzh(), vo.getMlh(), vo.getSl(), vo.getBgqx(), vo.getXmdh(), jh);
             case "ZY":
                 return String.format(DataGlobalVariable.ZY_DH_FOMAT, vo.getQzh(), vo.getMlh(), vo.getMl(), vo.getBgqx(), jh);
             case "YX":
@@ -459,6 +463,7 @@ public class ArchiveServiceImpl implements ArchiveService {
             stringRedisTemplate.opsForValue().set(archiveDTO.getDh(), String.valueOf(archiveDTO.getId()), 1L, TimeUnit.DAYS);
         }
         for (SecondaryArchiveDTO dto : secondaryArchiveDTOs) {
+            log.info("正在导入卷内目录:{}", JSONObject.toJSON(dto));
             String dh = dto.getDh();
             String archiveDh = dh.substring(0, dh.lastIndexOf("-"));
             int archiveId = Integer.parseInt(stringRedisTemplate.opsForValue().get(archiveDh));

+ 4 - 3
src/main/java/com/gz/service/archive/impl/SecondaryArchiveServiceImpl.java

@@ -16,6 +16,7 @@ import com.gz.vo.archive.SecondaryArchiveVO;
 import org.apache.catalina.webresources.JarWarResource;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import java.util.List;
@@ -35,13 +36,13 @@ public class SecondaryArchiveServiceImpl implements SecondaryArchiveService {
 
     @Override
     @Transactional
-    public Integer insert(SecondaryArchiveInsertVO dto) throws Exception {
+    public Integer insert(SecondaryArchiveDTO dto,MultipartFile uploadFile) throws Exception {
         dto.setCreated(JwtUtils.getCurrentUserJwtPayload().getId());
         // 插入
         Integer i = secondaryArchiveMapper.insertSelective(dto);
         // 上传附件
-        if (dto.getFile() != null){
-            archiveFileService.upload(dto.getFile(),dto.getArchiveId(),0,dto.getArchiveId());
+        if (uploadFile != null){
+            archiveFileService.upload(uploadFile,dto.getArchiveId(),0,dto.getArchiveId());
         }
         return i;
     }

+ 152 - 0
src/main/java/com/gz/service/statistics/impl/SelectStatisticsServiceImpl.java

@@ -3,12 +3,18 @@ package com.gz.service.statistics.impl;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUnit;
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.lang.tree.Tree;
 import cn.hutool.core.lang.tree.TreeNodeConfig;
 import cn.hutool.core.lang.tree.TreeUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.ReUtil;
+import cn.hutool.core.util.RuntimeUtil;
+import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.gz.common.DataGlobalVariable;
+import com.gz.core.exception.BusinessException;
 import com.gz.dto.borrow.ArchiveBorrowDTO;
 import com.gz.dto.system.ArchivesTreeDTO;
 import com.gz.mapper.borrow.ArchiveBorrowMapper;
@@ -19,12 +25,16 @@ import com.gz.rvo.statistics.ArchiveYearStatisticsRVO;
 import com.gz.rvo.statistics.BorrowStatisticsRVO;
 import com.gz.service.statistics.SelectStatisticsService;
 import com.gz.service.system.ArchivesTreeService;
+import com.gz.service.system.impl.AuthServiceImpl;
 import com.gz.utils.JwtUtils;
+import com.gz.utils.UnitUtils;
 import com.gz.vo.statistics.StatisticsVO;
 import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
@@ -32,6 +42,8 @@ import org.springframework.util.StringUtils;
 
 import javax.annotation.Resource;
 import javax.persistence.Id;
+import java.io.File;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -44,6 +56,7 @@ import java.util.stream.Collectors;
  * @author LiuchangLan
  * @date 2021/3/8 14:59
  */
+@Slf4j
 @Service
 public class SelectStatisticsServiceImpl implements SelectStatisticsService {
 
@@ -59,6 +72,9 @@ public class SelectStatisticsServiceImpl implements SelectStatisticsService {
     @Resource
     private ArchiveBorrowMapper archiveBorrowMapper;
 
+    @Value("${upload-file.archive-file-root-directory}")
+    private String baseDir;
+
     @Override
     public List<ArchiveStatisticsRVO> selectStatisticsByType(StatisticsVO vo) {
         String key = String.format(DataGlobalVariable.CACHE_KEY_FOMAT, this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName(), JSONObject.toJSONString(vo));
@@ -74,6 +90,83 @@ public class SelectStatisticsServiceImpl implements SelectStatisticsService {
             }
             // 统计结果
             List<ArchiveStatisticsRVO> tree = selectStatisticsMapper.selectArchiveStatistics(vo);
+//            //二级分类集合
+//            List<String> list = new ArrayList<>();
+//            List<ArchivesTreeDTO> archivesTreeDTOS = archivesTreeService.selectByOrder();
+//            archivesTreeDTOS.forEach(dto -> {
+//                if (dto.getParentId() != -1) {
+//                    for (ArchivesTreeDTO dt : archivesTreeDTOS) {
+//                        if (dto.getParentId() == dt.getId()) {
+//                            list.add(dt.getCode());
+//                        }
+//                    }
+//                }
+//            });
+            //占用磁盘大小临时存储到map
+            Map<String, Long> map = new HashMap<>();
+            List<ArchivesTreeDTO> archiveTrees = archivesTreeService.selectAll();
+            archiveTrees.forEach(i -> {
+                map.put(i.getCode(), 0L);
+            });
+            // 档案文件根目录
+            File baseDir = FileUtil.file(this.baseDir);
+            // 统计总数的一级档案数
+            List<String> calcSumType = new ArrayList<String>(){{
+                add("WS");
+                add("SJ");
+            }};
+            //占用磁盘的总大小
+            Long hj = 0L;
+            if (FileUtil.exist(baseDir) && FileUtil.isDirectory(baseDir)) {
+                // 全宗号
+                for (File qzh : baseDir.listFiles()) {
+                    if (FileUtil.isDirectory(qzh)) {
+                        // 年份
+                        for (File year : qzh.listFiles()) {
+                            if (ObjectUtil.isNotEmpty(year)) {
+                                //分类
+                                for (File category : year.listFiles()) {
+                                    if (ObjectUtil.isNotEmpty(category)) {
+                                        // 一级档案数分类
+                                        if (map.keySet().stream().anyMatch(i -> i.equals(category.getName()))){
+                                            long histryFileSize = Long.parseLong(map.get(category.getName()).toString());
+                                            Long currFileSize = this.getLinuxDirectorySize(category);
+                                            histryFileSize += currFileSize;
+                                            map.put(category.getName(), histryFileSize );
+                                            if (calcSumType.contains(category.getName())){
+                                                hj +=currFileSize;
+                                            }
+                                        }
+                                        // 二级档案数
+                                        for (File category2 : category.listFiles()) {
+                                            if (map.keySet().stream().anyMatch(i -> i.equals(category2.getName()))){
+                                                long histryFileSize = Long.parseLong(map.get(category2.getName()).toString());
+                                                Long currFileSize = this.getLinuxDirectorySize(category2);
+                                                histryFileSize += currFileSize;
+                                                map.put(category2.getName(), histryFileSize );
+                                                hj +=currFileSize;
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            Map<String, String> map1 = new HashMap<>();
+            //内存大小赋值
+            for (Map.Entry<String, Long> entry : map.entrySet()) {
+                map1.put(entry.getKey(), UnitUtils.storageUnitConvertStr(entry.getValue()));
+            }
+            for (Map.Entry<String, String> entry : map1.entrySet()) {
+                for (ArchiveStatisticsRVO li : tree) {
+                    if (li.getCode().equals(entry.getKey())) {
+                        li.setSpace(entry.getValue());
+                    }
+                }
+            }
+            //计算总量
             tree.forEach(e -> {
                 if (e.getParentId() == -1) {
                     for (ArchiveStatisticsRVO node : tree) {
@@ -88,6 +181,8 @@ public class SelectStatisticsServiceImpl implements SelectStatisticsService {
                     }
                 }
             });
+
+            tree.get(tree.size() - 1).setSumSpace(UnitUtils.storageUnitConvertStr(hj));
             stringRedisTemplate.opsForValue().set(key, JSONObject.toJSONString(tree), DataGlobalVariable.CACHE_EXPIRES, DataGlobalVariable.TIME_UNIT);
             return tree;
         }
@@ -107,11 +202,68 @@ public class SelectStatisticsServiceImpl implements SelectStatisticsService {
                 vo.setEndTime(vo.getTime().split(" - ")[1]);
             }
             List<ArchiveYearStatisticsRVO> archiveYearStatisticsRVOS = selectStatisticsMapper.selectArchiveYearStatistics(vo);
+            // 档案文件根目录
+            File baseDir = FileUtil.file(this.baseDir);
+            Long hj = 0l;
+            log.info("{}{}", baseDir, baseDir.isDirectory());
+            if (FileUtil.exist(baseDir) && FileUtil.isDirectory(baseDir)) {
+                // 全宗号
+                for (File qzh : baseDir.listFiles()) {
+                    if (FileUtil.isDirectory(qzh)) {
+                        // 年份
+                        for (File year : qzh.listFiles()) {
+                            if (ObjectUtil.isNotEmpty(year)) {
+                                Long linuxDirectorySize = this.getLinuxDirectorySize(year);
+                                hj += linuxDirectorySize;
+                                archiveYearStatisticsRVOS.forEach(statisticsRVO -> {
+                                    if (statisticsRVO.getGdnd().equals(year.getName())) {
+                                        String s = UnitUtils.storageUnitConvertStr(linuxDirectorySize);
+                                        statisticsRVO.setSpace(s);
+                                    }
+                                });
+                            }
+                        }
+                    }
+                }
+            }
+            if(archiveYearStatisticsRVOS.size()>0){
+                archiveYearStatisticsRVOS.get(archiveYearStatisticsRVOS.size() - 1).setSumSpace(UnitUtils.storageUnitConvertStr(hj));
+            }
             stringRedisTemplate.opsForValue().set(key, JSONObject.toJSONString(archiveYearStatisticsRVOS), DataGlobalVariable.CACHE_EXPIRES, DataGlobalVariable.TIME_UNIT);
             return archiveYearStatisticsRVOS;
         }
     }
 
+    /**
+     * @return 文件夹占用空间大小 单位:字节(K) 1GB = 1024MB = 1024 * 1024 KB = 1024 * 1024 * 1024 B
+     * @description 获取Linux文件夹大小
+     * @author ZhangHai
+     * @since 2021/9/15 11:33
+     */
+    private Long getLinuxDirectorySize(File file) {
+        if (!file.exists()) {
+            throw new BusinessException(500, "文件见不存在");
+        }
+        if (!file.isDirectory()) {
+            throw new BusinessException(500, "参数非文件见");
+        }
+        // 执行命令Format
+        final String commandFomat = "du -s -b {}";
+
+        // 需要执行的命令
+        final String command = StrUtil.format(commandFomat, file.getAbsoluteFile());
+        log.info("文件夹大小扫描命令执行:{}", command);
+        // 执行命令的结果
+        String commandResult = RuntimeUtil.execForStr(command);
+        // 占用空间大小 String类型
+        String sizeStr = commandResult.substring(0, commandResult.indexOf("\t"));
+        Long size = 0L;
+        if (StrUtil.isNotEmpty(sizeStr)) {
+            size = Long.parseLong(sizeStr);
+        }
+        return size;
+    }
+
     @Override
     public List<BorrowStatisticsRVO> selectBorrowStatistics(StatisticsVO vo) {
         String key = String.format(DataGlobalVariable.CACHE_KEY_FOMAT, this.getClass().getName(), Thread.currentThread().getStackTrace()[1].getMethodName(), JSONObject.toJSONString(vo));

+ 1 - 1
src/main/java/com/gz/service/system/AdminService.java

@@ -22,7 +22,7 @@ public interface AdminService {
      * @author LiuChangLan
      * @since 2020/9/4 14:46
      */
-    Integer delete(Integer id);
+    Integer delete(String id);
 
     /**
      * @description 改

+ 7 - 0
src/main/java/com/gz/service/system/DictService.java

@@ -104,4 +104,11 @@ public interface DictService {
      * @since 2021/3/8 17:22
      */
     List<Map> selectMiJiRole(Integer roleId);
+
+    /**
+     * @description 部门权限
+     * @author LiuChangLan
+     * @since 2021/3/8 17:22
+     */
+    Integer selectDeptQx(Integer roleId);
 }

+ 1 - 0
src/main/java/com/gz/service/system/FileService.java

@@ -4,6 +4,7 @@ import com.gz.dto.system.FileDTO;
 import com.gz.rvo.system.FileUploadRVO;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.io.File;
 import java.io.IOException;
 
 public interface FileService {

+ 10 - 0
src/main/java/com/gz/service/system/RoleService.java

@@ -75,4 +75,14 @@ public interface RoleService {
      */
     List<JSONObject> selectShowArchive(Integer roleId);
 
+    /**
+     * 查看权限是否需要生成水印
+     *
+     * @param roleId    权限id
+     * @param roleLabel 权限标识 1:详情 2:文件 3:水印 4:下载
+     * @author LiuChangLan
+     * @since 2022/2/24 17:32
+     */
+    Boolean selectArchiveRole(Integer roleId, Integer roleLabel);
+
 }

+ 15 - 7
src/main/java/com/gz/service/system/impl/AdminServiceImpl.java

@@ -15,6 +15,7 @@ import com.gz.utils.JwtUtils;
 import com.gz.utils.PasswordUtils;
 import com.gz.vo.system.AdminVO;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -51,8 +52,8 @@ public class AdminServiceImpl implements AdminService {
     }
 
     @Override
-    public Integer delete(Integer id) {
-        return adminMapper.deleteByPrimaryKey(id);
+    public Integer delete(String id) {
+        return adminMapper.deleteById(id);
     }
 
     @Override
@@ -166,35 +167,42 @@ public class AdminServiceImpl implements AdminService {
                     }else {
                         deptMapper.insertSelective(deptPcDTO);
                     }
-                }else if ("4".equals(state)) {
+                }else if ("2".equals(state)) {
                     //删除
                     deptMapper.deleteByPrimaryKey(id);
                 }
             }
             for (Map<String, Object> map : user) {
                 AdminDTO adminDTO = new AdminDTO();
+
                 adminDTO.setId(String.valueOf(map.get("guid") == null ? "" : map.get("guid")));
                 adminDTO.setAdminName(String.valueOf(map.get("userName") == null ? "" : map.get("userName")));
                 adminDTO.setAccount(String.valueOf(map.get("loginName") == null ? "" : map.get("loginName")));
-//                adminDTO.setUserOrder(String.valueOf(map.get("sortno") == null ? "" : map.get("sortno")));
                 adminDTO.setPhone(String.valueOf(map.get("mobilephone") == null ? "" : map.get("mobilephone")));
-//                adminDTO.setShowName(String.valueOf(map.get("positionTitle") == null ? "" : map.get("positionTitle")));
                 String state = String.valueOf(map.get("state") == null ? "" : map.get("state"));
+                // 根据用户姓名和用户账号查询用户
+                List<AdminDTO> adminVOS = this.adminMapper.selectByPage(new AdminVO(adminDTO.getAdminName(),adminDTO.getAccount()));
                 //正常
                 if ("1".equals(state)) {
                     List<String> deptids = (List<String>) map.get("orgGuid");
                     if (adminMapper.existsWithPrimaryKey(adminDTO.getId())) {
                         for (String deptid : deptids) {
                             adminDTO.setDeptId(deptid);
+                            // 现有用户同步不改变用户角色(新增用户默认普通用户)
+                            if(CollectionUtils.isNotEmpty(adminVOS)){
+                                adminDTO.setRoleId(adminVOS.get(0).getRoleId());
+                            }
                             adminMapper.updateByPrimaryKeySelective(adminDTO);
                         }
                     }else {
                         for (String deptid : deptids) {
                             adminDTO.setDeptId(deptid);
+                            // 普通用户
+                            adminDTO.setRoleId(8);
                             adminMapper.insertSelective(adminDTO);
                         }
                     }
-                } else if ("4".equals(state)) {
+                } else if ("2".equals(state)) {
                     //删除
                     adminMapper.deleteByPrimaryKey(adminDTO.getId());
                 }
@@ -207,7 +215,7 @@ public class AdminServiceImpl implements AdminService {
             e.printStackTrace();
             return new HashMap<String,Object>(){{
                 put("data",e.getMessage());
-                put("status","success");
+                put("status","fail");
             }};
         }
     }

+ 6 - 0
src/main/java/com/gz/service/system/impl/DictServiceImpl.java

@@ -191,4 +191,10 @@ public class DictServiceImpl implements DictService {
         }
         return result;
     }
+
+    @Override
+    public Integer selectDeptQx(Integer roleId) {
+
+        return this.menuRoleMapper.selectDeptQx(roleId);
+    }
 }

+ 7 - 0
src/main/java/com/gz/service/system/impl/FileServiceImpl.java

@@ -1,15 +1,20 @@
 package com.gz.service.system.impl;
 
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.IdUtil;
 import com.gz.config.FileUploadConfig;
 import com.gz.core.exception.BusinessException;
 import com.gz.core.exception.CustomExceptionEnum;
+import com.gz.dto.system.ArchiveFileDTO;
 import com.gz.dto.system.FileDTO;
 import com.gz.mapper.system.FileMapper;
 import com.gz.rvo.system.FileUploadRVO;
 import com.gz.service.system.FileService;
+import com.gz.utils.JwtUtils;
+import com.gz.utils.WatermarkUtils;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.tomcat.util.http.fileupload.FileUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -71,4 +76,6 @@ public class FileServiceImpl implements FileService {
         log.info("文件上传完成,原文件名[{}],服务器地址[{}],现在文件名[{}]", fileName, serverFilePath, serverFileName);
         return fileDTO;
     }
+
+
 }

+ 18 - 7
src/main/java/com/gz/service/system/impl/RoleServiceImpl.java

@@ -136,13 +136,13 @@ public class RoleServiceImpl implements RoleService {
                 i = menuRoleMapper.insert(menuRoleDTO);
             }
         }
-            /** 查看所有部门权限控制  0:不能查看全部功能,1:可查看*/
-            if (vo.getBmqxRole() != null) {
-                MenuRoleDTO menuRoleDTO = new MenuRoleDTO();
-                menuRoleDTO.setRoleId(vo.getRoleId());
-                menuRoleDTO.setMenuId(vo.getBmqxRole());
-                menuRoleDTO.setRoleType(DataGlobalVariable.ARCHIVE_DEPT);
-                i = menuRoleMapper.insert(menuRoleDTO);
+        /** 查看所有部门权限控制  0:不能查看全部功能,1:可查看*/
+        if (vo.getBmqxRole() != null) {
+            MenuRoleDTO menuRoleDTO = new MenuRoleDTO();
+            menuRoleDTO.setRoleId(vo.getRoleId());
+            menuRoleDTO.setMenuId(vo.getBmqxRole());
+            menuRoleDTO.setRoleType(DataGlobalVariable.ARCHIVE_DEPT);
+            i = menuRoleMapper.insert(menuRoleDTO);
         }
         return i;
     }
@@ -200,6 +200,8 @@ public class RoleServiceImpl implements RoleService {
         List<JSONObject> result = new ArrayList<>();
         result.add(new JSONObject().put("title", "详情").put("id", 1));
         result.add(new JSONObject().put("title", "文件").put("id", 2));
+        result.add(new JSONObject().put("title", "水印").put("id", 3));
+        result.add(new JSONObject().put("title", "下载").put("id", 4));
         MenuRoleDTO menuRoleDTO = new MenuRoleDTO();
         menuRoleDTO.setRoleType(DataGlobalVariable.ARCHIVE_SHOW);
         menuRoleDTO.setRoleId(roleId);
@@ -216,4 +218,13 @@ public class RoleServiceImpl implements RoleService {
 
         return result;
     }
+
+    @Override
+    public Boolean selectArchiveRole(Integer roleId,Integer roleLabel) {
+        MenuRoleDTO menuRoleDTO = new MenuRoleDTO();
+        menuRoleDTO.setRoleId(roleId);
+        menuRoleDTO.setRoleType(DataGlobalVariable.ARCHIVE_SHOW);
+        menuRoleDTO.setMenuId(roleLabel);
+        return menuRoleMapper.selectCount(menuRoleDTO) > 0;
+    }
 }

+ 1 - 0
src/main/java/com/gz/utils/UnitUtils.java

@@ -51,3 +51,4 @@ public class UnitUtils {
         return NumberUtil.round(byteValue / 1.0 / MB, 2);
     }
 }
+

+ 84 - 0
src/main/java/com/gz/utils/WatermarkUtils.java

@@ -0,0 +1,84 @@
+package com.gz.utils;
+
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.io.IoUtil;
+import cn.hutool.system.SystemUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.pdfbox.pdmodel.PDDocument;
+import org.apache.pdfbox.pdmodel.PDPage;
+import org.apache.pdfbox.pdmodel.PDPageContentStream;
+import org.apache.pdfbox.pdmodel.PDResources;
+import org.apache.pdfbox.pdmodel.font.PDFont;
+import org.apache.pdfbox.pdmodel.font.PDType0Font;
+import org.apache.pdfbox.pdmodel.graphics.state.PDExtendedGraphicsState;
+import org.apache.pdfbox.util.Matrix;
+import org.apache.tomcat.util.http.fileupload.FileUtils;
+import org.apache.tomcat.util.http.fileupload.IOUtils;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+
+@Slf4j
+public class WatermarkUtils {
+
+    /**
+     * 给pdf增加水印
+     *
+     * @author LiuChangLan
+     * @since 2022/2/24 15:42
+     */
+    public static void generateWatermarkPdf(String pdfFilePath, String newPdfPath, String watermarkContent) {
+        log.info("水印生成 原文件:{} 生成后文件:{} 水印内容:{}", pdfFilePath, newPdfPath, watermarkContent);
+        File pdfFile = FileUtil.file(pdfFilePath);
+        PDDocument pdf = null;
+        try {
+            //打开pdf文件
+            pdf = PDDocument.load(pdfFile);
+            pdf.setAllSecurityToBeRemoved(true);
+            for (PDPage page : pdf.getPages()) {
+                PDPageContentStream cs = new PDPageContentStream(pdf, page, PDPageContentStream.AppendMode.APPEND, true, true);
+                String ts = watermarkContent;
+                //引入字体文件 解决中文汉字乱码问题
+                PDFont font = null;
+                if (SystemUtil.getOsInfo().isWindows()) {
+                    font = PDType0Font.load(pdf, new FileInputStream("C:\\Windows\\Fonts\\STLITI.TTF"), true);
+                } else {
+                    font = PDType0Font.load(pdf, new FileInputStream("/data/project/STLITI.TTF"), true);
+                }
+                float fontSize = 26;
+                PDResources resources = page.getResources();
+                PDExtendedGraphicsState r0 = new PDExtendedGraphicsState();
+                // 水印透明度
+                r0.setNonStrokingAlphaConstant(0.2f);
+                r0.setAlphaSourceFlag(true);
+                cs.setGraphicsStateParameters(r0);
+                //水印颜色
+                cs.setNonStrokingColor(153, 153, 153);
+                cs.beginText();
+                cs.setFont(font, fontSize);
+                //根据水印文字大小长度计算横向坐标需要渲染几次水印
+                float h = ts.length() * fontSize;
+                for (int i = 0; i <= 5; i++) {
+                    // 获取旋转实例
+                    cs.setTextMatrix(Matrix.getRotateInstance(-150, i * 220, 0));
+                    cs.showText(ts);
+                    for (int j = 0; j < 10; j++) {
+                        cs.setTextMatrix(Matrix.getRotateInstance(-150, i * 220, j * h * 2));
+                        cs.showText(ts);
+                    }
+                }
+                cs.endText();
+                cs.restoreGraphicsState();
+                cs.close();
+                pdf.save(newPdfPath);
+
+            }
+        } catch (IOException e) {
+            log.error("pdf生成水印失败", e);
+            throw new RuntimeException("pdf生成水印失败");
+        } finally {
+            IoUtil.close(pdf);
+        }
+    }
+}

+ 3 - 0
src/main/java/com/gz/vo/archive/SearchArchiveVO.java

@@ -59,6 +59,9 @@ public class SearchArchiveVO extends PageVO {
     // 部门id
     private String deptId;
 
+    // 全宗号
+    private String qzh;
+
     public boolean getAgain(){
         return this.again;
     }

+ 2 - 0
src/main/java/com/gz/vo/statistics/StatisticsVO.java

@@ -23,4 +23,6 @@ public class StatisticsVO {
     private List<String> mlCodes;
     // 关键字
     private String gjz;
+    //保管期限
+    private String bgqx;
 }

+ 6 - 0
src/main/java/com/gz/vo/system/AdminVO.java

@@ -2,6 +2,7 @@ package com.gz.vo.system;
 
 import com.gz.vo.PageVO;
 import lombok.Data;
+import org.apache.commons.lang.StringUtils;
 
 /**
  * @author LiuchangLan
@@ -24,4 +25,9 @@ public class AdminVO extends PageVO {
 
     // 权限id
     private String roleId;
+
+    public AdminVO(String adminName,String account){
+        this.adminName = StringUtils.isNotBlank(adminName) ? adminName.trim() : null;
+        this.account = StringUtils.isNotBlank(account) ? account.trim() : null;
+    }
 }

+ 1 - 0
src/main/resources/application-dev.yml

@@ -121,6 +121,7 @@ upload-file:
   server-file-url-prefix: http://examdasfda.cn.utools.club
   file-root-directory: E:\cache
   archive-file-root-directory: E:\cache\archive
+  watermark-archive-file-root-directory: /data/file/watermark_archive_file
 #logging:
 #  file:
 #    path: D:\logs\guihua_archive

+ 2 - 1
src/main/resources/application-prod.yml

@@ -2,7 +2,7 @@ server:
   port: 9091
 spring:
   resources:
-    static-locations: classpath:/static,classpath:/public,classpath:/resources,classpath:/META-INF/resources,file:${upload-file.file-root-directory},file:${upload-file.archive-file-root-directory}
+    static-locations: classpath:/static,classpath:/public,classpath:/resources,classpath:/META-INF/resources,file:${upload-file.file-root-directory},file:${upload-file.archive-file-root-directory},file:${upload-file.watermark-archive-file-root-directory}
   # 数据源配置
   datasource:
     # 连接池类型
@@ -126,6 +126,7 @@ upload-file:
   server-file-url-prefix: http://66.1.21.158:9091
   file-root-directory: /data/file
   archive-file-root-directory: /data/file/archive_file
+  watermark-archive-file-root-directory: /data/file/watermark_archive_file
 logging:
   file:
     path: /data/logs

+ 1 - 1
src/main/resources/application.yml

@@ -22,7 +22,7 @@ auth:
     # 进行登录验证的地址
     force-urls: /**
     # 跳过验证地址
-    skip-urls: /druid/**,/,/**/*.pdf,/**/*.png,/**/*.jpg,/**/*.html,/**/*.ico,/**/*.css,/**/*.gif,/**/*.js,/webSocket/**,/**/*.woff2,/**/*.less,/system/auth/login,/system/auth/refreshToken,/system/auth/generatePictureCaptcha,/template/*.xlsx,/rabbit/test,/system/auth/loginByBase64
+    skip-urls: /druid/**,/,/reader/**,/**/*.pdf,/**/*.png,/**/*.jpg,/**/*.html,/**/*.ico,/**/*.css,/**/*.gif,/**/*.js,/webSocket/**,/**/*.woff2,/**/*.less,/system/auth/login,/system/auth/refreshToken,/system/auth/generatePictureCaptcha,/template/*.xlsx,/rabbit/test,/system/auth/loginByBase64,/system/admin/synchronize
 rabbitmq:
   # 数据交换机
   data-exchange: ARCHIVE_DATA_EXCHANGE

+ 17 - 1
src/main/resources/mapper/adminMapper.xml

@@ -27,9 +27,25 @@
             <if test="dept != null and dept != ''">
                 and dept_id in (select d.id from tab_dept d where d.id = #{dept} or parent_id = #{dept})
             </if>
-            <if test="roleId != null">
+            <if test="roleId != null and roleId != ''">
                 and role_id = #{roleId}
             </if>
         </where>
     </select>
+
+    <delete id="deleteById" parameterType="java.lang.String">
+        delete from tab_admin where id = #{id}
+    </delete>
+
+    <select id="selectList" resultType="com.gz.dto.system.AdminDTO" parameterType="com.gz.vo.system.AdminVO">
+        select * from tab_admin
+        <where>
+            <if test="adminName != null and adminName != ''">
+                and TRIM(admin_name)  = #{adminName}
+            </if>
+            <if test="account != null and account != ''">
+                and TRIM(account) =  #{account}
+            </if>
+        </where>
+    </select>
 </mapper>

+ 86 - 86
src/main/resources/mapper/archiveMapper.xml

@@ -4,75 +4,68 @@
 
     <select id="searchList" resultType="com.gz.rvo.archive.ArchiveRVO"
             parameterType="com.gz.vo.archive.SearchArchiveVO">
-        SELECT
-        d.dict_name mj_text,
-        a.*
-        FROM `tab_archives` a
-        LEFT JOIN tab_dict d
-        ON a.mj = d.dict_code
-        LEFT JOIN tab_secondary_archive sa
-        ON a.id = sa.archive_id
+        SELECT d.dict_name mj_text, a.*
+        FROM tab_archives a
+        LEFT JOIN tab_dict d ON a.mj = d.dict_code
+        LEFT JOIN tab_secondary_archive sa ON a.id = sa.archive_id
         LEFT JOIN tab_admin u on u.id = a.created
-        <where>
-            a.deleted = 0
-            and ml IN (
-            SELECT
-            `code`
-            FROM
-            tab_archives_tree atr
-            LEFT JOIN tab_menu_role tmr ON atr.id = tmr.menu_id
-            WHERE
-            tmr.role_id = #{roleId}
-            AND tmr.role_type = 1
-            )
-            and mj in (select d.dict_code from tab_dict d left join tab_menu_role mr on d.id = mr.menu_id where
-            mr.role_id = #{roleId} and mr.role_type = 2 )
-
-            <if test="deptId!=null and deptId!=''">
+        where a.deleted = 0
+        and ml IN (
+        SELECT `code` FROM tab_archives_tree atr
+        LEFT JOIN tab_menu_role tmr ON atr.id = tmr.menu_id WHERE tmr.role_id = #{roleId} AND tmr.role_type = 1
+        )
+        and mj in (
+        select d.dict_code from tab_dict d left join tab_menu_role mr on d.id = mr.menu_id
+        where mr.role_id = #{roleId} and mr.role_type = 2
+        )
+        <if test="deptId!=null and deptId!=''">
             and u.dept_id = #{deptId}
-            </if>
-
-            <if test="dh != null and dh != ''">
-                AND a.dh like concat(concat('%',#{dh}),'%')
-            </if>
-            <if test="mlh != null and mlh != ''">
-                AND a.mlh = #{mlh}
-            </if>
-            <if test="wjbh != null and wjbh != ''">
-                AND (a.wjbh like concat(concat('%',#{wjbh}),'%') OR sa.wh like concat(concat('%',#{wjbh}),'%'))
-            </if>
-            <if test="ml != null and ml != ''">
-                AND (a.ml = #{ml} or a.ml in (select `code` FROM tab_archives_tree where parent_id = (SELECT id FROM `tab_archives_tree` where code = #{ml})))
-            </if>
-            <if test="bgqx != null and bgqx != ''">
-                <choose>
-                    <when test="bgqx == 'D10' or bgqx == '005'">
-                        AND a.bgqx in ('D10','005')
-                    </when>
-                    <when test="bgqx == 'D30' or bgqx == '004'">
-                        AND a.bgqx in ('D30','004')
-                    </when>
-                    <when test="bgqx == 'Y'.toString() or bgqx == '001'">
-                        AND a.bgqx in ('Y','001')
-                    </when>
-                    <otherwise>
-                        AND a.bgqx = #{bgqx}
-                    </otherwise>
-                </choose>
-            </if>
-            <if test="mj != null and mj != ''">
-                AND a.mj = #{mj}
-            </if>
-            <if test="gdnd != null and gdnd != ''">
-                AND a.gdnd = #{gdnd}
-            </if>
-            <if test="ztc != null and ztc != ''">
-                AND (a.ztc like concat(concat('%',#{ztc}),'%') OR a.tm like concat(concat('%',#{ztc}),'%') OR sa.tm like concat(concat('%',#{ztc}),'%'))
-            </if>
-            <if test="sql != null and sql != ''">
-                ${sql}
-            </if>
-        </where>
+        </if>
+        <if test="dh != null and dh != ''">
+            AND a.dh like concat(concat('%',#{dh}),'%')
+        </if>
+        <if test="mlh != null and mlh != ''">
+            AND a.mlh = #{mlh}
+        </if>
+        <if test="wjbh != null and wjbh != ''">
+            AND (a.wjbh like concat(concat('%',#{wjbh}),'%') OR sa.wh like concat(concat('%',#{wjbh}),'%'))
+        </if>
+        <if test="ml != null and ml != ''">
+            AND (a.ml = #{ml} or a.ml in (select `code` FROM tab_archives_tree where parent_id = (SELECT id FROM
+            `tab_archives_tree` where code = #{ml})))
+        </if>
+        <if test="bgqx != null and bgqx != ''">
+            <choose>
+                <when test="bgqx == 'D10' or bgqx == '005'">
+                    AND a.bgqx in ('D10','005')
+                </when>
+                <when test="bgqx == 'D30' or bgqx == '004'">
+                    AND a.bgqx in ('D30','004')
+                </when>
+                <when test="bgqx == 'Y'.toString() or bgqx == '001'">
+                    AND a.bgqx in ('Y','001')
+                </when>
+                <otherwise>
+                    AND a.bgqx = #{bgqx}
+                </otherwise>
+            </choose>
+        </if>
+        <if test="mj != null and mj != ''">
+            AND a.mj = #{mj}
+        </if>
+        <if test="gdnd != null and gdnd != ''">
+            AND a.gdnd = #{gdnd}
+        </if>
+        <if test="ztc != null and ztc != ''">
+            AND (a.ztc like concat(concat('%',#{ztc}),'%') OR a.tm like concat(concat('%',#{ztc}),'%') OR sa.tm like
+            concat(concat('%',#{ztc}),'%'))
+        </if>
+        <if test="qzh != null and qzh != ''">
+            AND a.qzh = #{qzh}
+        </if>
+        <if test="sql != null and sql != ''">
+            ${sql}
+        </if>
         group by a.id
         <if test="field != null and field != '' and order != null and order != ''">
             order by ${field} ${order}
@@ -97,7 +90,8 @@
                 AND (a.wjbh like concat(concat('%',#{wjbh}),'%') OR sa.wh like concat(concat('%',#{wjbh}),'%'))
             </if>
             <if test="ml != null and ml != ''">
-                AND a.ml = #{ml} or a.ml in (select `code` FROM tab_archives_tree where parent_id = (SELECT id FROM `tab_archives_tree` where code = #{ml}))
+                AND a.ml = #{ml} or a.ml in (select `code` FROM tab_archives_tree where parent_id = (SELECT id FROM
+                `tab_archives_tree` where code = #{ml}))
             </if>
             <if test="bgqx != null and bgqx != ''">
                 AND a.bgqx = #{bgqx}
@@ -109,7 +103,10 @@
                 AND a.mj = #{mj}
             </if>
             <if test="ztc != null and ztc != ''">
-                AND (a.ztc like concat(concat('%',#{ztc}),'%') OR a.tm like concat(concat('%',#{ztc}),'%') OR sa.tm like concat(concat('%',#{ztc}),'%'))
+                AND (a.ztc like concat(concat('%',#{ztc}),'%') OR a.tm like concat(concat('%',#{ztc}),'%'))
+            </if>
+            <if test="qzh != null and qzh != ''">
+                AND a.qzh = #{qzh}
             </if>
             <if test="sql != null and sql != ''">
                 ${sql}
@@ -223,26 +220,24 @@
     </select>
 
     <select id="selectByPk" resultType="com.gz.rvo.archive.ArchiveRVO" parameterType="int">
-        SELECT
-            d.dict_name mj_text,
-            d1.dict_name bgqx_text,
-            d2.title ml_Text,
-            a.*
+        SELECT d.dict_name  mj_text,
+               d1.dict_name bgqx_text,
+               d2.title     ml_Text,
+               a.*
         FROM `tab_archives` a
-         LEFT JOIN tab_dict d ON a.mj = d.dict_code
-         LEFT JOIN tab_dict d1 ON a.bgqx = d1.dict_code
-         LEFT JOIN tab_archives_tree d2 ON a.ml = d2.code
+                 LEFT JOIN tab_dict d ON a.mj = d.dict_code
+                 LEFT JOIN tab_dict d1 ON a.bgqx = d1.dict_code
+                 LEFT JOIN tab_archives_tree d2 ON a.ml = d2.code
         where a.deleted = 0
-        and a.id = #{id}
+          and a.id = #{id}
     </select>
 
 
-    <select id="selectByDh"  resultType="com.gz.rvo.archive.ArchiveRVO" parameterType="string">
-        SELECT
-            d.dict_name mj_text,
-            d1.dict_name bgqx_text,
-            d2.title ml_Text,
-            a.*
+    <select id="selectByDh" resultType="com.gz.rvo.archive.ArchiveRVO" parameterType="string">
+        SELECT d.dict_name  mj_text,
+               d1.dict_name bgqx_text,
+               d2.title     ml_Text,
+               a.*
         FROM `tab_archives` a
                  LEFT JOIN tab_dict d ON a.mj = d.dict_code
                  LEFT JOIN tab_dict d1 ON a.bgqx = d1.dict_code
@@ -252,10 +247,15 @@
     </select>
 
     <select id="getMenuId" resultType="int">
-        select menu_id from tab_menu_role where role_id = #{id} and role_type = 4
+        select menu_id
+        from tab_menu_role
+        where role_id = #{id}
+          and role_type = 4
     </select>
 
     <select id="getDeptId" resultType="string">
-        select dept_id from tab_admin where id=#{id}
+        select dept_id
+        from tab_admin
+        where id = #{id}
     </select>
 </mapper>

+ 32 - 28
src/main/resources/mapper/selectStatisticsMapper.xml

@@ -36,34 +36,38 @@
     </select>
 
     <select id="selectArchiveYearStatistics" resultType="com.gz.rvo.statistics.ArchiveYearStatisticsRVO">
-        SELECT a1.gdnd
-             , (
-            SELECT count(a.id)
-            FROM tab_archives a
-            WHERE a1.`gdnd` = a.gdnd
-              AND a.deleted = 0
-        ) AS archive_count
-             , (
-            SELECT count(af.id)
-            FROM tab_archives a
-                     LEFT JOIN tab_archive_file af ON a.id = af.archive_id
-            WHERE a1.`gdnd` = a.gdnd
-              AND a.deleted = 0
-              AND af.deleted = 0
-        ) AS file_count
-        FROM tab_archives a1
-        <where>
-            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
-                AND a1.gdnd BETWEEN #{startTime} AND #{endTime}
-            </if>
-            <if test="mlCodes != null and mlCodes.size > 0">
-                AND a1.ml in
-                <foreach collection="mlCodes" item="item" index="index" open="(" close=")" separator=",">
-                    #{item}
-                </foreach>
-            </if>
-        </where>
-        GROUP BY a1.gdnd
+        select t1.gdnd, count(t1.id) archive_count,sum(file_count) file_count
+        from tab_archives t1
+        left join (select archive_id,count(id) file_count
+        from tab_archive_file t where t.deleted = 0
+        ) t2 on t1.id = t2.archive_id
+        where t1.deleted = 0
+        <if test="mlCodes != null and mlCodes.size > 0">
+            AND t1.ml in
+            <foreach collection="mlCodes" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+            AND t1.gdnd BETWEEN #{startTime} AND #{endTime}
+        </if>
+        <if test="bgqx != null and bgqx != ''">
+            <choose>
+                <when test="bgqx == 'D10' or bgqx == '005'">
+                    AND t1.bgqx in ('D10','005')
+                </when>
+                <when test="bgqx == 'D30' or bgqx == '004'">
+                    AND t1.bgqx in ('D30','004')
+                </when>
+                <when test="bgqx == 'Y'.toString() or bgqx == '001'">
+                    AND t1.bgqx in ('Y','001')
+                </when>
+                <otherwise>
+                    AND t1.bgqx = #{bgqx}
+                </otherwise>
+            </choose>
+        </if>
+        group by t1.gdnd
     </select>
 
     <select id="selectBorrowStatistics" resultType="com.gz.rvo.statistics.BorrowStatisticsRVO">

+ 42 - 33
src/main/resources/static/css/public.css

@@ -1,70 +1,79 @@
 body {
-    margin: 15px 15px 15px 15px;
-    background: rg(247,248,249);
+  margin: 15px 15px 15px 15px;
+  background: rg(247, 248, 249);
 }
 
 .layuimini-container {
- /*   border: 1px solid #f2f2f2;
+  /*   border: 1px solid #f2f2f2;
     border-radius: 5px;
     background-color: #ffffff */
 }
 
 .layuimini-main {
-    margin: 10px 10px 10px 10px;
+  margin: 10px 10px 10px 10px;
 }
 
 /**必填红点 */
 .layuimini-form > .layui-form-item > .required:after {
-    content: '*';
-    color: red;
-    position: absolute;
-    margin-left: 4px;
-    font-weight: bold;
-    line-height: 1.8em;
-    top: 6px;
-    right: 5px;
+  content: "*";
+  color: red;
+  position: absolute;
+  margin-left: 4px;
+  font-weight: bold;
+  line-height: 1.8em;
+  top: 6px;
+  right: 5px;
 }
 
 .layuimini-form > .layui-form-item > .layui-form-label {
-    width: 120px !important;
+  width: 120px !important;
 }
 
 .layuimini-form > .layui-form-item > .layui-input-block {
-    margin-left: 150px !important;
+  margin-left: 150px !important;
 }
 
 .layuimini-form > .layui-form-item > .layui-input-block > tip {
-    display: inline-block;
-    margin-top: 10px;
-    line-height: 10px;
-    font-size: 10px;
-    color: #a29c9c;
+  display: inline-block;
+  margin-top: 10px;
+  line-height: 10px;
+  font-size: 10px;
+  color: #a29c9c;
 }
 
 /**搜索框*/
 .layuimini-container .table-search-fieldset {
-    margin: 0;
-    border: 1px solid #e6e6e6;
-    padding: 10px 20px 5px 20px;
-    color: #6b6b6b;
+  margin: 0;
+  border: 1px solid #e6e6e6;
+  padding: 10px 20px 5px 20px;
+  color: #6b6b6b;
 }
 
 /**自定义滚动条样式 */
 ::-webkit-scrollbar {
-    width: 15px;
-    height: 15px
+  width: 15px;
+  height: 15px;
 }
 
 ::-webkit-scrollbar-track {
-    background-color: transparent;
-    -webkit-border-radius: 2em;
-    -moz-border-radius: 2em;
-    border-radius: 2em;
+  background-color: transparent;
+  -webkit-border-radius: 2em;
+  -moz-border-radius: 2em;
+  border-radius: 2em;
 }
 
 ::-webkit-scrollbar-thumb {
-    background-color: #9c9da0;
-    -webkit-border-radius: 2em;
-    -moz-border-radius: 2em;
-    border-radius: 2em
+  background-color: #9c9da0;
+  -webkit-border-radius: 2em;
+  -moz-border-radius: 2em;
+  border-radius: 2em;
+}
+/**打印 */
+@media print {
+  .toolbar {
+    display: none;
+  }
+  .is-print {
+    display: block;
+  }
 }

File diff suppressed because it is too large
+ 2 - 0
src/main/resources/static/js/jquery-3.6.0.min.js


+ 511 - 0
src/main/resources/static/js/jquery.media.js

@@ -0,0 +1,511 @@
+/*
+ * jQuery Media Plugin for converting elements into rich media content.
+ *
+ * Examples and documentation at: http://malsup.com/jquery/media/
+ * Copyright (c) 2007-2010 M. Alsup
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * @author: M. Alsup
+ * @version: 0.99 (05-JUN-2013)
+ * @requires jQuery v1.1.2 or later
+ * $Id: jquery.media.js 2460 2007-07-23 02:53:15Z malsup $
+ *
+ * Supported Media Players:
+ *	- Flash
+ *	- Quicktime
+ *	- Real Player
+ *	- Silverlight
+ *	- Windows Media Player
+ *	- iframe
+ *
+ * Supported Media Formats:
+ *	 Any types supported by the above players, such as:
+ *	 Video: asf, avi, flv, mov, mpg, mpeg, mp4, qt, smil, swf, wmv, 3g2, 3gp
+ *	 Audio: aif, aac, au, gsm, mid, midi, mov, mp3, m4a, snd, rm, wav, wma
+ *	 Other: bmp, html, pdf, psd, qif, qtif, qti, tif, tiff, xaml
+ *
+ * Thanks to Mark Hicken and Brent Pedersen for helping me debug this on the Mac!
+ * Thanks to Dan Rossi for numerous bug reports and code bits!
+ * Thanks to Skye Giordano for several great suggestions!
+ * Thanks to Richard Connamacher for excellent improvements to the non-IE behavior!
+ */
+/*global SWFObject alert Sys */
+/*jshint forin:false */
+;(function($) {
+"use strict";	
+
+var mode = document.documentMode || 0;
+var msie = /MSIE/.test(navigator.userAgent);
+var lameIE = msie && (/MSIE (6|7|8)\.0/.test(navigator.userAgent) || mode < 9);
+
+/**
+ * Chainable method for converting elements into rich media.
+ *
+ * @param options
+ * @param callback fn invoked for each matched element before conversion
+ * @param callback fn invoked for each matched element after conversion
+ */
+$.fn.media = function(options, f1, f2) {
+	if (options == 'undo') {
+		return this.each(function() {
+			var $this = $(this);
+			var html = $this.data('media.origHTML');
+			if (html)
+				$this.replaceWith(html);
+		});
+	}
+	
+	return this.each(function() {
+		if (typeof options == 'function') {
+			f2 = f1;
+			f1 = options;
+			options = {};
+		}
+		var o = getSettings(this, options);
+		// pre-conversion callback, passes original element and fully populated options
+		if (typeof f1 == 'function') f1(this, o);
+
+		var r = getTypesRegExp();
+		var m = r.exec(o.src.toLowerCase()) || [''];
+		var fn;
+
+		if (o.type)
+			m[0] = o.type;
+		else
+			m.shift();
+
+		for (var i=0; i < m.length; i++) {
+			fn = m[i].toLowerCase();
+			if (isDigit(fn[0])) fn = 'fn' + fn; // fns can't begin with numbers
+			if (!$.fn.media[fn])
+				continue;  // unrecognized media type
+			// normalize autoplay settings
+			var player = $.fn.media[fn+'_player'];
+			if (!o.params) o.params = {};
+			if (player) {
+				var num = player.autoplayAttr == 'autostart';
+				o.params[player.autoplayAttr || 'autoplay'] = num ? (o.autoplay ? 1 : 0) : o.autoplay ? true : false;
+			}
+			var $div = $.fn.media[fn](this, o);
+
+			$div.css('backgroundColor', o.bgColor).width(o.width);
+			
+			if (o.canUndo) {
+				var $temp = $('<div></div>').append(this);
+				$div.data('media.origHTML', $temp.html()); // store original markup
+			}
+			
+			// post-conversion callback, passes original element, new div element and fully populated options
+			if (typeof f2 == 'function') f2(this, $div[0], o, player.name);
+			break;
+		}
+	});
+};
+
+/**
+ * Non-chainable method for adding or changing file format / player mapping
+ * @name mapFormat
+ * @param String format File format extension (ie: mov, wav, mp3)
+ * @param String player Player name to use for the format (one of: flash, quicktime, realplayer, winmedia, silverlight or iframe
+ */
+$.fn.media.mapFormat = function(format, player) {
+	if (!format || !player || !$.fn.media.defaults.players[player]) return; // invalid
+	format = format.toLowerCase();
+	if (isDigit(format[0])) format = 'fn' + format;
+	$.fn.media[format] = $.fn.media[player];
+	$.fn.media[format+'_player'] = $.fn.media.defaults.players[player];
+};
+
+// global defautls; override as needed
+$.fn.media.defaults = {
+	standards:  true,       // use object tags only (no embeds for non-IE browsers)
+	canUndo:    true,       // tells plugin to store the original markup so it can be reverted via: $(sel).mediaUndo()
+	width:		400,
+	height:		400,
+	autoplay:	0,			// normalized cross-player setting
+	bgColor:	'#ffffff',	// background color
+	params:		{ wmode: 'transparent'},	// added to object element as param elements; added to embed element as attrs
+	attrs:		{},			// added to object and embed elements as attrs
+	flvKeyName: 'file',		// key used for object src param (thanks to Andrea Ercolino)
+	flashvars:	{},			// added to flash content as flashvars param/attr
+	flashVersion:	'7',	// required flash version
+	expressInstaller: null,	// src for express installer
+
+	// default flash video and mp3 player (@see: http://jeroenwijering.com/?item=Flash_Media_Player)
+	flvPlayer:	 'mediaplayer.swf',
+	mp3Player:	 'mediaplayer.swf',
+
+	// @see http://msdn2.microsoft.com/en-us/library/bb412401.aspx
+	silverlight: {
+		inplaceInstallPrompt: 'true', // display in-place install prompt?
+		isWindowless:		  'true', // windowless mode (false for wrapping markup)
+		framerate:			  '24',	  // maximum framerate
+		version:			  '0.9',  // Silverlight version
+		onError:			  null,	  // onError callback
+		onLoad:			      null,   // onLoad callback
+		initParams:			  null,	  // object init params
+		userContext:		  null	  // callback arg passed to the load callback
+	}
+};
+
+// Media Players; think twice before overriding
+$.fn.media.defaults.players = {
+	flash: {
+		name:		 'flash',
+		title:		 'Flash',
+		types:		 'flv,mp3,swf',
+		mimetype:	 'application/x-shockwave-flash',
+		pluginspage: 'http://www.adobe.com/go/getflashplayer',
+		ieAttrs: {
+			classid:  'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000',
+			type:	  'application/x-oleobject',
+			codebase: 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + $.fn.media.defaults.flashVersion
+		}
+	},
+	quicktime: {
+		name:		 'quicktime',
+		title:		 'QuickTime',
+		mimetype:	 'video/quicktime',
+		pluginspage: 'http://www.apple.com/quicktime/download/',
+		types:		 'aif,aiff,aac,au,bmp,gsm,mov,mid,midi,mpg,mpeg,mp4,m4a,psd,qt,qtif,qif,qti,snd,tif,tiff,wav,3g2,3gp',
+		ieAttrs: {
+			classid:  'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B',
+			codebase: 'http://www.apple.com/qtactivex/qtplugin.cab'
+		}
+	},
+	realplayer: {
+		name:		  'real',
+		title:		  'RealPlayer',
+		types:		  'ra,ram,rm,rpm,rv,smi,smil',
+		mimetype:	  'audio/x-pn-realaudio-plugin',
+		pluginspage:  'http://www.real.com/player/',
+		autoplayAttr: 'autostart',
+		ieAttrs: {
+			classid: 'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA'
+		}
+	},
+	winmedia: {
+		name:		  'winmedia',
+		title:		  'Windows Media',
+		types:		  'asx,asf,avi,wma,wmv',
+		mimetype:	  isFirefoxWMPPluginInstalled() ? 'application/x-ms-wmp' : 'application/x-mplayer2',
+		pluginspage:  'http://www.microsoft.com/Windows/MediaPlayer/',
+		autoplayAttr: 'autostart',
+		oUrl:		  'url',
+		ieAttrs: {
+			classid:  'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6',
+			type:	  'application/x-oleobject'
+		}
+	},
+	// special cases
+	img: {
+		name:  'img',
+		title: 'Image',
+		types: 'gif,png,jpg'
+	},
+	iframe: {
+		name:  'iframe',
+		types: 'html,pdf'
+	},
+	silverlight: {
+		name:  'silverlight',
+		types: 'xaml'
+	}
+};
+
+//
+//	everything below here is private
+//
+
+
+// detection script for FF WMP plugin (http://www.therossman.org/experiments/wmp_play.html)
+// (hat tip to Mark Ross for this script)
+function isFirefoxWMPPluginInstalled() {
+	var plugs = navigator.plugins || [];
+	for (var i = 0; i < plugs.length; i++) {
+		var plugin = plugs[i];
+		if (plugin['filename'] == 'np-mswmp.dll')
+			return true;
+	}
+	return false;
+}
+
+var counter = 1;
+
+for (var player in $.fn.media.defaults.players) {
+	var types = $.fn.media.defaults.players[player].types;
+	$.each(types.split(','), function(i,o) {
+		if (isDigit(o[0])) o = 'fn' + o;
+		$.fn.media[o] = $.fn.media[player] = getGenerator(player);
+		$.fn.media[o+'_player'] = $.fn.media.defaults.players[player];
+	});
+}
+
+function getTypesRegExp() {
+	var types = '';
+	for (var player in $.fn.media.defaults.players) {
+		if (types.length) types += ',';
+		types += $.fn.media.defaults.players[player].types;
+	}
+	return new RegExp('\\.(' + types.replace(/,/ig,'|') + ')\\b');
+}
+
+function getGenerator(player) {
+	return function(el, options) {
+		return generate(el, options, player);
+	};
+}
+
+function isDigit(c) {
+	return '0123456789'.indexOf(c) > -1;
+}
+
+// flatten all possible options: global defaults, meta, option obj
+function getSettings(el, options) {
+	options = options || {};
+	var a, n;
+	var $el = $(el);
+	var cls = el.className || '';
+	// support metadata plugin (v1.0 and v2.0)
+	var meta = $.metadata ? $el.metadata() : $.meta ? $el.data() : {};
+	meta = meta || {};
+	var w = meta.width  || parseInt(((cls.match(/\bw:(\d+)/)||[])[1]||0),10) || parseInt(((cls.match(/\bwidth:(\d+)/)||[])[1]||0),10);
+	var h = meta.height || parseInt(((cls.match(/\bh:(\d+)/)||[])[1]||0),10) || parseInt(((cls.match(/\bheight:(\d+)/)||[])[1]||0),10);
+
+	if (w) meta.width = w;
+	if (h) meta.height = h;
+	if (cls) meta.cls = cls;
+	
+	// crank html5 style data attributes
+	var dataName = 'data-';
+    for (var i=0; i < el.attributes.length; i++) {
+        a = el.attributes[i], n = $.trim(a.name);
+        var index = n.indexOf(dataName);
+        if (index === 0) {
+			n = n.substring(dataName.length);
+			meta[n] = a.value;
+        }
+    }
+
+	a = $.fn.media.defaults;
+	var b = options;
+	var c = meta;
+
+	var p = { params: { bgColor: options.bgColor || $.fn.media.defaults.bgColor } };
+	var opts = $.extend({}, a, b, c);
+	$.each(['attrs','params','flashvars','silverlight'], function(i,o) {
+		opts[o] = $.extend({}, p[o] || {}, a[o] || {}, b[o] || {}, c[o] || {});
+	});
+
+	if (typeof opts.caption == 'undefined') opts.caption = $el.text();
+
+	// make sure we have a source!
+	opts.src = opts.src || $el.attr('href') || $el.attr('src') || 'unknown';
+	return opts;
+}
+
+//
+//	Flash Player
+//
+
+// generate flash using SWFObject library if possible
+$.fn.media.swf = function(el, opts) {
+	var f, p;
+	if (!window.SWFObject && !window.swfobject) {
+		// roll our own
+		if (opts.flashvars) {
+			var a = [];
+			for (f in opts.flashvars)
+				a.push(f + '=' + opts.flashvars[f]);
+			if (!opts.params) opts.params = {};
+			opts.params.flashvars = a.join('&');
+		}
+		return generate(el, opts, 'flash');
+	}
+
+	var id = el.id ? (' id="'+el.id+'"') : '';
+	var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
+	var $div = $('<div' + id + cls + '>');
+
+	// swfobject v2+
+	if (window.swfobject) {
+		$(el).after($div).appendTo($div);
+		if (!el.id) el.id = 'movie_player_' + counter++;
+
+		// replace el with swfobject content
+		window.swfobject.embedSWF(opts.src, el.id, opts.width, opts.height, opts.flashVersion,
+			opts.expressInstaller, opts.flashvars, opts.params, opts.attrs);
+	}
+	// swfobject < v2
+	else {
+		$(el).after($div).remove();
+		var so = new SWFObject(opts.src, 'movie_player_' + counter++, opts.width, opts.height, opts.flashVersion, opts.bgColor);
+		if (opts.expressInstaller) so.useExpressInstall(opts.expressInstaller);
+
+		for (p in opts.params)
+			if (p != 'bgColor') so.addParam(p, opts.params[p]);
+		for (f in opts.flashvars)
+			so.addVariable(f, opts.flashvars[f]);
+		so.write($div[0]);
+	}
+
+	if (opts.caption) $('<div>').appendTo($div).html(opts.caption);
+	return $div;
+};
+
+// map flv and mp3 files to the swf player by default
+$.fn.media.flv = $.fn.media.mp3 = function(el, opts) {
+	var src = opts.src;
+	var player = /\.mp3\b/i.test(src) ? opts.mp3Player : opts.flvPlayer;
+	var key = opts.flvKeyName;
+	src = encodeURIComponent(src);
+	opts.src = player;
+	opts.src = opts.src + '?'+key+'=' + (src);
+	var srcObj = {};
+	srcObj[key] = src;
+	opts.flashvars = $.extend({}, srcObj, opts.flashvars );
+	return $.fn.media.swf(el, opts);
+};
+
+//
+//	Silverlight
+//
+$.fn.media.xaml = function(el, opts) {
+	if (!window.Sys || !window.Sys.Silverlight) {
+		if ($.fn.media.xaml.warning) return;
+		$.fn.media.xaml.warning = 1;
+		alert('You must include the Silverlight.js script.');
+		return;
+	}
+
+	var props = {
+		width: opts.width,
+		height: opts.height,
+		background: opts.bgColor,
+		inplaceInstallPrompt: opts.silverlight.inplaceInstallPrompt,
+		isWindowless: opts.silverlight.isWindowless,
+		framerate: opts.silverlight.framerate,
+		version: opts.silverlight.version
+	};
+	var events = {
+		onError: opts.silverlight.onError,
+		onLoad: opts.silverlight.onLoad
+	};
+
+	var id1 = el.id ? (' id="'+el.id+'"') : '';
+	var id2 = opts.id || 'AG' + counter++;
+	// convert element to div
+	var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
+	var $div = $('<div' + id1 + cls + '>');
+	$(el).after($div).remove();
+
+	Sys.Silverlight.createObjectEx({
+		source: opts.src,
+		initParams: opts.silverlight.initParams,
+		userContext: opts.silverlight.userContext,
+		id: id2,
+		parentElement: $div[0],
+		properties: props,
+		events: events
+	});
+
+	if (opts.caption) $('<div>').appendTo($div).html(opts.caption);
+	return $div;
+};
+
+//
+// generate object/embed markup
+//
+function generate(el, opts, player) {
+	var $el = $(el);
+	var o = $.fn.media.defaults.players[player];
+	var a, key, v;
+
+	if (player == 'iframe') {
+		o = $('<iframe' + ' width="' + opts.width + '" height="' + opts.height + '" >');
+		o.attr('src', opts.src);
+		o.css('backgroundColor', o.bgColor);
+	}
+	else if (player == 'img') {
+		o = $('<img>');
+		o.attr('src', opts.src);
+		if (opts.width)
+			o.attr('width', opts.width);
+		if (opts.height)
+			o.attr('height', opts.height);
+		o.css('backgroundColor', o.bgColor);
+	}
+	else if (lameIE) {
+		a = ['<object width="' + opts.width + '" height="' + opts.height + '" '];
+		for (key in opts.attrs)
+			a.push(key + '="'+opts.attrs[key]+'" ');
+		for (key in o.ieAttrs || {}) {
+			v = o.ieAttrs[key];
+			if (key == 'codebase' && window.location.protocol == 'https:')
+				v = v.replace('http','https');
+			a.push(key + '="'+v+'" ');
+		}
+		a.push('></ob'+'ject'+'>');
+		var p = ['<param name="' + (o.oUrl || 'src') +'" value="' + opts.src + '">'];
+		for (key in opts.params)
+			p.push('<param name="'+ key +'" value="' + opts.params[key] + '">');
+		o = document.createElement(a.join(''));
+		for (var i=0; i < p.length; i++)
+			o.appendChild(document.createElement(p[i]));
+	}
+	else if (opts.standards) {
+		// Rewritten to be standards compliant by Richard Connamacher
+		a = ['<object type="' + o.mimetype +'" width="' + opts.width + '" height="' + opts.height +'"'];
+		if (opts.src) a.push(' data="' + opts.src + '" ');
+		if (msie) {
+			for (key in o.ieAttrs || {}) {
+				v = o.ieAttrs[key];
+				if (key == 'codebase' && window.location.protocol == 'https:')
+					v = v.replace('http','https');
+				a.push(key + '="'+v+'" ');
+			}
+		}
+		a.push('>');
+		a.push('<param name="' + (o.oUrl || 'src') +'" value="' + opts.src + '">');
+		for (key in opts.params) {
+			if (key == 'wmode' && player != 'flash') // FF3/Quicktime borks on wmode
+				continue;
+			a.push('<param name="'+ key +'" value="' + opts.params[key] + '">');
+		}
+		// Alternate HTML
+		a.push('<div><p><strong>'+o.title+' Required</strong></p><p>'+o.title+' is required to view this media. <a href="'+o.pluginspage+'">Download Here</a>.</p></div>');
+		a.push('</ob'+'ject'+'>');
+	}
+	 else {
+	        a = ['<embed width="' + opts.width + '" height="' + opts.height + '" style="display:block"'];
+	        if (opts.src) a.push(' src="' + opts.src + '" ');
+	        for (key in opts.attrs)
+	            a.push(key + '="'+opts.attrs[key]+'" ');
+	        for (key in o.eAttrs || {})
+	            a.push(key + '="'+o.eAttrs[key]+'" ');
+	        for (key in opts.params) {
+	            if (key == 'wmode' && player != 'flash') // FF3/Quicktime borks on wmode
+					continue;
+	            a.push(key + '="'+opts.params[key]+'" ');
+	        }
+	        a.push('></em'+'bed'+'>');
+	    }	
+	// convert element to div
+	var id = el.id ? (' id="'+el.id+'"') : '';
+	var cls = opts.cls ? (' class="' + opts.cls + '"') : '';
+	var $div = $('<div' + id + cls + '>');
+	$el.after($div).remove();
+	if (lameIE || player == 'iframe' || player == 'img')
+		$div.append(o);
+	else
+		$div.html(a.join(''));
+	
+	if (opts.caption) 
+		$('<div>').appendTo($div).html(opts.caption);
+	return $div;
+}
+
+
+})(jQuery);

File diff suppressed because it is too large
+ 357 - 333
src/main/resources/static/js/lay-module/layuimini/miniMenu.js


+ 1 - 1
src/main/resources/static/js/lay-module/layuimini/miniTab.js

@@ -527,7 +527,7 @@ layui.define(["element", "layer", "jquery"], function (exports) {
                             if ($element.hasClass('layui-nav-item') && $element.hasClass('layui-nav-itemed')) {
                                 var moduleId = $element.parent().attr('id');
                                 $(".layuimini-header-menu li").attr('class', 'layui-nav-item');
-                                $("#" + moduleId + "HeaderId").addClass("layui-this");
+                                $("#" + moduleId + "HeaderId").addClass("layui-this ");
                                 $(".layuimini-menu-left .layui-nav.layui-nav-tree").attr('class', 'layui-nav layui-nav-tree layui-hide');
                                 $("#" + moduleId).attr('class', 'layui-nav layui-nav-tree layui-this');
                             } else {

File diff suppressed because it is too large
+ 8 - 0
src/main/resources/static/js/lay-module/utils/base64.min.js


+ 7 - 0
src/main/resources/static/js/utils.js

@@ -0,0 +1,7 @@
+
+function printPage(id,zoom) {
+  let dom = layui.$(id)
+    dom.addClass("is-print")
+    window.print();
+    dom.removeClass("is-print")
+  }

+ 13 - 16
src/main/resources/static/page/admin/edit.html

@@ -45,9 +45,9 @@
 
 
     <div class="layui-form-item">
-        <label class="layui-form-label required">手机号</label>
+        <label class="layui-form-label">手机号</label>
         <div class="layui-input-block">
-            <input type="text" name="phone" lay-verify="phone" lay-reqtext="手机号不能为空" placeholder="请输入手机号"
+            <input type="text" name="phone" placeholder="请输入手机号"
                    value="" class="layui-input">
         </div>
     </div>
@@ -94,24 +94,23 @@
 <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
-    layui.use(['form', 'http', 'treeSelect'], function () {
+    layui.use(['form', 'http', 'treeSelect', 'url'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
         var form = layui.form,
             layer = layui.layer,
             http = layui.http,
             treeSelect = layui.treeSelect,
             $ = layui.$;
-        let id = $('#id').val()
         let deptId = ''
-
+        // url参数
+        const urlParam = layui.url()
         /**方-------------------------------法-------------------------------定-------------------------------义*/
-
             //保存方法
         let save = function (data) {
-                http.post(id == '' ? 'system/admin/insert' : 'system/admin/update', data, true, function (res) {
+                http.post('system/admin/addOrUpdate', data, true, function (res) {
                     if (res.code == 200) {
                         let index = layer.alert('保存成功!', {
-                            title: id == '' ? '添加' : '修改' + '信息'
+                            title: urlParam.id == '' ? '添加' : '修改' + '信息'
                         }, function () {
                             // 关闭弹出层
                             layer.close(index);
@@ -144,12 +143,11 @@
                         enable: true
                     }
                 },
+                click: function (d) {
+                    $("#deptId").val(d.current.id);
+                },
                 success: function (res) {
-                    if (deptId != null) {
-                        if (id != '' && deptId != '') {
-                            treeSelect.checkNode('deptId', deptId);
-                        }
-                    }
+                    treeSelect.checkNode('deptId', deptId);
                 }
             });
         }
@@ -157,9 +155,9 @@
 
         // 加载数据
         let initData = function () {
-            if (id != '') {
+            if (urlParam.id) {
                 $("#account").prop('readonly', 'readonly')
-                http.get('system/admin/selectByPrimaryKey', {id: id}, false, function (res) {
+                http.get('system/admin/selectByPrimaryKey', {id: urlParam.id}, false, function (res) {
                     deptId = res.data.deptId
                     form.val("addPaper", res.data);
                     form.render();
@@ -177,7 +175,6 @@
             })
         }
         /**事-------------------------------件-------------------------------绑-------------------------------定*/
-
         initSelect()
         initData()
         initDept()

+ 10 - 12
src/main/resources/static/page/admin/list.html

@@ -115,18 +115,18 @@
                 cols: [[
                     // {type: 'checkbox', fixed: 'left'}
                     {type: 'numbers'},
-                    {field: 'adminName', title: '姓名'},
-                    {field: 'account', title: '登录名'},
-                    {field: 'idCard', title: '身份证号'},
-                    {field: 'email', title: '邮箱'},
-                    {field: 'phone', title: '手机'},
-                    {field: 'createTime', title: '创建时间'},
                     {
                         field: 'status', title: '用户状态',
                         templet: function (rv) {
                             return '<input type="checkbox" value="' + rv.id + '" name="status" ' + (rv.status == 0 ? 'checked' : '') + ' lay-skin="switch" lay-filter="switchTest" lay-text="正常|禁用">'
                         }
                     },
+                    {field: 'account', title: '登录名'},
+                    {field: 'adminName', title: '姓名'},
+                    {field: 'phone', title: '手机'},
+                    {field: 'idCard', title: '身份证号'},
+                    {field: 'email', title: '邮箱'},
+                    {field: 'createTime', title: '创建时间'},
                     {templet: '#operating', align: 'center', title: '操作', width: 300}
                 ]]
             });
@@ -192,7 +192,7 @@
         //添加方法
         let addPaper = function () {
             layer.open({
-                title: '添加角色',
+                title: '添加用户',
                 type: 2,
                 shade: 0.2,
                 maxmin: true,
@@ -230,16 +230,14 @@
 
         let updPaper = function (id) {
             layer.open({
-                title: '添加字典',
+                title: '修改用户',
                 type: 2,
                 shade: 0.2,
                 maxmin: true,
                 shadeClose: true,
                 area: ['100%', '100%'],
-                content: './edit.html',
-                success: function (layero, index) {
-                    var body = layer.getChildFrame('body', index);
-                    body.find("#id").val(id);
+                content: './edit.html?id=' + id,
+                success: function (layer, index) {
                 },
                 end: function () {
                     renderTable()

+ 59 - 41
src/main/resources/static/page/archive/edit.html

@@ -58,12 +58,13 @@
 
                         <label class="layui-form-label required">档案门类:</label>
                         <div class="layui-input-inline">
-<!--                            <input type="hidden" id="mlId" class="layui-input">-->
-<!--                            <input type="hidden" id="mlCode" class="layui-input">-->
-                            <input type="text" id="ml" name="ml" lay-verify="required" lay-reqtext="档案门类不能为空" lay-filter="ml" class="layui-input">
-<!--                            <select name="ml" id="ml" lay-filter="ml" lay-verify="required" lay-reqtext="档案门类不能为空">-->
-<!--                                <option value="">请选择档案门类</option>-->
-<!--                            </select>-->
+                            <!--                            <input type="hidden" id="mlId" class="layui-input">-->
+                            <!--                            <input type="hidden" id="mlCode" class="layui-input">-->
+                            <input type="text" id="ml" name="ml" lay-reqtext="档案门类不能为空"
+                                   lay-filter="ml" class="layui-input">
+                            <!--                            <select name="ml" id="ml" lay-filter="ml" lay-verify="required" lay-reqtext="档案门类不能为空">-->
+                            <!--                                <option value="">请选择档案门类</option>-->
+                            <!--                            </select>-->
                         </div>
 
 
@@ -74,7 +75,7 @@
                             </select>
                         </div>
                         <label class="layui-form-label">目录号:</label>
-<!--                        lay-verify="required"-->
+                        <!--                        lay-verify="required"-->
                         <div class="layui-input-inline">
                             <input type="number" class="layui-input" placeholder="请输入目录号" name="mlh" id="mlh"
                                    lay-filter="mlh"
@@ -271,7 +272,7 @@
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
 
-    layui.use(['form', 'http', 'iconPickerFa', 'treeSelect', 'laydate', 'upload', 'element', 'table'], function () {
+    layui.use(['form', 'http', 'iconPickerFa', 'treeSelect', 'laydate', 'upload', 'element', 'table', 'url'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
         var form = layui.form,
             layer = layui.layer,
@@ -282,16 +283,12 @@
             upload = layui.upload,
             table = layui.table,
             treeSelect = layui.treeSelect;
-        let id = $('#id').val();
+        const urlParam = layui.url()
         let bgqxappend = false;
 
-        let fileType = $("#fileType").val()
+        let fileType = urlParam.fileType
         let curr = 1;
 
-
-        let isAddhsdw = false;
-        let isAddxmdh = false;
-
         let sl = '';
         let ml = '';
 
@@ -346,6 +343,19 @@
 
         }
 
+
+        let loadBgqx = ml => {
+            http.get('system/dict/selectDictByCode', {code: ml === 'WS' ? 'BAOGUANQIXIANYI' : 'BAOGUANQIXIANER'}, false, function (res) {
+                let html = '';
+                for (let i in res.data) {
+                    html += '<option value="' + res.data[i].dictCode + '">' + res.data[i].dictName + '</option>'
+                }
+                $("#bgqx").empty()
+                $("#bgqx").append(html)
+                form.render();//菜单渲染 把内容加载进去
+            })
+        }
+
         let initUpload = function () {
             let fileList = $('#file-list')
             let uploadListIns = upload.render({
@@ -409,13 +419,13 @@
 
         // 保存方法
         let save = function (data, method) {
-            if (sl){
+            if (sl) {
                 data.ml = sl
             }
-            http.post(id == '' ? 'archive/archive/insert' : 'archive/archive/update', data, true, function (res) {
+            http.post(!urlParam.id ? 'archive/archive/insert' : 'archive/archive/update', data, true, function (res) {
                 if (res.code == 200) {
                     let index = layer.alert('保存成功!', {
-                        title: id == '' ? '添加' : '修改' + '信息'
+                        title: urlParam.id == '' ? '添加' : '修改' + '信息'
                     }, function () {
                         if (method == 'save') {
                             // 关闭弹出层
@@ -473,12 +483,12 @@
                         enable: true
                     }
                 },
-                click: function (d){
+                click: function (d) {
                     let code = ''
                     let parent = d.current.getParentNode()
-                    if(parent != null){
+                    if (parent != null) {
                         code = parent.code
-                    }else {
+                    } else {
                         code = d.current.code
                     }
 
@@ -486,7 +496,8 @@
                     sl = d.current.code
 
                     getJh()
-                    let jhLable = '';
+                    loadBgqx(code)
+                    let jhLable = ''
                     switch (code) {
                         case 'SJ':
                         case 'MT':
@@ -515,17 +526,16 @@
 
                     switch (code) {
                         case 'KU':
-                            if(!isAddhsdw){
+                            if (!$("#hsdwdh_label")[0]) {
                                 html += ' <label class="layui-form-label required" id="hsdwdh_label">核算单位代号:</label>\n' +
                                     '        <div class="layui-input-inline" style="width: 540px;" id="hsdwdh_input">\n' +
                                     '            <input type="text" class="layui-input" name="hsdwdh" id="hsdwdh" placeholder="请输入核算单位代号" lay-filter="hsdwdh"\n' +
                                     '                   lay-verify="required" lay-reqtext="核算单位代号不能为空">\n' +
                                     '        </div>'
-                                isAddhsdw = !isAddhsdw
                             }
                             break;
                         case 'KJ':
-                            if(!isAddxmdh){
+                            if (!$("#xmdh_label")[0]) {
                                 html += '<label class="layui-form-label required" id="xmdh_label" >项目代号:</label>\n' +
                                     '        <div class="layui-input-inline" style="width: 540px;" id="xmdh_input" >\n' +
                                     '            <input type="text" class="layui-input" name="xmdh" id="xmdh" placeholder="请输入项目代号" lay-filter="xmldh"\n' +
@@ -533,6 +543,15 @@
                                     '        </div>'
                             }
                             break;
+                        default :
+                            if ($("#xmdh_label")[0]) {
+                                $("#xmdh_label").remove()
+                                $("#xmdh_input").remove()
+                            }
+                            if ($("#hsdwdh_label")[0]) {
+                                $("#hsdwdh_label").remove()
+                                $("#hsdwdh_input").remove()
+                            }
                     }
                     $('#hide_div').append(html)
 
@@ -621,31 +640,32 @@
         // 加载数据
         let initData = function () {
             let adata = ''
-            if (id != '') {
+            if (urlParam.id != '') {
                 $("#file_tab_list").show();
                 $("#zj").hide()
                 http.get('/archive/archive/selectByPrimaryKey', {
-                    id: id
+                    id: urlParam.id
                 }, false, function (res) {
                     adata = res.data
                     form.val("addDict", res.data);
                     form.render();
                 })
-            }else {
+            } else {
                 $("#file_tab_list").hide();
             }
             if (!bgqxappend) {
                 let ml = $("#ml").val()
-
-                // 加载保管期限
-                http.get('system/dict/selectDictByCode', {code: ml === 'WS' ? 'BAOGUANQIXIANYI' : 'BAOGUANQIXIANER'}, false, function (res) {
-                    let html = '';
-                    for (let i in res.data) {
-                        html += '<option value="' + res.data[i].dictCode + '">' + res.data[i].dictName + '</option>'
-                    }
-                    $("#bgqx").append(html)
-                    form.render();//菜单渲染 把内容加载进去
-                })
+                loadBgqx(ml)
+
+                // // 加载保管期限
+                // http.get('system/dict/selectDictByCode', {code: ml === 'WS' ? 'BAOGUANQIXIANYI' : 'BAOGUANQIXIANER'}, false, function (res) {
+                //     let html = '';
+                //     for (let i in res.data) {
+                //         html += '<option value="' + res.data[i].dictCode + '">' + res.data[i].dictName + '</option>'
+                //     }
+                //     $("#bgqx").append(html)
+                //     form.render();//菜单渲染 把内容加载进去
+                // })
                 bgqxappend = !bgqxappend
             }
             form.val("addDict", adata);
@@ -673,7 +693,7 @@
                     limitName: 'pageSize'
                 },
                 where: {
-                    archiveId: id,
+                    archiveId: urlParam.id,
                     fileType: fileType
                 },
                 response: {
@@ -753,11 +773,9 @@
                 maxmin: true,
                 shadeClose: true,
                 area: ['600px', '400px'],
-                content: './upload.html',
+                content: './upload.html?archiveId=' + urlParam.id + '&fileType=' + fileType,
                 success: function (layero, index) {
                     var body = layer.getChildFrame('body', index);
-                    body.find("#archive_id").val(id);
-                    body.find("#fileType").val(fileType);
                 },
                 end: function () {
                     renderTable()

+ 10 - 10
src/main/resources/static/page/archive/editSecondary.html

@@ -61,7 +61,7 @@
         <label class="layui-form-label">文号:</label>
         <div class="layui-input-block" style="">
             <input type="text" class="layui-input" placeholder="请输入文号" name="wh" id="wh" lay-filter="wh"
-                   lay-verify="required" lay-reqtext="文号不能为空">
+                   lay-reqtext="文号不能为空">
         </div>
     </div>
 
@@ -70,12 +70,12 @@
         <label class="layui-form-label">责任者:</label>
         <div class="layui-input-block" style="">
             <input type="text" class="layui-input" placeholder="请输入责任者" name="zrz" id="zrz" lay-filter="zrz"
-                   lay-verify="required" lay-reqtext="责任者不能为空">
+                   lay-reqtext="责任者不能为空">
         </div>
     </div>
 
     <div class="layui-form-item">
-        <label class="layui-form-label">文件:</label>
+        <label class="layui-form-label required">文件:</label>
         <div class="layui-input-block">
             <div class="layui-input-inline" style="">
                 <input type="text" placeholder="请选择文件" readonly class="layui-input" id="upload">
@@ -113,7 +113,7 @@
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
 
-    layui.use(['form', 'http', 'laydate', 'upload'], function () {
+    layui.use(['form', 'http', 'laydate', 'upload', 'url'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
         var form = layui.form,
             layer = layui.layer,
@@ -121,9 +121,9 @@
             $ = layui.$,
             upload = layui.upload,
             laydate = layui.laydate,
-            id = $('#id').val(),
-            archive_id = $("#archive_id").val(),
             upload_file = {};
+        const urlParam = layui.url()
+        console.log('url参数', urlParam)
         /**方-------------------------------法-------------------------------定-------------------------------义*/
 
         /** 初始化日期控件*/
@@ -174,10 +174,10 @@
         let save = function (data, method) {
             let f = paramsToFormData(data)
             f.append('file', upload_file)
-            http.post(id == '' ? 'secondary/archive/insert' : 'secondary/archive/update', f, true, function (res) {
+            http.post(urlParam.id == '' ? 'secondary/archive/insert' : 'secondary/archive/update', f, true, function (res) {
                 if (res.code == 200) {
                     let index = layer.alert('保存成功!', {
-                        title: id == '' ? '添加' : '修改' + '信息'
+                        title: urlParam.id == '' ? '添加' : '修改' + '信息'
                     }, function () {
                         if (method == 'save') {
                             // 关闭弹出层
@@ -194,9 +194,9 @@
         // 加载数据
         let initData = function () {
             let adata = ''
-            if (id != '') {
+            if (urlParam.id != '') {
                 http.get('secondary/archive/selectByPrimaryKey', {
-                    id: id
+                    id: urlParam.id
                 }, false, function (res) {
                     adata = res.data
                     form.val("addDict", res.data);

+ 167 - 0
src/main/resources/static/page/archive/editSecondaryNew.html

@@ -0,0 +1,167 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>layui</title>
+    <link rel="stylesheet" href="../../lib/layui-v2.5.5/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../css/public.css" media="all">
+    <link rel="stylesheet" href="../../lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
+    <style>
+        body { background-color: #ffffff;}
+        .layui-form-label { padding-left: 0;}
+        .layui-form-item {  text-align: center;}
+    </style>
+</head>
+<body>
+<form class="layui-form layuimini-form" lay-filter="saveSecondary" id="saveSecondaryId" style="text-aglin:center">
+    <div class="layui-form-item">
+        <label class="layui-form-label required">顺序号:</label>
+        <div class="layui-input-block" >
+            <input id="id" name="id" type="hidden">
+            <input id="archiveId" name="archiveId" type="hidden">
+            <input type="text" class="layui-input" placeholder="请输入顺序号" name="sxh" id="sxh" lay-filter="sxh"
+                   lay-verify="required" lay-reqtext="顺序号不能为空">
+        </div>
+    </div>
+
+    <div class="layui-form-item">
+        <label class="layui-form-label required">题名:</label>
+        <div class="layui-input-block">
+            <input type="text" class="layui-input" placeholder="请输入题名" name="tm" id="tm" lay-filter="tm"
+                   lay-verify="required" lay-reqtext="题名不能为空">
+        </div>
+    </div>
+
+    <div class="layui-form-item">
+        <label class="layui-form-label required">日期:</label>
+        <div class="layui-input-block">
+            <input type="text" class="layui-input" placeholder="请选择日期" name="rq" id="rq" lay-filter="rq"
+                   lay-verify="required" lay-reqtext="日期不能为空">
+        </div>
+    </div>
+
+    <div class="layui-form-item">
+        <label class="layui-form-label required">页号:</label>
+        <div class="layui-input-block">
+            <input type="number" class="layui-input" placeholder="请输入页号" value="1" name="yh" id="yh"
+                   lay-filter="yh" lay-verify="required" lay-reqtext="页号不能为空">
+        </div>
+    </div>
+
+    <div class="layui-form-item">
+        <label class="layui-form-label required">文号:</label>
+        <div class="layui-input-block">
+            <input type="text" class="layui-input" placeholder="请输入文号" name="wh" id="wh"
+                   lay-filter="wh" lay-verify="required" lay-reqtext="文号不能为空">
+        </div>
+    </div>
+
+    <div class="layui-form-item">
+        <label class="layui-form-label required">责任者:</label>
+        <div class="layui-input-block">
+            <input type="text" class="layui-input" placeholder="请输入责任者" name="zrz" id="zrz"
+                   lay-filter="zrz" lay-verify="required" lay-reqtext="责任者不能为空">
+        </div>
+    </div>
+
+    <div class="layui-form-item">
+        <label class="layui-form-label required">文件:</label>
+        <div class="layui-input-block">
+            <div class="layui-input-inline" >
+                <input type="file" id="uploadFile" name="uploadFile"/>
+            </div>
+        </div>
+    </div>
+
+    <div class="layui-form-item">
+        <label class="layui-form-label">备注:</label>
+        <div class="layui-input-block" >
+            <textarea class="layui-textarea" name="bz" placeholder="请输入备注"></textarea>
+        </div>
+    </div>
+    <div class="layui-form-item">
+        <button class="layui-btn layui-btn"  id="cancel" style="background-color: white;color:#1E9FFF;border: 1px solid #1E9FFF">取消</button>
+        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">保存</button>
+    </div>
+</form>
+<script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
+<script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
+<script>
+    function RequestParameter(){
+        let url = window.location.search; //获取url中"?"符后的字串
+        let theRequest = new Object();
+        if (url.indexOf("?") != -1) {
+            var str = url.substr(1);
+            var strs = str.split("&");
+            for(var i = 0; i < strs.length; i ++) {
+                theRequest[strs[i].split("=")[0]]=(strs[i].split("=")[1]);
+            }
+        }
+        return theRequest
+    }
+    layui.use(['form', 'http', 'laydate', 'upload', 'url'], function () {
+        var form = layui.form,
+            layer = layui.layer,
+            http = layui.http,
+            $ = layui.$,
+            laydate = layui.laydate
+        const urlParam = layui.url()
+
+        /** 初始化日期控件*/
+        let initDate = function () {
+            laydate.render({
+                elem: '#rq',
+                type: 'date',
+                trigger: 'click',
+            });
+        }
+        // 保存方法
+        let save = function (data, method) {
+            let formData = new FormData($('#saveSecondaryId')[0]);
+            http.post('secondary/archive/save', formData, true, function (res) {
+                if (res.code == 200) {
+                    let index = layer.alert('保存成功!', {
+                        title: urlParam.id == '' ? '添加' : '修改' + '信息'
+                    }, function () {
+                        if (method == 'save') {
+                            // 关闭弹出层
+                            let iframeIndex = parent.layer.getFrameIndex(window.name);
+                            parent.layer.close(iframeIndex);
+                        }
+                        layer.close(index);
+                    });
+                }
+            })
+        }
+        // 加载数据
+        let initData = function () {
+            var id = RequestParameter()["id"];
+            var archiveId = RequestParameter()["archiveId"];
+            console.log("id="+id,"archiveId="+archiveId);
+            $("#id").val(id);
+            $("#archiveId").val(archiveId);
+            let adata = ''
+            if (urlParam.id != '') {
+                http.get('secondary/archive/selectByPrimaryKey', {
+                    id: urlParam.id
+                }, false, function (res) {
+                    adata = res.data
+                    form.val("saveSecondary", res.data);
+                    form.render();
+                })
+            }
+        }
+        initDate()
+        initData()
+        //监听提交
+        form.on('submit(saveBtn)', function (data) {
+            save(data.field, 'save')
+        });
+        layui.$('#cancel').on('click', function () {
+            let index = parent.layer.getFrameIndex(window.name);
+            parent.layer.close(index);//关闭当前页
+        });
+    });
+</script>
+</body>
+</html>

+ 4 - 5
src/main/resources/static/page/archive/fileList.html

@@ -50,7 +50,7 @@
 <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
-    layui.use(['table', 'http', 'form', 'upload'], function () {
+    layui.use(['table', 'http', 'form', 'upload', 'url'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
 
         var table = layui.table,
@@ -58,9 +58,8 @@
             form = layui.form,
             upload = layui.upload,
             $ = layui.jquery;
+        const urlParam = layui.url()
 
-        let archive_id = $("#archive_id").val()
-        let fileType = $("#fileType").val()
         let curr = 1;
         /**方-------------------------------法-------------------------------定-------------------------------义*/
             //数据加载方法
@@ -82,8 +81,8 @@
                         limitName: 'pageSize'
                     },
                     where: {
-                        archiveId: archive_id,
-                        fileType: fileType
+                        archiveId: urlParam.archive_id,
+                        fileType: urlParam.fileType
                     },
                     response: {
                         statusCode: 200 //重新规定成功的状态码为 200,table 组件默认为 0

+ 29 - 24
src/main/resources/static/page/archive/list.html

@@ -47,6 +47,16 @@
                             <option value="">保管期限</option>
                         </select>
                     </div>
+
+                    <div class="layui-inline" style="width: 100px;">
+                        <select name="qzh" id="qzh">
+                            <option value="">全宗号</option>
+                            <option value="5179">5179</option>
+                            <option value="5098">5098</option>
+                            <option value="5134">5134</option>
+                        </select>
+                    </div>
+
                     <div class="layui-inline">
                         <input type="checkbox" name="allDocument" lay-skin="primary" title="全文检索">
                         <div class="layui-unselect layui-form-checkbox layui-form-checked" lay-skin="primary">
@@ -122,6 +132,7 @@
 
         $("#resultSearch").hide()
 
+        // 获取权限按钮
         http.getRoleButton(158)
 
         let initUpload = function () {
@@ -151,7 +162,6 @@
             layer.close(loading);
         }
 
-
         let initSelect = function () {
             initBgqx()
             // 加载密集
@@ -167,11 +177,12 @@
 
         }
 
-        let initgdnx = function (){
-            http.get('system/dict/selectGdnd',{},false, function (res) {
+        // 加载归档年度
+        let initgdnx = function () {
+            http.get('system/dict/selectGdnd', {}, false, function (res) {
                 let html = '';
                 for (let i in res.data) {
-                    html += '<option value="' + res.data[i].gdnx + '">' + res.data[i].gdnx+ '</option>'
+                    html += '<option value="' + res.data[i].gdnx + '">' + res.data[i].gdnx + '</option>'
                 }
                 $("#gdnd").append(html)
                 form.render();//菜单渲染 把内容加载进去
@@ -255,9 +266,10 @@
             })
         }
 
+        // 加载保管期限
         let initBgqx = function () {
             let code = 'BAOGUANQIXIANER'
-            if(searchParam.ml === 'WS' || searchParam.ml === ''){
+            if (searchParam.ml === 'WS' || searchParam.ml === '') {
                 code = 'BAOGUANQIXIANYI'
             }
             http.get('system/dict/selectDictByCode', {code: code}, false, function (res) {
@@ -330,7 +342,6 @@
             });
         }
 
-
         //添加方法
         let addDict = function () {
             var index = layer.open({
@@ -352,6 +363,7 @@
             });
         }
 
+        // 高级检索
         let advancedSearch = function () {
             var index = layer.open({
                 title: '高级检索',
@@ -362,7 +374,6 @@
                 area: ['750px', '600px'],
                 content: './advancedSearch.html',
                 success: function (layero, index) {
-                    var body = layer.getChildFrame('body', index);
                 },
                 end: function () {
                     renderTable()
@@ -384,11 +395,8 @@
                 maxmin: true,
                 shadeClose: true,
                 area: ['100%', '100%'],
-                content: './fileList.html',
+                content: './fileList.html?archive_id=' + data.id + '&fileType=' + 1,
                 success: function (layero, index) {
-                    var body = layer.getChildFrame('body', index);
-                    body.find("#archive_id").val(data.id);
-                    body.find("#fileType").val(1);
                 },
                 end: function () {
                     renderTable()
@@ -405,11 +413,8 @@
                 maxmin: true,
                 shadeClose: true,
                 area: ['100%', '100%'],
-                content: './fileList.html',
+                content: './fileList.html?archive_id=' + data.id + '&fileType=' + 0,
                 success: function (layero, index) {
-                    var body = layer.getChildFrame('body', index);
-                    body.find("#archive_id").val(data.id);
-                    body.find("#fileType").val(0);
                 },
                 end: function () {
                     renderTable()
@@ -429,9 +434,6 @@
                 area: ['100%', '100%'],
                 content: './secondaryList.html?archive_id=' + data.id + "&dh=" + data.dh,
                 success: function (layero, index) {
-                    // var body = layer.getChildFrame('body', index);
-                    // body.find("#archive_id").val(data.id);
-                    // body.find("#dh").val(data.dh);
                 },
                 end: function () {
                     renderTable()
@@ -469,7 +471,7 @@
                 maxmin: true,
                 shadeClose: true,
                 area: ['100%', '100%'],
-                content: './edit.html',
+                content: './edit.html?id=' + id + '&mlId=' + searchParam.mlId + '&mlCode=' + searchParam.ml + '&fileType=' + 0,
                 success: function (layero, index) {
                     var body = layer.getChildFrame('body', index);
                     body.find("#id").val(id);
@@ -483,6 +485,7 @@
             });
         }
 
+        // 批量删除
         let batchDel = function () {
             var data = layui.table.checkStatus('user-table').data;
             if (data.length > 0) {
@@ -510,6 +513,7 @@
             }
         }
 
+        // 导入
         let importExcel = function () {
             var index = layer.open({
                 title: '文档导入',
@@ -520,7 +524,6 @@
                 area: ['100%', '100%'],
                 content: './import.html',
                 success: function (layero, index) {
-                    var body = layer.getChildFrame('body', index);
                 },
                 end: function () {
                     renderTable()
@@ -528,6 +531,7 @@
             });
         }
 
+        // 档案信息
         let join = function (id) {
             layer.open({
                 title: '档案信息',
@@ -538,9 +542,6 @@
                 area: ['100%', '100%'],
                 content: './show.html' + '?id=' + id,
                 success: function (layero, index) {
-                    // var body = layer.getChildFrame('body', index);
-                    // body.find("#archive_id").val(id);
-                    // console.log(body.find("#archive_id"))
                 },
                 end: function () {
                     // renderTable()
@@ -548,10 +549,12 @@
             });
         }
 
+        // 下载模板
         let download = function () {
             window.open("/template/导入模板.xlsx", "_blank")
         }
 
+        // 导出
         let exportUser = function (data) {
             var url = http.requestUrl + 'archives/user/exportWord?userId=' + data.id;
             var xhr = new XMLHttpRequest();
@@ -578,7 +581,6 @@
             };
             // 发送ajax请求
             xhr.send()
-
         }
         /**事-------------------------------件-------------------------------绑-------------------------------定*/
 
@@ -666,6 +668,7 @@
             $("#wjbh").val('')
             $("#mj").val('')
             $("#gdnd").val('')
+            $("#qzh").val('')
             $("#bgqx").val('')
             const ml = searchParam.ml
             searchParam = {}
@@ -681,6 +684,7 @@
             searchParam.bgqx = data.field.bgqx
             searchParam.gdnd = data.field.gdnd
             searchParam.mj = data.field.mj
+            searchParam.qzh = data.field.qzh
             searchParam.ztc = data.field.ztc
             searchParam.wjbh = data.field.wjbh
             searchParam.again = true
@@ -694,6 +698,7 @@
             searchParam.bgqx = data.field.bgqx
             searchParam.gdnd = data.field.gdnd
             searchParam.mj = data.field.mj
+            searchParam.qzh = data.field.qzh
             searchParam.ztc = data.field.ztc
             searchParam.wjbh = data.field.wjbh
             searchParam.allDocument = data.field.allDocument

+ 5 - 10
src/main/resources/static/page/archive/secondaryList.html

@@ -35,7 +35,7 @@
 <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
-    layui.use(['table', 'http', 'form', 'upload','url'], function () {
+    layui.use(['table', 'http', 'form', 'upload', 'url'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
 
         var table = layui.table,
@@ -121,6 +121,7 @@
         }
 
         let add = function () {
+            console.log('&add archiveId=' + archive_id);
             var index = layer.open({
                 title: '添加卷内目录',
                 type: 2,
@@ -128,19 +129,16 @@
                 maxmin: true,
                 shadeClose: true,
                 area: ['600px', '600px'],
-                content: './editSecondary.html',
+                content: './editSecondaryNew.html?archiveId=' + archive_id,
                 success: function (layero, index) {
-                    var body = layer.getChildFrame('body', index);
-                    body.find("#archive_id").val(archive_id);
                 },
                 end: function () {
                     renderTable()
                 }
             });
         }
-
-
         let update = function (data) {
+            console.log('&update archiveId=' + archive_id);
             var index = layer.open({
                 title: '修改卷内目录',
                 type: 2,
@@ -148,11 +146,8 @@
                 maxmin: true,
                 shadeClose: true,
                 area: ['600px', '600px'],
-                content: './editSecondary.html',
+                content: './editSecondaryNew.html?id=' + data.id + '&archiveId=' + archive_id,
                 success: function (layero, index) {
-                    var body = layer.getChildFrame('body', index);
-                    body.find("#archive_id").val(archive_id);
-                    body.find("#id").val(data.id)
                 },
                 end: function () {
                     renderTable()

+ 123 - 41
src/main/resources/static/page/archive/show.html

@@ -7,8 +7,14 @@
     <link rel="stylesheet" href="../../css/public.css" media="all">
     <link rel="stylesheet" href="../../lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
     <style>
+        html,body{
+            width: 100%;
+            height: 100%;
+            overflow: hidden;
+        }
         body {
             background-color: #ffffff;
+            margin:0px ;
         }
 
         #file_list li {
@@ -20,7 +26,7 @@
 
         #file_list li a {
             display: inline-block;
-            width: 100%;
+            width: 70%;
             height: 100%;
             box-sizing: border-box;
             color: #fff;
@@ -32,7 +38,11 @@
             text-overflow: ellipsis;
             font-size: 12px;
         }
-
+        #file_list li a.down{
+            width:auto;
+            position: absolute;
+            right: 0px;
+        }
         table tr td, th {
             font-size: 18px;
         }
@@ -52,6 +62,25 @@
             /*padding-right: 200px;*/
             width: 400px;
         }
+
+        ul li a {
+            white-space: nowrap;
+        }
+        .layui-tab{
+            height: 100%;
+        }
+        .layui-tab .layui-tab-content{
+            padding: 0px;
+            position: absolute;
+            top: 50px;
+            left: 10px;
+            right: 10px;
+            bottom: 10px;
+        }
+        .layui-tab-item{
+            width: 100%;
+            height: 100%;
+        }
     </style>
 </head>
 <body>
@@ -61,7 +90,7 @@
         <li class="layui-this" lay-id="0">档案信息</li>
         <li id="file_tab_list">文件预览</li>
     </ul>
-    <div class="layui-tab-content" style="height: 100px;">
+    <div class="layui-tab-content">
         <div class="layui-tab-item layui-show">
             <div>
                 <table style="font-size:12px;" border="1" class="layui-table" cellspacing="0">
@@ -97,105 +126,117 @@
                         <th width="40px">备注:</th>
                         <td colspan="3" id="remarks"></td>
                     </tr>
+                    <tr id="uploadFileId">
+                        <th width="40px">附件:</th>
+                        <td colspan="3" id="uploadFile"></td>
+                    </tr>
                 </table>
             </div>
         </div>
         <div class="layui-tab-item">
-            <div class="layui-fluid" style="height: 100%">
-                <div class="layui-row">
-                    <div class="layui-col-md2" id="files">
-                        <ul id="file_list" class="layui-bg-black" style="height: calc(90vh);">
-                        </ul>
-                    </div>
-                    <div class="layui-col-md10" id="pdf_yl">
-                        <iframe src="" frameborder="0" id="pdf_show" style="width: 100%; height: calc(90vh);"></iframe>
-                    </div>
+            <div class="layui-row">
+                <div class="layui-col-md2" id="files">
+                    <ul id="file_list" class="layui-bg-black" style="height: calc(90vh);">
+                    </ul>
+                </div>
+                <div class="layui-col-md10" id="pdf_yl">
+                    <a class="pdf-box" id="pdf_show"></a>
                 </div>
             </div>
         </div>
     </div>
 </div>
 <input id="archive_id" name="archive_id" type="hidden">
+<script src="../../js/lay-module/utils/base64.min.js"></script>
 <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
+<script src="../../js/jquery-3.6.0.min.js"></script>
+<script src="../../js/jquery.media.js"></script>
 <script>
+    var dataList = [];
+    var $;
+    var urlAll=[]
     layui.use(['http', 'element', 'url'], function () {
         let http = layui.http,
-            $ = layui.$,
             url = layui.url,
             element = layui.element
         ;
-
-        // let archive_id = $("#archive_id").val()
+        $ = layui.$;
         let archive_id = url('id')['id']
 
-        // let a = setInterval(function (){
-        //     layer.msg(archive_id)
-        // },1000);
-        //
-
         if (!archive_id) {
             layer.msg('加载错误')
             return;
         }
-
         let isShowFile = true;
 
+        let pdfRender = (src)=>{
+            let pdf = $("#pdf_show")
+            let height = pdf.parents('.layui-tab-item').height()
+            let width = pdf.parent().width()
+            pdf.attr('href',src).media({width:width || '100%', height})
+        }
 
         $(document).on('click', 'li>a', function () {
             $("#file_list").children("li").removeClass("layui-bg-green")
             let li = $(this).parent("li")
             li.addClass("layui-bg-green")
             let pef_src = $(this).attr('pdf_src')
-            $("#pdf_show").prop('src', pef_src)
-        });
+            pdfRender(pef_src)
 
+        });
         let initFile = () => {
-            let html = ""
+            let html = '' // '<button onclick="batchDownload()">批量下载</button><br/>';
             http.get('archive/archiveFile/selectByArchiveId', {
                 archiveId: archive_id,
                 fileType: 0
             }, false, res => {
                 if (res.code == 200) {
                     if (res.data.length == 0) {
-                        // layui.layer.msg('无文件无法预览,即将自动关闭', {icon: 2}, function () {
-                        //     // 关闭弹出层
-                        //     let iframeIndex = parent.layer.getFrameIndex(window.name);
-                        //     parent.layer.close(iframeIndex);
-                        // })
-                        // return
                         $("#file_tab_list").hide()
                         return
                     }
                     if (res.data.length == 1) {
+                        let obj = res.data[0]
                         $("#files").removeClass();
                         $("#files").addClass("layui-col-md0");
                         $("#files").hide();
                         $("#pdf_yl").removeClass();
                         $("#pdf_yl").addClass("layui-col-md12");
+                        let uploadPdf = '<a style="text-align: right;color:#009688;" download="' + obj.fileName + '" href="' + 'http://66.1.21.158:9091' + obj.filePath + obj.fileName + '">下载</a>';
+                        $("#uploadFile").html(uploadPdf);
+                        dataList.push(obj);
+                    } else {
+                        $("#uploadFileId").attr("style", "display:none");
+                        //$("#uploadFileId").css("display", "none");
                     }
                     for (let i = 0; i < res.data.length; i++) {
                         let item = res.data[i]
+                        dataList.push(item);
+                        let url = 'http://66.1.21.158:9091/' + item.filePath + '/' + item.fileName
+                        let cls = ''
                         if (i == 0) {
-                            html += '<li class="layui-bg-green"><a title="' + (i + 1) + '、' + (item.jnml ? item.jnml : '档案文件') + '" pdf_src="' + item.filePath + '/' + item.fileName + '">' + (i + 1) + '、' + (item.jnml ? item.jnml : '档案文件') + '</a></li>'
-                            $("#pdf_show").prop('src', item.filePath + '/' + item.fileName)
-                        } else {
-                            html += '<li><a title="' + (i + 1) + '、' + (item.jnml ? item.jnml : '档案文件') + '" pdf_src="' + item.filePath + '/' + item.fileName + '">' + (i + 1) + '、' + (item.jnml ? item.jnml : '档案文件') + '</a></li>'
+                            cls= 'layui-bg-green'
+                            pdfRender(url)
                         }
+
+                        html += '<li class="' +cls+' "><a title="' + (i + 1) + '、' +
+                            (item.jnml ? item.jnml : '档案文件') +
+                            '" pdf_src="'
+                            + url + '">' + (i + 1) + '、' + (item.jnml ? item.jnml : '档案文件') + '</a>' +
+                            '<a class="down" target="_blank" download="' + item.fileName + '" href="' + url +
+                            '  ">下载</a></li>'
                     }
                     $("#file_list").append(html)
                 } else {
-                    // $("#file_tab_list").hide()
                     isShowFile = false
                 }
             })
         }
-
         let initData = () => {
             http.get('archive/archive/selectByPrimaryKeyText', {
                 id: archive_id
             }, false, res => {
-                console.log(res)
                 if (res.code == 200) {
                     $("#dh").text(res.data.dh ? res.data.dh : '无');
                     $("#tm").text(res.data.tm ? res.data.tm : '无');
@@ -211,7 +252,6 @@
                     layer.msg('您当前没有权限查看该档案,请联系管理员。', {
                         icon: 2,
                     }, function () {
-                        // 关闭弹出层
                         let iframeIndex = parent.layer.getFrameIndex(window.name);
                         parent.layer.close(iframeIndex);
                     })
@@ -229,14 +269,56 @@
                     layer.msg('您当前没有权限查看该档案文件,请联系管理员。', {
                         icon: 2,
                     }, function () {
-                        // // 关闭弹出层
-                        // let iframeIndex = parent.layer.getFrameIndex(window.name);
-                        // parent.layer.close(iframeIndex);
                     })
                 }
             }
         });
     })
+
+    function downloadFile() {//下载文件方法
+        urlAll.forEach(url => {
+            const iframe = document.createElement("iframe");
+            iframe.style.display = "none";  // 防止影响页面
+            iframe.style.height = 0;  // 防止影响页面
+            iframe.src = url;
+            console.log(iframe)
+            document.body.appendChild(iframe);  // 这一行必须,iframe挂在到dom树上才会发请求
+            setTimeout(() => {
+                iframe.remove();
+            }, 5 * 60 * 1000);
+
+        })
+    }
+    function batchDownload() {
+        let dataFileList = this.dataList;
+        console.log(JSON.stringify(dataFileList))
+        for (var i = 0; i < dataFileList.length; i++){
+            var item = dataFileList[i];
+            // console.log(item)
+            // var fileName = item.fileName;
+           urlAll.push('http://66.1.21.158:9091' + dataFileList[i].filePath + dataFileList[i].fileName)
+
+            // console.log(url)
+            // var a = document.createElement('a');
+            // var e = document.createEvent('MouseEvents');
+            // e.initEvent('click', false, false);
+            // a.target="_blank";
+            // a.href = url;
+            // a.download = fileName
+            // a.dispatchEvent(e);
+
+
+        }
+        urlAll.forEach(url => {
+            let a = document.createElement('a') // 创建a标签
+            let e = document.createEvent('MouseEvents') // 创建鼠标事件对象
+            e.initEvent('click', false, false) // 初始化事件对象
+            a.target="_blank";
+            a.href = url // 设置下载地址
+            a.download = '' // 设置下载文件名
+            a.dispatchEvent(e)
+        })
+    }
 </script>
 </body>
 </html>

+ 4 - 3
src/main/resources/static/page/archive/upload.html

@@ -55,12 +55,13 @@
 <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
-    layui.use(['form', 'upload', 'http'], () => {
+    layui.use(['form', 'upload', 'http', 'url'], () => {
 
         let layer = layui.layer;
 
-        let archive_id = layui.$("#archive_id").val()
-        let fileType = layui.$("#fileType").val()
+        const urlParam = layui.url()
+        let archive_id = urlParam.archiveId
+        let fileType = urlParam.fileType
         let secondaryArchiveId = ''
         let selectFile = false;
 

+ 30 - 29
src/main/resources/static/page/archives-tree/edit.html

@@ -18,7 +18,8 @@
         <label class="layui-form-label required">门类名称</label>
         <div class="layui-input-block">
             <input type="hidden" name="id" id="id" class="layui-input">
-            <input type="text" name="title" lay-verify="required" lay-reqtext="门类名称不能为空" placeholder="请输入门类名称" value="" class="layui-input">
+            <input type="text" name="title" lay-verify="required" lay-reqtext="门类名称不能为空" placeholder="请输入门类名称" value=""
+                   class="layui-input">
         </div>
     </div>
 
@@ -26,18 +27,18 @@
     <div class="layui-form-item">
         <label class="layui-form-label required">门类代码</label>
         <div class="layui-input-block">
-            <input type="text" name="code" placeholder="请输入门类代码" value="" lay-verify="" lay-reqtext="门类代码不能为空" class="layui-input">
+            <input type="text" name="code" placeholder="请输入门类代码" value="" lay-verify="" lay-reqtext="门类代码不能为空"
+                   class="layui-input">
         </div>
     </div>
 
 
-
     <div class="layui-form-item">
         <label class="layui-form-label">父级门类</label>
         <div class="layui-input-block">
-<!--            <select name="parentId" id="parentId" lay-filter="parentId">-->
-<!--                <option value="-1">请选择父级菜单</option>-->
-<!--            </select>-->
+            <!--            <select name="parentId" id="parentId" lay-filter="parentId">-->
+            <!--                <option value="-1">请选择父级菜单</option>-->
+            <!--            </select>-->
             <input type="text" id="parentId" name="parentId" lay-filter="parentId" class="layui-input">
         </div>
     </div>
@@ -59,37 +60,37 @@
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
 
-    layui.use(['form','http','iconPickerFa','treeSelect'], function () {
+    layui.use(['form', 'http', 'iconPickerFa', 'treeSelect', 'url'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
         var form = layui.form,
             layer = layui.layer,
             http = layui.http,
             $ = layui.$,
             treeSelect = layui.treeSelect;
-        let id = $('#id').val()
+        const urlParam = layui.url()
         let parentId;
         /**方-------------------------------法-------------------------------定-------------------------------义*/
-        // 保存方法
+            // 保存方法
         let save = function (data) {
                 var selectedNodes = treeSelect.zTree('parentId').getSelectedNodes();
-                if (selectedNodes.length > 0){
+                if (selectedNodes.length > 0) {
                     data.parentId = selectedNodes[0].id
-                }else {
+                } else {
                     data.parentId = -1
                 }
-            http.post(id == '' ? 'system/archivesTree/insert': 'system/archivesTree/update',data,true,function (res) {
-                if (res.code == 200){
-                    let index = layer.alert('保存成功!', {
-                        title: id == '' ? '添加':'修改' + '信息'
-                    }, function () {
-                        // 关闭弹出层
-                        layer.close(index);
-                        let iframeIndex = parent.layer.getFrameIndex(window.name);
-                        parent.layer.close(iframeIndex);
-                    });
-                }
-            })
-        }
+                http.post(urlParam.id == '' ? 'system/archivesTree/insert' : 'system/archivesTree/update', data, true, function (res) {
+                    if (res.code == 200) {
+                        let index = layer.alert('保存成功!', {
+                            title: urlParam.id == '' ? '添加' : '修改' + '信息'
+                        }, function () {
+                            // 关闭弹出层
+                            layer.close(index);
+                            let iframeIndex = parent.layer.getFrameIndex(window.name);
+                            parent.layer.close(iframeIndex);
+                        });
+                    }
+                })
+            }
 
         // 加载下拉框
         let loadDictSelect = function () {
@@ -122,7 +123,7 @@
                     }
                 },
                 success: function (res) {
-                    if(id != '' && parentId != '' && parentId != -1){
+                    if (urlParam.id != '' && parentId != '' && parentId != -1) {
                         treeSelect.checkNode('parentId', parentId);
                     }
                 }
@@ -131,10 +132,10 @@
 
         // 加载数据
         let initData = function () {
-            if(id != ''){
-                http.get('/system/archivesTree/selectByPrimaryKey',{
-                    id: id
-                },false,function (res) {
+            if (urlParam.id) {
+                http.get('/system/archivesTree/selectByPrimaryKey', {
+                    id: urlParam.id
+                }, false, function (res) {
                     form.val("addDict", res.data);
                     parentId = res.data.parentId
                     form.render();

+ 2 - 6
src/main/resources/static/page/archives-tree/list.html

@@ -124,12 +124,8 @@
                 maxmin:true,
                 shadeClose: true,
                 area: ['100%', '100%'],
-                content: './edit.html',
-                success: function(layero, index){
-                    // var iframe = window['layui-layer-iframe' + index];
-                    // iframe.setValue(id)
-                    var body=layer.getChildFrame('body',index);
-                    body.find("#id").val(id);
+                content: './edit.html?id=' + id,
+                success: function(layer, index){
                 },
                 end: function () {
                     renderTable()

+ 6 - 4
src/main/resources/static/page/auditList/audit.html

@@ -132,17 +132,19 @@
     <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
     <script>
 
-        layui.use(['form', 'http', 'laydate'], function () {
+        layui.use(['form', 'http', 'laydate', 'url'], function () {
             /**变-------------------------------量-------------------------------定-------------------------------义*/
             var form = layui.form,
                 layer = layui.layer,
                 http = layui.http,
                 laydate = layui.laydate,
                 $ = layui.$;
-            let id = $('#id').val()
+            const urlParam = layui.url()
+            console.log(urlParam, '参数')
             /**方-------------------------------法-------------------------------定-------------------------------义*/
                 // 保存方法
             let save = function (data) {
+                    data.id = urlParam.id
                     http.post('borrow/archiveBorrow/audit', data, true, function (res) {
                         if (res.code == 200) {
                             let index = layer.alert('保存成功!', {
@@ -162,7 +164,7 @@
             let initData = function () {
                 // 加载当前文档信息
                 http.get('borrow/archiveBorrow/selectBorrowInfo', {
-                    id: id
+                    id: urlParam.id
                 }, false, function (res) {
                     $("#adminName").text(res.data.name == null ? '无' : res.data.name)
                     let jy = ''
@@ -185,7 +187,7 @@
                     $("#phone").text(res.data.phone == null ? '无' : res.data.phone)
                     let fjHtml = '无'
                     if (res.data.originalFileName) {
-                        fjHtml = '<a style="color: #2D8CF0" target="_blank" href="' + res.data.filePath +'/' +  res.data.fileName + '">' + res.data.originalFileName + '</a>'
+                        fjHtml = '<a style="color: #2D8CF0" target="_blank" href="' + res.data.filePath + '/' + res.data.fileName + '">' + res.data.originalFileName + '</a>'
                     }
                     $("#fj").html(fjHtml)
                     // form.val("addDict", res.data);

+ 1 - 3
src/main/resources/static/page/auditList/list.html

@@ -275,10 +275,8 @@
                 maxmin: true,
                 shadeClose: true,
                 area: ['100%', '100%'],
-                content: './audit.html',
+                content: './audit.html?id=' + data.id,
                 success: function (layero, index) {
-                    var body = layer.getChildFrame('body', index);
-                    body.find("#id").val(data.id);
                 },
                 end: function () {
                     renderTable()

+ 25 - 7
src/main/resources/static/page/borrow/list.html

@@ -57,6 +57,11 @@
                         <button id="resultSearch" lay-submit lay-filter="resultSearch" class="layui-btn icon-btn"><i
                                 class="layui-icon"></i>结果中搜索
                         </button>
+                        <button id="resetSearch" type="reset" lay-submit lay-filter="resetSearch"
+                                class="layui-btn icon-btn">
+                            <i class="layui-icon layui-icon-refresh-3"></i>
+                            重置
+                        </button>
                     </div>
                 </div>
             </div>
@@ -163,11 +168,8 @@
                 maxmin: true,
                 shadeClose: true,
                 area: ['70%', '90%'],
-                content: '../borrow/reserve.html',
+                content: '../borrow/reserve.html?archive_id=' + data.id + "&recordType=" + 1,
                 success: function (layero, index) {
-                    var body = layer.getChildFrame('body', index);
-                    body.find("#archive_id").val(data.id);
-                    body.find("#recordType").val(1);
                 },
                 end: function () {
                     renderTable()
@@ -240,11 +242,11 @@
             })
         }
 
-        let initgdnx = function (){
-            http.get('system/dict/selectGdnd',{},false, function (res) {
+        let initgdnx = function () {
+            http.get('system/dict/selectGdnd', {}, false, function (res) {
                 let html = '';
                 for (let i in res.data) {
-                    html += '<option value="' + res.data[i].gdnx + '">' + res.data[i].gdnx+ '</option>'
+                    html += '<option value="' + res.data[i].gdnx + '">' + res.data[i].gdnx + '</option>'
                 }
                 $("#gdnd").append(html)
                 form.render();//菜单渲染 把内容加载进去
@@ -608,6 +610,22 @@
             }
         })
 
+        form.on('submit(resetSearch)', function (data) {
+            // searchParam.reset = true
+            $("#ztc").val('')
+            $("#dh").val('')
+            $("#wjbh").val('')
+            $("#mj").val('')
+            $("#gdnd").val('')
+            $("#bgqx").val('')
+            const ml = searchParam.ml
+            searchParam = {}
+            searchParam.ml = ml
+            curr = 1
+            $("#resultSearch").hide()
+            renderTable()
+        })
+
         form.on('submit(resultSearch)', function (data) {
             searchParam.dh = data.field.dh
             searchParam.mlh = data.field.mlh

+ 25 - 19
src/main/resources/static/page/borrow/reserve.html

@@ -10,6 +10,7 @@
         body {
             background-color: #ffffff;
         }
+
         .layui-form-item .layui-input-inline {
             /*width: 20%;*/
         }
@@ -20,6 +21,7 @@
     <div class="layui-form-item" id="ryA">
         <label class="layui-form-label required">人员类型:</label>
         <div class="layui-input-block">
+            <input type="hidden" name="recordType" id="recordType" class="layui-input">
             <input lay-filter="personType" type="radio" name="personType" value="局内人员" title="局内人员" checked>
             <input lay-filter="personType" type="radio" name="personType" value="外来人员" title="外来人员">
         </div>
@@ -68,6 +70,7 @@
     <div class="layui-form-item">
         <label class="layui-form-label required">档号:</label>
         <div class="layui-input-block">
+            <input type="hidden" name="archiveId" id="archive_id" class="layui-input">
             <input type="text" name="dh" placeholder="请输入档号" value="" lay-verify="required" lay-reqtext="档号不能为空"
                    class="layui-input" readonly>
         </div>
@@ -128,7 +131,7 @@
 <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
-    layui.use(['form', 'http', 'laydate', 'upload','url'], function () {
+    layui.use(['form', 'http', 'laydate', 'upload', 'url'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
         var form = layui.form,
             layer = layui.layer,
@@ -141,9 +144,8 @@
         let recordType = url().recordType
         console.log()
         /**方-------------------------------法-------------------------------定-------------------------------义*/
-        if(recordType == 1){
-            http.get('system/auth/currLoginAdminDept', {
-            }, true, function (res) {
+        if (recordType == 1) {
+            http.get('system/auth/currLoginAdminDept', {}, true, function (res) {
                 if (res.code === 200) {
                     $("#dept").val(res.data.deptName ? res.data.deptName : '无')
                     $("#phone").val(res.data.phone)
@@ -156,24 +158,26 @@
             // $("#dept_container").hide()
             // $("#phone_container").hide()
             $("#ryA").hide()
-        }else {
+        } else {
             $("#name_A").hide();
         }
-            // 保存方法
+        // 保存方法
         let save = function (data) {
-                http.post('borrow/archiveBorrow/borrow', data, true, function (res) {
-                    if (res.code == 200) {
-                        let index = layer.alert('保存成功!', {
-                            title: '预约借阅文档'
-                        }, function () {
-                            // 关闭弹出层
-                            layer.close(index);
-                            let iframeIndex = parent.layer.getFrameIndex(window.name);
-                            parent.layer.close(iframeIndex);
-                        });
-                    }
-                })
-            }
+            data.archiveId = archiveId
+            data.recordType = recordType
+            http.post('borrow/archiveBorrow/borrow', data, true, function (res) {
+                if (res.code == 200) {
+                    let index = layer.alert('保存成功!', {
+                        title: '预约借阅文档'
+                    }, function () {
+                        // 关闭弹出层
+                        layer.close(index);
+                        let iframeIndex = parent.layer.getFrameIndex(window.name);
+                        parent.layer.close(iframeIndex);
+                    });
+                }
+            })
+        }
         // 加载下拉框
         let loadDictSelect = function () {
             http.get('system/admin/selectAll', {}, false, function (res) {
@@ -186,11 +190,13 @@
                 form.render();//菜单渲染 把内容加载进去
             })
         }
+
         // 最小时间
         function minDate() {
             var now = new Date();
             return now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate();
         }
+
         // 加载数据
         let initData = function () {
             laydate.render({

+ 7 - 7
src/main/resources/static/page/dept/edit.html

@@ -60,14 +60,14 @@
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
 
-    layui.use(['form', 'http', 'iconPickerFa', 'treeSelect'], function () {
+    layui.use(['form', 'http', 'iconPickerFa', 'treeSelect', 'url'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
         var form = layui.form,
             layer = layui.layer,
             http = layui.http,
             $ = layui.$,
             treeSelect = layui.treeSelect;
-        let id = $('#id').val()
+        const urlParam = layui.url()
         let parentId;
         /**方-------------------------------法-------------------------------定-------------------------------义*/
             // 保存方法
@@ -78,10 +78,10 @@
                 } else {
                     data.parentId = null
                 }
-                http.post(id == '' ? 'system/dept/insert' : 'system/dept/update', data, true, function (res) {
+                http.post(urlParam.id == '' ? 'system/dept/insert' : 'system/dept/update', data, true, function (res) {
                     if (res.code == 200) {
                         let index = layer.alert('保存成功!', {
-                            title: id == '' ? '添加' : '修改' + '信息'
+                            title: urlParam.id == '' ? '添加' : '修改' + '信息'
                         }, function () {
                             // 关闭弹出层
                             layer.close(index);
@@ -116,7 +116,7 @@
                 },
                 success: function (res) {
                     if (parentId != null) {
-                        if (id != '' && parentId != '' && parentId != -1) {
+                        if (urlParam.id != '' && parentId != '' && parentId != -1) {
                             treeSelect.checkNode('parentId', parentId);
                         }
                     }
@@ -126,9 +126,9 @@
 
         // 加载数据
         let initData = function () {
-            if (id != '') {
+            if (urlParam.id) {
                 http.get('/system/dept/selectByPrimaryKey', {
-                    id: id
+                    id: urlParam.id
                 }, false, function (res) {
                     form.val("addDict", res.data);
                     parentId = res.data.parentId

+ 28 - 22
src/main/resources/static/page/dept/list.html

@@ -33,12 +33,12 @@
 <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
-    layui.use(['table', 'treetable','http'], function () {
+    layui.use(['table', 'treetable', 'http'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
         let $ = layui.jquery,
-        table = layui.table,
-        http = layui.http,
-        treetable = layui.treetable;
+            table = layui.table,
+            http = layui.http,
+            treetable = layui.treetable;
 
         /**方-------------------------------法-------------------------------定-------------------------------义*/
         http.getRoleButton(184)
@@ -57,8 +57,8 @@
                 page: false,
                 cols: [[
                     {type: 'numbers'},
-                    {field: 'deptName',  title: '名称'},
-                    {field: 'deptOrder',  title: '排序'},
+                    {field: 'deptName', title: '名称'},
+                    {field: 'deptOrder', title: '排序'},
                     {templet: '#operating', width: 300, align: 'center', title: '操作'}
                 ]],
                 done: function () {
@@ -84,7 +84,7 @@
                 title: '添加部门',
                 type: 2,
                 shade: 0.2,
-                maxmin:true,
+                maxmin: true,
                 shadeClose: true,
                 area: ['100%', '100%'],
                 content: './edit.html',
@@ -97,13 +97,13 @@
         //删除方法
         let deleteDict = function (id) {
             layer.confirm('真的删除行么', function (index) {
-                http.delete('/system/dept/delete',{id: id},true,function (res) {
-                    if (res.code == 200){
+                http.delete('/system/dept/delete', {id: id}, true, function (res) {
+                    if (res.code == 200) {
                         layer.msg('删除成功', {
                             icon: 1,
                             time: 2000
                         })
-                    }else {
+                    } else {
                         layer.msg(res.msg, {
                             icon: 2,
                             time: 2000
@@ -121,15 +121,11 @@
                 title: '修改部门',
                 type: 2,
                 shade: 0.2,
-                maxmin:true,
+                maxmin: true,
                 shadeClose: true,
                 area: ['100%', '100%'],
-                content: './edit.html',
-                success: function(layero, index){
-                    // var iframe = window['layui-layer-iframe' + index];
-                    // iframe.setValue(id)
-                    var body=layer.getChildFrame('body',index);
-                    body.find("#id").val(id);
+                content: './edit.html?id=' + id,
+                success: function (layero, index) {
                 },
                 end: function () {
                     renderTable()
@@ -146,17 +142,27 @@
         table.on('tool(dict-table)', function (obj) {
             let data = obj.data;
             switch (obj.event) {
-                case 'delete': deleteDict(data.id); break;
-                case 'update': updateDict(data.id); break;
+                case 'delete':
+                    deleteDict(data.id);
+                    break;
+                case 'update':
+                    updateDict(data.id);
+                    break;
             }
         });
 
         //头部工具栏监听
         table.on('toolbar(dict-table)', function (obj) {
             switch (obj.event) {
-                case 'unfoldAll': unfoldAll(); break;
-                case 'add': addDict(); break;
-                case 'foldAll': foldAll(); break;
+                case 'unfoldAll':
+                    unfoldAll();
+                    break;
+                case 'add':
+                    addDict();
+                    break;
+                case 'foldAll':
+                    foldAll();
+                    break;
             }
         })
     });

+ 2 - 4
src/main/resources/static/page/myBorrow/list.html

@@ -224,16 +224,14 @@
         //打开附件列表
         let opinion = function (data) {
             var index = layer.open({
-                title: '预约借阅',
+                title: '审核结果',
                 type: 2,
                 shade: 0.2,
                 maxmin: true,
                 shadeClose: true,
                 area: ['100%', '100%'],
-                content: './ruditResult.html',
+                content: './ruditResult.html?id=' + data.id,
                 success: function (layero, index) {
-                    var body = layer.getChildFrame('body', index);
-                    body.find("#id").val(data.id);
                 },
                 end: function () {
                     renderTable()

+ 3 - 3
src/main/resources/static/page/myBorrow/ruditResult.html

@@ -74,21 +74,21 @@
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
 
-    layui.use(['form', 'http', 'laydate'], function () {
+    layui.use(['form', 'http', 'laydate','url'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
         var form = layui.form,
             layer = layui.layer,
             http = layui.http,
             laydate = layui.laydate,
             $ = layui.$;
-        let id = $('#id').val()
+        const urlParam = layui.url()
         /**方-------------------------------法-------------------------------定-------------------------------义*/
 
         // 加载数据
         let initData = function () {
             // 加载当前文档信息
             http.get('borrow/archiveBorrow/selectByPrimaryKey', {
-                id: id
+                id: urlParam.id
             }, false, function (res) {
                 if (res.code === 200){
 

+ 18 - 19
src/main/resources/static/page/role/edit.html

@@ -33,7 +33,6 @@
     </div>
 
 
-
     <div class="layui-form-item">
         <div class="layui-input-block">
             <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
@@ -44,37 +43,37 @@
 <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
-    layui.use(['form','http'], function () {
+    layui.use(['form', 'http', 'url'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
         var form = layui.form,
             layer = layui.layer,
             http = layui.http,
             $ = layui.$;
-        let id = $('#id').val()
+        const urlParam = layui.url()
 
         /**方-------------------------------法-------------------------------定-------------------------------义*/
 
 
-        //保存方法
+            //保存方法
         let save = function (data) {
-            http.post(id == '' ? 'system/role/insert': 'system/role/update',data,true,function (res) {
-                if (res.code == 200){
-                    let index = layer.alert('保存成功!', {
-                        title: id == '' ? '添加':'修改' + '信息'
-                    }, function () {
-                        // 关闭弹出层
-                        layer.close(index);
-                        let iframeIndex = parent.layer.getFrameIndex(window.name);
-                        parent.layer.close(iframeIndex);
-                    });
-                }
-            })
-        }
+                http.post(urlParam.id ? 'system/role/insert' : 'system/role/update', data, true, function (res) {
+                    if (res.code == 200) {
+                        let index = layer.alert('保存成功!', {
+                            title: urlParam.id == '' ? '添加' : '修改' + '信息'
+                        }, function () {
+                            // 关闭弹出层
+                            layer.close(index);
+                            let iframeIndex = parent.layer.getFrameIndex(window.name);
+                            parent.layer.close(iframeIndex);
+                        });
+                    }
+                })
+            }
 
         // 加载数据
         let initData = function () {
-            if(id != ''){
-                http.get('system/role/selectByPrimaryKey',{id: id},true,function (res) {
+            if (urlParam.id) {
+                http.get('system/role/selectByPrimaryKey', {id: urlParam.id}, true, function (res) {
                     form.val("addPaper", res.data);
                     form.render();
                 })

+ 56 - 29
src/main/resources/static/page/role/editRole.html

@@ -51,17 +51,15 @@
                     </div>
                 </div>
             </div>
-
-            <div class="layui-col-md4">
-                <label class="layui-form-label">是否可查看全部门</label>
-                <div class="layui-input-block">
-                    <select  id="bmqx-role" name="interest" lay-filter="aihao">
-                        <option value="1" selected="">否</option>
-                        <option value="0">是</option>
-                    </select>
+            <div class="layui-col-md3">
+                <div class="layui-card">
+                    <div class="layui-card-header"><i class="layui-icon layui-icon-star"></i>是否仅可见本部门</div>
+                    <div class="layui-input-block">
+                        <input type="radio" name="bmqx-role" value="0" title="是" checked="">
+                        <input type="radio" name="bmqx-role" value="1" title="否">
+                    </div>
                 </div>
             </div>
-
         </div>
     </div>
 </div>
@@ -75,21 +73,21 @@
 <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
-    layui.use(['form', 'http', 'tree', 'util'], function () {
+    layui.use(['form', 'http', 'tree', 'util', 'url'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
         var form = layui.form,
             layer = layui.layer,
             http = layui.http,
             tree = layui.tree,
             $ = layui.$;
-        let id = $('#id').val()
+        const urlParam = layui.url()
 
 
         /**方-------------------------------法-------------------------------定-------------------------------义*/
 
         let initTree = function () {
             http.get('system/role/selectRoleList', {
-                roleId: id
+                roleId: urlParam.id
             }, true, function (res) {
                 // 基本演示
                 tree.render({
@@ -119,7 +117,7 @@
         }
 
         let initMj = () => {
-            http.get('system/dict/selectMiJiRole', {roleId: id}, true, function (res) {
+            http.get('system/dict/selectMiJiRole', {roleId: urlParam.id}, true, function (res) {
                 tree.render({
                     elem: '#miji-role'
                     , data: res.data
@@ -128,8 +126,22 @@
                 });
             })
         }
+        let initdept = () => {
+            http.get('system/dict/selectDeptQx', {roleId: urlParam.id}, true, function (res) {
+                tree.render({
+                    elem: '#bmqx-role'
+                    , data: res.data
+                });
+                if (res.data == 1) {
+                    form.val('addPaper', {
+                        "bmqx-role": true //开关状态
+                    });
+                }
+            })
+
+        }
         let initArchiveTree = () => {
-            http.get('system/archivesTree/selectArchiveRole', {roleId: id}, true, function (res) {
+            http.get('system/archivesTree/selectArchiveRole', {roleId: urlParam.id}, true, function (res) {
                 tree.render({
                     elem: '#archive-tree-role'
                     , data: res.data
@@ -140,15 +152,15 @@
         }
 
         let initArchive = () => {
-            http.get('system/role/selectShowArchive', {roleId: id}, true, res => {
-               if (res.code == 200){
-                   tree.render({
-                       elem: '#archive-role'
-                       , data: res.data
-                       , showCheckbox: true  //是否显示复选框
-                       , id: 'archive-role'
-                   });
-               }
+            http.get('system/role/selectShowArchive', {roleId: urlParam.id}, true, res => {
+                if (res.code == 200) {
+                    tree.render({
+                        elem: '#archive-role'
+                        , data: res.data
+                        , showCheckbox: true  //是否显示复选框
+                        , id: 'archive-role'
+                    });
+                }
             })
 
         }
@@ -157,20 +169,25 @@
 
         //保存方法
         let save = function () {
-            console.log(document.getElementById("bmqx-role").value)
+                let i;
+            if(document.getElementsByName("bmqx-role")[0].checked){
+                i=document.getElementsByName("bmqx-role")[0].value
+            }else {
+                i=document.getElementsByName("bmqx-role")[1].value
+            }
             let data = {
-                roleId: id,
+                roleId: urlParam.id,
                 menuIds: getChecked_list(tree.getChecked("menu-role")),
                 mjCodes: getChecked_list(tree.getChecked("miji-role")),
                 archiveTrees: getChecked_list(tree.getChecked("archive-tree-role")),
                 archiveShow: getChecked_list(tree.getChecked("archive-role")),
-                bmqxRole:document.getElementById("bmqx-role").value
+                bmqxRole: i
             }
             console.log()
             http.post('system/role/setRole', data, true, function (res) {
                 if (res.code == 200) {
                     let index = layer.alert('保存成功!', {
-                        title: id == '' ? '添加' : '修改' + '信息'
+                        title: urlParam.id == '' ? '添加' : '修改' + '信息'
                     }, function () {
                         // 关闭弹出层
                         layer.close(index);
@@ -179,17 +196,27 @@
                     });
                 }
             })
-    }
+        }
 
         /**事-------------------------------件-------------------------------绑-------------------------------定*/
 
         initTree()
         initArchiveTree()
         initMj()
+        initdept()
+
+        var bmqxRole = 0
+        form.on('switch(switchTest)', function (data) {
+            if (this.checked) {
+                bmqxRole = 1
+            } else {
+                bmqxRole = 0
+            }
+        });
 
         //监听提交
         form.on('submit(saveBtn)', function (data) {
-             save(data.field)
+            save(data.field)
         });
 
     });

+ 63 - 59
src/main/resources/static/page/role/list.html

@@ -17,14 +17,14 @@
 
 <!--  头部工具栏  -->
 <script type="text/html" id="toolbar">
-<!--        <button class="layui-btn layui-btn-sm" lay-event="addPaper">添加</button>-->
+    <!--        <button class="layui-btn layui-btn-sm" lay-event="addPaper">添加</button>-->
 </script>
 
 <!-- 操作列 -->
 <script type="text/html" id="operating">
-<!--    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="setRole">设置权限</a>-->
-<!--    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>-->
-<!--    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>-->
+    <!--    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="setRole">设置权限</a>-->
+    <!--    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>-->
+    <!--    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>-->
 </script>
 
 </body>
@@ -33,7 +33,7 @@
 <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
 <script>
-    layui.use(['table','http'], function () {
+    layui.use(['table', 'http'], function () {
         /**变-------------------------------量-------------------------------定-------------------------------义*/
 
         var table = layui.table,
@@ -45,48 +45,48 @@
         http.getRoleButton(18)
         //数据加载方法
         let renderTable = function () {
-                // 加载表格数据
-                table.render({
-                    elem: '#paper-table',
-                    url: 'system/role/select',
-                    toolbar: '#toolbar', //开启头部工具栏,并为其绑定左侧模板
-                    defaultToolbar: ['filter', 'exports', 'print'],
-                    title: '用户数据表',
-                    page: {
-                        curr: curr
-                    },
-                    limit: 15,
-                    limits: [15, 30, 45, 60],
-                    request: {
-                        pageName: 'pageNum',
-                        limitName: 'pageSize'
-                    },
-                    response: {
-                        statusCode: 200 //重新规定成功的状态码为 200,table 组件默认为 0
-                    },
-                    parseData: function (res) {
-                        return {
-                            "code": res.code,
-                            "msg": res.msg,
-                            "count": res.data.total,
-                            "data": res.data.list
-                        }
-                    },
-                    done: function(res, curr1, count) {
-                        // $('th').css({'background-color': '#1aa094', 'color': '#fff','font-weight':'bold'})
-                        curr = curr1
-                    },
-                    cols: [[
-                        // {type: 'checkbox', fixed: 'left'}
-                        {type: 'numbers'},
-                        {field: 'roleName', title: '角色名称'},
-                        {field: 'remark', title: '角色描述'},
-                        {field: 'createTime', title: '创建时间'},
-                        {templet: '#operating', align: 'center', title: '操作'}
-                    ]]
-                });
+            // 加载表格数据
+            table.render({
+                elem: '#paper-table',
+                url: 'system/role/select',
+                toolbar: '#toolbar', //开启头部工具栏,并为其绑定左侧模板
+                defaultToolbar: ['filter', 'exports', 'print'],
+                title: '用户数据表',
+                page: {
+                    curr: curr
+                },
+                limit: 15,
+                limits: [15, 30, 45, 60],
+                request: {
+                    pageName: 'pageNum',
+                    limitName: 'pageSize'
+                },
+                response: {
+                    statusCode: 200 //重新规定成功的状态码为 200,table 组件默认为 0
+                },
+                parseData: function (res) {
+                    return {
+                        "code": res.code,
+                        "msg": res.msg,
+                        "count": res.data.total,
+                        "data": res.data.list
+                    }
+                },
+                done: function (res, curr1, count) {
+                    // $('th').css({'background-color': '#1aa094', 'color': '#fff','font-weight':'bold'})
+                    curr = curr1
+                },
+                cols: [[
+                    // {type: 'checkbox', fixed: 'left'}
+                    {type: 'numbers'},
+                    {field: 'roleName', title: '角色名称'},
+                    {field: 'remark', title: '角色描述'},
+                    {field: 'createTime', title: '创建时间'},
+                    {templet: '#operating', align: 'center', title: '操作'}
+                ]]
+            });
 
-            }
+        }
 
         //添加方法
         let addPaper = function () {
@@ -109,7 +109,7 @@
         //删除方法
         let delPaper = function (id) {
             layer.confirm('真的删除行么', function (index) {
-                http.delete('system/role/delete',{id: id},true,function (res) {
+                http.delete('system/role/delete', {id: id}, true, function (res) {
                     if (res.code == 200) {
                         layer.msg('删除成功', {
                             icon: 1,
@@ -127,7 +127,7 @@
             });
         }
 
-        let updPaper = function(id){
+        let updPaper = function (id) {
             layer.open({
                 title: '修改权限',
                 type: 2,
@@ -135,10 +135,8 @@
                 maxmin: true,
                 shadeClose: true,
                 area: ['100%', '100%'],
-                content: './edit.html',
+                content: './edit.html?id=' + id,
                 success: function (layero, index) {
-                    var body=layer.getChildFrame('body',index);
-                    body.find("#id").val(id);
                 },
                 end: function () {
                     renderTable()
@@ -146,7 +144,7 @@
             });
         }
 
-        let setRole = function(id){
+        let setRole = function (id) {
             layer.open({
                 title: '设置权限',
                 type: 2,
@@ -154,10 +152,8 @@
                 maxmin: true,
                 shadeClose: true,
                 area: ['100%', '100%'],
-                content: './editRole.html',
+                content: './editRole.html?id=' + id,
                 success: function (layero, index) {
-                    var body=layer.getChildFrame('body',index);
-                    body.find("#id").val(id);
                 },
                 end: function () {
                     renderTable()
@@ -171,16 +167,24 @@
         //头工具栏事件
         table.on('toolbar(paper-table)', function (obj) {
             switch (obj.event) {
-                case 'add': addPaper(); break;
+                case 'add':
+                    addPaper();
+                    break;
             }
         })
 
         //监听行工具事件
         table.on('tool(paper-table)', function (obj) {
             switch (obj.event) {
-                case 'delete': delPaper(obj.data.id); break;
-                case 'update': updPaper(obj.data.id); break;
-                case 'setRole': setRole(obj.data.id); break;
+                case 'delete':
+                    delPaper(obj.data.id);
+                    break;
+                case 'update':
+                    updPaper(obj.data.id);
+                    break;
+                case 'setRole':
+                    setRole(obj.data.id);
+                    break;
             }
         })
     });

+ 158 - 125
src/main/resources/static/page/statistics/archiveStatistics.html

@@ -1,145 +1,178 @@
 <!DOCTYPE html>
 <html lang="en">
-<head>
-    <meta charset="UTF-8">
+  <head>
+    <meta charset="UTF-8" />
     <title>Title</title>
-    <link rel="stylesheet" href="../../lib/layui-v2.5.5/css/layui.css" media="all">
-    <link rel="stylesheet" href="../../css/public.css" media="all">
-</head>
-<style>
-</style>
-<body>
-<div class="layuimini-container">
-    <div class="layuimini-main">
+    <link
+      rel="stylesheet"
+      href="../../lib/layui-v2.5.5/css/layui.css"
+      media="all"
+    />
+    <link rel="stylesheet" href="../../css/public.css" media="all" />
+  </head>
+  <style></style>
+  <body>
+    <div class="layuimini-container">
+      <div class="layuimini-main">
         <div>
-            <div class="layui-form toolbar">
-                <div class="layui-form-item">
-                    <div class="layui-form-item">
-                        <div class="layui-inline" style="width: 300px;">
-                            <input name="time" id="time" class="layui-input" placeholder="请选择统计时间段" readonly>
-                        </div>
-                        <div class="layui-inline">
-                            <input type="text" name="ml" lay-filter="ml" id="ml" class="layui-input">
-                        </div>
-                        <div class="layui-inline">
-                            <button id="btnSearch" lay-submit lay-filter="search" class="layui-btn icon-btn"><i
-                                    class="layui-icon"></i>搜索
-                            </button>
-                        </div>
-                    </div>
+          <div class="layui-form toolbar">
+            <div class="layui-form-item">
+              <div class="layui-form-item">
+                <div class="layui-inline" style="width: 300px">
+                  <input
+                    name="time"
+                    id="time"
+                    class="layui-input"
+                    placeholder="请选择统计时间段"
+                    readonly
+                  />
                 </div>
+                <div class="layui-inline">
+                  <input
+                    type="text"
+                    name="ml"
+                    lay-filter="ml"
+                    id="ml"
+                    class="layui-input"
+                  />
+                </div>
+                <div class="layui-inline">
+                  <button
+                    id="btnSearch"
+                    lay-submit
+                    lay-filter="search"
+                    class="layui-btn icon-btn"
+                  >
+                    <i class="layui-icon"></i>搜索
+                  </button>
+                </div>
+                <div class="layui-inline">
+                  <button
+                    onclick="printPage('\[lay-id=table\]')"
+                    lay-filter="search"
+                    class="layui-btn icon-btn"
+                  >
+                    <i class="layui-icon layui-icon-print"></i>打印
+                  </button>
+                </div>
+              </div>
             </div>
-            <table class="layui-hide" id="table" lay-filter="table"></table>
+          </div>
+          <table class="layui-hide" id="table" lay-filter="table"></table>
         </div>
+      </div>
     </div>
-</div>
-</body>
+  </body>
 </html>
 <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
+<script src="../../js/utils.js" charset="utf-8"></script>
 <script>
-    layui.use(['treetable', 'http', 'treeSelect', 'laydate', 'form'], function () {
-        let searchParam = {}
-
-        // 加载日期控件
-        layui.laydate.render({
-            elem: '#time',
-            type: 'datetime',
-            trigger: 'click',
-            range: true
-            // value: new Date()
-        });
-
-        // 加载树形下拉框控件
-        layui.treeSelect.render({
-            // 选择器
-            elem: '#ml',
-            // 数据
-            data: 'system/archivesTree/selectTree',
-            // 异步加载方式:get/post,默认get
-            type: 'get',
-            // 占位符
-            placeholder: '请选择门类',
-            // 是否开启搜索功能:true/false,默认false
-            search: true,
-            // 一些可定制的样式
-            style: {
-                folder: {
-                    enable: true
-                },
-                line: {
-                    enable: true
-                }
-            }
-        });
-
+  layui.use(
+    ["treetable", "http", "treeSelect", "laydate", "form"],
+    function () {
+      let searchParam = {};
 
-        let renderTable = function () {
-            layui.treetable.render({
-                treeColIndex: 1,
-                treeSpid: -1,
-                treeIdName: 'id',
-                treePidName: 'parentId',
-                // toolbar: '#toolbar',
-                elem: '#table',
-                url: 'statistics/selectStatisticsByType',
-                page: false,
-                totalRow: true,
-                where: searchParam,
-                cols: [[
-                    {type: 'numbers'},
-                    {field: 'title', title: '门类/属类', totalRowText: '合计'},
-                    {field: 'code', title: '编码'},
-                    {field: 'archiveCount', title: '归档案卷数', totalRow: true},
-                    {field: 'fileCount', title: '归档文件数', totalRow: true},
-                    {field: 'space', title: '占用磁盘大小', totalRow: true}
-                    // {templet: '#operating', width: 120, align: 'center', title: '操作'}
-                ]],
-                done: function (res, curr, count) {
-                    console.log(res, curr, count)
-                    let archiveCount = 0,
-                        fileCount = 0
-                    res.data.forEach(item => {
-                        if (item.pid === -1) {
-                            archiveCount += item.archiveCount
-                            fileCount += item.fileCount
-                        }
-                    })
-                    console.log(archiveCount, fileCount)
-                    // $('th').css({'background-color': '#1aa094', 'color': '#fff','font-weight':'bold'})
-                    layer.closeAll('loading');
-                    var divArr = layui.$(".layui-table-total div.layui-table-cell");
-                    layui.$.each(divArr, function (index, item) {
-                        var _div = layui.$(item);
-                        if (index === 3) {
-                            _div.html(archiveCount);
-                        } else if (index === 4) {
-                            _div.html(fileCount);
-                        }
+      // 加载日期控件
+      layui.laydate.render({
+        elem: "#time",
+        type: "datetime",
+        trigger: "click",
+        range: true,
+        // value: new Date()
+      });
 
-                        // var content = _div.html();
-                        // content = content.replace(".00", "");
+      // 加载树形下拉框控件
+      layui.treeSelect.render({
+        // 选择器
+        elem: "#ml",
+        // 数据
+        data: "system/archivesTree/selectTree",
+        // 异步加载方式:get/post,默认get
+        type: "get",
+        // 占位符
+        placeholder: "请选择门类",
+        // 是否开启搜索功能:true/false,默认false
+        search: true,
+        // 一些可定制的样式
+        style: {
+          folder: {
+            enable: true,
+          },
+          line: {
+            enable: true,
+          },
+        },
+      });
 
-                    });
-                }
+      let renderTable = function () {
+        layui.treetable.render({
+          treeColIndex: 1,
+          treeSpid: -1,
+          treeIdName: "id",
+          treePidName: "parentId",
+          // toolbar: '#toolbar',
+          elem: "#table",
+          url: "statistics/selectStatisticsByType",
+          page: false,
+          totalRow: true,
+          where: searchParam,
+          cols: [
+            [
+              { type: "numbers" },
+              { field: "title", title: "门类/属类", totalRowText: "合计" },
+              { field: "code", title: "编码" },
+              { field: "archiveCount", title: "归档案卷数", totalRow: true },
+              { field: "fileCount", title: "归档文件数", totalRow: true },
+              { field: "space", title: "占用磁盘大小", totalRow: true },
+              // {templet: '#operating', width: 120, align: 'center', title: '操作'}
+            ],
+          ],
+          done: function (res, curr, count) {
+            // console.log(res, curr, count)
+            let archiveCount = 0,
+              fileCount = 0,
+              sumSpace = null;
+            res.data.forEach((item) => {
+              if (item.pid === -1) {
+                archiveCount += item.archiveCount;
+                fileCount += item.fileCount;
+              }
+              sumSpace = item.sumSpace;
             });
-        }
-
-
-        renderTable()
-
+            console.log(11, archiveCount, fileCount);
+            // $('th').css({'background-color': '#1aa094', 'color': '#fff','font-weight':'bold'})
+            layer.closeAll("loading");
+            var divArr = layui.$(".layui-table-total div.layui-table-cell");
+            layui.$.each(divArr, function (index, item) {
+              var _div = layui.$(item);
+              if (index === 3) {
+                _div.html(archiveCount);
+              } else if (index === 4) {
+                _div.html(fileCount);
+              } else if (index === 5) {
+                _div.html(sumSpace);
+              }
 
-        layui.form.on('submit(search)', function (data) {
-            searchParam = data.field
-            var selectedNodes = layui.treeSelect.zTree('ml').getSelectedNodes();
-            if (selectedNodes.length > 0) {
-                searchParam.ml = selectedNodes[0].id
-            } else {
-                searchParam.ml = null
-            }
-            renderTable()
-        })
+              // var content = _div.html();
+              // content = content.replace(".00", "");
+            });
+          },
+        });
+      };
 
+      renderTable();
 
-    })
+      layui.form.on("submit(search)", function (data) {
+        searchParam = data.field;
+        var selectedNodes = layui.treeSelect.zTree("ml").getSelectedNodes();
+        if (selectedNodes.length > 0) {
+          searchParam.ml = selectedNodes[0].id;
+        } else {
+          searchParam.ml = null;
+        }
+        renderTable();
+      });
+    }
+  );
 </script>

+ 190 - 119
src/main/resources/static/page/statistics/archiveYearStatistics.html

@@ -1,139 +1,210 @@
 <!DOCTYPE html>
 <html lang="en">
-<head>
-    <meta charset="UTF-8">
+  <head>
+    <meta charset="UTF-8" />
     <title>Title</title>
-    <link rel="stylesheet" href="../../lib/layui-v2.5.5/css/layui.css" media="all">
-    <link rel="stylesheet" href="../../css/public.css" media="all">
-</head>
-<style>
-</style>
-<body>
-<div class="layuimini-container">
-    <div class="layuimini-main">
+    <link
+      rel="stylesheet"
+      href="../../lib/layui-v2.5.5/css/layui.css"
+      media="all"
+    />
+    <link rel="stylesheet" href="../../css/public.css" media="all" />
+  </head>
+  <style>
+  </style>
+
+  <body>
+    <div class="layuimini-container">
+      <div class="layuimini-main">
         <div>
-            <div class="layui-form toolbar">
-                <div class="layui-form-item">
-                    <div class="layui-form-item">
-                        <div class="layui-inline" style="width: 300px;">
-                            <input name="time" id="time" class="layui-input" placeholder="请选择统计时间段" readonly>
-                        </div>
-                        <div class="layui-inline">
-                            <input type="text" name="ml" lay-filter="ml" id="ml" class="layui-input">
-                        </div>
-                        <div class="layui-inline">
-                            <button id="btnSearch" lay-submit lay-filter="search" class="layui-btn icon-btn"><i
-                                    class="layui-icon"></i>搜索
-                            </button>
-                        </div>
-                    </div>
+          <div class="layui-form toolbar">
+            <div class="layui-form-item">
+              <div class="layui-form-item">
+                <div class="layui-inline" style="width: 300px">
+                  <input
+                    name="time"
+                    id="time"
+                    class="layui-input"
+                    placeholder="请选择统计时间段"
+                    readonly
+                  />
+                </div>
+                <div class="layui-inline">
+                  <input
+                    type="text"
+                    name="ml"
+                    lay-filter="ml"
+                    id="ml"
+                    class="layui-input"
+                  />
+                </div>
+                <div class="layui-inline">
+                  <select name="bgqx" id="bgqx"></select>
                 </div>
+                <div class="layui-inline">
+                  <button
+                    id="btnSearch"
+                    lay-submit
+                    lay-filter="search"
+                    class="layui-btn icon-btn"
+                  >
+                    <i class="layui-icon"></i>搜索
+                  </button>
+                </div>
+                <div class="layui-inline">
+                  <button
+                    onclick="printPage('\[lay-id=table\]')"
+                    lay-filter="search"
+                    class="layui-btn icon-btn"
+                  >
+                    <i class="layui-icon layui-icon-print"></i>打印
+                  </button>
+                </div>
+              </div>
             </div>
-            <table class="layui-hide" id="table" lay-filter="table"></table>
+          </div>
+          <table class="layui-hide" id="table" lay-filter="table"></table>
         </div>
+      </div>
     </div>
-</div>
-</body>
+  </body>
 </html>
 <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
-<script>
-    layui.use(['table', 'http', 'treeSelect', 'laydate', 'form'], function () {
-        let searchParam = {}
+<script src="../../js/utils.js" charset="utf-8"></script>
 
-        layui.laydate.render({
-            elem: '#time',
-            type: 'year',
-            trigger: 'click',
-            range: true
-            // value: new Date()
-        });
+<script>
+  layui.use(["table", "http", "treeSelect", "laydate", "form"], function () {
+    let searchParam = {};
+    var table = layui.table,
+      laydate = layui.laydate,
+      http = layui.http,
+      form = layui.form,
+      tree = layui.tree,
+      upload = layui.upload,
+      url = layui.url,
+      $ = layui.jquery;
+    layui.laydate.render({
+      elem: "#time",
+      type: "year",
+      trigger: "click",
+      range: true,
+      // value: new Date()
+    });
 
+    // 加载下拉框
+    layui.treeSelect.render({
+      // 选择器
+      elem: "#ml",
+      // 数据
+      data: "system/archivesTree/selectTree",
+      // 异步加载方式:get/post,默认get
+      type: "get",
+      // 占位符
+      placeholder: "请选择门类",
+      // 是否开启搜索功能:true/false,默认false
+      search: true,
+      // 一些可定制的样式
+      style: {
+        folder: {
+          enable: true,
+        },
+        line: {
+          enable: true,
+        },
+      },
+    });
 
-        // 加载下拉框
-        layui.treeSelect.render({
-            // 选择器
-            elem: '#ml',
-            // 数据
-            data: 'system/archivesTree/selectTree',
-            // 异步加载方式:get/post,默认get
-            type: 'get',
-            // 占位符
-            placeholder: '请选择门类',
-            // 是否开启搜索功能:true/false,默认false
-            search: true,
-            // 一些可定制的样式
-            style: {
-                folder: {
-                    enable: true
-                },
-                line: {
-                    enable: true
-                }
+    let renderTable = function () {
+      // 加载表格数据
+      layui.table.render({
+        elem: "#table",
+        url: "statistics/selectArchiveYearStatistics",
+        title: "统计表",
+        limit: 15,
+        limits: [15, 30, 45, 60],
+        page: false,
+        where: searchParam,
+        totalRow: true,
+        request: {
+          pageName: "pageNum",
+          limitName: "pageSize",
+        },
+        response: {
+          statusCode: 200, //重新规定成功的状态码为 200,table 组件默认为 0
+        },
+        parseData: function (res) {
+          return {
+            code: res.code,
+            msg: res.msg,
+            // "count": res.data.,
+            data: res.data,
+          };
+        },
+        done: function (res, curr, count) {
+          let lm = null;
+          res.data.forEach((item) => {
+            lm = item.sumSpace;
+          });
+          // $('th').css({'background-color': '#1aa094', 'color': '#fff','font-weight':'bold'})
+          var divArr = layui.$(".layui-table-total div.layui-table-cell");
+          layui.$.each(divArr, function (index, item) {
+            var _div = layui.$(item);
+            var content = _div.html();
+            content = content.replace(".00", "");
+            _div.html(content);
+            if (index === 4) {
+              _div.html(lm);
             }
-        });
+          });
+        },
+        cols: [
+          [
+            { type: "numbers" },
+            { field: "gdnd", title: "年份", totalRowText: "合计" },
+            { field: "archiveCount", title: "归档案卷数", totalRow: true },
+            { field: "fileCount", title: "归档文件数", totalRow: true },
+            { field: "space", title: "占用磁盘大小", totalRow: true },
+            // {templet: '#operating', align: 'center', title: '操作', width: 300}
+          ],
+        ],
+      });
+    };
 
+    renderTable();
 
-        let renderTable = function () {
-            // 加载表格数据
-            layui.table.render({
-                elem: '#table',
-                url: 'statistics/selectArchiveYearStatistics',
-                title: '统计表',
-                limit: 15,
-                limits: [15, 30, 45, 60],
-                page: false,
-                where: searchParam,
-                totalRow: true,
-                request: {
-                    pageName: 'pageNum',
-                    limitName: 'pageSize'
-                },
-                response: {
-                    statusCode: 200 //重新规定成功的状态码为 200,table 组件默认为 0
-                },
-                parseData: function (res) {
-                    return {
-                        "code": res.code,
-                        "msg": res.msg,
-                        // "count": res.data.,
-                        "data": res.data
-                    }
-                },
-                done: function (res, curr, count) {
-                    // $('th').css({'background-color': '#1aa094', 'color': '#fff','font-weight':'bold'})
-                    var divArr = layui.$(".layui-table-total div.layui-table-cell");
-                    layui.$.each(divArr,function (index,item) {
-                        var _div = layui.$(item);
-                        var content = _div.html();
-                        content = content.replace(".00","");
-                        _div.html(content);
-                    });
-                },
-                cols: [[
-                    {type: 'numbers'},
-                    {field: 'gdnd', title: '年份', totalRowText: '合计'},
-                    {field: 'archiveCount', title: '归档案卷数', totalRow: true},
-                    {field: 'fileCount', title: '归档文件数', totalRow: true},
-                    {field: 'space', title: '占用磁盘大小', totalRow: true},
-                    // {templet: '#operating', align: 'center', title: '操作', width: 300}
-                ]]
-            });
+    function initBgqx() {
+      http.get(
+        "system/dict/selectDictByCode",
+        { code: "BAOGUANQIXIANYI" },
+        false,
+        function (res) {
+          let html = "";
+          for (let i in res.data) {
+            html +=
+              '<option value="' +
+              res.data[i].dictCode +
+              '">' +
+              res.data[i].dictName +
+              "</option>";
+          }
+          $("#bgqx").html('<option value="">请选择保管期限</option>');
+          $("#bgqx").append(html);
+          form.render(); //菜单渲染 把内容加载进去
         }
+      );
+    }
+    initBgqx();
 
-        renderTable()
-
-        layui.form.on('submit(search)', function (data) {
-            searchParam = data.field
-            var selectedNodes = layui.treeSelect.zTree('ml').getSelectedNodes();
-            if (selectedNodes.length > 0) {
-                searchParam.ml = selectedNodes[0].id
-            } else {
-                searchParam.ml = null
-            }
-            renderTable()
-        })
-
-
-    })
+    layui.form.on("submit(search)", function (data) {
+      searchParam = data.field;
+      var selectedNodes = layui.treeSelect.zTree("ml").getSelectedNodes();
+      if (selectedNodes.length > 0) {
+        searchParam.ml = selectedNodes[0].id;
+      } else {
+        searchParam.ml = null;
+      }
+      renderTable();
+    });
+  });
 </script>

+ 163 - 126
src/main/resources/static/page/statistics/borrowStatistics.html

@@ -1,146 +1,183 @@
 <!DOCTYPE html>
 <html lang="en">
-<head>
-    <meta charset="UTF-8">
+  <head>
+    <meta charset="UTF-8" />
     <title>Title</title>
-    <link rel="stylesheet" href="../../lib/layui-v2.5.5/css/layui.css" media="all">
-    <link rel="stylesheet" href="../../css/public.css" media="all">
-</head>
-<style>
-</style>
-<body>
-<div class="layuimini-container">
-    <div class="layuimini-main">
+    <link
+      rel="stylesheet"
+      href="../../lib/layui-v2.5.5/css/layui.css"
+      media="all"
+    />
+    <link rel="stylesheet" href="../../css/public.css" media="all" />
+  </head>
+  <style></style>
+  <body>
+    <div class="layuimini-container">
+      <div class="layuimini-main">
         <div>
-            <div class="layui-form toolbar">
-                <div class="layui-form-item">
-                    <div class="layui-form-item">
-                        <div class="layui-inline">
-                            <input type="text" name="gjz" lay-filter="gjz" id="gjz" class="layui-input" placeholder="请输入档号或题名">
-                        </div>
-                        <div class="layui-inline">
-                            <input type="text" name="ml" lay-filter="ml" id="ml" class="layui-input">
-                        </div>
-                        <div class="layui-inline" style="width: 300px;">
-                            <input name="time" id="time" class="layui-input" placeholder="请选择统计时间段" readonly>
-                        </div>
-                        <div class="layui-inline">
-                            <button id="btnSearch" lay-submit lay-filter="search" class="layui-btn icon-btn"><i
-                                    class="layui-icon"></i>搜索
-                            </button>
-                        </div>
-                    </div>
+          <div class="layui-form toolbar">
+            <div class="layui-form-item">
+              <div class="layui-form-item">
+                <div class="layui-inline">
+                  <input
+                    type="text"
+                    name="gjz"
+                    lay-filter="gjz"
+                    id="gjz"
+                    class="layui-input"
+                    placeholder="请输入档号或题名"
+                  />
                 </div>
+                <div class="layui-inline">
+                  <input
+                    type="text"
+                    name="ml"
+                    lay-filter="ml"
+                    id="ml"
+                    class="layui-input"
+                  />
+                </div>
+                <div class="layui-inline" style="width: 300px">
+                  <input
+                    name="time"
+                    id="time"
+                    class="layui-input"
+                    placeholder="请选择统计时间段"
+                    readonly
+                  />
+                </div>
+                <div class="layui-inline">
+                  <button
+                    id="btnSearch"
+                    lay-submit
+                    lay-filter="search"
+                    class="layui-btn icon-btn"
+                  >
+                    <i class="layui-icon"></i>搜索
+                  </button>
+                </div>
+
+                <div class="layui-inline">
+                  <button
+                    onclick="printPage('\[lay-id=table\]')"
+                    lay-filter="search"
+                    class="layui-btn icon-btn"
+                  >
+                    <i class="layui-icon layui-icon-print"></i>打印
+                  </button>
+                </div>
+              </div>
             </div>
-            <table class="layui-hide" id="table" lay-filter="table"></table>
+          </div>
+          <table class="layui-hide" id="table" lay-filter="table"></table>
         </div>
+      </div>
     </div>
-</div>
-</body>
+  </body>
 </html>
 <script src="../../lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
 <script src="../../js/lay-config.js?v=1.0.4" charset="utf-8"></script>
+<script src="../../js/utils.js" charset="utf-8"></script>
 <script>
-    layui.use(['treetable', 'http', 'laydate', 'form', 'treeSelect'], function () {
+  layui.use(
+    ["treetable", "http", "laydate", "form", "treeSelect"],
+    function () {
+      let searchParam = {};
 
-        let searchParam = {}
+      layui.laydate.render({
+        elem: "#time",
+        type: "datetime",
+        trigger: "click",
+        range: true,
+        // value: new Date()
+      });
 
-        layui.laydate.render({
-            elem: '#time',
-            type: 'datetime',
-            trigger: 'click',
-            range: true
-            // value: new Date()
-        });
+      // 加载下拉框
+      layui.treeSelect.render({
+        // 选择器
+        elem: "#ml",
+        // 数据
+        data: "system/archivesTree/selectTree",
+        // 异步加载方式:get/post,默认get
+        type: "get",
+        // 占位符
+        placeholder: "请选择门类",
+        // 是否开启搜索功能:true/false,默认false
+        search: true,
+        // 一些可定制的样式
+        style: {
+          folder: {
+            enable: true,
+          },
+          line: {
+            enable: true,
+          },
+        },
+      });
 
-        // 加载下拉框
-        layui.treeSelect.render({
-            // 选择器
-            elem: '#ml',
-            // 数据
-            data: 'system/archivesTree/selectTree',
-            // 异步加载方式:get/post,默认get
-            type: 'get',
-            // 占位符
-            placeholder: '请选择门类',
-            // 是否开启搜索功能:true/false,默认false
-            search: true,
-            // 一些可定制的样式
-            style: {
-                folder: {
-                    enable: true
-                },
-                line: {
-                    enable: true
-                }
-            }
+      let renderTable = function () {
+        layui.table.render({
+          elem: "#table",
+          url: "statistics/selectBorrowStatistics",
+          title: "统计表",
+          limit: 15,
+          limits: [15, 30, 45, 60],
+          page: false,
+          request: {
+            pageName: "pageNum",
+            limitName: "pageSize",
+          },
+          totalRow: true,
+          where: searchParam,
+          response: {
+            statusCode: 200, //重新规定成功的状态码为 200,table 组件默认为 0
+          },
+          parseData: function (res) {
+            return {
+              code: res.code,
+              msg: res.msg,
+              // "count": res.data.,
+              data: res.data,
+            };
+          },
+          done: function (res, curr, count) {
+            // $('th').css({'background-color': '#1aa094', 'color': '#fff','font-weight':'bold'})
+            var divArr = layui.$(".layui-table-total div.layui-table-cell");
+            layui.$.each(divArr, function (index, item) {
+              var _div = layui.$(item);
+              var content = _div.html();
+              content = content.replace(".00", "");
+              _div.html(content);
+            });
+          },
+          cols: [
+            [
+              { type: "numbers" },
+              { field: "dh", title: "档号", totalRowText: "合计" },
+              { field: "tm", title: "题名" },
+              { field: "ml", title: "门类/属类" },
+              // {field: 'createTime', title: '最后借阅时间'},
+              // {field: 'estimateReturnTime',  title: '预计归还时间'},
+              // {field: 'returnTime',  title: '实际归还时间'},
+              { field: "borrowCount", title: "借阅次数", totalRow: true },
+              // {templet: '#operating', align: 'center', title: '操作', width: 300}
+            ],
+          ],
         });
+      };
 
+      renderTable();
 
-        let renderTable = function () {
-
-            layui.table.render({
-                elem: '#table',
-                url: 'statistics/selectBorrowStatistics',
-                title: '统计表',
-                limit: 15,
-                limits: [15, 30, 45, 60],
-                page: false,
-                request: {
-                    pageName: 'pageNum',
-                    limitName: 'pageSize'
-                },
-                totalRow: true,
-                where: searchParam,
-                response: {
-                    statusCode: 200 //重新规定成功的状态码为 200,table 组件默认为 0
-                },
-                parseData: function (res) {
-                    return {
-                        "code": res.code,
-                        "msg": res.msg,
-                        // "count": res.data.,
-                        "data": res.data
-                    }
-                },
-                done: function (res, curr, count) {
-                    // $('th').css({'background-color': '#1aa094', 'color': '#fff','font-weight':'bold'})
-                    var divArr = layui.$(".layui-table-total div.layui-table-cell");
-                    layui.$.each(divArr,function (index,item) {
-                        var _div = layui.$(item);
-                        var content = _div.html();
-                        content = content.replace(".00","");
-                        _div.html(content);
-                    });
-                },
-                cols: [[
-                    {type: 'numbers'},
-                    {field: 'dh', title: '档号', totalRowText: '合计'},
-                    {field: 'tm', title: '题名'},
-                    {field: 'ml', title: '门类/属类'},
-                    // {field: 'createTime', title: '最后借阅时间'},
-                    // {field: 'estimateReturnTime',  title: '预计归还时间'},
-                    // {field: 'returnTime',  title: '实际归还时间'},
-                    {field: 'borrowCount', title: '借阅次数', totalRow: true},
-                    // {templet: '#operating', align: 'center', title: '操作', width: 300}
-                ]]
-            });
-
+      layui.form.on("submit(search)", function (data) {
+        searchParam = data.field;
+        var selectedNodes = layui.treeSelect.zTree("ml").getSelectedNodes();
+        if (selectedNodes.length > 0) {
+          searchParam.ml = selectedNodes[0].id;
+        } else {
+          searchParam.ml = null;
         }
-
-        renderTable()
-
-
-        layui.form.on('submit(search)', function (data) {
-            searchParam = data.field
-            var selectedNodes = layui.treeSelect.zTree('ml').getSelectedNodes();
-            if (selectedNodes.length > 0) {
-                searchParam.ml = selectedNodes[0].id
-            } else {
-                searchParam.ml = null
-            }
-            renderTable()
-        })
-
-    })
+        renderTable();
+      });
+    }
+  );
 </script>

+ 4 - 10
src/test/java/com/gz/ConverOldSystemData.java

@@ -2,30 +2,24 @@ package com.gz;
 
 import cn.hutool.core.io.FileTypeUtil;
 import cn.hutool.core.io.FileUtil;
-import cn.hutool.core.io.IORuntimeException;
 import cn.hutool.core.io.IoUtil;
-import cn.hutool.core.util.CharsetUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSON;
 import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
-import cn.hutool.poi.excel.ExcelUtil;
-import cn.hutool.poi.excel.ExcelWriter;
 import com.gz.dto.archive.ArchiveDTO;
 import com.itextpdf.text.Document;
 import com.itextpdf.text.DocumentException;
 import com.itextpdf.text.Image;
 import com.itextpdf.text.Rectangle;
 import com.itextpdf.text.pdf.PdfWriter;
-import com.sun.corba.se.spi.ior.iiop.IIOPFactories;
-import com.sun.xml.internal.org.jvnet.fastinfoset.stax.LowLevelFastInfosetStreamWriter;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.poi.util.IOUtils;
 
-import javax.imageio.ImageIO;
-import java.awt.image.BufferedImage;
-import java.io.*;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
 import java.net.MalformedURLException;
 import java.nio.charset.Charset;
 import java.util.ArrayList;

+ 56 - 0
src/test/java/com/gz/HandleSource.java

@@ -0,0 +1,56 @@
+package com.gz;
+
+import cn.hutool.core.io.FileUtil;
+import cn.hutool.core.map.MapUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.poi.excel.ExcelReader;
+import cn.hutool.poi.excel.ExcelUtil;
+import com.gz.dto.archive.ArchiveDTO;
+import com.gz.mapper.archive.ArchiveMapper;
+import com.gz.rvo.archive.ArchiveRVO;
+import com.gz.service.archive.ArchiveService;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+import tk.mybatis.mapper.entity.Example;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+@SpringBootTest
+public class HandleSource {
+
+    @Resource
+    private ArchiveService archiveService;
+
+    @Resource
+    private ArchiveMapper archiveMapper;
+
+    @Test
+    public void run() {
+        ExcelReader reader = ExcelUtil.getReader(FileUtil.file("C:\\Users\\ljw\\Desktop\\a.xlsx"));
+        List<Map<String, Object>> maps = reader.readAll();
+
+        for (Map<String, Object> map : maps) {
+            String dh = MapUtil.getStr(map, "a");
+            String ly = MapUtil.getStr(map, "b");
+            String xzqh = MapUtil.getStr(map, "c");
+            String bq = MapUtil.getStr(map, "d");
+
+            if (StrUtil.isNotBlank(bq)) {
+                System.out.println(bq);
+            }
+
+            ArchiveDTO archiveDTO = new ArchiveDTO();
+            archiveDTO.setDh(dh);
+            archiveDTO.setLy(ly);
+            archiveDTO.setXzqh(xzqh);
+            archiveDTO.setBq(bq);
+
+            Example dhParam = new Example(ArchiveDTO.class);
+            dhParam.createCriteria().andEqualTo("dh", dh);
+            archiveMapper.updateByExampleSelective(archiveDTO, dhParam);
+        }
+    }
+}

+ 60 - 0
src/test/java/com/gz/WatermarkPdf.java

@@ -0,0 +1,60 @@
+package com.gz;
+
+import org.apache.pdfbox.pdmodel.PDDocument;
+import org.apache.pdfbox.pdmodel.PDPage;
+import org.apache.pdfbox.pdmodel.PDPageContentStream;
+import org.apache.pdfbox.pdmodel.PDResources;
+import org.apache.pdfbox.pdmodel.font.PDFont;
+import org.apache.pdfbox.pdmodel.font.PDType0Font;
+import org.apache.pdfbox.pdmodel.graphics.state.PDExtendedGraphicsState;
+import org.apache.pdfbox.util.Matrix;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+
+public class WatermarkPdf {
+
+
+    public static void main(String[] args) throws IOException {
+        File pdfFile = new File("F:\\错误\\5179-WS2020-001-0000-1145.pdf");
+        //打开pdf文件
+        PDDocument pdf = PDDocument.load(pdfFile);
+        pdf.setAllSecurityToBeRemoved(true);
+        for (PDPage page : pdf.getPages()) {
+            PDPageContentStream cs = new PDPageContentStream(pdf, page, PDPageContentStream.AppendMode.APPEND, true, true);
+            String ts = "刘长兰";
+            //引入字体文件 解决中文汉字乱码问题
+            PDFont font = PDType0Font.load(pdf, new FileInputStream("C:\\Windows\\Fonts\\STLITI.TTF"), true);
+            float fontSize = 26;
+            PDResources resources = page.getResources();
+            PDExtendedGraphicsState r0 = new PDExtendedGraphicsState();
+            // 水印透明度
+            r0.setNonStrokingAlphaConstant(0.2f);
+            r0.setAlphaSourceFlag(true);
+            cs.setGraphicsStateParameters(r0);
+            //水印颜色
+            cs.setNonStrokingColor(153, 153, 153);
+            cs.beginText();
+            cs.setFont(font, fontSize);
+            //根据水印文字大小长度计算横向坐标需要渲染几次水印
+            float h = ts.length() * fontSize;
+            for (int i = 0; i <= 5; i++) {
+                // 获取旋转实例
+                cs.setTextMatrix(Matrix.getRotateInstance(-150, i * 220, 0));
+                cs.showText(ts);
+                for (int j = 0; j < 10; j++) {
+                    cs.setTextMatrix(Matrix.getRotateInstance(-150, i * 220, j * h * 2));
+                    cs.showText(ts);
+                }
+            }
+            cs.endText();
+            cs.restoreGraphicsState();
+            cs.close();
+            pdf.save("F:\\Watermark.pdf");
+        }
+
+    }
+
+
+}