多单位版国产化地质资料管理系统
zhai
2025-11-17 378d576468f1378179a8a184e78b8aa6309edc0f
广海地质资料系统
2 文件已重命名
35个文件已修改
187个文件已添加
2个文件已删除
46117 ■■■■■ 已修改文件
pom.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/common/ArchivesCustomConfig.java 289 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/common/BarcodeGenerator.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/common/EsAttachIndexBuildJob.java 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/common/PdfUtil.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/common/TscUtil.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/common/UsbSyncExampleWindowsItem.java 113 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/common/XmlUtil.java 173 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/common/ZipUtil.java 137 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/config/ArchivesCustomConfig.java 209 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/config/RestHighLevelConfig.java 122 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/ArchivesCustomConfigController.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/ArchivesManageController.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/BorrowController.java 657 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/CatAjjxxController.java 575 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/CatYswjxxController.java 417 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/CommonController.java 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/FileViewController.java 546 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/GdMisManageController.java 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/ImportExcelController.java 307 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/ImportExcelSuController.java 221 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/LabelController.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/PhysicalController.java 591 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/ScanPrintController.java 180 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/SearchController.java 708 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/TapeController.java 289 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/UtilizationUserController.java 357 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/controller/UtlStatisticsController.java 504 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/dao/BorrowDetailMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/dao/BorrowFormMapper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/dao/CatCgwjxxMapper.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/dao/CatCheckMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/dao/CatSwyxxxMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/dao/CheckQuestionMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/dao/PackingManageMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/dao/PhysicalDetailMapper.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/dao/PhysicalFormMapper.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/BorrowDetail.java 446 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/BorrowForm.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/CatAjjxx.java 296 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/CatCgwjxx.java 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/CatCheck.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/CatKc.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/CatSmxx.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/CatSwyxxx.java 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/CatTfxx.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/CatXzq.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/CatYswjxx.java 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/CatZkxx.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/CheckQuestion.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/PackingManage.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/PhysicalDetail.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/PhysicalForm.java 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/entity/UtilizationUser.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/vo/BorrowInfo.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/vo/ParentBorrowInfo.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/vo/ParentPhysicalInfo.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/vo/PhysicalInfo.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/data/vo/UserInfo.java 438 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/operate/CatAjjxxOperate.java 415 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/operate/CatYswjxxOperate.java 332 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/operate/TapeOperate.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/operate/TransferOperate.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/operate/UtilizationFormFlowListener.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/BorrowDetailService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/BorrowFormService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/CatCgwjxxService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/CatCheckService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/CatSwyxxxService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/CatYswjxxService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/CheckQuestionService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/PackingManageService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/PhysicalDetailService.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/PhysicalFormService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/ReadXml2017Service.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/ReadXml2023Service.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/ReadXmlService.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/XmlService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/impl/BorrowDetailServiceImpl.java 279 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/impl/BorrowFormServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/impl/CatCgwjxxServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/impl/CatCheckServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/impl/CatSwyxxxServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/impl/CatYswjxxServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/impl/CheckQuestionServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/impl/PackingManageServiceImpl.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/impl/PhysicalDetailServiceImpl.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/impl/PhysicalFormServiceImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/impl/ReadXml2017ServiceImpl.java 591 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/impl/ReadXml2023ServiceImpl.java 813 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zbooksoft/gdmis/service/impl/XmlServiceImpl.java 302 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/applicationContext.xml 117 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/license_gh.lic 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BorrowFormMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BorrwDetailMapper.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/KeywordMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/KeywordParamMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/MenuItemMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/MessageMapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/NavigationClassificationColumnMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/NavigationClassificationMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/PermissionMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/PhysicalDetailMapper.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/PhysicalFormMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/SubtabMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/UserMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/spring-mybatis.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/spring-servlet.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/spring-shiro.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/lib/JDBC-VB_P-2.12-2025063010.jar 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/lib/tsc_sdk.jar 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/account/login_gh.jsp 326 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/account/login_gh_new.jsp 416 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/borrow/addBorrowForm.jsp 499 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/borrow/borrowForm.jsp 925 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/borrow/index.jsp 647 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/borrow/indexTest.jsp 536 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/borrow/myBorrowFormIndex.jsp 279 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/catAjjxx/checkIndex.jsp 286 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/catAjjxx/importBaoPanXmlIndex.jsp 320 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/catAjjxx/importXmlIndex.jsp 333 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/catAjjxx/updateFileTypeIndex.jsp 220 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/common/commonTips.jsp 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/common/relationFileTips.jsp 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/config/customConfigIndex.jsp 392 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/excel/importExcel.jsp 273 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/excel/importSuExcel.jsp 273 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/excel/tapeImportExcel.jsp 314 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/fileView/index.jsp 282 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/fileView/noAuthorize.jsp 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/fileView/physicalView.jsp 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/gdMisManage/selectCheckQuestion.jsp 373 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/gdMisManage/selectClassified.jsp 280 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/gdMisManage/selectInflectionPoint.jsp 396 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/gdMisManage/selectMineral.jsp 299 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/gdMisManage/selectRegion.jsp 552 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/label/labelIndex.jsp 209 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/material/acceptanceIndex.jsp 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/material/importXmlIndex.jsp 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/physical/addPhysicalForm.jsp 520 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/physical/index.jsp 502 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/physical/myPhysicalFormIndex.jsp 279 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/physical/physicalForm.jsp 923 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/search/advancedQuery.jsp 201 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/search/details.jsp 287 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/search/index.jsp 195 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/search/physicalDetails.jsp 225 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/search/result_attach.jsp 491 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/search/retrieve.jsp 167 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/search/searchDataIndex.jsp 558 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/search/searchFrom.jsp 398 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/search/searchResult.jsp 790 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/search/searchResult_attach.jsp 516 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/search/searchTest.jsp 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utilizationUser/register.jsp 313 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utilizationUser/register3.jsp 494 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utilizationUser/userQuestion.jsp 533 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/physicalIndex.jsp 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/physicalStatistics.jsp 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/serviceStatistics.jsp 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/transferStatistics.jsp 199 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatistics.jsp 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByArea.jsp 207 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByDept.jsp 202 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByDeptAddress.jsp 205 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByDeptType.jsp 205 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByIndustry.jsp 205 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsBySecurity.jsp 184 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByService.jsp 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByType.jsp 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByUser.jsp 266 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/gh/utlStatistics/utlType.jsp 186 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/WEB-INF/view/scanPrint/scanPrint.jsp 293 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap-theme.css 587 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap-theme.css.map 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap-theme.min.css 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap-theme.min.css.map 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap.css 6757 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap.css.map 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap.min.css 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap.min.css.map 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.eot 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.svg 288 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.ttf 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.woff 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.woff2 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/js/bootstrap.js 2377 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/js/bootstrap.min.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/plugins/bootstrap-3.3.7/js/npm.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/archives.css 2097 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/archivesHN.css 1304 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/css.css 172 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/albumbg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/applybtnbg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/archives_resultbg.jpg 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/archives_resultbg_re.jpg 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/archives_resultpic.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/archives_resultsc.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/archives_search_logo.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/archives_searchbg.jpg 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/borrow-step-line.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/borrow-step-lineH.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/borrow-title.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/font/SourceHanSansCN-Regular.ttf 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/font/SourceHanSansCN-Regular.woff 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/online-close.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/online-i.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/online-open.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/serbtn1.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/archivesHN/serbtn2.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/headerbg.jpg 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/login5i1.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/login5i2.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/login7bg.jpg 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/login7btn.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/login7main.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/login7register.jpg 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/login7registerbtn.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/loginbg.jpg 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/loginconbg.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/logini1.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/logini2.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/loginlogo-HN.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/images/logintxt.png 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/search.css 133 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/styles/v2/index-blue.css 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml
@@ -837,6 +837,13 @@
            <scope>system</scope>
            <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/kingbase8-8.6.0.jar</systemPath>
        </dependency>
<!--        <dependency>-->
<!--            <groupId>org.postgresql</groupId>-->
<!--            <artifactId>Driver</artifactId>-->
<!--            <version>2.12-2025063010</version>-->
<!--            <scope>system</scope>-->
<!--            <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/JDBC-VB_P-2.12-2025063010.jar</systemPath>-->
<!--        </dependency>-->
        <!-- 添加PageOffice依赖 -->
        <dependency>
            <groupId>com.zhuozhengsoft</groupId>
@@ -845,6 +852,16 @@
            <scope>system</scope>
            <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/pageoffice-6.1.0.1-javax.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>com.google.zxing</groupId>
            <artifactId>core</artifactId>
            <version>3.5.1</version>
        </dependency>
        <dependency>
            <groupId>com.google.zxing</groupId>
            <artifactId>javase</artifactId>
            <version>3.5.1</version>
        </dependency>
        <!-- 添加平台依赖 -->
        <dependency>
src/main/java/com/zbooksoft/gdmis/common/ArchivesCustomConfig.java
File was deleted
src/main/java/com/zbooksoft/gdmis/common/BarcodeGenerator.java
New file
@@ -0,0 +1,58 @@
package com.zbooksoft.gdmis.common;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.oned.Code128Writer;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
/**
 * @Description:
 * @Author: zhai
 * @Date: 2025/8/15
 **/
public class BarcodeGenerator {
    public static void generateBarcode(String data, String filePath) throws WriterException, IOException {
        // 设置条形码参数
        Map<EncodeHintType, Object> hints = new HashMap<>();
        hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
        // 创建条形码生成器
        Code128Writer barcodeWriter = new Code128Writer();
        BitMatrix bitMatrix = barcodeWriter.encode(data, BarcodeFormat.CODE_128, 300, 100, hints);
        // 保存为图片文件
        Path path = Paths.get(filePath);
        MatrixToImageWriter.writeToPath(bitMatrix, "PNG", path);
    }
    public static void main(String[] args) {
        try {
            String data = "Hello, World!";
            String filePath = "D:\\barcode.png";
//            generateBarcode(data, filePath);
            BufferedImage bufferedImage = generateBarcodeImage(data);
            System.out.println("条形码已生成:");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public static BufferedImage generateBarcodeImage(String data) throws WriterException {
        Map<EncodeHintType, Object> hints = new HashMap<>();
        hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
        Code128Writer barcodeWriter = new Code128Writer();
        BitMatrix bitMatrix = barcodeWriter.encode(data, BarcodeFormat.CODE_128, 5, 5, hints);
        return MatrixToImageWriter.toBufferedImage(bitMatrix);
    }
}
src/main/java/com/zbooksoft/gdmis/common/EsAttachIndexBuildJob.java
New file
@@ -0,0 +1,130 @@
package com.zbooksoft.gdmis.common;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruili.wcp.common.SpringContextUtil;
import com.ruili.wcp.common.TextExtractUtil;
import com.ruili.wcp.data.entity.config.Module;
import com.ruili.wcp.data.entity.config.TaskLog;
import com.ruili.wcp.data.entity.config.View;
import com.ruili.wcp.engine.FulltextIndexBuilder;
import com.ruili.wcp.service.config.ModuleService;
import com.ruili.wcp.service.config.TaskLogService;
import com.ruili.wcp.service.config.ViewService;
import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.Date;
import java.util.List;
import java.util.Map;
@DisallowConcurrentExecution
public class EsAttachIndexBuildJob implements Job {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private TaskLogService taskLogService;
    @Autowired
    private ModuleService moduleService;
    @Autowired
    private ViewService viewService;
    private static final Logger logger = LoggerFactory.getLogger(EsAttachIndexBuildJob.class);
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        // TODO Auto-generated method stub
        FulltextIndexBuilder fulltextIndexBuilder = (FulltextIndexBuilder) SpringContextUtil.getBean(FulltextIndexBuilder.class);
        boolean isExists = false;
        int ESIndexCount = 0;
        int ESIndexFail = 0;
        JobDataMap jobDetailDataMap = context.getJobDetail().getJobDataMap();
        String taskName = jobDetailDataMap.getString("taskName");
        Long id = jobDetailDataMap.getLong("id");
        if (!fulltextIndexBuilder.conn()) {
            TaskLog log = new TaskLog();
            log.setTaskName(taskName);
            log.setAction("任务调度运行");
            log.setTaskId(id);
            log.setOperateType("运行");
            log.setMessage("ES服务器连接失败,请检查服务器配置是否正确!");
            log.setOperateTime(new Date());
            taskLogService.saveOrUpdate(log);
            return;
        }
        isExists = fulltextIndexBuilder.isIndexLibraryExists("attach");
        if (!isExists) {
            boolean isCreate = fulltextIndexBuilder.createIndexAttachLibrary();
            if (!isCreate) {
                TaskLog log = new TaskLog();
                log.setTaskName(taskName);
                log.setAction("任务调度运行");
                log.setTaskId(id);
                log.setOperateType("运行");
                log.setMessage("创建附件索引库失败");
                log.setOperateTime(new Date());
                taskLogService.saveOrUpdate(log);
                return;
            }
        }
        // 取得需要添加es索引的模块ID
        QueryWrapper<Module> queryWrapper = new QueryWrapper<Module>();
        queryWrapper.eq("enable_attach_fulltext", 1);
        List<Module> modules = moduleService.list(queryWrapper);
        for (Module module : modules) {
            ESIndexCount = 0;
            ESIndexFail = 0;
            String moduleId = module.getModuleId().toString();
            String moduleTableName = module.getMainTableName();
            QueryWrapper<View> viewQueryWrapper = new QueryWrapper<View>();
            viewQueryWrapper.like("view_identify", "Search");
            viewQueryWrapper.eq("module_id", moduleId);
            View view = viewService.getOne(viewQueryWrapper);
            String sqlWhere = view.getSqlWhere();
            // 一个模块ID的所有附件
            String sql = "SELECT * FROM " + moduleTableName + " where " + sqlWhere;
            //String sql = "SELECT * FROM sys_attach a," + moduleTableName + " b where a.fulltext_state=0 and a.module_id=" + moduleId + " and a.key_id=b.id and b.delete_state=0 and b."+sqlWhere;
            List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
            for (Map<String, Object> map : list) {
                try {
                    String attachPath = map.get("WJLJ").toString();
                    String esId = map.get("id").toString();
                    String attachType = map.get("WJGS").toString();
                    String content = TextExtractUtil.extract(attachPath, attachType);
                    if (content != null && !"".equals(content)) {
                        map.put("fullText", content);
                        String IsSucceed = fulltextIndexBuilder.createIndex("attach", "file", esId, map);
                        if (IsSucceed.equals("update") || IsSucceed.equals("created")) {
                            jdbcTemplate.execute("update " + moduleTableName + " set fulltext_state=1 where id=" + esId);
                            ESIndexCount++;
                        } else {
                            ESIndexFail++;
                        }
                    } else {
                        ESIndexFail++;
                    }
                } catch (Exception ex) {
                    logger.error(ex.getMessage(), ex);
                    ESIndexFail++;
                }
            }
            TaskLog log = new TaskLog();
            log.setTaskName(taskName);
            log.setAction("任务调度运行");
            log.setTaskId(id);
            log.setOperateType("运行");
            log.setMessage("成功创建" + module.getModuleName() + "模块附件索引" + ESIndexCount + "条,失败" + ESIndexFail + "条");
            log.setOperateTime(new Date());
            taskLogService.saveOrUpdate(log);
        }
        fulltextIndexBuilder.closeConn();
    }
}
src/main/java/com/zbooksoft/gdmis/common/PdfUtil.java
New file
@@ -0,0 +1,81 @@
package com.zbooksoft.gdmis.common;
import com.itextpdf.kernel.font.PdfFontFactory;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfPage;
import com.itextpdf.kernel.pdf.PdfReader;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;
import java.io.FileOutputStream;
import java.io.IOException;
/**
 * @Description:
 * @Author: zhai
 * @Date: 2025/9/29
 **/
public class PdfUtil {
    public static void addBlankPageAtBeginning(String sourcePath, String targetPath) throws IOException {
        // 读取源PDF文档
        PdfReader reader = new PdfReader(sourcePath);
        PdfWriter writer = new PdfWriter(targetPath);
        PdfDocument pdfDoc = new PdfDocument(reader, writer);
        try {
            // 创建新的空白页并插入到第一页前
            PdfPage newPage = pdfDoc.addNewPage(1);
            // 在新页面上添加内容
            PdfCanvas canvas = new PdfCanvas(newPage);
            // 设置字体和大小,并移动到指定位置
            canvas.beginText()
                    .setFontAndSize(PdfFontFactory.createFont("STSong-Light", "UniGB-UCS2-H"), 14)
                    .moveText(100, 700)
                    .showText("请打印移交此版本数据")
                    .endText();
            // 关闭文档
            pdfDoc.close();
            reader.close();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            pdfDoc.close();
            reader.close();
        }
    }
    public static void addFirstPageToWord(String sourcePath, String outputPath) {
        try {
            XWPFDocument document = new XWPFDocument();
            // 添加首页内容
            addCoverPageContent(document);
            // 保存文档
            FileOutputStream out = new FileOutputStream(outputPath);
            document.write(out);
            out.close();
            document.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    private static void addCoverPageContent(XWPFDocument document) {
        // 标题
        XWPFParagraph title = document.createParagraph();
        title.setAlignment(ParagraphAlignment.CENTER);
        XWPFRun titleRun = title.createRun();
        titleRun.setText("请打印移交此版本数据");
        titleRun.setBold(true);
        titleRun.setFontSize(28);
        // 空行
        document.createParagraph();
    }
}
src/main/java/com/zbooksoft/gdmis/common/TscUtil.java
New file
@@ -0,0 +1,71 @@
package com.zbooksoft.gdmis.common;
import java.util.ArrayList;
import java.util.List;
/**
 * @Description:
 * @Author: zhai
 * @Date: 2025/8/12
 **/
public class TscUtil {
    public static List<String> wrapText(String text, int maxWidth, int size) {
        List<String> lines = new ArrayList<>();
        String[] words = text.split("");
        StringBuilder currentLine = new StringBuilder();
        int currentWidth = 0;
        for (String word : words) {
            // 简单估算字符宽度(中文字符宽度为2,英文字符宽度为1)
            int wordWidth = word.matches("[\\u4e00-\\u9fa5]") ? 2 : 1;
            if (currentWidth + wordWidth > maxWidth) {
                lines.add(currentLine.toString());
                currentLine = new StringBuilder(word);
                currentWidth = wordWidth;
            } else {
                currentLine.append(word);
                currentWidth += wordWidth;
            }
        }
        if (currentLine.length() > 0) {
            lines.add(currentLine.toString());
        }
        if (lines.size() > size) {
            return lines.subList(0, size);
        }
        return lines;
    }
    public static int getTextLong(String text) {
        String[] words = text.split("");
        int currentWidth = 0;
        for (String word : words) {
            // 简单估算字符宽度(中文字符宽度为2,英文字符宽度为1)
            currentWidth += word.matches("[\\u4e00-\\u9fa5]") ? 2 : 1;
        }
        return currentWidth;
    }
    public static String replaceEnglishQuotesWithChinese(String text) {
        if (text == null || text.isEmpty()) {
            return text;
        }
        StringBuilder result = new StringBuilder();
        boolean isOpenQuote = true; // 标记当前应该是开引号还是闭引号
        for (char c : text.toCharArray()) {
            if (c == '"') {
                // 根据标记决定使用开引号还是闭引号
                result.append(isOpenQuote ? '“' : '”');
                // 切换状态
                isOpenQuote = !isOpenQuote;
            } else {
                result.append(c);
            }
        }
        return result.toString();
    }
}
src/main/java/com/zbooksoft/gdmis/common/UsbSyncExampleWindowsItem.java
New file
@@ -0,0 +1,113 @@
package com.zbooksoft.gdmis.common;
import com.zbooksoft.gdmis.data.entity.CatYswjxx;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import tsc_sdk.TcpComm;
import java.util.List;
import static com.zbooksoft.gdmis.common.TscUtil.getTextLong;
import static com.zbooksoft.gdmis.common.TscUtil.wrapText;
public class UsbSyncExampleWindowsItem {
    private static final Logger logger = LoggerFactory.getLogger(UsbSyncExampleWindowsItem.class);
    public static void printItemLabel(List<CatYswjxx> itemDataList) {
        TcpComm asyncComm = new TcpComm("172.0.0.1", 8080);
        try {
            asyncComm.open();
            for (CatYswjxx catYswjxx : itemDataList) {
                String all = catYswjxx.getWjtm();
                String itemCode = catYswjxx.getDh();
                String isSecurity = catYswjxx.getSfsm();
                String newBarCode = itemCode.replace("底", "D").replace("测", "C").replace("观", "G").replace("探", "T").replace("样", "Y").replace("试", "S").replace("录", "L").replace("像", "X").replace("综", "Z").replace("文", "W").replace("实", "S").replace("物", "W").replace("钻", "Z").replace("设", "S").replace("相", "X").replace("油", "Y").replace("电", "D").replace("地", "D");
                String boxMum = catYswjxx.getHh();
                String newBoxMum = "";
                if (boxMum.contains("盒")) {
                    //获取盒字后面的内容
                    newBoxMum = boxMum.substring(1);
                } else {
                    newBoxMum = formatConverter(boxMum);
                }
                newBarCode = newBarCode + "-" + newBoxMum;
                // 使用示例
                List<String> wrappedLines = wrapText(all, 28, 3); // 每行最大宽度20
                StringBuilder commandBuilder = new StringBuilder();
                commandBuilder.append("SET RESPONSE ON\r\n");
                commandBuilder.append("CLS\r\n");
                int yPosition = 25;
                if (wrappedLines.size() == 1) {
                    yPosition = 65;
                } else if (wrappedLines.size() == 2) {
                    yPosition = 50;
                }
                for (String line : wrappedLines) {
                    commandBuilder.append("TEXT 25,").append(yPosition).append(",\"A123.TTF\",0,7,7,\"").append(line).append("\"\r\n");
                    yPosition += 35;
                }
                commandBuilder.append("BARCODE 5,150,\"128\",140,0,0,2,2,\"").append(newBarCode).append("\"\r\n");
                commandBuilder.append("TEXT 20,320,\"A123.TTF\",0,16,16,\"").append(itemCode).append("\"\r\n");
                int wordWidth = getTextLong(boxMum);
                long boxMumWidth = wordWidth * 30L;
                long boxMumX = (400 - boxMumWidth) / 2;
                if ("是".equals(isSecurity)) {
                    commandBuilder.append("TEXT ").append(boxMumX).append(",395,\"A123.TTF\",0,16,16,\"").append(boxMum).append("★\"\r\n");
                } else {
                    boxMumX = boxMumX + 10;
                    commandBuilder.append("TEXT ").append(boxMumX).append(",395,\"A123.TTF\",0,16,16,\"").append(boxMum).append("\"\r\n");
                }
                commandBuilder.append("PRINT 1\r\n");
                byte[] dataToSend = commandBuilder.toString().getBytes();
                asyncComm.writeSync(dataToSend);
            }
            Thread.sleep(25000);
        } catch (Exception e) {
            logger.error("打印错误: {}", e.getMessage());
        } finally {
            try {
                asyncComm.close();
                logger.info("连接关闭");
            } catch (Exception e) {
                logger.error("关闭打印机连接错误: {}", e.getMessage());
            }
        }
    }
    public static void main(String[] args) {
        String he = "C10-06-11";
        if (he.contains("盒")) {
            //获取盒字后面的内容
            String he1 = he.substring(1);
        } else {
            formatConverter(he);
        }
    }
    public static String formatConverter(String boxNum) {
        String newBoxNum = "";
        String[] split = boxNum.split("-");
        if (split.length == 3) {
            String f = split[0];
            String fFormat = "";
            if (f.length() == 2) {
                fFormat = f.charAt(0) + "0" + f.substring(1);
            } else {
                fFormat = f;
            }
            String s = split[1];
            String sFormat = String.format("%02d", Integer.parseInt(s));
            String t = split[2];
            String tFormat = String.format("%02d", Integer.parseInt(t));
            newBoxNum = fFormat + sFormat + tFormat;
        }
        return newBoxNum;
    }
}
src/main/java/com/zbooksoft/gdmis/common/XmlUtil.java
@@ -1,20 +1,20 @@
package com.zbooksoft.gdmis.common;
import org.dom4j.*;
import com.zbooksoft.gdmis.controller.ArchivesCustomConfigController;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.Node;
import org.dom4j.XPath;
import org.dom4j.io.SAXReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import static gnu.cajo.utils.extra.TransparentItemProxy.handler;
/**
 * @Description: 解析xml工具类
@@ -22,7 +22,21 @@
 * @Date: 2024/8/6
 **/
public class XmlUtil {
    private static final Logger logger = LoggerFactory.getLogger(XmlUtil.class);
    /**
     * 通过 Node 查找子节点
     *
     * @param node Node
     * @param path xpath表达式
     * @return Node元素
     * @throws Exception
     */
    public static Node getNode(Node node, String path) {
        XPath xPath = node.createXPath(path);
        return xPath.selectSingleNode(node);
    }
    public static Document getDocument(String path) throws Exception {
        FileInputStream xmlStream = null;
@@ -33,7 +47,26 @@
            Document document = saxReader.read(xmlStream);
            return document;
        } catch (Exception e) {
            throw new Exception("解析xml文件失败");
        } finally {
            xmlStream.close();
        }
    }
    public static Document getDocument(MultipartFile file) throws Exception {
        FileInputStream xmlStream = null;
        try {
            // 1. 创建临时文件
            File tempFile = File.createTempFile("temp_", ".tmp", new File(System.getProperty("java.io.tmpdir")));
            file.transferTo(tempFile);
            xmlStream = new FileInputStream(tempFile);
            SAXReader saxReader = new SAXReader();
            Document document = saxReader.read(xmlStream);
            if (tempFile.exists()) {
                tempFile.delete();
            }
            return document;
        } catch (Exception e) {
            throw new Exception("解析xml文件失败");
        } finally {
            xmlStream.close();
@@ -81,21 +114,117 @@
        }
    }
    public static Integer stringToInteger(String str) throws Exception {
        try {
            return Integer.valueOf(str);
        } catch (NumberFormatException e) {
            logger.info("字符串转Integer异常:{}", str);
            return 0;
        }
    }
    public static Double stringToDouble(String str) {
        try {
            return Double.valueOf(str);
        } catch (NumberFormatException e) {
            logger.info("字符串转Double异常:{}", str);
            return 0.0;
        }
    }
    public static Date stringToDate(String str) throws Exception {
        try {
            if (str == null || "".equals(str)) {
                return null;
            }
            if (str.contains("/")) {
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
                return sdf.parse(str);
            }
            if (str.contains("-")) {
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                return sdf.parse(str);
            }
            return null;
        } catch (NumberFormatException e) {
            logger.info("字符串转日期异常:{}", str);
            return null;
        }
    }
    public static String getFileType(String name) {
        name = name.toUpperCase();
        String newName = name;
        switch (name) {
            case "ZW":
                newName = "正文";
                break;
            case "SP":
                newName = "审批";
                break;
            case "FT":
                newName = "附图";
                break;
            case "FB":
                newName = "附表";
                break;
            case "FJ":
                newName = "附件";
                break;
            case "DMT":
                newName = "多媒体";
                break;
            case "SJK":
                newName = "数据库";
                break;
            case "RJ":
                newName = "软件";
                break;
            case "QT":
                newName = "其他";
                break;
        }
        return newName;
    }
    public static Integer getSecurityCode(String security) {
        Integer code = null;
        switch (security) {
            case "绝密":
                code = 4;
                break;
            case "机密":
                code = 3;
                break;
            case "秘密":
                code = 2;
                break;
            case "内部":
                code = 1;
                break;
            case "不涉密":
                code = 0;
                break;
        }
        return code;
    }
    public static void main(String[] args) {
        try {
            System.out.println(new Date());
//            String path = "E:\\Desktop\\新建文件夹 (4)\\地质资料文件目录.xml";
            String path = "E:\\Desktop\\新建文件夹 (4)\\2023\\地质资料文.xml";
            Document document = getDocument(path);
            Node wjjxxNode = getNode(document, "WJJXX");
            List<Node> cgwjjxxNodeList = getNodeList(wjjxxNode, "CGWJJXX/CGWJXX");
            for (Node cgwjjxxNode : cgwjjxxNodeList){
                String cgwjmc = getNodeText(cgwjjxxNode, "WJLB");
                System.out.println(cgwjmc);
            String filePath = "E:\\Desktop\\新建文件夹 (5)\\b01_0095.ml";
            try (BufferedReader br = new BufferedReader(new FileReader(filePath))) {
                String line;
                while ((line = br.readLine()) != null) {
                    // 处理每一行
                    System.out.println(line);
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            System.out.println(new Date());
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
src/main/java/com/zbooksoft/gdmis/common/ZipUtil.java
New file
@@ -0,0 +1,137 @@
package com.zbooksoft.gdmis.common;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
/**
 * @Description:
 * @Author: zhai
 * @Date: 2024/9/22
 **/
public class ZipUtil {
    private static final Logger logger = LoggerFactory.getLogger(ZipUtil.class);
    public static String zipFile(File path, String format) {
        String generatePath = "";
        if (!path.exists()) {
            path.mkdirs();
        }
        try {
            if (path.isDirectory()) {
                generatePath = path.getParent().endsWith("/") == false ? path.getParent() + File.separator + path.getName() + "." + format
                        : path.getParent() + path.getName() + "." + format;
            } else {
                generatePath = path.getParent().endsWith("/") == false ? path.getParent() + File.separator : path.getParent();
                generatePath += path.getName().substring(0, path.getName().lastIndexOf(".")) + "." + format;
            }
            // 输出流
            FileOutputStream outputStream = new FileOutputStream(generatePath);
            // 压缩输出流
            ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(outputStream));
            zip(out, path, "");
            out.flush();
            out.close();
            return generatePath;
        } catch (Exception e) {
            return null;
        } finally {
            try {
                FileUtils.deleteDirectory(path);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
    private static void zip(ZipOutputStream output, File file, String childPath) throws Exception {
        FileInputStream input = null;
        try {
            // 文件为目录
            if (file.isDirectory()) {
                // 得到当前目录里面的文件列表
                File list[] = file.listFiles();
                childPath = childPath + (childPath.length() == 0 ? "" : "/") + file.getName();
                // 循环递归压缩每个文件
                for (File f : list) {
                    zip(output, f, childPath);
                }
            } else {
                // 压缩文件
                childPath = (childPath.length() == 0 ? "" : childPath + "/") + file.getName();
                output.putNextEntry(new ZipEntry(childPath));
                input = new FileInputStream(file);
                int readLen = 0;
                byte[] buffer = new byte[1024 * 8];
                while ((readLen = input.read(buffer, 0, 1024 * 8)) != -1) {
                    output.write(buffer, 0, readLen);
                }
            }
        } catch (Exception ex) {
            ex.printStackTrace();
            logger.info(ex.getMessage());
        } finally {
            // 关闭流
            if (input != null) {
                try {
                    input.close();
                } catch (IOException ex) {
                    ex.printStackTrace();
                }
            }
        }
    }
    /**
     * 复制文件
     *
     * @param srcPath 源文件绝对路径
     * @param
     * @return boolean
     */
    public static String copyFile(String srcPath, String destPath) {
        File srcFile = new File(srcPath);
        if (!srcFile.exists()) { // 源文件不存在
            return "文件不存在!";
        }
        // 获取待复制文件的文件名
        File file = new File(srcPath);
        if (destPath.equals(srcPath)) { // 源文件路径和目标文件路径重复
            return "文件路径重复!";
        }
        File destFile = new File(destPath);
        if (destFile.exists() && destFile.isFile()) { // 该路径下已经有一个同名文件
            return destPath + ",已经有一个同名文件!";
        }
        String destDir = destFile.getParentFile().getPath();
        File destFileDir = new File(destDir);
        destFileDir.mkdirs();
        try {
            FileUtils.copyFile(file, destFile);
            return "";
        } catch (IOException e) {
            logger.info(e.getMessage());
            return "文件归档出错!";
        }
    }
    public static void main(String[] args) {
        String paths = "D:\\RecordFile\\dataPack\\2024090006_20240927101254\\";
        File path = new File(paths);
        if (!path.exists()) {
            path.mkdirs();
        }
        boolean directory = path.isDirectory();
        System.out.println(directory);
    }
}
src/main/java/com/zbooksoft/gdmis/config/ArchivesCustomConfig.java
New file
@@ -0,0 +1,209 @@
package com.zbooksoft.gdmis.config;
public class ArchivesCustomConfig {
    //系统相关配置
    private boolean enableSimple;// 是否启动简单版本
    //利用相关配置
    private boolean enableAllowDifferentArchives;// 档案利用是否允许借不同档案
    private boolean enableAllowDifferentFilingUnit;// 档案利用是否允许借不同的归档部门档案
    private boolean enableSecurityClassification;// 启用密级控制
    private boolean enableHideFilingUnit;// 是否隐藏归档/形成部门
    //地图相关配置
    private boolean enableSpaceData;// 是否启用空间数据
    private String provinceName;// 省份名称
    private String borderLayerName;// 边界图层名称
    private String borderUrl;// 获取省界接口地址
    private String defaultProvinceCoordinate;// 默认省经纬度
    private String defaultProvinceFirst;// 默认地球坐标系代号1
    private String defaultProvinceSecond;// 默认地球坐标系代号2
    private String mapPath;// 地图图片地址
    private String yaoGanMapPath;// 地图遥感图片地址
    private String originalPath;// 原始电子文件路径
    private String viewPath;// 浏览电子文件路径
    private String provinceCode;//省馆档号前缀
    private String apiKey;// 大模型聊天key
    private String sessionsApiUrl;// 聊天会话地址
    private String completionsApiUrl;// 聊天地址
    private String checkRule;// 聊天地址
    public ArchivesCustomConfig() {
        this.enableAllowDifferentArchives = true;
        this.enableAllowDifferentFilingUnit = true;
    }
    public boolean isEnableAllowDifferentArchives() {
        return enableAllowDifferentArchives;
    }
    public void setEnableAllowDifferentArchives(boolean enableAllowDifferentArchives) {
        this.enableAllowDifferentArchives = enableAllowDifferentArchives;
    }
    public boolean isEnableAllowDifferentFilingUnit() {
        return enableAllowDifferentFilingUnit;
    }
    public void setEnableAllowDifferentFilingUnit(boolean enableAllowDifferentFilingUnit) {
        this.enableAllowDifferentFilingUnit = enableAllowDifferentFilingUnit;
    }
    public boolean isEnableSecurityClassification() {
        return enableSecurityClassification;
    }
    public void setEnableSecurityClassification(boolean enableSecurityClassification) {
        this.enableSecurityClassification = enableSecurityClassification;
    }
    public boolean isEnableHideFilingUnit() {
        return enableHideFilingUnit;
    }
    public void setEnableHideFilingUnit(boolean enableHideFilingUnit) {
        this.enableHideFilingUnit = enableHideFilingUnit;
    }
    public boolean isEnableSpaceData() {
        return enableSpaceData;
    }
    public void setEnableSpaceData(boolean enableSpaceData) {
        this.enableSpaceData = enableSpaceData;
    }
    public String getProvinceName() {
        return provinceName;
    }
    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }
    public String getBorderLayerName() {
        return borderLayerName;
    }
    public void setBorderLayerName(String borderLayerName) {
        this.borderLayerName = borderLayerName;
    }
    public String getBorderUrl() {
        return borderUrl;
    }
    public void setBorderUrl(String borderUrl) {
        this.borderUrl = borderUrl;
    }
    public String getDefaultProvinceCoordinate() {
        return defaultProvinceCoordinate;
    }
    public void setDefaultProvinceCoordinate(String defaultProvinceCoordinate) {
        this.defaultProvinceCoordinate = defaultProvinceCoordinate;
    }
    public String getDefaultProvinceFirst() {
        return defaultProvinceFirst;
    }
    public void setDefaultProvinceFirst(String defaultProvinceFirst) {
        this.defaultProvinceFirst = defaultProvinceFirst;
    }
    public String getDefaultProvinceSecond() {
        return defaultProvinceSecond;
    }
    public void setDefaultProvinceSecond(String defaultProvinceSecond) {
        this.defaultProvinceSecond = defaultProvinceSecond;
    }
    public String getOriginalPath() {
        return originalPath;
    }
    public void setEnableSimple(boolean enableSimple) {
        this.enableSimple = enableSimple;
    }
    public boolean getEnableSimple() {
        return enableSimple;
    }
    public void setOriginalPath(String originalPath) {
        this.originalPath = originalPath;
    }
    public String getViewPath() {
        return viewPath;
    }
    public void setViewPath(String viewPath) {
        this.viewPath = viewPath;
    }
    public String getMapPath() {
        return mapPath;
    }
    public void setMapPath(String mapPath) {
        this.mapPath = mapPath;
    }
    public String getYaoGanMapPath() {
        return yaoGanMapPath;
    }
    public void setYaoGanMapPath(String yaoGanMapPath) {
        this.yaoGanMapPath = yaoGanMapPath;
    }
    public String getApiKey() {
        return apiKey;
    }
    public void setApiKey(String apiKey) {
        this.apiKey = apiKey;
    }
    public String getSessionsApiUrl() {
        return sessionsApiUrl;
    }
    public void setSessionsApiUrl(String sessionsApiUrl) {
        this.sessionsApiUrl = sessionsApiUrl;
    }
    public String getCompletionsApiUrl() {
        return completionsApiUrl;
    }
    public void setCompletionsApiUrl(String completionsApiUrl) {
        this.completionsApiUrl = completionsApiUrl;
    }
    public String getCheckRule() {
        return checkRule;
    }
    public void setCheckRule(String checkRule) {
        this.checkRule = checkRule;
    }
    public String getProvinceCode() {
        return provinceCode;
    }
    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }
}
src/main/java/com/zbooksoft/gdmis/config/RestHighLevelConfig.java
New file
@@ -0,0 +1,122 @@
package com.zbooksoft.gdmis.config;
import com.ruili.wcp.common.CustomConfigUtil;
import com.ruili.wcp.configsettting.SystemConfig;
import com.ruili.wcp.web.common.LicenseException;
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
import org.springframework.util.ObjectUtils;
import javax.annotation.PostConstruct;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
 * @Description ES客户端配置
 * @Author fsr
 * @Date 2021/12/20
 **/
@Configuration
@DependsOn(value = {"customConfigUtil"}) // 声明一下并不一定生效
public class RestHighLevelConfig {
    private String host = "127.0.0.1";
    private Integer port = 9200;
    private static final String PROTOCOL = "http"; // 协议
    private static final int CONNECT_TIME_OUT = 1000; // http连接超时 毫秒
    private static final int SOCKET_TIME_OUT = 6000; // sock超时
    private static final int CONNECTION_REQUEST_TIME_OUT = 5000; // 请求超时
    private static final int MAX_CONNECT_NUM = 50;
    private static final int MAX_CONNECT_PER_ROUTE = 50;
    @Autowired
    private CustomConfigUtil customConfigUtil;
    public static void main(String[] args) throws IOException {
        Class<CustomConfigUtil> customConfigUtilClass = CustomConfigUtil.class;
        Class<? extends ClassLoader> aClass = customConfigUtilClass.getClassLoader().getClass();
        InputStream resourceAsStream = aClass.getResourceAsStream("jdbc.properties");
        Properties properties = new Properties();
        properties.load(resourceAsStream);
        properties.get("jdbc.driver");
        properties.get("jdbc.url");
        properties.get("jdbc.username");
        Object password = properties.get("jdbc.password");
        System.out.println(password);
    }
    private RestHighLevelClient restHighLevelClient;
    @PostConstruct
    public void init() throws LicenseException {
        SystemConfig systemConfig = this.customConfigUtil.getConfigObj(SystemConfig.class);
        if (systemConfig == null) {
            systemConfig = new SystemConfig();
            customConfigUtil.setConfigObj(systemConfig);
        }
        String esHost = systemConfig.getElasticSearchServerHost();
        if (!ObjectUtils.isEmpty(esHost)) {
            this.host = esHost;
        }
        String esPort = systemConfig.getElasticSearchServerPort();
        if (!ObjectUtils.isEmpty(esPort)) {
            this.port = Integer.valueOf(esPort);
        }
        // 设置访问参数
        HttpHost httpHost = new HttpHost(this.host, this.port, PROTOCOL);
        RestClientBuilder clientBuilder = RestClient.builder(httpHost);
        //判断是否要用户密码验证
        if (systemConfig.getElasticSearchRequiresAuthentication()) {
            String esUserName = systemConfig.getElasticSearchUserName();
            String esPassword = systemConfig.getElasticSearchPassword();
            CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
            credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(esUserName, esPassword));
            clientBuilder.setHttpClientConfigCallback(f -> {
                f.setDefaultCredentialsProvider(credentialsProvider)
                        .setMaxConnTotal(MAX_CONNECT_NUM)
                        .setMaxConnPerRoute(MAX_CONNECT_PER_ROUTE);
                f.disableConnectionState();
                return f;
            });
        } else {
            // http连接池设置
            clientBuilder.setHttpClientConfigCallback(builder -> {
                builder.setMaxConnTotal(MAX_CONNECT_NUM).setMaxConnPerRoute(MAX_CONNECT_PER_ROUTE);
                builder.disableConnectionState();
                return builder;
            });
        }
        // 超时设置
        clientBuilder.setRequestConfigCallback(builder -> {
            builder.setConnectTimeout(CONNECT_TIME_OUT)
                    .setSocketTimeout(SOCKET_TIME_OUT)
                    .setConnectionRequestTimeout(CONNECTION_REQUEST_TIME_OUT);
            return builder;
        });
        restHighLevelClient = new RestHighLevelClient(clientBuilder);
    }
    @Bean
    public RestHighLevelClient restHighLevelClient() {
        return restHighLevelClient;
    }
}
src/main/java/com/zbooksoft/gdmis/controller/ArchivesCustomConfigController.java
New file
@@ -0,0 +1,63 @@
package com.zbooksoft.gdmis.controller;
import com.ruili.wcp.common.CustomConfigUtil;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.zbooksoft.gdmis.config.ArchivesCustomConfig;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
@RequestMapping("/archivesCustomConfig")
public class ArchivesCustomConfigController {
    @Autowired
    public CustomConfigUtil customConfigUtil;
    private static final Logger logger = LoggerFactory.getLogger(ArchivesCustomConfigController.class);
    /**
     * 自定义配置页面
     *
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/archivesCustomConfigIndex")
    @RequiresUser
    public ModelAndView index(HttpServletRequest request, HttpServletResponse response) throws Exception {
        ArchivesCustomConfig archivesCustomConfig = customConfigUtil.getConfigObj(ArchivesCustomConfig.class);
        ModelAndView mav = new ModelAndView("gh/config/customConfigIndex");
        mav.addObject("archivesCustomConfig", archivesCustomConfig);
        return mav;
    }
    /**
     * 保存配置
     *
     * @return
     */
    @RequestMapping(value = "/saveCustomConfig", produces = "application/json; charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    @RequiresUser
    public Object saveCustomConfig(@RequestBody ArchivesCustomConfig archivesCustomConfig) {
        try {
            customConfigUtil.setConfigObj(archivesCustomConfig);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
}
src/main/java/com/zbooksoft/gdmis/controller/ArchivesManageController.java
File was deleted
src/main/java/com/zbooksoft/gdmis/controller/BorrowController.java
New file
@@ -0,0 +1,657 @@
package com.zbooksoft.gdmis.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruili.wcp.common.CustomConfigUtil;
import com.ruili.wcp.data.entity.config.Module;
import com.ruili.wcp.data.entity.management.*;
import com.ruili.wcp.engine.flow.HistoryService;
import com.ruili.wcp.engine.flow.RuntimeService;
import com.ruili.wcp.engine.flow.TaskService;
import com.ruili.wcp.service.config.ModuleService;
import com.ruili.wcp.web.common.UserFriendlyException;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.ruili.wcp.web.model.easyui.DataTableVO;
import com.ruili.wcp.web.model.easyui.PagedSortedAndFilteredInputDto;
import com.zbooksoft.gdmis.config.ArchivesCustomConfig;
import com.zbooksoft.gdmis.data.entity.BorrowDetail;
import com.zbooksoft.gdmis.data.entity.BorrowForm;
import com.zbooksoft.gdmis.data.entity.CatAjjxx;
import com.zbooksoft.gdmis.data.vo.BorrowInfo;
import com.zbooksoft.gdmis.data.vo.ParentBorrowInfo;
import com.zbooksoft.gdmis.service.*;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.apache.shiro.session.InvalidSessionException;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.*;
/**
 * @Description: 借阅
 * @Author: zhai
 * @Date: 2024/8/28
 **/
@Controller
@RequestMapping("/borrow")
public class BorrowController {
    @Autowired
    CatAjjxxService catAjjxxService;
    @Autowired
    CatCgwjxxService catCgwjxxService;
    @Autowired
    CatYswjxxService catYswjxxService;
    @Autowired
    BorrowDetailService borrowDetailService;
    @Autowired
    BorrowFormService borrowFormService;
    @Autowired
    RuntimeService runtimeService;
    @Autowired
    TaskService taskService;
    @Autowired
    CustomConfigUtil customConfigUtil;
    @Autowired
    ModuleService moduleService;
    @Autowired
    HistoryService historyService;
    @Autowired
    UserCheckService userCheckService;
    @Autowired
    UtilizationUserService utilizationUserService;
    @Autowired
    JdbcTemplate jdbcTemplate;
    private static final Logger logger = LoggerFactory.getLogger(BorrowController.class);
    @RequestMapping({"/addBorrowDetail"})
    @ResponseBody
    @RequiresUser
    public AjaxResponse addBorrowDetail(String keyId) {
        try {
            String strSql = "select  *  from view_all_utlization where id = " + keyId;
            Map<String, Object> map = jdbcTemplate.queryForMap(strSql);
            Long moduleId = Long.parseLong(map.get("module_id").toString());
            Module module = moduleService.getByIdModule(moduleId);
            QueryWrapper<Module> moduleQueryWrapper = new QueryWrapper<>();
            moduleQueryWrapper.eq("module_id", module.getParentId());
            moduleQueryWrapper.ne("parent_id", 0);
            List<Module> moduleList = moduleService.list(moduleQueryWrapper);
            AjaxResponse ajaxResponse = new AjaxResponse(true);
            Map<String, Object> resultMap = new HashMap<String, Object>();
            if (moduleList.size() == 0) {
                // 案卷级利用
                resultMap = addUtilizationForFile(Long.parseLong(keyId));
            } else if (moduleList.size() > 0) {
                // 文件级利用,需要反查案卷级信息
                resultMap = addUtilizationForItem(module, Long.parseLong(keyId));
            }
//            String unit = resultMap.get("unit").toString().equals("卷") ? "0" : "1";
            String unit = "0";
            if (resultMap != null) {
                StringBuilder sb = new StringBuilder();
                sb.append("top.layer.open({");
                sb.append("   title : '提示',");
                sb.append("   type : 2,");
                sb.append("   area : [ '700px', '220px' ],");
                sb.append("   fixed : true, ");
                sb.append("   content : 'common/commonTips?addNum=" + resultMap.get("addNum") + "&type=借阅&repeatNum=" + resultMap.get("repeatNum") + "&existFileNum=" + resultMap.get("existFileNum") + "&existItemNum=" + resultMap.get("existItemNum") + "&urlPath=borrow'");
                sb.append("});");
                Map<String, String> result = new HashMap<String, String>();
                result.put("jsExpression", sb.toString());
                result.put("totalNum", resultMap.get("existFileNum").toString());
                ajaxResponse.setResult(result);
            }
            return ajaxResponse;
        } catch (InvalidSessionException e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 资料借阅申请首页
     *
     * @return
     */
    @RequestMapping(value = {"", "index"})
    @RequiresUser
    public ModelAndView index() {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        List<BorrowInfo> borrowInfoList = new ArrayList<>();
        List<BorrowDetail> allBorrowDetailList = new ArrayList<>();
        if (user != null) {
            List<ParentBorrowInfo> parentBorrowInfoList = borrowDetailService.selectDistinctParentBorrowInfo(user.getUserId());
            // 通过distinct获取案卷
            for (ParentBorrowInfo parentBorrowInfo : parentBorrowInfoList) {
                QueryWrapper<BorrowDetail> queryWrapper = new QueryWrapper<>();
                queryWrapper.eq("form_id", 0).eq("create_user_id", user.getUserId()).eq("file_id", parentBorrowInfo.getFileId());
                queryWrapper.orderByDesc("item_number");
                List<BorrowDetail> borrowDetailList = borrowDetailService.list(queryWrapper);
                BorrowInfo borrowInfo = new BorrowInfo();
                borrowInfo.setParentBorrowInfo(parentBorrowInfo);
                borrowInfo.setBorrowDetailList(borrowDetailList);
                borrowInfoList.add(borrowInfo);
                allBorrowDetailList.addAll(borrowDetailList);
            }
        }
        ModelAndView mav = new ModelAndView("gh/borrow/index");
        mav.addObject("curUserId", user.getUserId());
        mav.addObject("curUserName", user.getTrueName());
        mav.addObject("curUserTel", user.getMobilePhone());
        mav.addObject("curDeptName", user.getDeptName());
        mav.addObject("curDeptId", user.getDeptId());
        mav.addObject("dateNow", DateTime.now());
        // 默认加一个月
        Calendar rightNow = Calendar.getInstance();
        rightNow.setTime(new Date());
        rightNow.add(Calendar.MONTH, 1);
        Date utilizationValidDate = rightNow.getTime();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String reStr = sdf.format(utilizationValidDate);
        mav.addObject("borrowValidDate", reStr);
        mav.addObject("borrowInfoList", borrowInfoList);
        mav.addObject("allBorrowDetailList", allBorrowDetailList);
        return mav;
    }
    /**
     * 保存明细信息
     *
     * @param
     * @return
     */
    @RequestMapping(value = "/saveBorrowDetail", produces = "application/json; charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    @RequiresUser
    public Object saveBorrowDetail(Long formId, @RequestBody ArrayList<BorrowDetail> borrowDetailList) {
        try {
            borrowDetailService.saveOrUpdateBatch(borrowDetailList);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 保存申请单信息
     *
     * @param
     * @return
     */
    @RequestMapping(value = "/saveBorrowForm", produces = "application/json; charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    @RequiresUser
    public Object saveBorrowForm(@RequestBody BorrowForm borrowForm) {
        try {
            Subject currentUser = SecurityUtils.getSubject();
            Session session = currentUser.getSession();
            User user = (User) session.getAttribute("user");
            borrowForm.setCreateUserId(user.getUserId());
            borrowForm.setCreateUserName(user.getTrueName());
            borrowForm.setCreateTime(new Date());
            // 生成利用单编号
            Date date = new Date();
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMM");
            String preNum = dateFormat.format(date);
            String maxApplyCode = borrowFormService.selectMaxApplyCode(preNum);
            String applyCode = preNum + "0001";
            if (StringUtils.isNotEmpty(maxApplyCode)) {
                Integer newApplyCode = Integer.parseInt(maxApplyCode) + 1;
                applyCode = newApplyCode.toString();
            }
            borrowForm.setApplyCode(applyCode);
            borrowForm.setFlowState(0);
            borrowForm.setState(0);
            borrowForm.setDeleteState(0);
            borrowForm.setBorrowDate(new Date());
            borrowFormService.saveOrUpdate(borrowForm);
            QueryWrapper<BorrowDetail> query = new QueryWrapper<>();
            query.eq("form_id", 0).eq("electronic", 0).eq("paper", 0).eq("original", 0).eq("create_user_id", user.getUserId());
            borrowDetailService.remove(query);
            // 修改明细表formid
            QueryWrapper<BorrowDetail> updateWrapper = new QueryWrapper<>();
            updateWrapper.eq("form_id", 0).eq("create_user_id", user.getUserId());
            BorrowDetail borrowDetail = new BorrowDetail();
            borrowDetail.setFormId(borrowForm.getFormId());
            borrowDetailService.update(borrowDetail, updateWrapper);
            List<ParentBorrowInfo> parentBorrowInfos = borrowDetailService.selectDistinctParentBorrowInfoByFormId(borrowForm.getFormId());
            borrowForm.setFileCount(parentBorrowInfos.size());
            QueryWrapper<BorrowDetail> wrapper = new QueryWrapper<>();
            wrapper.eq("form_id", borrowForm.getFormId());
            int count = borrowDetailService.count(wrapper);
            borrowForm.setItemCount(count);
            borrowFormService.saveOrUpdate(borrowForm);
            // 生成流程信息
            Long moduleId = 1828968610175959041L;
            Long tableId = 1828970885262917633L;
            Long keyId = borrowForm.getFormId();
            Long processDefinitionId = 1829455272978984961L;
            String businessViewUrl = "borrow/borrowForm?formId=" + keyId;
            Map<String, Object> dataMap = new HashMap<String, Object>();
            dataMap.put("applyCode", borrowForm.getApplyCode());
            dataMap.put("createTime", borrowForm.getCreateTime());
            dataMap.put("createUserId", borrowForm.getCreateUserId());
            dataMap.put("formId", borrowForm.getFormId());
            dataMap.put("remark", borrowForm.getRemark());
            dataMap.put("utilizationMethod", borrowForm.getUtilizationMethod());
            FlowRuntimeExecution processInstance = runtimeService.startProcessInstanceById(processDefinitionId, moduleId, tableId, keyId, user.getUserId(), user.getTrueName(), businessViewUrl, dataMap);
            // 完成第一步
            List<FlowRuntimeTask> taskList = taskService.getTaskByProcessInstanceId(processInstance.getProcessInstanceId());
            if (taskList != null && taskList.size() > 0) {
                for (FlowRuntimeTask task : taskList) {
                    taskService.complete(task.getTaskId(), "", null, dataMap, null);
                }
            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 档案利用申请单审核
     *
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/borrowForm")
    @RequiresUser
    public ModelAndView borrowForm(Long formId, Long processInstanceId, Long taskId, HttpServletRequest request, HttpServletResponse response) throws Exception {
        ArchivesCustomConfig archivesCustomConfig = customConfigUtil.getConfigObj(ArchivesCustomConfig.class);
        ModelAndView mav = new ModelAndView("gh/borrow/borrowForm");
        BorrowForm borrowForm = borrowFormService.getById(formId);
        List<BorrowInfo> borrowInfoList = new ArrayList<>();
        List<ParentBorrowInfo> parentBorrowInfoList = borrowDetailService.selectDistinctParentBorrowInfoByFormId(formId);
        List<BorrowDetail> allBorrowDetailList = new ArrayList<>();
        if (borrowForm == null) {
            throw new UserFriendlyException("申请单不存在", "申请单已被删除,无法打开!");
        }
        // 通过distinct获取案卷
        for (ParentBorrowInfo parentBorrowInfo : parentBorrowInfoList) {
            QueryWrapper<BorrowDetail> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("form_id", formId).eq("file_id", parentBorrowInfo.getFileId());
            queryWrapper.orderByAsc("item_number");
            List<BorrowDetail> borrowDetailList = borrowDetailService.list(queryWrapper);
            BorrowInfo archivalInfo = new BorrowInfo();
            archivalInfo.setParentBorrowInfo(parentBorrowInfo);
            archivalInfo.setBorrowDetailList(borrowDetailList);
            borrowInfoList.add(archivalInfo);
            allBorrowDetailList.addAll(borrowDetailList);
        }
        // 获取利用单模块
        QueryWrapper<Module> borrowFormWrapper = new QueryWrapper<Module>();
        borrowFormWrapper.eq("module_identify", "borrowForm");
        Module borrowFormModule = moduleService.getOne(borrowFormWrapper);
        mav.addObject("borrowFormModule", borrowFormModule);
        mav.addObject("borrowInfoList", borrowInfoList);
        mav.addObject("allBorrowDetailList", allBorrowDetailList);
        mav.addObject("borrowForm", borrowForm);
        mav.addObject("archivesCustomConfig", archivesCustomConfig);
        // 处理流程信息
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        Long moduleId = 1828968610175959041L;
        Long tableId = 1828970885262917633L;
        FlowRuntimeTask task = null;
        FlowHistoryProcess historyProcess = null;
        if (taskId != null) {
            task = taskService.getTaskById(taskId);
            if (task != null) {
                processInstanceId = task.getProcessInstanceId();
                mav.addObject("task", task);
                mav.addObject("processInstanceId", processInstanceId);
                mav.addObject("isEnd", false);
            } else {
                // 查找是否有历史任务记录
                FlowHistoryTask historyTask = historyService.getHistoryTaskById(taskId);
                if (historyTask != null) {
                    processInstanceId = historyTask.getProcessInstanceId();
                } else {
                }
            }
        }
        // 查找流程是否已经结束
        if (processInstanceId != null) {
            historyProcess = historyService.getHistoryProcessByProcessInstanceId(processInstanceId);
        } else if (moduleId != null && tableId != null && formId != null) {
            historyProcess = historyService.getHistoryProcessByBusinessInfo(moduleId, tableId, formId);
        }
        if (historyProcess != null) {
            processInstanceId = historyProcess.getProcessInstanceId();
            mav.addObject("processInstanceId", processInstanceId);
            // 如果流程已经结束
            if (historyProcess.getEndTime() != null) {
                mav.addObject("isEnd", true);
            } else {
                mav.addObject("isEnd", false);
                // 查找是否为自己待办
                List<FlowRuntimeTask> taskList = taskService.findTasksByProcessInstanceIdAndUserId(user.getUserId(), historyProcess.getProcessInstanceId());
                if (taskList != null && taskList.size() > 0) {
                    mav.addObject("task", taskList.get(0));
                    mav.addObject("isEnd", false);
                }
            }
        } else {
//            throw new UserFriendlyException("找不到流程实例", "流程实例不存在或已完成!");
        }
        // 读取流程历史信息
        if (task != null || historyProcess != null) {
            List<FlowHistoryTask> historyTaskList = historyService.getFlowHistoryTaskByProcessInstanceId(processInstanceId);
            mav.addObject("historyTaskList", historyTaskList);
        }
//
//        String utilizeApprovePermission = "BusinessManage.borrowForm.UtilizeApprove";
//        boolean permitted = currentUser.isPermitted(utilizeApprovePermission);
//        mav.addObject("approvePermission", currentUser.isPermitted(utilizeApprovePermission));
        mav.addObject("approvePermission", true);
        return mav;
    }
    /**
     * 我的借阅单首页
     *
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/myBorrowFormIndex")
    @RequiresUser
    public ModelAndView myBorrowFormIndex(HttpServletRequest request, HttpServletResponse response) throws Exception {
        ModelAndView mav = new ModelAndView("gh/borrow/myBorrowFormIndex");
        return mav;
    }
    /**
     * 分页获取我的利用申请列表
     *
     * @param
     * @param pageInput
     * @return
     */
    @RequestMapping("/getMyBorrowFormList")
    @ResponseBody
    @RequiresUser
    public Object getMyBorrowFormList(Integer flowState, PagedSortedAndFilteredInputDto pageInput) {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        QueryWrapper<BorrowForm> query = new QueryWrapper<>();
        if (flowState != null && flowState != -2) {
            query.eq("flow_state", flowState);
        }
        query.nested(qy -> qy.eq("create_user_id", user.getUserId()).or().eq("borrow_user_id", user.getUserId()));
        IPage<BorrowForm> utilizationFormIPage;
        String searchText = pageInput.getSearchText();
        if (searchText != null && searchText != "") {
            query.nested(i -> i.like("apply_code", searchText).or().like("borrow_user_name", searchText));
        }
        String sort = pageInput.getSort();
        String order = pageInput.getOrder();
        if (sort != null && sort != "") {
            query.orderBy(true, !order.equals("desc"), "apply_code");
        }
        DataTableVO<BorrowForm> dto = new DataTableVO<>();
        if (pageInput.getPage() != 0 && pageInput.getRows() != 0) {
            Page<BorrowForm> page = new Page<>(pageInput.getPage(), pageInput.getRows());
            utilizationFormIPage = borrowFormService.page(page, query);
            dto.setTotal(utilizationFormIPage.getTotal());
            dto.setRows(utilizationFormIPage.getRecords());
        } else {
            List<BorrowForm> utilizationFormList = borrowFormService.list(query);
            dto.setTotal(utilizationFormList.size());
            dto.setRows(utilizationFormList);
        }
        return dto;
    }
    /**
     * 删除借阅单
     *
     * @param formIdList
     * @return
     */
    @RequestMapping(value = "/deleteBorrowForm", produces = "application/json; charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    @RequiresUser
    public Object deleteBorrowForm(@RequestBody ArrayList<Long> formIdList) {
        try {
            borrowFormService.removeByIds(formIdList);
            for (Long formId : formIdList) {
                QueryWrapper<BorrowDetail> query = new QueryWrapper<>();
                query.eq("form_id", formId);
                borrowDetailService.remove(query);
                // 删除流程实例
                runtimeService.deleteProcessInstanceByBusinessInfo(1828968610175959041L, 1828970885262917633L, formId);
            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 删除明细信息
     *
     * @param fileId
     * @return
     */
    @RequestMapping(value = "/deleteBorrowDetail", produces = "application/json; charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    @RequiresUser
    public Object deleteBorrowDetail(Long fileId) {
        try {
            QueryWrapper<BorrowDetail> query = new QueryWrapper<>();
            query.eq("file_id", fileId);
            query.eq("form_id", 0L);
            borrowDetailService.remove(query);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 删除明细信息通过明细id
     *
     * @param detailId
     * @return
     */
    @RequestMapping(value = "/deleteBorrowDetailById", produces = "application/json; charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    @RequiresUser
    public Object deleteBorrowDetailById(Long detailId) {
        try {
            borrowDetailService.removeById(detailId);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 人工添加申请单
     *
     * @param
     * @return
     */
    @RequestMapping(value = "/addBorrowForm")
    @RequiresUser
    public ModelAndView addBorrowForm() {
        ModelAndView mav = new ModelAndView("gh/borrow/addBorrowForm");
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        mav.addObject("curUserId", user.getUserId());
        mav.addObject("curUserName", user.getTrueName());
        mav.addObject("curUserTel", user.getMobilePhone());
        mav.addObject("curDeptName", user.getDeptName());
        mav.addObject("curDeptId", user.getDeptId());
        return mav;
    }
    /**
     * 分页获取人工添加明细列表
     *
     * @param
     * @param pageInput
     * @return
     */
    @RequestMapping("/getBorrowDetailListByPeople")
    @ResponseBody
    @RequiresUser
    public Object getBorrowDetailListByPeople(PagedSortedAndFilteredInputDto pageInput, Long formId) {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        QueryWrapper<BorrowDetail> query = new QueryWrapper<>();
        if (formId != null && formId > 0) {
            query.eq("form_id", formId);
        } else if (formId != null && formId < 0) {
            query.gt("form_id", 0);
        } else {
            query.eq("form_id", 0).eq("create_user_id", user.getUserId());
        }
        query.eq("file_title", "人工添加");
        List<BorrowDetail> list = borrowDetailService.list(query);
        return list;
    }
    public Map<String, Object> addUtilizationForFile(Long keyId) {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        Map<String, Object> resultMap = new HashMap<>();
        int addNum = 0;
        int repeatNum = 0;
        int existItemNum = 0;
        QueryWrapper<BorrowDetail> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("form_id", 0);
        queryWrapper.eq("create_user_id", user.getUserId());
        int itemCount = borrowDetailService.count(queryWrapper);
        existItemNum += itemCount;
        queryWrapper.eq("file_id", keyId);
        List<BorrowDetail> borrowDetailList = borrowDetailService.list(queryWrapper);
        if (borrowDetailList.size() == 0) {
            CatAjjxx catAjjxx = catAjjxxService.getById(keyId);
            Integer cgwjxxCount = borrowDetailService.setCgwjxx(catAjjxx);
            Integer yswjxxCount = borrowDetailService.setYswjxx(catAjjxx);
            addNum++;
            existItemNum += cgwjxxCount + yswjxxCount;
        } else {
            repeatNum++;
        }
        String strSql = "select distinct file_id from UTL_BORROW_DETAIL  where form_id=0 and create_user_id=" + user.getUserId();
        List<Map<String, Object>> parentMapList = jdbcTemplate.queryForList(strSql);
        resultMap.put("existFileNum", parentMapList.size());
        resultMap.put("existItemNum", existItemNum);
        resultMap.put("addNum", addNum);
        resultMap.put("repeatNum", repeatNum);
        return resultMap;
    }
    public Map<String, Object> addUtilizationForItem(Module module, Long keyId) {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        int addNum = 0;
        int repeatNum = 0;
        int existItemNum = 0;
        ArrayList<Long> longs = new ArrayList<>();
        longs.add(keyId);
        Map<String, Object> resultMap = new HashMap<>();
        QueryWrapper<BorrowDetail> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("form_id", 0);
        queryWrapper.eq("create_user_id", user.getUserId());
        int itemCount = borrowDetailService.count(queryWrapper);
        existItemNum += itemCount;
        queryWrapper.eq("item_id", keyId);
        List<BorrowDetail> borrowDetailList = borrowDetailService.list(queryWrapper);
        if (borrowDetailList.size() == 0) {
            String mainTableName = module.getMainTableName();
            if (mainTableName.equals("CAT_ITEM_CGWJXX")) {
                Integer cgwjxxCount = borrowDetailService.setCgwjxxByIds(longs);
                existItemNum += cgwjxxCount;
            } else if (mainTableName.equals("CAT_ITEM_YSWJXX")) {
                Integer cgwjxxCount = borrowDetailService.setYswjxxByIds(longs);
                existItemNum += cgwjxxCount;
            }
        }
        resultMap.put("addNum", 1);
        resultMap.put("repeatNum", 0);
        resultMap.put("existItemNum", existItemNum);
        String strSql = "select distinct file_id from UTL_BORROW_DETAIL  where form_id=0 and create_user_id=" + user.getUserId();
        List<Map<String, Object>> parentMapList = jdbcTemplate.queryForList(strSql);
        resultMap.put("existFileNum", parentMapList.size());
        return resultMap;
    }
}
src/main/java/com/zbooksoft/gdmis/controller/CatAjjxxController.java
New file
@@ -0,0 +1,575 @@
package com.zbooksoft.gdmis.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruili.wcp.common.CustomConfigUtil;
import com.ruili.wcp.data.entity.config.View;
import com.ruili.wcp.data.entity.management.User;
import com.ruili.wcp.engine.ExpressionParser;
import com.ruili.wcp.service.config.ViewService;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.zbooksoft.gdmis.config.ArchivesCustomConfig;
import com.zbooksoft.gdmis.data.entity.CatCgwjxx;
import com.zbooksoft.gdmis.data.entity.CatCheck;
import com.zbooksoft.gdmis.data.entity.CatYswjxx;
import com.zbooksoft.gdmis.service.*;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.dom4j.Document;
import org.dom4j.Element;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import java.io.File;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.zbooksoft.gdmis.common.XmlUtil.getDocument;
/**
 * @author 15280
 */
@Controller
@RequestMapping("/catAjjxx")
public class CatAjjxxController {
    @Autowired
    ViewService viewService;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    CatYswjxxService catYswjxxService;
    @Autowired
    ReadXml2017Service readXml2017Service;
    @Autowired
    ReadXml2023Service readXml2023Service;
    @Autowired
    XmlService xmlService;
    @Autowired
    CustomConfigUtil customConfigUtil;
    @Autowired
    CatCheckService catCheckService;
    private static final Logger logger = LoggerFactory.getLogger(CatAjjxxController.class);
    /**
     * 小工具xml导入页面
     *
     * @return
     */
    @RequestMapping(value = "/importXmlIndex")
    @RequiresUser
    public ModelAndView importXmlIndex() {
        ArchivesCustomConfig archivesCustomConfig = customConfigUtil.getConfigObj(ArchivesCustomConfig.class);
        ModelAndView mv = new ModelAndView("gh/catAjjxx/importXmlIndex");
        mv.addObject("archivesCustomConfig", archivesCustomConfig);
        return mv;
    }
    /**
     * XML导入
     *
     * @param file
     * @param startData
     * @return
     */
    @RequestMapping({"/importXML"})
    @ResponseBody
    @RequiresUser
    public Object importXML(@RequestParam(value = "file", required = false) MultipartFile file, String startData, String endData) {
        try {
            Document document = getDocument(file);
            Element rootElement = document.getRootElement();
            String rootName = rootElement.getName();
            xmlService.readXml(document, startData, endData);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * xml更新页面
     *
     * @return
     */
    @RequestMapping(value = "/updateXmlIndex")
    @RequiresUser
    public ModelAndView updateXmlIndex() {
        ModelAndView mv = new ModelAndView("hn/catAjjxx/updateXmlIndex");
        return mv;
    }
    /**
     * 需更新xml文件
     *
     * @param file
     * @param checkData
     * @param ajId
     * @return
     */
    @RequestMapping({"/updateXML"})
    @ResponseBody
    @RequiresUser
    public Object updateXML(@RequestParam(value = "file", required = false) MultipartFile file, String checkData, String ajId) {
        try {
            Document document = getDocument(file);
            Long updateId = Long.parseLong(ajId);
            Element rootElement = document.getRootElement();
            String rootName = rootElement.getName();
            if ("AJXX".equals(rootName)) {
//                updateXml2017Service.updateXml(document, checkData, updateId);
            } else if ("DZZLXX".equals(rootName)) {
//                updateXml2023Service.updateXml(document, checkData, updateId);
            }
            if (checkData != null && !"".equals(checkData)) {
                QueryWrapper<CatCheck> catCheckQueryWrapper = new QueryWrapper<>();
                catCheckQueryWrapper.eq("aj_id", Long.parseLong(ajId));
                catCheckQueryWrapper.isNull("check_date");
                CatCheck catCheck = catCheckService.getOne(catCheckQueryWrapper);
                catCheck.setAjId(Long.parseLong(ajId));
//                catCheck.setCheckDate(stringToDate(checkData));
                catCheckService.saveOrUpdate(catCheck);
            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * XML导入
     *
     * @param file
     * @param startData
     * @return
     */
    @RequestMapping({"/importBaoPanXML"})
    @ResponseBody
    @RequiresUser
    public Object importBaoPanXML(@RequestParam(value = "file", required = false) MultipartFile file, String startData, String endData) {
        try {
            Document document = getDocument(file);
            Element rootElement = document.getRootElement();
            String rootName = rootElement.getName();
            //暂时不判断重复
            if ("AJXX".equals(rootName)) {
                readXml2017Service.readXml(document, startData, endData);
            } else if ("DZZLXX".equals(rootName)) {
                readXml2023Service.readXml(document, startData, endData);
            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 关联附件
     *
     * @param viewId
     * @param idList
     * @return
     */
    @RequestMapping({"/relationFile"})
    @ResponseBody
    @RequiresUser
    public AjaxResponse relationFile(Long viewId, @RequestBody List<Long> idList) {
        try {
            //查询业务数据
            //获取文件信息
            Map<String, Object> resultMap = new HashMap<>();
            int ysTotal = 0;
            int ysSuccess = 0;
            int ysFailed = 0;
            ArchivesCustomConfig archivesCustomConfig = customConfigUtil.getConfigObj(ArchivesCustomConfig.class);
            View view = viewService.getViewById(viewId);
            String strIds = "";
            String strParam = "";
            if (idList != null && idList.size() > 0) {
                strIds = " and id in( " + StringUtils.join(idList, ",") + ")";
            } else {
                String sqlWhere = view.getSqlWhere();
                if (sqlWhere != null && !"".equals(sqlWhere)) {
                    //添加表达式解析,去掉${CurUserName}等之类的参数
                    if (sqlWhere.contains("$")) {
                        ExpressionParser expressionParser = new ExpressionParser();
                        sqlWhere = expressionParser.parsing(sqlWhere);
                    }
                    strParam = " and " + sqlWhere;
                }
            }
            String strSql = "select * from " + view.getMainTableName() + " where 1=1 " + strIds + strParam;
            // 查询业务数据
            List<Map<String, Object>> list = jdbcTemplate.queryForList(strSql);
//
            String uploadPath = archivesCustomConfig.getOriginalPath();
            String newUploadPath = archivesCustomConfig.getViewPath();
            String provinceCode = archivesCustomConfig.getProvinceCode();
            for (Map<String, Object> map : list) {
                String pathIn = "";
                String sgdh = map.get("SGDH").toString();
                boolean enableSimple = archivesCustomConfig.getEnableSimple();
                if (enableSimple) {
                    pathIn = sgdh;
                } else {
                    //取第一层文件夹(省馆档号取前三位,形成5位数字前加hn)
                    String pr = sgdh.substring(0, 3);
                    int num = Integer.parseInt(pr);
                    String fistFileName = String.format("%05d", num);
                    pathIn = provinceCode + fistFileName + "/";
                    //取第二层文件夹(省馆档号,形成6位数字前加hn)
                    String secondFileName = String.format("%06d", Long.parseLong(sgdh));
                    pathIn = pathIn + provinceCode + secondFileName;
                }
                //d/省馆档号
                String filePath = uploadPath + pathIn + File.separator;
                String newFilePath = newUploadPath + sgdh + File.separator;
                Long id = Long.parseLong(map.get("ID").toString());
                QueryWrapper<CatCgwjxx> catCgwjxxQueryWrapper = new QueryWrapper<>();
                catCgwjxxQueryWrapper.eq("aj_id", id);
                //d/省馆档号/
                String path = filePath + "源电子文件";
                String cdPath = filePath + "存档电子文件";
                String newCdPath = newFilePath + "存档电子文件";
                QueryWrapper<CatYswjxx> catYswjxxQueryWrapper = new QueryWrapper<>();
                catYswjxxQueryWrapper.eq("aj_id", id);
                List<CatYswjxx> catYswjxxList = catYswjxxService.list(catYswjxxQueryWrapper);
                String ysPath = filePath + "原始资料电子文件";
                String newYsPath = newFilePath + "原始资料电子文件";
                ysTotal += catYswjxxList.size();
                for (CatYswjxx catYswjxx : catYswjxxList) {
                    String wjm = catYswjxx.getWjm();
                    String yswjPath = ysPath + File.separator + wjm;
                    String newYswjPath = newYsPath + File.separator + wjm;
                    File file = new File(yswjPath);
                    if (file.exists() && file.isFile()) {
                        catYswjxx.setWjlj(yswjPath);
                        ysSuccess++;
                    } else {
                        ysFailed++;
                    }
                    catYswjxxService.saveOrUpdate(catYswjxx);
                }
            }
            resultMap.put("ysTotal", ysTotal);
            resultMap.put("ysSuccess", ysSuccess);
            resultMap.put("ysFailed", ysFailed);
            AjaxResponse ajaxResponse = new AjaxResponse(true);
            if (resultMap != null) {
                StringBuilder sb = new StringBuilder();
                sb.append("top.layer.open({");
                sb.append("   title : '提示',");
                sb.append("   type : 2,");
                sb.append("   area : [ '700px', '180px' ],");
                sb.append("   fixed : true, ");
                sb.append("   content : 'common/relationFileTips?ysTotal=" + resultMap.get("ysTotal") + "&ysSuccess=" + resultMap.get("ysSuccess") + "&ysFailed=" + resultMap.get("ysFailed") + "'");
                sb.append("});");
                Map<String, String> result = new HashMap<String, String>();
                result.put("jsExpression", sb.toString());
                ajaxResponse.setResult(result);
            }
            return ajaxResponse;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 关联附件
     *
     * @param viewId
     * @param idList
     * @return
     */
    @RequestMapping({"/relationFiles"})
    @ResponseBody
    @RequiresUser
    public AjaxResponse relationFiles(Long viewId, @RequestBody List<Long> idList) {
        try {
            //查询业务数据
            //获取文件信息
            Map<String, Object> resultMap = new HashMap<>();
            int ysTotal = 0;
            int ysSuccess = 0;
            int ysFailed = 0;
            ArchivesCustomConfig archivesCustomConfig = customConfigUtil.getConfigObj(ArchivesCustomConfig.class);
            View view = viewService.getViewById(viewId);
            String strIds = "";
            String strParam = "";
            if (idList != null && idList.size() > 0) {
                strIds = " and id in( " + StringUtils.join(idList, ",") + ")";
            } else {
                String sqlWhere = view.getSqlWhere();
                if (sqlWhere != null && !"".equals(sqlWhere)) {
                    //添加表达式解析,去掉${CurUserName}等之类的参数
                    if (sqlWhere.contains("$")) {
                        ExpressionParser expressionParser = new ExpressionParser();
                        sqlWhere = expressionParser.parsing(sqlWhere);
                    }
                    strParam = " and " + sqlWhere;
                }
            }
            String strSql = "select * from " + view.getMainTableName() + " where 1=1 " + strIds + strParam;
            // 查询业务数据
            List<Map<String, Object>> list = jdbcTemplate.queryForList(strSql);
//
            String uploadPath = archivesCustomConfig.getOriginalPath();
            for (Map<String, Object> map : list) {
//                String dh = map.get("DH").toString();
                String dh = map.get("XMKYQBH").toString();
                //d/省馆档号
                String filePath = uploadPath + dh + File.separator + "电子文件" + File.separator;
                Long id = Long.parseLong(map.get("ID").toString());
                QueryWrapper<CatYswjxx> catYswjxxQueryWrapper = new QueryWrapper<>();
                catYswjxxQueryWrapper.eq("aj_id", id);
                List<CatYswjxx> catYswjxxList = catYswjxxService.list(catYswjxxQueryWrapper);
                ysTotal += catYswjxxList.size();
                for (CatYswjxx catYswjxx : catYswjxxList) {
                    String yswjPath = "";
                    String wjtm = catYswjxx.getWjtm();
                    String wjgs = catYswjxx.getWjgs();
                    if (wjgs != null && !"".equals(wjgs)) {
                        String wjm = wjtm + wjgs;
                        yswjPath = filePath + wjm;
                    } else {
                        yswjPath = filePath + wjtm;
                    }
                    File file = new File(yswjPath);
                    if (file.exists() && file.isFile()) {
                        long fileSize = file.length();
                        double fileSizeMB = fileSize / (1024.0 * 1024.0);
                        String fileSizeStr = String.format("%.2f", fileSizeMB);
                        catYswjxx.setWjdx(fileSizeStr);
//                        catYswjxx.setWjgs("pdf");
                        catYswjxx.setWjlj(yswjPath);
                        ysSuccess++;
                    } else {
                        ysFailed++;
                    }
                    catYswjxx.setWjm(wjtm);
                    catYswjxxService.saveOrUpdate(catYswjxx);
                }
            }
            resultMap.put("ysTotal", ysTotal);
            resultMap.put("ysSuccess", ysSuccess);
            resultMap.put("ysFailed", ysFailed);
            AjaxResponse ajaxResponse = new AjaxResponse(true);
            if (resultMap != null) {
                StringBuilder sb = new StringBuilder();
                sb.append("top.layer.open({");
                sb.append("   title : '提示',");
                sb.append("   type : 2,");
                sb.append("   area : [ '700px', '180px' ],");
                sb.append("   fixed : true, ");
                sb.append("   content : 'common/relationFileTips?ysTotal=" + resultMap.get("ysTotal") + "&ysSuccess=" + resultMap.get("ysSuccess") + "&ysFailed=" + resultMap.get("ysFailed") + "'");
                sb.append("});");
                Map<String, String> result = new HashMap<String, String>();
                result.put("jsExpression", sb.toString());
                ajaxResponse.setResult(result);
            }
            return ajaxResponse;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 关联附件
     *
     * @param viewId
     * @param idList
     * @return
     */
    @RequestMapping({"/digitalRelationFiles"})
    @ResponseBody
    @RequiresUser
    public AjaxResponse digitalRelationFiles(Long viewId, @RequestBody List<Long> idList) {
        try {
            //查询业务数据
            //获取文件信息
            Map<String, Object> resultMap = new HashMap<>();
            int ysTotal = 0;
            int ysSuccess = 0;
            int ysFailed = 0;
            ArchivesCustomConfig archivesCustomConfig = customConfigUtil.getConfigObj(ArchivesCustomConfig.class);
            View view = viewService.getViewById(viewId);
            String strIds = "";
            String strParam = "";
            if (idList != null && idList.size() > 0) {
                strIds = " and id in( " + StringUtils.join(idList, ",") + ")";
            } else {
                String sqlWhere = view.getSqlWhere();
                if (sqlWhere != null && !"".equals(sqlWhere)) {
                    //添加表达式解析,去掉${CurUserName}等之类的参数
                    if (sqlWhere.contains("$")) {
                        ExpressionParser expressionParser = new ExpressionParser();
                        sqlWhere = expressionParser.parsing(sqlWhere);
                    }
                    strParam = " and " + sqlWhere;
                }
            }
            String strSql = "select * from " + view.getMainTableName() + " where 1=1 " + strIds + strParam;
            // 查询业务数据
            List<Map<String, Object>> list = jdbcTemplate.queryForList(strSql);
//
            String uploadPath = archivesCustomConfig.getOriginalPath();
            for (Map<String, Object> map : list) {
                String dh = map.get("DH").toString();
                //d/省馆档号
                String filePath = uploadPath + dh + File.separator;
                Long id = Long.parseLong(map.get("ID").toString());
                QueryWrapper<CatYswjxx> catYswjxxQueryWrapper = new QueryWrapper<>();
                catYswjxxQueryWrapper.eq("aj_id", id);
                List<CatYswjxx> catYswjxxList = catYswjxxService.list(catYswjxxQueryWrapper);
                ysTotal += catYswjxxList.size();
                for (CatYswjxx catYswjxx : catYswjxxList) {
                    String wjDh = catYswjxx.getDh();
                    String yswjPath = "";
                    yswjPath = filePath + wjDh + File.separator + wjDh + ".pdf";
                    File file = new File(yswjPath);
                    if (file.exists() && file.isFile()) {
                        long fileSize = file.length();
                        double fileSizeMB = fileSize / (1024.0 * 1024.0);
                        String fileSizeStr = String.format("%.2f", fileSizeMB);
                        catYswjxx.setWjdx(fileSizeStr);
                        catYswjxx.setWjgs(".pdf");
                        catYswjxx.setWjlj(yswjPath);
                        catYswjxx.setWjm(wjDh);
                        ysSuccess++;
                    } else {
                        ysFailed++;
                    }
                    catYswjxxService.saveOrUpdate(catYswjxx);
                }
            }
            resultMap.put("ysTotal", ysTotal);
            resultMap.put("ysSuccess", ysSuccess);
            resultMap.put("ysFailed", ysFailed);
            AjaxResponse ajaxResponse = new AjaxResponse(true);
            if (resultMap != null) {
                StringBuilder sb = new StringBuilder();
                sb.append("top.layer.open({");
                sb.append("   title : '提示',");
                sb.append("   type : 2,");
                sb.append("   area : [ '700px', '180px' ],");
                sb.append("   fixed : true, ");
                sb.append("   content : 'common/relationFileTips?ysTotal=" + resultMap.get("ysTotal") + "&ysSuccess=" + resultMap.get("ysSuccess") + "&ysFailed=" + resultMap.get("ysFailed") + "'");
                sb.append("});");
                Map<String, String> result = new HashMap<String, String>();
                result.put("jsExpression", sb.toString());
                ajaxResponse.setResult(result);
            }
            return ajaxResponse;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 档案验收页面
     *
     * @return
     */
    @RequestMapping(value = "/checkIndex")
    @RequiresUser
    public ModelAndView acceptanceIndex() {
        ModelAndView mv = new ModelAndView("gh/catAjjxx/checkIndex");
        return mv;
    }
    /**
     * 资料验收
     *
     * @return
     */
    @RequestMapping({"/check"})
    @ResponseBody
    @RequiresUser
    public Object check(@RequestBody Map<String, Object> postData) {
        try {
            Subject currentUser = SecurityUtils.getSubject();
            Session session = currentUser.getSession();
            User user = (User) session.getAttribute("user");
            Long id = Long.parseLong(postData.get("id").toString());
            int checkState = Integer.parseInt(postData.get("checkState").toString());
            String selectSql = "SELECT * FROM BUS_TRANSFER_LOG WHERE ID =" + id;
            Map<String, Object> map = jdbcTemplate.queryForMap(selectSql);
            Object ajId = map.get("AJ_ID");
            CatCheck catCheck = new CatCheck();
            catCheck.setItemId(id);
            catCheck.setAjId(Long.parseLong(ajId.toString()));
            catCheck.setQuestion(postData.get("question").toString());
            catCheck.setIsPass(checkState);
            catCheck.setCreateTime(new Date());
            catCheck.setCreateUserName(user.getUserName());
            catCheck.setCreateUserId(user.getUserId());
            catCheck.setCheckQuestion(postData.get("checkQuestion") == null ? "" : postData.get("checkQuestion").toString());
            catCheckService.saveOrUpdate(catCheck);
            String updateSql = "update BUS_TRANSFER_LOG set YSZT = '" + checkState + "' where ID = " + id;
            jdbcTemplate.execute(updateSql);
            String updateSqlY = "update CAT_ITEM_YSWJXX set YSZT = '" + checkState + "' where YJ_ID = " + id;
            jdbcTemplate.execute(updateSqlY);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
}
src/main/java/com/zbooksoft/gdmis/controller/CatYswjxxController.java
New file
@@ -0,0 +1,417 @@
package com.zbooksoft.gdmis.controller;
import com.alibaba.fastjson.JSONObject;
import com.ruili.wcp.common.CustomConfigUtil;
import com.ruili.wcp.common.StringUtil;
import com.ruili.wcp.common.excel.PoiUtil;
import com.ruili.wcp.configsettting.SystemConfig;
import com.ruili.wcp.data.entity.config.Module;
import com.ruili.wcp.data.entity.management.User;
import com.ruili.wcp.engine.form.IFormData;
import com.ruili.wcp.service.config.ModuleService;
import com.ruili.wcp.service.config.ViewService;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.zbooksoft.gdmis.common.PdfUtil;
import com.zbooksoft.gdmis.data.entity.CatYswjxx;
import com.zbooksoft.gdmis.data.entity.PackingManage;
import com.zbooksoft.gdmis.service.CatCheckService;
import com.zbooksoft.gdmis.service.CatYswjxxService;
import com.zbooksoft.gdmis.service.PackingManageService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static com.zbooksoft.gdmis.common.ZipUtil.copyFile;
import static com.zbooksoft.gdmis.common.ZipUtil.zipFile;
/**
 * @author 15280
 */
@Controller
@RequestMapping("/catYswjxx")
public class CatYswjxxController {
    @Autowired
    ViewService viewService;
    @Autowired
    PackingManageService packingManageService;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    CatYswjxxService catYswjxxService;
    @Autowired
    CustomConfigUtil customConfigUtil;
    @Autowired
    ModuleService moduleService;
    @Autowired
    IFormData iform;
    @Autowired
    CatCheckService catCheckService;
    private static final Logger logger = LoggerFactory.getLogger(CatYswjxxController.class);
    /**
     * 文件拆分
     *
     * @return
     */
    @RequestMapping({"/split"})
    @ResponseBody
    @RequiresUser
    public Object split(Long moduleId, Long viewId, Long id, @RequestBody JSONObject jsonData) {
        try {
            //获取拆几份
            String count = StringUtil.nullToEmpty(jsonData.getString("returnOpinion")).trim();
            if (jsonData.containsKey("ids")) {
                ArrayList<String> ids = (ArrayList<String>) jsonData.get("ids");
                for (String longId : ids) {
                    Module module = moduleService.getByIdModule(moduleId);
                    String mainTableName = module.getMainTableName();
                    String selectSql = "select * from " + mainTableName + " where ID = " + longId;
                    Map<String, Object> map = jdbcTemplate.queryForMap(selectSql);
                    addPacking(map, count);
                }
            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 文件拆分
     *
     * @return
     */
    @RequestMapping({"/addCg"})
    @ResponseBody
    @RequiresUser
    public Object addCg(Long moduleId, Long viewId, Long id, @RequestBody JSONObject jsonData) {
        try {
            //获取拆几份
            String count = StringUtil.nullToEmpty(jsonData.getString("returnOpinion")).trim();
            if (jsonData.containsKey("ids")) {
                ArrayList<String> ids = (ArrayList<String>) jsonData.get("ids");
                String cgSql = "select NVL(max(BGBH), 0) BGBH FROM CAT_ITEM_CGWJXX";
                Map<String, Object> stringMap = jdbcTemplate.queryForMap(cgSql);
                int maxDH = Integer.parseInt(stringMap.get("BGBH").toString());
                for (int i = 0; i < ids.size(); i++) {
                    int newDH = maxDH + 1 + i;
                    String newDhString = String.format("%04d", newDH);
                    String sql = "select * from CAT_ITEM_YSWJXX where id = " + ids.get(i);
                    Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(sql);
                    String sl = stringObjectMap.get("SL") == null ? "0" : stringObjectMap.get("SL").toString();
                    Integer slInt = Integer.parseInt(sl) - Integer.parseInt(count);
                    if (slInt < 0) {
                        slInt = 0;
                    }
                    stringObjectMap.put("BGBH", newDhString);
                    LocalDateTime currentDate = LocalDateTime.now();
                    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
                    String formattedDate = currentDate.format(formatter);
                    stringObjectMap.put("CREATE_TIME", formattedDate);
                    stringObjectMap.put("MODIFY_TIME", formattedDate);
                    stringObjectMap.put("CDDZWJLJ", stringObjectMap.get("WJLJ"));
                    stringObjectMap.put("SL", count);
                    String jnxh = stringObjectMap.get("JNXH") == null ? "" : stringObjectMap.get("JNXH").toString();
                    String newDh = newDhString + "-" + jnxh;
                    stringObjectMap.put("DH", newDh);
                    iform.insert(1823017354756390913L, stringObjectMap);
                    String updateSql = "update CAT_ITEM_YSWJXX set SL = '" + slInt + "' where ID = " + ids.get(i);
                    jdbcTemplate.update(updateSql);
                }
            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 添加临时位置
     *
     * @return
     */
    @RequestMapping({"/addTemp"})
    @ResponseBody
    @RequiresUser
    public Object addTemp(Long moduleId, Long viewId, Long id, @RequestBody JSONObject jsonData) {
        try {
            //获取拆几份
            String count = StringUtil.nullToEmpty(jsonData.getString("returnOpinion")).trim();
            if (jsonData.containsKey("ids")) {
                ArrayList<String> ids = (ArrayList<String>) jsonData.get("ids");
                for (String longId : ids) {
                    Module module = moduleService.getByIdModule(moduleId);
                    String mainTableName = module.getMainTableName();
                    String updateSql = "update " + mainTableName + " set HH = '" + count + "' where ID = " + longId;
                    int update = jdbcTemplate.update(updateSql);
                }
            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 文件装盒
     *
     * @return
     */
    @RequestMapping({"/packagingBox"})
    @ResponseBody
    @RequiresUser
    public Object packagingBox(Long moduleId, Long viewId, Long id, @RequestBody JSONObject jsonData) {
        try {
            //获取拆几份
            String count = StringUtil.nullToEmpty(jsonData.getString("returnOpinion")).trim();
            if (jsonData.containsKey("ids")) {
                ArrayList<String> ids = (ArrayList<String>) jsonData.get("ids");
                for (String longId : ids) {
                    Module module = moduleService.getByIdModule(moduleId);
                    String mainTableName = module.getMainTableName();
                    String selectSql = "select * from " + mainTableName + " where ID = " + longId;
                    Map<String, Object> map = jdbcTemplate.queryForMap(selectSql);
                    addPacking(map, count);
                }
            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    private void addPacking(Map<String, Object> map, String count) {
        String num = "";
        int i = Integer.parseInt(count);
        String id = StringUtil.nullToEmpty(map.get("ID")).trim();
        String dh = StringUtil.nullToEmpty(map.get("DH")).trim();
        packingManageService.removeByItemId(Long.parseLong(id));
        if (dh != null && !dh.equals("")) {
            num = dh;
        }
        String ajId = StringUtil.nullToEmpty(map.get("AJ_ID")).trim();
        for (int j = 0; j <= i; j++) {
            PackingManage packingManage = new PackingManage();
            if (j == 0) {
                packingManage.setItemNum(num);
            } else {
                packingManage.setItemNum(num + "-" + j);
            }
            packingManage.setItemId(id);
            packingManage.setAjId(ajId);
            packingManage.setType(0);
            packingManage.setCreateTime(new java.util.Date());
            packingManageService.saveOrUpdate(packingManage);
        }
    }
    /**
     * 全部打包
     *
     * @return
     */
    @RequestMapping("/extractFile")
    @RequiresUser
    public void extractFile(HttpServletRequest request, HttpServletResponse response, String ids) {
        try {
            String filePath = "";
            String generatePath = "";
            Subject currentUser = SecurityUtils.getSubject();
            Session session = currentUser.getSession();
            User user = (User) session.getAttribute("user");
            String userName = user.getUserName();
            String timestamp = Long.toString(System.currentTimeMillis());
            try {
                // 读取文件存放路径
                SystemConfig config = SystemConfig.getInstance();
                filePath = config.getAttachUploadPath() + "dataPack" + File.separator + userName + "_" + timestamp + File.separator;
//                for (int i = 0; i < idList.length; i++) {
                String wjljSql = "SELECT WJLJ FROM CAT_ITEM_YSWJXX WHERE  ID  = " + ids;
                List<Map<String, Object>> wjljList = jdbcTemplate.queryForList(wjljSql);
                if (wjljList.size() > 0) {
                    String newSavePath = filePath;
                    if (wjljList.get(0).get("WJLJ") != null) {
                        String cddzwjlj = wjljList.get(0).get("WJLJ").toString();
                        File file = new File(cddzwjlj);
                        String name = file.getName();
                        if (name.contains(".pdf") || name.contains(".PDF")) {
                            String parent = file.getParent();
                            String newName = "tmp_" + name;
                            String newCddzwjlj = parent + File.separator + newName;
                            PdfUtil.addBlankPageAtBeginning(cddzwjlj, newCddzwjlj);
                            cddzwjlj = newCddzwjlj;
                        }
                        copyFile(cddzwjlj, newSavePath + File.separator + name);
                    }
                }
//                }
                // 压缩文件
                generatePath = zipFile(new File(filePath), "rar");
            } catch (Exception ex) {
                logger.error(ex.getMessage(), ex);
            }
            File file = new File(generatePath);
            InputStream inStream;
            try {
                inStream = new FileInputStream(generatePath);// 文件的存放路径
                response.reset();
                // 设置输出的格式
                String userAgent = request.getHeader("User-Agent");
                // 根据获取的浏览器进行编码
                String encodeFilename = PoiUtil.encodeDownloadFilename(file.getName(), userAgent);
                response.setHeader("content-disposition", "filename=" + encodeFilename);
                // 文件后缀
                response.setContentType("application/vnd.ms-excel;charset=UTF-8");
                // 循环取出流中的数据
                byte[] b = new byte[100];
                int len;
                while ((len = inStream.read(b)) > 0)
                    response.getOutputStream().write(b, 0, len);
                inStream.close();
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                file.delete();
            }
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
    }
//    /**
//     * 添加到成果资料
//     *
//     * @return
//     */
//    @RequestMapping({"/addCg"})
//    @ResponseBody
//    @RequiresUser
//    public Object addCg(Long moduleId, Long viewId, Long id, @RequestBody JSONObject jsonData) {
//        try {
//            //获取拆几份
//            String count = StringUtil.nullToEmpty(jsonData.getString("returnOpinion")).trim();
//            if (jsonData.containsKey("ids")) {
//                ArrayList<String> ids = (ArrayList<String>) jsonData.get("ids");
//                for (String longId : ids) {
//                    Module module = moduleService.getByIdModule(moduleId);
//                    String mainTableName = module.getMainTableName();
//                    String selectSql = "select * from " + mainTableName + " where ID = " + longId;
//                    Map<String, Object> map = jdbcTemplate.queryForMap(selectSql);
//                    addPacking(map, count);
//                }
//            }
//            return new AjaxResponse(true);
//        } catch (Exception e) {
//            logger.error(e.getMessage(), e);
//            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
//        }
//    }
    /**
     * 导入页面
     *
     * @param type 0:从转孔基本信息进入 1:从钻孔图幅进入
     * @return
     */
    @RequestMapping({"/updateFileTypeIndex"})
    @RequiresUser
    public ModelAndView importIndex(Integer type) {
        ModelAndView mv = new ModelAndView("gh/catAjjxx/updateFileTypeIndex");
        return mv;
    }
    /**
     * 获取文件类型
     *
     * @return
     */
    @RequestMapping(value = "/getFileType")
    @ResponseBody
    @RequiresUser
    public List<Map<String, Object>> getFileType() {
        String sql = "SELECT param_name , param_value  FROM sys_keyword_param where  keyword_id = 1830441538759495681";
        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
        return mapList;
    }
    /**
     * 获取文件类型
     *
     * @return
     */
    @RequestMapping(value = "/updateFileType")
    @ResponseBody
    @RequiresUser
    public Object updateFileType(String fileType, @RequestBody ArrayList<Long> idList) {
        int newXh = 0;
        CatYswjxx yswjxx = catYswjxxService.getById(idList.get(0));
        String maxFileType = catYswjxxService.getMaxFileType(yswjxx.getAjId(), fileType);
        if (maxFileType != null) {
            newXh = Integer.parseInt(maxFileType);
        }
        try {
            for (Long id : idList) {
                //JNXH
                CatYswjxx catYswjxx = catYswjxxService.getById(id);
                newXh = newXh + 1;
                catYswjxx.setXh(Integer.toString(newXh));
                String substring = fileType.substring(fileType.indexOf("/") + 1);
                String newXhFormatted = String.format("%04d", newXh);
                String newJnxh = substring + newXhFormatted;
                catYswjxx.setJnxh(newJnxh);
                catYswjxx.setWjlx(fileType);
                catYswjxxService.updateById(catYswjxx);
            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    public static void main(String[] args) {
        String fileType = "观/G";
        String substring = fileType.substring(fileType.indexOf("/") + 1);
        System.out.println(substring);
    }
}
src/main/java/com/zbooksoft/gdmis/controller/CommonController.java
New file
@@ -0,0 +1,80 @@
package com.zbooksoft.gdmis.controller;
import com.ruili.wcp.service.config.ModuleService;
import com.zbooksoft.gdmis.service.*;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**
 * @Description:
 * @Author: zhai
 * @Date: 2024/9/3
 **/
@Controller
@RequestMapping("/common")
public class CommonController {
//    @Autowired
//    JdbcTemplate jdbcTemplate;
//    @Autowired
//    ModuleService moduleService;
//
//    @Autowired
//    UserCheckService userCheckService;
//
//    @Autowired
//    CatAjjxxService catAjjxxService;
//    @Autowired
//    BorrowDetailService borrowDetailService;
//
//    @Autowired
//    ProcessingDetailService processingDetailService;
//
//    @Autowired
//    UtilizationUserService utilizationUserService;
    private static final Logger logger = LoggerFactory.getLogger(CommonController.class);
    /**
     * 利用提示
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/commonTips")
    @RequiresUser
    public ModelAndView commonTips(Integer addNum, String type, Integer repeatNum, Integer existFileNum, Integer existItemNum, String urlPath) throws Exception {
        ModelAndView mav = new ModelAndView("gh/common/commonTips");
        mav.addObject("addNum", addNum);
        mav.addObject("repeatNum", repeatNum);
        mav.addObject("type", type);
        mav.addObject("existFileNum", existFileNum);
        mav.addObject("existItemNum", existItemNum);
        mav.addObject("existItemNum", existItemNum);
        mav.addObject("urlPath", urlPath);
        return mav;
    }
    /**
     * 关联附件提示
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/relationFileTips")
    @RequiresUser
    public ModelAndView relationFileTips(Integer ysTotal, Integer ysSuccess, Integer ysFailed) throws Exception {
        ModelAndView mav = new ModelAndView("gh/common/relationFileTips");
        mav.addObject("ysTotal", ysTotal);
        mav.addObject("ysSuccess", ysSuccess);
        mav.addObject("ysFailed", ysFailed);
        return mav;
    }
}
src/main/java/com/zbooksoft/gdmis/controller/FileViewController.java
New file
@@ -0,0 +1,546 @@
package com.zbooksoft.gdmis.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.ruili.wcp.common.CustomConfigUtil;
import com.ruili.wcp.configsettting.SystemConfig;
import com.ruili.wcp.data.entity.management.Dept;
import com.ruili.wcp.data.entity.management.User;
import com.ruili.wcp.service.config.ViewService;
import com.ruili.wcp.service.management.DeptService;
import com.ruili.wcp.service.management.UserService;
import com.ruili.wcp.web.common.UserFriendlyException;
import com.ruili.wcp.web.model.easyui.TreeVO;
import com.zbooksoft.gdmis.config.ArchivesCustomConfig;
import com.zbooksoft.gdmis.data.entity.*;
import com.zbooksoft.gdmis.service.*;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 档案浏览控制器
 *
 * @author PanYi
 */
@Controller
@RequestMapping("/fileView")
public class FileViewController {
    @Autowired
    ViewService viewService;
    @Autowired
    CatAjjxxService catAjjxxService;
    @Autowired
    CatCgwjxxService catCgwjxxService;
    @Autowired
    CatSwyxxxService catSwyxxxService;
    @Autowired
    CatSwajxxService catSwajxxService;
    @Autowired
    CatYswjxxService catYswjxxService;
    @Autowired
    CustomConfigUtil customConfigUtil;
    @Autowired
    BorrowDetailService borrowDetailService;
    @Autowired
    ProcessingDetailService processingDetailService;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    UtilizationUserService utilizationUserService;
    @Autowired
    UserService userService;
    @Autowired
    DeptService deptService;
    private static final Logger logger = LoggerFactory.getLogger(FileViewController.class);
    /**
     * 档案浏览首页
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = {"", "index"})
    @RequiresUser
    public ModelAndView index(Long keyId, Integer fileType, String keyword) throws Exception {
        ModelAndView mav = new ModelAndView("gh/fileView/index");//指向index.jsp文件
        mav.addObject("keyId", keyId);
        mav.addObject("fileType", fileType);
        mav.addObject("keyword", keyword);
        if (fileType == 0) {
            CatAjjxx catAjjxx = catAjjxxService.getById(keyId);
            mav.addObject("title", catAjjxx.getZlmc());
        } else if (fileType == 1) {
            CatYswjxx catYswjxx = catYswjxxService.getById(keyId);
            mav.addObject("title", catYswjxx.getWjtm());
        } else if (fileType == 2) {
            CatCgwjxx catCgwjxx = catCgwjxxService.getById(keyId);
            mav.addObject("title", catCgwjxx.getWjtm());
        }
        return mav;
    }
    /**
     * 获取文件列表
     *
     * @param
     * @param keyId
     * @return
     */
    @RequestMapping(value = "/getFileList", produces = "application/json; charset=utf-8")
    @ResponseBody
    @RequiresUser
    public Object getFileList(Long keyId, Integer fileType) {//keyId  attatchId   value是对应档案的id、
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        String deptName = user.getDeptName();
        Integer userSecurityCode = 3;
        if (deptName != null && "外部用户".equals(deptName)) {
            QueryWrapper<UtilizationUser> utilizationUserQueryWrapper = new QueryWrapper<>();
            utilizationUserQueryWrapper.eq("user_id", user.getUserId());
            UtilizationUser utilizationUser = utilizationUserService.getOne(utilizationUserQueryWrapper);
//            userSecurityCode = utilizationUser.getSecurityCode();
        }
        List<TreeVO> list = new ArrayList<>();
        if (fileType == 0) {
            QueryWrapper<CatCgwjxx> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("aj_id", keyId);
            List<CatCgwjxx> catCgwjxxList = catCgwjxxService.list(queryWrapper);
            for (CatCgwjxx catCgwjxx : catCgwjxxList) {
                try {
                    //            if (catCgwjxx.getSecurityCode() == null || (catCgwjxx.getSecurityCode() != null && catCgwjxx.getSecurityCode() <= userSecurityCode)) {
                    TreeVO vo = new TreeVO();
                    vo.setId(catCgwjxx.getId());
                    vo.setText(catCgwjxx.getWjtm());
                    String lllj = catCgwjxx.getCddzwjlj();
                    if (lllj != null) {
                        String extension = lllj.substring(lllj.lastIndexOf('.'));
                        String iconCls = getFileIconCls(extension);
                        vo.setIconCls("fa " + iconCls);
                    } else {
                        String iconCls = getFileIconCls(".pdf");
                        vo.setIconCls("fa " + iconCls);
                    }
                    Map<String, Object> attributes = new HashMap<>();
                    attributes.put("isFile", true);
                    vo.setAttributes(attributes);
                    list.add(vo);
                } catch (Exception e) {
                }
            }
            QueryWrapper<CatYswjxx> ysQueryWrapper = new QueryWrapper<>();
            ysQueryWrapper.eq("aj_id", keyId);
            List<CatYswjxx> catYswjxxList = catYswjxxService.list(ysQueryWrapper);
            for (CatYswjxx catYswjxx : catYswjxxList) {
                try {
                    //            if (catCgwjxx.getSecurityCode() == null || (catCgwjxx.getSecurityCode() != null && catCgwjxx.getSecurityCode() <= userSecurityCode)) {
                    TreeVO vo = new TreeVO();
                    vo.setId(catYswjxx.getId());
                    vo.setText(catYswjxx.getWjtm());
                    String lllj = catYswjxx.getWjlj();
                    if (lllj != null) {
                        String extension = lllj.substring(lllj.lastIndexOf('.'));
                        String iconCls = getFileIconCls(extension);
                        vo.setIconCls("fa " + iconCls);
                    } else {
                        String iconCls = getFileIconCls(".pdf");
                        vo.setIconCls("fa " + iconCls);
                    }
                    Map<String, Object> attributes = new HashMap<>();
                    attributes.put("isFile", true);
                    vo.setAttributes(attributes);
                    list.add(vo);
                } catch (Exception e) {
                }
            }
        } else if (fileType == 1) {
            CatYswjxx catYswjxx = catYswjxxService.getById(keyId);
            TreeVO vo = new TreeVO();
            vo.setId(catYswjxx.getId());
            vo.setText(catYswjxx.getWjtm());
            String lllj = catYswjxx.getWjlj();
            if (lllj != null) {
                String extension = lllj.substring(lllj.lastIndexOf('.'));
                String iconCls = getFileIconCls(extension);
                vo.setIconCls("fa " + iconCls);
            } else {
                String iconCls = getFileIconCls(".pdf");
                vo.setIconCls("fa " + iconCls);
            }
            Map<String, Object> attributes = new HashMap<>();
            attributes.put("isFile", true);
            vo.setAttributes(attributes);
            list.add(vo);
        } else if (fileType == 2) {
            CatCgwjxx catCgwjxx = catCgwjxxService.getById(keyId);
            TreeVO vo = new TreeVO();
            vo.setId(catCgwjxx.getId());
            vo.setText(catCgwjxx.getWjtm());
            String lllj = catCgwjxx.getCddzwjlj();
            if (lllj != null) {
                String extension = lllj.substring(lllj.lastIndexOf('.'));
                String iconCls = getFileIconCls(extension);
                vo.setIconCls("fa " + iconCls);
            } else {
                String iconCls = getFileIconCls(".pdf");
                vo.setIconCls("fa " + iconCls);
            }
            Map<String, Object> attributes = new HashMap<>();
            attributes.put("isFile", true);
            vo.setAttributes(attributes);
            list.add(vo);
        }
        return list;
    }
    //borrow_approval_hn.ureport%202.xml
    private String getFileIconCls(String extension) {
        String iconCls = "";
        switch (extension.toLowerCase()) {
            case ".doc":
            case ".docx":
                iconCls = "fa-file-word-o";
                break;
            case ".xls":
            case ".xlsx":
                iconCls = "fa-file-excel-o";
                break;
            case ".ppt":
            case ".pptx":
                iconCls = "fa-file-powerpoint-o";
                break;
            case ".pdf":
                iconCls = "fa-file-pdf-o";
                break;
            case ".txt":
                iconCls = "fa-file-text-o";
                break;
            case ".jpg":
            case ".png":
            case ".bmp":
            case ".jpeg":
            case ".gif":
            case ".tif":
                iconCls = "fa-file-image-o";
                break;
            case ".cda":
            case ".wav":
            case ".mp3":
            case ".mid":
            case ".wma":
            case ".aif":
            case ".aiff":
            case ".ra":
            case ".ape":
            case ".au":
            case ".ogg":
            case ".m3u8":
                iconCls = "fa-file-audio-o";
                break;
            case ".avi":
            case ".mov":
            case ".asf":
            case ".rm":
            case ".mpeg":
            case ".mpg":
            case ".dat":
            case ".qt":
            case ".wmv":
            case ".mp4":
            case ".webm":
            case ".ogv":
                iconCls = "fa-file-video-o";
                break;
            default:
                iconCls = "fa-file-o";
                break;
        }
        return iconCls;
    }
    /**
     * 浏览文件
     *
     * @param keyId
     * @param type  0 成果文件 1原始文件
     * @return
     * @throws Exception
     */
    @RequestMapping("viewFile")
    @RequiresUser
    public ModelAndView viewFile(String keyId, Integer type, String keyword) throws Exception {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        SystemConfig config = SystemConfig.getInstance();
        String[] dirs = config.getExternalVirtualDirectory().split(";");
        String viewPath = "";
        String secretPageNumber = "";
        // 转发到平台的文件浏览页面
        ModelAndView mav = new ModelAndView("redirect:/general/viewFile");
        mav.addObject("keyword", keyword);
        if (type == 2) {
            CatCgwjxx catCgwjxx = catCgwjxxService.getById(keyId);
            viewPath = catCgwjxx.getLllj();
            if (viewPath != null && (viewPath.endsWith(".pdf") || viewPath.endsWith(".pdf"))) {
                //判断前置页码
                secretPageNumber = catCgwjxx.getSmym();
                String newSecretPageNumber = "";
                int qzyInt = 0;
                String qzy = catCgwjxx.getQzy();
                try {
                    if (StringUtils.isNotBlank(qzy)) {
                        qzyInt = Integer.parseInt(qzy);
                        String[] split = secretPageNumber.split(",");
                        for (int i = 0; i < split.length; i++) {
                            int parseInt = Integer.parseInt(split[i]);
                            int qzyIntAll = qzyInt + parseInt;
                            newSecretPageNumber += qzyIntAll + ",";
                        }
                        secretPageNumber = newSecretPageNumber.substring(0, newSecretPageNumber.length() - 1);
                    }
                } catch (Exception e) {
                    logger.error("前页码转换异常:{}", qzy);
                }
            }
        } else if (type == 1) {
            CatYswjxx catYswjxx = catYswjxxService.getById(keyId);
            viewPath = catYswjxx.getWjlj();
        } else if (type == 0) {
            CatCgwjxx catCgwjxx = catCgwjxxService.getById(keyId);
            if (catCgwjxx != null) {
                viewPath = catCgwjxx.getLllj();
            } else {
                CatYswjxx catYswjxx = catYswjxxService.getById(keyId);
                viewPath = catYswjxx.getWjlj();
            }
        } else {
            String attachExtension = "该附件不存在!";
            session.setAttribute("browse_", false);
            throw new UserFriendlyException("错误提示", attachExtension);
        }
        if (viewPath == null) {
            String attachExtension = "该附件不存在!";
            session.setAttribute("browse_", false);
            throw new UserFriendlyException("错误提示", attachExtension);
        }
        String attachViewUrl = "";
        for (int i = 0; i < dirs.length; i++) {
            String dir = dirs[i];
            String[] dirArr = dir.split("\\|");
            if (dirArr.length == 2 && viewPath.contains(dirArr[0])) {
                if (viewPath.endsWith(".tif") || viewPath.endsWith(".tiff")) {
                    attachViewUrl = viewPath.replace(dirArr[0], dirArr[1]);
                } else {
                    attachViewUrl = viewPath.replace(dirArr[0], dirArr[1]);
                    attachViewUrl = attachViewUrl.replace("\\", "/");
                }
            }
        }
        if (attachViewUrl == null || attachViewUrl.equals("")) {
            String attachExtension = "该附件不存在!";
            session.setAttribute("browse_", false);
            throw new UserFriendlyException("错误提示", attachExtension);
        }
        if (!authorizeAttachPermission(Long.parseLong(keyId), type)) {
            ModelAndView customMav = new ModelAndView("gh/fileView/noAuthorize");
            return customMav;
        }
        logger.info("电子文件浏览路径:{}", attachViewUrl);
        mav.addObject("attachViewUrl", attachViewUrl);
        if (user.getUserType() != 0) {
            mav.addObject("secretPageNumber", secretPageNumber);
        }
        return mav;
    }
    /**
     * 档案浏览首页
     *
     * @return
     * @throws Exception
     */
    @RequestMapping("physicalView")
    @RequiresUser
    public ModelAndView physicalView(Long id) {
        ModelAndView mav = new ModelAndView("hn/fileView/physicalView");//指向index.jsp文件
        mav.addObject("id", id);
        CatSwyxxx catSwyxxx = catSwyxxxService.getById(id);
        String zkbh = catSwyxxx.getZkbh();
        mav.addObject("zkbh", zkbh);
        Long ajId = catSwyxxx.getAjId();
        CatSwajxx catSwajxx = catSwajxxService.getById(ajId);
        String xmmc = catSwajxx.getXmmc();
        mav.addObject("xmmc", xmmc);
        String sgcgzldh = catSwajxx.getSgcgzldh();
        mav.addObject("sgcgzldh", sgcgzldh);
        return mav;
    }
    /**
     * 判断是否已经关联附件
     *
     * @param keyId
     * @return
     */
    @RequestMapping(value = "/checkHasAttach", produces = "application/json; charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    @RequiresUser
    public Object checkHasAttach(Long keyId, Integer type) {
        try {
            boolean reg = false;
            if (type == null || keyId == null) {
                return reg;
            }
            if (type == 0) {
                CatCgwjxx catCgwjxx = catCgwjxxService.getById(keyId);
                String lllj = catCgwjxx.getLllj();
                if (StringUtils.isNotEmpty(lllj) && catCgwjxx != null) {
                    reg = true;
                }
//                if (catCgwjxx != null && catCgwjxx.getRelationState() != null && catCgwjxx.getRelationState() == 1) {
//                    reg = true;
//                }
            } else if (type == 1) {
                CatYswjxx catYswjxx = catYswjxxService.getById(keyId);
                String lllj = catYswjxx.getLllj();
                if (StringUtils.isNotEmpty(lllj) && catYswjxx != null) {
                    reg = true;
                }
//                if (catYswjxx != null && catYswjxx.getRelationState() != null && catYswjxx.getRelationState() == 1) {
//                    reg = true;
//                }
            }
            return reg;
        } catch (Exception e) {
            return false;
        }
    }
    /**
     * 判断是否有权限浏览附件
     *
     * @param type
     * @param keyId
     * @return
     */
    public boolean authorizeAttachPermission(Long keyId, Integer type) {
        //根据密级进行判断,高密级能浏览低密级文件
        ArchivesCustomConfig archivesCustomConfig = customConfigUtil.getConfigObj(ArchivesCustomConfig.class);
        boolean authorizeResult = false;
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        //先判断是否是档案管理员 如果是直接可以浏览
        Long userId = user.getUserId();
        List<Dept> deptList = deptService.getSubDeptListByUserId(userId);
        for (Dept dept : deptList) {
            String deptName = dept.getDeptName();
            if (deptName.contains("档案管理员")) {
                return true;
            }
        }
//        QueryWrapper<UtilizationUser> utilizationUserQueryWrapper = new QueryWrapper<>();
//        utilizationUserQueryWrapper.eq("user_id", userId);
//        UtilizationUser utilizationUser = utilizationUserService.getOne(utilizationUserQueryWrapper);
//        if (utilizationUser == null) {
//            return true;
//        }
        //判断时候借阅过该文件,如果借阅过该文件,直接返回true
        Integer borrowCount = borrowDetailService.getBorrowCount(keyId, userId);
//        Integer processingCount = processingDetailService.getProcessingCount(keyId, userId);
        if (borrowCount > 0) {
            return true;
        }
        //判断利用用户注册是时是否可以自助浏览,如果不可以直接返回false
//        if (utilizationUser.getSelfBrowse() == null || utilizationUser.getSelfBrowse() == 0) {
//            return false;
//        }
//        if (archivesCustomConfig.getEnableSimple() && utilizationUser.getSelfBrowse() != null && utilizationUser.getSelfBrowse() == 1) {
//            return true;
//        }
        //判断是否有涉密证书,如果没有这能浏览 公开数据
//        String certificateNumber = utilizationUser.getCertificateNumber();
//        if (certificateNumber != null && !("").equals(certificateNumber)) {
//            if (type == 0) {
//                CatCgwjxx catCgwjxx = catCgwjxxService.getById(keyId);
//                String sfsm = catCgwjxx.getSfsm();
//                if (sfsm == null || sfsm.equals("") || "否".equals(sfsm)) {
//                    return true;
//                }
//            } else if (type == 1) {
//                CatYswjxx catYswjxx = catYswjxxService.getById(keyId);
//                String sfsm = catYswjxx.getSfsm();
//                if (sfsm == null || sfsm.equals("") || "否".equals(sfsm)) {
//                    return true;
//                }
//            }
//        }
        //判断用户密级是否可以浏览
        Integer securityLevel = user.getSecurityLevel();
        if (securityLevel != null) {
            if (type == 0) {
                CatCgwjxx catCgwjxx = catCgwjxxService.getById(keyId);
                if (catCgwjxx.getSecurityCode() == null || catCgwjxx.getSecurityCode() <= securityLevel + 1) {
                    return true;
                }
            } else if (type == 1) {
                CatYswjxx catYswjxx = catYswjxxService.getById(keyId);
                if (catYswjxx.getSecurityCode() == null && catYswjxx.getSecurityCode() <= securityLevel + 1) {
                    return true;
                }
            }
        }
        return authorizeResult;
    }
}
src/main/java/com/zbooksoft/gdmis/controller/GdMisManageController.java
New file
@@ -0,0 +1,89 @@
package com.zbooksoft.gdmis.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.zbooksoft.gdmis.data.entity.CheckQuestion;
import com.zbooksoft.gdmis.service.CheckQuestionService;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.List;
/**
 * @author 15280
 */
@Controller
@RequestMapping("/gdMisManage")
public class GdMisManageController {
    @Autowired
    CheckQuestionService checkQuestionService;
    private static final Logger logger = LoggerFactory.getLogger(GdMisManageController.class);
    @RequestMapping({"/selectRegion"})
    @RequiresUser
    public ModelAndView selectRegion(String hasSelectRegion) throws Exception {
        ModelAndView mav = new ModelAndView("gh/gdMisManage/selectRegion");
        mav.addObject("hasSelectRegion", hasSelectRegion);
        return mav;
    }
    @RequestMapping({"/selectCheckQuestion"})
    @RequiresUser
    public ModelAndView selectCheckQuestion() throws Exception {
        ModelAndView mav = new ModelAndView("gh/gdMisManage/selectCheckQuestion");
        return mav;
    }
    @RequestMapping({"/getCheckQuestion"})
    @ResponseBody
    @RequiresUser
    public Object getCheckQuestion(String question) {
        try {
            if (question != null && !question.equals("")) {
                QueryWrapper<CheckQuestion> checkQuestionQueryWrapper = new QueryWrapper<>();
                checkQuestionQueryWrapper.like("question", question);
                return checkQuestionService.list(checkQuestionQueryWrapper);
            }
            List<CheckQuestion> checkQuestionList = checkQuestionService.list();
            return checkQuestionList;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo("导入失败"), false);
        }
    }
    @RequestMapping({"/selectMineral"})
    @RequiresUser
    public ModelAndView mineralSelection() throws Exception {
        ModelAndView mav = new ModelAndView("gh/gdMisManage/selectMineral");
        return mav;
    }
    @RequestMapping({"/selectInflectionPoint"})
    @RequiresUser
    public ModelAndView selectInflectionPoint() throws Exception {
        ModelAndView mav = new ModelAndView("gh/gdMisManage/selectInflectionPoint");
        return mav;
    }
    @RequestMapping({"/selectClassInfo"})
    @RequiresUser
    public ModelAndView selectClassInfo() throws Exception {
        ModelAndView mav = new ModelAndView("gh/gdMisManage/selectClassified");
        return mav;
    }
}
src/main/java/com/zbooksoft/gdmis/controller/ImportExcelController.java
New file
@@ -0,0 +1,307 @@
package com.zbooksoft.gdmis.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruili.wcp.data.entity.config.ImportColumn;
import com.ruili.wcp.data.entity.config.ImportTemplate;
import com.ruili.wcp.engine.form.IFormData;
import com.ruili.wcp.service.config.ImportColumnService;
import com.ruili.wcp.service.config.ImportTemplateService;
import com.ruili.wcp.web.common.LicenseException;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.zbooksoft.gdmis.service.CatSwajxxService;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import static com.ruili.wcp.web.controller.general.DataImportController.getExcelValue;
/**
 * @Description:导入Excel文件
 * @Author: zhai
 * @Date: 2024/9/11
 **/
@Controller
@RequestMapping("/importExcel")
public class ImportExcelController {
    @Autowired
    ImportTemplateService importTemplateService;
    @Autowired
    ImportColumnService importColumnService;
    @Autowired
    CatSwajxxService catSwajxxService;
    //    @Autowired
//    CatSwzkxxService catSwzkxxService;
//    @Autowired
//    CatSwyxxxService catSwyxxxService;
    @Autowired
    IFormData iform;
    @Autowired
    JdbcTemplate jdbcTemplate;
    private static final Logger logger = LoggerFactory.getLogger(ImportExcelController.class);
    /**
     * 导入页面
     *
     * @param type 0:从转孔基本信息进入 1:从钻孔图幅进入
     * @return
     */
    @RequestMapping({"/importIndex"})
    @RequiresUser
    public ModelAndView importIndex(Integer type) {
        ModelAndView mv = new ModelAndView("gh/excel/importExcel");
        return mv;
    }
    /**
     * @param file 0 导入转孔信息  1 导入图幅信息 2 导入实物案卷信息
     * @return
     * @throws LicenseException
     */
    @RequestMapping({"/importExcel"})
    @ResponseBody
    @RequiresUser
    public Object importExcel(@RequestParam(value = "file", required = false) MultipartFile file) throws LicenseException {
        try {
            readExcelBySwyp(file);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo("导入失败"), false);
        }
    }
    private void readExcelBySwyp(MultipartFile file) throws IOException {
        List<Long> importTemplateIds = Arrays.asList(1954734982477950977L, 1954736942581067778L);
        String originalFilename = file.getOriginalFilename();
        InputStream inputStream = file.getInputStream();
        if (originalFilename.matches("^.+\\.(?i)(xls)$")) {
            //创建工作簿对象
            HSSFWorkbook hssfWorkbook = new HSSFWorkbook(inputStream);
            HashMap<String, Object> map = readProject2003(hssfWorkbook);
            readExcel2003(hssfWorkbook, map);
        }
        if (originalFilename.matches("^.+\\.(?i)(xlsx)$")) {
            //创建工作簿对象
            XSSFWorkbook xssfWorkbook = new XSSFWorkbook(inputStream);
            for (int i = 0; i < 2; i++) {
                HashMap<String, Object> map = null;
                readExcel2007(xssfWorkbook, i, importTemplateIds.get(i), map, 0);
            }
        }
    }
    //Excel2003 xls格式
    private HashMap<String, Object> readProject2003(HSSFWorkbook hssfWorkbook) {
        HashMap<String, Object> map = new HashMap<>();
        //读取第i个工作表
        HSSFSheet sheet = hssfWorkbook.getSheetAt(0);
//项目名称:1:25万南沙幅海域区域地质调查
        String xmmc = getValue(sheet, 6, 3);
        map.put("XMMC", xmmc);
        String xmbh = getValue(sheet, 7, 3);
        map.put("XMBH", xmbh);
        String dcchc = getValue(sheet, 8, 3);
        map.put("DCCHC", dcchc);
        String dchy = getValue(sheet, 9, 3);
        map.put("DCHY", dchy);
        String dcqu = getValue(sheet, 10, 3);
        map.put("DCQU", dcqu);
        String dcsj = getValue(sheet, 11, 3);
        map.put("DCSJ", dcsj);
        String jyr = getValue(sheet, 12, 3);
        map.put("JYR", jyr);
        String syr = getValue(sheet, 13, 3);
        map.put("SYR", syr);
        String syrq = getValue(sheet, 14, 3);
        map.put("SYRQ", syrq);
        return map;
    }
    private String getValue(HSSFSheet sheet, int rowIndex, int cellIndex) {
        Row row = sheet.getRow(rowIndex);
        if (row != null) {
            Cell cell = row.getCell(cellIndex);
            if (cell != null) {
                String excelValue = getExcelValue(cell) == null ? "" : getExcelValue(cell).toString();
                return subString(excelValue);
            }
        }
        return null;
    }
    private String subString(String cellValue) {
        if (cellValue != null && cellValue.contains(":")) {
            int index = cellValue.indexOf(":");
            return cellValue.substring(index + 1).trim();
        }
        return cellValue;
    }
    //Excel2003 xls格式
    private void readExcel2003(HSSFWorkbook hssfWorkbook, Map<String, Object> mapData) {
        ImportTemplate importTemplate = importTemplateService.getByIdImportTemplate(1966070853328244738L);
        QueryWrapper<ImportColumn> query = new QueryWrapper();
        query.eq("import_template_id", importTemplate.getImportTemplateId());
        List<ImportColumn> columnList = importColumnService.list(query);
        List<String> excelColumns = new ArrayList();
        //读取第i个工作表
        HSSFSheet sheet = hssfWorkbook.getSheetAt(1);
        //获取最后一行的num,即总行数。此处从6行开始
        int maxRow = sheet.getLastRowNum();
        Row row = sheet.getRow(3);
//        Row row = sheet.getRow(4);
        int totalCells = row.getPhysicalNumberOfCells();
        for (int j = 0; j < totalCells; ++j) {
            Cell cell = row.getCell(j);
            String cellValue = getExcelValue(cell) == null ? "" : getExcelValue(cell).toString();
            if (StringUtils.isNotEmpty(cellValue) && "站位位置".equals(cellValue)) {
                Row rowJd = sheet.getRow(4);
                Cell cellJd = rowJd.getCell(j);
                String excelValueJd = getExcelValue(cellJd);
                excelColumns.add(excelValueJd);
                Cell cellWd = rowJd.getCell(j + 1);
                String excelValueWd = getExcelValue(cellWd);
                excelColumns.add(excelValueWd);
            } else if (StringUtils.isNotEmpty(cellValue)) {
                excelColumns.add(cellValue.toString());
            }
        }
        for (int j = 6; j <= maxRow; j++) {
            Row rowValue = sheet.getRow(j);
            Map<String, Object> map = new HashMap();
            map.putAll(mapData);
            for (int z = 0; z < columnList.size(); z++) {
                ImportColumn column = columnList.get(z);
                int columnIndex = excelColumns.indexOf(column.getExcelColunm());
                if (columnIndex >= 0) {
                    Cell cell = rowValue.getCell(columnIndex);
                    Object cellValue = getExcelValue(cell);
                    map.put(column.getColumnName(), cellValue);
                }
            }
            iform.insert(importTemplate.getTableId(), map);
        }
    }
    // Excel2007 xlsx
    private void readExcel2007(XSSFWorkbook xssfWorkbook, int sheetAt, Long importTemplateId, Map<String, Object> mapData, int rowNum) {
        ImportTemplate importTemplate = importTemplateService.getByIdImportTemplate(importTemplateId);
        QueryWrapper<ImportColumn> query = new QueryWrapper();
        query.eq("import_template_id", importTemplate.getImportTemplateId());
        List<ImportColumn> columnList = importColumnService.list(query);
        List<String> excelColumns = new ArrayList();
        int dhIndex = 0;
        //读取第i个工作表
        XSSFSheet sheet = xssfWorkbook.getSheetAt(sheetAt);
        //获取最后一行的num,即总行数。此处从0开始
        int maxRow = sheet.getLastRowNum();
        Row row = sheet.getRow(0);
        int totalCells = row.getPhysicalNumberOfCells();
        for (int j = 0; j < totalCells; ++j) {
            Cell cell = row.getCell(j);
            Object cellValue = getExcelValue(cell);
            if (sheetAt == 1 && "案卷档号".equals(cellValue.toString())) {
                dhIndex = j;
            }
            excelColumns.add(cellValue.toString());
        }
        for (int j = 1; j <= maxRow; j++) {
            try {
                Row rowValue = sheet.getRow(j);
                Map<String, Object> map = new HashMap();
                if (sheetAt == 1) {
                    Cell cell = rowValue.getCell(dhIndex);
                    Object cellValue = getExcelValue(cell);
                    String sql = "select id from cat_file_ajjxx where dh='" + cellValue + "'";
                    Long id = jdbcTemplate.queryForObject(sql, Long.class);
                    map.put("AJ_ID", id);
                }
                for (int z = 0; z < columnList.size(); z++) {
                    ImportColumn column = columnList.get(z);
                    if ("2".equals(column.getLinkedData())) {
                        String linkedType = column.getLinkedType();
                        String excelColunm = column.getExcelColunm();
                        int columnIndex = excelColumns.indexOf(excelColunm);
                        if (columnIndex >= 0) {
                            Cell cell = rowValue.getCell(columnIndex);
                            Object cellValue = getExcelValue(cell);
                            String[] split = linkedType.split("\\|");
                            String tableName = split[0];
                            String columnName = split[1];
                            String valueName = split[2];
                            String sql = "select " + valueName + " from " + tableName + " where " + columnName + "='" + cellValue + "'";
                            String columnValue = jdbcTemplate.queryForObject(sql, String.class);
                            map.put(column.getColumnName(), columnValue);
                        }
                    } else {
                        int columnIndex = excelColumns.indexOf(column.getExcelColunm());
                        if (columnIndex >= 0) {
                            Cell cell = rowValue.getCell(columnIndex);
                            Object cellValue = getExcelValue(cell);
                            if ("工作时间".equals(column.getColumnName().toString())) {
                                String string = cellValue.toString();
                                boolean contains = string.contains("-");
                                if (contains) {
                                    String[] split = string.split("-");
                                    map.put("QSSJ", split[0]);
                                    map.put("ZZSJ", split[1]);
                                } else {
                                    map.put("QSSJ", string);
                                }
                            } else {
                                map.put(column.getColumnName(), cellValue);
                            }
                        }
                    }
                }
                iform.insert(importTemplate.getTableId(), map);
            } catch (Exception e) {
                logger.info(e.getMessage(), e);
            }
        }
    }
}
src/main/java/com/zbooksoft/gdmis/controller/ImportExcelSuController.java
New file
@@ -0,0 +1,221 @@
package com.zbooksoft.gdmis.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruili.wcp.data.entity.config.ImportColumn;
import com.ruili.wcp.data.entity.config.ImportTemplate;
import com.ruili.wcp.engine.form.IFormData;
import com.ruili.wcp.service.config.ImportColumnService;
import com.ruili.wcp.service.config.ImportTemplateService;
import com.ruili.wcp.web.common.LicenseException;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.zbooksoft.gdmis.service.CatSwajxxService;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import static com.ruili.wcp.web.controller.general.DataImportController.getExcelValue;
/**
 * @Description:导入Excel文件
 * @Author: zhai
 * @Date: 2024/9/11
 **/
@Controller
@RequestMapping("/importSuExcel")
public class ImportExcelSuController {
    @Autowired
    ImportTemplateService importTemplateService;
    @Autowired
    ImportColumnService importColumnService;
    @Autowired
    CatSwajxxService catSwajxxService;
    //    @Autowired
//    CatSwzkxxService catSwzkxxService;
//    @Autowired
//    CatSwyxxxService catSwyxxxService;
    @Autowired
    IFormData iform;
    @Autowired
    JdbcTemplate jdbcTemplate;
    private static final Logger logger = LoggerFactory.getLogger(ImportExcelSuController.class);
    /**
     * 导入页面
     *
     * @param type 0:从转孔基本信息进入 1:从钻孔图幅进入
     * @return
     */
    @RequestMapping({"/importIndex"})
    @RequiresUser
    public ModelAndView importIndex(Integer type) {
        ModelAndView mv = new ModelAndView("gh/excel/importSuExcel");
        return mv;
    }
    /**
     * @param file 0 导入转孔信息  1 导入图幅信息 2 导入实物案卷信息
     * @return
     * @throws LicenseException
     */
    @RequestMapping({"/importExcel"})
    @ResponseBody
    @RequiresUser
    public Object importExcel(@RequestParam(value = "file", required = false) MultipartFile file) throws LicenseException {
        try {
            readExcelByAjxx(file);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo("导入失败"), false);
        }
    }
    private void readExcelByAjxx(MultipartFile file) throws IOException {
        List<Long> importTemplateIds = Arrays.asList(1954734982477950977L, 1954736942581067778L);
        // 创建一个可修改的ArrayList
        String originalFilename = file.getOriginalFilename();
        HashMap<String, Object> map = new HashMap<>();
        InputStream inputStream = file.getInputStream();
        if (originalFilename.matches("^.+\\.(?i)(xls)$")) {
            //创建工作簿对象
            HSSFWorkbook hssfWorkbook = new HSSFWorkbook(inputStream);
            for (int i = 0; i < 2; i++) {
                readExcel2003(hssfWorkbook, i, importTemplateIds.get(i), map);
            }
        }
        if (originalFilename.matches("^.+\\.(?i)(xlsx)$")) {
            //创建工作簿对象
            XSSFWorkbook xssfWorkbook = new XSSFWorkbook(inputStream);
            for (int i = 0; i < 2; i++) {
                readExcel2007(xssfWorkbook, i, importTemplateIds.get(i), map);
            }
        }
    }
    //Excel2003 xls格式
    private void readExcel2003(HSSFWorkbook hssfWorkbook, int sheetAt, Long importTemplateId, Map<String, Object> mapData) {
        ImportTemplate importTemplate = importTemplateService.getByIdImportTemplate(importTemplateId);
        QueryWrapper<ImportColumn> query = new QueryWrapper();
        query.eq("import_template_id", importTemplate.getImportTemplateId());
        List<ImportColumn> columnList = importColumnService.list(query);
        List<String> excelColumns = new ArrayList();
        int dhIndex = 0;
        //读取第i个工作表
        HSSFSheet sheet = hssfWorkbook.getSheetAt(sheetAt);
        //获取最后一行的num,即总行数。此处从0开始
        int maxRow = sheet.getLastRowNum();
        Row row = sheet.getRow(0);
        int totalCells = row.getPhysicalNumberOfCells();
        for (int j = 0; j < totalCells; ++j) {
            Cell cell = row.getCell(j);
            Object cellValue = getExcelValue(cell);
            if (sheetAt == 1 && "案卷档号".equals(cellValue.toString())) {
                dhIndex = j;
            }
            excelColumns.add(cellValue.toString());
        }
        for (int j = 1; j <= maxRow; j++) {
            Row rowValue = sheet.getRow(j);
            Map<String, Object> map = new HashMap();
            if (sheetAt == 1) {
                Cell cell = rowValue.getCell(dhIndex);
                Object cellValue = getExcelValue(cell);
                String sql = "select id from cat_file_ajjxx where dh='" + cellValue + "'";
                Long id = jdbcTemplate.queryForObject(sql, Long.class);
                map.put("AJ_ID", id);
                map.put("YSZT", 3);
                map.put("AJ_DH", cellValue);
            }
            for (int z = 0; z < columnList.size(); z++) {
                ImportColumn column = columnList.get(z);
                int columnIndex = excelColumns.indexOf(column.getExcelColunm());
                if (columnIndex >= 0) {
                    Cell cell = rowValue.getCell(columnIndex);
                    Object cellValue = getExcelValue(cell);
                    map.put(column.getColumnName(), cellValue);
                }
            }
            iform.insert(importTemplate.getTableId(), map);
        }
    }
    // Excel2007 xlsx
    private void readExcel2007(XSSFWorkbook xssfWorkbook, int sheetAt, Long importTemplateId, Map<String, Object> mapData) {
        ImportTemplate importTemplate = importTemplateService.getByIdImportTemplate(importTemplateId);
        QueryWrapper<ImportColumn> query = new QueryWrapper();
        query.eq("import_template_id", importTemplate.getImportTemplateId());
        List<ImportColumn> columnList = importColumnService.list(query);
        List<String> excelColumns = new ArrayList();
        int dhIndex = 0;
        //读取第i个工作表
        XSSFSheet sheet = xssfWorkbook.getSheetAt(sheetAt);
        //获取最后一行的num,即总行数。此处从0开始
        int maxRow = sheet.getLastRowNum();
        Row row = sheet.getRow(0);
        int totalCells = row.getPhysicalNumberOfCells();
        for (int j = 0; j < totalCells; ++j) {
            Cell cell = row.getCell(j);
            Object cellValue = getExcelValue(cell);
            if (sheetAt == 1 && "案卷档号".equals(cellValue.toString())) {
                dhIndex = j;
            }
            excelColumns.add(cellValue.toString());
        }
        for (int j = 1; j <= maxRow; j++) {
            try {
                Row rowValue = sheet.getRow(j);
                Map<String, Object> map = new HashMap();
                if (sheetAt == 1) {
                    Cell cell = rowValue.getCell(dhIndex);
                    Object cellValue = getExcelValue(cell);
                    String sql = "select id from cat_file_ajjxx where dh='" + cellValue + "'";
                    Long id = jdbcTemplate.queryForObject(sql, Long.class);
                    map.put("AJ_ID", id);
                    map.put("YSZT", 3);
                    map.put("AJ_DH", cellValue);
                }
                for (int z = 0; z < columnList.size(); z++) {
                    ImportColumn column = columnList.get(z);
                    int columnIndex = excelColumns.indexOf(column.getExcelColunm());
                    if (columnIndex >= 0) {
                        Cell cell = rowValue.getCell(columnIndex);
                        Object cellValue = getExcelValue(cell);
                        map.put(column.getColumnName(), cellValue);
                    }
                }
                iform.insert(importTemplate.getTableId(), map);
            } catch (Exception e) {
                logger.info(e.getMessage(), e);
            }
        }
    }
}
src/main/java/com/zbooksoft/gdmis/controller/LabelController.java
New file
@@ -0,0 +1,99 @@
package com.zbooksoft.gdmis.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruili.wcp.common.CustomConfigUtil;
import com.ruili.wcp.data.entity.config.Module;
import com.ruili.wcp.data.entity.management.*;
import com.ruili.wcp.engine.flow.HistoryService;
import com.ruili.wcp.engine.flow.RuntimeService;
import com.ruili.wcp.engine.flow.TaskService;
import com.ruili.wcp.service.config.ModuleService;
import com.ruili.wcp.web.common.UserFriendlyException;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.ruili.wcp.web.model.easyui.DataTableVO;
import com.ruili.wcp.web.model.easyui.PagedSortedAndFilteredInputDto;
import com.zbooksoft.gdmis.config.ArchivesCustomConfig;
import com.zbooksoft.gdmis.data.entity.BorrowDetail;
import com.zbooksoft.gdmis.data.entity.BorrowForm;
import com.zbooksoft.gdmis.data.entity.CatAjjxx;
import com.zbooksoft.gdmis.data.vo.BorrowInfo;
import com.zbooksoft.gdmis.data.vo.ParentBorrowInfo;
import com.zbooksoft.gdmis.service.*;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.apache.shiro.session.InvalidSessionException;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.*;
/**
 * @Description:
 * @Author: zhai
 * @Date: 2024/8/28
 **/
@Controller
@RequestMapping("/label")
public class LabelController {
    @Autowired
    CatAjjxxService catAjjxxService;
    @Autowired
    CatCgwjxxService catCgwjxxService;
    @Autowired
    CatYswjxxService catYswjxxService;
    @Autowired
    BorrowDetailService borrowDetailService;
    @Autowired
    BorrowFormService borrowFormService;
    @Autowired
    RuntimeService runtimeService;
    @Autowired
    TaskService taskService;
    @Autowired
    CustomConfigUtil customConfigUtil;
    @Autowired
    ModuleService moduleService;
    @Autowired
    HistoryService historyService;
    @Autowired
    UserCheckService userCheckService;
    @Autowired
    UtilizationUserService utilizationUserService;
    @Autowired
    JdbcTemplate jdbcTemplate;
    private static final Logger logger = LoggerFactory.getLogger(LabelController.class);
    /**
     * 标签打印选择页面
     *
     * @param type
     * @return
     */
    @RequestMapping({"/labelIndex"})
    @RequiresUser
    public ModelAndView importIndex(Integer type) {
        ModelAndView mv = new ModelAndView("gh/label/labelIndex");
        mv.addObject("type", type);
        return mv;
    }
}
src/main/java/com/zbooksoft/gdmis/controller/PhysicalController.java
New file
@@ -0,0 +1,591 @@
package com.zbooksoft.gdmis.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruili.wcp.common.CustomConfigUtil;
import com.ruili.wcp.data.entity.config.Module;
import com.ruili.wcp.data.entity.management.*;
import com.ruili.wcp.engine.flow.HistoryService;
import com.ruili.wcp.engine.flow.RuntimeService;
import com.ruili.wcp.engine.flow.TaskService;
import com.ruili.wcp.service.config.ModuleService;
import com.ruili.wcp.web.common.UserFriendlyException;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.ruili.wcp.web.model.easyui.DataTableVO;
import com.ruili.wcp.web.model.easyui.PagedSortedAndFilteredInputDto;
import com.zbooksoft.gdmis.config.ArchivesCustomConfig;
import com.zbooksoft.gdmis.data.entity.CatSwajxx;
import com.zbooksoft.gdmis.data.entity.PhysicalDetail;
import com.zbooksoft.gdmis.data.entity.PhysicalForm;
import com.zbooksoft.gdmis.data.entity.UtilizationUser;
import com.zbooksoft.gdmis.data.vo.ParentPhysicalInfo;
import com.zbooksoft.gdmis.data.vo.PhysicalInfo;
import com.zbooksoft.gdmis.service.*;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.apache.shiro.session.InvalidSessionException;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.*;
/**
 * @Description: 加工、借阅、实物利用管理
 * @Author: zhai
 * @Date: 2024/8/28
 **/
@Controller
@RequestMapping("/physical")
public class PhysicalController {
    @Autowired
    CatAjjxxService catAjjxxService;
    @Autowired
    CatSwajxxService catSwajxxService;
    @Autowired
    CatCgwjxxService catCgwjxxService;
    @Autowired
    CatYswjxxService catYswjxxService;
    @Autowired
    PhysicalDetailService physicalDetailService;
    @Autowired
    PhysicalFormService physicalFormService;
    @Autowired
    RuntimeService runtimeService;
    @Autowired
    TaskService taskService;
    @Autowired
    CustomConfigUtil customConfigUtil;
    @Autowired
    ModuleService moduleService;
    @Autowired
    HistoryService historyService;
    @Autowired
    UtilizationUserService utilizationUserService;
    @Autowired
    JdbcTemplate jdbcTemplate;
    private static final Logger logger = LoggerFactory.getLogger(PhysicalController.class);
    @RequestMapping({"/addPhysicalDetail"})
    @ResponseBody
    @RequiresUser
    public AjaxResponse addPhysicalDetail(String keyId) {
        try {
            Subject currentUser = SecurityUtils.getSubject();
            Session session = currentUser.getSession();
            User user = (User) session.getAttribute("user");
            Map<String, Object> resultMap = new HashMap<>();
            QueryWrapper<PhysicalDetail> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("form_id", 0);
            queryWrapper.eq("create_user_id", user.getUserId());
            int itemCount = physicalDetailService.count(queryWrapper);
            queryWrapper.eq("file_id", keyId);
            List<PhysicalDetail> physicalDetailList = physicalDetailService.list(queryWrapper);
            if (physicalDetailList.size() == 0) {
                CatSwajxx catSwajxx = catSwajxxService.getById(keyId);
                Integer swajxxCount = physicalDetailService.setSwajxx(catSwajxx);
                resultMap.put("addNum", 1);
                resultMap.put("repeatNum", 0);
                resultMap.put("existItemNum", itemCount + swajxxCount);
            } else {
                resultMap.put("addNum", 0);
                resultMap.put("repeatNum", 1);
                resultMap.put("existItemNum", itemCount);
            }
            String strSql = "select distinct file_id from UTL_PHYSICAL_DETAIL  where form_id=0 and create_user_id=" + user.getUserId();
            List<Map<String, Object>> parentMapList = jdbcTemplate.queryForList(strSql);
            resultMap.put("existFileNum", parentMapList.size());
            AjaxResponse ajaxResponse = new AjaxResponse(true);
            if (resultMap != null) {
                StringBuilder sb = new StringBuilder();
                sb.append("top.layer.open({");
                sb.append("   title : '提示',");
                sb.append("   type : 2,");
                sb.append("   area : [ '700px', '220px' ],");
                sb.append("   fixed : true, ");
                sb.append("   content : 'common/commonTips?addNum=" + resultMap.get("addNum") + "&type=实物利用&repeatNum=" + resultMap.get("repeatNum") + "&existFileNum=" + resultMap.get("existFileNum") + "&existItemNum=" + resultMap.get("existItemNum") + "&urlPath=physical'");
                sb.append("});");
                Map<String, String> result = new HashMap<String, String>();
                result.put("jsExpression", sb.toString());
                ajaxResponse.setResult(result);
            }
            return ajaxResponse;
        } catch (InvalidSessionException e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 资料借阅申请首页
     *
     * @return
     */
    @RequestMapping(value = {"", "index"})
    @RequiresUser
    public ModelAndView index() {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        List<PhysicalInfo> physicalInfoList = new ArrayList<>();
        List<PhysicalDetail> allPhysicalDetailList = new ArrayList<>();
        if (user != null) {
            List<ParentPhysicalInfo> parentPhysicalInfoList = physicalDetailService.selectDistinctParentPhysicalInfo(user.getUserId());
            // 通过distinct获取案卷
            for (ParentPhysicalInfo parentPhysicalInfo : parentPhysicalInfoList) {
                QueryWrapper<PhysicalDetail> queryWrapper = new QueryWrapper<>();
                queryWrapper.eq("form_id", 0).eq("create_user_id", user.getUserId()).eq("file_id", parentPhysicalInfo.getFileId());
                queryWrapper.orderByAsc("item_number");
                List<PhysicalDetail> physicalDetailList = physicalDetailService.list(queryWrapper);
                PhysicalInfo physicalInfo = new PhysicalInfo();
                physicalInfo.setParentPhysicalInfo(parentPhysicalInfo);
                physicalInfo.setPhysicalDetailList(physicalDetailList);
                physicalInfoList.add(physicalInfo);
                allPhysicalDetailList.addAll(physicalDetailList);
            }
        }
        ModelAndView mav = new ModelAndView("gh/physical/index");
        mav.addObject("curUserId", user.getUserId());
        mav.addObject("curUserName", user.getTrueName());
        mav.addObject("curUserTel", user.getMobilePhone());
        mav.addObject("curDeptName", user.getDeptName());
        mav.addObject("curDeptId", user.getDeptId());
        mav.addObject("physicalInfoList", physicalInfoList);
        mav.addObject("allPhysicalDetailList", allPhysicalDetailList);
        return mav;
    }
    /**
     * 保存明细信息
     *
     * @param
     * @return
     */
    @RequestMapping(value = "/savePhysicalDetail", produces = "application/json; charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    @RequiresUser
    public Object savePhysicalDetail(Long formId, @RequestBody ArrayList<PhysicalDetail> physicalDetailList) {
        try {
            physicalDetailService.saveOrUpdateBatch(physicalDetailList);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 保存申请单信息
     *
     * @param
     * @return
     */
    @RequestMapping(value = "/savePhysicalForm", produces = "application/json; charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    @RequiresUser
    public Object savePhysicalForm(@RequestBody PhysicalForm physicalForm) {
        try {
            Subject currentUser = SecurityUtils.getSubject();
            Session session = currentUser.getSession();
            User user = (User) session.getAttribute("user");
            physicalForm.setCreateUserId(user.getUserId());
            physicalForm.setCreateUserName(user.getTrueName());
            physicalForm.setCreateTime(new Date());
            // 生成利用单编号
            Date date = new Date();
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMM");
            String preNum = dateFormat.format(date);
            String maxApplyCode = physicalFormService.selectMaxApplyCode(preNum);
            String applyCode = preNum + "0001";
            if (StringUtils.isNotEmpty(maxApplyCode)) {
                Integer newApplyCode = Integer.parseInt(maxApplyCode) + 1;
                applyCode = newApplyCode.toString();
            }
            physicalForm.setApplyCode(applyCode);
            physicalForm.setFlowState(0);
            physicalForm.setState(0);
            physicalForm.setPhysicalDate(new Date());
            physicalFormService.saveOrUpdate(physicalForm);
            QueryWrapper<PhysicalDetail> query = new QueryWrapper<>();
            query.eq("form_id", 0).eq("survey", 0).eq("sampling", 0).eq("create_user_id", user.getUserId());
            physicalDetailService.remove(query);
            // 修改明细表formid
            QueryWrapper<PhysicalDetail> updateWrapper = new QueryWrapper<>();
            updateWrapper.eq("form_id", 0).eq("create_user_id", user.getUserId());
            PhysicalDetail physicalDetail = new PhysicalDetail();
            physicalDetail.setFormId(physicalForm.getFormId());
            physicalDetailService.update(physicalDetail, updateWrapper);
            List<ParentPhysicalInfo> parentPhysicalInfos = physicalDetailService.selectDistinctParentPhysicalInfoByFormId(physicalForm.getFormId());
            physicalForm.setFileCount(parentPhysicalInfos.size());
            QueryWrapper<PhysicalDetail> wrapper = new QueryWrapper<>();
            wrapper.eq("form_id", physicalForm.getFormId());
            int count = physicalDetailService.count(wrapper);
            physicalForm.setItemCount(count);
            physicalFormService.saveOrUpdate(physicalForm);
            // 生成流程信息
            Long moduleId = 1834402236946464769L;
            Long tableId = 1834404937772056577L;
            Long keyId = physicalForm.getFormId();
            Long processDefinitionId = 1834468968411238402L;
            String businessViewUrl = "physical/physicalForm?formId=" + keyId;
            Map<String, Object> dataMap = new HashMap<String, Object>();
            dataMap.put("applyCode", physicalForm.getApplyCode());
            dataMap.put("createTime", physicalForm.getCreateTime());
            dataMap.put("createUserId", physicalForm.getCreateUserId());
            dataMap.put("formId", physicalForm.getFormId());
            dataMap.put("remark", physicalForm.getRemark());
            FlowRuntimeExecution processInstance = runtimeService.startProcessInstanceById(processDefinitionId, moduleId, tableId, keyId, user.getUserId(), user.getTrueName(), businessViewUrl, dataMap);
            // 完成第一步
            List<FlowRuntimeTask> taskList = taskService.getTaskByProcessInstanceId(processInstance.getProcessInstanceId());
            if (taskList != null && taskList.size() > 0) {
                for (FlowRuntimeTask task : taskList) {
                    taskService.complete(task.getTaskId(), "", null, dataMap, null);
                }
            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 档案利用申请单审核
     *
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/physicalForm")
    @RequiresUser
    public ModelAndView physicalForm(Long formId, Long processInstanceId, Long taskId, HttpServletRequest request, HttpServletResponse response) throws Exception {
        ArchivesCustomConfig archivesCustomConfig = customConfigUtil.getConfigObj(ArchivesCustomConfig.class);
        ModelAndView mav = new ModelAndView("gh/physical/physicalForm");
        PhysicalForm physicalForm = physicalFormService.getById(formId);
        List<PhysicalInfo> physicalInfoList = new ArrayList<>();
        List<ParentPhysicalInfo> parentPhysicalInfoList = physicalDetailService.selectDistinctParentPhysicalInfoByFormId(formId);
        List<PhysicalDetail> allPhysicalDetailList = new ArrayList<>();
        if (physicalForm == null) {
            throw new UserFriendlyException("申请单不存在", "申请单已被删除,无法打开!");
        }
        // 通过distinct获取案卷
        for (ParentPhysicalInfo parentPhysicalInfo : parentPhysicalInfoList) {
            QueryWrapper<PhysicalDetail> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("form_id", formId).eq("file_id", parentPhysicalInfo.getFileId());
            queryWrapper.orderByAsc("item_number");
            List<PhysicalDetail> physicalDetailList = physicalDetailService.list(queryWrapper);
            PhysicalInfo physicalInfo = new PhysicalInfo();
            physicalInfo.setParentPhysicalInfo(parentPhysicalInfo);
            physicalInfo.setPhysicalDetailList(physicalDetailList);
            physicalInfoList.add(physicalInfo);
            allPhysicalDetailList.addAll(physicalDetailList);
        }
        // 获取利用单模块
        QueryWrapper<Module> physicalFormWrapper = new QueryWrapper<Module>();
        physicalFormWrapper.eq("module_identify", "physicalForm");
        Module physicalFormModule = moduleService.getOne(physicalFormWrapper);
        mav.addObject("physicalFormModule", physicalFormModule);
        mav.addObject("physicalInfoList", physicalInfoList);
        mav.addObject("allPhysicalDetailList", allPhysicalDetailList);
        mav.addObject("physicalForm", physicalForm);
        mav.addObject("archivesCustomConfig", archivesCustomConfig);
        // 处理流程信息
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        Long moduleId = 1834402236946464769L;
        Long tableId = 1834404937772056577L;
        FlowRuntimeTask task = null;
        FlowHistoryProcess historyProcess = null;
        if (taskId != null) {
            task = taskService.getTaskById(taskId);
            if (task != null) {
                processInstanceId = task.getProcessInstanceId();
                mav.addObject("task", task);
                mav.addObject("processInstanceId", processInstanceId);
                mav.addObject("isEnd", false);
            } else {
                // 查找是否有历史任务记录
                FlowHistoryTask historyTask = historyService.getHistoryTaskById(taskId);
                if (historyTask != null) {
                    processInstanceId = historyTask.getProcessInstanceId();
                } else {
                }
            }
        }
        // 查找流程是否已经结束
        if (processInstanceId != null) {
            historyProcess = historyService.getHistoryProcessByProcessInstanceId(processInstanceId);
        } else if (moduleId != null && tableId != null && formId != null) {
            historyProcess = historyService.getHistoryProcessByBusinessInfo(moduleId, tableId, formId);
        }
        if (historyProcess != null) {
            processInstanceId = historyProcess.getProcessInstanceId();
            mav.addObject("processInstanceId", processInstanceId);
            // 如果流程已经结束
            if (historyProcess.getEndTime() != null) {
                mav.addObject("isEnd", true);
            } else {
                mav.addObject("isEnd", false);
                // 查找是否为自己待办
                List<FlowRuntimeTask> taskList = taskService.findTasksByProcessInstanceIdAndUserId(user.getUserId(), historyProcess.getProcessInstanceId());
                if (taskList != null && taskList.size() > 0) {
                    mav.addObject("task", taskList.get(0));
                    mav.addObject("isEnd", false);
                }
            }
        } else {
//            throw new UserFriendlyException("找不到流程实例", "流程实例不存在或已完成!");
        }
        // 读取流程历史信息
        if (task != null || historyProcess != null) {
            List<FlowHistoryTask> historyTaskList = historyService.getFlowHistoryTaskByProcessInstanceId(processInstanceId);
            mav.addObject("historyTaskList", historyTaskList);
        }
//
//        String utilizeApprovePermission = "BusinessManage.ArchivesUtilizationForm.UtilizeApprove";
//        boolean permitted = currentUser.isPermitted(utilizeApprovePermission);
//        mav.addObject("approvePermission", currentUser.isPermitted(utilizeApprovePermission));
        mav.addObject("approvePermission", true);
        return mav;
    }
    /**
     * 我的借阅单首页
     *
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/myPhysicalFormIndex")
    @RequiresUser
    public ModelAndView myPhysicalFormIndex(HttpServletRequest request, HttpServletResponse response) throws Exception {
        ModelAndView mav = new ModelAndView("gh/physical/myPhysicalFormIndex");
        return mav;
    }
    /**
     * 分页获取我的利用申请列表
     *
     * @param
     * @param pageInput
     * @return
     */
    @RequestMapping("/getMyPhysicalFormList")
    @ResponseBody
    @RequiresUser
    public Object getMyPhysicalFormList(Integer flowState, PagedSortedAndFilteredInputDto pageInput) {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        QueryWrapper<PhysicalForm> query = new QueryWrapper<>();
        if (flowState != null && flowState != -2) {
            query.eq("flow_state", flowState);
        }
        query.nested(qy -> qy.eq("create_user_id", user.getUserId()).or().eq("apply_user_id", user.getUserId()));
        IPage<PhysicalForm> utilizationFormIPage;
        String searchText = pageInput.getSearchText();
        if (searchText != null && searchText != "") {
            query.nested(i -> i.like("apply_code", searchText).or().like("borrow_apply_user_name", searchText));
        }
        String sort = pageInput.getSort();
        String order = pageInput.getOrder();
        if (sort != null && sort != "") {
            query.orderBy(true, !order.equals("desc"), "apply_code");
        }
        DataTableVO<PhysicalForm> dto = new DataTableVO<>();
        if (pageInput.getPage() != 0 && pageInput.getRows() != 0) {
            Page<PhysicalForm> page = new Page<>(pageInput.getPage(), pageInput.getRows());
            utilizationFormIPage = physicalFormService.page(page, query);
            dto.setTotal(utilizationFormIPage.getTotal());
            dto.setRows(utilizationFormIPage.getRecords());
        } else {
            List<PhysicalForm> utilizationFormList = physicalFormService.list(query);
            dto.setTotal(utilizationFormList.size());
            dto.setRows(utilizationFormList);
        }
        return dto;
    }
    /**
     * 删除借阅单
     *
     * @param formIdList
     * @return
     */
    @RequestMapping(value = "/deletePhysicalForm", produces = "application/json; charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    @RequiresUser
    public Object deletePhysicalForm(@RequestBody ArrayList<Long> formIdList) {
        try {
            physicalFormService.removeByIds(formIdList);
            for (Long formId : formIdList) {
                QueryWrapper<PhysicalDetail> query = new QueryWrapper<>();
                query.eq("form_id", formId);
                physicalDetailService.remove(query);
                // 删除流程实例
                runtimeService.deleteProcessInstanceByBusinessInfo(1834402236946464769L, 1834404937772056577L, formId);
            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    @RequestMapping(value = "/getBorrowUserInfo", produces = "application/json; charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    @RequiresUser
    public Object getBorrowUserInfo(String userId) {
        try {
            QueryWrapper<UtilizationUser> utilizationUserQueryWrapper = new QueryWrapper<>();
            utilizationUserQueryWrapper.eq("user_id", userId);
            UtilizationUser utilizationUser = utilizationUserService.getOne(utilizationUserQueryWrapper);
            return new AjaxResponse(utilizationUser);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 删除明细信息
     *
     * @param fileId
     * @return
     */
    @RequestMapping(value = "/deletePhysicalDetail", produces = "application/json; charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    @RequiresUser
    public Object deletePhysicalDetail(Long fileId) {
        try {
            QueryWrapper<PhysicalDetail> query = new QueryWrapper<>();
            query.eq("file_id", fileId);
            query.eq("form_id", 0L);
            physicalDetailService.remove(query);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 人工添加实物利用单
     *
     * @param
     * @return
     */
    @RequestMapping(value = "/addPhysicalForm")
    @RequiresUser
    public ModelAndView addProcessingForm() {
        ModelAndView mav = new ModelAndView("gh/physical/addPhysicalForm");
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        mav.addObject("curUserId", user.getUserId());
        mav.addObject("curUserName", user.getTrueName());
        mav.addObject("curUserTel", user.getMobilePhone());
        mav.addObject("curDeptName", user.getDeptName());
        mav.addObject("curDeptId", user.getDeptId());
        return mav;
    }
    /**
     * 分页获取人工添加明细列表
     *
     * @param
     * @param pageInput
     * @return
     */
    @RequestMapping("/getPhysicalDetailListByPeople")
    @ResponseBody
    @RequiresUser
    public Object getPhysicalDetailListByPeople(PagedSortedAndFilteredInputDto pageInput, Long formId) {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        QueryWrapper<PhysicalDetail> query = new QueryWrapper<>();
        if (formId != null && formId > 0) {
            query.eq("form_id", formId);
        } else if (formId != null && formId < 0) {
            query.gt("form_id", 0);
        } else {
            query.eq("form_id", 0).eq("create_user_id", user.getUserId());
        }
        query.eq("file_title", "人工添加");
        List<PhysicalDetail> list = physicalDetailService.list(query);
        return list;
    }
    /**
     * 删除明细信息通过明细id
     *
     * @param detailId
     * @return
     */
    @RequestMapping(value = "/deletePhysicalDetailById", produces = "application/json; charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    @RequiresUser
    public Object deletePhysicalDetailById(Long detailId) {
        try {
            physicalDetailService.removeById(detailId);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
}
src/main/java/com/zbooksoft/gdmis/controller/ScanPrintController.java
New file
@@ -0,0 +1,180 @@
package com.zbooksoft.gdmis.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruili.wcp.data.entity.config.View;
import com.ruili.wcp.data.entity.management.User;
import com.ruili.wcp.engine.form.IFormData;
import com.ruili.wcp.service.config.ModuleService;
import com.ruili.wcp.service.config.ViewService;
import com.ruili.wcp.web.model.AjaxResponse;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @Description
 * @Author fsr
 * @Date 2020/12/12
 * 扫描枪分发
 **/
@Controller
@RequestMapping("/scanPrintController")
public class ScanPrintController {
    private static final Logger logger = LoggerFactory.getLogger(ScanPrintController.class);
    @Autowired
    ModuleService moduleService;
    @Autowired
    IFormData iFormData;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    ViewService viewService;
    /**
     * @Description 出库扫描
     * @Date 2020/12/12
     **/
    @RequestMapping(value = "/outScanPrint")
    public ModelAndView outScanPrint(Long viewId) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("scanPrint/scanPrint");
        modelAndView.addObject("viewId", viewId);
        modelAndView.addObject("printType", 1);
        return modelAndView;
    }
    /**
     * @Description 入库扫描
     * @Date 2020/12/12
     **/
    @RequestMapping(value = "/inScanPrint")
    public ModelAndView inScanPrint(Long viewId) {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("scanPrint/scanPrint");
        modelAndView.addObject("viewId", viewId);
        modelAndView.addObject("printType", 0);
        return modelAndView;
        //ARCHIVAL_TYPE
    }
    /**
     * @Description 保存扫描枪数据
     * @Date 2020/12/12
     * printType 扫描类型 1.出 0. 进
     * operationType 操作类型 1 出入库  2 销毁
     **/
    @RequestMapping(value = "/saveScanPrintData")
    @RequiresUser
    @ResponseBody
    public Object saveScanPrintData(@RequestBody List<Map<String, Object>> data, int printType, Long viewId) {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        View view = viewService.getViewById(viewId);
        String mainTableName = view.getMainTableName();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        if (data != null && data.size() > 0) {
            if (printType == 0) { //入库扫描
                updateWarehousing(mainTableName, data);
            }
            if (printType == 1) { //出库
                outWarehousing(data);
            }
        }
        return new AjaxResponse(true);
    }
    private Map<String, Object> getBusinessData(String tableName, String archivalCode) {
        String sql = "SELECT * FROM " + tableName + " WHERE ARCHIVAL_STATE = 3 AND ARCHIVAL_CODE='" + archivalCode + "'";
        Map<String, Object> data = null;
        try {
            data = jdbcTemplate.queryForMap(sql);
        } catch (Exception e) {
            logger.error(e.getMessage());
        }
        return data;
    }
    /**
     * @Description 入库
     * @Date 2020/12/13
     **/
    private void updateWarehousing(String tableName, List<Map<String, Object>> data) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        StringBuilder sql = new StringBuilder("UPDATE " + tableName + " SET IN_STATUS_CODE=0, IN_STATUS='已入库', IN_TIME=TO_DATE('" + sdf.format(new Date()) + "', 'yyyy-mm-dd hh24:mi:ss') WHERE ARCHIVAL_CODE IN (");
        for (int i = 0; i < data.size(); i++) {
            String archivalCode = (String) data.get(i).get("archival_code");
            if (archivalCode != null) {
                sql.append("'" + archivalCode + "'");
                if (i < data.size() - 1) {
                    sql.append(",");
                }
            }
        }
        sql.append(")");
        jdbcTemplate.update(sql.toString());
    }
    /**
     * @Description 出库
     * @Date 2020/12/13
     **/
    private void outWarehousing(List<Map<String, Object>> data) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //更新出库状态
        for (int i = 0; i < data.size(); i++) {
            String archivalCode = (String) data.get(i).get("archival_code");
            String sqlSelect = "select * from BUS_PACKING_MANAGE where ITEM_NUM = '" + archivalCode + "'";
            Map<String, Object> packingMap = jdbcTemplate.queryForMap(sqlSelect);
            long itemId = Long.parseLong(packingMap.get("ITEM_ID").toString());
            String sql = "select * from BUS_WAREHOUSING where item_id =" + itemId + " and IN_STATUS_CODE =0";
            List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
            if (mapList.size() >= 0) {
                Map<String, Object> map = mapList.get(0);
                Date date = new Date();
                String format = sdf.format(date);
                String sqlUpdate = "update BUS_WAREHOUSING SET OUT_STATUS_CODE=1, OUT_STATUS='已出库', OUT_TIME='" + format + "' WHERE ID=" + map.get("ID");
                jdbcTemplate.update(sqlUpdate);
                String sqlUpdateBox = "update BUS_PACKING_MANAGE SET ITEM_STATE='借出'  WHERE ID=" + packingMap.get("ID");
                jdbcTemplate.update(sqlUpdateBox);
            }
        }
    }
    /**
     * @Description 保存到销毁库
     * @Date 2020/12/13
     **/
    private void saveToDisposeForm(Map<String, Object> businessData) {
    }
}
src/main/java/com/zbooksoft/gdmis/controller/SearchController.java
New file
@@ -0,0 +1,708 @@
package com.zbooksoft.gdmis.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.core.type.TypeReference;
import com.ruili.wcp.common.CustomConfigUtil;
import com.ruili.wcp.common.JSONUtil;
import com.ruili.wcp.data.entity.config.TableColumn;
import com.ruili.wcp.data.entity.management.User;
import com.ruili.wcp.data.vo.config.AdvancedConditionVO;
import com.ruili.wcp.engine.DataSourceConfig;
import com.ruili.wcp.service.config.TableColumnService;
import com.ruili.wcp.web.common.LicenseException;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.ruili.wcp.web.model.easyui.DataTableVO;
import com.ruili.wcp.web.model.easyui.PagedAndFilteredInputDto;
import com.ruili.wcp.web.model.easyui.PagedSortedAndFilteredInputDto;
import com.zbooksoft.gdmis.config.ArchivesCustomConfig;
import com.zbooksoft.gdmis.data.entity.CatAjjxx;
import com.zbooksoft.gdmis.data.entity.CatCgwjxx;
import com.zbooksoft.gdmis.data.entity.CatSwajxx;
import com.zbooksoft.gdmis.data.entity.CatYswjxx;
import com.zbooksoft.gdmis.service.CatAjjxxService;
import com.zbooksoft.gdmis.service.CatCgwjxxService;
import com.zbooksoft.gdmis.service.CatSwajxxService;
import com.zbooksoft.gdmis.service.CatYswjxxService;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.text.Text;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.index.query.*;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder;
import org.elasticsearch.search.fetch.subphase.highlight.HighlightField;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
 * @Description:资料检索
 * @Author: zhai
 * @Date: 2024/8/28
 **/
@Controller
@RequestMapping("/search")
public class SearchController {
    @Autowired
    CatAjjxxService catAjjxxService;
    @Autowired
    CatCgwjxxService catCgwjxxService;
    @Autowired
    CatSwajxxService catSwajxxService;
    @Autowired
    CatYswjxxService catYswjxxService;
    @Autowired
    CustomConfigUtil customConfigUtil;
    @Autowired
    TableColumnService tableColumnService;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    RestHighLevelClient restHighLevelClient;
    private static final Logger logger = LoggerFactory.getLogger(SearchController.class);
    /**
     * 资料检索页面
     *
     * @return
     */
    @RequestMapping(value = "/retrieve")
    @RequiresUser
    public ModelAndView retrieve() {
        ModelAndView mv = new ModelAndView("gh/search/retrieve");
        return mv;
    }
    /**
     * 全文案卷目录检索结果页
     *
     * @param keyword
     * @return
     * @throws Exception
     */
    @RequestMapping("/searchResult")
    @RequiresUser
    public ModelAndView searchResult(Integer isSuperSearch, String selectedValue, String keyword) throws Exception {
        ModelAndView mav = null;
        ArchivesCustomConfig archivesCustomConfig = customConfigUtil.getConfigObj(ArchivesCustomConfig.class);
        mav = new ModelAndView("gh/search/searchResult");
        mav.addObject("archivesCustomConfig", archivesCustomConfig);
        mav.addObject("selectedValue", selectedValue);
        mav.addObject("keyword", keyword);
        return mav;
    }
    /**
     * 全文内容检索结果页
     *
     * @param archivesType
     * @param keyword
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    @RequestMapping("attach")
    @RequiresUser
    public ModelAndView attachSearch(Long archivesType, String keyword, HttpServletRequest request, HttpServletResponse response) throws Exception {
        ModelAndView mav = new ModelAndView("gh/search/result_attach");
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        mav.addObject("archivesType", archivesType);
        mav.addObject("keyword", keyword);
        return mav;
    }
    @RequestMapping("/getAttachSearchData")
    @ResponseBody
    @RequiresUser
    public Object getAttachSearchData(Long archivesType, PagedAndFilteredInputDto input, String filterMapStr) throws IOException, LicenseException {
        boolean isFieldUpper = DataSourceConfig.checkFieldNameIsNeedUpper();
        try {
            BoolQueryBuilder boolBuilder = QueryBuilders.boolQuery();
            SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
            // 从全文内容和标题中检索关键字
            MultiMatchQueryBuilder matchQueryBuilder = QueryBuilders.multiMatchQuery(input.getSearchText(), "fullText", "WJM")
                    .minimumShouldMatch("50%").operator(Operator.AND);
            boolBuilder.must(matchQueryBuilder);
            if (filterMapStr != null && !filterMapStr.equals("")) {
                Map<String, String> filterMap = JSONUtil.string2Obj(filterMapStr, new TypeReference<Map<String, String>>() {
                });
                for (Map.Entry<String, String> entry : filterMap.entrySet()) {
                    String mapKey = getAvailableString(entry.getKey(), isFieldUpper);
                    String mapValue = entry.getValue();
                    if (!mapValue.equals("") && !mapValue.equals(null)) {
                        boolBuilder.must(new TermQueryBuilder(mapKey, mapValue));
                    }
                }
            }
            MatchPhraseQueryBuilder matchPhraseQueryBuilder = QueryBuilders.matchPhraseQuery("fullText", input.getSearchText()).slop(50);
            boolBuilder.should(matchPhraseQueryBuilder);
            sourceBuilder.query(boolBuilder); // 设置查询,可以是任何类型的QueryBuilder。
            // 设置高亮显示字段
            HighlightBuilder highlightBuilder = new HighlightBuilder();
            highlightBuilder.field(getAvailableString("WJM", isFieldUpper), 250, 1);
            highlightBuilder.field("fullText", 250, 1);
            sourceBuilder.highlighter(highlightBuilder);
            int from = (input.getPage() - 1) * input.getRows();
            sourceBuilder.from(from); // 设置确定结果要从哪个索引开始搜索的from选项,默认为0
            sourceBuilder.size(input.getRows()); // 设置确定搜素命中返回数的size选项,默认为10
            sourceBuilder.timeout(new TimeValue(60, TimeUnit.SECONDS)); // 设置一个可选的超时,控制允许搜索的时间。
            SearchRequest searchRequest = new SearchRequest("attach"); // 索引
            searchRequest.source(sourceBuilder);
            SearchResponse response = this.restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT);
            SearchHits hits = response.getHits(); // SearchHits提供有关所有匹配的全局信息,例如总命中数或最高分数:.
            List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
            SearchHit[] hitsList = hits.getHits();
            for (int i = 0; i < hitsList.length; i++) {
                Map<String, Object> hitMap = hitsList[i].getSourceAsMap();
                Map<String, HighlightField> highlightFields = hitsList[i].getHighlightFields(); // 获取对应的高亮域
                Map<String, Object> row = new HashMap<String, Object>();
                row.put("physicalName", getFieldValue(hitMap, highlightFields, getAvailableString("WJTM", isFieldUpper)));
                row.put("fullText", getFieldValue(hitMap, highlightFields, "fullText"));
                Object extension = hitMap.get(getAvailableString("WJGS", isFieldUpper));
                if (extension != null) {
                    extension = extension.toString().toLowerCase();
                }
                row.put("extension", extension);
                row.put("attachId", hitMap.get(getAvailableString("attach_id", isFieldUpper)));
                row.put("moduleId", hitMap.get(getAvailableString("module_id", isFieldUpper)));
                row.put("keyId", hitMap.get(getAvailableString("ID", isFieldUpper)));
                rows.add(row);
            }
            Map<String, Object> data = new HashMap<String, Object>();
            long total = hits.getTotalHits();
            if (total >= 10000) {
                total = 10000;
            }
            data.put("total", total);
            data.put("rows", rows);
            data.put("searchTime", (double) (response.getTook().getMillis()) / 1000);
            return new AjaxResponse(data);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    @RequestMapping("/getSearchData")
    @ResponseBody
    @RequiresUser
    public Object getSearchData(String selectedValue, String keyword, String keywordMapStr, PagedSortedAndFilteredInputDto pageInput) {
        try {
            String selSql = "select * from view_all_utlization  where  1=1";
            if (selectedValue != null && !selectedValue.equals("") && keyword != null && !keyword.equals("")) {
                selSql += " and " + selectedValue + " like '%" + keyword + "%'";
            }
            if (keywordMapStr != null && !keywordMapStr.equals("")) {
                keywordMapStr = StringEscapeUtils.unescapeHtml4(keywordMapStr);
                Map<String, String> filterMap = JSONUtil.string2Obj(keywordMapStr, new TypeReference<Map<String, String>>() {
                });
                for (Map.Entry<String, String> entry : filterMap.entrySet()) {
                    String value = entry.getValue();
                    String key = entry.getKey();
                    if (!value.equals("") && !value.equals(null)) {
                        selSql += " and " + key + " like '%" + value + "%'";
                    }
                }
            }
            List<Map<String, Object>> rows = jdbcTemplate.queryForList(selSql);
            return rows;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
//    @RequestMapping("/getSearchData")
//    @ResponseBody
//    @RequiresUser
//    public Object getSearchData(String selectedValue, String keyword, String keywordMapStr, PagedSortedAndFilteredInputDto pageInput) {
//        try {
//            Page<CatAjjxx> page = new Page(pageInput.getPage(), pageInput.getRows());
//            QueryWrapper<CatAjjxx> catAjjxxQueryWrapper = new QueryWrapper<>();
//            catAjjxxQueryWrapper.eq("fbzt", "1");
//            if (keywordMapStr != null && !keywordMapStr.equals("")) {
//                Map<String, String> filterMap = JSONUtil.string2Obj(keywordMapStr, new TypeReference<Map<String, String>>() {
//                });
//                //{"XCSJ":"60年代","GZCD":"1:50000","ZLLB":"海洋区域地质调查","KC":"钛矿"}
//                for (Map.Entry<String, String> entry : filterMap.entrySet()) {
//                    String value = entry.getValue();
//                    String key = entry.getKey();
//                    if ("DESC".equals(value)) {
//                        catAjjxxQueryWrapper.orderByDesc(key);
//                    } else if ("GZCD".equals(key) && !"".equals(value)) {
//                        catAjjxxQueryWrapper.eq("GZCD", value);
//                    } else if ("ZLLB".equals(key) && !"".equals(value)) {
//                        catAjjxxQueryWrapper.eq("ZLLB", value);
//                    } else if ("KCMC".equals(key) && !"".equals(value)) {
//                        catAjjxxQueryWrapper.like("KCMC", value);
//                    } else if ("XCSJV".equals(key) && !"".equals(value)) {
//                        switch (value) {
//                            case "50年代":
//                                catAjjxxQueryWrapper.between("XCSJ", "1950-01-01", "1960-01-01");
//                                break;
//                            case "60年代":
//                                catAjjxxQueryWrapper.between("XCSJ", "1960-01-01", "1970-01-01");
//                                break;
//                            case "70年代":
//                                catAjjxxQueryWrapper.between("XCSJ", "1970-01-01", "1980-01-01");
//                                break;
//                            case "80年代":
//                                catAjjxxQueryWrapper.between("XCSJ", "1980-01-01", "1990-01-01");
//                                break;
//                            case "90年代":
//                                catAjjxxQueryWrapper.between("XCSJ", "1990-01-01", "2000-01-01");
//                                break;
//                            case "2000年以后":
//                                catAjjxxQueryWrapper.gt("XCSJ", "2000-01-01");
//                                break;
//                            case "解放前":
//                                catAjjxxQueryWrapper.lt("XCSJ", "1949-01-01");
//                                break;
//                        }
//                    }
//                }
//            }
//            if (keyword == null || "".equals(keyword)) {
//                IPage<CatAjjxx> logPage = catAjjxxService.page(page, catAjjxxQueryWrapper);
//                DataTableVO<CatAjjxx> dataTable = new DataTableVO();
//                dataTable.setTotal(logPage.getTotal());
//                dataTable.setRows(logPage.getRecords());
//                return dataTable;
//            }
//            if (selectedValue != null && !"".equals(selectedValue)) {
//                String[] keywords = keyword.split(",");
//                for (String kw : keywords) {
//                    if ("SGDH".equals(selectedValue)) {
//                        catAjjxxQueryWrapper.eq(selectedValue, kw);
//                    } else {
//                        catAjjxxQueryWrapper.like(selectedValue, kw);
//                    }
//                }
//                IPage<CatAjjxx> logPage = catAjjxxService.page(page, catAjjxxQueryWrapper);
//                DataTableVO<CatAjjxx> dataTable = new DataTableVO();
//                dataTable.setTotal(logPage.getTotal());
//                dataTable.setRows(logPage.getRecords());
//                return dataTable;
//            }
//
//            catAjjxxQueryWrapper.like("zlmc", keyword).or().like("dh", keyword);
//            IPage<CatAjjxx> logPage = catAjjxxService.page(page, catAjjxxQueryWrapper);
//            DataTableVO<CatAjjxx> dataTable = new DataTableVO();
//            dataTable.setTotal(logPage.getTotal());
//            dataTable.setRows(logPage.getRecords());
//            return dataTable;
//
//        } catch (Exception e) {
//            logger.error(e.getMessage(), e);
//            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
//        }
//    }
    @RequestMapping("/getSuperSearchData")
    @ResponseBody
    @RequiresUser
    public Object getSuperSearchData(@RequestParam String keywordMapStr, PagedSortedAndFilteredInputDto pageInput) {
        try {
            Page<CatAjjxx> page = new Page(pageInput.getPage(), pageInput.getRows());
            QueryWrapper<CatAjjxx> catAjjxxQueryWrapper = new QueryWrapper<>();
            catAjjxxQueryWrapper.eq("fbzt", "1");
            if (keywordMapStr != null && !keywordMapStr.equals("")) {
                Map<String, String> filterMap = JSONUtil.string2Obj(keywordMapStr, new TypeReference<Map<String, String>>() {
                });
                for (Map.Entry<String, String> entry : filterMap.entrySet()) {
                    if ("startXCSJ".equals(entry.getKey()) && !"".equals(entry.getValue())) {
                        catAjjxxQueryWrapper.gt("XCSJ", entry.getValue());
                    } else if ("endXCSJ".equals(entry.getKey()) && !"".equals(entry.getValue())) {
                        catAjjxxQueryWrapper.lt("XCSJ", entry.getValue());
                    } else if (!"".equals(entry.getKey()) && !"".equals(entry.getValue())) {
                        catAjjxxQueryWrapper.like(entry.getKey(), entry.getValue());
                    }
                }
            }
            String customSql = getAdvancedConditionsSql(null, null);
            IPage<CatAjjxx> logPage = catAjjxxService.page(page, catAjjxxQueryWrapper);
            DataTableVO<CatAjjxx> dataTable = new DataTableVO();
            dataTable.setTotal(logPage.getTotal());
            dataTable.setRows(logPage.getRecords());
            return dataTable;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    @RequestMapping({"/advancedQuery"})
    @RequiresUser
    public ModelAndView advancedQuery() {
        ModelAndView mav = new ModelAndView("gh/search/advancedQuery");
//        ArrayList<HashMap<String, String>> columnList = new ArrayList<>();
//        HashMap<String, String> stringStringHashMap = new HashMap<>();
//        stringStringHashMap.put("columnName", "SGDH");
//        stringStringHashMap.put("columnLabel", "案卷号");
//        columnList.add(stringStringHashMap);
//        stringStringHashMap = new HashMap<>();
//        stringStringHashMap.put("columnName", "ZLMC");
//        stringStringHashMap.put("columnLabel", "资料名称");
//        columnList.add(stringStringHashMap);
//        stringStringHashMap = new HashMap<>();
//        stringStringHashMap.put("columnName", "DH");
//        stringStringHashMap.put("columnLabel", "案卷号");
//        columnList.add(stringStringHashMap);
//        mav.addObject("columnList", columnList);
        return mav;
    }
    /**
     * 高级查询页面
     *
     * @param keyword
     * @return
     * @throws Exception
     */
    @RequestMapping("/searchFrom")
    @RequiresUser
    public ModelAndView searchFrom(String selectedValue, String keyword) throws Exception {
        ModelAndView mav = new ModelAndView("gh/search/searchFrom");
        return mav;
    }
    /**
     * 资料详情页面
     *
     * @return
     */
    @RequestMapping(value = "/details")
    @RequiresUser
    public ModelAndView details(Long keyId) {
        CatAjjxx catAjjxx = catAjjxxService.getById(keyId);
        String zlmc = catAjjxx.getZlmc();
//        Long swId = catAjjxx.getSwId();
        ModelAndView mv = new ModelAndView("gh/search/details");
        mv.addObject("zlmc", zlmc);
        mv.addObject("keyId", keyId);
//        mv.addObject("swId", swId);
        return mv;
    }
    @RequestMapping("/getDetails")
    @ResponseBody
    @RequiresUser
    public Object getDetails(Long keyId) {
        try {
            String sql = "select * from CAT_FILE_AJJXX where id =" + keyId;
            Map<String, Object> map = jdbcTemplate.queryForMap(sql);
            //其他编著者资料
            String bzzs = map.get("BZZ") == null ? "" : map.get("BZZ").toString();
            bzzs = bzzs.replace("[", "").replace("]", "");
            String[] split = bzzs.split(",");
            ArrayList<String> bzzqtzlList = new ArrayList<>();
            for (int i = 0; i < split.length; i++) {
                QueryWrapper<CatAjjxx> catAjjxxQueryWrapper = new QueryWrapper<>();
                catAjjxxQueryWrapper.like("BZZ", split[i]);
                catAjjxxQueryWrapper.eq("fbzt", 1);
                List<CatAjjxx> list = catAjjxxService.list(catAjjxxQueryWrapper);
                for (CatAjjxx catAjjxx : list) {
                    bzzqtzlList.add(catAjjxx.getZlmc() + "_" + catAjjxx.getId() + "_" + catAjjxx.getBzz());
                }
            }
            map.put("BZZQTZL", bzzqtzlList);
            //形成单位其他资料
            String xcda = map.get("XCDWMC") == null ? "" : map.get("XCDWMC").toString();
            ArrayList<String> xcdwqtzlList = new ArrayList<>();
            QueryWrapper<CatAjjxx> queryWrapper = new QueryWrapper<>();
            queryWrapper.like("XCDWMC", xcda);
            queryWrapper.eq("fbzt", 1);
            List<CatAjjxx> list = catAjjxxService.list(queryWrapper);
            for (CatAjjxx catAjjxx : list) {
                xcdwqtzlList.add(catAjjxx.getZlmc() + "_" + catAjjxx.getId() + "_" + catAjjxx.getBzz());
            }
            map.put("XCDWQTZL", xcdwqtzlList);
            //成果文件目录
            ArrayList<String> wjmuList = new ArrayList<>();
            QueryWrapper<CatCgwjxx> cgwjxxQueryWrapper = new QueryWrapper<>();
            cgwjxxQueryWrapper.eq("AJ_ID", keyId);
            List<CatCgwjxx> catCgwjxxList = catCgwjxxService.list(cgwjxxQueryWrapper);
            for (CatCgwjxx catCgwjxx : catCgwjxxList) {
                wjmuList.add(catCgwjxx.getWjm() + " " + catCgwjxx.getWjtm() + "_" + catCgwjxx.getId());
            }
            map.put("CGWJMU", wjmuList);
            //原始文件目录
            ArrayList<String> yswjmuList = new ArrayList<>();
            QueryWrapper<CatYswjxx> ysWrapper = new QueryWrapper<>();
            ysWrapper.eq("AJ_ID", keyId);
            List<CatYswjxx> catYswjxxList = catYswjxxService.list(ysWrapper);
            for (CatYswjxx catYswjxx : catYswjxxList) {
                yswjmuList.add(catYswjxx.getWjm() + " " + catYswjxx.getWjtm() + "_" + catYswjxx.getId());
            }
            map.put("YSWJMU", yswjmuList);
            //相识资料
            ArrayList<String> xszlList = new ArrayList<>();
            String gjz = map.get("GJZ") == null ? "" : map.get("GJZ").toString();
            String[] gjzs = gjz.split("[,,]");
            for (int i = 0; i < gjzs.length; i++) {
                String gjzValue = gjzs[i];
                if (!"".equals(gjzValue)) {
                    QueryWrapper<CatAjjxx> wrapper = new QueryWrapper<>();
                    wrapper.like("GJZ", gjzs[i]);
                    wrapper.like("fbzt", 1);
                    List<CatAjjxx> xsList = catAjjxxService.list(wrapper);
                    for (CatAjjxx catAjjxx : xsList) {
                        xszlList.add(catAjjxx.getZlmc() + "_" + catAjjxx.getId() + "_" + catAjjxx.getBzz());
                    }
                }
            }
            map.put("XSZL", xszlList);
            return new AjaxResponse(map);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
//    @RequestMapping("/getPhysicalDetails")
//    @ResponseBody
//    @RequiresUser
//    public Object getPhysicalDetails(Long keyId) {
//        try {
//
//            String sql = "select * from CAT_FILE_SWAJXX where id =" + keyId;
//            Map<String, Object> map = jdbcTemplate.queryForMap(sql);
//
//            //文件目录
//            ArrayList<String> wjmuList = new ArrayList<>();
//            QueryWrapper<CatSwyxxx> swzkxxQueryWrapper = new QueryWrapper<>();
//            swzkxxQueryWrapper.eq("AJ_ID", keyId);
//            List<CatSwyxxx> catSwyxxxList = catSwyxxxService.list(swzkxxQueryWrapper);
//            for (CatSwyxxx catSwyxxx : catSwyxxxList) {
//                wjmuList.add(catSwyxxx.getZkbh() + "_" + catSwyxxx.getId());
//            }
//            map.put("ZKML", wjmuList);
//
//            return new AjaxResponse(map);
//        } catch (Exception e) {
//            logger.error(e.getMessage(), e);
//            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
//        }
//    }
    /**
     * 实物资料详情页面
     *
     * @return
     */
    @RequestMapping(value = "/physicalDetails")
    @RequiresUser
    public ModelAndView physicalDetails(Long keyId) {
        CatSwajxx catSwajxx = catSwajxxService.getById(keyId);
        ModelAndView mv = new ModelAndView("gh/search/physicalDetails");
        mv.addObject("keyId", keyId);
        mv.addObject("zlmc", catSwajxx.getSwzltm());
        return mv;
    }
    private String getFieldValue(Map<String, Object> hitMap, Map<String, HighlightField> highlightFields, String fieldName) {
        String fieldValue = "";
        HighlightField highlightFullText = highlightFields.get(fieldName);
        if (highlightFullText != null) {
            // 为title串值增加自定义的高亮标签
            Text[] titleTexts = highlightFullText.fragments();
            String highlightText = "";
            for (Text text : titleTexts) {
                highlightText += text;
            }
            fieldValue = highlightText;
        } else {
            if (hitMap.get(fieldName) != null)
                fieldValue = hitMap.get(fieldName).toString();
        }
        return fieldValue;
    }
    private String getAvailableString(String sourceStr, boolean isFieldUpper) {
        if (isFieldUpper) {
            return sourceStr.toUpperCase();
        } else {
            return sourceStr;
        }
    }
    protected String getAdvancedConditionsSql(String advancedConditionsStr, Long tableId) {
        String conditionsSql = "";
        AdvancedConditionVO advancedCondition = null;
        try {
            advancedConditionsStr = StringEscapeUtils.unescapeHtml4(advancedConditionsStr);
            advancedCondition = (AdvancedConditionVO) JSONUtil.string2Obj(advancedConditionsStr, AdvancedConditionVO.class);
        } catch (Exception var6) {
            logger.error("高级查询条件字符串转换为查询条件对象失败", var6);
        }
        if (advancedCondition != null) {
            List<TableColumn> tableColumns = this.tableColumnService.getColumnListByTableId(tableId);
            conditionsSql = generalGroupAdvancedConditionSql(advancedCondition, tableColumns);
        }
        return conditionsSql;
    }
    protected String generalGroupAdvancedConditionSql(AdvancedConditionVO advancedCondition, List<TableColumn> tableColumns) {
        StringBuffer sqlBuffer = new StringBuffer();
        if (advancedCondition.getChildren() != null && advancedCondition.getChildren().size() > 0) {
            sqlBuffer.append("(");
            Iterator var4 = advancedCondition.getChildren().iterator();
            while (true) {
                while (var4.hasNext()) {
                    AdvancedConditionVO condition = (AdvancedConditionVO) var4.next();
                    String subSqlStr;
                    if (!condition.getOp().equals("and") && !condition.getOp().equals("or")) {
                        subSqlStr = generalRuleAdvancedConditionSql(condition, tableColumns);
                        if (!subSqlStr.equals("")) {
                            if (sqlBuffer.length() > 1) {
                                sqlBuffer.append(" " + condition.getLogicOp());
                            }
                            sqlBuffer.append(" " + subSqlStr);
                        }
                    } else {
                        subSqlStr = this.generalGroupAdvancedConditionSql(condition, tableColumns);
                        if (!subSqlStr.equals("")) {
                            if (sqlBuffer.length() > 1) {
                                sqlBuffer.append(" " + condition.getOp());
                            }
                            sqlBuffer.append(" " + subSqlStr);
                        }
                    }
                }
                sqlBuffer.append(")");
                break;
            }
        }
        return sqlBuffer.toString();
    }
    protected String generalRuleAdvancedConditionSql(AdvancedConditionVO advancedCondition, List<TableColumn> tableColumns) {
        StringBuffer sqlBuffer = new StringBuffer();
        sqlBuffer.append(advancedCondition.getField());
        String operatorQueryText = "";
        String queryValue = "'" + advancedCondition.getValue() + "'";
        TableColumn tableColumn = (TableColumn) tableColumns.stream().filter((a) -> {
            return a.getColumnName().equals(advancedCondition.getField());
        }).findFirst().orElse(null);
        byte var8;
        if (tableColumn != null) {
            switch (tableColumn.getDataType()) {
                case "datetime":
                    if (DataSourceConfig.getDbType().getDb().equalsIgnoreCase("ORACLE")) {
                        queryValue = "to_date('" + advancedCondition.getValue() + " 00:00:00','yyyy-mm-dd hh24:mi:ss')";
                    }
                    break;
                case "int":
                case "float":
                case "decimal":
                case "bit":
                case "tinyint":
                case "bigint":
                    queryValue = advancedCondition.getValue();
            }
        }
        switch (advancedCondition.getOp()) {
            case "equal":
                operatorQueryText = "=";
                break;
            case "notequal":
                operatorQueryText = "!=";
                break;
            case "greater":
                operatorQueryText = ">";
                break;
            case "greaterorequal":
                operatorQueryText = ">=";
                break;
            case "less":
                operatorQueryText = "<";
                break;
            case "lessorequal":
                operatorQueryText = "<=";
                break;
            case "contains":
                operatorQueryText = " like ";
                queryValue = "'%" + advancedCondition.getValue() + "%'";
                break;
            case "notcontains":
                operatorQueryText = " not like ";
                queryValue = "'%" + advancedCondition.getValue() + "%'";
                break;
            case "beginwith":
                operatorQueryText = " like ";
                queryValue = "'" + advancedCondition.getValue() + "%'";
                break;
            case "endwith":
                operatorQueryText = " like ";
                queryValue = "'%" + advancedCondition.getValue() + "'";
                break;
            default:
                operatorQueryText = "=";
        }
        sqlBuffer.append(operatorQueryText + queryValue);
        return sqlBuffer.toString();
    }
}
src/main/java/com/zbooksoft/gdmis/controller/TapeController.java
New file
@@ -0,0 +1,289 @@
package com.zbooksoft.gdmis.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruili.wcp.data.entity.config.ImportColumn;
import com.ruili.wcp.data.entity.config.ImportTemplate;
import com.ruili.wcp.engine.form.IFormData;
import com.ruili.wcp.service.config.ImportColumnService;
import com.ruili.wcp.service.config.ImportTemplateService;
import com.ruili.wcp.web.common.LicenseException;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.zbooksoft.gdmis.data.entity.CatAjjxx;
import com.zbooksoft.gdmis.service.CatAjjxxService;
import com.zbooksoft.gdmis.service.CatSwajxxService;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.ruili.wcp.web.controller.general.DataImportController.getExcelValue;
/**
 * @Description:导入Excel文件
 * @Author: zhai
 * @Date: 2024/9/11
 **/
@Controller
@RequestMapping("/tape")
public class TapeController {
    @Autowired
    ImportTemplateService importTemplateService;
    @Autowired
    ImportColumnService importColumnService;
    @Autowired
    CatSwajxxService catSwajxxService;
    @Autowired
    CatAjjxxService catAjjxxService;
    //    @Autowired
//    CatSwzkxxService catSwzkxxService;
//    @Autowired
//    CatSwyxxxService catSwyxxxService;
    @Autowired
    IFormData iform;
    @Autowired
    JdbcTemplate jdbcTemplate;
    private static final Logger logger = LoggerFactory.getLogger(TapeController.class);
    /**
     * 导入页面
     *
     * @param type 0:从转孔基本信息进入 1:从钻孔图幅进入
     * @return
     */
    @RequestMapping({"/importIndex"})
    @RequiresUser
    public ModelAndView importIndex(Integer type) {
        ModelAndView mv = new ModelAndView("gh/excel/tapeImportExcel");
        return mv;
    }
    /**
     * @param file 0 导入转孔信息  1 导入图幅信息 2 导入实物案卷信息
     * @return
     * @throws LicenseException
     */
    @RequestMapping({"/importExcel"})
    @ResponseBody
    @RequiresUser
    public Object importExcel(@RequestParam(value = "file", required = false) MultipartFile file, String ajId) throws LicenseException {
        try {
            readExcelByTape(file, ajId);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo("导入失败"), false);
        }
    }
    /**
     * @Description 全宗统计数据
     * @Date${DATE} 2023/5/16
     **/
    @RequestMapping(value = "/getProject")
    @ResponseBody
    @RequiresUser
    public List<Map<String, Object>> getProject() {
        String sql = "SELECT XMKYQMC, ID FROM CAT_FILE_AJJXX";
        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
        return mapList;
    }
    /**
     * 处理选择的数据(装盒)
     *
     * @param fromId
     * @param idList
     * @return
     */
    @RequestMapping(value = "/addTapeDetail")
    @ResponseBody
    public Object addBoxList(Long fromId, @RequestBody List<Long> idList) {
        for (Long longId : idList) {
            String countSql = "SELECT COUNT(1) AS count FROM BUS_TAPE_DETAIL WHERE RELATION_ID = " + longId + " AND FORM_ID = " + fromId;
            int count = jdbcTemplate.queryForObject(countSql, Integer.class);
            if (count > 0) {
                continue;
            }
            String selectSql = "SELECT * FROM  BUS_TAPE_MANAGE WHERE ID = " + longId;
            Map<String, Object> tapeManageMap = jdbcTemplate.queryForMap(selectSql);
            HashMap<String, Object> insertMap = new HashMap<>();
            insertMap.put("GQM", tapeManageMap.get("GQM"));
            insertMap.put("LBDZ", tapeManageMap.get("LBDZ"));
            insertMap.put("WJM", tapeManageMap.get("WJM"));
            insertMap.put("PH", tapeManageMap.get("PH"));
            insertMap.put("WJH", tapeManageMap.get("WJH"));
            insertMap.put("GZDW", tapeManageMap.get("GZDW"));
            insertMap.put("GZRQ", tapeManageMap.get("GZRQ"));
            insertMap.put("FORM_ID", fromId);
            insertMap.put("RELATION_ID", longId);
            iform.insert(1982633467650830338L, insertMap);
        }
        return new AjaxResponse(true);
    }
    private void readExcelByTape(MultipartFile file, String ajId) throws IOException {
        String originalFilename = file.getOriginalFilename();
        CatAjjxx catAjjxx = catAjjxxService.getById(ajId);
        HashMap<String, Object> map = new HashMap<>();
        map.put("AJ_ID", ajId);
        map.put("XMMC", catAjjxx.getXmkyqmc());
        map.put("XMBH", catAjjxx.getXmkyqbh());
        map.put("ZLZT", 0);
        //获取最大批次号
        String sql = "SELECT MAX(PCH) as pch FROM BUS_TAPE_MANAGE WHERE AJ_ID =" + ajId;
        Map<String, Object> mapPch = jdbcTemplate.queryForMap(sql);
        Integer pch = mapPch.get("pch") == null ? 0 : Integer.parseInt(mapPch.get("pch").toString());
        map.put("PCH", pch + 1);
        InputStream inputStream = file.getInputStream();
        if (originalFilename.matches("^.+\\.(?i)(xls)$")) {
            //创建工作簿对象
            HSSFWorkbook hssfWorkbook = new HSSFWorkbook(inputStream);
            readExcel2003(hssfWorkbook);
        }
        if (originalFilename.matches("^.+\\.(?i)(xlsx)$")) {
            //创建工作簿对象
            XSSFWorkbook xssfWorkbook = new XSSFWorkbook(inputStream);
            readExcel2007(xssfWorkbook, map);
        }
    }
    private String getValue(HSSFSheet sheet, int rowIndex, int cellIndex) {
        Row row = sheet.getRow(rowIndex);
        if (row != null) {
            Cell cell = row.getCell(cellIndex);
            if (cell != null) {
                String excelValue = getExcelValue(cell) == null ? "" : getExcelValue(cell).toString();
                return subString(excelValue);
            }
        }
        return null;
    }
    private String subString(String cellValue) {
        if (cellValue != null && cellValue.contains(":")) {
            int index = cellValue.indexOf(":");
            return cellValue.substring(index + 1).trim();
        }
        return cellValue;
    }
    //Excel2003 xls格式
    private void readExcel2003(HSSFWorkbook hssfWorkbook) {
        ImportTemplate importTemplate = importTemplateService.getByIdImportTemplate(1966024810830041089L);
        QueryWrapper<ImportColumn> query = new QueryWrapper();
        query.eq("import_template_id", importTemplate.getImportTemplateId());
        List<ImportColumn> columnList = importColumnService.list(query);
        List<String> excelColumns = new ArrayList();
        //读取第i个工作表
        HSSFSheet sheet = hssfWorkbook.getSheetAt(1);
        //获取最后一行的num,即总行数。此处从6行开始
        int maxRow = sheet.getLastRowNum();
        Row row = sheet.getRow(3);
//        Row row = sheet.getRow(4);
        int totalCells = row.getPhysicalNumberOfCells();
        for (int j = 0; j < totalCells; ++j) {
            Cell cell = row.getCell(j);
            String cellValue = getExcelValue(cell) == null ? "" : getExcelValue(cell).toString();
            if (StringUtils.isNotEmpty(cellValue) && "站位位置".equals(cellValue)) {
                Row rowJd = sheet.getRow(4);
                Cell cellJd = rowJd.getCell(j);
                String excelValueJd = getExcelValue(cellJd);
                excelColumns.add(excelValueJd);
                Cell cellWd = rowJd.getCell(j + 1);
                String excelValueWd = getExcelValue(cellWd);
                excelColumns.add(excelValueWd);
            } else if (StringUtils.isNotEmpty(cellValue)) {
                excelColumns.add(cellValue.toString());
            }
        }
        for (int j = 6; j <= maxRow; j++) {
            Row rowValue = sheet.getRow(j);
            Map<String, Object> map = new HashMap();
            for (int z = 0; z < columnList.size(); z++) {
                ImportColumn column = columnList.get(z);
                int columnIndex = excelColumns.indexOf(column.getExcelColunm());
                if (columnIndex >= 0) {
                    Cell cell = rowValue.getCell(columnIndex);
                    Object cellValue = getExcelValue(cell);
                    map.put(column.getColumnName(), cellValue);
                }
            }
            iform.insert(importTemplate.getTableId(), map);
        }
    }
    // Excel2007 xlsx
    private void readExcel2007(XSSFWorkbook xssfWorkbook, Map<String, Object> mapData) {
        ImportTemplate importTemplate = importTemplateService.getByIdImportTemplate(1966024810830041089L);
        QueryWrapper<ImportColumn> query = new QueryWrapper();
        query.eq("import_template_id", importTemplate.getImportTemplateId());
        List<ImportColumn> columnList = importColumnService.list(query);
        List<String> excelColumns = new ArrayList();
        //读取第i个工作表
        XSSFSheet sheet = xssfWorkbook.getSheetAt(0);
        //获取最后一行的num,即总行数。此处从0开始
        int maxRow = sheet.getLastRowNum();
        Row row = sheet.getRow(0);
        int totalCells = row.getPhysicalNumberOfCells();
        for (int j = 0; j < totalCells; ++j) {
            Cell cell = row.getCell(j);
            Object cellValue = getExcelValue(cell);
            excelColumns.add(cellValue.toString());
        }
        for (int j = 1; j <= maxRow; j++) {
            try {
                Row rowValue = sheet.getRow(j);
                Map<String, Object> map = new HashMap();
                map.putAll(mapData);
                for (int z = 0; z < columnList.size(); z++) {
                    ImportColumn column = columnList.get(z);
                    int columnIndex = excelColumns.indexOf(column.getExcelColunm());
                    if (columnIndex >= 0) {
                        Cell cell = rowValue.getCell(columnIndex);
                        Object cellValue = getExcelValue(cell);
                        map.put(column.getColumnName(), cellValue);
                    }
                }
                iform.insert(importTemplate.getTableId(), map);
            } catch (Exception e) {
                logger.info(e.getMessage(), e);
            }
        }
    }
}
src/main/java/com/zbooksoft/gdmis/controller/UtilizationUserController.java
New file
@@ -0,0 +1,357 @@
package com.zbooksoft.gdmis.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruili.wcp.common.EncryptUtil;
import com.ruili.wcp.common.IdGenerater;
import com.ruili.wcp.common.LogUtils;
import com.ruili.wcp.common.OperateType;
import com.ruili.wcp.data.entity.management.*;
import com.ruili.wcp.engine.form.IFormData;
import com.ruili.wcp.service.management.*;
import com.ruili.wcp.web.common.LicenseException;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.zbooksoft.gdmis.data.entity.UserCheck;
import com.zbooksoft.gdmis.data.entity.UtilizationUnit;
import com.zbooksoft.gdmis.data.entity.UtilizationUser;
import com.zbooksoft.gdmis.service.UserCheckService;
import com.zbooksoft.gdmis.service.UtilizationUnitService;
import com.zbooksoft.gdmis.service.UtilizationUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.*;
/**
 * @Description:利用用户管理
 * @Author: zhai
 * @Date: 2024/8/22
 **/
@Controller
@RequestMapping("/utilizationUser")
public class UtilizationUserController {
    @Autowired
    DeptService deptService;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    UserService userService;
    @Autowired
    RoleService roleService;
    //    @Autowired
//    UserQuestionService userQuestionService;
    @Autowired
    UtilizationUserService utilizationUserService;
    @Autowired
    UtilizationUnitService utilizationUnitService;
    @Autowired
    KeywordParamService keywordParamService;
    @Autowired
    KeywordService keywordService;
    @Autowired
    UserCheckService userCheckService;
    @Autowired
    IFormData iform;
    private static final Logger logger = LoggerFactory.getLogger(UtilizationUserController.class);
    @RequestMapping(value = "/register")
    public Object register() {
        return new ModelAndView("gh/utilizationUser/register3");
    }
    //获取部门信息
    @RequestMapping({"/getDept"})
    @ResponseBody
    public Object getDept() {
        try {
            List<UtilizationUnit> utilizationUnitList = utilizationUnitService.list();
            return new AjaxResponse(utilizationUnitList);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    @RequestMapping({"/getValue"})
    @ResponseBody
    public Object getValue(String name) {
        try {
            QueryWrapper<Keyword> keywordQueryWrapper = new QueryWrapper<>();
            keywordQueryWrapper.eq("keyword_name", name);
            Keyword keyword = keywordService.getOne(keywordQueryWrapper);
            QueryWrapper<KeywordParam> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("keyword_id", keyword.getKeywordId());
            List<KeywordParam> KeywordParamList = keywordParamService.list(queryWrapper);
            return new AjaxResponse(KeywordParamList);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 注册
     *
     * @param formData
     * @param request
     * @return
     */
    @RequestMapping(value = {"/saveRegister"}, produces = {"application/json; charset=utf-8"}, method = {RequestMethod.POST})
    @ResponseBody
    public Object saveRegister(@RequestBody Map<String, Object> formData, HttpServletRequest request) {
        try {
            String cardId = formData.get("ID_CARD").toString();
            String mobile = formData.get("MOBILE").toString();
            //先判断一些条件(身份证唯一等)
            String sql = "select ID from UTL_UTILIZATION_USER where ID_CARD = '" + cardId + "'";
            List<Map<String, Object>> maps = jdbcTemplate.queryForList(sql);
            if (maps.size() > 0) {
                return new AjaxResponse(new ErrorInfo("该身份证已被注册!"), false);
            }
            String sql2 = "select ID from UTL_UTILIZATION_USER where MOBILE = '" + mobile + "'";
            List<Map<String, Object>> maps2 = jdbcTemplate.queryForList(sql2);
            if (maps2.size() > 0) {
                return new AjaxResponse(new ErrorInfo("该手机号已被注册!"), false);
            }
            User user = new User();
            String userName = formData.get("USER_NAME").toString();
            String sex = formData.get("SEX").toString();
            String province = formData.get("PROVINCE").toString();
            String city = formData.get("CITY").toString();
            String deptNames = formData.get("DEPT").toString();
            String deptNature = formData.get("DEPT_NATURE").toString();
            String deptAddress = formData.get("DEPT_ADDRESS").toString();
            String postCode = formData.get("POST_CODE").toString();
            String certificateNumber = formData.get("CERTIFICATE_NUMBER").toString();
            String job = formData.get("JOB").toString();
            String telNumber = formData.get("TEL_NUMBER").toString();
            String email = formData.get("EMAIL").toString();
            String qqNum = formData.get("QQ_NUM").toString();
            String projectType = formData.get("PROJECT_TYPE").toString();
            String projectName = formData.get("PROJECT_NAME").toString();
            String trade = formData.get("TRADE").toString();
            String materialScope = formData.get("MATERIAL_SCOPE").toString();
            String materialPurpose = formData.get("MATERIAL_PURPOSE").toString();
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            String applyDate = sdf.format(new Date());
            //登录名为身份证号,唯一性
            user.setUserName(cardId);
            String pwd = cardId.substring(cardId.length() - 6, cardId.length());
            String md5Pwd = EncryptUtil.getInstance().MD5(pwd);
            //默认取身份证后六位作为密码
            user.setPassword(md5Pwd);
            user.setTrueName(userName);
            Byte enableLogin = 1;
            user.setEnableLogin(enableLogin);
            user.setUserType(1);
            user.setMobilePhone(mobile);
            user.setCreateTime(new Date());
            //用户设置为外部用户
            LambdaQueryWrapper<Dept> wrapper = new LambdaQueryWrapper<>();
            wrapper.eq(Dept::getDeptName, "外部用户");
            Dept dept = deptService.getOne(wrapper);
            user.setDeptId(dept.getDeptId());
            user.setDeptName("外部用户");
            //插入系统用户表
            userService.saveUser(user);
            Long userId = user.getUserId();
            //初始化用户默认角色
            List<Role> roles = roleService.addUserToDefaultRole(user.getUserId());
            if (roles != null && roles.size() > 0) {
                for (Role role : roles) {
                    LogUtils.insertLog("角色管理", OperateType.安全操作_新增.toString(), "增加角色内用户", "增加角色【" + role.getRoleName() + "】内用户:" + user.getTrueAndUserName(), "", request);
                }
            }
            //插入利用用户表
            long id = IdGenerater.getId();
            HashMap<String, Object> mapData = new HashMap<>();
            mapData.put("ID", id);
            mapData.put("ENABLE_LOGIN", enableLogin);
            mapData.put("PASSWORD", pwd);
            mapData.put("USER_NAME", userName);
            mapData.put("SEX", sex);
            mapData.put("ID_CARD", cardId);
            mapData.put("PROVINCE", province);
            mapData.put("CITY", city);
            mapData.put("DEPT", deptNames);
            mapData.put("POST_CODE", postCode);
            mapData.put("DEPT_ADDRESS", deptAddress);
            mapData.put("MOBILE", mobile);
            mapData.put("TEL_NUMBER", telNumber);
            mapData.put("EMAIL", email);
            mapData.put("QQ_NUM", qqNum);
            mapData.put("PROJECT_TYPE", projectType);
            mapData.put("MATERIAL_SCOPE", materialScope);
            mapData.put("MATERIAL_PURPOSE", materialPurpose);
            mapData.put("JOB", job);
            mapData.put("PROJECT_NAME", projectName);
            mapData.put("DEPT_NATURE", deptNature);
            mapData.put("TRADE", trade);
            mapData.put("CERTIFICATE_NUMBER", certificateNumber);
            mapData.put("USER_ID", userId);
            mapData.put("APPLY_DATE", applyDate);
            mapData.put("LOGIN_NAME", cardId);
            iform.insert(1826177548856377345L, mapData);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error("添加注册用户出错", e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 验收是否已经进行了登记
     *
     * @param userId
     * @return
     */
    @RequestMapping({"/getCheckUserInfo"})
    @ResponseBody
    public Object getCheckUserInfo(String userId) {
        try {
            QueryWrapper<UserCheck> userCheckQueryWrapper = new QueryWrapper<>();
            userCheckQueryWrapper.eq("UTILIZATION_USER_ID", userId);
            userCheckQueryWrapper.ge("VALID_END", new Date());
            int count = userCheckService.count(userCheckQueryWrapper);
            if (count > 0) {
                return new AjaxResponse("该用户已经进行了登记");
            }
            UtilizationUser utilizationUser = utilizationUserService.getById(userId);
            return new AjaxResponse(utilizationUser);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
//    /**
//     * 到馆登记
//     *
//     * @param formData
//     * @param utilizationUserId
//     * @return
//     */
//    @RequestMapping({"/saveCheckUserInfo"})
//    @ResponseBody
//    public Object saveCheckUserInfo(@RequestBody Map<String, Object> formData, String utilizationUserId) {
//        try {
//            UserCheck userCheck = new UserCheck();
//            String userName = formData.get("USER_NAME").toString();
//            String cardId = formData.get("CARD_ID").toString();
//            String deptName = formData.get("DEPT_NAME").toString();
//            String deptNature = formData.get("DEPT_NATURE").toString();
//            String projectName = formData.get("PROJECT_NAME").toString();
//            String projectType = formData.get("PROJECT_TYPE").toString();
//            String borrowUser = formData.get("BORROW_USER").toString();
//            String materialScope = formData.get("MATERIAL_SCOPE").toString();
//            String purpose = formData.get("PURPOSE").toString();
//            String certificateNum = formData.get("CERTIFICATE_NUM").toString();
//            String validStart = formData.get("VALID_START").toString();
//            String validEnd = formData.get("VALID_END").toString();
//            String operatorName = formData.get("OPERATOR_NAME").toString();
//            String userId = formData.get("USER_ID").toString();
//            String loginName = formData.get("LOGIN_NAME").toString();
//
//            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//            userCheck.setUserName(userName);
//            userCheck.setUtilizationUserId(Long.parseLong(utilizationUserId));
//            userCheck.setUserId(Long.parseLong(userId));
//            userCheck.setCardId(cardId);
//            userCheck.setDeptName(deptName);
//            userCheck.setDeptNature(deptNature);
//            userCheck.setProjectName(projectName);
//            userCheck.setProjectType(projectType);
//            userCheck.setBorrowUser(borrowUser);
//            userCheck.setMaterialScope(materialScope);
//            userCheck.setPurpose(purpose);
//            userCheck.setCertificateNum(certificateNum);
//            userCheck.setValidStart(sdf.parse(validStart));
//            userCheck.setValidEnd(sdf.parse(validEnd));
//            userCheck.setOperatorName(operatorName);
//            userCheck.setRegisterDate(new Date());
//            userCheck.setLoginName(loginName);
//            userCheckService.saveOrUpdate(userCheck);
//            return new AjaxResponse(userCheck);
//        } catch (Exception e) {
//            logger.error(e.getMessage(), e);
//            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
//        }
//    }
//    /**
//     * 验证是否在有效期内
//     *
//     * @param userName
//     * @return
//     */
//    @RequestMapping({"/userVerify"})
//    @ResponseBody
//    public Object userVerify(@RequestBody String userName) {
//        try {
//            User userByName = userService.getUserByName(userName);
//            String deptName = userByName.getDeptName();
//            if (deptName != null && "外部用户".equals(deptName)) {
//                Date tomorrow = new Date();
//                Calendar calendar = Calendar.getInstance();
//                calendar.setTime(tomorrow);
//                calendar.add(Calendar.DAY_OF_YEAR, -1); // 加一天
//                tomorrow = calendar.getTime();
//                QueryWrapper<UserCheck> userCheckQueryWrapper = new QueryWrapper<>();
//                userCheckQueryWrapper.eq("USER_ID", userByName.getUserId());
//                userCheckQueryWrapper.ge("VALID_END", tomorrow);
//                int count = userCheckService.count(userCheckQueryWrapper);
//                if (count == 0) {
//                    return new AjaxResponse(new ErrorInfo("该用户尚未登记登记"), false);
//                }
//
//            }
//            return new AjaxResponse(true);
//        } catch (Exception e) {
//            logger.error(e.getMessage(), e);
//            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
//        }
//
//    }
    /**
     * 满意度调查页面
     *
     * @return
     * @throws LicenseException
     */
    @RequestMapping(value = "/userQuestion")
    public Object userQuestion() {
        ModelAndView mav = new ModelAndView("hn/utilizationUser/userQuestion");
        return mav;
    }
}
src/main/java/com/zbooksoft/gdmis/controller/UtlStatisticsController.java
New file
@@ -0,0 +1,504 @@
package com.zbooksoft.gdmis.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.zbooksoft.gdmis.data.entity.ProcessingDetail;
import com.zbooksoft.gdmis.service.ProcessingDetailService;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @Description: 利用统计
 * @Author: zhai
 * @Date: 2024/9/13
 **/
@Controller
@RequestMapping("/utlStatistics")
public class UtlStatisticsController {
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    ProcessingDetailService processingDetailService;
    private static final Logger logger = LoggerFactory.getLogger(UtlStatisticsController.class);
    /**
     * 服务利用统计
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/serviceStatistics")
    @RequiresUser
    public ModelAndView serviceStatistics() {
        ModelAndView mav = new ModelAndView("gh/utlStatistics/serviceStatistics");
        return mav;
    }
    /**
     * 根据借阅类型
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/utlType")
    @RequiresUser
    public ModelAndView utlType() {
        ModelAndView mav = new ModelAndView("gh/utlStatistics/utlType");
        return mav;
    }
    @RequestMapping({"/getUtlType"})
    @ResponseBody
    @RequiresUser
    public Object getUtlType(String code) {
        try {
            ArrayList<Map<String, Object>> mapList = new ArrayList<>();
            return mapList;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 按人件份统计
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/transferStatistics")
    @RequiresUser
    public ModelAndView transferStatistics() {
        ModelAndView mav = new ModelAndView("gh/utlStatistics/transferStatistics");
        return mav;
    }
    @RequestMapping({"/getTransferStatistics"})
    @ResponseBody
    @RequiresUser
    public Object getTransferStatistics(String year, String startData, String endData) {
        try {
            String sql = "SELECT " +
                    "    A.ID," +
                    "    A.XMKYQMC ," +
                    "    COUNT(DISTINCT B.ID) AS transferTime," +
                    "    COUNT(C.ID) AS transferCount," +
                    "    COUNT(CASE WHEN C.yszt = '3' THEN C.ID END) AS tidyCount," +
                    "    COUNT(CASE WHEN C.yszt = '3' THEN C.ID END) AS acceptCount," +
                    "    SUM(C.WJDX) AS acceptData," +
                    "    COUNT(CASE WHEN D.is_pass = 0 THEN D.id END) AS returnTime" +
                    " FROM CAT_FILE_AJJXX A" +
                    " LEFT JOIN BUS_TRANSFER_LOG B ON A.ID = B.AJ_ID" +
                    " LEFT JOIN CAT_ITEM_YSWJXX C ON A.ID = C.AJ_ID" +
                    " LEFT JOIN CAT_CHECK_INFO D ON A.ID = D.aj_id" +
                    " WHERE 1=1 ";
            // 添加时间段筛选条件
            if (startData != null && !startData.isEmpty()) {
                sql += " AND B.TRANSFER_TIEM >= '" + startData + "'";
            }
            if (endData != null && !endData.isEmpty()) {
                sql += " AND B.TRANSFER_TIEM <= '" + endData + "'";
            }
            sql += " GROUP BY A.ID, A.XMKYQMC" +
                    " ORDER BY A.ID;";
            List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
            return mapList;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 按人件份统计
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/utlStatisticsByUser")
    @RequiresUser
    public ModelAndView utlStatisticsByUser() {
        ModelAndView mav = new ModelAndView("gh/utlStatistics/utlStatisticsByUser");
        return mav;
    }
    @RequestMapping({"/getUtlStatisticsByUser"})
    @ResponseBody
    @RequiresUser
    public Object getUtlStatisticsByUser(String year, String startData, String endData) {
        try {
            List<Map<String, Object>> mapList = new ArrayList<>();
            if (year == null || year.equals("")) {
                String yearSQL = "SELECT DISTINCT YEAR(DATE_TIME) AS YEAR FROM  UTL_VIEW_FORM ";
                jdbcTemplate.queryForList(yearSQL).forEach(map -> {
                    String years = map.get("YEAR").toString().replace(".0", "");
                    Map<String, Object> hashMap = getCount("YEAR(DATE_TIME)", years);
                    hashMap.put("year", years);
                    mapList.add(hashMap);
                });
            } else {
                String yearSQL = "SELECT DISTINCT MONTH(DATE_TIME) AS MONTH FROM  UTL_VIEW_FORM where YEAR(DATE_TIME) = '" + year + "'";
                jdbcTemplate.queryForList(yearSQL).forEach(map -> {
                    String month = map.get("MONTH").toString().replace(".0", "");
                    Map<String, Object> hashMap = getCount(" MONTH(DATE_TIME)", month);
                    hashMap.put("year", year);
                    hashMap.put("month", month);
                    mapList.add(hashMap);
                });
            }
            return mapList;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 按借阅单位统计
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/utlStatisticsByDept")
    @RequiresUser
    public ModelAndView utlStatisticsByDept() {
        ModelAndView mav = new ModelAndView("gh/utlStatistics/utlStatisticsByDept");
        return mav;
    }
    //获取部门信息
    @RequestMapping({"/getUtlStatisticsByDept"})
    @ResponseBody
    @RequiresUser
    public Object getUtlStatisticsByDept(String deptName) {
        try {
            List<Map<String, Object>> mapList = new ArrayList<>();
            if (deptName == null || deptName.equals("")) {
                String yearSQL = "SELECT DISTINCT DEPT_NAME AS DEPT_NAME FROM  UTL_VIEW_FORM";
                jdbcTemplate.queryForList(yearSQL).forEach(map -> {
                    String deptNames = map.get("DEPT_NAME") == null ? "" : map.get("DEPT_NAME").toString();
                    Map<String, Object> hashMap = getCount("DEPT_NAME", deptNames);
                    hashMap.put("deptName", deptNames);
                    mapList.add(hashMap);
                });
            }
            return mapList;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 按借阅单位所在地统计
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/utlStatisticsByDeptAddress")
    @RequiresUser
    public ModelAndView utlStatisticsByDeptAddress() {
        ModelAndView mav = new ModelAndView("gh/utlStatistics/utlStatisticsByDeptAddress");
        return mav;
    }
    //获取部门信息
    @RequestMapping({"/getUtlStatisticsByDeptAddress"})
    @ResponseBody
    @RequiresUser
    public Object getUtlStatisticsByDeptAddress(String year, String startData, String endData) {
        try {
            List<Map<String, Object>> mapList = new ArrayList<>();
            String yearSQL = "SELECT DISTINCT city AS city FROM  UTL_VIEW_FORM";
            jdbcTemplate.queryForList(yearSQL).forEach(map -> {
                String city = map.get("city").toString();
                Map<String, Object> hashMap = getCount("city", city);
                hashMap.put("city", city);
                mapList.add(hashMap);
            });
            return mapList;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 按所属行业统计
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/utlStatisticsByIndustry")
    @RequiresUser
    public ModelAndView utlStatisticsByIndustry() {
        ModelAndView mav = new ModelAndView("gh/utlStatistics/utlStatisticsByIndustry");
        return mav;
    }
    //获取部门信息
    @RequestMapping({"/getUtlStatisticsByIndustry"})
    @ResponseBody
    @RequiresUser
    public Object getUtlStatisticsByIndustry(String year, String startData, String endData) {
        try {
            List<Map<String, Object>> mapList = new ArrayList<>();
            String yearSQL = "SELECT DISTINCT TRADE AS TRADE FROM  UTL_VIEW_FORM";
            jdbcTemplate.queryForList(yearSQL).forEach(map -> {
                String trade = map.get("TRADE").toString();
                Map<String, Object> hashMap = getCount("TRADE", trade);
                hashMap.put("trade", trade);
                mapList.add(hashMap);
            });
            return mapList;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 按单位性质统计
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/utlStatisticsByDeptType")
    @RequiresUser
    public ModelAndView utlStatisticsByDeptType() {
        ModelAndView mav = new ModelAndView("gh/utlStatistics/utlStatisticsByDeptType");
        return mav;
    }
    //获取部门信息
    @RequestMapping({"/getUtlStatisticsByDeptType"})
    @ResponseBody
    @RequiresUser
    public Object getUtlStatisticsByDeptType(String year, String startData, String endData) {
        try {
            List<Map<String, Object>> mapList = new ArrayList<>();
            String yearSQL = "SELECT DISTINCT DEPT_NATURE AS DEPT_NATURE FROM  UTL_VIEW_FORM";
            jdbcTemplate.queryForList(yearSQL).forEach(map -> {
                String deptNature = map.get("DEPT_NATURE").toString();
                Map<String, Object> hashMap = getCount("DEPT_NATURE", deptNature);
                hashMap.put("deptNature", deptNature);
                mapList.add(hashMap);
            });
            return mapList;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 按借阅区域统计
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/utlStatisticsByArea")
    @RequiresUser
    public ModelAndView utlStatisticsByArea() {
        ModelAndView mav = new ModelAndView("gh/utlStatistics/utlStatisticsByArea");
        return mav;
    }
    @RequestMapping({"/getUtlStatisticsByArea"})
    @ResponseBody
    @RequiresUser
    public Object getUtlStatisticsByArea(String year, String startData, String endData) {
        try {
            List<Map<String, Object>> mapList = new ArrayList<>();
            String yearSQL = "SELECT DISTINCT DEPT_NATURE AS DEPT_NATURE FROM  UTL_VIEW_FORM";
            jdbcTemplate.queryForList(yearSQL).forEach(map -> {
                String deptNature = map.get("DEPT_NATURE").toString();
                Map<String, Object> hashMap = getCount("DEPT_NATURE", deptNature);
                hashMap.put("deptNature", deptNature);
                mapList.add(hashMap);
            });
            return mapList;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 按资料类别统计
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/utlStatisticsByType")
    @RequiresUser
    public ModelAndView utlStatisticsByType() {
        ModelAndView mav = new ModelAndView("gh/utlStatistics/utlStatisticsByType");
        return mav;
    }
    /**
     * 对外服务详单
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/utlStatisticsByService")
    @RequiresUser
    public ModelAndView utlStatisticsByService() {
        ModelAndView mav = new ModelAndView("gh/utlStatistics/utlStatisticsByService");
        return mav;
    }
    /**
     * 涉密资料加工信息统计
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/utlStatisticsBySecurity")
    @RequiresUser
    public ModelAndView utlStatisticsBySecurity() {
        ModelAndView mav = new ModelAndView("gh/utlStatistics/utlStatisticsBySecurity");
        return mav;
    }
    @RequestMapping({"/getUtlStatisticsBySecurity"})
    @ResponseBody
    @RequiresUser
    public Object getUtlStatisticsBySecurity() {
        try {
            QueryWrapper<ProcessingDetail> wrapper = new QueryWrapper<>();
            wrapper.ne("SECURITY_CLASSIFICATION", "");
            wrapper.ne("SECURITY_CLASSIFICATION", "内部");
            wrapper.isNotNull("SECURITY_CLASSIFICATION");
            List<ProcessingDetail> processingDetailList = processingDetailService.list(wrapper);
            return processingDetailList;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 地质资料利用情况统计
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/utlStatistics")
    @RequiresUser
    public ModelAndView utlStatistics() {
        ModelAndView mav = new ModelAndView("gh/utlStatistics/utlStatistics");
        return mav;
    }
    /**
     * 地质资料利用情况统计
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/physicalStatistics")
    @RequiresUser
    public ModelAndView physicalStatistics() {
        ModelAndView mav = new ModelAndView("gh/utlStatistics/physicalStatistics");
        return mav;
    }
    public Map<String, Object> getCount(String tableName, String value) {
        HashMap<String, Object> map = new HashMap<>();
        String sql = "SELECT  APPLY_NAME, COUNT(APPLY_NAME) as count,SUM(FILE_COUNT) as file_count,SUM(ITEM_COUNT) as item_count FROM utl_view_form where " + tableName + " ='" + value + "' GROUP BY  APPLY_NAME ";
        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
        for (Map<String, Object> map1 : mapList) {
            if (map1.get("APPLY_NAME") != null && "借阅".equals(map1.get("APPLY_NAME").toString())) {
                map.put("borrow", map1.get("count"));
                map.put("borrowFileCount", map1.get("file_count"));
                map.put("borrowItemCount", map1.get("item_count"));
            }
            if (map1.get("APPLY_NAME") != null && "加工".equals(map1.get("APPLY_NAME").toString())) {
                map.put("process", map1.get("count"));
                map.put("processFileCount", map1.get("file_count"));
                map.put("processItemCount", map1.get("item_count"));
            }
            if (map1.get("APPLY_NAME") != null && "实物利用".equals(map1.get("APPLY_NAME").toString())) {
                map.put("physical", map1.get("count"));
                map.put("physicalFileCount", map1.get("file_count"));
                map.put("physicalItemCount", map1.get("item_count"));
            }
        }
        return map;
    }
    /**
     * 获取地质资料 成果资料 原始资料 实物资料数量
     *
     * @return
     */
    @RequestMapping({"/getCount"})
    @ResponseBody
    @RequiresUser
    public Object getCount() {
        try {
            HashMap<Object, Object> counMap = new HashMap<>();
            String dzzlCountSql = "select count(1) from CAT_FILE_AJJXX where fbzt = 1";
            Integer dzzlCount = jdbcTemplate.queryForObject(dzzlCountSql, Integer.class);
            counMap.put("dzzlCount", dzzlCount);
            String yzCountSql = "select count(1) from CAT_ITEM_YSWJXX where AJ_ID IN (select ID from CAT_FILE_AJJXX where fbzt = 1)";
            Integer yzCount = jdbcTemplate.queryForObject(yzCountSql, Integer.class);
            counMap.put("yzCount", yzCount);
            String cgCountSql = "select count(1) from CAT_ITEM_CGWJXX where AJ_ID IN (select ID from CAT_FILE_AJJXX where fbzt = 1)";
            Integer cgCount = jdbcTemplate.queryForObject(cgCountSql, Integer.class);
            counMap.put("cgCount", cgCount);
            String swCountSql = "select count(1) from CAT_FILE_SWAJXX ";
            Integer swCount = jdbcTemplate.queryForObject(swCountSql, Integer.class);
            counMap.put("swCount", swCount);
            return counMap;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
}
src/main/java/com/zbooksoft/gdmis/dao/BorrowDetailMapper.java
@@ -2,6 +2,9 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbooksoft.gdmis.data.entity.BorrowDetail;
import com.zbooksoft.gdmis.data.vo.ParentBorrowInfo;
import java.util.List;
/**
 * <p>
@@ -12,6 +15,8 @@
 * @since 2020-01-03
 */
public interface BorrowDetailMapper extends BaseMapper<BorrowDetail> {
    List<ParentBorrowInfo> selectDistinctParentBorrowInfo(Long createUserId);
    List<ParentBorrowInfo> selectDistinctParentBorrowInfoByFormId(Long formId);
}
src/main/java/com/zbooksoft/gdmis/dao/BorrowFormMapper.java
@@ -11,4 +11,5 @@
 * @Date 2024/7/31
 **/
public interface BorrowFormMapper extends BaseMapper<BorrowForm> {
    String selectMaxApplyCode(String preNum);
}
src/main/java/com/zbooksoft/gdmis/dao/CatCgwjxxMapper.java
New file
@@ -0,0 +1,12 @@
package com.zbooksoft.gdmis.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbooksoft.gdmis.data.entity.CatCgwjxx;
/**
 * @Description 成果文件级接口
 * @Author zhai
 * @Date 2024/7/31
 **/
public interface CatCgwjxxMapper extends BaseMapper<CatCgwjxx> {
}
src/main/java/com/zbooksoft/gdmis/dao/CatCheckMapper.java
New file
@@ -0,0 +1,17 @@
package com.zbooksoft.gdmis.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbooksoft.gdmis.data.entity.CatCheck;
/**
 * <p>
 * Mapper 借阅明细接口
 * </p>
 *
 * @author cb
 * @since 2020-01-03
 */
public interface CatCheckMapper extends BaseMapper<CatCheck> {
}
src/main/java/com/zbooksoft/gdmis/dao/CatSwyxxxMapper.java
New file
@@ -0,0 +1,14 @@
package com.zbooksoft.gdmis.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbooksoft.gdmis.data.entity.CatSwyxxx;
/**
 * @Description 矿产信息接口
 * @Author zhai
 * @Date 2024/7/31
 **/
public interface CatSwyxxxMapper extends BaseMapper<CatSwyxxx> {
}
src/main/java/com/zbooksoft/gdmis/dao/CheckQuestionMapper.java
New file
@@ -0,0 +1,16 @@
package com.zbooksoft.gdmis.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbooksoft.gdmis.data.entity.CheckQuestion;
/**
 * <p>
 * Mapper 借阅明细接口
 * </p>
 *
 * @author cb
 * @since 2020-01-03
 */
public interface CheckQuestionMapper extends BaseMapper<CheckQuestion> {
}
src/main/java/com/zbooksoft/gdmis/dao/PackingManageMapper.java
New file
@@ -0,0 +1,13 @@
package com.zbooksoft.gdmis.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbooksoft.gdmis.data.entity.CatZkxx;
import com.zbooksoft.gdmis.data.entity.PackingManage;
/**
 * @Description:
 * @Author: zhai
 * @Date: 2025/9/9
 **/
public interface PackingManageMapper  extends BaseMapper<PackingManage> {
}
src/main/java/com/zbooksoft/gdmis/dao/PhysicalDetailMapper.java
New file
@@ -0,0 +1,23 @@
package com.zbooksoft.gdmis.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbooksoft.gdmis.data.entity.PhysicalDetail;
import com.zbooksoft.gdmis.data.vo.ParentPhysicalInfo;
import java.util.List;
/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author cb
 * @since 2020-01-03
 */
public interface PhysicalDetailMapper extends BaseMapper<PhysicalDetail> {
    List<ParentPhysicalInfo> selectDistinctParentPhysicalInfo(Long createUserId);
    List<ParentPhysicalInfo> selectDistinctParentPhysicalInfoByFormId(Long formId);
}
src/main/java/com/zbooksoft/gdmis/dao/PhysicalFormMapper.java
New file
@@ -0,0 +1,16 @@
package com.zbooksoft.gdmis.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zbooksoft.gdmis.data.entity.PhysicalForm;
/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author cb
 * @since 2020-01-03
 */
public interface PhysicalFormMapper extends BaseMapper<PhysicalForm> {
    String selectMaxApplyCode(String preNum);
}
src/main/java/com/zbooksoft/gdmis/data/entity/BorrowDetail.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
@@ -12,6 +13,7 @@
 * @Date: 2024/8/2
 **/
@TableName("UTL_BORROW_DETAIL")
@Data
public class BorrowDetail {
    /**
@@ -24,87 +26,52 @@
     */
    private Long formId;
    /**
     * 案卷级或文件级id
     * 案卷级id
     */
    private Long keyId;
    private Long fileId;
    /**
     * 文件级id
     */
    private Long itemId;
    /**
     * 档号
     */
    private String archivalCode;
    /**
     * 档号 ITEM_CODE
     */
    private String itemCode;
    /**
     * 件号
     */
    private String itemNumber;
    /**
     * 编号
     * 案卷题名
     */
    private String documentNumber;
    private String fileTitle;
    /**
     * 案卷级或文件级题名
     * 文件题名
     */
    private String archivalTitle;
    /**
     * 模块id
     */
    private Long moduleId;
    /**
     * 模块名称
     */
    private String moduleName;
    /**
     * 父模块id
     */
    private Long parentModuleId;
    /**
     * 案卷id(案卷时和key_id一致)
     */
    private Long parentKeyId;
    /**
     * 案卷档号(案卷时和archives_code一致)
     */
    private String parentArchivalCode;
    /**
     * 案卷题名(案卷时和title一致)
     */
    private String parentArchivalTitle;
    /**
     * 归档部门
     */
    private String filingUnit;
    /**
     * 浏览
     */
    private Integer browseRights;
    /**
     * 下载
     */
    private Integer downloadRights;
    /**
     * 打印
     */
    private Integer printRights;
    private String itemTitle;
    /**
     * 原件借出
     * 借阅类型 0:成果资料,1:原始资料
     */
    private Integer originalBorrow;
    private Integer borrowType;
    /**
     * 纸质借阅
     * 电子
     */
    private Integer electronic;
    /**
     * 纸质
     */
    private Integer paper;
    /**
     * 纸质查阅
     * 原件借出
     */
    private Integer paperBrowse;
    /**
     * 纸质复制
     */
    private Integer paperCopy;
    /**
     * 纸质借出
     */
    private Integer paperBorrow;
    private Integer original;
    /**
     * 同意与否:0不同意,1同意
     */
@@ -127,362 +94,13 @@
     */
    private String securityClassification;
    /**
     * 密级代码
     * 涉密页码
     */
    private Integer securityClassificationCode;
    private String securityPageNum;
    /**
     * 文本页数
     * 是否可以借阅纸质文件   BORROW_PURPOSE
     */
    private Integer pageNum;
    /**
     * 文本价格
     */
    private String pagePrice;
    /**
     * 图件页数
     */
    private Integer drawNum;
    /**
     * 图件价格
     */
    private String drawPrice;
    /**
     * 利用方式
     */
    private String utilizationType;
    private String parentDocumentNumber;
    private String year;
    public String getOldId() {
        return oldId;
    }
    public void setOldId(String oldId) {
        this.oldId = oldId;
    }
    private String oldId;
    public Long getDetailId() {
        return detailId;
    }
    public void setDetailId(Long detailId) {
        this.detailId = detailId;
    }
    public Long getFormId() {
        return formId;
    }
    public void setFormId(Long formId) {
        this.formId = formId;
    }
    public Long getKeyId() {
        return keyId;
    }
    public void setKeyId(Long keyId) {
        this.keyId = keyId;
    }
    public String getArchivalCode() {
        return archivalCode;
    }
    public void setArchivalCode(String archivalCode) {
        this.archivalCode = archivalCode;
    }
    public String getArchivalTitle() {
        return archivalTitle;
    }
    public void setArchivalTitle(String archivalTitle) {
        this.archivalTitle = archivalTitle;
    }
    public Long getModuleId() {
        return moduleId;
    }
    public void setModuleId(Long moduleId) {
        this.moduleId = moduleId;
    }
    public Long getParentModuleId() {
        return parentModuleId;
    }
    public void setParentModuleId(Long parentModuleId) {
        this.parentModuleId = parentModuleId;
    }
    public String getParentArchivalCode() {
        return parentArchivalCode;
    }
    public void setParentArchivalCode(String parentArchivalCode) {
        this.parentArchivalCode = parentArchivalCode;
    }
    public String getParentArchivalTitle() {
        return parentArchivalTitle;
    }
    public void setParentArchivalTitle(String parentArchivalTitle) {
        this.parentArchivalTitle = parentArchivalTitle;
    }
    public Integer getBrowseRights() {
        return browseRights;
    }
    public void setBrowseRights(Integer browseRights) {
        this.browseRights = browseRights;
    }
    public Integer getDownloadRights() {
        return downloadRights;
    }
    public void setDownloadRights(Integer downloadRights) {
        this.downloadRights = downloadRights;
    }
    public Integer getPrintRights() {
        return printRights;
    }
    public void setPrintRights(Integer printRights) {
        this.printRights = printRights;
    }
    public Integer getPaper() {
        return paper;
    }
    public void setPaper(Integer paper) {
        this.paper = paper;
    }
    public Integer getAgree() {
        return agree;
    }
    public void setAgree(Integer agree) {
        this.agree = agree;
    }
    public Long getCreateUserId() {
        return createUserId;
    }
    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }
    public String getCreateUserName() {
        return createUserName;
    }
    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getFilingUnit() {
        return filingUnit;
    }
    public void setFilingUnit(String filingUnit) {
        this.filingUnit = filingUnit;
    }
    public String getItemNumber() {
        return itemNumber;
    }
    public void setItemNumber(String itemNumber) {
        this.itemNumber = itemNumber;
    }
    public String getDocumentNumber() {
        return documentNumber;
    }
    public void setDocumentNumber(String documentNumber) {
        this.documentNumber = documentNumber;
    }
    public Long getParentKeyId() {
        return parentKeyId;
    }
    public void setParentKeyId(Long parentKeyId) {
        this.parentKeyId = parentKeyId;
    }
    public String getModuleName() {
        return moduleName;
    }
    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }
    public Integer getPaperCopy() {
        return paperCopy;
    }
    public void setPaperCopy(Integer paperCopy) {
        this.paperCopy = paperCopy;
    }
    public Integer getPaperBorrow() {
        return paperBorrow;
    }
    public void setPaperBorrow(Integer paperBorrow) {
        this.paperBorrow = paperBorrow;
    }
    public Integer getPaperBrowse() {
        return paperBrowse;
    }
    public void setPaperBrowse(Integer paperBrowse) {
        this.paperBrowse = paperBrowse;
    }
    public Integer getOriginalBorrow() {
        return originalBorrow;
    }
    public void setOriginalBorrow(Integer originalBorrow) {
        this.originalBorrow = originalBorrow;
    }
    public String getSecurityClassification() {
        return securityClassification;
    }
    public void setSecurityClassification(String securityClassification) {
        this.securityClassification = securityClassification;
    }
    public Integer getSecurityClassificationCode() {
        return securityClassificationCode;
    }
    public void setSecurityClassificationCode(Integer securityClassificationCode) {
        this.securityClassificationCode = securityClassificationCode;
    }
    public Integer getPageNum() {
        return pageNum;
    }
    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }
    public String getPagePrice() {
        return pagePrice;
    }
    public void setPagePrice(String pagePrice) {
        this.pagePrice = pagePrice;
    }
    public Integer getDrawNum() {
        return drawNum;
    }
    public void setDrawNum(Integer drawNum) {
        this.drawNum = drawNum;
    }
    public String getDrawPrice() {
        return drawPrice;
    }
    public void setDrawPrice(String drawPrice) {
        this.drawPrice = drawPrice;
    }
    public String getUtilizationType() {
        return utilizationType;
    }
    public void setUtilizationType(String utilizationType) {
        this.utilizationType = utilizationType;
    }
    public String getParentDocumentNumber() {
        return parentDocumentNumber;
    }
    public void setParentDocumentNumber(String parentDocumentNumber) {
        this.parentDocumentNumber = parentDocumentNumber;
    }
    public String getYear() {
        return year;
    }
    public void setYear(String year) {
        this.year = year;
    }
    private Integer paperBorrow;
    @Override
    public String toString() {
        return "ArchivesUtilizationDetail{" +
                "detailId=" + detailId +
                ", formId=" + formId +
                ", keyId=" + keyId +
                ", archivalCode='" + archivalCode + '\'' +
                ", itemNumber='" + itemNumber + '\'' +
                ", documentNumber='" + documentNumber + '\'' +
                ", archivalTitle='" + archivalTitle + '\'' +
                ", moduleId=" + moduleId +
                ", moduleName='" + moduleName + '\'' +
                ", parentModuleId=" + parentModuleId +
                ", parentKeyId=" + parentKeyId +
                ", parentArchivalCode='" + parentArchivalCode + '\'' +
                ", parentArchivalTitle='" + parentArchivalTitle + '\'' +
                ", filingUnit='" + filingUnit + '\'' +
                ", browseRights=" + browseRights +
                ", downloadRights=" + downloadRights +
                ", printRights=" + printRights +
                ", originalBorrow=" + originalBorrow +
                ", paper=" + paper +
                ", paperBrowse=" + paperBrowse +
                ", paperCopy=" + paperCopy +
                ", paperBorrow=" + paperBorrow +
                ", agree=" + agree +
                ", createUserId=" + createUserId +
                ", createUserName='" + createUserName + '\'' +
                ", createTime=" + createTime +
                ", securityClassification='" + securityClassification + '\'' +
                ", securityClassificationCode=" + securityClassificationCode +
                ", pageNum=" + pageNum +
                ", pagePrice='" + pagePrice + '\'' +
                ", drawNum=" + drawNum +
                ", drawPrice='" + drawPrice + '\'' +
                ", utilizationType='" + utilizationType + '\'' +
                ", parentDocumentNumber='" + parentDocumentNumber + '\'' +
                ", year='" + year + '\'' +
                ", oldId='" + oldId + '\'' +
                '}';
    }
}
src/main/java/com/zbooksoft/gdmis/data/entity/BorrowForm.java
@@ -31,51 +31,50 @@
    /**
     * 利用类型:0电子借阅,1纸质借阅
     */
    private Integer utilizationType;
    private Integer borrowType;
    /**
     * 利用人id
     */
    private Long utilizationUserId;
    private Long borrowUserId;
    /**
     * 利用人名称
     */
    private String utilizationUserName;
    private String borrowUserName;
    /**
     * 利用人所在部门ID
     * 邮政编码
     */
    private Long utilizationDeptId;
    private String postCode;
    /**
     * 利用人所在部门
     * 涉密证书编号
     */
    private String utilizationDept;
    private String certificateNumber;
    /**
     * 电话号码
     */
    private String telNumber;
    /**
     * 利用人手机号
     */
    private String utilizationTel;
    private String borrowTel;
    /**
     * 利用日期(默认为创建日期,流程批准完后改为批准日期)
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date utilizationDate;
    private Date borrowDate;
    /**
     * 利用截止日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date utilizationValidDate;
    private Date borrowValidDate;
    /**
     * 利用理由
     * 资料用途
     */
    private String utilizationPurpose;
    /**
     * 归档部门
     */
    private String filingUnit;
    /**
     * 归档部门ID
     */
    private Long filingUnitId;
    private String borrowPurpose;
    /**
     * 备注
     */
@@ -94,17 +93,10 @@
    private String flowStep;
    /**
     * 电子借阅是否存在原件借出,只要有一条借阅明细勾选原件借出,则修改为1
     */
    private Integer originalBorrow;
    /**
     * 流程实例ID
     */
    private Long processInstanceId;
    /**
     * 归还日期
     */
    private Date returnDate;
    /**
     * 创建人ID
     */
@@ -124,31 +116,29 @@
    /**
     * 密级代码
     */
    private Integer securityClassificationCode;
    private Integer securityCode;
    /**
     * 最后催还时间
     */
    private Date lastRecallTime;
    /**
     * 催还次数
     */
    private Integer recallNum;
    private Integer isExist;
    private String cardId;
    private String deptName;
    private String deptNature;
    private String deptAddress;
    private String area;
    private Integer fileCount;
    private Integer itemCount;
    /**
     * 身份证号码  ID_CARD
     */
    private String idCard;
    /**
     * 利用方式 已经走过流程,未走过流程
     */
    private String utilizationMethod;
    private String utilizationMode;
    /**
     * 删除状态
     */
    private Integer deleteState;
}
src/main/java/com/zbooksoft/gdmis/data/entity/CatAjjxx.java
@@ -4,7 +4,9 @@
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@@ -16,6 +18,7 @@
@TableName("CAT_FILE_AJJXX")
@Data
public class CatAjjxx {
    /**
     * 主键
@@ -101,8 +104,9 @@
    /**
     * 形成时间
     */
    private Date xcsj;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private String xcsj;
    /**
     * 资料类别
     */
@@ -154,6 +158,11 @@
    private String mj;
    /**
     * 密级代码
     */
    private String mjdm;
    /**
     * 是否保护
     */
@@ -176,12 +185,13 @@
    /**
     * 发证日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date fzrq;
    /**
     * 发布日期
     */
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date fbrq;
    /**
     * 关键字
@@ -415,27 +425,27 @@
     * 正文纸质件数
     */
    private String zwzzjs;
    private Integer zwzzjs;
    /**
     * 审批纸质件数
     */
    private String spzzjs;
    private Integer spzzjs;
    /**
     * 附图纸质件数
     */
    private String ftzzjs;
    private Integer ftzzjs;
    /**
     * 附表纸质件数
     */
    private String fbzzjs;
    private Integer fbzzjs;
    /**
     * 附件纸质件数
     */
    private String fjzzjs;
    private Integer fjzzjs;
    /**
     * 其他纸质件数
     */
@@ -451,164 +461,172 @@
     * 正文电子件数
     */
    private String zwdzjs;
    private Integer zwdzjs;
    /**
     * 审批电子件数
     */
    private String spdzjs;
    private Integer spdzjs;
    /**
     * 附图电子件数
     */
    private String ftdzjs;
    private Integer ftdzjs;
    /**
     * 附表电子件数
     */
    private String fbdzjs;
    private Integer fbdzjs;
    /**
     * 附件电子件数
     */
    private String fjdzjs;
    private Integer fjdzjs;
    /**
     * 软件电子件数
     */
    private String rjdzjs;
    private Integer rjdzjs;
    /**
     * 数据库电子件数
     */
    private String sjkdzjs;
    private Integer sjkdzjs;
    /**
     * 多媒体电子件数
     */
    private String dmtdzjs;
    private Integer dmtdzjs;
    /**
     * 其他电子件数
     */
    private String qtdzjs;
    private Integer qtdzjs;
    /**
     * 成果资料数据量
     */
    private String cgzlsjl;
    private Double cgzlsjl;
    /**
     * 成果资料电子文件总数
     */
    private String cgzldzwjzs;
    private Integer cgzldzwjzs;
    /**
     * 成果资料电子件数
     */
    private Integer cgzldzjs;
    /**
     * 成果资料纸质件数
     */
    private Integer cgzlzzjs;
    /**
     * 成果资料电子文件夹总数
     */
    private String cgzldzwjjzs;
    private Integer cgzldzwjjzs;
    /**
     * 底/d类纸质件数
     */
    private String dzzjs;
    private Integer dzzjs;
    /**
     * 测/c类纸质件数
     */
    private String czzjs;
    private Integer czzjs;
    /**
     * 观/g类纸质件数
     */
    private String gzzjs;
    private Integer gzzjs;
    /**
     * 探/t类纸质件数
     */
    private String tzzjs;
    private Integer tzzjs;
    /**
     * 样/y类纸质件数
     */
    private String yzzjs;
    private Integer yzzjs;
    /**
     * 试/s类纸质件数
     */
    private String szzjs;
    private Integer szzjs;
    /**
     * 录/l类纸质件数
     */
    private String lzzjs;
    private Integer lzzjs;
    /**
     * 像/x类纸质件数
     */
    private String xzzjs;
    private Integer xzzjs;
    /**
     * 综/z类纸质件数
     */
    private String zzzjs;
    private Integer zzzjs;
    /**
     * 文/w类纸质件数
     */
    private String wzzjs;
    private Integer wzzjs;
    /**
     * 底/d类电子件数
     */
    private String ddzjs;
    private Integer ddzjs;
    /**
     * 测/c类电子件数
     */
    private String cdzjs;
    private Integer cdzjs;
    /**
     * 观/g类电子件数
     */
    private String gdzjs;
    private Integer gdzjs;
    /**
     * 探/t类电子件数
     */
    private String tdzjs;
    private Integer tdzjs;
    /**
     * 样/y类电子件数
     */
    private String ydzjs;
    private Integer ydzjs;
    /**
     * 试/s类电子件数
     */
    private String sdzjs;
    private Integer sdzjs;
    /**
     * 录/l类电子件数
     */
    private String ldzjs;
    private Integer ldzjs;
    /**
     * 像/x类电子件数
     */
    private String xdzjs;
    private Integer xdzjs;
    /**
     * 综/z类电子件数
     */
    private String zdzjs;
    private Integer zdzjs;
    /**
     * 文/w类电子件数
     */
    private String wdzjs;
    private Integer wdzjs;
    /**
     * 原始电子数据量
     */
@@ -633,44 +651,44 @@
     * 钻孔数量(岩矿心)
     */
    private String zksl;
    private Integer zksl;
    /**
     * 总进尺
     */
    private String zjc;
    private Double zjc;
    /**
     * 岩心总数量(取心)
     */
    private String yxzsl;
    private Double yxzsl;
    /**
     * 岩屑总数量
     */
    private String yxizsl;
    private Integer yxizsl;
    /**
     * 标本总数量
     */
    private String bbzsl;
    private Integer bbzsl;
    /**
     * 样品总数量
     */
    private String ypzsl;
    private Integer ypzsl;
    /**
     * 光片总数量
     */
    private String gpzsl;
    private Integer gpzsl;
    /**
     * 薄片总数量
     */
    private String bpzsl;
    private Integer bpzsl;
    /**
     * 其他类型名称
     */
@@ -685,7 +703,6 @@
     */
    private String qtswsl;
    //项目/矿权信息
    /**
     * 项目/矿业权性质
     */
@@ -698,33 +715,84 @@
    /**
     * 所属项目名称
     */
    private String xmkyqmc;
    /**
     * 所属项目编号
     */
    private String xmkyqbh;
    /**
     * 年度
     */
    private String nd;
    /**
     * 年度经费
     */
    private String ndjf;
    /**
     * 年度经费
     */
    /**
     * 所属项目编号
     */
    private String xmsfzm;
    /**
     * 任务书编号
     */
    private String rwsbh;
    /**
     * 矿业权起始日期
     */
    private Date qssj;
    private String qssj;
    /**
     * 矿业权终止日期
     */
    private Date zzsj;
    private String zzsj;
    /**
     * 项目周期
     */
    private String xmzq;
    /**
     * 项目属性
     */
    private String xmsx;
    /**
     * 三性定位
     */
    private String sxdw;
    /**
     * 三性定位
     */
    private String xmzt;
    /**
     * 项目主管机构名称
     */
    private String xmzgjgmc;
    /**
     * 项目技术负责人
     */
    private String xmfzrjs;
    /**
     * 项目技术负责人
     */
    private String xmfzrhq;
    /**
     * 矿业权人
     */
    private String xmcddwkyqr;
    /**
     * 项目负责人
@@ -805,9 +873,10 @@
     * 资料状态
     */
    private String zlzt;
    private Integer zlzt;
    /**
     * 著录状态
     * 0:受理  1:不合格  2:合格  3:待著录  4:著录
     */
    private String zluzt;
@@ -815,7 +884,7 @@
     * 发布状态
     */
    private String fbzt;
    private Integer fbzt;
    /**
     * 验收人
     */
@@ -825,14 +894,15 @@
    /**
     * 验收完成时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date yswsj;
    /**
     * 凭证信息录入状态
     */
    private String pzxxlrzt;
    private Integer pzxxlrzt;
    /**
     * 发布时间
     */
@@ -843,4 +913,110 @@
     */
    private String fbr;
    /**
     * 正文源电子件数
     */
    private String zwydzjs;
    /**
     * 审批源电子件数
     */
    private String spydzjs;
    /**
     * 附图源电子件数
     */
    private String ftydzjs;
    /**
     * 附表源电子件数
     */
    private String fbydzjs;
    /**
     * 附件源电子件数
     */
    private String fjydzjs;
    /**
     * 软件源电子件数
     */
    private String rjydzjs;
    /**
     * 数据库源电子件数
     */
    private String sjkydzjs;
    /**
     * 多媒体源电子件数
     */
    private String dmtydzjs;
    /**
     * 其他源电子件数
     */
    private String qtydzjs;
    /**
     * 正文存档电子件数
     */
    private String zwcddzjs;
    /**
     * 审批存档电子件数
     */
    private String spcddzjs;
    /**
     * 附图存档电子件数
     */
    private String ftcddzjs;
    /**
     * 附表存档电子件数
     */
    private String fbcddzjs;
    /**
     * 附件存档电子件数
     */
    private String fjcddzjs;
    /**
     * 软件存档电子件数
     */
    private String rjcddzjs;
    /**
     * 数据库存档电子件数
     */
    private String sjkcddzjs;
    /**
     * 多媒体存档电子件数
     */
    private String dmtcddzjs;
    /**
     * 其他存档电子件数
     */
    private String qtcddzjs;
    /**
     * 其他纸质件数
     */
    private Integer qtzzjs;
    /**
     * 原始资料电子件数
     */
    private Integer yszldzjs;
    /**
     * 原始资料数据量
     */
    private Double yszlsjl;
    /**
     * 原始资料电子文件总数
     */
    private Integer yszldzwjzs;
    /**
     * 原始资料电子文件夹总数
     */
    private Integer yszldzwjjzs;
    /**
     * 原始资料纸质件数
     */
    private String yszlzzjs;
    /**
     * 存储两条以上的地理位置信息
     */
    private String dlwzs;
    private Long swId;
    private Integer deleteState;
}
src/main/java/com/zbooksoft/gdmis/data/entity/CatCgwjxx.java
@@ -5,8 +5,6 @@
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
/**
 * @Description:成果文件级
 * @Author: zhai
@@ -25,7 +23,7 @@
     * 所属案卷id
     */
    private Long ajid;
    private Long ajId;
    /**
     * 案卷号
@@ -37,7 +35,7 @@
     * 件号
     */
    private String jh;
    private Integer jh;
    /**
     * 文件题名
     */
@@ -54,13 +52,18 @@
     * 册号
     */
    private String ch;
    private Integer ch;
    /**
     * 电子文件名
     */
    private String wjm;
    /**
     * 电子文件名
     */
    private String dh;
    /**
     * 源电子文件路径
@@ -84,7 +87,7 @@
     * 源电子文件大小
     */
    private String ydzwjdx;
    private Double ydzwjdx;
    /**
     * 源电文件数
@@ -156,7 +159,7 @@
     * 存档电子文件大小
     */
    private String cddzwjdx;
    private Double cddzwjdx;
    /**
     * 存档电子文件数
@@ -222,7 +225,7 @@
     * 形成时间
     */
    private Date xcsj;
    private String xcsj;
    /**
     * 形成人
@@ -291,5 +294,33 @@
     * 插图文件大小(正文显示)
     */
    private String ctdx;
    /**
     * 插图文件大小(正文显示)
     */
    private String jm;
    /**
     * 是否涉密
     */
    private String sfsm;
    /**
     * 涉密信息
     */
    private String smxx;
    /**
     * 浏览路径
     */
    private String lllj;
    /**
     * 关联状态 0 未关联  1 已关联
     */
    private Integer relationState;
    /**
     * 密级代码
     */
    private Integer securityCode;
    /**
     * 密级代码
     */
    private Integer jyzt;
}
src/main/java/com/zbooksoft/gdmis/data/entity/CatCheck.java
New file
@@ -0,0 +1,56 @@
package com.zbooksoft.gdmis.data.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
/**
 * @Description:资料验收统计
 * @Author: zhai
 * @Date: 2024/8/19
 **/
@TableName("CAT_CHECK_INFO")
@Data
public class CatCheck {
    @TableId(type = IdType.ID_WORKER)
    private Long id;
    /**
     * 文件夹id
     */
    private Long itemId;
    /**
     * 案卷级id
     */
    private Long ajId;
    /**
     * 是否验收通过
     */
    private Integer isPass;
    /**
     * 验收存在的问题
     */
    private String question;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 创建人
     */
    private String createUserName;
    /**
     * 创建人id
     */
    private Long createUserId;
    /**
     * 选择问题
     */
    private String checkQuestion;
}
src/main/java/com/zbooksoft/gdmis/data/entity/CatKc.java
@@ -23,7 +23,7 @@
     * 所属案卷ID
     */
    private Long ajid;
    private Long ajId;
    /**
     * 矿产代码
src/main/java/com/zbooksoft/gdmis/data/entity/CatSmxx.java
@@ -23,12 +23,12 @@
     * 所属案卷ID
     */
    private Long ajid;
    private Long ajId;
    /**
     * 所属文件ID
     */
    private String wjid;
    private Long wjId;
    /**
     * 涉密内容
     */
@@ -61,4 +61,10 @@
    private String zsfw;
    /**
     * 涉密页码
     */
    private String smym;
}
src/main/java/com/zbooksoft/gdmis/data/entity/CatSwyxxx.java
New file
@@ -0,0 +1,114 @@
package com.zbooksoft.gdmis.data.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
 * @Description:岩心岩屑信息
 * @Author: zhai
 * @Date: 2024/10/18
 **/
@TableName("CAT_ITEM_SWYXXX")
@Data
public class CatSwyxxx {
    /**
     * 主键
     */
    @TableId(type = IdType.ID_WORKER)
    private Long id;
    private Long ajId;
    /**
     * 资源唯一标识符
     */
    private String bsf;
    /**
     * 组织机构代码
     */
    private String zzjgdm;
    /**
     * 项目名称
     */
    private String xmmc;
    /**
     * 实物资料档号
     */
    private String swzldh;
    /**
     * 钻孔编号
     */
    private String zkbh;
    /**
     * 钻孔名称
     */
    private String zkmc;
    /**
     * 资料类别
     */
    private String zllb;
    /**
     * 勘探线号
     */
    private String ktxh;
    /**
     * 孔口经度
     */
    private String kkjd;
    /**
     * 孔口纬度
     */
    private String kkwd;
    /**
     * 总进尺(米)
     */
    private String zjc;
    /**
     * 取心数量
     */
    private String qxsl;
    /**
     * 保管岩心长度
     */
    private String bgyxcd;
    /**
     * 岩屑数量
     */
    private String yxsl;
    /**
     * 保管岩屑数量
     */
    private String bgyxsl;
    /**
     * 见矿深度范围
     */
    private String jksdfw;
    /**
     * 保管现状
     */
    private String bgxz;
    /**
     * 有无岩心影像
     */
    private String ywyxyx;
    /**
     * 保管单位名称
     */
    private String bgdwmc;
    /**
     * 备注
     */
    private String remark;
}
src/main/java/com/zbooksoft/gdmis/data/entity/CatTfxx.java
@@ -23,7 +23,7 @@
     * 所属案卷信息
     */
    private Long ajid;
    private Long ajId;
    /**
     * 序号
src/main/java/com/zbooksoft/gdmis/data/entity/CatXzq.java
@@ -22,7 +22,7 @@
     * 所属案卷ID
     */
    private Long ajid;
    private Long ajId;
    /**
     * 行政区代码
     */
src/main/java/com/zbooksoft/gdmis/data/entity/CatYswjxx.java
@@ -23,13 +23,18 @@
     * 所属案卷ID
     */
    private Long ajid;
    private Long ajId;
    /**
     * 档号
     */
    private String dh;
    /**
     * 档号
     */
    private String hh;
    /**
     * 序号
@@ -162,4 +167,93 @@
     */
    private String wjgssm;
    /**
     * 项目编码
     */
    private String xmbm;
    /**
     * 形成单位
     */
    private String xcdw;
    /**
     * 评审文号
     */
    private String pswh;
    /**
     * 评审时间
     */
    private Data pssj;
    /**
     * 评审单位
     */
    private String psdw;
    /**
     * 编目时间
     */
    private String bmsj;
    /**
     * 编写者
     */
    private String bxz;
    /**
     * 编著单位
     */
    private String bzdw;
    /**
     * 纸张页数
     */
    private String zzys;
    /**
     * 保管期限
     */
    private String bgqx;
    /**
     * 数量
     */
    private String sl;
    /**
     * 页码
     */
    private String ym;
    /**
     * 验收状态
     */
    private Integer yszt;
    /**
     * 浏览路径
     */
    private String lllj;
    /**
     * 关联状态 0 未关联  1 已关联
     */
    private Integer relationState;
    /**
     * 密级代码
     */
    private Integer securityCode;
    /**
     * 是否涉密
     */
    private String sfsm;
    /**
     * 涉密详情
     */
    private String smxx;
    /**
     * 涉密详情
     */
    private String jnxh;
    /**
     * 是否可以借阅实物
     */
    private Integer jyzt;
}
src/main/java/com/zbooksoft/gdmis/data/entity/CatZkxx.java
@@ -23,7 +23,7 @@
     * 所属案卷信息
     */
    private Long ajid;
    private Long ajId;
    /**
     * 序号
src/main/java/com/zbooksoft/gdmis/data/entity/CheckQuestion.java
New file
@@ -0,0 +1,30 @@
package com.zbooksoft.gdmis.data.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
 * @Description:借阅单明细
 * @Author: zhai
 * @Date: 2024/8/2
 **/
@TableName("BUS_CHECK_QUESTION")
@Data
public class CheckQuestion {
    /**
     * id
     */
    @TableId(type = IdType.ID_WORKER)
    private Long id;
    /**
     * 验收问题
     */
    private String question;
    /**
     * 案卷级id
     */
    private String remark;
}
src/main/java/com/zbooksoft/gdmis/data/entity/PackingManage.java
New file
@@ -0,0 +1,67 @@
package com.zbooksoft.gdmis.data.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
/**
 * @Description:装盒管理
 * @Author: zhai
 * @Date: 2024/8/2
 **/
@TableName("BUS_PACKING_MANAGE")
@Data
public class PackingManage {
    /**
     * 主键
     */
    @TableId(type = IdType.ID_WORKER)
    private Long id;
    /**
     * 库位号
     */
    private String storageLocation;
    /**
     * 装盒单号
     */
    private String boxNumber;
    /**
     * 整理人
     */
    private String collator;
    /**
     * 整理时间
     */
    private String collectTime;
    /**
     * 装盒单详情
     */
    private String boxDocDetail;
    /**
     * 文件id
     */
    private String itemId;
    /**
     * 案卷id
     */
    private String ajId;
    /**
     * 编号
     */
    private String itemNum;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 资料类型 0:成果资料,1:原始资料
     */
    private Integer type;
}
src/main/java/com/zbooksoft/gdmis/data/entity/PhysicalDetail.java
New file
@@ -0,0 +1,95 @@
package com.zbooksoft.gdmis.data.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
/**
 * @Description:实物利用明细
 * @Author: zhai
 * @Date: 2024/8/2
 **/
@TableName("UTL_PHYSICAL_DETAIL")
@Data
public class PhysicalDetail {
    /**
     * 明细id
     */
    @TableId(type = IdType.ID_WORKER)
    private Long detailId;
    /**
     * 利用申请单id,默认0
     */
    private Long formId;
    /**
     * 案卷级id
     */
    private Long fileId;
    /**
     * 文件级id
     */
    private Long itemId;
    /**
     * 档号
     */
    private String archivalCode;
    /**
     * 件号
     */
    private String itemNumber;
    /**
     * 案卷题名
     */
    private String fileTitle;
    /**
     * 文件题名
     */
    private String itemTitle;
    /**
     * 借阅类型 0:成果资料,1:原始资料
     */
    private Integer processingType;
    /**
     * 观察
     */
    private Integer survey;
    /**
     * 取样
     */
    private Integer sampling;
    /**
     * 同意与否:0不同意,1同意
     */
    private Integer agree;
//    /**
//     * 利用方式
//     */
//    private String utilizationType;
    /**
     * 钻孔名称
     */
    private String drillingName;
    /**
     * 取样深度
     */
    private String samplingDepth;
    /**
     * 创建人ID
     */
    private Long createUserId;
    /**
     * 创建人名称
     */
    private String createUserName;
    /**
     * 创建时间
     */
    private Date createTime;
}
src/main/java/com/zbooksoft/gdmis/data/entity/PhysicalForm.java
New file
@@ -0,0 +1,189 @@
package com.zbooksoft.gdmis.data.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
 * @Description:实物利用单
 * @Author: zhai
 * @Date: 2024/8/2
 **/
@TableName("UTL_PHYSICAL_FORM")
@Data
public class PhysicalForm {
    /**
     * 利用单id
     */
    @TableId(type = IdType.ID_WORKER)
    private Long formId;
    /**
     * 申请编码
     */
    private String applyCode;
    /**
     * 利用类型
     */
    private Integer utilizationType;
    /**
     * 单位名称
     */
    private String deptName;
    /**
     * 单位地址
     */
    private String deptAddress;
    /**
     * 单位id
     */
    private Long deptId;
    /**
     * 申请人
     */
    private String applyUser;
    /**
     * 申请人id
     */
    private Long applyUserId;
    /**
     * 身份证号码
     */
    private String cardId;
    /**
     * 联系电话
     */
    private String telNumber;
    /**
     * 邮箱
     */
    private String email;
    /**
     * 项目名称(工作内容)
     */
    private String projectName;
    /**
     * 题名
     */
    private String title;
    /**
     * 档号
     */
    private String archivalCode;
    /**
     * 观察/取样范围
     */
    private String observationScope;
    /**
     * 观察取样时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private String observationTime;
    /**
     * 取样数量
     */
    private Integer sampleNum;
    /**
     * 取样方式
     */
    private String sampleMethod;
    /**
     * 测试项目及样品量需求
     */
    private String testProject;
    /**
     * 送检机构
     */
    private String sendInstitution;
    /**
     * 研究目的
     */
    private String researchPurpose;
    /**
     * 研究内容
     */
    private String researchContent;
    /**
     * 预期成果
     */
    private String expectedResult;
    /**
     * 申请单位意见
     */
    private String applyDeptOpinion;
    /**
     * 是否同意
     */
    private Integer agree;
    /**
     * 流程步骤
     */
    private String flowStep;
    /**
     * 创建人ID
     */
    private Long createUserId;
    /**
     * 创建人名称
     */
    private String createUserName;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 状态:0 申请中 1 已通过 2已归还
     */
    private Integer state;
    /**
     * 流程状态
     */
    private Integer flowState;
    /**
     * 流程实例ID
     */
    private Long processInstanceId;
    /**
     * 利用日期(默认为创建日期,流程批准完后改为批准日期)
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date physicalDate;
    /**
     * 备注
     */
    private String remark;
    private Integer fileCount;
    private Integer itemCount;
    /**
     * 职务/职称
     */
    private String jobTitle;
}
src/main/java/com/zbooksoft/gdmis/data/entity/UtilizationUser.java
@@ -9,6 +9,8 @@
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
@TableName("UTL_UTILIZATION_USER")
@Data
public class UtilizationUser {
@@ -20,7 +22,7 @@
    /**
     * 是否允许登录
     */
    private Integer isAllowLogin;
    private Integer enableLogin;
    /**
     * 密码
@@ -32,13 +34,17 @@
     */
    private String userName;
    /**
     * 登录名
     */
    private String loginName;
    /**
     * 性别
     */
    private String sex;
    /**
     * 身份证
     */
    private String cardId;
    private String idCard;
    /**
     * 所属省份
@@ -120,12 +126,12 @@
    /**
     * 涉密证书编号
     */
    private String secretCertificateNumber;
    private String certificateNumber;
    /**
     * 密级
     */
    private String secretLevel;
    private String security;
    /**
     * 自助浏览
@@ -141,6 +147,23 @@
     */
    private Long userId;
    /**
     * 审批人
     */
    private String approval;
    /**
     * 审批人ID
     */
    private String approvalId;
    /**
     * 审批时间
     */
    private Date approvalDate;
    /**
     * 密级代码
     */
    private Integer securityCode;
}
//
src/main/java/com/zbooksoft/gdmis/data/vo/BorrowInfo.java
New file
@@ -0,0 +1,27 @@
package com.zbooksoft.gdmis.data.vo;
import com.zbooksoft.gdmis.data.entity.BorrowDetail;
import java.util.List;
public class BorrowInfo {
    private ParentBorrowInfo parentBorrowInfo;
    private List<BorrowDetail> borrowDetailList;
    public ParentBorrowInfo getParentBorrowInfo() {
        return parentBorrowInfo;
    }
    public void setParentBorrowInfo(ParentBorrowInfo parentBorrowInfo) {
        this.parentBorrowInfo = parentBorrowInfo;
    }
    public List<BorrowDetail> getBorrowDetailList() {
        return borrowDetailList;
    }
    public void setBorrowDetailList(List<BorrowDetail> borrowDetailList) {
        this.borrowDetailList = borrowDetailList;
    }
}
src/main/java/com/zbooksoft/gdmis/data/vo/ParentBorrowInfo.java
New file
@@ -0,0 +1,31 @@
package com.zbooksoft.gdmis.data.vo;
public class ParentBorrowInfo {
    private Long fileId;
    private String archivalCode;
    private String fileTitle;
    public Long getFileId() {
        return fileId;
    }
    public void setFileId(Long fileId) {
        this.fileId = fileId;
    }
    public String getArchivalCode() {
        return archivalCode;
    }
    public void setArchivalCode(String archivalCode) {
        this.archivalCode = archivalCode;
    }
    public String getFileTitle() {
        return fileTitle;
    }
    public void setFileTitle(String fileTitle) {
        this.fileTitle = fileTitle;
    }
}
src/main/java/com/zbooksoft/gdmis/data/vo/ParentPhysicalInfo.java
New file
@@ -0,0 +1,31 @@
package com.zbooksoft.gdmis.data.vo;
public class ParentPhysicalInfo {
    private Long fileId;
    private String archivalCode;
    private String fileTitle;
    public Long getFileId() {
        return fileId;
    }
    public void setFileId(Long fileId) {
        this.fileId = fileId;
    }
    public String getArchivalCode() {
        return archivalCode;
    }
    public void setArchivalCode(String archivalCode) {
        this.archivalCode = archivalCode;
    }
    public String getFileTitle() {
        return fileTitle;
    }
    public void setFileTitle(String fileTitle) {
        this.fileTitle = fileTitle;
    }
}
src/main/java/com/zbooksoft/gdmis/data/vo/PhysicalInfo.java
New file
@@ -0,0 +1,30 @@
package com.zbooksoft.gdmis.data.vo;
import com.zbooksoft.gdmis.data.entity.PhysicalDetail;
import java.util.List;
/**
 * @author zhai
 */
public class PhysicalInfo {
    private ParentPhysicalInfo parentPhysicalInfo;
    private List<PhysicalDetail> physicalDetailList;
    public ParentPhysicalInfo getParentPhysicalInfo() {
        return parentPhysicalInfo;
    }
    public void setParentPhysicalInfo(ParentPhysicalInfo parentPhysicalInfo) {
        this.parentPhysicalInfo = parentPhysicalInfo;
    }
    public List<PhysicalDetail> getPhysicalDetailList() {
        return physicalDetailList;
    }
    public void setPhysicalDetailList(List<PhysicalDetail> physicalDetailList) {
        this.physicalDetailList = physicalDetailList;
    }
}
src/main/java/com/zbooksoft/gdmis/data/vo/UserInfo.java
New file
@@ -0,0 +1,438 @@
package com.zbooksoft.gdmis.data.vo;
import lombok.Data;
import java.util.Date;
@Data
public class UserInfo {
    /**
     * 主键ID
     */
    private Long id;
    /**
     * 是否允许登录
     */
    private Integer enableLogin;
    /**
     * 密码
     */
    private String password;
    /**
     * 真实姓名
     */
    private String userName;
    /**
     * 登录名
     */
    private String loginName;
    /**
     * 性别
     */
    private String sex;
    /**
     * 身份证
     */
    private String idCard;
    /**
     * 所属省份
     */
    private String province;
    /**
     * 所属城市
     */
    private String city;
    /**
     * 单位
     */
    private String dept;
    /**
     * 邮政编码
     */
    private String postCode;
    /**
     * 单位地址
     */
    private String deptAddress;
    /**
     * 手机号码
     */
    private String mobile;
    /**
     * 电话号码
     */
    private String telNumber;
    /**
     * 电子邮箱
     */
    private String email;
    /**
     * QQ号
     */
    private String qqNum;
    /**
     * 申请日期
     */
    private String applyDate;
    /**
     * 项目类型
     */
    private String projectType;
    /**
     * 资料范围
     */
    private String materialScope;
    /**
     * 资料用途
     */
    private String materialPurpose;
    /**
     * 职称
     */
    private String job;
    /**
     * 项目名称
     */
    private String projectName;
    /**
     * 单位性质
     */
    private String deptNature;
    /**
     * 所属行业
     */
    private String trade;
    /**
     * 涉密证书编号
     */
    private String certificateNum;
    /**
     * 密级
     */
    private String security;
    /**
     * 自助浏览
     */
    private Integer selfBrowse;
    /**
     * 自助打印
     */
    private Integer selfPrint;
    /**
     * 关联用户ID
     */
    private Long userId;
    /**
     * 审批人
     */
    private String approval;
    /**
     * 审批人ID
     */
    private String approvalId;
    /**
     * 审批时间
     */
    private Date approvalDate;
    /**
     * 密级代码
     */
    private Integer securityCode;
    /**
     * 资料用途
     */
    private String purpose;
    private String projectTypes;
    private String projectNames;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Integer getEnableLogin() {
        return enableLogin;
    }
    public void setEnableLogin(Integer enableLogin) {
        this.enableLogin = enableLogin;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public String getUserName() {
        return userName;
    }
    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getLoginName() {
        return loginName;
    }
    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }
    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
    public String getIdCard() {
        return idCard;
    }
    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }
    public String getProvince() {
        return province;
    }
    public void setProvince(String province) {
        this.province = province;
    }
    public String getCity() {
        return city;
    }
    public void setCity(String city) {
        this.city = city;
    }
    public String getDept() {
        return dept;
    }
    public void setDept(String dept) {
        this.dept = dept;
    }
    public String getPostCode() {
        return postCode;
    }
    public void setPostCode(String postCode) {
        this.postCode = postCode;
    }
    public String getDeptAddress() {
        return deptAddress;
    }
    public void setDeptAddress(String deptAddress) {
        this.deptAddress = deptAddress;
    }
    public String getMobile() {
        return mobile;
    }
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    public String getTelNumber() {
        return telNumber;
    }
    public void setTelNumber(String telNumber) {
        this.telNumber = telNumber;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public String getQqNum() {
        return qqNum;
    }
    public void setQqNum(String qqNum) {
        this.qqNum = qqNum;
    }
    public String getApplyDate() {
        return applyDate;
    }
    public void setApplyDate(String applyDate) {
        this.applyDate = applyDate;
    }
    public String getProjectType() {
        return projectType;
    }
    public void setProjectType(String projectType) {
        this.projectType = projectType;
    }
    public String getMaterialScope() {
        return materialScope;
    }
    public void setMaterialScope(String materialScope) {
        this.materialScope = materialScope;
    }
    public String getMaterialPurpose() {
        return materialPurpose;
    }
    public void setMaterialPurpose(String materialPurpose) {
        this.materialPurpose = materialPurpose;
    }
    public String getJob() {
        return job;
    }
    public void setJob(String job) {
        this.job = job;
    }
    public String getProjectName() {
        return projectName;
    }
    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }
    public String getDeptNature() {
        return deptNature;
    }
    public void setDeptNature(String deptNature) {
        this.deptNature = deptNature;
    }
    public String getTrade() {
        return trade;
    }
    public void setTrade(String trade) {
        this.trade = trade;
    }
    public String getCertificateNum() {
        return certificateNum;
    }
    public void setCertificateNum(String certificateNum) {
        this.certificateNum = certificateNum;
    }
    public String getSecurity() {
        return security;
    }
    public void setSecurity(String security) {
        this.security = security;
    }
    public Integer getSelfBrowse() {
        return selfBrowse;
    }
    public void setSelfBrowse(Integer selfBrowse) {
        this.selfBrowse = selfBrowse;
    }
    public Integer getSelfPrint() {
        return selfPrint;
    }
    public void setSelfPrint(Integer selfPrint) {
        this.selfPrint = selfPrint;
    }
    public Long getUserId() {
        return userId;
    }
    public void setUserId(Long userId) {
        this.userId = userId;
    }
    public String getApproval() {
        return approval;
    }
    public void setApproval(String approval) {
        this.approval = approval;
    }
    public String getApprovalId() {
        return approvalId;
    }
    public void setApprovalId(String approvalId) {
        this.approvalId = approvalId;
    }
    public Date getApprovalDate() {
        return approvalDate;
    }
    public void setApprovalDate(Date approvalDate) {
        this.approvalDate = approvalDate;
    }
    public Integer getSecurityCode() {
        return securityCode;
    }
    public void setSecurityCode(Integer securityCode) {
        this.securityCode = securityCode;
    }
    public String getPurpose() {
        return purpose;
    }
    public void setPurpose(String purpose) {
        this.purpose = purpose;
    }
}
src/main/java/com/zbooksoft/gdmis/operate/CatAjjxxOperate.java
New file
@@ -0,0 +1,415 @@
package com.zbooksoft.gdmis.operate;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruili.wcp.common.SpringContextUtil;
import com.ruili.wcp.data.entity.config.Module;
import com.ruili.wcp.data.entity.config.View;
import com.ruili.wcp.data.entity.management.User;
import com.ruili.wcp.engine.form.IFormData;
import com.ruili.wcp.service.config.ModuleService;
import com.ruili.wcp.service.config.ViewService;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.zbooksoft.gdmis.data.entity.BorrowDetail;
import com.zbooksoft.gdmis.data.entity.CatAjjxx;
import com.zbooksoft.gdmis.service.BorrowDetailService;
import com.zbooksoft.gdmis.service.CatAjjxxService;
import com.zbooksoft.gdmis.service.CatCgwjxxService;
import com.zbooksoft.gdmis.service.CatYswjxxService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import org.springframework.jdbc.core.JdbcTemplate;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
/**
 * @Description:地质资料基本信息操作方法
 * @Author: zhai
 * @Date: 2024/8/15
 **/
public class CatAjjxxOperate {
    private static final Logger logger = LoggerFactory.getLogger(CatAjjxxOperate.class);
    ViewService viewService = (ViewService) SpringContextUtil.getBean("viewServiceImpl");
    BorrowDetailService borrowDetailService = (BorrowDetailService) SpringContextUtil.getBean("borrowDetailServiceImpl");
    CatAjjxxService catAjjxxService = (CatAjjxxService) SpringContextUtil.getBean("catAjjxxServiceImpl");
    CatCgwjxxService catCgwjxxService = (CatCgwjxxService) SpringContextUtil.getBean("catCgwjxxServiceImpl");
    CatYswjxxService catYswjxxService = (CatYswjxxService) SpringContextUtil.getBean("catYswjxxServiceImpl");
    ModuleService moduleService = (ModuleService) SpringContextUtil.getBean("moduleServiceImpl");
    JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtil.getBean("jdbcTemplate");
    IFormData iform = (IFormData) SpringContextUtil.getBean("iFormData");
    /**
     * 发布
     *
     * @param viewId
     * @param idList
     * @return
     */
    public AjaxResponse release(Long viewId, ArrayList<Long> idList) {
        try {
            LocalDateTime now = LocalDateTime.now();
            // 创建 DateTimeFormatter 对象,指定日期格式  blankTape
            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
            // 格式化日期
            String formattedDate = now.format(formatter);
            View view = viewService.getViewById(viewId);
            String strSql = "update " + view.getMainTableName() + " set fbzt = 1 ";
            jdbcTemplate.batchUpdate(strSql + " where " + view.getIdField() + "=?", new BatchPreparedStatementSetter() {
                @Override
                public void setValues(PreparedStatement ps, int i) throws SQLException {
                    ps.setLong(1, idList.get(i));// 下标从1开始
                }
                @Override
                public int getBatchSize() {
                    return idList.size();
                }
            });
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 取消发布
     *
     * @param viewId
     * @param idList
     * @return
     */
    public AjaxResponse cancelRelease(Long viewId, ArrayList<Long> idList) {
        try {
            int state = 0;
            String columnName = "fbzt";
            updateState(viewId, idList, state, columnName);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 取消发布
     *
     * @param viewId
     * @param idList
     * @return
     */
    public AjaxResponse warehousing(Long viewId, ArrayList<Long> idList) {
        try {
            int state = 1;
            String columnName = "zlzt";
            updateState(viewId, idList, state, columnName);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    public void updateState(Long viewId, ArrayList<Long> idList, Integer state, String columnName) {
        View view = viewService.getViewById(viewId);
        String strSql = "update " + view.getMainTableName() + " set " + columnName + " = " + state;
        jdbcTemplate.batchUpdate(strSql + " where " + view.getIdField() + "=?", new BatchPreparedStatementSetter() {
            @Override
            public void setValues(PreparedStatement ps, int i) throws SQLException {
                ps.setLong(1, idList.get(i));// 下标从1开始
            }
            @Override
            public int getBatchSize() {
                return idList.size();
            }
        });
    }
    /**
     * 添加档案利用
     *
     * @param viewId
     * @param idList
     * @return
     */
    public AjaxResponse addUtilization(Long viewId, ArrayList<Long> idList) {
        try {
            View view = viewService.getViewById(viewId);
            AjaxResponse ajaxResponse = addUtilizationByModuleId(view.getModuleId(), idList);
            return ajaxResponse;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 添加档案利用
     *
     * @param viewId
     * @param idList
     * @return
     */
    public AjaxResponse addUtilizationAll(Long viewId, ArrayList<Long> idList) {
        try {
            AjaxResponse ajaxResponse = addUtilizationByAll(idList);
            return ajaxResponse;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 通过moduleid添加档案利用
     */
    public AjaxResponse addUtilizationByModuleId(Long moduleId, List<Long> idList) {
        try {
            Module module = moduleService.getByIdModule(moduleId);
            QueryWrapper<Module> moduleQueryWrapper = new QueryWrapper<>();
            moduleQueryWrapper.eq("module_id", module.getParentId());
            moduleQueryWrapper.ne("parent_id", 0);
            List<Module> moduleList = moduleService.list(moduleQueryWrapper);
            AjaxResponse ajaxResponse = new AjaxResponse(true);
            Map<String, Object> resultMap = new HashMap<String, Object>();
            if (moduleList.size() == 0) {
                // 案卷级利用
                resultMap = addUtilizationForFile(idList);
            } else if (moduleList.size() > 0) {
                // 文件级利用,需要反查案卷级信息
                resultMap = addUtilizationForItem(module, idList);
            }
//            String unit = resultMap.get("unit").toString().equals("卷") ? "0" : "1";
            String unit = "0";
            if (resultMap != null) {
                StringBuilder sb = new StringBuilder();
                sb.append("top.layer.open({");
                sb.append("   title : '提示',");
                sb.append("   type : 2,");
                sb.append("   area : [ '700px', '220px' ],");
                sb.append("   fixed : true, ");
                sb.append("   content : 'common/commonTips?addNum=" + resultMap.get("addNum") + "&type=借阅&repeatNum=" + resultMap.get("repeatNum") + "&existFileNum=" + resultMap.get("existFileNum") + "&existItemNum=" + resultMap.get("existItemNum") + "&urlPath=borrow'");
                sb.append("});");
                Map<String, String> result = new HashMap<String, String>();
                result.put("jsExpression", sb.toString());
                result.put("totalNum", resultMap.get("existFileNum").toString());
                ajaxResponse.setResult(result);
            }
            return ajaxResponse;
        } catch (Exception ex) {
            logger.error(ex.getMessage(), ex);
            return new AjaxResponse(new ErrorInfo(ex.getMessage()), false);
        }
    }
    /**
     * 通过moduleid添加档案利用
     */
    public AjaxResponse addUtilizationByAll(List<Long> idList) {
        try {
            String strSql = "select  *  from view_all_utlization where id = " + idList.get(0);
            Map<String, Object> map = jdbcTemplate.queryForMap(strSql);
            Long moduleId = Long.parseLong(map.get("module_id").toString());
            Module module = moduleService.getByIdModule(moduleId);
            QueryWrapper<Module> moduleQueryWrapper = new QueryWrapper<>();
            moduleQueryWrapper.eq("module_id", module.getParentId());
            moduleQueryWrapper.ne("parent_id", 0);
            List<Module> moduleList = moduleService.list(moduleQueryWrapper);
            AjaxResponse ajaxResponse = new AjaxResponse(true);
            Map<String, Object> resultMap = new HashMap<String, Object>();
            if (moduleList.size() == 0) {
                // 案卷级利用
                resultMap = addUtilizationForFile(idList);
            } else if (moduleList.size() > 0) {
                // 文件级利用,需要反查案卷级信息
                resultMap = addUtilizationForItem(module, idList);
            }
//            String unit = resultMap.get("unit").toString().equals("卷") ? "0" : "1";
            String unit = "0";
            if (resultMap != null) {
                StringBuilder sb = new StringBuilder();
                sb.append("top.layer.open({");
                sb.append("   title : '提示',");
                sb.append("   type : 2,");
                sb.append("   area : [ '700px', '220px' ],");
                sb.append("   fixed : true, ");
                sb.append("   content : 'common/commonTips?addNum=" + resultMap.get("addNum") + "&type=借阅&repeatNum=" + resultMap.get("repeatNum") + "&existFileNum=" + resultMap.get("existFileNum") + "&existItemNum=" + resultMap.get("existItemNum") + "&urlPath=borrow'");
                sb.append("});");
                Map<String, String> result = new HashMap<String, String>();
                result.put("jsExpression", sb.toString());
                result.put("totalNum", resultMap.get("existFileNum").toString());
                ajaxResponse.setResult(result);
            }
            return ajaxResponse;
        } catch (Exception ex) {
            logger.error(ex.getMessage(), ex);
            return new AjaxResponse(new ErrorInfo(ex.getMessage()), false);
        }
    }
    public Map<String, Object> addUtilizationForFile(List<Long> idList) {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        Map<String, Object> resultMap = new HashMap<>();
        int addNum = 0;
        int repeatNum = 0;
        int existItemNum = 0;
        for (int i = 0; i < idList.size(); i++) {
            Long keyId = idList.get(i);
            QueryWrapper<BorrowDetail> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("form_id", 0);
            queryWrapper.eq("create_user_id", user.getUserId());
            int itemCount = borrowDetailService.count(queryWrapper);
            existItemNum += itemCount;
            queryWrapper.eq("file_id", keyId);
            List<BorrowDetail> borrowDetailList = borrowDetailService.list(queryWrapper);
            if (borrowDetailList.size() == 0) {
                CatAjjxx catAjjxx = catAjjxxService.getById(keyId);
                Integer cgwjxxCount = borrowDetailService.setCgwjxx(catAjjxx);
                Integer yswjxxCount = borrowDetailService.setYswjxx(catAjjxx);
                addNum++;
                existItemNum += cgwjxxCount + yswjxxCount;
            } else {
                repeatNum++;
            }
        }
        String strSql = "select distinct file_id from UTL_BORROW_DETAIL  where form_id=0 and create_user_id=" + user.getUserId();
        List<Map<String, Object>> parentMapList = jdbcTemplate.queryForList(strSql);
        resultMap.put("existFileNum", parentMapList.size());
        resultMap.put("existItemNum", existItemNum);
        resultMap.put("addNum", addNum);
        resultMap.put("repeatNum", repeatNum);
        return resultMap;
    }
    public Map<String, Object> addUtilizationForItem(Module module, List<Long> idList) {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        int addNum = 0;
        int repeatNum = 0;
        int existItemNum = 0;
        Map<String, Object> resultMap = new HashMap<>();
        for (int i = 0; i < idList.size(); i++) {
            Long keyId = idList.get(i);
            QueryWrapper<BorrowDetail> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("form_id", 0);
            queryWrapper.eq("create_user_id", user.getUserId());
            int itemCount = borrowDetailService.count(queryWrapper);
            existItemNum += itemCount;
            queryWrapper.eq("item_id", keyId);
            List<BorrowDetail> borrowDetailList = borrowDetailService.list(queryWrapper);
            if (borrowDetailList.size() == 0) {
                String mainTableName = module.getMainTableName();
                if (mainTableName.equals("CAT_ITEM_CGWJXX")) {
                    Integer cgwjxxCount = borrowDetailService.setCgwjxxByIds(idList);
                    existItemNum += cgwjxxCount;
                } else if (mainTableName.equals("CAT_ITEM_YSWJXX")) {
                    Integer cgwjxxCount = borrowDetailService.setYswjxxByIds(idList);
                    existItemNum += cgwjxxCount;
                }
            }
        }
        resultMap.put("addNum", 1);
        resultMap.put("repeatNum", 0);
        resultMap.put("existItemNum", existItemNum);
        String strSql = "select distinct file_id from UTL_BORROW_DETAIL  where form_id=0 and create_user_id=" + user.getUserId();
        List<Map<String, Object>> parentMapList = jdbcTemplate.queryForList(strSql);
        resultMap.put("existFileNum", parentMapList.size());
        return resultMap;
    }
    /**
     * 添加成果
     *
     * @param viewId
     * @param idList
     * @return
     */
    public AjaxResponse addCg(Long viewId, ArrayList<Long> idList) {
        try {
            String cgSql = "select NVL(max(BGBH), 0) BGBH FROM CAT_ITEM_CGWJXX";
            Map<String, Object> stringMap = jdbcTemplate.queryForMap(cgSql);
            int maxDH = Integer.parseInt(stringMap.get("BGBH").toString());
            for (int i = 0; i < idList.size(); i++) {
                int newDH = maxDH + 1 + i;
                String newDhString = String.format("%04d", newDH);
                String sql = "select * from CAT_ITEM_YSWJXX where id = " + idList.get(i);
                Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(sql);
                stringObjectMap.put("BGBH", newDhString);
                LocalDateTime currentDate = LocalDateTime.now();
                DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
                String formattedDate = currentDate.format(formatter);
                stringObjectMap.put("CREATE_TIME", formattedDate);
                stringObjectMap.put("MODIFY_TIME", formattedDate);
                stringObjectMap.put("CDDZWJLJ", stringObjectMap.get("WJLJ"));
                stringObjectMap.put("CDDZWJLJ", stringObjectMap.get("WJLJ"));
                iform.insert(1823017354756390913L, stringObjectMap);
            }
            return null;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 取消发布
     *
     * @param viewId
     * @param idList
     * @return
     */
    public AjaxResponse createArchiveCode(Long viewId, ArrayList<Long> idList) {
        try {
            String sql = "select NVL(max(DH), 0) DH FROM CAT_FILE_AJJXX";
            Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(sql);
            int maxDH = Integer.parseInt(stringObjectMap.get("DH").toString());
            for (int i = 0; i < idList.size(); i++) {
                int newDH = maxDH + 1 + i;
                String newDhString = String.format("%04d", newDH);
                String updateSql = "update CAT_FILE_AJJXX set DH = '" + newDhString + "' where ID = " + idList.get(i);
                jdbcTemplate.update(updateSql);
            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
}
src/main/java/com/zbooksoft/gdmis/operate/CatYswjxxOperate.java
New file
@@ -0,0 +1,332 @@
package com.zbooksoft.gdmis.operate;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruili.wcp.common.SpringContextUtil;
import com.ruili.wcp.common.StringUtil;
import com.ruili.wcp.data.entity.config.View;
import com.ruili.wcp.service.config.ViewService;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.zbooksoft.gdmis.data.entity.PackingManage;
import com.zbooksoft.gdmis.service.CatSmxxService;
import com.zbooksoft.gdmis.service.CatYswjxxService;
import com.zbooksoft.gdmis.service.PackingManageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import org.springframework.jdbc.core.JdbcTemplate;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * @Description:原始文件信息操作方法
 * @Author: zhai
 * @Date: 2024/8/15
 **/
public class CatYswjxxOperate {
    private static final Logger logger = LoggerFactory.getLogger(CatYswjxxOperate.class);
    CatYswjxxService catYswjxxService = (CatYswjxxService) SpringContextUtil.getBean("catYswjxxServiceImpl");
    CatSmxxService catSmxxService = (CatSmxxService) SpringContextUtil.getBean("catSmxxServiceImpl");
    PackingManageService packingManageService = (PackingManageService) SpringContextUtil.getBean("packingManageServiceImpl");
    ViewService viewService = (ViewService) SpringContextUtil.getBean("viewServiceImpl");
    JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtil.getBean("jdbcTemplate");
    /**
     * 退回待著录
     *
     * @param viewId
     * @param idList
     * @return
     */
    public AjaxResponse submitCheck(Long viewId, ArrayList<Long> idList) {
        View view = viewService.getViewById(viewId);
        int state = 2;
        String strSql = "update " + view.getMainTableName() + " set yszt = " + state;
        try {
            jdbcTemplate.batchUpdate(strSql + " where " + view.getIdField() + "=?", new BatchPreparedStatementSetter() {
                @Override
                public void setValues(PreparedStatement ps, int i) throws SQLException {
                    ps.setLong(1, idList.get(i));// 下标从1开始
                }
                @Override
                public int getBatchSize() {
                    return idList.size();
                }
            });
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 验收后中数据进行撤回
     *
     * @param viewId
     * @param idList
     * @return
     */
    public AjaxResponse revocationCheck(Long viewId, ArrayList<Long> idList) {
        View view = viewService.getViewById(viewId);
        int state = 0;
        String strSql = "update " + view.getMainTableName() + " set yszt = " + state;
        try {
            jdbcTemplate.batchUpdate(strSql + " where " + view.getIdField() + "=?", new BatchPreparedStatementSetter() {
                @Override
                public void setValues(PreparedStatement ps, int i) throws SQLException {
                    ps.setLong(1, idList.get(i));// 下标从1开始
                }
                @Override
                public int getBatchSize() {
                    return idList.size();
                }
            });
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 是否可借阅
     *
     * @param viewId
     * @param idList
     * @return
     */
    public AjaxResponse isBorrow(Long viewId, ArrayList<Long> idList) {
        //纸质借阅状态,0可外借,1不可借出
        View view = viewService.getViewById(viewId);
        int state = 1;
        String strSql = "update " + view.getMainTableName() + " set JYZT = " + state;
        try {
            jdbcTemplate.batchUpdate(strSql + " where " + view.getIdField() + "=?", new BatchPreparedStatementSetter() {
                @Override
                public void setValues(PreparedStatement ps, int i) throws SQLException {
                    ps.setLong(1, idList.get(i));// 下标从1开始
                }
                @Override
                public int getBatchSize() {
                    return idList.size();
                }
            });
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 原始文件装盒
     *
     * @return
     */
    public AjaxResponse packagingBoxYs(Long viewId, ArrayList<Long> idList) {
        try {
            String box = "0001";
            String maxBoxSql = "select max(box_number) from BUS_PACKING_MANAGE WHERE TYPE = 1";
            String boxNum = jdbcTemplate.queryForObject(maxBoxSql, String.class);
            if (boxNum != null || "".equals(boxNum)) {
                int num = Integer.parseInt(boxNum);
                num += 1;
                DecimalFormat df = new DecimalFormat("0000");
                box = df.format(num);
            }
            int newPage = 0;
            View view = viewService.getViewById(viewId);
            String mainTableName = view.getMainTableName();
            for (int i = 0; i < idList.size(); i++) {
                String selectSql = "select * from " + mainTableName + " where id = " + idList.get(i);
                Map<String, Object> map = jdbcTemplate.queryForMap(selectSql);
                String itemNum = StringUtil.nullToEmpty(map.get("DH")).trim();
                String id = StringUtil.nullToEmpty(map.get("ID")).trim();
                String ajId = StringUtil.nullToEmpty(map.get("AJ_ID")).trim();
                QueryWrapper<PackingManage> packingManageQueryWrapper = new QueryWrapper<>();
                packingManageQueryWrapper.eq("item_id", idList.get(i));
                PackingManage packingManage = new PackingManage();
                List<PackingManage> packingManageList = packingManageService.list(packingManageQueryWrapper);
                if (packingManageList.size() > 0) {
                    packingManage = packingManageList.get(0);
                }
                packingManage.setItemNum(itemNum);
                packingManage.setItemId(id);
                packingManage.setAjId(ajId);
                packingManage.setCreateTime(new java.util.Date());
                packingManage.setType(1);
                String zzys = map.get("ZZYS") == null ? "0" : map.get("ZZYS").toString();
                if (newPage + Integer.parseInt(zzys) > 500) {
                    int num = Integer.parseInt(box);
                    num += 1;
                    DecimalFormat df = new DecimalFormat("0000");
                    String newBox = df.format(num);
                    box = newBox;
                    newPage = Integer.parseInt(zzys);
                } else {
                    newPage = newPage + Integer.parseInt(zzys);
                }
                packingManage.setBoxNumber(box);
                packingManageService.saveOrUpdate(packingManage);
                String updateSql = "update " + mainTableName + " set HH = '" + box + "' where id = " + idList.get(i);
                jdbcTemplate.update(updateSql);
            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 文件装盒
     *
     * @return
     */
    public AjaxResponse packagingBoxCg(Long viewId, ArrayList<Long> idList) {
        try {
            //分成果和原始  原始盒子命名规则最大号,成果文件报告号
            //解析纸张大小, 获取最大盒子号,进行装盒 500页
            String box = "01";
            int newPage = 0;
            View view = viewService.getViewById(viewId);
            String mainTableName = view.getMainTableName();
            String selectSqlOne = "select * from " + mainTableName + " where id = " + idList.get(0);
            Map<String, Object> mapList = jdbcTemplate.queryForMap(selectSqlOne);
            String sl = mapList.get("SL") == null ? "0" : mapList.get("SL").toString();
            for (int i = 1; i <= Integer.parseInt(sl); i++) {
                DecimalFormat df = new DecimalFormat("00");
                String cover = df.format(i);
                for (int j = 0; j < idList.size(); j++) {
                    String selectSql = "select * from " + mainTableName + " where id = " + idList.get(j);
                    Map<String, Object> map = jdbcTemplate.queryForMap(selectSql);
                    String zzys = map.get("ZZYS") == null ? "0" : map.get("ZZYS").toString();
                    String id = StringUtil.nullToEmpty(map.get("ID")).trim();
                    String dh = StringUtil.nullToEmpty(map.get("DH")).trim();
                    String bgbh = StringUtil.nullToEmpty(map.get("BGBH")).trim();
                    String ajId = StringUtil.nullToEmpty(map.get("AJ_ID")).trim();
                    PackingManage packingManage = new PackingManage();
                    packingManage.setItemNum(dh + "-" + i);
                    packingManage.setItemId(id);
                    packingManage.setAjId(ajId);
                    packingManage.setType(0);
                    packingManage.setCreateTime(new java.util.Date());
                    //计算盒号
                    if (newPage + Integer.parseInt(zzys) > 500) {
                        int num = Integer.parseInt(box);
                        num += 1;
                        String newBox = df.format(num);
                        box = newBox;
                        newPage = Integer.parseInt(zzys);
                        packingManage.setBoxNumber(bgbh + "-" + cover + "-" + newBox);
                    } else {
                        newPage = newPage + Integer.parseInt(zzys);
                        packingManage.setBoxNumber(bgbh + "-" + cover + "-" + box);
                    }
                    packingManageService.saveOrUpdate(packingManage);
                }
            }
//            for (int i = 0; i < idList.size(); i++) {
//                String selectSql = "select * from " + mainTableName + " where id = " + idList.get(i);
//                Map<String, Object> map = jdbcTemplate.queryForMap(selectSql);
//                String zzys = map.get("ZZYS") == null ? "0" : map.get("ZZYS").toString();
//                String dh = map.get("DH") == null ? "0" : map.get("DH").toString();
//                if (newPage + Integer.parseInt(zzys) > 500) {
//                    int num = Integer.parseInt(box);
//                    num += 1;
//                    DecimalFormat df = new DecimalFormat("0000");
//                    String newBox = df.format(num);
//                    box = newBox;
//                    newPage = Integer.parseInt(zzys);
//                } else {
//                    newPage = newPage + Integer.parseInt(zzys);
//                }
//                String updateSql = "update " + mainTableName + " set HH = '" + box + "' where id = " + idList.get(i);
//                jdbcTemplate.update(updateSql);
//
//
//                //查询拆分了几份
//                QueryWrapper<PackingManage> packingManageQueryWrapper = new QueryWrapper<>();
//                packingManageQueryWrapper.eq("item_id", idList.get(i));
//                List<PackingManage> packingManageList = packingManageService.list(packingManageQueryWrapper);
//                for (int j = 0; j < packingManageList.size(); j++) {
//                    PackingManage packingManage = packingManageList.get(j);
//                    if (newPage + Integer.parseInt(zzys) > 500) {
//                        int num = Integer.parseInt(box);
//                        num += 1;
//                        DecimalFormat df = new DecimalFormat("00");
//                        String newBox = df.format(num);
//                        box = newBox;
//                        newPage = Integer.parseInt(zzys);
//                        packingManage.setBoxNumber(dh + "-" + newBox);
//                    } else {
//                        newPage = newPage + Integer.parseInt(zzys);
//                        packingManage.setBoxNumber(dh + "-" + box);
//                    }
//                    if (j == 0) {
//                        String updateSql = "update " + mainTableName + " set HH = '" + dh + "-" + box + "' where id = " + idList.get(i);
//                        jdbcTemplate.update(updateSql);
//                    }
//                    packingManageService.saveOrUpdate(packingManage);
//                }
//            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 取消发布
     *
     * @param viewId
     * @param idList
     * @return
     */
    public AjaxResponse createArchiveCode(Long viewId, ArrayList<Long> idList) {
        try {
            Long aLong = idList.get(0);
            String selectSql = "select AJ_ID from CAT_ITEM_YSWJXX  where id = " + aLong;
            Map<String, Object> map = jdbcTemplate.queryForMap(selectSql);
            Long ajId = map.get("AJ_ID") == null ? 0 : Long.parseLong(map.get("AJ_ID").toString());
            String sql = "select  DH FROM CAT_FILE_AJJXX where  id = " + ajId;
            Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(sql);
            String maxDH = stringObjectMap.get("DH") == null ? "" : stringObjectMap.get("DH").toString();
            for (int i = 0; i < idList.size(); i++) {
                String sqlSelect = "select JNXH from CAT_ITEM_YSWJXX where id = " + idList.get(i);
                Map<String, Object> stringObjectMap1 = jdbcTemplate.queryForMap(sqlSelect);
                String jnxh = stringObjectMap1.get("JNXH") == null ? "" : stringObjectMap1.get("JNXH").toString();
                String dh = maxDH + "-" + jnxh;
                String updateSql = "update CAT_ITEM_YSWJXX set DH = '" + dh + "' where ID = " + idList.get(i);
                jdbcTemplate.update(updateSql);
            }
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
}
src/main/java/com/zbooksoft/gdmis/operate/TapeOperate.java
New file
@@ -0,0 +1,68 @@
package com.zbooksoft.gdmis.operate;
import com.ruili.wcp.common.SpringContextUtil;
import com.ruili.wcp.data.entity.config.View;
import com.ruili.wcp.service.config.ViewService;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.zbooksoft.gdmis.service.CatSmxxService;
import com.zbooksoft.gdmis.service.CatYswjxxService;
import com.zbooksoft.gdmis.service.PackingManageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.BatchPreparedStatementSetter;
import org.springframework.jdbc.core.JdbcTemplate;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
/**
 * @Description:
 * @Author: zhai
 * @Date: 2025/10/15
 **/
public class TapeOperate {
    private static final Logger logger = LoggerFactory.getLogger(CatYswjxxOperate.class);
    CatYswjxxService catYswjxxService = (CatYswjxxService) SpringContextUtil.getBean("catYswjxxServiceImpl");
    CatSmxxService catSmxxService = (CatSmxxService) SpringContextUtil.getBean("catSmxxServiceImpl");
    PackingManageService packingManageService = (PackingManageService) SpringContextUtil.getBean("packingManageServiceImpl");
    ViewService viewService = (ViewService) SpringContextUtil.getBean("viewServiceImpl");
    JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtil.getBean("jdbcTemplate");
    /**
     * 取消发布
     *
     * @param viewId
     * @param idList
     * @return
     */
    public AjaxResponse warehousing(Long viewId, ArrayList<Long> idList) {
        try {
            int state = 0;
            String columnName = "ZLZT";
            updateState(viewId, idList, state, columnName);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    public void updateState(Long viewId, ArrayList<Long> idList, Integer state, String columnName) {
        View view = viewService.getViewById(viewId);
        String strSql = "update " + view.getMainTableName() + " set " + columnName + " = " + state;
        jdbcTemplate.batchUpdate(strSql + " where " + view.getIdField() + "=?", new BatchPreparedStatementSetter() {
            @Override
            public void setValues(PreparedStatement ps, int i) throws SQLException {
                ps.setLong(1, idList.get(i));// 下标从1开始
            }
            @Override
            public int getBatchSize() {
                return idList.size();
            }
        });
    }
}
src/main/java/com/zbooksoft/gdmis/operate/TransferOperate.java
New file
@@ -0,0 +1,75 @@
package com.zbooksoft.gdmis.operate;
import com.ruili.wcp.common.SpringContextUtil;
import com.ruili.wcp.data.entity.config.View;
import com.ruili.wcp.service.config.ViewService;
import com.ruili.wcp.web.model.AjaxResponse;
import com.ruili.wcp.web.model.ErrorInfo;
import com.zbooksoft.gdmis.service.CatSmxxService;
import com.zbooksoft.gdmis.service.CatYswjxxService;
import com.zbooksoft.gdmis.service.PackingManageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.ArrayList;
/**
 * @Description:原始文件信息操作方法
 * @Author: zhai
 * @Date: 2024/8/15
 **/
public class TransferOperate {
    private static final Logger logger = LoggerFactory.getLogger(TransferOperate.class);
    CatYswjxxService catYswjxxService = (CatYswjxxService) SpringContextUtil.getBean("catYswjxxServiceImpl");
    CatSmxxService catSmxxService = (CatSmxxService) SpringContextUtil.getBean("catSmxxServiceImpl");
    PackingManageService packingManageService = (PackingManageService) SpringContextUtil.getBean("packingManageServiceImpl");
    ViewService viewService = (ViewService) SpringContextUtil.getBean("viewServiceImpl");
    JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtil.getBean("jdbcTemplate");
    /**
     * 提交验收
     *
     * @param viewId
     * @param idList
     * @return
     */
    public AjaxResponse submitCheck(Long viewId, ArrayList<Long> idList) {
        View view = viewService.getViewById(viewId);
        int state = 2;
        try {
            String strSql = "update " + view.getMainTableName() + " set yszt = " + state + " where id = " + idList.get(0);
            jdbcTemplate.execute(strSql);
            String updateSql = "update CAT_ITEM_YSWJXX set yszt = " + state + " where  YJ_ID =" + idList.get(0);
            jdbcTemplate.execute(updateSql);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
    /**
     * 验收后中数据进行撤回
     *
     * @param viewId
     * @param idList
     * @return
     */
    public AjaxResponse revocationCheck(Long viewId, ArrayList<Long> idList) {
        View view = viewService.getViewById(viewId);
        int state = 0;
        try {
            String strSql = "update " + view.getMainTableName() + " set yszt = " + state + " where id = " + idList.get(0);
            jdbcTemplate.execute(strSql);
            String updateSql = "update CAT_ITEM_YSWJXX set yszt = " + state + " where  YJ_ID =" + idList.get(0);
            jdbcTemplate.execute(updateSql);
            return new AjaxResponse(true);
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return new AjaxResponse(new ErrorInfo(e.getMessage()), false);
        }
    }
}
src/main/java/com/zbooksoft/gdmis/operate/UtilizationFormFlowListener.java
New file
@@ -0,0 +1,68 @@
package com.zbooksoft.gdmis.operate;
import com.ruili.wcp.common.SpringContextUtil;
import com.ruili.wcp.engine.flow.delegate.DelegateTask;
import com.ruili.wcp.engine.flow.delegate.TaskListener;
import com.ruili.wcp.engine.form.IFormData;
import com.ruili.wcp.service.management.MessageService;
import com.ruili.wcp.service.management.RoleService;
import com.ruili.wcp.service.management.RoleUserService;
import com.ruili.wcp.service.management.UserService;
import org.springframework.jdbc.core.JdbcTemplate;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class UtilizationFormFlowListener implements TaskListener {
    IFormData iFormData = (IFormData) SpringContextUtil.getBean("iFormData");
    MessageService messageService = (MessageService) SpringContextUtil.getBean("messageServiceImpl");
    RoleService roleService = (RoleService) SpringContextUtil.getBean("roleServiceImpl");
    UserService userService = (UserService) SpringContextUtil.getBean("userServiceImpl");
    RoleUserService roleUserService = (RoleUserService) SpringContextUtil.getBean("roleUserServiceImpl");
    JdbcTemplate jdbcTemplate = (JdbcTemplate) SpringContextUtil.getBean("jdbcTemplate");
    @Override
    public void notify(DelegateTask delegateTask) {
        if (delegateTask != null) {
            //添加数据到bus_warehousing    LOCATION_NUMBER
            Long keyId = delegateTask.getProcessInstance().getKeyId();
            String strSql = "SELECT ITEM_CODE, ITEM_TITLE ,BORROW_TYPE, PAPER ,ITEM_ID FROM  UTL_BORROW_DETAIL WHERE AGREE = 1 AND  FORM_ID=" + keyId;
            List<Map<String, Object>> mapList = jdbcTemplate.queryForList(strSql);
            for (int i = 0; i < mapList.size(); i++) {
                Object borrowType = mapList.get(i).get("BORROW_TYPE");
                if (mapList.get(i).get("PAPER") != null && mapList.get(i).get("PAPER").toString().equals("1")) {
                    Map<String, Object> data = new HashMap<>();
                    String itemId = mapList.get(i).get("ITEM_ID").toString();
                    if (borrowType != null && borrowType.toString().equals("0")) {
                        String sql = "SELECT * FROM CAT_ITEM_CGWJXX WHERE ID =" + itemId;
                        Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(sql);
                        Object o = stringObjectMap.get("HH");
                        data.put("BOX_NUM", o);
                        data.put("LOCATION_NUMBER", o);
                    } else if (borrowType != null && borrowType.toString().equals("1")) {
                        String sql = "SELECT * FROM CAT_ITEM_YSWJXX WHERE ID =" + itemId;
                        Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(sql);
                        Object o = stringObjectMap.get("HH");
                        data.put("BOX_NUM", o);
                        data.put("LOCATION_NUMBER", o);
                    }
                    data.put("ARCHIVAL_CODE", mapList.get(i).get("ITEM_CODE"));
                    data.put("TITLE", mapList.get(i).get("ITEM_TITLE"));
                    data.put("ARCHIVAL_TYPE", borrowType);
                    data.put("IN_STATUS_CODE", "0");
                    data.put("IN_STATUS", "待出库");
                    data.put("EXIST_STATUS", "1");
                    data.put("ITEM_ID", itemId);
                    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                    data.put("CREATE_TIME", sdf.format(new Date()));
                    iFormData.insert(1972515952908148738L, data);
                }
            }
        }
    }
}
src/main/java/com/zbooksoft/gdmis/service/BorrowDetailService.java
@@ -2,6 +2,10 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.zbooksoft.gdmis.data.entity.BorrowDetail;
import com.zbooksoft.gdmis.data.entity.CatAjjxx;
import com.zbooksoft.gdmis.data.vo.ParentBorrowInfo;
import java.util.List;
/**
 * <p>
@@ -12,5 +16,17 @@
 * @since 2020-01-03
 */
public interface BorrowDetailService extends IService<BorrowDetail> {
    List<ParentBorrowInfo> selectDistinctParentBorrowInfo(Long createUserId);
    List<ParentBorrowInfo> selectDistinctParentBorrowInfoByFormId(Long formId);
    Integer setYswjxx(CatAjjxx catAjjxx);
    Integer setYswjxxByIds(List<Long> idList);
    Integer setCgwjxx(CatAjjxx catAjjxx);
    Integer setCgwjxxByIds(List<Long> idList);
    Integer getBorrowCount(Long keyId, Long userId);
}
src/main/java/com/zbooksoft/gdmis/service/BorrowFormService.java
@@ -12,4 +12,5 @@
 * @since 2020-01-03
 */
public interface BorrowFormService extends IService<BorrowForm> {
    String selectMaxApplyCode(String preNum);
}
src/main/java/com/zbooksoft/gdmis/service/CatCgwjxxService.java
New file
@@ -0,0 +1,14 @@
package com.zbooksoft.gdmis.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zbooksoft.gdmis.data.entity.CatCgwjxx;
/**
 * @Description
 * @Author zhai
 * @Date 2024/7/310.
 **/
public interface CatCgwjxxService extends IService<CatCgwjxx> {
    boolean deleteCatCgwjxxByAjId(Long ajId);
}
src/main/java/com/zbooksoft/gdmis/service/CatCheckService.java
New file
@@ -0,0 +1,13 @@
package com.zbooksoft.gdmis.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zbooksoft.gdmis.data.entity.CatCheck;
/**
 * @Description
 * @Author zhai
 * @Date 2024/7/31
 **/
public interface CatCheckService extends IService<CatCheck> {
}
src/main/java/com/zbooksoft/gdmis/service/CatSwyxxxService.java
New file
@@ -0,0 +1,13 @@
package com.zbooksoft.gdmis.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zbooksoft.gdmis.data.entity.CatSwyxxx;
/**
 * @Description
 * @Author zhai
 * @Date 2024/7/31
 **/
public interface CatSwyxxxService extends IService<CatSwyxxx> {
}
src/main/java/com/zbooksoft/gdmis/service/CatYswjxxService.java
@@ -10,4 +10,5 @@
 * @Date 2024/7/31
 **/
public interface CatYswjxxService extends IService<CatYswjxx> {
    String getMaxFileType(Long ajId, String fileType);
}
src/main/java/com/zbooksoft/gdmis/service/CheckQuestionService.java
New file
@@ -0,0 +1,13 @@
package com.zbooksoft.gdmis.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zbooksoft.gdmis.data.entity.CheckQuestion;
/**
 * @Description
 * @Author zhai
 * @Date 2024/7/31
 **/
public interface CheckQuestionService extends IService<CheckQuestion> {
}
src/main/java/com/zbooksoft/gdmis/service/PackingManageService.java
New file
@@ -0,0 +1,15 @@
package com.zbooksoft.gdmis.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zbooksoft.gdmis.data.entity.CatCheck;
import com.zbooksoft.gdmis.data.entity.PackingManage;
/**
 * @Description
 * @Author zhai
 * @Date 2024/7/31
 **/
public interface PackingManageService extends IService<PackingManage> {
    void removeByItemId(Long itemId);
}
src/main/java/com/zbooksoft/gdmis/service/PhysicalDetailService.java
New file
@@ -0,0 +1,25 @@
package com.zbooksoft.gdmis.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zbooksoft.gdmis.data.entity.CatSwajxx;
import com.zbooksoft.gdmis.data.entity.PhysicalDetail;
import com.zbooksoft.gdmis.data.vo.ParentPhysicalInfo;
import java.util.List;
/**
 * <p>
 * 服务类
 * </p>
 *
 * @author cb
 * @since 2020-01-03
 */
public interface PhysicalDetailService extends IService<PhysicalDetail> {
    List<ParentPhysicalInfo> selectDistinctParentPhysicalInfo(Long createUserId);
    List<ParentPhysicalInfo> selectDistinctParentPhysicalInfoByFormId(Long formId);
    Integer setSwajxx( CatSwajxx catSwajxx);
}
src/main/java/com/zbooksoft/gdmis/service/PhysicalFormService.java
New file
@@ -0,0 +1,16 @@
package com.zbooksoft.gdmis.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zbooksoft.gdmis.data.entity.PhysicalForm;
/**
 * <p>
 * 服务类
 * </p>
 *
 * @author cb
 * @since 2020-01-03
 */
public interface PhysicalFormService extends IService<PhysicalForm> {
    String selectMaxApplyCode(String preNum);
}
src/main/java/com/zbooksoft/gdmis/service/ReadXml2017Service.java
New file
@@ -0,0 +1,10 @@
package com.zbooksoft.gdmis.service;
/**
 * @Description:xml读取接口
 * @Author: zhai
 * @Date: 2024/8/7
 **/
public interface ReadXml2017Service extends ReadXmlService {
}
src/main/java/com/zbooksoft/gdmis/service/ReadXml2023Service.java
New file
@@ -0,0 +1,10 @@
package com.zbooksoft.gdmis.service;
/**
 * @Description:xml读取接口
 * @Author: zhai
 * @Date: 2024/8/7
 **/
public interface ReadXml2023Service extends ReadXmlService {
}
src/main/java/com/zbooksoft/gdmis/service/ReadXmlService.java
New file
@@ -0,0 +1,17 @@
package com.zbooksoft.gdmis.service;
import org.dom4j.Document;
/**
 * @Description:xml读取接口
 * @Author: zhai
 * @Date: 2024/8/7
 **/
public interface ReadXmlService {
    /**
     * 读取xml文件
     */
    void readXml(Document document, String startData,String endData) throws Exception;
}
src/main/java/com/zbooksoft/gdmis/service/XmlService.java
New file
@@ -0,0 +1,12 @@
package com.zbooksoft.gdmis.service;
import org.dom4j.Document;
/**
 * @Description:xml读取接口
 * @Author: zhai
 * @Date: 2024/8/7
 **/
public interface XmlService  {
    void readXml(Document document, String startData, String endData) throws Exception;
}
src/main/java/com/zbooksoft/gdmis/service/impl/BorrowDetailServiceImpl.java
@@ -1,20 +1,295 @@
package com.zbooksoft.gdmis.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruili.wcp.data.entity.management.User;
import com.zbooksoft.gdmis.dao.BorrowDetailMapper;
import com.zbooksoft.gdmis.data.entity.BorrowDetail;
import com.zbooksoft.gdmis.service.BorrowDetailService;
import com.zbooksoft.gdmis.data.entity.CatAjjxx;
import com.zbooksoft.gdmis.data.entity.CatCgwjxx;
import com.zbooksoft.gdmis.data.entity.CatYswjxx;
import com.zbooksoft.gdmis.data.vo.ParentBorrowInfo;
import com.zbooksoft.gdmis.service.*;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author cb
 * @author zhai
 * @since 2020-01-03
 */
@Service
public class BorrowDetailServiceImpl extends ServiceImpl<BorrowDetailMapper, BorrowDetail> implements BorrowDetailService {
    @Autowired
    CatCgwjxxService catCgwjxxService;
    @Autowired
    CatYswjxxService catYswjxxService;
    @Autowired
    UtilizationUserService utilizationUserService;
    @Autowired
    BorrowDetailService borrowDetailService;
    @Autowired
    CatAjjxxService catAjjxxService;
    @Override
    public List<ParentBorrowInfo> selectDistinctParentBorrowInfo(Long createUserId) {
        return this.baseMapper.selectDistinctParentBorrowInfo(createUserId);
    }
    /**
     * 获取具体申请单案卷
     */
    @Override
    public List<ParentBorrowInfo> selectDistinctParentBorrowInfoByFormId(Long formId) {
        return this.baseMapper.selectDistinctParentBorrowInfoByFormId(formId);
    }
    /**
     * 添加成果文件级信息
     *
     * @param catAjjxx
     */
    @Override
    public Integer setCgwjxx(CatAjjxx catAjjxx) {
        int count = 0;
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        String deptName = user.getDeptName();
        Integer userSecurityCode = 3;
        QueryWrapper<CatCgwjxx> catCgwjxxQueryWrapper = new QueryWrapper<>();
        catCgwjxxQueryWrapper.eq("aj_id", catAjjxx.getId());
        catCgwjxxQueryWrapper.eq("yszt", 3);
        List<CatCgwjxx> catCgwjxxList = catCgwjxxService.list(catCgwjxxQueryWrapper);
        //如果没有文件级,只添加案卷级数据
        if (catCgwjxxList.size() == 0) {
            BorrowDetail borrowDetail = new BorrowDetail();
            borrowDetail.setFileId(catAjjxx.getId());
            borrowDetail.setFileTitle(catAjjxx.getZlmc());
            borrowDetail.setArchivalCode(catAjjxx.getSgdh());
            borrowDetail.setCreateTime(new Date());
            borrowDetail.setCreateUserId(user.getUserId());
            borrowDetail.setCreateUserName(user.getTrueName());
            borrowDetail.setFormId(0L);
            borrowDetail.setBorrowType(0);
            borrowDetail.setPaper(0);
            borrowDetail.setElectronic(0);
            borrowDetail.setOriginal(0);
            borrowDetailService.saveOrUpdate(borrowDetail);
        }
        for (CatCgwjxx catCgwjxx : catCgwjxxList) {
            if (catCgwjxx.getSecurityCode() == null || (catCgwjxx.getSecurityCode() != null && catCgwjxx.getSecurityCode() <= userSecurityCode)) {
                BorrowDetail borrowDetail = new BorrowDetail();
                borrowDetail.setFileId(catAjjxx.getId());
                borrowDetail.setItemId(catCgwjxx.getId());
                borrowDetail.setFileTitle(catAjjxx.getZlmc());
                borrowDetail.setItemTitle(catCgwjxx.getWjtm());
                borrowDetail.setItemNumber(catCgwjxx.getWjm());
                borrowDetail.setArchivalCode(catAjjxx.getSgdh());
                borrowDetail.setSecurityClassification(catCgwjxx.getWjmj());
                borrowDetail.setSecurityPageNum(catCgwjxx.getSmym());
                borrowDetail.setCreateTime(new Date());
                borrowDetail.setCreateUserId(user.getUserId());
                borrowDetail.setCreateUserName(user.getTrueName());
                borrowDetail.setFormId(0L);
                borrowDetail.setBorrowType(0);
                borrowDetail.setPaper(0);
                borrowDetail.setElectronic(0);
                borrowDetail.setOriginal(0);
                borrowDetail.setPaperBorrow(catCgwjxx.getJyzt());
                borrowDetailService.saveOrUpdate(borrowDetail);
                count++;
            }
        }
        return count;
    }
    /**
     * 添加成果文件级信息
     *
     * @param catAjjxx
     */
    @Override
    public Integer setCgwjxxByIds(List<Long> idList) {
        int count = 0;
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        Integer userSecurityCode = 3;
        for (Long id : idList) {
            CatCgwjxx catCgwjxx = catCgwjxxService.getById(id);
            if (catCgwjxx.getSecurityCode() == null || (catCgwjxx.getSecurityCode() != null && catCgwjxx.getSecurityCode() <= userSecurityCode)) {
                BorrowDetail borrowDetail = new BorrowDetail();
                CatAjjxx catAjjxx = catAjjxxService.getById(catCgwjxx.getAjId());
                if (catAjjxx != null) {
                    borrowDetail.setFileId(catAjjxx.getId());
                    borrowDetail.setFileTitle(catAjjxx.getZlmc());
                    borrowDetail.setArchivalCode(catAjjxx.getSgdh());
                } else {
                    borrowDetail.setFileId(0L);
                    borrowDetail.setFileTitle("无");
                    borrowDetail.setArchivalCode("无");
                }
                borrowDetail.setItemId(catCgwjxx.getId());
                borrowDetail.setItemTitle(catCgwjxx.getWjtm());
                borrowDetail.setItemNumber(catCgwjxx.getWjm());
                borrowDetail.setItemCode(catCgwjxx.getDh());
                borrowDetail.setSecurityClassification(catCgwjxx.getWjmj());
                borrowDetail.setSecurityPageNum(catCgwjxx.getSmym());
                borrowDetail.setCreateTime(new Date());
                borrowDetail.setCreateUserId(user.getUserId());
                borrowDetail.setCreateUserName(user.getTrueName());
                borrowDetail.setFormId(0L);
                borrowDetail.setBorrowType(0);
                borrowDetail.setPaper(0);
                borrowDetail.setElectronic(0);
                borrowDetail.setOriginal(0);
                borrowDetail.setPaperBorrow(catCgwjxx.getJyzt());
                borrowDetailService.saveOrUpdate(borrowDetail);
            }
        }
        return count;
    }
    /**
     * 添加原始文件级信息
     *
     * @param catAjjxx
     */
    @Override
    public Integer setYswjxx(CatAjjxx catAjjxx) {
        int count = 0;
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        Integer userSecurityCode = 3;
        QueryWrapper<CatYswjxx> catYswjxxQueryWrapper = new QueryWrapper<>();
        catYswjxxQueryWrapper.eq("aj_id", catAjjxx.getId());
        catYswjxxQueryWrapper.eq("yszt", 3);
        List<CatYswjxx> catYswjxxList = catYswjxxService.list(catYswjxxQueryWrapper);
        //如果没有文件级,只添加案卷级数据
        if (catYswjxxList.size() == 0) {
            BorrowDetail borrowDetail = new BorrowDetail();
            borrowDetail.setFileId(catAjjxx.getId());
            borrowDetail.setFileTitle(catAjjxx.getZlmc());
            borrowDetail.setArchivalCode(catAjjxx.getSgdh());
            borrowDetail.setCreateTime(new Date());
            borrowDetail.setCreateUserId(user.getUserId());
            borrowDetail.setCreateUserName(user.getTrueName());
            borrowDetail.setFormId(0L);
            borrowDetail.setBorrowType(1);
            borrowDetail.setPaper(0);
            borrowDetail.setElectronic(0);
            borrowDetail.setOriginal(0);
            borrowDetailService.saveOrUpdate(borrowDetail);
        }
        for (CatYswjxx catYswjxx : catYswjxxList) {
            if (catYswjxx.getSecurityCode() == null || (catYswjxx.getSecurityCode() != null && catYswjxx.getSecurityCode() <= userSecurityCode)) {
                BorrowDetail borrowDetail = new BorrowDetail();
                borrowDetail.setFileId(catAjjxx.getId());
                borrowDetail.setItemId(catYswjxx.getId());
                borrowDetail.setFileTitle(catAjjxx.getZlmc());
                borrowDetail.setItemTitle(catYswjxx.getWjtm());
                borrowDetail.setItemNumber(catYswjxx.getWjm());
                borrowDetail.setArchivalCode(catAjjxx.getSgdh());
                borrowDetail.setSecurityClassification(catYswjxx.getWjmj());
                borrowDetail.setSecurityPageNum(catYswjxx.getSmym());
                borrowDetail.setCreateTime(new Date());
                borrowDetail.setCreateUserId(user.getUserId());
                borrowDetail.setCreateUserName(user.getTrueName());
                borrowDetail.setFormId(0L);
                borrowDetail.setBorrowType(1);
                borrowDetail.setPaper(0);
                borrowDetail.setElectronic(0);
                borrowDetail.setOriginal(0);
                borrowDetail.setPaperBorrow(catYswjxx.getJyzt());
                borrowDetailService.saveOrUpdate(borrowDetail);
                count++;
            }
        }
        return count;
    }
    /**
     * 添加原始文件级信息
     *
     * @param catAjjxx
     */
    @Override
    public Integer setYswjxxByIds(List<Long> idList) {
        int count = 0;
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        Integer userSecurityCode = 3;
        for (Long id : idList) {
            CatYswjxx catYswjxx = catYswjxxService.getById(id);
            if (catYswjxx != null && (catYswjxx.getSecurityCode() == null || (catYswjxx.getSecurityCode() != null && catYswjxx.getSecurityCode() <= userSecurityCode))) {
                BorrowDetail borrowDetail = new BorrowDetail();
                CatAjjxx catAjjxx = catAjjxxService.getById(catYswjxx.getAjId());
                if (catAjjxx != null) {
                    borrowDetail.setFileId(catAjjxx.getId());
                    borrowDetail.setFileTitle(catAjjxx.getZlmc());
                    borrowDetail.setArchivalCode(catAjjxx.getDh());
                } else {
                    borrowDetail.setFileId(0L);
                    borrowDetail.setFileTitle("无");
                    borrowDetail.setArchivalCode("无");
                }
                borrowDetail.setItemId(catYswjxx.getId());
                borrowDetail.setItemCode(catYswjxx.getDh());
                borrowDetail.setItemTitle(catYswjxx.getWjtm());
                borrowDetail.setItemNumber(catYswjxx.getWjm());
                borrowDetail.setSecurityClassification(catYswjxx.getWjmj());
                borrowDetail.setSecurityPageNum(catYswjxx.getSmym());
                borrowDetail.setCreateTime(new Date());
                borrowDetail.setCreateUserId(user.getUserId());
                borrowDetail.setCreateUserName(user.getTrueName());
                borrowDetail.setFormId(0L);
                borrowDetail.setBorrowType(1);
                borrowDetail.setPaper(0);
                borrowDetail.setElectronic(0);
                borrowDetail.setOriginal(0);
                borrowDetail.setPaperBorrow(catYswjxx.getJyzt());
                borrowDetailService.saveOrUpdate(borrowDetail);
                count++;
            }
        }
        return count;
    }
    @Override
    public Integer getBorrowCount(Long keyId, Long userId) {
        QueryWrapper<BorrowDetail> borrowDetailQueryWrapper = new QueryWrapper<>();
        borrowDetailQueryWrapper.eq("item_id", keyId);
        borrowDetailQueryWrapper.eq("create_user_id", userId);
        borrowDetailQueryWrapper.eq("agree", 1);
        Integer count = borrowDetailService.count(borrowDetailQueryWrapper);
        return count;
    }
}
src/main/java/com/zbooksoft/gdmis/service/impl/BorrowFormServiceImpl.java
@@ -16,4 +16,11 @@
 */
@Service
public class BorrowFormServiceImpl extends ServiceImpl<BorrowFormMapper, BorrowForm> implements BorrowFormService {
    /**
     * 获取申请单中最大申请单号
     */
    @Override
    public String selectMaxApplyCode(String preNum) {
        return this.baseMapper.selectMaxApplyCode(preNum);
    }
}
src/main/java/com/zbooksoft/gdmis/service/impl/CatCgwjxxServiceImpl.java
New file
@@ -0,0 +1,23 @@
package com.zbooksoft.gdmis.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zbooksoft.gdmis.dao.CatCgwjxxMapper;
import com.zbooksoft.gdmis.data.entity.CatCgwjxx;
import com.zbooksoft.gdmis.service.CatCgwjxxService;
import org.springframework.stereotype.Service;
/**
 * @Description
 * @Author zhai
 * @Date 2024/7/31
 **/
@Service
public class CatCgwjxxServiceImpl extends ServiceImpl<CatCgwjxxMapper, CatCgwjxx> implements CatCgwjxxService {
    @Override
    public boolean deleteCatCgwjxxByAjId(Long ajId) {
        QueryWrapper<CatCgwjxx> catCgwjxxQueryWrapper = new QueryWrapper<>();
        catCgwjxxQueryWrapper.eq("aj_id", ajId);
        return this.remove(catCgwjxxQueryWrapper);
    }
}
src/main/java/com/zbooksoft/gdmis/service/impl/CatCheckServiceImpl.java
New file
@@ -0,0 +1,16 @@
package com.zbooksoft.gdmis.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zbooksoft.gdmis.dao.CatCheckMapper;
import com.zbooksoft.gdmis.data.entity.CatCheck;
import com.zbooksoft.gdmis.service.CatCheckService;
import org.springframework.stereotype.Service;
/**
 * @Description
 * @Author zhai
 * @Date 2024/7/31
 **/
@Service
public class CatCheckServiceImpl extends ServiceImpl<CatCheckMapper, CatCheck> implements CatCheckService {
}
src/main/java/com/zbooksoft/gdmis/service/impl/CatSwyxxxServiceImpl.java
New file
@@ -0,0 +1,16 @@
package com.zbooksoft.gdmis.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zbooksoft.gdmis.dao.CatSwyxxxMapper;
import com.zbooksoft.gdmis.data.entity.CatSwyxxx;
import com.zbooksoft.gdmis.service.CatSwyxxxService;
import org.springframework.stereotype.Service;
/**
 * @Description
 * @Author zhai
 * @Date 2024/7/31
 **/
@Service
public class CatSwyxxxServiceImpl extends ServiceImpl<CatSwyxxxMapper, CatSwyxxx> implements CatSwyxxxService {
}
src/main/java/com/zbooksoft/gdmis/service/impl/CatYswjxxServiceImpl.java
@@ -1,10 +1,13 @@
package com.zbooksoft.gdmis.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zbooksoft.gdmis.dao.CatYswjxxMapper;
import com.zbooksoft.gdmis.data.entity.CatYswjxx;
import com.zbooksoft.gdmis.service.CatYswjxxService;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
 * @Description
@@ -13,4 +16,17 @@
 **/
@Service
public class CatYswjxxServiceImpl extends ServiceImpl<CatYswjxxMapper, CatYswjxx> implements CatYswjxxService {
    @Override
    public String getMaxFileType(Long ajId, String fileType) {
        QueryWrapper<CatYswjxx> catYswjxxQueryWrapper = new QueryWrapper<>();
        catYswjxxQueryWrapper.eq("aj_id", ajId)
                .eq("wjlx", fileType)
                .select("max(XH) as xh");
        Map<String, Object> map = this.getMap(catYswjxxQueryWrapper);
        if (map != null) {
            return map.get("xh").toString();
        } else {
            return "0";
        }
    }
}
src/main/java/com/zbooksoft/gdmis/service/impl/CheckQuestionServiceImpl.java
New file
@@ -0,0 +1,19 @@
package com.zbooksoft.gdmis.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zbooksoft.gdmis.dao.CheckQuestionMapper;
import com.zbooksoft.gdmis.data.entity.CheckQuestion;
import com.zbooksoft.gdmis.service.CheckQuestionService;
import org.springframework.stereotype.Service;
/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author cb
 * @since 2020-01-03
 */
@Service
public class CheckQuestionServiceImpl extends ServiceImpl<CheckQuestionMapper, CheckQuestion> implements CheckQuestionService {
}
src/main/java/com/zbooksoft/gdmis/service/impl/PackingManageServiceImpl.java
New file
@@ -0,0 +1,28 @@
package com.zbooksoft.gdmis.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zbooksoft.gdmis.dao.CatCheckMapper;
import com.zbooksoft.gdmis.dao.PackingManageMapper;
import com.zbooksoft.gdmis.data.entity.CatCheck;
import com.zbooksoft.gdmis.data.entity.PackingManage;
import com.zbooksoft.gdmis.service.CatCheckService;
import com.zbooksoft.gdmis.service.PackingManageService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
 * @Description
 * @Author zhai
 * @Date 2024/7/31
 **/
@Service
public class PackingManageServiceImpl extends ServiceImpl<PackingManageMapper, PackingManage> implements PackingManageService {
    @Override
    public void removeByItemId(Long itemId) {
        QueryWrapper<PackingManage> packingManageQueryWrapper = new QueryWrapper<>();
        packingManageQueryWrapper.eq("item_id", itemId);
        this.remove(packingManageQueryWrapper);
    }
}
src/main/java/com/zbooksoft/gdmis/service/impl/PhysicalDetailServiceImpl.java
New file
@@ -0,0 +1,91 @@
package com.zbooksoft.gdmis.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruili.wcp.data.entity.management.User;
import com.zbooksoft.gdmis.dao.PhysicalDetailMapper;
import com.zbooksoft.gdmis.data.entity.CatSwajxx;
import com.zbooksoft.gdmis.data.entity.CatSwyxxx;
import com.zbooksoft.gdmis.data.entity.PhysicalDetail;
import com.zbooksoft.gdmis.data.vo.ParentPhysicalInfo;
import com.zbooksoft.gdmis.service.CatSwyxxxService;
import com.zbooksoft.gdmis.service.PhysicalDetailService;
import com.zbooksoft.gdmis.service.ProcessingDetailService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author cb
 * @since 2020-01-03
 */
@Service
public class PhysicalDetailServiceImpl extends ServiceImpl<PhysicalDetailMapper, PhysicalDetail>
        implements PhysicalDetailService {
    @Autowired
    CatSwyxxxService catSwyxxxService;
    @Autowired
    ProcessingDetailService processingDetailService;
    @Autowired
    PhysicalDetailService physicalDetailService;
    @Override
    public List<ParentPhysicalInfo> selectDistinctParentPhysicalInfo(Long createUserId) {
        return this.baseMapper.selectDistinctParentPhysicalInfo(createUserId);
    }
    /**
     * 获取具体申请单案卷
     */
    @Override
    public List<ParentPhysicalInfo> selectDistinctParentPhysicalInfoByFormId(Long formId) {
        return this.baseMapper.selectDistinctParentPhysicalInfoByFormId(formId);
    }
    /**
     * 添加实物信息
     *
     * @param catSwajxx
     */
    @Override
    public Integer setSwajxx(CatSwajxx catSwajxx) {
        int count = 0;
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        QueryWrapper<CatSwyxxx> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("aj_id", catSwajxx.getId());
        List<CatSwyxxx> catSwyxxxList = catSwyxxxService.list(queryWrapper);
        for (CatSwyxxx catSwyxxx : catSwyxxxList) {
            PhysicalDetail physicalDetail = new PhysicalDetail();
//            physicalDetail.setFileId(catSwajxx.getAjId());
            physicalDetail.setItemId(catSwyxxx.getId());
            physicalDetail.setFileTitle(catSwajxx.getXmmc());
            physicalDetail.setItemTitle(catSwyxxx.getZkmc());
            physicalDetail.setItemNumber(catSwyxxx.getZkbh());
            physicalDetail.setArchivalCode(catSwajxx.getSwzldh());
            physicalDetail.setCreateTime(new Date());
            physicalDetail.setCreateUserId(user.getUserId());
            physicalDetail.setCreateUserName(user.getTrueName());
            physicalDetail.setFormId(0L);
            physicalDetail.setSurvey(0);
            physicalDetail.setSampling(0);
            physicalDetailService.saveOrUpdate(physicalDetail);
            count++;
        }
        return count;
    }
}
src/main/java/com/zbooksoft/gdmis/service/impl/PhysicalFormServiceImpl.java
New file
@@ -0,0 +1,24 @@
package com.zbooksoft.gdmis.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zbooksoft.gdmis.dao.PhysicalFormMapper;
import com.zbooksoft.gdmis.data.entity.PhysicalForm;
import com.zbooksoft.gdmis.service.PhysicalFormService;
import org.springframework.stereotype.Service;
/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author cb
 * @since 2020-01-03
 */
@Service
public class PhysicalFormServiceImpl extends ServiceImpl<PhysicalFormMapper, PhysicalForm>
        implements PhysicalFormService {
    @Override
    public String selectMaxApplyCode(String preNum) {
        return this.baseMapper.selectMaxApplyCode(preNum);
    }
}
src/main/java/com/zbooksoft/gdmis/service/impl/ReadXml2017ServiceImpl.java
New file
@@ -0,0 +1,591 @@
package com.zbooksoft.gdmis.service.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.ruili.wcp.common.CustomConfigUtil;
import com.ruili.wcp.common.IdGenerater;
import com.ruili.wcp.data.entity.management.User;
import com.zbooksoft.gdmis.config.ArchivesCustomConfig;
import com.zbooksoft.gdmis.data.entity.*;
import com.zbooksoft.gdmis.service.*;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.dom4j.Document;
import org.dom4j.Node;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import static com.zbooksoft.gdmis.common.XmlUtil.*;
/**
 * @Description:
 * @Author: zhai
 * @Date: 2024/8/7
 **/
@Service
public class ReadXml2017ServiceImpl implements ReadXml2017Service {
    @Autowired
    CatXzqService catXzqService;
    @Autowired
    CatDlwzxxService catDlwzxxService;
    @Autowired
    CatKcService catKcService;
    @Autowired
    CatSmxxService catSmxxService;
    @Autowired
    CatZkxxService catZkxxService;
    @Autowired
    CatTfxxService catTfxxService;
    @Autowired
    CatYswjxxService catYswjxxService;
    @Autowired
    CatAjjxxService catAjjxxService;
    @Autowired
    CatCheckService catCheckService;
    @Autowired
    CatCgwjxxService catCgwjxxService;
    @Autowired
    CustomConfigUtil customConfigUtil;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void readXml(Document document, String startData, String endData) throws Exception {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        Node ajjxxNode = getNode(document, "AJXX");
        long ajjxxId = IdGenerater.getId();
        CatAjjxx catAjjxx = new CatAjjxx();
        catAjjxx.setDeleteState(0);
        catAjjxx.setId(ajjxxId);
        catAjjxx.setSlsj(stringToDate(startData));
        catAjjxx.setYsjzsj(stringToDate(endData));
        catAjjxx.setZlzt(0);
        if (user != null) {
            catAjjxx.setSlr(user.getTrueName());
            catAjjxx.setYsr(user.getTrueName());
        }
        //项目信息
        catAjjxx.setZjly(getNodeText(ajjxxNode, "ZJLY"));
        catAjjxx.setXmkyqxz(getNodeText(ajjxxNode, "XMXZ"));
        catAjjxx.setXmkyqbh(getNodeText(ajjxxNode, "XMBH"));
        catAjjxx.setXmkyqmc(getNodeText(ajjxxNode, "XMMC"));
        catAjjxx.setXmcddwkyqr(getNodeText(ajjxxNode, "XMFZR"));
        catAjjxx.setQssj(getNodeText(ajjxxNode, "XMQSSJ"));
        catAjjxx.setZzsj(getNodeText(ajjxxNode, "XMZZSJ"));
//        catAjjxx.setQssj(stringToDate(getNodeText(ajjxxNode, "XMQSSJ")));
//        catAjjxx.setZzsj(stringToDate(getNodeText(ajjxxNode, "XMZZSJ")));
        catAjjxx.setSpjg(getNodeText(ajjxxNode, "PSJG"));
        catAjjxx.setSpsj(stringToDate(getNodeText(ajjxxNode, "PSSJ")));
        // 案卷级信息
        catAjjxx.setHjrdh(getNodeText(ajjxxNode, "HJRDH"));
        catAjjxx.setZlmc(getNodeText(ajjxxNode, "TM"));
        catAjjxx.setBzz(getNodeText(ajjxxNode, "BZZ"));
        catAjjxx.setXcdwmc(getNodeText(ajjxxNode, "XCDWMC"));
        catAjjxx.setXcdwshxydm(getNodeText(ajjxxNode, "XCZZJGDM"));
        catAjjxx.setXcsj(getNodeText(ajjxxNode, "XCSJ"));
        catAjjxx.setSpjg(getNodeText(ajjxxNode, "PSJG"));
        catAjjxx.setSpsj(stringToDate(getNodeText(ajjxxNode, "PSSJ")));
        List<Node> xzqNodeList = getNodeList(ajjxxNode, "XZQList");
        String xzqmc = "";
        String xzqdms = "";
        for (Node xzqNode : xzqNodeList) {
            CatXzq catXzq = new CatXzq();
            catXzq.setAjId(ajjxxId);
            String sj = getNodeText(xzqNode, "Province");
            String dj = getNodeText(xzqNode, "District");
            String xj = getNodeText(xzqNode, "County");
            if (!"".equals(sj)) {
                xzqmc += sj;
            }
            catXzq.setSj(sj);
            if (!"".equals(dj)) {
                xzqmc += " " + dj;
            }
            catXzq.setDj(dj);
            if (!"".equals(xj)) {
                xzqmc += " " + xj;
            }
            catXzq.setXj(xj);
            if ("".equals(getNodeText(xzqNode, "CountyCode"))) {
                catXzq.setXzqdm(getNodeText(xzqNode, "CountyCode"));
            } else if ("".equals(getNodeText(xzqNode, "DistrictCode"))) {
                catXzq.setXzqdm(getNodeText(xzqNode, "DistrictCode"));
            } else if ("".equals(getNodeText(xzqNode, "ProvinceCode"))) {
                catXzq.setXzqdm(getNodeText(xzqNode, "ProvinceCode"));
            }
            String xzqdm = catXzq.getXzqdm();
            if (!"".equals(xzqdm)) {
                xzqdms += xzqdm + ",";
            }
            catXzqService.saveOrUpdate(catXzq);
            xzqmc += ",";
        }
        if (!"".equals(xzqmc)) {
            catAjjxx.setXzqmc(xzqmc.substring(0, xzqmc.length() - 1));
        }
        if (!"".equals(xzqdms)) {
            catAjjxx.setXzqdm(xzqdms.substring(0, xzqdms.length() - 1));
        }
        catAjjxx.setQsjdFx(getNodeText(ajjxxNode, "QSJDLX"));
        catAjjxx.setQsjdDu(getNodeText(ajjxxNode, "QSJDDu"));
        catAjjxx.setQsjdFen(getNodeText(ajjxxNode, "QSJDFen"));
        catAjjxx.setQsjdMiao(getNodeText(ajjxxNode, "QSJDMiao"));
        catAjjxx.setZzjdFx(getNodeText(ajjxxNode, "ZZJDLX"));
        catAjjxx.setZzjdDu(getNodeText(ajjxxNode, "ZZJDDu"));
        catAjjxx.setZzjdFen(getNodeText(ajjxxNode, "ZZJDFen"));
        catAjjxx.setZzjdMiao(getNodeText(ajjxxNode, "ZZJDMiao"));
        catAjjxx.setQswdFx(getNodeText(ajjxxNode, "QSWDLX"));
        catAjjxx.setQswdDu(getNodeText(ajjxxNode, "QSWDDu"));
        catAjjxx.setQswdFen(getNodeText(ajjxxNode, "QSWDFen"));
        catAjjxx.setQswdMiao(getNodeText(ajjxxNode, "QSWDMiao"));
        catAjjxx.setZzwdFx(getNodeText(ajjxxNode, "ZZWDLX"));
        catAjjxx.setZzwdDu(getNodeText(ajjxxNode, "ZZWDDu"));
        catAjjxx.setZzwdFen(getNodeText(ajjxxNode, "ZZWDFen"));
        catAjjxx.setZzwdMiao(getNodeText(ajjxxNode, "ZZWDMiao"));
        //WENEW
        catAjjxx.setYz(getNodeText(ajjxxNode, "YZ"));
        List<Node> kcNodeList = getNodeList(ajjxxNode, "KCList");
        String kcmcs = "";
        for (Node kcNode : kcNodeList) {
            CatKc catKc = new CatKc();
            catKc.setAjId(ajjxxId);
            String kcdm = getNodeText(kcNode, "DM");
            catKc.setKcdm(kcdm);
            String kcmc = getNodeText(kcNode, "MC");
            catKc.setKcmc(kcmc);
            if (!"".equals(kcdm) && !"".equals(kcmc)) {
                kcmcs += kcdm + "-" + kcmc + ",";
            }
            catKcService.saveOrUpdate(catKc);
        }
        if (!"".equals(kcmcs)) {
            catAjjxx.setKcmc(kcmcs.substring(0, kcmcs.length() - 1));
        }
        catAjjxx.setZllb(getNodeText(ajjxxNode, "ZLLB"));
        catAjjxx.setBz(getNodeText(ajjxxNode, "TMBZ"));
        String gzcd = getNodeText(ajjxxNode, "GZCD");
        gzcd = gzcd.replaceAll("/", ":").replaceAll("万", "0000");
        catAjjxx.setGzcd(gzcd);
        catAjjxx.setGzff(getNodeText(ajjxxNode, "GZFF"));
        catAjjxx.setNrzy(getNodeText(ajjxxNode, "NRZY"));
        catAjjxx.setYdzwjgsjbb(getNodeText(ajjxxNode, "KFGJWB"));
        catAjjxx.setYjhj(getNodeText(ajjxxNode, "YJHJ"));
        catAjjxx.setRjhj(getNodeText(ajjxxNode, "CZXT"));
        String dztjxtksm = getNodeText(ajjxxNode, "DZTJXTKSM");
        if ("".equals(dztjxtksm)) {
            catAjjxx.setTjxtkzktysm(getNodeText(ajjxxNode, "DZWDSM"));
        }
        catAjjxx.setQtsm(getNodeText(ajjxxNode, "DZWJXXBZ"));
        catAjjxx.setHjrmc(getNodeText(ajjxxNode, "HJDWMC"));
        catAjjxx.setHjrdz(getNodeText(ajjxxNode, "HJRTXDZ"));
        catAjjxx.setHjryb(getNodeText(ajjxxNode, "HJRYZBM"));
        catAjjxx.setHjrtyshxydm(getNodeText(ajjxxNode, "HJZZJGDM"));
        catAjjxx.setHjrlxr(getNodeText(ajjxxNode, "HJLXR"));
        String hjrgddh = getNodeText(ajjxxNode, "HJRGDDH");
        String hjrsjh = getNodeText(ajjxxNode, "HJRSJH");
        catAjjxx.setHjrlxfs(hjrgddh + " " + hjrsjh);
        catAjjxx.setHjrdzyx(getNodeText(ajjxxNode, "HJRDZYX"));
        String bhq = getNodeText(ajjxxNode, "BHQ");
        catAjjxx.setBhq(bhq);
        if (bhq != null && !"".equals(bhq)) {
            catAjjxx.setSfbh("是");
        } else {
            catAjjxx.setSfbh("否");
        }
        String nodeText = getNodeText(ajjxxNode, "MJ");
        if ("不涉密".equals(nodeText)) {
            catAjjxx.setMjdm("0");
        } else if ("内部".equals(nodeText)) {
            catAjjxx.setMjdm("1");
        } else if ("秘密".equals(nodeText)) {
            catAjjxx.setMjdm("2");
        } else if ("机密".equals(nodeText)) {
            catAjjxx.setMjdm("3");
        } else if ("绝密".equals(nodeText)) {
            catAjjxx.setMjdm("4");
        }
        catAjjxx.setMj(nodeText);
        //成果数量信息
        catAjjxx.setCgzlsjl(stringToDouble(getNodeText(ajjxxNode, "CGZLSJL")));
        catAjjxx.setCgzldzwjzs(stringToInteger(getNodeText(ajjxxNode, "DZWJSL")));
        catAjjxx.setCgzldzwjjzs(stringToInteger(getNodeText(ajjxxNode, "DZWJJSL")));
        catAjjxx.setZwdzjs(stringToInteger(getNodeText(ajjxxNode, "DZZWSL")));
        catAjjxx.setSpdzjs(stringToInteger(getNodeText(ajjxxNode, "DZSPSL")));
        catAjjxx.setFtdzjs(stringToInteger(getNodeText(ajjxxNode, "DZFTSL")));
        catAjjxx.setFbdzjs(stringToInteger(getNodeText(ajjxxNode, "DZFBSL")));
        catAjjxx.setFjdzjs(stringToInteger(getNodeText(ajjxxNode, "DZFJSL")));
        catAjjxx.setRjdzjs(stringToInteger(getNodeText(ajjxxNode, "DZRJSL")));
        catAjjxx.setSjkdzjs(stringToInteger(getNodeText(ajjxxNode, "DZSJKSL")));
        catAjjxx.setDmtdzjs(stringToInteger(getNodeText(ajjxxNode, "DZDMTSL")));
        catAjjxx.setQtdzjs(stringToInteger(getNodeText(ajjxxNode, "DZQTSL")));
        catAjjxx.setCgzldzjs(catAjjxx.getZwdzjs()
                + catAjjxx.getSpdzjs()
                + catAjjxx.getFtdzjs()
                + catAjjxx.getFbdzjs()
                + catAjjxx.getFjdzjs()
                + catAjjxx.getRjdzjs()
                + catAjjxx.getSjkdzjs()
                + catAjjxx.getDmtdzjs()
                + catAjjxx.getQtdzjs());
        catAjjxx.setZwzzjs(stringToInteger(getNodeText(ajjxxNode, "ZZZWSL")));
        catAjjxx.setSpzzjs(stringToInteger(getNodeText(ajjxxNode, "ZZSPSL")));
        catAjjxx.setFtzzjs(stringToInteger(getNodeText(ajjxxNode, "ZZFTSL")));
        catAjjxx.setFbzzjs(stringToInteger(getNodeText(ajjxxNode, "ZZFBSL")));
        catAjjxx.setFjzzjs(stringToInteger(getNodeText(ajjxxNode, "ZZFJSL")));
        catAjjxx.setQtzzjs(stringToInteger(getNodeText(ajjxxNode, "ZZQTSL")));
        catAjjxx.setCgzlzzjs(catAjjxx.getZwzzjs()
                + catAjjxx.getSpzzjs()
                + catAjjxx.getFtzzjs()
                + catAjjxx.getFbzzjs()
                + catAjjxx.getFjzzjs()
                + catAjjxx.getQtzzjs());
        //原始数量信息
        catAjjxx.setYszlsjl(stringToDouble(getNodeText(ajjxxNode, "YSDZWJDX")));
        catAjjxx.setYszldzwjzs(stringToInteger(getNodeText(ajjxxNode, "YSDZWJSL")));
        catAjjxx.setYszldzwjjzs(stringToInteger(getNodeText(ajjxxNode, "YSDZWJJSL")));
        catAjjxx.setDzzjs(stringToInteger(getNodeText(ajjxxNode, "YSZZDLSL")));
        catAjjxx.setCzzjs(stringToInteger(getNodeText(ajjxxNode, "YSZZCLSL")));
        catAjjxx.setGzzjs(stringToInteger(getNodeText(ajjxxNode, "YSZZGLSL")));
        catAjjxx.setTzzjs(stringToInteger(getNodeText(ajjxxNode, "YSZZTLSL")));
        catAjjxx.setYzzjs(stringToInteger(getNodeText(ajjxxNode, "YSZZYLSL")));
        catAjjxx.setSzzjs(stringToInteger(getNodeText(ajjxxNode, "YSZZSLSL")));
        catAjjxx.setLzzjs(stringToInteger(getNodeText(ajjxxNode, "YSZZLLSL")));
        catAjjxx.setXzzjs(stringToInteger(getNodeText(ajjxxNode, "YSZZXLSL")));
        catAjjxx.setZzzjs(stringToInteger(getNodeText(ajjxxNode, "YSZZZLSL")));
        catAjjxx.setWzzjs(stringToInteger(getNodeText(ajjxxNode, "YSZZWLSL")));
        catAjjxx.setDdzjs(stringToInteger(getNodeText(ajjxxNode, "YSDZDLSL")));
        catAjjxx.setCdzjs(stringToInteger(getNodeText(ajjxxNode, "YSDZCLSL")));
        catAjjxx.setGdzjs(stringToInteger(getNodeText(ajjxxNode, "YSDZGLSL")));
        catAjjxx.setTdzjs(stringToInteger(getNodeText(ajjxxNode, "YSDZTLSL")));
        catAjjxx.setYdzjs(stringToInteger(getNodeText(ajjxxNode, "YSDZYLSL")));
        catAjjxx.setSdzjs(stringToInteger(getNodeText(ajjxxNode, "YSDZSLSL")));
        catAjjxx.setLdzjs(stringToInteger(getNodeText(ajjxxNode, "YSDZLLSL")));
        catAjjxx.setXdzjs(stringToInteger(getNodeText(ajjxxNode, "YSDZXLSL")));
        catAjjxx.setZdzjs(stringToInteger(getNodeText(ajjxxNode, "YSDZZLSL")));
        catAjjxx.setWdzjs(stringToInteger(getNodeText(ajjxxNode, "YSDZWLSL")));
        catAjjxx.setYszldzjs(catAjjxx.getDdzjs()
                + catAjjxx.getCdzjs()
                + catAjjxx.getGdzjs()
                + catAjjxx.getTdzjs()
                + catAjjxx.getYdzjs()
                + catAjjxx.getSdzjs()
                + catAjjxx.getLdzjs()
                + catAjjxx.getXdzjs()
                + catAjjxx.getZdzjs()
                + catAjjxx.getWdzjs());
        //todo::原始资料数量怎么计算
//            ajjxx.YSZLZZJS = DataPacketService.CountYSZZNum(ajjxx);
//            catAjjxx.setYszlzzjs()
        // 实物汇总数量信息
        catAjjxx.setDdgzwz(getNodeText(ajjxxNode, "DDGZWZ"));
        catAjjxx.setCkd(getNodeText(ajjxxNode, "CKD"));
        catAjjxx.setZykz(getNodeText(ajjxxNode, "ZYKZ"));
        catAjjxx.setCylx(getNodeText(ajjxxNode, "CYLX"));
        catAjjxx.setCksd(getNodeText(ajjxxNode, "CKSD"));
        catAjjxx.setZycgjs(getNodeText(ajjxxNode, "ZYCG"));
        catAjjxx.setSwbz(getNodeText(ajjxxNode, "SWXXBZ"));
        catAjjxx.setZksl(stringToInteger(getNodeText(ajjxxNode, "SWYKX")));
        catAjjxx.setZjc(stringToDouble(getNodeText(ajjxxNode, "SWZJC")));
        catAjjxx.setYxzsl(stringToDouble(getNodeText(ajjxxNode, "SWQX")));
        catAjjxx.setYxizsl(stringToInteger(getNodeText(ajjxxNode, "SWYX")));
        catAjjxx.setBbzsl(stringToInteger(getNodeText(ajjxxNode, "SWBB")));
        catAjjxx.setYpzsl(stringToInteger(getNodeText(ajjxxNode, "SWYP")));
        catAjjxx.setGpzsl(stringToInteger(getNodeText(ajjxxNode, "SWGP")));
        catAjjxx.setBpzsl(stringToInteger(getNodeText(ajjxxNode, "SWBP")));
        catAjjxx.setQtswmc(getNodeText(ajjxxNode, "SWQT"));
//        ArchivesCustomConfig archivesCustomConfig = customConfigUtil.getConfigObj(ArchivesCustomConfig.class);
//        String checkRule = archivesCustomConfig.getCheckRule();
//
//        if (StringUtils.isNotEmpty(checkRule)) {
//            String sql = "select count(*) from CAT_FILE_AJJXX where ";
//            String[] checkRules = checkRule.split("\\|");
//            for (String rule : checkRules) {
//                String camelCaseFieldName = CommonUtil.underscoreToCamelCase(rule);
//                Object fieldValue = CommonUtil.getFieldValue(catAjjxx, camelCaseFieldName);
//                sql += rule + " = '" + fieldValue + "' and ";
//            }
//            sql = sql.substring(0, sql.length() - 4);
//            Integer integer = jdbcTemplate.queryForObject(sql, Integer.class);
//            if (integer > 0) {
//                throw new RuntimeException("数据重复");
//            }
//        }
        catAjjxxService.saveOrUpdate(catAjjxx);
        //成果文件级信息
        List<Node> cgwjcNodeList = getNodeList(ajjxxNode, "CGWJCList");
        for (Node cgwjcNode : cgwjcNodeList) {
            String wjlxmc = getNodeText(cgwjcNode, "WJLX");
            Integer ch = stringToInteger(getNodeText(cgwjcNode, "CH"));
            //成果文件
            List<Node> cgwjxxNodeList = getNodeList(cgwjcNode, "CGWJXXList");
            for (Node cgwjxxNode : cgwjxxNodeList) {
                CatCgwjxx catCgwjxx = new CatCgwjxx();
                long cgwjxxId = IdGenerater.getId();
                catCgwjxx.setAjId(ajjxxId);
                String fileType = getFileType(wjlxmc);
                catCgwjxx.setWjlx(fileType);
                catCgwjxx.setCh(ch);
                catCgwjxx.setId(cgwjxxId);
                catCgwjxx.setJh(stringToInteger(getNodeText(cgwjxxNode, "JH")));
                String wjmc = getNodeText(cgwjxxNode, "WJMC");
                if (wjmc.contains(".")) {
                    String wjm = wjmc.substring(0, wjmc.indexOf("."));
                    catCgwjxx.setWjm(wjm);
                } else {
                    catCgwjxx.setWjm(wjmc);
                }
                catCgwjxx.setWjtm(getNodeText(cgwjxxNode, "WJBT"));
                catCgwjxx.setYdzwjm(getNodeText(cgwjxxNode, "WJMC"));
                catCgwjxx.setYdzwjlj(getNodeText(cgwjxxNode, "WJLJ"));
                catCgwjxx.setYdzwjdx(stringToDouble(getNodeText(cgwjxxNode, "WJDX")));
                //TODO::插图信息
//                    XmlNode ctNode = cgwjNode.SelectSingleNode("CTList");
                catCgwjxx.setCddzwjm(getNodeText(cgwjxxNode, "CDWJMC"));
                catCgwjxx.setCddzwjlj(getNodeText(cgwjxxNode, "CDWJLJ"));
                catCgwjxx.setCddzwjdx(stringToDouble(getNodeText(cgwjxxNode, "CDWJDX")));
                catCgwjxx.setZtxs(getNodeText(cgwjxxNode, "HJZTXS"));
                catCgwjxx.setXcr(getNodeText(cgwjxxNode, "XCR"));
                catCgwjxx.setXcdwmc(getNodeText(cgwjxxNode, "XCDW"));
                catCgwjxx.setXcsj(getNodeText(cgwjxxNode, "XCSJ"));
//                catCgwjxx.setXcsj(stringToDate(getNodeText(cgwjxxNode, "XCSJ")));
                catCgwjxx.setFtzxblc(getNodeText(cgwjxxNode, "BLC"));
                catCgwjxx.setTh(getNodeText(cgwjxxNode, "TH"));
                catCgwjxx.setQzy(getNodeText(cgwjxxNode, "QZY"));
                String bz = getNodeText(cgwjxxNode, "BZ");
                if ((catCgwjxx.getWjlx() == "FT" || catCgwjxx.getWjlx() == "附图") && bz.contains("*")) {
                    catCgwjxx.setFtgg(bz);
                } else {
                    catCgwjxx.setBz(bz);
                }
                //涉密信息
                catCgwjxx.setSmym(getNodeText(cgwjxxNode, "SMYM"));
                catCgwjxx.setSmzl(getNodeText(cgwjxxNode, "SMZL"));
                catCgwjxx.setSmsx(getNodeText(cgwjxxNode, "SMSX"));
                String mj = getNodeText(cgwjxxNode, "MJ");
                if (mj != null && !("").equals(mj)) {
                    catCgwjxx.setSfsm("是");
                    Integer securityCode = getSecurityCode(mj);
                    catCgwjxx.setSecurityCode(securityCode);
                } else {
                    catCgwjxx.setSfsm("否");
                }
                catCgwjxx.setWjmj(mj);
                catCgwjxx.setBmqx(getNodeText(cgwjxxNode, "SMZLSX"));
                ObjectMapper mapper = new ObjectMapper();
                ObjectNode root = mapper.createObjectNode();
                ArrayNode addresses = mapper.createArrayNode();
                List<Node> smxxNodeList = getNodeList(cgwjxxNode, "SMXXList/SMXX");
                for (Node smxxNode : smxxNodeList) {
                    CatSmxx catSmxx = new CatSmxx();
                    catSmxx.setAjId(ajjxxId);
                    catSmxx.setWjId(cgwjxxId);
                    String smym = getNodeText(smxxNode, "SMYM");
                    String smzl = getNodeText(smxxNode, "SMZL");
                    String smsx = getNodeText(smxxNode, "SMSX");
                    String wjmj = getNodeText(smxxNode, "MJ");
                    String bmqx = getNodeText(smxxNode, "SMZLSX");
                    catSmxx.setSmym(smym);
                    catSmxx.setSmzl(smzl);
                    catSmxx.setSmsx(smsx);
                    catSmxx.setWjmj(wjmj);
                    catSmxx.setBmqx(bmqx);
                    catSmxxService.saveOrUpdate(catSmxx);
                    ObjectNode address = mapper.createObjectNode();
                    address.put("mj", wjmj);
                    address.put("smym", smym);
                    address.put("smsx", smsx);
                    address.put("bmqx", bmqx);
                    address.put("zxfw", "");
                    address.put("smzl", smzl);
                    addresses.add(address);
                }
                root.put("classified", addresses);
                String jsonString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(root);
                catCgwjxx.setSmxx(jsonString);
                catCgwjxxService.saveOrUpdate(catCgwjxx);
            }
        }
//        //原始文件级信息
//        List<Node> yswjmlNodeList = getNodeList(ajjxxNode, "YSWJMLList");
//        for (Node yswjmlNode : yswjmlNodeList) {
//            String wjlxmc = getNodeText(yswjmlNode, "DZ");
//
//            //原始文件
//            List<Node> yswjxxNodeList = getNodeList(yswjmlNode, "YSWJXXList");
//            for (Node yswjxxNode : yswjxxNodeList) {
//                long yswjxxId = IdGenerater.getId();
//                CatYswjxx catYswjxx = new CatYswjxx();
//                catYswjxx.setAjId(ajjxxId);
//                catYswjxx.setId(yswjxxId);
//                catYswjxx.setWjlx(wjlxmc);
//
//
//                catYswjxx.setWjm(getNodeText(yswjxxNode, "DZWJM"));
//                catYswjxx.setXh(getNodeText(yswjxxNode, "JH"));
//                catYswjxx.setWjtm(getNodeText(yswjxxNode, "WJMC"));
//                catYswjxx.setWjdx(getNodeText(yswjxxNode, "WJZJS"));
//                catYswjxx.setWjlj(getNodeText(yswjxxNode, "WJLJ"));
//
//
//                String hjztxs = getNodeText(yswjxxNode, "HJZTXS");
//                if ("".equals(hjztxs)) {
//                    catYswjxx.setZtxs(getNodeText(yswjxxNode, "ZTXS"));
//                } else {
//                    catYswjxx.setZtxs(hjztxs);
//                }
//
//                catYswjxx.setSfhj(getNodeText(yswjxxNode, "SFHJ"));
//                catYswjxx.setQzy(getNodeText(yswjxxNode, "QZY"));
//                catYswjxx.setBz(getNodeText(yswjxxNode, "BZ"));
//
//                //涉密信息
//                catYswjxx.setSmym(getNodeText(yswjxxNode, "SMYM"));
//                catYswjxx.setSmzl(getNodeText(yswjxxNode, "SMZL"));
//                catYswjxx.setSmsx(getNodeText(yswjxxNode, "SMSX"));
//
//                String mj = getNodeText(yswjxxNode, "MJ");
//                if (mj != null && !("").equals(mj)) {
//                    catYswjxx.setSfsm("是");
//                    Integer securityCode = getSecurityCode(mj);
//                    catYswjxx.setSecurityCode(securityCode);
//                } else {
//                    catYswjxx.setSfsm("否");
//                }
//                catYswjxx.setWjmj(mj);
//                catYswjxx.setBmqx(getNodeText(yswjxxNode, "SMZLSX"));
//                ObjectMapper mapper = new ObjectMapper();
//                ObjectNode root = mapper.createObjectNode();
//                ArrayNode addresses = mapper.createArrayNode();
//                List<Node> smxxNodeList = getNodeList(yswjxxNode, "SMXXList/SMXX");
//                for (Node smxxNode : smxxNodeList) {
//                    CatSmxx catSmxx = new CatSmxx();
//                    catSmxx.setAjId(ajjxxId);
//                    catSmxx.setWjId(yswjxxId);
//
//                    String smym = getNodeText(smxxNode, "SMYM");
//                    String smzl = getNodeText(smxxNode, "SMZL");
//                    String smsx = getNodeText(smxxNode, "SMSX");
//                    String wjmj = getNodeText(smxxNode, "MJ");
//                    String bmqx = getNodeText(smxxNode, "SMZLSX");
//
//                    catSmxx.setSmym(smym);
//                    catSmxx.setSmzl(smzl);
//                    catSmxx.setSmsx(smsx);
//                    catSmxx.setWjmj(wjmj);
//                    catSmxx.setBmqx(bmqx);
//                    catSmxxService.saveOrUpdate(catSmxx);
//
//                    ObjectNode address = mapper.createObjectNode();
//                    address.put("mj", wjmj);
//                    address.put("smym", smym);
//                    address.put("smsx", smsx);
//                    address.put("bmqx", bmqx);
//                    address.put("zxfw", "");
//                    address.put("smzl", smzl);
//                    addresses.add(address);
//                }
//                root.put("classified", addresses);
//                String jsonString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(root);
//                catYswjxx.setSmxx(jsonString);
//                catYswjxxService.saveOrUpdate(catYswjxx);
//            }
        //实物钻孔信息
//            List<Node> zkxxList = getNodeList(ajjxxNode, "ZKXXList");
//            for (int i = 0; i < zkxxList.size(); i++) {
//                Node zkxxNode = zkxxList.get(i);
//                CatZkxx catZkxx = new CatZkxx();
//                catZkxx.setAjId(ajjxxId);
//
//                catZkxx.setXh(Integer.toString(i + 1));
//                catZkxx.setZkmc(getNodeText(zkxxNode, "ZKMC"));
//                catZkxx.setZkjd(getNodeText(zkxxNode, "HZB"));
//                catZkxx.setZkwd(getNodeText(zkxxNode, "ZZB"));
//                catZkxx.setZjc(getNodeText(zkxxNode, "ZJC"));
//                catZkxx.setQxsl(getNodeText(zkxxNode, "QXSL"));
//                catZkxx.setYxsl(getNodeText(zkxxNode, "YX"));
//                catZkxx.setJksdfw(getNodeText(zkxxNode, "JKSDFW"));
//                catZkxx.setBz(getNodeText(zkxxNode, "BZ"));
//                catZkxxService.saveOrUpdate(catZkxx);
//            }
//
//            //实物图幅信息
//            List<Node> tfxxNodeList = getNodeList(ajjxxNode, "QDXMList");
//            for (int i = 0; i < tfxxNodeList.size(); i++) {
//                Node tfxxNode = tfxxNodeList.get(i);
//                CatTfxx catTfxx = new CatTfxx();
//                catTfxx.setAjId(ajjxxId);
//                String string = Integer.toString(i + 1);
//                catTfxx.setXh(string);
//                catTfxx.setTfmc(getNodeText(tfxxNode, "TFMC"));
//                catTfxx.setScpmmc(getNodeText(tfxxNode, "SCPMMC"));
//                catTfxx.setZyfx(getNodeText(tfxxNode, "ZYFX"));
//                catTfxx.setBbsl(getNodeText(tfxxNode, "BBSL"));
//                catTfxx.setYpsl(getNodeText(tfxxNode, "FYSL"));
//                catTfxx.setGpsl(getNodeText(tfxxNode, "GPSL"));
//                catTfxx.setBpsl(getNodeText(tfxxNode, "BPSL"));
//
//                catTfxx.setBz(getNodeText(tfxxNode, "BZ"));
//                catTfxxService.saveOrUpdate(catTfxx);
//            }
//        }
    }
}
src/main/java/com/zbooksoft/gdmis/service/impl/ReadXml2023ServiceImpl.java
New file
@@ -0,0 +1,813 @@
package com.zbooksoft.gdmis.service.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.ruili.wcp.common.CustomConfigUtil;
import com.ruili.wcp.common.IdGenerater;
import com.ruili.wcp.data.entity.management.User;
import com.zbooksoft.gdmis.config.ArchivesCustomConfig;
import com.zbooksoft.gdmis.data.entity.*;
import com.zbooksoft.gdmis.service.*;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.dom4j.Document;
import org.dom4j.Node;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.List;
import static com.zbooksoft.gdmis.common.XmlUtil.*;
/**
 * @Description:
 * @Author: zhai
 * @Date: 2024/8/7
 **/
@Service
public class ReadXml2023ServiceImpl implements ReadXml2023Service {
    @Autowired
    CatXzqService catXzqService;
    @Autowired
    CatDlwzxxService catDlwzxxService;
    @Autowired
    CatKcService catKcService;
    @Autowired
    CatSmxxService catSmxxService;
    @Autowired
    CatZkxxService catZkxxService;
    @Autowired
    CatTfxxService catTfxxService;
    @Autowired
    CatYswjxxService catYswjxxService;
    @Autowired
    CatCgwjxxService catCgwjxxService;
    @Autowired
    CatAjjxxService catAjjxxService;
    @Autowired
    CatCheckService catCheckService;
    @Autowired
    CustomConfigUtil customConfigUtil;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void readXml(Document document, String startData, String endData) throws Exception {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        //案卷级信息
        Node ajjxxNode = getNode(document, "AJJXX");
//        Node bsdNode = getNode(document, "DZZLBSD");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        long ajjxxId = IdGenerater.getId();
        CatAjjxx catAjjxx = new CatAjjxx();
        catAjjxx.setId(ajjxxId);
        catAjjxx.setDeleteState(0);
        catAjjxx.setSlsj(stringToDate(startData));
        catAjjxx.setYsjzsj(stringToDate(endData));
        catAjjxx.setZlzt(0);
        if (user != null) {
            catAjjxx.setSlr(user.getTrueName());
            catAjjxx.setYsr(user.getTrueName());
        }
        //项目信息
        catAjjxx.setSmqk(getNodeText(ajjxxNode, "SMQK"));
        catAjjxx.setZjly(getNodeText(ajjxxNode, "ZJLY"));
        catAjjxx.setXmkyqlx(getNodeText(ajjxxNode, "XMKYQ/XMKYQLX"));
        catAjjxx.setXmkyqxz(getNodeText(ajjxxNode, "XMKYQ/XMKYQXZ"));
        catAjjxx.setXmkyqbh(getNodeText(ajjxxNode, "XMKYQ/XMKYQBH"));
        catAjjxx.setXmkyqmc(getNodeText(ajjxxNode, "XMKYQ/XMKYQMC"));
        catAjjxx.setXmcddwkyqr(getNodeText(ajjxxNode, "XMKYQ/XMCDDWKYQR"));
        catAjjxx.setQssj(getNodeText(ajjxxNode, "XMKYQ/QSSJ"));
        catAjjxx.setZzsj(getNodeText(ajjxxNode, "XMKYQ/ZZSJ"));
//        catAjjxx.setQssj(stringToDate(getNodeText(ajjxxNode, "XMKYQ/QSSJ")));
//        catAjjxx.setZzsj(stringToDate(getNodeText(ajjxxNode, "XMKYQ/ZZSJ")));
        catAjjxx.setXmxxsm(getNodeText(ajjxxNode, "XMKYQ/XMXXSM"));
        catAjjxx.setSpjg(getNodeText(ajjxxNode, "XMKYQ/SPJG"));
        catAjjxx.setSpsj(stringToDate(getNodeText(ajjxxNode, "XMKYQ/SPSJ")));
        //汇交人信息
        catAjjxx.setHjrmc(getNodeText(ajjxxNode, "HJR/HJRMC"));
        catAjjxx.setHjrdz(getNodeText(ajjxxNode, "HJR/HJRDZ"));
        catAjjxx.setHjryb(getNodeText(ajjxxNode, "HJR/HJRYB"));
        catAjjxx.setHjrtyshxydm(getNodeText(ajjxxNode, "HJR/HJRTYSHXYDM"));
        catAjjxx.setHjrlxr(getNodeText(ajjxxNode, "HJR/HJRLXR"));
        catAjjxx.setHjrdh(getNodeText(ajjxxNode, "HJR/HJRDH"));
        catAjjxx.setHjrdzyx(getNodeText(ajjxxNode, "HJR/HJRDZYX"));
        //报送单信息
//            xmxx.GPSL = XMLHelper.GetNodeValue(bsdNode, "GPSL").ToInt();
//            xmxx.YPSL = XMLHelper.GetNodeValue(bsdNode, "YPSL").ToInt();
//            xmxx.QTJZMC = XMLHelper.GetNodeValue(bsdNode, "QTJZSL/JZMC");
//            xmxx.QTJZSL = XMLHelper.GetNodeValue(bsdNode, "QTJZSL/JZSL").ToInt();
//            xmxx.BSDBZ = XMLHelper.GetNodeValue(bsdNode, "BZ");
        //案卷级信息
        catAjjxx.setHjrdh(getNodeText(ajjxxNode, "HJRDH"));
        catAjjxx.setDh(getNodeText(ajjxxNode, "DH"));
        catAjjxx.setSgdh(getNodeText(ajjxxNode, "SGDH"));
        catAjjxx.setZlmc(getNodeText(ajjxxNode, "ZLMC"));
        catAjjxx.setFzmc(getNodeText(ajjxxNode, "FZMC"));
        String bzz = "";
        List<Node> BzzNodeList = getNodeList(ajjxxNode, "BZZ/Item");
        for (Node bzzNode : BzzNodeList) {
            String nodeText = bzzNode.getText();
            if (nodeText != null && !"".equals(nodeText)) {
                bzz += nodeText + ",";
            }
        }
        if (!"".equals(bzz)) {
            bzz = bzz.substring(0, bzz.length() - 1);
            catAjjxx.setBzz(bzz);
        }
        catAjjxx.setXcdwmc(getNodeText(ajjxxNode, "XCDW/Item/XCDWMC"));
        catAjjxx.setXcdwshxydm(getNodeText(ajjxxNode, "XCDW/Item/XCDWSHXYDM"));
        catAjjxx.setXcsj(getNodeText(ajjxxNode, "XCSJ"));
        String xzqmc = "";
        String xzqdms = "";
        //行政区
        List<Node> xzqNodeList = getNodeList(ajjxxNode, "XZQ/Item");
        for (Node xzqNode : xzqNodeList) {
            CatXzq catXzq = new CatXzq();
            catXzq.setAjId(ajjxxId);
            String xzqdm = getNodeText(xzqNode, "XZQDM");
            if (!"".equals(xzqdm)) {
                xzqdms += xzqdm + ",";
            }
            catXzq.setXzqdm(xzqdm);
            catXzq.setGb(getNodeText(xzqNode, "XZQMC/GB").replaceAll("\\s+", ""));
            String sj = getNodeText(xzqNode, "XZQMC/SJ").replaceAll("\\s+", "");
            ;
            if (!"".equals(sj)) {
                xzqmc += sj;
            }
            catXzq.setSj(sj);
            String dj = getNodeText(xzqNode, "XZQMC/DJ").replaceAll("\\s+", "");
            ;
            if (!"".equals(dj)) {
                xzqmc += " " + dj;
            }
            catXzq.setDj(dj);
            String xj = getNodeText(xzqNode, "XZQMC/XJ").replaceAll("\\s+", "");
            ;
            if (!"".equals(xj)) {
                xzqmc += " " + xj;
            }
            catXzq.setXj(xj);
            catXzqService.saveOrUpdate(catXzq);
            xzqmc += ",";
        }
        if (!"".equals(xzqmc)) {
            catAjjxx.setXzqmc(xzqmc.substring(0, xzqmc.length() - 1));
        }
        if (!"".equals(xzqdms)) {
            catAjjxx.setXzqdm(xzqdms.substring(0, xzqdms.length() - 1));
        }
        catAjjxx.setDlzbx(getNodeText(ajjxxNode, "DLZBX"));
        //工作区范围
        List<Node> gzqfwNodeList = getNodeList(ajjxxNode, "GZQFW/Item");
        if (gzqfwNodeList.size() > 0) {
            ObjectMapper mapper = new ObjectMapper();
            ObjectNode root = mapper.createObjectNode();
            ArrayNode addresses = mapper.createArrayNode();
            for (int i = 0; i < gzqfwNodeList.size(); i++) {
                Node gzqfwNode = gzqfwNodeList.get(i);
                if (i == 0) {
                    catAjjxx.setQsjdFx(getNodeText(gzqfwNode, "SZZB/QSJD/FX"));
                    catAjjxx.setQsjdDu(getNodeText(gzqfwNode, "SZZB/QSJD/DU"));
                    catAjjxx.setQsjdFen(getNodeText(gzqfwNode, "SZZB/QSJD/FEN"));
                    catAjjxx.setQsjdMiao(getNodeText(gzqfwNode, "SZZB/QSJD/MIAO"));
                    catAjjxx.setZzjdFx(getNodeText(gzqfwNode, "SZZB/ZZJD/FX"));
                    catAjjxx.setZzjdDu(getNodeText(gzqfwNode, "SZZB/ZZJD/DU"));
                    catAjjxx.setZzjdFen(getNodeText(gzqfwNode, "SZZB/ZZJD/FEN"));
                    catAjjxx.setZzjdMiao(getNodeText(gzqfwNode, "SZZB/ZZJD/MIAO"));
                    catAjjxx.setQswdFx(getNodeText(gzqfwNode, "SZZB/QSWD/FX"));
                    catAjjxx.setQswdDu(getNodeText(gzqfwNode, "SZZB/QSWD/DU"));
                    catAjjxx.setQswdFen(getNodeText(gzqfwNode, "SZZB/QSWD/FEN"));
                    catAjjxx.setQswdMiao(getNodeText(gzqfwNode, "SZZB/QSWD/MIAO"));
                    catAjjxx.setZzwdFx(getNodeText(gzqfwNode, "SZZB/ZZWD/FX"));
                    catAjjxx.setZzwdDu(getNodeText(gzqfwNode, "SZZB/ZZWD/DU"));
                    catAjjxx.setZzwdFen(getNodeText(gzqfwNode, "SZZB/ZZWD/FEN"));
                    catAjjxx.setZzwdMiao(getNodeText(gzqfwNode, "SZZB/ZZWD/MIAO"));
                    catAjjxx.setGdzb(getNodeText(gzqfwNode, "GDZB"));
                } else {
                    String qsjdFx = getNodeText(gzqfwNode, "SZZB/QSJD/FX");
                    String qsjdDu = getNodeText(gzqfwNode, "SZZB/QSJD/DU");
                    String qsjdFen = getNodeText(gzqfwNode, "SZZB/QSJD/FEN");
                    String qsjdMiao = getNodeText(gzqfwNode, "SZZB/QSJD/MIAO");
                    String zzjdFx = getNodeText(gzqfwNode, "SZZB/ZZJD/FX");
                    String zzjdDu = getNodeText(gzqfwNode, "SZZB/ZZJD/DU");
                    String zzjdFen = getNodeText(gzqfwNode, "SZZB/ZZJD/FEN");
                    String zzjdMiao = getNodeText(gzqfwNode, "SZZB/ZZJD/MIAO");
                    String qswdFx = getNodeText(gzqfwNode, "SZZB/QSWD/FX");
                    String qswdDu = getNodeText(gzqfwNode, "SZZB/QSWD/DU");
                    String qswdFen = getNodeText(gzqfwNode, "SZZB/QSWD/FEN");
                    String qswdMiao = getNodeText(gzqfwNode, "SZZB/QSWD/MIAO");
                    String zzwdFx = getNodeText(gzqfwNode, "SZZB/ZZWD/FX");
                    String zzwdDu = getNodeText(gzqfwNode, "SZZB/ZZWD/DU");
                    String zzwdFen = getNodeText(gzqfwNode, "SZZB/ZZWD/FEN");
                    String zzwdMiao = getNodeText(gzqfwNode, "SZZB/ZZWD/MIAO");
                    String gdzb = getNodeText(gzqfwNode, "GDZB");
//                    CatDlwzxx catDlwzxx = new CatDlwzxx();
//                    catDlwzxx.setAjId(ajjxxId);
//                    catDlwzxx.setQsjdFx(qsjdFx);
//                    catDlwzxx.setQsjdDu(qsjdDu);
//                    catDlwzxx.setQsjdFen(qsjdFen);
//                    catDlwzxx.setQsjdMiao(qsjdMiao);
//                    catDlwzxx.setZzjdFx(zzjdFx);
//                    catDlwzxx.setZzjdDu(zzjdDu);
//                    catDlwzxx.setZzjdFen(zzjdFen);
//                    catDlwzxx.setZzjdMiao(zzjdMiao);
//                    catDlwzxx.setQswdFx(qswdFx);
//                    catDlwzxx.setQswdDu(qswdDu);
//                    catDlwzxx.setQswdFen(qswdFen);
//                    catDlwzxx.setQswdMiao(qswdMiao);
//                    catDlwzxx.setZzwdFx(zzwdFx);
//                    catDlwzxx.setZzwdDu(zzwdDu);
//                    catDlwzxx.setZzwdFen(zzwdFen);
//                    catDlwzxx.setZzwdMiao(zzwdMiao);
//                    catDlwzxx.setGdzb(gdzb);
//                    catDlwzxxService.saveOrUpdate(catDlwzxx);
                    ObjectNode address = mapper.createObjectNode();
                    address.put("qsjd", qsjdFx);
                    address.put("qsjd_d", qsjdDu);
                    address.put("qsjd_f", qsjdFen);
                    address.put("qsjd_m", qsjdMiao);
                    address.put("zzjd", zzjdFx);
                    address.put("zzjd_d", zzjdDu);
                    address.put("zzjd_f", zzjdFen);
                    address.put("zzjd_m", zzjdMiao);
                    address.put("qswd", qswdFx);
                    address.put("qswd_d", qswdDu);
                    address.put("qswd_f", qswdFen);
                    address.put("qswd_m", qswdMiao);
                    address.put("zzwd", zzwdFx);
                    address.put("zzwd_d", zzwdDu);
                    address.put("zzwd_f", zzwdFen);
                    address.put("zzwd_m", zzwdMiao);
                    address.put("gdzb", gdzb);
                    addresses.add(address);
                }
            }
            if (addresses.size() > 0) {
                root.put("coordinate", addresses);
                String jsonString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(root);
                catAjjxx.setDlwzs(jsonString);
            }
        } else {
            catAjjxx.setQsjdFx(getNodeText(ajjxxNode, "GZQFW/SZZB/QSJD/FX"));
            catAjjxx.setQsjdDu(getNodeText(ajjxxNode, "GZQFW/SZZB/QSJD/DU"));
            catAjjxx.setQsjdFen(getNodeText(ajjxxNode, "GZQFW/SZZB/QSJD/FEN"));
            catAjjxx.setQsjdMiao(getNodeText(ajjxxNode, "GZQFW/SZZB/QSJD/MIAO"));
            catAjjxx.setZzjdFx(getNodeText(ajjxxNode, "GZQFW/SZZB/ZZJD/FX"));
            catAjjxx.setZzjdDu(getNodeText(ajjxxNode, "GZQFW/SZZB/ZZJD/DU"));
            catAjjxx.setZzjdFen(getNodeText(ajjxxNode, "GZQFW/SZZB/ZZJD/FEN"));
            catAjjxx.setZzjdMiao(getNodeText(ajjxxNode, "GZQFW/SZZB/ZZJD/MIAO"));
            catAjjxx.setQsjdFx(getNodeText(ajjxxNode, "GZQFW/SZZB/QSWD/FX"));
            catAjjxx.setQsjdDu(getNodeText(ajjxxNode, "GZQFW/SZZB/QSWD/DU"));
            catAjjxx.setQsjdFen(getNodeText(ajjxxNode, "GZQFW/SZZB/QSWD/FEN"));
            catAjjxx.setQsjdMiao(getNodeText(ajjxxNode, "GZQFW/SZZB/QSWD/MIAO"));
            catAjjxx.setZzwdFx(getNodeText(ajjxxNode, "GZQFW/SZZB/ZZWD/FX"));
            catAjjxx.setZzwdDu(getNodeText(ajjxxNode, "GZQFW/SZZB/ZZWD/DU"));
            catAjjxx.setZzwdFen(getNodeText(ajjxxNode, "GZQFW/SZZB/ZZWD/FEN"));
            catAjjxx.setZzwdMiao(getNodeText(ajjxxNode, "GZQFW/SZZB/ZZWD/MIAO"));
        }
        String yz = "[";
        List<Node> yzNodeList = getNodeList(ajjxxNode, "YZ/Item");
        for (Node yzNode : yzNodeList) {
            String nodeText = yzNode.getText();
            if (nodeText != null && !"".equals(nodeText)) {
                yz += nodeText + ",";
            }
        }
        if (!"".equals(yz)) {
            yz = yz.substring(0, yz.length() - 1) + "]";
            catAjjxx.setYz(yz);
        }
        //矿产
        List<Node> kcNodeList = getNodeList(ajjxxNode, "KC/Item");
        String kcmcs = "";
        for (Node kcNode : kcNodeList) {
            CatKc catKc = new CatKc();
            catKc.setAjId(ajjxxId);
            String kcdm = getNodeText(kcNode, "KCDM");
            catKc.setKcdm(kcdm);
            String kcmc = getNodeText(kcNode, "KCMC");
            catKc.setKcmc(kcmc);
            if (!"".equals(kcdm) && !"".equals(kcmc)) {
                kcmcs += kcdm + "-" + kcmc + ",";
            }
            catKcService.saveOrUpdate(catKc);
        }
        if (!"".equals(kcmcs)) {
            catAjjxx.setKcmc(kcmcs.substring(0, kcmcs.length() - 1));
        }
        catAjjxx.setZllb(getNodeText(ajjxxNode, "ZLLB/ZLLBMC"));
        String yj = getNodeText(ajjxxNode, "ZLLB/ZLLBMC/YJ");
        String ej = getNodeText(ajjxxNode, "ZLLB/ZLLBMC/EJ");
        String sj = getNodeText(ajjxxNode, "ZLLB/ZLLBMC/SJ");
        if (sj != null && !"".equals(sj)) {
            catAjjxx.setZllb(sj);
        } else if (ej != null && !"".equals(ej)) {
            catAjjxx.setZllb(ej);
        } else if (yj != null && !"".equals(yj)) {
            catAjjxx.setZllb(yj);
        }
        String gzcd = getNodeText(ajjxxNode, "GZCD");
        gzcd = gzcd.replaceAll("/", ":").replaceAll("万", "0000");
        catAjjxx.setGzcd(gzcd);
        catAjjxx.setQtgzcd(getNodeText(ajjxxNode, "QTGZCD"));
        String gzff = "";
        List<Node> gzffNodeList = getNodeList(ajjxxNode, "GZFF/Item");
        for (Node gzffNode : gzffNodeList) {
            String gzffYJ = getNodeText(gzffNode, "YJ").replaceAll("\\s+", "");
            String gzffEJ = getNodeText(gzffNode, "EJ").replaceAll("\\s+", "");
            if (gzffEJ != null && !"".equals(gzffEJ)) {
                gzff += gzffEJ + ",";
            }
            if (gzffYJ != null && !"".equals(gzffYJ)) {
                gzff += gzffYJ + ",";
            }
        }
        if (!"".equals(gzff)) {
            gzff = gzff.substring(0, gzff.length() - 1);
            catAjjxx.setGzff(gzff);
        }
        String gjz = "";
        List<Node> gjzNodeList = getNodeList(ajjxxNode, "GJZ/Item");
        for (Node gjzNode : gjzNodeList) {
            String nodeText = gjzNode.getText();
            if (nodeText != null && !"".equals(nodeText)) {
                gjz += nodeText + ",";
            }
        }
        if (!"".equals(gjz)) {
            gjz = gjz.substring(0, gjz.length() - 1);
            catAjjxx.setGjz(gjz);
        }
        catAjjxx.setNrzy(getNodeText(ajjxxNode, "ZY"));
        catAjjxx.setYdzwjgsjbb(getNodeText(ajjxxNode, "YDZWJGSJBB"));
        catAjjxx.setYjhj(getNodeText(ajjxxNode, "YJHJ"));
        catAjjxx.setRjhj(getNodeText(ajjxxNode, "RJHJ"));
        catAjjxx.setTjxtkzktysm(getNodeText(ajjxxNode, "TJXTKZKTYSM"));
        catAjjxx.setQtsm(getNodeText(ajjxxNode, "QTSM"));
        catAjjxx.setBz(getNodeText(ajjxxNode, "BZ"));
        catAjjxx.setHjrmc(getNodeText(ajjxxNode, "HJR/HJRMC"));
        catAjjxx.setHjrdz(getNodeText(ajjxxNode, "HJR/HJRTXDZ"));
        catAjjxx.setHjryb(getNodeText(ajjxxNode, "HJR/HJRYB"));
        catAjjxx.setHjrtyshxydm(getNodeText(ajjxxNode, "HJR/HJRTYSHXYDM"));
        catAjjxx.setHjrlxr(getNodeText(ajjxxNode, "HJR/HJRLXR"));
        catAjjxx.setHjrlxfs(getNodeText(ajjxxNode, "HJR/HJRDH"));
        catAjjxx.setHjrdzyx(getNodeText(ajjxxNode, "HJR/HJRDZYX"));
        String bhq = getNodeText(ajjxxNode, "BHQ");
        catAjjxx.setBhq(bhq);
        if (bhq != null && !"".equals(bhq)) {
            catAjjxx.setSfbh("是");
        } else {
            catAjjxx.setSfbh("否");
        }
        catAjjxx.setSmqk(getNodeText(ajjxxNode, "SMQK"));
        String nodeText = getNodeText(ajjxxNode, "MJ");
        if ("不涉密".equals(nodeText)) {
            catAjjxx.setMjdm("0");
        } else if ("内部".equals(nodeText)) {
            catAjjxx.setMjdm("1");
        } else if ("秘密".equals(nodeText)) {
            catAjjxx.setMjdm("2");
        } else if ("机密".equals(nodeText)) {
            catAjjxx.setMjdm("3");
        } else if ("绝密".equals(nodeText)) {
            catAjjxx.setMjdm("4");
        }
        catAjjxx.setMj(nodeText);
        catAjjxx.setJsrq(stringToDate(getNodeText(ajjxxNode, "JSRQ")));
        catAjjxx.setJsdwmc(getNodeText(ajjxxNode, "JSDW/JSDWMC"));
        catAjjxx.setBgdwmc(getNodeText(ajjxxNode, "BGDW/Item/BGDWMC"));
        catAjjxx.setHjpzh(getNodeText(ajjxxNode, "HJPZH"));
        catAjjxx.setFzrq(stringToDate(getNodeText(ajjxxNode, "FZRQ")));
        catAjjxx.setFbrq(stringToDate(getNodeText(ajjxxNode, "FBRQ")));
        catAjjxx.setBzsdh(getNodeText(ajjxxNode, "BZSDH"));
        catAjjxx.setZlly(getNodeText(ajjxxNode, "ZLLY"));
        catAjjxx.setHjzsdw(getNodeText(ajjxxNode, "HJZSDW"));
        //成果数量信息CGZLSJL
        catAjjxx.setCgzldzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/CGZLDZJS")));
        catAjjxx.setCgzlsjl(stringToDouble(getNodeText(ajjxxNode, "SLXX/CGSLXX/CGZLSJL")));
        catAjjxx.setCgzldzwjzs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/CGZLDZWJZS")));
        catAjjxx.setCgzldzwjjzs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/CGZLDZWJJZS")));
        catAjjxx.setCgzlzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/CGZLZZJS")));
        catAjjxx.setZwdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/ZWDZJS")));
        catAjjxx.setSpdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/SPDZJS")));
        catAjjxx.setFtdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/FTDZJS")));
        catAjjxx.setFbdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/FBDZJS")));
        catAjjxx.setFjdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/FJDZJS")));
        catAjjxx.setRjdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/RJDZJS")));
        catAjjxx.setSjkdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/SJKDZJS")));
        catAjjxx.setDmtdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/DMTDZJS")));
        catAjjxx.setQtdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/QTDZJS")));
        catAjjxx.setZwydzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/ZWYDZJS"));
        catAjjxx.setSpydzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/SPYDZJS"));
        catAjjxx.setFtydzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/FTYDZJS"));
        catAjjxx.setFbydzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/FBYDZJS"));
        catAjjxx.setFjydzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/FJYDZJS"));
        catAjjxx.setRjydzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/RJYDZJS"));
        catAjjxx.setSjkydzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/SJKYDZJS"));
        catAjjxx.setDmtydzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/DMTYDZJS"));
        catAjjxx.setQtydzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/QTYDZJS"));
        catAjjxx.setZwcddzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/ZWCDDZJS"));
        catAjjxx.setSpcddzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/SPCDDZJS"));
        catAjjxx.setFtcddzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/FTCDDZJS"));
        catAjjxx.setFbcddzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/FBCDDZJS"));
        catAjjxx.setFjcddzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/FJCDDZJS"));
        catAjjxx.setRjcddzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/RJCDDZJS"));
        catAjjxx.setSjkcddzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/SJKCDDZJS"));
        catAjjxx.setDmtcddzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/DMTCDDZJS"));
        catAjjxx.setQtcddzjs(getNodeText(ajjxxNode, "SLXX/CGSLXX/QTCDDZJS"));
        catAjjxx.setZwzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/ZWZZJS")));
        catAjjxx.setSpzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/SPZZJS")));
        catAjjxx.setFtzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/FTZZJS")));
        catAjjxx.setFbzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/FBZZJS")));
        catAjjxx.setFjzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/FJZZJS")));
        catAjjxx.setQtzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/CGSLXX/QTZZJS")));
        //原始数量信息
        catAjjxx.setYszldzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/YSZLDZJS")));
        catAjjxx.setYszlsjl(stringToDouble(getNodeText(ajjxxNode, "SLXX/YSSLXX/YSZLSJL")));
        catAjjxx.setYszldzwjzs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/YSZLDZWJZS")));
        catAjjxx.setYszldzwjjzs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/YSZLDZWJJZS")));
        catAjjxx.setYszlzzjs(getNodeText(ajjxxNode, "SLXX/YSSLXX/YSZLZZJS"));
        catAjjxx.setDzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/DZZJS")));
        catAjjxx.setCzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/CZZJS")));
        catAjjxx.setGzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/GZZJS")));
        catAjjxx.setTzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/TZZJS")));
        catAjjxx.setYzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/YZZJS")));
        catAjjxx.setSzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/SZZJS")));
        catAjjxx.setLzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/LZZJS")));
        catAjjxx.setXzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/XZZJS")));
        catAjjxx.setZzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/ZZZJS")));
        catAjjxx.setWzzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/WZZJS")));
        catAjjxx.setDdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/DDZJS")));
        catAjjxx.setCdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/CDZJS")));
        catAjjxx.setGdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/GDZJS")));
        catAjjxx.setTdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/TDZJS")));
        catAjjxx.setYdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/YDZJS")));
        catAjjxx.setSdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/SDZJS")));
        catAjjxx.setLdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/LDZJS")));
        catAjjxx.setXdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/XDZJS")));
        catAjjxx.setZdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/ZDZJS")));
        catAjjxx.setWdzjs(stringToInteger(getNodeText(ajjxxNode, "SLXX/YSSLXX/WDZJS")));
        //实物汇总数量信息
        catAjjxx.setDdgzwz(getNodeText(ajjxxNode, "SWHZXX/DDGZWZ"));
        catAjjxx.setCkd(getNodeText(ajjxxNode, "SWHZXX/CKD"));
        catAjjxx.setZykz(getNodeText(ajjxxNode, "SWHZXX/ZYKZ"));
        catAjjxx.setCylx(getNodeText(ajjxxNode, "SWHZXX/CYLX"));
        catAjjxx.setCksd(getNodeText(ajjxxNode, "SWHZXX/CKSD"));
        catAjjxx.setZycgjs(getNodeText(ajjxxNode, "SWHZXX/ZYCGJS"));
        catAjjxx.setSwbz(getNodeText(ajjxxNode, "SWHZXX/BZ"));
        catAjjxx.setZksl(stringToInteger(getNodeText(ajjxxNode, "SWHZXX/ZKSL")));
        catAjjxx.setZjc(stringToDouble(getNodeText(ajjxxNode, "SWHZXX/ZJC")));
        catAjjxx.setYxzsl(stringToDouble(getNodeText(ajjxxNode, "SWHZXX/YXZSL")));
        catAjjxx.setYxizsl(stringToInteger(getNodeText(ajjxxNode, "SWHZXX/YXIZSL")));
        catAjjxx.setBbzsl(stringToInteger(getNodeText(ajjxxNode, "SWHZXX/BBZSL")));
        catAjjxx.setYpzsl(stringToInteger(getNodeText(ajjxxNode, "SWHZXX/YPZSL")));
        catAjjxx.setGpzsl(stringToInteger(getNodeText(ajjxxNode, "SWHZXX/GPZSL")));
        catAjjxx.setBpzsl(stringToInteger(getNodeText(ajjxxNode, "SWHZXX/BPZSL")));
        catAjjxx.setQtswmc(getNodeText(ajjxxNode, "SWHZXX/QTZSL/QTSWMC"));
        catAjjxx.setQtswsl(getNodeText(ajjxxNode, "SWHZXX/QTZSL/QTSWSL"));
//        ArchivesCustomConfig archivesCustomConfig = customConfigUtil.getConfigObj(ArchivesCustomConfig.class);
//        String checkRule = archivesCustomConfig.getCheckRule();
//
//        if (StringUtils.isNotEmpty(checkRule)) {
//            String sql = "select count(*) from CAT_FILE_AJJXX where ";
//            String[] checkRules = checkRule.split("\\|");
//            for (String rule : checkRules) {
//                String camelCaseFieldName = CommonUtil.underscoreToCamelCase(rule);
//                Object fieldValue = CommonUtil.getFieldValue(catAjjxx, camelCaseFieldName);
//                sql += rule + " = '" + fieldValue + "' and ";
//            }
//            sql = sql.substring(0, sql.length() - 4);
//            Integer integer = jdbcTemplate.queryForObject(sql, Integer.class);
//            if (integer > 0) {
//                throw new RuntimeException("数据重复");
//            }
//        }
        catAjjxxService.saveOrUpdate(catAjjxx);
        Node wjjxxNode = getNode(document, "WJJXX");
        List<Node> cgwjjxxNodeList = getNodeList(wjjxxNode, "CGWJJXX/CGWJXX");
        //成果文件级信息
        for (Node cgwjjxxNode : cgwjjxxNodeList) {
            String cgwjmc = getNodeText(cgwjjxxNode, "WJLB");
            //成果文件册
            List<Node> nodeList = getNodeList(cgwjjxxNode, "CGWJC");
            for (Node cgwjcNode : nodeList) {
                Integer cxh = stringToInteger(getNodeText(cgwjcNode, "CXH"));
                List<Node> cgwjNodeList = getNodeList(cgwjcNode, "CGWJ");
                for (Node cgwjNode : cgwjNodeList) {
                    Long catCgwjxxId = IdGenerater.getId();
                    CatCgwjxx catCgwjxx = new CatCgwjxx();
                    String fileType = getFileType(cgwjmc);
                    catCgwjxx.setWjlx(fileType);
                    catCgwjxx.setAjId(catAjjxx.getId());
                    catCgwjxx.setId(catCgwjxxId);
                    catCgwjxx.setCh(cxh);
                    String wjm = getNodeText(cgwjNode, "WJM");
                    catCgwjxx.setWjm(wjm);
                    if (wjm.length() >= 5) {
                        catCgwjxx.setJh(stringToInteger(wjm.substring(4)));
                    }
                    catCgwjxx.setWjtm(getNodeText(cgwjNode, "WJTM"));
                    catCgwjxx.setJm(getNodeText(cgwjNode, "JM"));
                    String ydzwjm = getNodeText(cgwjNode, "YDZWJM");
                    catCgwjxx.setYdzwjm(ydzwjm);
                    catCgwjxx.setYdzwjlb(getNodeText(cgwjNode, "YDZWJLB"));
                    catCgwjxx.setYdzwjlj(getNodeText(cgwjNode, "YDZWJLJ"));
                    catCgwjxx.setYdzwjdx(stringToDouble(getNodeText(cgwjNode, "YDZWJDX")));
                    catCgwjxx.setYdzfjwjmc(getNodeText(cgwjNode, "YDZFJWJMC"));
                    catCgwjxx.setYdzfjwjlb(getNodeText(cgwjNode, "YDZFJWJLB"));
                    String ydzfjwjlj = getNodeText(cgwjNode, "YDZFJWJLJ");
                    catCgwjxx.setYdzfjwjlj(ydzfjwjlj);
                    catCgwjxx.setYdzfjwjdx(getNodeText(cgwjNode, "YDZFJWJDX"));
                    catCgwjxx.setYdzwjs(getNodeText(cgwjNode, "YDZWJS"));
                    catCgwjxx.setYdzwjjs(getNodeText(cgwjNode, "YDZWJJS"));
                    //读取源电子文件格式
                    catCgwjxx.setYdzwjgs(getNodeText(cgwjNode, "WJGSXX/YDZWJGSXX/WJGS"));
                    catCgwjxx.setYdzwjgssm(getNodeText(cgwjNode, "WJGSXX/YDZWJGSXX/WJGSSM"));
                    catCgwjxx.setCddzwjm(getNodeText(cgwjNode, "CDDZWJM"));
                    catCgwjxx.setCddzwjlb(getNodeText(cgwjNode, "CDDZWJLB"));
                    catCgwjxx.setCddzwjlj(getNodeText(cgwjNode, "CDDZWJLJ"));
                    catCgwjxx.setCddzwjdx(stringToDouble(getNodeText(cgwjNode, "CDDZWJDX")));
                    catCgwjxx.setCddzwjs(getNodeText(cgwjNode, "CDDZWJS"));
                    catCgwjxx.setCddzwjjs(getNodeText(cgwjNode, "CDDZWJJS"));
                    //读取存档电子文件格式
                    catCgwjxx.setCddzwjgs(getNodeText(cgwjNode, "WJGSXX/CDDZWJGSXX/WJGS"));
                    catCgwjxx.setCddzwjgssm(getNodeText(cgwjNode, "WJGSXX/CDDZWJGSXX/WJGSSM"));
                    catCgwjxx.setZtxs(getNodeText(cgwjNode, "ZTXS"));
                    catCgwjxx.setXcr(getNodeText(cgwjNode, "XCR/Item"));
                    catCgwjxx.setXcdwmc(getNodeText(cgwjNode, "XCDWMC/Item"));
//                    catCgwjxx.setXcsj(stringToDate(getNodeText(cgwjNode, "XCSJ")));
                    catCgwjxx.setXcsj(getNodeText(cgwjNode, "XCSJ"));
                    catCgwjxx.setTh(getNodeText(cgwjNode, "TH"));
                    catCgwjxx.setFthxblc(getNodeText(cgwjNode, "BLC/FTHXBLC"));
                    catCgwjxx.setFtzxblc(getNodeText(cgwjNode, "BLC/FTZXBLC"));
                    catCgwjxx.setFtgg(getNodeText(cgwjNode, "FTGG"));
                    catCgwjxx.setQzy(getNodeText(cgwjNode, "QZY"));
                    catCgwjxx.setBz(getNodeText(cgwjNode, "BZ"));
                    //涉密信息
                    List<Node> smxxNodeList = getNodeList(cgwjNode, "SMXX/Item");
                    ObjectMapper mapper = new ObjectMapper();
                    ObjectNode root = mapper.createObjectNode();
                    ArrayNode addresses = mapper.createArrayNode();
                    if (smxxNodeList.size() > 0) {
                        catCgwjxx.setSfsm("是");
                    } else {
                        catCgwjxx.setSfsm("否");
                    }
                    for (int i = 0; i < smxxNodeList.size(); i++) {
                        Node smxxNode = smxxNodeList.get(i);
                        if (i == 0) {
                            catCgwjxx.setSmym(getNodeText(smxxNode, "SMNR"));
                            catCgwjxx.setSmzl(getNodeText(smxxNode, "SMZL"));
                            catCgwjxx.setSmsx(getNodeText(smxxNode, "SMSX"));
                            catCgwjxx.setWjmj(getNodeText(smxxNode, "WJMJ"));
                            Integer securityCode = getSecurityCode(getNodeText(smxxNode, "WJMJ"));
                            catCgwjxx.setSecurityCode(securityCode);
                            catCgwjxx.setBmqx(getNodeText(smxxNode, "BMQX"));
                            catCgwjxx.setZxfw(getNodeText(smxxNode, "ZXFW"));
                        } else {
                            String smnr = getNodeText(smxxNode, "SMNR");
                            String smzl = getNodeText(smxxNode, "SMZL");
                            String smsx = getNodeText(smxxNode, "SMSX");
                            String wjmj = getNodeText(smxxNode, "WJMJ");
                            String bmqx = getNodeText(smxxNode, "BMQX");
                            String zxfw = getNodeText(smxxNode, "ZXFW");
                            CatSmxx catSmxx = new CatSmxx();
                            catSmxx.setAjId(ajjxxId);
                            catSmxx.setWjId(catCgwjxxId);
                            catSmxx.setSmnr(smnr);
                            catSmxx.setSmzl(smzl);
                            catSmxx.setSmsx(smsx);
                            catSmxx.setWjmj(wjmj);
                            catSmxx.setBmqx(bmqx);
//                            catSmxx.setZxfw(zxfw);
                            catSmxxService.saveOrUpdate(catSmxx);
                            //{"classified":[{"mj":"内部","smym":"11","smsx":"22","bmqx":"33","zxfw":"34","smzl":""}]}
                            ObjectNode address = mapper.createObjectNode();
                            address.put("mj", wjmj);
                            address.put("smym", smnr);
                            address.put("smsx", smsx);
                            address.put("bmqx", bmqx);
                            address.put("zxfw", zxfw);
                            address.put("smzl", smzl);
                            addresses.add(address);
                        }
                    }
                    root.put("classified", addresses);
                    String jsonString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(root);
                    catCgwjxx.setSmxx(jsonString);
                    catCgwjxxService.saveOrUpdate(catCgwjxx);
                }
            }
        }
        //  原始文件级信息
//        List<Node> yswjxxNodeList = getNodeList(wjjxxNode, "YSWJJXX/YSWJXX");
//        for (Node yswjxxNode : yswjxxNodeList) {
//            String cgwjmc = getNodeText(yswjxxNode, "WJLB");
//            //原始文件
//            List<Node> yswjNodeList = getNodeList(yswjxxNode, "YSWJ");
//            for (int i = 0; i < yswjNodeList.size(); i++) {
//                Node yswjNode = yswjNodeList.get(i);
//                Long catYswjxxId = IdGenerater.getId();
//                CatYswjxx catYswjxx = new CatYswjxx();
//                catYswjxx.setWjlx(cgwjmc);
//                catYswjxx.setAjId(ajjxxId);
//                catYswjxx.setId(catYswjxxId);
//                catYswjxx.setWjm(getNodeText(yswjNode, "WJM"));
//
//                catYswjxx.setXh(Integer.toString(i + 1));
//                catYswjxx.setWjtm(getNodeText(yswjNode, "WJTM"));
//                catYswjxx.setWjdx(getNodeText(yswjNode, "WJDX"));
//                catYswjxx.setWjlb(getNodeText(yswjNode, "WJLB"));
//                catYswjxx.setWjlj(getNodeText(yswjNode, "WJLJ"));
//
//                //读取文件格式
//                catYswjxx.setWjgs(getNodeText(yswjNode, "WJGSXX/WJGS"));
//                catYswjxx.setWjgssm(getNodeText(yswjNode, "WJGSXX/WJGSSM"));
//
//                catYswjxx.setZtxs(getNodeText(yswjNode, "ZTXS"));
////                catYswjxx.setGdztxs(getNodeText(yswjNode, "GDZTXS"));
//                catYswjxx.setXcr(getNodeText(yswjNode, "XCR/Item"));
//                catYswjxx.setXcdwmc(getNodeText(yswjNode, "XCDWMC/Item"));
//                catYswjxx.setXcsj(getNodeText(yswjNode, "XCSJ"));
//                catYswjxx.setSfhj(getNodeText(yswjNode, "SFHJ"));
//                catYswjxx.setQzy(getNodeText(yswjNode, "QZY"));
//                catYswjxx.setFthxblc(getNodeText(yswjNode, "FTHXBLC"));
//                catYswjxx.setFtzxblc(getNodeText(yswjNode, "FTZXBLC"));
//                catYswjxx.setBz(getNodeText(yswjNode, "BZ"));
//
//
//                catYswjxx.setFthxblc(getNodeText(yswjNode, "BLC/FTHXBLC"));
//                catYswjxx.setFtzxblc(getNodeText(yswjNode, "BLC/FTZXBLC"));
//
//                //涉密信息
//                List<Node> smxxNodeList = getNodeList(yswjNode, "SMXX/Item");
//                ObjectMapper mapper = new ObjectMapper();
//                ObjectNode root = mapper.createObjectNode();
//                ArrayNode addresses = mapper.createArrayNode();
//                if (smxxNodeList.size() > 0) {
//                    catYswjxx.setSfsm("是");
//                } else {
//                    catYswjxx.setSfsm("否");
//                }
//                for (int j = 0; j < smxxNodeList.size(); j++) {
//                    Node smxxNode = smxxNodeList.get(j);
//                    if (j == 0) {
//                        catYswjxx.setSmym(getNodeText(smxxNode, "SMNR"));
//                        catYswjxx.setSmzl(getNodeText(smxxNode, "SMZL"));
//                        catYswjxx.setSmsx(getNodeText(smxxNode, "SMSX"));
//                        catYswjxx.setWjmj(getNodeText(smxxNode, "WJMJ"));
//                        Integer securityCode = getSecurityCode(getNodeText(smxxNode, "WJMJ"));
//                        catYswjxx.setSecurityCode(securityCode);
//                        catYswjxx.setBmqx(getNodeText(smxxNode, "BMQX"));
//                        catYswjxx.setZxfw(getNodeText(smxxNode, "ZXFW"));
//                    } else {
//
//                        String smnr = getNodeText(smxxNode, "SMNR");
//                        String smzl = getNodeText(smxxNode, "SMZL");
//                        String smsx = getNodeText(smxxNode, "SMSX");
//                        String wjmj = getNodeText(smxxNode, "WJMJ");
//                        String bmqx = getNodeText(smxxNode, "BMQX");
//                        String zxfw = getNodeText(smxxNode, "ZXFW");
//
//                        CatSmxx catSmxx = new CatSmxx();
//                        catSmxx.setAjId(ajjxxId);
//                        catSmxx.setWjId(catYswjxxId);
//                        catSmxx.setSmnr(smnr);
//                        catSmxx.setSmzl(smzl);
//                        catSmxx.setSmsx(smsx);
//                        catSmxx.setWjmj(wjmj);
//                        catSmxx.setBmqx(bmqx);
////                        catSmxx.setZxfw(zxfw);
//                        catSmxxService.saveOrUpdate(catSmxx);
//
//                        //{"classified":[{"mj":"内部","smym":"11","smsx":"22","bmqx":"33","zxfw":"34","smzl":""}]}
//                        ObjectNode address = mapper.createObjectNode();
//                        address.put("mj", wjmj);
//                        address.put("smym", smnr);
//                        address.put("smsx", smsx);
//                        address.put("bmqx", bmqx);
//                        address.put("zxfw", zxfw);
//                        address.put("smzl", smzl);
//                        addresses.add(address);
//                    }
//                }
//                root.put("classified", addresses);
//                String jsonString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(root);
//                catYswjxx.setSmxx(jsonString);
//                catYswjxxService.saveOrUpdate(catYswjxx);
//            }
//        }
//        //实物钻孔信息
//        Node swqdxxNode = getNode(document, "SWQDXX");
//        List<Node> zkxxNodeList = getNodeList(swqdxxNode, "ZKXX/Item");
//        for (int i = 0; i < zkxxNodeList.size(); i++) {
//            Node zkxxNode = zkxxNodeList.get(i);
//            CatZkxx catZkxx = new CatZkxx();
//            catZkxx.setAjId(ajjxxId);
//            catZkxx.setXh(getNodeText(zkxxNode, "XH"));
//            catZkxx.setZkmc(getNodeText(zkxxNode, "ZKMC"));
//            catZkxx.setZkjd(getNodeText(zkxxNode, "ZKJD"));
//            catZkxx.setZkwd(getNodeText(zkxxNode, "ZKWD"));
//            catZkxx.setZjc(getNodeText(zkxxNode, "ZJC"));
//            catZkxx.setQxsl(getNodeText(zkxxNode, "QXSL"));
//            catZkxx.setYxsl(getNodeText(zkxxNode, "YXSL"));
//            catZkxx.setJksdfw(getNodeText(zkxxNode, "JKSDFW"));
//            catZkxx.setSwzllb(getNodeText(zkxxNode, "SWZLLB"));
//            catZkxx.setTyhjjgm(getNodeText(zkxxNode, "TYHJJGM"));
//            catZkxx.setBz(getNodeText(zkxxNode, "BZ"));
//            catZkxxService.saveOrUpdate(catZkxx);
//        }
//        //实物图幅信息
//        List<Node> tfxxNodeList = getNodeList(swqdxxNode, "TFXX/Item");
//        for (int i = 0; i < tfxxNodeList.size(); i++) {
//            Node tfxxNode = tfxxNodeList.get(i);
//            CatTfxx catTfxx = new CatTfxx();
//            catTfxx.setAjId(ajjxxId);
//            catTfxx.setXh(getNodeText(tfxxNode, "XH"));
//            catTfxx.setTfmc(getNodeText(tfxxNode, "TFMC"));
//            catTfxx.setScpmmc(getNodeText(tfxxNode, "SCPMMC"));
//            catTfxx.setZyfx(getNodeText(tfxxNode, "ZYFX"));
//            catTfxx.setBbsl(getNodeText(tfxxNode, "BBSL"));
//            catTfxx.setYpsl(getNodeText(tfxxNode, "YPSL"));
//            catTfxx.setGpsl(getNodeText(tfxxNode, "GPSL"));
//            catTfxx.setBpsl(getNodeText(tfxxNode, "BPSL"));
//            catTfxx.setSwzllb(getNodeText(tfxxNode, "SWZLLB"));
//            catTfxx.setBz(getNodeText(tfxxNode, "BZ"));
//            catTfxxService.saveOrUpdate(catTfxx);
//        }
    }
}
src/main/java/com/zbooksoft/gdmis/service/impl/XmlServiceImpl.java
New file
@@ -0,0 +1,302 @@
package com.zbooksoft.gdmis.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.ruili.wcp.common.CustomConfigUtil;
import com.ruili.wcp.common.IdGenerater;
import com.ruili.wcp.data.entity.management.User;
import com.ruili.wcp.engine.form.IFormData;
import com.zbooksoft.gdmis.data.entity.*;
import com.zbooksoft.gdmis.service.*;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;
import org.dom4j.Document;
import org.dom4j.Node;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.zbooksoft.gdmis.common.XmlUtil.*;
/**
 * @Description:
 * @Author: zhai
 * @Date: 2024/8/7
 **/
@Service
public class XmlServiceImpl implements XmlService {
    @Autowired
    CatXzqService catXzqService;
    @Autowired
    CatDlwzxxService catDlwzxxService;
    @Autowired
    CatKcService catKcService;
    @Autowired
    CatSmxxService catSmxxService;
    @Autowired
    CatZkxxService catZkxxService;
    @Autowired
    CatTfxxService catTfxxService;
    @Autowired
    CatYswjxxService catYswjxxService;
    @Autowired
    CatCgwjxxService catCgwjxxService;
    @Autowired
    CatAjjxxService catAjjxxService;
    @Autowired
    CatCheckService catCheckService;
    @Autowired
    CustomConfigUtil customConfigUtil;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    IFormData iform;
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void readXml(Document document, String startData, String endData) throws Exception {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("user");
        //案卷级信息
        Node ajjxxNode = getNode(document, "AJJXX");
        Node zlxxNode = getNode(document, "ZLXX");
//        Node bsdNode = getNode(document, "DZZLBSD");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String xmbh = getNodeText(ajjxxNode, "XMBH");
        String xmmc = getNodeText(ajjxxNode, "XMMC");
        Long ajjxxId = 0L;
        QueryWrapper<CatAjjxx> catAjjxxQueryWrapper = new QueryWrapper<>();
        catAjjxxQueryWrapper.eq("XMKYQBH", xmbh);
        catAjjxxQueryWrapper.eq("XMKYQMC", xmmc);
        List<CatAjjxx> list = catAjjxxService.list(catAjjxxQueryWrapper);
        if (list.size() > 0) {
            CatAjjxx catAjjxx = list.get(0);
            ajjxxId = catAjjxx.getId();
        } else {
            CatAjjxx catAjjxx = new CatAjjxx();
            ajjxxId = IdGenerater.getId();
            String sql = "select NVL(max(DH), 0) DH FROM CAT_FILE_AJJXX";
            Map<String, Object> stringObjectMap = jdbcTemplate.queryForMap(sql);
            String dh = stringObjectMap.get("DH").toString();
            if (dh.length() > 4) {
                //取后4位
                dh = dh.substring(dh.length() - 4);
            }
            int maxDH = Integer.parseInt(dh);
            int newDH = maxDH + 1;
            String newDhString = String.format("%04d", newDH);
            catAjjxx.setDh(newDhString);
            catAjjxx.setId(ajjxxId);
            catAjjxx.setDeleteState(0);
            catAjjxx.setSlsj(stringToDate(startData));
            catAjjxx.setYsjzsj(stringToDate(endData));
            catAjjxx.setZlzt(0);
            if (user != null) {
                catAjjxx.setSlr(user.getTrueName());
                catAjjxx.setYsr(user.getTrueName());
            }
            //项目信息XMKYQBH
            catAjjxx.setXmkyqbh(getNodeText(ajjxxNode, "XMBH"));
            catAjjxx.setRwsbh(getNodeText(ajjxxNode, "XMRWSBH"));
            catAjjxx.setXmkyqlx(getNodeText(ajjxxNode, "XMLX"));
            catAjjxx.setXmkyqxz(getNodeText(ajjxxNode, "XMXZ"));
            catAjjxx.setZjly(getNodeText(ajjxxNode, "XMZJLY"));
            catAjjxx.setXmsfzm(getNodeText(ajjxxNode, "XMSFM"));
            //矿业权人
            catAjjxx.setXmkyqmc(getNodeText(ajjxxNode, "XMMC"));
            catAjjxx.setNd(getNodeText(ajjxxNode, "ND"));
            catAjjxx.setNdjf(getNodeText(ajjxxNode, "NDJF"));
            catAjjxx.setQssj(getNodeText(ajjxxNode, "QSSJ"));
            catAjjxx.setZzsj(getNodeText(ajjxxNode, "ZZSJ"));
            catAjjxx.setXmzq(getNodeText(ajjxxNode, "XMZQ"));
            catAjjxx.setXmsx(getNodeText(ajjxxNode, "XMSX"));
            catAjjxx.setSxdw(getNodeText(ajjxxNode, "SXDW"));
            catAjjxx.setSxdw(getNodeText(ajjxxNode, "SXDW"));
            catAjjxx.setXmzt(getNodeText(ajjxxNode, "XMZT"));
            catAjjxx.setXmfzr(getNodeText(ajjxxNode, "XMFZR"));
            catAjjxx.setXmzgjgmc(getNodeText(ajjxxNode, "XMZGJGMC"));
            catAjjxx.setXmfzrjs(getNodeText(ajjxxNode, "XMFZRJS"));
            catAjjxx.setXmfzrhq(getNodeText(ajjxxNode, "XMFFZR"));
            catAjjxx.setXmxxsm(getNodeText(ajjxxNode, "XMXXSM"));
            catAjjxxService.saveOrUpdate(catAjjxx);
        }
        String yjdw = getNodeText(ajjxxNode, "YJDW");
        String yjsj = getNodeText(ajjxxNode, "YJSJ");
        String yjr = getNodeText(ajjxxNode, "YJR");
        String yjrlxfs = getNodeText(ajjxxNode, "YJRLXFS");
        String yjbh = getNodeText(ajjxxNode, "YJBH");
        String cjsj = getNodeText(ajjxxNode, "CJSJ");
        HashMap<String, Object> transferMap = new HashMap<>();
        transferMap.put("TRANSFER_DEPT", yjdw);
        transferMap.put("TRANSFER_TIEM", yjsj);
        transferMap.put("TRANSFER_USER", yjr);
        transferMap.put("USER_NUMBER", yjrlxfs);
        transferMap.put("TRANSFER_NUM", yjbh);
        transferMap.put("CREATE_TIME", cjsj);
        transferMap.put("AJ_ID", ajjxxId);
        Long insertId = iform.insert(1977224563949338625l, transferMap);
        //  原始文件级信息
        List<Node> yswjxxNodeList = getNodeList(zlxxNode, "WJJXX");
        for (Node yswjxxNode : yswjxxNodeList) {
            String wjtm = getNodeText(yswjxxNode, "WJTM");
            HashMap<String, Object> map = new HashMap<>();
            //判断是否存在,存在进行更新,不存在添加
            Long catYswjxxId = IdGenerater.getId();
            String selectSql = " select * from CAT_ITEM_YSWJXX where AJ_ID =" + ajjxxId + " and  WJTM = '" + wjtm + "'";
            List<Map<String, Object>> mapList = jdbcTemplate.queryForList(selectSql);
            if (mapList.size() > 0) {
                Map<String, Object> stringObjectMap = mapList.get(0);
                String yszt = stringObjectMap.get("yszt") == null ? "0" : stringObjectMap.get("yszt").toString();
                if (("3").equals(yszt)) {
                    throw new Exception(wjtm + "资料已被接收,请勿重复导入");
                }
                catYswjxxId = Long.parseLong(stringObjectMap.get("ID").toString());
                Object transferNumber = stringObjectMap.get("TRANSFER_NUMBER");
                int transfer = 1;
                if (transferNumber != null) {
                    transfer = Integer.parseInt(transferNumber.toString());
                }
                map.put("TRANSFER_NUMBER", transfer);
            }
            String cgwjmc = getNodeText(yswjxxNode, "WJLB");
            String jh = getNodeText(yswjxxNode, "JH");
            String jhLast = jh.substring(jh.length() - 1);
            String xcdw = getNodeText(yswjxxNode, "XCDW");
            String xcr = getNodeText(yswjxxNode, "XCR");
            String xcsj = getNodeText(yswjxxNode, "XCSJ");
            String sl = getNodeText(yswjxxNode, "SL");
            String ym = getNodeText(yswjxxNode, "YM");
            String psdw = getNodeText(yswjxxNode, "PSDW");
            String pswh = getNodeText(yswjxxNode, "PSWH");
            String pssj = getNodeText(yswjxxNode, "PSSJ");
            String bxdw = getNodeText(yswjxxNode, "BXDW");
            String bxz = getNodeText(yswjxxNode, "BXZ");
            String zzys = getNodeText(yswjxxNode, "ZZYS");
            String wjdx = getNodeText(yswjxxNode, "WJDX");
            String wjlb = getNodeText(yswjxxNode, "WJLB");
            String wjlj = getNodeText(yswjxxNode, "WJLJ");
            String ztxs = getNodeText(yswjxxNode, "ZTXS");
            String qzy = getNodeText(yswjxxNode, "QZY");
            String hxblc = getNodeText(yswjxxNode, "HXBLC");
            String zxblc = getNodeText(yswjxxNode, "ZXBLC");
            String wjgs = getNodeText(yswjxxNode, "WJGSXX/WJGS");
            String wjgssm = getNodeText(yswjxxNode, "WJGSXX/WJGSSM");
            map.put("ID", catYswjxxId);
            map.put("AJ_ID", ajjxxId);
            map.put("CGWJMC", cgwjmc);
            map.put("JNXH", jh);
            map.put("WJTM", wjtm);
            map.put("XCDWMC", xcdw);
//            map.put("BXZ", xcr);
            map.put("XCSJ", xcsj);
            map.put("SL", sl);
            map.put("YM", ym);
            map.put("PSDW", psdw);
            map.put("PSWH", pswh);
            map.put("PSSJ", pssj);
            map.put("BXDW", bxdw);
            map.put("BXZ", bxz);
            map.put("ZZYS", zzys);
            map.put("WJDX", wjdx);
            map.put("WJLX", wjlb);
            map.put("WJLJ", wjlj);
            map.put("GDZTXS", ztxs);
            map.put("QZY", qzy);
            map.put("FTHXBLC", hxblc);
            map.put("FTZXBLC", zxblc);
            map.put("WJGS", wjgs);
            map.put("WJGSSM", wjgssm);
            map.put("JUANH", 1);
            map.put("XH", jhLast);
            map.put("YJ_ID", insertId);
            //涉密信息
            List<Node> smxxNodeList = getNodeList(yswjxxNode, "SMXX/Item");
            ObjectMapper mapper = new ObjectMapper();
            ObjectNode root = mapper.createObjectNode();
            ArrayNode addresses = mapper.createArrayNode();
            if (smxxNodeList.size() > 0) {
                map.put("sfsm", "是");
            } else {
                map.put("sfsm", "否");
            }
            for (int j = 0; j < smxxNodeList.size(); j++) {
                Node smxxNode = smxxNodeList.get(j);
                if (j == 0) {
                    map.put("SMYM", getNodeText(smxxNode, "SMNR"));
                    map.put("SMZL", getNodeText(smxxNode, "SMZL"));
                    map.put("SMSX", getNodeText(smxxNode, "SMSX"));
                    map.put("WJMJ", getNodeText(smxxNode, "WJMJ"));
                    Integer securityCode = getSecurityCode(getNodeText(smxxNode, "WJMJ"));
                    map.put("SECURITY_CODE", securityCode);
                    map.put("BMQX", getNodeText(smxxNode, "BMQX"));
                    map.put("ZXFW", getNodeText(smxxNode, "ZXFW"));
                } else {
                    String smnr = getNodeText(smxxNode, "SMNR");
                    String smzl = getNodeText(smxxNode, "SMZL");
                    String smsx = getNodeText(smxxNode, "SMSX");
                    String wjmj = getNodeText(smxxNode, "WJMJ");
                    String bmqx = getNodeText(smxxNode, "BMQX");
                    String zxfw = getNodeText(smxxNode, "ZXFW");
                    CatSmxx catSmxx = new CatSmxx();
                    catSmxx.setAjId(ajjxxId);
                    catSmxx.setWjId(catYswjxxId);
                    catSmxx.setSmnr(smnr);
                    catSmxx.setSmzl(smzl);
                    catSmxx.setSmsx(smsx);
                    catSmxx.setWjmj(wjmj);
                    catSmxx.setBmqx(bmqx);
//                        catSmxx.setZxfw(zxfw);
                    catSmxxService.saveOrUpdate(catSmxx);
                    //{"classified":[{"mj":"内部","smym":"11","smsx":"22","bmqx":"33","zxfw":"34","smzl":""}]}
                    ObjectNode address = mapper.createObjectNode();
                    address.put("mj", wjmj);
                    address.put("smym", smnr);
                    address.put("smsx", smsx);
                    address.put("bmqx", bmqx);
                    address.put("zxfw", zxfw);
                    address.put("smzl", smzl);
                    addresses.add(address);
                }
            }
            root.put("classified", addresses);
            String jsonString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(root);
            map.put("smxx", jsonString);
            if (mapList.size() > 0) {
                //TRANSFER_NUMBER
                iform.update(1823021414679085057L, map, catYswjxxId);
            } else {
                iform.insert(1823021414679085057L, map);
            }
        }
    }
}
src/main/resources/applicationContext.xml
@@ -1,75 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:cache="http://www.springframework.org/schema/cache" xmlns:task="http://www.springframework.org/schema/task"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:cache="http://www.springframework.org/schema/cache" xmlns:task="http://www.springframework.org/schema/task"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd 
        http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd
        http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">
    <!-- 配置自动扫描的包,使其自动注入到IOC容器 -->
    <context:component-scan base-package="com.ruili.**" />
    <!-- 配置自动扫描的包,使其自动注入到IOC容器 -->
    <context:component-scan base-package="com.ruili.**,com.zbooksoft.**"/>
    <!-- 启用缓存注解功能(需要配置在Spring主配置文件中) -->
    <cache:annotation-driven cache-manager="ehcacheManager" />
    <!-- 启用缓存注解功能(需要配置在Spring主配置文件中) -->
    <cache:annotation-driven cache-manager="ehcacheManager"/>
    <task:annotation-driven scheduler="myScheduler" />
    <task:annotation-driven scheduler="myScheduler"/>
    <task:scheduler id="myScheduler" pool-size="5" />
    <task:scheduler id="myScheduler" pool-size="5"/>
    <!-- ureport2配置内置数据源 -->
    <bean id="buildinDatasource" class="com.ruili.wcp.common.report.UreportBuildinDatasource">
        <property name="dataSource" ref="dataSource"></property>
    </bean>
    <!-- ureport2配置内置数据源 -->
    <bean id="buildinDatasource" class="com.ruili.wcp.common.report.UreportBuildinDatasource">
        <property name="dataSource" ref="dataSource"></property>
    </bean>
    <!-- 基于spring实现的缓存管理器 -->
    <bean id="ehcacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
        <property name="cacheManager" ref="cacheManagerFactory" />
    </bean>
    <!-- 基于spring实现的缓存管理器 -->
    <bean id="ehcacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
        <property name="cacheManager" ref="cacheManagerFactory"/>
    </bean>
    <!--加载ehcache的相关配置 -->
    <bean id="cacheManagerFactory"
        class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
        <property name="configLocation" value="classpath:ehcache.xml" />
        <property name="shared" value="true"></property>
    </bean>
    <!--加载ehcache的相关配置 -->
    <bean id="cacheManagerFactory"
          class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
        <property name="configLocation" value="classpath:ehcache.xml"/>
        <property name="shared" value="true"></property>
    </bean>
    <!-- spring 线程池的配置 begin -->
    <context:property-placeholder location="classpath:spring-thread.properties"
        ignore-unresolvable="true" order="1" />
    <bean id="taskExecutor"
        class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
        <!-- 核心线程数 -->
        <property name="corePoolSize" value="${core_pool_size}" />
        <!-- 最大线程数 -->
        <property name="maxPoolSize" value="${max_pool_size}" />
        <!-- 队列最大长度 -->
        <property name="queueCapacity" value="${queue_capacity}" />
        <!-- 线程池维护线程所允许的空闲时间,默认为60s -->
        <property name="keepAliveSeconds" value="${keep_alive_seconds}" />
    </bean>
    <!-- 用于IO操作的系统池 -->
    <bean id="ioTaskExecutor"
        class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
        <!-- 核心线程数 -->
        <property name="corePoolSize" value="20" />
        <!-- 最大线程数 -->
        <property name="maxPoolSize" value="100" />
        <!-- 队列最大长度 -->
        <property name="queueCapacity" value="1000" />
        <!-- 线程池维护线程所允许的空闲时间,默认为60s -->
        <property name="keepAliveSeconds" value="60" />
    </bean>
    <!-- spring 线程池的配置 end -->
    <!-- spring 线程池的配置 begin -->
    <context:property-placeholder location="classpath:spring-thread.properties"
                                  ignore-unresolvable="true" order="1"/>
    <bean id="taskExecutor"
          class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
        <!-- 核心线程数 -->
        <property name="corePoolSize" value="${core_pool_size}"/>
        <!-- 最大线程数 -->
        <property name="maxPoolSize" value="${max_pool_size}"/>
        <!-- 队列最大长度 -->
        <property name="queueCapacity" value="${queue_capacity}"/>
        <!-- 线程池维护线程所允许的空闲时间,默认为60s -->
        <property name="keepAliveSeconds" value="${keep_alive_seconds}"/>
    </bean>
    <!-- 用于IO操作的系统池 -->
    <bean id="ioTaskExecutor"
          class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
        <!-- 核心线程数 -->
        <property name="corePoolSize" value="20"/>
        <!-- 最大线程数 -->
        <property name="maxPoolSize" value="100"/>
        <!-- 队列最大长度 -->
        <property name="queueCapacity" value="1000"/>
        <!-- 线程池维护线程所允许的空闲时间,默认为60s -->
        <property name="keepAliveSeconds" value="60"/>
    </bean>
    <!-- spring 线程池的配置 end -->
    <!-- 导入其他配置文件 -->
    <import resource="spring-shiro.xml" />
    <import resource="spring-mybatis.xml" />
    <import resource="spring-wcp.xml" />
    <import resource="spring-quartz.xml" />
    <!-- 导入ureport配置文件 -->
    <import resource="classpath:ureport-console-context.xml" />
    <!-- 导入其他配置文件 -->
    <import resource="spring-shiro.xml"/>
    <import resource="spring-mybatis.xml"/>
    <import resource="spring-wcp.xml"/>
    <import resource="spring-quartz.xml"/>
    <!-- 导入ureport配置文件 -->
    <import resource="classpath:ureport-console-context.xml"/>
</beans>
src/main/resources/license_gh.lic
New file
@@ -0,0 +1 @@
Ic5OXgAAABoAAAALAAAACkV4cGlyeURhdGUAAAHsRAzQAAAAAFMAAAACAAAADgAAADlMaWNlbnNlQ29tcGFueeW5v+W3nua1t+a0i+WcsOi0qOiwg+afpeWxgOWcsOi0qOi1hOaWmeeuoeeQhuacjeWKoeezu+e7nwAAABsAAAALAAAAC0xpY2Vuc2VEYXRlAAABmY7JjdEAAAAeAAAAAgAAAA4AAAAETGljZW5zZUVkaXRpb25GVUxMAAAAFwAAAAUAAAALTGljZW5zZVR5cGUAAAAAAAAAPgAAAAIAAAALAAAAJ01hY2hpbmVDb2RlRjFCNi1BNUI2LUExQzktMTM2My01MzJFLTlCMjMtRDU0NC1CRTJDAAAAnAAAAAEAAAAQAAAAgGxpY2Vuc2VTaWduYXR1cmU+eSB8aA0fuoY6zNWLO4J0yUZUFmXHFGbaMEcqYfdx3taYSA2Z98+6sBw8ttdt4H3D7TMhUR+Bf2CKKNqfoBdO3s7PLlwu7ewSWvLJj006Bq6bEmLi25r1hSuZhiWtuEmSIl5PtRYKRKvvIq1SSOXa1q+Hvpf96LwBTyKh0kZzXwAAACIAAAACAAAADwAAAAdzaWduYXR1cmVEaWdlc3RTSEEtNTEy
src/main/resources/mapper/BorrowFormMapper.xml
New file
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zbooksoft.gdmis.dao.BorrowFormMapper">
    <select id="selectMaxApplyCode" parameterType="String" resultType="String">
        select max(apply_code)
        FROM UTL_BORROW_FORM
        WHERE apply_code like CONCAT_WS('%', #{preNum,jdbcType=VARCHAR}, '%')
    </select>
    <select id="selectMaxApplyCode" parameterType="String" resultType="String" databaseId="oracle">
        select max(apply_code)
        FROM UTL_BORROW_FORM
        WHERE  apply_code like '%' || #{preNum,jdbcType=VARCHAR} || '%'
    </select>
</mapper>
src/main/resources/mapper/BorrwDetailMapper.xml
New file
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zbooksoft.gdmis.dao.BorrowDetailMapper">
    <select id="selectDistinctParentBorrowInfo" parameterType="Long"
            resultType="com.zbooksoft.gdmis.data.vo.ParentBorrowInfo">
        select distinct file_id, archival_code, file_title
        FROM utl_borrow_detail
        WHERE (form_id = 0 or form_id is null)
          and create_user_id = #{createUserId}
    </select>
    <select id="selectDistinctParentBorrowInfoByFormId" parameterType="Long"
            resultType="com.zbooksoft.gdmis.data.vo.ParentBorrowInfo">
        select distinct file_id, archival_code, file_title
        FROM UTL_BORROW_DETAIL
        WHERE form_id = #{formId}
    </select>
</mapper>
src/main/resources/mapper/KeywordMapper.xml
@@ -9,6 +9,12 @@
        where keyword_type = #{keywordType}
    </select>
    <!-- 获取最大排序号 -->
    <select id="selectMaxSortNum" parameterType="String" resultType="int" databaseId="postgresql">
        select NVL(max(sort_num), 0) sortNum
        FROM sys_keyword
        where keyword_type = #{keywordType}
    </select>
    <!-- 获取最大排序号 -->
    <select id="selectMaxSortNum" parameterType="String" resultType="int" databaseId="kingbasees">
        select NVL(max(sort_num), 0) sortNum
        FROM sys_keyword
src/main/resources/mapper/KeywordParamMapper.xml
@@ -3,8 +3,8 @@
<mapper namespace="com.ruili.wcp.dao.management.KeywordParamMapper">
    <!-- 根据关键字ID获取参数最大排序号 -->
    <select id="selectMaxSortNum" parameterType="Long" resultType="int">
        select ifnull(max(sort_num), 0) sortNum
    <select id="selectMaxSortNum" parameterType="Long" resultType="int" >
        select NVL(max(sort_num), 0) sortNum
        FROM sys_keyword_param
        where keyword_id = #{keywordId}
    </select>
src/main/resources/mapper/MenuItemMapper.xml
@@ -15,6 +15,12 @@
        WHERE menu_id = #{menuId}
          and parent_id = #{parentId}
    </select>
    <select id="selectMaxSortNum" parameterType="Map" resultType="int" databaseId="postgresql">
        select NVL(max(sort_num), 0) sortNum
        FROM sys_menuitem
        WHERE menu_id = #{menuId}
          and parent_id = #{parentId}
    </select>
    <!-- 获取某个父节点下最大排序号 -->
    <select id="selectMaxSortNum" parameterType="Map" resultType="int" databaseId="kingbasees">
        select NVL(max(sort_num), 0) sortNum
src/main/resources/mapper/MessageMapper.xml
@@ -11,6 +11,15 @@
    </select>
    <!-- 根据userId获取最大id和条数 -->
    <select id="getUnreadMessageCount" parameterType="Long" resultType="map" databaseId="postgresql">
        select NVL(count(*), 0)        count,
               NVL(max(message_id), 0) maxId
        FROM sys_message
        WHERE receive_user_id = #{userId}
          and is_read = '0'
    </select>
    <!-- 根据userId获取最大id和条数 -->
    <select id="getUnreadMessageCount" parameterType="Long" resultType="map" databaseId="kingbasees">
        select NVL(count(*), 0)        count,
               NVL(max(message_id), 0) maxId
src/main/resources/mapper/NavigationClassificationColumnMapper.xml
@@ -4,7 +4,7 @@
    <!-- 获取最大排序号 -->
    <select id="selectMaxSortNum" parameterType="Long" resultType="int">
        select ifnull(max(sort_num), 0) sortNum
        select NVL(max(sort_num), 0) sortNum
        FROM cnf_nav_classify_column
        where classification_id = #{classificationId}
    </select>
src/main/resources/mapper/NavigationClassificationMapper.xml
@@ -4,7 +4,7 @@
    <!-- 获取最大排序号 -->
    <select id="selectMaxSortNum" parameterType="Long" resultType="int">
        select ifnull(max(sort_num), 0) sortNum
        select NVL(max(sort_num), 0) sortNum
        FROM cnf_nav_classify
        where module_id = #{moduleId}
          and parent_id = #{parentId}
src/main/resources/mapper/PermissionMapper.xml
@@ -9,6 +9,13 @@
    </select>
    <!-- 根据parentId获取最大排序号-->
    <select id="selectMaxSortNum" parameterType="Long" resultType="int" databaseId="postgresql">
        select NVL(max(sort_num), 0) sortNum
        FROM cnf_permission
        WHERE parent_id = #{parentId}
    </select>
    <!-- 根据parentId获取最大排序号-->
    <select id="selectMaxSortNum" parameterType="Long" resultType="int" databaseId="kingbasees">
        select NVL(max(sort_num), 0) sortNum
        FROM cnf_permission
src/main/resources/mapper/PhysicalDetailMapper.xml
New file
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zbooksoft.gdmis.dao.PhysicalDetailMapper">
    <select id="selectDistinctParentPhysicalInfo" parameterType="Long"
            resultType="com.zbooksoft.gdmis.data.vo.ParentPhysicalInfo">
        select distinct file_id, archival_code, file_title
        FROM UTL_PHYSICAL_DETAIL
        WHERE (form_id = 0 or form_id is null)
          and create_user_id = #{createUserId}
    </select>
    <select id="selectDistinctParentPhysicalInfoByFormId" parameterType="Long"
            resultType="com.zbooksoft.gdmis.data.vo.ParentPhysicalInfo">
        select distinct file_id, archival_code, file_title
        FROM UTL_PHYSICAL_DETAIL
        WHERE form_id = #{formId}
    </select>
</mapper>
src/main/resources/mapper/PhysicalFormMapper.xml
New file
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zbooksoft.gdmis.dao.PhysicalFormMapper">
    <select id="selectMaxApplyCode" parameterType="String" resultType="String">
        select max(apply_code)
        FROM UTL_PHYSICAL_FORM
        WHERE apply_code like CONCAT_WS('%', #{preNum,jdbcType=VARCHAR}, '%')
    </select>
    <select id="selectMaxApplyCode" parameterType="String" resultType="String" databaseId="oracle">
        select max(apply_code)
        FROM UTL_PHYSICAL_FORM
        WHERE  apply_code like '%' || #{preNum,jdbcType=VARCHAR} || '%'
    </select>
</mapper>
src/main/resources/mapper/SubtabMapper.xml
@@ -14,6 +14,12 @@
        ifnull(max(sort_num),0) sortNum
        FROM cnf_subtab where module_id = #{moduleId}
    </select>
    <!-- 根据模块ID获取页签最大排序号 -->
    <select id="selectMaxSortNum" parameterType="Long" resultType="int" databaseId="postgresql">
        select
            NVL(max(sort_num),0) sortNum
        FROM cnf_subtab where module_id = #{moduleId}
    </select>
    <!-- 根据模块ID获取页签最大排序号 -->
    <select id="selectMaxSortNum" parameterType="Long" resultType="int" databaseId="oracle">
src/main/resources/mapper/UserMapper.xml
@@ -71,7 +71,8 @@
        </if>
        limit #{currIndex} , #{pageSize}
    </select>
    <select id="selectUserPage" parameterType="map" resultMap="withUserMap" databaseId="oracle">
    <!--    <select id="selectUserPage" parameterType="map" resultMap="withUserMap" databaseId="oracle">-->
    <select id="selectUserPage" parameterType="map" resultMap="withUserMap">
        SELECT * FROM (
        SELECT t.*, ROWNUM AS rn FROM (
        select
src/main/resources/spring-mybatis.xml
@@ -88,6 +88,7 @@
                <prop key="KingbaseES">kingbasees</prop>
                <prop key="DM">dameng</prop>
                <prop key="XuGU">xugu</prop>
                <prop key="PostgreSQL">postgresql</prop>
            </props>
        </property>
    </bean>
@@ -119,7 +120,7 @@
    <!-- 配置mybatis mapper接口 -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <!--自动扫描 dao下的interface,并加入IOC容器 -->
        <property name="basePackage" value="com.ruili.**.dao" />
        <property name="basePackage" value="com.ruili.**.dao,com.zbooksoft.**.dao" />
        <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
    </bean>
src/main/resources/spring-servlet.xml
@@ -19,7 +19,7 @@
        http://www.springframework.org/schema/cache/spring-cache.xsd">
    <!-- 启动包扫描功能,以便注册带有@Controllers等注解的类成为spring的bean -->
    <context:component-scan base-package="com.ruili.**.controller,com.ruili.wcp.web.api"/>
    <context:component-scan base-package="com.ruili.**.controller,com.ruili.wcp.web.api,com.zbooksoft.**.controller"/>
    <!-- AOP 注解方式 ;定义Aspect -->
    <!-- 启动AspectJ支持 只对扫描过的bean有效 -->
src/main/resources/spring-shiro.xml
@@ -48,6 +48,16 @@
    <bean id="credentialsMatcher" class="com.ruili.wcp.common.RetryLimitCredentialsMatcher">
        <constructor-arg ref="shiroCacheManager"/>
    </bean>
    <!-- RememberMe 管理器 -->
    <bean id="rememberMeManager" class="org.apache.shiro.web.mgt.CookieRememberMeManager">
        <property name="cookie" ref="rememberMeCookie"/>
    </bean>
    <!-- RememberMe Cookie 配置 -->
    <bean id="rememberMeCookie" class="org.apache.shiro.web.servlet.SimpleCookie">
        <property name="name" value="rememberMe"/>
        <property name="maxAge" value="2592000"/> <!-- 30天 -->
        <property name="httpOnly" value="true"/>
    </bean>
    <!-- Shiro安全管理器 -->
    <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
@@ -55,6 +65,7 @@
        <property name="cacheManager" ref="shiroCacheManager"></property>
        <!-- 注入session管理器 -->
        <property name="sessionManager" ref="sessionManager"/>
        <property name="rememberMeManager" ref="rememberMeManager"/>
    </bean>
    <!-- 会话ID生成器 -->
src/main/webapp/WEB-INF/lib/JDBC-VB_P-2.12-2025063010.jar
Binary files differ
src/main/webapp/WEB-INF/lib/tsc_sdk.jar
Binary files differ
src/main/webapp/WEB-INF/view/account/login_gh.jsp
New file
@@ -0,0 +1,326 @@
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>用户登录-${systemConfig.platformTitle}</title>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <!-- easyui -->
    <%--    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">--%>
    <link href="static/plugins/jquery-easyui/themes/icon.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
    <!-- jquery -->
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <!-- 滚动条 -->
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <script type="text/javascript" src="static/plugins/crypto-js/core.js"></script>
    <script type="text/javascript" src="static/plugins/crypto-js/md5.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <style>
        html {
            overflow: hidden;
        }
        body {
            font-size: 14px;
            color: #e3e6f4;
            cursor: default;
        }
        .login {
        }
        .loginbg {
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            z-index: -1;
        }
        .loginbg img {
            height: 100%;
            width: 100%;
            border: 0;
        }
        .logincontent {
            width: 990px;
            margin: 0 auto;
        }
        .loginlogo {
            text-align: center;
        }
        .loginlogo {
            margin: 130px 0 0 0;
        }
        .loginmain {
            position: absolute;
            top: 50%;
            left: 50%;
            height: 516px;
            width: 980px;
            margin: -180px 0 0 -490px;
            background: url(static/styles/images/login7main.png) no-repeat;
        }
        .loginframe {
            width: 330px;
            height: 450px;
            float: right;
            margin: 56px 90px 0 0;
            padding: 22px 30px 0 30px;
        }
        .loginframe h3 {
            color: #444444;
            font-size: 26px;
            font-weight: normal;
            font-family: "Microsoft YaHei";
            line-height: 30px;
            margin-bottom: 30px;
            border-bottom: 1px solid #e9e9e9;
            padding: 0 0 20px 26px;
        }
        .loginframe h3 span {
            color: #2684f0;
            font-size: 16px;
            margin-left: 10px;
        }
        .loginframe .loginusername, .loginframe .loginpwd {
            margin-bottom: 16px;
            height: 34px;
            padding: 6px 20px;
            background: #fff;
            border-bottom: 1px solid #4291f6;
        }
        .loginframe .loginusername input, .loginframe .loginpwd input {
            color: #666;
            width: 80%;
            height: 34px;
            line-height: 34px;
            font-size: 15px;
            border: 0 none;
            margin: 0 0 0 30px;
            font-family: "Microsoft YaHei";
            background: #fff;
        }
        .loginframe input::-webkit-input-placeholder {
            color: #aaaaaa;
        }
        .loginframe input::-moz-placeholder {
            color: #aaaaaa;
        }
        .loginframe input:-moz-placeholder {
            color: #aaaaaa;
        }
        .loginframe input:-ms-input-placeholder {
            color: #aaaaaa;
        }
        .loginframe .loginusername {
            background: #fff url(static/styles/images/login5i1.png) 16px center no-repeat;
        }
        .loginframe .loginpwd {
            background: #fff url(static/styles/images/login5i2.png) 16px center no-repeat;
        }
        .loginframe .user_remember {
            margin: 22px 0 10px 16px;
            height: 20px;
            line-height: 20px;
            font-size: 13px;
            color: #808080;
        }
        .loginframe .user_remember input {
            margin: 3px 6px 0 0;
            width: 14px;
            height: 14px;
            float: left;
        }
        .loginframe .user_remember span {
            float: left;
            margin: 0 20px 0 0;
        }
        .loginframe .user_btn input {
            border: 0 none;
            background: url(static/styles/images/login7btn.png);
            width: 280px;
            height: 96px;
            margin: 0 0 0 30px;
            cursor: pointer;
        }
        .loginframe .user_tip {
            color: #808080;
            text-align: center;
        }
        .loginframe .user_tip a {
            text-decoration: underline;
            color: #3d85e3;
        }
        input {
            background-color: rgba(255, 255, 255, 0) !important;
        }
        input:-webkit-autofill {
            transition: background-color 5000s ease-in-out 0s;
            /*-webkit-text-fill-color: #fff !important;*/
        }
    </style>
</head>
<body>
<div class="login">
    <div class="loginbg"><img src="static/styles/images/login7bg.jpg"/></div>
    <div class="logincontent">
        <%--        <div class="loginlogo"><img src="static/styles/images/loginlogo-HN.png"/></div>--%>
        <div class="loginlogo"><img src="${systemConfig.loginLogoUrl }" class="logo-login" alt=""/></div>
        <div class="loginmain clear">
            <div class="loginframe">
                <h3>用户登录<span>Login User</span></h3>
                <p class="loginusername"><input id="txtUserName" style=" box-shadow: none;" type="text"
                                                placeholder="请输入用户名"/></p>
                <p class="loginpwd"><input id="txtPassword" type="password" placeholder="请输入密码"/></p>
                <div class="user_remember clear">
                    <input id="cbRememberMe" type="checkbox"/><span>记住我</span>
                    <%--                        <input type="checkbox"/><span>记住密码</span>--%>
                    <%--                        <span style="float:right;">忘记密码?</span>--%>
                </div>
                <p class="user_btn"><input id="btnLogin" type="button" value=""/></p>
                <p class="user_tip">没有账户?&nbsp;<a href="javascript: register();">点击注册>></a></p>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $("#btnLogin").click(function (e) {
            userVerify();
        });
        $("#txtPassword").keyup(function (e) {
            if (e.keyCode == "13") {
                userVerify();
            }
        });
        $('#validateCode').keyup(function (e) {
            if (e.keyCode == "13") {
                userVerify();
            }
        });
    });
    <%--//刷新验证码--%>
    <%--function changeImg() {--%>
    <%--    $("#validateCodeImg").attr("src", "drawImage/drawImage/?" + Math.random());--%>
    <%--}--%>
    function register() {
        var url = "utilizationUser/register";
        window.open(url);
    }
    function login() {
        var userName = $('#txtUserName').val();
        var password = $('#txtPassword').val();
        password = CryptoJS.MD5(password).toString().toUpperCase();
        var validateCode = $("#validateCode").val();
        wcp.ui.setBusy(
            $(".login-frame"),
            wcp.ajax({
                url: "account/loginIn",
                data: JSON.stringify({
                    userName: userName,
                    password: password,
                    validateCode: validateCode,
                    rememberMe: $('#cbRememberMe').is(':checked'),
                    returnUrl: $('#hidReturnUrl').val()
                })
            })
        );
    }
    function userVerify() {
        var userName = $('#txtUserName').val();
        if (userName == "") {
            wcp.message.warn("用户名不能为空!");
            return;
        }
        var password = $('#txtPassword').val();
        if (password == "") {
            wcp.message.warn("密码不能为空!");
            return;
        }
        <c:if test="${systemConfig.enableLoginVerificationCode}">
        var validateCode = $('#validateCode').val();
        if (validateCode == "") {
            wcp.message.warn("验证码不能为空!");
            return;
        }
        </c:if>
        login();
        // $(".login-frame"),
        //     wcp.ajax({
        //         // url: "utilizationUser/userVerify",
        //         // data: JSON.stringify(userName),
        //     }).done(function (result) {
        //         login();
        //     });
    }
</script>
</body>
</html>
src/main/webapp/WEB-INF/view/account/login_gh_new.jsp
New file
@@ -0,0 +1,416 @@
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>用户登录-${systemConfig.platformTitle}</title>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <!-- easyui -->
    <%--    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">--%>
    <%--    <link href="static/plugins/jquery-easyui/themes/icon.css" rel="stylesheet" type="text/css">--%>
    <%--    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">--%>
    <link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
    <!-- jquery -->
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <!-- 滚动条 -->
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <script type="text/javascript" src="static/plugins/crypto-js/core.js"></script>
    <script type="text/javascript" src="static/plugins/crypto-js/md5.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <style>
        html, body, h1, h2, h3, h4, h5, h6, p, dl, dd, ul, li, ol, form, input, textarea, select, table, th, td {
            margin: 0px;
            padding: 0px;
        }
        body {
            font-size: 15px;
            font-family: "Microsoft YaHei";
            color: #333333;
            cursor: default;
        }
        i, b, em {
            font-style: normal;
        }
        li {
            list-style: none;
        }
        a {
            text-decoration: none;
            color: #04446a;
        }
        a:hover {
            color: #3a667f;
        }
        img {
            border: none;
            vertical-align: top;
        }
        table {
            border-collapse: collapse;
        }
        textarea {
            resize: none;
            overflow: auto;
        }
        .hide {
            display: none;
        }
        *:focus {
            outline: none;
        }
        .clear {
            *zoom: 1;
        }
        .clear:after {
            content: "";
            display: block;
            clear: both;
        }
        html {
            overflow: hidden;
        }
        body {
            font-size: 14px;
            font-family: "    SimSun"
            color: #e3e6f4;
            cursor: default;
        }
        .login {
        }
        .loginbg {
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            right: 0;
            z-index: -1;
        }
        .loginbg img {
            height: 100%;
            width: 100%;
            border: 0;
        }
        .loginlogo {
            text-align: center;
        }
        .loginlogo {
            margin: 90px 0 0 0;
        }
        .loginmain {
            width: 475px;
            height: 454px;
            position: absolute;
            top: 29%;
            left: 63%;
            margin: 0px 0 0 0px;
        }
        .loginframe {
            background: url(static/styles/images/loginconbg.png);
            width: 315px;
            height: 434px;
            padding: 20px 80px 0 80px;
            border-radius: 20px;
            /*box-shadow: 0px 10px 32px #3575bc;*/
        }
        .logintxt {
            text-align: center;
            padding: 28px 0 24px 0;
            margin: 0 auto;
        }
        .loginframe .loginusername, .loginframe .loginpwd {
            height: 48px;
            padding: 0 20px;
            background: none;
            border-radius: 6px;
            border: 1px solid #1269ff;
        }
        .loginframe .loginusername input, .loginframe .loginpwd input {
            color: #666;
            width: 80%;
            height: 46px;
            line-height: 46px;
            font-size: 14px;
            border: 0 none;
            margin: 0 0 0 40px;
            font-family: "SimSun";
            background: none;
        }
        .loginframe input::-webkit-input-placeholder {
            color: #a7a4a4;
        }
        .loginframe input::-moz-placeholder {
            color: #a7a4a4;
        }
        .loginframe input:-moz-placeholder {
            color: #a7a4a4;
        }
        .loginframe input:-ms-input-placeholder {
            color: #a7a4a4;
        }
        .loginframe .loginusername {
            background: url(static/styles/images/logini1.png) 24px center no-repeat;
            margin-bottom: 28px;
        }
        .loginframe .loginpwd {
            background: url(static/styles/images/logini2.png) 24px center no-repeat;
            margin-bottom: 18px;
        }
        .loginframe .user_remember {
            /*margin: 0 0 40px 29px;*/
            height: 20px;
            line-height: 20px;
            font-size: 14px;
            color: #525252;
        }
        .loginframe .user_remember input {
            margin: 3px 8px 0 0;
            width: 14px;
            height: 14px;
            float: left;
        }
        .loginframe .user_remember span {
            float: left;
            /*margin: 0 26px 0 0;*/
        }
        .loginframe .user_btn input {
            border: 0 none;
            font-size: 16px;
            color: #fff;
            height: 48px;
            line-height: 48px;
            cursor: pointer;
            text-align: center;
            border-radius: 6px;
            /*box-shadow: 0px 14px 16px #c4d9ff;*/
        }
        .loginframe .user_btn input.dlbtn {
            background: #1269ff;
            width: 204px;
        }
        .loginframe .user_btn input.zcbtn {
            background: #ffa400;
            width: 92px;
            margin-left: 10px;
        }
        .loginframe .user_btn input:hover {
            opacity: 0.9;
        }
        .loginfoot {
            position: absolute;
            bottom: 26px;
            text-align: center;
            margin: 0 auto;
            width: 100%;
        }
        .loginframe .user_tip {
            color: #808080;
            text-align: center;
        }
        .loginframe .user_tip a {
            text-decoration: underline;
            color: #3d85e3;
        }
        .loginframe .user_btn input {
            border: 0 none;
            background: url(static/styles/images/login7btn.png);
            width: 280px;
            height: 96px;
            margin: 0 0 0 30px;
            cursor: pointer;
        }
        .loginfoot p {
            color: #fff;
        }
    </style>
</head>
<body>
<form>
    <div class="login">
        <div class="loginbg"><img src="static/styles/images/loginbg.jpg"/></div>
        <%--        <div class="loginlogo"><img src="static/styles/images/loginlogo_hn.png"/></div>--%>
        <div class="loginlogo"><img src="${systemConfig.loginLogoUrl }" class="logo-login" alt=""/></div>
        <div class="loginmain clear">
            <div class="loginframe">
                <div class="logintxt"><img src="static/styles/images/logintxt.png" alt="系统登录"></div>
                <p class="loginusername"><input id="txtUserName" name="userName" type="text"
                                                placeholder="请输入用户名"/></p>
                <p class="loginpwd"><input id="txtPassword" name="password" type="password"
                                           placeholder="请输入密码"/>
                </p>
                <c:if test="${systemConfig.enableLoginVerificationCode }">
                    <div class="clear">
                        <p class="user" style="width:160px; float:left; margin-right:5px;">
                            <i class="fa fa-key"></i>
                            <input id="validateCode" name="validateCode" type="text" placeholder="验证码"
                                   style="width:100px;"/>
                        </p>
                        <p style="float:left;">
                            <img alt="验证码看不清,换一张" src="drawImage/drawImage" id="validateCodeImg">
                            <a href="javascript:void(0)" onclick="changeImg()" style="line-height:60px;">
                                &nbsp;<font size="4">换一张</font>
                            </a>
                        </p>
                    </div>
                </c:if>
                <div class="user_remember clear">
                    <input id="cbRememberMe" type="checkbox"><span>记住我</span>
                </div>
                <p class="user_btn"><input id="btnLogin" type="button" value=""/></p>
                <p class="user_tip">没有账户?&nbsp;<a href="javascript: register();">点击注册>></a></p>
                <%--                <p class="user_btn">--%>
                <%--                    <input type="hidden" name="returnUrl" id="hidReturnUrl" value="${resultUrl}"/>--%>
                <%--                    <input type="button" id="btnLogin" value="登录" class="dlbtn"/>--%>
                <%--                    <input type="button" id="btnRegister" value="注册" class="zcbtn"/>--%>
                <%--                </p>--%>
            </div>
        </div>
        <div class="loginfoot"><p>技术支持:${systemConfig.platformCopyRight}</p></div>
    </div>
</form>
<script type="text/javascript">
    $(function () {
        $("#btnLogin").click(function (e) {
            login();
        });
        $("#txtPassword").keyup(function (e) {
            if (e.keyCode == "13") {
                login();
            }
        });
        $('#validateCode').keyup(function (e) {
            if (e.keyCode == "13") {
                login();
            }
        });
    });
    //刷新验证码
    function changeImg() {
        $("#validateCodeImg").attr("src", "drawImage/drawImage/?" + Math.random());
    }
    function login() {
        var userName = $('#txtUserName').val();
        if (userName == "") {
            wcp.message.warn("用户名不能为空!");
            return;
        }
        var password = $('#txtPassword').val();
        if (password == "") {
            wcp.message.warn("密码不能为空!");
            return;
        }
        <c:if test="${systemConfig.enableLoginVerificationCode}">
        var validateCode = $('#validateCode').val();
        if (validateCode == "") {
            wcp.message.warn("验证码不能为空!");
            return;
        }
        </c:if>
        password = CryptoJS.MD5(password).toString().toUpperCase();
        var validateCode = $("#validateCode").val();
        wcp.ui.setBusy(
            $(".loginframe"),
            wcp.ajax({
                url: "account/loginIn",
                data: JSON.stringify({
                    userName: userName,
                    password: password,
                    validateCode: validateCode,
                    rememberMe: $('#cbRememberMe').is(':checked'),
                    returnUrl: $('#hidReturnUrl').val()
                })
            })
        );
    }
    //GeologicalManagement
    $("#btnRegister").click(function (e) {
        register();
    });
    function register() {
        var url = "utilizationUser/register";
        window.open(url);
    }
</script>
</body>
</html>
src/main/webapp/WEB-INF/view/gh/borrow/addBorrowForm.jsp
New file
@@ -0,0 +1,499 @@
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath%>">
    <title>人工添加借阅申请</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/material-teal.css" type="text/css">
    <link rel="stylesheet" type="text/css" href="static/plugins/webuploader/webuploader.css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/archives.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/icheck/skins/all.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-edatagrid/jquery.edatagrid.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-afterresize/jquery.afterresize.min.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <script type="text/javascript" src="static/plugins/ace/src-noconflict/ace.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
    <script type="text/javascript" src="static/plugins/webuploader/webuploader.js"></script>
    <script src="static/plugins/webuploader/webuploader.min.js"></script>
    <script src="static/plugins/ptfileupload/pt.fileupload.js"></script>
    <style>
        body {
            background: #f3f5fa;
            width: 1020px;
            margin: 0 auto;
        }
        .pt-form table {
            margin: 20px auto 0px auto;
        }
        .webuploader-pick {
            background-color: #d81b60;
            border: 1px solid #c40a4e;
            border-radius: 4px;
            color: #fff;
            padding: 5px 10px;
            float: right;
            margin: -10px 32px 0 0;
        }
        .webuploader-pick i.fa-upload {
            padding-right: 0.3em;
            color: #fff;
        }
    </style>
</head>
<body>
<div class="margin-lr">
    <div class="pt-title-theme3"><i class="fa fa-file-text"></i><h4>借阅申请单</h4></div>
    <div class="ptbody">
        <div class="pt-application-row">
            <div class="pt-subtitle"><i></i><span>借阅单</span></div>
            <div class="pt-form">
                <form id="form1">
                    <table style="width:100%;">
                        <tr>
                            <td class="tbtitle">借阅单编号:</td>
                            <td colspan="3">[自动生成]</td>
                        </tr>
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em> 姓名:</td>
                            <td style="width: 35%;">
                                <input class="easyui-textbox" id="borrowUserName" name="borrowUserName"
                                       type="text" style="width:300px;" value="${curUserName}"
                                       data-options="required:true,tipPosition:'bottom',buttonText:'选',prompt:'请选择借阅人...',onClickButton:function(){selectBorrowName(); }"/>
                                <input id="borrowUserId" class="easyui-textbox" name="borrowUserId"
                                       type="hidden"
                                       value="${curUserId}"/>
                            </td>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>工作单位:</td>
                            <td style="width: 35%;">
                                <input class="easyui-textbox" id="deptName"
                                       name="deptName" type="text" style="width:300px"
                                       data-options="required:true"
                                       value=""/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle"> 邮编:</td>
                            <td style="width: 35%;">
                                <input class="easyui-textbox" id="postCode"
                                       name="postCode" type="text" style="width:300px"
                                       value=""/>
                            </td>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>单位地址:</td>
                            <td style="width: 35%;">
                                <input class="easyui-textbox" id="deptAddress"
                                       name="deptAddress" type="text" style="width:300px"
                                       data-options="required:true"
                                       value=""/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle">电话:</td>
                            <td style="width: 35%;">
                                <input class="easyui-textbox" id="telNumber"
                                       name="telNumber" type="text" style="width:300px"
                                       value=""/>
                            </td>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>手机:</td>
                            <td style="width: 35%;">
                                <input class="easyui-textbox" id="borrowTel"
                                       name="borrowTel" type="text" style="width:300px"
                                       value=""/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle">涉密证书编号:</td>
                            <td colspan="3">
                                <input class="easyui-textbox" id="certificateNumber"
                                       name="certificateNumber" type="text" style="width:785px"
                                       value=""/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>资料用途:</td>
                            <td colspan="3">
                                <input class="easyui-textbox" name="borrowPurpose"
                                       data-options="required:true,multiline:true"
                                       style="height:60px;width:785px">
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle">用户备注:</td>
                            <td colspan="3">
                                <input class="easyui-textbox" name="remark" data-options="multiline:true"
                                       style="height:60px;width:785px">
                            </td>
                        </tr>
                        <tr id="tr1" style="display: none">
                            <td class="tbtitle">部门:</td>
                            <td style="width: 35%;"><input class="easyui-textbox" id="borrowDept"
                                                           type="text" style="width:300px"
                                                           value="${curDeptName}"/>
                                <input class="easyui-textbox" id="borrowDeptId"
                                       type="hidden" value="${curDeptId}"/>
                            </td>
                            <td class="tbtitle">单位名称:</td>
                            <td style="width: 35%;">
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="pt-application-row">
            <div class="pt-subtitle"><i></i><span>借阅目录</span></div>
            <div class="pt-spacing">
                <div>
                    <div id="toolbar" style="height: auto">
                        <div>
                            <a onclick="addRow();" class="pt-btn pt-btn-success">
                                <i class="fa fa-plus"></i> 新增
                            </a>
                            <a onclick="$('#tb_BorrowDetail').edatagrid('saveRow');" class="pt-btn pt-btn-info">
                                <i class="fa fa-save"></i>
                                确认修改
                            </a>
                            <a onclick="$('#tb_BorrowDetail').edatagrid('cancelRow');" class="pt-btn pt-btn-warning">
                                <i class="fa fa-scissors"></i>
                                撤销
                            </a>
                            <a onclick="saveData();" class="pt-btn pt-btn-info">
                                <i class="fa fa-save"></i>
                                保存
                            </a>
                            <a onclick="$('#tb_BorrowDetail').edatagrid('destroyRow');" class="pt-btn pt-btn-danger">
                                <i class="fa fa-trash-o"></i>
                                删除
                            </a>
                        </div>
                    </div>
                    <div>
                        <table id="tb_BorrowDetail" singleselect="true" idfield="detailId" style="width: 100%;"
                               toolbar="#toolbar">
                            <thead>
                            <tr>
                                <th field="archivalCode" width="15%" align="center"
                                    editor="{type:'validatebox',options:{required:true}}">档号
                                </th>
                                <th field="itemNumber" width="15%" align="center"
                                    editor="{type:'validatebox',options:{required:true}}">件号
                                </th>
                                <th field="securityClassification" width="15%" align="center"
                                    editor="{type:'combobox',options:{valueField:'csmc',textField:'csmc',
                            data:securityList,multiple:false,editable:false,panelHeight:'auto'}}">密级
                                </th>
                                <th field="itemTitle" width="40%" align="center"
                                    editor="{type:'validatebox',options:{required:true}}">题名
                                </th>
                                <th field="borrowType" width="15%" align="center"
                                    editor="{type:'combobox',options:{valueField:'csmc',textField:'csmc',
                            data:uniqueList,multiple:false,editable:false,panelHeight:'auto'}}">借阅类型
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="pt-application-btn">
            <button class="pt-btn pt-btn-purple" onclick="saveBorrowForm()">提交</button>
            <button class="pt-btn pt-btn-default" onclick="closeWindow()">关闭</button>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    var selectId = '0';
    var params = {
        callBack: null,
        callBackParams: null
    };
    var createUserId = '${curUserId}';
    var uniqueList = [
        {
            "csid": "电子",
            "csmc": "电子",
            "selected": "true"
        },
        {
            "csid": "纸质",
            "csmc": "纸质"
        },
        {
            "csid": "调阅原件",
            "csmc": "调阅原件"
        }
    ];
    var securityList = [
        {
            "csid": "",
            "csmc": "",
        },
        {
            "csid": "内部",
            "csmc": "内部",
            "selected": "true"
        },
        {
            "csid": "秘密",
            "csmc": "秘密"
        },
        {
            "csid": "机密",
            "csmc": "机密"
        },
        {
            "csid": "绝密",
            "csmc": "绝密"
        }
    ];
    $(function () {
        new ResizeScroll({
            "id": ".ptbody", fun: function () {
                var wh = $(window).height();
                return (wh - 36 - 28 - 10);
            }
        });
        //人员变换时事件
        $('#borrowUserName').textbox({
            onChange: function (value) {
                setTimeout(function () {
                    getBorrowUserInfo(value);
                }, 500);
            }
        });
        getBorrowDetailList();
        // loadCategories();
    })
    //提交
    function saveBorrowForm() {
        var borrowDetailList = $('#tb_BorrowDetail').datagrid("getRows");
        if (borrowDetailList.length == 0) {
            wcp.notify.error('借阅目录为空,不能提交!');
            return;
        }
        var state = {'state': 0};
        var flowState = {'flowState': 0};
        //验证表单信息
        var isValid = $('#form1').form('validate');
        if (!isValid) {
            wcp.notify.error('表单验证有误,请检查表单输入项!');
            return false;
        }
        var formData = $.extend({}, $("#form1").serializeObject(), state, flowState);
        wcp.ui.setBusy("body", wcp.ajax({
            url: "borrow/saveBorrowForm",
            data: JSON.stringify(formData),
        }).done(function (result) {
            wcp.notify.info('提交成功!');
            params.parent.refreshData();//刷新父亲
            closeWindow();
        }));
    }
    function closeWindow() {
        var title = top.$('#tt').tabs('getSelected').panel("options").title;
        top.$("#tt").tabs("close", title);
    }
    //绑定字段列表
    function getBorrowDetailList() {
        var wh = $(window).height();// 移除所有 change 事件监听器
        $('#tb_BorrowDetail').edatagrid({
            rownumbers: true,
            pagination: false,
            fitColumns: true,
            method: "get",
            url: "borrow/getBorrowDetailListByPeople",
            saveUrl: "",
            updateUrl: "",
            onDestroy: function (index, row) {
                $.ajax({
                    type: 'POST',
                    contentType: "application/json; charset=utf-8",
                    url: "borrow/deleteBorrowDetailById?detailId=" + row.detailId,
                    success: function (data) {
                    }
                });
            },
            onLoadSuccess: function (data) {
                for (var i = 0; i < data.rows.length; i++) {
                    var row = data.rows[i];
                    var value = ""
                    if (row.electronic == 1) {
                        value = "电子";
                    }
                    if (row.paper == 1) {
                        value = "纸质";
                    }
                    if (row.original == 1) {
                        value = "原件借出";
                    }
                    $('#tb_BorrowDetail').datagrid('beginEdit', i);
                    // 获取编辑器对象
                    var editors = $('#tb_BorrowDetail').datagrid('getEditors', i);
                    $(editors[4].target[0]).combobox("setValue", value);
                    $(editors[4].target[0]).combobox("setText", value);
                    $('#tb_BorrowDetail').datagrid('endEdit', i);
                }
            }
        });
    }
    function saveData() {
        var editIndex = $('#tb_BorrowDetail').datagrid('getRows').length;
        for (var i = 0; i < editIndex; i++) {
            $('#tb_BorrowDetail').datagrid("endEdit", i);
        }
        var borrowDetailList = $('#tb_BorrowDetail').datagrid("getRows");
        for (i = 0; i < borrowDetailList.length; i++) {
            if (borrowDetailList[i].hasOwnProperty('isNewRecord')) {
                var isNewRecord = borrowDetailList[i].isNewRecord;
                if (isNewRecord) {
                    layer.alert("请先确认字段!");
                    return false;
                }
                //删除isNewRecord属性
                delete borrowDetailList[i].isNewRecord;
            }
            borrowDetailList[i]["createUserId"] = createUserId;
            borrowDetailList[i]["formId"] = 0;
            borrowDetailList[i]["fileTitle"] = "人工添加";
            borrowDetailList[i]["fileId"] = 0;
            if (borrowDetailList[i]["borrowType"] == "电子") {
                borrowDetailList[i]["electronic"] = 1;
                borrowDetailList[i]["paper"] = 0;
                borrowDetailList[i]["original"] = 0;
            }
            if (borrowDetailList[i]["borrowType"] == "纸质") {
                borrowDetailList[i]["electronic"] = 0;
                borrowDetailList[i]["paper"] = 1;
                borrowDetailList[i]["original"] = 0;
            }
            if (borrowDetailList[i]["borrowType"] == "调阅原件") {
                borrowDetailList[i]["electronic"] = 0;
                borrowDetailList[i]["paper"] = 0;
                borrowDetailList[i]["original"] = 1;
            }
            borrowDetailList[i]["agree"] = 1;
            delete borrowDetailList[i].borrowType;
        }
        $.ajax({
            type: 'POST',
            contentType: "application/json; charset=utf-8",
            url: "borrow/saveBorrowDetail",
            dataType: 'json',
            data: JSON.stringify(borrowDetailList),
            success: function (data) {
                $('#tb_BorrowDetail').datagrid("reload");
            }
        });
    }
    function addRow() {
        var rows = $("#tb_BorrowDetail").datagrid("getRows");
        var index = rows.length;
        $('#tb_BorrowDetail').edatagrid('addRow', {
            index: index,
            row: {
                "archivalCode": "",
                "itemNumber": "",
                "securityClassification": "",
                "itemTitle": "",
                "borrowType": "电子",
            }
        });
    }
    //选择利用人
    function selectBorrowName() {
        wcp.picker.selectUser({
            title: "请选择利用人",
            multiSelect: false,
            idElement: "borrowUserId",
            nameElement: "borrowUserName",
            deptNameElement: "borrowDept",
            deptIdElement: "borrowDeptId",
            layerOpener: window
        });
    }
    //添加信息
    function getBorrowUserInfo() {
        var deptName = $("#borrowDept").textbox('getValue');
        var borrowUserId = $("#borrowUserId").textbox('getValue');
        if (deptName != null && deptName == "外部用户") {
            wcp.ui.setBusy("body", wcp.ajax({
                url: "borrow/getBorrowUserInfo?userId=" + borrowUserId,
            }).done(function (result) {
                $("#deptName").textbox('setValue', result.deptName);
                $("#postCode").textbox('setValue', result.postCode);
                $("#deptAddress").textbox('setValue', result.deptAddress);
                $("#telNumber").textbox('setValue', result.telNumber);
                $("#borrowTel").textbox('setValue', result.borrowTel);
                $("#certificateNumber").textbox('setValue', result.certificateNumber);
                $("#borrowPurpose").textbox('setValue', result.borrowPurpose);
            }));
        }
    }
</script>
</html>
src/main/webapp/WEB-INF/view/gh/borrow/borrowForm.jsp
New file
@@ -0,0 +1,925 @@
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath%>">
    <title>借阅申请单</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/material-teal.css" type="text/css">
    <link rel="stylesheet" type="text/css" href="static/plugins/webuploader/webuploader.css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/archives.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/icheck/skins/all.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/plugins/datagrid-detailview.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-edatagrid/jquery.edatagrid.js"></script>
    <script type="text/javascript" src="static/plugins/icheck/icheck.min.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <script type="text/javascript" src="static/plugins/ace/src-noconflict/ace.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/plugins/webuploader/webuploader.js"></script>
    <script src="static/plugins/webuploader/webuploader.min.js"></script>
    <script src="static/plugins/ptfileupload/pt.fileupload.js"></script>
    <style>
        body {
            background: #f3f5fa;
            width: 1150px;
            margin: 0 auto;
        }
        .pt-form table {
            margin: 20px auto 0px auto;
        }
        .webuploader-pick {
            background-color: #d81b60;
            border: 1px solid #c40a4e;
            border-radius: 4px;
            color: #fff;
            padding: 5px 10px;
            float: right;
            margin: -10px 32px 0 0;
        }
        .webuploader-pick i.fa-upload {
            padding-right: 0.3em;
            color: #fff;
        }
    </style>
</head>
<body>
<div class="margin-lr">
    <div class="pt-title-theme3">
        <i class="fa fa-file-text"></i>
        <h4>借阅申请单</h4>
    </div>
    <div class="ptbody">
        <div class="pt-application-row">
            <div class="pt-subtitle">
                <i></i>
                <span>借阅审批</span>
            </div>
            <div class="pt-form">
                <form id="form1">
                    <table style="width: 100%;">
                        <tr>
                            <td class="tbtitle">借阅单编号</td>
                            <td>
                                <input id="formId" name="formId" type="hidden"
                                       value="${borrowForm.formId}"/>
                                <span style="color:#808080;">
                                        <input class="easyui-textbox" id="applyCode" name="applyCode" type="text"
                                               style="width:310px" value="${borrowForm.applyCode}"
                                               readonly/>
                                    </span>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle">姓名
                            </td>
                            <td>
                                <input class="easyui-textbox" id="borrowUserName" name="borrowUserName"
                                       type="text" style="width:310px"
                                       value="${borrowForm.borrowUserName}" readonly/>
                                <input type="hidden" id="borrowUserId" name="borrowUserId" type="text"
                                       style="width:310px" value="${borrowForm.borrowUserId}"
                                       readonly/>
                            </td>
                            <td class="tbtitle">
                                工作单位:
                            </td>
                            <td>
                                <input class="easyui-textbox" name="deptName" type="text" style="width:310px"
                                       value="${borrowForm.deptName}"
                                       data-options="tipPosition:'bottom'" readonly/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle">
                                邮编:
                            </td>
                            <td>
                                <input class="easyui-textbox" id="postCode" name="postCode" type="text"
                                       style="width:310px"
                                       value="${borrowForm.postCode}"
                                       data-options="tipPosition:'bottom'" readonly/>
                            </td>
                            <td class="tbtitle">
                                单位地址:
                            </td>
                            <td>
                                <input class="easyui-textbox" id="deptAddress" name="deptAddress" type="text"
                                       style="width:310px"
                                       value="${borrowForm.deptAddress}"
                                       data-options="tipPosition:'bottom'"/>
                                <input type="hidden" id="utilizationMethod" name="utilizationMethod" type="text"
                                       style="width:310px" value="${borrowForm.utilizationMethod}"
                                       readonly/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle">电话:</td>
                            <td>
                                <input class="easyui-textbox" id="telNumber" name="telNumber" type="text"
                                       style="width:310px"
                                       value="${borrowForm.telNumber}"
                                       data-options="tipPosition:'bottom'" readonly/>
                            </td>
                            <td class="tbtitle">流程状态</td>
                            <td>
                                <c:if test="${borrowForm.applyCode==null}">
                                    <font style="color:red"><b>未发起流程</b></font>
                                </c:if>
                                <c:if test="${borrowForm.flowState==0}">
                                    <font style="color:#00a55a;"><b>流程中[${borrowForm.flowStep}]</b></font>
                                </c:if>
                                <c:if test="${borrowForm.flowState==1}">
                                    <font style="color:#00a55a;"><b>已结束</b></font>
                                </c:if>
                                <c:if test="${borrowForm.flowState==-1}">
                                    <font style="color:#00a55a;"><b>已终止</b></font>
                                </c:if>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle">手机:</td>
                            <td>
                                <input class="easyui-textbox" id="borrowTel" name="telNumber" type="text"
                                       style="width:310px"
                                       value="${borrowForm.borrowTel}"
                                       data-options="tipPosition:'bottom'" readonly/>
                            </td>
                            <td class="tbtitle">涉密证书编号:</td>
                            <td>
                                <input class="easyui-textbox" id="certificateNumber" name="certificateNumber"
                                       type="text"
                                       style="width:310px"
                                       value="${borrowForm.certificateNumber}"
                                       data-options="tipPosition:'bottom'" readonly/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>资料用途</td>
                            <td colspan="3">
                                <input class="easyui-textbox" name="borrowPurpose"
                                       data-options="multiline:true,required:true"
                                       style="height:70px;width:98%"
                                       value="${borrowForm.borrowPurpose}" readonly>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle">用户备注</td>
                            <td colspan="3">
                                <input class="easyui-textbox" name="remark" data-options="multiline:true"
                                       style="height:70px;width:98%" value="${borrowForm.remark}" readonly>
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="pt-application-row">
            <div class="pt-subtitle">
                <i></i>
                <span>附件</span>
            </div>
            <div class="pt-fj clear">
                <div class="pt-process-formats">
                    <ul class="clear" id="thelist">
                    </ul>
                </div>
                <div id="picker">
                    <i class="fa fa-upload"></i>
                    上传附件
                </div>
            </div>
        </div>
        <div class="pt-application-row">
            <div class="pt-subtitle">
                <i></i>
                <span>借阅明细</span>
            </div>
            <div class="pt-spacing" style="padding:18px 10px">
                <div class="easyui-accordion">
                    <c:forEach items="${borrowInfoList}" var="borrowInfo">
                        <div style="overflow:hidden;"
                             title="档号:${borrowInfo.parentBorrowInfo.archivalCode}   ${borrowInfo.parentBorrowInfo.fileTitle}">
                            <table cellspacing="0" cellpadding="0">
                                <tr>
                                    <th style="width:6%;text-align:center;">件号</th>
                                    <th style="width:35%;text-align:center;">题名</th>
                                    <th style="width:10%;text-align:center;">密级</th>
                                    <th style="width:10%;text-align:center;">涉密页码</th>
                                    <th>
                                        <input type="checkbox" class="flat"
                                               id="electronic_all_${borrowInfo.parentBorrowInfo.fileId}"/>电子
                                        <input type="checkbox" class="flat"
                                               id="paper_all_${borrowInfo.parentBorrowInfo.fileId}"/>纸质
                                        <input type="checkbox" class="flat"
                                               id="original_all_${borrowInfo.parentBorrowInfo.fileId}"/>调阅原件
                                    </th>
                                    <th>
                                        <input type="radio" class="flat"
                                               name="agreeGroupAll_${borrowInfo.parentBorrowInfo.fileId}"
                                               id="agree_all_${borrowInfo.parentBorrowInfo.fileId}"/>
                                        同意
                                        <input type="radio" class="flat"
                                               name="agreeGroupAll_${borrowInfo.parentBorrowInfo.fileId}"
                                               id="notAgree_all_${borrowInfo.parentBorrowInfo.fileId}"/>
                                        不同意
                                    </th>
                                    <th style="text-align:center">浏览</th>
                                </tr>
                                <c:forEach items="${borrowInfo.borrowDetailList}"
                                           var="borrowDetail">
                                    <tr>
                                        <td style="text-align:center;">${borrowDetail.itemNumber}</td>
                                        <td style="text-align:center;">${borrowDetail.itemTitle}</td>
                                        <td style="text-align:center;">${borrowDetail.securityClassification}</td>
                                        <td style="text-align:center;">${borrowDetail.securityPageNum}</td>
                                        <td>
                                            <input type="checkbox" class="flat"
                                                   id="electronic_${borrowDetail.detailId}"
                                                   name="electronic_${borrowDetail.fileId}"/>电子
                                            <input type="checkbox" class="flat"
                                                   id="paper_${borrowDetail.detailId}"
                                                   name="paper_${borrowDetail.fileId}"/>纸质
                                            <input type="checkbox" class="flat"
                                                   id="original_${borrowDetail.detailId}"
                                                   name="original_${borrowDetail.fileId}"/>调阅原件
                                        </td>
                                        <td>
                                            <input type="radio" class="flat"
                                                   name="agreeGroup_${borrowDetail.detailId}"
                                                   id="agree_${borrowDetail.detailId}"/>
                                            同意
                                            <input type="radio" class="flat"
                                                   name="agreeGroup_${borrowDetail.detailId}"
                                                   id="notAgree_${borrowDetail.detailId}"/>
                                            不同意
                                        </td>
                                        <td style="text-align:center;padding:0"
                                            id="browse_file_${borrowDetail.detailId}">
                                        </td>
                                    </tr>
                                </c:forEach>
                            </table>
                        </div>
                    </c:forEach>
                </div>
            </div>
        </div>
        <div class="pt-application-row">
            <div class="pt-subtitle">
                <i></i>
                <span>流程记录</span>
                <i></i>
                <a href="javascript:showFlowDiagram();">
                    <span style="color: #0a84ff">流程示意图</span>
                </a>
            </div>
            <div class="pt-tablelist">
                <table cellspacing="0" cellpadding="0">
                    <tr>
                        <th>序号</th>
                        <th>办理环节</th>
                        <th>办理人员</th>
                        <th>办理意见</th>
                        <th>处理时间</th>
                    </tr>
                    <c:forEach items="${historyTaskList}" varStatus="status" var="history">
                        <tr>
                            <td>${status.index+1 }</td>
                            <td>${history.taskName }</td>
                            <td>${history.assigneeUserName }</td>
                            <c:if test="${history.deleteReason!=null&&'ROLL_BACK'.equals(history.deleteReason)}">
                                <td>[退回]${history.approvalComment }</td>
                            </c:if>
                            <c:if test="${history.deleteReason!=null&&'PROCESS_INSTANCE_DELETED'.equals(history.deleteReason)}">
                                <td>[终止]${history.approvalComment }</td>
                            </c:if>
                            <c:if test="${history.deleteReason==null||(!'ROLL_BACK'.equals(history.deleteReason)&&!'PROCESS_INSTANCE_DELETED'.equals(history.deleteReason))}">
                                <td>${history.approvalComment }</td>
                            </c:if>
                            <td>
                                <fmt:formatDate value="${history.endTime }" pattern="yyyy-MM-dd HH:mm:ss"/>
                            </td>
                        </tr>
                    </c:forEach>
                </table>
            </div>
        </div>
        <div class="pt-application-btn">
            <%--            <button class="pt-btn pt-btn-primary" onclick="saveBorrowDetail()">保存信息</button>--%>
            <c:if test="${task!=null || approvePermission}">
                <button class="pt-btn pt-btn-primary" onclick="dealFlow()">流程办理</button>
            </c:if>
            <%--            <c:if test="${borrowForm.flowState==1}">--%>
            <%--                <button class="pt-btn pt-btn-warning" onclick="reportPrinting()"><i class="fa fa-map-o"></i>打印借阅单--%>
            <%--                </button>--%>
            <%--            </c:if>--%>
            <button class="pt-btn pt-btn-default" onclick="closeWindow()">关闭</button>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    var selectId = '0';
    var params = {
        callBack: null,
        callBackParams: null
    };
    $(function () {
        new ResizeScroll({
            "id": ".ptbody", fun: function () {
                var wh = $(window).height();
                return (wh - 36 - 28 - 10);
            }
        });
        //渲染所有checkbox
        $('input[type=radio],input[type="checkbox"].flat').iCheck({
            checkboxClass: 'icheckbox_flat-red',
            radioClass: 'iradio_square-green',
            increaseArea: '50%',
        });
        <c:forEach items="${borrowInfoList}" var="borrowInfo">
        //全部电子选中与否
        $('#electronic_all_${borrowInfo.parentBorrowInfo.fileId}').on('ifChecked', function (event) {
            $("input[name='electronic_${borrowInfo.parentBorrowInfo.fileId}']").iCheck('check');
        });
        $('#electronic_all_${borrowInfo.parentBorrowInfo.fileId}').on('ifUnchecked', function (event) {
            $("input[name='electronic_${borrowInfo.parentBorrowInfo.fileId}']").iCheck('uncheck');
        });
        //全部纸质选中与否
        $('#paper_all_${borrowInfo.parentBorrowInfo.fileId}').on('ifChecked', function (event) {
            $("input[name='paper_${borrowInfo.parentBorrowInfo.fileId}']").iCheck('check');
        });
        $('#paper_all_${borrowInfo.parentBorrowInfo.fileId}').on('ifUnchecked', function (event) {
            $("input[name='paper_${borrowInfo.parentBorrowInfo.fileId}']").iCheck('uncheck');
        });
        //全部原件借出选中与否
        $('#original_all_${borrowInfo.parentBorrowInfo.fileId}').on('ifChecked', function (event) {
            $("input[name='original_${borrowInfo.parentBorrowInfo.fileId}']").iCheck('check');
        });
        $('#original_all_${borrowInfo.parentBorrowInfo.fileId}').on('ifUnchecked', function (event) {
            $("input[name='original_${borrowInfo.parentBorrowInfo.fileId}']").iCheck('uncheck');
        });
        //全部同意与否
        $('#agree_all_${borrowInfo.parentBorrowInfo.fileId}').on('ifChecked', function (event) {
            <c:forEach items="${borrowInfo.borrowDetailList}" var="borrowDetail">
            $("input[id='agree_${borrowDetail.detailId}']").iCheck('check');
            </c:forEach>
        });
        $('#notAgree_all_${borrowInfo.parentBorrowInfo.fileId}').on('ifChecked', function (event) {
            <c:forEach items="${borrowInfo.borrowDetailList}" var="borrowDetail">
            $("input[id='notAgree_${borrowDetail.detailId}']").iCheck('check');
            </c:forEach>
        });
        </c:forEach>
        <c:forEach items="${allBorrowDetailList}" var="borrowDetail">
        if ('${borrowDetail.electronic}' == '1') {
            $("#electronic_${borrowDetail.detailId}").iCheck('check');
        }
        if ('${borrowDetail.paper}' == '1') {
            $("#paper_${borrowDetail.detailId}").iCheck('check');
        }
        if ('${borrowDetail.original}' == '1') {
            $("#original_${borrowDetail.detailId}").iCheck('check');
        }
        if ('${borrowDetail.agree}' == '1') {
            $("#agree_${borrowDetail.detailId}").iCheck('check');
        }
        if ('${borrowDetail.agree}' == '0') {
            $("#notAgree_${borrowDetail.detailId}").iCheck('check');
        }
        //审核过的不允许选择同意与否,选中与否
        <c:if test="${borrowForm.flowState!=0}">
        $("#electronic_all_${borrowDetail.fileId}").iCheck('disable');
        $("#paper_all_${borrowDetail.fileId}").iCheck('disable');
        $("#original_all_${borrowDetail.fileId}").iCheck('disable');
        $('#agree_all_${borrowDetail.fileId}').iCheck('disable');
        $('#notAgree_all_${borrowDetail.fileId}').iCheck('disable');
        $("#electronic_${borrowDetail.detailId}").iCheck('disable');
        if ('${borrowDetail.electronic}' == '1') {
            $("#electronic_${borrowDetail.detailId}").parent().attr('class', 'icheckbox_flat-red checked');
        }
        $("#apeer_${borrowDetail.detailId}").iCheck('disable');
        if ('${borrowDetail.paper}' == '1') {
            $("#paper_${borrowDetail.detailId}").parent().attr('class', 'icheckbox_flat-red checked');
        }
        $("#original_${borrowDetail.detailId}").iCheck('disable');
        if ('${borrowDetail.original}' == '1') {
            $("#original_${borrowDetail.detailId}").parent().attr('class', 'icheckbox_flat-red checked');
        }
        $("#agree_${borrowDetail.detailId}").iCheck('disable');
        <c:if test="${borrowDetail.agree==1}">
        $("#agree_${borrowDetail.detailId}").parent().attr('class', 'iradio_square-red checked');
        </c:if>
        $("#notAgree_${borrowDetail.detailId}").iCheck('disable');
        <c:if test="${borrowDetail.agree==0}">
        $("#notAgree_${borrowDetail.detailId}").parent().attr('class', 'iradio_square-green checked');
        </c:if>
        </c:if>
        $('#browse_file_${borrowDetail.detailId}').html('');
        $.ajax({
            url: "fileView/checkHasAttach?keyId=${borrowDetail.itemId}&type=${borrowDetail.borrowType}",    //请求的url地址
            dataType: "json",   //返回格式为json
            type: "post",
            async: false,
            success: function (data) {
                if (data) {
                    var html = "<a href='fileView/viewFile?keyId=${borrowDetail.itemId}&type=${borrowDetail.borrowType}' target='_blank' class='pt-color-primary'><i class='fa fa-eye' title='浏览'></i></a>";
                    $('#browse_file_${borrowDetail.detailId}').append(html);
                }
            }
        })
        </c:forEach>
        loadAttachList();
    });
    //选中并且清除灰色样式
    function setCheckedDisableAndClearDisableCss(type, id) {
        $("#" + type + "_" + id).iCheck('check');
        $("#" + type + "_" + id).iCheck('disable');
        $("#" + type + "_" + id).parent().attr('class', 'icheckbox_flat-red checked');
    }
    //不选中,允许可选
    function setUnCheckedEnable(type, id) {
        $("#" + type + "_" + id).iCheck('uncheck');
        $("#" + type + "_" + id).iCheck('enable');
    }
    //不选中,不可选
    function setUnCheckedDisable(type, id) {
        $("#" + type + "_" + id).iCheck('uncheck');
        $("#" + type + "_" + id).iCheck('disable');
    }
    //保存所有选中状态
    function saveBorrowDetail() {
        var array = [];
        <c:forEach items="${allBorrowDetailList}" var="borrowDetail">
        var detailId = '${borrowDetail.detailId}';
        var electronic = $("#electronic_" + detailId).is(':checked') == true ? 1 : 0;
        var paper = $("#paper_" + detailId).is(':checked') == true ? 1 : 0;
        var original = $("#original_" + detailId).is(':checked') == true ? 1 : 0;
        var agree = $("#agree_" + detailId).is(':checked');
        var notAgree = $("#notAgree_" + detailId).is(':checked');
        var borrowDetailInfo;
        if (agree) {
            agree = 1;
        } else {
            agree = 0;
        }
        ;
        borrowDetailInfo = {
            "detailId": detailId,
            "electronic": electronic,
            "paper": paper,
            "original": original,
            "agree": agree
        };
        array.push(borrowDetailInfo);
        </c:forEach>
        wcp.ui.setBusy("body", wcp.ajax({
            url: "borrow/saveBorrowDetail",
            data: JSON.stringify(array),
        }).done(function (result) {
            wcp.notify.success('保存成功!');
        }));
    }
    function dealFlow() {
        saveBorrowDetail();
        var url = "flow/dealFlow?keyId=${borrowForm.formId}&processInstanceId=${processInstanceId}&taskId=${task.taskId}";
        var title = "流程办理";
        top.layer.open({
            title: title,
            type: 2,
            area: ["680px", "550px"],
            fixed: false,
            content: url,
            success: function (layero, index) {
                var body = window.top.layer.getChildFrame('body', index);
                var iframeWin = window.top[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象
                //将表单参数传给流程办理页面
                var formData = $("#form1").serializeObject();
                iframeWin.params.variables = formData;
                iframeWin.params.callBack = dealFlowCallBack;
            }
        });
    }
    function dealFlowCallBack() {
        //saveArchivesUtilizationForm();
        //判断是否需要执行回调函数
        if (params.callBack) {
            if (params.callBackParams) {
                params.callBack(params.callBackParams);
            } else {
                params.callBack();
            }
        }
        closeWindow();
    }
    function closeWindow() {
        var title = top.$('#tt').tabs('getSelected').panel("options").title;
        top.$("#tt").tabs("close", title);
    }
    //上传附件
    var $list = $('#thelist');
    var addFile = [];//增加的附件
    var deleteFile = [];//删除的附件,只存已在数据库中数据
    //上传附件
    var fileUpload = new FileUpload({
        auto: true,
        serverPath: 'general/uploadFile?moduleId=${borrowFormModule.moduleId}&tableId=${borrowFormModule.mainTableId}&keyId=${borrowForm.formId}&attachType=0',
        fileSingleSizeLimit: 1024 * 1024 * 1024,
        uploadSuccess: function (file, response) {
            response = eval(response);
            addFile.push(response.result);
            var uploadName = response.result.uploadName;
            var attachUrl = response.result.attachUrl.replace(/\\/g, "\\\\");
            var attachViewUrl = response.result.attachViewUrl.replace(/\\/g, "\\\\");
            var physicalName = response.result.physicalName;
            $('#' + file.id).find('.pt-process-bar').fadeOut();
            $('#' + file.id).find('span.state').text('已上传');
            $('#' + file.id).children("div").append('<div class="pt-process-formats-btn" style="float:left">'
                + '<a href="javascript:;" class="pt-color-success" onclick="viewFile(\'0\',\'0\',\'' + attachViewUrl + '\')"><i class="fa fa-eye" title="查看"></i>查看</a>'
                + '<a href="javascript:;" class="pt-color-danger" onclick="removeFile(\'' + file.id + '\',\'' + uploadName + '\')"><i class="fa fa-trash-o" title="删除"></i>删除</a>'
                + '<a href="javascript:;" class="pt-color-primary" onclick="downLoadFile(0,\'' + attachUrl + '\',\'' + physicalName + '\')"><i class="fa fa-download" title="下载"></i>下载</a></div>');
            saveAttachs('${borrowForm.formId}');
        },
        fileQueued: function (file) {
            $list.append('<li id="' + file.id + '"><img src="static/styles/images/' + getImg('.' + file.ext) + '">'
                + '<div class="pt-process-formats-txt"><h5 title="' + file.name + '">' + file.name + '</h5>'
                + '<div class="pt-process-bar"><div class="bar"><div class="subbar"></div></div><span class="state">等待上传...</span></div></div></li>');
        },
        uploadProgress: function (file, percentage) {
            var $li = $('#' + file.id),
                $percent = $li.find('.subbar');
            $li.find('span.state').text('上传中');
            $percent.css('width', percentage * 100 + '%');
        },
        uploadError: function (file, reason) {
            $('#' + file.id).find('span.state').text('上传出错').parent().append("<i class='fa fa-close pt-color-danger'></i>");
        },
        //捕捉加入队列前的错误
        uploadBeforeError: function (type) {
            wcp.notify.error("上传出错!请检查后重新上传!错误代码" + type);
        },
        uploadComplete: function (file) {
        }
    });
    $list.delegate('i.fa-close', 'click', function (event) {
        $(this).closest("li").remove();
    });
    //加载附件列表
    function loadAttachList() {
        $list.html('');
        $.ajax({
            type: 'POST',
            contentType: "application/json; charset=utf-8",
            async: false,//取消异步请求
            url: 'general/getAttachList?moduleId=${borrowFormModule.moduleId}&keyId=${borrowForm.formId}',
            success: function (data) {
                for (var i = 0; i < data.length; i++) {
                    var img = getImg(data[i].extension);
                    var attachUrl = data[i].attachUrl.replace(/\\/g, "\\\\");
                    var attachId = data[i].attachId;
                    var physicalName = data[i].physicalName;
                    var attachType = data[i].attachType;
                    var extension = data[i].extension.toLowerCase();
                    if (attachType == 0) {
                        var htmlStr = '<li id="' + data[i].attachId + '">'
                            + '<img src="static/styles/images/' + img + '" alt="">'
                            + '<div class="pt-process-formats-txt">'
                            + '   <h5 title="${attach.physicalName}">' + physicalName + '</h5> '
                            + '   <div class="pt-process-formats-btn">'
                            + '       <a href="javascript:;" class="pt-color-success" onclick="viewFile(\'' + attachId + '\',0)">'
                            + '           <i class="fa fa-eye" title="查看"></i>查看</a> ';
                        if (extension == ".doc" || extension == ".docx" || extension == ".xls" || extension == ".xlsx") {
                            htmlStr += '<a href="javascript:;" class="pt-color-primary" onclick="viewFile(\'' + attachId + '\',1)">'
                                + '           <i class="fa fa-pencil" title="编辑"></i>编辑</a>';
                        }
                        htmlStr += '<a href="javascript:;" class="pt-color-danger" onclick="removeFile(\'' + attachId + '\',null,\'' + attachUrl + '\')">'
                            + '           <i class="fa fa-trash-o" title="删除"></i>删除</a>'
                            + '       <a href="javascript:;" class="pt-color-primary" onclick="downLoadFile(\'' + attachId + '\',\'' + attachUrl + '\',\'' + physicalName + '\')">'
                            + '           <i class="fa fa-download" title="下载"></i>下载</a>'
                            + '   </div>'
                            + '</div>'
                            + '</li> ';
                        $list.append(htmlStr);
                    } else if (attachType == 1) {
                        var mainBodyAttachHtml = '<div  id="' + attachId + '" class="form-unit-text clear">'
                            + '<img src="static/styles/images/' + img + '">'
                            + '<p>' + physicalName + '</p> '
                            + '<div class="pt-process-formats-btn">'
                            + '    <a href="javascript:;" class="pt-color-success" onclick="viewFile(\'' + attachId + '\',0)">'
                            + '    <i class="fa fa-eye" title="查看"></i>查看</a>'
                            + '    <a href="javascript:;" class="pt-color-danger" onclick="removeFile(\'' + attachId + '\',null,\'' + attachUrl + '\')">'
                            + '    <i class="fa fa-trash-o" title="删除"></i>删除</a>'
                            + '    <a href="javascript:;" class="pt-color-primary" onclick="downLoadFile(\'' + attachId + '\',\'' + attachUrl + '\',\'' + physicalName + '\')">'
                            + '    <i class="fa fa-download" title="下载"></i>下载</a>'
                            + '    <a href="javascript:;" class="pt-color-warning">'
                            + '</div> '
                            + '</div>';
                        $('#divMainBodyAttach').html('');
                        $('#divMainBodyAttach').append(mainBodyAttachHtml);
                    }
                }
            }
        });
    }
    function getImg(ext) {
        var ret = "";
        switch (ext) {
            case "wps":
            case "docx":
            case "doc":
                ret = "formats-word.png";
                break;
            case "et":
            case "xlsx":
            case "xls":
                ret = "formats-excel.png";
                break;
            case "pptx":
            case "ppt":
                ret = "formats-ppt.png";
                break;
            case "pdf":
                ret = "formats-pdf.png";
                break;
            case "zip":
                ret = "formats-zip.png";
                break;
            case "png":
            case "jpg":
            case "jpeg":
            case "bmp":
            case "gif":
                ret = "formats-img.png";
                break;
            default:
                ret = "formats-lcurrency.png";
                break;
        }
        return ret;
    }
    function downLoadFile(attachId, attachUrl, physicalName) {
        var url = 'general/beforeDownloadAttach?attachId=' + attachId;
        $.ajax({
            type: 'POST',
            url: "general/beforeDownloadAttach?attachId=" + attachId,
            async: false,
            success: function (data) {
                if (data == "noAuthorize") {
                    wcp.message.error('对不起,您无权限下载此附件!');
                } else if (data == "noFile") {
                    wcp.message.error('对不起,不存在此附件!');
                } else {
                    dowloadAttachFunction(attachId, attachUrl, physicalName);
                }
            }
        });
    }
    //下载附件
    function dowloadAttachFunction(attachId, attachUrl, physicalName) {
        var url = 'general/downLoadAttach?attachId=' + attachId;
        //创建form
        var form = document.getElementById('#downLoadForm');
        if (form == null) {
            form = $("<form>");
            form.attr("id", "downLoadForm");
            form.attr("style", "display:none");
            form.attr("target", "");
            form.attr("method", "post");
            $("body").append(form);
        }
        form.attr("action", url);
        //附件地址
        var inputAttachUrl = document.getElementById('#iptAttachUrl');
        if (inputAttachUrl == null) {
            inputAttachUrl = $("<input>");
            inputAttachUrl.attr("id", "iptAttachUrl");
            form.append(inputAttachUrl);
        }
        inputAttachUrl.attr("type", "hidden");
        inputAttachUrl.attr("name", "attachUrl");
        inputAttachUrl.val(attachUrl);
        //附件物理名称
        var inputPhysicalName = document.getElementById('#iptphysicalName');
        if (inputPhysicalName == null) {
            inputPhysicalName = $("<input>");
            inputPhysicalName.attr("id", "iptphysicalName");
            form.append(inputPhysicalName);
        }
        inputPhysicalName.attr("type", "hidden");
        inputPhysicalName.attr("name", "physicalName");
        inputPhysicalName.val(physicalName);
        form.submit();
    }
    //浏览附件
    function viewFile(attachId, isEdit, attachViewUrl) {
        var url = 'general/viewFile?attachId=' + attachId + '&isEdit=' + isEdit + '&attachViewUrl=' + encodeURIComponent(attachViewUrl);
        // top.addPanel(url, '附件浏览' + attachId);
        window.open(url);
    }
    //移除附件,临时上传文件暂时未删除
    function removeFile(attachId, uploadName, attachUrl) {
        try {
            $('#' + attachId).closest("li").remove();
        } catch (e) {
        }
        try {
            $('#' + attachId).closest("div").remove();
        } catch (e) {
        }
        if (uploadName == null) {
            deleteFile.push({'attachId': attachId, "attachUrl": attachUrl});
            deleteAttachs();
        } else {
            removeAaary(addFile, uploadName); //移除临时保存的
        }
    }
    /*删除数组中的某一个对象
    _arr:数组
    _obj:需删除的对象
    */
    function removeAaary(_arr, _obj) {
        var length = _arr.length;
        for (var i = 0; i < length; i++) {
            if (_arr[i].uploadName == _obj) {
                if (i == 0) {
                    _arr.shift(); //删除并返回数组的第一个元素
                    return _arr;
                } else if (i == length - 1) {
                    _arr.pop();  //删除并返回数组的最后一个元素
                    return _arr;
                } else {
                    _arr.splice(i, 1); //删除下标为i的元素
                    return _arr;
                }
            }
        }
    }
    //保存增加的附件数据,数据新增时keyId不为null
    function saveAttachs(keyId) {
        var url = "api/general/saveAttachs";
        if (keyId != null) {
            url = url + "?keyId=" + keyId;
        }
        $.ajax({
            type: 'POST',
            contentType: "application/json; charset=utf-8",
            url: url,
            dataType: 'json',
            data: JSON.stringify(addFile),
            async: false,//取消异步请求
            success: function (data) {
                addFile = [];
            }
        });
    }
    //删除指定的附件数据
    function deleteAttachs() {
        $.ajax({
            type: 'POST',
            contentType: "application/json; charset=utf-8",
            url: "api/general/deleteAttachs",
            dataType: 'json',
            data: JSON.stringify(deleteFile),
            async: false,//取消异步请求
            success: function (data) {
                deleteFile = [];
            }
        });
    }
    function openTab(url, title, partId, type) {
        top.addPanel(url, title);
        var curTabWin = null;
        var curTab = top.$('#tt').tabs('getSelected');
        if (curTab && curTab.find('iframe').length > 0) {
            curTabWin = curTab.find('iframe')[0].contentWindow;
            //将回调函数传给子页面
            $(curTabWin).load(function () {
                if (curTabWin.params) {
                    curTabWin.params.callBackParams = partId;
                    curTabWin.params.callBack = getPartContent;
                    if (type == 1) {
                        curTabWin.params.callBack = refreshData;
                    }
                }
            });
        }
    }
    //打印借阅单
    function reportPrinting() {
        var applyCode = $("#applyCode").textbox("getValue");
        var borrowUserName = $("#borrowUserName").textbox("getValue");
        var fileName = applyCode + "_" + borrowUserName;
        // var reportFile = "borrow_approval.ureport.xml";
        var reportFile = "borrow_approval_hn.ureport.xml"
        var path = "<%=path%>";
        var url = path + "/ureport/preview?_u=file:" + reportFile + "&_i=&_n=" + fileName + "&formId=" + '${borrowForm.formId}';
        window.open(url);
    }
    /**
     * 流程示意图
     */
    function showFlowDiagram() {
        top.layer.open({
            title: "流程示意图",
            type: 2,
            area: ['1100px', '600px'],
            shadeClose: true, //点击遮罩关闭
            content: 'flow/showFlowDiagram?processInstanceId=${processInstanceId}'
        });
    }
</script>
</html>
src/main/webapp/WEB-INF/view/gh/borrow/index.jsp
New file
@@ -0,0 +1,647 @@
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <title>借阅申请</title>
    <!-- 字体 -->
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/material-teal.css" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/styles/archivesHN.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/icheck/skins/all.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-edatagrid/jquery.edatagrid.js"></script>
    <script type="text/javascript" src="static/plugins/icheck/icheck.min.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <script type="text/javascript" src="static/plugins/ace/src-noconflict/ace.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
    <style>
        .pink {
            background: #FC9D9A;
        }
    </style>
</head>
<body>
<div class="application">
    <%--    <div class="application-title">--%>
    <%--        <div class="application-title-c clear"><span class="borrow-title"></span>--%>
    <%--            <h3>借阅申请</h3></div>--%>
    <%--    </div>--%>
    <div class="application-step">
        <ul class="clear">
            <li class="steped"><span><i class="fa fa-check"></i></span><a href="javascript:;">填写利用内容</a><b></b>
            </li>
            <li><a href="javascript:;"><span>2</span>填写用户信息</a><b></b></li>
            <li><a href="javascript:;"><span>3</span>成功提交利用单</a></li>
        </ul>
        <p><span>注意:</span>如果您还需同时借阅其他案件,请先关闭该窗口,继续在查询界面将所需要的案卷添加到借阅单,再一并提交。
        </p>
    </div>
    <c:if test="${borrowInfoList.size()==0}">
        <div class="noadd">
            <i class="fa fa-dropbox"></i>
            <h5>未选择任何资料!</h5>
            <p>当前您还未选择任何资料,请先在<a href="javascript:;">资料查询</a>页面查询您所需要的资料</p>
        </div>
        <div class="application-btn">
            <button class="pt-btn pt-btn-default pt-btn-success " onclick="addBorrowDetail()">添加</button>
            <button class="pt-btn pt-btn-default pt-btn-warning" onclick="closeWindow()">关闭</button>
        </div>
    </c:if>
    <c:if test="${borrowInfoList.size()>0}">
        <div id="divInfoStep1" class="application-con">
            <div class="contit">
                <h4>利用明细</h4>
                <button onclick="deleteAllBorrowDetail()" class="pt-btn pt-btn-danger pt-btn-padding pull-right">
                    全部删除
                </button>
                <button onclick="addBorrowDetail()" class="pt-btn pt-btn-success pt-btn-padding pull-right">
                    添加
                </button>
            </div>
            <div class="pt-form">
                <div class="application-body">
                    <c:forEach items="${borrowInfoList}" var="borrowInfo">
                        <div class="application-listli" id="list_${borrowInfo.parentBorrowInfo.fileId}">
                            <div class="listli-title" id="tr_${borrowInfo.parentBorrowInfo.fileId}">
                                <span class="txt_fold">档号:${borrowInfo.parentBorrowInfo.archivalCode}</span>&nbsp;&nbsp;&nbsp;&nbsp;<span
                                    class="txt_fold txt_blue">${borrowInfo.parentBorrowInfo.fileTitle}</span>
                                <i class="fa fa-times-circle pull-right" style="padding: 0px 5px 0px 5px"
                                   onclick="deleteBorrowDetail('${borrowInfo.parentBorrowInfo.fileId}')"></i>&nbsp&nbsp
                                <i class="fa fa-plus-square pull-right" style="padding: 0px 5px 0px 5px"
                                   onclick="addBorrowDetailByUser('${borrowInfo.parentBorrowInfo.fileId}')"></i>
                            </div>
                            <div class="detailed">
                                <table style="width: 100%;">
                                    <tr class="detailed-th" id="trhead_${borrowInfo.parentBorrowInfo.fileId}">
                                        <td style="width: 10%">件号</td>
                                        <td style="width: 45%">题名</td>
                                        <td style="width: 10%">密级</td>
                                        <td style="width: 10%">涉密页码</td>
                                        <td style="width: 25%">
                                            <div class="cg">
                                                <input type="checkbox" class="flat cg"
                                                       name="electronic_cg_${borrowInfo.parentBorrowInfo.fileId}"
                                                       id="electronic_all_cg_${borrowInfo.parentBorrowInfo.fileId}"/>电子
                                                <input type="checkbox" class="flat cg"
                                                       name="paper_cg_${borrowInfo.parentBorrowInfo.fileId}"
                                                       id="paper_all_cg_${borrowInfo.parentBorrowInfo.fileId}"/>纸质
                                                <input type="checkbox" class="flat cg"
                                                       name="original_cg_${borrowInfo.parentBorrowInfo.fileId}"
                                                       id="original_all_cg_${borrowInfo.parentBorrowInfo.fileId}"/>调阅原件
                                            </div>
                                        </td>
                                    </tr>
                                    <c:forEach items="${borrowInfo.borrowDetailList}" var="borrowDetail">
                                        <c:if test="${borrowDetail.securityClassification == null || borrowDetail.securityClassification != '' && borrowDetail.securityClassification == '公开'}">
                                            <tr class="tr_${borrowInfo.parentBorrowInfo.fileId}_0 cg">
                                        </c:if>
                                        <c:if test="${ borrowDetail.securityClassification == '内部' || borrowDetail.securityClassification == '秘密' || borrowDetail.securityClassification == '机密' ||borrowDetail.securityClassification == '绝密'}">
                                            <tr class="tr_${borrowInfo.parentBorrowInfo.fileId}_0 cg pink">
                                        </c:if>
                                        <td>${borrowDetail.itemNumber}</td>
                                        <td>${borrowDetail.itemTitle}</td>
                                        <td>${borrowDetail.securityClassification}</td>
                                        <td>${borrowDetail.securityPageNum}</td>
                                        <td><input type="checkbox" class="flat"
                                                   name="electronic_cg_${borrowInfo.parentBorrowInfo.fileId}"
                                                   id="electronic_${borrowDetail.detailId}"/>电子
                                            <c:if test="${ borrowDetail.paperBorrow == 1 }">
                                                <input type="checkbox" class="flat"
                                                       name="paper_no_cg_${borrowInfo.parentBorrowInfo.fileId}"
                                                       id="paper_no_${borrowDetail.detailId}" disabled/>纸质
                                                <input type="checkbox" class="flat"
                                                       name="original_no_cg_${borrowInfo.parentBorrowInfo.fileId}"
                                                       id="original_no_${borrowDetail.detailId}" disabled/>调阅原件
                                            </c:if>
                                            <c:if test="${ borrowDetail.paperBorrow == 0|| borrowDetail.paperBorrow == null}">
                                                <input type="checkbox" class="flat"
                                                       name="paper_cg_${borrowInfo.parentBorrowInfo.fileId}"
                                                       id="paper_${borrowDetail.detailId}"/>纸质
                                                <input type="checkbox" class="flat"
                                                       name="original_cg_${borrowInfo.parentBorrowInfo.fileId}"
                                                       id="original_${borrowDetail.detailId}"/>调阅原件
                                            </c:if>
                                        </td>
                                        </tr>
                                    </c:forEach>
                                </table>
                            </div>
                        </div>
                    </c:forEach>
                </div>
            </div>
        </div>
    </c:if>
    <div id="divInfoStep2" style="display:none" class="application-con">
        <div class="contit"><h4>借阅人信息</h4></div>
        <div class="pt-form">
            <form id="form1" method="post">
                <div class="application-body">
                    <div class="application-c2">
                        <div class="application-li2">
                            <table style="width:100%;">
                                <tr>
                                    <td class="tbtitle">借阅单编号:</td>
                                    <td colspan="3">[自动生成]</td>
                                </tr>
                                <tr>
                                    <td class="tbtitle"><em class="pt-color-danger">*</em> 姓名:</td>
                                    <td style="width: 35%;">
                                        <input class="easyui-textbox" id="borrowUserName" name="borrowUserName"
                                               type="text" style="width:300px;" value="${curUserName}"
                                               data-options="required:true,tipPosition:'bottom',buttonText:'选',prompt:'请选择利用人...',onClickButton:function(){selectBorrowName(); }"/>
                                        <input id="borrowUserId" class="easyui-textbox" name="borrowUserId"
                                               type="hidden"
                                               value="${curUserId}"/>
                                    </td>
                                    <td class="tbtitle"><em class="pt-color-danger">*</em>工作单位:</td>
                                    <td style="width: 35%;">
                                        <input class="easyui-textbox" id="deptName"
                                               name="deptName" type="text" style="width:300px"
                                               data-options="required:true"
                                               value=""/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tbtitle"> 邮编:</td>
                                    <td style="width: 35%;">
                                        <input class="easyui-textbox" id="postCode"
                                               name="postCode" type="text" style="width:300px"
                                               value=""/>
                                    </td>
                                    <td class="tbtitle"><em class="pt-color-danger">*</em>单位地址:</td>
                                    <td style="width: 35%;">
                                        <input class="easyui-textbox" id="deptAddress"
                                               name="deptAddress" type="text" style="width:300px"
                                               value=""/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tbtitle"><em class="pt-color-danger">*</em> 利用日期:</td>
                                    <td style="width: 35%;"><input class="easyui-datebox" id="borrowDate"
                                                                   name="borrowDate" type="text" style="width:300px"
                                                                   editable="false"
                                                                   data-options="required:true,tipPosition:'bottom',onSelect:onSelectStartDate"
                                                                   value="${dateNow}"/></td>
                                    <td class="tbtitle"><em class="pt-color-danger">*</em> 截止日期:</td>
                                    <td style="width: 35%;"><input class="easyui-datebox" id="borrowValidDate"
                                                                   name="borrowValidDate" type="text"
                                                                   style="width:300px"
                                                                   editable="false"
                                                                   data-options="required:true,tipPosition:'bottom',onSelect:onSelectEndDate"
                                                                   value="${borrowValidDate}"/></td>
                                </tr>
                                <tr>
                                    <td class="tbtitle">电话:</td>
                                    <td style="width: 35%;">
                                        <input class="easyui-textbox" id="telNumber"
                                               name="telNumber" type="text" style="width:300px"
                                               value=""/>
                                    </td>
                                    <td class="tbtitle"><em class="pt-color-danger">*</em>手机:</td>
                                    <td style="width: 35%;">
                                        <input class="easyui-textbox" id="borrowTel"
                                               name="borrowTel" type="text" style="width:300px"
                                               data-options="required:true"
                                               value=""/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tbtitle">身份证号:</td>
                                    <td style="width: 35%;">
                                        <input class="easyui-textbox" id="idCard"
                                               name="idCard" type="text" style="width:300px"
                                               value=""/>
                                    </td>
                                    <td class="tbtitle"><em class="pt-color-danger">*</em>是否通过流程:</td>
                                    <td style="width: 35%;">
                                        <input class="easyui-radiobutton" type="radio" class="flat" value="0"
                                               name="utilizationMethod"
                                               id="agree_utilizationMethod"/>
                                        是
                                        <input class="easyui-radiobutton" type="radio" class="flat" value="1"
                                               name="utilizationMethod"
                                               id="notAgree_utilizationMethod"/>
                                        否
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tbtitle">部门名称:</td>
                                    <td colspan="3">
                                        <input class="easyui-textbox" id="borrowDept"
                                               type="text" style="width:785px"
                                               value="${curDeptName}"/>
                                        <input class="easyui-textbox" id="borrowDeptId"
                                               type="hidden" value="${curDeptId}"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tbtitle"><em class="pt-color-danger">*</em>资料用途:</td>
                                    <td colspan="3">
                                        <input class="easyui-textbox" name="borrowPurpose"
                                               data-options="required:true"
                                               style="height:60px;width:785px">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tbtitle">用户备注:</td>
                                    <td colspan="3">
                                        <input class="easyui-textbox" name="remark" data-options="multiline:true"
                                               style="height:60px;width:785px">
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div id="divInfoStep3" style="display:none" class="submitted">
        <i class="fa fa-check-circle"></i>
        <h5>申请单已提交成功!</h5>
        <p>纸质借阅请到借阅管理员处领取资料,电子借阅请在审批通过后到“我的借阅单”中查看</p>
    </div>
    <c:if test="${borrowInfoList.size()>0}">
        <div class="application-btn">
            <button id="btn_pre" class="pt-btn pt-btn-info" style="display:none" onclick="getPreStep()">上一步</button>
            <button id="btn_next" class="pt-btn pt-btn-info" onclick="saveBorrowDetail()">下一步</button>
            <button id="btn_submit" class="pt-btn pt-btn-success" style="display:none"
                    onclick="saveBorrowForm()">提交
            </button>
            <button id="btn_close" class="pt-btn pt-btn-default" onclick="closeWindow()">关闭</button>
        </div>
    </c:if>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script type="text/javascript">
    var curDeptName = "${curDeptName}";
    $(function () {
        if (curDeptName != null && curDeptName == "外部用户") {
            $("#processingUserName").combobox('readonly', true);
        }
        new ResizeScroll({
            "id": ".application-body", fun: function () {
                var wh = $(window).height();
                return (wh - 235);
            }
        });
        //渲染所有checkbox
        $('input[type="checkbox"].flat').iCheck({
            checkboxClass: 'icheckbox_flat-red',
            increaseArea: '50%'
        });
        <c:forEach items="${borrowInfoList}" var="borrowInfo">
        // 全部电子选中与否
        $(document).on('ifChecked', '#electronic_all_cg_${borrowInfo.parentBorrowInfo.fileId}', function (event) {
            $("input[name='electronic_cg_${borrowInfo.parentBorrowInfo.fileId}']").iCheck('check');
        });
        $(document).on('ifUnchecked', '#electronic_all_cg_${borrowInfo.parentBorrowInfo.fileId}', function (event) {
            $("input[name='electronic_cg_${borrowInfo.parentBorrowInfo.fileId}']").iCheck('uncheck');
        });
        //全部纸质选中与否
        $(document).on('ifChecked', '#paper_all_cg_${borrowInfo.parentBorrowInfo.fileId}', function (event) {
            $("input[name='paper_cg_${borrowInfo.parentBorrowInfo.fileId}']").iCheck('check');
        });
        $(document).on('ifUnchecked', '#paper_all_cg_${borrowInfo.parentBorrowInfo.fileId}', function (event) {
            $("input[name='paper_cg_${borrowInfo.parentBorrowInfo.fileId}']").iCheck('uncheck');
        });
        //全部原件借出选中与否
        $(document).on('ifChecked', '#original_all_cg_${borrowInfo.parentBorrowInfo.fileId}', function (event) {
            $("input[name='original_cg_${borrowInfo.parentBorrowInfo.fileId}']").iCheck('check');
        });
        $(document).on('ifUnchecked', '#original_all_cg_${borrowInfo.parentBorrowInfo.fileId}', function (event) {
            $("input[name='original_cg_${borrowInfo.parentBorrowInfo.fileId}']").iCheck('uncheck');
        });
        </c:forEach>
        // $(".ys").hide();
        //电子借阅,纸质借阅切换
        getBorrowUserInfo();
    });
    //上一步
    function getPreStep() {
        $("#step2").removeClass("steped");
        $("#step3").removeClass("steped");
        $("#step1").addClass("steped");
        $("#divInfoStep1").show();
        $("#divInfoStep2").hide();
        $("#btn_pre").hide();
        $("#btn_submit").hide();
        $("#btn_next").show();
    }
    //保存用户信息
    function saveBorrowForm() {
        var state = {'state': 0};
        var flowState = {'flowState': 0};
        var selectedValue = $('input[name="utilizationMethod"]:checked').val();
        console.log(selectedValue);
        var utilizationMethod = {'utilizationMethod': selectedValue};
        //验证表单信息
        var isValid = $('#form1').form('validate');
        if (!isValid) {
            wcp.notify.error('表单验证有误,请检查表单输入项!');
            return false;
        }
        var formData = $.extend({}, $("#form1").serializeObject(), state, flowState, utilizationMethod);
        wcp.ui.setBusy("body", wcp.ajax({
            url: "borrow/saveBorrowForm",
            data: JSON.stringify(formData),
        }).done(function (result) {
            $("#step1").removeClass("steped");
            $("#step2").removeClass("steped");
            $("#step3").addClass("steped");
            $("#divInfoStep1").hide();
            $("#divInfoStep2").hide();
            $("#divInfoStep3").show();
            $("#btn_pre").hide();
            $("#btn_next").hide();
            $("#btn_submit").hide();
        }));
    }
    function closeWindow() {
        window.close();
        var title = top.$('#tt').tabs('getSelected').panel("options").title;
        top.$("#tt").tabs("close", title);
    }
    //保存所有选中状态
    function saveBorrowDetail() {
        var array = [];
        <c:forEach items="${allBorrowDetailList}" var="borrowDetail">
        var detailId = '${borrowDetail.detailId}';
        var borrowDetail = null;
        var electronic = $("#electronic_" + detailId).is(':checked') == true ? 1 : 0;
        var paper = $("#paper_" + detailId).is(':checked') == true ? 1 : 0;
        var original = $("#original_" + detailId).is(':checked') == true ? 1 : 0;
        if (electronic == "1" || paper == "1" || original == "1") {
            borrowDetail = {
                "detailId": detailId,
                "electronic": electronic,
                "paper": paper,
                "original": original,
                "agree": 1
            };
            array.push(borrowDetail);
        }
        </c:forEach>
        if (array.length == 0) {
            wcp.notify.error('无明细信息,不能提交!');
            return;
        }
        wcp.ui.setBusy("body", wcp.ajax({
            url: "borrow/saveBorrowDetail",
            data: JSON.stringify(array),
        }).done(function (result) {
            $("#step1").removeClass("steped");
            $("#step2").addClass("steped");
            $("#divInfoStep1").hide();
            $("#divInfoStep2").show();
            $("#btn_pre").show();
            $("#btn_next").hide();
            $("#btn_submit").show();
        }));
    }
    //选择利用人
    function selectBorrowName() {
        wcp.picker.selectUser({
            title: "请选择利用人",
            multiSelect: false,
            idElement: "borrowUserId",
            nameElement: "borrowUserName",
            deptNameElement: "borrowDept",
            deptIdElement: "borrowDeptId",
            layerOpener: window
        });
    }
    //删除所有
    function deleteAllBorrowDetail() {
        layer.confirm('删除后将无法恢复,请确定是否全部删除?', {
            btn: ['是', '否'],
            offset: '300px'
        }, function () {
            <c:forEach items="${borrowInfoList}" var="archivalInfo">
            detail('${archivalInfo.parentBorrowInfo.fileId}');
            </c:forEach>
            wcp.notify.success('删除成功!');
        });
    }
    //删除
    function deleteBorrowDetail(fileId) {
        layer.confirm('删除后将无法恢复,请确定是否删除?', {
            btn: ['是', '否'],
            offset: '300px'
        }, function () {
            detail(fileId);
            wcp.notify.success('删除成功!');
        });
    }
    function detail(fileId) {
        wcp.ui.setBusy("body", wcp.ajax({
            url: "borrow/deleteBorrowDetail?fileId=" + fileId
        }).done(function (result) {
            $(".tr_" + fileId + "_0").remove();
            $(".tr_" + fileId + "_1").remove();
            $("#tr_" + fileId).remove();
            $("#trhead_" + fileId).remove();
            $("#list_" + fileId).remove();
        }));
    }
    //人员变换时事件
    $('#borrowUserName').textbox({
        onChange: function (value) {
            setTimeout(function () {
                getBorrowUserInfo(value);
            }, 1000);
        }
    });
    //添加信息
    function getBorrowUserInfo() {
        var deptName = $("#borrowDept").textbox('getValue');
        var borrowUserId = $("#borrowUserId").textbox('getValue');
        if (deptName != null && deptName == "外部用户") {
            wcp.ui.setBusy("body", wcp.ajax({
                url: "common/getUserInfo?userId=" + borrowUserId,
            }).done(function (result) {
                $("#deptName").textbox('setValue', result.dept);
                $("#postCode").textbox('setValue', result.postCode);
                $("#deptAddress").textbox('setValue', result.deptAddress);
                $("#telNumber").textbox('setValue', result.telNumber);
                $("#borrowTel").textbox('setValue', result.mobile);
                $("#certificateNumber").textbox('setValue', result.certificateNum);
                $("#borrowPurpose").textbox('setValue', result.purpose);
            }));
        }
    }
    function addBorrowDetail() {
        var pageUrl = "common/addDetailsIndex?type=0"
        openUrlByLayer(650, 270, pageUrl, "添加利用", null);
    }
    function addBorrowDetailByUser(fileId) {
        var pageUrl = "common/addDetailsByUserIndex?type=0&fileId=" + fileId
        openUrlByLayer(600, 470, pageUrl, "人工添加利用文件级", null);
    }
    //通过Layer打开窗口
    function openUrlByLayer(pageWidth, pageHeight, pageUrl, title, ids, defaultFull) {
        top.layer.open({
            title: title,
            type: 2,
            area: [pageWidth + "px", pageHeight + "px"],
            fixed: false,
            maxmin: true,
            content: pageUrl,
            success: function (layero, index) {
                var body = window.top.layer.getChildFrame('body', index);
                var iframeWin = window.top[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象
                //将回调函数传给子页面
                if (iframeWin.params) {
                    if (ids) {
                        iframeWin.params.ids = ids;
                    }
                    iframeWin.params.parent = window;
                    iframeWin.params.callBack = reload;
                }
                if (defaultFull) {
                    top.layer.full(index);
                }
            }
        });
    }
    function reload() {
        location.reload();
    }
    //选择开始日期
    function onSelectStartDate(d) {
        var currTime = new Date();
        var currDate = new Date(currTime.getFullYear(), currTime.getMonth(), currTime.getDate());
        if (d < currDate) {
            wcp.notify.error('利用日期不能在今天之前!');
            this.datebox('setValue', '').datebox('showPanel');
        }
        var issd = this.id == 'utilizationDate';
        var sd = issd ? d : new Date($('#utilizationDate').datebox('getValue'));
        var ed = issd ? new Date($('#utilizationValidDate').datebox('getValue')) : d;
        var sdStr = dateFormat("YYYY-mm-dd", sd);
        var edStr = dateFormat("YYYY-mm-dd", ed);
        if (ed < sd || sdStr == edStr) {
            wcp.notify.error('借出日期应小于截止日期!');
            this.datebox('setValue', '').datebox('showPanel');
        } else {
            var g = new util();
            var utilizationValidDate = new Date($('#utilizationValidDate').datebox('getValue'));
            var utilizationDate = g.addMonths(utilizationValidDate, -1);
            utilizationDate = g.addDays(utilizationDate, -1);
            if (utilizationDate > d) {
                wcp.notify.error('借出日期与截止超过一个月!');
                this.datebox('setValue', '').datebox('showPanel');
            }
        }
    }
    //选择截止日期
    function onSelectEndDate(d) {
        var issd = this.id == 'utilizationDate', sd = issd ? d : new Date($('#utilizationDate').datebox('getValue')),
            ed = issd ? new Date($('#utilizationValidDate').datebox('getValue')) : d;
        if (ed < sd) {
            wcp.notify.error('截止日期应大于借出日期!');
            this.datebox('setValue', '').datebox('showPanel');
        } else {
            var g = new util();
            var utilizationDate = new Date($('#utilizationDate').datebox('getValue'));
            var utilizationValidDate = g.addMonths(utilizationDate, 1);
            if (utilizationValidDate < d) {
                wcp.notify.error('截止日期超过一个月!');
                this.datebox('setValue', '').datebox('showPanel');
            }
        }
    }
    function dateFormat(fmt, date) {
        var ret;
        var opt = {
            "Y+": date.getFullYear().toString(),        // 年
            "m+": (date.getMonth() + 1).toString(),     // 月
            "d+": date.getDate().toString(),            // 日
            "H+": date.getHours().toString(),           // 时
            "M+": date.getMinutes().toString(),         // 分
            "S+": date.getSeconds().toString()          // 秒
            // 有其他格式化字符需求可以继续添加,必须转化成字符串
        };
        for (var k in opt) {
            ret = new RegExp("(" + k + ")").exec(fmt);
            if (ret) {
                fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
            }
        }
        return fmt;
    }
</script>
</html>
src/main/webapp/WEB-INF/view/gh/borrow/indexTest.jsp
New file
@@ -0,0 +1,536 @@
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <title>借阅申请</title>
    <!-- 字体 -->
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/material-teal.css" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/styles/archivesHN.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/icheck/skins/all.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-edatagrid/jquery.edatagrid.js"></script>
    <script type="text/javascript" src="static/plugins/icheck/icheck.min.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <script type="text/javascript" src="static/plugins/ace/src-noconflict/ace.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
</head>
<body>
<div class="application">
    <%--    <div class="application-title">--%>
    <%--        <div class="application-title-c clear"><span class="borrow-title"></span>--%>
    <%--            <h3>借阅申请</h3></div>--%>
    <%--    </div>--%>
    <div class="application-step">
        <ul class="clear">
            <li class="steped"><span><i class="fa fa-check"></i></span><a href="javascript:;">填写利用内容</a><b></b>
            </li>
            <li><a href="javascript:;"><span>2</span>填写用户信息</a><b></b></li>
            <li><a href="javascript:;"><span>3</span>成功提交利用单</a></li>
        </ul>
        <p><span>注意:</span>如果您还需同时借阅其他案件,请先关闭该窗口,继续在查询界面将所需要的案卷添加到借阅单,再一并提交。
        </p>
    </div>
    <c:if test="${borrowInfoList.size()==0}">
        <div class="noadd">
            <i class="fa fa-dropbox"></i>
            <h5>未选择任何资料!</h5>
            <p>当前您还未选择任何资料,请先在<a href="javascript:;">资料查询</a>页面查询您所需要的资料</p>
        </div>
        <div class="application-btn">
            <button class="pt-btn pt-btn-default pt-btn-success " onclick="addBorrowDetail()">添加</button>
            <button class="pt-btn pt-btn-default pt-btn-warning" onclick="closeWindow()">关闭</button>
        </div>
    </c:if>
    <c:if test="${borrowInfoList.size()>0}">
        <div id="divInfoStep1" class="application-con">
            <div class="contit">
                <h4>利用明细</h4>
                <span class="consel">请选择一种利用类型: <input class="easyui-combobox" id="utilizationType"
                                                                name="utilizationType"
                                                                data-options="
                                    editable: false,
                                    panelHeight: 'auto',
                                    valueField: 'label',
                                    textField: 'value',
                                    data: [{
                                        label: '0',
                                        value: '成果资料',
                                        selected: true
                                    },{
                                        label: '1',
                                        value: '原始资料'
                                    }]"/></span>
                <button onclick="deleteAllBorrowDetail()" class="pt-btn pt-btn-danger pt-btn-padding pull-right">
                    全部删除
                </button>
                <button onclick="addBorrowDetail()" class="pt-btn pt-btn-success pt-btn-padding pull-right">
                    添加
                </button>
            </div>
            <div class="pt-form">
                <div class="application-body">
                    <c:forEach items="${borrowInfoList}" var="borrowInfo">
                        <div class="application-listli" id="list_${borrowInfo.parentBorrowInfo.fileId}">
                            <div class="listli-title" id="tr_${borrowInfo.parentBorrowInfo.fileId}">
                                <span class="txt_fold">档号:${borrowInfo.parentBorrowInfo.archivalCode}</span>&nbsp;&nbsp;&nbsp;&nbsp;<span
                                    class="txt_fold txt_blue">${borrowInfo.parentBorrowInfo.fileTitle}</span>
                                <i class="fa fa-times-circle pull-right"
                                   onclick="deleteBorrowDetail('${borrowInfo.parentBorrowInfo.fileId}')"></i>
                            </div>
                            <div class="detailed">
                                <table style="width: 100%;">
                                    <tr class="detailed-th" id="trhead_${borrowInfo.parentBorrowInfo.fileId}">
                                        <td style="width: 10%">件号</td>
                                        <td style="width: 55%">题名</td>
                                        <td style="width: 10%">密级</td>
                                        <td style="width: 25%">
                                        </td>
                                    </tr>
                                    <c:forEach items="${borrowInfo.borrowDetailList}" var="borrowDetail">
                                        <c:if test="${borrowDetail.borrowType == 0}">
                                            <tr class="tr_${borrowInfo.parentBorrowInfo.fileId}_0 cg">
                                                <td>${borrowDetail.itemNumber}</td>
                                                <td>${borrowDetail.itemTitle}</td>
                                                <td>${borrowDetail.securityClassification}</td>
                                                <td><input type="checkbox" class="easyui-checkbox" name="electronic"
                                                           id="electronic_${borrowDetail.detailId}"/>电子
                                                    <input type="checkbox" class="easyui-checkbox" name="paper"
                                                           id="paper_${borrowDetail.detailId}"/>纸质
                                                    <input type="checkbox" class="easyui-checkbox" name="original"
                                                           id="original_${borrowDetail.detailId}"/>原件借出
                                            </tr>
                                        </c:if>
                                        <c:if test="${borrowDetail.borrowType == 1}">
                                            <tr class="tr_${borrowInfo.parentBorrowInfo.fileId}_1 ys"
                                                style="display: none">
                                                <td>${borrowDetail.itemNumber}</td>
                                                <td>${borrowDetail.itemTitle}</td>
                                                <td>${borrowDetail.securityClassification}</td>
                                                <td><input type="checkbox" class="easyui-checkbox" name="electronic"
                                                           id="electronic_${borrowDetail.detailId}"/>电子
                                                    <input type="checkbox" class="easyui-checkbox" name="paper"
                                                           id="paper_${borrowDetail.detailId}"/>纸质
                                                    <input type="checkbox" class="easyui-checkbox" name="original"
                                                           id="original_${borrowDetail.detailId}"/>原件借出
                                            </tr>
                                        </c:if>
                                    </c:forEach>
                                </table>
                            </div>
                        </div>
                    </c:forEach>
                </div>
            </div>
        </div>
    </c:if>
    <div id="divInfoStep2" style="display:none" class="application-con">
        <div class="contit"><h4>借阅人信息</h4></div>
        <div class="pt-form">
            <form id="form1" method="post">
                <div class="application-body">
                    <div class="application-c2">
                        <div class="application-li2">
                            <table style="width:100%;">
                                <tr>
                                    <td class="tbtitle">借阅单编号:</td>
                                    <td colspan="3">[自动生成]</td>
                                </tr>
                                <tr>
                                    <td class="tbtitle"><em class="pt-color-danger">*</em> 姓名:</td>
                                    <td style="width: 35%;">
                                        <input class="easyui-textbox" id="borrowUserName" name="borrowUserName"
                                               type="text" style="width:300px;" value="${curUserName}"
                                               data-options="required:true,tipPosition:'bottom',buttonText:'选',prompt:'请选择利用人...',onClickButton:function(){selectBorrowName(); }"/>
                                        <input id="borrowUserId" class="easyui-textbox" name="borrowUserId"
                                               type="hidden"
                                               value="${curUserId}"/>
                                    </td>
                                    <td class="tbtitle"><em class="pt-color-danger">*</em>工作单位:</td>
                                    <td style="width: 35%;">
                                        <input class="easyui-textbox" id="deptName"
                                               name="deptName" type="text" style="width:300px"
                                               data-options="required:true"
                                               value=""/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tbtitle"> 邮编:</td>
                                    <td style="width: 35%;">
                                        <input class="easyui-textbox" id="postCode"
                                               name="postCode" type="text" style="width:300px"
                                               value=""/>
                                    </td>
                                    <td class="tbtitle"><em class="pt-color-danger">*</em>单位地址:</td>
                                    <td style="width: 35%;">
                                        <input class="easyui-textbox" id="deptAddress"
                                               name="deptAddress" type="text" style="width:300px"
                                               data-options="required:true"
                                               value=""/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tbtitle">电话:</td>
                                    <td style="width: 35%;">
                                        <input class="easyui-textbox" id="telNumber"
                                               name="telNumber" type="text" style="width:300px"
                                               value=""/>
                                    </td>
                                    <td class="tbtitle"><em class="pt-color-danger">*</em>手机:</td>
                                    <td style="width: 35%;">
                                        <input class="easyui-textbox" id="borrowTel"
                                               name="borrowTel" type="text" style="width:300px"
                                               data-options="required:true"
                                               value=""/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tbtitle">涉密证书编号:</td>
                                    <td colspan="3">
                                        <input class="easyui-textbox" id="certificateNumber"
                                               name="certificateNumber" type="text" style="width:785px"
                                               value=""/>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tbtitle"><em class="pt-color-danger">*</em>资料用途:</td>
                                    <td colspan="3">
                                        <input class="easyui-textbox" name="borrowPurpose"
                                               data-options="required:true"
                                               style="height:60px;width:785px">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="tbtitle">用户备注:</td>
                                    <td colspan="3">
                                        <input class="easyui-textbox" name="remark" data-options="multiline:true"
                                               style="height:60px;width:785px">
                                    </td>
                                </tr>
                                <tr id="tr1" style="display: none">
                                    <td class="tbtitle">部门:</td>
                                    <td style="width: 35%;"><input class="easyui-textbox" id="borrowDept"
                                                                   type="text" style="width:300px"
                                                                   value="${curDeptName}"/>
                                        <input class="easyui-textbox" id="borrowDeptId"
                                               type="hidden" value="${curDeptId}"/>
                                    </td>
                                    <td class="tbtitle">单位名称:</td>
                                    <td style="width: 35%;">
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div id="divInfoStep3" style="display:none" class="submitted">
        <i class="fa fa-check-circle"></i>
        <h5>申请单已提交成功!</h5>
        <p>纸质借阅请到借阅管理员处领取资料,电子借阅请在审批通过后到“我的借阅单”中查看</p>
    </div>
    <c:if test="${borrowInfoList.size()>0}">
        <div class="application-btn">
            <button id="btn_pre" class="pt-btn pt-btn-info" style="display:none" onclick="getPreStep()">上一步</button>
            <button id="btn_next" class="pt-btn pt-btn-info" onclick="saveBorrowDetail()">下一步</button>
            <button id="btn_submit" class="pt-btn pt-btn-success" style="display:none"
                    onclick="saveBorrowForm()">提交
            </button>
            <button id="btn_close" class="pt-btn pt-btn-default" onclick="closeWindow()">关闭</button>
        </div>
    </c:if>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script type="text/javascript">
    $(function () {
        new ResizeScroll({
            "id": ".application-body", fun: function () {
                var wh = $(window).height();
                return (wh - 235);
            }
        });
        //渲染所有checkbox
        $('input[type="checkbox"].flat').iCheck({
            checkboxClass: 'icheckbox_flat-red',
            increaseArea: '50%'
        });
        //全部电子选中与否
        $('#electronic_all').on('ifChecked', function (event) {
            var el = $("input[name='electronic']");
            $("input[name='electronic']").iCheck('check');
        });
        $('#electronic_all').on('ifUnchecked', function (event) {
            $("input[name='electronic']").iCheck('uncheck');
        });
        //全部纸质选中与否
        $('#paper_all').on('ifChecked', function (event) {
            $("input[name='paper']").iCheck('check');
        });
        $('#paper_all').on('ifUnchecked', function (event) {
            $("input[name='paper']").iCheck('uncheck');
        });
        //全部原件借出选中与否
        $('#original_all').on('ifChecked', function (event) {
            $("input[name='original']").iCheck('check');
        });
        $('#original_all').on('ifUnchecked', function (event) {
            $("input[name='original']").iCheck('uncheck');
        });
        //电子借阅,纸质借阅切换
        $('#utilizationType').combobox({
            onChange: function (newValue, oldValue) {
                if (newValue == 0)//成果
                {
                    $(".cg").show();
                    $(".ys").hide();
                }
                if (newValue == 1)//原始
                {
                    $(".cg").hide();
                    $(".ys").show();
                }
            }
        });
        getBorrowUserInfo();
    });
    //上一步
    function getPreStep() {
        $("#step2").removeClass("steped");
        $("#step3").removeClass("steped");
        $("#step1").addClass("steped");
        $("#divInfoStep1").show();
        $("#divInfoStep2").hide();
        $("#btn_pre").hide();
        $("#btn_submit").hide();
        $("#btn_next").show();
    }
    //保存用户信息
    function saveBorrowForm() {
        var state = {'state': 0};
        var flowState = {'flowState': 0};
        //验证表单信息
        var isValid = $('#form1').form('validate');
        if (!isValid) {
            wcp.notify.error('表单验证有误,请检查表单输入项!');
            return false;
        }
        var formData = $.extend({}, $("#form1").serializeObject(), state, flowState);
        wcp.ui.setBusy("body", wcp.ajax({
            url: "borrow/saveBorrowForm",
            data: JSON.stringify(formData),
        }).done(function (result) {
            $("#step1").removeClass("steped");
            $("#step2").removeClass("steped");
            $("#step3").addClass("steped");
            $("#divInfoStep1").hide();
            $("#divInfoStep2").hide();
            $("#divInfoStep3").show();
            $("#btn_pre").hide();
            $("#btn_next").hide();
            $("#btn_submit").hide();
        }));
    }
    function closeWindow() {
        window.close();
        var title = top.$('#tt').tabs('getSelected').panel("options").title;
        top.$("#tt").tabs("close", title);
    }
    //保存所有选中状态
    function saveBorrowDetail() {
        var array = [];
        <c:forEach items="${allBorrowDetailList}" var="borrowDetail">
        var detailId = '${borrowDetail.detailId}';
        var borrowDetail = null;
        var electronic = $("#electronic_" + detailId).checkbox('options').checked == true ? 1 : 0;
        var paper = $("#paper_" + detailId).checkbox('options').checked == true ? 1 : 0;
        var original = $("#original_" + detailId).checkbox('options').checked == true ? 1 : 0;
        if (electronic == "1" || paper == "1" || original == "1") {
            borrowDetail = {
                "detailId": detailId,
                "electronic": electronic,
                "paper": paper,
                "original": original,
                "agree": 1
            };
            array.push(borrowDetail);
        }
        </c:forEach>
        if (array.length == 0) {
            wcp.notify.error('无明细信息,不能提交!');
            return;
        }
        wcp.ui.setBusy("body", wcp.ajax({
            url: "borrow/saveBorrowDetail",
            data: JSON.stringify(array),
        }).done(function (result) {
            $("#step1").removeClass("steped");
            $("#step2").addClass("steped");
            $("#divInfoStep1").hide();
            $("#divInfoStep2").show();
            $("#btn_pre").show();
            $("#btn_next").hide();
            $("#btn_submit").show();
        }));
    }
    //选择利用人
    function selectBorrowName() {
        wcp.picker.selectUser({
            title: "请选择利用人",
            multiSelect: false,
            idElement: "borrowUserId",
            nameElement: "borrowUserName",
            deptNameElement: "borrowDept",
            deptIdElement: "borrowDeptId",
            layerOpener: window
        });
    }
    //删除所有
    function deleteAllBorrowDetail() {
        layer.confirm('删除后将无法恢复,请确定是否全部删除?', {
            btn: ['是', '否'],
            offset: '300px'
        }, function () {
            <c:forEach items="${borrowInfoList}" var="archivalInfo">
            deleteBorrowDetail('${archivalInfo.parentBorrowInfo.fileId}');
            </c:forEach>
            wcp.notify.success('删除成功!');
        });
    }
    //删除
    function deleteBorrowDetail(fileId) {
        wcp.ui.setBusy("body", wcp.ajax({
            url: "borrow/deleteBorrowDetail?fileId=" + fileId
        }).done(function (result) {
            $(".tr_" + fileId + "_0").remove();
            $(".tr_" + fileId + "_1").remove();
            $("#tr_" + fileId).remove();
            $("#trhead_" + fileId).remove();
            $("#list_" + fileId).remove();
        }));
    }
    //人员变换时事件
    $('#borrowUserName').textbox({
        onChange: function (value) {
            setTimeout(function () {
                getBorrowUserInfo(value);
            }, 1000);
        }
    });
    //添加信息
    function getBorrowUserInfo() {
        var deptName = $("#borrowDept").textbox('getValue');
        var borrowUserId = $("#borrowUserId").textbox('getValue');
        if (deptName != null && deptName == "外部用户") {
            $("#borrowUserName").combobox('readonly', true);
            wcp.ui.setBusy("body", wcp.ajax({
                url: "common/getUserInfo?userId=" + borrowUserId,
            }).done(function (result) {
                $("#deptName").textbox('setValue', result.dept);
                $("#postCode").textbox('setValue', result.postCode);
                $("#deptAddress").textbox('setValue', result.deptAddress);
                $("#telNumber").textbox('setValue', result.telNumber);
                $("#borrowTel").textbox('setValue', result.mobile);
                $("#certificateNumber").textbox('setValue', result.certificateNum);
                $("#borrowPurpose").textbox('setValue', result.purpose);
            }));
        }
    }
    function addBorrowDetail() {
        var pageUrl = "common/addDetailsIndex?type=0"
        openUrlByLayer(650, 270, pageUrl, "添加利用", null);
    }
    //通过Layer打开窗口
    function openUrlByLayer(pageWidth, pageHeight, pageUrl, title, ids, defaultFull) {
        top.layer.open({
            title: title,
            type: 2,
            area: [pageWidth + "px", pageHeight + "px"],
            fixed: false,
            maxmin: true,
            content: pageUrl,
            success: function (layero, index) {
                var body = window.top.layer.getChildFrame('body', index);
                var iframeWin = window.top[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象
                //将回调函数传给子页面
                if (iframeWin.params) {
                    if (ids) {
                        iframeWin.params.ids = ids;
                    }
                    iframeWin.params.parent = window;
                    iframeWin.params.callBack = reload;
                }
                if (defaultFull) {
                    top.layer.full(index);
                }
            }
        });
    }
    function reload() {
        location.reload();
    }
</script>
</html>
src/main/webapp/WEB-INF/view/gh/borrow/myBorrowFormIndex.jsp
New file
@@ -0,0 +1,279 @@
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>我的借阅单</title>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link href="static/styles/initialize.css" rel="stylesheet" type="text/css">
    <link href="static/styles/common.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-edatagrid/jquery.edatagrid.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <script type="text/javascript" src="static/plugins/ace/src-noconflict/ace.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
    <style>
        /* .panel-body{border:0 none;} */
        .tabs-header, .tabs-tool {
            background-color: #fff;
        }
        .textbox {
            margin-top: 3px;
        }
    </style>
</head>
<body>
<div class="pt-main-top clear">
    <div class="pt-nav">
        <span class="pt-title-icon"><i class="fa fa-language"></i></span>
        <div class="pt-title">
            <div>
                <h4>个人利用记录</h4>
            </div>
        </div>
    </div>
    <div class="pt-search">
        <p class="pt-retrieval">
            <input id="txtKeySearch" type="text" placeholder="请输入借阅编码/借阅人搜索">
            <button id="btnKeySearch">
                <i class="fa fa-search"></i>
            </button>
        </p>
        <input class="easyui-combobox" id="flowState"
               data-options="
                                                panelHeight: 'auto',
                                                valueField: 'label',
                                                textField: 'value',
                                                editable: false,
                                                width:100,
                                                data: [{
                                                    label: '-2',
                                                    value: '所有的',
                                                    selected: true
                                                },
                                                {
                                                    label: '0',
                                                    value: '流程中'
                                                },{
                                                    label: '1',
                                                    value: '已结束'
                                                },{
                                                    label: '-1',
                                                    value: '已终止'
                                                }]"/>
    </div>
</div>
<div class="pt-form-inline">
    <div id="right">
        <div>
            <table id="tb_borrowForm" style="width:100%;">
            </table>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    $(function () {
        $("#flowState").combobox({
            onChange: function (n, o) {
                getMyBorrowFormList(n);
            }
        });
        //绑定关键字检索输入框回车事件
        $("#btnKeySearch").click(function () {
            SearchKey();
        });
        //关键字检索按钮事件
        $('#txtKeySearch').bind('keypress', function (event) {
            if (event.keyCode == "13") {
                SearchKey();
            }
        });
    })
    //关键字搜索方法
    function SearchKey() {
        var keyValue = $("#txtKeySearch").val();
        $('#tb_borrowForm').datagrid('load', {
            searchText: keyValue
        });
    }
    //删除借阅单
    function deleteBorrowForm() {
        //获取dg选中的数据行
        var checkRows = $("#tb_borrowForm").datagrid("getChecked");
        if (checkRows.length == 0) {
            wcp.message.info("请选择需要删除的数据!");
        } else {
            var ids = new Array();
            $.each(checkRows, function (index, value) {
                ids.push(value.formId);
            });
            wcp.ui.setBusy("body", wcp.ajax({
                url: "borrow/deleteBorrowForm",
                data: JSON.stringify(ids),
            }).done(function (result) {
                wcp.notify.success('删除成功!');
                $('#tb_borrowForm').datagrid('reload');
            }));
        }
    }
    //根据状态获取申请单列表
    function getMyBorrowFormList(flowState) {
        var url = 'borrow/getMyBorrowFormList?flowState=' + flowState;
        $("#tb_borrowForm").datagrid({
            rownumbers: true,
            fitColumns: true,
            method: "get",
            checkOnSelect: false,
            selectOnCheck: false,
            pagination: true,
            sortOrder: 'desc',
            sortName: "form_id",
            url: url,
            toolbar: "#toolbar_form",
            emptyMsg: "没有找到匹配的记录",
            idField: "formId",
            columns: [[
                {
                    field: 'ck',
                    checkbox: true
                },
                {
                    field: 'applyCode',
                    title: '借阅单编号',
                    width: 100,
                    sortable: true
                },
                {
                    field: 'borrowUserName',
                    title: '借阅人名称',
                    width: 100,
                    sortable: true
                },
                {
                    field: 'borrowTel',
                    title: '借阅人手机号',
                    width: 100,
                    sortable: true
                },
                {
                    field: 'borrowDate',
                    title: '借阅日期',
                    width: 100
                },
                {
                    field: 'flowStep',
                    title: '当前步骤信息',
                    width: 100
                }
            ]]
            , onClickRow: function (rowIndex, rowData) {
                var pageUrl = "borrow/borrowForm?formId=" + rowData.formId;
                if (top.addPanel) {
                    top.addPanel(pageUrl, "我的借阅单" + rowData.formId);
                    var curTabWin = null;
                    var curTab = top.$('#tt').tabs('getSelected');
                    if (curTab && curTab.find('iframe').length > 0) {
                        curTabWin = curTab.find('iframe')[0].contentWindow;
                        //将回调函数传给子页面
                        $(curTabWin).load(function () {
                            if (curTabWin.params) {
                                //将回调函数传给子页面
                                //if(ids){
                                //    curTabWin.params.ids = ids;
                                //}
                                curTabWin.params.callBack = refreshData;
                            }
                        });
                    }
                } else {
                    window.open(pageUrl);
                }
            }
            , rowStyler: function (index, row) {
                var curDate = new Date();
                var currentDate = getNowFormatDate(curDate);
                var utilizationValidDate = new Date(row.utilizationValidDate);
                var uvd = getNowFormatDate(utilizationValidDate);
                var backDate = utilizationValidDate.setDate(utilizationValidDate.getDate() - 3);
                var currentBackDate = getNowFormatDate(new Date(backDate));
                var color = "";
                if (row.originalBorrow == 1 && row.state == 0 && row.flowState == 1 && uvd >= currentDate && currentDate >= currentBackDate) {
                    color = 'background-color:#FFF8DC;';
                }
                if (row.originalBorrow == 1 && row.state == 0 && row.flowState == 1 && uvd <= currentDate) {
                    color = "background-color:red;";
                }
                return color;
            }
            , onLoadSuccess: function (data) {
                $('#tb_borrowForm').datagrid('clearChecked');
            }
        })
    }
    function getNowFormatDate(date) {
        var seperator1 = "-";
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate = year + seperator1 + month + seperator1 + strDate;
        return currentdate;
    }
    //刷新表格数据
    function refreshData() {
        $('#tb_borrowForm').datagrid('reload');
    }
</script>
</html>
src/main/webapp/WEB-INF/view/gh/catAjjxx/checkIndex.jsp
New file
@@ -0,0 +1,286 @@
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <meta name="viewport" charset="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>资料验收</title>
    <!--[if !IE]><!-->
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <!--<![endif]-->
    <!--[if gt IE 8]>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <![endif]-->
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/webuploader/webuploader.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-datagrid-dnd/datagrid-dnd.js"></script>
    <script src="static/plugins/jquery.redirect.js" type="text/javascript"></script>
    <script type="text/javascript" src="static/plugins/webuploader/webuploader.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
    <style>
        .combobox-group {
            clear: both;
        }
        .combobox-gitem {
            float: left;
            padding-right: 10px;
        }
        .progress {
            border: 1px solid #1483d8;
            width: 100%;
            background: #fff;
            height: 18px;
            /*line-height: 20px;*/
            display: inline-block;
            text-align: center;
            color: #6dbfff;
            position: absolute;
            margin-right: 10px;
            top: 290px;
        }
        .progress span.percentage {
            width: 0;
            height: 100%;
            left: 0;
            top: 0;
            background: #1483d8;
            position: absolute;
        }
        .progress span.text {
            position: relative;
            z-index: 10;
        }
    </style>
</head>
<body>
<div class="margin-lr">
    <div class="pt-main-top clear">
        <div class="pt-nav">
                <span class="pt-title-icon"> <i class="fa fa-upload"></i>
                </span>
            <div class="pt-title">
                <div>
                    <h4>资料验收</h4>
                </div>
            </div>
        </div>
    </div>
    <div class="pt-form">
        <form id="formImportTemplate">
            <div class="ptbody">
                <table style="width: 100%;">
                    <tr>
                        <td class="tbtitle">是否合格:</td>
                        <td>
                            <div>
                                <input class="easyui-radiobutton" name="isOk" value="-1"
                                       data-options="onChange:updateTypeOnChange" label="不合格">
                                <input class="easyui-radiobutton" name="isOk" value="1"
                                       data-options="onChange:updateTypeOnChange" label="合格">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">验收时间:</td>
                        <td>
                            <div>
                                <input id="checkData" class="easyui-datebox" style="width:200px"
                                       required="required" data-options="required:true,showSeconds:false"><br/>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">添加验收问题:</td>
                        <td>
                            <div>
                                <button id="selectCheckQuestion" class="pt-btn pt-btn-primary">添加验收问题</button>
                            </div>
                        </td>
                    </tr>
                    <tr id="tr_question">
                        <td class="tbtitle">验收问题:</td>
                        <td>
                            <input id="question" class="easyui-textbox" name="question"
                                   style="width:260px;height:80px"
                                   data-options="">
                        </td>
                    </tr>
                </table>
                <div class="progress" style="display: none;">
                    <span class="text">0%</span>
                    <span class="percentage"></span>
                </div>
            </div>
            <div class="pt-form-btn">
                <div class="form-group">
                    <a id="btnSave" class="pt-btn pt-btn-primary">确定</a>
                    <a id="btnClose" class="pt-btn pt-btn-default">关闭</a>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    //窗口参数,用于弹窗传递
    var params = {
        ids: null
    };
    var fileName;
    var uploader;
    var importTemplateId;
    var falg = false;
    var _extensions = "xml";
    var _mimeTypes = ".xml";
    var _mountFileFlag = false;
    var _importLogId;
    var checkState;
    var updateState;
    var checkQuestion;
    $(function () {
        $("input[radiobuttonName='isOk'][value='1']").radiobutton('check');
        initTime();
        new ResizeScroll({
            "id": ".ptbody",
            fun: function () {
                var wh = $(window).height();
                $("body").height(wh);
                return (wh - 69 - 62);
            }
        });
        $("#btnSave").click(function () {
            checkNoFile();
        });
        $("#btnClose").click(function () {
            closeWindow();
        });
        $("#selectCheckQuestion").click(function () {
            selectCheckQuestion();
        });
    });
    function closeWindow() {
        var index = top.layer.getFrameIndex(window.name); //获取窗口索引
        top.layer.close(index);
    }
    //判断是否合格
    function updateTypeOnChange(checked) {
        if (checked) {
            var val = $(this).val();
            if (val == 1) {
                checkState = 3;
                $("#tr_question").hide();
            } else {
                checkState = 1;
                $("#tr_question").show();
            }
        }
    }
    //点击后,打开矿种选择框
    function selectCheckQuestion() {
        var haveSelected = checkQuestion;
        top.layer.open({
            title: "选择问题清单",
            type: 2,
            area: ["900px", "600px"],
            fixed: false,
            content: "gdMisManage/selectCheckQuestion",
            success: function (layero, index) {
                console.log("layero", layero)
                var body = window.top.layer.getChildFrame('body', index);
                var iframeWin = window.top[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象
                //将回调函数传给子页面
                if (iframeWin && iframeWin.param) {
                    iframeWin.param.haveSelected = haveSelected;
                    // iframeWin.param.backOne = selectQuestionCallBack;
                    iframeWin.param.backOne = window.selectQuestionCallBack;
                }
            }
        });
    }
    window.selectQuestionCallBack = function (selectMineral) {
        checkQuestion = selectMineral;
    };
    function checkNoFile() {
        var id = params.ids[0];
        var checkData = $('#checkData').textbox("getValue");
        var question = $('#question').textbox("getValue");
        if (question != null && question != "") {
            checkQuestion = checkQuestion + "," + "0" + "-" + "question";
        }
        wcp.ui.setBusy("body", wcp.ajax({
            url: "catAjjxx/check",
            data: JSON.stringify({
                checkState: checkState,
                id: id,
                checkData: checkData,
                question: question,
                checkQuestion: checkQuestion
            }),
        }).done(function (result) {
            //关闭窗口
            closeWindow();
            top.wcp.notify.success("保存成功!");
        }));
    }
    function initTime() {
        var date = new Date();
        var year = date.getFullYear();
        var month = date.getMonth() + 1; //月份+1
        var day = date.getDate();
        var parsedate = year + "/" + month + "/" + day;
        $("#checkData").datebox('setValue', parsedate);
    }
</script>
</html>
src/main/webapp/WEB-INF/view/gh/catAjjxx/importBaoPanXmlIndex.jsp
New file
@@ -0,0 +1,320 @@
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <meta name="viewport" charset="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>数据导入</title>
    <!--[if !IE]><!-->
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <!--<![endif]-->
    <!--[if gt IE 8]>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <![endif]-->
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/webuploader/webuploader.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-datagrid-dnd/datagrid-dnd.js"></script>
    <script src="static/plugins/jquery.redirect.js" type="text/javascript"></script>
    <script type="text/javascript" src="static/plugins/webuploader/webuploader.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
    <style>
        .combobox-group {
            clear: both;
        }
        .combobox-gitem {
            float: left;
            padding-right: 10px;
        }
        .progress {
            border: 1px solid #1483d8;
            width: 100%;
            background: #fff;
            height: 18px;
            /*line-height: 20px;*/
            display: inline-block;
            text-align: center;
            color: #6dbfff;
            position: absolute;
            margin-right: 10px;
            top: 290px;
        }
        .progress span.percentage {
            width: 0;
            height: 100%;
            left: 0;
            top: 0;
            background: #1483d8;
            position: absolute;
        }
        .progress span.text {
            position: relative;
            z-index: 10;
        }
    </style>
</head>
<body>
<div class="margin-lr">
    <div class="pt-main-top clear">
        <div class="pt-nav">
                <span class="pt-title-icon"> <i class="fa fa-upload"></i>
                </span>
            <div class="pt-title">
                <div>
                    <h4>xml数据导入信息</h4>
                </div>
            </div>
        </div>
    </div>
    <div class="pt-form">
        <form id="formImportTemplate">
            <div class="ptbody">
                <table style="width: 100%;">
                        <tr>
                            <td class="tbtitle">移交时间:</td>
                            <td>
                                <div>
                                    <input id="startData" class="easyui-datebox" style="width:200px"
                                           required="required" data-options="required:true,showSeconds:false"><br/>
                                        <%--                                <input class="easyui-datetimebox" name="birthday" data-options="required:true,showSeconds:false" value="3/4/2010 2:3" style="width:150px">--%>
                                </div>
                            </td>
                        </tr>
                    <tr>
                        <td class="tbtitle">文件:</td>
                        <td>
                            <div>
                                <div id="picker">选择文件</div>
                                <div style="margin-top:10px;">
                                    <span id="fileName"></span>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
                <div class="progress" style="display: none;">
                    <span class="text">0%</span>
                    <span class="percentage"></span>
                </div>
            </div>
            <div class="pt-form-btn">
                <div class="form-group">
                    <a id="btnSave" class="pt-btn pt-btn-primary">导入</a>
                    <a id="btnClose" class="pt-btn pt-btn-default">关闭</a>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    //窗口参数,用于弹窗传递
    var params = {
        callBack: null
    };
    var fileName;
    var uploader;
    var falg = false;
    var _extensions = "xml";
    var _mimeTypes = ".xml";
    var _mountFileFlag = false;
    var _importLogId;
    $(function () {
        // $("input[radiobuttonName='importTemplate'][value='2017']").radiobutton('check');
        initData();
        new ResizeScroll({
            "id": ".ptbody",
            fun: function () {
                var wh = $(window).height();
                $("body").height(wh);
                return (wh - 69 - 62);
            }
        });
        $("#btnSave").click(function () {
            if (!falg) {
                wcp.notify.warn('请选择文件!');
                return false;
            }
            var obj = $('#formImportTemplate').serializeObject();//new Object();
            <c:if test="${ not archivesCustomConfig.enableSimple}">
            obj.startData = $('#startData').textbox("getValue");
            </c:if>
            uploader.options.formData = obj;
            uploader.upload();
        });
        uploadFile();
        $("#btnClose").click(function () {
            closeWindow();
        });
    });
    function closeWindow() {
        var index = top.layer.getFrameIndex(window.name); //获取窗口索引
        top.layer.close(index);
    }
    function uploadFile() {
        //var imgFileExtensions = 'xlsx,xls';
        uploader = WebUploader.create({
            swf: 'static/plugins/webuploader/Uploader.swf',
            server: 'catAjjxx/importBaoPanXML',
            timeout: 0,
            pick: {
                id: "#picker",
                multiple: false
            },
            accept: {
                title: '选择文件',
                extensions: "xml",
                mimeTypes: '.xml'
            },
            auto: false,
            duplicate: true
        });
        uploader.on("uploadSuccess", function (file, response) { //上传成功事件
            var obj = response;
            if (obj.success != undefined) {
                //ie8无需转换 TRANSFER_NUM
            } else {
                obj = eval('(' + response + ')');
            }
            //系统校验拦截时返回错误信息
            if (obj.error != undefined && obj.error.message != undefined) {
                // layer.alert(obj.error.message);
                top.wcp.notify.error(obj.error.message);
            } else {
                top.wcp.notify.success("数据导入成功!");
            }
            wcp.ui.clearBusy("body");
            $(".progress").hide();
            falg = false;
            $("#fileName").html("");
            //判断是否需要执行回调函数
            if (params.callBack) {
                params.callBack();
            }
            closeWindow();
        });
        uploader.on("uploadError", function (file, reason) { //上传失败
            wcp.message.error("上传失败:" + reason, "错误");
            wcp.ui.clearBusy("body");
            $(".progress").hide();
            falg = false;
            $("#fileName").html("");
        });
        uploader.on("beforeFileQueued", function (file) {
            var ext = file.ext;
            if (_mimeTypes.indexOf(ext.toLowerCase()) == -1) {
                wcp.message.error("请选择" + _mimeTypes + "文件!", "错误");
                return false;
            }
            var _regularTypeV = $("#regularType").html()
            if (_mountFileFlag && _regularTypeV == '') {
                wcp.message.error("当前模板未配置规则!", "错误");
                return false;
            }
        });
        uploader.on("fileQueued", function (file) {
            falg = true;
            $("#fileName").html(file.name);
        });
        uploader.on("uploadProgress", function (file, percentage) {
            var per = Math.trunc(percentage * 100);
            if (per != 100) {
                $(".progress .text").text(per + "%");
            } else {
                $(".progress .text").text("上传完成,正在处理数据...");
            }
            $(".progress .percentage").css('width', per + '%');
        });
        // 开始上传时添加显示
        uploader.on('startUpload', function () {
            $(".progress").show();
            wcp.ui.setBusy("body");
        });
    }
    function initData() {
        var date = new Date();
        var startData = initTime(date);
        $("#startData").datebox('setValue', startData);
        var futureDate = addWorkDays(date, 10); // 向当前日期添加10个工作日
        var endData = initTime(futureDate);
        $("#endData").datebox('setValue', endData);
    }
    function initTime(date) {
        var year = date.getFullYear();
        var month = date.getMonth() + 1; //月份+1
        var day = date.getDate();
        var parsedate = year + "-" + month + "-" + day;
        return parsedate;
    }
    function addWorkDays(date, days) {
        let currentDate = new Date(date);
        let addedDays = 0;
        while (addedDays < days) {
            // 增加一天
            currentDate.setDate(currentDate.getDate() + 1);
            // 检查是否为工作日
            const dayOfWeek = currentDate.getDay();
            if (dayOfWeek !== 0 && dayOfWeek !== 6) { // 0: Sunday, 6: Saturday
                addedDays++;
            }
        }
        return currentDate;
    }
    // 使用示例
</script>
</html>
src/main/webapp/WEB-INF/view/gh/catAjjxx/importXmlIndex.jsp
New file
@@ -0,0 +1,333 @@
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <meta name="viewport" charset="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>数据导入</title>
    <!--[if !IE]><!-->
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <!--<![endif]-->
    <!--[if gt IE 8]>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <![endif]-->
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/webuploader/webuploader.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-datagrid-dnd/datagrid-dnd.js"></script>
    <script src="static/plugins/jquery.redirect.js" type="text/javascript"></script>
    <script type="text/javascript" src="static/plugins/webuploader/webuploader.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
    <style>
        .combobox-group {
            clear: both;
        }
        .combobox-gitem {
            float: left;
            padding-right: 10px;
        }
        .progress {
            border: 1px solid #1483d8;
            width: 100%;
            background: #fff;
            height: 18px;
            /*line-height: 20px;*/
            display: inline-block;
            text-align: center;
            color: #6dbfff;
            position: absolute;
            margin-right: 10px;
            top: 290px;
        }
        .progress span.percentage {
            width: 0;
            height: 100%;
            left: 0;
            top: 0;
            background: #1483d8;
            position: absolute;
        }
        .progress span.text {
            position: relative;
            z-index: 10;
        }
    </style>
</head>
<body>
<div class="margin-lr">
    <div class="pt-main-top clear">
        <div class="pt-nav">
                <span class="pt-title-icon"> <i class="fa fa-upload"></i>
                </span>
            <div class="pt-title">
                <div>
                    <h4>xml数据导入信息</h4>
                </div>
            </div>
        </div>
    </div>
    <div class="pt-form">
        <form id="formImportTemplate">
            <div class="ptbody">
                <table style="width: 100%;">
                    <c:if test="${ not archivesCustomConfig.enableSimple}">
                        <tr>
                            <td class="tbtitle">受理时间:</td>
                            <td>
                                <div>
                                    <input id="startData" class="easyui-datebox" style="width:200px"
                                           required="required" data-options="required:true,showSeconds:false"><br/>
                                        <%--                                <input class="easyui-datetimebox" name="birthday" data-options="required:true,showSeconds:false" value="3/4/2010 2:3" style="width:150px">--%>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle">验收截止时间:</td>
                            <td>
                                <div>
                                    <input id="endData" class="easyui-datebox" style="width:200px"
                                           required="required" data-options="required:true,showSeconds:false"><br/>
                                </div>
                            </td>
                        </tr>
                    </c:if>
                    <tr>
                        <td class="tbtitle">文件:</td>
                        <td>
                            <div>
                                <div id="picker">选择文件</div>
                                <div style="margin-top:10px;">
                                    <span id="fileName"></span>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
                <div class="progress" style="display: none;">
                    <span class="text">0%</span>
                    <span class="percentage"></span>
                </div>
            </div>
            <div class="pt-form-btn">
                <div class="form-group">
                    <a id="btnSave" class="pt-btn pt-btn-primary">导入</a>
                    <a id="btnClose" class="pt-btn pt-btn-default">关闭</a>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    //窗口参数,用于弹窗传递
    var params = {
        callBack: null
    };
    var fileName;
    var uploader;
    var falg = false;
    var _extensions = "xml";
    var _mimeTypes = ".xml";
    var _mountFileFlag = false;
    var _importLogId;
    $(function () {
        // $("input[radiobuttonName='importTemplate'][value='2017']").radiobutton('check');
        initData();
        new ResizeScroll({
            "id": ".ptbody",
            fun: function () {
                var wh = $(window).height();
                $("body").height(wh);
                return (wh - 69 - 62);
            }
        });
        $("#btnSave").click(function () {
            if (!falg) {
                wcp.notify.warn('请选择文件!');
                return false;
            }
            var obj = $('#formImportTemplate').serializeObject();//new Object();
            <c:if test="${ not archivesCustomConfig.enableSimple}">
            obj.startData = $('#startData').textbox("getValue");
            obj.endData = $('#endData').textbox("getValue");
            </c:if>
            uploader.options.formData = obj;
            uploader.upload();
        });
        uploadFile();
        $("#btnClose").click(function () {
            closeWindow();
        });
    });
    function closeWindow() {
        var index = top.layer.getFrameIndex(window.name); //获取窗口索引
        top.layer.close(index);
    }
    function uploadFile() {
        //var imgFileExtensions = 'xlsx,xls';
        uploader = WebUploader.create({
            swf: 'static/plugins/webuploader/Uploader.swf',
            server: 'catAjjxx/importXML',
            timeout: 0,
            pick: {
                id: "#picker",
                multiple: false
            },
            accept: {
                title: '选择文件',
                extensions: "xml",
                mimeTypes: '.xml'
            },
            auto: false,
            duplicate: true
        });
        uploader.on("uploadSuccess", function (file, response) { //上传成功事件
            var obj = response;
            if (obj.success != undefined) {
                //ie8无需转换
            } else {
                obj = eval('(' + response + ')');
            }
            //系统校验拦截时返回错误信息
            if (obj.error != undefined && obj.error.message != undefined) {
                // layer.alert(obj.error.message);
                top.wcp.notify.error(obj.error.message);
            } else {
                top.wcp.notify.success("数据导入成功!");
            }
            wcp.ui.clearBusy("body");
            $(".progress").hide();
            falg = false;
            $("#fileName").html("");
            //判断是否需要执行回调函数
            if (params.callBack) {
                params.callBack();
            }
            closeWindow();
        });
        uploader.on("uploadError", function (file, reason) { //上传失败
            wcp.message.error("上传失败:" + reason, "错误");
            wcp.ui.clearBusy("body");
            $(".progress").hide();
            falg = false;
            $("#fileName").html("");
        });
        uploader.on("beforeFileQueued", function (file) {
            var ext = file.ext;
            if (_mimeTypes.indexOf(ext.toLowerCase()) == -1) {
                wcp.message.error("请选择" + _mimeTypes + "文件!", "错误");
                return false;
            }
            var _regularTypeV = $("#regularType").html()
            if (_mountFileFlag && _regularTypeV == '') {
                wcp.message.error("当前模板未配置规则!", "错误");
                return false;
            }
        });
        uploader.on("fileQueued", function (file) {
            falg = true;
            $("#fileName").html(file.name);
        });
        uploader.on("uploadProgress", function (file, percentage) {
            var per = Math.trunc(percentage * 100);
            if (per != 100) {
                $(".progress .text").text(per + "%");
            } else {
                $(".progress .text").text("上传完成,正在处理数据...");
            }
            $(".progress .percentage").css('width', per + '%');
        });
        // 开始上传时添加显示
        uploader.on('startUpload', function () {
            $(".progress").show();
            wcp.ui.setBusy("body");
        });
    }
    function initData() {
        var date = new Date();
        var startData = initTime(date);
        $("#startData").datebox('setValue', startData);
        var futureDate = addWorkDays(date, 10); // 向当前日期添加10个工作日
        var endData = initTime(futureDate);
        $("#endData").datebox('setValue', endData);
    }
    function initTime(date) {
        var year = date.getFullYear();
        var month = date.getMonth() + 1; //月份+1
        var day = date.getDate();
        var parsedate = year + "-" + month + "-" + day;
        return parsedate;
    }
    function addWorkDays(date, days) {
        let currentDate = new Date(date);
        let addedDays = 0;
        while (addedDays < days) {
            // 增加一天
            currentDate.setDate(currentDate.getDate() + 1);
            // 检查是否为工作日
            const dayOfWeek = currentDate.getDay();
            if (dayOfWeek !== 0 && dayOfWeek !== 6) { // 0: Sunday, 6: Saturday
                addedDays++;
            }
        }
        return currentDate;
    }
    // 使用示例
</script>
</html>
src/main/webapp/WEB-INF/view/gh/catAjjxx/updateFileTypeIndex.jsp
New file
@@ -0,0 +1,220 @@
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <meta name="viewport" charset="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>修改文件类型</title>
    <!--[if !IE]><!-->
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <!--<![endif]-->
    <!--[if gt IE 8]>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <![endif]-->
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/webuploader/webuploader.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-datagrid-dnd/datagrid-dnd.js"></script>
    <script src="static/plugins/jquery.redirect.js" type="text/javascript"></script>
    <script type="text/javascript" src="static/plugins/webuploader/webuploader.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
    <style>
        .combobox-group {
            clear: both;
        }
        .combobox-gitem {
            float: left;
            padding-right: 10px;
        }
        .progress {
            border: 1px solid #1483d8;
            width: 100%;
            background: #fff;
            height: 18px;
            /*line-height: 20px;*/
            display: inline-block;
            text-align: center;
            color: #6dbfff;
            position: absolute;
            margin-right: 10px;
            top: 290px;
        }
        .progress span.percentage {
            width: 0;
            height: 100%;
            left: 0;
            top: 0;
            background: #1483d8;
            position: absolute;
        }
        .progress span.text {
            position: relative;
            z-index: 10;
        }
    </style>
</head>
<body>
<div class="margin-lr">
    <div class="pt-main-top clear">
        <div class="pt-nav">
                <span class="pt-title-icon"> <i class="fa fa-upload"></i>
                </span>
            <div class="pt-title">
                <div>
                    <h4>修改文件类型</h4>
                </div>
            </div>
        </div>
    </div>
    <div class="pt-form">
        <form id="formImportTemplate">
            <div class="ptbody">
                <table style="width: 100%;">
                    <tr>
                        <td class="tbtitle">文件类型:</td>
                        <td>
                            <div>
                                <div>
                                    <input class="easyui-combobox" id="WJLX"
                                           name="WJLX" type="text"
                                           style="height:30px;text-align: left; width: 300px;"
                                           value=""
                                           data-options=" editable: true, required:true,panelHeight: '200',valueField:'id', textField:'name'"/>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
                <div class="progress" style="display: none;">
                    <span class="text">0%</span>
                    <span class="percentage"></span>
                </div>
            </div>
            <div class="pt-form-btn">
                <div class="form-group">
                    <a id="btnSave" class="pt-btn pt-btn-primary">确定</a>
                    <a id="btnClose" class="pt-btn pt-btn-default">关闭</a>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    //窗口参数,用于弹窗传递
    var params = {
        callBack: null
    };
    var fileName;
    var uploader;
    var importTemplateId;
    var comboboxId;
    var falg = false;
    var _mountFileFlag = false;
    var _importLogId;
    $(function () {
        initSelectProject();
        new ResizeScroll({
            "id": ".ptbody",
            fun: function () {
                var wh = $(window).height();
                $("body").height(wh);
                return (wh - 69 - 62);
            }
        });
        $("#btnSave").click(function () {
            var wjlx = $("#WJLX").combobox("getValue");
            var idList = params.ids;
            wcp.ui.setBusy("body", wcp.ajax({
                url: "catYswjxx/updateFileType?fileType=" + wjlx,
                data: JSON.stringify(idList)
            }).done(function (result) {
                //判断是否需要执行回调函数
                if (params.callBack) {
                    params.callBack();
                }
                //关闭窗口
                closeWindow();
                top.wcp.notify.success("保存成功!");
            }));
        });
        $("#btnClose").click(function () {
            closeWindow();
        });
    });
    function initSelectProject() {
        var data = [];
        wcp.ui.setBusy("body", wcp.ajax({
            url: "catYswjxx/getFileType"
        }).done(function (result) {
            result.forEach(function (item) {
                var dept = {
                    id: item.PARAM_VALUE,
                    name: item.PARAM_NAME
                }
                var jsonString = JSON.stringify(dept);
                data.push(JSON.parse(jsonString))
            });
            $('#WJLX').combobox('loadData', data);
            // 绑定选中事件
            $('#WJLX').combobox({
                onSelect: function (record) {
                    // comboboxId = record.id;
                }
            });
        }));
    }
    function closeWindow() {
        var index = top.layer.getFrameIndex(window.name); //获取窗口索引
        top.layer.close(index);
    }
</script>
</html>
src/main/webapp/WEB-INF/view/gh/common/commonTips.jsp
New file
@@ -0,0 +1,87 @@
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <title>提示</title>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/styles/archives.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
</head>
<body>
<div class="application_tips_con">
    <div class="tips_num">
        <i class="fa fa-check-circle"></i>
        <h5>
            <c:if test="${addNum!=0}">
                成功添加<font style="color:red;">${addNum}</font>档资料到${type}申请单
            </c:if>
            <c:if test="${addNum==0}">
                资料添加失败
            </c:if>
            <c:if test="${repeatNum!=0}">
                ,当前资料已存在申请单中
            </c:if>
            !<br/> 当前${type}申请单中共有<font style="color:red">${existFileNum}</font>档资料,
            包含<font style="color:red">${existItemNum}</font>件文件级资料。
        </h5>
    </div>
    <p>
        <span>注意:</span>
        纸质借阅请到借阅管理员处领取资料,电子借阅请在审批通过后到“我的${type}单”中查看。
    </p>
    <div class="application-btn">
        <button class="pt-btn pt-btn-info" onclick="closeWindow()">继续浏览</button>
        <button class="pt-btn pt-btn-default" onclick="openUtilizationForm()">查看${type}单</button>
    </div>
</div>
<script type="text/javascript">
    <%--var urlPath = ${urlPath};--%>
    var path = "<%=path%>/${urlPath}";
    //关闭窗口事件
    function closeWindow() {
        var index = top.layer.getFrameIndex(window.name); //获取窗口索引
        top.layer.close(index);
    }
    function openUtilizationForm() {
        closeWindow();
        <%--window.open("<%=path%>/" + urlPath);--%>
        window.open(path);
    }
    function openTab(url, title, partId, type) {
        top.addPanel(url, title);
        var curTabWin = null;
        var curTab = top.$('#tt').tabs('getSelected');
        if (curTab && curTab.find('iframe').length > 0) {
            curTabWin = curTab.find('iframe')[0].contentWindow;
            //将回调函数传给子页面
            $(curTabWin).load(function () {
                if (curTabWin.params) {
                    curTabWin.params.callBackParams = partId;
                    curTabWin.params.callBack = getPartContent;
                    if (type == 1) {
                        curTabWin.params.callBack = refreshData;
                    }
                }
            });
        }
    }
</script>
</body>
</html>
src/main/webapp/WEB-INF/view/gh/common/relationFileTips.jsp
New file
@@ -0,0 +1,88 @@
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <title>提示</title>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/styles/archives.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
</head>
<body>
<div class="application_tips_con">
    <div class="tips_num">
        <i class="fa fa-check-circle"></i>
        <h5>
            共关联原始文件:<font
                style="color:red;">${ysTotal}</font>件;
<%--            <br/>其中成果文件关联成功<font style="color:red;">${cgSuccess}</font>件;--%>
<%--            <c:if test="${cgFailed!=0}">--%>
<%--                关联失败<font style="color:red;">${cgFailed}</font>件;--%>
<%--            </c:if>--%>
            <br/>其中原始文件关联成功<font style="color:red;">${ysSuccess}</font>件;
            <c:if test="${ysFailed!=0}">
                关联失败<font style="color:red;">${ysFailed}</font>件;
            </c:if>
<%--            <br/> 当前${type}申请单中共有<font style="color:red">${existFileNum}</font>档资料,--%>
<%--            包含<font style="color:red">${existItemNum}</font>件文件级资料。--%>
        </h5>
    </div>
<%--    <p>--%>
<%--        <span>注意:</span>--%>
<%--        纸质借阅请到借阅管理员处领取资料,电子借阅请在审批通过后到“我的${type}单”中查看。--%>
<%--    </p>--%>
<%--    <div class="application-btn">--%>
<%--        <button class="pt-btn pt-btn-info" onclick="closeWindow()">继续浏览</button>--%>
<%--        <button class="pt-btn pt-btn-default" onclick="openUtilizationForm()">查看${type}单</button>--%>
<%--    </div>--%>
</div>
<script type="text/javascript">
    <%--var urlPath = ${urlPath};--%>
    var path = "<%=path%>/${urlPath}";
    //关闭窗口事件
    function closeWindow() {
        var index = top.layer.getFrameIndex(window.name); //获取窗口索引
        top.layer.close(index);
    }
    function openUtilizationForm() {
        closeWindow();
        <%--window.open("<%=path%>/" + urlPath);--%>
        window.open(path);
    }
    function openTab(url, title, partId, type) {
        top.addPanel(url, title);
        var curTabWin = null;
        var curTab = top.$('#tt').tabs('getSelected');
        if (curTab && curTab.find('iframe').length > 0) {
            curTabWin = curTab.find('iframe')[0].contentWindow;
            //将回调函数传给子页面
            $(curTabWin).load(function () {
                if (curTabWin.params) {
                    curTabWin.params.callBackParams = partId;
                    curTabWin.params.callBack = getPartContent;
                    if (type == 1) {
                        curTabWin.params.callBack = refreshData;
                    }
                }
            });
        }
    }
</script>
</body>
</html>
src/main/webapp/WEB-INF/view/gh/config/customConfigIndex.jsp
New file
@@ -0,0 +1,392 @@
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>自定义配置</title>
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/plugins/jquery-steps/css/main.css" type="text/css">
    <link rel="stylesheet" href="static/styles/material-teal.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/webuploader/webuploader.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/webuploader/webuploader.js"></script>
    <script type="text/javascript" src="static/plugins/ace/src-noconflict/ace.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
    <style>
        html, body {
            height: 100%;
        }
        body {
            overflow: hidden;
        }
        .sourceBody {
            border-top: 1px solid #eee;
        }
        .viewBody {
            padding: 0 20px;
        }
        .pt-form td.tbtitle {
            width: 200px;
        }
        .uploadBtn div {
            width: 94px !important;
            height: 41px !important;
        }
    </style>
</head>
<body>
<form id="formConfig" style="height:100%">
    <div id="allView" class="easyui-tabs" style="width:100%; height:100%" data-options="tabPosition:'left'">
        <div title="系统配置" data-options="iconCls:'fa fa-empire'" class="pt-form viewBody">
            <table style="width: 100%;">
                <tr>
                    <td class="tbtitle">是否启动简约版本:</td>
                    <td>
                        <input type="hidden" id="enableSimple" name="enableSimple"
                               value="${archivesCustomConfig.enableSimple}"/>
                        <input id="enableSimpleText" class="easyui-switchbutton"
                               data-options="onText:'是',offText:'否',onChange:changeEvent"/>
                    </td>
                </tr>
            </table>
        </div>
        <div title="利用配置" data-options="iconCls:'fa fa-empire'" class="pt-form viewBody">
            <table style="width: 100%;">
                <tr>
                    <td class="tbtitle">是否允许借不同类型资料:</td>
                    <td>
                        <input type="hidden" id="enableAllowDifferentArchives" name="enableAllowDifferentArchives"
                               value="${archivesCustomConfig.enableAllowDifferentArchives}"/>
                        <input id="enableAllowDifferentArchivesText" class="easyui-switchbutton"
                               data-options="onText:'是',offText:'否',onChange:changeEvent"/>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">是否允许借不同归档部门资料:</td>
                    <td>
                        <input type="hidden" id="enableAllowDifferentFilingUnit" name="enableAllowDifferentFilingUnit"
                               value="${archivesCustomConfig.enableAllowDifferentFilingUnit}"/>
                        <input id="enableAllowDifferentFilingUnitText" class="easyui-switchbutton"
                               data-options="onText:'是',offText:'否',onChange:changeEvent"/>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">是否隐藏归档/形成部门:</td>
                    <td>
                        <input type="hidden" id="enableHideFilingUnit" name="enableHideFilingUnit"
                               value="${archivesCustomConfig.enableHideFilingUnit}"/>
                        <input id="enableHideFilingUnitText" class="easyui-switchbutton"
                               data-options="onText:'是',offText:'否',onChange:changeEvent"/>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">是否启用密级控制:</td>
                    <td>
                        <input type="hidden" id="enableSecurityClassification" name="enableSecurityClassification"
                               value="${archivesCustomConfig.enableSecurityClassification}"/>
                        <input id="enableSecurityClassificationText" class="easyui-switchbutton"
                               data-options="onText:'是',offText:'否',onChange:changeEvent"/>
                    </td>
                </tr>
            </table>
        </div>
<%--        <div title="地图相关配置" data-options="iconCls:'fa fa-empire'" class="pt-form viewBody">--%>
<%--            <table style="width: 100%;">--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">是否启用空间数据:</td>--%>
<%--                    <td>--%>
<%--                        <input type="hidden" id="enableSpaceData" name="enableSpaceData"--%>
<%--                               value="${archivesCustomConfig.enableSpaceData}"/>--%>
<%--                        <input id="enableSpaceDataText" class="easyui-switchbutton"--%>
<%--                               data-options="onText:'是',offText:'否',onChange:changeEvent"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">省份名称:</td>--%>
<%--                    <td>--%>
<%--                        <input id="provinceName" name="provinceName" class="easyui-textbox"--%>
<%--                               value="${archivesCustomConfig.provinceName}" style="width:30%"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">边界图层名称:</td>--%>
<%--                    <td>--%>
<%--                        <input id="borderLayerName" name="borderLayerName" class="easyui-textbox"--%>
<%--                               value="${archivesCustomConfig.borderLayerName}" style="width:30%"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">获取省界接口地址:</td>--%>
<%--                    <td>--%>
<%--                        <input id="borderUrl" name="borderUrl" class="easyui-textbox"--%>
<%--                               value="${archivesCustomConfig.borderUrl}" style="width:30%"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">默认省经纬度:</td>--%>
<%--                    <td>--%>
<%--                        <input id="defaultProvinceCoordinate" name="defaultProvinceCoordinate" class="easyui-textbox"--%>
<%--                               value="${archivesCustomConfig.defaultProvinceCoordinate}" style="width:30%"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">默认地球坐标系代号1:</td>--%>
<%--                    <td>--%>
<%--                        <input id="defaultProvinceFirst" name="defaultProvinceFirst" class="easyui-textbox"--%>
<%--                               value="${archivesCustomConfig.defaultProvinceFirst}" style="width:30%"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">默认地球坐标系代号2:</td>--%>
<%--                    <td>--%>
<%--                        <input id="defaultProvinceSecond" name="defaultProvinceSecond" class="easyui-textbox"--%>
<%--                               value="${archivesCustomConfig.defaultProvinceSecond}" style="width:30%"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">地图图片地址:</td>--%>
<%--                    <td>--%>
<%--                        <input id="mapPath" name="mapPath" class="easyui-textbox"--%>
<%--                               value="${archivesCustomConfig.mapPath}" style="width:30%"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">地图遥感图片地址:</td>--%>
<%--                    <td>--%>
<%--                        <input id="yaoGanMapPath" name="yaoGanMapPath" class="easyui-textbox"--%>
<%--                               value="${archivesCustomConfig.yaoGanMapPath}" style="width:30%"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
<%--            </table>--%>
<%--        </div>--%>
        <div title="附件相关配置" data-options="iconCls:'fa fa-empire'" class="pt-form viewBody">
            <table style="width: 100%;">
                <tr>
                    <td class="tbtitle">原始电子文件路径:</td>
                    <td>
                        <input id="originalPath" name="originalPath" class="easyui-textbox"
                               value="${archivesCustomConfig.originalPath}" style="width:30%"/>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">浏览电子文件路径:</td>
                    <td>
                        <input id="viewPath" name="viewPath" class="easyui-textbox"
                               value="${archivesCustomConfig.viewPath}" style="width:30%"/>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">省馆档号前缀:</td>
                    <td>
                        <input id="provinceCode" name="provinceCode" class="easyui-textbox"
                               value="${archivesCustomConfig.provinceCode}" style="width:30%"/>
                    </td>
                </tr>
            </table>
        </div>
<%--        <div title="chat相关配置" data-options="iconCls:'fa fa-empire'" class="pt-form viewBody">--%>
<%--            <table style="width: 100%;">--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">大模型ip:</td>--%>
<%--                    <td>--%>
<%--                        <input id="chatIp" name="chatIp" class="easyui-textbox"--%>
<%--                               value="${archivesCustomConfig.chatIp}" style="width:30%"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">API_KEY:</td>--%>
<%--                    <td>--%>
<%--                        <input id="apiKey" name="apiKey" class="easyui-textbox"--%>
<%--                               value="${archivesCustomConfig.apiKey}" style="width:30%"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">回话ID:</td>--%>
<%--                    <td>--%>
<%--                        <input id="chatId" name="chatId" class="easyui-textbox"--%>
<%--                               value="${archivesCustomConfig.chatId}" style="width:30%"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">数据集ids:</td>--%>
<%--                    <td>--%>
<%--                        <input id="datasetIds" name="datasetIds" class="easyui-textbox"--%>
<%--                               value="${archivesCustomConfig.datasetIds}" style="width:30%"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
                <%--                <tr>--%>
                <%--                    <td class="tbtitle">文件ids:</td>--%>
                <%--                    <td>--%>
                <%--                        <input id="documentIds" name="documentIds" class="easyui-textbox"--%>
                <%--                               value="${archivesCustomConfig.documentIds}" style="width:30%"/>--%>
                <%--                    </td>--%>
                <%--                </tr>--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">相似度阈值:</td>--%>
<%--                    <td>--%>
<%--                        <input id="similarityThreshold" name="similarityThreshold" class="easyui-numberspinner"--%>
<%--                               value="${archivesCustomConfig.similarityThreshold}"--%>
<%--                               style="width:30%"--%>
<%--                               data-options="min:0,max:1,precision:2,increment:0.1"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
<%--                <tr>--%>
<%--                    <td class="tbtitle">向量相似度权重:</td>--%>
<%--                    <td>--%>
<%--                        <input id="vectorSimilarityWeight" name="vectorSimilarityWeight" class="easyui-numberspinner"--%>
<%--                               value="${archivesCustomConfig.vectorSimilarityWeight}"--%>
<%--                               style="width:30%"--%>
<%--                               data-options="min:0,max:1,precision:2,increment:0.1"/>--%>
<%--                    </td>--%>
<%--                </tr>--%>
<%--            </table>--%>
<%--        </div>--%>
        <div title="汇交相关配置" data-options="iconCls:'fa fa-empire'" class="pt-form viewBody">
            <table style="width: 100%;">
                <tr>
                    <td class="tbtitle">唯一性验证:</td>
                    <td>
                        <input id="checkRule" name="checkRule" class="easyui-textbox"
                               value="${archivesCustomConfig.checkRule}" style="width:30%"/>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</form>
<div class="pt-form-btn" style="bottom:0px;">
    <div class="form-group">
        <button id="btnSave" class="pt-btn pt-btn-primary">保存</button>
        <button id="btnClose" class="pt-btn pt-btn-default">关闭</button>
    </div>
</div>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    var editor_customAttachViewScript;
    $(function () {
        //初始化表单值
        if ($("#enableSimple").val() == "true") {
            $('#enableSimpleText').switchbutton("check");
        } else {
            $('#enableSimpleText').switchbutton("uncheck");
        }
        if ($("#enableAllowDifferentArchives").val() == "true") {
            $('#enableAllowDifferentArchivesText').switchbutton("check");
        } else {
            $('#enableAllowDifferentArchivesText').switchbutton("uncheck");
        }
        if ($("#enableAllowDifferentFilingUnit").val() == "true") {
            $('#enableAllowDifferentFilingUnitText').switchbutton("check");
        } else {
            $('#enableAllowDifferentFilingUnitText').switchbutton("uncheck");
        }
        if ($("#enableSecurityClassification").val() == "true") {
            $('#enableSecurityClassificationText').switchbutton("check");
        } else {
            $('#enableSecurityClassificationText').switchbutton("uncheck");
        }
        if ($("#enableHideFilingUnit").val() == "true") {
            $('#enableHideFilingUnitText').switchbutton("check");
        } else {
            $('#enableHideFilingUnitText').switchbutton("uncheck");
        }
        new ResizeScroll({
            "id": ".viewBody",
            fun: function () {
                var wh = $(window).height();
                return (wh - 52);
            }
        });
        //绑定按钮事件
        $("#btnSave").click(function () {
            //验证表单信息
            var isValid = $('#formConfig').form('validate');
            if (!isValid) {
                wcp.notify.warn('系统配置验证有误,请检查配置项!');
                return false;
            }
            var obj = $("#formConfig").serializeObject();
            wcp.ui.setBusy("body", wcp.ajax({
                url: "archivesCustomConfig/saveCustomConfig",
                data: JSON.stringify(obj),
            }).done(function (result) {
                top.wcp.notify.success("保存成功!");
            }));
        });
        $("#btnClose").click(function () {
            closeWindow();
        });
        $("#cnfData_but").click(function () {
            initCnfData();
        });
        $("#sysData_but").click(function () {
            initSysData();
        });
    })
    //关闭窗口事件
    function closeWindow() {
        top.closeNowPanel();
    }
    //选择控件切换事件
    function changeEvent(checked) {
        $('#' + this.id.replace("Text", "")).val(checked);
    }
</script>
</body>
</html>
src/main/webapp/WEB-INF/view/gh/excel/importExcel.jsp
New file
@@ -0,0 +1,273 @@
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <meta name="viewport" charset="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>数据导入</title>
    <!--[if !IE]><!-->
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <!--<![endif]-->
    <!--[if gt IE 8]>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <![endif]-->
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/webuploader/webuploader.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-datagrid-dnd/datagrid-dnd.js"></script>
    <script src="static/plugins/jquery.redirect.js" type="text/javascript"></script>
    <script type="text/javascript" src="static/plugins/webuploader/webuploader.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
    <style>
        .combobox-group {
            clear: both;
        }
        .combobox-gitem {
            float: left;
            padding-right: 10px;
        }
        .progress {
            border: 1px solid #1483d8;
            width: 100%;
            background: #fff;
            height: 18px;
            /*line-height: 20px;*/
            display: inline-block;
            text-align: center;
            color: #6dbfff;
            position: absolute;
            margin-right: 10px;
            top: 290px;
        }
        .progress span.percentage {
            width: 0;
            height: 100%;
            left: 0;
            top: 0;
            background: #1483d8;
            position: absolute;
        }
        .progress span.text {
            position: relative;
            z-index: 10;
        }
    </style>
</head>
<body>
<div class="margin-lr">
    <div class="pt-main-top clear">
        <div class="pt-nav">
                <span class="pt-title-icon"> <i class="fa fa-upload"></i>
                </span>
            <div class="pt-title">
                <div>
                    <h4>数据导入信息</h4>
                </div>
            </div>
        </div>
    </div>
    <div class="pt-form">
        <form id="formImportTemplate">
            <div class="ptbody">
                <table style="width: 100%;">
                    <tr>
                        <td class="tbtitle">excel文件:</td>
                        <td>
                            <div>
                                <div id="picker">选择文件</div>
                                <%--                                <font color="red">(注:上传的zip文件中,根目录只解析excel文件和名称为‘附件’的文件夹。其中excel文件有且只能有一个,‘附件’的文件夹可以为空。)</font>--%>
                                <div style="margin-top:10px;">
                                    <span id="fileName"></span>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
                <div class="progress" style="display: none;">
                    <span class="text">0%</span>
                    <span class="percentage"></span>
                </div>
            </div>
            <div class="pt-form-btn">
                <div class="form-group">
                    <a id="btnSave" class="pt-btn pt-btn-primary">导入</a>
                    <a id="btnClose" class="pt-btn pt-btn-default">关闭</a>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    //窗口参数,用于弹窗传递
    var params = {
        callBack: null
    };
    var fileName;
    var uploader;
    var importTemplateId;
    var falg = false;
    var _extensions = "xlsx,xls";
    var _mimeTypes = ".xlsx,.xls";
    var _mountFileFlag = false;
    var _importLogId;
    var type = '${type}';
    $(function () {
        new ResizeScroll({
            "id": ".ptbody",
            fun: function () {
                var wh = $(window).height();
                $("body").height(wh);
                return (wh - 69 - 62);
            }
        });
        $("#btnSave").click(function () {
            if (!falg) {
                wcp.notify.warn('请选择文件!');
                return false;
            }
            var obj = $('#formImportTemplate').serializeObject();//new Object();
            obj.typeNum = type;
            uploader.options.formData = obj;
            uploader.upload();
        });
        $("#btnClose").click(function () {
            closeWindow();
        });
        uploadFile();
    });
    function closeWindow() {
        var index = top.layer.getFrameIndex(window.name); //获取窗口索引
        top.layer.close(index);
    }
    function uploadFile() {
        //var imgFileExtensions = 'xlsx,xls';
        uploader = WebUploader.create({
            swf: 'static/plugins/webuploader/Uploader.swf',
            server: 'importExcel/importExcel',
            timeout: 0,
            pick: {
                id: "#picker",
                multiple: false
            },
            accept: {
                title: '选择文件',
                extensions: "xlsx,xls",
                mimeTypes: '.xlsx,.xls'
            },
            auto: false,
            duplicate: true
        });
        uploader.on("uploadSuccess", function (file, response) { //上传成功事件
            //console.info(response);
            var obj = response;
            if (obj.success != undefined) {
                //ie8无需转换
            } else {
                obj = eval('(' + response + ')');
            }
            //系统校验拦截时返回错误信息
            if (obj.error != undefined && obj.error.message != undefined) {
                top.wcp.notify.error(obj.error.message);
            } else {
                top.wcp.notify.success("导入数据成功!");
            }
            wcp.ui.clearBusy("body");
            $(".progress").hide();
            if (params.callBack) {
                params.callBack();
            }
            closeWindow();
        });
        uploader.on("uploadError", function (file, reason) { //上传失败
            wcp.message.error("上传失败:" + reason, "错误");
            wcp.ui.clearBusy("body");
            $(".progress").hide();
            falg = false;
            $("#fileName").html("");
        });
        uploader.on("beforeFileQueued", function (file) {
            var ext = file.ext;
            if (_mimeTypes.indexOf(ext.toLowerCase()) == -1) {
                wcp.message.error("请选择" + _mimeTypes + "文件!", "错误");
                return false;
            }
            var _regularTypeV = $("#regularType").html()
            if (_mountFileFlag && _regularTypeV == '') {
                wcp.message.error("当前模板未配置规则!", "错误");
                return false;
            }
        });
        uploader.on("fileQueued", function (file) {
            falg = true;
            $("#fileName").html(file.name);
            // importTemplateId = $("#importTemplate").combobox("getValue");
        });
        uploader.on("uploadProgress", function (file, percentage) {
            var per = Math.trunc(percentage * 100);
            if (per != 100) {
                $(".progress .text").text(per + "%");
            } else {
                $(".progress .text").text("上传完成,正在处理数据...");
            }
            $(".progress .percentage").css('width', per + '%');
        });
        // 开始上传时添加显示
        uploader.on('startUpload', function () {
            $(".progress").show();
            wcp.ui.setBusy("body");
        });
    }
</script>
</html>
src/main/webapp/WEB-INF/view/gh/excel/importSuExcel.jsp
New file
@@ -0,0 +1,273 @@
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <meta name="viewport" charset="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>数据导入</title>
    <!--[if !IE]><!-->
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <!--<![endif]-->
    <!--[if gt IE 8]>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <![endif]-->
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/webuploader/webuploader.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-datagrid-dnd/datagrid-dnd.js"></script>
    <script src="static/plugins/jquery.redirect.js" type="text/javascript"></script>
    <script type="text/javascript" src="static/plugins/webuploader/webuploader.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
    <style>
        .combobox-group {
            clear: both;
        }
        .combobox-gitem {
            float: left;
            padding-right: 10px;
        }
        .progress {
            border: 1px solid #1483d8;
            width: 100%;
            background: #fff;
            height: 18px;
            /*line-height: 20px;*/
            display: inline-block;
            text-align: center;
            color: #6dbfff;
            position: absolute;
            margin-right: 10px;
            top: 290px;
        }
        .progress span.percentage {
            width: 0;
            height: 100%;
            left: 0;
            top: 0;
            background: #1483d8;
            position: absolute;
        }
        .progress span.text {
            position: relative;
            z-index: 10;
        }
    </style>
</head>
<body>
<div class="margin-lr">
    <div class="pt-main-top clear">
        <div class="pt-nav">
                <span class="pt-title-icon"> <i class="fa fa-upload"></i>
                </span>
            <div class="pt-title">
                <div>
                    <h4>数据导入信息</h4>
                </div>
            </div>
        </div>
    </div>
    <div class="pt-form">
        <form id="formImportTemplate">
            <div class="ptbody">
                <table style="width: 100%;">
                    <tr>
                        <td class="tbtitle">excel文件:</td>
                        <td>
                            <div>
                                <div id="picker">选择文件</div>
                                <%--                                <font color="red">(注:上传的zip文件中,根目录只解析excel文件和名称为‘附件’的文件夹。其中excel文件有且只能有一个,‘附件’的文件夹可以为空。)</font>--%>
                                <div style="margin-top:10px;">
                                    <span id="fileName"></span>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
                <div class="progress" style="display: none;">
                    <span class="text">0%</span>
                    <span class="percentage"></span>
                </div>
            </div>
            <div class="pt-form-btn">
                <div class="form-group">
                    <a id="btnSave" class="pt-btn pt-btn-primary">导入</a>
                    <a id="btnClose" class="pt-btn pt-btn-default">关闭</a>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    //窗口参数,用于弹窗传递
    var params = {
        callBack: null
    };
    var fileName;
    var uploader;
    var importTemplateId;
    var falg = false;
    var _extensions = "xlsx,xls";
    var _mimeTypes = ".xlsx,.xls";
    var _mountFileFlag = false;
    var _importLogId;
    var type = '${type}';
    $(function () {
        new ResizeScroll({
            "id": ".ptbody",
            fun: function () {
                var wh = $(window).height();
                $("body").height(wh);
                return (wh - 69 - 62);
            }
        });
        $("#btnSave").click(function () {
            if (!falg) {
                wcp.notify.warn('请选择文件!');
                return false;
            }
            var obj = $('#formImportTemplate').serializeObject();//new Object();
            obj.typeNum = type;
            uploader.options.formData = obj;
            uploader.upload();
        });
        $("#btnClose").click(function () {
            closeWindow();
        });
        uploadFile();
    });
    function closeWindow() {
        var index = top.layer.getFrameIndex(window.name); //获取窗口索引
        top.layer.close(index);
    }
    function uploadFile() {
        //var imgFileExtensions = 'xlsx,xls';
        uploader = WebUploader.create({
            swf: 'static/plugins/webuploader/Uploader.swf',
            server: 'importSuExcel/importExcel',
            timeout: 0,
            pick: {
                id: "#picker",
                multiple: false
            },
            accept: {
                title: '选择文件',
                extensions: "xlsx,xls",
                mimeTypes: '.xlsx,.xls'
            },
            auto: false,
            duplicate: true
        });
        uploader.on("uploadSuccess", function (file, response) { //上传成功事件
            //console.info(response);
            var obj = response;
            if (obj.success != undefined) {
                //ie8无需转换
            } else {
                obj = eval('(' + response + ')');
            }
            //系统校验拦截时返回错误信息
            if (obj.error != undefined && obj.error.message != undefined) {
                top.wcp.notify.error(obj.error.message);
            } else {
                top.wcp.notify.success("导入数据成功!");
            }
            wcp.ui.clearBusy("body");
            $(".progress").hide();
            if (params.callBack) {
                params.callBack();
            }
            closeWindow();
        });
        uploader.on("uploadError", function (file, reason) { //上传失败
            wcp.message.error("上传失败:" + reason, "错误");
            wcp.ui.clearBusy("body");
            $(".progress").hide();
            falg = false;
            $("#fileName").html("");
        });
        uploader.on("beforeFileQueued", function (file) {
            var ext = file.ext;
            if (_mimeTypes.indexOf(ext.toLowerCase()) == -1) {
                wcp.message.error("请选择" + _mimeTypes + "文件!", "错误");
                return false;
            }
            var _regularTypeV = $("#regularType").html()
            if (_mountFileFlag && _regularTypeV == '') {
                wcp.message.error("当前模板未配置规则!", "错误");
                return false;
            }
        });
        uploader.on("fileQueued", function (file) {
            falg = true;
            $("#fileName").html(file.name);
            // importTemplateId = $("#importTemplate").combobox("getValue");
        });
        uploader.on("uploadProgress", function (file, percentage) {
            var per = Math.trunc(percentage * 100);
            if (per != 100) {
                $(".progress .text").text(per + "%");
            } else {
                $(".progress .text").text("上传完成,正在处理数据...");
            }
            $(".progress .percentage").css('width', per + '%');
        });
        // 开始上传时添加显示
        uploader.on('startUpload', function () {
            $(".progress").show();
            wcp.ui.setBusy("body");
        });
    }
</script>
</html>
src/main/webapp/WEB-INF/view/gh/excel/tapeImportExcel.jsp
New file
@@ -0,0 +1,314 @@
<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <meta name="viewport" charset="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>数据导入</title>
    <!--[if !IE]><!-->
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <!--<![endif]-->
    <!--[if gt IE 8]>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <![endif]-->
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/webuploader/webuploader.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-datagrid-dnd/datagrid-dnd.js"></script>
    <script src="static/plugins/jquery.redirect.js" type="text/javascript"></script>
    <script type="text/javascript" src="static/plugins/webuploader/webuploader.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
    <style>
        .combobox-group {
            clear: both;
        }
        .combobox-gitem {
            float: left;
            padding-right: 10px;
        }
        .progress {
            border: 1px solid #1483d8;
            width: 100%;
            background: #fff;
            height: 18px;
            /*line-height: 20px;*/
            display: inline-block;
            text-align: center;
            color: #6dbfff;
            position: absolute;
            margin-right: 10px;
            top: 290px;
        }
        .progress span.percentage {
            width: 0;
            height: 100%;
            left: 0;
            top: 0;
            background: #1483d8;
            position: absolute;
        }
        .progress span.text {
            position: relative;
            z-index: 10;
        }
    </style>
</head>
<body>
<div class="margin-lr">
    <div class="pt-main-top clear">
        <div class="pt-nav">
                <span class="pt-title-icon"> <i class="fa fa-upload"></i>
                </span>
            <div class="pt-title">
                <div>
                    <h4>数据导入信息</h4>
                </div>
            </div>
        </div>
    </div>
    <div class="pt-form">
        <form id="formImportTemplate">
            <div class="ptbody">
                <table style="width: 100%;">
                    <tr>
                        <td class="tbtitle">项目名称:</td>
                        <td>
                            <div>
                                <div>
                                    <input class="easyui-combobox" id="XMKYQMC"
                                           name="XMKYQMC" type="text"
                                           style="height:30px;text-align: left; width: 486px;"
                                           value=""
                                           data-options=" editable: true, required:true,panelHeight: '200',valueField:'id', textField:'name'"/>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="tbtitle">excel文件:</td>
                        <td>
                            <div>
                                <div id="picker">选择文件</div>
                                <%--                                <font color="red">(注:上传的zip文件中,根目录只解析excel文件和名称为‘附件’的文件夹。其中excel文件有且只能有一个,‘附件’的文件夹可以为空。)</font>--%>
                                <div style="margin-top:10px;">
                                    <span id="fileName"></span>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
                <div class="progress" style="display: none;">
                    <span class="text">0%</span>
                    <span class="percentage"></span>
                </div>
            </div>
            <div class="pt-form-btn">
                <div class="form-group">
                    <a id="btnSave" class="pt-btn pt-btn-primary">导入</a>
                    <a id="btnClose" class="pt-btn pt-btn-default">关闭</a>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    //窗口参数,用于弹窗传递
    var params = {
        callBack: null
    };
    var fileName;
    var uploader;
    var importTemplateId;
    var comboboxId;
    var falg = false;
    var _extensions = "xlsx,xls";
    var _mimeTypes = ".xlsx,.xls";
    var _mountFileFlag = false;
    var _importLogId;
    var type = '${type}';
    $(function () {
        initSelectProject();
        new ResizeScroll({
            "id": ".ptbody",
            fun: function () {
                var wh = $(window).height();
                $("body").height(wh);
                return (wh - 69 - 62);
            }
        });
        $("#btnSave").click(function () {
            if (!falg) {
                wcp.notify.warn('请选择文件!');
                return false;
            }
            var obj = $('#formImportTemplate').serializeObject();//new Object();
            obj.typeNum = type;
            obj.ajId = comboboxId;
            uploader.options.formData = obj;
            uploader.upload();
        });
        $("#btnClose").click(function () {
            closeWindow();
        });
        uploadFile();
    });
    function initSelectProject() {
        var data = [];
        wcp.ui.setBusy("body", wcp.ajax({
            url: "tape/getProject"
        }).done(function (result) {
            result.forEach(function (item) {
                var dept = {
                    id: item.ID,
                    name: item.XMKYQMC
                }
                var jsonString = JSON.stringify(dept);
                data.push(JSON.parse(jsonString))
            });
            $('#XMKYQMC').combobox('loadData', data);
            // 绑定选中事件
            $('#XMKYQMC').combobox({
                onSelect: function (record) {
                    // 选中事件处理逻辑
                    comboboxId = record.id;
                }
            });
        }));
    }
    function closeWindow() {
        var index = top.layer.getFrameIndex(window.name); //获取窗口索引
        top.layer.close(index);
    }
    function uploadFile() {
        //var imgFileExtensions = 'xlsx,xls';
        uploader = WebUploader.create({
            swf: 'static/plugins/webuploader/Uploader.swf',
            server: 'tape/importExcel',
            timeout: 0,
            pick: {
                id: "#picker",
                multiple: false
            },
            accept: {
                title: '选择文件',
                extensions: "xlsx,xls",
                mimeTypes: '.xlsx,.xls'
            },
            auto: false,
            duplicate: true
        });
        uploader.on("uploadSuccess", function (file, response) { //上传成功事件
            //console.info(response);
            var obj = response;
            if (obj.success != undefined) {
                //ie8无需转换
            } else {
                obj = eval('(' + response + ')');
            }
            //系统校验拦截时返回错误信息
            if (obj.error != undefined && obj.error.message != undefined) {
                top.wcp.notify.error(obj.error.message);
            } else {
                top.wcp.notify.success("导入数据成功!");
            }
            wcp.ui.clearBusy("body");
            $(".progress").hide();
            if (params.callBack) {
                params.callBack();
            }
            closeWindow();
        });
        uploader.on("uploadError", function (file, reason) { //上传失败
            wcp.message.error("上传失败:" + reason, "错误");
            wcp.ui.clearBusy("body");
            $(".progress").hide();
            falg = false;
            $("#fileName").html("");
        });
        uploader.on("beforeFileQueued", function (file) {
            var ext = file.ext;
            if (_mimeTypes.indexOf(ext.toLowerCase()) == -1) {
                wcp.message.error("请选择" + _mimeTypes + "文件!", "错误");
                return false;
            }
            var _regularTypeV = $("#regularType").html()
            if (_mountFileFlag && _regularTypeV == '') {
                wcp.message.error("当前模板未配置规则!", "错误");
                return false;
            }
        });
        uploader.on("fileQueued", function (file) {
            falg = true;
            $("#fileName").html(file.name);
            // importTemplateId = $("#importTemplate").combobox("getValue");
        });
        uploader.on("uploadProgress", function (file, percentage) {
            var per = Math.trunc(percentage * 100);
            if (per != 100) {
                $(".progress .text").text(per + "%");
            } else {
                $(".progress .text").text("上传完成,正在处理数据...");
            }
            $(".progress .percentage").css('width', per + '%');
        });
        // 开始上传时添加显示
        uploader.on('startUpload', function () {
            $(".progress").show();
            wcp.ui.setBusy("body");
        });
    }
</script>
</html>
src/main/webapp/WEB-INF/view/gh/fileView/index.jsp
New file
@@ -0,0 +1,282 @@
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <title>资料浏览</title>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/styles/archivesHN.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-edatagrid/jquery.edatagrid.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-afterresize/jquery.afterresize.min.js"></script>
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
    <script type="text/javascript" src="static/plugins/ace/src-noconflict/ace.js"></script>
    <!-- wcp组件 -->
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
    <script type="text/javascript" src="static/plugins/crypto-js/core.js"></script>
    <script type="text/javascript" src="static/plugins/crypto-js/enc-base64.js"></script>
    <style>
        html, body {
            height: 100%;
            overflow: hidden;
        }
        .tree-joinbottom {
            background: none;
            padding-top: 2px;
            margin-right: 4px;
            font-size: 14px;
        }
        .tree-join {
            background: none;
            padding-top: 2px;
            margin-right: 4px;
            font-size: 14px;
        }
        .pt-tree .tree-title {
            color: #616161;
            font-weight: bold;
        }
    </style>
    <script>
        $(function () {
            var $ul_top_li = $("ul#top li");
            $ul_top_li.click(function () {
                    $(this).addClass("onlinehot")
                        .siblings().removeClass("onlinehot");
                    var value = $(this).text();
                    initFileTree(value);
                }
            );
            var $div_open = $("div#open");
            $div_open.click(function () {
                $(".onlineHN-left").css("width", "350px").css("padding", "20px 30px");
                $(".onlineHN-right").css("margin-left", "350px");
                $(".onlineHN-left-tit").css("font-size", "20px");
                $(this).hide();
                $("#close").show();
            });
            var $div_close = $("div#close");
            $div_close.click(function () {
                $(".onlineHN-left").css("width", "0px").css("padding", "0px");
                $(".onlineHN-right").css("margin-left", "0px");
                $(".onlineHN-left-tit").css("font-size", "0px");
                $(this).hide();
                $("#open").show();
            });
        })
    </script>
</head>
<body>
<div class="onlineHN">
    <div class="onlineHN-title"><i></i>${title}</div>
    <%--    <ul class="onlineHN-top clear" id="top">--%>
    <%--        <li style="cursor: pointer;">封面</li>--%>
    <%--        <li style="cursor: pointer;" class="onlinehot">正文</li>--%>
    <%--        <li style="cursor: pointer;">附图</li>--%>
    <%--        <li style="cursor: pointer;">附表</li>--%>
    <%--        <li style="cursor: pointer;">附件</li>--%>
    <%--        <li style="cursor: pointer;">审批</li>--%>
    <%--        <li style="cursor: pointer;">其他</li>--%>
    <%--    </ul>--%>
    <div>
        <div class="onlineHN-left">
            <h4 class="onlineHN-left-tit"><i></i>目录</h4>
            <div class="pt-tree" style="border:0 none;">
                <ul id="ul_filelist"></ul>
            </div>
            <div class="online-close" id="close"></div>
            <div class="online-open" id="open" style="display: none;"></div>
        </div>
        <div class="onlineHN-right">
            <div class="onlineHN-right-bar clear">
                <button class="tjbtn" id="addProcessing"><i class="fa fa-plus-square"></i>添加到加工申请</button>
                <button class="dybtn">自助打印</button>
                <div class="rightscroll">
                    <div class="listcon">
                        <iframe id="ifmRight" width='100%' height='100%' frameborder='no' scrolling='no' border='0'
                                marginwidth='0' marginheight='0' style="display:block;"></iframe>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    var keyId = "${keyId}";
    var fileType = "${fileType}";
    var keyword = "${keyword}";
    // var fileType = "正文";
    $(function () {
        var $ul_top_li = $("ul#top li");
        $ul_top_li.each(function () {
            if ($(this).text() == fileType) {
                $(this).addClass("onlinehot")
                    .siblings().removeClass("onlinehot");
            }
        });
        debugger;
        initFileTree();
        computeHeight();
        $(window).afterresize(function () {
            computeHeight();
        })
        // $("#addProcessing").click(function () {
        //     addProcessingDetail();
        // })
    })
    function initFileTree() {
        $("#ul_filelist").tree({
            method: "post",
            <%--url: "fileView/getFileList?keyId=${keyId}&fileType=" + encodeURI(fileType),--%>
            url: "fileView/getFileList?keyId=${keyId}&fileType=" + fileType,
            animate: true,
            lines: true,
            formatter: function (node) {
                return "<span class='easyui-tooltip' title='" + node.text + "'>" + node.text + "</span>";
                // return '<li class="clear"><i class="fa fa-file-text-o"></i><a href="javascript:;">' + node.text + '</a></li>';
            },
            onBeforeLoad: function (node, param) {
                new ResizeScroll({
                    "id": "#ul_filelist",
                    fun: function () {
                        var wh = $(window).height();
                        return (wh - 70 - 56);
                    }
                });
                wcp.ui.setBusy("#ul_filelist");
            },
            onLoadSuccess: function (node, data) {
                wcp.ui.clearBusy("#ul_filelist");
                new ResizeScroll({
                    "id": "#ul_filelist",
                    fun: function () {
                        var wh = $(window).height();
                        return (wh - 70 - 56);
                    }
                });
                $(".easyui-tooltip").tooltip({
                    onShow: function () {
                        $(this).tooltip('tip').css({
                            borderColor: '#222d32'
                        });
                    }
                });
                var nowSelectedNodeId = findFirstNode(data);
                if (nowSelectedNodeId != null) {
                    var node = $('#ul_filelist').tree('find', nowSelectedNodeId);
                    if (node != null) {
                        $('#ul_filelist').tree('select', node.target);
                        selectNode(node);
                    }
                } else {
                    console.log("无附件")
                }
            },
            onLoadError: function (args) {
                wcp.ui.clearBusy("#ul_filelist");
            },
            onClick: function (node) {
                selectNode(node);
            }
        })
    }
    //查找第一个文件节点
    function findFirstNode(data) {
        for (var i = 0; i < data.length; i++) {
            var item = data[i];
            if (item.attributes && item.attributes.isFile) {
                return item.id;
            } else {
                if (item.children != null && item.children.length > 0) {
                    var id = findFirstNode(item.children);
                    if (id != null) {
                        return id;
                    }
                }
            }
        }
        return null;
    }
    //选中某个节点
    function selectNode(node) {
        $("#attachTitle").html(node.text);
        var url = "fileView/viewFile?keyId=" + node.id + "&type=" + fileType + "&keyword=" + keyword;
        $("#ifmRight").attr("src", url);
    }
    //计算框架页面高度
    function computeHeight() {
        var wh = $(window).height();
        var ifrmHeight = wh - 70 - 56 - 32;
        $("#ifmRight").height(ifrmHeight);
        $('#layout_navigation').layout('resize', {
            height: wh - 20
        });
    }
    // function addProcessingDetail() {
    //     wcp.ui.setBusy("body", wcp.ajax({
    //         url: "processing/addProcessingDetail?keyId=" + keyId
    //     }).done(function (result) {
    //         if (result && result.jsExpression) {
    //             eval(result.jsExpression);
    //         }
    //     }));
    // }
</script>
</html>
Diff truncated after the above file
src/main/webapp/WEB-INF/view/gh/fileView/noAuthorize.jsp src/main/webapp/WEB-INF/view/gh/fileView/physicalView.jsp src/main/webapp/WEB-INF/view/gh/gdMisManage/selectCheckQuestion.jsp src/main/webapp/WEB-INF/view/gh/gdMisManage/selectClassified.jsp src/main/webapp/WEB-INF/view/gh/gdMisManage/selectInflectionPoint.jsp src/main/webapp/WEB-INF/view/gh/gdMisManage/selectMineral.jsp src/main/webapp/WEB-INF/view/gh/gdMisManage/selectRegion.jsp src/main/webapp/WEB-INF/view/gh/label/labelIndex.jsp src/main/webapp/WEB-INF/view/gh/material/acceptanceIndex.jsp src/main/webapp/WEB-INF/view/gh/material/importXmlIndex.jsp src/main/webapp/WEB-INF/view/gh/physical/addPhysicalForm.jsp src/main/webapp/WEB-INF/view/gh/physical/index.jsp src/main/webapp/WEB-INF/view/gh/physical/myPhysicalFormIndex.jsp src/main/webapp/WEB-INF/view/gh/physical/physicalForm.jsp src/main/webapp/WEB-INF/view/gh/search/advancedQuery.jsp src/main/webapp/WEB-INF/view/gh/search/details.jsp src/main/webapp/WEB-INF/view/gh/search/index.jsp src/main/webapp/WEB-INF/view/gh/search/physicalDetails.jsp src/main/webapp/WEB-INF/view/gh/search/result_attach.jsp src/main/webapp/WEB-INF/view/gh/search/retrieve.jsp src/main/webapp/WEB-INF/view/gh/search/searchDataIndex.jsp src/main/webapp/WEB-INF/view/gh/search/searchFrom.jsp src/main/webapp/WEB-INF/view/gh/search/searchResult.jsp src/main/webapp/WEB-INF/view/gh/search/searchResult_attach.jsp src/main/webapp/WEB-INF/view/gh/search/searchTest.jsp src/main/webapp/WEB-INF/view/gh/utilizationUser/register.jsp src/main/webapp/WEB-INF/view/gh/utilizationUser/register3.jsp src/main/webapp/WEB-INF/view/gh/utilizationUser/userQuestion.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/physicalIndex.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/physicalStatistics.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/serviceStatistics.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/transferStatistics.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatistics.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByArea.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByDept.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByDeptAddress.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByDeptType.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByIndustry.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsBySecurity.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByService.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByType.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/utlStatisticsByUser.jsp src/main/webapp/WEB-INF/view/gh/utlStatistics/utlType.jsp src/main/webapp/WEB-INF/view/scanPrint/scanPrint.jsp src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap-theme.css src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap-theme.css.map src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap-theme.min.css src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap-theme.min.css.map src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap.css src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap.css.map src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap.min.css src/main/webapp/static/plugins/bootstrap-3.3.7/css/bootstrap.min.css.map src/main/webapp/static/plugins/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.eot src/main/webapp/static/plugins/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.svg src/main/webapp/static/plugins/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.ttf src/main/webapp/static/plugins/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.woff src/main/webapp/static/plugins/bootstrap-3.3.7/fonts/glyphicons-halflings-regular.woff2 src/main/webapp/static/plugins/bootstrap-3.3.7/js/bootstrap.js src/main/webapp/static/plugins/bootstrap-3.3.7/js/bootstrap.min.js src/main/webapp/static/plugins/bootstrap-3.3.7/js/npm.js src/main/webapp/static/styles/archives.css src/main/webapp/static/styles/archivesHN.css src/main/webapp/static/styles/css.css src/main/webapp/static/styles/images/archivesHN/albumbg.png src/main/webapp/static/styles/images/archivesHN/applybtnbg.png src/main/webapp/static/styles/images/archivesHN/archives_resultbg.jpg src/main/webapp/static/styles/images/archivesHN/archives_resultbg_re.jpg src/main/webapp/static/styles/images/archivesHN/archives_resultpic.png src/main/webapp/static/styles/images/archivesHN/archives_resultsc.png src/main/webapp/static/styles/images/archivesHN/archives_search_logo.png src/main/webapp/static/styles/images/archivesHN/archives_searchbg.jpg src/main/webapp/static/styles/images/archivesHN/borrow-step-line.png src/main/webapp/static/styles/images/archivesHN/borrow-step-lineH.png src/main/webapp/static/styles/images/archivesHN/borrow-title.png src/main/webapp/static/styles/images/archivesHN/font/SourceHanSansCN-Regular.ttf src/main/webapp/static/styles/images/archivesHN/font/SourceHanSansCN-Regular.woff src/main/webapp/static/styles/images/archivesHN/online-close.png src/main/webapp/static/styles/images/archivesHN/online-i.png src/main/webapp/static/styles/images/archivesHN/online-open.png src/main/webapp/static/styles/images/archivesHN/serbtn1.png src/main/webapp/static/styles/images/archivesHN/serbtn2.png src/main/webapp/static/styles/images/headerbg.jpg src/main/webapp/static/styles/images/login5i1.png src/main/webapp/static/styles/images/login5i2.png src/main/webapp/static/styles/images/login7bg.jpg src/main/webapp/static/styles/images/login7btn.png src/main/webapp/static/styles/images/login7main.png src/main/webapp/static/styles/images/login7register.jpg src/main/webapp/static/styles/images/login7registerbtn.png src/main/webapp/static/styles/images/loginbg.jpg src/main/webapp/static/styles/images/loginconbg.png src/main/webapp/static/styles/images/logini1.png src/main/webapp/static/styles/images/logini2.png src/main/webapp/static/styles/images/loginlogo-HN.png src/main/webapp/static/styles/images/logintxt.png src/main/webapp/static/styles/search.css src/main/webapp/static/styles/v2/index-blue.css